From 5860ded4716170b562c3e915c7eebb879742dcd4 Mon Sep 17 00:00:00 2001 From: Ahmet Inan Date: Fri, 16 Apr 2021 17:53:43 +0200 Subject: [PATCH] use revised value K0 for SRGB --- yuv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yuv.c b/yuv.c index 2cdfcdb..edc0b59 100644 --- a/yuv.c +++ b/yuv.c @@ -18,7 +18,7 @@ uint8_t yuv_clamp(float x) uint8_t srgb(float linear) { float v = fminf(fmaxf(linear, 0.0f), 1.0f); - float K0 = 0.03928f; + float K0 = 0.04045f; float a = 0.055f; float phi = 12.92f; float gamma = 2.4f; @@ -29,7 +29,7 @@ uint8_t srgb(float linear) float linear(uint8_t srgb) { float v = srgb / 255.0f; - float K0 = 0.03928f; + float K0 = 0.04045f; float a = 0.055f; float phi = 12.92f; float gamma = 2.4f;