]> rtime.felk.cvut.cz Git - hercules2020/kcf.git/blob - src/fft.cpp
a7974009a4aa4b217b3dd9cdec4324f5563f8544
[hercules2020/kcf.git] / src / fft.cpp
1
2 #include "fft.h"
3 #include <cassert>
4
5 Fft::~Fft()
6 {
7
8 }
9
10 void Fft::init(unsigned width, unsigned height, unsigned num_of_feats, unsigned num_of_scales)
11 {
12     m_width = width;
13     m_height = height;
14     m_num_of_feats = num_of_feats;
15 #ifdef BIG_BATCH
16     m_num_of_scales = num_of_scales;
17 #else
18     (void)num_of_scales;
19 #endif
20 }
21
22 void Fft::set_window(const MatDynMem &window)
23 {
24     assert(window.dims == 2);
25     assert(window.size().width == m_width);
26     assert(window.size().height == m_height);
27     (void)window;
28 }
29
30 void Fft::forward(const MatDynMem &real_input, ComplexMat &complex_result)
31 {
32     assert(real_input.dims == 2);
33     assert(real_input.size().width == m_width);
34     assert(real_input.size().height == m_height);
35     (void)real_input;
36     (void)complex_result;
37 }
38
39 void Fft::forward_window(MatDynMem &patch_feats, ComplexMat &complex_result, MatDynMem &tmp)
40 {
41         assert(patch_feats.dims == 3);
42 #ifndef BIG_BATCH
43         assert(patch_feats.size[0] == m_num_of_feats);
44 #else
45         assert(patch_feats.size[0] == m_num_of_feats * m_num_of_scales);
46 #endif
47         assert(patch_feats.size[1] == m_height);
48         assert(patch_feats.size[2] == m_width);
49
50         assert(tmp.dims == patch_feats.dims);
51         assert(tmp.size[0] == patch_feats.size[0]);
52         assert(tmp.size[1] == patch_feats.size[1]);
53         assert(tmp.size[2] == patch_feats.size[2]);
54
55         (void)patch_feats;
56         (void)complex_result;
57         (void)tmp;
58 }
59
60 void Fft::inverse(ComplexMat &complex_input, MatDynMem &real_result)
61 {
62     assert(real_result.dims == 3);
63 #ifndef BIG_BATCH
64     assert(real_result.size[0] == m_num_of_feats);
65 #else
66     assert(real_result.size[0] == m_num_of_feats * m_num_of_scales);
67 #endif
68     assert(real_result.size[1] == m_height);
69     assert(real_result.size[2] == m_width);
70
71     (void)complex_input;
72     (void)real_result;
73 }