video_output: opengl: add BT.2020 decoding matrices

Multimedia / VLC - Niklas Haas [haasn.xyz] - 3 November 2017 09:59 EDT

Generated the matrices using the following small program:

#include #include

void main() { struct pl_color_repr repr = { .sys = PL_COLOR_SYSTEM_BT_2020_NC, .levels = PL_COLOR_LEVELS_TV, };

struct pl_transform3x3 tf = pl_color_repr_decode(&repr, NULL); for (int i = 0; i < 3; i++) { printf("% .15f, % .15f, % .15f, % .15f ,\n", tf.mat.m[i][0], tf.mat.m[i][1], tf.mat.m[i][2], tf.c[i]); } }

I've also verified that the BT.709 and BT.601 matrices are identical within an error margin of several orders of magnitude. (Probably due to floating point inaccuracy)

P.s. VLC doesn't seem to distinguish between BT.2020-NC and BT.2020-CL, which I believe is a bug. But anyway, we can only easily handle BT.2020-NC anyway, so hard-code it as that. (BT.2020-CL support would require some more libplacebo integration)

a4ef923841 video_output: opengl: add BT.2020 decoding matrices
modules/video_output/opengl/fragment_shaders.c | 8 ++++++++
1 file changed, 8 insertions(+)

Upstream: git.videolan.org


  • Share