diff options
author | 2002-02-03 02:08:05 +0000 | |
---|---|---|
committer | 2002-02-03 02:08:05 +0000 | |
commit | 420039c5f5833fea1b2e32ec95ccd9f8b4e791bf (patch) | |
tree | 170135fe5565338530bf695afa9c21da8a3fe0ff | |
parent | 70af3967c4eba2ce8391764adf0edcfdeb53409e (diff) |
filterPos bugfix (only nearest neighbor scaling was affected)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4493 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | postproc/swscale.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/postproc/swscale.c b/postproc/swscale.c index c734a56ff8..a1bccd321f 100644 --- a/postproc/swscale.c +++ b/postproc/swscale.c @@ -689,7 +689,7 @@ static inline void initFilter(int16_t **outFilter, int16_t **filterPos, int *out xDstInSrc= xInc/2 - 0x8000; 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; filter[i]= 1.0; @@ -709,7 +709,7 @@ static inline void initFilter(int16_t **outFilter, int16_t **filterPos, int *out xDstInSrc= xInc/2 - 0x8000; for(i=0; i<dstW; i++) { - int xx= (xDstInSrc>>16) - (filterSize>>1) + 1; + int xx= (xDstInSrc - ((filterSize-1)<<15) + (1<<15))>>16; int j; (*filterPos)[i]= xx; @@ -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 */ if(srcFormat==IMGFMT_IYUV) srcFormat=IMGFMT_I420; if(srcFormat==IMGFMT_Y8) srcFormat=IMGFMT_Y800; - + if(dstFormat==IMGFMT_Y8) dstFormat=IMGFMT_Y800; + if(!isSupportedIn(srcFormat)) return NULL; if(!isSupportedOut(dstFormat)) return NULL; |