OSDN Git Service

Revert r14218. FFMAX is a macro, so
authorVitor Sessak <vitor1001@gmail.com>
Mon, 14 Jul 2008 14:41:01 +0000 (14:41 +0000)
committerVitor Sessak <vitor1001@gmail.com>
Mon, 14 Jul 2008 14:41:01 +0000 (14:41 +0000)
   sum = FFMAX(1, scalar_product(...));
might calculate the scalar product twice, which is slower.

Originally committed as revision 14230 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/ra288.c

index 0a1d2e4..60e9854 100644 (file)
@@ -69,7 +69,9 @@ static void decode(Real288_internal *glob, float gain, int cb_coef)
     for (x=0; x < 5; x++)
         buffer[x] = codetable[cb_coef][x] * sumsum;
 
-    sum = FFMAX(1, scalar_product_float(buffer, buffer, 5) / 5);
+    sum = scalar_product_float(buffer, buffer, 5) / 5;
+
+    sum = FFMAX(sum, 1);
 
     /* shift and store */
     memmove(glob->lhist, glob->lhist - 1, 10 * sizeof(*glob->lhist));