From e73c83d3dfd0d492701ed1b8e9a2dd8e5d760151 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Mon, 16 May 2016 14:39:42 +0200 Subject: 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. --- video/out/opengl/video.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'video') 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, -- cgit v1.2.3