changeset 113:d0920575b48a

* pass allocator through to sub-cuts (duh)
author Chris Cannam <c.cannam@qmul.ac.uk>
date Wed, 20 May 2009 08:52:11 +0000
parents 2e25bdc9f826
children 496e6d6eb413
files plugins/AdaptiveSpectrogram.cpp plugins/AdaptiveSpectrogram.h
diffstat 2 files changed, 9 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/AdaptiveSpectrogram.cpp	Tue May 19 16:18:11 2009 +0000
+++ b/plugins/AdaptiveSpectrogram.cpp	Wed May 20 08:52:11 2009 +0000
@@ -319,7 +319,8 @@
                                 int res,
                                 int x, int y, int h,
                                 Cutting *&top, Cutting *&bottom,
-                                Cutting *&left, Cutting *&right) const
+                                Cutting *&left, Cutting *&right,
+                                BlockAllocator *allocator) const
 {
     if (m_threaded && !m_threadsInUse) {
 
@@ -354,16 +355,16 @@
         // Splitting this way keeps us in the same resolution,
         // but with two vertical subregions of height h/2.
 
-        top    = cut(s, res, x, y + h/2, h/2, 0);
-        bottom = cut(s, res, x, y, h/2, 0);
+        top    = cut(s, res, x, y + h/2, h/2, allocator);
+        bottom = cut(s, res, x, y, h/2, allocator);
 
         // The "horizontal" division is a left/right split.  Splitting
         // this way places us in resolution res/2, which has lower
         // vertical resolution but higher horizontal resolution.  We
         // need to double x accordingly.
         
-        left   = cut(s, res/2, 2 * x, y/2, h/2, 0);
-        right  = cut(s, res/2, 2 * x + 1, y/2, h/2, 0);
+        left   = cut(s, res/2, 2 * x, y/2, h/2, allocator);
+        right  = cut(s, res/2, 2 * x + 1, y/2, h/2, allocator);
     }
 }
 
@@ -387,7 +388,7 @@
     if (h > 1 && res > s.minres) {
 
         Cutting *top = 0, *bottom = 0, *left = 0, *right = 0;
-        getSubCuts(s, res, x, y, h, top, bottom, left, right);
+        getSubCuts(s, res, x, y, h, top, bottom, left, right, allocator);
 
         double vcost = top->cost + bottom->cost;
         double hcost = left->cost + right->cost;
--- a/plugins/AdaptiveSpectrogram.h	Tue May 19 16:18:11 2009 +0000
+++ b/plugins/AdaptiveSpectrogram.h	Wed May 20 08:52:11 2009 +0000
@@ -260,7 +260,8 @@
 
     void getSubCuts(const Spectrograms &, int res, int x, int y, int h,
                     Cutting *&top, Cutting *&bottom,
-                    Cutting *&left, Cutting *&right) const;
+                    Cutting *&left, Cutting *&right,
+                    BlockAllocator *allocator) const;
 
     void printCutting(Cutting *, std::string) const;