[FFmpeg-cvslog] r29454 - trunk/libswscale/swscale.c

ramiro subversion
Tue Jul 28 07:45:47 CEST 2009


Author: ramiro
Date: Tue Jul 28 07:45:47 2009
New Revision: 29454

Log:
MMX2 scaler: Remove {} block leftover from factorization in initMMX2Scaler().
Merge variable declarations to previous {} block and indent.

Modified:
   trunk/libswscale/swscale.c

Modified: trunk/libswscale/swscale.c
==============================================================================
--- trunk/libswscale/swscale.c	Tue Jul 28 07:42:46 2009	(r29453)
+++ trunk/libswscale/swscale.c	Tue Jul 28 07:45:47 2009	(r29454)
@@ -1893,6 +1893,8 @@ static void initMMX2HScaler(int dstW, in
             x86_reg imm8OfPShufW1  = (d+1<4) ? imm8OfPShufW1B  : imm8OfPShufW1A;
             x86_reg imm8OfPShufW2  = (d+1<4) ? imm8OfPShufW2B  : imm8OfPShufW2A;
             x86_reg fragmentLength = (d+1<4) ? fragmentLengthB : fragmentLengthA;
+            int maxShift= 3-(d+inc);
+            int shift=0;
 
             filter[i  ] = (( xpos         & 0xFFFF) ^ 0xFFFF)>>9;
             filter[i+1] = (((xpos+xInc  ) & 0xFFFF) ^ 0xFFFF)>>9;
@@ -1900,30 +1902,25 @@ static void initMMX2HScaler(int dstW, in
             filter[i+3] = (((xpos+xInc*3) & 0xFFFF) ^ 0xFFFF)>>9;
             filterPos[i/2]= xx;
 
-            {
-                int maxShift= 3-(d+inc);
-                int shift=0;
-
-                memcpy(funnyCode + fragmentPos, fragment, fragmentLength);
-
-                funnyCode[fragmentPos + imm8OfPShufW1]=
-                    (a+inc) | ((b+inc)<<2) | ((c+inc)<<4) | ((d+inc)<<6);
-                funnyCode[fragmentPos + imm8OfPShufW2]=
-                    a | (b<<2) | (c<<4) | (d<<6);
+            memcpy(funnyCode + fragmentPos, fragment, fragmentLength);
 
-                if (i+4-inc>=dstW) shift=maxShift; //avoid overread
-                else if ((filterPos[i/2]&3) <= maxShift) shift=filterPos[i/2]&3; //Align
+            funnyCode[fragmentPos + imm8OfPShufW1]=
+                (a+inc) | ((b+inc)<<2) | ((c+inc)<<4) | ((d+inc)<<6);
+            funnyCode[fragmentPos + imm8OfPShufW2]=
+                a | (b<<2) | (c<<4) | (d<<6);
 
-                if (shift && i>=shift)
-                {
-                    funnyCode[fragmentPos + imm8OfPShufW1]+= 0x55*shift;
-                    funnyCode[fragmentPos + imm8OfPShufW2]+= 0x55*shift;
-                    filterPos[i/2]-=shift;
-                }
+            if (i+4-inc>=dstW) shift=maxShift; //avoid overread
+            else if ((filterPos[i/2]&3) <= maxShift) shift=filterPos[i/2]&3; //Align
 
-                fragmentPos+= fragmentLength;
+            if (shift && i>=shift)
+            {
+                funnyCode[fragmentPos + imm8OfPShufW1]+= 0x55*shift;
+                funnyCode[fragmentPos + imm8OfPShufW2]+= 0x55*shift;
+                filterPos[i/2]-=shift;
             }
 
+            fragmentPos+= fragmentLength;
+
             funnyCode[fragmentPos]= RET;
         }
         xpos+=xInc;



More information about the ffmpeg-cvslog mailing list