diff options
author | Niklas Haas <git@haasn.xyz> | 2017-06-14 20:06:56 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2017-06-18 20:54:44 +0200 |
commit | 1f3000b03c5ca8208858634ba57833d7dbb009cc (patch) | |
tree | 9bc913987fed190f4425030cc360248616b56e6b /video/csputils.c | |
parent | fe1227883a865b845c0c271bafd281f288404acb (diff) | |
download | mpv-1f3000b03c5ca8208858634ba57833d7dbb009cc.tar.bz2 mpv-1f3000b03c5ca8208858634ba57833d7dbb009cc.tar.xz |
vo_opengl: implement support for OOTFs and non-display referred content
This introduces (yet another..) mp_colorspace members, an enum `light`
(for lack of a better name) which basically tells us whether we're
dealing with scene-referred or display-referred light, but also a bit
more metadata (in which way is the scene-referred light expected to be
mapped to the display?).
The addition of this parameter accomplishes two goals:
1. Allows us to actually support HLG more-or-less correctly[1]
2. Allows people playing back direct “camera” content (e.g. v-log or
s-log2) to treat it as scene-referred instead of display-referred
[1] Even better would be to use the display-referred OOTF instead of the
idealized OOTF, but this would require either native HLG support in
LittleCMS (unlikely) or more communication between lcms.c and
video_shaders.c than I'm remotely comfortable with
That being said, in principle we could switch our usage of the BT.1886
EOTF to the BT.709 OETF instead and treat BT.709 content as being
scene-referred under application of the 709+1886 OOTF; which moves that
particular conversion from the 3dlut to the shader code; but also allows
a) users like UliZappe to turn it off and b) supporting the full HLG
OOTF in the same framework. But I think I prefer things as they are
right now.
Diffstat (limited to 'video/csputils.c')
-rw-r--r-- | video/csputils.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/video/csputils.c b/video/csputils.c index 51019a8164..9db7bb54a9 100644 --- a/video/csputils.c +++ b/video/csputils.c @@ -84,6 +84,15 @@ const struct m_opt_choice_alternatives mp_csp_trc_names[] = { {0} }; +const struct m_opt_choice_alternatives mp_csp_light_names[] = { + {"auto", MP_CSP_LIGHT_AUTO}, + {"display", MP_CSP_LIGHT_DISPLAY}, + {"hlg", MP_CSP_LIGHT_SCENE_HLG}, + {"709-1886", MP_CSP_LIGHT_SCENE_709_1886}, + {"gamma1.2", MP_CSP_LIGHT_SCENE_1_2}, + {0} +}; + const char *const mp_csp_equalizer_names[MP_CSP_EQ_COUNT] = { "brightness", "contrast", @@ -112,6 +121,8 @@ void mp_colorspace_merge(struct mp_colorspace *orig, struct mp_colorspace *new) orig->gamma = new->gamma; if (!orig->sig_peak) orig->sig_peak = new->sig_peak; + if (!orig->light) + orig->light = new->light; } // The short name _must_ match with what vf_stereo3d accepts (if supported). |