summaryrefslogtreecommitdiff
path: root/libs/vamp-plugins
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-02-10 15:08:44 +0100
committerRobin Gareus <robin@gareus.org>2016-02-10 15:11:45 +0100
commite41296bf5d8ac95566e9bedd5599c7f8d74e2ed2 (patch)
tree739434f122a78a20e00ebec90f12decb16082fc1 /libs/vamp-plugins
parent6c8a062be9a0e34ee0f60ad16499827b5fdaa627 (diff)
Add loudness histogram Feature to the EBUr128 VAMP plugin
Diffstat (limited to 'libs/vamp-plugins')
-rw-r--r--libs/vamp-plugins/EBUr128.cpp25
1 files changed, 22 insertions, 3 deletions
diff --git a/libs/vamp-plugins/EBUr128.cpp b/libs/vamp-plugins/EBUr128.cpp
index 1a3b9a401c..a93dfe0e02 100644
--- a/libs/vamp-plugins/EBUr128.cpp
+++ b/libs/vamp-plugins/EBUr128.cpp
@@ -111,7 +111,7 @@ VampEBUr128::getOutputDescriptors() const
OutputDescriptor zc;
zc.identifier = "loundless";
zc.name = "Integrated loudness";
- zc.description = "Integrated loudness";
+ zc.description = "Integrated Loudness";
zc.unit = "LUFS";
zc.hasFixedBinCount = true;
zc.binCount = 0;
@@ -121,8 +121,8 @@ VampEBUr128::getOutputDescriptors() const
list.push_back(zc);
zc.identifier = "range";
- zc.name = "Integrated loudness Range";
- zc.description = "Dynamic Range of the audio";
+ zc.name = "Integrated Loudness Range";
+ zc.description = "Dynamic Range of the Audio";
zc.unit = "LU";
zc.hasFixedBinCount = true;
zc.binCount = 0;
@@ -131,6 +131,17 @@ VampEBUr128::getOutputDescriptors() const
zc.sampleType = OutputDescriptor::OneSamplePerStep;
list.push_back(zc);
+ zc.identifier = "histogram";
+ zc.name = "Loudness Histogram";
+ zc.description = "Dynamic Range of the audio";
+ zc.unit = "";
+ zc.hasFixedBinCount = false;
+ zc.binCount = 0;
+ zc.hasKnownExtents = false;
+ zc.isQuantized = false;
+ zc.sampleType = OutputDescriptor::OneSamplePerStep;
+ list.push_back(zc);
+
return list;
}
@@ -166,5 +177,13 @@ VampEBUr128::getRemainingFeatures()
range.values.push_back(ebu.range_max () - ebu.range_min ());
returnFeatures[1].push_back(range);
+ Feature hist;
+ hist.hasTimestamp = false;
+ const int * hist_M = ebu.histogram_M();
+ for (int i = 110; i < 650; ++i) {
+ hist.values.push_back(hist_M[i]);
+ }
+ returnFeatures[2].push_back(hist);
+
return returnFeatures;
}