diff options
author | Paul B Mahol <onemda@gmail.com> | 2018-12-30 17:23:53 +0100 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2018-12-30 17:50:44 +0100 |
commit | 72270d5bd071684944fa0a09d390e818aa76a975 (patch) | |
tree | 1b4aa8deef844241badbf97e7c5ed210e3ada0f4 | |
parent | e4788ae31b2e9af45d11f4bf4498c075dcc25a6c (diff) | |
download | ffmpeg-72270d5bd071684944fa0a09d390e818aa76a975.tar.gz |
avfilter/af_afir: optimize code a little more
Avoid memset.
-rw-r--r-- | libavfilter/af_afir.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/libavfilter/af_afir.c b/libavfilter/af_afir.c index 8271c2cfce..3e13edf96a 100644 --- a/libavfilter/af_afir.c +++ b/libavfilter/af_afir.c @@ -76,7 +76,6 @@ static int fir_channel(AVFilterContext *ctx, void *arg, int ch, int nb_jobs) seg->output_offset[ch] += s->min_part_size; if (seg->output_offset[ch] == seg->part_size) { seg->output_offset[ch] = 0; - memset(dst, 0, sizeof(*dst) * seg->part_size); } else { memmove(src, src + s->min_part_size, (seg->input_size - s->min_part_size) * sizeof(*src)); @@ -119,9 +118,7 @@ static int fir_channel(AVFilterContext *ctx, void *arg, int ch, int nb_jobs) buf[n] += sum[n]; } - for (n = 0; n < seg->part_size; n++) { - dst[n] += buf[n]; - } + memcpy(dst, buf, seg->part_size * sizeof(*dst)); buf = (float *)seg->buffer->extended_data[ch]; memcpy(buf, sum + seg->part_size, seg->part_size * sizeof(*buf)); |