summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKacper Michajłow <kasper93@gmail.com>2024-02-11 00:51:58 +0100
committerDudemanguy <random342@airmail.cc>2024-03-09 05:58:52 +0000
commit05c8d5a93a743cb735ca751c2a6343dba4dcf511 (patch)
treec9abe2e8eef8bc09026bbc849cf68d6e90f43eb0
parent391261f7576ff2abc738cf8d566bdc8aad267f1f (diff)
downloadmpv-05c8d5a93a743cb735ca751c2a6343dba4dcf511.tar.bz2
mpv-05c8d5a93a743cb735ca751c2a6343dba4dcf511.tar.xz
csputils: add missing PL_COLOR_SYSTEM names
-rw-r--r--DOCS/man/vf.rst11
-rw-r--r--video/csputils.c9
-rw-r--r--video/mp_image.c3
3 files changed, 19 insertions, 4 deletions
diff --git a/DOCS/man/vf.rst b/DOCS/man/vf.rst
index 1423e4c392..1d067e31f4 100644
--- a/DOCS/man/vf.rst
+++ b/DOCS/man/vf.rst
@@ -204,10 +204,13 @@ Available mpv-only filters are:
Available color spaces are:
:auto: automatic selection (default)
- :bt.601: ITU-R BT.601 (SD)
- :bt.709: ITU-R BT.709 (HD)
- :bt.2020-ncl: ITU-R BT.2020 non-constant luminance system
- :bt.2020-cl: ITU-R BT.2020 constant luminance system
+ :bt.601: ITU-R Rec. BT.601 (SD)
+ :bt.709: ITU-R Rec. BT.709 (HD)
+ :bt.2020-ncl: ITU-R Rec. BT.2020 (non-constant luminance)
+ :bt.2020-cl: ITU-R Rec. BT.2020 (constant luminance)
+ :bt.2100-pq: ITU-R Rec. BT.2100 ICtCp PQ variant
+ :bt.2100-hlg: ITU-R Rec. BT.2100 ICtCp HLG variant
+ :dolbyvision: Dolby Vision
:smpte-240m: SMPTE-240M
``<colorlevels>``
diff --git a/video/csputils.c b/video/csputils.c
index 0587c57f4e..555f0c045e 100644
--- a/video/csputils.c
+++ b/video/csputils.c
@@ -37,6 +37,9 @@ const struct m_opt_choice_alternatives pl_csp_names[] = {
{"smpte-240m", PL_COLOR_SYSTEM_SMPTE_240M},
{"bt.2020-ncl", PL_COLOR_SYSTEM_BT_2020_NC},
{"bt.2020-cl", PL_COLOR_SYSTEM_BT_2020_C},
+ {"bt.2100-pq", PL_COLOR_SYSTEM_BT_2100_PQ},
+ {"bt.2100-hlg", PL_COLOR_SYSTEM_BT_2100_HLG},
+ {"dolbyvision", PL_COLOR_SYSTEM_DOLBYVISION},
{"rgb", PL_COLOR_SYSTEM_RGB},
{"xyz", PL_COLOR_SYSTEM_XYZ},
{"ycgco", PL_COLOR_SYSTEM_YCGCO},
@@ -315,6 +318,12 @@ void mp_get_csp_matrix(struct mp_csp_params *params, struct pl_transform3x3 *m)
enum pl_color_system colorspace = params->repr.sys;
if (colorspace <= PL_COLOR_SYSTEM_UNKNOWN || colorspace >= PL_COLOR_SYSTEM_COUNT)
colorspace = PL_COLOR_SYSTEM_BT_601;
+ // Not supported. TODO: replace with pl_color_repr_decode
+ if (colorspace == PL_COLOR_SYSTEM_BT_2100_PQ ||
+ colorspace == PL_COLOR_SYSTEM_BT_2100_HLG ||
+ colorspace == PL_COLOR_SYSTEM_DOLBYVISION) {
+ colorspace = PL_COLOR_SYSTEM_BT_2020_NC;
+ }
enum pl_color_levels levels_in = params->repr.levels;
if (levels_in <= PL_COLOR_LEVELS_UNKNOWN || levels_in >= PL_COLOR_LEVELS_COUNT)
levels_in = PL_COLOR_LEVELS_LIMITED;
diff --git a/video/mp_image.c b/video/mp_image.c
index 33a784741f..23b1ab8af0 100644
--- a/video/mp_image.c
+++ b/video/mp_image.c
@@ -910,6 +910,9 @@ void mp_image_params_guess_csp(struct mp_image_params *params)
params->repr.sys != PL_COLOR_SYSTEM_BT_709 &&
params->repr.sys != PL_COLOR_SYSTEM_BT_2020_NC &&
params->repr.sys != PL_COLOR_SYSTEM_BT_2020_C &&
+ params->repr.sys != PL_COLOR_SYSTEM_BT_2100_PQ &&
+ params->repr.sys != PL_COLOR_SYSTEM_BT_2100_HLG &&
+ params->repr.sys != PL_COLOR_SYSTEM_DOLBYVISION &&
params->repr.sys != PL_COLOR_SYSTEM_SMPTE_240M &&
params->repr.sys != PL_COLOR_SYSTEM_YCGCO)
{