Commit 8a01d20c authored by Michael Niedermayer's avatar Michael Niedermayer

filterPos bugfix (only nearest neighbor scaling was affected)

Originally committed as revision 4493 to svn://svn.mplayerhq.hu/mplayer/trunk/postproc
parent 6ff0ad6b
...@@ -689,7 +689,7 @@ static inline void initFilter(int16_t **outFilter, int16_t **filterPos, int *out ...@@ -689,7 +689,7 @@ static inline void initFilter(int16_t **outFilter, int16_t **filterPos, int *out
xDstInSrc= xInc/2 - 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 - ((filterSize-1)<<15) + (1<<15))>>16;
(*filterPos)[i]= xx; (*filterPos)[i]= xx;
filter[i]= 1.0; filter[i]= 1.0;
...@@ -709,7 +709,7 @@ static inline void initFilter(int16_t **outFilter, int16_t **filterPos, int *out ...@@ -709,7 +709,7 @@ static inline void initFilter(int16_t **outFilter, int16_t **filterPos, int *out
xDstInSrc= xInc/2 - 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 - ((filterSize-1)<<15) + (1<<15))>>16;
int j; int j;
(*filterPos)[i]= xx; (*filterPos)[i]= xx;
...@@ -1125,7 +1125,8 @@ SwsContext *getSwsContext(int srcW, int srcH, int srcFormat, int dstW, int dstH, ...@@ -1125,7 +1125,8 @@ SwsContext *getSwsContext(int srcW, int srcH, int srcFormat, int dstW, int dstH,
/* avoid dupplicate Formats, so we dont need to check to much */ /* avoid dupplicate Formats, so we dont need to check to much */
if(srcFormat==IMGFMT_IYUV) srcFormat=IMGFMT_I420; if(srcFormat==IMGFMT_IYUV) srcFormat=IMGFMT_I420;
if(srcFormat==IMGFMT_Y8) srcFormat=IMGFMT_Y800; if(srcFormat==IMGFMT_Y8) srcFormat=IMGFMT_Y800;
if(dstFormat==IMGFMT_Y8) dstFormat=IMGFMT_Y800;
if(!isSupportedIn(srcFormat)) return NULL; if(!isSupportedIn(srcFormat)) return NULL;
if(!isSupportedOut(dstFormat)) return NULL; if(!isSupportedOut(dstFormat)) return NULL;
......
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