X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavfilter%2Fvf_nlmeans.c;h=7451bec4ae6e294f622b4b28fb5e340f06427842;hb=3a3e8c35b63a40c4d59161097dc8652c15d13779;hp=dcb5a0395334565e798d730eebb1b932846df246;hpb=bad70b7af6b909691f5389e14eb7d0c03db10af9;p=ffmpeg diff --git a/libavfilter/vf_nlmeans.c b/libavfilter/vf_nlmeans.c index dcb5a039533..7451bec4ae6 100644 --- a/libavfilter/vf_nlmeans.c +++ b/libavfilter/vf_nlmeans.c @@ -419,7 +419,7 @@ static void weight_averages(uint8_t *dst, ptrdiff_t dst_linesize, // Also weight the centered pixel wa[x].total_weight += 1.f; wa[x].sum += 1.f * src[x]; - dst[x] = av_clip_uint8(wa[x].sum / wa[x].total_weight); + dst[x] = av_clip_uint8(wa[x].sum / wa[x].total_weight + 0.5f); } dst += dst_linesize; src += src_linesize; @@ -577,7 +577,7 @@ static const AVFilterPad nlmeans_outputs[] = { { NULL } }; -AVFilter ff_vf_nlmeans = { +const AVFilter ff_vf_nlmeans = { .name = "nlmeans", .description = NULL_IF_CONFIG_SMALL("Non-local means denoiser."), .priv_size = sizeof(NLMeansContext),