mirror of
https://github.com/alsa-project/alsa-tools.git
synced 2026-02-15 22:05:24 -05:00
Added ac3dec 0.6.1 with native ALSA driver.
This commit is contained in:
parent
f2d80b5b5d
commit
28ff64db0a
50 changed files with 6094 additions and 0 deletions
37
ac3dec/test/Makefile.am
Normal file
37
ac3dec/test/Makefile.am
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
INCLUDES = -I../libac3
|
||||
noinst_PROGRAMS = imdct_test dither_test
|
||||
#noinst_PROGRAMS = bitstream_test imdct_test imdct_timing uncouple_timing\
|
||||
#crc_timing
|
||||
noinst_HEADERS = timing.h
|
||||
|
||||
#bitstream_test_SOURCES = bitstream_test.c
|
||||
#bitstream_test_LDADD = ../bitstream.o ../crc.o
|
||||
#
|
||||
dither_test_SOURCES = dither_test.c
|
||||
dither_test_LDADD = ../libac3/dither.o
|
||||
|
||||
imdct_test_SOURCES = imdct_test.c
|
||||
imdct_test_LDADD = ../libac3/imdct.o -lm
|
||||
#
|
||||
#imdct_timing_SOURCES = imdct_timing.c timing.c
|
||||
#imdct_timing_LDADD = ../imdct.o -lm
|
||||
#
|
||||
#uncouple_timing_SOURCES = uncouple_timing.c timing.c
|
||||
#uncouple_timing_LDADD = ../uncouple.o ../dither.o -lm
|
||||
#
|
||||
#crc_timing_SOURCES = crc_timing.c timing.c
|
||||
#crc_timing_LDADD = ../crc.o -lm
|
||||
|
||||
check:
|
||||
#rm -f bitstream_test.out
|
||||
#./bitstream_test > bitstream_test.out
|
||||
#diff bitstream_test.out bitstream_test.out.ref
|
||||
#rm -f imdct_test.out
|
||||
#./imdct_test > imdct_test.out
|
||||
#diff imdct_test.out imdct_test.out.ref
|
||||
rm -f dither_test.out
|
||||
./dither_test > dither_test.out
|
||||
diff dither_test.out dither_test.out.ref
|
||||
|
||||
clean:
|
||||
rm -f *.out
|
||||
43
ac3dec/test/dither_test.c
Normal file
43
ac3dec/test/dither_test.c
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* dither_test.c
|
||||
*
|
||||
* Aaron Holtzman - May 1999
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include "ac3.h"
|
||||
#include "ac3_internal.h"
|
||||
#include "dither.h"
|
||||
|
||||
#include <sys/time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
int i,j,foo;
|
||||
struct timeval start,end;
|
||||
|
||||
/*
|
||||
for(i=0;i < 65538 ;i++)
|
||||
//printf("%04x\n",dither_gen());
|
||||
printf("%f\n",((sint_16)dither_gen())/ 32768.0);
|
||||
printf("\n");
|
||||
*/
|
||||
|
||||
|
||||
|
||||
for(j=0;j < 10 ;j++)
|
||||
{
|
||||
gettimeofday(&start,0);
|
||||
for(i=0;i < 10000 ;i++)
|
||||
{
|
||||
foo = dither_gen();
|
||||
}
|
||||
gettimeofday(&end,0);
|
||||
printf("%f us\n",((end.tv_sec - start.tv_sec) * 1000000 +
|
||||
(end.tv_usec - start.tv_usec))/10000.0);
|
||||
}
|
||||
|
||||
}
|
||||
38
ac3dec/test/imdct_test.c
Normal file
38
ac3dec/test/imdct_test.c
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* imdct_test.c
|
||||
*
|
||||
* Aaron Holtzman - May 1999
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include "ac3.h"
|
||||
#include "ac3_internal.h"
|
||||
#include "imdct.h"
|
||||
|
||||
static stream_samples_t samples;
|
||||
static bsi_t bsi;
|
||||
static audblk_t audblk;
|
||||
|
||||
int main(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
samples[0][20] = 0.4;
|
||||
samples[0][40] = 0.4;
|
||||
samples[0][30] = 1.0;
|
||||
|
||||
|
||||
imdct_init();
|
||||
bsi.nfchans = 1;
|
||||
|
||||
imdct(&bsi,&audblk,samples);
|
||||
|
||||
|
||||
for(i=0;i<256;i++)
|
||||
printf("%1.8f\n",samples[0][i]);
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
14
ac3dec/test/timing.h
Normal file
14
ac3dec/test/timing.h
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
/*
|
||||
* timing.h
|
||||
*
|
||||
* Aaron Holtzman - May 1999
|
||||
*
|
||||
*/
|
||||
|
||||
//uint_64 get_time(void);
|
||||
uint_64 timing_init(void);
|
||||
|
||||
void timing_test_2(void (*func)(void*,void*),void *arg_1,void *arg_2,char name[]);
|
||||
void timing_test_3(void (*func)(void*,void*,void*),void *arg_1,void *arg_2,void *arg_3,char name[]);
|
||||
double timing_once_3(void (*func)(void*,void*,void*),void *arg_1,void *arg_2,void *arg_3);
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue