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.
This commit is contained in:
Niklas Haas 2016-05-16 14:39:42 +02:00
parent e6f6ae94f3
commit e73c83d3df
No known key found for this signature in database
GPG Key ID: 9A09076581B27402
1 changed files with 3 additions and 1 deletions

View File

@ -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,