mirror of
https://github.com/mpv-player/mpv
synced 2024-12-27 01:22:30 +00:00
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:
parent
e6f6ae94f3
commit
e73c83d3df
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user