Mercurial > libavcodec.hg
comparison ra144.c @ 6900:9333cbdc4524 libavcodec
Rename var: add read coefficients a decent name
author | vitor |
---|---|
date | Mon, 26 May 2008 18:26:47 +0000 |
parents | 61283b6e5f73 |
children | b6e110c575ff |
comparison
equal
deleted
inserted
replaced
6899:61283b6e5f73 | 6900:9333cbdc4524 |
---|---|
206 const uint16_t *gsp, unsigned int gval, | 206 const uint16_t *gsp, unsigned int gval, |
207 int16_t *output_buffer, GetBitContext *gb) | 207 int16_t *output_buffer, GetBitContext *gb) |
208 { | 208 { |
209 uint16_t buffer_a[40]; | 209 uint16_t buffer_a[40]; |
210 uint16_t *block; | 210 uint16_t *block; |
211 int a = get_bits(gb, 7); | 211 int cba_idx = get_bits(gb, 7); // Index of the adaptative CB. 0 if none. |
212 int d = get_bits(gb, 8); | 212 int gain = get_bits(gb, 8); |
213 int b = get_bits(gb, 7); | 213 int cb1_idx = get_bits(gb, 7); |
214 int c = get_bits(gb, 7); | 214 int cb2_idx = get_bits(gb, 7); |
215 int m[3]; | 215 int m[3]; |
216 | 216 |
217 if (a) { | 217 if (cba_idx) { |
218 a += HALFBLOCK - 1; | 218 cba_idx += HALFBLOCK - 1; |
219 rotate_block(ractx->adapt_cb, buffer_a, a); | 219 rotate_block(ractx->adapt_cb, buffer_a, cba_idx); |
220 m[0] = irms(buffer_a, gval) >> 12; | 220 m[0] = irms(buffer_a, gval) >> 12; |
221 } else { | 221 } else { |
222 m[0] = 0; | 222 m[0] = 0; |
223 } | 223 } |
224 | 224 |
225 m[1] = ((ftable1[b] >> 4) * gval) >> 8; | 225 m[1] = ((ftable1[cb1_idx] >> 4) * gval) >> 8; |
226 m[2] = ((ftable2[c] >> 4) * gval) >> 8; | 226 m[2] = ((ftable2[cb2_idx] >> 4) * gval) >> 8; |
227 | 227 |
228 memmove(ractx->adapt_cb, ractx->adapt_cb + BLOCKSIZE, | 228 memmove(ractx->adapt_cb, ractx->adapt_cb + BLOCKSIZE, |
229 (BUFFERSIZE - BLOCKSIZE) * 2); | 229 (BUFFERSIZE - BLOCKSIZE) * 2); |
230 | 230 |
231 block = ractx->adapt_cb + BUFFERSIZE - BLOCKSIZE; | 231 block = ractx->adapt_cb + BUFFERSIZE - BLOCKSIZE; |
232 | 232 |
233 add_wav(d, a, m, buffer_a, etable1[b], etable2[c], block); | 233 add_wav(gain, cba_idx, m, buffer_a, etable1[cb1_idx], etable2[cb2_idx], |
234 block); | |
234 | 235 |
235 final(gsp, block, output_buffer, ractx->buffer, BLOCKSIZE); | 236 final(gsp, block, output_buffer, ractx->buffer, BLOCKSIZE); |
236 } | 237 } |
237 | 238 |
238 static int dec1(int16_t *decsp, const int *data, const int *inp, int f) | 239 static int dec1(int16_t *decsp, const int *data, const int *inp, int f) |