summaryrefslogtreecommitdiffstats
path: root/video/out
diff options
context:
space:
mode:
authorNiklas Haas <git@nand.wakku.to>2014-04-01 00:17:07 +0200
committerwm4 <wm4@nowhere>2014-06-22 19:02:06 +0200
commitfbd35caef830a1d0a25f1ee6e3b5d71453c98a59 (patch)
tree9e0e3a6ec3fcb7bf573ab023b84691cc6d4b8951 /video/out
parent7f3ea1280228175664241ba5b8edaee48fd33439 (diff)
downloadmpv-fbd35caef830a1d0a25f1ee6e3b5d71453c98a59.tar.bz2
mpv-fbd35caef830a1d0a25f1ee6e3b5d71453c98a59.tar.xz
video: Refactor rendering intent for DCP XYZ and :srgb
Notably, we now conform to SMPTE 428-1-2006 when decoding XYZ12 input, and we can support rendering intents other than colorimetric when converting between BT.709 and BT.2020, like with :srgb or :icc-profile.
Diffstat (limited to 'video/out')
-rw-r--r--video/out/gl_video.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/video/out/gl_video.c b/video/out/gl_video.c
index 989c1792db..52ad1a66f4 100644
--- a/video/out/gl_video.c
+++ b/video/out/gl_video.c
@@ -577,7 +577,11 @@ static void update_uniforms(struct gl_video *p, GLuint program)
if (loc >= 0) {
float m[3][4] = {{0}};
if (p->image_desc.flags & MP_IMGFLAG_XYZ) {
- mp_get_xyz2rgb_coeffs(&cparams, p->csp_src, m);
+ // Hard-coded as relative colorimetric for now, since this transforms
+ // from the source file's D55 material to whatever color space our
+ // projector/display lives in, which should be D55 for a proper
+ // home cinema setup either way.
+ mp_get_xyz2rgb_coeffs(&cparams, p->csp_src, MP_INTENT_RELATIVE_COLORIMETRIC, m);
} else {
mp_get_yuv2rgb_coeffs(&cparams, m);
}
@@ -649,7 +653,10 @@ static void update_uniforms(struct gl_video *p, GLuint program)
loc = gl->GetUniformLocation(program, "cms_matrix");
if (loc >= 0) {
float cms_matrix[3][3] = {{0}};
- mp_get_cms_matrix(p->csp_src, p->csp_dest, cms_matrix);
+ // Hard-coded to relative colorimetric - for a BT.2020 3DLUT we expect
+ // the input to be actual BT.2020 and not something red- or blueshifted,
+ // and for sRGB monitors we most likely want relative scaling either way.
+ mp_get_cms_matrix(p->csp_src, p->csp_dest, MP_INTENT_RELATIVE_COLORIMETRIC, cms_matrix);
gl->UniformMatrix3fv(loc, 1, GL_TRUE, &cms_matrix[0][0]);
}