From 75a24bef4a33a36d1bcd9dbd87c105d5893d0728 Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Mon, 4 Jul 2011 16:26:03 +0100 Subject: iirfilter: add fate test Change the test program to output text instead of binary files so it can be compared easily in FATE. Signed-off-by: Mans Rullgard --- libavcodec/iirfilter.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'libavcodec/iirfilter.c') diff --git a/libavcodec/iirfilter.c b/libavcodec/iirfilter.c index a942068aee..34d3962807 100644 --- a/libavcodec/iirfilter.c +++ b/libavcodec/iirfilter.c @@ -311,6 +311,9 @@ av_cold void ff_iir_filter_free_coeffs(struct FFIIRFilterCoeffs *coeffs) } #ifdef TEST +#undef printf +#include + #define FILT_ORDER 4 #define SIZE 1024 int main(void) @@ -320,7 +323,6 @@ int main(void) float cutoff_coeff = 0.4; int16_t x[SIZE], y[SIZE]; int i; - FILE* fd; fcoeffs = ff_iir_filter_init_coeffs(NULL, FF_FILTER_TYPE_BUTTERWORTH, FF_FILTER_MODE_LOWPASS, FILT_ORDER, @@ -333,13 +335,8 @@ int main(void) ff_iir_filter(fcoeffs, fstate, SIZE, x, 1, y, 1); - fd = fopen("in.bin", "w"); - fwrite(x, sizeof(x[0]), SIZE, fd); - fclose(fd); - - fd = fopen("out.bin", "w"); - fwrite(y, sizeof(y[0]), SIZE, fd); - fclose(fd); + for (i = 0; i < SIZE; i++) + printf("%6d %6d\n", x[i], y[i]); ff_iir_filter_free_coeffs(fcoeffs); ff_iir_filter_free_state(fstate); -- cgit v1.2.3