diff options
author | Vitor Sessak <vitor1001@gmail.com> | 2008-09-25 20:03:57 +0000 |
---|---|---|
committer | Vitor Sessak <vitor1001@gmail.com> | 2008-09-25 20:03:57 +0000 |
commit | 64e4af2ac19e7146080bf6aa2220cc2611943d1f (patch) | |
tree | fbfb1a808b67b1a784e7af944286cbcc54ebf664 | |
parent | 68997192ebad66fa2e068af622ee34dfea37f297 (diff) | |
download | ffmpeg-64e4af2ac19e7146080bf6aa2220cc2611943d1f.tar.gz |
Do instead of divising a float by a constant, multiply by its inverse
Originally committed as revision 15417 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/ra288.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/ra288.c b/libavcodec/ra288.c index 11d5e4c6ec..c4d430edaf 100644 --- a/libavcodec/ra288.c +++ b/libavcodec/ra288.c @@ -96,12 +96,12 @@ static void decode(RA288Context *ractx, float gain, int cb_coef) /* block 48 of G.728 spec */ /* exp(sum * 0.1151292546497) == pow(10.0,sum/20) */ - sumsum = exp(sum * 0.1151292546497) * gain / (2048 * 4096); + sumsum = exp(sum * 0.1151292546497) * gain * (1.0/(1<<23)); for (i=0; i < 5; i++) buffer[i] = codetable[cb_coef][i] * sumsum; - sum = (4096 * 4096) * scalar_product_float(buffer, buffer, 5) / 5; + sum = scalar_product_float(buffer, buffer, 5) * ((1<<24)/5.); sum = FFMAX(sum, 1); |