FFmpeg
Macros | Functions
signature_lookup.c File Reference
#include "libavutil/mem.h"
#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 sll_free (MatchingInfo **sll)
 
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 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

◆ HOUGH_MAX_OFFSET

#define HOUGH_MAX_OFFSET   90

Definition at line 29 of file signature_lookup.c.

◆ MAX_FRAMERATE

#define MAX_FRAMERATE   60

Definition at line 30 of file signature_lookup.c.

◆ DIR_PREV

#define DIR_PREV   0

Definition at line 32 of file signature_lookup.c.

◆ DIR_NEXT

#define DIR_NEXT   1

Definition at line 33 of file signature_lookup.c.

◆ DIR_PREV_END

#define DIR_PREV_END   2

Definition at line 34 of file signature_lookup.c.

◆ DIR_NEXT_END

#define DIR_NEXT_END   3

Definition at line 35 of file signature_lookup.c.

◆ STATUS_NULL

#define STATUS_NULL   0

Definition at line 37 of file signature_lookup.c.

◆ STATUS_END_REACHED

#define STATUS_END_REACHED   1

Definition at line 38 of file signature_lookup.c.

◆ STATUS_BEGIN_REACHED

#define STATUS_BEGIN_REACHED   2

Definition at line 39 of file signature_lookup.c.

Function Documentation

◆ sll_free()

static void sll_free ( MatchingInfo **  sll)
static

Definition at line 41 of file signature_lookup.c.

Referenced by get_matching_parameters(), and lookup_signatures().

◆ fill_l1distlut()

static void fill_l1distlut ( uint8_t  lut[])
static

Definition at line 51 of file signature_lookup.c.

Referenced by lookup_signatures().

◆ intersection_word()

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

Definition at line 71 of file signature_lookup.c.

Referenced by get_jaccarddist().

◆ union_word()

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

Definition at line 86 of file signature_lookup.c.

Referenced by get_jaccarddist().

◆ get_l1dist()

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

Definition at line 101 of file signature_lookup.c.

Referenced by evaluate_parameters(), and get_matching_parameters().

◆ get_jaccarddist()

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 126 of file signature_lookup.c.

Referenced by find_next_coarsecandidate().

◆ 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 152 of file signature_lookup.c.

Referenced by lookup_signatures().

◆ get_matching_parameters()

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 186 of file signature_lookup.c.

Referenced by lookup_signatures().

◆ iterate_frame()

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

Definition at line 327 of file signature_lookup.c.

Referenced by evaluate_parameters().

◆ evaluate_parameters()

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

Definition at line 430 of file signature_lookup.c.

Referenced by lookup_signatures().

◆ lookup_signatures()

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

Definition at line 535 of file signature_lookup.c.

Referenced by request_frame().