@@ -1143,20 +1143,20 @@ const YuvConstants SIMD_ALIGNED(kYvuJPEGConstants) = {
11431143#undef YG
11441144
11451145// BT.709 YUV to RGB reference
1146- // * R = Y - V * -1.28033
1147- // * G = Y - U * 0.21482 - V * 0.38059
1148- // * B = Y - U * -2.12798
1146+ // R = (Y - 16) * 1.164 - V * -1.793
1147+ // G = ( Y - 16) * 1.164 - U * 0.213 - V * 0.533
1148+ // B = ( Y - 16) * 1.164 - U * -2.112
11491149
11501150// Y contribution to R,G,B. Scale and bias.
1151- #define YG 16320 /* round(1.000 * 64 * 256 * 256 / 257) */
1152- #define YGB 32 /* 64 / 2 */
1151+ #define YG 18997 /* round(1.164 * 64 * 256 * 256 / 257) */
1152+ #define YGB - 1160 /* 1.164 * 64 * -16 + 64 / 2 */
11531153
1154- // TODO(fbarchard): Find way to express 2.12 instead of 2.0.
1154+ // TODO(fbarchard): Find way to express 2.112 instead of 2.0.
11551155// U and V contributions to R,G,B.
1156- #define UB -128 /* max(-128, round(-2.12798 * 64)) */
1157- #define UG 14 /* round(0.21482 * 64) */
1158- #define VG 24 /* round(0.38059 * 64) */
1159- #define VR -82 /* round(-1.28033 * 64) */
1156+ #define UB -128 /* max(-128, round(-2.112 * 64)) */
1157+ #define UG 14 /* round(0.213 * 64) */
1158+ #define VG 34 /* round(0.533 * 64) */
1159+ #define VR -115 /* round(-1.793 * 64) */
11601160
11611161// Bias values to round, and subtract 128 from U and V.
11621162#define BB (UB * 128 + YGB )
0 commit comments