FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
vf_extractplanes.c File Reference
#include "libavutil/avstring.h"
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavfilter/framequeue.h"
#include "avfilter.h"
#include "drawutils.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  ExtractPlanesContext
 

Macros

#define FF_INTERNAL_FIELDS   1
 
#define PLANE_R   0x01
 
#define PLANE_G   0x02
 
#define PLANE_B   0x04
 
#define PLANE_A   0x08
 
#define PLANE_Y   0x10
 
#define PLANE_U   0x20
 
#define PLANE_V   0x40
 
#define OFFSET(x)   offsetof(ExtractPlanesContext, x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
 
#define EIGHTBIT_FORMATS
 
#define HIGHDEPTH_FORMATS(suf)
 

Functions

 AVFILTER_DEFINE_CLASS (extractplanes)
 
static int query_formats (AVFilterContext *ctx)
 
static int config_input (AVFilterLink *inlink)
 
static int config_output (AVFilterLink *outlink)
 
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)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *frame)
 
static av_cold int init (AVFilterContext *ctx)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const AVOption extractplanes_options []
 
static const AVFilterPad extractplanes_inputs []
 
AVFilter ff_vf_extractplanes
 

Macro Definition Documentation

#define FF_INTERNAL_FIELDS   1

Definition at line 26 of file vf_extractplanes.c.

#define PLANE_R   0x01

Definition at line 33 of file vf_extractplanes.c.

Referenced by config_input().

#define PLANE_G   0x02

Definition at line 34 of file vf_extractplanes.c.

Referenced by config_input().

#define PLANE_B   0x04

Definition at line 35 of file vf_extractplanes.c.

Referenced by config_input().

#define PLANE_A   0x08

Definition at line 36 of file vf_extractplanes.c.

Referenced by config_input().

#define PLANE_Y   0x10

Definition at line 37 of file vf_extractplanes.c.

Referenced by config_input().

#define PLANE_U   0x20

Definition at line 38 of file vf_extractplanes.c.

Referenced by config_input().

#define PLANE_V   0x40

Definition at line 39 of file vf_extractplanes.c.

Referenced by config_input().

#define OFFSET (   x)    offsetof(ExtractPlanesContext, x)

Definition at line 51 of file vf_extractplanes.c.

Definition at line 52 of file vf_extractplanes.c.

#define EIGHTBIT_FORMATS
Value:
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:71
packed RGB 8:8:8, 24bpp, RGBRGB...
Definition: pixfmt.h:68
planar GBR 4:4:4 24bpp
Definition: pixfmt.h:168
packed BGR 8:8:8, 32bpp, XBGRXBGR... X=unused/undefined
Definition: pixfmt.h:239
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
Definition: pixfmt.h:101
packed RGB 8:8:8, 32bpp, RGBXRGBX... X=unused/undefined
Definition: pixfmt.h:238
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
Definition: pixfmt.h:94
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range...
Definition: pixfmt.h:100
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
Definition: pixfmt.h:79
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
Definition: pixfmt.h:176
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
Definition: pixfmt.h:95
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
Definition: pixfmt.h:92
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
Definition: pixfmt.h:93
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:70
alias for AV_PIX_FMT_YA8
Definition: pixfmt.h:146
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
Definition: pixfmt.h:78
packed RGB 8:8:8, 24bpp, BGRBGR...
Definition: pixfmt.h:69
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
Definition: pixfmt.h:177
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
Definition: pixfmt.h:72
packed BGR 8:8:8, 32bpp, BGRXBGRX... X=unused/undefined
Definition: pixfmt.h:240
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:66
Y , 8bpp.
Definition: pixfmt.h:74
planar GBRA 4:4:4:4 32bpp
Definition: pixfmt.h:215
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
Definition: pixfmt.h:80
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
Definition: pixfmt.h:73
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor ...
Definition: pixfmt.h:258
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
Definition: pixfmt.h:99
packed RGB 8:8:8, 32bpp, XRGBXRGB... X=unused/undefined
Definition: pixfmt.h:237

