Mercurial > hg > vamp-libxtract-plugins
comparison plugins/XTractPlugin.h @ 1:d9b43f698a44
* Update for libxtract SVN. Almost all of these changes were provided by
Jamie Bullock.
author | cannam |
---|---|
date | Wed, 14 Feb 2007 16:16:13 +0000 |
parents | 298dc5b79772 |
children | c2305fa8e01f |
comparison
equal
deleted
inserted
replaced
0:298dc5b79772 | 1:d9b43f698a44 |
---|---|
16 | 16 |
17 #ifndef _XTRACT_PLUGIN_H_ | 17 #ifndef _XTRACT_PLUGIN_H_ |
18 #define _XTRACT_PLUGIN_H_ | 18 #define _XTRACT_PLUGIN_H_ |
19 | 19 |
20 #include <vamp-sdk/Plugin.h> | 20 #include <vamp-sdk/Plugin.h> |
21 #include <xtract/libxtract.h> | |
21 | 22 |
22 class XTractPlugin : public Vamp::Plugin | 23 class XTractPlugin : public Vamp::Plugin |
23 { | 24 { |
24 public: | 25 public: |
25 XTractPlugin(unsigned int xtFeature, float inputSampleRate); | 26 XTractPlugin(unsigned int xtFeature, float inputSampleRate); |
52 Vamp::RealTime timestamp); | 53 Vamp::RealTime timestamp); |
53 | 54 |
54 FeatureSet getRemainingFeatures(); | 55 FeatureSet getRemainingFeatures(); |
55 | 56 |
56 protected: | 57 protected: |
57 enum XTractInputType { | |
58 TimeDomainAudio, | |
59 MagnitudeSpectrum, | |
60 SpectralPeaks, | |
61 SpectralPeaksPlusF0, | |
62 HarmonicSpectrum, | |
63 BarkCoefficients, | |
64 CustomInputType | |
65 }; | |
66 XTractInputType getXTractInputType() const; | |
67 bool needPeakThreshold() const; | 58 bool needPeakThreshold() const; |
59 bool needHarmonicThreshold() const; | |
60 bool needRolloffThreshold() const; | |
68 | 61 |
69 mutable OutputList m_outputDescriptors; | 62 mutable OutputList m_outputDescriptors; |
70 void setupOutputDescriptors() const; | 63 void setupOutputDescriptors() const; |
71 | 64 |
72 bool processSPF0(float *data); | 65 bool processSPF0(const float *data); |
73 | 66 |
74 const unsigned int m_xtFeature; | 67 const unsigned int m_xtFeature; |
75 size_t m_channels; | 68 size_t m_channels; |
76 size_t m_stepSize; | 69 size_t m_stepSize; |
77 size_t m_blockSize; | 70 size_t m_blockSize; |
78 | 71 |
79 float *m_resultBuffer; | 72 float *m_resultBuffer; |
80 | 73 |
81 float m_threshold; | 74 float m_peakThreshold; |
75 float m_rolloffThreshold; | |
76 float m_harmonicThreshold; | |
82 | 77 |
83 float m_minFreq; | 78 float m_minFreq; |
84 float m_maxFreq; | 79 float m_maxFreq; |
85 | 80 |
86 size_t m_coeffCount; | 81 size_t m_coeffCount; |
87 float **m_mfccFilters; | 82 float **m_mfccFilters; |
88 int m_mfccStyle; | 83 int m_mfccStyle; |
89 | 84 |
90 int *m_barkBandLimits; | 85 int *m_barkBandLimits; |
91 | 86 |
87 static xtract_function_descriptor_t *m_xtDescriptors; | |
88 static int m_xtDescRefCount; | |
89 xtract_function_descriptor_t *xtDescriptor() { | |
90 return &m_xtDescriptors[m_xtFeature]; | |
91 } | |
92 const xtract_function_descriptor_t *xtDescriptor() const { | |
93 return &m_xtDescriptors[m_xtFeature]; | |
94 } | |
95 | |
92 size_t m_outputBinCount; | 96 size_t m_outputBinCount; |
93 bool m_initialised; | 97 bool m_initialised; |
94 }; | 98 }; |
95 | 99 |
96 | 100 |