2009/2/13 Matthias Hopf
On Feb 11, 09 11:28:56 -0800, Yang Zhao wrote:
static float ps_alu_consts[] = { - 1.0, 0.0, 1.13983, -1.13983/2, // r - c[0] - 1.0, -0.39465, -0.5806, (0.39465+0.5806)/2, // g - c[1] - 1.0, 2.03211, 0.0, -2.03211/2, // b - c[2] + 1.0, 0.0, 1.4020, 0, // r - c[0] + 1.0, -0.34414, -0.71414, 0, // g - c[1] + 1.0, 1.7720, 0.0, 0, // b - c[2] + /* Constants for undoing Y'CbCr scaling + * - Y' is scaled from 16:235 + * - Cb/Cr are scaled from 16:240 + * Unscaled value N' = N * N_mul + N_shift (N' in range [-0.5, 0.5]) + * Vector is [Y_mul, Y_shfit, C_mul, C_shift] + */ + 256.0/219.0, -16.0/219.0, 256.0/224.0, -128.0/224.0,
I don't understand this, Alex. You are changing *both* the color conversion matrix *and* introducing scaling functions?!?
The change to the conversion matrix is actually to make it follow BT.709 instead of BT.601. The former seemed like a better default, as it's what's used in HD media, and the difference between the two is claimed to be mostly negligible.
The scaling can be perfectly embedded in the color matrix.
My linear algebra is a little rusty, so I wasn't sure if was possible to fold the 2 sets scaling multiplier and offset into the conversion matrix when I made the patch. I can give this another look-over. -- Yang Zhao http://yangman.ca -- To unsubscribe, e-mail: radeonhd+unsubscribe@opensuse.org For additional commands, e-mail: radeonhd+help@opensuse.org