Module: Mesa
Branch: main
Commit: 0bd9ab232baf5dfb499f5a5148e74a79df07cae1
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=0bd9ab232baf5dfb499f5a5148e74a79df07cae1

Author: David Rosca <[email protected]>
Date:   Wed Jul 19 12:10:21 2023 +0200

gallium/auxiliary/vl: Fix RGB->YCbCr full range matrix

Also rename it to bt_709_rev_full as there already
is bt_709 which is used for YCbCr->RGB.

Fixes: 8a21efce3a2 ("frontends/va: Add postproc support for converting to full 
range")

Reviewed-by: Leo Liu <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24238>

---

 src/gallium/auxiliary/vl/vl_csc.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/gallium/auxiliary/vl/vl_csc.c 
b/src/gallium/auxiliary/vl/vl_csc.c
index dccedf821e0..b015a44314d 100644
--- a/src/gallium/auxiliary/vl/vl_csc.c
+++ b/src/gallium/auxiliary/vl/vl_csc.c
@@ -137,10 +137,10 @@ static const vl_csc_matrix bt_709_rev  = {
    { 0.439f, -0.399f, -0.040f, 0.5f   }
 };
 
-static const vl_csc_matrix bt_709_full  = {
-   { 0.0f,  1.0f, 0.0f, 0.0f },
-   { 0.0f, -0.5f, 0.5f, 0.5f },
-   { 0.5f, -0.5f, 0.0f, 0.5f }
+static const vl_csc_matrix bt_709_rev_full = {
+   { 0.213f,  0.715f,  0.072f, 0.0f },
+   {-0.115f, -0.385f,  0.5f,   0.5f },
+   { 0.5f,   -0.454f, -0.046f, 0.5f }
 };
 
 static const vl_csc_matrix identity =
@@ -197,7 +197,7 @@ void vl_csc_get_matrix(enum VL_CSC_COLOR_STANDARD cs,
          cstd = &smpte240m;
          break;
       case VL_CSC_COLOR_STANDARD_BT_709_REV:
-         memcpy(matrix, full_range ? bt_709_full : bt_709_rev, 
sizeof(vl_csc_matrix));
+         memcpy(matrix, full_range ? bt_709_rev_full : bt_709_rev, 
sizeof(vl_csc_matrix));
          return;
       case VL_CSC_COLOR_STANDARD_IDENTITY:
       default:

Reply via email to