| @@ -132,11 +132,14 @@ typedef struct LibplaceboContext { · 131 unmodified lines |
| 132 | 132 | int inverse_tonemapping; |
| 133 | 133 | float crosstalk; |
| 134 | 134 | int tonemapping_lut_size; |
| 135 | + |
| 136 | +#if FF_API_LIBPLACEBO_OPTS |
| 135 | 137 | /* for backwards compatibility */ |
| 136 | 138 | float desat_str; |
| 137 | 139 | float desat_exp; |
| 138 | 140 | int gamut_warning; |
| 139 | 141 | int gamut_clipping; |
| 142 | +#endif |
| 140 | 143 | |
| 141 | 144 | /* pl_dither_params */ |
| 142 | 145 | int dithering; |
| @@ -380,6 +383,7 @@ static int process_frames(AVFilterContext *avctx, AVFrame *out, AVFrame *in) · 237 unmodified lines |
| 380 | 383 | pl_rect2df_aspect_set(&target.crop, aspect, s->pad_crop_ratio); |
| 381 | 384 | } |
| 382 | 385 | |
| 386 | +#if FF_API_LIBPLACEBO_OPTS |
| 383 | 387 | /* backwards compatibility with older API */ |
| 384 | 388 | if (!tonemapping_mode && (s->desat_str >= 0.0f || s->desat_exp >= 0.0f)) { |
| 385 | 389 | float str = s->desat_str < 0.0f ? 0.9f : s->desat_str; |
| @@ -397,6 +401,7 @@ static int process_frames(AVFilterContext *avctx, AVFrame *out, AVFrame *in) · 11 unmodified lines |
| 397 | 401 | gamut_mode = PL_GAMUT_WARN; |
| 398 | 402 | if (s->gamut_clipping) |
| 399 | 403 | gamut_mode = PL_GAMUT_DESATURATE; |
| 404 | +#endif |
| 400 | 405 | |
| 401 | 406 | /* Update render params */ |
| 402 | 407 | params = (struct pl_render_params) { |
| @@ -818,11 +823,14 @@ static const AVOption libplacebo_options[] = { · 415 unmodified lines |
| 818 | 823 | { "inverse_tonemapping", "Inverse tone mapping (range expansion)", OFFSET(inverse_tonemapping), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DYNAMIC }, |
| 819 | 824 | { "tonemapping_crosstalk", "Crosstalk factor for tone-mapping", OFFSET(crosstalk), AV_OPT_TYPE_FLOAT, {.dbl = 0.04}, 0.0, 0.30, DYNAMIC }, |
| 820 | 825 | { "tonemapping_lut_size", "Tone-mapping LUT size", OFFSET(tonemapping_lut_size), AV_OPT_TYPE_INT, {.i64 = 256}, 2, 1024, DYNAMIC }, |
| 826 | + |
| 827 | +#if FF_API_LIBPLACEBO_OPTS |
| 821 | 828 | /* deprecated options for backwards compatibility, defaulting to -1 to not override the new defaults */ |
| 822 | 829 | { "desaturation_strength", "Desaturation strength", OFFSET(desat_str), AV_OPT_TYPE_FLOAT, {.dbl = -1.0}, -1.0, 1.0, DYNAMIC | AV_OPT_FLAG_DEPRECATED }, |
| 823 | 830 | { "desaturation_exponent", "Desaturation exponent", OFFSET(desat_exp), AV_OPT_TYPE_FLOAT, {.dbl = -1.0}, -1.0, 10.0, DYNAMIC | AV_OPT_FLAG_DEPRECATED }, |
| 824 | 831 | { "gamut_warning", "Highlight out-of-gamut colors", OFFSET(gamut_warning), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DYNAMIC | AV_OPT_FLAG_DEPRECATED }, |
| 825 | 832 | { "gamut_clipping", "Enable colorimetric gamut clipping", OFFSET(gamut_clipping), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DYNAMIC | AV_OPT_FLAG_DEPRECATED }, |
| 833 | +#endif |
| 826 | 834 | |
| 827 | 835 | { "dithering", "Dither method to use", OFFSET(dithering), AV_OPT_TYPE_INT, {.i64 = PL_DITHER_BLUE_NOISE}, -1, PL_DITHER_METHOD_COUNT - 1, DYNAMIC, "dither" }, |
| 828 | 836 | { "none", "Disable dithering", 0, AV_OPT_TYPE_CONST, {.i64 = -1}, 0, 0, STATIC, "dither" }, |