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

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

#include "signature.h"

Go to the source code of this file.

Macros

#define HOUGH_MAX_OFFSET   90
 
#define MAX_FRAMERATE   60
 
#define DIR_PREV   0
 
#define DIR_NEXT   1
 
#define DIR_PREV_END   2
 
#define DIR_NEXT_END   3
 
#define STATUS_NULL   0
 
#define STATUS_END_REACHED   1
 
#define STATUS_BEGIN_REACHED   2
 

Functions

static void fill_l1distlut (uint8_t lut[])
 
static unsigned int intersection_word (const uint8_t *first, const uint8_t *second)
 
static unsigned int union_word (const uint8_t *first, const uint8_t *second)
 
static unsigned int get_l1dist (AVFilterContext *ctx, SignatureContext *sc, const uint8_t *first, const uint8_t *second)
 
static int get_jaccarddist (SignatureContext *sc, CoarseSignature *first, CoarseSignature *second)
 calculates the jaccard distance and evaluates a pair of coarse signatures as good More...
 
static int find_next_coarsecandidate (SignatureContext *sc, CoarseSignature *secondstart, CoarseSignature **first, CoarseSignature **second, int start)
 step through the coarsesignatures as long as a good candidate is found More...
 
static MatchingInfoget_matching_parameters (AVFilterContext *ctx, SignatureContext *sc, FineSignature *first, FineSignature *second)
 compares framesignatures and sorts out signatures with a l1 distance above a given threshold. More...
 
static int iterate_frame (double frr, FineSignature **a, FineSignature **b, int fcount, int *bcount, int dir)
 
static MatchingInfo evaluate_parameters (AVFilterContext *ctx, SignatureContext *sc, MatchingInfo *infos, MatchingInfo bestmatch, int mode)
 
static void sll_free (MatchingInfo *sll)
 
static MatchingInfo lookup_signatures (AVFilterContext *ctx, SignatureContext *sc, StreamContext *first, StreamContext *second, int mode)
 

Detailed Description

MPEG-7 video signature calculation and lookup filter.

Definition in file signature_lookup.c.

Macro Definition Documentation

#define HOUGH_MAX_OFFSET   90

Definition at line 28 of file signature_lookup.c.

Referenced by get_matching_parameters().

#define MAX_FRAMERATE   60

Definition at line 29 of file signature_lookup.c.

Referenced by get_matching_parameters().

#define DIR_PREV   0

Definition at line 31 of file signature_lookup.c.

Referenced by evaluate_parameters(), and iterate_frame().

#define DIR_NEXT   1

Definition at line 32 of file signature_lookup.c.

Referenced by evaluate_parameters(), and iterate_frame().

#define DIR_PREV_END   2

Definition at line 33 of file signature_lookup.c.

Referenced by evaluate_parameters(), and iterate_frame().

#define DIR_NEXT_END   3

Definition at line 34 of file signature_lookup.c.

Referenced by evaluate_parameters(), and iterate_frame().

#define STATUS_NULL   0

Definition at line 36 of file signature_lookup.c.

Referenced by evaluate_parameters().

#define STATUS_END_REACHED   1

Definition at line 37 of file signature_lookup.c.

Referenced by evaluate_parameters().

#define STATUS_BEGIN_REACHED   2

Definition at line 38 of file signature_lookup.c.

Referenced by evaluate_parameters().

Function Documentation

static void fill_l1distlut ( uint8_t  lut[])
static

Definition at line 40 of file signature_lookup.c.

Referenced by lookup_signatures().

static unsigned int intersection_word ( const uint8_t first,
const uint8_t second 
)
static

Definition at line 60 of file signature_lookup.c.

Referenced by get_jaccarddist().

static unsigned int union_word ( const uint8_t first,
const uint8_t second 
)
static

Definition at line 75 of file signature_lookup.c.

Referenced by get_jaccarddist().

static unsigned int get_l1dist ( AVFilterContext ctx,
SignatureContext sc,
const uint8_t first,
const uint8_t second 
)
static

Definition at line 90 of file signature_lookup.c.

Referenced by evaluate_parameters(), and get_matching_parameters().

static int get_jaccarddist ( SignatureContext sc,
CoarseSignature first,
CoarseSignature second 
)
static

calculates the jaccard distance and evaluates a pair of coarse signatures as good

Returns
0 if pair is bad, 1 otherwise

Definition at line 115 of file signature_lookup.c.

Referenced by find_next_coarsecandidate().

static int find_next_coarsecandidate ( SignatureContext sc,
CoarseSignature secondstart,
CoarseSignature **  first,
CoarseSignature **  second,
int  start 
)
static

step through the coarsesignatures as long as a good candidate is found

Returns
0 if no candidate is found, 1 otherwise

Definition at line 140 of file signature_lookup.c.

Referenced by lookup_signatures().

static MatchingInfo* get_matching_parameters ( AVFilterContext ctx,
SignatureContext sc,
FineSignature first,
FineSignature second 
)
static

compares framesignatures and sorts out signatures with a l1 distance above a given threshold.

Then tries to find out offset and differences between framerates with a hough transformation

Definition at line 174 of file signature_lookup.c.

Referenced by lookup_signatures().

static int iterate_frame ( double  frr,
FineSignature **  a,
FineSignature **  b,
int  fcount,
int bcount,
int  dir 
)
static

Definition at line 315 of file signature_lookup.c.

Referenced by evaluate_parameters().

static MatchingInfo evaluate_parameters ( AVFilterContext ctx,
SignatureContext sc,
MatchingInfo infos,
MatchingInfo  bestmatch,
int  mode 
)
static

Definition at line 418 of file signature_lookup.c.

Referenced by lookup_signatures().

static void sll_free ( MatchingInfo sll)
static

Definition at line 523 of file signature_lookup.c.

Referenced by lookup_signatures().

static MatchingInfo lookup_signatures ( AVFilterContext ctx,
SignatureContext sc,
StreamContext first,
StreamContext second,
int  mode 
)
static

Definition at line 533 of file signature_lookup.c.

Referenced by request_frame().