summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.dev>2023-06-19 12:59:51 +0200
committerNiklas Haas <github-daiK1o@haasn.dev>2023-06-21 23:52:35 +0200
commitf1600ea9cf1664a094983cf75d63dc6ea09fe1b6 (patch)
treec8e61650654fd592894545b981cc9acb5e2b68d8 /video
parent594458838ecf2229797e10266915e0f33c95d4fd (diff)
downloadmpv-f1600ea9cf1664a094983cf75d63dc6ea09fe1b6.tar.bz2
mpv-f1600ea9cf1664a094983cf75d63dc6ea09fe1b6.tar.xz
vo_gpu_next: add missing --gamut-mapping-mode options
Adds the missing upstream values that were exposed by the new gamut mapping API.
Diffstat (limited to 'video')
-rw-r--r--video/out/gpu/video.c9
-rw-r--r--video/out/gpu/video.h7
-rw-r--r--video/out/vo_gpu_next.c13
3 files changed, 25 insertions, 4 deletions
diff --git a/video/out/gpu/video.c b/video/out/gpu/video.c
index b957f71258..4ca5428098 100644
--- a/video/out/gpu/video.c
+++ b/video/out/gpu/video.c
@@ -400,9 +400,14 @@ const struct m_sub_options gl_video_conf = {
{"gamut-mapping-mode", OPT_CHOICE(tone_map.gamut_mode,
{"auto", GAMUT_AUTO},
{"clip", GAMUT_CLIP},
- {"warn", GAMUT_WARN},
+ {"perceptual", GAMUT_PERCEPTUAL},
+ {"relative", GAMUT_RELATIVE},
+ {"saturation", GAMUT_SATURATION},
+ {"absolute", GAMUT_ABSOLUTE},
{"desaturate", GAMUT_DESATURATE},
- {"darken", GAMUT_DARKEN})},
+ {"darken", GAMUT_DARKEN},
+ {"warn", GAMUT_WARN},
+ {"linear", GAMUT_LINEAR})},
{"hdr-compute-peak", OPT_CHOICE(tone_map.compute_peak,
{"auto", 0},
{"yes", 1},
diff --git a/video/out/gpu/video.h b/video/out/gpu/video.h
index 5952998fa5..de70a8f801 100644
--- a/video/out/gpu/video.h
+++ b/video/out/gpu/video.h
@@ -113,9 +113,14 @@ enum tone_mapping_mode {
enum gamut_mode {
GAMUT_AUTO,
GAMUT_CLIP,
- GAMUT_WARN,
+ GAMUT_PERCEPTUAL,
+ GAMUT_RELATIVE,
+ GAMUT_SATURATION,
+ GAMUT_ABSOLUTE,
GAMUT_DESATURATE,
GAMUT_DARKEN,
+ GAMUT_WARN,
+ GAMUT_LINEAR,
};
struct gl_tone_map_opts {
diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c
index 9916cbc6be..825c93178b 100644
--- a/video/out/vo_gpu_next.c
+++ b/video/out/vo_gpu_next.c
@@ -1862,9 +1862,14 @@ static void update_render_options(struct vo *vo)
#if PL_API_VER >= 269
const struct pl_gamut_map_function *gamut_modes[] = {
[GAMUT_CLIP] = &pl_gamut_map_clip,
- [GAMUT_WARN] = &pl_gamut_map_highlight,
+ [GAMUT_PERCEPTUAL] = &pl_gamut_map_perceptual,
+ [GAMUT_RELATIVE] = &pl_gamut_map_relative,
+ [GAMUT_SATURATION] = &pl_gamut_map_saturation,
+ [GAMUT_ABSOLUTE] = &pl_gamut_map_absolute,
[GAMUT_DESATURATE] = &pl_gamut_map_desaturate,
[GAMUT_DARKEN] = &pl_gamut_map_darken,
+ [GAMUT_WARN] = &pl_gamut_map_highlight,
+ [GAMUT_LINEAR] = &pl_gamut_map_linear,
};
// Back-compat approximation, taken from libplacebo source code
@@ -1880,6 +1885,12 @@ static void update_render_options(struct vo *vo)
[GAMUT_WARN] = PL_GAMUT_WARN,
[GAMUT_DESATURATE] = PL_GAMUT_DESATURATE,
[GAMUT_DARKEN] = PL_GAMUT_DARKEN,
+ // Unsupported
+ [GAMUT_PERCEPTUAL] = PL_GAMUT_CLIP,
+ [GAMUT_RELATIVE] = PL_GAMUT_CLIP,
+ [GAMUT_SATURATION] = PL_GAMUT_CLIP,
+ [GAMUT_ABSOLUTE] = PL_GAMUT_CLIP,
+ [GAMUT_LINEAR] = PL_GAMUT_CLIP,
};
static const enum pl_tone_map_mode tone_map_modes[] = {