summaryrefslogtreecommitdiff
path: root/libavcodec/ra288.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-08-09 15:08:20 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-08-09 15:08:20 +0200
commitaae1c247b1cd5f17c137f5c7f357c519200b1017 (patch)
treeca604bc1fc415debec4f3b849aa4a83a8de961db /libavcodec/ra288.c
parentd5d74cf5307ba606182dbaac568f06bf20d76eff (diff)
downloadffmpeg-aae1c247b1cd5f17c137f5c7f357c519200b1017.tar.gz
ra288: avoid one multiply
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/ra288.c')
-rw-r--r--libavcodec/ra288.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/ra288.c b/libavcodec/ra288.c
index 9445e7088e..f2b97cca97 100644
--- a/libavcodec/ra288.c
+++ b/libavcodec/ra288.c
@@ -96,14 +96,14 @@ static void decode(RA288Context *ractx, float gain, int cb_coef)
for (i=0; i < 5; i++)
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 */
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);
}