diff options
author | Paul B Mahol <onemda@gmail.com> | 2018-11-12 09:27:08 +0100 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2018-11-12 09:27:08 +0100 |
commit | a09411a0ee029687d3a80fb17149406513b2d2e5 (patch) | |
tree | 0efb52cb6aab3716122cd6606b0fadd5e8819d8a /libavfilter | |
parent | ee47ac97d7938fc221d1d386e3e520a5521cddfd (diff) | |
download | ffmpeg-a09411a0ee029687d3a80fb17149406513b2d2e5.tar.gz |
avfilter/af_afftfilt: calculate all channels FFT values upfront
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/af_afftfilt.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/libavfilter/af_afftfilt.c b/libavfilter/af_afftfilt.c index d5e3b7f500..150f8ed859 100644 --- a/libavfilter/af_afftfilt.c +++ b/libavfilter/af_afftfilt.c @@ -289,15 +289,18 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) 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; |