diff options
author | Paul B Mahol <onemda@gmail.com> | 2022-12-12 17:20:53 +0100 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2022-12-12 20:29:07 +0100 |
commit | 69ac78da9befee4a3238721cdb06ceb6fdac6f0a (patch) | |
tree | aa105571ca21345d2aa8bd0925b40ece7fb2c1f8 /libavfilter/afir_template.c | |
parent | a73f4ca49b67ecb317c845eff1b02cadd9e513b9 (diff) | |
download | ffmpeg-69ac78da9befee4a3238721cdb06ceb6fdac6f0a.tar.gz |
avfilter/afir_template: avoid indirect accessing nb_partitions value
Diffstat (limited to 'libavfilter/afir_template.c')
-rw-r--r-- | libavfilter/afir_template.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libavfilter/afir_template.c b/libavfilter/afir_template.c index bd8a907bd4..fea0627b6b 100644 --- a/libavfilter/afir_template.c +++ b/libavfilter/afir_template.c @@ -267,6 +267,7 @@ static int fn(fir_quantum)(AVFilterContext *ctx, AVFrame *out, int ch, int offse ftype *sumin = (ftype *)seg->sumin->extended_data[ch]; ftype *sumout = (ftype *)seg->sumout->extended_data[ch]; int *output_offset = &seg->output_offset[ch]; + const int nb_partitions = seg->nb_partitions; const int input_offset = seg->input_offset; const int part_size = seg->part_size; int j; @@ -306,7 +307,7 @@ static int fn(fir_quantum)(AVFilterContext *ctx, AVFrame *out, int ch, int offse j = seg->part_index[ch]; - for (int i = 0; i < seg->nb_partitions; i++) { + for (int i = 0; i < nb_partitions; i++) { const int coffset = j * seg->coeff_size; const ftype *blockout = (const ftype *)seg->blockout->extended_data[ch] + i * seg->block_size; const ctype *coeff = (const ctype *)seg->coeff->extended_data[ch * !s->one2many] + coffset; @@ -317,7 +318,7 @@ static int fn(fir_quantum)(AVFilterContext *ctx, AVFrame *out, int ch, int offse s->afirdsp.dcmul_add(sumin, blockout, (const ftype *)coeff, part_size); #endif if (j == 0) - j = seg->nb_partitions; + j = nb_partitions; j--; } @@ -331,7 +332,7 @@ static int fn(fir_quantum)(AVFilterContext *ctx, AVFrame *out, int ch, int offse buf = (ftype *)seg->buffer->extended_data[ch]; memcpy(buf, sumout + part_size, part_size * sizeof(*buf)); - seg->part_index[ch] = (seg->part_index[ch] + 1) % seg->nb_partitions; + seg->part_index[ch] = (seg->part_index[ch] + 1) % nb_partitions;; memmove(src, src + min_part_size, (seg->input_size - min_part_size) * sizeof(*src)); |