diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c index 88c2f64082..eb4f753d95 100644 --- a/libavcodec/ac3enc.c +++ b/libavcodec/ac3enc.c @@ -1280,14 +1280,15 @@ static av_cold int AC3_encode_close(AVCodecContext *avctx) return 0; } -#if 0 +#ifdef TEST /*************************************************************************/ /* TEST */ -#undef random -#define FN (N/4) +#include "libavutil/lfg.h" -void fft_test(void) +#define FN (MDCT_SAMPLES/4) + +static void fft_test(AVLFG *lfg) { IComplex in[FN], in1[FN]; int k, n, i; @@ -1296,8 +1297,8 @@ void fft_test(void) /* FFT test */ for(i=0;i emax) emax = e; err += e * e; } - printf("err2=%f emax=%f\n", err / (N/2), emax); + av_log(NULL, AV_LOG_DEBUG, "err2=%f emax=%f\n", err / AC3_MAX_COEFS, emax); } -void test_ac3(void) +int main(void) { - AC3EncodeContext ctx; - unsigned char frame[AC3_MAX_CODED_FRAME_SIZE]; - int16_t samples[AC3_FRAME_SIZE]; - int ret, i; + AVLFG lfg; - AC3_encode_init(&ctx, 44100, 64000, 1); + av_log_set_level(AV_LOG_DEBUG); + mdct_init(9); - fft_test(); - mdct_test(); + fft_test(&lfg); + mdct_test(&lfg); - for(i=0;i