[vlc-devel] [PATCH] OpenGL: compute the BT.2020 YUV->RGB in 10bits

Jean-Baptiste Kempf jb at videolan.org
Sun Apr 17 13:51:41 CEST 2016


---
 modules/video_output/opengl.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/modules/video_output/opengl.c b/modules/video_output/opengl.c
index d6217b5..c843968 100644
--- a/modules/video_output/opengl.c
+++ b/modules/video_output/opengl.c
@@ -272,12 +272,20 @@ static void BuildYUVFragmentShader(vout_display_opengl_t *vgl,
         1.164383561643836, -0.21324861427373,  -0.532909328559444,  0.301482665475862 ,
         1.164383561643836,  2.112401785714286,  0.0000,            -1.133402217873451 ,
     };
+    const float matrix_bt2020_tv2full_10[12] = {
+        1.167808219178083,  0.0000,             1.683611383928571, -0.915687932159165 ,
+        1.167808219178082, -0.187877063349399  -0.652337331206542,  0.347458498519301 ,
+        1.167808219178082,  2.148071651785714,  0.0000,            -1.148145075016308 ,
+    };
     const float *matrix;
     switch( fmt->space )
     {
         case COLOR_SPACE_BT601:
             matrix = matrix_bt601_tv2full;
             break;
+        case COLOR_SPACE_BT2020:
+            matrix = matrix_bt2020_tv2full_10;
+            break;
         default:
             matrix = matrix_bt709_tv2full;
     };
-- 
2.8.0.rc3



More information about the vlc-devel mailing list