[FFmpeg-soc] [soc]: r829 - dirac/libavcodec/dirac.c

marco subversion at mplayerhq.hu
Wed Aug 15 23:10:00 CEST 2007


Author: marco
Date: Wed Aug 15 23:10:00 2007
New Revision: 829

Log:
small optimization to help the compiler unroll the loop

Modified:
   dirac/libavcodec/dirac.c

Modified: dirac/libavcodec/dirac.c
==============================================================================
--- dirac/libavcodec/dirac.c	(original)
+++ dirac/libavcodec/dirac.c	Wed Aug 15 23:10:00 2007
@@ -2160,17 +2160,13 @@ START_TIMER
     linein  = pixels;
     for (y = 0; y < height * 2; y++) {
         for (x = 10; x < outwidth - 10; x += 2) {
+            uint8_t *li1 = &linein[x];
+            uint8_t *li2 = &linein[x];
             int i;
             int val = 0;
 
-            for (i = 0; i <= 4; i++) {
-                int xpos;
-                xpos = x - 2 * i;
-                val += t[i] * linein[xpos];
-
-                xpos = x + 2 * i + 2;
-                val += t[i] * linein[xpos];
-            }
+            for (i = 0; i <= 4; i++)
+                val += t[i] * (li1[-i] + li2[-i]);
 
             val += 128;
             val >>= 8;



More information about the FFmpeg-soc mailing list