From eaba6bfc51cc7a5ff5be8769ca6165e85a515034 Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Sun, 25 Dec 2022 10:24:07 +0100 Subject: [PATCH] avfilter/afir_template: reduce memset overhead a little --- 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);