1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-21 07:16:56 +00:00

vo_opengl: fix gray playback

Commit f24ba544 wasn't an equivalent change.

(This shit needs some sort of automated tests.)
This commit is contained in:
wm4 2015-12-26 18:36:55 +01:00
parent 05444e8135
commit b637d6366c

View File

@ -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;