Fix erroneous limits calculations

This commit is contained in:
Chris Cannam
2023-03-23 17:26:28 +00:00
parent adfe1ff2cf
commit 963752951d
2 changed files with 4 additions and 4 deletions

View File

@@ -389,10 +389,10 @@ R3Stretcher::calculateHop()
m_log.log(1, "calculateHop: inhop and mean outhop", m_inhop, m_inhop * ratio); m_log.log(1, "calculateHop: inhop and mean outhop", m_inhop, m_inhop * ratio);
if (m_inhop < m_limits.maxInhopWithReadahead) { 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; m_useReadahead = true;
} else { } 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; m_useReadahead = false;
} }

View File

@@ -114,8 +114,8 @@ protected:
minPreferredOuthop(roundUpDiv(rate, 512)), // 128 minPreferredOuthop(roundUpDiv(rate, 512)), // 128
maxPreferredOuthop(roundUpDiv(rate, 128)), // 512 maxPreferredOuthop(roundUpDiv(rate, 128)), // 512
minInhop(1), minInhop(1),
maxInhopWithReadahead(roundUpDiv(rate, 32)), // 1024 maxInhopWithReadahead(roundUpDiv(rate, 64)), // 1024
maxInhop(roundUpDiv(rate, 32)) { // 1024 maxInhop(roundUpDiv(rate, 32)) { // 2048
if (options & RubberBandStretcher::OptionWindowShort) { if (options & RubberBandStretcher::OptionWindowShort) {
// See note in calculateHop // See note in calculateHop
minPreferredOuthop = roundUpDiv(rate, 256); // 256 minPreferredOuthop = roundUpDiv(rate, 256); // 256