# HG changeset patch # User michael # Date 1012702085 0 # Node ID 8303419cc60fb8792e7c45bd04a318d1b65e34e6 # Parent 317df369e7e7cb3d95152a8d71b900d086cd204b filterPos bugfix (only nearest neighbor scaling was affected) diff -r 317df369e7e7 -r 8303419cc60f postproc/swscale.c --- a/postproc/swscale.c Sun Feb 03 01:42:02 2002 +0000 +++ b/postproc/swscale.c Sun Feb 03 02:08:05 2002 +0000 @@ -689,7 +689,7 @@ xDstInSrc= xInc/2 - 0x8000; for(i=0; i>16) - (filterSize>>1) + 1; + int xx= (xDstInSrc - ((filterSize-1)<<15) + (1<<15))>>16; (*filterPos)[i]= xx; filter[i]= 1.0; @@ -709,7 +709,7 @@ xDstInSrc= xInc/2 - 0x8000; for(i=0; i>16) - (filterSize>>1) + 1; + int xx= (xDstInSrc - ((filterSize-1)<<15) + (1<<15))>>16; int j; (*filterPos)[i]= xx; @@ -1125,7 +1125,8 @@ /* 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;