FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
vf_signature.c File Reference

MPEG-7 video signature calculation and lookup filter. More...

#include <float.h>
#include "libavcodec/put_bits.h"
#include "libavformat/avformat.h"
#include "libavutil/opt.h"
#include "libavutil/avstring.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/timestamp.h"
#include "avfilter.h"
#include "internal.h"
#include "signature.h"
#include "signature_lookup.c"

Go to the source code of this file.

Macros

#define OFFSET(x)   offsetof(SignatureContext, x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM
 
#define BLOCK_LCM   (int64_t) 476985600
 

Functions

 AVFILTER_DEFINE_CLASS (signature)
 
static int query_formats (AVFilterContext *ctx)
 
static int config_input (AVFilterLink *inlink)
 
static int get_block_size (const Block *b)
 
static uint64_t get_block_sum (StreamContext *sc, uint64_t intpic[32][32], const Block *b)
 
static int cmp (const uint64_t *a, const uint64_t *b)
 
static void set_bit (uint8_t *data, size_t pos)
 sets the bit at position pos to 1 in data More...
 
static int filter_frame (AVFilterLink *inlink, AVFrame *picref)
 
static int xml_export (AVFilterContext *ctx, StreamContext *sc, const char *filename)
 
static int binary_export (AVFilterContext *ctx, StreamContext *sc, const char *filename)
 
static int export (AVFilterContext *ctx, StreamContext *sc, int input)
 
static int request_frame (AVFilterLink *outlink)
 
static av_cold int init (AVFilterContext *ctx)
 
static av_cold void uninit (AVFilterContext *ctx)
 
static int config_output (AVFilterLink *outlink)
 

Variables

static const AVOption signature_options []
 
static const AVFilterPad signature_outputs []
 
AVFilter ff_vf_signature
 

Detailed Description

MPEG-7 video signature calculation and lookup filter.

See Also
http://epubs.surrey.ac.uk/531590/1/MPEG-7%20Video%20Signature%20Author%27s%20Copy.pdf

Definition in file vf_signature.c.

Macro Definition Documentation

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

Definition at line 39 of file vf_signature.c.

Definition at line 40 of file vf_signature.c.

#define BLOCK_LCM   (int64_t) 476985600

Definition at line 41 of file vf_signature.c.

Referenced by config_input(), and filter_frame().

Function Documentation

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

Definition at line 72 of file vf_signature.c.

static int config_input ( AVFilterLink inlink)
static

Definition at line 90 of file vf_signature.c.

Referenced by init().

static int get_block_size ( const Block b)
static

Definition at line 107 of file vf_signature.c.

Referenced by filter_frame().

static uint64_t get_block_sum ( StreamContext sc,
uint64_t  intpic[32][32],
const Block b 
)
static

Definition at line 112 of file vf_signature.c.

Referenced by filter_frame().

static int cmp ( const uint64_t *  a,
const uint64_t *  b 
)
static

Definition at line 135 of file vf_signature.c.

Referenced by filter_frame().

static void set_bit ( uint8_t data,
size_t  pos 
)
static

sets the bit at position pos to 1 in data

Definition at line 143 of file vf_signature.c.

Referenced by filter_frame().

static int filter_frame ( AVFilterLink inlink,
AVFrame picref 
)
static

Definition at line 149 of file vf_signature.c.

Referenced by init().

static int xml_export ( AVFilterContext ctx,
StreamContext sc,
const char *  filename 
)
static

Definition at line 383 of file vf_signature.c.

Referenced by export().

static int binary_export ( AVFilterContext ctx,
StreamContext sc,
const char *  filename 
)
static

Definition at line 489 of file vf_signature.c.

Referenced by export().

static int export ( AVFilterContext ctx,
StreamContext sc,
int  input 
)
static

Definition at line 567 of file vf_signature.c.

Referenced by request_frame().

static int request_frame ( AVFilterLink outlink)
static

