summaryrefslogtreecommitdiffstats
path: root/video/csputils.c
diff options
context:
space:
mode:
authorNiklas Haas <git@nand.wakku.to>2016-06-26 19:04:36 +0200
committerwm4 <wm4@nowhere>2016-06-28 19:48:29 +0200
commit9278ce98f7198e61116043fe69f885bfca54ec1c (patch)
treefdec3d79c9a97239c7e30a07258d63c7cea5ab91 /video/csputils.c
parent4ce53025cb475408bfb27a56a57322d9d0c48a4f (diff)
downloadmpv-9278ce98f7198e61116043fe69f885bfca54ec1c.tar.bz2
mpv-9278ce98f7198e61116043fe69f885bfca54ec1c.tar.xz
vo_opengl: implement ARIB STD-B68 (HLG) HDR TRC
This HDR function is unique in that it's still display-referred, it just allows for values above the reference peak (super-highlights). The official standard doesn't actually document this very well, but the nominal peak turns out to be exactly 12.0 - so we normalize to this value internally in mpv. (This lets us preserve the property that the textures are encoded in the range [0,1], preventing clipping and making the best use of an integer texture's range) This was grouped together with SMPTE ST2084 when checking libavutil compatibility since they were added in the same release window, in a similar timeframe.
Diffstat (limited to 'video/csputils.c')
-rw-r--r--video/csputils.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/video/csputils.c b/video/csputils.c
index ffa1f82a6d..e9e6772ac8 100644
--- a/video/csputils.c
+++ b/video/csputils.c
@@ -78,6 +78,7 @@ const struct m_opt_choice_alternatives mp_csp_trc_names[] = {
{"gamma2.8", MP_CSP_TRC_GAMMA28},
{"prophoto", MP_CSP_TRC_PRO_PHOTO},
{"st2084", MP_CSP_TRC_SMPTE_ST2084},
+ {"std-b67", MP_CSP_TRC_ARIB_STD_B67},
{0}
};
@@ -171,8 +172,9 @@ enum mp_csp_trc avcol_trc_to_mp_csp_trc(int avtrc)
case AVCOL_TRC_LINEAR: return MP_CSP_TRC_LINEAR;
case AVCOL_TRC_GAMMA22: return MP_CSP_TRC_GAMMA22;
case AVCOL_TRC_GAMMA28: return MP_CSP_TRC_GAMMA28;
-#if HAVE_AVUTIL_ST2084
+#if HAVE_AVUTIL_HDR
case AVCOL_TRC_SMPTEST2084: return MP_CSP_TRC_SMPTE_ST2084;
+ case AVCOL_TRC_ARIB_STD_B67: return MP_CSP_TRC_ARIB_STD_B67;
#endif
default: return MP_CSP_TRC_AUTO;
}
@@ -222,8 +224,9 @@ int mp_csp_trc_to_avcol_trc(enum mp_csp_trc trc)
case MP_CSP_TRC_LINEAR: return AVCOL_TRC_LINEAR;
case MP_CSP_TRC_GAMMA22: return AVCOL_TRC_GAMMA22;
case MP_CSP_TRC_GAMMA28: return AVCOL_TRC_GAMMA28;
-#if HAVE_AVUTIL_ST2084
+#if HAVE_AVUTIL_HDR
case MP_CSP_TRC_SMPTE_ST2084: return AVCOL_TRC_SMPTEST2084;
+ case MP_CSP_TRC_ARIB_STD_B67: return AVCOL_TRC_ARIB_STD_B67;
#endif
default: return AVCOL_TRC_UNSPECIFIED;
}