forked from spotify/echoprint-codegen
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFingerprint.h
More file actions
45 lines (36 loc) · 1.05 KB
/
Fingerprint.h
File metadata and controls
45 lines (36 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//
// echoprint-codegen
// Copyright 2011 The Echo Nest Corporation. All rights reserved.
//
#ifndef FINGERPRINT_H
#define FINGERPRINT_H
#include "Common.h"
#include "SubbandAnalysis.h"
#include "MatrixUtility.h"
#include <vector>
#define HASH_SEED 0x9ea5fa36
#define QUANTIZE_DT_S (256.0/11025.0)
#define QUANTIZE_A_S (256.0/11025.0)
#define HASH_BITMASK 0x000fffff
#define SUBBANDS 8
struct FPCode {
FPCode() : frame(0), code(0) {}
FPCode(uint f, int c) : frame(f), code(c) {}
uint frame;
uint code;
};
unsigned int MurmurHash2 ( const void * key, int len, unsigned int seed );
class Fingerprint {
public:
uint quantized_time_for_frame_delta(uint frame_delta);
uint quantized_time_for_frame_absolute(uint frame);
Fingerprint(SubbandAnalysis* pSubbandAnalysis, int offset);
void Compute();
uint adaptiveOnsets(int ttarg, matrix_u&out, uint*&onset_counter_for_band) ;
std::vector<FPCode>& getCodes(){return _Codes;}
protected:
SubbandAnalysis *_pSubbandAnalysis;
int _Offset;
std::vector<FPCode> _Codes;
};
#endif