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

vitor subversion
Wed Sep 24 22:03:58 CEST 2008


Author: vitor
Date: Wed Sep 24 22:03:58 2008
New Revision: 15402

Log:
Simplify: move division by constant off the loop


Modified:
   trunk/libavcodec/ra288.c

Modified: trunk/libavcodec/ra288.c
==============================================================================
--- trunk/libavcodec/ra288.c	(original)
+++ trunk/libavcodec/ra288.c	Wed Sep 24 22:03:58 2008
@@ -88,10 +88,11 @@ static void decode(RA288Context *ractx, 
     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;
 




More information about the ffmpeg-cvslog mailing list