aboutsummaryrefslogtreecommitdiffhomepage
path: root/video
diff options
context:
space:
mode:
authorGravatar wm4 <wm4@nowhere>2015-12-26 18:36:55 +0100
committerGravatar wm4 <wm4@nowhere>2015-12-26 18:36:55 +0100
commitb637d6366cfe858accba02c9e50046a6acb81493 (patch)
treea110acc92cd41f914d582370114b2b04632eab5c /video
parent05444e81357c5f8053795e270b57453b0a6e3e65 (diff)
vo_opengl: fix gray playback
Commit f24ba544 wasn't an equivalent change. (This shit needs some sort of automated tests.)
Diffstat (limited to 'video')
-rw-r--r--video/csputils.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/video/csputils.c b/video/csputils.c
index 479c411322..08c484ffda 100644
--- a/video/csputils.c
+++ b/video/csputils.c
@@ -655,13 +655,12 @@ void mp_get_csp_matrix(struct mp_csp_params *params, struct mp_cmat *m)
};
if ((colorspace == MP_CSP_BT_601 || colorspace == MP_CSP_BT_709 ||
- colorspace == MP_CSP_SMPTE_240M || colorspace == MP_CSP_BT_2020_NC)
- && !params->gray)
+ colorspace == MP_CSP_SMPTE_240M || colorspace == MP_CSP_BT_2020_NC))
{
// Hue is equivalent to rotating input [U, V] subvector around the origin.
// Saturation scales [U, V].
- float huecos = params->saturation * cos(params->hue);
- float huesin = params->saturation * sin(params->hue);
+ float huecos = params->gray ? 0 : params->saturation * cos(params->hue);
+ float huesin = params->gray ? 0 : params->saturation * sin(params->hue);
for (int i = 0; i < 3; i++) {
float u = m->m[i][1], v = m->m[i][2];
m->m[i][1] = huecos * u - huesin * v;