summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorNiklas Haas <git@nand.wakku.to>2016-05-16 14:39:42 +0200
committerNiklas Haas <git@nand.wakku.to>2016-05-16 14:42:45 +0200
commite73c83d3dfd0d492701ed1b8e9a2dd8e5d760151 (patch)
tree5cc78f8a3647f5bea8cd57b43ec06a665cb1392a /video
parente6f6ae94f3ab4e4e25c23b7cd837efee9eb64b75 (diff)
downloadmpv-e73c83d3dfd0d492701ed1b8e9a2dd8e5d760151.tar.bz2
mpv-e73c83d3dfd0d492701ed1b8e9a2dd8e5d760151.tar.xz
vo_opengl: skip tonemapping if the output trc is HDR
This makes it so that users with actual HDR displays can just set their config to target-trc=st2084 and get native HDR output. This will look a bit silly for SDR content (everything will be really bright), but for lack of a better tone mapping situation (including reverse tone mapping) this is the easiest thing to do for now. Ideally the brightness metadata should be part of the colorspace struct or something (with mpv always adapting where necessary), but it depends on the TRC and not the primaries so it's a bit more complicated than that.
Diffstat (limited to 'video')
-rw-r--r--video/out/opengl/video.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c
index 291290b2cc..f217bc7a70 100644
--- a/video/out/opengl/video.c
+++ b/video/out/opengl/video.c
@@ -2259,7 +2259,9 @@ static void pass_colormanage(struct gl_video *p, bool display_scaled,
// For HDR, the assumption of reference brightness = display brightness
// is discontinued. Instead, we have to tone map the brightness to
// the display using some algorithm.
- if (p->image_params.gamma == MP_CSP_TRC_SMPTE_ST2084 && !display_scaled) {
+ if (p->image_params.gamma == MP_CSP_TRC_SMPTE_ST2084 &&
+ trc_dst != MP_CSP_TRC_SMPTE_ST2084 && !display_scaled)
+ {
GLSLF("// HDR tone mapping\n");
int reference_brightness = 10000; // As per SMPTE ST.2084
pass_tone_map(p->sc, reference_brightness, p->opts.target_brightness,