summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.dev>2023-08-04 16:18:16 +0200
committerNiklas Haas <github-daiK1o@haasn.dev>2023-08-04 16:58:44 +0200
commit45e95311b83560d6e716f6cbc9fc8506f828c4cc (patch)
tree182913557f7267f2bfbdfb0e991d456d1e4df074 /video
parent14504e0559f8de95d16a123f1a4b5218425ba36b (diff)
downloadmpv-45e95311b83560d6e716f6cbc9fc8506f828c4cc.tar.bz2
mpv-45e95311b83560d6e716f6cbc9fc8506f828c4cc.tar.xz
vo_gpu_next: add --hdr-peak-percentile
Diffstat (limited to 'video')
-rw-r--r--video/out/gpu/video.c2
-rw-r--r--video/out/gpu/video.h1
-rw-r--r--video/out/vo_gpu_next.c1
3 files changed, 4 insertions, 0 deletions
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,