FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
vf_extractplanes.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 "libavutil/avstring.h"
22 #include "libavutil/imgutils.h"
23 #include "libavutil/opt.h"
24 #include "libavutil/pixdesc.h"
25 #include "avfilter.h"
26 #include "drawutils.h"
27 #include "internal.h"
28 
29 #define PLANE_R 0x01
30 #define PLANE_G 0x02
31 #define PLANE_B 0x04
32 #define PLANE_A 0x08
33 #define PLANE_Y 0x10
34 #define PLANE_U 0x20
35 #define PLANE_V 0x40
36 
37 typedef struct {
38  const AVClass *class;
40  int map[4];
41  int linesize[4];
42  int is_packed;
43  int depth;
44  int step;
46 
47 #define OFFSET(x) offsetof(ExtractPlanesContext, x)
48 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
49 static const AVOption extractplanes_options[] = {
50  { "planes", "set planes", OFFSET(requested_planes), AV_OPT_TYPE_FLAGS, {.i64=1}, 1, 0xff, FLAGS, "flags"},
51  { "y", "set luma plane", 0, AV_OPT_TYPE_CONST, {.i64=PLANE_Y}, 0, 0, FLAGS, "flags"},
52  { "u", "set u plane", 0, AV_OPT_TYPE_CONST, {.i64=PLANE_U}, 0, 0, FLAGS, "flags"},
53  { "v", "set v plane", 0, AV_OPT_TYPE_CONST, {.i64=PLANE_V}, 0, 0, FLAGS, "flags"},
54  { "r", "set red plane", 0, AV_OPT_TYPE_CONST, {.i64=PLANE_R}, 0, 0, FLAGS, "flags"},
55  { "g", "set green plane", 0, AV_OPT_TYPE_CONST, {.i64=PLANE_G}, 0, 0, FLAGS, "flags"},
56  { "b", "set blue plane", 0, AV_OPT_TYPE_CONST, {.i64=PLANE_B}, 0, 0, FLAGS, "flags"},
57  { "a", "set alpha plane", 0, AV_OPT_TYPE_CONST, {.i64=PLANE_A}, 0, 0, FLAGS, "flags"},
58  { NULL }
59 };
60 
61 AVFILTER_DEFINE_CLASS(extractplanes);
62 
64 {
65  static const enum AVPixelFormat in_pixfmts_le[] = {
90  };
91  static const enum AVPixelFormat in_pixfmts_be[] = {
116  };
117  static const enum AVPixelFormat out8_pixfmts[] = { AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE };
118  static const enum AVPixelFormat out16le_pixfmts[] = { AV_PIX_FMT_GRAY16LE, AV_PIX_FMT_NONE };
119  static const enum AVPixelFormat out16be_pixfmts[] = { AV_PIX_FMT_GRAY16BE, AV_PIX_FMT_NONE };
120  const enum AVPixelFormat *out_pixfmts, *in_pixfmts;
121  const AVPixFmtDescriptor *desc;
122  AVFilterFormats *avff;
123  int i, ret, depth = 0, be = 0;
124 
125  if (!ctx->inputs[0]->in_formats ||
126  !ctx->inputs[0]->in_formats->nb_formats) {
127  return AVERROR(EAGAIN);
128  }
129 
130  avff = ctx->inputs[0]->in_formats;
131  desc = av_pix_fmt_desc_get(avff->formats[0]);
132  depth = desc->comp[0].depth;
133  be = desc->flags & AV_PIX_FMT_FLAG_BE;
134  if (be) {
135  in_pixfmts = in_pixfmts_be;
136  } else {
137  in_pixfmts = in_pixfmts_le;
138  }
139  if (!ctx->inputs[0]->out_formats)
140  if ((ret = ff_formats_ref(ff_make_format_list(in_pixfmts), &ctx->inputs[0]->out_formats)) < 0)
141  return ret;
142 
143  for (i = 1; i < avff->nb_formats; i++) {
144  desc = av_pix_fmt_desc_get(avff->formats[i]);
145  if (depth != desc->comp[0].depth ||
146  be != (desc->flags & AV_PIX_FMT_FLAG_BE)) {
147  return AVERROR(EAGAIN);
148  }
149  }
150 
151  if (depth == 8)
152  out_pixfmts = out8_pixfmts;
153  else if (be)
154  out_pixfmts = out16be_pixfmts;
155  else
156  out_pixfmts = out16le_pixfmts;
157 
158  for (i = 0; i < ctx->nb_outputs; i++)
159  if ((ret = ff_formats_ref(ff_make_format_list(out_pixfmts), &ctx->outputs[i]->in_formats)) < 0)
160  return ret;
161  return 0;
162 }
163 
164 static int config_input(AVFilterLink *inlink)
165 {
166  AVFilterContext *ctx = inlink->dst;
167  ExtractPlanesContext *s = ctx->priv;
169  int plane_avail, ret, i;
170  uint8_t rgba_map[4];
171 
172  plane_avail = ((desc->flags & AV_PIX_FMT_FLAG_RGB) ? PLANE_R|PLANE_G|PLANE_B :
173  PLANE_Y |
174  ((desc->nb_components > 2) ? PLANE_U|PLANE_V : 0)) |
175  ((desc->flags & AV_PIX_FMT_FLAG_ALPHA) ? PLANE_A : 0);
176  if (s->requested_planes & ~plane_avail) {
177  av_log(ctx, AV_LOG_ERROR, "Requested planes not available.\n");
178  return AVERROR(EINVAL);
179  }
180  if ((ret = av_image_fill_linesizes(s->linesize, inlink->format, inlink->w)) < 0)
181  return ret;
182 
183  s->depth = desc->comp[0].depth >> 3;
184  s->step = av_get_padded_bits_per_pixel(desc) >> 3;
185  s->is_packed = !(desc->flags & AV_PIX_FMT_FLAG_PLANAR) &&
186  (desc->nb_components > 1);
187  if (desc->flags & AV_PIX_FMT_FLAG_RGB) {
188  ff_fill_rgba_map(rgba_map, inlink->format);
189  for (i = 0; i < 4; i++)
190  s->map[i] = rgba_map[s->map[i]];
191  }
192 
193  return 0;
194 }
195 
196 static int config_output(AVFilterLink *outlink)
197 {
198  AVFilterContext *ctx = outlink->src;
199  AVFilterLink *inlink = ctx->inputs[0];
200  ExtractPlanesContext *s = ctx->priv;
202  const int output = outlink->srcpad - ctx->output_pads;
203 
204  if (s->map[output] == 1 || s->map[output] == 2) {
205  outlink->h = AV_CEIL_RSHIFT(inlink->h, desc->log2_chroma_h);
206  outlink->w = AV_CEIL_RSHIFT(inlink->w, desc->log2_chroma_w);
207  }
208 
209  return 0;
210 }
211 
212 static void extract_from_packed(uint8_t *dst, int dst_linesize,
213  const uint8_t *src, int src_linesize,
214  int width, int height,
215  int depth, int step, int comp)
216 {
217  int x, y;
218 
219  for (y = 0; y < height; y++) {
220  switch (depth) {
221  case 1:
222  for (x = 0; x < width; x++)
223  dst[x] = src[x * step + comp];
224  break;
225  case 2:
226  for (x = 0; x < width; x++) {
227  dst[x * 2 ] = src[x * step + comp * 2 ];
228  dst[x * 2 + 1] = src[x * step + comp * 2 + 1];
229  }
230  break;
231  }
232  dst += dst_linesize;
233  src += src_linesize;
234  }
235 }
236 
237 static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
238 {
239  AVFilterContext *ctx = inlink->dst;
240  ExtractPlanesContext *s = ctx->priv;
241  int i, eof = 0, ret = 0;
242 
243  for (i = 0; i < ctx->nb_outputs; i++) {
244  AVFilterLink *outlink = ctx->outputs[i];
245  const int idx = s->map[i];
246  AVFrame *out;
247 
248  if (outlink->status)
249  continue;
250 
251  out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
252  if (!out) {
253  ret = AVERROR(ENOMEM);
254  break;
255  }
256  av_frame_copy_props(out, frame);
257 
258  if (s->is_packed) {
259  extract_from_packed(out->data[0], out->linesize[0],
260  frame->data[0], frame->linesize[0],
261  outlink->w, outlink->h,
262  s->depth,
263  s->step, idx);
264  } else {
265  av_image_copy_plane(out->data[0], out->linesize[0],
266  frame->data[idx], frame->linesize[idx],
267  s->linesize[idx], outlink->h);
268  }
269 
270  ret = ff_filter_frame(outlink, out);
271  if (ret == AVERROR_EOF)
272  eof++;
273  else if (ret < 0)
274  break;
275  }
276  av_frame_free(&frame);
277 
278  if (eof == ctx->nb_outputs)
279  ret = AVERROR_EOF;
280  else if (ret == AVERROR_EOF)
281  ret = 0;
282  return ret;
283 }
284 
286 {
287  ExtractPlanesContext *s = ctx->priv;
288  int planes = (s->requested_planes & 0xf) | (s->requested_planes >> 4);
289  int i;
290 
291  for (i = 0; i < 4; i++) {
292  char *name;
293  AVFilterPad pad = { 0 };
294 
295  if (!(planes & (1 << i)))
296  continue;
297 
298  name = av_asprintf("out%d", ctx->nb_outputs);
299  if (!name)
300  return AVERROR(ENOMEM);
301  s->map[ctx->nb_outputs] = i;
302  pad.name = name;
303  pad.type = AVMEDIA_TYPE_VIDEO;
305 
306  ff_insert_outpad(ctx, ctx->nb_outputs, &pad);
307  }
308 
309  return 0;
310 }
311 
313 {
314  int i;
315 
316  for (i = 0; i < ctx->nb_outputs; i++)
317  av_freep(&ctx->output_pads[i].name);
318 }
319 
321  {
322  .name = "default",
323  .type = AVMEDIA_TYPE_VIDEO,
324  .filter_frame = filter_frame,
325  .config_props = config_input,
326  },
327  { NULL }
328 };
329 
331  .name = "extractplanes",
332  .description = NULL_IF_CONFIG_SMALL("Extract planes as grayscale frames."),
333  .priv_size = sizeof(ExtractPlanesContext),
334  .priv_class = &extractplanes_class,
335  .init = init,
336  .uninit = uninit,
338  .inputs = extractplanes_inputs,
339  .outputs = NULL,
341 };
342 
343 #if CONFIG_ALPHAEXTRACT_FILTER
344 
345 static av_cold int init_alphaextract(AVFilterContext *ctx)
346 {
347  ExtractPlanesContext *s = ctx->priv;
348 
350 
351  return init(ctx);
352 }
353 
354 AVFilter ff_vf_alphaextract = {
355  .name = "alphaextract",
356  .description = NULL_IF_CONFIG_SMALL("Extract an alpha channel as a "
357  "grayscale image component."),
358  .priv_size = sizeof(ExtractPlanesContext),
359  .init = init_alphaextract,
360  .uninit = uninit,
362  .inputs = extractplanes_inputs,
363  .outputs = NULL,
365 };
366 #endif /* CONFIG_ALPHAEXTRACT_FILTER */
#define NULL
Definition: coverity.c:32
static const AVFilterPad extractplanes_inputs[]
#define PLANE_U
const char * s
Definition: avisynth_c.h:768
#define PLANE_A
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:2266
This structure describes decoded (raw) audio or video data.
Definition: frame.h:184
AVFILTER_DEFINE_CLASS(extractplanes)
AVOption.
Definition: opt.h:245
packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is st...
Definition: pixfmt.h:220
static av_cold void uninit(AVFilterContext *ctx)
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:67
misc image utilities
#define OFFSET(x)
Main libavfilter public API header.
packed RGB 8:8:8, 24bpp, RGBRGB...
Definition: pixfmt.h:64
const char * desc
Definition: nvenc.c:101
planar GBR 4:4:4 24bpp
Definition: pixfmt.h:180
packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is st...
Definition: pixfmt.h:219
enum AVMediaType type
AVFilterPad type.
Definition: internal.h:64
packed BGR 8:8:8, 32bpp, XBGRXBGR... X=unused/undefined
Definition: pixfmt.h:253
static int config_input(AVFilterLink *inlink)
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.
Definition: video.c:76
#define FLAGS
planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
Definition: pixfmt.h:139
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
Definition: pixdesc.h:92
AVFilterFormats * ff_make_format_list(const int *fmts)
Create a list of supported formats.
Definition: formats.c:283
const char * name
Pad name.
Definition: internal.h:59
AVFilterLink ** inputs
array of pointers to input links
Definition: avfilter.h:315
planar GBRA 4:4:4:4 64bpp, big-endian
Definition: pixfmt.h:230
planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian)
Definition: pixfmt.h:202
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Definition: avfilter.c:1189
AVFilterPad * output_pads
array of output pads
Definition: avfilter.h:318
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
Definition: pixfmt.h:102
AVComponentDescriptor comp[4]
Parameters that describe how pixels are packed.
Definition: pixdesc.h:117
uint8_t
#define av_cold
Definition: attributes.h:82
#define AV_PIX_FMT_FLAG_ALPHA
The pixel format has an alpha channel.
Definition: pixdesc.h:173
packed RGB 8:8:8, 32bpp, RGBXRGBX... X=unused/undefined
Definition: pixfmt.h:252
AVOptions.
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as lit...
Definition: pixfmt.h:111
packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is st...
Definition: pixfmt.h:217
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
Definition: pixfmt.h:95
static AVFrame * frame
planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian)
Definition: pixfmt.h:203
#define height
planar GBR 4:4:4 48bpp, big-endian
Definition: pixfmt.h:186
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range...
Definition: pixfmt.h:101
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
Definition: pixfmt.h:75
#define AVERROR_EOF
End of file.
Definition: error.h:55
planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian)
Definition: pixfmt.h:206
static void extract_from_packed(uint8_t *dst, int dst_linesize, const uint8_t *src, int src_linesize, int width, int height, int depth, int step, int comp)
#define AVFILTER_FLAG_DYNAMIC_OUTPUTS
The number of the filter outputs is not determined just by AVFilter.outputs.
Definition: avfilter.h:111
#define av_log(a,...)
A filter pad used for either input or output.
Definition: internal.h:53
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
Definition: pixfmt.h:188
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:176
16 bits gray, 16 bits alpha (big-endian)
Definition: pixfmt.h:226
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
Definition: pixdesc.h:101
static const AVOption extractplanes_options[]
planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
Definition: pixfmt.h:144
#define AVERROR(e)
Definition: error.h:43
#define AV_PIX_FMT_FLAG_RGB
The pixel format contains RGB-like data (as opposed to YUV/grayscale).
Definition: pixdesc.h:148
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
Definition: frame.c:158
unsigned nb_outputs
number of output pads
Definition: avfilter.h:320
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:176
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
Definition: pixfmt.h:96
void * priv
private data for use by the filter
Definition: avfilter.h:322
int av_get_padded_bits_per_pixel(const AVPixFmtDescriptor *pixdesc)
Return the number of bits per pixel for the pixel format described by pixdesc, including any padding ...
Definition: pixdesc.c:2231
static int config_output(AVFilterLink *outlink)
planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
Definition: pixfmt.h:142
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
Definition: pixfmt.h:93
packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as lit...
Definition: pixfmt.h:160
int depth
Definition: v4l.c:62
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:66
char * av_asprintf(const char *fmt,...)
Definition: avstring.c:113
uint64_t flags
Combination of AV_PIX_FMT_FLAG_...
Definition: pixdesc.h:106
AVFilter ff_vf_extractplanes
uint8_t nb_components
The number of components each pixel has, (1-4)
Definition: pixdesc.h:83
alias for AV_PIX_FMT_YA8
Definition: pixfmt.h:157
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
Definition: pixfmt.h:74
#define width
int ff_formats_ref(AVFilterFormats *f, AVFilterFormats **ref)
Add *ref as a new reference to formats.
Definition: formats.c:440
AVFormatContext * ctx
Definition: movenc.c:48
unsigned nb_formats
number of formats
Definition: formats.h:65
packed RGB 8:8:8, 24bpp, BGRBGR...
Definition: pixfmt.h:65
#define PLANE_Y
static const AVFilterPad outputs[]
Definition: af_afftfilt.c:386
#define src
Definition: vp9dsp.c:530
packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big...
Definition: pixfmt.h:159
int ff_fill_rgba_map(uint8_t *rgba_map, enum AVPixelFormat pix_fmt)
Definition: drawutils.c:35
#define PLANE_V
planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
Definition: pixfmt.h:140
#define PLANE_R
static const AVFilterPad inputs[]
Definition: af_afftfilt.c:376
misc drawing utilities
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
Definition: frame.h:215
static int query_formats(AVFilterContext *ctx)
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
Definition: pixfmt.h:189
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Definition: pixdesc.h:81
planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian)
Definition: pixfmt.h:204
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
Definition: pixfmt.h:68
planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian)
Definition: pixfmt.h:205
Describe the class of an AVClass context structure.
Definition: log.h:67
Filter definition.
Definition: avfilter.h:144
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:88
planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian)
Definition: pixfmt.h:207
Y , 16bpp, big-endian.
Definition: pixfmt.h:98
#define PLANE_G
packed BGR 8:8:8, 32bpp, BGRXBGRX... X=unused/undefined
Definition: pixfmt.h:254
const char * name
Filter name.
Definition: avfilter.h:148
const VDPAUPixFmtMap * map
AVFilterLink ** outputs
array of pointers to output links
Definition: avfilter.h:319
static av_cold int init(AVFilterContext *ctx)
static int flags
Definition: cpu.c:47
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition: frame.h:198
planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition: pixfmt.h:143
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:62
Y , 8bpp.
Definition: pixfmt.h:70
planar GBRA 4:4:4:4 32bpp
Definition: pixfmt.h:229
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big...
Definition: pixfmt.h:110
planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
Definition: pixfmt.h:141
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
Definition: pixfmt.h:76
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
Definition: pixfmt.h:69
#define AV_PIX_FMT_FLAG_BE
Pixel format is big-endian.
Definition: pixdesc.h:128
Y , 16bpp, little-endian.
Definition: pixfmt.h:99
A list of supported formats for one end of a filter link.
Definition: formats.h:64
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor ...
Definition: pixfmt.h:272
16 bits gray, 16 bits alpha (little-endian)
Definition: pixfmt.h:227
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
An instance of a filter.
Definition: avfilter.h:307
#define PLANE_B
FILE * out
Definition: movenc.c:54
#define av_freep(p)
int(* config_props)(AVFilterLink *link)
Link configuration callback.
Definition: internal.h:128
static void comp(unsigned char *dst, int dst_stride, unsigned char *src, int src_stride, int add)
Definition: eamad.c:83
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
Definition: pixfmt.h:100
planar GBR 4:4:4 48bpp, little-endian
Definition: pixfmt.h:187
void av_image_copy_plane(uint8_t *dst, int dst_linesize, const uint8_t *src, int src_linesize, int bytewidth, int height)
Copy image plane from src to dst.
Definition: imgutils.c:287
internal API functions
int depth
Number of bits in the component.
Definition: pixdesc.h:58
planar GBRA 4:4:4:4 64bpp, little-endian
Definition: pixfmt.h:231
packed RGB 8:8:8, 32bpp, XRGBXRGB... X=unused/undefined
Definition: pixfmt.h:251
static int ff_insert_outpad(AVFilterContext *f, unsigned index, AVFilterPad *p)
Insert a new output pad for the filter.
Definition: internal.h:291
AVPixelFormat
Pixel format.
Definition: pixfmt.h:60
#define AV_PIX_FMT_FLAG_PLANAR
At least one pixel component is not in the first data plane.
Definition: pixdesc.h:144
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
Definition: frame.c:589
packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is st...
Definition: pixfmt.h:218
#define AV_CEIL_RSHIFT(a, b)
Definition: common.h:58
const char * name
Definition: opengl_enc.c:103
int * formats
list of media formats
Definition: formats.h:66