Mercurial > libavcodec.hg
comparison ra144.c @ 6965:a7f6b979de4b libavcodec
Rename functions
author | vitor |
---|---|
date | Sun, 01 Jun 2008 13:17:22 +0000 |
parents | 3504fdd54fd3 |
children | 9eee8f8ff9e6 |
comparison
equal
deleted
inserted
replaced
6964:3504fdd54fd3 | 6965:a7f6b979de4b |
---|---|
71 return (ff_sqrt(x << 20) << s) << 2; | 71 return (ff_sqrt(x << 20) << s) << 2; |
72 } | 72 } |
73 | 73 |
74 /** | 74 /** |
75 * Evaluate the LPC filter coefficients from the reflection coefficients. | 75 * Evaluate the LPC filter coefficients from the reflection coefficients. |
76 * Does the inverse of the eq() function. | 76 * Does the inverse of the eval_refl() function. |
77 */ | 77 */ |
78 static void do_voice(const int *refl, int *coefs) | 78 static void eval_coefs(const int *refl, int *coefs) |
79 { | 79 { |
80 int buffer[10]; | 80 int buffer[10]; |
81 int *b1 = buffer; | 81 int *b1 = buffer; |
82 int *b2 = coefs; | 82 int *b2 = coefs; |
83 int x, y; | 83 int x, y; |
249 return rms(data, f); | 249 return rms(data, f); |
250 } | 250 } |
251 | 251 |
252 /** | 252 /** |
253 * Evaluate the reflection coefficients from the filter coefficients. | 253 * Evaluate the reflection coefficients from the filter coefficients. |
254 * Does the inverse of the do_voice() function. | 254 * Does the inverse of the eval_coefs() function. |
255 * | 255 * |
256 * @return 1 if one of the reflection coefficients is of magnitude greater than | 256 * @return 1 if one of the reflection coefficients is of magnitude greater than |
257 * 4095, 0 if not. | 257 * 4095, 0 if not. |
258 */ | 258 */ |
259 static int eq(const int16_t *coefs, int *refl) | 259 static int eval_refl(const int16_t *coefs, int *refl) |
260 { | 260 { |
261 int retval = 0; | 261 int retval = 0; |
262 int b, c, i; | 262 int b, c, i; |
263 unsigned int u; | 263 unsigned int u; |
264 int buffer1[10]; | 264 int buffer1[10]; |
310 // Interpolate block coefficients from the this frame forth block and | 310 // Interpolate block coefficients from the this frame forth block and |
311 // last frame forth block | 311 // last frame forth block |
312 for (x=0; x<30; x++) | 312 for (x=0; x<30; x++) |
313 decsp[x] = (a * ractx->lpc_coef[x] + b * ractx->lpc_coef_old[x])>> 2; | 313 decsp[x] = (a * ractx->lpc_coef[x] + b * ractx->lpc_coef_old[x])>> 2; |
314 | 314 |
315 if (eq(decsp, work)) { | 315 if (eval_refl(decsp, work)) { |
316 // The interpolated coefficients are unstable, copy either new or old | 316 // The interpolated coefficients are unstable, copy either new or old |
317 // coefficients | 317 // coefficients |
318 if (copynew) | 318 if (copynew) |
319 return dec1(decsp, ractx->lpc_refl, ractx->lpc_coef, f); | 319 return dec1(decsp, ractx->lpc_refl, ractx->lpc_coef, f); |
320 else | 320 else |
348 | 348 |
349 for (i=0; i<10; i++) | 349 for (i=0; i<10; i++) |
350 // "<< 1"? Doesn't this make one value out of two of the table useless? | 350 // "<< 1"? Doesn't this make one value out of two of the table useless? |
351 ractx->lpc_refl[i] = decodetable[i][get_bits(&gb, sizes[i]) << 1]; | 351 ractx->lpc_refl[i] = decodetable[i][get_bits(&gb, sizes[i]) << 1]; |
352 | 352 |
353 do_voice(ractx->lpc_refl, ractx->lpc_coef); | 353 eval_coefs(ractx->lpc_refl, ractx->lpc_coef); |
354 | 354 |
355 energy = decodeval[get_bits(&gb, 5) << 1]; // Useless table entries? | 355 energy = decodeval[get_bits(&gb, 5) << 1]; // Useless table entries? |
356 | 356 |
357 refl_rms[0] = dec2(ractx, gbuf2[0], 0, 0, ractx->old_energy); | 357 refl_rms[0] = dec2(ractx, gbuf2[0], 0, 0, ractx->old_energy); |
358 refl_rms[1] = dec2(ractx, gbuf2[1], 1, energy > ractx->old_energy, | 358 refl_rms[1] = dec2(ractx, gbuf2[1], 1, energy > ractx->old_energy, |