From 06a6225996b2e21e354d334f89267f05cd8724a4 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 11 Oct 2024 15:46:48 -0700 Subject: [PATCH] Fixed conversion from RGB to full range BT.709 YCbCr This was a typo in the formula. The correct formula is as listed on https://en.wikipedia.org/wiki/YCbCr. Without this change, white comes out as 253,255,255. --- src/rendervulkan.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rendervulkan.cpp b/src/rendervulkan.cpp index 03aa5a2af..54d7608dd 100644 --- a/src/rendervulkan.cpp +++ b/src/rendervulkan.cpp @@ -78,7 +78,7 @@ static constexpr mat3x4 g_rgb2yuv_srgb_to_bt709_limited = {{ static constexpr mat3x4 g_rgb2yuv_srgb_to_bt709_full = {{ { 0.2126f, 0.7152f, 0.0722f, 0.0f }, { -0.1146f, -0.3854f, 0.5000f, 0.5f }, - { 0.5000f, -0.4542f, -0.0468f, 0.5f }, + { 0.5000f, -0.4542f, -0.0458f, 0.5f }, }}; static const mat3x4& colorspace_to_conversion_from_srgb_matrix(EStreamColorspace colorspace) {