[FFmpeg-cvslog] fate: Add dependencies for dct/fft/mdct/rdft tests
Diego Biurrun
git at videolan.org
Fri Aug 8 14:18:35 CEST 2014
ffmpeg | branch: release/1.1 | Diego Biurrun <diego at biurrun.de> | Wed Jun 25 17:09:13 2014 -0700| [58d7b835e3cec48ab5a2393405fe82dee72c06a0] | committer: Diego Biurrun
fate: Add dependencies for dct/fft/mdct/rdft tests
(cherry picked from commit d396987c303bdc4eea7d1a1ff6776475d9bbd9ea)
Signed-off-by: Diego Biurrun <diego at biurrun.de>
Conflicts:
libavcodec/fft-test.c
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=58d7b835e3cec48ab5a2393405fe82dee72c06a0
---
libavcodec/fft-test.c | 22 ++++++++++++++++++++++
tests/fate/fft.mak | 32 ++++++++++++++++----------------
2 files changed, 38 insertions(+), 16 deletions(-)
diff --git a/libavcodec/fft-test.c b/libavcodec/fft-test.c
index 1e46750..74b4b6f 100644
--- a/libavcodec/fft-test.c
+++ b/libavcodec/fft-test.c
@@ -112,6 +112,7 @@ static void fft_ref(FFTComplex *tabr, FFTComplex *tab, int nbits)
}
}
+#if CONFIG_MDCT
static void imdct_ref(FFTSample *out, FFTSample *in, int nbits)
{
int n = 1<<nbits;
@@ -146,8 +147,10 @@ static void mdct_ref(FFTSample *output, FFTSample *input, int nbits)
output[k] = REF_SCALE(s, nbits - 1);
}
}
+#endif /* CONFIG_MDCT */
#if CONFIG_FFT_FLOAT
+#if CONFIG_DCT
static void idct_ref(float *output, float *input, int nbits)
{
int n = 1<<nbits;
@@ -180,6 +183,7 @@ static void dct_ref(float *output, float *input, int nbits)
output[k] = s;
}
}
+#endif /* CONFIG_DCT */
#endif
@@ -303,6 +307,7 @@ int main(int argc, char **argv)
tab2 = av_malloc(fft_size * sizeof(FFTSample));
switch (transform) {
+#if CONFIG_MDCT
case TRANSFORM_MDCT:
av_log(NULL, AV_LOG_INFO,"Scale factor is set to %f\n", scale);
if (do_inverse)
@@ -311,6 +316,7 @@ int main(int argc, char **argv)
av_log(NULL, AV_LOG_INFO,"MDCT");
ff_mdct_init(m, fft_nbits, do_inverse, scale);
break;
+#endif /* CONFIG_MDCT */
case TRANSFORM_FFT:
if (do_inverse)
av_log(NULL, AV_LOG_INFO,"IFFT");
@@ -320,6 +326,7 @@ int main(int argc, char **argv)
fft_ref_init(fft_nbits, do_inverse);
break;
#if CONFIG_FFT_FLOAT
+#if CONFIG_RDFT
case TRANSFORM_RDFT:
if (do_inverse)
av_log(NULL, AV_LOG_INFO,"IDFT_C2R");
@@ -328,6 +335,8 @@ int main(int argc, char **argv)
ff_rdft_init(r, fft_nbits, do_inverse ? IDFT_C2R : DFT_R2C);
fft_ref_init(fft_nbits, do_inverse);
break;
+#endif /* CONFIG_RDFT */
+#if CONFIG_DCT
case TRANSFORM_DCT:
if (do_inverse)
av_log(NULL, AV_LOG_INFO,"DCT_III");
@@ -335,6 +344,7 @@ int main(int argc, char **argv)
av_log(NULL, AV_LOG_INFO,"DCT_II");
ff_dct_init(d, fft_nbits, do_inverse ? DCT_III : DCT_II);
break;
+#endif /* CONFIG_DCT */
#endif
default:
av_log(NULL, AV_LOG_ERROR, "Requested transform not supported\n");
@@ -353,6 +363,7 @@ int main(int argc, char **argv)
av_log(NULL, AV_LOG_INFO,"Checking...\n");
switch (transform) {
+#if CONFIG_MDCT
case TRANSFORM_MDCT:
if (do_inverse) {
imdct_ref((FFTSample *)tab_ref, (FFTSample *)tab1, fft_nbits);
@@ -366,6 +377,7 @@ int main(int argc, char **argv)
err = check_diff((FFTSample *)tab_ref, tab2, fft_size / 2, scale);
}
break;
+#endif /* CONFIG_MDCT */
case TRANSFORM_FFT:
memcpy(tab, tab1, fft_size * sizeof(FFTComplex));
s->fft_permute(s, tab);
@@ -375,6 +387,7 @@ int main(int argc, char **argv)
err = check_diff((FFTSample *)tab_ref, (FFTSample *)tab, fft_size * 2, 1.0);
break;
#if CONFIG_FFT_FLOAT
+#if CONFIG_RDFT
case TRANSFORM_RDFT:
fft_size_2 = fft_size >> 1;
if (do_inverse) {
@@ -406,6 +419,8 @@ int main(int argc, char **argv)
err = check_diff((float *)tab_ref, (float *)tab2, fft_size, 1.0);
}
break;
+#endif /* CONFIG_RDFT */
+#if CONFIG_DCT
case TRANSFORM_DCT:
memcpy(tab, tab1, fft_size * sizeof(FFTComplex));
d->dct_calc(d, tab);
@@ -416,6 +431,7 @@ int main(int argc, char **argv)
}
err = check_diff((float *)tab_ref, (float *)tab, fft_size, 1.0);
break;
+#endif /* CONFIG_DCT */
#endif
}
@@ -467,19 +483,25 @@ int main(int argc, char **argv)
}
switch (transform) {
+#if CONFIG_MDCT
case TRANSFORM_MDCT:
ff_mdct_end(m);
break;
+#endif /* CONFIG_MDCT */
case TRANSFORM_FFT:
ff_fft_end(s);
break;
#if CONFIG_FFT_FLOAT
+#if CONFIG_RDFT
case TRANSFORM_RDFT:
ff_rdft_end(r);
break;
+#endif /* CONFIG_RDFT */
+#if CONFIG_DCT
case TRANSFORM_DCT:
ff_dct_end(d);
break;
+#endif /* CONFIG_DCT */
#endif
}
diff --git a/tests/fate/fft.mak b/tests/fate/fft.mak
index 20d5638..d2a3904 100644
--- a/tests/fate/fft.mak
+++ b/tests/fate/fft.mak
@@ -1,8 +1,8 @@
define DEF_FFT
-FATE_FFT += fate-fft-$(1) fate-ifft-$(1) \
- fate-mdct-$(1) fate-imdct-$(1) \
- fate-rdft-$(1) fate-irdft-$(1) \
- fate-dct1d-$(1) fate-idct1d-$(1)
+FATE_FFT-$(CONFIG_DCT) += fate-dct1d-$(1) fate-idct1d-$(1)
+FATE_FFT-$(CONFIG_FFT) += fate-fft-$(1) fate-ifft-$(1)
+FATE_FFT-$(CONFIG_MDCT) += fate-mdct-$(1) fate-imdct-$(1)
+FATE_FFT-$(CONFIG_RDFT) += fate-rdft-$(1) fate-irdft-$(1)
fate-fft-$(N): ARGS = -n$(1)
fate-ifft-$(N): ARGS = -n$(1) -i
@@ -16,14 +16,14 @@ endef
$(foreach N, 4 5 6 7 8 9 10 11 12, $(eval $(call DEF_FFT,$(N))))
-fate-fft-test: $(FATE_FFT)
-$(FATE_FFT): libavcodec/fft-test$(EXESUF)
-$(FATE_FFT): CMD = run libavcodec/fft-test $(CPUFLAGS:%=-c%) $(ARGS)
-$(FATE_FFT): REF = /dev/null
+fate-fft-float: $(FATE_FFT-yes)
+$(FATE_FFT-yes): libavcodec/fft-test$(EXESUF)
+$(FATE_FFT-yes): CMD = run libavcodec/fft-test $(CPUFLAGS:%=-c%) $(ARGS)
+$(FATE_FFT-yes): REF = /dev/null
define DEF_FFT_FIXED
-FATE_FFT_FIXED += fate-fft-fixed-$(1) fate-ifft-fixed-$(1) \
- fate-mdct-fixed-$(1) fate-imdct-fixed-$(1)
+FATE_FFT_FIXED-$(CONFIG_FFT) += fate-fft-fixed-$(1) fate-ifft-fixed-$(1)
+FATE_FFT_FIXED-$(CONFIG_MDCT) += fate-mdct-fixed-$(1) fate-imdct-fixed-$(1)
fate-fft-fixed-$(1): ARGS = -n$(1)
fate-ifft-fixed-$(1): ARGS = -n$(1) -i
@@ -33,10 +33,10 @@ endef
$(foreach N, 4 5 6 7 8 9 10 11 12, $(eval $(call DEF_FFT_FIXED,$(N))))
-fate-fft-fixed-test: $(FATE_FFT_FIXED)
-$(FATE_FFT_FIXED): libavcodec/fft-fixed-test$(EXESUF)
-$(FATE_FFT_FIXED): CMD = run libavcodec/fft-fixed-test $(CPUFLAGS:%=-c%) $(ARGS)
-$(FATE_FFT_FIXED): REF = /dev/null
+fate-fft-fixed: $(FATE_FFT_FIXED-yes)
+$(FATE_FFT_FIXED-yes): libavcodec/fft-fixed-test$(EXESUF)
+$(FATE_FFT_FIXED-yes): CMD = run libavcodec/fft-fixed-test $(CPUFLAGS:%=-c%) $(ARGS)
+$(FATE_FFT_FIXED-yes): REF = /dev/null
-FATE-$(call ALLYES, AVCODEC FFT) += $(FATE_FFT) $(FATE_FFT_FIXED)
-fate-fft: $(FATE_FFT) $(FATE_FFT_FIXED)
+FATE-$(CONFIG_AVCODEC) += $(FATE_FFT-yes) $(FATE_FFT_FIXED-yes)
+fate-fft: $(FATE_FFT-yes) $(FATE_FFT_FIXED-yes)
More information about the ffmpeg-cvslog
mailing list