aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/ulti.c
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2013-07-02 13:50:02 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-07-03 23:10:57 +0200
commitf0bcb13aedcff8b4a454347c634ac41aefab9e86 (patch)
treea4c733a6b3c27fd314ca359688e908ff2b9ce6de /libavcodec/ulti.c
parent99f1d7493349640a1489b6b42dec20a9b1326f9b (diff)
downloadffmpeg-f0bcb13aedcff8b4a454347c634ac41aefab9e86.tar.gz
lavfi/delogo: avoid propagation of rounding errors in chroma planes
When operating on subsampled chroma planes, some rounding is taking place. The left and top borders are rounded down while the width and height are rounded up, so all rounding is done outward to guarantee the logo area is fully covered. The problem is that the width and height are counted from the unrounded left and top borders, respectively. So if the left or top border position has indeed been rounded down, and the width or height needs no rounding (up), the position of the the right or bottom border will be effectively rounded down, i.e. inward. The issue can easily be seen with a yuv240p input and -vf delogo=45:45:60:40:show=1 -vframes 1 delogo-bug.png (or virtually any logo area with odd x and y and even width and height.) The right and bottom chroma borders (in green) are clearly off. In order to fix this, the width and height must be adjusted to include the bits lost in the rounding of the left and top border positions, respectively, prior to being themselves rounded up. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/ulti.c')
0 files changed, 0 insertions, 0 deletions