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
1616416164 option, check the @ref{color syntax,,"Color" section in the ffmpeg-utils
1616516165 manual,ffmpeg-utils}. Defaults to @code{black}.
1616616166
16167+@item corner_rounding
16168+Render 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
16170+square to fully circular. In other words, it gives the radius divided by half
16171+the smaller side length. Defaults to @code{0.0}.
16172+
1616716173 @item colorspace
1616816174 @item color_primaries
1616916175 @item color_trc
libavfilter/vf_libplacebo.c+5−0
@@ -148,6 +148,7 @@ typedef struct LibplaceboContext { · 147 unmodified lines
148148 AVExpr *pos_x_pexpr, *pos_y_pexpr, *pos_w_pexpr, *pos_h_pexpr;
149149 AVRational target_sar;
150150 float pad_crop_ratio;
151+ float corner_rounding;
151152 int force_original_aspect_ratio;
152153 int force_divisible_by;
153154 int normalize_sar;
@@ -440,6 +441,9 @@ static int update_settings(AVFilterContext *ctx) · 286 unmodified lines
440441 (float) color_rgba[1] / UINT8_MAX,
441442 (float) color_rgba[2] / UINT8_MAX,
442443 },
444+#if PL_API_VER >= 277
445+ .corner_rounding = s->corner_rounding,
446+#endif
443447
444448 .deband_params = s->deband ? &s->deband_params : NULL,
445449 .sigmoid_params = s->sigmoid ? &pl_sigmoid_default_params : NULL,
@@ -1154,6 +1158,7 @@ static const AVOption libplacebo_options[] = { · 708 unmodified lines
11541158 { "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 },
11551159 { "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 },
11561160 { "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 },
11571162
11581163 {"colorspace", "select colorspace", OFFSET(colorspace), AV_OPT_TYPE_INT, {.i64=-1}, -1, AVCOL_SPC_NB-1, DYNAMIC, "colorspace"},
11591164 {"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