changeset 3907:6312aa265429

pass accel flags to a52_resample_init
author arpi
date Sun, 30 Dec 2001 20:42:49 +0000
parents 7f54bf9796c5
children 0cc94b1eec0f
files dec_audio.c liba52/a52.h liba52/resample.c liba52/resample_c.c liba52/resample_mmx.c
diffstat 5 files changed, 13 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/dec_audio.c	Sun Dec 30 20:32:57 2001 +0000
+++ b/dec_audio.c	Sun Dec 30 20:42:49 2001 +0000
@@ -33,8 +33,10 @@
 #endif
 
 #include "liba52/a52.h"
+#include "liba52/mm_accel.h"
 static sample_t * a52_samples;
 static a52_state_t a52_state;
+static uint32_t a52_accel=0;
 
 #ifdef USE_G72X
 #include "g72x/g72x.h"
@@ -536,12 +538,11 @@
 }
 case AFM_A52: {
   // Dolby AC3 audio:
-  int accel=0; // should contain mmx/sse/etc flags
-  if(gCpuCaps.hasSSE) accel|=MM_ACCEL_X86_SSE;
-  if(gCpuCaps.hasMMX) accel|=MM_ACCEL_X86_MMX;
-  if(gCpuCaps.hasMMX2) accel|=MM_ACCEL_X86_MMXEXT;
-  if(gCpuCaps.has3DNow) accel|=MM_ACCEL_X86_3DNOW;
-  a52_samples=a52_init (accel);
+  if(gCpuCaps.hasSSE) a52_accel|=MM_ACCEL_X86_SSE;
+  if(gCpuCaps.hasMMX) a52_accel|=MM_ACCEL_X86_MMX;
+  if(gCpuCaps.hasMMX2) a52_accel|=MM_ACCEL_X86_MMXEXT;
+  if(gCpuCaps.has3DNow) a52_accel|=MM_ACCEL_X86_3DNOW;
+  a52_samples=a52_init (a52_accel);
   if (a52_samples == NULL) {
 	mp_msg(MSGT_DECAUDIO,MSGL_ERR,"A52 init failed\n");
 	driver=0;break;
@@ -562,8 +563,7 @@
 }
 case AFM_HWAC3: {
   // Dolby AC3 passthrough:
-  int accel=0; // should contain mmx/sse/etc flags
-  a52_samples=a52_init (accel);
+  a52_samples=a52_init (a52_accel);
   if (a52_samples == NULL) {
        mp_msg(MSGT_DECAUDIO,MSGL_ERR,"A52 init failed\n");
        driver=0;break;
@@ -1144,7 +1144,7 @@
 	// a52_dynrng (&state, NULL, NULL); // disable dynamic range compensation
 
 	// frame decoded, let's resample:
-	a52_resample_init(flags,sh_audio->channels);
+	a52_resample_init(a52_accel,flags,sh_audio->channels);
 	len=0;
 	for (i = 0; i < 6; i++) {
 	    if (a52_block (&a52_state, a52_samples)){
--- a/liba52/a52.h	Sun Dec 30 20:32:57 2001 +0000
+++ b/liba52/a52.h	Sun Dec 30 20:42:49 2001 +0000
@@ -119,7 +119,7 @@
 		 sample_t (* call) (sample_t, void *), void * data);
 int a52_block (a52_state_t * state, sample_t * samples);
 
-void a52_resample_init(int _flags,int _chans);
+void a52_resample_init(uint32_t mm_accel,int _flags,int _chans);
 extern int (* a52_resample) (float * _f, int16_t * s16);
 
 uint16_t crc16_block(uint8_t *data,uint32_t num_bytes);
--- a/liba52/resample.c	Sun Dec 30 20:32:57 2001 +0000
+++ b/liba52/resample.c	Sun Dec 30 20:42:49 2001 +0000
@@ -586,7 +586,7 @@
 }
 #endif //arch_x86
 
-void a52_resample_init(int _flags,int _chans){
+void a52_resample_init(uint32_t mm_accel,int _flags,int _chans){
     chans=_chans;
     flags=_flags;
 
--- a/liba52/resample_c.c	Sun Dec 30 20:32:57 2001 +0000
+++ b/liba52/resample_c.c	Sun Dec 30 20:42:49 2001 +0000
@@ -586,7 +586,7 @@
 }
 #endif //arch_x86
 
-void a52_resample_init(int _flags,int _chans){
+void a52_resample_init(uint32_t mm_accel,int _flags,int _chans){
     chans=_chans;
     flags=_flags;
 
--- a/liba52/resample_mmx.c	Sun Dec 30 20:32:57 2001 +0000
+++ b/liba52/resample_mmx.c	Sun Dec 30 20:42:49 2001 +0000
@@ -586,7 +586,7 @@
 }
 #endif //arch_x86
 
-void a52_resample_init(int _flags,int _chans){
+void a52_resample_init(uint32_t mm_accel,int _flags,int _chans){
     chans=_chans;
     flags=_flags;