History

lavfi/vf_libplacebo: add corner_rounding option

For what use it may be.

Niklas Haas committed 3 years ago

Commit c4cdd791 parent 098b3382 files · +11 −0Browse files

Unified · Split

2 files
  1. doc/filters.texi +6 −0
  2. libavfilter/vf_libplacebo.c +5 −0
doc/filters.texi+6−0
@@ -16164,6 +16164,12 @@ example as a result of @option{normalize_sar}. For the general syntax of this · 16163 unmodified lines
16164option, check the @ref{color syntax,,"Color" section in the ffmpeg-utils16164option, check the @ref{color syntax,,"Color" section in the ffmpeg-utils
16165manual,ffmpeg-utils}. Defaults to @code{black}.16165manual,ffmpeg-utils}. Defaults to @code{black}.
16166 16166
16167@item corner_rounding
16168Render frames with rounded corners. The value, given as a float ranging from
16169@code{0.0} to @code{1.0}, indicates the relative degree of rounding, from fully
16170square to fully circular. In other words, it gives the radius divided by half
16171the smaller side length. Defaults to @code{0.0}.
16172
16167@item colorspace16173@item colorspace
16168@item color_primaries16174@item color_primaries
16169@item color_trc16175@item color_trc
libavfilter/vf_libplacebo.c+5−0
@@ -148,6 +148,7 @@ typedef struct LibplaceboContext { · 147 unmodified lines
148 AVExpr *pos_x_pexpr, *pos_y_pexpr, *pos_w_pexpr, *pos_h_pexpr;148 AVExpr *pos_x_pexpr, *pos_y_pexpr, *pos_w_pexpr, *pos_h_pexpr;
149 AVRational target_sar;149 AVRational target_sar;
150 float pad_crop_ratio;150 float pad_crop_ratio;
151 float corner_rounding;
151 int force_original_aspect_ratio;152 int force_original_aspect_ratio;
152 int force_divisible_by;153 int force_divisible_by;
153 int normalize_sar;154 int normalize_sar;
@@ -440,6 +441,9 @@ static int update_settings(AVFilterContext *ctx) · 286 unmodified lines
440 (float) color_rgba[1] / UINT8_MAX,441 (float) color_rgba[1] / UINT8_MAX,
441 (float) color_rgba[2] / UINT8_MAX,442 (float) color_rgba[2] / UINT8_MAX,
442 },443 },
444#if PL_API_VER >= 277
445 .corner_rounding = s->corner_rounding,
446#endif
443 447
444 .deband_params = s->deband ? &s->deband_params : NULL,448 .deband_params = s->deband ? &s->deband_params : NULL,
445 .sigmoid_params = s->sigmoid ? &pl_sigmoid_default_params : NULL,449 .sigmoid_params = s->sigmoid ? &pl_sigmoid_default_params : NULL,
@@ -1154,6 +1158,7 @@ static const AVOption libplacebo_options[] = { · 708 unmodified lines
1154 { "normalize_sar", "force SAR normalization to 1:1 by adjusting pos_x/y/w/h", OFFSET(normalize_sar), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, STATIC },1158 { "normalize_sar", "force SAR normalization to 1:1 by adjusting pos_x/y/w/h", OFFSET(normalize_sar), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, STATIC },
1155 { "pad_crop_ratio", "ratio between padding and cropping when normalizing SAR (0=pad, 1=crop)", OFFSET(pad_crop_ratio), AV_OPT_TYPE_FLOAT, {.dbl=0.0}, 0.0, 1.0, DYNAMIC },1159 { "pad_crop_ratio", "ratio between padding and cropping when normalizing SAR (0=pad, 1=crop)", OFFSET(pad_crop_ratio), AV_OPT_TYPE_FLOAT, {.dbl=0.0}, 0.0, 1.0, DYNAMIC },
1156 { "fillcolor", "Background fill color", OFFSET(fillcolor), AV_OPT_TYPE_STRING, {.str = "black"}, .flags = DYNAMIC },1160 { "fillcolor", "Background fill color", OFFSET(fillcolor), AV_OPT_TYPE_STRING, {.str = "black"}, .flags = DYNAMIC },
1161 { "corner_rounding", "Corner rounding radius", OFFSET(corner_rounding), AV_OPT_TYPE_FLOAT, {.dbl = 0.0}, 0.0, 1.0, .flags = DYNAMIC },
1157 1162
1158 {"colorspace", "select colorspace", OFFSET(colorspace), AV_OPT_TYPE_INT, {.i64=-1}, -1, AVCOL_SPC_NB-1, DYNAMIC, "colorspace"},1163 {"colorspace", "select colorspace", OFFSET(colorspace), AV_OPT_TYPE_INT, {.i64=-1}, -1, AVCOL_SPC_NB-1, DYNAMIC, "colorspace"},
1159 {"auto", "keep the same colorspace", 0, AV_OPT_TYPE_CONST, {.i64=-1}, INT_MIN, INT_MAX, STATIC, "colorspace"},1164 {"auto", "keep the same colorspace", 0, AV_OPT_TYPE_CONST, {.i64=-1}, INT_MIN, INT_MAX, STATIC, "colorspace"},

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