summaryrefslogtreecommitdiffstats
path: root/video/csputils.c
diff options
context:
space:
mode:
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.