FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
vf_mpdecimate.c File Reference
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/pixelutils.h"
#include "libavutil/timestamp.h"
#include "avfilter.h"
#include "internal.h"
#include "formats.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  DecimateContext
 

Macros

#define OFFSET(x)   offsetof(DecimateContext, x)
 
#define FLAGS   AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 

Functions

 AVFILTER_DEFINE_CLASS (mpdecimate)
 
static int diff_planes (AVFilterContext *ctx, uint8_t *cur, int cur_linesize, uint8_t *ref, int ref_linesize, int w, int h)
 Return 1 if the two planes are different, 0 otherwise. More...
 
static int decimate_frame (AVFilterContext *ctx, AVFrame *cur, AVFrame *ref)
 Tell if the frame should be decimated, for example if it is no much different with respect to the reference frame ref. More...
 
static av_cold int init (AVFilterContext *ctx)
 
static av_cold void uninit (AVFilterContext *ctx)
 
static int query_formats (AVFilterContext *ctx)
 
static int config_input (AVFilterLink *inlink)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *cur)
 

Variables

static const AVOption mpdecimate_options []
 
static const AVFilterPad mpdecimate_inputs []
 
static const AVFilterPad mpdecimate_outputs []
 
AVFilter ff_vf_mpdecimate
 

Macro Definition Documentation

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

Definition at line 54 of file vf_mpdecimate.c.

Definition at line 55 of file vf_mpdecimate.c.

Function Documentation

AVFILTER_DEFINE_CLASS ( mpdecimate  )
static int diff_planes ( AVFilterContext ctx,
uint8_t cur,
int  cur_linesize,
uint8_t ref,
int  ref_linesize,
int  w,
int  h 
)
static

Return 1 if the two planes are different, 0 otherwise.

Definition at line 71 of file vf_mpdecimate.c.

Referenced by decimate_frame().

static int decimate_frame ( AVFilterContext ctx,
AVFrame cur,
AVFrame ref 
)
static

Tell if the frame should be decimated, for example if it is no much different with respect to the reference frame ref.

Definition at line 109 of file vf_mpdecimate.c.

Referenced by filter_frame().

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 144 of file vf_mpdecimate.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 158 of file vf_mpdecimate.c.

static int query_formats ( AVFilterContext ctx)
static

Definition at line 164 of file vf_mpdecimate.c.

static int config_input ( AVFilterLink inlink)
static

Definition at line 187 of file vf_mpdecimate.c.

static int filter_frame ( AVFilterLink inlink,
AVFrame cur 
)
static

Definition at line 198 of file vf_mpdecimate.c.

Variable Documentation

const AVOption mpdecimate_options[]
static
Initial value:
= {
{ "max", "set the maximum number of consecutive dropped frames (positive), or the minimum interval between dropped frames (negative)",
OFFSET(max_drop_count), AV_OPT_TYPE_INT, {.i64=0}, INT_MIN, INT_MAX, FLAGS },
{ "hi", "set high dropping threshold", OFFSET(hi), AV_OPT_TYPE_INT, {.i64=64*12}, INT_MIN, INT_MAX, FLAGS },
{ "lo", "set low dropping threshold", OFFSET(lo), AV_OPT_TYPE_INT, {.i64=64*5}, INT_MIN, INT_MAX, FLAGS },
{ "frac", "set fraction dropping threshold", OFFSET(frac), AV_OPT_TYPE_FLOAT, {.dbl=0.33}, 0, 1, FLAGS },
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define OFFSET(x)
Definition: vf_mpdecimate.c:54
#define FLAGS
Definition: vf_mpdecimate.c:55

Definition at line 57 of file vf_mpdecimate.c.

const AVFilterPad mpdecimate_inputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_input,
.filter_frame = filter_frame,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int filter_frame(AVFilterLink *inlink, AVFrame *cur)
static int config_input(AVFilterLink *inlink)

Definition at line 227 of file vf_mpdecimate.c.

const AVFilterPad mpdecimate_outputs[]
static
Initial value:
= {
{
.name = "default",
},
{ NULL }
}
#define NULL
Definition: coverity.c:32

Definition at line 237 of file vf_mpdecimate.c.

AVFilter ff_vf_mpdecimate
Initial value:
= {
.name = "mpdecimate",
.description = NULL_IF_CONFIG_SMALL("Remove near-duplicate frames."),
.init = init,
.uninit = uninit,
.priv_size = sizeof(DecimateContext),
.priv_class = &mpdecimate_class,
}
static const AVFilterPad mpdecimate_inputs[]
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:176
static const AVFilterPad outputs[]
Definition: af_afftfilt.c:386
static av_cold void uninit(AVFilterContext *ctx)
static const AVFilterPad inputs[]
Definition: af_afftfilt.c:376
static int query_formats(AVFilterContext *ctx)
static const AVFilterPad mpdecimate_outputs[]
static av_cold int init(AVFilterContext *ctx)

Definition at line 245 of file vf_mpdecimate.c.