avcodec/tests/fft: Fix building with CONFIG_MDCT disabled

Since e6afa61be9, no components in
libavcodec enable CONFIG_MDCT. This fixes building "make testprogs".

Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
Martin Storsjö 2022-11-07 10:31:15 +02:00
parent e17628b720
commit 202b7a9ae7
1 changed files with 4 additions and 0 deletions

View File

@ -226,6 +226,7 @@ static inline void fft_init(FFTContext **s, int nbits, int inverse)
#endif #endif
} }
#if CONFIG_MDCT
static inline void mdct_init(FFTContext **s, int nbits, int inverse, double scale) static inline void mdct_init(FFTContext **s, int nbits, int inverse, double scale)
{ {
#if AVFFT #if AVFFT
@ -252,6 +253,7 @@ static inline void imdct_calc(struct FFTContext *s, FFTSample *output, const FFT
s->imdct_calc(s, output, input); s->imdct_calc(s, output, input);
#endif #endif
} }
#endif
static inline void fft_permute(FFTContext *s, FFTComplex *z) static inline void fft_permute(FFTContext *s, FFTComplex *z)
{ {
@ -592,12 +594,14 @@ int main(int argc, char **argv)
time_start = av_gettime_relative(); time_start = av_gettime_relative();
for (it = 0; it < nb_its; it++) { for (it = 0; it < nb_its; it++) {
switch (transform) { switch (transform) {
#if CONFIG_MDCT
case TRANSFORM_MDCT: case TRANSFORM_MDCT:
if (do_inverse) if (do_inverse)
imdct_calc(m, &tab->re, &tab1->re); imdct_calc(m, &tab->re, &tab1->re);
else else
mdct_calc(m, &tab->re, &tab1->re); mdct_calc(m, &tab->re, &tab1->re);
break; break;
#endif
case TRANSFORM_FFT: case TRANSFORM_FFT:
memcpy(tab, tab1, fft_size * sizeof(FFTComplex)); memcpy(tab, tab1, fft_size * sizeof(FFTComplex));
fft_calc(s, tab); fft_calc(s, tab);