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

Michael Niedermayer michael at mplayer.dev.hu
Tue Dec 25 18:19:20 CET 2001


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

Modified Files:
	downmix.c 
Log Message:
memset(?, 0, 256*sizeof(float)) in MMX


Index: downmix.c
===================================================================
RCS file: /cvsroot/mplayer/main/liba52/downmix.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- downmix.c	23 Dec 2001 17:52:27 -0000	1.7
+++ downmix.c	25 Dec 2001 17:19:18 -0000	1.8
@@ -65,7 +65,7 @@
     output = flags & A52_CHANNEL_MASK;
     if (output > A52_DOLBY)
 	return -1;
-
+    
     output = table[output][input & 7];
 
     if ((output == A52_STEREO) &&
@@ -593,9 +593,25 @@
 static void zero (sample_t * samples)
 {
     int i;
-
+#ifdef HAVE_MMX
+	asm volatile(
+		"movl $-1024, %%esi		\n\t"
+		"pxor %%mm0, %%mm0		\n\t"
+		"1:				\n\t"
+		"movq %%mm0, (%0, %%esi)	\n\t"
+		"movq %%mm0, 8(%0, %%esi)	\n\t"
+		"movq %%mm0, 16(%0, %%esi)	\n\t"
+		"movq %%mm0, 24(%0, %%esi)	\n\t"
+		"addl $32, %%esi		\n\t"
+		" jnz 1b			\n\t"
+		"emms"
+	:: "r" (samples+256)
+	: "%esi"
+	);
+#else
     for (i = 0; i < 256; i++)
 	samples[i] = 0;
+#endif
 }
 
 void downmix (sample_t * samples, int acmod, int output, sample_t bias,




More information about the MPlayer-cvslog mailing list