FFmpeg
Loading...
Searching...
No Matches
vf_yadif.c File Reference
#include "libavutil/common.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "filters.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 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 FFFilter 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)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
Definition common.h:74

Definition at line 36 of file vf_yadif.c.

◆ FILTER

#define FILTER ( start,
end,
is_not_edge )

Definition at line 47 of file vf_yadif.c.

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

◆ MAX_ALIGN

#define MAX_ALIGN   8

Definition at line 108 of file vf_yadif.c.

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

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 89 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 109 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 140 of file vf_yadif.c.

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

◆ filter()

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

Definition at line 228 of file vf_yadif.c.

◆ config_output()

static int config_output ( AVFilterLink * outlink)
static

Definition at line 272 of file vf_yadif.c.

Variable Documentation

◆ pix_fmts

enum AVPixelFormat pix_fmts[]
static
Initial value:
= {
}
#define AV_PIX_FMT_YUV420P16
Definition pixfmt.h:556
#define AV_PIX_FMT_YUV444P12
Definition pixfmt.h:552
#define AV_PIX_FMT_YUV444P9
Definition pixfmt.h:544
#define AV_PIX_FMT_YUV420P10
Definition pixfmt.h:545
#define AV_PIX_FMT_GBRP9
Definition pixfmt.h:563
#define AV_PIX_FMT_YUV422P9
Definition pixfmt.h:543
#define AV_PIX_FMT_YUV420P12
Definition pixfmt.h:549
#define AV_PIX_FMT_YUV422P12
Definition pixfmt.h:550
#define AV_PIX_FMT_GBRP10
Definition pixfmt.h:564
#define AV_PIX_FMT_YUV422P10
Definition pixfmt.h:546
#define AV_PIX_FMT_GBRP12
Definition pixfmt.h:565
#define AV_PIX_FMT_YUV420P9
Definition pixfmt.h:542
#define AV_PIX_FMT_YUV420P14
Definition pixfmt.h:553
@ AV_PIX_FMT_NONE
Definition pixfmt.h:72
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition pixfmt.h:73
@ AV_PIX_FMT_YUV440P
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
Definition pixfmt.h:106
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition pixfmt.h:77
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
Definition pixfmt.h:81
@ AV_PIX_FMT_YUVA420P
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
Definition pixfmt.h:108
@ 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:107
@ AV_PIX_FMT_YUV410P
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
Definition pixfmt.h:79
@ AV_PIX_FMT_YUV411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
Definition pixfmt.h:80
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition pixfmt.h:78
@ AV_PIX_FMT_YUVA444P
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
Definition pixfmt.h:174
@ AV_PIX_FMT_GBRAP
planar GBRA 4:4:4:4 32bpp
Definition pixfmt.h:212
@ 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:86
@ AV_PIX_FMT_YUVA422P
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
Definition pixfmt.h:173
@ AV_PIX_FMT_GBRP
planar GBR 4:4:4 24bpp
Definition pixfmt.h:165
@ 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:87
@ 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:85
#define AV_PIX_FMT_YUV422P14
Definition pixfmt.h:554
#define AV_PIX_FMT_YUV422P16
Definition pixfmt.h:557
#define AV_PIX_FMT_GRAY16
Definition pixfmt.h:528
#define AV_PIX_FMT_GBRP16
Definition pixfmt.h:567
#define AV_PIX_FMT_YUV444P14
Definition pixfmt.h:555
#define AV_PIX_FMT_GBRP14
Definition pixfmt.h:566
#define AV_PIX_FMT_YUV444P16
Definition pixfmt.h:558
#define AV_PIX_FMT_YUV444P10
Definition pixfmt.h:548

Definition at line 254 of file vf_yadif.c.

◆ yadif_class

const AVClass yadif_class
static
Initial value:
= {
.class_name = "yadif",
.item_name = av_default_item_name,
.option = ff_yadif_options,
}
const char * av_default_item_name(void *ptr)
Return the context name.
Definition log.c:241
#define LIBAVUTIL_VERSION_INT
Definition version.h:85
@ AV_CLASS_CATEGORY_FILTER
Definition log.h:36
const AVOption ff_yadif_options[]

Definition at line 300 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,
},
}
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
int ff_yadif_filter_frame(AVFilterLink *link, AVFrame *frame)

Definition at line 308 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,
},
}
static int config_output(AVBitStreamFilterLink *outlink)
int ff_yadif_request_frame(AVFilterLink *link)

Definition at line 316 of file vf_yadif.c.

◆ ff_vf_yadif

const FFFilter ff_vf_yadif
Initial value:
= {
.p.name = "yadif",
.p.description = NULL_IF_CONFIG_SMALL("Deinterlace the input image."),
.p.priv_class = &yadif_class,
.priv_size = sizeof(YADIFContext),
}
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition avfilter.h:166
#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:204
static av_cold void uninit(AVBitStreamFilterContext *ctx)
#define FILTER_INPUTS(array)
Definition filters.h:264
#define FILTER_OUTPUTS(array)
Definition filters.h:265
#define FILTER_PIXFMTS_ARRAY(array)
Definition filters.h:244
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition internal.h:88
static enum AVPixelFormat pix_fmts[]
Definition libkvazaar.c:296
static const AVFilterPad avfilter_vf_yadif_outputs[]
Definition vf_yadif.c:316
static const AVFilterPad avfilter_vf_yadif_inputs[]
Definition vf_yadif.c:308
static const AVClass yadif_class
Definition vf_yadif.c:300
void ff_yadif_uninit(AVFilterContext *ctx)

Definition at line 325 of file vf_yadif.c.