1
0
mirror of https://github.com/mpv-player/mpv synced 2025-03-21 18:57:35 +00:00

csputils: add missing PL_COLOR_SYSTEM names

This commit is contained in:
Kacper Michajłow 2024-02-11 00:51:58 +01:00 committed by Dudemanguy
parent 391261f757
commit 05c8d5a93a
3 changed files with 19 additions and 4 deletions

View File

@ -204,10 +204,13 @@ Available mpv-only filters are:
Available color spaces are: Available color spaces are:
:auto: automatic selection (default) :auto: automatic selection (default)
:bt.601: ITU-R BT.601 (SD) :bt.601: ITU-R Rec. BT.601 (SD)
:bt.709: ITU-R BT.709 (HD) :bt.709: ITU-R Rec. BT.709 (HD)
:bt.2020-ncl: ITU-R BT.2020 non-constant luminance system :bt.2020-ncl: ITU-R Rec. BT.2020 (non-constant luminance)
:bt.2020-cl: ITU-R BT.2020 constant luminance system :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 :smpte-240m: SMPTE-240M
``<colorlevels>`` ``<colorlevels>``

View File

@ -37,6 +37,9 @@ const struct m_opt_choice_alternatives pl_csp_names[] = {
{"smpte-240m", PL_COLOR_SYSTEM_SMPTE_240M}, {"smpte-240m", PL_COLOR_SYSTEM_SMPTE_240M},
{"bt.2020-ncl", PL_COLOR_SYSTEM_BT_2020_NC}, {"bt.2020-ncl", PL_COLOR_SYSTEM_BT_2020_NC},
{"bt.2020-cl", PL_COLOR_SYSTEM_BT_2020_C}, {"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}, {"rgb", PL_COLOR_SYSTEM_RGB},
{"xyz", PL_COLOR_SYSTEM_XYZ}, {"xyz", PL_COLOR_SYSTEM_XYZ},
{"ycgco", PL_COLOR_SYSTEM_YCGCO}, {"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; enum pl_color_system colorspace = params->repr.sys;
if (colorspace <= PL_COLOR_SYSTEM_UNKNOWN || colorspace >= PL_COLOR_SYSTEM_COUNT) if (colorspace <= PL_COLOR_SYSTEM_UNKNOWN || colorspace >= PL_COLOR_SYSTEM_COUNT)
colorspace = PL_COLOR_SYSTEM_BT_601; 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; enum pl_color_levels levels_in = params->repr.levels;
if (levels_in <= PL_COLOR_LEVELS_UNKNOWN || levels_in >= PL_COLOR_LEVELS_COUNT) if (levels_in <= PL_COLOR_LEVELS_UNKNOWN || levels_in >= PL_COLOR_LEVELS_COUNT)
levels_in = PL_COLOR_LEVELS_LIMITED; levels_in = PL_COLOR_LEVELS_LIMITED;

View File

@ -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_709 &&
params->repr.sys != PL_COLOR_SYSTEM_BT_2020_NC && 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_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_SMPTE_240M &&
params->repr.sys != PL_COLOR_SYSTEM_YCGCO) params->repr.sys != PL_COLOR_SYSTEM_YCGCO)
{ {