diff options
author | Paul B Mahol <onemda@gmail.com> | 2022-02-25 10:30:33 +0100 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2022-02-25 18:15:26 +0100 |
commit | e845c41c944ebc42411c9cc52f8d13faed1b78a3 (patch) | |
tree | be015c5eeae8326226ad9c3ccb5ad429fd37809d /libavfilter/af_dynaudnorm.c | |
parent | c523724c693ee031d8b5351aff6232a1f7d86876 (diff) | |
download | ffmpeg-e845c41c944ebc42411c9cc52f8d13faed1b78a3.tar.gz |
avfilter/af_dynaudnorm: cleanup gaussian_filter() function
Diffstat (limited to 'libavfilter/af_dynaudnorm.c')
-rw-r--r-- | libavfilter/af_dynaudnorm.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libavfilter/af_dynaudnorm.c b/libavfilter/af_dynaudnorm.c index 783266f8c1..121a3ef5d7 100644 --- a/libavfilter/af_dynaudnorm.c +++ b/libavfilter/af_dynaudnorm.c @@ -435,12 +435,16 @@ static double minimum_filter(cqueue *q) static double gaussian_filter(DynamicAudioNormalizerContext *s, cqueue *q, cqueue *tq) { + const double *weights = s->weights; double result = 0.0, tsum = 0.0; int i; for (i = 0; i < cqueue_size(q); i++) { - tsum += cqueue_peek(tq, i) * s->weights[i]; - result += cqueue_peek(q, i) * s->weights[i] * cqueue_peek(tq, i); + double tq_item = cqueue_peek(tq, i); + double q_item = cqueue_peek(q, i); + + tsum += tq_item * weights[i]; + result += tq_item * weights[i] * q_item; } if (tsum == 0.0) |