From fc5ddc97cf0293a2aff74e47a28d4d49a8b63f17 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 10 Mar 2024 18:41:13 +0100 Subject: Revert bt709 colors to default for now --- src/color_conversion.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/color_conversion.c b/src/color_conversion.c index eb71dd6..dad58ff 100644 --- a/src/color_conversion.c +++ b/src/color_conversion.c @@ -36,18 +36,18 @@ static float abs_f(float v) { " 0.050928, 0.429412, -0.034537, 0.000000,\n" \ " 0.062745, 0.500000, 0.500000, 1.000000);" -/* ITU-R BT709, full. Custom values (0.2000 0.7152 0.0722) */ +/* ITU-R BT709, full */ /* https://www.itu.int/dms_pubrec/itu-r/rec/bt/R-REC-BT.709-6-201506-I!!PDF-E.pdf */ -#define RGB_TO_NV12_FULL "const mat4 RGBtoYUV = mat4(0.200000, -0.107782, 0.500000, 0.000000,\n" \ - " 0.715200, -0.385428, -0.447000, 0.000000,\n" \ - " 0.072200, 0.500000, -0.045125, 0.000000,\n" \ - " 0.000000, 0.500000, 0.500000, 1.000000);\n" - -/* ITU-R BT709, limited. Custom values (0.2000 0.7152 0.0722). (full multiplied by (235-16)/255, adding 16/255 to luma) */ -#define RGB_TO_NV12_LIMITED "const mat4 RGBtoYUV = mat4(0.171765, -0.092566, 0.429412, 0.000000,\n" \ - " 0.614231, -0.331015, -0.383894, 0.000000,\n" \ - " 0.062007, 0.429412, -0.038754, 0.000000,\n" \ - " 0.062745, 0.500000, 0.500000, 1.000000);\n" +#define RGB_TO_NV12_FULL "const mat4 RGBtoYUV = mat4(0.212600, -0.114572, 0.500000, 0.000000,\n" \ + " 0.715200, -0.385428, -0.454153, 0.000000,\n" \ + " 0.072200, 0.500000, -0.045847, 0.000000,\n" \ + " 0.000000, 0.500000, 0.500000, 1.000000);" + +/* ITU-R BT709, limited (full multiplied by (235-16)/255, adding 16/255 to luma) */ +#define RGB_TO_NV12_LIMITED "const mat4 RGBtoYUV = mat4(0.182586, -0.098397, 0.429412, 0.000000,\n" \ + " 0.614231, -0.331015, -0.390037, 0.000000,\n" \ + " 0.062007, 0.429412, -0.039375, 0.000000,\n" \ + " 0.062745, 0.500000, 0.500000, 1.000000);" static const char* color_format_range_get_transform_matrix(gsr_destination_color color_format, gsr_color_range color_range) { switch(color_format) { -- cgit v1.2.3