forked from FFmpeg/FFmpeg
The function dec1() do two completly unrelated things. Split the rms calculation out of it.
Originally committed as revision 13604 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
ce3d365f2f
commit
50b8f2cf1c
1 changed files with 11 additions and 9 deletions
|
@ -239,14 +239,12 @@ static void do_output_subblock(RA144Context *ractx,
|
||||||
final(lpc_coefs, block, output_buffer, ractx->buffer, BLOCKSIZE);
|
final(lpc_coefs, block, output_buffer, ractx->buffer, BLOCKSIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dec1(int16_t *decsp, const int *data, const int *inp, int f)
|
static void dec1(int16_t *decsp, const int *inp)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i=0; i<30; i++)
|
for (i=0; i<30; i++)
|
||||||
*(decsp++) = *(inp++);
|
*(decsp++) = *(inp++);
|
||||||
|
|
||||||
return rms(data, f);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -315,10 +313,13 @@ static int dec2(RA144Context *ractx, int16_t *decsp, int block_num,
|
||||||
if (eval_refl(decsp, work)) {
|
if (eval_refl(decsp, work)) {
|
||||||
// The interpolated coefficients are unstable, copy either new or old
|
// The interpolated coefficients are unstable, copy either new or old
|
||||||
// coefficients
|
// coefficients
|
||||||
if (copynew)
|
if (copynew) {
|
||||||
return dec1(decsp, ractx->lpc_refl, ractx->lpc_coef, f);
|
dec1(decsp, ractx->lpc_coef);
|
||||||
else
|
return rms(ractx->lpc_refl, f);
|
||||||
return dec1(decsp, ractx->lpc_refl_old, ractx->lpc_coef_old, f);
|
} else {
|
||||||
|
dec1(decsp, ractx->lpc_coef_old);
|
||||||
|
return rms(ractx->lpc_refl_old, f);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return rms(work, f);
|
return rms(work, f);
|
||||||
}
|
}
|
||||||
|
@ -358,8 +359,9 @@ static int ra144_decode_frame(AVCodecContext * avctx,
|
||||||
refl_rms[1] = dec2(ractx, block_coefs[1], 1, energy > ractx->old_energy,
|
refl_rms[1] = dec2(ractx, block_coefs[1], 1, energy > ractx->old_energy,
|
||||||
t_sqrt(energy*ractx->old_energy) >> 12);
|
t_sqrt(energy*ractx->old_energy) >> 12);
|
||||||
refl_rms[2] = dec2(ractx, block_coefs[2], 2, 1, energy);
|
refl_rms[2] = dec2(ractx, block_coefs[2], 2, 1, energy);
|
||||||
refl_rms[3] = dec1(block_coefs[3], ractx->lpc_refl, ractx->lpc_coef,
|
refl_rms[3] = rms(ractx->lpc_refl, energy);
|
||||||
energy);
|
|
||||||
|
dec1(block_coefs[3], ractx->lpc_coef);
|
||||||
|
|
||||||
/* do output */
|
/* do output */
|
||||||
for (c=0; c<4; c++) {
|
for (c=0; c<4; c++) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue