comparison ra144.c @ 7830:3da762190370 libavcodec

Pass directly variable 'a' to interp instead of evaluating it from num_blocks
author vitor
date Mon, 08 Sep 2008 18:18:29 +0000
parents 7640294af313
children b9a26c7e64ef
comparison
equal deleted inserted replaced
7829:7640294af313 7830:3da762190370
256 FFSWAP(int *, bp1, bp2); 256 FFSWAP(int *, bp1, bp2);
257 } 257 }
258 return 0; 258 return 0;
259 } 259 }
260 260
261 static int interp(RA144Context *ractx, int16_t *out, int block_num, 261 static int interp(RA144Context *ractx, int16_t *out, int a,
262 int copyold, int energy) 262 int copyold, int energy)
263 { 263 {
264 int work[10]; 264 int work[10];
265 int a = block_num + 1;
266 int b = NBLOCKS - a; 265 int b = NBLOCKS - a;
267 int i; 266 int i;
268 267
269 // Interpolate block coefficients from the this frame forth block and 268 // Interpolate block coefficients from the this frame forth block and
270 // last frame forth block 269 // last frame forth block
313 eval_coefs(ractx->lpc_coef[0], lpc_refl); 312 eval_coefs(ractx->lpc_coef[0], lpc_refl);
314 ractx->lpc_refl_rms[0] = rms(lpc_refl); 313 ractx->lpc_refl_rms[0] = rms(lpc_refl);
315 314
316 energy = energy_tab[get_bits(&gb, 5)]; 315 energy = energy_tab[get_bits(&gb, 5)];
317 316
318 refl_rms[0] = interp(ractx, block_coefs[0], 0, 1, ractx->old_energy); 317 refl_rms[0] = interp(ractx, block_coefs[0], 1, 1, ractx->old_energy);
319 refl_rms[1] = interp(ractx, block_coefs[1], 1, energy <= ractx->old_energy, 318 refl_rms[1] = interp(ractx, block_coefs[1], 2, energy <= ractx->old_energy,
320 t_sqrt(energy*ractx->old_energy) >> 12); 319 t_sqrt(energy*ractx->old_energy) >> 12);
321 refl_rms[2] = interp(ractx, block_coefs[2], 2, 0, energy); 320 refl_rms[2] = interp(ractx, block_coefs[2], 3, 0, energy);
322 refl_rms[3] = rescale_rms(ractx->lpc_refl_rms[0], energy); 321 refl_rms[3] = rescale_rms(ractx->lpc_refl_rms[0], energy);
323 322
324 int_to_int16(block_coefs[3], ractx->lpc_coef[0]); 323 int_to_int16(block_coefs[3], ractx->lpc_coef[0]);
325 324
326 for (i=0; i < 4; i++) { 325 for (i=0; i < 4; i++) {