mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-19 05:40:56 +00:00
lavfi/vf_libplacebo: add contrast recovery options
New upstream option. Enabled by default in the high-quality preset upstream, so enable it by default here.
This commit is contained in:
parent
2e83ba001d
commit
13e9899014
@ -16664,6 +16664,19 @@ output color volumes. Disabled by default.
|
|||||||
Size of the tone-mapping LUT, between @code{2} and @code{1024}. Defaults to
|
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{256}. Note that this figure is squared when combined with
|
||||||
@code{peak_detect}.
|
@code{peak_detect}.
|
||||||
|
|
||||||
|
@item contrast_recovery
|
||||||
|
Contrast recovery strength. If set to a value above @code{0.0}, the source
|
||||||
|
image will be divided into high-frequency and low-frequency components, and a
|
||||||
|
portion of the high-frequency image is added back onto the tone-mapped output.
|
||||||
|
May cause excessive ringing artifacts for some HDR sources, but can improve the
|
||||||
|
subjective sharpness and detail left over in the image after tone-mapping.
|
||||||
|
Defaults to @code{0.30}.
|
||||||
|
|
||||||
|
@item contrast_smoothness
|
||||||
|
Contrast recovery lowpass kernel size. Defaults to @code{3.5}. Increasing or
|
||||||
|
decreasing this will affect the visual appearance substantially. Has no effect
|
||||||
|
when @code{contrast_recovery} is disabled.
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
@subsubsection Dithering
|
@subsubsection Dithering
|
||||||
|
@ -219,6 +219,8 @@ typedef struct LibplaceboContext {
|
|||||||
float tonemapping_param;
|
float tonemapping_param;
|
||||||
int inverse_tonemapping;
|
int inverse_tonemapping;
|
||||||
int tonemapping_lut_size;
|
int tonemapping_lut_size;
|
||||||
|
float contrast_recovery;
|
||||||
|
float contrast_smoothness;
|
||||||
|
|
||||||
#if FF_API_LIBPLACEBO_OPTS
|
#if FF_API_LIBPLACEBO_OPTS
|
||||||
/* for backwards compatibility */
|
/* for backwards compatibility */
|
||||||
@ -431,6 +433,10 @@ static int update_settings(AVFilterContext *ctx)
|
|||||||
.tone_mapping_param = s->tonemapping_param,
|
.tone_mapping_param = s->tonemapping_param,
|
||||||
.inverse_tone_mapping = s->inverse_tonemapping,
|
.inverse_tone_mapping = s->inverse_tonemapping,
|
||||||
.lut_size = s->tonemapping_lut_size,
|
.lut_size = s->tonemapping_lut_size,
|
||||||
|
#if PL_API_VER >= 285
|
||||||
|
.contrast_recovery = s->contrast_recovery,
|
||||||
|
.contrast_smoothness = s->contrast_smoothness,
|
||||||
|
#endif
|
||||||
);
|
);
|
||||||
|
|
||||||
set_gamut_mode(&s->color_map_params, gamut_mode);
|
set_gamut_mode(&s->color_map_params, gamut_mode);
|
||||||
@ -1398,6 +1404,8 @@ 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 },
|
{ "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 },
|
{ "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 },
|
{ "tonemapping_lut_size", "Tone-mapping LUT size", OFFSET(tonemapping_lut_size), AV_OPT_TYPE_INT, {.i64 = 256}, 2, 1024, DYNAMIC },
|
||||||
|
{ "contrast_recovery", "HDR contrast recovery strength", OFFSET(contrast_recovery), AV_OPT_TYPE_FLOAT, {.dbl = 0.30}, 0.0, 3.0, DYNAMIC },
|
||||||
|
{ "contrast_smoothness", "HDR contrast recovery smoothness", OFFSET(contrast_smoothness), AV_OPT_TYPE_FLOAT, {.dbl = 3.50}, 1.0, 32.0, DYNAMIC },
|
||||||
|
|
||||||
#if FF_API_LIBPLACEBO_OPTS
|
#if FF_API_LIBPLACEBO_OPTS
|
||||||
/* deprecated options for backwards compatibility, defaulting to -1 to not override the new defaults */
|
/* deprecated options for backwards compatibility, defaulting to -1 to not override the new defaults */
|
||||||
|
Loading…
Reference in New Issue
Block a user