The branch, master has been updated
via 6f1ab828d3da168d28c65c03b80ad89a61c19d06 (commit)
from eab3b68237bb9b76425fbd75bda4dd69327d2928 (commit)
- Log -----------------------------------------------------------------
commit 6f1ab828d3da168d28c65c03b80ad89a61c19d06
Author: Niklas Haas <[email protected]>
AuthorDate: Mon Oct 6 14:06:30 2025 +0200
Commit: Niklas Haas <[email protected]>
CommitDate: Thu Oct 9 20:45:09 2025 +0000
libavfilter/vf_libplacebo: add `temperature` option
diff --git a/doc/filters.texi b/doc/filters.texi
index 262e7ad009..5863041d1a 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -16795,6 +16795,11 @@ coefficients for RGB inputs.
@item gamma
Gamma adjustment, between @code{0.0} and @code{16.0}. Defaults to @code{1.0}.
+@item temperature
+Color temperature adjustment. Lower values make the output warmer/redder,
+down to @code{1667}, while higher values make the output cooler/bluer, up to
+@code{25000}. Defaults to @code{6500} (neutral white).
+
@item cones
Cone model to use for color blindness simulation. Accepts any combination of
@code{l}, @code{m} and @code{s}. Here are some examples:
diff --git a/libavfilter/vf_libplacebo.c b/libavfilter/vf_libplacebo.c
index 2b3738c8e0..2d8dd29be0 100644
--- a/libavfilter/vf_libplacebo.c
+++ b/libavfilter/vf_libplacebo.c
@@ -261,6 +261,7 @@ typedef struct LibplaceboContext {
float saturation;
float hue;
float gamma;
+ float temperature;
/* pl_peak_detect_params */
int peakdetect;
@@ -446,6 +447,8 @@ static int update_settings(AVFilterContext *ctx)
.saturation = s->saturation,
.hue = s->hue,
.gamma = s->gamma,
+ // libplacebo uses a normalized/relative scale for CCT
+ .temperature = (s->temperature - 6500.0) / 3500.0,
};
opts->peak_detect_params = *pl_peak_detect_params(
@@ -1723,6 +1726,7 @@ static const AVOption libplacebo_options[] = {
{ "saturation", "Saturation gain", OFFSET(saturation), AV_OPT_TYPE_FLOAT,
{.dbl = 1.0}, 0.0, 16.0, DYNAMIC },
{ "hue", "Hue shift", OFFSET(hue), AV_OPT_TYPE_FLOAT, {.dbl = 0.0}, -M_PI,
M_PI, DYNAMIC },
{ "gamma", "Gamma adjustment", OFFSET(gamma), AV_OPT_TYPE_FLOAT, {.dbl =
1.0}, 0.0, 16.0, DYNAMIC },
+ { "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 },
-----------------------------------------------------------------------
Summary of changes:
doc/filters.texi | 5 +++++
libavfilter/vf_libplacebo.c | 4 ++++
2 files changed, 9 insertions(+)
hooks/post-receive
--
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]