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 MAX_ALIGN   8
 
#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

#define MAX_ALIGN   8

Definition at line 43 of file vf_yadif.c.

Referenced by filter_edges(), filter_edges_16bit(), and filter_slice().

#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
if(ac->has_optimized_func)

Definition at line 45 of file vf_yadif.c.

#define FILTER (   start,
  end,
  is_not_edge 
)

Definition at line 56 of file vf_yadif.c.

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

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

Definition at line 490 of file vf_yadif.c.

#define FLAGS   AV_OPT_FLAG_VIDEO_PARAM

Definition at line 491 of file vf_yadif.c.

Function Documentation

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 98 of file vf_yadif.c.

Referenced by config_props().

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 117 of file vf_yadif.c.

Referenced by config_props().

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 146 of file vf_yadif.c.

Referenced by config_props().

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 164 of file vf_yadif.c.

Referenced by config_props().

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

Definition at line 193 of file vf_yadif.c.

Referenced by filter().

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

Definition at line 233 of file vf_yadif.c.

Referenced by return_frame().

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

Definition at line 260 of file vf_yadif.c.

static int return_frame ( AVFilterContext ctx,
int  is_second 
)
static

Definition at line 278 of file vf_yadif.c.

Referenced by filter_frame(), and request_frame().

static int filter_frame ( AVFilterLink link,
AVFrame frame 
)
static

Definition at line 318 of file vf_yadif.c.

Referenced by request_frame().

static int request_frame ( AVFilterLink link)
static

Definition at line 363 of file vf_yadif.c.

static int poll_frame ( AVFilterLink link)
static

Definition at line 399 of file vf_yadif.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 427 of file vf_yadif.c.

static int query_formats ( AVFilterContext ctx)
static

Definition at line 436 of file vf_yadif.c.

static int config_props ( AVFilterLink link)
static

Definition at line 466 of file vf_yadif.c.

Variable Documentation

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:490
NULL
Definition: eval.c:55
#define FLAGS
Definition: vf_yadif.c:491

Definition at line 492 of file vf_yadif.c.

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:492
LIBAVUTIL_VERSION_INT
Definition: eval.c:55
av_default_item_name
Definition: dnxhdenc.c:52

Definition at line 502 of file vf_yadif.c.

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:318
static AVFrame * get_video_buffer(AVFilterLink *link, int w, int h)
Definition: vf_yadif.c:260

Definition at line 509 of file vf_yadif.c.

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:363
static int config_props(AVFilterLink *link)
Definition: vf_yadif.c:466
static int poll_frame(AVFilterLink *link)
Definition: vf_yadif.c:399
NULL
Definition: eval.c:55

Definition at line 519 of file vf_yadif.c.

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:509
static const AVFilterPad outputs[]
Definition: af_ashowinfo.c:232
static const AVClass yadif_class
Definition: vf_yadif.c:502
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:436
static const AVFilterPad avfilter_vf_yadif_outputs[]
Definition: vf_yadif.c:519
static const AVFilterPad inputs[]
Definition: af_ashowinfo.c:221
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_yadif.c:427

Definition at line 530 of file vf_yadif.c.