summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.xyz>2017-06-10 02:10:41 +0200
committerwm4 <wm4@nowhere>2017-06-18 20:54:44 +0200
commitda7ae75e2626750bb254ac174b21fecba5eb41cd (patch)
treeb12c5196622ff2f09344fd94ca856c76d7108776
parentc3f32f3a6e3486093eb17518146a6459a34c0c41 (diff)
downloadmpv-da7ae75e2626750bb254ac174b21fecba5eb41cd.tar.bz2
mpv-da7ae75e2626750bb254ac174b21fecba5eb41cd.tar.xz
csputils: implement sony s-gamut
The S-Log "matching" colorspace
-rw-r--r--DOCS/man/options.rst2
-rw-r--r--video/csputils.c9
-rw-r--r--video/csputils.h1
3 files changed, 12 insertions, 0 deletions
diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst
index a82871ebfc..74890d2433 100644
--- a/DOCS/man/options.rst
+++ b/DOCS/man/options.rst
@@ -4597,6 +4597,8 @@ The following video options are currently all specific to ``--vo=opengl`` and
DCI-P3 (Digital Cinema Colorspace), SMPTE RP431-2
v-gamut
Panasonic V-Gamut (VARICAM) primaries
+ s-gamut
+ Sony S-Gamut (S-Log) primaries
``--target-trc=<value>``
Specifies the transfer characteristics (gamma) of the display. Video colors
diff --git a/video/csputils.c b/video/csputils.c
index 5b5c4e1def..c97f08ea0c 100644
--- a/video/csputils.c
+++ b/video/csputils.c
@@ -66,6 +66,7 @@ const struct m_opt_choice_alternatives mp_csp_prim_names[] = {
{"cie1931", MP_CSP_PRIM_CIE_1931},
{"dci-p3", MP_CSP_PRIM_DCI_P3},
{"v-gamut", MP_CSP_PRIM_V_GAMUT},
+ {"s-gamut", MP_CSP_PRIM_S_GAMUT},
{0}
};
@@ -453,6 +454,14 @@ struct mp_csp_primaries mp_get_csp_primaries(enum mp_csp_prim spc)
.blue = {0.100, -0.03},
.white = d65
};
+ // From Sony S-Log reference manual
+ case MP_CSP_PRIM_S_GAMUT:
+ return (struct mp_csp_primaries) {
+ .red = {0.730, 0.280},
+ .green = {0.140, 0.855},
+ .blue = {0.100, -0.05},
+ .white = d65
+ };
default:
return (struct mp_csp_primaries) {{0}};
}
diff --git a/video/csputils.h b/video/csputils.h
index 8b63ac3905..b5446c4d6c 100644
--- a/video/csputils.h
+++ b/video/csputils.h
@@ -65,6 +65,7 @@ enum mp_csp_prim {
MP_CSP_PRIM_CIE_1931,
MP_CSP_PRIM_DCI_P3,
MP_CSP_PRIM_V_GAMUT,
+ MP_CSP_PRIM_S_GAMUT,
MP_CSP_PRIM_COUNT
};