diff options
author | michael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-12-30 21:38:53 +0000 |
---|---|---|
committer | michael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-12-30 21:38:53 +0000 |
commit | 8a95255ef276a9cb80b57b9c74dc5d17cc1671c7 (patch) | |
tree | 3f50f71836457bdd4342345b0f0903f462f031f5 /liba52/test.c | |
parent | 2addc399ab7f0d55e894029a446a8045dcebcd1d (diff) | |
download | mpv-8a95255ef276a9cb80b57b9c74dc5d17cc1671c7.tar.bz2 mpv-8a95255ef276a9cb80b57b9c74dc5d17cc1671c7.tar.xz |
runtime cpudetect in liba52 way
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3909 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'liba52/test.c')
-rw-r--r-- | liba52/test.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/liba52/test.c b/liba52/test.c index d77b716d35..13fca5bed7 100644 --- a/liba52/test.c +++ b/liba52/test.c @@ -11,6 +11,7 @@ #include <inttypes.h> #include "a52.h" +#include "mm_accel.h" #include "../cpudetect.h" static sample_t * samples; @@ -51,6 +52,13 @@ long long t, sum=0, min=256*256*256*64; stdout= stderr; //EVIL HACK FIXME GetCpuCaps(&gCpuCaps); stdout= temp; +// gCpuCaps.hasMMX=0; +// gCpuCaps.hasSSE=0; + if(gCpuCaps.hasMMX) accel |= MM_ACCEL_X86_MMX; + if(gCpuCaps.hasMMX2) accel |= MM_ACCEL_X86_MMXEXT; + if(gCpuCaps.hasSSE) accel |= MM_ACCEL_X86_SSE; + if(gCpuCaps.has3DNow) accel |= MM_ACCEL_X86_3DNOW; +// if(gCpuCaps.has3DNowExt) accel |= MM_ACCEL_X86_3DNOWEXT; samples = a52_init (accel); if (samples == NULL) { @@ -87,7 +95,7 @@ ENDTIMING buf_size=0; // decode: - flags=A52_STEREO; //A52_STEREO; // A52_DOLBY // A52_2F2R // A52_3F2R | A52_LFE + flags=A52_STEREO; //A52_STEREO; //A52_DOLBY; //A52_STEREO; // A52_DOLBY // A52_2F2R // A52_3F2R | A52_LFE channels=2; flags |= A52_ADJUST_LEVEL; @@ -99,7 +107,7 @@ ENDTIMING // a52_dynrng (&state, NULL, NULL); // disable dynamic range compensation STARTTIMING - a52_resample_init(flags,channels); + a52_resample_init(accel,flags,channels); s16 = out_buf; for (i = 0; i < 6; i++) { if (a52_block (&state, samples)) @@ -112,7 +120,7 @@ ENDTIMING if(sum<min) min=sum; sum=0; #endif - fwrite(out_buf,6*256*2*2,1,stdout); + fwrite(out_buf,6*256*2*channels,1,stdout); } |