another nub question. what's "saturated" math and how is it used in mmx?
Posted on 2003-12-16 17:50:13 by evil__donkey
Staurated mean that when you add a byte with a byte the result will never get greater than 255 -->gets saturated to 255 and no carry is generate for the next adiacent byte . So adding color 233+128=255 :)

Same goes for substracting -> get saturated to 0 (zero) and no burrow gets to adiacent bytes. So: 128-233=0

(like for example addin R1+R2, G1+G2, B1+B2 components in 2 RGB colors)

Mostly very usefull for add/sub 24 or 32 bits colors in alpha blending or other effects

MMX registers/instructions are able to make 8 such additions in a sigle instruction

Othewise (or for 16bits colors) one must use compares and jumps and this will sow down the CPU ....

For 8bits colors there is no problem because you can easy make up an LUT(look up table) for this .

:grin: but with the new P4 who knows :P
Posted on 2003-12-16 19:19:48 by BogdanOntanu