-
-
Notifications
You must be signed in to change notification settings - Fork 143
/
Copy pathfft_lib_fftw3.h
46 lines (35 loc) · 1004 Bytes
/
fft_lib_fftw3.h
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
46
// Copyright (C) 2010-2016 Lukas Lalinsky
// Distributed under the MIT license, see the LICENSE file for details.
#ifndef CHROMAPRINT_FFT_LIB_FFTW3_H_
#define CHROMAPRINT_FFT_LIB_FFTW3_H_
#include <fftw3.h>
#include "fft_frame.h"
#include "utils.h"
#ifdef USE_FFTW3F
#define FFTW_SCALAR float
#define fftw_plan fftwf_plan
#define fftw_plan_r2r_1d fftwf_plan_r2r_1d
#define fftw_execute fftwf_execute
#define fftw_destroy_plan fftwf_destroy_plan
#define fftw_malloc fftwf_malloc
#define fftw_free fftwf_free
#else
#define FFTW_SCALAR double
#endif
namespace chromaprint {
class FFTLib {
public:
FFTLib(size_t frame_size);
~FFTLib();
void Load(const int16_t *begin1, const int16_t *end1, const int16_t *begin2, const int16_t *end2);
void Compute(FFTFrame &frame);
private:
CHROMAPRINT_DISABLE_COPY(FFTLib);
size_t m_frame_size;
FFTW_SCALAR *m_window;
FFTW_SCALAR *m_input;
FFTW_SCALAR *m_output;
fftw_plan m_plan;
};
}; // namespace chromaprint
#endif // CHROMAPRINT_FFT_LIB_FFTW3_H_