summaryrefslogtreecommitdiff
path: root/src/audio_core/interpolate.cpp
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner2016-09-18 18:01:46 -0700
committerGravatar Yuri Kunde Schlesner2016-09-18 21:14:25 -0700
commit396a8d91a4423d9c793eeff0798d544613647511 (patch)
treee0203961233db1ffcbbca2e15154d71d142c5822 /src/audio_core/interpolate.cpp
parentTweak formatting settings (diff)
downloadyuzu-396a8d91a4423d9c793eeff0798d544613647511.tar.gz
yuzu-396a8d91a4423d9c793eeff0798d544613647511.tar.xz
yuzu-396a8d91a4423d9c793eeff0798d544613647511.zip
Manually tweak source formatting and then re-run clang-format
Diffstat (limited to 'src/audio_core/interpolate.cpp')
-rw-r--r--src/audio_core/interpolate.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/audio_core/interpolate.cpp b/src/audio_core/interpolate.cpp
index 7751c545d..cb1c58a67 100644
--- a/src/audio_core/interpolate.cpp
+++ b/src/audio_core/interpolate.cpp
@@ -71,15 +71,17 @@ StereoBuffer16 None(State& state, const StereoBuffer16& input, float rate_multip
71 71
72StereoBuffer16 Linear(State& state, const StereoBuffer16& input, float rate_multiplier) { 72StereoBuffer16 Linear(State& state, const StereoBuffer16& input, float rate_multiplier) {
73 // Note on accuracy: Some values that this produces are +/- 1 from the actual firmware. 73 // Note on accuracy: Some values that this produces are +/- 1 from the actual firmware.
74 return StepOverSamples(state, input, rate_multiplier, [](u64 fraction, const auto& x0, 74 return StepOverSamples(state, input, rate_multiplier,
75 const auto& x1, const auto& x2) { 75 [](u64 fraction, const auto& x0, const auto& x1, const auto& x2) {
76 // This is a saturated subtraction. (Verified by black-box fuzzing.) 76 // This is a saturated subtraction. (Verified by black-box fuzzing.)
77 s64 delta0 = MathUtil::Clamp<s64>(x1[0] - x0[0], -32768, 32767); 77 s64 delta0 = MathUtil::Clamp<s64>(x1[0] - x0[0], -32768, 32767);
78 s64 delta1 = MathUtil::Clamp<s64>(x1[1] - x0[1], -32768, 32767); 78 s64 delta1 = MathUtil::Clamp<s64>(x1[1] - x0[1], -32768, 32767);
79 79
80 return std::array<s16, 2>{static_cast<s16>(x0[0] + fraction * delta0 / scale_factor), 80 return std::array<s16, 2>{
81 static_cast<s16>(x0[1] + fraction * delta1 / scale_factor)}; 81 static_cast<s16>(x0[0] + fraction * delta0 / scale_factor),
82 }); 82 static_cast<s16>(x0[1] + fraction * delta1 / scale_factor),
83 };
84 });
83} 85}
84 86
85} // namespace AudioInterp 87} // namespace AudioInterp