[FFmpeg-cvslog] lavfi/vf_libplacebo: deprecate hybrid_mix option
Niklas Haas
git at videolan.org
Sat Jul 8 13:56:45 EEST 2023
ffmpeg | branch: master | Niklas Haas <git at haasn.dev> | Sat Jul 8 12:41:45 2023 +0200| [2e83ba001d79e1b543f6c0e408ae17da4ca5251a] | committer: Niklas Haas
lavfi/vf_libplacebo: deprecate hybrid_mix option
Deprecated upstream in libplacebo v6.292.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2e83ba001d79e1b543f6c0e408ae17da4ca5251a
---
doc/filters.texi | 6 ------
libavfilter/vf_libplacebo.c | 16 +++++++++-------
2 files changed, 9 insertions(+), 13 deletions(-)
diff --git a/doc/filters.texi b/doc/filters.texi
index f17488c7c7..95b04cea1a 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -16664,12 +16664,6 @@ output color volumes. Disabled by default.
Size of the tone-mapping LUT, between @code{2} and @code{1024}. Defaults to
@code{256}. Note that this figure is squared when combined with
@code{peak_detect}.
-
- at item hybrid_mix
-If nonzero, this much of the upper range of the tone-mapped result is smoothly
-mixed with a per-channel (LMS) tone-mapped version. Helps avoid unnatural
-blown-out highlights when tone-mapping very bright, strongly saturated colors.
-Defaults to @code{0.2}.
@end table
@subsubsection Dithering
diff --git a/libavfilter/vf_libplacebo.c b/libavfilter/vf_libplacebo.c
index e58183a5ca..10a79ac950 100644
--- a/libavfilter/vf_libplacebo.c
+++ b/libavfilter/vf_libplacebo.c
@@ -219,7 +219,6 @@ typedef struct LibplaceboContext {
float tonemapping_param;
int inverse_tonemapping;
int tonemapping_lut_size;
- float hybrid_mix;
#if FF_API_LIBPLACEBO_OPTS
/* for backwards compatibility */
@@ -232,6 +231,7 @@ typedef struct LibplaceboContext {
int tonemapping_mode;
float crosstalk;
float overshoot;
+ float hybrid_mix;
#endif
/* pl_dither_params */
@@ -360,12 +360,10 @@ static int update_settings(AVFilterContext *ctx)
int err = 0;
LibplaceboContext *s = ctx->priv;
int gamut_mode = s->gamut_mode;
- float hybrid_mix = s->hybrid_mix;
uint8_t color_rgba[4];
- RET(av_parse_color(color_rgba, s->fillcolor, -1, s));
-
#if FF_API_LIBPLACEBO_OPTS
+ float hybrid_mix = s->hybrid_mix;
/* backwards compatibility with older API */
switch (s->tonemapping_mode) {
case 0: /*PL_TONE_MAP_AUTO*/
@@ -390,6 +388,8 @@ static int update_settings(AVFilterContext *ctx)
gamut_mode = GAMUT_MAP_DESATURATE;
#endif
+ RET(av_parse_color(color_rgba, s->fillcolor, -1, s));
+
s->deband_params = *pl_deband_params(
.iterations = s->deband_iterations,
.threshold = s->deband_threshold,
@@ -419,11 +419,13 @@ static int update_settings(AVFilterContext *ctx)
);
s->color_map_params = *pl_color_map_params(
-#if PL_API_VER >= 269
+#if FF_API_LIBPLACEBO_OPTS
+# if PL_API_VER >= 269
.hybrid_mix = hybrid_mix,
-#elif FF_API_LIBPLACEBO_OPTS
+# else
.tone_mapping_mode = s->tonemapping_mode,
.tone_mapping_crosstalk = s->crosstalk,
+# endif
#endif
.tone_mapping_function = get_tonemapping_func(s->tonemapping),
.tone_mapping_param = s->tonemapping_param,
@@ -1396,7 +1398,6 @@ static const AVOption libplacebo_options[] = {
{ "tonemapping_param", "Tunable parameter for some tone-mapping functions", OFFSET(tonemapping_param), AV_OPT_TYPE_FLOAT, {.dbl = 0.0}, 0.0, 100.0, .flags = DYNAMIC },
{ "inverse_tonemapping", "Inverse tone mapping (range expansion)", OFFSET(inverse_tonemapping), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DYNAMIC },
{ "tonemapping_lut_size", "Tone-mapping LUT size", OFFSET(tonemapping_lut_size), AV_OPT_TYPE_INT, {.i64 = 256}, 2, 1024, DYNAMIC },
- { "hybrid_mix", "Tone-mapping hybrid LMS mixing coefficient", OFFSET(hybrid_mix), AV_OPT_TYPE_FLOAT, {.dbl = 0.20}, 0.0, 1.00, DYNAMIC },
#if FF_API_LIBPLACEBO_OPTS
/* deprecated options for backwards compatibility, defaulting to -1 to not override the new defaults */
@@ -1417,6 +1418,7 @@ static const AVOption libplacebo_options[] = {
{ "luma", "Luminance", 0, AV_OPT_TYPE_CONST, {.i64 = 4}, 0, 0, STATIC, "tonemap_mode" },
{ "tonemapping_crosstalk", "Crosstalk factor for tone-mapping", OFFSET(crosstalk), AV_OPT_TYPE_FLOAT, {.dbl = 0.04}, 0.0, 0.30, DYNAMIC | AV_OPT_FLAG_DEPRECATED },
{ "overshoot", "Tone-mapping overshoot margin", OFFSET(overshoot), AV_OPT_TYPE_FLOAT, {.dbl = 0.05}, 0.0, 1.0, DYNAMIC | AV_OPT_FLAG_DEPRECATED },
+ { "hybrid_mix", "Tone-mapping hybrid LMS mixing coefficient", OFFSET(hybrid_mix), AV_OPT_TYPE_FLOAT, {.dbl = 0.20}, 0.0, 1.00, DYNAMIC },
#endif
{ "dithering", "Dither method to use", OFFSET(dithering), AV_OPT_TYPE_INT, {.i64 = PL_DITHER_BLUE_NOISE}, -1, PL_DITHER_METHOD_COUNT - 1, DYNAMIC, "dither" },
More information about the ffmpeg-cvslog
mailing list