Commit 5a636383 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '24f45c16'

* commit '24f45c16':
  fate: Add dependencies for dct/fft/mdct/rdft tests

Conflicts:
	libavcodec/fft-test.c
	tests/fate/fft.mak
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 357168bc 24f45c16
......@@ -117,6 +117,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;
......@@ -151,8 +152,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(FFTSample *output, FFTSample *input, int nbits)
{
int n = 1<<nbits;
......@@ -185,6 +188,7 @@ static void dct_ref(FFTSample *output, FFTSample *input, int nbits)
output[k] = s;
}
}
#endif /* CONFIG_DCT */
#endif
......@@ -310,6 +314,7 @@ int main(int argc, char **argv)
tab2 = av_malloc_array(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)
......@@ -318,6 +323,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");
......@@ -327,6 +333,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");
......@@ -335,6 +342,7 @@ 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)
......@@ -343,7 +351,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
# endif /* CONFIG_DCT */
#endif
default:
av_log(NULL, AV_LOG_ERROR, "Requested transform not supported\n");
......@@ -362,6 +370,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);
......@@ -375,6 +384,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);
......@@ -384,6 +394,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) {
......@@ -415,6 +426,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, (FFTSample *)tab);
......@@ -425,6 +438,7 @@ int main(int argc, char **argv)
}
err = check_diff((float *)tab_ref, (float *)tab, fft_size, 1.0);
break;
#endif /* CONFIG_DCT */
#endif
}
......@@ -476,21 +490,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
# 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
define DEF_FFT_FIXED32
FATE_FFT_FIXED32 += fate-fft-fixed32-$(1) fate-ifft-fixed32-$(1) \
......@@ -55,5 +55,5 @@ $(FATE_FFT_FIXED32): libavcodec/fft-fixed32-test$(EXESUF)
$(FATE_FFT_FIXED32): CMD = run libavcodec/fft-fixed32-test $(CPUFLAGS:%=-c%) $(ARGS)
$(FATE_FFT_FIXED32): REF = /dev/null
FATE-$(call ALLYES, AVCODEC FFT MDCT) += $(FATE_FFT) $(FATE_FFT_FIXED) $(FATE_FFT_FIXED32)
fate-fft: $(FATE_FFT) $(FATE_FFT_FIXED) $(FATE_FFT_FIXED32)
FATE-$(call ALLYES, AVCODEC FFT MDCT) += $(FATE_FFT-yes) $(FATE_FFT_FIXED-yes) $(FATE_FFT_FIXED32)
fate-fft: $(FATE_FFT-yes) $(FATE_FFT_FIXED-yes) $(FATE_FFT_FIXED32)
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