From 45e95311b83560d6e716f6cbc9fc8506f828c4cc Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Fri, 4 Aug 2023 16:18:16 +0200 Subject: vo_gpu_next: add --hdr-peak-percentile --- video/out/gpu/video.c | 2 ++ video/out/gpu/video.h | 1 + video/out/vo_gpu_next.c | 1 + 3 files changed, 4 insertions(+) (limited to 'video') diff --git a/video/out/gpu/video.c b/video/out/gpu/video.c index 4233f14336..73bd191740 100644 --- a/video/out/gpu/video.c +++ b/video/out/gpu/video.c @@ -416,6 +416,8 @@ const struct m_sub_options gl_video_conf = { {"auto", 0}, {"yes", 1}, {"no", -1})}, + {"hdr-peak-percentile", OPT_FLOAT(tone_map.peak_percentile), + M_RANGE(0.0, 100.0)}, {"hdr-peak-decay-rate", OPT_FLOAT(tone_map.decay_rate), M_RANGE(1.0, 1000.0)}, {"hdr-scene-threshold-low", OPT_FLOAT(tone_map.scene_threshold_low), diff --git a/video/out/gpu/video.h b/video/out/gpu/video.h index 30c100e302..4f42fca08f 100644 --- a/video/out/gpu/video.h +++ b/video/out/gpu/video.h @@ -133,6 +133,7 @@ struct gl_tone_map_opts { float decay_rate; float scene_threshold_low; float scene_threshold_high; + float peak_percentile; float contrast_recovery; float contrast_smoothness; int gamut_mode; diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c index 30034f98b9..3fe068c279 100644 --- a/video/out/vo_gpu_next.c +++ b/video/out/vo_gpu_next.c @@ -1883,6 +1883,7 @@ static void update_render_options(struct vo *vo) p->peak_detect.smoothing_period = opts->tone_map.decay_rate; p->peak_detect.scene_threshold_low = opts->tone_map.scene_threshold_low; p->peak_detect.scene_threshold_high = opts->tone_map.scene_threshold_high; + p->peak_detect.percentile = opts->tone_map.peak_percentile; const struct pl_tone_map_function * const tone_map_funs[] = { [TONE_MAPPING_AUTO] = &pl_tone_map_auto, -- cgit v1.2.3