1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

output shifted by a few pixels on extreem scalings bugfix

filterPos was wrong by 0.5 pixels on downscale with -sws 1 and 2 bugfix

Originally committed as revision 3783 to svn://svn.mplayerhq.hu/mplayer/trunk/postproc
This commit is contained in:
Michael Niedermayer 2001-12-27 00:57:32 +00:00
parent 6ec6e3c963
commit f15afacdf4

View File

@ -1889,7 +1889,7 @@ static inline void RENAME(initFilter)(int16_t *dstFilter, int16_t *filterPos, in
// printf("%d %d %d\n", filterSize, srcW, dstW);
*filterSize= (*filterSize +(filterAlign-1)) & (~(filterAlign-1));
xDstInSrc= xInc - 0x8000;
xDstInSrc= xInc/2 - 0x8000;
for(i=0; i<dstW; i++)
{
int xx= (xDstInSrc>>16) - (*filterSize>>1) + 1;
@ -1937,10 +1937,10 @@ static inline void RENAME(initFilter)(int16_t *dstFilter, int16_t *filterPos, in
// printf("%d %d %d\n", *filterSize, srcW, dstW);
*filterSize= (*filterSize +(filterAlign-1)) & (~(filterAlign-1));
xDstInSrc= xInc - 0x8000;
xDstInSrc= xInc/2 - 0x8000;
for(i=0; i<dstW; i++)
{
int xx= (int)((double)xDstInSrc/(double)(1<<16) - *filterSize*0.5 + 0.5);
int xx= (int)((double)xDstInSrc/(double)(1<<16) - ((*filterSize)-1)*0.5 + 0.5);
int j;
filterPos[i]= xx;