summaryrefslogtreecommitdiffstats
path: root/video/filter
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.xyz>2017-06-14 20:06:56 +0200
committerwm4 <wm4@nowhere>2017-06-18 20:54:44 +0200
commit1f3000b03c5ca8208858634ba57833d7dbb009cc (patch)
tree9bc913987fed190f4425030cc360248616b56e6b /video/filter
parentfe1227883a865b845c0c271bafd281f288404acb (diff)
downloadmpv-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/filter')
-rw-r--r--video/filter/vf_format.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/video/filter/vf_format.c b/video/filter/vf_format.c
index 2cb6943879..ed9e4214ee 100644
--- a/video/filter/vf_format.c
+++ b/video/filter/vf_format.c
@@ -39,6 +39,7 @@ struct vf_priv_s {
int primaries;
int gamma;
float sig_peak;
+ int light;
int chroma_location;
int stereo_in;
int stereo_out;
@@ -97,6 +98,8 @@ static int reconfig(struct vf_instance *vf, struct mp_image_params *in,
out->color.gamma = p->gamma;
if (p->sig_peak)
out->color.sig_peak = p->sig_peak;
+ if (p->light)
+ out->color.light = p->light;
if (p->chroma_location)
out->chroma_location = p->chroma_location;
if (p->stereo_in)
@@ -146,6 +149,7 @@ static const m_option_t vf_opts_fields[] = {
OPT_CHOICE_C("primaries", primaries, 0, mp_csp_prim_names),
OPT_CHOICE_C("gamma", gamma, 0, mp_csp_trc_names),
OPT_FLOAT("sig-peak", sig_peak, 0),
+ OPT_CHOICE_C("light", light, 0, mp_csp_light_names),
OPT_CHOICE_C("chroma-location", chroma_location, 0, mp_chroma_names),
OPT_CHOICE_C("stereo-in", stereo_in, 0, mp_stereo3d_names),
OPT_CHOICE_C("stereo-out", stereo_out, 0, mp_stereo3d_names),