[FFmpeg-cvslog] r14652 - trunk/libavcodec/ra144.c

vitor subversion
Wed Aug 6 23:16:24 CEST 2008


Author: vitor
Date: Wed Aug  6 23:16:24 2008
New Revision: 14652

Log:
Simplify eval_refl(): do not store a buffer value in a var when the buffer could be used directly

Modified:
   trunk/libavcodec/ra144.c

Modified: trunk/libavcodec/ra144.c
==============================================================================
--- trunk/libavcodec/ra144.c	(original)
+++ trunk/libavcodec/ra144.c	Wed Aug  6 23:16:24 2008
@@ -236,15 +236,15 @@ static int eval_refl(int *refl, const in
     for (i=0; i < 10; i++)
         buffer2[i] = coefs[i];
 
-    u = refl[9] = bp2[9];
+    refl[9] = bp2[9];
 
-    if (u + 0x1000 > 0x1fff) {
+    if ((unsigned) bp2[9] + 0x1000 > 0x1fff) {
         av_log(ractx, AV_LOG_ERROR, "Overflow. Broken sample?\n");
         return 1;
     }
 
     for (c=8; c >= 0; c--) {
-        b = 0x1000-((u * u) >> 12);
+        b = 0x1000-((bp2[c+1] * bp2[c+1]) >> 12);
 
         if (!b)
             b = -2;
@@ -252,9 +252,9 @@ static int eval_refl(int *refl, const in
         for (u=0; u<=c; u++)
             bp1[u] = ((bp2[u] - ((refl[c+1] * bp2[c-u]) >> 12)) * (0x1000000 / b)) >> 12;
 
-        refl[c] = u = bp1[c];
+        refl[c] = bp1[c];
 
-        if ((u + 0x1000) > 0x1fff)
+        if ((unsigned) bp1[c] + 0x1000 > 0x1fff)
             return 1;
 
         FFSWAP(int *, bp1, bp2);




More information about the ffmpeg-cvslog mailing list