1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00
Originally committed as revision 29512 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
This commit is contained in:
Ramiro Polla 2009-08-13 19:03:14 +00:00
parent f51fb686de
commit 737cbcde08

View File

@ -1871,39 +1871,39 @@ static int initMMX2HScaler(int dstW, int xInc, uint8_t *filterCode, int16_t *fil
int shift=0; int shift=0;
if (filterCode) { if (filterCode) {
filter[i ] = (( xpos & 0xFFFF) ^ 0xFFFF)>>9; filter[i ] = (( xpos & 0xFFFF) ^ 0xFFFF)>>9;
filter[i+1] = (((xpos+xInc ) & 0xFFFF) ^ 0xFFFF)>>9; filter[i+1] = (((xpos+xInc ) & 0xFFFF) ^ 0xFFFF)>>9;
filter[i+2] = (((xpos+xInc*2) & 0xFFFF) ^ 0xFFFF)>>9; filter[i+2] = (((xpos+xInc*2) & 0xFFFF) ^ 0xFFFF)>>9;
filter[i+3] = (((xpos+xInc*3) & 0xFFFF) ^ 0xFFFF)>>9; filter[i+3] = (((xpos+xInc*3) & 0xFFFF) ^ 0xFFFF)>>9;
filterPos[i/2]= xx; filterPos[i/2]= xx;
memcpy(filterCode + fragmentPos, fragment, fragmentLength); memcpy(filterCode + fragmentPos, fragment, fragmentLength);
filterCode[fragmentPos + imm8OfPShufW1]= filterCode[fragmentPos + imm8OfPShufW1]=
(a+inc) | ((b+inc)<<2) | ((c+inc)<<4) | ((d+inc)<<6); (a+inc) | ((b+inc)<<2) | ((c+inc)<<4) | ((d+inc)<<6);
filterCode[fragmentPos + imm8OfPShufW2]= filterCode[fragmentPos + imm8OfPShufW2]=
a | (b<<2) | (c<<4) | (d<<6); a | (b<<2) | (c<<4) | (d<<6);
if (i+4-inc>=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 else if ((filterPos[i/2]&3) <= maxShift) shift=filterPos[i/2]&3; //Align
if (shift && i>=shift) if (shift && i>=shift)
{ {
filterCode[fragmentPos + imm8OfPShufW1]+= 0x55*shift; filterCode[fragmentPos + imm8OfPShufW1]+= 0x55*shift;
filterCode[fragmentPos + imm8OfPShufW2]+= 0x55*shift; filterCode[fragmentPos + imm8OfPShufW2]+= 0x55*shift;
filterPos[i/2]-=shift; filterPos[i/2]-=shift;
} }
} }
fragmentPos+= fragmentLength; fragmentPos+= fragmentLength;
if (filterCode) if (filterCode)
filterCode[fragmentPos]= RET; filterCode[fragmentPos]= RET;
} }
xpos+=xInc; xpos+=xInc;
} }
if (filterCode) if (filterCode)
filterPos[((i/2)+1)&(~1)]= xpos>>16; // needed to jump to the next part filterPos[((i/2)+1)&(~1)]= xpos>>16; // needed to jump to the next part
return fragmentPos + 1; return fragmentPos + 1;
} }