Commit a09411a0 authored by Paul B Mahol's avatar Paul B Mahol

avfilter/af_afftfilt: calculate all channels FFT values upfront

parent ee47ac97
......@@ -287,17 +287,20 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
values[VAR_NBBINS] = window_size / 2;
values[VAR_CHANNELS] = inlink->channels;
for (ch = 0; ch < inlink->channels; ch++) {
FFTComplex *fft_data = s->fft_data[ch];
av_fft_permute(s->fft, fft_data);
av_fft_calc(s->fft, fft_data);
}
for (ch = 0; ch < inlink->channels; ch++) {
FFTComplex *fft_data = s->fft_data[ch];
FFTComplex *fft_temp = s->fft_temp[ch];
float *buf = (float *)s->buffer->extended_data[ch];
int x;
values[VAR_CHANNEL] = ch;
av_fft_permute(s->fft, fft_data);
av_fft_calc(s->fft, fft_data);
for (n = 0; n <= window_size / 2; n++) {
float fr, fi;
......
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