vf_pad.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008 vmrsss
3  * Copyright (c) 2009 Stefano Sabatini
4  *
5  * This file is part of Libav.
6  *
7  * Libav is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * Libav is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with Libav; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
27 #include "avfilter.h"
28 #include "formats.h"
29 #include "internal.h"
30 #include "video.h"
31 #include "libavutil/avstring.h"
32 #include "libavutil/common.h"
33 #include "libavutil/eval.h"
34 #include "libavutil/pixdesc.h"
35 #include "libavutil/colorspace.h"
36 #include "libavutil/avassert.h"
37 #include "libavutil/imgutils.h"
38 #include "libavutil/parseutils.h"
39 #include "libavutil/mathematics.h"
40 #include "drawutils.h"
41 
42 static const char *const var_names[] = {
43  "PI",
44  "PHI",
45  "E",
46  "in_w", "iw",
47  "in_h", "ih",
48  "out_w", "ow",
49  "out_h", "oh",
50  "x",
51  "y",
52  "a",
53  "hsub",
54  "vsub",
55  NULL
56 };
57 
58 enum var_name {
72 };
73 
75 {
76  static const enum AVPixelFormat pix_fmts[] = {
80 
87 
89  };
90 
92  return 0;
93 }
94 
95 typedef struct {
96  int w, h;
97  int x, y;
98  int in_w, in_h;
99 
100  char w_expr[256];
101  char h_expr[256];
102  char x_expr[256];
103  char y_expr[256];
104 
107  int line_step[4];
108  int hsub, vsub;
109 } PadContext;
110 
111 static av_cold int init(AVFilterContext *ctx, const char *args)
112 {
113  PadContext *pad = ctx->priv;
114  char color_string[128] = "black";
115 
116  av_strlcpy(pad->w_expr, "iw", sizeof(pad->w_expr));
117  av_strlcpy(pad->h_expr, "ih", sizeof(pad->h_expr));
118  av_strlcpy(pad->x_expr, "0" , sizeof(pad->w_expr));
119  av_strlcpy(pad->y_expr, "0" , sizeof(pad->h_expr));
120 
121  if (args)
122  sscanf(args, "%255[^:]:%255[^:]:%255[^:]:%255[^:]:%255s",
123  pad->w_expr, pad->h_expr, pad->x_expr, pad->y_expr, color_string);
124 
125  if (av_parse_color(pad->color, color_string, -1, ctx) < 0)
126  return AVERROR(EINVAL);
127 
128  return 0;
129 }
130 
131 static av_cold void uninit(AVFilterContext *ctx)
132 {
133  PadContext *pad = ctx->priv;
134  int i;
135 
136  for (i = 0; i < 4; i++) {
137  av_freep(&pad->line[i]);
138  pad->line_step[i] = 0;
139  }
140 }
141 
142 static int config_input(AVFilterLink *inlink)
143 {
144  AVFilterContext *ctx = inlink->dst;
145  PadContext *pad = ctx->priv;
146  const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(inlink->format);
147  uint8_t rgba_color[4];
148  int ret, is_packed_rgba;
149  double var_values[VARS_NB], res;
150  char *expr;
151 
152  pad->hsub = pix_desc->log2_chroma_w;
153  pad->vsub = pix_desc->log2_chroma_h;
154 
155  var_values[VAR_PI] = M_PI;
156  var_values[VAR_PHI] = M_PHI;
157  var_values[VAR_E] = M_E;
158  var_values[VAR_IN_W] = var_values[VAR_IW] = inlink->w;
159  var_values[VAR_IN_H] = var_values[VAR_IH] = inlink->h;
160  var_values[VAR_OUT_W] = var_values[VAR_OW] = NAN;
161  var_values[VAR_OUT_H] = var_values[VAR_OH] = NAN;
162  var_values[VAR_A] = (double) inlink->w / inlink->h;
163  var_values[VAR_HSUB] = 1<<pad->hsub;
164  var_values[VAR_VSUB] = 1<<pad->vsub;
165 
166  /* evaluate width and height */
167  av_expr_parse_and_eval(&res, (expr = pad->w_expr),
168  var_names, var_values,
169  NULL, NULL, NULL, NULL, NULL, 0, ctx);
170  pad->w = var_values[VAR_OUT_W] = var_values[VAR_OW] = res;
171  if ((ret = av_expr_parse_and_eval(&res, (expr = pad->h_expr),
172  var_names, var_values,
173  NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0)
174  goto eval_fail;
175  pad->h = var_values[VAR_OUT_H] = var_values[VAR_OH] = res;
176  /* evaluate the width again, as it may depend on the evaluated output height */
177  if ((ret = av_expr_parse_and_eval(&res, (expr = pad->w_expr),
178  var_names, var_values,
179  NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0)
180  goto eval_fail;
181  pad->w = var_values[VAR_OUT_W] = var_values[VAR_OW] = res;
182 
183  /* evaluate x and y */
184  av_expr_parse_and_eval(&res, (expr = pad->x_expr),
185  var_names, var_values,
186  NULL, NULL, NULL, NULL, NULL, 0, ctx);
187  pad->x = var_values[VAR_X] = res;
188  if ((ret = av_expr_parse_and_eval(&res, (expr = pad->y_expr),
189  var_names, var_values,
190  NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0)
191  goto eval_fail;
192  pad->y = var_values[VAR_Y] = res;
193  /* evaluate x again, as it may depend on the evaluated y value */
194  if ((ret = av_expr_parse_and_eval(&res, (expr = pad->x_expr),
195  var_names, var_values,
196  NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0)
197  goto eval_fail;
198  pad->x = var_values[VAR_X] = res;
199 
200  /* sanity check params */
201  if (pad->w < 0 || pad->h < 0 || pad->x < 0 || pad->y < 0) {
202  av_log(ctx, AV_LOG_ERROR, "Negative values are not acceptable.\n");
203  return AVERROR(EINVAL);
204  }
205 
206  if (!pad->w)
207  pad->w = inlink->w;
208  if (!pad->h)
209  pad->h = inlink->h;
210 
211  pad->w &= ~((1 << pad->hsub) - 1);
212  pad->h &= ~((1 << pad->vsub) - 1);
213  pad->x &= ~((1 << pad->hsub) - 1);
214  pad->y &= ~((1 << pad->vsub) - 1);
215 
216  pad->in_w = inlink->w & ~((1 << pad->hsub) - 1);
217  pad->in_h = inlink->h & ~((1 << pad->vsub) - 1);
218 
219  memcpy(rgba_color, pad->color, sizeof(rgba_color));
220  ff_fill_line_with_color(pad->line, pad->line_step, pad->w, pad->color,
221  inlink->format, rgba_color, &is_packed_rgba, NULL);
222 
223  av_log(ctx, AV_LOG_VERBOSE, "w:%d h:%d -> w:%d h:%d x:%d y:%d color:0x%02X%02X%02X%02X[%s]\n",
224  inlink->w, inlink->h, pad->w, pad->h, pad->x, pad->y,
225  pad->color[0], pad->color[1], pad->color[2], pad->color[3],
226  is_packed_rgba ? "rgba" : "yuva");
227 
228  if (pad->x < 0 || pad->y < 0 ||
229  pad->w <= 0 || pad->h <= 0 ||
230  (unsigned)pad->x + (unsigned)inlink->w > pad->w ||
231  (unsigned)pad->y + (unsigned)inlink->h > pad->h) {
232  av_log(ctx, AV_LOG_ERROR,
233  "Input area %d:%d:%d:%d not within the padded area 0:0:%d:%d or zero-sized\n",
234  pad->x, pad->y, pad->x + inlink->w, pad->y + inlink->h, pad->w, pad->h);
235  return AVERROR(EINVAL);
236  }
237 
238  return 0;
239 
240 eval_fail:
241  av_log(NULL, AV_LOG_ERROR,
242  "Error when evaluating the expression '%s'\n", expr);
243  return ret;
244 
245 }
246 
247 static int config_output(AVFilterLink *outlink)
248 {
249  PadContext *pad = outlink->src->priv;
250 
251  outlink->w = pad->w;
252  outlink->h = pad->h;
253  return 0;
254 }
255 
256 static AVFilterBufferRef *get_video_buffer(AVFilterLink *inlink, int perms, int w, int h)
257 {
258  PadContext *pad = inlink->dst->priv;
259 
260  AVFilterBufferRef *picref = ff_get_video_buffer(inlink->dst->outputs[0], perms,
261  w + (pad->w - pad->in_w),
262  h + (pad->h - pad->in_h));
263  int plane;
264 
265  if (!picref)
266  return NULL;
267 
268  picref->video->w = w;
269  picref->video->h = h;
270 
271  for (plane = 0; plane < 4 && picref->data[plane]; plane++) {
272  int hsub = (plane == 1 || plane == 2) ? pad->hsub : 0;
273  int vsub = (plane == 1 || plane == 2) ? pad->vsub : 0;
274 
275  picref->data[plane] += (pad->x >> hsub) * pad->line_step[plane] +
276  (pad->y >> vsub) * picref->linesize[plane];
277  }
278 
279  return picref;
280 }
281 
282 static int does_clip(PadContext *pad, AVFilterBufferRef *outpicref, int plane, int hsub, int vsub, int x, int y)
283 {
284  int64_t x_in_buf, y_in_buf;
285 
286  x_in_buf = outpicref->data[plane] - outpicref->buf->data[plane]
287  + (x >> hsub) * pad ->line_step[plane]
288  + (y >> vsub) * outpicref->linesize [plane];
289 
290  if(x_in_buf < 0 || x_in_buf % pad->line_step[plane])
291  return 1;
292  x_in_buf /= pad->line_step[plane];
293 
294  av_assert0(outpicref->buf->linesize[plane]>0); //while reference can use negative linesize the main buffer should not
295 
296  y_in_buf = x_in_buf / outpicref->buf->linesize[plane];
297  x_in_buf %= outpicref->buf->linesize[plane];
298 
299  if( y_in_buf<<vsub >= outpicref->buf->h
300  || x_in_buf<<hsub >= outpicref->buf->w)
301  return 1;
302  return 0;
303 }
304 
306 {
307  PadContext *pad = inlink->dst->priv;
308  AVFilterBufferRef *out = avfilter_ref_buffer(in, ~0);
309  int plane, needs_copy;
310 
311  if (!out) {
313  return AVERROR(ENOMEM);
314  }
315 
316  for (plane = 0; plane < 4 && out->data[plane]; plane++) {
317  int hsub = (plane == 1 || plane == 2) ? pad->hsub : 0;
318  int vsub = (plane == 1 || plane == 2) ? pad->vsub : 0;
319 
320  av_assert0(out->buf->w > 0 && out->buf->h > 0);
321 
322  if (out->format != out->buf->format) //unsupported currently
323  break;
324 
325  out->data[plane] -= (pad->x >> hsub) * pad->line_step[plane] +
326  (pad->y >> vsub) * out->linesize [plane];
327 
328  if (does_clip(pad, out, plane, hsub, vsub, 0, 0) ||
329  does_clip(pad, out, plane, hsub, vsub, 0, pad->h - 1) ||
330  does_clip(pad, out, plane, hsub, vsub, pad->w - 1, 0) ||
331  does_clip(pad, out, plane, hsub, vsub, pad->w - 1, pad->h - 1))
332  break;
333  }
334  needs_copy = plane < 4 && out->data[plane];
335  if (needs_copy) {
336  av_log(inlink->dst, AV_LOG_DEBUG, "Direct padding impossible allocating new frame\n");
339  FFMAX(inlink->w, pad->w),
340  FFMAX(inlink->h, pad->h));
341  if (!out) {
343  return AVERROR(ENOMEM);
344  }
345 
347  }
348 
349  out->video->w = pad->w;
350  out->video->h = pad->h;
351 
352  /* top bar */
353  if (pad->y) {
354  ff_draw_rectangle(out->data, out->linesize,
355  pad->line, pad->line_step, pad->hsub, pad->vsub,
356  0, 0, pad->w, pad->y);
357  }
358 
359  /* bottom bar */
360  if (pad->h > pad->y + pad->in_h) {
361  ff_draw_rectangle(out->data, out->linesize,
362  pad->line, pad->line_step, pad->hsub, pad->vsub,
363  0, pad->y + pad->in_h, pad->w, pad->h - pad->y - pad->in_h);
364  }
365 
366  /* left border */
367  ff_draw_rectangle(out->data, out->linesize, pad->line, pad->line_step,
368  pad->hsub, pad->vsub, 0, pad->y, pad->x, in->video->h);
369 
370  if (needs_copy) {
371  ff_copy_rectangle(out->data, out->linesize, in->data, in->linesize,
372  pad->line_step, pad->hsub, pad->vsub,
373  pad->x, pad->y, 0, in->video->w, in->video->h);
374  }
375 
376  /* right border */
377  ff_draw_rectangle(out->data, out->linesize,
378  pad->line, pad->line_step, pad->hsub, pad->vsub,
379  pad->x + pad->in_w, pad->y, pad->w - pad->x - pad->in_w,
380  in->video->h);
381 
383  return ff_filter_frame(inlink->dst->outputs[0], out);
384 }
385 
387  {
388  .name = "default",
389  .type = AVMEDIA_TYPE_VIDEO,
390  .config_props = config_input,
391  .get_video_buffer = get_video_buffer,
392  .filter_frame = filter_frame,
393  },
394  { NULL }
395 };
396 
398  {
399  .name = "default",
400  .type = AVMEDIA_TYPE_VIDEO,
401  .config_props = config_output,
402  },
403  { NULL }
404 };
405 
407  .name = "pad",
408  .description = NULL_IF_CONFIG_SMALL("Pad input image to width:height[:x:y[:color]] (default x and y: 0, default color: black)."),
409 
410  .priv_size = sizeof(PadContext),
411  .init = init,
412  .uninit = uninit,
414 
415  .inputs = avfilter_vf_pad_inputs,
416 
417  .outputs = avfilter_vf_pad_outputs,
418 };
uint8_t * data[8]
buffer data for each plane/channel
Definition: avfilter.h:63
static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *in)
Definition: vf_pad.c:305
int format
media format
Definition: avfilter.h:92
Definition: vf_pad.c:59
int vsub
chroma subsampling values
Definition: vf_pad.c:108
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:1435
AVFilterBufferRefVideoProps * video
video buffer specific properties
Definition: avfilter.h:159
int linesize[8]
number of bytes per line
Definition: avfilter.h:157
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:70
misc image utilities
static const AVFilterPad outputs[]
Definition: af_ashowinfo.c:122
packed RGB 8:8:8, 24bpp, RGBRGB...
Definition: pixfmt.h:67
int in_h
width and height for the padded input video, which has to be aligned to the chroma values in order to...
Definition: vf_pad.c:98
int ff_filter_frame(AVFilterLink *link, AVFilterBufferRef *frame)
Send a frame of data to the next filter.
Definition: avfilter.c:459
int x
Definition: vf_pad.c:97
Various defines for YUV<->RGB conversion.
static const AVFilterPad avfilter_vf_pad_outputs[]
Definition: vf_pad.c:397
static int config_output(AVFilterLink *outlink)
Definition: vf_pad.c:247
Definition: vf_pad.c:66
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
Definition: pixdesc.h:66
int h
width and height of the allocated buffer
Definition: avfilter.h:93
char w_expr[256]
width expression string
Definition: vf_pad.c:100
void avfilter_unref_buffer(AVFilterBufferRef *ref)
Remove a reference to a buffer.
Definition: buffer.c:75
int w
Definition: vf_pad.c:96
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
Definition: mem.c:151
AVFilterFormats * ff_make_format_list(const int *fmts)
Create a list of supported formats.
Definition: formats.c:165
char h_expr[256]
height expression string
Definition: vf_pad.c:101
const char * name
Pad name.
Definition: internal.h:39
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Definition: avassert.h:37
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
Definition: pixfmt.h:102
uint8_t
int linesize[8]
number of bytes per line
Definition: avfilter.h:80
Definition: vf_pad.c:68
#define NAN
Definition: math.h:7
static const char *const var_names[]
Definition: vf_pad.c:42
void avfilter_unref_bufferp(AVFilterBufferRef **ref)
Remove a reference to a buffer and set the pointer to NULL.
Definition: buffer.c:88
Definition: vf_pad.c:63
char y_expr[256]
height expression string
Definition: vf_pad.c:103
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
Definition: pixfmt.h:95
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range ...
Definition: pixfmt.h:101
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_...
Definition: pixfmt.h:78
var_name
Definition: vf_boxblur.c:47
void ff_set_common_formats(AVFilterContext *ctx, AVFilterFormats *formats)
A helper for query_formats() which sets all links to the same list of formats.
Definition: formats.c:375
static av_cold int init(AVFilterContext *ctx, const char *args)
Definition: vf_pad.c:111
int av_parse_color(uint8_t *rgba_color, const char *color_string, int slen, void *log_ctx)
Put the RGBA values that correspond to color_string in rgba_color.
Definition: parseutils.c:300
A filter pad used for either input or output.
Definition: internal.h:33
int av_expr_parse_and_eval(double *d, const char *s, const char *const *const_names, const double *const_values, const char *const *func1_names, double(*const *funcs1)(void *, double), const char *const *func2_names, double(*const *funcs2)(void *, double, double), void *opaque, int log_offset, void *log_ctx)
Parse and evaluate an expression.
Definition: eval.c:548
AVFilterBufferRef * ff_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
Request a picture buffer with a specific set of permissions.
Definition: video.c:145
int h
image height
Definition: avfilter.h:123
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
Definition: pixdesc.h:75
AVFilterBuffer * buf
the buffer that this is a reference to
Definition: avfilter.h:140
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:88
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
Definition: pixfmt.h:96
void * priv
private data for use by the filter
Definition: avfilter.h:439
static int config_input(AVFilterLink *inlink)
Definition: vf_pad.c:142
Definition: graph2dot.c:48
simple assert() macros that are a bit more flexible than ISO C assert().
void av_log(void *avcl, int level, const char *fmt,...)
Definition: log.c:146
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
Definition: pixfmt.h:93
size_t av_strlcpy(char *dst, const char *src, size_t size)
Copy the string src to dst, but no more than size - 1 bytes, and null-terminate dst.
Definition: avstring.c:67
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
Definition: pixfmt.h:94
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:69
AVFilterBufferRef * avfilter_ref_buffer(AVFilterBufferRef *ref, int pmask)
Add a new reference to a buffer.
Definition: buffer.c:35
Definition: vf_pad.c:60
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_...
Definition: pixfmt.h:77
#define M_E
Definition: ratecontrol.c:39
Definition: vf_pad.c:62
AVFilter avfilter_vf_pad
Definition: vf_pad.c:406
int y
offsets of the input area with respect to the padded area
Definition: vf_pad.c:97
int in_w
Definition: vf_pad.c:98
Definition: vf_pad.c:64
packed RGB 8:8:8, 24bpp, BGRBGR...
Definition: pixfmt.h:68
A reference to an AVFilterBuffer.
Definition: avfilter.h:139
NULL
Definition: eval.c:52
static int does_clip(PadContext *pad, AVFilterBufferRef *outpicref, int plane, int hsub, int vsub, int x, int y)
Definition: vf_pad.c:282
misc drawing utilities
Definition: vf_pad.c:71
static const AVFilterPad avfilter_vf_pad_inputs[]
Definition: vf_pad.c:386
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Definition: pixdesc.h:55
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
Definition: pixfmt.h:71
Filter definition.
Definition: avfilter.h:371
static const AVFilterPad inputs[]
Definition: af_ashowinfo.c:110
void ff_copy_rectangle(uint8_t *dst[4], int dst_linesize[4], uint8_t *src[4], int src_linesize[4], int pixelstep[4], int hsub, int vsub, int x, int y, int y2, int w, int h)
Definition: drawutils.c:102
uint8_t color[4]
color expressed either in YUVA or RGBA colorspace for the padding area
Definition: vf_pad.c:105
#define M_PHI
Definition: mathematics.h:34
Definition: vf_pad.c:67
const char * name
filter name
Definition: avfilter.h:372
Definition: vf_pad.c:65
misc parsing utilities
AVFilterLink ** outputs
array of pointers to output links
Definition: avfilter.h:433
static AVFilterBufferRef * get_video_buffer(AVFilterLink *inlink, int perms, int w, int h)
Definition: vf_pad.c:256
static int query_formats(AVFilterContext *ctx)
Definition: vf_pad.c:74
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:65
common internal and external API header
void avfilter_copy_buffer_ref_props(AVFilterBufferRef *dst, AVFilterBufferRef *src)
Copy properties of src to dst, without copying the actual data.
Definition: buffer.c:164
Definition: vf_pad.c:61
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_...
Definition: pixfmt.h:79
uint8_t * line[4]
Definition: vf_pad.c:106
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
Definition: pixfmt.h:72
static const uint8_t color[]
Definition: log.c:52
#define AV_PERM_WRITE
can write to the buffer
Definition: avfilter.h:98
int ff_fill_line_with_color(uint8_t *line[4], int pixel_step[4], int w, uint8_t dst_color[4], enum AVPixelFormat pix_fmt, uint8_t rgba_color[4], int *is_packed_rgba, uint8_t rgba_map_ptr[4])
Definition: drawutils.c:29
uint8_t * data[8]
picture/audio data for each plane
Definition: avfilter.h:141
int format
media format
Definition: avfilter.h:170
int h
output dimensions, a value of 0 will result in the input size
Definition: vf_pad.c:96
int line_step[4]
Definition: vf_pad.c:107
An instance of a filter.
Definition: avfilter.h:418
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
Definition: pixfmt.h:100
char x_expr[256]
width expression string
Definition: vf_pad.c:102
int hsub
Definition: vf_pad.c:108
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_pad.c:131
internal API functions
void ff_draw_rectangle(uint8_t *dst[4], int dst_linesize[4], uint8_t *src[4], int pixelstep[4], int hsub, int vsub, int x, int y, int w, int h)
Definition: drawutils.c:82
AVPixelFormat
Pixel format.
Definition: pixfmt.h:63
#define AV_PERM_NEG_LINESIZES
the buffer requested can have negative linesizes
Definition: avfilter.h:102
simple arithmetic expression evaluator