From bd1487b17d0806a79cc74b911008a533e1ec3036 Mon Sep 17 00:00:00 2001 From: Doris Verria Date: Tue, 25 Apr 2023 23:19:10 +0200 Subject: QVideoTextureHelper: Fix color matrix calculation The color matrix for BT709 video (limited) range, had a small mistake. From calculations based on the BT709 standard and for video range (16 - 235) values, the conversion equations are: R = Y * 1.1644 + V * 1.7928 + (-248.100994) G = Y * 1.1644 + U * -0.2132 + V * -0.5329 + 76.878080 B = Y * 1.1644 + U * 2.1124 + (-289.017566) So there was a missplacement between two of the coeficients in the matrix. Fixes: QTBUG-108083 Pick-to: 6.5 6.2 Change-Id: If58c7df8a9ad4d975a2ac0c90cd3692232210995 Reviewed-by: Lars Knoll --- src/multimedia/video/qvideotexturehelper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/multimedia/video/qvideotexturehelper.cpp b/src/multimedia/video/qvideotexturehelper.cpp index 7cb1e1a6e..3675e157f 100644 --- a/src/multimedia/video/qvideotexturehelper.cpp +++ b/src/multimedia/video/qvideotexturehelper.cpp @@ -398,7 +398,7 @@ static QMatrix4x4 colorMatrix(const QVideoFrameFormat &format) 0.0f, 0.000f, 0.000f, 1.0000f); return QMatrix4x4( 1.1644f, 0.000f, 1.7928f, -0.9731f, - 1.1644f, -0.5329f, -0.2132f, 0.3015f, + 1.1644f, -0.2132f, -0.5329f, 0.3015f, 1.1644f, 2.1124f, 0.000f, -1.1335f, 0.0f, 0.000f, 0.000f, 1.0000f); case QVideoFrameFormat::ColorSpace_BT2020: -- cgit v1.2.1