[FFmpeg-cvslog] r15417 - trunk/libavcodec/ra288.c

vitor subversion
Thu Sep 25 22:03:58 CEST 2008


Author: vitor
Date: Thu Sep 25 22:03:57 2008
New Revision: 15417

Log:
Do instead of divising a float by a constant, multiply by its inverse


Modified:
   trunk/libavcodec/ra288.c

Modified: trunk/libavcodec/ra288.c
==============================================================================
--- trunk/libavcodec/ra288.c	(original)
+++ trunk/libavcodec/ra288.c	Thu Sep 25 22:03:57 2008
@@ -96,12 +96,12 @@ static void decode(RA288Context *ractx, 
 
     /* 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);
 




More information about the ffmpeg-cvslog mailing list