[Mplayer-cvslog] CVS: main/liba52 downmix.c,1.6,1.7

Michael Niedermayer michael at mplayer.dev.hu
Sun Dec 23 18:52:30 CET 2001


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

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


Index: downmix.c
===================================================================
RCS file: /cvsroot/mplayer/main/liba52/downmix.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- downmix.c	23 Dec 2001 17:32:34 -0000	1.6
+++ downmix.c	23 Dec 2001 17:52:27 -0000	1.7
@@ -334,15 +334,34 @@
 {
     int i;
 
+#ifdef HAVE_SSE
+	asm volatile(
+	"movlps %1, %%xmm7		\n\t"
+	"shufps $0x00, %%xmm7, %%xmm7	\n\t"
+	"movl $-1024, %%esi		\n\t"
+	"1:				\n\t"
+	"movaps (%0, %%esi), %%xmm0	\n\t" 
+	"movaps 1024(%0, %%esi), %%xmm1	\n\t" 
+	"addps 2048(%0, %%esi), %%xmm0	\n\t" 
+	"addps %%xmm7, %%xmm1		\n\t"
+	"addps %%xmm1, %%xmm0		\n\t"
+	"movaps %%xmm0, (%0, %%esi)	\n\t"
+	"addl $16, %%esi		\n\t"
+	" jnz 1b			\n\t"
+	:: "r" (samples+256), "m" (bias)
+	: "%esi"
+	);
+#else
     for (i = 0; i < 256; i++)
 	samples[i] += samples[i + 256] + samples[i + 512] + bias;
+#endif
 }
 
 static void mix4to1 (sample_t * samples, sample_t bias)
 {
     int i;
 
-#ifdef HAVE_SSE // FIXME untested
+#ifdef HAVE_SSE
 	asm volatile(
 	"movlps %1, %%xmm7		\n\t"
 	"shufps $0x00, %%xmm7, %%xmm7	\n\t"




More information about the MPlayer-cvslog mailing list