FFmpeg
Data Structures | Macros | Functions | Variables
vf_yadif.c File Reference
#include "libavutil/avassert.h"
#include "libavutil/cpu.h"
#include "libavutil/common.h"
#include "libavutil/pixdesc.h"
#include "libavutil/imgutils.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "video.h"
#include "yadif.h"

Go to the source code of this file.

Data Structures

struct  ThreadData
 Used for passing data between threads. More...
 

Macros

#define CHECK(j)
 
#define FILTER(start, end, is_not_edge)
 
#define MAX_ALIGN   8
 

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 av_cold void uninit (AVFilterContext *ctx)
 
static int query_formats (AVFilterContext *ctx)
 
static int config_props (AVFilterLink *link)
 

Variables

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;\

Definition at line 41 of file vf_yadif.c.

◆ FILTER

#define FILTER (   start,
  end,
  is_not_edge 
)

Definition at line 52 of file vf_yadif.c.

◆ MAX_ALIGN

#define MAX_ALIGN   8

Definition at line 113 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 94 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 114 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 145 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 163 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 194 of file vf_yadif.c.

Referenced by filter().

◆ filter()

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

Definition at line 233 of file vf_yadif.c.

Referenced by config_props().

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 260 of file vf_yadif.c.

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 269 of file vf_yadif.c.

◆ config_props()

static int config_props ( AVFilterLink link)
static

Definition at line 318 of file vf_yadif.c.

Variable Documentation

◆ yadif_class

const AVClass yadif_class
static
Initial value:
= {
.class_name = "yadif",
.item_name = av_default_item_name,
.option = ff_yadif_options,
}

Definition at line 354 of file vf_yadif.c.

◆ avfilter_vf_yadif_inputs

const AVFilterPad avfilter_vf_yadif_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = ff_yadif_filter_frame,
},
{ NULL }
}

Definition at line 362 of file vf_yadif.c.

◆ avfilter_vf_yadif_outputs

const AVFilterPad avfilter_vf_yadif_outputs[]
static
Initial value:
= {
{
.name = "default",
.request_frame = ff_yadif_request_frame,
.config_props = config_props,
},
{ NULL }
}

Definition at line 371 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,
}

Definition at line 381 of file vf_yadif.c.

query_formats
static int query_formats(AVFilterContext *ctx)
Definition: vf_yadif.c:269
avfilter_vf_yadif_inputs
static const AVFilterPad avfilter_vf_yadif_inputs[]
Definition: vf_yadif.c:362
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_yadif.c:260
outputs
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
FFABS
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
Definition: common.h:72
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
NULL
#define NULL
Definition: coverity.c:32
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:191
inputs
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: filter_design.txt:243
AV_CLASS_CATEGORY_FILTER
@ AV_CLASS_CATEGORY_FILTER
Definition: log.h:37
ff_yadif_options
const AVOption ff_yadif_options[]
Definition: yadif_common.c:198
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:188
avfilter_vf_yadif_outputs
static const AVFilterPad avfilter_vf_yadif_outputs[]
Definition: vf_yadif.c:371
YADIFContext
Definition: yadif.h:50
ff_yadif_request_frame
int ff_yadif_request_frame(AVFilterLink *link)
Definition: yadif_common.c:159
AVFILTER_FLAG_SLICE_THREADS
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition: avfilter.h:116
config_props
static int config_props(AVFilterLink *link)
Definition: vf_yadif.c:318
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
yadif_class
static const AVClass yadif_class
Definition: vf_yadif.c:354
AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
#define AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
Same as AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, except that the filter will have its filter_frame() c...
Definition: avfilter.h:133
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:565
ff_yadif_filter_frame
int ff_yadif_filter_frame(AVFilterLink *link, AVFrame *frame)
Definition: yadif_common.c:92