Commit f049ae26 authored by michael's avatar michael

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


git-svn-id: file:///var/local/repositories/mplayer/trunk/postproc@3783 b3059339-0415-0410-9bf9-f77b7e298cf2
parent dde70264
...@@ -1889,7 +1889,7 @@ static inline void RENAME(initFilter)(int16_t *dstFilter, int16_t *filterPos, in ...@@ -1889,7 +1889,7 @@ static inline void RENAME(initFilter)(int16_t *dstFilter, int16_t *filterPos, in
// printf("%d %d %d\n", filterSize, srcW, dstW); // printf("%d %d %d\n", filterSize, srcW, dstW);
*filterSize= (*filterSize +(filterAlign-1)) & (~(filterAlign-1)); *filterSize= (*filterSize +(filterAlign-1)) & (~(filterAlign-1));
xDstInSrc= xInc - 0x8000; xDstInSrc= xInc/2 - 0x8000;
for(i=0; i<dstW; i++) for(i=0; i<dstW; i++)
{ {
int xx= (xDstInSrc>>16) - (*filterSize>>1) + 1; int xx= (xDstInSrc>>16) - (*filterSize>>1) + 1;
...@@ -1937,10 +1937,10 @@ static inline void RENAME(initFilter)(int16_t *dstFilter, int16_t *filterPos, in ...@@ -1937,10 +1937,10 @@ static inline void RENAME(initFilter)(int16_t *dstFilter, int16_t *filterPos, in
// printf("%d %d %d\n", *filterSize, srcW, dstW); // printf("%d %d %d\n", *filterSize, srcW, dstW);
*filterSize= (*filterSize +(filterAlign-1)) & (~(filterAlign-1)); *filterSize= (*filterSize +(filterAlign-1)) & (~(filterAlign-1));
xDstInSrc= xInc - 0x8000; xDstInSrc= xInc/2 - 0x8000;
for(i=0; i<dstW; i++) 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; int j;
filterPos[i]= xx; filterPos[i]= xx;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment