diff options
author | Niklas Haas <git@haasn.dev> | 2022-01-04 01:50:00 +0100 |
---|---|---|
committer | Niklas Haas <github-daiK1o@haasn.dev> | 2022-01-07 06:28:14 +0100 |
commit | d09c73c7b2b0135cb24ab2173b3c4ee1c55840b0 (patch) | |
tree | 02b33ac09f5720cfa328c747d2481a6a82d7d09b /video/out/vo_gpu_next.c | |
parent | f3fccfc395ddb7a504ab2aae48452178fa92d907 (diff) | |
download | mpv-d09c73c7b2b0135cb24ab2173b3c4ee1c55840b0.tar.bz2 mpv-d09c73c7b2b0135cb24ab2173b3c4ee1c55840b0.tar.xz |
vo_gpu: add --tone-mapping-mode
This merges the old desaturation control options into a single
enumeration, with the goal of both simplifying how these options work
and also making this list more extensible (including, notably, new
options only supported by vo_gpu_next).
For the hybrid option, I decided to port the (slightly tweaked) values
from libplacebo's pre-refactor defaults, rather than the old values we
had in mpv, to more visually match the look of the vo_gpu_next hybrid.
Diffstat (limited to 'video/out/vo_gpu_next.c')
-rw-r--r-- | video/out/vo_gpu_next.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c index 390852ff71..9bbb58101f 100644 --- a/video/out/vo_gpu_next.c +++ b/video/out/vo_gpu_next.c @@ -1406,12 +1406,21 @@ static void update_render_options(struct priv *p) [GAMUT_DARKEN] = PL_GAMUT_DARKEN, }; + static const enum pl_tone_map_mode tone_map_modes[] = { + [TONE_MAP_MODE_AUTO] = PL_TONE_MAP_AUTO, + [TONE_MAP_MODE_RGB] = PL_TONE_MAP_RGB, + [TONE_MAP_MODE_MAX] = PL_TONE_MAP_MAX, + [TONE_MAP_MODE_HYBRID] = PL_TONE_MAP_HYBRID, + [TONE_MAP_MODE_LUMA] = PL_TONE_MAP_LUMA, + }; + p->color_map = pl_color_map_default_params; p->color_map.intent = opts->icc_opts->intent; p->color_map.tone_mapping_function = tone_map_funs[opts->tone_map.curve]; p->color_map.tone_mapping_param = opts->tone_map.curve_param; p->color_map.inverse_tone_mapping = opts->tone_map.inverse; p->color_map.tone_mapping_crosstalk = opts->tone_map.crosstalk; + p->color_map.tone_mapping_mode = tone_map_modes[opts->tone_map.mode]; if (isnan(p->color_map.tone_mapping_param)) // vo_gpu compatibility p->color_map.tone_mapping_param = 0.0; if (opts->tone_map.gamut_mode != GAMUT_AUTO) |