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

Go to the source code of this file.

Data Structures

struct  qitem
 
struct  DecimateContext
 

Macros

#define INPUT_MAIN   0
 
#define INPUT_CLEANSRC   1
 
#define OFFSET(x)   offsetof(DecimateContext, x)
 
#define FLAGS   AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
#define CALC_DIFF(nbits)
 
#define PF_NOALPHA(suf)   AV_PIX_FMT_YUV420##suf, AV_PIX_FMT_YUV422##suf, AV_PIX_FMT_YUV444##suf
 
#define PF_ALPHA(suf)   AV_PIX_FMT_YUVA420##suf, AV_PIX_FMT_YUVA422##suf, AV_PIX_FMT_YUVA444##suf
 
#define PF(suf)   PF_NOALPHA(suf), PF_ALPHA(suf)
 

Functions

 AVFILTER_DEFINE_CLASS (decimate)
 
static void calc_diffs (const DecimateContext *dm, struct qitem *q, const AVFrame *f1, const AVFrame *f2)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static int config_input (AVFilterLink *inlink)
 
static av_cold int decimate_init (AVFilterContext *ctx)
 
static av_cold void decimate_uninit (AVFilterContext *ctx)
 
static int request_inlink (AVFilterContext *ctx, int lid)
 
static int request_frame (AVFilterLink *outlink)
 
static int query_formats (AVFilterContext *ctx)
 
static int config_output (AVFilterLink *outlink)
 

Variables

static const AVOption decimate_options []
 
static const AVFilterPad decimate_outputs []
 
AVFilter ff_vf_decimate
 

Macro Definition Documentation

#define INPUT_MAIN   0

Definition at line 28 of file vf_decimate.c.

Referenced by config_output(), decimate_init(), filter_frame(), and request_frame().

#define INPUT_CLEANSRC   1

Definition at line 29 of file vf_decimate.c.

Referenced by config_output(), decimate_init(), filter_frame(), and request_frame().

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

Definition at line 65 of file vf_decimate.c.

Definition at line 66 of file vf_decimate.c.

#define CALC_DIFF (   nbits)
Value:
do { \
for (x = 0; x < width; x += hblockx) { \
int64_t acc = 0; \
int m = FFMIN(width, x + hblockx); \
for (xl = x; xl < m; xl++) \
acc += abs(((const uint##nbits##_t *)f1p)[xl] - \
((const uint##nbits##_t *)f2p)[xl]); \
bdiffs[ydest * dm->nxblocks + xdest] += acc; \
xdest++; \
} \
} while (0)
int acc
Definition: yuv2rgb.c:543
unsigned m
Definition: audioconvert.c:187
#define FFMIN(a, b)
Definition: common.h:96
for(j=16;j >0;--j)
static int width

Referenced by calc_diffs().

#define PF_NOALPHA (   suf)    AV_PIX_FMT_YUV420##suf, AV_PIX_FMT_YUV422##suf, AV_PIX_FMT_YUV444##suf

Referenced by query_formats().

#define PF_ALPHA (   suf)    AV_PIX_FMT_YUVA420##suf, AV_PIX_FMT_YUVA422##suf, AV_PIX_FMT_YUVA444##suf
#define PF (   suf)    PF_NOALPHA(suf), PF_ALPHA(suf)

Referenced by query_formats(), and xbr_filter().

Function Documentation

AVFILTER_DEFINE_CLASS ( decimate  )
static void calc_diffs ( const DecimateContext dm,
struct qitem q,
const AVFrame f1,
const AVFrame f2 
)
static

Definition at line 81 of file vf_decimate.c.

Referenced by filter_frame().

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 146 of file vf_decimate.c.

Referenced by decimate_init(), and request_inlink().

static int config_input ( AVFilterLink inlink)
static

Definition at line 234 of file vf_decimate.c.

Referenced by decimate_init().

static av_cold int decimate_init ( AVFilterContext ctx)
static

Definition at line 267 of file vf_decimate.c.

static av_cold void decimate_uninit ( AVFilterContext ctx)
static

Definition at line 300 of file vf_decimate.c.

static int request_inlink ( AVFilterContext ctx,
int  lid 
)
static

Definition at line 313 of file vf_decimate.c.

Referenced by request_frame().

static int request_frame ( AVFilterLink outlink)
static

Definition at line 329 of file vf_decimate.c.

static int query_formats ( AVFilterContext ctx)
static

Definition at line 345 of file vf_decimate.c.

static int config_output ( AVFilterLink outlink)
static

Definition at line 362 of file vf_decimate.c.

Variable Documentation

const AVOption decimate_options[]
static
Initial value:
= {
{ "cycle", "set the number of frame from which one will be dropped", OFFSET(cycle), AV_OPT_TYPE_INT, {.i64 = 5}, 2, 25, FLAGS },
{ "dupthresh", "set duplicate threshold", OFFSET(dupthresh_flt), AV_OPT_TYPE_DOUBLE, {.dbl = 1.1}, 0, 100, FLAGS },
{ "scthresh", "set scene change threshold", OFFSET(scthresh_flt), AV_OPT_TYPE_DOUBLE, {.dbl = 15.0}, 0, 100, FLAGS },
{ "blockx", "set the size of the x-axis blocks used during metric calculations", OFFSET(blockx), AV_OPT_TYPE_INT, {.i64 = 32}, 4, 1<<9, FLAGS },
{ "blocky", "set the size of the y-axis blocks used during metric calculations", OFFSET(blocky), AV_OPT_TYPE_INT, {.i64 = 32}, 4, 1<<9, FLAGS },
{ "ppsrc", "mark main input as a pre-processed input and activate clean source input stream", OFFSET(ppsrc), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS },
{ "chroma", "set whether or not chroma is considered in the metric calculations", OFFSET(chroma), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1, FLAGS },
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define OFFSET(x)
Definition: vf_decimate.c:65
#define FLAGS
Definition: vf_decimate.c:66
static void chroma(WaveformContext *s, AVFrame *in, AVFrame *out, int component, int intensity, int offset, int column)
Definition: vf_waveform.c:740

Definition at line 68 of file vf_decimate.c.

const AVFilterPad decimate_outputs[]
static
Initial value:
= {
{
.name = "default",
.request_frame = request_frame,
.config_props = config_output,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int request_frame(AVFilterLink *outlink)
Definition: vf_decimate.c:329
static int config_output(AVFilterLink *outlink)
Definition: vf_decimate.c:362

Definition at line 396 of file vf_decimate.c.

AVFilter ff_vf_decimate
Initial value:
= {
.name = "decimate",
.description = NULL_IF_CONFIG_SMALL("Decimate frames (post field matching filter)."),
.init = decimate_init,
.uninit = decimate_uninit,
.priv_size = sizeof(DecimateContext),
.priv_class = &decimate_class,
}
static const AVFilterPad decimate_outputs[]
Definition: vf_decimate.c:396
#define AVFILTER_FLAG_DYNAMIC_INPUTS
The number of the filter inputs is not determined just by AVFilter.inputs.
Definition: avfilter.h:102
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:176
static av_cold void decimate_uninit(AVFilterContext *ctx)
Definition: vf_decimate.c:300
static const AVFilterPad outputs[]
Definition: af_afftfilt.c:385
static av_cold int decimate_init(AVFilterContext *ctx)
Definition: vf_decimate.c:267
static int flags
Definition: cpu.c:47
static int query_formats(AVFilterContext *ctx)
Definition: vf_decimate.c:345

Definition at line 406 of file vf_decimate.c.