Definition at line 585 of file vf_signature.c.

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 641 of file vf_signature.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 697 of file vf_signature.c.

static int config_output ( AVFilterLink outlink)
static

Definition at line 732 of file vf_signature.c.

Variable Documentation

const AVOption signature_options[]
static
Initial value:
= {
{ "detectmode", "set the detectmode",
OFFSET(mode), AV_OPT_TYPE_INT, {.i64 = MODE_OFF}, 0, NB_LOOKUP_MODE-1, FLAGS, "mode" },
{ "off", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = MODE_OFF}, 0, 0, .flags = FLAGS, "mode" },
{ "full", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = MODE_FULL}, 0, 0, .flags = FLAGS, "mode" },
{ "fast", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = MODE_FAST}, 0, 0, .flags = FLAGS, "mode" },
{ "nb_inputs", "number of inputs",
OFFSET(nb_inputs), AV_OPT_TYPE_INT, {.i64 = 1}, 1, INT_MAX, FLAGS },
{ "filename", "filename for output files",
OFFSET(filename), AV_OPT_TYPE_STRING, {.str = ""}, 0, NB_FORMATS-1, FLAGS },
{ "format", "set output format",
OFFSET(format), AV_OPT_TYPE_INT, {.i64 = FORMAT_BINARY}, 0, 1, FLAGS , "format" },
{ "binary", 0, 0, AV_OPT_TYPE_CONST, {.i64=FORMAT_BINARY}, 0, 0, FLAGS, "format" },
{ "xml", 0, 0, AV_OPT_TYPE_CONST, {.i64=FORMAT_XML}, 0, 0, FLAGS, "format" },
{ "th_d", "threshold to detect one word as similar",
OFFSET(thworddist), AV_OPT_TYPE_INT, {.i64 = 9000}, 1, INT_MAX, FLAGS },
{ "th_dc", "threshold to detect all words as similar",
OFFSET(thcomposdist), AV_OPT_TYPE_INT, {.i64 = 60000}, 1, INT_MAX, FLAGS },
{ "th_xh", "threshold to detect frames as similar",
OFFSET(thl1), AV_OPT_TYPE_INT, {.i64 = 116}, 1, INT_MAX, FLAGS },
{ "th_di", "minimum length of matching sequence in frames",
OFFSET(thdi), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, FLAGS },
{ "th_it", "threshold for relation of good to all frames",
OFFSET(thit), AV_OPT_TYPE_DOUBLE, {.dbl = 0.5}, 0.0, 1.0, FLAGS },
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define OFFSET(x)
Definition: vf_signature.c:39
static const char * format
Definition: movenc.c:47
#define FLAGS
Definition: vf_signature.c:40
mode
Use these values in ebur128_init (or'ed).
Definition: ebur128.h:83

Definition at line 43 of file vf_signature.c.

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

Definition at line 746 of file vf_signature.c.

AVFilter ff_vf_signature
Initial value:
= {
.name = "signature",
.description = NULL_IF_CONFIG_SMALL("Calculate the MPEG-7 video signature"),
.priv_size = sizeof(SignatureContext),
.priv_class = &signature_class,
.init = init,
}
#define NULL
Definition: coverity.c:32
static const AVFilterPad signature_outputs[]
Definition: vf_signature.c:746
#define AVFILTER_FLAG_DYNAMIC_INPUTS
The number of the filter inputs is not determined just by AVFilter.inputs.
Definition: avfilter.h:105
static int flags
Definition: log.c:57
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:179
static const AVFilterPad outputs[]
Definition: af_afftfilt.c:386
static const AVFilterPad inputs[]
Definition: af_afftfilt.c:376
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_signature.c:697
static int query_formats(AVFilterContext *ctx)
Definition: vf_signature.c:72
static av_cold int init(AVFilterContext *ctx)
Definition: vf_signature.c:641

Definition at line 756 of file vf_signature.c.