Handle non-ideal sample rates in R3; document sample rate parameter

This commit is contained in:
Chris Cannam
2022-09-26 16:02:13 +01:00
parent f586fe601a
commit 9e423cdd8c
9 changed files with 88 additions and 44 deletions

View File

@@ -33,6 +33,7 @@
#include "../common/Resampler.h"
#include "../common/Profiler.h"
#include "../common/sysutils.h"
#include "../common/mathmisc.h"
#include <cassert>
#include <cmath>
@@ -365,16 +366,6 @@ R2Stretcher::getEffectiveRatio() const
return m_timeRatio * m_pitchScale;
}
size_t
R2Stretcher::roundUp(size_t value)
{
if (!(value & (value - 1))) return value;
size_t bits = 0;
while (value) { ++bits; value >>= 1; }
value = size_t(1) << bits;
return value;
}
void
R2Stretcher::calculateSizes()
{