changeset 3782:3e53c3991170

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
author michael
date Thu, 27 Dec 2001 00:57:32 +0000
parents 3a2bd7d449f7
children de6b00131e95
files postproc/swscale_template.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/postproc/swscale_template.c	Thu Dec 27 00:37:03 2001 +0000
+++ b/postproc/swscale_template.c	Thu Dec 27 00:57:32 2001 +0000
@@ -1889,7 +1889,7 @@
 //		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 @@
 //		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;