diff options
| author | 2020-10-13 16:00:33 -0400 | |
|---|---|---|
| committer | 2020-10-13 16:36:58 -0400 | |
| commit | 9f9b64d280d50b39c92e8e12c6f45ef78a72b4ea (patch) | |
| tree | d1a143eb839744bc1515700c861ec7e5d04d130e /src/audio_core/algorithm | |
| parent | Merge pull request #4786 from lioncash/flags (diff) | |
| download | yuzu-9f9b64d280d50b39c92e8e12c6f45ef78a72b4ea.tar.gz yuzu-9f9b64d280d50b39c92e8e12c6f45ef78a72b4ea.tar.xz yuzu-9f9b64d280d50b39c92e8e12c6f45ef78a72b4ea.zip | |
audio_core/CMakeLists: Make warnings consistent with core
Normalizes the warnings shared between audio_core and core.
Diffstat (limited to 'src/audio_core/algorithm')
| -rw-r--r-- | src/audio_core/algorithm/filter.cpp | 3 | ||||
| -rw-r--r-- | src/audio_core/algorithm/interpolate.cpp | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/audio_core/algorithm/filter.cpp b/src/audio_core/algorithm/filter.cpp index f65bf64f7..f34a5b9f3 100644 --- a/src/audio_core/algorithm/filter.cpp +++ b/src/audio_core/algorithm/filter.cpp | |||
| @@ -55,7 +55,8 @@ void Filter::Process(std::vector<s16>& signal) { | |||
| 55 | /// @param total_count The total number of biquads to be cascaded. | 55 | /// @param total_count The total number of biquads to be cascaded. |
| 56 | /// @param index 0-index of the biquad to calculate the Q value for. | 56 | /// @param index 0-index of the biquad to calculate the Q value for. |
| 57 | static double CascadingBiquadQ(std::size_t total_count, std::size_t index) { | 57 | static double CascadingBiquadQ(std::size_t total_count, std::size_t index) { |
| 58 | const double pole = M_PI * (2 * index + 1) / (4.0 * total_count); | 58 | const auto pole = |
| 59 | M_PI * static_cast<double>(2 * index + 1) / (4.0 * static_cast<double>(total_count)); | ||
| 59 | return 1.0 / (2.0 * std::cos(pole)); | 60 | return 1.0 / (2.0 * std::cos(pole)); |
| 60 | } | 61 | } |
| 61 | 62 | ||
diff --git a/src/audio_core/algorithm/interpolate.cpp b/src/audio_core/algorithm/interpolate.cpp index 689a54508..699fcb84c 100644 --- a/src/audio_core/algorithm/interpolate.cpp +++ b/src/audio_core/algorithm/interpolate.cpp | |||
| @@ -146,7 +146,7 @@ std::vector<s16> Interpolate(InterpolationState& state, std::vector<s16> input, | |||
| 146 | return {}; | 146 | return {}; |
| 147 | 147 | ||
| 148 | if (ratio <= 0) { | 148 | if (ratio <= 0) { |
| 149 | LOG_CRITICAL(Audio, "Nonsensical interpolation ratio {}", ratio); | 149 | LOG_ERROR(Audio, "Nonsensical interpolation ratio {}", ratio); |
| 150 | return input; | 150 | return input; |
| 151 | } | 151 | } |
| 152 | 152 | ||
| @@ -164,7 +164,8 @@ std::vector<s16> Interpolate(InterpolationState& state, std::vector<s16> input, | |||
| 164 | const std::size_t num_frames{input.size() / 2}; | 164 | const std::size_t num_frames{input.size() / 2}; |
| 165 | 165 | ||
| 166 | std::vector<s16> output; | 166 | std::vector<s16> output; |
| 167 | output.reserve(static_cast<std::size_t>(input.size() / ratio + InterpolationState::taps)); | 167 | output.reserve(static_cast<std::size_t>(static_cast<double>(input.size()) / ratio + |
| 168 | InterpolationState::taps)); | ||
| 168 | 169 | ||
| 169 | for (std::size_t frame{}; frame < num_frames; ++frame) { | 170 | for (std::size_t frame{}; frame < num_frames; ++frame) { |
| 170 | const std::size_t lut_index{(state.fraction >> 8) * InterpolationState::taps}; | 171 | const std::size_t lut_index{(state.fraction >> 8) * InterpolationState::taps}; |