1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-13 21:28:01 +02:00

ra288: avoid one multiply

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2011-08-09 15:08:20 +02:00
parent d5d74cf530
commit aae1c247b1

View File

@ -96,14 +96,14 @@ static void decode(RA288Context *ractx, float gain, int cb_coef)
for (i=0; i < 5; i++) for (i=0; i < 5; i++)
buffer[i] = codetable[cb_coef][i] * sumsum; buffer[i] = codetable[cb_coef][i] * sumsum;
sum = ff_dot_productf(buffer, buffer, 5) * ((1<<24)/5.); sum = ff_dot_productf(buffer, buffer, 5);
sum = FFMAX(sum, 1); sum = FFMAX(sum, 5. / (1<<24));
/* shift and store */ /* shift and store */
memmove(gain_block, gain_block + 1, 9 * sizeof(*gain_block)); memmove(gain_block, gain_block + 1, 9 * sizeof(*gain_block));
gain_block[9] = 10 * log10(sum) - 32; gain_block[9] = 10 * log10(sum) + (10*log10(((1<<24)/5.)) - 32);
ff_celp_lp_synthesis_filterf(block, ractx->sp_lpc, buffer, 5, 36); ff_celp_lp_synthesis_filterf(block, ractx->sp_lpc, buffer, 5, 36);
} }