Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(329)

Unified Diff: src/gpu/effects/GrYUVtoRGBEffect.cpp

Issue 1241723005: Add Rec709 YUV color space support to GrYUVtoRGBEffect. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Tricksy floatses. Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkImageInfo.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrYUVtoRGBEffect.cpp
diff --git a/src/gpu/effects/GrYUVtoRGBEffect.cpp b/src/gpu/effects/GrYUVtoRGBEffect.cpp
index a46cb920777ca99d174ad7c2c56d482555ab869e..dd1b48082c6bd1487c835c4e0328014b6b876a48 100644
--- a/src/gpu/effects/GrYUVtoRGBEffect.cpp
+++ b/src/gpu/effects/GrYUVtoRGBEffect.cpp
@@ -54,6 +54,7 @@ public:
public:
static const GrGLfloat kJPEGConversionMatrix[16];
static const GrGLfloat kRec601ConversionMatrix[16];
+ static const GrGLfloat kRec709ConversionMatrix[16];
// this class always generates the same code.
static void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder*) {}
@@ -91,6 +92,9 @@ public:
case kRec601_SkYUVColorSpace:
pdman.setMatrix4f(fMatrixUni, kRec601ConversionMatrix);
break;
+ case kRec709_SkYUVColorSpace:
+ pdman.setMatrix4f(fMatrixUni, kRec709ConversionMatrix);
+ break;
}
}
@@ -161,6 +165,11 @@ const GrGLfloat YUVtoRGBEffect::GLProcessor::kRec601ConversionMatrix[16] = {
1.164f, -0.391f, -0.813f, 0.52925f,
1.164f, 2.018f, 0.0f, -1.08175f,
0.0f, 0.0f, 0.0f, 1.0};
+const GrGLfloat YUVtoRGBEffect::GLProcessor::kRec709ConversionMatrix[16] = {
+ 1.164f, 0.0f, 1.793f, -0.96925f,
+ 1.164f, -0.213f, -0.533f, 0.30025f,
+ 1.164f, 2.112f, 0.0f, -1.12875f,
+ 0.0f, 0.0f, 0.0f, 1.0f};
}
//////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « include/core/SkImageInfo.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698