aboutsummaryrefslogtreecommitdiffhomepage
path: root/video
diff options
context:
space:
mode:
authorGravatar Vittorio Giovara <vittorio.giovara@gmail.com>2017-12-14 16:19:54 -0500
committerGravatar Jan Ekström <jeebjp@gmail.com>2017-12-14 23:31:09 +0200
commitd7d670fcbf3974894429e5693e76536f0d2fe847 (patch)
tree3c9c0c40287e040f261ee410ba7870c797e10af7 /video
parent3b0ed13e39d02a653c433f56b6c7506801939e23 (diff)
csputils: Add support for Display P3 primaries
Diffstat (limited to 'video')
-rw-r--r--video/csputils.c6
-rw-r--r--video/csputils.h1
2 files changed, 5 insertions, 2 deletions
diff --git a/video/csputils.c b/video/csputils.c
index 438e1c752b..f02a4ca4b8 100644
--- a/video/csputils.c
+++ b/video/csputils.c
@@ -66,6 +66,7 @@ const struct m_opt_choice_alternatives mp_csp_prim_names[] = {
{"prophoto", MP_CSP_PRIM_PRO_PHOTO},
{"cie1931", MP_CSP_PRIM_CIE_1931},
{"dci-p3", MP_CSP_PRIM_DCI_P3},
+ {"display-p3", MP_CSP_PRIM_DISPLAY_P3},
{"v-gamut", MP_CSP_PRIM_V_GAMUT},
{"s-gamut", MP_CSP_PRIM_S_GAMUT},
{0}
@@ -433,13 +434,14 @@ struct mp_csp_primaries mp_get_csp_primaries(enum mp_csp_prim spc)
.blue = {0.1666, 0.0089},
.white = e
};
- // From SMPTE RP 431-2
+ // From SMPTE RP 431-2 and 432-1
case MP_CSP_PRIM_DCI_P3:
+ case MP_CSP_PRIM_DISPLAY_P3:
return (struct mp_csp_primaries) {
.red = {0.680, 0.320},
.green = {0.265, 0.690},
.blue = {0.150, 0.060},
- .white = dci
+ .white = spc == MP_CSP_PRIM_DCI_P3 ? dci : d65
};
// From Panasonic VARICAM reference manual
case MP_CSP_PRIM_V_GAMUT:
diff --git a/video/csputils.h b/video/csputils.h
index 246dfdcfcf..441f2b024b 100644
--- a/video/csputils.h
+++ b/video/csputils.h
@@ -64,6 +64,7 @@ enum mp_csp_prim {
MP_CSP_PRIM_PRO_PHOTO,
MP_CSP_PRIM_CIE_1931,
MP_CSP_PRIM_DCI_P3,
+ MP_CSP_PRIM_DISPLAY_P3,
MP_CSP_PRIM_V_GAMUT,
MP_CSP_PRIM_S_GAMUT,
MP_CSP_PRIM_COUNT