vo_gpu_next: add --hdr-contrast-recovery/smoothness

New upstream feature. Disabled by default.
This commit is contained in:
Niklas Haas 2023-07-17 16:37:36 +02:00 committed by Niklas Haas
parent ac725764ec
commit 02595011eb
5 changed files with 25 additions and 0 deletions

View File

@ -87,6 +87,7 @@ Interface changes
--no-gpu-shader-cache to disable)
- add `--directory-mode=recursive|lazy|ignore`
- ctrl+h now uses `auto-safe` rather than `auto` when turing on hardware decoding
- add `--hdr-contrast-recovery` and `--hdr-contrast-smoothness`
--- mpv 0.35.0 ---
- add the `--vo=gpu-next` video output driver, as well as the options
`--allow-delayed-peak-detect`, `--builtin-scalers`,

View File

@ -6713,6 +6713,18 @@ them.
aggressive, up to the limit of the high threshold (at which point the
filter becomes instant).
``--hdr-contrast-recovery=<0.0..2.0>``, ``--hdr-contrast-smoothness=<1.0..100.0>``
Enables the HDR contrast recovery algorithm, which is to designed to
enhance contrast of HDR video after tone mapping. The strength (default:
0.0) indicates the degree of contrast recovery, with 0.0 being completely
disabled and 1.0 being 100% strength. Values higher than 1.0 are allowed,
but may result in excessive sharpening. The smoothness (default: 3.5)
indicates the degree to which the HDR source is low-passed in order to
obtain contrast information - a value of 2.0 corresponds to 2x downscaling.
Users on low DPI displays (<= 100) may want to lower this value, while
users on very high DPI displays ("retina") may want to increase it. (Only
for ``vo=gpu-next``)
``--use-embedded-icc-profile``
Load the embedded ICC profile contained in media files such as PNG images.
(Default: yes). Note that this option only works when also using a display

View File

@ -325,6 +325,7 @@ static const struct gl_video_opts gl_video_opts_def = {
.decay_rate = 100.0,
.scene_threshold_low = 5.5,
.scene_threshold_high = 10.0,
.contrast_smoothness = 3.5,
},
.early_flush = -1,
.shader_cache = true,
@ -421,6 +422,10 @@ const struct m_sub_options gl_video_conf = {
M_RANGE(0, 20.0)},
{"hdr-scene-threshold-high", OPT_FLOAT(tone_map.scene_threshold_high),
M_RANGE(0, 20.0)},
{"hdr-contrast-recovery", OPT_FLOAT(tone_map.contrast_recovery),
M_RANGE(0, 2.0)},
{"hdr-contrast-smoothness", OPT_FLOAT(tone_map.contrast_smoothness),
M_RANGE(1.0, 100.0)},
{"opengl-pbo", OPT_BOOL(pbo)},
SCALER_OPTS("scale", SCALER_SCALE),
SCALER_OPTS("dscale", SCALER_DSCALE),

View File

@ -133,6 +133,8 @@ struct gl_tone_map_opts {
float decay_rate;
float scene_threshold_low;
float scene_threshold_high;
float contrast_recovery;
float contrast_smoothness;
int gamut_mode;
bool visualize;
};

View File

@ -1967,6 +1967,11 @@ static void update_render_options(struct vo *vo)
p->color_map.tone_mapping_param = 0.0;
p->color_map.visualize_lut = opts->tone_map.visualize;
#if PL_API_VER >= 285
p->color_map.contrast_recovery = opts->tone_map.contrast_recovery;
p->color_map.contrast_smoothness = opts->tone_map.contrast_smoothness;
#endif
#if PL_API_VER >= 269
if (opts->tone_map.gamut_mode != GAMUT_AUTO)
p->color_map.gamut_mapping = gamut_modes[opts->tone_map.gamut_mode];