26 #define BITSTREAM_READER_LE
32 #define MAX_BACKWARD_FILTER_ORDER 36
33 #define MAX_BACKWARD_FILTER_LEN 40
34 #define MAX_BACKWARD_FILTER_NONREC 35
36 #define RA288_BLOCK_SIZE 5
37 #define RA288_BLOCKS_PER_FRAME 32
84 static void convolve(
float *tgt,
const float *src,
int len,
int n)
97 float *gain_block = ractx->
gain_hist + 28;
99 memmove(ractx->
sp_hist + 70, ractx->
sp_hist + 75, 36*
sizeof(*block));
103 for (i=0; i < 10; i++)
104 sum -= gain_block[9-i] * ractx->
gain_lpc[i];
107 sum = av_clipf(sum, 0, 60);
111 sumsum = exp(sum * 0.1151292546497) * gain * (1.0/(1<<23));
113 for (i=0; i < 5; i++)
114 buffer[i] =
codetable[cb_coef][i] * sumsum;
118 sum =
FFMAX(sum, 5. / (1<<24));
121 memmove(gain_block, gain_block + 1, 9 *
sizeof(*gain_block));
123 gain_block[9] = 10 * log10(sum) + (10*log10(((1<<24)/5.)) - 32);
141 int order,
int n,
int non_rec,
float *out,
142 float *hist,
float *out2,
const float *window)
155 convolve(buffer1, work + order , n , order);
156 convolve(buffer2, work + order + n, non_rec, order);
158 for (i=0; i <= order; i++) {
159 out2[i] = out2[i] * 0.5625 + buffer1[i];
160 out [i] = out2[i] + buffer2[i];
171 float *hist,
float *rec,
const float *window,
172 float *lpc,
const float *
tab,
173 int order,
int n,
int non_rec,
int move_size)
182 memmove(hist, hist + n, move_size*
sizeof(*hist));
186 int *got_frame_ptr,
AVPacket *avpkt)
189 int buf_size = avpkt->
size;
195 if (buf_size < avctx->block_align) {
197 "Error! Input buffer is too small [%d<%d]\n",
214 int cb_coef =
get_bits(&gb, 6 + (i&1));
216 decode(ractx, gain, cb_coef);