Commit 24f45c16 authored by Diego Biurrun's avatar Diego Biurrun

fate: Add dependencies for dct/fft/mdct/rdft tests

parent 5ec6d152
......@@ -113,6 +113,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;
......@@ -147,8 +148,10 @@ static void mdct_ref(FFTSample *output, FFTSample *input, int nbits)
output[k] = REF_SCALE(s, nbits - 1);
}
}
#endif /* CONFIG_MDCT */
#if FFT_FLOAT
#if CONFIG_DCT
static void idct_ref(float *output, float *input, int nbits)
{
int n = 1<<nbits;
......@@ -181,6 +184,7 @@ static void dct_ref(float *output, float *input, int nbits)
output[k] = s;
}
}
#endif /* CONFIG_DCT */
#endif
......@@ -304,6 +308,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)
......@@ -312,6 +317,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");
......@@ -321,6 +327,7 @@ int main(int argc, char **argv)
fft_ref_init(fft_nbits, do_inverse);
break;
#if FFT_FLOAT
#if CONFIG_RDFT
case TRANSFORM_RDFT:
if (do_inverse)
av_log(NULL, AV_LOG_INFO,"IDFT_C2R");
......@@ -329,6 +336,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");
......@@ -336,6 +345,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");
......@@ -354,6 +364,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);
......@@ -367,6 +378,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);
......@@ -376,6 +388,7 @@ int main(int argc, char **argv)
err = check_diff((FFTSample *)tab_ref, (FFTSample *)tab, fft_size * 2, 1.0);
break;
#if FFT_FLOAT
#if CONFIG_RDFT
case TRANSFORM_RDFT:
fft_size_2 = fft_size >> 1;
if (do_inverse) {
......@@ -407,6 +420,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);
......@@ -417,6 +432,7 @@ int main(int argc, char **argv)
}
err = check_diff((float *)tab_ref, (float *)tab, fft_size, 1.0);
break;
#endif /* CONFIG_DCT */
#endif
}
......@@ -468,19 +484,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 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
}
......
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)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment