summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorKacper Michajłow <kasper93@gmail.com>2023-01-24 08:11:16 +0100
committerLeo Izen <leo.izen@gmail.com>2023-03-02 09:37:06 -0500
commitf2fab0d8e1eea51b4b51f67871e0c3e093c92f53 (patch)
tree7415317683800c2b6737edddc8785c92cdcfa550 /video
parent9dc4154fecd9ef99b56b3e9e7534142df0ccae92 (diff)
downloadmpv-f2fab0d8e1eea51b4b51f67871e0c3e093c92f53.tar.bz2
mpv-f2fab0d8e1eea51b4b51f67871e0c3e093c92f53.tar.xz
mp_image: fix XYZ gamma and primaries guess
Diffstat (limited to 'video')
-rw-r--r--video/mp_image.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/video/mp_image.c b/video/mp_image.c
index f39ecb5b79..5753f144d9 100644
--- a/video/mp_image.c
+++ b/video/mp_image.c
@@ -888,18 +888,10 @@ void mp_image_params_guess_csp(struct mp_image_params *params)
} else if (forced_csp == MP_CSP_XYZ) {
params->color.space = MP_CSP_XYZ;
params->color.levels = MP_CSP_LEVELS_PC;
-
- // In theory, XYZ data does not really need a concept of 'primaries' to
- // function, but this field can still be relevant for guiding gamut
- // mapping optimizations, and it's also used by `mp_get_csp_matrix`
- // when deciding what RGB space to map XYZ to for VOs that don't want
- // to directly ingest XYZ into their color pipeline. We pick DCI-P3
- // because it is the colorspace most closely matching digital cinema
- // content, and also has the correct DCI whitepoint.
- if (params->color.primaries == MP_CSP_PRIM_AUTO)
- params->color.primaries = MP_CSP_PRIM_DCI_P3;
- if (params->color.gamma == MP_CSP_TRC_AUTO)
- params->color.gamma = MP_CSP_TRC_LINEAR;
+ // Force gamma to ST428 as this is the only correct for DCDM X'Y'Z'
+ params->color.gamma = MP_CSP_TRC_ST428;
+ // Don't care about primaries, they shouldn't be used, or if anything
+ // MP_CSP_PRIM_ST428 should be defined.
} else {
// We have no clue.
params->color.space = MP_CSP_AUTO;