diff options
author | alex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-11-23 17:16:43 +0000 |
---|---|---|
committer | alex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-11-23 17:16:43 +0000 |
commit | 8afad12f8d53ddc6a4e544647d13abe0d68047d1 (patch) | |
tree | 7fe61cfed181bf4f3d1d03dcf6c28b01b3aa1104 | |
parent | db51f47ae64334f6e7e3489a33396a807cbe65c0 (diff) |
changed to use cpudetect.c (to use change te #if 1 -> #if 0 :)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3089 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | mp3lib/sr1.c | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/mp3lib/sr1.c b/mp3lib/sr1.c index 688226cad8..a664c9dc88 100644 --- a/mp3lib/sr1.c +++ b/mp3lib/sr1.c @@ -370,12 +370,15 @@ extern void dct64_MMX_3dnowex( void ); extern void dct64_MMX_sse( void ); void (*dct64_MMX_func)( void ); +#include "../cpudetect.h" + // Init decoder tables. Call first, once! #ifdef USE_FAKE_MONO void MP3_Init(int fakemono){ #else void MP3_Init(){ #endif +#if 1 #ifdef ARCH_X86 _CpuID=CpuDetect(); _i586=ipentium(); @@ -484,6 +487,86 @@ void MP3_Init(){ { synth_func = NULL; } +#else + +#ifdef HAVE_MMX +/* Use it for any MMX cpu */ + if(gCpuCaps.hasMMX) + { + make_decode_tables_MMX(outscale); + printf("mp3lib: made decode tables with mmx optimization\n"); + } + else +#endif + make_decode_tables(outscale); + +#ifdef USE_FAKE_MONO + if (fakemono == 1) + fr.synth=synth_1to1_l; + else if (fakemono == 2) + fr.synth=synth_1to1_r; + else + fr.synth=synth_1to1; +#else + fr.synth=synth_1to1; +#endif + fr.synth_mono=synth_1to1_mono2stereo; + fr.down_sample=0; + fr.down_sample_sblimit = SBLIMIT>>(fr.down_sample); + init_layer2(); + init_layer3(fr.down_sample_sblimit); + tables_done_flag=1; + + dct36_func=dct36; +#ifdef HAVE_SSE + if(gCpuCaps.hasSSE) + { + synth_func=synth_1to1_MMX; + dct64_MMX_func=dct64_MMX_sse; + printf("mp3lib: using SSE optimized decore!\n"); + } + else +#endif +#ifdef HAVE_3DNOWEX + if (gCpuCaps.has3DNowExt) + { + synth_func=synth_1to1_MMX; + dct36_func=dct36_3dnowex; + dct64_MMX_func=dct64_MMX_3dnowex; + printf("mp3lib: using 3DNow!Ex optimized decore!\n"); + } + else +#endif +#ifdef HAVE_3DNOW + if (gCpuCaps.has3DNow) + { + synth_func=synth_1to1_MMX; + dct36_func=dct36_3dnow; + dct64_MMX_func=dct64_MMX_3dnow; + printf("mp3lib: using 3DNow! optimized decore!\n"); + } + else +#endif +#ifdef HAVE_MMX + if (gCpuCaps.hasMMX) + { + synth_func=synth_1to1_MMX; + dct64_MMX_func=dct64_MMX; + printf("mp3lib: using MMX optimized decore!\n"); + } + else +#endif +#ifdef ARCH_X86 + if (gCpuCaps.cpuType >= CPUTYPE_I386) + { + synth_func=synth_1to1_pent; + } + else +#endif + { + synth_func = NULL; + } +#endif } #if 0 |