FFmpeg  2.6.3
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
vf_drawbox.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008 Affine Systems, Inc (Michael Sullivan, Bobby Impollonia)
3  * Copyright (c) 2013 Andrey Utkin <andrey.krieger.utkin gmail com>
4  *
5  * This file is part of FFmpeg.
6  *
7  * FFmpeg 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  * FFmpeg 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 FFmpeg; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 /**
23  * @file
24  * Box and grid drawing filters. Also a nice template for a filter
25  * that needs to write in the input frame.
26  */
27 
28 #include "libavutil/colorspace.h"
29 #include "libavutil/common.h"
30 #include "libavutil/opt.h"
31 #include "libavutil/eval.h"
32 #include "libavutil/pixdesc.h"
33 #include "libavutil/parseutils.h"
34 #include "avfilter.h"
35 #include "formats.h"
36 #include "internal.h"
37 #include "video.h"
38 
39 static const char *const var_names[] = {
40  "dar",
41  "hsub", "vsub",
42  "in_h", "ih", ///< height of the input video
43  "in_w", "iw", ///< width of the input video
44  "sar",
45  "x",
46  "y",
47  "h", ///< height of the rendered box
48  "w", ///< width of the rendered box
49  "t",
50  "max",
51  NULL
52 };
53 
54 enum { Y, U, V, A };
55 
56 enum var_name {
69 };
70 
71 typedef struct DrawBoxContext {
72  const AVClass *class;
73  int x, y, w, h;
74  int thickness;
75  char *color_str;
76  unsigned char yuv_color[4];
77  int invert_color; ///< invert luma color
78  int vsub, hsub; ///< chroma subsampling
79  char *x_expr, *y_expr; ///< expression for x and y
80  char *w_expr, *h_expr; ///< expression for width and height
81  char *t_expr; ///< expression for thickness
83 
84 static const int NUM_EXPR_EVALS = 5;
85 
86 static av_cold int init(AVFilterContext *ctx)
87 {
88  DrawBoxContext *s = ctx->priv;
89  uint8_t rgba_color[4];
90 
91  if (!strcmp(s->color_str, "invert"))
92  s->invert_color = 1;
93  else if (av_parse_color(rgba_color, s->color_str, -1, ctx) < 0)
94  return AVERROR(EINVAL);
95 
96  if (!s->invert_color) {
97  s->yuv_color[Y] = RGB_TO_Y_CCIR(rgba_color[0], rgba_color[1], rgba_color[2]);
98  s->yuv_color[U] = RGB_TO_U_CCIR(rgba_color[0], rgba_color[1], rgba_color[2], 0);
99  s->yuv_color[V] = RGB_TO_V_CCIR(rgba_color[0], rgba_color[1], rgba_color[2], 0);
100  s->yuv_color[A] = rgba_color[3];
101  }
102 
103  return 0;
104 }
105 
107 {
108  static const enum AVPixelFormat pix_fmts[] = {
114  };
115 
117  return 0;
118 }
119 
120 static int config_input(AVFilterLink *inlink)
121 {
122  AVFilterContext *ctx = inlink->dst;
123  DrawBoxContext *s = ctx->priv;
124  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
125  double var_values[VARS_NB], res;
126  char *expr;
127  int ret;
128  int i;
129 
130  s->hsub = desc->log2_chroma_w;
131  s->vsub = desc->log2_chroma_h;
132 
133  var_values[VAR_IN_H] = var_values[VAR_IH] = inlink->h;
134  var_values[VAR_IN_W] = var_values[VAR_IW] = inlink->w;
135  var_values[VAR_SAR] = inlink->sample_aspect_ratio.num ? av_q2d(inlink->sample_aspect_ratio) : 1;
136  var_values[VAR_DAR] = (double)inlink->w / inlink->h * var_values[VAR_SAR];
137  var_values[VAR_HSUB] = s->hsub;
138  var_values[VAR_VSUB] = s->vsub;
139  var_values[VAR_X] = NAN;
140  var_values[VAR_Y] = NAN;
141  var_values[VAR_H] = NAN;
142  var_values[VAR_W] = NAN;
143  var_values[VAR_T] = NAN;
144 
145  for (i = 0; i <= NUM_EXPR_EVALS; i++) {
146  /* evaluate expressions, fail on last iteration */
147  var_values[VAR_MAX] = inlink->w;
148  if ((ret = av_expr_parse_and_eval(&res, (expr = s->x_expr),
149  var_names, var_values,
150  NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0 && i == NUM_EXPR_EVALS)
151  goto fail;
152  s->x = var_values[VAR_X] = res;
153 
154  var_values[VAR_MAX] = inlink->h;
155  if ((ret = av_expr_parse_and_eval(&res, (expr = s->y_expr),
156  var_names, var_values,
157  NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0 && i == NUM_EXPR_EVALS)
158  goto fail;
159  s->y = var_values[VAR_Y] = res;
160 
161  var_values[VAR_MAX] = inlink->w - s->x;
162  if ((ret = av_expr_parse_and_eval(&res, (expr = s->w_expr),
163  var_names, var_values,
164  NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0 && i == NUM_EXPR_EVALS)
165  goto fail;
166  s->w = var_values[VAR_W] = res;
167 
168  var_values[VAR_MAX] = inlink->h - s->y;
169  if ((ret = av_expr_parse_and_eval(&res, (expr = s->h_expr),
170  var_names, var_values,
171  NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0 && i == NUM_EXPR_EVALS)
172  goto fail;
173  s->h = var_values[VAR_H] = res;
174 
175  var_values[VAR_MAX] = INT_MAX;
176  if ((ret = av_expr_parse_and_eval(&res, (expr = s->t_expr),
177  var_names, var_values,
178  NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0 && i == NUM_EXPR_EVALS)
179  goto fail;
180  s->thickness = var_values[VAR_T] = res;
181  }
182 
183  /* if w or h are zero, use the input w/h */
184  s->w = (s->w > 0) ? s->w : inlink->w;
185  s->h = (s->h > 0) ? s->h : inlink->h;
186 
187  /* sanity check width and height */
188  if (s->w < 0 || s->h < 0) {
189  av_log(ctx, AV_LOG_ERROR, "Size values less than 0 are not acceptable.\n");
190  return AVERROR(EINVAL);
191  }
192 
193  av_log(ctx, AV_LOG_VERBOSE, "x:%d y:%d w:%d h:%d color:0x%02X%02X%02X%02X\n",
194  s->x, s->y, s->w, s->h,
195  s->yuv_color[Y], s->yuv_color[U], s->yuv_color[V], s->yuv_color[A]);
196 
197  return 0;
198 
199 fail:
200  av_log(ctx, AV_LOG_ERROR,
201  "Error when evaluating the expression '%s'.\n",
202  expr);
203  return ret;
204 }
205 
206 static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
207 {
208  DrawBoxContext *s = inlink->dst->priv;
209  int plane, x, y, xb = s->x, yb = s->y;
210  unsigned char *row[4];
211 
212  for (y = FFMAX(yb, 0); y < frame->height && y < (yb + s->h); y++) {
213  row[0] = frame->data[0] + y * frame->linesize[0];
214 
215  for (plane = 1; plane < 3; plane++)
216  row[plane] = frame->data[plane] +
217  frame->linesize[plane] * (y >> s->vsub);
218 
219  if (s->invert_color) {
220  for (x = FFMAX(xb, 0); x < xb + s->w && x < frame->width; x++)
221  if ((y - yb < s->thickness) || (yb + s->h - 1 - y < s->thickness) ||
222  (x - xb < s->thickness) || (xb + s->w - 1 - x < s->thickness))
223  row[0][x] = 0xff - row[0][x];
224  } else {
225  for (x = FFMAX(xb, 0); x < xb + s->w && x < frame->width; x++) {
226  double alpha = (double)s->yuv_color[A] / 255;
227 
228  if ((y - yb < s->thickness) || (yb + s->h - 1 - y < s->thickness) ||
229  (x - xb < s->thickness) || (xb + s->w - 1 - x < s->thickness)) {
230  row[0][x ] = (1 - alpha) * row[0][x ] + alpha * s->yuv_color[Y];
231  row[1][x >> s->hsub] = (1 - alpha) * row[1][x >> s->hsub] + alpha * s->yuv_color[U];
232  row[2][x >> s->hsub] = (1 - alpha) * row[2][x >> s->hsub] + alpha * s->yuv_color[V];
233  }
234  }
235  }
236  }
237 
238  return ff_filter_frame(inlink->dst->outputs[0], frame);
239 }
240 
241 #define OFFSET(x) offsetof(DrawBoxContext, x)
242 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
243 
244 #if CONFIG_DRAWBOX_FILTER
245 
246 static const AVOption drawbox_options[] = {
247  { "x", "set horizontal position of the left box edge", OFFSET(x_expr), AV_OPT_TYPE_STRING, { .str="0" }, CHAR_MIN, CHAR_MAX, FLAGS },
248  { "y", "set vertical position of the top box edge", OFFSET(y_expr), AV_OPT_TYPE_STRING, { .str="0" }, CHAR_MIN, CHAR_MAX, FLAGS },
249  { "width", "set width of the box", OFFSET(w_expr), AV_OPT_TYPE_STRING, { .str="0" }, CHAR_MIN, CHAR_MAX, FLAGS },
250  { "w", "set width of the box", OFFSET(w_expr), AV_OPT_TYPE_STRING, { .str="0" }, CHAR_MIN, CHAR_MAX, FLAGS },
251  { "height", "set height of the box", OFFSET(h_expr), AV_OPT_TYPE_STRING, { .str="0" }, CHAR_MIN, CHAR_MAX, FLAGS },
252  { "h", "set height of the box", OFFSET(h_expr), AV_OPT_TYPE_STRING, { .str="0" }, CHAR_MIN, CHAR_MAX, FLAGS },
253  { "color", "set color of the box", OFFSET(color_str), AV_OPT_TYPE_STRING, { .str = "black" }, CHAR_MIN, CHAR_MAX, FLAGS },
254  { "c", "set color of the box", OFFSET(color_str), AV_OPT_TYPE_STRING, { .str = "black" }, CHAR_MIN, CHAR_MAX, FLAGS },
255  { "thickness", "set the box thickness", OFFSET(t_expr), AV_OPT_TYPE_STRING, { .str="3" }, CHAR_MIN, CHAR_MAX, FLAGS },
256  { "t", "set the box thickness", OFFSET(t_expr), AV_OPT_TYPE_STRING, { .str="3" }, CHAR_MIN, CHAR_MAX, FLAGS },
257  { NULL }
258 };
259 
260 AVFILTER_DEFINE_CLASS(drawbox);
261 
262 static const AVFilterPad drawbox_inputs[] = {
263  {
264  .name = "default",
265  .type = AVMEDIA_TYPE_VIDEO,
266  .config_props = config_input,
267  .filter_frame = filter_frame,
268  .needs_writable = 1,
269  },
270  { NULL }
271 };
272 
273 static const AVFilterPad drawbox_outputs[] = {
274  {
275  .name = "default",
276  .type = AVMEDIA_TYPE_VIDEO,
277  },
278  { NULL }
279 };
280 
281 AVFilter ff_vf_drawbox = {
282  .name = "drawbox",
283  .description = NULL_IF_CONFIG_SMALL("Draw a colored box on the input video."),
284  .priv_size = sizeof(DrawBoxContext),
285  .priv_class = &drawbox_class,
286  .init = init,
288  .inputs = drawbox_inputs,
289  .outputs = drawbox_outputs,
291 };
292 #endif /* CONFIG_DRAWBOX_FILTER */
293 
294 #if CONFIG_DRAWGRID_FILTER
295 static av_pure av_always_inline int pixel_belongs_to_grid(DrawBoxContext *drawgrid, int x, int y)
296 {
297  // x is horizontal (width) coord,
298  // y is vertical (height) coord
299  int x_modulo;
300  int y_modulo;
301 
302  // Abstract from the offset
303  x -= drawgrid->x;
304  y -= drawgrid->y;
305 
306  x_modulo = x % drawgrid->w;
307  y_modulo = y % drawgrid->h;
308 
309  // If x or y got negative, fix values to preserve logics
310  if (x_modulo < 0)
311  x_modulo += drawgrid->w;
312  if (y_modulo < 0)
313  y_modulo += drawgrid->h;
314 
315  return x_modulo < drawgrid->thickness // Belongs to vertical line
316  || y_modulo < drawgrid->thickness; // Belongs to horizontal line
317 }
318 
319 static int drawgrid_filter_frame(AVFilterLink *inlink, AVFrame *frame)
320 {
321  DrawBoxContext *drawgrid = inlink->dst->priv;
322  int plane, x, y;
323  uint8_t *row[4];
324 
325  for (y = 0; y < frame->height; y++) {
326  row[0] = frame->data[0] + y * frame->linesize[0];
327 
328  for (plane = 1; plane < 3; plane++)
329  row[plane] = frame->data[plane] +
330  frame->linesize[plane] * (y >> drawgrid->vsub);
331 
332  if (drawgrid->invert_color) {
333  for (x = 0; x < frame->width; x++)
334  if (pixel_belongs_to_grid(drawgrid, x, y))
335  row[0][x] = 0xff - row[0][x];
336  } else {
337  for (x = 0; x < frame->width; x++) {
338  double alpha = (double)drawgrid->yuv_color[A] / 255;
339 
340  if (pixel_belongs_to_grid(drawgrid, x, y)) {
341  row[0][x ] = (1 - alpha) * row[0][x ] + alpha * drawgrid->yuv_color[Y];
342  row[1][x >> drawgrid->hsub] = (1 - alpha) * row[1][x >> drawgrid->hsub] + alpha * drawgrid->yuv_color[U];
343  row[2][x >> drawgrid->hsub] = (1 - alpha) * row[2][x >> drawgrid->hsub] + alpha * drawgrid->yuv_color[V];
344  }
345  }
346  }
347  }
348 
349  return ff_filter_frame(inlink->dst->outputs[0], frame);
350 }
351 
352 static const AVOption drawgrid_options[] = {
353  { "x", "set horizontal offset", OFFSET(x_expr), AV_OPT_TYPE_STRING, { .str="0" }, CHAR_MIN, CHAR_MAX, FLAGS },
354  { "y", "set vertical offset", OFFSET(y_expr), AV_OPT_TYPE_STRING, { .str="0" }, CHAR_MIN, CHAR_MAX, FLAGS },
355  { "width", "set width of grid cell", OFFSET(w_expr), AV_OPT_TYPE_STRING, { .str="0" }, CHAR_MIN, CHAR_MAX, FLAGS },
356  { "w", "set width of grid cell", OFFSET(w_expr), AV_OPT_TYPE_STRING, { .str="0" }, CHAR_MIN, CHAR_MAX, FLAGS },
357  { "height", "set height of grid cell", OFFSET(h_expr), AV_OPT_TYPE_STRING, { .str="0" }, CHAR_MIN, CHAR_MAX, FLAGS },
358  { "h", "set height of grid cell", OFFSET(h_expr), AV_OPT_TYPE_STRING, { .str="0" }, CHAR_MIN, CHAR_MAX, FLAGS },
359  { "color", "set color of the grid", OFFSET(color_str), AV_OPT_TYPE_STRING, { .str = "black" }, CHAR_MIN, CHAR_MAX, FLAGS },
360  { "c", "set color of the grid", OFFSET(color_str), AV_OPT_TYPE_STRING, { .str = "black" }, CHAR_MIN, CHAR_MAX, FLAGS },
361  { "thickness", "set grid line thickness", OFFSET(t_expr), AV_OPT_TYPE_STRING, {.str="1"}, CHAR_MIN, CHAR_MAX, FLAGS },
362  { "t", "set grid line thickness", OFFSET(t_expr), AV_OPT_TYPE_STRING, {.str="1"}, CHAR_MIN, CHAR_MAX, FLAGS },
363  { NULL }
364 };
365 
366 AVFILTER_DEFINE_CLASS(drawgrid);
367 
368 static const AVFilterPad drawgrid_inputs[] = {
369  {
370  .name = "default",
371  .type = AVMEDIA_TYPE_VIDEO,
372  .config_props = config_input,
373  .filter_frame = drawgrid_filter_frame,
374  .needs_writable = 1,
375  },
376  { NULL }
377 };
378 
379 static const AVFilterPad drawgrid_outputs[] = {
380  {
381  .name = "default",
382  .type = AVMEDIA_TYPE_VIDEO,
383  },
384  { NULL }
385 };
386 
387 AVFilter ff_vf_drawgrid = {
388  .name = "drawgrid",
389  .description = NULL_IF_CONFIG_SMALL("Draw a colored grid on the input video."),
390  .priv_size = sizeof(DrawBoxContext),
391  .priv_class = &drawgrid_class,
392  .init = init,
394  .inputs = drawgrid_inputs,
395  .outputs = drawgrid_outputs,
397 };
398 
399 #endif /* CONFIG_DRAWGRID_FILTER */
#define NULL
Definition: coverity.c:32
const char * s
Definition: avisynth_c.h:669
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:2029
This structure describes decoded (raw) audio or video data.
Definition: frame.h:163
AVOption.
Definition: opt.h:255
#define av_pure
Definition: attributes.h:62
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:73
static const AVFilterPad outputs[]
Definition: af_ashowinfo.c:246
Main libavfilter public API header.
int num
numerator
Definition: rational.h:44
char * color_str
Definition: vf_drawbox.c:75
Various defines for YUV<->RGB conversion.
static const char *const var_names[]
Definition: vf_drawbox.c:39
char * y_expr
expression for x and y
Definition: vf_drawbox.c:79
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
Definition: pixdesc.h:80
char * w_expr
Definition: vf_drawbox.c:80
AVFilterFormats * ff_make_format_list(const int *fmts)
Create a list of supported formats.
Definition: formats.c:294
#define AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
Some filters support a generic "enable" expression option that can be used to enable or disable a fil...
Definition: avfilter.h:451
const char * name
Pad name.
Definition: internal.h:67
#define OFFSET(x)
Definition: vf_drawbox.c:241
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Definition: avfilter.c:1145
if()
Definition: avfilter.c:975
uint8_t
#define av_cold
Definition: attributes.h:74
AVOptions.
static int query_formats(AVFilterContext *ctx)
Definition: vf_drawbox.c:106
static AVFrame * frame
#define FLAGS
Definition: vf_drawbox.c:242
static double av_q2d(AVRational a)
Convert rational to double.
Definition: rational.h:80
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range ...
Definition: pixfmt.h:107
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_...
Definition: pixfmt.h:81
char * x_expr
Definition: vf_drawbox.c:79
#define AV_LOG_VERBOSE
Detailed information.
Definition: log.h:191
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:539
#define av_log(a,...)
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:344
int invert_color
invert luma color
Definition: vf_drawbox.c:77
A filter pad used for either input or output.
Definition: internal.h:61
static int config_input(AVFilterLink *inlink)
Definition: vf_drawbox.c:120
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:713
static double alpha(void *priv, double x, double y)
Definition: vf_geq.c:98
int width
width and height of the video frame
Definition: frame.h:212
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:175
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
Definition: pixdesc.h:89
#define AVERROR(e)
Definition: error.h:43
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:180
void * priv
private data for use by the filter
Definition: avfilter.h:654
#define FFMAX(a, b)
Definition: common.h:64
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:72
var_name
Definition: aeval.c:46
char * t_expr
expression for thickness
Definition: vf_drawbox.c:81
float y
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_...
Definition: pixfmt.h:80
Definition: vf_drawbox.c:54
ret
Definition: avfilter.c:974
char * h_expr
expression for width and height
Definition: vf_drawbox.c:80
static const int NUM_EXPR_EVALS
Definition: vf_drawbox.c:84
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
Definition: frame.h:191
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Definition: pixdesc.h:69
Definition: vf_drawbox.c:54
int hsub
chroma subsampling
Definition: vf_drawbox.c:78
Definition: vf_drawbox.c:54
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
Definition: pixfmt.h:74
Describe the class of an AVClass context structure.
Definition: log.h:66
Filter definition.
Definition: avfilter.h:470
static const AVFilterPad inputs[]
Definition: af_ashowinfo.c:237
const char * name
Filter name.
Definition: avfilter.h:474
misc parsing utilities
AVFilterLink ** outputs
array of pointers to output links
Definition: avfilter.h:648
#define RGB_TO_U_CCIR(r1, g1, b1, shift)
Definition: colorspace.h:103
static int flags
Definition: cpu.c:47
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition: frame.h:174
#define RGB_TO_V_CCIR(r1, g1, b1, shift)
Definition: colorspace.h:107
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:68
common internal and external API header
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_...
Definition: pixfmt.h:82
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
Definition: pixfmt.h:75
static av_cold int init(AVFilterContext *ctx)
Definition: vf_drawbox.c:86
#define RGB_TO_Y_CCIR(r, g, b)
Definition: colorspace.h:99
#define NAN
Definition: math.h:28
#define AVFILTER_DEFINE_CLASS(fname)
Definition: internal.h:313
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
Definition: vf_drawbox.c:206
An instance of a filter.
Definition: avfilter.h:633
int height
Definition: frame.h:212
unsigned char yuv_color[4]
Definition: vf_drawbox.c:76
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
Definition: pixfmt.h:106
#define av_always_inline
Definition: attributes.h:37
Definition: vf_drawbox.c:54
internal API functions
AVPixelFormat
Pixel format.
Definition: pixfmt.h:66
for(j=16;j >0;--j)
simple arithmetic expression evaluator