DescriptionS32A_D565_Blend has a bug where it can overflow the final 5/6/5 values. This
happens because when we try to merge an 8-bit and a 5/6/5-bit value into the
same "space", we had been truncing down the 8-bit value. This is wrong...
e.g.
src 8-bit value: 0xF8
dst 5-bit value: 0x1F
If we trunc down, to move everyone into the 5-bit space, we get
src: 0x1F
dst: 0x1F
But now we *think* that our src is fully saturated (which it wasn't.. 0xF8)
and subsequently we've violated our premul requirement that all components
are <= alpha.
The fix is to perform the math in 8-bit space instead, so we promote the 5/6/5
values UP, do the math, and then shift them back down.
Patch Set 1 #
MessagesTotal messages: 2
|