From c51f6b1ae2543bb9e7ac9a108cb825c95d388abf Mon Sep 17 00:00:00 2001 From: Chris Cannam Date: Thu, 23 Mar 2023 17:26:28 +0000 Subject: [PATCH] Fix erroneous limits calculations --- src/finer/R3Stretcher.cpp | 4 ++-- src/finer/R3Stretcher.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/finer/R3Stretcher.cpp b/src/finer/R3Stretcher.cpp index e56f3d2..dd996aa 100644 --- a/src/finer/R3Stretcher.cpp +++ b/src/finer/R3Stretcher.cpp @@ -382,10 +382,10 @@ R3Stretcher::calculateHop() m_log.log(1, "calculateHop: inhop and mean outhop", m_inhop, m_inhop * ratio); if (m_inhop < m_limits.maxInhopWithReadahead) { - m_log.log(1, "calculateHop: using readahead"); + m_log.log(1, "calculateHop: using readahead; maxInhopWithReadahead", m_limits.maxInhopWithReadahead); m_useReadahead = true; } else { - m_log.log(1, "calculateHop: not using readahead, inhop too long for buffer in current configuration"); + m_log.log(1, "calculateHop: not using readahead; maxInhopWithReadahead", m_limits.maxInhopWithReadahead); m_useReadahead = false; } } diff --git a/src/finer/R3Stretcher.h b/src/finer/R3Stretcher.h index d1b8308..5735db1 100644 --- a/src/finer/R3Stretcher.h +++ b/src/finer/R3Stretcher.h @@ -114,8 +114,8 @@ protected: minPreferredOuthop(roundUpDiv(rate, 512)), // 128 maxPreferredOuthop(roundUpDiv(rate, 128)), // 512 minInhop(1), - maxInhopWithReadahead(roundUpDiv(rate, 32)), // 1024 - maxInhop(roundUpDiv(rate, 32)) { // 1024 + maxInhopWithReadahead(roundUpDiv(rate, 64)), // 1024 + maxInhop(roundUpDiv(rate, 32)) { // 2048 if (options & RubberBandStretcher::OptionWindowShort) { // See note in calculateHop minPreferredOuthop = roundUpDiv(rate, 256); // 256