diff options
author | Paul B Mahol <onemda@gmail.com> | 2023-07-27 13:03:39 +0200 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2023-07-28 14:02:33 +0200 |
commit | 830e522cdecb644f869b59f8e58aed2e2fd59ff6 (patch) | |
tree | 989326a7669a38b80705c674da152c14c2cef18d | |
parent | 27804200ef15a4170167f23b5599541bacaff38e (diff) | |
download | ffmpeg-830e522cdecb644f869b59f8e58aed2e2fd59ff6.tar.gz |
avfilter/avf_showcwt: reduce memory usage even more
-rw-r--r-- | libavfilter/avf_showcwt.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libavfilter/avf_showcwt.c b/libavfilter/avf_showcwt.c index 8badfbd34e..8278623d4b 100644 --- a/libavfilter/avf_showcwt.c +++ b/libavfilter/avf_showcwt.c @@ -578,6 +578,8 @@ static int run_channel_cwt(AVFilterContext *ctx, void *arg, int jobnr, int nb_jo ShowCWTContext *s = ctx->priv; const int ch = *(int *)arg; const AVComplexFloat *fft_out = (const AVComplexFloat *)s->fft_out->extended_data[ch]; + AVComplexFloat *isrc = (AVComplexFloat *)s->ifft_in->extended_data[jobnr]; + AVComplexFloat *idst = (AVComplexFloat *)s->ifft_out->extended_data[jobnr]; const int output_padding_size = s->output_padding_size; const int ihop_size = s->ihop_size; const int ioffset = (output_padding_size - ihop_size) >> 1; @@ -586,8 +588,6 @@ static int run_channel_cwt(AVFilterContext *ctx, void *arg, int jobnr, int nb_jo const int end = (count * (jobnr+1)) / nb_jobs; for (int y = start; y < end; y++) { - AVComplexFloat *isrc = (AVComplexFloat *)s->ifft_in->extended_data[y]; - AVComplexFloat *idst = (AVComplexFloat *)s->ifft_out->extended_data[y]; AVComplexFloat *chout = ((AVComplexFloat *)s->ch_out->extended_data[ch]) + y * ihop_size; AVComplexFloat *dstx = (AVComplexFloat *)s->dst_x->extended_data[jobnr]; AVComplexFloat *srcx = (AVComplexFloat *)s->src_x->extended_data[jobnr]; @@ -803,14 +803,14 @@ static int config_output(AVFilterLink *outlink) s->ifft_in->format = inlink->format; s->ifft_in->nb_samples = s->ifft_in_size * 2; - s->ifft_in->ch_layout.nb_channels = s->frequency_band_count; + s->ifft_in->ch_layout.nb_channels = s->nb_threads; ret = av_frame_get_buffer(s->ifft_in, 0); if (ret < 0) return ret; s->ifft_out->format = inlink->format; s->ifft_out->nb_samples = s->ifft_out_size * 2; - s->ifft_out->ch_layout.nb_channels = s->frequency_band_count; + s->ifft_out->ch_layout.nb_channels = s->nb_threads; ret = av_frame_get_buffer(s->ifft_out, 0); if (ret < 0) return ret; |