FFmpeg
Data Structures | Macros | Functions | Variables
vf_yadif.c File Reference
#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 config_output (AVFilterLink *outlink)
 

Variables

static enum AVPixelFormat pix_fmts []
 
static const AVClass yadif_class
 
static const AVFilterPad avfilter_vf_yadif_inputs []
 
static const AVFilterPad avfilter_vf_yadif_outputs []
 
const 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 39 of file vf_yadif.c.

◆ FILTER

#define FILTER (   start,
  end,
  is_not_edge 
)

Definition at line 50 of file vf_yadif.c.

◆ MAX_ALIGN

#define MAX_ALIGN   8

Definition at line 111 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 92 of file vf_yadif.c.

Referenced by config_output().

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

Referenced by config_output().

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

Referenced by config_output().

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

Referenced by config_output().

◆ filter_slice()

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

Definition at line 192 of file vf_yadif.c.

Referenced by filter().

◆ filter()

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

Definition at line 231 of file vf_yadif.c.

Referenced by config_output().

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 259 of file vf_yadif.c.

◆ config_output()

static int config_output ( AVFilterLink outlink)
static

Definition at line 286 of file vf_yadif.c.

Variable Documentation

◆ pix_fmts

enum AVPixelFormat pix_fmts[]
static

◆ 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 322 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,
},
}

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

Definition at line 338 of file vf_yadif.c.

◆ ff_vf_yadif

const AVFilter ff_vf_yadif
Initial value:

Definition at line 347 of file vf_yadif.c.

FILTER_PIXFMTS_ARRAY
#define FILTER_PIXFMTS_ARRAY(array)
Definition: internal.h:170
AV_PIX_FMT_YUV420P10
#define AV_PIX_FMT_YUV420P10
Definition: pixfmt.h:406
AV_PIX_FMT_YUV440P
@ AV_PIX_FMT_YUV440P
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
Definition: pixfmt.h:99
AV_PIX_FMT_GBRP14
#define AV_PIX_FMT_GBRP14
Definition: pixfmt.h:424
AV_PIX_FMT_GBRAP
@ AV_PIX_FMT_GBRAP
planar GBRA 4:4:4:4 32bpp
Definition: pixfmt.h:205
AV_PIX_FMT_GBRP10
#define AV_PIX_FMT_GBRP10
Definition: pixfmt.h:422
AV_PIX_FMT_YUV422P9
#define AV_PIX_FMT_YUV422P9
Definition: pixfmt.h:404
AV_PIX_FMT_GRAY16
#define AV_PIX_FMT_GRAY16
Definition: pixfmt.h:390
pix_fmts
static enum AVPixelFormat pix_fmts[]
Definition: vf_yadif.c:268
AV_PIX_FMT_YUV444P10
#define AV_PIX_FMT_YUV444P10
Definition: pixfmt.h:409
avfilter_vf_yadif_inputs
static const AVFilterPad avfilter_vf_yadif_inputs[]
Definition: vf_yadif.c:330
AV_PIX_FMT_YUV422P16
#define AV_PIX_FMT_YUV422P16
Definition: pixfmt.h:418
AV_PIX_FMT_YUVJ422P
@ AV_PIX_FMT_YUVJ422P
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
Definition: pixfmt.h:79
AV_PIX_FMT_YUVA420P
@ AV_PIX_FMT_YUVA420P
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
Definition: pixfmt.h:101
AV_PIX_FMT_YUV444P16
#define AV_PIX_FMT_YUV444P16
Definition: pixfmt.h:419
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_yadif.c:259
AV_PIX_FMT_YUV420P9
#define AV_PIX_FMT_YUV420P9
Definition: pixfmt.h:403
AV_PIX_FMT_YUV420P16
#define AV_PIX_FMT_YUV420P16
Definition: pixfmt.h:417
AV_PIX_FMT_YUV420P
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:66
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:190
AV_PIX_FMT_YUVJ444P
@ AV_PIX_FMT_YUVJ444P
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
Definition: pixfmt.h:80
FFABS
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
Definition: common.h:64
AV_PIX_FMT_GBRP16
#define AV_PIX_FMT_GBRP16
Definition: pixfmt.h:425
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
AV_PIX_FMT_YUVJ420P
@ AV_PIX_FMT_YUVJ420P
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
Definition: pixfmt.h:78
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:237
AV_PIX_FMT_YUV422P10
#define AV_PIX_FMT_YUV422P10
Definition: pixfmt.h:407
AV_PIX_FMT_GRAY8
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
Definition: pixfmt.h:74
AV_PIX_FMT_GBRP9
#define AV_PIX_FMT_GBRP9
Definition: pixfmt.h:421
AV_CLASS_CATEGORY_FILTER
@ AV_CLASS_CATEGORY_FILTER
Definition: log.h:36
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:117
config_output
static int config_output(AVFilterLink *outlink)
Definition: vf_yadif.c:286
AV_PIX_FMT_YUV422P12
#define AV_PIX_FMT_YUV422P12
Definition: pixfmt.h:411
avfilter_vf_yadif_outputs
static const AVFilterPad avfilter_vf_yadif_outputs[]
Definition: vf_yadif.c:338
AV_PIX_FMT_YUV444P12
#define AV_PIX_FMT_YUV444P12
Definition: pixfmt.h:413
AV_PIX_FMT_YUVA444P
@ AV_PIX_FMT_YUVA444P
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
Definition: pixfmt.h:167
AV_PIX_FMT_GBRP12
#define AV_PIX_FMT_GBRP12
Definition: pixfmt.h:423
YADIFContext
Definition: yadif.h:50
AV_PIX_FMT_YUVJ440P
@ AV_PIX_FMT_YUVJ440P
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range
Definition: pixfmt.h:100
AV_PIX_FMT_YUV444P9
#define AV_PIX_FMT_YUV444P9
Definition: pixfmt.h:405
AV_PIX_FMT_YUV420P12
#define AV_PIX_FMT_YUV420P12
Definition: pixfmt.h:410
AV_PIX_FMT_YUV422P14
#define AV_PIX_FMT_YUV422P14
Definition: pixfmt.h:415
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:65
ff_yadif_request_frame
int ff_yadif_request_frame(AVFilterLink *link)
Definition: yadif_common.c:159
AV_PIX_FMT_YUV444P
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:71
AV_PIX_FMT_GBRP
@ AV_PIX_FMT_GBRP
planar GBR 4:4:4 24bpp
Definition: pixfmt.h:158
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:127
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AV_PIX_FMT_YUV422P
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:70
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:191
AV_PIX_FMT_YUV411P
@ AV_PIX_FMT_YUV411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
Definition: pixfmt.h:73
yadif_class
static const AVClass yadif_class
Definition: vf_yadif.c:322
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:160
AV_PIX_FMT_YUV410P
@ AV_PIX_FMT_YUV410P
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
Definition: pixfmt.h:72
AV_PIX_FMT_YUV444P14
#define AV_PIX_FMT_YUV444P14
Definition: pixfmt.h:416
AV_PIX_FMT_YUVA422P
@ AV_PIX_FMT_YUVA422P
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
Definition: pixfmt.h:166
ff_yadif_filter_frame
int ff_yadif_filter_frame(AVFilterLink *link, AVFrame *frame)
Definition: yadif_common.c:92
AV_PIX_FMT_YUV420P14
#define AV_PIX_FMT_YUV420P14
Definition: pixfmt.h:414