ref: 9a79041c6c79453138f005107b481803c59e4659
parent: 48386d443bf6e1e2828b9347fae7e08cdb745751
author: Clownacy <Clownacy@users.noreply.github.com>
date: Mon Aug 31 13:23:44 EDT 2020
Optimise the Lanczos resampler a little Apprently floating-point divisions are slower than multiplications
--- a/src/Backends/Audio/SoftwareMixer.cpp
+++ b/src/Backends/Audio/SoftwareMixer.cpp
@@ -170,7 +170,7 @@
const double nx = 3.14159265358979323846 * kernel_input;
const double nxa = nx / kernel_radius;
- accumulator += input_sample * (sin(nx) / nx) * (sin(nxa) / nxa);
+ accumulator += input_sample * (sin(nx) * sin(nxa) / (nx * nxa));
}
}