nir/lower_tex: Fix minor error in YUV color conversion matrix
authorJohnson Lin <johnson.lin@intel.com>
Thu, 4 May 2017 06:37:52 +0000 (14:37 +0800)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 4 May 2017 06:44:59 +0000 (23:44 -0700)
commita6fb943f3eb86ca501a7e7b8d4621ba215f91133
tree8509c6cbadad0e0702e14b7e1dd3058774cec563
parentda665d22f55ba4af0f6f3c4fbea80a193e7028c1
nir/lower_tex: Fix minor error in YUV color conversion matrix

The matrix used for YCbCr to RGB is listed in:

    https://en.wikipedia.org/wiki/YCbCr

There was an error in converting the offsets from integers to unorm
values: 0.0625=16/256 should be 16.0/255,and 0.5=128.0/256 should be
128.0/255.  With this fix, the CSC result is bit aligned with wikipedia's
conversion result and FFMPeg's result.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100854
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
src/compiler/nir/nir_lower_tex.c