| @@ -240,20 +240,6 @@ typedef struct LibplaceboContext { · 239 unmodified lines |
| 240 | 240 | float contrast_recovery; |
| 241 | 241 | float contrast_smoothness; |
| 242 | 242 | |
| 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 | | − |
| 257 | 243 | /* pl_dither_params */ |
| 258 | 244 | int dithering; |
| 259 | 245 | int dither_lut_size; |
| @@ -382,32 +368,6 @@ static int update_settings(AVFilterContext *ctx) · 122 unmodified lines |
| 382 | 368 | int gamut_mode = s->gamut_mode; |
| 383 | 369 | uint8_t color_rgba[4]; |
| 384 | 370 | |
| 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 | | − |
| 411 | 371 | RET(av_parse_color(color_rgba, s->fillcolor, -1, s)); |
| 412 | 372 | |
| 413 | 373 | opts->deband_params = *pl_deband_params( |
| @@ -434,21 +394,10 @@ static int update_settings(AVFilterContext *ctx) · 20 unmodified lines |
| 434 | 394 | .scene_threshold_high = s->scene_high, |
| 435 | 395 | #if PL_API_VER >= 263 |
| 436 | 396 | .percentile = s->percentile, |
| 437 | | −#endif |
| 438 | | −#if FF_API_LIBPLACEBO_OPTS && PL_API_VER < 256 |
| 439 | | − .overshoot_margin = s->overshoot, |
| 440 | 397 | #endif |
| 441 | 398 | ); |
| 442 | 399 | |
| 443 | 400 | 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 |
| 452 | 401 | .tone_mapping_function = get_tonemapping_func(s->tonemapping), |
| 453 | 402 | .tone_mapping_param = s->tonemapping_param, |
| 454 | 403 | .inverse_tone_mapping = s->inverse_tonemapping, |
| @@ -1458,28 +1407,6 @@ static const AVOption libplacebo_options[] = { · 1003 unmodified lines |
| 1458 | 1407 | { "contrast_recovery", "HDR contrast recovery strength", OFFSET(contrast_recovery), AV_OPT_TYPE_FLOAT, {.dbl = 0.30}, 0.0, 3.0, DYNAMIC }, |
| 1459 | 1408 | { "contrast_smoothness", "HDR contrast recovery smoothness", OFFSET(contrast_smoothness), AV_OPT_TYPE_FLOAT, {.dbl = 3.50}, 1.0, 32.0, DYNAMIC }, |
| 1460 | 1409 | |
| 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 | | − |
| 1483 | 1410 | { "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" }, |
| 1484 | 1411 | { "none", "Disable dithering", 0, AV_OPT_TYPE_CONST, {.i64 = -1}, 0, 0, STATIC, .unit = "dither" }, |
| 1485 | 1412 | { "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 |
| 1503 | 1430 | { "polar_cutoff", "Polar LUT cutoff", OFFSET(polar_cutoff), AV_OPT_TYPE_FLOAT, {.dbl = 0}, 0.0, 1.0, DYNAMIC }, |
| 1504 | 1431 | { "disable_linear", "Disable linear scaling", OFFSET(disable_linear), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DYNAMIC }, |
| 1505 | 1432 | { "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 |
| 1509 | 1433 | { "force_dither", "Force dithering", OFFSET(force_dither), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DYNAMIC }, |
| 1510 | 1434 | { "disable_fbos", "Force-disable FBOs", OFFSET(disable_fbos), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DYNAMIC }, |
| 1511 | 1435 | { NULL }, |