Definition at line 67 of file vf_extractplanes.c.

Referenced by query_formats().

#define HIGHDEPTH_FORMATS (   suf)

Definition at line 85 of file vf_extractplanes.c.

Referenced by query_formats().

Function Documentation

AVFILTER_DEFINE_CLASS ( extractplanes  )
static int query_formats ( AVFilterContext ctx)
static

Definition at line 118 of file vf_extractplanes.c.

static int config_input ( AVFilterLink inlink)
static

Definition at line 201 of file vf_extractplanes.c.

static int config_output ( AVFilterLink outlink)
static

Definition at line 233 of file vf_extractplanes.c.

Referenced by init().

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 
)
static

Definition at line 249 of file vf_extractplanes.c.

Referenced by filter_frame().

static int filter_frame ( AVFilterLink inlink,
AVFrame frame 
)
static

Definition at line 274 of file vf_extractplanes.c.

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 322 of file vf_extractplanes.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 352 of file vf_extractplanes.c.

Variable Documentation

const AVOption extractplanes_options[]
static
Initial value:
= {
{ "planes", "set planes", OFFSET(requested_planes), AV_OPT_TYPE_FLAGS, {.i64=1}, 1, 0xff, FLAGS, "flags"},
{ "y", "set luma plane", 0, AV_OPT_TYPE_CONST, {.i64=PLANE_Y}, 0, 0, FLAGS, "flags"},
{ "u", "set u plane", 0, AV_OPT_TYPE_CONST, {.i64=PLANE_U}, 0, 0, FLAGS, "flags"},
{ "v", "set v plane", 0, AV_OPT_TYPE_CONST, {.i64=PLANE_V}, 0, 0, FLAGS, "flags"},
{ "r", "set red plane", 0, AV_OPT_TYPE_CONST, {.i64=PLANE_R}, 0, 0, FLAGS, "flags"},
{ "g", "set green plane", 0, AV_OPT_TYPE_CONST, {.i64=PLANE_G}, 0, 0, FLAGS, "flags"},
{ "b", "set blue plane", 0, AV_OPT_TYPE_CONST, {.i64=PLANE_B}, 0, 0, FLAGS, "flags"},
{ "a", "set alpha plane", 0, AV_OPT_TYPE_CONST, {.i64=PLANE_A}, 0, 0, FLAGS, "flags"},
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define PLANE_U
#define PLANE_A
#define OFFSET(x)
#define FLAGS
#define PLANE_Y
#define PLANE_V
#define PLANE_R
#define PLANE_G
#define PLANE_B

Definition at line 53 of file vf_extractplanes.c.

const AVFilterPad extractplanes_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = filter_frame,
.config_props = config_input,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int config_input(AVFilterLink *inlink)
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)

Definition at line 360 of file vf_extractplanes.c.

AVFilter ff_vf_extractplanes
Initial value:
= {
.name = "extractplanes",
.description = NULL_IF_CONFIG_SMALL("Extract planes as grayscale frames."),
.priv_size = sizeof(ExtractPlanesContext),
.priv_class = &extractplanes_class,
.init = init,
}
#define NULL
Definition: coverity.c:32
static const AVFilterPad extractplanes_inputs[]
static av_cold void uninit(AVFilterContext *ctx)
#define AVFILTER_FLAG_DYNAMIC_OUTPUTS
The number of the filter outputs is not determined just by AVFilter.outputs.
Definition: avfilter.h:111
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
static const AVFilterPad inputs[]
Definition: af_acontrast.c:193
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
static int query_formats(AVFilterContext *ctx)
static av_cold int init(AVFilterContext *ctx)
#define flags(name, subs,...)
Definition: cbs_av1.c:596

Definition at line 370 of file vf_extractplanes.c.