summaryrefslogtreecommitdiff
path: root/libavcodec/ra288.c
diff options
context:
space:
mode:
authorVitor Sessak <vitor1001@gmail.com>2008-09-24 20:03:58 +0000
committerVitor Sessak <vitor1001@gmail.com>2008-09-24 20:03:58 +0000
commita987a126fd29bb234e82a7ea699d4ca3326c684c (patch)
tree39c70319dd22dbee3c314a575f8b711713e34e00 /libavcodec/ra288.c
parent4e240985d8b856e62e4e0377283138cf51cc398e (diff)
downloadffmpeg-a987a126fd29bb234e82a7ea699d4ca3326c684c.tar.gz
Simplify: move division by constant off the loop
Originally committed as revision 15402 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/ra288.c')
-rw-r--r--libavcodec/ra288.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/ra288.c b/libavcodec/ra288.c
index f7e1af55a0..bfc2b37665 100644
--- a/libavcodec/ra288.c
+++ b/libavcodec/ra288.c
@@ -88,10 +88,11 @@ static void decode(RA288Context *ractx, float gain, int cb_coef)
sum = av_clipf(sum, 0, 60);
/* block 48 of G.728 spec */
- sumsum = exp(sum * 0.1151292546497) * gain; /* pow(10.0,sum/20)*gain */
+ /* exp(sum * 0.1151292546497) == pow(10.0,sum/20) */
+ sumsum = exp(sum * 0.1151292546497) * gain / 2048.;
for (i=0; i < 5; i++)
- buffer[i] = codetable[cb_coef][i] * sumsum * (1./2048.);
+ buffer[i] = codetable[cb_coef][i] * sumsum;
sum = scalar_product_float(buffer, buffer, 5) / 5;