[Mplayer-cvslog] CVS: main/liba52 downmix.c,1.12,1.13 parse.c,1.1,1.2 a52_internal.h,1.2,1.3

Michael Niedermayer michael at mplayer.dev.hu
Sun Dec 30 22:53:59 CET 2001


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

Modified Files:
	downmix.c parse.c a52_internal.h 
Log Message:
runtime cpudetect the liba52 way part 2 (downmix.c)


Index: downmix.c
===================================================================
RCS file: /cvsroot/mplayer/main/liba52/downmix.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- downmix.c	30 Dec 2001 19:57:14 -0000	1.12
+++ downmix.c	30 Dec 2001 21:53:56 -0000	1.13
@@ -24,18 +24,16 @@
  */
 
 #include "config.h"
-#include "../cpudetect.h"
 
 #include <string.h>
 #include <inttypes.h>
 
 #include "a52.h"
 #include "a52_internal.h"
+#include "mm_accel.h"
 
 #define CONVERT(acmod,output) (((output) << 3) + (acmod))
 
-//#undef HAVE_SSE
-//#undef HAVE_MMX
 
 void (*downmix)(sample_t * samples, int acmod, int output, sample_t bias,
 	      sample_t clev, sample_t slev)= NULL;
@@ -47,7 +45,17 @@
 	      sample_t clev, sample_t slev);
 static void upmix_MMX (sample_t * samples, int acmod, int output);
 static void upmix_C (sample_t * samples, int acmod, int output);
-      
+
+void downmix_accel_init(uint32_t mm_accel)
+{
+    upmix= upmix_C;
+    downmix= downmix_C;
+#ifdef ARCH_X86    
+    if(mm_accel & MM_ACCEL_X86_MMX) upmix= upmix_MMX;
+    if(mm_accel & MM_ACCEL_X86_SSE) downmix= downmix_SSE;
+#endif
+}
+   
 int downmix_init (int input, int flags, sample_t * level,
 		  sample_t clev, sample_t slev)
 {
@@ -76,13 +84,6 @@
 	 A52_DOLBY,	A52_DOLBY,	A52_DOLBY,	A52_DOLBY}
     };
     int output;
-
-    upmix= upmix_C;
-    downmix= downmix_C;
-#ifdef ARCH_X86    
-    if(gCpuCaps.hasMMX) upmix= upmix_MMX;
-    if(gCpuCaps.hasSSE) downmix= downmix_SSE;
-#endif
 
     output = flags & A52_CHANNEL_MASK;
     if (output > A52_DOLBY)

Index: parse.c
===================================================================
RCS file: /cvsroot/mplayer/main/liba52/parse.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- parse.c	9 Dec 2001 15:28:44 -0000	1.1
+++ parse.c	30 Dec 2001 21:53:56 -0000	1.2
@@ -57,6 +57,7 @@
     int i;
 
     imdct_init (mm_accel);
+    downmix_accel_init(mm_accel);
 
     samples = memalign (16, 256 * 12 * sizeof (sample_t));
     if (samples == NULL)

Index: a52_internal.h
===================================================================
RCS file: /cvsroot/mplayer/main/liba52/a52_internal.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- a52_internal.h	30 Dec 2001 19:57:14 -0000	1.2
+++ a52_internal.h	30 Dec 2001 21:53:56 -0000	1.3
@@ -43,6 +43,7 @@
 
 int downmix_init (int input, int flags, sample_t * level,
 		  sample_t clev, sample_t slev);
+void downmix_accel_init(uint32_t mm_accel);
 int downmix_coeff (sample_t * coeff, int acmod, int output, sample_t level,
 		   sample_t clev, sample_t slev);
 extern void (*downmix) (sample_t * samples, int acmod, int output, sample_t bias,




More information about the MPlayer-cvslog mailing list