summaryrefslogtreecommitdiffstats
path: root/video/csputils.c
diff options
context:
space:
mode:
Diffstat (limited to 'video/csputils.c')
-rw-r--r--video/csputils.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/video/csputils.c b/video/csputils.c
index ea83739e8e..922f3ee80f 100644
--- a/video/csputils.c
+++ b/video/csputils.c
@@ -564,8 +564,8 @@ void mp_get_yuv2rgb_coeffs(struct mp_csp_params *params, struct mp_cmat *m)
// 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;