gallium/vl: Simplify usage of full range matrices
authorThomas Hellstrom <thellstrom@vmware.com>
Fri, 4 Mar 2016 10:49:31 +0000 (11:49 +0100)
committerThomas Hellstrom <thellstrom@vmware.com>
Wed, 22 Feb 2017 09:19:27 +0000 (10:19 +0100)
commit4c3fe3257de2cf9e00554c426aea676d57faea43
treeeca44190255a0ffa9e75c5b1587b097c40da3629
parentf01e947cdb81f182202146c01e8678770eebf68e
gallium/vl: Simplify usage of full range matrices

When looking at the full range matrices, it becomes obvious that the difference
between the standard matrices and the full range matrices is that the full
range matrices are multiplied by 1.164. Together with offsetting the y value
with -16/255, this will scale and offset RGB with the desired quantities.

However, the standard SMPTE 240M matrix seems to differ a bit since the
U and V coefficients are only multiplied with 1.138 to get the full range
matrix. This would actually alter the color somewhat so I figure that's an
error. The full range matrix is consistent with Nvidia's VDPAU implementation.

We can also incorporate the ybias in the brightness simplifying the
calculation somewhat.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
src/gallium/auxiliary/vl/vl_csc.c