From 3ce97d8ddd68ff7fddcc75ae1a9b29abcb5acad0 Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Fri, 22 Jan 2021 18:18:38 +0100 Subject: [PATCH] avfilter/vf_atadenoise: fix mid calculation --- libavfilter/vf_atadenoise.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavfilter/vf_atadenoise.c b/libavfilter/vf_atadenoise.c index b543665ebf..ccbda723f0 100644 --- a/libavfilter/vf_atadenoise.c +++ b/libavfilter/vf_atadenoise.c @@ -135,7 +135,7 @@ static av_cold int init(AVFilterContext *ctx) s->size |= 1; } s->radius = s->size / 2; - s->mid = s->radius + 1; + s->mid = s->radius; return 0; } @@ -429,7 +429,7 @@ static int config_input(AVFilterLink *inlink) for (int p = 0; p < s->nb_planes; p++) { float sigma = s->radius * s->sigma[p]; - s->weights[p][s->mid] = 1.f; + s->weights[p][s->radius] = 1.f; for (int n = 1; n <= s->radius; n++) { s->weights[p][s->radius + n] = s->weights[p][s->radius - n] = expf(-0.5 * (n + 1) * (n + 1) / (sigma * sigma));