1193
|
1
|
|
2 // a52_resample_init should find the requested converter (from type flags ->
|
|
3 // given number of channels) and set up some function pointers...
|
|
4
|
|
5 // a52_resample() should do the conversion.
|
|
6
|
|
7 #include <inttypes.h>
|
|
8 #include <stdio.h>
|
|
9 #include "a52.h"
|
|
10 #include "mm_accel.h"
|
|
11 #include "config.h"
|
|
12 #include "../libpostproc/mangle.h"
|
|
13
|
|
14 int (* a52_resample) (float * _f, int16_t * s16)=NULL;
|
|
15
|
|
16 #include "resample_c.c"
|
|
17
|
|
18 #ifdef ARCH_X86
|
|
19 #include "resample_mmx.c"
|
|
20 #endif
|
|
21
|
|
22 void* a52_resample_init(uint32_t mm_accel,int flags,int chans){
|
|
23 void* tmp;
|
|
24
|
|
25 #ifdef ARCH_X86
|
|
26 if(mm_accel&MM_ACCEL_X86_MMX){
|
|
27 tmp=a52_resample_MMX(flags,chans);
|
|
28 if(tmp){
|
|
29 if(a52_resample==NULL) fprintf(stderr, "Using MMX optimized resampler\n");
|
|
30 a52_resample=tmp;
|
|
31 return tmp;
|
|
32 }
|
|
33 }
|
|
34 #endif
|
|
35
|
|
36 tmp=a52_resample_C(flags,chans);
|
|
37 if(tmp){
|
|
38 if(a52_resample==NULL) fprintf(stderr, "No accelerated resampler found\n");
|
|
39 a52_resample=tmp;
|
|
40 return tmp;
|
|
41 }
|
|
42
|
|
43 fprintf(stderr, "Unimplemented resampler for mode 0x%X -> %d channels conversion - Contact MPlayer developers!\n", flags, chans);
|
|
44 return NULL;
|
|
45 }
|