summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiklas Haas <git@nand.wakku.to>2014-12-29 14:48:16 +0100
committerDiogo Franco (Kovensky) <diogomfranco@gmail.com>2015-01-25 17:00:15 +0900
commitca048e8d6d74512bddeaed1d208adac37aaa885c (patch)
tree2bf351137e8ff6a8fba450ccd2f9af39a811a9b5
parenta2f4391ca15b257411d3e92b65c6197975d47b04 (diff)
downloadmpv-ca048e8d6d74512bddeaed1d208adac37aaa885c.tar.bz2
mpv-ca048e8d6d74512bddeaed1d208adac37aaa885c.tar.xz
vo_opengl: Ignore approx-gamma for BT.2020-CL
The details of the non-linear transformation from/to BT.2020's constant luminance system don't really make sense with any other gamma curve, since changing the gamma curve completely breaks the chroma channels.
-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 e9d91e3f17..fda99a83b0 100644
--- a/video/out/gl_video.c
+++ b/video/out/gl_video.c
@@ -936,8 +936,8 @@ static void compile_shaders(struct gl_video *p)
// Linear light scaling is only enabled when either color correction
// option (3dlut or srgb) is enabled, otherwise scaling is done in the
- // source space. We also need to linearize for constant luminance systems.
- if ((!p->is_linear_rgb && use_cms) || use_const_luma) {
+ // source space.
+ if (!p->is_linear_rgb && use_cms) {
// We just use the color level range to distinguish between PC
// content like images, which are most likely sRGB, and TV content
// like movies, which are most likely BT.2020
@@ -952,6 +952,13 @@ static void compile_shaders(struct gl_video *p)
}
}
+ // We also need to linearize for the constant luminance system. This
+ // transformation really makes no sense with anything other than the
+ // official gamma curves, though. This overrides approx-gamma.
+ if (use_const_luma) {
+ gamma_fun = MP_CSP_TRC_BT_2020_EXACT;
+ }
+
// Figure out the right color spaces we need to convert, if any
enum mp_csp_prim prim_src = p->image_params.primaries, prim_dest;
if (use_cms) {