]> git.sesse.net Git - ffmpeg/commit
lavfi/gradfun: fix rounding in MMX code.
authorClément Bœsch <ubitux@gmail.com>
Thu, 6 Dec 2012 23:36:29 +0000 (00:36 +0100)
committerAnton Khirnov <anton@khirnov.net>
Thu, 28 Mar 2013 06:59:04 +0000 (07:59 +0100)
commit2d66fc543b01995d6146fc132a778d3e722ca665
tree22aadf11effb0a211c7f10461baf1fa238ba4da3
parent8b9a153ef3673d5847291987fa0dcddeac4a640b
lavfi/gradfun: fix rounding in MMX code.

Current code divides before increasing precision.

Also reduce upper bound for strength from 255 to 64.  This will prevent
an overflow in the SSSE3 and MMX filter_line code: delta is expressed as
an u16 being shifted by 2 to the left. If it overflows, having a
strength not above 64 will make sure that m is set to 0 (making the
m*m*delta >> 14 expression void).

A value above 64 should not make any sense unless gradfun is used as
a blur filter.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
doc/filters.texi
libavfilter/vf_gradfun.c
libavfilter/x86/vf_gradfun.c