summaryrefslogtreecommitdiffstats
path: root/video/csputils.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-12-09 00:16:51 +0100
committerwm4 <wm4@nowhere>2015-12-09 00:16:51 +0100
commitc5c7b239b6386940a8063c6954db2a4705ce3251 (patch)
treed5798be4f57ee0df4835a28693819099d61849ab /video/csputils.c
parentc2d0d7818f1045fbee5f296d614a11d25784215f (diff)
downloadmpv-c5c7b239b6386940a8063c6954db2a4705ce3251.tar.bz2
mpv-c5c7b239b6386940a8063c6954db2a4705ce3251.tar.xz
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.
Diffstat (limited to 'video/csputils.c')
-rw-r--r--video/csputils.c10
1 files changed, 5 insertions, 5 deletions
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.