[Mplayer-cvslog] CVS: main/liba52 downmix.c,1.3,1.4

Michael Niedermayer michael at mplayer.dev.hu
Sun Dec 23 18:08:35 CET 2001


Update of /cvsroot/mplayer/main/liba52
In directory mplayer:/var/tmp.root/cvs-serv19506

Modified Files:
	downmix.c 
Log Message:
mix2to1 in SSE


Index: downmix.c
===================================================================
RCS file: /cvsroot/mplayer/main/liba52/downmix.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- downmix.c	19 Dec 2001 19:35:08 -0000	1.3
+++ downmix.c	23 Dec 2001 17:08:33 -0000	1.4
@@ -305,8 +305,29 @@
 {
     int i;
 
+#ifdef HAVE_SSE
+	asm volatile(
+	"movlps %2, %%xmm7		\n\t"
+	"shufps $0x00, %%xmm7, %%xmm7	\n\t"
+	"movl $-1024, %%esi		\n\t"
+	"1:				\n\t"
+	"movaps (%0, %%esi), %%xmm0	\n\t" 
+	"movaps 16(%0, %%esi), %%xmm1	\n\t" 
+	"addps (%1, %%esi), %%xmm0	\n\t" 
+	"addps 16(%1, %%esi), %%xmm1	\n\t" 
+	"addps %%xmm7, %%xmm0		\n\t"
+	"addps %%xmm7, %%xmm1		\n\t"
+	"movaps %%xmm0, (%1, %%esi)	\n\t"
+	"movaps %%xmm1, 16(%1, %%esi)	\n\t"
+	"addl $32, %%esi		\n\t"
+	" jnz 1b			\n\t"
+	:: "r" (src+256), "r" (dest+256), "m" (bias)
+	: "%esi"
+	);
+#else
     for (i = 0; i < 256; i++)
 	dest[i] += src[i] + bias;
+#endif
 }
 
 static void mix3to1 (sample_t * samples, sample_t bias)




More information about the MPlayer-cvslog mailing list