FFmpeg
vf_maskfun.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018 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 "libavutil/imgutils.h"
22 #include "libavutil/pixdesc.h"
23 #include "libavutil/opt.h"
24 #include "avfilter.h"
25 #include "formats.h"
26 #include "internal.h"
27 #include "video.h"
28 
29 typedef struct MaskFunContext {
30  const AVClass *class;
31 
32  int low, high;
33  int planes;
34  int fill;
35  int sum;
36 
37  int linesize[4];
38  int width[4], height[4];
39  int nb_planes;
40  int depth;
41  int max;
42  uint64_t max_sum;
43 
46  int (*maskfun)(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs);
48 
49 #define OFFSET(x) offsetof(MaskFunContext, x)
50 #define VFT AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
51 
52 static const AVOption maskfun_options[] = {
53  { "low", "set low threshold", OFFSET(low), AV_OPT_TYPE_INT, {.i64=10}, 0, UINT16_MAX, VFT },
54  { "high", "set high threshold", OFFSET(high), AV_OPT_TYPE_INT, {.i64=10}, 0, UINT16_MAX, VFT },
55  { "planes", "set planes", OFFSET(planes), AV_OPT_TYPE_INT, {.i64=0xF}, 0, 0xF, VFT },
56  { "fill", "set fill value", OFFSET(fill), AV_OPT_TYPE_INT, {.i64=0}, 0, UINT16_MAX, VFT },
57  { "sum", "set sum value", OFFSET(sum), AV_OPT_TYPE_INT, {.i64=10}, 0, UINT16_MAX, VFT },
58  { NULL }
59 };
60 
61 AVFILTER_DEFINE_CLASS(maskfun);
62 
63 static const enum AVPixelFormat pix_fmts[] = {
82 };
83 
85 {
86  AVFilterContext *ctx = inlink->dst;
87  MaskFunContext *s = ctx->priv;
88  AVFilterLink *outlink = ctx->outputs[0];
89 
90  if (s->getsum(ctx, frame)) {
91  AVFrame *out = av_frame_clone(s->empty);
92 
93  if (!out) {
95  return AVERROR(ENOMEM);
96  }
97  out->pts = frame->pts;
99 
100  return ff_filter_frame(outlink, out);
101  }
102 
103  ff_filter_execute(ctx, s->maskfun, frame, NULL,
104  FFMIN(s->height[1], ff_filter_get_nb_threads(ctx)));
105 
106  return ff_filter_frame(outlink, frame);
107 }
108 
109 #define GETSUM(name, type, div) \
110 static int getsum##name(AVFilterContext *ctx, AVFrame *out) \
111 { \
112  MaskFunContext *s = ctx->priv; \
113  uint64_t sum = 0; \
114  int p; \
115  \
116  for (p = 0; p < s->nb_planes; p++) { \
117  const int linesize = out->linesize[p] / div; \
118  const int w = s->width[p]; \
119  const int h = s->height[p]; \
120  type *dst = (type *)out->data[p]; \
121  \
122  if (!((1 << p) & s->planes)) \
123  continue; \
124  \
125  for (int y = 0; y < h; y++) { \
126  for (int x = 0; x < w; x++) \
127  sum += dst[x]; \
128  if (sum >= s->max_sum) \
129  return 1; \
130  dst += linesize; \
131  } \
132  } \
133  \
134  return 0; \
135 }
136 
137 GETSUM(8, uint8_t, 1)
138 GETSUM(16, uint16_t, 2)
139 
140 #define MASKFUN(name, type, div) \
141 static int maskfun##name(AVFilterContext *ctx, void *arg, \
142  int jobnr, int nb_jobs) \
143 { \
144  MaskFunContext *s = ctx->priv; \
145  AVFrame *out = arg; \
146  const int low = s->low; \
147  const int high = s->high; \
148  const int max = s->max; \
149  int p; \
150  \
151  for (p = 0; p < s->nb_planes; p++) { \
152  const int linesize = out->linesize[p] / div; \
153  const int w = s->width[p]; \
154  const int h = s->height[p]; \
155  const int slice_start = (h * jobnr) / nb_jobs; \
156  const int slice_end = (h * (jobnr+1)) / nb_jobs; \
157  type *dst = (type *)out->data[p] + slice_start * linesize; \
158  \
159  if (!((1 << p) & s->planes)) \
160  continue; \
161  \
162  for (int y = slice_start; y < slice_end; y++) { \
163  for (int x = 0; x < w; x++) { \
164  if (dst[x] <= low) \
165  dst[x] = 0; \
166  else if (dst[x] > high) \
167  dst[x] = max; \
168  } \
169  \
170  dst += linesize; \
171  } \
172  } \
173  \
174  return 0; \
175 }
176 
177 MASKFUN(8, uint8_t, 1)
178 MASKFUN(16, uint16_t, 2)
179 
181 {
182  MaskFunContext *s = ctx->priv;
183 
184  s->fill = FFMIN(s->fill, s->max);
185  if (s->depth == 8) {
186  for (int p = 0; p < s->nb_planes; p++) {
187  uint8_t *dst = s->empty->data[p];
188 
189  for (int y = 0; y < s->height[p]; y++) {
190  memset(dst, s->fill, s->width[p]);
191  dst += s->empty->linesize[p];
192  }
193  }
194  } else {
195  for (int p = 0; p < s->nb_planes; p++) {
196  uint16_t *dst = (uint16_t *)s->empty->data[p];
197 
198  for (int y = 0; y < s->height[p]; y++) {
199  for (int x = 0; x < s->width[p]; x++)
200  dst[x] = s->fill;
201  dst += s->empty->linesize[p] / 2;
202  }
203  }
204  }
205 }
206 
208 {
209  MaskFunContext *s = ctx->priv;
210 
211  s->max_sum = 0;
212  for (int p = 0; p < s->nb_planes; p++) {
213  if (!((1 << p) & s->planes))
214  continue;
215  s->max_sum += (uint64_t)s->sum * s->width[p] * s->height[p];
216  }
217 }
218 
220 {
221  AVFilterContext *ctx = inlink->dst;
222  MaskFunContext *s = ctx->priv;
224  int vsub, hsub, ret;
225 
226  s->nb_planes = av_pix_fmt_count_planes(inlink->format);
227 
228  if ((ret = av_image_fill_linesizes(s->linesize, inlink->format, inlink->w)) < 0)
229  return ret;
230 
231  hsub = desc->log2_chroma_w;
232  vsub = desc->log2_chroma_h;
233  s->height[1] = s->height[2] = AV_CEIL_RSHIFT(inlink->h, vsub);
234  s->height[0] = s->height[3] = inlink->h;
235  s->width[1] = s->width[2] = AV_CEIL_RSHIFT(inlink->w, hsub);
236  s->width[0] = s->width[3] = inlink->w;
237 
238  s->depth = desc->comp[0].depth;
239  s->max = (1 << s->depth) - 1;
240 
241  if (s->depth == 8) {
242  s->maskfun = maskfun8;
243  s->getsum = getsum8;
244  } else {
245  s->maskfun = maskfun16;
246  s->getsum = getsum16;
247  }
248 
249  s->empty = ff_get_video_buffer(inlink, inlink->w, inlink->h);
250  if (!s->empty)
251  return AVERROR(ENOMEM);
252 
253  fill_frame(ctx);
254 
255  set_max_sum(ctx);
256 
257  return 0;
258 }
259 
260 static int process_command(AVFilterContext *ctx, const char *cmd, const char *args,
261  char *res, int res_len, int flags)
262 {
263  MaskFunContext *s = ctx->priv;
264  int fill = s->fill;
265  int sum = s->sum;
266  int ret;
267 
268  ret = ff_filter_process_command(ctx, cmd, args, res, res_len, flags);
269  if (ret < 0)
270  return ret;
271 
272  if (sum != s->sum)
273  set_max_sum(ctx);
274 
275  if (fill != s->fill)
276  fill_frame(ctx);
277 
278  return 0;
279 }
280 
282 {
283  MaskFunContext *s = ctx->priv;
284 
285  av_frame_free(&s->empty);
286 }
287 
288 static const AVFilterPad maskfun_inputs[] = {
289  {
290  .name = "default",
291  .type = AVMEDIA_TYPE_VIDEO,
293  .filter_frame = filter_frame,
294  .config_props = config_input,
295  },
296 };
297 
298 static const AVFilterPad maskfun_outputs[] = {
299  {
300  .name = "default",
301  .type = AVMEDIA_TYPE_VIDEO,
302  },
303 };
304 
306  .name = "maskfun",
307  .description = NULL_IF_CONFIG_SMALL("Create Mask."),
308  .priv_size = sizeof(MaskFunContext),
309  .uninit = uninit,
313  .priv_class = &maskfun_class,
315  .process_command = process_command,
316 };
fill_frame
static void fill_frame(AVFilterContext *ctx)
Definition: vf_maskfun.c:180
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:98
AV_PIX_FMT_YUVA422P16
#define AV_PIX_FMT_YUVA422P16
Definition: pixfmt.h:434
AV_PIX_FMT_GBRAP16
#define AV_PIX_FMT_GBRAP16
Definition: pixfmt.h:413
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:64
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
out
FILE * out
Definition: movenc.c:54
MaskFunContext::empty
AVFrame * empty
Definition: vf_maskfun.c:44
ff_filter_frame
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Definition: avfilter.c:1018
av_pix_fmt_desc_get
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:2564
FILTER_PIXFMTS_ARRAY
#define FILTER_PIXFMTS_ARRAY(array)
Definition: internal.h:171
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
process_command
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
Definition: vf_maskfun.c:260
av_frame_free
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
Definition: frame.c:112
AV_PIX_FMT_YUVA422P9
#define AV_PIX_FMT_YUVA422P9
Definition: pixfmt.h:426
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:303
pixdesc.h
AV_PIX_FMT_YUVA420P16
#define AV_PIX_FMT_YUVA420P16
Definition: pixfmt.h:433
AV_PIX_FMT_YUVA420P10
#define AV_PIX_FMT_YUVA420P10
Definition: pixfmt.h:428
AVOption
AVOption.
Definition: opt.h:247
MaskFunContext::low
int low
Definition: vf_maskfun.c:32
AV_PIX_FMT_YUV420P10
#define AV_PIX_FMT_YUV420P10
Definition: pixfmt.h:391
maskfun_outputs
static const AVFilterPad maskfun_outputs[]
Definition: vf_maskfun.c:298
AV_PIX_FMT_YUV440P
@ AV_PIX_FMT_YUV440P
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
Definition: pixfmt.h:99
AVFilter::name
const char * name
Filter name.
Definition: avfilter.h:153
video.h
AV_PIX_FMT_YUVA422P10
#define AV_PIX_FMT_YUVA422P10
Definition: pixfmt.h:429
AV_PIX_FMT_GRAY9
#define AV_PIX_FMT_GRAY9
Definition: pixfmt.h:371
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_maskfun.c:281
hsub
static void hsub(htype *dst, const htype *src, int bins)
Definition: vf_median.c:74
planes
static const struct @320 planes[]
formats.h
av_pix_fmt_count_planes
int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:2604
AV_PIX_FMT_YUVA420P9
#define AV_PIX_FMT_YUVA420P9
Definition: pixfmt.h:425
AV_PIX_FMT_GBRP14
#define AV_PIX_FMT_GBRP14
Definition: pixfmt.h:409
AV_PIX_FMT_GBRAP
@ AV_PIX_FMT_GBRAP
planar GBRA 4:4:4:4 32bpp
Definition: pixfmt.h:205
AV_PIX_FMT_GBRP10
#define AV_PIX_FMT_GBRP10
Definition: pixfmt.h:407
AV_PIX_FMT_YUVA444P16
#define AV_PIX_FMT_YUVA444P16
Definition: pixfmt.h:435
AV_PIX_FMT_YUV422P9
#define AV_PIX_FMT_YUV422P9
Definition: pixfmt.h:389
OFFSET
#define OFFSET(x)
Definition: vf_maskfun.c:49
AV_PIX_FMT_GRAY16
#define AV_PIX_FMT_GRAY16
Definition: pixfmt.h:375
AVFilterPad
A filter pad used for either input or output.
Definition: internal.h:50
AV_PIX_FMT_YUV444P10
#define AV_PIX_FMT_YUV444P10
Definition: pixfmt.h:394
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:248
av_cold
#define av_cold
Definition: attributes.h:90
AV_PIX_FMT_YUV422P16
#define AV_PIX_FMT_YUV422P16
Definition: pixfmt.h:403
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:79
AV_PIX_FMT_GBRAP10
#define AV_PIX_FMT_GBRAP10
Definition: pixfmt.h:411
av_image_fill_linesizes
int av_image_fill_linesizes(int linesizes[4], enum AVPixelFormat pix_fmt, int width)
Fill plane linesizes for an image with pixel format pix_fmt and width width.
Definition: imgutils.c:89
config_input
static int config_input(AVFilterLink *inlink)
Definition: vf_maskfun.c:219
s
#define s(width, name)
Definition: cbs_vp9.c:257
AV_PIX_FMT_GBRAP12
#define AV_PIX_FMT_GBRAP12
Definition: pixfmt.h:412
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:101
AV_PIX_FMT_YUV444P16
#define AV_PIX_FMT_YUV444P16
Definition: pixfmt.h:404
AV_CEIL_RSHIFT
#define AV_CEIL_RSHIFT(a, b)
Definition: common.h:51
MaskFunContext::width
int width[4]
Definition: vf_maskfun.c:38
AV_PIX_FMT_YUV420P9
#define AV_PIX_FMT_YUV420P9
Definition: pixfmt.h:388
ff_vf_maskfun
const AVFilter ff_vf_maskfun
Definition: vf_maskfun.c:305
AV_PIX_FMT_YUV420P16
#define AV_PIX_FMT_YUV420P16
Definition: pixfmt.h:402
ctx
AVFormatContext * ctx
Definition: movenc.c:48
AV_PIX_FMT_GRAY14
#define AV_PIX_FMT_GRAY14
Definition: pixfmt.h:374
av_frame_clone
AVFrame * av_frame_clone(const AVFrame *src)
Create a new frame that references the same data as src.
Definition: frame.c:424
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:66
maskfun_inputs
static const AVFilterPad maskfun_inputs[]
Definition: vf_maskfun.c:288
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:191
MASKFUN
#define MASKFUN(name, type, div)
Definition: vf_maskfun.c:140
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:80
arg
const char * arg
Definition: jacosubdec.c:67
AV_PIX_FMT_GRAY10
#define AV_PIX_FMT_GRAY10
Definition: pixfmt.h:372
AVFILTER_DEFINE_CLASS
AVFILTER_DEFINE_CLASS(maskfun)
AV_PIX_FMT_GBRP16
#define AV_PIX_FMT_GBRP16
Definition: pixfmt.h:410
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:66
NULL
#define NULL
Definition: coverity.c:32
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:78
MaskFunContext::max_sum
uint64_t max_sum
Definition: vf_maskfun.c:42
MaskFunContext::sum
int sum
Definition: vf_maskfun.c:35
AV_PIX_FMT_YUV422P10
#define AV_PIX_FMT_YUV422P10
Definition: pixfmt.h:392
AV_PIX_FMT_GRAY8
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
Definition: pixfmt.h:74
AV_PIX_FMT_GBRP9
#define AV_PIX_FMT_GBRP9
Definition: pixfmt.h:406
set_max_sum
static void set_max_sum(AVFilterContext *ctx)
Definition: vf_maskfun.c:207
MaskFunContext::height
int height[4]
Definition: vf_maskfun.c:38
for
for(j=16;j >0;--j)
Definition: h264pred_template.c:469
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:117
AV_PIX_FMT_YUV422P12
#define AV_PIX_FMT_YUV422P12
Definition: pixfmt.h:396
AV_PIX_FMT_YUV444P12
#define AV_PIX_FMT_YUV444P12
Definition: pixfmt.h:398
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:882
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:167
pix_fmts
static enum AVPixelFormat pix_fmts[]
Definition: vf_maskfun.c:63
AV_PIX_FMT_YUVA444P10
#define AV_PIX_FMT_YUVA444P10
Definition: pixfmt.h:430
MaskFunContext::linesize
int linesize[4]
Definition: vf_maskfun.c:37
internal.h
AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
#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:130
MaskFunContext::maskfun
int(* maskfun)(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
Definition: vf_maskfun.c:46
MaskFunContext::max
int max
Definition: vf_maskfun.c:41
AV_PIX_FMT_GBRP12
#define AV_PIX_FMT_GBRP12
Definition: pixfmt.h:408
maskfun_options
static const AVOption maskfun_options[]
Definition: vf_maskfun.c:52
ff_filter_get_nb_threads
int ff_filter_get_nb_threads(AVFilterContext *ctx)
Get number of threads for current filter instance.
Definition: avfilter.c:803
MaskFunContext::depth
int depth
Definition: vf_maskfun.c:40
FFMIN
#define FFMIN(a, b)
Definition: macros.h:49
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
Definition: vf_maskfun.c:84
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:100
AVFilterPad::name
const char * name
Pad name.
Definition: internal.h:56
MaskFunContext::fill
int fill
Definition: vf_maskfun.c:34
AV_PIX_FMT_YUV444P9
#define AV_PIX_FMT_YUV444P9
Definition: pixfmt.h:390
VFT
#define VFT
Definition: vf_maskfun.c:50
AVFilter
Filter definition.
Definition: avfilter.h:149
ret
ret
Definition: filter_design.txt:187
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:427
MaskFunContext::nb_planes
int nb_planes
Definition: vf_maskfun.c:39
AV_PIX_FMT_YUV420P12
#define AV_PIX_FMT_YUV420P12
Definition: pixfmt.h:395
AV_PIX_FMT_YUV422P14
#define AV_PIX_FMT_YUV422P14
Definition: pixfmt.h:400
MaskFunContext::high
int high
Definition: vf_maskfun.c:32
MaskFunContext::getsum
int(* getsum)(AVFilterContext *ctx, AVFrame *out)
Definition: vf_maskfun.c:45
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:65
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:224
avfilter.h
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:71
AVFilterContext
An instance of a filter.
Definition: avfilter.h:386
AV_PIX_FMT_GBRP
@ AV_PIX_FMT_GBRP
planar GBR 4:4:4 24bpp
Definition: pixfmt.h:158
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:121
desc
const char * desc
Definition: libsvtav1.c:79
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:70
AVPixFmtDescriptor
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Definition: pixdesc.h:69
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:192
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:73
imgutils.h
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:561
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:72
AV_PIX_FMT_YUV440P12
#define AV_PIX_FMT_YUV440P12
Definition: pixfmt.h:397
AV_PIX_FMT_YUV444P14
#define AV_PIX_FMT_YUV444P14
Definition: pixfmt.h:401
MaskFunContext::planes
int planes
Definition: vf_maskfun.c:33
AV_PIX_FMT_GRAY12
#define AV_PIX_FMT_GRAY12
Definition: pixfmt.h:373
ff_filter_execute
static av_always_inline int ff_filter_execute(AVFilterContext *ctx, avfilter_action_func *func, void *arg, int *ret, int nb_jobs)
Definition: internal.h:143
int
int
Definition: ffmpeg_filter.c:156
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:166
AV_PIX_FMT_YUV420P14
#define AV_PIX_FMT_YUV420P14
Definition: pixfmt.h:399
MaskFunContext
Definition: vf_maskfun.c:29
GETSUM
#define GETSUM(name, type, div)
Definition: vf_maskfun.c:109
AVFILTERPAD_FLAG_NEEDS_WRITABLE
#define AVFILTERPAD_FLAG_NEEDS_WRITABLE
The filter expects writable frames from its input link, duplicating data buffers if needed.
Definition: internal.h:69