FFmpeg
Loading...
Searching...
No Matches
vf_il.c File Reference

(de)interleave fields filter More...

#include "libavutil/opt.h"
#include "libavutil/imgutils.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "filters.h"
#include "formats.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  IlContext
 

Macros

#define OFFSET(x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
 

Enumerations

enum  FilterMode { MODE_NONE , MODE_INTERLEAVE , MODE_DEINTERLEAVE }
 

Functions

 AVFILTER_DEFINE_CLASS (il)
 
static int query_formats (const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
 
static int config_input (AVFilterLink *inlink)
 
static void interleave (uint8_t *dst, uint8_t *src, int w, int h, int dst_linesize, int src_linesize, enum FilterMode mode, int swap)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *inpicref)
 

Variables

static const AVOption il_options []
 
static const AVFilterPad inputs []
 
const FFFilter ff_vf_il
 

Detailed Description

(de)interleave fields filter

Definition in file vf_il.c.

Macro Definition Documentation

◆ OFFSET

#define OFFSET ( x)
Value:
offsetof(IlContext, x)

Definition at line 50 of file vf_il.c.

◆ FLAGS

Enumeration Type Documentation

◆ FilterMode

enum FilterMode
Enumerator
MODE_NONE 
MODE_INTERLEAVE 
MODE_DEINTERLEAVE 

Definition at line 35 of file vf_il.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( il )

◆ query_formats()

static int query_formats ( const AVFilterContext * ctx,
AVFilterFormatsConfig ** cfg_in,
AVFilterFormatsConfig ** cfg_out )
static

Definition at line 86 of file vf_il.c.

◆ config_input()

static int config_input ( AVFilterLink * inlink)
static

Definition at line 96 of file vf_il.c.

◆ interleave()

static void interleave ( uint8_t * dst,
uint8_t * src,
int w,
int h,
int dst_linesize,
int src_linesize,
enum FilterMode mode,
int swap )
static

◆ filter_frame()

static int filter_frame ( AVFilterLink * inlink,
AVFrame * inpicref )
static

Definition at line 144 of file vf_il.c.

Variable Documentation

◆ il_options

const AVOption il_options[]
static
Initial value:
= {
{"luma_mode", "select luma mode", OFFSET(luma_mode), AV_OPT_TYPE_INT, {.i64=MODE_NONE}, MODE_NONE, MODE_DEINTERLEAVE, FLAGS, .unit = "luma_mode"},
{"l", "select luma mode", OFFSET(luma_mode), AV_OPT_TYPE_INT, {.i64=MODE_NONE}, MODE_NONE, MODE_DEINTERLEAVE, FLAGS, .unit = "luma_mode"},
{"none", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_NONE}, 0, 0, FLAGS, .unit = "luma_mode"},
{"interleave", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_INTERLEAVE}, 0, 0, FLAGS, .unit = "luma_mode"},
{"i", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_INTERLEAVE}, 0, 0, FLAGS, .unit = "luma_mode"},
{"deinterleave", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_DEINTERLEAVE}, 0, 0, FLAGS, .unit = "luma_mode"},
{"d", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_DEINTERLEAVE}, 0, 0, FLAGS, .unit = "luma_mode"},
{"chroma_mode", "select chroma mode", OFFSET(chroma_mode), AV_OPT_TYPE_INT, {.i64=MODE_NONE}, MODE_NONE, MODE_DEINTERLEAVE, FLAGS, .unit = "chroma_mode"},
{"c", "select chroma mode", OFFSET(chroma_mode), AV_OPT_TYPE_INT, {.i64=MODE_NONE}, MODE_NONE, MODE_DEINTERLEAVE, FLAGS, .unit = "chroma_mode"},
{"none", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_NONE}, 0, 0, FLAGS, .unit = "chroma_mode"},
{"interleave", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_INTERLEAVE}, 0, 0, FLAGS, .unit = "chroma_mode"},
{"i", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_INTERLEAVE}, 0, 0, FLAGS, .unit = "chroma_mode"},
{"deinterleave", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_DEINTERLEAVE}, 0, 0, FLAGS, .unit = "chroma_mode"},
{"d", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_DEINTERLEAVE}, 0, 0, FLAGS, .unit = "chroma_mode"},
{"alpha_mode", "select alpha mode", OFFSET(alpha_mode), AV_OPT_TYPE_INT, {.i64=MODE_NONE}, MODE_NONE, MODE_DEINTERLEAVE, FLAGS, .unit = "alpha_mode"},
{"a", "select alpha mode", OFFSET(alpha_mode), AV_OPT_TYPE_INT, {.i64=MODE_NONE}, MODE_NONE, MODE_DEINTERLEAVE, FLAGS, .unit = "alpha_mode"},
{"none", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_NONE}, 0, 0, FLAGS, .unit = "alpha_mode"},
{"interleave", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_INTERLEAVE}, 0, 0, FLAGS, .unit = "alpha_mode"},
{"i", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_INTERLEAVE}, 0, 0, FLAGS, .unit = "alpha_mode"},
{"deinterleave", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_DEINTERLEAVE}, 0, 0, FLAGS, .unit = "alpha_mode"},
{"d", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_DEINTERLEAVE}, 0, 0, FLAGS, .unit = "alpha_mode"},
{"luma_swap", "swap luma fields", OFFSET(luma_swap), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS},
{"ls", "swap luma fields", OFFSET(luma_swap), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS},
{"chroma_swap", "swap chroma fields", OFFSET(chroma_swap), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS},
{"cs", "swap chroma fields", OFFSET(chroma_swap), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS},
{"alpha_swap", "swap alpha fields", OFFSET(alpha_swap), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS},
{"as", "swap alpha fields", OFFSET(alpha_swap), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS},
{NULL}
}
#define FLAGS
Definition cmdutils.c:598
#define NULL
Definition coverity.c:32
@ MODE_NONE
Definition f_perms.c:31
#define OFFSET(x)
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
Definition opt.h:298
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition opt.h:258
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
Definition opt.h:326
@ MODE_INTERLEAVE
Definition vf_il.c:37
@ MODE_DEINTERLEAVE
Definition vf_il.c:38

Definition at line 53 of file vf_il.c.

◆ inputs

const AVFilterPad inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = filter_frame,
.config_props = config_input,
},
}
static int config_input(AVFilterLink *inlink)
static int filter_frame(DBEDecodeContext *s, AVFrame *frame)
Definition dolby_e.c:1067
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200

Definition at line 182 of file vf_il.c.

◆ ff_vf_il

const FFFilter ff_vf_il
Initial value:
= {
.p.name = "il",
.p.description = NULL_IF_CONFIG_SMALL("Deinterleave or interleave fields."),
.p.priv_class = &il_class,
.priv_size = sizeof(IlContext),
.process_command = ff_filter_process_command,
}
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
Definition aeval.c:246
static const AVFilterPad inputs[]
Definition af_aap.c:299
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:906
#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:196
#define FILTER_INPUTS(array)
Definition filters.h:264
#define FILTER_OUTPUTS(array)
Definition filters.h:265
#define FILTER_QUERY_FUNC2(func)
Definition filters.h:241
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition internal.h:88
const AVFilterPad ff_video_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_VIDEO.
Definition video.c:37

Definition at line 191 of file vf_il.c.