mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-13 06:24:27 +02:00
yuv.h: update RGB<->YUV coefficients in comment
The values for the R/G/B floating point formulas resembled https://fourcc.org/fccyvrgb.php and Video Demystified, but the fixed point values are more closely aligned to rounded values from https://en.wikipedia.org/wiki/YCbCr and BT.601. The R/G/B formulas with the values prior to this change are added to sharpyuv_csp.c as they align with the fixed values. The origin of those coefficients is unclear. For consistency between library versions we'll leave them as is. Bug: webp:375011696 Change-Id: Id3f2a57530eee700cc52a899b32b25b5c015e89b
This commit is contained in:
@ -60,6 +60,10 @@ void SharpYuvComputeConversionMatrix(const SharpYuvColorSpace* yuv_color_space,
|
||||
|
||||
// Matrices are in YUV_FIX fixed point precision.
|
||||
// WebP's matrix, similar but not identical to kRec601LimitedMatrix
|
||||
// Derived using the following formulas:
|
||||
// Y = 0.2569 * R + 0.5044 * G + 0.0979 * B + 16
|
||||
// U = -0.1483 * R - 0.2911 * G + 0.4394 * B + 128
|
||||
// V = 0.4394 * R - 0.3679 * G - 0.0715 * B + 128
|
||||
static const SharpYuvConversionMatrix kWebpMatrix = {
|
||||
{16839, 33059, 6420, 16 << 16},
|
||||
{-9719, -19081, 28800, 128 << 16},
|
||||
|
Reference in New Issue
Block a user