summaryrefslogtreecommitdiff
path: root/libavfilter
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2019-10-20 21:53:11 +0200
committerPaul B Mahol <onemda@gmail.com>2019-10-21 09:26:41 +0200
commita174e5f8da77d17dc16227f94eb14db7fd0365a4 (patch)
treeefbe8aaba91e71afdf82c6212d880e28423bbdb8 /libavfilter
parent0afc1fe1470094e84dfa4e25a7f1bb2d52fbb92c (diff)
avfilter/vf_nlmeans: round values toward nearest integer
Instead of rounding toward zero and thus producing darker output.
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/vf_nlmeans.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavfilter/vf_nlmeans.c b/libavfilter/vf_nlmeans.c
index dcb5a03953..06233b0dd4 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;