[Mplayer-cvslog] CVS: main/postproc swscale.c,1.66,1.67

Michael Niedermayer michael at mplayer.dev.hu
Sun Feb 3 03:08:08 CET 2002


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

Modified Files:
	swscale.c 
Log Message:
filterPos bugfix (only nearest neighbor scaling was affected) 


Index: swscale.c
===================================================================
RCS file: /cvsroot/mplayer/main/postproc/swscale.c,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -r1.66 -r1.67
--- swscale.c	2 Feb 2002 18:18:58 -0000	1.66
+++ swscale.c	3 Feb 2002 02:08:05 -0000	1.67
@@ -689,7 +689,7 @@
 		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 @@
 		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 @@
 	/* 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;
 




More information about the MPlayer-cvslog mailing list