Adjusting saturation value on i965?

Keith Packard keithp at keithp.com
Sun Feb 24 20:49:54 PST 2008


On Sun, 2008-02-24 at 22:27 +0200, Tero Saarni wrote:
> Textured video implementation on i965 has only brightness and contrast
> settings.  Is it possible to adjust saturation value by some other
> means?

The textured video adapters don't actually implement brightness and
contrast, they're just stubbed out in the driver to make some media
players happier.

To make these controls work, you'd need to go fix the YUV->RGB
transformation inside the fragment shader sitting down in the driver.
Check out the code in packed_yuv_wm.g4a -- it's got a little section
that does the conversion using this function:

     R = Clamp ( 1.164(Y-16/255) + 1.596(Cr-128/255), 0, 1)
     G = Clamp ( 1.164(Y-16/255) - 0.813(Cr-128/255) - 0.392(Cb-128/255), 0, 1)
     B = Clamp ( 1.164(Y-16/255) + 2.017(Cb-128/255), 0, 1)
 
Adjusting the constants in this function, or adding additional
instructions to de-linearize the transformation should be all that is
needed.

-- 
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.x.org/archives/xorg/attachments/20080225/e761a398/attachment.pgp>


More information about the xorg mailing list