Libav
Data Structures | Macros | Functions | Variables
vf_yadif.c File Reference
#include "libavutil/cpu.h"
#include "libavutil/common.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "video.h"
#include "yadif.h"
#include <assert.h>

Go to the source code of this file.

Data Structures

struct  ThreadData
 

Macros

#define CHECK(j)
 
#define FILTER(start, end, is_not_edge)
 
#define OFFSET(x)   offsetof(YADIFContext, x)
 
#define FLAGS   AV_OPT_FLAG_VIDEO_PARAM
 

Functions

static void filter_line_c (void *dst1, void *prev1, void *cur1, void *next1, int w, int prefs, int mrefs, int parity, int mode)
 
static void filter_edges (void *dst1, void *prev1, void *cur1, void *next1, int w, int prefs, int mrefs, int parity, int mode)
 
static void filter_line_c_16bit (void *dst1, void *prev1, void *cur1, void *next1, int w, int prefs, int mrefs, int parity, int mode)
 
static void filter_edges_16bit (void *dst1, void *prev1, void *cur1, void *next1, int w, int prefs, int mrefs, int parity, int mode)
 
static int filter_slice (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static void filter (AVFilterContext *ctx, AVFrame *dstpic, int parity, int tff)
 
static AVFrameget_video_buffer (AVFilterLink *link, int w, int h)
 
static int return_frame (AVFilterContext *ctx, int is_second)
 
static int filter_frame (AVFilterLink *link, AVFrame *frame)
 
static int request_frame (AVFilterLink *link)
 
static int poll_frame (AVFilterLink *link)
 
static av_cold void uninit (AVFilterContext *ctx)
 
static int query_formats (AVFilterContext *ctx)
 
static int config_props (AVFilterLink *link)
 

Variables

static const AVOption options []
 
static const AVClass yadif_class
 
static const AVFilterPad avfilter_vf_yadif_inputs []
 
static const AVFilterPad avfilter_vf_yadif_outputs []
 
AVFilter ff_vf_yadif
 

Macro Definition Documentation

§ CHECK

#define CHECK (   j)
Value:
{ int score = FFABS(cur[mrefs - 1 + (j)] - cur[prefs - 1 - (j)])\
+ FFABS(cur[mrefs +(j)] - cur[prefs -(j)])\
+ FFABS(cur[mrefs + 1 + (j)] - cur[prefs + 1 - (j)]);\
if (score < spatial_score) {\
spatial_score= score;\
spatial_pred= (cur[mrefs +(j)] + cur[prefs -(j)])>>1;\
#define FFABS(a)
Definition: common.h:52

Definition at line 43 of file vf_yadif.c.

§ FILTER

#define FILTER (   start,
  end,
  is_not_edge 
)

Definition at line 54 of file vf_yadif.c.

Referenced by filter_edges(), filter_edges_16bit(), filter_line_c(), and filter_line_c_16bit().

§ OFFSET

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

Definition at line 480 of file vf_yadif.c.

§ FLAGS

#define FLAGS   AV_OPT_FLAG_VIDEO_PARAM

Definition at line 481 of file vf_yadif.c.

Function Documentation

§ filter_line_c()

static void filter_line_c ( void dst1,
void prev1,
void cur1,
void next1,
int  w,
int  prefs,
int  mrefs,
int  parity,
int  mode 
)
static

Definition at line 96 of file vf_yadif.c.

Referenced by config_props().

§ filter_edges()

static void filter_edges ( void dst1,
void prev1,
void cur1,
void next1,
int  w,
int  prefs,
int  mrefs,
int  parity,
int  mode 
)
static

Definition at line 115 of file vf_yadif.c.

Referenced by config_props().

§ filter_line_c_16bit()

static void filter_line_c_16bit ( void dst1,
void prev1,
void cur1,
void next1,
int  w,
int  prefs,
int  mrefs,
int  parity,
int  mode 
)
static

Definition at line 141 of file vf_yadif.c.

Referenced by config_props().

§ filter_edges_16bit()

static void filter_edges_16bit ( void dst1,
void prev1,
void cur1,
void next1,
int  w,
int  prefs,
int  mrefs,
int  parity,
int  mode 
)
static

Definition at line 159 of file vf_yadif.c.

Referenced by config_props().

§ filter_slice()

static int filter_slice ( AVFilterContext ctx,
void arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 184 of file vf_yadif.c.

Referenced by filter().

§ filter()

static void filter ( AVFilterContext ctx,
AVFrame dstpic,
int  parity,
int  tff 
)
static

Definition at line 223 of file vf_yadif.c.

Referenced by return_frame().

§ get_video_buffer()

static AVFrame* get_video_buffer ( AVFilterLink link,
int  w,
int  h 
)
static

Definition at line 250 of file vf_yadif.c.

§ return_frame()

static int return_frame ( AVFilterContext ctx,
int  is_second 
)
static

Definition at line 268 of file vf_yadif.c.

Referenced by filter_frame(), and request_frame().

§ filter_frame()

static int filter_frame ( AVFilterLink link,
AVFrame frame 
)
static

Definition at line 308 of file vf_yadif.c.

Referenced by request_frame().

§ request_frame()

static int request_frame ( AVFilterLink link)
static

Definition at line 353 of file vf_yadif.c.

§ poll_frame()

static int poll_frame ( AVFilterLink link)
static

Definition at line 389 of file vf_yadif.c.

§ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 417 of file vf_yadif.c.

§ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 426 of file vf_yadif.c.

§ config_props()

static int config_props ( AVFilterLink link)
static

Definition at line 456 of file vf_yadif.c.

Variable Documentation

§ options

const AVOption options[]
static
Initial value:
= {
{ "mode", NULL, OFFSET(mode), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 3, FLAGS },
{ "parity", NULL, OFFSET(parity), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, FLAGS, "parity" },
{ "auto", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = -1 }, .unit = "parity" },
{ "tff", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, .unit = "parity" },
{ "bff", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, .unit = "parity" },
{ "auto", NULL, OFFSET(auto_enable), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, FLAGS },
{ NULL },
}
#define OFFSET(x)
Definition: vf_yadif.c:480
NULL
Definition: eval.c:55
#define FLAGS
Definition: vf_yadif.c:481

Definition at line 482 of file vf_yadif.c.

§ yadif_class

const AVClass yadif_class
static
Initial value:
= {
.class_name = "yadif",
.item_name = av_default_item_name,
.option = options,
}
static const AVOption options[]
Definition: vf_yadif.c:482
LIBAVUTIL_VERSION_INT
Definition: eval.c:55
av_default_item_name
Definition: dnxhdenc.c:52

Definition at line 492 of file vf_yadif.c.

§ avfilter_vf_yadif_inputs

const AVFilterPad avfilter_vf_yadif_inputs[]
static
Initial value:
= {
{
.name = "default",
.get_video_buffer = get_video_buffer,
.filter_frame = filter_frame,
},
{ NULL }
}
NULL
Definition: eval.c:55
static int filter_frame(AVFilterLink *link, AVFrame *frame)
Definition: vf_yadif.c:308
static AVFrame * get_video_buffer(AVFilterLink *link, int w, int h)
Definition: vf_yadif.c:250

Definition at line 499 of file vf_yadif.c.

§ avfilter_vf_yadif_outputs

const AVFilterPad avfilter_vf_yadif_outputs[]
static
Initial value:
= {
{
.name = "default",
.poll_frame = poll_frame,
.request_frame = request_frame,
.config_props = config_props,
},
{ NULL }
}
static int request_frame(AVFilterLink *link)
Definition: vf_yadif.c:353
static int config_props(AVFilterLink *link)
Definition: vf_yadif.c:456
static int poll_frame(AVFilterLink *link)
Definition: vf_yadif.c:389
NULL
Definition: eval.c:55

Definition at line 509 of file vf_yadif.c.

§ ff_vf_yadif

AVFilter ff_vf_yadif
Initial value:
= {
.name = "yadif",
.description = NULL_IF_CONFIG_SMALL("Deinterlace the input image"),
.priv_size = sizeof(YADIFContext),
.priv_class = &yadif_class,
}
static const AVFilterPad avfilter_vf_yadif_inputs[]
Definition: vf_yadif.c:499
static const AVFilterPad outputs[]
Definition: af_ashowinfo.c:232
static const AVClass yadif_class
Definition: vf_yadif.c:492
static int flags
Definition: log.c:44
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:145
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition: avfilter.h:415
static int query_formats(AVFilterContext *ctx)
Definition: vf_yadif.c:426
static const AVFilterPad avfilter_vf_yadif_outputs[]
Definition: vf_yadif.c:509
static const AVFilterPad inputs[]
Definition: af_ashowinfo.c:221
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_yadif.c:417

Definition at line 520 of file vf_yadif.c.