mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-10-24 02:09:03 +03:00
S16 saturating sum must be computed dot-product-first. The LSX/LASX code accumulated the offset into the dot product with wrapping vmaddwev/wod, so large-magnitude sums wrapped instead of saturating. Accumulate the dot product from zero (wrapping is exact: the dot product cannot overflow S16 for 8-bit with log2_denom < 7), then add the offset with a saturating vsadd. Also tweaked the checkasm test itself to cover only valid width and height combo. This fixes bi-weight checkasm test for all currently available asm implementations. Signed-off-by: Zuxy Meng <zuxy.meng@gmail.com>