[Mplayer-cvslog] CVS: main/postproc swscale_template.c,1.54,1.55

Michael Niedermayer michael at mplayer.dev.hu
Thu Dec 27 01:57:34 CET 2001


Update of /cvsroot/mplayer/main/postproc
In directory mplayer:/var/tmp.root/cvs-serv22914/postproc

Modified Files:
	swscale_template.c 
Log Message:
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


Index: swscale_template.c
===================================================================
RCS file: /cvsroot/mplayer/main/postproc/swscale_template.c,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -r1.54 -r1.55
--- swscale_template.c	25 Dec 2001 15:03:36 -0000	1.54
+++ swscale_template.c	27 Dec 2001 00:57:32 -0000	1.55
@@ -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;




More information about the MPlayer-cvslog mailing list