Mercurial > hg > match-vamp
comparison test/TestFeatureExtractor.cpp @ 188:487261a22b18 re-minimise
distance_t * diagonalWeight might not fit in distance_t; use pathcost_t for it. Also remove C-style casts.
author | Chris Cannam |
---|---|
date | Thu, 26 Feb 2015 12:19:17 +0000 |
parents | a17b22abd551 |
children | fa005e5e0953 |
comparison
equal
deleted
inserted
replaced
187:ba0d2104abec | 188:487261a22b18 |
---|---|
37 | 37 |
38 void checkAlternateProcessType(FeatureExtractor &fe, feature_t expected, | 38 void checkAlternateProcessType(FeatureExtractor &fe, feature_t expected, |
39 vector<double> real, vector<double> imag) | 39 vector<double> real, vector<double> imag) |
40 { | 40 { |
41 vector<float> in; | 41 vector<float> in; |
42 for (int i = 0; i < (int)real.size(); ++i) { | 42 for (size_t i = 0; i < real.size(); ++i) { |
43 in.push_back(float(real[i])); | 43 in.push_back(float(real[i])); |
44 in.push_back(float(imag[i])); | 44 in.push_back(float(imag[i])); |
45 } | 45 } |
46 feature_t alt = fe.process(&in[0]); | 46 feature_t alt = fe.process(&in[0]); |
47 BOOST_CHECK_EQUAL_COLLECTIONS(alt.begin(), alt.end(), | 47 BOOST_CHECK_EQUAL_COLLECTIONS(alt.begin(), alt.end(), |
62 int sz = szs[isz]; | 62 int sz = szs[isz]; |
63 | 63 |
64 int hs = sz / 2 + 1; | 64 int hs = sz / 2 + 1; |
65 int fsz = 13; | 65 int fsz = 13; |
66 | 66 |
67 FeatureExtractor::Parameters params((float)rate, sz); | 67 FeatureExtractor::Parameters params(float(rate), sz); |
68 params.useChromaFrequencyMap = true; | 68 params.useChromaFrequencyMap = true; |
69 FeatureExtractor fe(params); | 69 FeatureExtractor fe(params); |
70 BOOST_CHECK_EQUAL(fe.getFeatureSize(), fsz); | 70 BOOST_CHECK_EQUAL(fe.getFeatureSize(), fsz); |
71 | 71 |
72 for (int bin = 0; bin < hs; ++bin) { | 72 for (int bin = 0; bin < hs; ++bin) { |
139 int rate = 44100; | 139 int rate = 44100; |
140 int sz = 2048; | 140 int sz = 2048; |
141 int hs = sz / 2 + 1; | 141 int hs = sz / 2 + 1; |
142 int fsz = 84; | 142 int fsz = 84; |
143 | 143 |
144 FeatureExtractor::Parameters params((float)rate, sz); | 144 FeatureExtractor::Parameters params(float(rate), sz); |
145 FeatureExtractor fe(params); | 145 FeatureExtractor fe(params); |
146 BOOST_CHECK_EQUAL(fe.getFeatureSize(), fsz); | 146 BOOST_CHECK_EQUAL(fe.getFeatureSize(), fsz); |
147 | 147 |
148 for (int bin = 0; bin < hs; ++bin) { | 148 for (int bin = 0; bin < hs; ++bin) { |
149 | 149 |