summaryrefslogtreecommitdiffstats
path: root/liba52/test.c
diff options
context:
space:
mode:
Diffstat (limited to 'liba52/test.c')
-rw-r--r--liba52/test.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/liba52/test.c b/liba52/test.c
index 93906d978c..8d2588c109 100644
--- a/liba52/test.c
+++ b/liba52/test.c
@@ -1,7 +1,7 @@
// liba52 sample by A'rpi/ESP-team
// Reads an AC-3 stream from stdin, decodes and downmixes to s16 stereo PCM
// and writes it to stdout. The resulting stream is playable with sox:
-// play -c 2 -r 48000 out.sw
+// play -c2 -r48000 -sw -fs out.sw
//#define TIMING //needs Pentium or newer
@@ -14,14 +14,13 @@
#include "mm_accel.h"
#include "../cpudetect.h"
-static sample_t * samples;
-static a52_state_t state;
+static a52_state_t *state;
static uint8_t buf[3840];
static int buf_size=0;
static int16_t out_buf[6*256*6];
-void mp_msg_c( int x, const char *format, ... ) // stub for cpudetect.c
+void mp_msg( int x, const char *format, ... ) // stub for cpudetect.c
{
}
@@ -64,8 +63,8 @@ long long t, sum=0, min=256*256*256*64;
if(gCpuCaps.has3DNow) accel |= MM_ACCEL_X86_3DNOW;
// if(gCpuCaps.has3DNowExt) accel |= MM_ACCEL_X86_3DNOWEXT;
- samples = a52_init (accel);
- if (samples == NULL) {
+ state = a52_init (accel);
+ if (state == NULL) {
fprintf (stderr, "A52 init failed\n");
return 1;
}
@@ -104,20 +103,20 @@ ENDTIMING
flags |= A52_ADJUST_LEVEL;
STARTTIMING
- if (a52_frame (&state, buf, &flags, &level, bias))
+ if (a52_frame (state, buf, &flags, &level, bias))
{ fprintf(stderr,"error at decoding\n"); continue; }
ENDTIMING
- // a52_dynrng (&state, NULL, NULL); // disable dynamic range compensation
+ // a52_dynrng (state, NULL, NULL); // disable dynamic range compensation
STARTTIMING
a52_resample_init(accel,flags,channels);
s16 = out_buf;
for (i = 0; i < 6; i++) {
- if (a52_block (&state, samples))
+ if (a52_block (state))
{ fprintf(stderr,"error at sampling\n"); break; }
// float->int + channels interleaving:
- s16+=a52_resample(samples,s16);
+ s16+=a52_resample(a52_samples(state),s16);
ENDTIMING
}
#ifdef TIMING
@@ -130,7 +129,8 @@ sum=0;
eof:
#ifdef TIMING
-fprintf(stderr, "%4.4fk cycles ",min/1000.0);
+fprintf(stderr, "%4.4fk cycles\n",min/1000.0);
sum=0;
#endif
+return 0;
}