FFmpeg
Data Structures | Macros | Functions | Variables
vf_mestimate.c File Reference
#include "motion_estimation.h"
#include "libavcodec/mathops.h"
#include "libavutil/avassert.h"
#include "libavutil/common.h"
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/motion_vector.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  MEContext
 Copyright (c) 2016 Davinder Singh (DSM_) <ds.mudhar<.com> More...
 

Macros

#define OFFSET(x)   offsetof(MEContext, x)
 
#define FLAGS   AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
#define CONST(name, help, val, unit)   { name, help, 0, AV_OPT_TYPE_CONST, {.i64=val}, 0, 0, FLAGS, unit }
 
#define SEARCH_MV(method)
 
#define ADD_PRED(preds, px, py)
 

Functions

 AVFILTER_DEFINE_CLASS (mestimate)
 
static int query_formats (AVFilterContext *ctx)
 
static int config_input (AVFilterLink *inlink)
 
static void add_mv_data (AVMotionVector *mv, int mb_size, int x, int y, int x_mv, int y_mv, int dir)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *frame)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const AVOption mestimate_options []
 
static const AVFilterPad mestimate_inputs []
 
static const AVFilterPad mestimate_outputs []
 
AVFilter ff_vf_mestimate
 

Macro Definition Documentation

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

Definition at line 49 of file vf_mestimate.c.

Definition at line 50 of file vf_mestimate.c.

#define CONST (   name,
  help,
  val,
  unit 
)    { name, help, 0, AV_OPT_TYPE_CONST, {.i64=val}, 0, 0, FLAGS, unit }

Definition at line 51 of file vf_mestimate.c.

#define SEARCH_MV (   method)
Value:
do {\
for (mb_y = 0; mb_y < s->b_height; mb_y++)\
for (mb_x = 0; mb_x < s->b_width; mb_x++) {\
const int x_mb = mb_x << s->log2_mb_size;\
const int y_mb = mb_y << s->log2_mb_size;\
int mv[2] = {x_mb, y_mb};\
ff_me_search_##method(me_ctx, x_mb, y_mb, mv);\
add_mv_data(((AVMotionVector *) sd->data) + mv_count++, me_ctx->mb_size, x_mb, y_mb, mv[0], mv[1], dir);\
}\
} while (0)
static void add_mv_data(AVMotionVector *mv, int mb_size, int x, int y, int x_mv, int y_mv, int dir)
Definition: vf_mestimate.c:114
#define s(width, name)
Definition: cbs_vp9.c:257
static const int8_t mv[256][2]
Definition: 4xm.c:77
int
for(j=16;j >0;--j)

Definition at line 127 of file vf_mestimate.c.

Referenced by filter_frame().

#define ADD_PRED (   preds,
  px,
  py 
)
Value:
do {\
preds.mvs[preds.nb][0] = px;\
preds.mvs[preds.nb][1] = py;\
preds.nb++;\
} while(0)

Definition at line 139 of file vf_mestimate.c.

Referenced by filter_frame().

Function Documentation

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

Definition at line 71 of file vf_mestimate.c.

static int config_input ( AVFilterLink inlink)
static

Definition at line 91 of file vf_mestimate.c.

static void add_mv_data ( AVMotionVector mv,
int  mb_size,
int  x,
int  y,
int  x_mv,
int  y_mv,
int  dir 
)
static

Definition at line 114 of file vf_mestimate.c.

Referenced by filter_frame().

static int filter_frame ( AVFilterLink inlink,
AVFrame frame 
)
static

Definition at line 146 of file vf_mestimate.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 337 of file vf_mestimate.c.

Variable Documentation

const AVOption mestimate_options[]
static
Initial value:
= {
{ "method", "motion estimation method", OFFSET(method), AV_OPT_TYPE_INT, {.i64 = AV_ME_METHOD_ESA}, AV_ME_METHOD_ESA, AV_ME_METHOD_UMH, FLAGS, "method" },
CONST("esa", "exhaustive search", AV_ME_METHOD_ESA, "method"),
CONST("tss", "three step search", AV_ME_METHOD_TSS, "method"),
CONST("tdls", "two dimensional logarithmic search", AV_ME_METHOD_TDLS, "method"),
CONST("ntss", "new three step search", AV_ME_METHOD_NTSS, "method"),
CONST("fss", "four step search", AV_ME_METHOD_FSS, "method"),
CONST("ds", "diamond search", AV_ME_METHOD_DS, "method"),
CONST("hexbs", "hexagon-based search", AV_ME_METHOD_HEXBS, "method"),
CONST("epzs", "enhanced predictive zonal search", AV_ME_METHOD_EPZS, "method"),
CONST("umh", "uneven multi-hexagon search", AV_ME_METHOD_UMH, "method"),
{ "mb_size", "macroblock size", OFFSET(mb_size), AV_OPT_TYPE_INT, {.i64 = 16}, 8, INT_MAX, FLAGS },
{ "search_param", "search parameter", OFFSET(search_param), AV_OPT_TYPE_INT, {.i64 = 7}, 4, INT_MAX, FLAGS },
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define AV_ME_METHOD_TDLS
#define AV_ME_METHOD_DS
#define AV_ME_METHOD_NTSS
#define AV_ME_METHOD_EPZS
#define CONST(name, help, val, unit)
Definition: vf_mestimate.c:51
#define AV_ME_METHOD_HEXBS
#define OFFSET(x)
Definition: vf_mestimate.c:49
#define AV_ME_METHOD_UMH
#define AV_ME_METHOD_TSS
#define AV_ME_METHOD_FSS
#define FLAGS
Definition: vf_mestimate.c:50
#define AV_ME_METHOD_ESA
Copyright (c) 2016 Davinder Singh (DSM_) <ds.mudhar<.com>

Definition at line 53 of file vf_mestimate.c.

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

Definition at line 350 of file vf_mestimate.c.

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

Definition at line 360 of file vf_mestimate.c.

AVFilter ff_vf_mestimate
Initial value:
= {
.name = "mestimate",
.description = NULL_IF_CONFIG_SMALL("Generate motion vectors."),
.priv_size = sizeof(MEContext),
.priv_class = &mestimate_class,
}
Copyright (c) 2016 Davinder Singh (DSM_) <ds.mudhar<.com>
Definition: vf_mestimate.c:34
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
static const AVFilterPad mestimate_inputs[]
Definition: vf_mestimate.c:350
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_mestimate.c:337
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
static int query_formats(AVFilterContext *ctx)
Definition: vf_mestimate.c:71
static const AVFilterPad mestimate_outputs[]
Definition: vf_mestimate.c:360

Definition at line 368 of file vf_mestimate.c.