FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
vf_find_rect.c File Reference
#include "libavutil/avassert.h"
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "internal.h"
#include "lavfutils.h"

Go to the source code of this file.

Data Structures

struct  FOCContext
 

Macros

#define MAX_MIPMAPS   5
 
#define OFFSET(x)   offsetof(FOCContext, x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
 

Functions

static int query_formats (AVFilterContext *ctx)
 
static AVFramedownscale (AVFrame *in)
 
static float compare (const AVFrame *haystack, const AVFrame *obj, int offx, int offy)
 
static int config_input (AVFilterLink *inlink)
 
static float search (FOCContext *foc, int pass, int maxpass, int xmin, int xmax, int ymin, int ymax, int *best_x, int *best_y, float best_score)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static av_cold void uninit (AVFilterContext *ctx)
 
static av_cold int init (AVFilterContext *ctx)
 

Variables

static const AVOption foc_options []
 
static const AVClass foc_class
 
static const AVFilterPad foc_inputs []
 
static const AVFilterPad foc_outputs []
 
AVFilter ff_vf_find_rect
 

Macro Definition Documentation

#define MAX_MIPMAPS   5
Todo:
switch to dualinput

Definition at line 32 of file vf_find_rect.c.

Referenced by filter_frame(), and uninit().

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

Definition at line 46 of file vf_find_rect.c.

Definition at line 47 of file vf_find_rect.c.

Function Documentation

static int query_formats ( AVFilterContext ctx)
static

Definition at line 67 of file vf_find_rect.c.

static AVFrame* downscale ( AVFrame in)
static

Definition at line 78 of file vf_find_rect.c.

Referenced by filter_frame(), and init().

static float compare ( const AVFrame haystack,
const AVFrame obj,
int  offx,
int  offy 
)
static

Definition at line 111 of file vf_find_rect.c.

Referenced by ff_interleave_add_packet(), and search().

static int config_input ( AVFilterLink inlink)
static

Definition at line 149 of file vf_find_rect.c.

static float search ( FOCContext foc,
int  pass,
int  maxpass,
int  xmin,
int  xmax,
int  ymin,
int  ymax,
int *  best_x,
int *  best_y,
float  best_score 
)
static

Definition at line 162 of file vf_find_rect.c.

Referenced by filter_frame().

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 189 of file vf_find_rect.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 234 of file vf_find_rect.c.

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 249 of file vf_find_rect.c.

Variable Documentation

const AVOption foc_options[]
static
Initial value:
= {
{ "object", "object bitmap filename", OFFSET(obj_filename), AV_OPT_TYPE_STRING, {.str = NULL}, .flags = FLAGS },
{ "threshold", "set threshold", OFFSET(threshold), AV_OPT_TYPE_FLOAT, {.dbl = 0.5}, 0, 1.0, FLAGS },
{ "mipmaps", "set mipmaps", OFFSET(mipmaps), AV_OPT_TYPE_INT, {.i64 = 3}, 1, MAX_MIPMAPS, FLAGS },
{ "xmin", "", OFFSET(xmin), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, FLAGS },
{ "ymin", "", OFFSET(ymin), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, FLAGS },
{ "xmax", "", OFFSET(xmax), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, FLAGS },
{ "ymax", "", OFFSET(ymax), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, FLAGS },
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define OFFSET(x)
Definition: vf_find_rect.c:46
#define FLAGS
Definition: vf_find_rect.c:47
#define MAX_MIPMAPS
Definition: vf_find_rect.c:32

Definition at line 48 of file vf_find_rect.c.

const AVClass foc_class
static
Initial value:
= {
.class_name = "find_rect",
.item_name = av_default_item_name,
.option = foc_options,
}
#define LIBAVUTIL_VERSION_INT
Definition: version.h:62
av_default_item_name
static const AVOption foc_options[]
Definition: vf_find_rect.c:48

Definition at line 59 of file vf_find_rect.c.

const AVFilterPad foc_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 *in)
Definition: vf_find_rect.c:189
static int config_input(AVFilterLink *inlink)
Definition: vf_find_rect.c:149

Definition at line 283 of file vf_find_rect.c.

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

Definition at line 293 of file vf_find_rect.c.

AVFilter ff_vf_find_rect
Initial value:
= {
.name = "find_rect",
.description = NULL_IF_CONFIG_SMALL("Find a user specified object"),
.priv_size = sizeof(FOCContext),
.init = init,
.priv_class = &foc_class,
}
static const AVFilterPad outputs[]
Definition: af_ashowinfo.c:248
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_find_rect.c:234
static const AVFilterPad foc_outputs[]
Definition: vf_find_rect.c:293
static const AVFilterPad foc_inputs[]
Definition: vf_find_rect.c:283
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:175
static const AVClass foc_class
Definition: vf_find_rect.c:59
static av_cold int init(AVFilterContext *ctx)
Definition: vf_find_rect.c:249
static const AVFilterPad inputs[]
Definition: af_ashowinfo.c:239
static int query_formats(AVFilterContext *ctx)
Definition: vf_find_rect.c:67

Definition at line 301 of file vf_find_rect.c.