summaryrefslogtreecommitdiffstats
path: root/video/csputils.h
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.xyz>2020-05-17 03:17:28 +0200
committerNiklas Haas <git@haasn.xyz>2020-06-15 01:24:04 +0200
commitef6bc8504a945eb6492b8ed46fd5a1afaaf32182 (patch)
tree31a0beaa61c89e4e0dacec9e0cd52c559a9b84fc /video/csputils.h
parentc7fe4ae73ad5f073bbffe3e8a3460b728e7d0f46 (diff)
downloadmpv-ef6bc8504a945eb6492b8ed46fd5a1afaaf32182.tar.bz2
mpv-ef6bc8504a945eb6492b8ed46fd5a1afaaf32182.tar.xz
vo_gpu: reinterpret SDR white levels based on ITU-R BT.2408
This standard says we should use a value of 203 nits instead of 100 for mapping between SDR and HDR. Code copied from https://code.videolan.org/videolan/libplacebo/-/commit/9d9164773 In particular, that commit also includes a test case to make sure the implementation doesn't break roundtrips. Relevant to #4248 and #7357.
Diffstat (limited to 'video/csputils.h')
-rw-r--r--video/csputils.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/video/csputils.h b/video/csputils.h
index 34e2894a28..965c313a02 100644
--- a/video/csputils.h
+++ b/video/csputils.h
@@ -145,9 +145,11 @@ struct mp_colorspace {
// For many colorspace conversions, in particular those involving HDR, an
// implicit reference white level is needed. Since this magic constant shows up
-// a lot, give it an explicit name. The value of 100 cd/m² comes from ITU-R
-// documents such as ITU-R BT.2100
-#define MP_REF_WHITE 100.0
+// a lot, give it an explicit name. The value of 203 cd/m² comes from ITU-R
+// Report BT.2408, and the value for HLG comes from the cited HLG 75% level
+// (transferred to scene space).
+#define MP_REF_WHITE 203.0
+#define MP_REF_WHITE_HLG 3.17955
// Replaces unknown values in the first struct by those of the second struct
void mp_colorspace_merge(struct mp_colorspace *orig, struct mp_colorspace *new);