summaryrefslogtreecommitdiff
path: root/libavfilter/vf_bm3d.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2019-10-19 18:53:48 +0200
committerPaul B Mahol <onemda@gmail.com>2019-10-19 18:53:48 +0200
commita60232ab2d372d88d4590bad3b0857de9e132ce4 (patch)
treef35f99e96b9775dfbaa4b08f8155d523e69636c7 /libavfilter/vf_bm3d.c
parent7080bbfef401b8887d4e3ed2d7b2188a134614ff (diff)
downloadffmpeg-a60232ab2d372d88d4590bad3b0857de9e132ce4.tar.gz
avfilter/vf_bm3d: round values toward nearest integer
Instead of rounding toward zero and thus producing darker output.
Diffstat (limited to 'libavfilter/vf_bm3d.c')
-rw-r--r--libavfilter/vf_bm3d.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavfilter/vf_bm3d.c b/libavfilter/vf_bm3d.c
index f8d656c178..eb45a70bbd 100644
--- a/libavfilter/vf_bm3d.c
+++ b/libavfilter/vf_bm3d.c
@@ -660,7 +660,7 @@ static void do_output(BM3DContext *s, uint8_t *dst, int dst_linesize,
sum_den += den;
}
- dstp[j] = av_clip_uint8(sum_num / sum_den);
+ dstp[j] = av_clip_uint8(lrintf(sum_num / sum_den));
}
}
}
@@ -688,7 +688,7 @@ static void do_output16(BM3DContext *s, uint8_t *dst, int dst_linesize,
sum_den += den;
}
- dstp[j] = av_clip_uintp2_c(sum_num / sum_den, depth);
+ dstp[j] = av_clip_uintp2_c(lrintf(sum_num / sum_den), depth);
}
}
}