96 char color_string[128] =
"black";
104 sscanf(args,
"%255[^:]:%255[^:]:%255[^:]:%255[^:]:%127s",
118 double var_values[
VARS_NB], res;
128 var_values[
VAR_A] = (double) inlink->
w / inlink->
h;
156 pad->
x = var_values[
VAR_X] = res;
161 pad->
y = var_values[
VAR_Y] = res;
167 pad->
x = var_values[
VAR_X] = res;
170 if (pad->
w < 0 || pad->
h < 0 || pad->
x < 0 || pad->
y < 0) {
188 inlink->
w, inlink->
h, pad->
w, pad->
h, pad->
x, pad->
y,
191 if (pad->
x < 0 || pad->
y < 0 ||
192 pad->
w <= 0 || pad->
h <= 0 ||
193 (
unsigned)pad->
x + (
unsigned)inlink->
w > pad->
w ||
194 (
unsigned)pad->
y + (
unsigned)inlink->
h > pad->
h) {
196 "Input area %d:%d:%d:%d not within the padded area 0:0:%d:%d or zero-sized\n",
197 pad->
x, pad->
y, pad->
x + inlink->
w, pad->
y + inlink->
h, pad->
w, pad->
h);
205 "Error when evaluating the expression '%s'\n", expr);
225 w + (pad->
w - pad->
in_w) + 4*align,
226 h + (pad->
h - pad->
in_h));
235 for (plane = 0; plane < 4 && picref->
data[plane]; plane++)
244 int64_t x_in_buf, y_in_buf;
246 x_in_buf = outpicref->
data[plane] - outpicref->
buf->
data[plane]
248 + (y >> vsub) * outpicref->
linesize[plane];
250 if(x_in_buf < 0 || x_in_buf % pad->draw.pixelstep[plane])
256 y_in_buf = x_in_buf / outpicref->
buf->
linesize[plane];
259 if( y_in_buf<<vsub >= outpicref->
buf->
h
260 || x_in_buf<<hsub >= outpicref->
buf->
w)
269 int plane, needs_copy;
276 for (plane = 0; plane < 4 && out->
data[plane] && pad->
draw.
pixelstep[plane]; plane++) {
288 if (
does_clip(pad, out, plane, hsub, vsub, 0, 0) ||
289 does_clip(pad, out, plane, hsub, vsub, 0, pad->
h - 1) ||
290 does_clip(pad, out, plane, hsub, vsub, pad->
w - 1, 0) ||
291 does_clip(pad, out, plane, hsub, vsub, pad->
w - 1, pad->
h - 1))
316 0, 0, pad->
w, pad->
y);
320 if (pad->
h > pad->
y + pad->
in_h) {
323 0, pad->
y + pad->
in_h, pad->
w, pad->
h - pad->
y - pad->
in_h);
338 pad->
x + pad->
in_w, pad->
y, pad->
w - pad->
x - pad->
in_w,
367 .description =
NULL_IF_CONFIG_SMALL(
"Pad input image to width:height[:x:y[:color]] (default x and y: 0, default color: black)."),
373 .
inputs = avfilter_vf_pad_inputs,
375 .
outputs = avfilter_vf_pad_outputs,