From ef6bc8504a945eb6492b8ed46fd5a1afaaf32182 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Sun, 17 May 2020 03:17:28 +0200 Subject: 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. --- video/csputils.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'video/csputils.h') 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); -- cgit v1.2.3