changeset 4563:835d4fce67d5

fixing green line at right side bug (reported by Nick Kurshev <nickols_k@mail.ru>)
author michael
date Thu, 07 Feb 2002 03:39:30 +0000
parents d14f1bc66a74
children 5e1221d4655e
files postproc/swscale.c
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/postproc/swscale.c	Thu Feb 07 02:32:53 2002 +0000
+++ b/postproc/swscale.c	Thu Feb 07 03:39:30 2002 +0000
@@ -671,8 +671,8 @@
 		asm volatile("emms\n\t"::: "memory"); //FIXME this shouldnt be required but it IS (even for non mmx versions)
 #endif
 
+	// Note the +1 is for the MMXscaler which reads over the end
 	*filterPos = (int16_t*)memalign(8, (dstW+1)*sizeof(int16_t));
-	(*filterPos)[dstW]=0; // the MMX scaler will read over the end 
 
 	if(ABS(xInc - 0x10000) <10) // unscaled
 	{
@@ -963,6 +963,13 @@
 			(*outFilter)[i*(*outFilterSize) + j]= (int)(filter[i*filterSize + j]*scale);
 		}
 	}
+	
+	(*filterPos)[dstW]= (*filterPos)[dstW-1]; // the MMX scaler will read over the end
+	for(i=0; i<*outFilterSize; i++)
+	{
+		int j= dstW*(*outFilterSize);
+		(*outFilter)[j + i]= (*outFilter)[j + i - (*outFilterSize)];
+	}
 
 	free(filter);
 }