From 582a5f9cca7f8ae1f41076c8c3bc9c3bae851b09 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 25 Oct 2007 11:06:39 +0000 Subject: Add build magic around sbctester program --- sbc/Makefile.am | 14 +++++++++++++- sbc/sbctester.c | 10 ++-------- 2 files changed, 15 insertions(+), 9 deletions(-) (limited to 'sbc') diff --git a/sbc/Makefile.am b/sbc/Makefile.am index 46cb30be..840fbfef 100644 --- a/sbc/Makefile.am +++ b/sbc/Makefile.am @@ -1,14 +1,26 @@ +if SNDFILE +sndfile_programs = sbctester +else +sndfile_programs = +endif + if SBC noinst_LTLIBRARIES = libsbc.la libsbc_la_SOURCES = sbc.h sbc.c sbc_math.h sbc_tables.h -noinst_PROGRAMS = sbcinfo sbcdec sbcenc +noinst_PROGRAMS = sbcinfo sbcdec sbcenc $(sndfile_programs) sbcdec_LDADD = libsbc.la sbcenc_LDADD = libsbc.la + +if SNDFILE +sbctester_LDADD = @SNDFILE_LIBS@ endif +endif + +AM_CFLAGS = @SNDFILE_CFLAGS@ MAINTAINERCLEANFILES = Makefile.in diff --git a/sbc/sbctester.c b/sbc/sbctester.c index 0b35a335..9d719e2e 100644 --- a/sbc/sbctester.c +++ b/sbc/sbctester.c @@ -98,7 +98,6 @@ static int calculate_rms_level(SNDFILE * sndref, SF_INFO * infosref, int i, j, err = 0, verdict = 0; short refsample[MAXCHANNELS], tstsample[MAXCHANNELS]; double refbits, tstbits; - double rms; double rms_accu[MAXCHANNELS]; double rms_level[MAXCHANNELS]; double rms_limit = 1.0 / (pow(2.0, accuracy - 1) * pow(12.0, 0.5)); @@ -183,16 +182,11 @@ error: return (err < 0) ? err : verdict; } -static int check_sample() -{ - return 0; -} - static int check_absolute_diff(SNDFILE * sndref, SF_INFO * infosref, SNDFILE * sndtst, SF_INFO * infostst, int accuracy) { int i, j, err = 0, verdict = 0; - short refsample[MAXCHANNELS], tstsample[MAXCHANNELS], + short refsample[MAXCHANNELS], tstsample[MAXCHANNELS]; short refmax[MAXCHANNELS], tstmax[MAXCHANNELS]; double refbits, tstbits; double rms_absolute = 1.0 / (pow(2, accuracy - 2)); @@ -263,7 +257,7 @@ error: int main(int argc, char *argv[]) { int err = 0; - int rms_absolute, pass_rms, pass_absolute, pass, accuracy; + int pass_rms, pass_absolute, pass, accuracy; char *ref; char *tst; SNDFILE *sndref = NULL; -- cgit