2001-12-09 19:23:15 +00:00
|
|
|
|
|
|
|
// a52_resample_init should find the requested converter (from type flags ->
|
|
|
|
// given number of channels) and set up some function pointers...
|
|
|
|
|
|
|
|
// a52_resample() should do the conversion.
|
|
|
|
|
|
|
|
#include <inttypes.h>
|
2001-12-19 20:20:06 +00:00
|
|
|
#include <stdio.h>
|
2001-12-09 19:23:15 +00:00
|
|
|
#include "a52.h"
|
2001-12-30 21:38:53 +00:00
|
|
|
#include "mm_accel.h"
|
2001-12-17 19:33:19 +00:00
|
|
|
#include "../config.h"
|
2002-01-19 05:12:34 +00:00
|
|
|
#include "mangle.h"
|
2001-12-17 19:33:19 +00:00
|
|
|
|
2001-12-19 20:20:06 +00:00
|
|
|
int (* a52_resample) (float * _f, int16_t * s16)=NULL;
|
|
|
|
|
2001-12-30 21:44:10 +00:00
|
|
|
#include "resample_c.c"
|
|
|
|
|
2001-12-19 20:20:06 +00:00
|
|
|
#ifdef ARCH_X86
|
2001-12-30 21:44:10 +00:00
|
|
|
#include "resample_mmx.c"
|
2001-12-17 19:33:19 +00:00
|
|
|
#endif
|
2001-12-09 19:23:15 +00:00
|
|
|
|
2004-01-25 18:29:11 +00:00
|
|
|
#ifdef HAVE_ALTIVEC
|
|
|
|
#include "resample_altivec.c"
|
|
|
|
#endif
|
|
|
|
|
2001-12-30 21:44:10 +00:00
|
|
|
void* a52_resample_init(uint32_t mm_accel,int flags,int chans){
|
|
|
|
void* tmp;
|
2001-12-09 19:23:15 +00:00
|
|
|
|
2001-12-19 20:20:06 +00:00
|
|
|
#ifdef ARCH_X86
|
2001-12-30 21:44:10 +00:00
|
|
|
if(mm_accel&MM_ACCEL_X86_MMX){
|
|
|
|
tmp=a52_resample_MMX(flags,chans);
|
|
|
|
if(tmp){
|
|
|
|
if(a52_resample==NULL) fprintf(stderr, "Using MMX optimized resampler\n");
|
|
|
|
a52_resample=tmp;
|
|
|
|
return tmp;
|
|
|
|
}
|
2001-12-09 19:23:15 +00:00
|
|
|
}
|
2001-12-30 21:44:10 +00:00
|
|
|
#endif
|
2004-01-25 18:29:11 +00:00
|
|
|
#ifdef HAVE_ALTIVEC
|
|
|
|
if(mm_accel&MM_ACCEL_PPC_ALTIVEC){
|
|
|
|
tmp=a52_resample_altivec(flags,chans);
|
|
|
|
if(tmp){
|
|
|
|
if(a52_resample==NULL) fprintf(stderr, "Using AltiVec optimized resampler\n");
|
|
|
|
a52_resample=tmp;
|
|
|
|
return tmp;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2001-12-30 21:44:10 +00:00
|
|
|
tmp=a52_resample_C(flags,chans);
|
|
|
|
if(tmp){
|
|
|
|
if(a52_resample==NULL) fprintf(stderr, "No accelerated resampler found\n");
|
|
|
|
a52_resample=tmp;
|
|
|
|
return tmp;
|
2001-12-19 20:20:06 +00:00
|
|
|
}
|
|
|
|
|
2001-12-30 21:44:10 +00:00
|
|
|
fprintf(stderr, "Unimplemented resampler for mode 0x%X -> %d channels conversion - Contact MPlayer developers!\n", flags, chans);
|
|
|
|
return NULL;
|
2001-12-19 20:20:06 +00:00
|
|
|
}
|