summaryrefslogtreecommitdiff
path: root/libavcodec/iirfilter.c
diff options
context:
space:
mode:
authorMans Rullgard <mans@mansr.com>2011-07-04 16:26:03 +0100
committerMans Rullgard <mans@mansr.com>2011-07-04 16:26:26 +0100
commit75a24bef4a33a36d1bcd9dbd87c105d5893d0728 (patch)
treee988ffeb7e245d2660928fc85654016cf862be2d /libavcodec/iirfilter.c
parent66e2dd11876395c3ad053744b19fd46b0618155a (diff)
downloadffmpeg-75a24bef4a33a36d1bcd9dbd87c105d5893d0728.tar.gz
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 <mans@mansr.com>
Diffstat (limited to 'libavcodec/iirfilter.c')
-rw-r--r--libavcodec/iirfilter.c13
1 files changed, 5 insertions, 8 deletions
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 <stdio.h>
+
#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);