From c5c7b239b6386940a8063c6954db2a4705ce3251 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 9 Dec 2015 00:16:51 +0100 Subject: csputils, vo_opengl: remove XYZ special case in color matrix retrieval This just seems unnecessary. Refactor it a bit. There should be no functional changes. --- video/csputils.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'video/csputils.c') diff --git a/video/csputils.c b/video/csputils.c index 71ab0513a5..ff5ae3870d 100644 --- a/video/csputils.c +++ b/video/csputils.c @@ -527,10 +527,10 @@ void mp_get_cms_matrix(struct mp_csp_primaries src, struct mp_csp_primaries dest // get the coefficients of an SMPTE 428-1 xyz -> rgb conversion matrix // intent = the rendering intent used to convert to the target primaries -void mp_get_xyz2rgb_coeffs(struct mp_csp_params *params, - struct mp_csp_primaries prim, - enum mp_render_intent intent, struct mp_cmat *m) +static void mp_get_xyz2rgb_coeffs(struct mp_csp_params *params, + enum mp_render_intent intent, struct mp_cmat *m) { + struct mp_csp_primaries prim = mp_get_csp_primaries(params->primaries); float brightness = params->brightness; mp_get_rgb2xyz_matrix(prim, m->m); mp_invert_matrix3x3(m->m); @@ -636,8 +636,7 @@ void mp_get_yuv2rgb_coeffs(struct mp_csp_params *params, struct mp_cmat *m) // The vo should probably not be using a matrix generated by this // function for XYZ sources, but if it does, let's just assume it // wants BT.709 with D65 white point (virtually all other content). - mp_get_xyz2rgb_coeffs(params, mp_get_csp_primaries(MP_CSP_PRIM_BT_709), - MP_INTENT_RELATIVE_COLORIMETRIC, m); + mp_get_xyz2rgb_coeffs(params, MP_INTENT_RELATIVE_COLORIMETRIC, m); levels_in = -1; break; } @@ -720,6 +719,7 @@ void mp_csp_set_image_params(struct mp_csp_params *params, mp_image_params_guess_csp(&p); // ensure consistency params->colorspace = p.colorspace; params->levels_in = p.colorlevels; + params->primaries = p.primaries; } // Copy settings from eq into params. -- cgit v1.2.3