summaryrefslogtreecommitdiffstats
path: root/video/csputils.c
diff options
context:
space:
mode:
Diffstat (limited to 'video/csputils.c')
-rw-r--r--video/csputils.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/video/csputils.c b/video/csputils.c
index a0db6c8cd4..aaa32614b7 100644
--- a/video/csputils.c
+++ b/video/csputils.c
@@ -619,21 +619,22 @@ void mp_get_cms_matrix(struct mp_csp_primaries src, struct mp_csp_primaries dest
mp_mul_matrix3x3(m, tmp);
}
-// get the coefficients of an SMPTE 428-1 xyz -> rgb conversion matrix
+// get the coefficients of an ST 428-1 xyz -> rgb conversion matrix
// intent = the rendering intent used to convert to the target primaries
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->color.primaries);
+ // Convert to DCI-P3
+ struct mp_csp_primaries prim = mp_get_csp_primaries(MP_CSP_PRIM_DCI_P3);
float brightness = params->brightness;
mp_get_rgb2xyz_matrix(prim, m->m);
mp_invert_matrix3x3(m->m);
// All non-absolute mappings want to map source white to target white
if (intent != MP_INTENT_ABSOLUTE_COLORIMETRIC) {
- // SMPTE 428-1 defines the calibration white point as CIE xy (0.314, 0.351)
- static const struct mp_csp_col_xy smpte428 = {0.314, 0.351};
- mp_apply_chromatic_adaptation(smpte428, prim.white, m->m);
+ // SMPTE EG 432-1 Annex H defines the white point as equal energy
+ static const struct mp_csp_col_xy smpte432 = {1.0/3.0, 1.0/3.0};
+ mp_apply_chromatic_adaptation(smpte432, prim.white, m->m);
}
// Since this outputs linear RGB rather than companded RGB, we