From 6682ec830bf04c126d8a523773ab6ed31f94a7d1 Mon Sep 17 00:00:00 2001 From: michael Date: Tue, 18 Dec 2001 04:00:29 +0000 Subject: runtime cpu detection for the idct git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3580 b3059339-0415-0410-9bf9-f77b7e298cf2 --- liba52/test.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'liba52/test.c') diff --git a/liba52/test.c b/liba52/test.c index af0a5953f4..d77b716d35 100644 --- a/liba52/test.c +++ b/liba52/test.c @@ -11,6 +11,7 @@ #include #include "a52.h" +#include "../cpudetect.h" static sample_t * samples; static a52_state_t state; @@ -46,6 +47,11 @@ int bit_rate=0; long long t, sum=0, min=256*256*256*64; #endif + FILE *temp= stdout; + stdout= stderr; //EVIL HACK FIXME + GetCpuCaps(&gCpuCaps); + stdout= temp; + samples = a52_init (accel); if (samples == NULL) { fprintf (stderr, "A52 init failed\n"); @@ -81,7 +87,7 @@ ENDTIMING buf_size=0; // decode: - flags=A52_STEREO; // A52_DOLBY // A52_2F2R // A52_3F2R | A52_LFE + flags=A52_STEREO; //A52_STEREO; // A52_DOLBY // A52_2F2R // A52_3F2R | A52_LFE channels=2; flags |= A52_ADJUST_LEVEL; @@ -92,15 +98,15 @@ ENDTIMING // a52_dynrng (&state, NULL, NULL); // disable dynamic range compensation +STARTTIMING a52_resample_init(flags,channels); s16 = out_buf; for (i = 0; i < 6; i++) { -STARTTIMING if (a52_block (&state, samples)) { fprintf(stderr,"error at sampling\n"); break; } -ENDTIMING // float->int + channels interleaving: s16+=a52_resample(samples,s16); +ENDTIMING } #ifdef TIMING if(sum