Commit a60232ab authored by Paul B Mahol's avatar Paul B Mahol

avfilter/vf_bm3d: round values toward nearest integer

Instead of rounding toward zero and thus producing
darker output.
parent 7080bbfe
...@@ -660,7 +660,7 @@ static void do_output(BM3DContext *s, uint8_t *dst, int dst_linesize, ...@@ -660,7 +660,7 @@ static void do_output(BM3DContext *s, uint8_t *dst, int dst_linesize,
sum_den += den; 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, ...@@ -688,7 +688,7 @@ static void do_output16(BM3DContext *s, uint8_t *dst, int dst_linesize,
sum_den += den; 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);
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment