* Fix failure to remember that we have constructed an interpolator
window already (#25). Also avoid using alloca for substantial buffers * Lose FFT::getFloatTimeBuffer and getDoubleTimeBuffer -- it's too unclear when it's safe to use them and it's safer to control sizes externally. In RB with smoothing on, these buffers were incorrectly being used for window-si zed calculations (larger than FFT-sized). * Fix some incorrect buffer resize sizes * Build fixes for OS/X
This commit is contained in:
@@ -886,7 +886,7 @@ RubberBandStretcher::Impl::synthesiseChunk(size_t channel,
|
||||
const int hs = fsz / 2;
|
||||
|
||||
const int wsz = m_sWindowSize;
|
||||
|
||||
|
||||
if (!cd.unchanged) {
|
||||
|
||||
cd.fft->inversePolar(cd.mag, cd.phase, cd.dblbuf);
|
||||
@@ -910,22 +910,27 @@ RubberBandStretcher::Impl::synthesiseChunk(size_t channel,
|
||||
}
|
||||
|
||||
if (wsz > fsz) {
|
||||
float *tmp = (float *)alloca(wsz * sizeof(float));
|
||||
int p = shiftIncrement * 2;
|
||||
if (cd.interpolatorScale != p) {
|
||||
SincWindow<float>::write(cd.interpolator, wsz, p);
|
||||
cd.interpolatorScale = p;
|
||||
}
|
||||
v_multiply(fltbuf, cd.interpolator, wsz);
|
||||
v_copy(tmp, cd.interpolator, wsz);
|
||||
m_swindow->cut(tmp);
|
||||
v_add(windowAccumulator, tmp, wsz);
|
||||
} else {
|
||||
m_swindow->add(windowAccumulator, m_awindow->getArea() * 1.5f);
|
||||
}
|
||||
|
||||
m_swindow->cut(fltbuf);
|
||||
v_add(accumulator, fltbuf, wsz);
|
||||
cd.accumulatorFill = wsz;
|
||||
|
||||
if (wsz > fsz) {
|
||||
// reuse fltbuf to calculate interpolating window shape for
|
||||
// window accumulator
|
||||
v_copy(fltbuf, cd.interpolator, wsz);
|
||||
m_swindow->cut(fltbuf);
|
||||
v_add(windowAccumulator, fltbuf, wsz);
|
||||
} else {
|
||||
m_swindow->add(windowAccumulator, m_awindow->getArea() * 1.5f);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user