[FFmpeg-cvslog] avfilter/avf_showcwt: reduce memory usage even more

Paul B Mahol git at videolan.org
Fri Jul 28 15:00:21 EEST 2023


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Thu Jul 27 13:03:39 2023 +0200| [830e522cdecb644f869b59f8e58aed2e2fd59ff6] | committer: Paul B Mahol

avfilter/avf_showcwt: reduce memory usage even more

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=830e522cdecb644f869b59f8e58aed2e2fd59ff6
---

 libavfilter/avf_showcwt.c | 8 ++++----
 1 file 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;



More information about the ffmpeg-cvslog mailing list