diff --git a/libavcodec/fft_template.c b/libavcodec/fft_template.c index 6477372274..6c77854e41 100644 --- a/libavcodec/fft_template.c +++ b/libavcodec/fft_template.c @@ -29,11 +29,19 @@ #include #include #include "libavutil/mathematics.h" +#include "libavutil/thread.h" #include "fft.h" #include "fft-internal.h" #if FFT_FIXED_32 #include "fft_table.h" + +static void av_cold fft_lut_init(void) +{ + int n = 0; + ff_fft_lut_init(ff_fft_offsets_lut, 0, 1 << 17, &n); +} + #else /* FFT_FIXED_32 */ /* cos(2*pi*x/n) for 0<=x<=n/4, followed by its reverse */ @@ -52,6 +60,66 @@ COSTABLE(16384); COSTABLE(32768); COSTABLE(65536); COSTABLE(131072); + +static av_cold void init_ff_cos_tabs(int index) +{ + int i; + int m = 1<