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"
Include dependency graph for vf_tinterlace.c:

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. More...
 
static int filter_frame (AVFilterLink *inlink, AVFrame *picref)
 
static int request_frame (AVFilterLink *outlink)
 

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 avfilter_vf_tinterlace
 

Detailed Description

temporal field interlace filter, ported from MPlayer/libmpcodecs

Definition in file vf_tinterlace.c.

Macro Definition Documentation

#define FIELD_LOWER   1

Definition at line 153 of file vf_tinterlace.c.

Referenced by copy_picture_field(), and filter_frame().

#define FIELD_UPPER   0

Definition at line 152 of file vf_tinterlace.c.

Referenced by filter_frame().

#define FIELD_UPPER_AND_LOWER   2

Definition at line 154 of file vf_tinterlace.c.

Referenced by copy_picture_field(), and filter_frame().

Definition at line 58 of file vf_tinterlace.c.

Definition at line 80 of file vf_tinterlace.c.

Referenced by query_formats().

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

Definition at line 57 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().

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 config_out_props ( AVFilterLink outlink)
static

Definition at line 109 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 166 of file vf_tinterlace.c.

Referenced by filter_frame().

static int filter_frame ( AVFilterLink inlink,
AVFrame picref 
)
static

Definition at line 218 of file vf_tinterlace.c.

static int query_formats ( AVFilterContext ctx)
static

Definition at line 87 of file vf_tinterlace.c.

static int request_frame ( AVFilterLink outlink)
static

Definition at line 354 of file vf_tinterlace.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 100 of file vf_tinterlace.c.

Variable Documentation

AVFilter avfilter_vf_tinterlace
Initial value:
= {
.name = "tinterlace",
.description = NULL_IF_CONFIG_SMALL("Perform temporal field interlacing."),
.priv_size = sizeof(TInterlaceContext),
.priv_class = &tinterlace_class,
}
static int query_formats(AVFilterContext *ctx)
Definition: vf_tinterlace.c:87
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 av_cold void uninit(AVFilterContext *ctx)
static const AVFilterPad tinterlace_outputs[]
static const AVFilterPad tinterlace_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 at line 388 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 }
}
static int filter_frame(AVFilterLink *inlink, AVFrame *picref)
NULL
Definition: eval.c:55

Definition at line 369 of file vf_tinterlace.c.

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}
}
#define OFFSET(x)
Definition: vf_tinterlace.c:57
mode
Definition: f_perms.c:27
#define FLAGS
Definition: vf_tinterlace.c:58
NULL
Definition: eval.c:55
static int flags
Definition: cpu.c:23
#define TINTERLACE_FLAG_VLPF
Definition: vf_tinterlace.c:59

Definition at line 61 of file vf_tinterlace.c.

const AVFilterPad tinterlace_outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_out_props,
.request_frame = request_frame,
},
{ NULL }
}
static int request_frame(AVFilterLink *outlink)
NULL
Definition: eval.c:55
static int config_out_props(AVFilterLink *outlink)

Definition at line 378 of file vf_tinterlace.c.