diff options
author | Ramiro Polla <ramiro.polla@gmail.com> | 2009-07-28 05:41:22 +0000 |
---|---|---|
committer | Ramiro Polla <ramiro.polla@gmail.com> | 2009-07-28 05:41:22 +0000 |
commit | 901775c714ee5613f819e6545c46138830e7fadd (patch) | |
tree | 7285b473fb355a5dbbc464b22128dc5df557ea1e | |
parent | cbdc08d5a638c6b09beec1c6d1ab323721ab3c41 (diff) | |
download | ffmpeg-901775c714ee5613f819e6545c46138830e7fadd.tar.gz |
MMX2 scaler: add variable to ease factorization of initMMX2Scaler().
Originally committed as revision 29452 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
-rw-r--r-- | libswscale/swscale.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 6a85a52f35..ab8c6759c9 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -1888,6 +1888,7 @@ static void initMMX2HScaler(int dstW, int xInc, uint8_t *funnyCode, int16_t *fil int b=((xpos+xInc)>>16) - xx; int c=((xpos+xInc*2)>>16) - xx; int d=((xpos+xInc*3)>>16) - xx; + int inc = (d+1<4); filter[i ] = (( xpos & 0xFFFF) ^ 0xFFFF)>>9; filter[i+1] = (((xpos+xInc ) & 0xFFFF) ^ 0xFFFF)>>9; @@ -1897,17 +1898,17 @@ static void initMMX2HScaler(int dstW, int xInc, uint8_t *funnyCode, int16_t *fil if (d+1<4) { - int maxShift= 3-(d+1); + int maxShift= 3-(d+inc); int shift=0; memcpy(funnyCode + fragmentPos, fragmentB, fragmentLengthB); funnyCode[fragmentPos + imm8OfPShufW1B]= - (a+1) | ((b+1)<<2) | ((c+1)<<4) | ((d+1)<<6); + (a+inc) | ((b+inc)<<2) | ((c+inc)<<4) | ((d+inc)<<6); funnyCode[fragmentPos + imm8OfPShufW2B]= a | (b<<2) | (c<<4) | (d<<6); - if (i+3>=dstW) shift=maxShift; //avoid overread + if (i+4-inc>=dstW) shift=maxShift; //avoid overread else if ((filterPos[i/2]&3) <= maxShift) shift=filterPos[i/2]&3; //Align if (shift && i>=shift) |