History

avfilter: remove deprecated FF_API_LIBPLACEBO_OPTS

James Almer committed 2 years ago

Commit e58afae1 parent 02aea612 files · +0 −78Browse files

Unified · Split

2 files
  1. libavfilter/version_major.h +0 −2
  2. libavfilter/vf_libplacebo.c +0 −76
libavfilter/version_major.h+0−2
@@ -35,6 +35,4 @@ · 34 unmodified lines
3535 * the public API and may change, break or disappear at any time.
3636 */
3737
38−#define FF_API_LIBPLACEBO_OPTS (LIBAVFILTER_VERSION_MAJOR < 10)
39−
4038 #endif /* AVFILTER_VERSION_MAJOR_H */
libavfilter/vf_libplacebo.c+0−76
@@ -240,20 +240,6 @@ typedef struct LibplaceboContext { · 239 unmodified lines
240240 float contrast_recovery;
241241 float contrast_smoothness;
242242
243−#if FF_API_LIBPLACEBO_OPTS
244− /* for backwards compatibility */
245− float desat_str;
246− float desat_exp;
247− int gamut_warning;
248− int gamut_clipping;
249− int force_icc_lut;
250− int intent;
251− int tonemapping_mode;
252− float crosstalk;
253− float overshoot;
254− float hybrid_mix;
255−#endif
256−
257243 /* pl_dither_params */
258244 int dithering;
259245 int dither_lut_size;
@@ -382,32 +368,6 @@ static int update_settings(AVFilterContext *ctx) · 122 unmodified lines
382368 int gamut_mode = s->gamut_mode;
383369 uint8_t color_rgba[4];
384370
385−#if FF_API_LIBPLACEBO_OPTS
386− float hybrid_mix = s->hybrid_mix;
387− /* backwards compatibility with older API */
388− switch (s->tonemapping_mode) {
389− case 0: /*PL_TONE_MAP_AUTO*/
390− if (s->desat_str >= 0.0f)
391− hybrid_mix = s->desat_str;
392− break;
393− case 1: /*PL_TONE_MAP_RGB*/ hybrid_mix = 1.0f; break;
394− case 2: /*PL_TONE_MAP_HYBRID*/ hybrid_mix = 0.2f; break;
395− case 3: /*PL_TONE_MAP_LUMA*/ hybrid_mix = 0.0f; break;
396− case 4: /*PL_TONE_MAP_MAX*/ hybrid_mix = 0.0f; break;
397− }
398−
399− switch (s->intent) {
400− case PL_INTENT_SATURATION: gamut_mode = GAMUT_MAP_SATURATION; break;
401− case PL_INTENT_RELATIVE_COLORIMETRIC: gamut_mode = GAMUT_MAP_RELATIVE; break;
402− case PL_INTENT_ABSOLUTE_COLORIMETRIC: gamut_mode = GAMUT_MAP_ABSOLUTE; break;
403− }
404−
405− if (s->gamut_warning)
406− gamut_mode = GAMUT_MAP_HIGHLIGHT;
407− if (s->gamut_clipping)
408− gamut_mode = GAMUT_MAP_DESATURATE;
409−#endif
410−
411371 RET(av_parse_color(color_rgba, s->fillcolor, -1, s));
412372
413373 opts->deband_params = *pl_deband_params(
@@ -434,21 +394,10 @@ static int update_settings(AVFilterContext *ctx) · 20 unmodified lines
434394 .scene_threshold_high = s->scene_high,
435395 #if PL_API_VER >= 263
436396 .percentile = s->percentile,
437−#endif
438−#if FF_API_LIBPLACEBO_OPTS && PL_API_VER < 256
439− .overshoot_margin = s->overshoot,
440397 #endif
441398 );
442399
443400 opts->color_map_params = *pl_color_map_params(
444−#if FF_API_LIBPLACEBO_OPTS
445−# if PL_API_VER >= 269
446− .hybrid_mix = hybrid_mix,
447−# else
448− .tone_mapping_mode = s->tonemapping_mode,
449− .tone_mapping_crosstalk = s->crosstalk,
450−# endif
451−#endif
452401 .tone_mapping_function = get_tonemapping_func(s->tonemapping),
453402 .tone_mapping_param = s->tonemapping_param,
454403 .inverse_tone_mapping = s->inverse_tonemapping,
@@ -1458,28 +1407,6 @@ static const AVOption libplacebo_options[] = { · 1003 unmodified lines
14581407 { "contrast_recovery", "HDR contrast recovery strength", OFFSET(contrast_recovery), AV_OPT_TYPE_FLOAT, {.dbl = 0.30}, 0.0, 3.0, DYNAMIC },
14591408 { "contrast_smoothness", "HDR contrast recovery smoothness", OFFSET(contrast_smoothness), AV_OPT_TYPE_FLOAT, {.dbl = 3.50}, 1.0, 32.0, DYNAMIC },
14601409
1461−#if FF_API_LIBPLACEBO_OPTS
1462− /* deprecated options for backwards compatibility, defaulting to -1 to not override the new defaults */
1463− { "desaturation_strength", "Desaturation strength", OFFSET(desat_str), AV_OPT_TYPE_FLOAT, {.dbl = -1.0}, -1.0, 1.0, DYNAMIC | AV_OPT_FLAG_DEPRECATED },
1464− { "desaturation_exponent", "Desaturation exponent", OFFSET(desat_exp), AV_OPT_TYPE_FLOAT, {.dbl = -1.0}, -1.0, 10.0, DYNAMIC | AV_OPT_FLAG_DEPRECATED },
1465− { "gamut_warning", "Highlight out-of-gamut colors", OFFSET(gamut_warning), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DYNAMIC | AV_OPT_FLAG_DEPRECATED },
1466− { "gamut_clipping", "Enable desaturating colorimetric gamut clipping", OFFSET(gamut_clipping), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DYNAMIC | AV_OPT_FLAG_DEPRECATED },
1467− { "intent", "Rendering intent", OFFSET(intent), AV_OPT_TYPE_INT, {.i64 = PL_INTENT_PERCEPTUAL}, 0, 3, DYNAMIC | AV_OPT_FLAG_DEPRECATED, .unit = "intent" },
1468− { "perceptual", "Perceptual", 0, AV_OPT_TYPE_CONST, {.i64 = PL_INTENT_PERCEPTUAL}, 0, 0, STATIC, .unit = "intent" },
1469− { "relative", "Relative colorimetric", 0, AV_OPT_TYPE_CONST, {.i64 = PL_INTENT_RELATIVE_COLORIMETRIC}, 0, 0, STATIC, .unit = "intent" },
1470− { "absolute", "Absolute colorimetric", 0, AV_OPT_TYPE_CONST, {.i64 = PL_INTENT_ABSOLUTE_COLORIMETRIC}, 0, 0, STATIC, .unit = "intent" },
1471− { "saturation", "Saturation mapping", 0, AV_OPT_TYPE_CONST, {.i64 = PL_INTENT_SATURATION}, 0, 0, STATIC, .unit = "intent" },
1472− { "tonemapping_mode", "Tone-mapping mode", OFFSET(tonemapping_mode), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 4, DYNAMIC | AV_OPT_FLAG_DEPRECATED, .unit = "tonemap_mode" },
1473− { "auto", "Automatic selection", 0, AV_OPT_TYPE_CONST, {.i64 = 0}, 0, 0, STATIC, .unit = "tonemap_mode" },
1474− { "rgb", "Per-channel (RGB)", 0, AV_OPT_TYPE_CONST, {.i64 = 1}, 0, 0, STATIC, .unit = "tonemap_mode" },
1475− { "max", "Maximum component", 0, AV_OPT_TYPE_CONST, {.i64 = 2}, 0, 0, STATIC, .unit = "tonemap_mode" },
1476− { "hybrid", "Hybrid of Luma/RGB", 0, AV_OPT_TYPE_CONST, {.i64 = 3}, 0, 0, STATIC, .unit = "tonemap_mode" },
1477− { "luma", "Luminance", 0, AV_OPT_TYPE_CONST, {.i64 = 4}, 0, 0, STATIC, .unit = "tonemap_mode" },
1478− { "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 },
1479− { "overshoot", "Tone-mapping overshoot margin", OFFSET(overshoot), AV_OPT_TYPE_FLOAT, {.dbl = 0.05}, 0.0, 1.0, DYNAMIC | AV_OPT_FLAG_DEPRECATED },
1480− { "hybrid_mix", "Tone-mapping hybrid LMS mixing coefficient", OFFSET(hybrid_mix), AV_OPT_TYPE_FLOAT, {.dbl = 0.20}, 0.0, 1.00, DYNAMIC },
1481−#endif
1482−
14831410 { "dithering", "Dither method to use", OFFSET(dithering), AV_OPT_TYPE_INT, {.i64 = PL_DITHER_BLUE_NOISE}, -1, PL_DITHER_METHOD_COUNT - 1, DYNAMIC, .unit = "dither" },
14841411 { "none", "Disable dithering", 0, AV_OPT_TYPE_CONST, {.i64 = -1}, 0, 0, STATIC, .unit = "dither" },
14851412 { "blue", "Blue noise", 0, AV_OPT_TYPE_CONST, {.i64 = PL_DITHER_BLUE_NOISE}, 0, 0, STATIC, .unit = "dither" },
@@ -1503,9 +1430,6 @@ static const AVOption libplacebo_options[] = { · 17 unmodified lines
15031430 { "polar_cutoff", "Polar LUT cutoff", OFFSET(polar_cutoff), AV_OPT_TYPE_FLOAT, {.dbl = 0}, 0.0, 1.0, DYNAMIC },
15041431 { "disable_linear", "Disable linear scaling", OFFSET(disable_linear), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DYNAMIC },
15051432 { "disable_builtin", "Disable built-in scalers", OFFSET(disable_builtin), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DYNAMIC },
1506−#if FF_API_LIBPLACEBO_OPTS
1507− { "force_icc_lut", "Deprecated, does nothing", OFFSET(force_icc_lut), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DYNAMIC | AV_OPT_FLAG_DEPRECATED },
1508−#endif
15091433 { "force_dither", "Force dithering", OFFSET(force_dither), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DYNAMIC },
15101434 { "disable_fbos", "Force-disable FBOs", OFFSET(disable_fbos), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DYNAMIC },
15111435 { NULL },

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t