FFmpeg
vf_blend.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 Paul B Mahol
3  *
4  * This file is part of FFmpeg.
5  *
6  * FFmpeg is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * FFmpeg is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with FFmpeg; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #include "config_components.h"
22 
23 #include "libavutil/eval.h"
24 #include "libavutil/mem.h"
25 #include "libavutil/opt.h"
26 #include "libavutil/pixfmt.h"
27 #include "avfilter.h"
28 #include "filters.h"
29 #include "framesync.h"
30 #include "vf_blend_init.h"
31 #include "video.h"
32 #include "blend.h"
33 
34 #define TOP 0
35 #define BOTTOM 1
36 
37 typedef struct BlendContext {
38  const AVClass *class;
40  int hsub, vsub; ///< chroma subsampling values
41  int nb_planes;
42  char *all_expr;
44  double all_opacity;
45 
46  int depth;
48  int tblend;
49  AVFrame *prev_frame; /* only used with tblend */
51 } BlendContext;
52 
53 static const char *const var_names[] = { "X", "Y", "W", "H", "SW", "SH", "T", "N", "A", "B", "TOP", "BOTTOM", NULL };
55 
56 typedef struct ThreadData {
57  const AVFrame *top, *bottom;
60  int plane;
61  int w, h;
63 } ThreadData;
64 
65 #define OFFSET(x) offsetof(BlendContext, x)
66 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
67 
68 static const AVOption blend_options[] = {
69  { "c0_mode", "set component #0 blend mode", OFFSET(params[0].mode), AV_OPT_TYPE_INT, {.i64=0}, 0, BLEND_NB-1, FLAGS, .unit = "mode" },
70  { "c1_mode", "set component #1 blend mode", OFFSET(params[1].mode), AV_OPT_TYPE_INT, {.i64=0}, 0, BLEND_NB-1, FLAGS, .unit = "mode" },
71  { "c2_mode", "set component #2 blend mode", OFFSET(params[2].mode), AV_OPT_TYPE_INT, {.i64=0}, 0, BLEND_NB-1, FLAGS, .unit = "mode" },
72  { "c3_mode", "set component #3 blend mode", OFFSET(params[3].mode), AV_OPT_TYPE_INT, {.i64=0}, 0, BLEND_NB-1, FLAGS, .unit = "mode" },
73  { "all_mode", "set blend mode for all components", OFFSET(all_mode), AV_OPT_TYPE_INT, {.i64=-1},-1, BLEND_NB-1, FLAGS, .unit = "mode" },
74  { "addition", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_ADDITION}, 0, 0, FLAGS, .unit = "mode" },
75  { "addition128","", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_GRAINMERGE}, 0, 0, FLAGS, .unit = "mode" },
76  { "grainmerge", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_GRAINMERGE}, 0, 0, FLAGS, .unit = "mode" },
77  { "and", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_AND}, 0, 0, FLAGS, .unit = "mode" },
78  { "average", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_AVERAGE}, 0, 0, FLAGS, .unit = "mode" },
79  { "burn", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_BURN}, 0, 0, FLAGS, .unit = "mode" },
80  { "darken", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_DARKEN}, 0, 0, FLAGS, .unit = "mode" },
81  { "difference", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_DIFFERENCE}, 0, 0, FLAGS, .unit = "mode" },
82  { "difference128", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_GRAINEXTRACT}, 0, 0, FLAGS, .unit = "mode" },
83  { "grainextract", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_GRAINEXTRACT}, 0, 0, FLAGS, .unit = "mode" },
84  { "divide", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_DIVIDE}, 0, 0, FLAGS, .unit = "mode" },
85  { "dodge", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_DODGE}, 0, 0, FLAGS, .unit = "mode" },
86  { "exclusion", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_EXCLUSION}, 0, 0, FLAGS, .unit = "mode" },
87  { "extremity", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_EXTREMITY}, 0, 0, FLAGS, .unit = "mode" },
88  { "freeze", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_FREEZE}, 0, 0, FLAGS, .unit = "mode" },
89  { "glow", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_GLOW}, 0, 0, FLAGS, .unit = "mode" },
90  { "hardlight", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_HARDLIGHT}, 0, 0, FLAGS, .unit = "mode" },
91  { "hardmix", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_HARDMIX}, 0, 0, FLAGS, .unit = "mode" },
92  { "heat", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_HEAT}, 0, 0, FLAGS, .unit = "mode" },
93  { "lighten", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_LIGHTEN}, 0, 0, FLAGS, .unit = "mode" },
94  { "linearlight","", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_LINEARLIGHT},0, 0, FLAGS, .unit = "mode" },
95  { "multiply", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_MULTIPLY}, 0, 0, FLAGS, .unit = "mode" },
96  { "multiply128","", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_MULTIPLY128},0, 0, FLAGS, .unit = "mode" },
97  { "negation", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_NEGATION}, 0, 0, FLAGS, .unit = "mode" },
98  { "normal", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_NORMAL}, 0, 0, FLAGS, .unit = "mode" },
99  { "or", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_OR}, 0, 0, FLAGS, .unit = "mode" },
100  { "overlay", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_OVERLAY}, 0, 0, FLAGS, .unit = "mode" },
101  { "phoenix", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_PHOENIX}, 0, 0, FLAGS, .unit = "mode" },
102  { "pinlight", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_PINLIGHT}, 0, 0, FLAGS, .unit = "mode" },
103  { "reflect", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_REFLECT}, 0, 0, FLAGS, .unit = "mode" },
104  { "screen", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_SCREEN}, 0, 0, FLAGS, .unit = "mode" },
105  { "softlight", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_SOFTLIGHT}, 0, 0, FLAGS, .unit = "mode" },
106  { "subtract", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_SUBTRACT}, 0, 0, FLAGS, .unit = "mode" },
107  { "vividlight", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_VIVIDLIGHT}, 0, 0, FLAGS, .unit = "mode" },
108  { "xor", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_XOR}, 0, 0, FLAGS, .unit = "mode" },
109  { "softdifference","", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_SOFTDIFFERENCE}, 0, 0, FLAGS, .unit = "mode" },
110  { "geometric", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_GEOMETRIC}, 0, 0, FLAGS, .unit = "mode" },
111  { "harmonic", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_HARMONIC}, 0, 0, FLAGS, .unit = "mode" },
112  { "bleach", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_BLEACH}, 0, 0, FLAGS, .unit = "mode" },
113  { "stain", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_STAIN}, 0, 0, FLAGS, .unit = "mode" },
114  { "interpolate","", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_INTERPOLATE},0, 0, FLAGS, .unit = "mode" },
115  { "hardoverlay","", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_HARDOVERLAY},0, 0, FLAGS, .unit = "mode" },
116  { "c0_expr", "set color component #0 expression", OFFSET(params[0].expr_str), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, FLAGS },
117  { "c1_expr", "set color component #1 expression", OFFSET(params[1].expr_str), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, FLAGS },
118  { "c2_expr", "set color component #2 expression", OFFSET(params[2].expr_str), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, FLAGS },
119  { "c3_expr", "set color component #3 expression", OFFSET(params[3].expr_str), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, FLAGS },
120  { "all_expr", "set expression for all color components", OFFSET(all_expr), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, FLAGS },
121  { "c0_opacity", "set color component #0 opacity", OFFSET(params[0].opacity), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 1, FLAGS },
122  { "c1_opacity", "set color component #1 opacity", OFFSET(params[1].opacity), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 1, FLAGS },
123  { "c2_opacity", "set color component #2 opacity", OFFSET(params[2].opacity), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 1, FLAGS },
124  { "c3_opacity", "set color component #3 opacity", OFFSET(params[3].opacity), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 1, FLAGS },
125  { "all_opacity", "set opacity for all color components", OFFSET(all_opacity), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 1, FLAGS },
126  { NULL }
127 };
128 
130 
131 #define DEFINE_BLEND_EXPR(type, name, div) \
132 static void blend_expr_## name(const uint8_t *_top, ptrdiff_t top_linesize, \
133  const uint8_t *_bottom, ptrdiff_t bottom_linesize, \
134  uint8_t *_dst, ptrdiff_t dst_linesize, \
135  ptrdiff_t width, ptrdiff_t height, \
136  FilterParams *param, SliceParams *sliceparam) \
137 { \
138  const type *top = (const type*)_top; \
139  const type *bottom = (const type*)_bottom; \
140  double *values = sliceparam->values; \
141  int starty = sliceparam->starty; \
142  type *dst = (type*)_dst; \
143  AVExpr *e = sliceparam->e; \
144  int y, x; \
145  dst_linesize /= div; \
146  top_linesize /= div; \
147  bottom_linesize /= div; \
148  \
149  for (y = 0; y < height; y++) { \
150  values[VAR_Y] = y + starty; \
151  for (x = 0; x < width; x++) { \
152  values[VAR_X] = x; \
153  values[VAR_TOP] = values[VAR_A] = top[x]; \
154  values[VAR_BOTTOM] = values[VAR_B] = bottom[x]; \
155  dst[x] = av_expr_eval(e, values, NULL); \
156  } \
157  dst += dst_linesize; \
158  top += top_linesize; \
159  bottom += bottom_linesize; \
160  } \
161 }
162 
163 DEFINE_BLEND_EXPR(uint8_t, 8bit, 1)
164 DEFINE_BLEND_EXPR(uint16_t, 16bit, 2)
165 DEFINE_BLEND_EXPR(float, 32bit, 4)
166 
167 static int filter_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
168 {
169  ThreadData *td = arg;
170  int slice_start = (td->h * jobnr ) / nb_jobs;
171  int slice_end = (td->h * (jobnr+1)) / nb_jobs;
172  int height = slice_end - slice_start;
173  const uint8_t *top = td->top->data[td->plane];
174  const uint8_t *bottom = td->bottom->data[td->plane];
175  uint8_t *dst = td->dst->data[td->plane];
176  FilterLink *inl = ff_filter_link(td->inlink);
177  double values[VAR_VARS_NB];
178  SliceParams sliceparam = {.values = &values[0], .starty = slice_start, .e = td->param->e ? td->param->e[jobnr] : NULL};
179 
180  values[VAR_N] = inl->frame_count_out;
181  values[VAR_T] = td->dst->pts == AV_NOPTS_VALUE ? NAN : td->dst->pts * av_q2d(td->inlink->time_base);
182  values[VAR_W] = td->w;
183  values[VAR_H] = td->h;
184  values[VAR_SW] = td->w / (double)td->dst->width;
185  values[VAR_SH] = td->h / (double)td->dst->height;
186 
187  td->param->blend(top + slice_start * td->top->linesize[td->plane],
188  td->top->linesize[td->plane],
189  bottom + slice_start * td->bottom->linesize[td->plane],
190  td->bottom->linesize[td->plane],
191  dst + slice_start * td->dst->linesize[td->plane],
192  td->dst->linesize[td->plane],
193  td->w, height, td->param, &sliceparam);
194  return 0;
195 }
196 
198  const AVFrame *bottom_buf)
199 {
200  BlendContext *s = ctx->priv;
201  AVFilterLink *inlink = ctx->inputs[0];
202  AVFilterLink *outlink = ctx->outputs[0];
203  AVFrame *dst_buf;
204  int plane;
205 
206  dst_buf = ff_get_video_buffer(outlink, outlink->w, outlink->h);
207  if (!dst_buf)
208  return top_buf;
209 
210  if (av_frame_copy_props(dst_buf, top_buf) < 0) {
211  av_frame_free(&dst_buf);
212  return top_buf;
213  }
214 
215  for (plane = 0; plane < s->nb_planes; plane++) {
216  int hsub = plane == 1 || plane == 2 ? s->hsub : 0;
217  int vsub = plane == 1 || plane == 2 ? s->vsub : 0;
218  int outw = AV_CEIL_RSHIFT(dst_buf->width, hsub);
219  int outh = AV_CEIL_RSHIFT(dst_buf->height, vsub);
220  FilterParams *param = &s->params[plane];
221  ThreadData td = { .top = top_buf, .bottom = bottom_buf, .dst = dst_buf,
222  .w = outw, .h = outh, .param = param, .plane = plane,
223  .inlink = inlink };
224 
226  FFMIN(outh, s->nb_threads));
227  }
228 
229  if (!s->tblend)
230  av_frame_free(&top_buf);
231 
232  return dst_buf;
233 }
234 
236 {
237  AVFilterContext *ctx = fs->parent;
238  AVFrame *top_buf, *bottom_buf, *dst_buf;
239  int ret;
240 
241  ret = ff_framesync_dualinput_get(fs, &top_buf, &bottom_buf);
242  if (ret < 0)
243  return ret;
244  if (!bottom_buf)
245  return ff_filter_frame(ctx->outputs[0], top_buf);
246  dst_buf = blend_frame(ctx, top_buf, bottom_buf);
247  return ff_filter_frame(ctx->outputs[0], dst_buf);
248 }
249 
251 {
252  BlendContext *s = ctx->priv;
253 
254  s->tblend = !strcmp(ctx->filter->name, "tblend");
255  s->nb_threads = ff_filter_get_nb_threads(ctx);
256 
257  s->fs.on_event = blend_frame_for_dualinput;
258  return 0;
259 }
260 
261 static const enum AVPixelFormat pix_fmts[] = {
280 };
281 
283 {
284  BlendContext *s = ctx->priv;
285  int i;
286 
287  ff_framesync_uninit(&s->fs);
288  av_frame_free(&s->prev_frame);
289 
290  for (i = 0; i < FF_ARRAY_ELEMS(s->params); i++) {
291  if (s->params[i].e) {
292  for (int j = 0; j < s->nb_threads; j++)
293  av_expr_free(s->params[i].e[j]);
294  av_freep(&s->params[i].e);
295  }
296  }
297 
298 }
299 
301 {
302  BlendContext *s = ctx->priv;
303  int ret;
304 
305  for (int plane = 0; plane < FF_ARRAY_ELEMS(s->params); plane++) {
306  FilterParams *param = &s->params[plane];
307 
308  if (s->all_mode >= 0)
309  param->mode = s->all_mode;
310  if (s->all_opacity < 1)
311  param->opacity = s->all_opacity;
312 
313  ff_blend_init(param, s->depth);
314 
315  if (s->all_expr && !param->expr_str) {
316  param->expr_str = av_strdup(s->all_expr);
317  if (!param->expr_str)
318  return AVERROR(ENOMEM);
319  }
320  if (param->expr_str) {
321  if (!param->e) {
322  param->e = av_calloc(s->nb_threads, sizeof(*param->e));
323  if (!param->e)
324  return AVERROR(ENOMEM);
325  }
326  for (int i = 0; i < s->nb_threads; i++) {
327  av_expr_free(param->e[i]);
328  param->e[i] = NULL;
329  ret = av_expr_parse(&param->e[i], param->expr_str, var_names,
330  NULL, NULL, NULL, NULL, 0, ctx);
331  if (ret < 0)
332  return ret;
333  }
334  param->blend = s->depth > 8 ? s->depth > 16 ? blend_expr_32bit : blend_expr_16bit : blend_expr_8bit;
335  }
336  }
337 
338  return 0;
339 }
340 
341 static int config_output(AVFilterLink *outlink)
342 {
343  FilterLink *outl = ff_filter_link(outlink);
344  AVFilterContext *ctx = outlink->src;
345  AVFilterLink *toplink = ctx->inputs[TOP];
346  FilterLink *tl = ff_filter_link(toplink);
347  BlendContext *s = ctx->priv;
348  const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(toplink->format);
349  int ret;
350 
351  if (!s->tblend) {
352  AVFilterLink *bottomlink = ctx->inputs[BOTTOM];
353 
354  if (toplink->w != bottomlink->w || toplink->h != bottomlink->h) {
355  av_log(ctx, AV_LOG_ERROR, "First input link %s parameters "
356  "(size %dx%d) do not match the corresponding "
357  "second input link %s parameters (size %dx%d)\n",
358  ctx->input_pads[TOP].name, toplink->w, toplink->h,
359  ctx->input_pads[BOTTOM].name, bottomlink->w, bottomlink->h);
360  return AVERROR(EINVAL);
361  }
362  }
363 
364  outlink->w = toplink->w;
365  outlink->h = toplink->h;
366  outlink->time_base = toplink->time_base;
367  outlink->sample_aspect_ratio = toplink->sample_aspect_ratio;
368  outl->frame_rate = tl->frame_rate;
369 
370  s->hsub = pix_desc->log2_chroma_w;
371  s->vsub = pix_desc->log2_chroma_h;
372 
373  s->depth = pix_desc->comp[0].depth;
374  s->nb_planes = av_pix_fmt_count_planes(toplink->format);
375 
376  if (!s->tblend)
377  if ((ret = ff_framesync_init_dualinput(&s->fs, ctx)) < 0)
378  return ret;
379 
380  ret = config_params(ctx);
381  if (ret < 0)
382  return ret;
383 
384  if (s->tblend)
385  return 0;
386 
387  ret = ff_framesync_configure(&s->fs);
388  outlink->time_base = s->fs.time_base;
389 
390  return ret;
391 }
392 
393 static int process_command(AVFilterContext *ctx, const char *cmd, const char *args,
394  char *res, int res_len, int flags)
395 {
396  int ret;
397 
398  ret = ff_filter_process_command(ctx, cmd, args, res, res_len, flags);
399  if (ret < 0)
400  return ret;
401 
402  return config_params(ctx);
403 }
404 
405 static const AVFilterPad blend_outputs[] = {
406  {
407  .name = "default",
408  .type = AVMEDIA_TYPE_VIDEO,
409  .config_props = config_output,
410  },
411 };
412 
413 #if CONFIG_BLEND_FILTER
414 
415 static int activate(AVFilterContext *ctx)
416 {
417  BlendContext *s = ctx->priv;
418  return ff_framesync_activate(&s->fs);
419 }
420 
421 static const AVFilterPad blend_inputs[] = {
422  {
423  .name = "top",
424  .type = AVMEDIA_TYPE_VIDEO,
425  },{
426  .name = "bottom",
427  .type = AVMEDIA_TYPE_VIDEO,
428  },
429 };
430 
431 const AVFilter ff_vf_blend = {
432  .name = "blend",
433  .description = NULL_IF_CONFIG_SMALL("Blend two video frames into each other."),
434  .preinit = blend_framesync_preinit,
435  .init = init,
436  .uninit = uninit,
437  .priv_size = sizeof(BlendContext),
438  .activate = activate,
439  FILTER_INPUTS(blend_inputs),
442  .priv_class = &blend_class,
444  .process_command = process_command,
445 };
446 
447 #endif
448 
449 #if CONFIG_TBLEND_FILTER
450 
451 static int tblend_filter_frame(AVFilterLink *inlink, AVFrame *frame)
452 {
453  AVFilterContext *ctx = inlink->dst;
454  BlendContext *s = ctx->priv;
455  AVFilterLink *outlink = ctx->outputs[0];
456 
457  if (s->prev_frame) {
458  AVFrame *out;
459 
460  if (ctx->is_disabled)
462  else
463  out = blend_frame(ctx, frame, s->prev_frame);
464  av_frame_free(&s->prev_frame);
465  s->prev_frame = frame;
466  return ff_filter_frame(outlink, out);
467  }
468  s->prev_frame = frame;
469  return 0;
470 }
471 
472 AVFILTER_DEFINE_CLASS_EXT(tblend, "tblend", blend_options);
473 
474 static const AVFilterPad tblend_inputs[] = {
475  {
476  .name = "default",
477  .type = AVMEDIA_TYPE_VIDEO,
478  .filter_frame = tblend_filter_frame,
479  },
480 };
481 
482 const AVFilter ff_vf_tblend = {
483  .name = "tblend",
484  .description = NULL_IF_CONFIG_SMALL("Blend successive frames."),
485  .priv_size = sizeof(BlendContext),
486  .priv_class = &tblend_class,
487  .init = init,
488  .uninit = uninit,
489  FILTER_INPUTS(tblend_inputs),
493  .process_command = process_command,
494 };
495 
496 #endif
BLEND_GLOW
@ BLEND_GLOW
Definition: blend.h:56
ff_get_video_buffer
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.
Definition: video.c:116
AV_PIX_FMT_YUVA422P16
#define AV_PIX_FMT_YUVA422P16
Definition: pixfmt.h:546
VAR_SH
@ VAR_SH
Definition: vf_blend.c:54
AV_PIX_FMT_GBRAP16
#define AV_PIX_FMT_GBRAP16
Definition: pixfmt.h:525
BlendContext::vsub
int vsub
chroma subsampling values
Definition: vf_blend.c:40
ff_framesync_configure
int ff_framesync_configure(FFFrameSync *fs)
Configure a frame sync structure.
Definition: framesync.c:137
VAR_B
@ VAR_B
Definition: vf_blend.c:54
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:71
BLEND_EXCLUSION
@ BLEND_EXCLUSION
Definition: blend.h:39
AVERROR
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
opt.h
VAR_BOTTOM
@ VAR_BOTTOM
Definition: vf_blend.c:54
SliceParams::values
double * values
Definition: blend.h:73
FILTER_PIXFMTS_ARRAY
#define FILTER_PIXFMTS_ARRAY(array)
Definition: filters.h:242
ff_framesync_uninit
void ff_framesync_uninit(FFFrameSync *fs)
Free all memory currently allocated.
Definition: framesync.c:301
out
FILE * out
Definition: movenc.c:55
ff_filter_frame
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Definition: avfilter.c:1061
av_pix_fmt_desc_get
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:3170
VAR_TOP
@ VAR_TOP
Definition: vf_blend.c:54
inlink
The exact code depends on how similar the blocks are and how related they are to the and needs to apply these operations to the correct inlink or outlink if there are several Macros are available to factor that when no extra processing is inlink
Definition: filter_design.txt:212
FilterParams::expr_str
char * expr_str
Definition: blend.h:82
VAR_SW
@ VAR_SW
Definition: vf_blend.c:54
av_frame_free
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
Definition: frame.c:162
AVFILTER_DEFINE_CLASS_EXT
#define AVFILTER_DEFINE_CLASS_EXT(name, desc, options)
Definition: filters.h:265
AV_PIX_FMT_YUVA422P9
#define AV_PIX_FMT_YUVA422P9
Definition: pixfmt.h:538
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: filters.h:262
mode
Definition: swscale.c:52
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:389
AVFrame::pts
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
Definition: frame.h:501
AVFrame::width
int width
Definition: frame.h:461
AV_PIX_FMT_YUVA420P16
#define AV_PIX_FMT_YUVA420P16
Definition: pixfmt.h:545
VAR_H
@ VAR_H
Definition: vf_blend.c:54
AVComponentDescriptor::depth
int depth
Number of bits in the component.
Definition: pixdesc.h:57
AV_PIX_FMT_YUVA420P10
#define AV_PIX_FMT_YUVA420P10
Definition: pixfmt.h:540
AVOption
AVOption.
Definition: opt.h:429
ThreadData::bottom
const AVFrame * bottom
Definition: vf_blend.c:57
OFFSET
#define OFFSET(x)
Definition: vf_blend.c:65
AV_PIX_FMT_YUV420P10
#define AV_PIX_FMT_YUV420P10
Definition: pixfmt.h:502
BLEND_NEGATION
@ BLEND_NEGATION
Definition: blend.h:43
ThreadData::w
int w
Definition: vf_blend.c:61
AV_PIX_FMT_YUV440P
@ AV_PIX_FMT_YUV440P
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
Definition: pixfmt.h:106
var_names
static const char *const var_names[]
Definition: vf_blend.c:53
AVFilter::name
const char * name
Filter name.
Definition: avfilter.h:205
FFFrameSync
Frame sync structure.
Definition: framesync.h:168
BLEND_HARMONIC
@ BLEND_HARMONIC
Definition: blend.h:64
video.h
BLEND_ADDITION
@ BLEND_ADDITION
Definition: blend.h:30
AV_PIX_FMT_YUVA422P10
#define AV_PIX_FMT_YUVA422P10
Definition: pixfmt.h:541
BLEND_MULTIPLY128
@ BLEND_MULTIPLY128
Definition: blend.h:58
AV_PIX_FMT_GRAY9
#define AV_PIX_FMT_GRAY9
Definition: pixfmt.h:482
AVFrame::data
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition: frame.h:410
BLEND_GEOMETRIC
@ BLEND_GEOMETRIC
Definition: blend.h:63
BLEND_BLEACH
@ BLEND_BLEACH
Definition: blend.h:65
hsub
static void hsub(htype *dst, const htype *src, int bins)
Definition: vf_median.c:74
process_command
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
Definition: vf_blend.c:393
BLEND_NB
@ BLEND_NB
Definition: blend.h:69
av_expr_parse
int av_expr_parse(AVExpr **expr, const char *s, const char *const *const_names, const char *const *func1_names, double(*const *funcs1)(void *, double), const char *const *func2_names, double(*const *funcs2)(void *, double, double), int log_offset, void *log_ctx)
Parse an expression.
Definition: eval.c:710
bit
#define bit(string, value)
Definition: cbs_mpeg2.c:56
BLEND_DIVIDE
@ BLEND_DIVIDE
Definition: blend.h:37
BLEND_PHOENIX
@ BLEND_PHOENIX
Definition: blend.h:46
FilterParams::e
AVExpr ** e
Definition: blend.h:81
av_pix_fmt_count_planes
int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:3210
VAR_N
@ VAR_N
Definition: vf_blend.c:54
AV_PIX_FMT_YUVA420P9
#define AV_PIX_FMT_YUVA420P9
Definition: pixfmt.h:537
AV_PIX_FMT_GBRP14
#define AV_PIX_FMT_GBRP14
Definition: pixfmt.h:520
slice_end
static int slice_end(AVCodecContext *avctx, AVFrame *pict, int *got_output)
Handle slice ends.
Definition: mpeg12dec.c:1720
AV_PIX_FMT_GBRAP
@ AV_PIX_FMT_GBRAP
planar GBRA 4:4:4:4 32bpp
Definition: pixfmt.h:212
AV_PIX_FMT_GBRP10
#define AV_PIX_FMT_GBRP10
Definition: pixfmt.h:518
AV_PIX_FMT_YUVA444P16
#define AV_PIX_FMT_YUVA444P16
Definition: pixfmt.h:547
AV_PIX_FMT_YUV422P9
#define AV_PIX_FMT_YUV422P9
Definition: pixfmt.h:500
config_params
static int config_params(AVFilterContext *ctx)
Definition: vf_blend.c:300
vf_blend_init.h
AV_PIX_FMT_GRAY16
#define AV_PIX_FMT_GRAY16
Definition: pixfmt.h:486
VAR_X
@ VAR_X
Definition: vf_blend.c:54
BLEND_AND
@ BLEND_AND
Definition: blend.h:31
BlendContext::params
FilterParams params[4]
Definition: vf_blend.c:47
av_expr_free
void av_expr_free(AVExpr *e)
Free a parsed expression previously created with av_expr_parse().
Definition: eval.c:358
DEFINE_BLEND_EXPR
#define DEFINE_BLEND_EXPR(type, name, div)
Definition: vf_blend.c:131
pix_fmts
static enum AVPixelFormat pix_fmts[]
Definition: vf_blend.c:261
blend_options
static const AVOption blend_options[]
Definition: vf_blend.c:68
AVFilterPad
A filter pad used for either input or output.
Definition: filters.h:38
BLEND_SOFTLIGHT
@ BLEND_SOFTLIGHT
Definition: blend.h:50
AV_PIX_FMT_YUV444P10
#define AV_PIX_FMT_YUV444P10
Definition: pixfmt.h:505
AV_PIX_FMT_YUVJ411P
@ AV_PIX_FMT_YUVJ411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor ...
Definition: pixfmt.h:283
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:209
FF_ARRAY_ELEMS
#define FF_ARRAY_ELEMS(a)
Definition: sinewin_tablegen.c:29
av_cold
#define av_cold
Definition: attributes.h:90
AV_PIX_FMT_YUV422P16
#define AV_PIX_FMT_YUV422P16
Definition: pixfmt.h:514
AV_PIX_FMT_YUVJ422P
@ AV_PIX_FMT_YUVJ422P
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
Definition: pixfmt.h:86
AV_PIX_FMT_GBRAP10
#define AV_PIX_FMT_GBRAP10
Definition: pixfmt.h:522
ThreadData::plane
int plane
Definition: vf_blend.c:60
filter_slice
static int filter_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
Definition: vf_blend.c:167
s
#define s(width, name)
Definition: cbs_vp9.c:198
BLEND_OR
@ BLEND_OR
Definition: blend.h:44
AV_PIX_FMT_GBRAP12
#define AV_PIX_FMT_GBRAP12
Definition: pixfmt.h:523
AV_PIX_FMT_YUVA420P
@ AV_PIX_FMT_YUVA420P
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
Definition: pixfmt.h:108
BLEND_SCREEN
@ BLEND_SCREEN
Definition: blend.h:49
AV_PIX_FMT_YUV444P16
#define AV_PIX_FMT_YUV444P16
Definition: pixfmt.h:515
AV_CEIL_RSHIFT
#define AV_CEIL_RSHIFT(a, b)
Definition: common.h:60
AV_OPT_TYPE_DOUBLE
@ AV_OPT_TYPE_DOUBLE
Underlying C type is double.
Definition: opt.h:267
av_q2d
static double av_q2d(AVRational a)
Convert an AVRational to a double.
Definition: rational.h:104
filters.h
AV_PIX_FMT_YUVA444P12
#define AV_PIX_FMT_YUVA444P12
Definition: pixfmt.h:544
AV_PIX_FMT_YUV420P9
#define AV_PIX_FMT_YUV420P9
Definition: pixfmt.h:499
AV_PIX_FMT_YUV420P16
#define AV_PIX_FMT_YUV420P16
Definition: pixfmt.h:513
ctx
AVFormatContext * ctx
Definition: movenc.c:49
av_frame_clone
AVFrame * av_frame_clone(const AVFrame *src)
Create a new frame that references the same data as src.
Definition: frame.c:609
AVPixFmtDescriptor::log2_chroma_w
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
Definition: pixdesc.h:80
AV_PIX_FMT_YUV420P
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:73
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: filters.h:263
AV_PIX_FMT_GRAYF32
#define AV_PIX_FMT_GRAYF32
Definition: pixfmt.h:535
BLEND_EXTREMITY
@ BLEND_EXTREMITY
Definition: blend.h:61
NAN
#define NAN
Definition: mathematics.h:115
FRAMESYNC_DEFINE_CLASS
FRAMESYNC_DEFINE_CLASS(blend, BlendContext, fs)
ThreadData::h
int h
Definition: vf_blend.c:61
AV_PIX_FMT_YUVJ444P
@ AV_PIX_FMT_YUVJ444P
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
Definition: pixfmt.h:87
arg
const char * arg
Definition: jacosubdec.c:67
AV_PIX_FMT_GRAY10
#define AV_PIX_FMT_GRAY10
Definition: pixfmt.h:483
ThreadData::dst
AVFrame * dst
Definition: vf_blend.c:58
BLEND_PINLIGHT
@ BLEND_PINLIGHT
Definition: blend.h:47
FilterParams::mode
enum BlendMode mode
Definition: blend.h:79
AV_PIX_FMT_GBRP16
#define AV_PIX_FMT_GBRP16
Definition: pixfmt.h:521
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:75
NULL
#define NULL
Definition: coverity.c:32
av_frame_copy_props
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
Definition: frame.c:725
BLEND_MULTIPLY
@ BLEND_MULTIPLY
Definition: blend.h:42
fs
#define fs(width, name, subs,...)
Definition: cbs_vp9.c:200
BlendMode
BlendMode
Definition: blend.h:27
AV_PIX_FMT_YUVJ420P
@ AV_PIX_FMT_YUVJ420P
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
Definition: pixfmt.h:85
BlendContext::depth
int depth
Definition: vf_blend.c:46
activate
filter_frame For filters that do not use the activate() callback
AV_PIX_FMT_YUV440P10
#define AV_PIX_FMT_YUV440P10
Definition: pixfmt.h:504
init
static av_cold int init(AVFilterContext *ctx)
Definition: vf_blend.c:250
double
double
Definition: af_crystalizer.c:132
AV_PIX_FMT_YUV422P10
#define AV_PIX_FMT_YUV422P10
Definition: pixfmt.h:503
AV_PIX_FMT_GRAY8
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
Definition: pixfmt.h:81
AV_PIX_FMT_GBRP9
#define AV_PIX_FMT_GBRP9
Definition: pixfmt.h:517
BLEND_SUBTRACT
@ BLEND_SUBTRACT
Definition: blend.h:51
VAR_W
@ VAR_W
Definition: vf_blend.c:54
ff_filter_link
static FilterLink * ff_filter_link(AVFilterLink *link)
Definition: filters.h:197
BLEND_FREEZE
@ BLEND_FREEZE
Definition: blend.h:60
FilterParams
filter data
Definition: mlp.h:86
BLEND_LIGHTEN
@ BLEND_LIGHTEN
Definition: blend.h:41
BLEND_HEAT
@ BLEND_HEAT
Definition: blend.h:59
eval.h
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:94
ff_framesync_init_dualinput
int ff_framesync_init_dualinput(FFFrameSync *fs, AVFilterContext *parent)
Initialize a frame sync structure for dualinput.
Definition: framesync.c:372
height
#define height
Definition: dsp.h:85
dst
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition: dsp.h:83
BlendContext::prev_frame
AVFrame * prev_frame
Definition: vf_blend.c:49
AV_PIX_FMT_GBRPF32
#define AV_PIX_FMT_GBRPF32
Definition: pixfmt.h:532
AV_PIX_FMT_YUV422P12
#define AV_PIX_FMT_YUV422P12
Definition: pixfmt.h:507
BLEND_DODGE
@ BLEND_DODGE
Definition: blend.h:38
BlendContext::all_expr
char * all_expr
Definition: vf_blend.c:42
AV_NOPTS_VALUE
#define AV_NOPTS_VALUE
Undefined timestamp value.
Definition: avutil.h:248
BlendContext::tblend
int tblend
Definition: vf_blend.c:48
BlendContext
Definition: vf_blend.c:37
ff_vf_tblend
const AVFilter ff_vf_tblend
AV_PIX_FMT_YUV444P12
#define AV_PIX_FMT_YUV444P12
Definition: pixfmt.h:509
BlendContext::hsub
int hsub
Definition: vf_blend.c:40
ff_filter_process_command
int ff_filter_process_command(AVFilterContext *ctx, const char *cmd, const char *arg, char *res, int res_len, int flags)
Generic processing of user supplied commands that are set in the same way as the filter options.
Definition: avfilter.c:900
AV_PIX_FMT_YUVA444P
@ AV_PIX_FMT_YUVA444P
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
Definition: pixfmt.h:174
AV_PIX_FMT_YUVA444P10
#define AV_PIX_FMT_YUVA444P10
Definition: pixfmt.h:542
FilterParams::blend
void(* blend)(const uint8_t *top, ptrdiff_t top_linesize, const uint8_t *bottom, ptrdiff_t bottom_linesize, uint8_t *dst, ptrdiff_t dst_linesize, ptrdiff_t width, ptrdiff_t height, struct FilterParams *param, SliceParams *sliceparam)
Definition: blend.h:83
ThreadData::param
FilterParams * param
Definition: vf_blend.c:62
BLEND_INTERPOLATE
@ BLEND_INTERPOLATE
Definition: blend.h:67
BLEND_HARDLIGHT
@ BLEND_HARDLIGHT
Definition: blend.h:40
BlendContext::all_mode
enum BlendMode all_mode
Definition: vf_blend.c:43
VAR_T
@ VAR_T
Definition: vf_blend.c:54
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:256
SliceParams
Definition: blend.h:72
VAR_A
@ VAR_A
Definition: vf_blend.c:54
ff_vf_blend
const AVFilter ff_vf_blend
AV_PIX_FMT_GBRP12
#define AV_PIX_FMT_GBRP12
Definition: pixfmt.h:519
BlendContext::fs
FFFrameSync fs
Definition: vf_blend.c:39
ff_blend_init
static av_unused void ff_blend_init(FilterParams *param, int depth)
Definition: vf_blend_init.h:162
ff_filter_get_nb_threads
int ff_filter_get_nb_threads(AVFilterContext *ctx)
Get number of threads for current filter instance.
Definition: avfilter.c:840
blend.h
ThreadData
Used for passing data between threads.
Definition: dsddec.c:71
BLEND_STAIN
@ BLEND_STAIN
Definition: blend.h:66
FFMIN
#define FFMIN(a, b)
Definition: macros.h:49
BLEND_SOFTDIFFERENCE
@ BLEND_SOFTDIFFERENCE
Definition: blend.h:62
AV_PIX_FMT_YUVJ440P
@ AV_PIX_FMT_YUVJ440P
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range
Definition: pixfmt.h:107
VAR_VARS_NB
@ VAR_VARS_NB
Definition: vf_blend.c:54
AVFilterPad::name
const char * name
Pad name.
Definition: filters.h:44
BLEND_VIVIDLIGHT
@ BLEND_VIVIDLIGHT
Definition: blend.h:52
TOP
#define TOP
Definition: vf_blend.c:34
BLEND_DIFFERENCE
@ BLEND_DIFFERENCE
Definition: blend.h:35
av_calloc
void * av_calloc(size_t nmemb, size_t size)
Definition: mem.c:264
AV_PIX_FMT_YUV444P9
#define AV_PIX_FMT_YUV444P9
Definition: pixfmt.h:501
BlendContext::nb_threads
int nb_threads
Definition: vf_blend.c:50
BlendContext::nb_planes
int nb_planes
Definition: vf_blend.c:41
slice_start
static int slice_start(SliceContext *sc, VVCContext *s, VVCFrameContext *fc, const CodedBitstreamUnit *unit, const int is_first_slice)
Definition: dec.c:736
config_output
static int config_output(AVFilterLink *outlink)
Definition: vf_blend.c:341
AVFilter
Filter definition.
Definition: avfilter.h:201
BLEND_HARDMIX
@ BLEND_HARDMIX
Definition: blend.h:54
ret
ret
Definition: filter_design.txt:187
BLEND_GRAINMERGE
@ BLEND_GRAINMERGE
Definition: blend.h:57
pixfmt.h
frame
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
Definition: filter_design.txt:264
AV_PIX_FMT_YUVA444P9
#define AV_PIX_FMT_YUVA444P9
Definition: pixfmt.h:539
AV_PIX_FMT_YUV420P12
#define AV_PIX_FMT_YUV420P12
Definition: pixfmt.h:506
VAR_Y
@ VAR_Y
Definition: vf_blend.c:54
ThreadData::inlink
AVFilterLink * inlink
Definition: vf_blend.c:59
AV_PIX_FMT_YUV422P14
#define AV_PIX_FMT_YUV422P14
Definition: pixfmt.h:511
AVFrame::height
int height
Definition: frame.h:461
BLEND_HARDOVERLAY
@ BLEND_HARDOVERLAY
Definition: blend.h:68
framesync.h
ff_filter_execute
int ff_filter_execute(AVFilterContext *ctx, avfilter_action_func *func, void *arg, int *ret, int nb_jobs)
Definition: avfilter.c:1666
blend_frame
static AVFrame * blend_frame(AVFilterContext *ctx, AVFrame *top_buf, const AVFrame *bottom_buf)
Definition: vf_blend.c:197
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:72
AV_PIX_FMT_YUVA422P12
#define AV_PIX_FMT_YUVA422P12
Definition: pixfmt.h:543
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition: opt.h:259
avfilter.h
AV_PIX_FMT_GBRAPF32
#define AV_PIX_FMT_GBRAPF32
Definition: pixfmt.h:533
values
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return values
Definition: filter_design.txt:263
AVPixFmtDescriptor::comp
AVComponentDescriptor comp[4]
Parameters that describe how pixels are packed.
Definition: pixdesc.h:105
BLEND_XOR
@ BLEND_XOR
Definition: blend.h:53
BlendContext::all_opacity
double all_opacity
Definition: vf_blend.c:44
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_blend.c:282
AV_PIX_FMT_YUV444P
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:78
AVFilterContext
An instance of a filter.
Definition: avfilter.h:457
AV_PIX_FMT_GBRP
@ AV_PIX_FMT_GBRP
planar GBR 4:4:4 24bpp
Definition: pixfmt.h:165
AVFILTER_FLAG_SLICE_THREADS
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition: avfilter.h:152
av_strdup
char * av_strdup(const char *s)
Duplicate a string.
Definition: mem.c:272
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AV_PIX_FMT_YUV422P
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:77
mem.h
BLEND_DARKEN
@ BLEND_DARKEN
Definition: blend.h:34
AVPixFmtDescriptor
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Definition: pixdesc.h:69
blend_frame_for_dualinput
static int blend_frame_for_dualinput(FFFrameSync *fs)
Definition: vf_blend.c:235
BLEND_AVERAGE
@ BLEND_AVERAGE
Definition: blend.h:32
av_freep
#define av_freep(p)
Definition: tableprint_vlc.h:34
FilterParams::opacity
double opacity
Definition: blend.h:80
AV_PIX_FMT_YUV411P
@ AV_PIX_FMT_YUV411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
Definition: pixfmt.h:80
ThreadData::top
const AVFrame * top
Definition: vf_blend.c:57
AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
#define AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
Same as AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, except that the filter will have its filter_frame() c...
Definition: avfilter.h:190
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:482
AVFrame::linesize
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
Definition: frame.h:434
AV_PIX_FMT_YUV410P
@ AV_PIX_FMT_YUV410P
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
Definition: pixfmt.h:79
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:27
AV_PIX_FMT_YUV440P12
#define AV_PIX_FMT_YUV440P12
Definition: pixfmt.h:508
BLEND_BURN
@ BLEND_BURN
Definition: blend.h:33
AV_PIX_FMT_YUV444P14
#define AV_PIX_FMT_YUV444P14
Definition: pixfmt.h:512
ff_framesync_activate
int ff_framesync_activate(FFFrameSync *fs)
Examine the frames in the filter's input and try to produce output.
Definition: framesync.c:352
blend_outputs
static const AVFilterPad blend_outputs[]
Definition: vf_blend.c:405
ff_framesync_dualinput_get
int ff_framesync_dualinput_get(FFFrameSync *fs, AVFrame **f0, AVFrame **f1)
Definition: framesync.c:390
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Underlying C type is a uint8_t* that is either NULL or points to a C string allocated with the av_mal...
Definition: opt.h:276
AV_PIX_FMT_GRAY12
#define AV_PIX_FMT_GRAY12
Definition: pixfmt.h:484
BLEND_REFLECT
@ BLEND_REFLECT
Definition: blend.h:48
BLEND_GRAINEXTRACT
@ BLEND_GRAINEXTRACT
Definition: blend.h:36
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
Definition: opt.h:299
BOTTOM
#define BOTTOM
Definition: vf_blend.c:35
AVPixFmtDescriptor::log2_chroma_h
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
Definition: pixdesc.h:89
FLAGS
#define FLAGS
Definition: vf_blend.c:66
AV_PIX_FMT_YUVA422P
@ AV_PIX_FMT_YUVA422P
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
Definition: pixfmt.h:173
BLEND_LINEARLIGHT
@ BLEND_LINEARLIGHT
Definition: blend.h:55
AV_PIX_FMT_YUV420P14
#define AV_PIX_FMT_YUV420P14
Definition: pixfmt.h:510
BLEND_NORMAL
@ BLEND_NORMAL
Definition: blend.h:29
BLEND_OVERLAY
@ BLEND_OVERLAY
Definition: blend.h:45