[Mplayer-cvslog] CVS: main/postproc swscale.c,1.21,1.22 swscale.h,1.1,1.2

Nick Kurshev nickols_k at mail.ru
Sun Oct 28 20:08:09 CET 2001


Hello, Michael!
On Sun, 28 Oct 2001 19:31:31 +0100, you wrote:

> Update of /cvsroot/mplayer/main/postproc
> In directory mplayer:/var/tmp.root/cvs-serv31379/postproc
> 
> Modified Files:
> 	swscale.c swscale.h 
> Log Message:
> yv12 to yv12 scaler
> someone who knows a bit about vo_odivx could add support for it ...
> 
[snip]

I've study your stuff. Let me some minor warnings:
1. Why you don't use SFENCE?
2. Why you ignore 3DNOW optimization?

I want suggest you to make some changes:

1.
#include "../mmx_defs.h"

2.
It would be more readable to have:
-			MOVNTQ(%%mm0, (%4, %%eax, 4))\
-			MOVNTQ(%%mm2, 8(%4, %%eax, 4))\
-			MOVNTQ(%%mm1, 16(%4, %%eax, 4))\
-			MOVNTQ(%%mm3, 24(%4, %%eax, 4))\
+			MOVNTQ" %%mm0, (%4, %%eax, 4)\n\t"\
+			MOVNTQ" %%mm2, 8(%4, %%eax, 4)\n\t"\
+			MOVNTQ" %%mm1, 16(%4, %%eax, 4)\n\t"\
+			MOVNTQ" %%mm3, 24(%4, %%eax, 4)\n\t"\
(Althrough it's looks like cosmetic)
3.
-#ifdef HAVE_MMX2
-#define FUNNY_Y_CODE \
-			"prefetchnta 1024(%%esi)	\n\t"\
-			"prefetchnta 1056(%%esi)	\n\t"\
-			"prefetchnta 1088(%%esi)	\n\t"\
-			"call funnyYCode		\n\t"\
-			"movq temp0, %%mm2		\n\t"\
-			"xorl %%ecx, %%ecx		\n\t"
-#else
 #define FUNNY_Y_CODE \
+			PREFETCH" 1024(%%esi)	\n\t"\
+			PREFETCH" 1056(%%esi)	\n\t"\
+			PREFETCH" 1088(%%esi)	\n\t"\
 			"call funnyYCode		\n\t"\
 			"movq temp0, %%mm2		\n\t"\
 			"xorl %%ecx, %%ecx		\n\t"
-#endif

4.
-#ifdef HAVE_3DNOW
-	asm volatile("femms");
-#elif defined (HAVE_MMX)
-	asm volatile("emms");
-#endif
+	__asm __volatile(SFENCE:::"memory");
+	__asm __volatile(EMMS:::"memory");

5. before every C loop:
+		__asm __volatile(SFENCE:::"memory");
 #else
 //FIXME unroll C loop and dont recalculate UV
 		if(dstbpp==32 || dstbpp==24)

Best regards! Nick



More information about the MPlayer-cvslog mailing list