PR #21712 opened by Kacper Michajłow (kasper93)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21712
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21712.patch

Fixes peak detection for samples like in 
https://github.com/haasn/libplacebo/issues/358

This might introduce flickering on some other samples, but was agreed
upstream that they are better overall.


From c64ef613acbdc1ad6f325eec0024f0d57a1e0704 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= <[email protected]>
Date: Tue, 10 Feb 2026 18:21:23 +0100
Subject: [PATCH] vf_libplacebo: sync peak detection parameters with upstream
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Fixes peak detection for samples like in 
https://github.com/haasn/libplacebo/issues/358

This might introduce flickering on some other samples, but was agreed
upstream that they are better overall.

Signed-off-by: Kacper Michajłow <[email protected]>
---
 libavfilter/vf_libplacebo.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavfilter/vf_libplacebo.c b/libavfilter/vf_libplacebo.c
index e355f658f7..0f0a9addfb 100644
--- a/libavfilter/vf_libplacebo.c
+++ b/libavfilter/vf_libplacebo.c
@@ -1755,9 +1755,9 @@ static const AVOption libplacebo_options[] = {
     { "temperature", "Color temperature adjustment (kelvin)", 
OFFSET(temperature), AV_OPT_TYPE_FLOAT, {.dbl = 6500.0}, 1667.0, 25000.0, 
DYNAMIC },
 
     { "peak_detect", "Enable dynamic peak detection for HDR tone-mapping", 
OFFSET(peakdetect), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, DYNAMIC },
-    { "smoothing_period", "Peak detection smoothing period", 
OFFSET(smoothing), AV_OPT_TYPE_FLOAT, {.dbl = 100.0}, 0.0, 1000.0, DYNAMIC },
-    { "scene_threshold_low", "Scene change low threshold", OFFSET(scene_low), 
AV_OPT_TYPE_FLOAT, {.dbl = 5.5}, -1.0, 100.0, DYNAMIC },
-    { "scene_threshold_high", "Scene change high threshold", 
OFFSET(scene_high), AV_OPT_TYPE_FLOAT, {.dbl = 10.0}, -1.0, 100.0, DYNAMIC },
+    { "smoothing_period", "Peak detection smoothing period", 
OFFSET(smoothing), AV_OPT_TYPE_FLOAT, {.dbl = 20.0}, 0.0, 1000.0, DYNAMIC },
+    { "scene_threshold_low", "Scene change low threshold", OFFSET(scene_low), 
AV_OPT_TYPE_FLOAT, {.dbl = 1.0}, -1.0, 100.0, DYNAMIC },
+    { "scene_threshold_high", "Scene change high threshold", 
OFFSET(scene_high), AV_OPT_TYPE_FLOAT, {.dbl = 3.0}, -1.0, 100.0, DYNAMIC },
     { "percentile", "Peak detection percentile", OFFSET(percentile), 
AV_OPT_TYPE_FLOAT, {.dbl = 99.995}, 0.0, 100.0, DYNAMIC },
 
     { "gamut_mode", "Gamut-mapping mode", OFFSET(gamut_mode), AV_OPT_TYPE_INT, 
{.i64 = GAMUT_MAP_PERCEPTUAL}, 0, GAMUT_MAP_COUNT - 1, DYNAMIC, .unit = 
"gamut_mode" },
-- 
2.52.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to