diff src/vamp-hostsdk/PluginSummarisingAdapter.cpp @ 460:b409560a805b

Merge from branch vampipe
author Chris Cannam
date Mon, 10 Oct 2016 15:48:35 +0100
parents 7bab0c5422f4
children 5d9af3140f05
line wrap: on
line diff
--- a/src/vamp-hostsdk/PluginSummarisingAdapter.cpp	Thu Aug 18 12:00:24 2016 +0100
+++ b/src/vamp-hostsdk/PluginSummarisingAdapter.cpp	Mon Oct 10 15:48:35 2016 +0100
@@ -868,10 +868,19 @@
                 
                 map<float, int> distribution;
 
+#ifdef DEBUG_PLUGIN_SUMMARISING_ADAPTER
+                cerr << "summing (discrete): ";
+#endif
                 for (int k = 0; k < sz; ++k) {
+#ifdef DEBUG_PLUGIN_SUMMARISING_ADAPTER
+                    cerr << accumulator.results[k].values[bin] << " ";
+#endif
                     summary.sum += accumulator.results[k].values[bin];
                     distribution[accumulator.results[k].values[bin]] += 1;
                 }
+#ifdef DEBUG_PLUGIN_SUMMARISING_ADAPTER
+                cerr << endl;
+#endif
 
                 int md = 0;
 
@@ -908,11 +917,21 @@
 
                     double sum_c = 0.0;
 
+#ifdef DEBUG_PLUGIN_SUMMARISING_ADAPTER
+                    cerr << "summing (continuous): ";
+#endif
                     for (int k = 0; k < sz; ++k) {
+#ifdef DEBUG_PLUGIN_SUMMARISING_ADAPTER
+                        cerr << accumulator.results[k].values[bin] << "*"
+                             << toSec(accumulator.results[k].duration) << " ";
+#endif
                         double value = accumulator.results[k].values[bin]
                             * toSec(accumulator.results[k].duration);
                         sum_c += value;
                     }
+#ifdef DEBUG_PLUGIN_SUMMARISING_ADAPTER
+                cerr << endl;
+#endif
 
 #ifdef DEBUG_PLUGIN_SUMMARISING_ADAPTER
                     cerr << "mean_c = " << sum_c << " / " << totalDuration << " = "