[FFmpeg-cvslog] avfilter/afir_template: reduce memset overhead a little

Paul B Mahol git at videolan.org
Sun Dec 25 21:38:08 EET 2022


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sun Dec 25 10:24:07 2022 +0100| [eaba6bfc51cc7a5ff5be8769ca6165e85a515034] | committer: Paul B Mahol

avfilter/afir_template: reduce memset overhead a little

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

 libavfilter/afir_template.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavfilter/afir_template.c b/libavfilter/afir_template.c
index cce0800de9..d42ff882d3 100644
--- a/libavfilter/afir_template.c
+++ b/libavfilter/afir_template.c
@@ -279,13 +279,13 @@ static void fn(convert_channel)(AVFilterContext *ctx, AudioFIRContext *s, int ch
 
     av_log(ctx, AV_LOG_DEBUG, "channel: %d\n", ch);
 
-    memset(tempin, 0, sizeof(*tempin) * seg->fft_length);
+    memset(tempin + size, 0, sizeof(*tempin) * (seg->block_size - size));
     memcpy(tempin, time + seg->input_offset + coeff_partition * seg->part_size,
            size * sizeof(*tempin));
 
     seg->ctx_fn(seg->ctx[ch], tempout, tempin, sizeof(*tempin));
 
-    memcpy(coeff + coffset, tempout, (seg->part_size + 1) * sizeof(*coeff));
+    memcpy(coeff + coffset, tempout, seg->coeff_size * sizeof(*coeff));
 
     av_log(ctx, AV_LOG_DEBUG, "nb_partitions: %d\n", seg->nb_partitions);
     av_log(ctx, AV_LOG_DEBUG, "partition size: %d\n", seg->part_size);



More information about the ffmpeg-cvslog mailing list