vf_yadif.c File Reference
#include "libavutil/avassert.h"
#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>
Include dependency graph for vf_yadif.c:

Go to the source code of this file.

Macros

#define CHECK(j)
 
#define FILTER(start, end, is_not_edge)
 
#define OFFSET(x)   offsetof(YADIFContext, x)
 
#define FLAGS   AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
#define CONST(name, help, val, unit)   { name, help, 0, AV_OPT_TYPE_CONST, {.i64=val}, INT_MIN, INT_MAX, FLAGS, unit }
 

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 void filter (AVFilterContext *ctx, AVFrame *dstpic, int parity, int tff)
 
static int return_frame (AVFilterContext *ctx, int is_second)
 
static int filter_frame (AVFilterLink *link, AVFrame *frame)
 
static int request_frame (AVFilterLink *link)
 
static av_cold void uninit (AVFilterContext *ctx)
 
static int query_formats (AVFilterContext *ctx)
 
static int config_props (AVFilterLink *link)
 
 AVFILTER_DEFINE_CLASS (yadif)
 

Variables

static const AVOption yadif_options []
 
static const AVFilterPad avfilter_vf_yadif_inputs []
 
static const AVFilterPad avfilter_vf_yadif_outputs []
 
AVFilter avfilter_vf_yadif
 

Macro Definition Documentation

#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;\
initialize output if(nPeaks >3)%at least 3 peaks in spectrum for trying to find f0 nf0peaks
#define FFABS(a)
Definition: common.h:53

Definition at line 34 of file vf_yadif.c.

#define CONST (   name,
  help,
  val,
  unit 
)    { name, help, 0, AV_OPT_TYPE_CONST, {.i64=val}, INT_MIN, INT_MAX, FLAGS, unit }

Definition at line 434 of file vf_yadif.c.

#define FILTER (   start,
  end,
  is_not_edge 
)

Definition at line 45 of file vf_yadif.c.

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

Definition at line 432 of file vf_yadif.c.

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

Definition at line 431 of file vf_yadif.c.

Function Documentation

AVFILTER_DEFINE_CLASS ( yadif  )
static int config_props ( AVFilterLink link)
static

Definition at line 397 of file vf_yadif.c.

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

Definition at line 175 of file vf_yadif.c.

Referenced by return_frame().

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

Referenced by config_props().

static int filter_frame ( AVFilterLink link,
AVFrame frame 
)
static

Definition at line 264 of file vf_yadif.c.

Referenced by request_frame().

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

Referenced by config_props().

static int query_formats ( AVFilterContext ctx)
static

Definition at line 356 of file vf_yadif.c.

static int request_frame ( AVFilterLink link)
static

Definition at line 311 of file vf_yadif.c.

static int return_frame ( AVFilterContext ctx,
int  is_second 
)
static

Definition at line 224 of file vf_yadif.c.

Referenced by filter_frame(), and request_frame().

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 347 of file vf_yadif.c.

Variable Documentation

AVFilter avfilter_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:457
static const AVFilterPad outputs[]
Definition: af_ashowinfo.c:117
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static int query_formats(AVFilterContext *ctx)
Definition: vf_yadif.c:356
static const AVFilterPad avfilter_vf_yadif_outputs[]
Definition: vf_yadif.c:466
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_yadif.c:347
struct YADIFContext YADIFContext
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several inputs

Definition at line 476 of file vf_yadif.c.

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

Definition at line 457 of file vf_yadif.c.

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

Definition at line 466 of file vf_yadif.c.

const AVOption yadif_options[]
static
Initial value:
= {
{ "mode", "specify the interlacing mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=YADIF_MODE_SEND_FRAME}, 0, 3, FLAGS, "mode"},
CONST("send_frame", "send one frame for each frame", YADIF_MODE_SEND_FRAME, "mode"),
CONST("send_field", "send one frame for each field", YADIF_MODE_SEND_FIELD, "mode"),
CONST("send_frame_nospatial", "send one frame for each frame, but skip spatial interlacing check", YADIF_MODE_SEND_FRAME_NOSPATIAL, "mode"),
CONST("send_field_nospatial", "send one frame for each field, but skip spatial interlacing check", YADIF_MODE_SEND_FIELD_NOSPATIAL, "mode"),
{ "parity", "specify the assumed picture field parity", OFFSET(parity), AV_OPT_TYPE_INT, {.i64=YADIF_PARITY_AUTO}, -1, 1, FLAGS, "parity" },
CONST("tff", "assume top field first", YADIF_PARITY_TFF, "parity"),
CONST("bff", "assume bottom field first", YADIF_PARITY_BFF, "parity"),
CONST("auto", "auto detect parity", YADIF_PARITY_AUTO, "parity"),
{ "deint", "specify which frames to deinterlace", OFFSET(deint), AV_OPT_TYPE_INT, {.i64=YADIF_DEINT_ALL}, 0, 1, FLAGS, "deint" },
CONST("all", "deinterlace all frames", YADIF_DEINT_ALL, "deint"),
CONST("interlaced", "only deinterlace frames marked as interlaced", YADIF_DEINT_INTERLACED, "deint"),
{NULL},
}
send 1 frame for each frame but skips spatial interlacing check
Definition: yadif.h:28
mode
Definition: f_perms.c:27
bottom field first
Definition: yadif.h:34
send 1 frame for each field
Definition: yadif.h:27
auto detection
Definition: yadif.h:35
#define OFFSET(x)
Definition: vf_yadif.c:431
NULL
Definition: eval.c:55
send 1 frame for each field but skips spatial interlacing check
Definition: yadif.h:29
#define FLAGS
Definition: vf_yadif.c:432
deinterlace all frames
Definition: yadif.h:39
send 1 frame for each frame
Definition: yadif.h:26
#define CONST(name, help, val, unit)
Definition: vf_yadif.c:434
p parity
Definition: vf_mcdeint.c:178
only deinterlace frames marked as interlaced
Definition: yadif.h:40
top field first
Definition: yadif.h:33

Definition at line 436 of file vf_yadif.c.