]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/vf_nlmeans.c
avfilter/vf_identity: remove unnecessary check
[ffmpeg] / libavfilter / vf_nlmeans.c
index dcb5a0395334565e798d730eebb1b932846df246..7451bec4ae6e294f622b4b28fb5e340f06427842 100644 (file)
@@ -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),