"Kristian H. Kristensen" <k...@bitplanet.net> writes: > Johnson Lin <johnson....@intel.com> writes: > >> The matrix used for YCbCr to RGB is listed in Wiki >> https://en.wikipedia.org/wiki/YCbCr; >> There is minor error in the matrix constant: 0.0625=16/256 should be >> 16.0/255, >> and 0.5=128.0/256 should be 128.0/255. >> Note that conversion from a 0-255 byte number to 0-1.0 float is to divide by >> 255 >> instead of 256. That's we get 255=1.0f. >> By the constant change we can see the CSC result is bit aligned with >> Wiki conversion result and FFMPeg result. >> Otherwise in some situation, there will be one bit difference > > Thanks for fixing this. Try to wrap the the commit message so it fits > in 80 columns, eg: > > The matrix used for YCbCr to RGB is listed in: > > https://en.wikipedia.org/wiki/YCbCr; > > There is minor error in the matrix constant: 0.0625=16/256 should be > 16.0/255, and 0.5=128.0/256 should be 128.0/255. Note that conversion > from a 0-255 byte number to 0-1.0 float is to divide by 255 instead of > 256. That's we get 255=1.0f. > > By the constant change we can see the CSC result is bit aligned with > Wiki conversion result and FFMPeg result. Otherwise in some situation, > there will be one bit difference
Proposed rewording: 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 <e...@anholt.net>
signature.asc
Description: PGP signature
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev