diff options
author | 2014-09-16 06:23:50 -0700 | |
---|---|---|
committer | 2014-09-16 06:23:50 -0700 | |
commit | 223ba624b70ed5732688e3a8a63a423a9f9b02ad (patch) | |
tree | b9554206132349b2d607c22ed180e893735c9e8d /src/gpu/effects | |
parent | 9564ce60a657acce89fb956deb8645b324eaad1e (diff) |
Fix incorrect Rec601 YUV conversion matrix coefficient.
For future reference, the rec 601 matrix can be defined by the concatenation of these 2 matrices:
[1.164 0.0 1.596 0.0]
[1.164 -0.391 -0.813 0.0]
[1.164 2.018 0.0 0.0]
[1.164 0.0 0.0 1.0]
See: http://www.fourcc.org/fccyvrgb.php
and
[1.0 0.0 0.0 -0.0625]
[0.0 1.0 0.0 -0.5 ]
[0.0 0.0 1.0 -0.5 ]
[0.0 0.0 0.0 1.0 ]
Which transforms Y by -0.0625 (-16/256) and U and V by
-0.5 (-128/256) each.
Giving us the final matrix:
[1.164 0.0 1.596 -0.87075]
[1.164 -0.391 -0.813 0.52925]
[1.164 2.018 0.0 -1.08175]
[0.0 0.0 0.0 1.0 ]
Which produces our output [R,G,B,A], when multiplied
with an input [Y,U,V,A].
R=bsalomon@google.com
Author: rileya@chromium.org
Review URL: https://codereview.chromium.org/545983006
Diffstat (limited to 'src/gpu/effects')
-rw-r--r-- | src/gpu/effects/GrYUVtoRGBEffect.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gpu/effects/GrYUVtoRGBEffect.cpp b/src/gpu/effects/GrYUVtoRGBEffect.cpp index 0023b1b300..4ffc345a2c 100644 --- a/src/gpu/effects/GrYUVtoRGBEffect.cpp +++ b/src/gpu/effects/GrYUVtoRGBEffect.cpp @@ -132,8 +132,8 @@ const GrGLfloat YUVtoRGBEffect::GLEffect::kJPEGConversionMatrix[16] = { 1.0f, 1.772f, 0.0f, -0.886f, 0.0f, 0.0f, 0.0f, 1.0}; const GrGLfloat YUVtoRGBEffect::GLEffect::kRec601ConversionMatrix[16] = { - 1.164f, 0.0f, 1.596f, -1.08175f, - 1.164f, -0.391f, -0.813f, 0.529f, + 1.164f, 0.0f, 1.596f, -0.87075f, + 1.164f, -0.391f, -0.813f, 0.52925f, 1.164f, 2.018f, 0.0f, -1.08175f, 0.0f, 0.0f, 0.0f, 1.0}; } |