Olaf
Overly Lightweight Acoustic Fingerprinting
Loading...
Searching...
No Matches
Data Structures | Typedefs | Functions
olaf_fp_extractor.h File Reference

Olaf fingerprint extractor: combines event points into fingerprints. More...

#include "olaf_config.h"
#include "olaf_ep_extractor.h"
#include <stdint.h>

Go to the source code of this file.

Data Structures

struct  fingerprint
 A fingerprint is a combination of three event points each with a frequency bin, time bin and magnitude. More...
 
struct  extracted_fingerprints
 The result of fingerprint extraction: a list of fingerprints with a size. More...
 

Typedefs

typedef struct Olaf_FP_Extractor Olaf_FP_Extractor
 

Functions

Olaf_FP_Extractorolaf_fp_extractor_new (Olaf_Config *config)
 
void olaf_fp_extractor_destroy (Olaf_FP_Extractor *olaf_fp_extractor)
 
struct extracted_fingerprintsolaf_fp_extractor_extract (Olaf_FP_Extractor *olaf_fp_extractor, struct extracted_event_points *eps, int audioBlockIndex)
 
size_t olaf_fp_extractor_total (Olaf_FP_Extractor *fp_extractor)
 Returns the total number of extracted fingerprints.
 
uint64_t olaf_fp_extractor_hash (struct fingerprint f)
 Calculate a hash for a fingerprint.
 
void olaf_fp_extractor_print (struct fingerprint f)
 Print a single fingerprint, mainly for debug purposes.
 
int olaf_fp_extractor_compare_fp (const void *a, const void *b)
 A comparator to sort fingerprint hashes.
 

Detailed Description

Olaf fingerprint extractor: combines event points into fingerprints.

The fingerprint extractor is responsible for combining event points into fingerprints and also defines the fingerprint struct.

Function Documentation

◆ olaf_fp_extractor_compare_fp()

int olaf_fp_extractor_compare_fp ( const void *  a,
const void *  b 
)

A comparator to sort fingerprint hashes.

Parameters
[in]aThe first fingerprint hash.
[in]bThe second fingerprint hash.
Returns
An integer describing the hash order.

◆ olaf_fp_extractor_destroy()

void olaf_fp_extractor_destroy ( Olaf_FP_Extractor olaf_fp_extractor)

Free up memory and release resources.

Parameters
olaf_fp_extractorThe state to clean up.

◆ olaf_fp_extractor_extract()

struct extracted_fingerprints * olaf_fp_extractor_extract ( Olaf_FP_Extractor olaf_fp_extractor,
struct extracted_event_points eps,
int  audioBlockIndex 
)

Extract fingerprints from a list of event points.

Parameters
olaf_fp_extractorThe state information.
epsA pointer to a list of event points.
audioBlockIndexThe current audio block index.

◆ olaf_fp_extractor_hash()

uint64_t olaf_fp_extractor_hash ( struct fingerprint  f)

Calculate a hash for a fingerprint.

Parameters
[in]fThe fingerprint to calculate a hash for.
Returns
A uint64_t hash for a fingerprint.

◆ olaf_fp_extractor_new()

Olaf_FP_Extractor * olaf_fp_extractor_new ( Olaf_Config config)

Create a new fingerprint extractor based on the current config.

Parameters
configThe current configuration.

◆ olaf_fp_extractor_print()

void olaf_fp_extractor_print ( struct fingerprint  f)

Print a single fingerprint, mainly for debug purposes.

Parameters
[in]fThe single fingerprint to print.

◆ olaf_fp_extractor_total()

size_t olaf_fp_extractor_total ( Olaf_FP_Extractor fp_extractor)

Returns the total number of extracted fingerprints.

Parameters
fp_extractorThe fp extractor
Returns
The total number of extracted fingerprints.