diff options
author | heapo <heapo3@gmail.com> | 2018-12-06 18:15:47 +0100 |
---|---|---|
committer | heapo <heapo3@gmail.com> | 2018-12-06 18:46:08 +0100 |
commit | 117b1f3ec1bae4d9be68cf401f739fc7d35fcc40 (patch) | |
tree | 1baa2c45bf3c1f63b0820a10ef8cae69c410bcd4 /src/audio_core/algorithm | |
parent | Merge pull request #1824 from ReinUsesLisp/fbcache (diff) | |
download | yuzu-117b1f3ec1bae4d9be68cf401f739fc7d35fcc40.tar yuzu-117b1f3ec1bae4d9be68cf401f739fc7d35fcc40.tar.gz yuzu-117b1f3ec1bae4d9be68cf401f739fc7d35fcc40.tar.bz2 yuzu-117b1f3ec1bae4d9be68cf401f739fc7d35fcc40.tar.lz yuzu-117b1f3ec1bae4d9be68cf401f739fc7d35fcc40.tar.xz yuzu-117b1f3ec1bae4d9be68cf401f739fc7d35fcc40.tar.zst yuzu-117b1f3ec1bae4d9be68cf401f739fc7d35fcc40.zip |
Diffstat (limited to 'src/audio_core/algorithm')
-rw-r--r-- | src/audio_core/algorithm/interpolate.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/audio_core/algorithm/interpolate.cpp b/src/audio_core/algorithm/interpolate.cpp index 3aea9b0f2..5005ba519 100644 --- a/src/audio_core/algorithm/interpolate.cpp +++ b/src/audio_core/algorithm/interpolate.cpp @@ -54,8 +54,9 @@ std::vector<s16> Interpolate(InterpolationState& state, std::vector<s16> input, double l = 0.0; double r = 0.0; 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]; + const double lanczos_calc = Lanczos(taps, pos + j - taps + 1); + l += lanczos_calc * h[j][0]; + r += lanczos_calc * h[j][1]; } output.emplace_back(static_cast<s16>(std::clamp(l, -32768.0, 32767.0))); output.emplace_back(static_cast<s16>(std::clamp(r, -32768.0, 32767.0))); |