From 98333003d90732b6ad7a24b05ff25619be13f01c Mon Sep 17 00:00:00 2001 From: sekrit-twc Date: Wed, 1 Feb 2023 17:52:51 -0800 Subject: [PATCH] colorspace: use normalization factor 58.37/48 for ST.428-1 gamma --- src/zimg/colorspace/gamma.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/zimg/colorspace/gamma.cpp b/src/zimg/colorspace/gamma.cpp index c7e67817..b8db8241 100644 --- a/src/zimg/colorspace/gamma.cpp +++ b/src/zimg/colorspace/gamma.cpp @@ -277,12 +277,12 @@ float st_2084_inverse_eotf(float x) noexcept float st_428_eotf(float x) noexcept { - return x < 0.0f ? 0.0f : zimg_x_powf(x, 2.6f); + return x < 0.0f ? 0.0f : 52.37f / 48.0f * zimg_x_powf(x, 2.6f); } float st_428_inverse_eotf(float x) noexcept { - return x < 0.0f ? 0.0f : zimg_x_powf(x, 1.0f / 2.6f); + return x < 0.0f ? 0.0f : zimg_x_powf(x * (48.0f / 52.37f), 1.0f / 2.6f); } // Applies a per-channel correction instead of the iterative method specified in Rec.2100.