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

Michael Niedermayer michael at mplayer.dev.hu
Sun Dec 23 18:32:36 CET 2001


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

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


Index: downmix.c
===================================================================
RCS file: /cvsroot/mplayer/main/liba52/downmix.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- downmix.c	23 Dec 2001 17:16:07 -0000	1.5
+++ downmix.c	23 Dec 2001 17:32:34 -0000	1.6
@@ -402,11 +402,32 @@
     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 (%0, %%esi), %%xmm1	\n\t" 
+	"movaps 2048(%0, %%esi), %%xmm2	\n\t"
+	"addps %%xmm0, %%xmm1		\n\t"
+	"addps %%xmm0, %%xmm2		\n\t"
+	"movaps %%xmm1, (%0, %%esi)	\n\t"
+	"movaps %%xmm2, 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 + 256] = samples[i + 512] + common;
     }
+#endif
 }
 
 static void mix21to2 (sample_t * left, sample_t * right, sample_t bias)
@@ -670,7 +691,7 @@
 	break;
 
     case CONVERT (A52_3F2R, A52_2F1R):
-	mix3to2 (samples, bias);
+	mix3to2 (samples, bias); //FIXME possible bug? (output doesnt seem to be used)
 	move2to1 (samples + 768, samples + 512, bias);
 	break;
 




More information about the MPlayer-cvslog mailing list