avfilter/vf_delogo: round to the closest value
authorJean Delvare <jdelvare@suse.de>
Wed, 9 Dec 2015 11:07:47 +0000 (12:07 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Wed, 9 Dec 2015 11:23:00 +0000 (12:23 +0100)
commite74f1a121e94587d0df8a7f5a12f2d48a974695c
tree48a3a865c69137e7a47f8f1af55b788e56e8fae6
parentc8905e0d67f54b3228ea0aec57b7087925c0508b
avfilter/vf_delogo: round to the closest value

When the interpolated value is divided by the sum of weights, no
rounding is done, which means the value is truncated. This results in
a slight bias towards dark green in the interpolated area. Rounding
properly removes the bias.

I measured this change to reduce the interpolation error by 1 to 2 %
on average on a number of sample input and logo area combinations.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavfilter/vf_delogo.c
tests/ref/fate/filter-delogo