mirror of
https://github.com/mpv-player/mpv
synced 2025-02-19 22:36:55 +00:00
Fix compilation of liba52/test.c testing and benchmarking application.
It have been broken since API changes in liba52-0.7.4 that have been introduced with commit r18723. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25514 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
087dbfe99f
commit
99ad62f36f
@ -12,5 +12,5 @@ SRCS_COMMON = crc.c \
|
||||
|
||||
include ../mpcommon.mak
|
||||
|
||||
test: test.c ../osdep/libosdep.a $(LIBNAME_COMMON)
|
||||
test: test.c ../cpudetect.o $(LIBNAME_COMMON)
|
||||
$(CC) $(CFLAGS) -o $@ $^ -lm
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user