Browse Source

avfilter/vf_nlmeans: round values toward nearest integer

Instead of rounding toward zero and thus producing
darker output.
tags/n4.3
Paul B Mahol 5 years ago
parent
commit
a174e5f8da
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavfilter/vf_nlmeans.c

+ 1
- 1
libavfilter/vf_nlmeans.c View 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;


Loading…
Cancel
Save