FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
vf_tinterlace.c File Reference

temporal field interlace filter, ported from MPlayer/libmpcodecs More...

#include "libavutil/opt.h"
#include "libavutil/imgutils.h"
#include "libavutil/avassert.h"
#include "avfilter.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  TInterlaceContext
 

Macros

#define OFFSET(x)   offsetof(TInterlaceContext, x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
 
#define TINTERLACE_FLAG_VLPF   01
 
#define FULL_SCALE_YUVJ_FORMATS   AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P
 
#define FIELD_UPPER   0
 
#define FIELD_LOWER   1
 
#define FIELD_UPPER_AND_LOWER   2
 

Enumerations

enum  TInterlaceMode {
  MODE_MERGE = 0, MODE_DROP_EVEN, MODE_DROP_ODD, MODE_PAD,
  MODE_INTERLEAVE_TOP, MODE_INTERLEAVE_BOTTOM, MODE_INTERLACEX2, MODE_NB
}
 

Functions

 AVFILTER_DEFINE_CLASS (tinterlace)
 
static int query_formats (AVFilterContext *ctx)
 
static av_cold void uninit (AVFilterContext *ctx)
 
static int config_out_props (AVFilterLink *outlink)
 
static void copy_picture_field (uint8_t *dst[4], int dst_linesize[4], const uint8_t *src[4], int src_linesize[4], enum AVPixelFormat format, int w, int src_h, int src_field, int interleave, int dst_field, int flags)
 Copy picture field from src to dst.
 
static int filter_frame (AVFilterLink *inlink, AVFrame *picref)
 

Variables

static const AVOption tinterlace_options []
 
static enum AVPixelFormat full_scale_yuvj_pix_fmts []
 
static const AVFilterPad tinterlace_inputs []
 
static const AVFilterPad tinterlace_outputs []
 
AVFilter ff_vf_tinterlace
 

Detailed Description

temporal field interlace filter, ported from MPlayer/libmpcodecs

Definition in file vf_tinterlace.c.

Macro Definition Documentation

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

Definition at line 57 of file vf_tinterlace.c.

Definition at line 58 of file vf_tinterlace.c.

#define TINTERLACE_FLAG_VLPF   01

Definition at line 59 of file vf_tinterlace.c.

Referenced by config_out_props(), and copy_picture_field().

Definition at line 80 of file vf_tinterlace.c.

Referenced by query_formats().

#define FIELD_UPPER   0

Definition at line 161 of file vf_tinterlace.c.

Referenced by copy_picture_field(), and filter_frame().

#define FIELD_LOWER   1

Definition at line 162 of file vf_tinterlace.c.

Referenced by copy_picture_field(), and filter_frame().

#define FIELD_UPPER_AND_LOWER   2

Definition at line 163 of file vf_tinterlace.c.

Referenced by copy_picture_field(), and filter_frame().

Enumeration Type Documentation

Enumerator:
MODE_MERGE 
MODE_DROP_EVEN 
MODE_DROP_ODD 
MODE_PAD 
MODE_INTERLEAVE_TOP 
MODE_INTERLEAVE_BOTTOM 
MODE_INTERLACEX2 
MODE_NB 

Definition at line 34 of file vf_tinterlace.c.

Function Documentation

AVFILTER_DEFINE_CLASS ( tinterlace  )
static int query_formats ( AVFilterContext ctx)
static

Definition at line 87 of file vf_tinterlace.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 102 of file vf_tinterlace.c.

static int config_out_props ( AVFilterLink outlink)
static

Definition at line 111 of file vf_tinterlace.c.

static void copy_picture_field ( uint8_t dst[4],
int  dst_linesize[4],
const uint8_t src[4],
int  src_linesize[4],
enum AVPixelFormat  format,
int  w,
int  src_h,
int  src_field,
int  interleave,
int  dst_field,
int  flags 
)
inlinestatic

Copy picture field from src to dst.

Parameters
src_fieldcopy from upper, lower field or both
interleaveleave a padding line between each copied line
dst_fieldcopy to upper or lower field, only meaningful when interleave is selected
flagscontext flags

Definition at line 175 of file vf_tinterlace.c.

Referenced by filter_frame().

static int filter_frame ( AVFilterLink inlink,
AVFrame picref 
)
static

Definition at line 227 of file vf_tinterlace.c.

Variable Documentation

const AVOption tinterlace_options[]
static
Initial value:
= {
{"mode", "select interlace mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=MODE_MERGE}, 0, MODE_NB-1, FLAGS, "mode"},
{"merge", "merge fields", 0, AV_OPT_TYPE_CONST, {.i64=MODE_MERGE}, INT_MIN, INT_MAX, FLAGS, "mode"},
{"drop_even", "drop even fields", 0, AV_OPT_TYPE_CONST, {.i64=MODE_DROP_EVEN}, INT_MIN, INT_MAX, FLAGS, "mode"},
{"drop_odd", "drop odd fields", 0, AV_OPT_TYPE_CONST, {.i64=MODE_DROP_ODD}, INT_MIN, INT_MAX, FLAGS, "mode"},
{"pad", "pad alternate lines with black", 0, AV_OPT_TYPE_CONST, {.i64=MODE_PAD}, INT_MIN, INT_MAX, FLAGS, "mode"},
{"interleave_top", "interleave top and bottom fields", 0, AV_OPT_TYPE_CONST, {.i64=MODE_INTERLEAVE_TOP}, INT_MIN, INT_MAX, FLAGS, "mode"},
{"interleave_bottom", "interleave bottom and top fields", 0, AV_OPT_TYPE_CONST, {.i64=MODE_INTERLEAVE_BOTTOM}, INT_MIN, INT_MAX, FLAGS, "mode"},
{"interlacex2", "interlace fields from two consecutive frames", 0, AV_OPT_TYPE_CONST, {.i64=MODE_INTERLACEX2}, INT_MIN, INT_MAX, FLAGS, "mode"},
{"flags", "set flags", OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64 = 0}, 0, INT_MAX, 0, "flags" },
{"low_pass_filter", "enable vertical low-pass filter", 0, AV_OPT_TYPE_CONST, {.i64 = TINTERLACE_FLAG_VLPF}, INT_MIN, INT_MAX, FLAGS, "flags" },
{"vlpf", "enable vertical low-pass filter", 0, AV_OPT_TYPE_CONST, {.i64 = TINTERLACE_FLAG_VLPF}, INT_MIN, INT_MAX, FLAGS, "flags" },
{NULL}
}

Definition at line 61 of file vf_tinterlace.c.

enum AVPixelFormat full_scale_yuvj_pix_fmts[]
static
Initial value:

Definition at line 83 of file vf_tinterlace.c.

Referenced by config_out_props().

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

Definition at line 371 of file vf_tinterlace.c.

const AVFilterPad tinterlace_outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_out_props,
},
{ NULL }
}

Definition at line 380 of file vf_tinterlace.c.

AVFilter ff_vf_tinterlace
Initial value:
= {
.name = "tinterlace",
.description = NULL_IF_CONFIG_SMALL("Perform temporal field interlacing."),
.priv_size = sizeof(TInterlaceContext),
.priv_class = &tinterlace_class,
}

Definition at line 389 of file vf_tinterlace.c.