3 * Copyright (C) 2001 Árpád Gereöffy
5 * This file is part of a52dec, a free ATSC A-52 stream decoder.
6 * See http://liba52.sourceforge.net/ for updates.
8 * File added for use with MPlayer and not part of original a52dec.
10 * a52dec is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * a52dec is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 // a52_resample_init should find the requested converter (from type flags ->
26 // given number of channels) and set up some function pointers...
28 // a52_resample() should do the conversion.
37 int (* a52_resample
) (float * _f
, int16_t * s16
)=NULL
;
39 #include "resample_c.c"
41 #if ARCH_X86 || ARCH_X86_64
42 #include "resample_mmx.c"
46 #include "resample_altivec.c"
49 void* a52_resample_init(uint32_t mm_accel
,int flags
,int chans
){
52 #if ARCH_X86 || ARCH_X86_64
53 if(mm_accel
&MM_ACCEL_X86_MMX
){
54 tmp
=a52_resample_MMX(flags
,chans
);
56 if(a52_resample
==NULL
) fprintf(stderr
, "Using MMX optimized resampler\n");
63 if(mm_accel
&MM_ACCEL_PPC_ALTIVEC
){
64 tmp
=a52_resample_altivec(flags
,chans
);
66 if(a52_resample
==NULL
) fprintf(stderr
, "Using AltiVec optimized resampler\n");
73 tmp
=a52_resample_C(flags
,chans
);
75 if(a52_resample
==NULL
) fprintf(stderr
, "No accelerated resampler found\n");
80 fprintf(stderr
, "Unimplemented resampler for mode 0x%X -> %d channels conversion - Contact MPlayer developers!\n", flags
, chans
);