[Mplayer-cvslog] CVS: main/liba52 downmix.c,1.1,1.2

Michael Niedermayer michael at mplayer.dev.hu
Wed Dec 19 19:58:12 CET 2001


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

Modified Files:
	downmix.c 
Log Message:
sse opt of mix32to2() 


Index: downmix.c
===================================================================
RCS file: /cvsroot/mplayer/main/liba52/downmix.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- downmix.c	9 Dec 2001 15:28:44 -0000	1.1
+++ downmix.c	19 Dec 2001 18:58:05 -0000	1.2
@@ -411,11 +411,33 @@
     int i;
     sample_t common;
 
+#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 1024(%0, %%esi), %%xmm0	\n\t" 
+	"addps %%xmm7, %%xmm0		\n\t" // common
+	"movaps %%xmm0, %%xmm1		\n\t" // common
+	"addps (%0, %%esi), %%xmm0	\n\t" 
+	"addps 2048(%0, %%esi), %%xmm1	\n\t" 
+	"addps 3072(%0, %%esi), %%xmm0	\n\t" 
+	"addps 4096(%0, %%esi), %%xmm1	\n\t" 
+	"movaps %%xmm0, (%0, %%esi)	\n\t"
+	"movaps %%xmm1, 1024(%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++) {
 	common = samples[i + 256] + bias;
 	samples[i] += common + samples[i + 768];
 	samples[i + 256] = common + samples[i + 512] + samples[i + 1024];
     }
+#endif
 }
 
 static void mix32toS (sample_t * samples, sample_t bias)




More information about the MPlayer-cvslog mailing list