aboutsummaryrefslogtreecommitdiff
path: root/src/audio_core/algorithm/interpolate.cpp
diff options
context:
space:
mode:
authorraven02 <jacky.kktsui@yahoo.com.hk>2018-09-19 19:53:11 +0800
committerGitHub <noreply@github.com>2018-09-19 19:53:11 +0800
commitc8f9bbbf859c0e38cf691b64c67761382fcebfc2 (patch)
tree99529c2277a6b740a6e278985c5147fa649c5497 /src/audio_core/algorithm/interpolate.cpp
parentb91f7d5d67a67115926ad03526f71a7cc3dfb326 (diff)
parentb33ce787b7959e1bfd3b5ae4886b6e137fb97711 (diff)
Merge branch 'master' into tlds
Diffstat (limited to 'src/audio_core/algorithm/interpolate.cpp')
-rw-r--r--src/audio_core/algorithm/interpolate.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/audio_core/algorithm/interpolate.cpp b/src/audio_core/algorithm/interpolate.cpp
index 11459821f..3aea9b0f2 100644
--- a/src/audio_core/algorithm/interpolate.cpp
+++ b/src/audio_core/algorithm/interpolate.cpp
@@ -14,7 +14,7 @@
namespace AudioCore {
/// The Lanczos kernel
-static double Lanczos(size_t a, double x) {
+static double Lanczos(std::size_t a, double x) {
if (x == 0.0)
return 1.0;
const double px = M_PI * x;
@@ -37,15 +37,15 @@ std::vector<s16> Interpolate(InterpolationState& state, std::vector<s16> input,
}
state.nyquist.Process(input);
- constexpr size_t taps = InterpolationState::lanczos_taps;
- const size_t num_frames = input.size() / 2;
+ constexpr std::size_t taps = InterpolationState::lanczos_taps;
+ const std::size_t num_frames = input.size() / 2;
std::vector<s16> output;
- output.reserve(static_cast<size_t>(input.size() / ratio + 4));
+ output.reserve(static_cast<std::size_t>(input.size() / ratio + 4));
double& pos = state.position;
auto& h = state.history;
- for (size_t i = 0; i < num_frames; ++i) {
+ for (std::size_t i = 0; i < num_frames; ++i) {
std::rotate(h.begin(), h.end() - 1, h.end());
h[0][0] = input[i * 2 + 0];
h[0][1] = input[i * 2 + 1];
@@ -53,7 +53,7 @@ std::vector<s16> Interpolate(InterpolationState& state, std::vector<s16> input,
while (pos <= 1.0) {
double l = 0.0;
double r = 0.0;
- for (size_t j = 0; j < h.size(); j++) {
+ for (std::size_t j = 0; j < h.size(); j++) {
l += Lanczos(taps, pos + j - taps + 1) * h[j][0];
r += Lanczos(taps, pos + j - taps + 1) * h[j][1];
}