diff options
author | Kelebek1 <eeeedddccc@hotmail.co.uk> | 2022-07-17 00:48:45 +0200 |
---|---|---|
committer | Kelebek1 <eeeedddccc@hotmail.co.uk> | 2022-07-22 02:11:32 +0200 |
commit | 458da8a94877677f086f06cdeecf959ec4283a33 (patch) | |
tree | 583166d77602ad90a0d552f37de8729ad80fd6c1 /src/audio_core/algorithm/interpolate.h | |
parent | Merge pull request #8598 from Link4565/recv-dontwait (diff) | |
download | yuzu-458da8a94877677f086f06cdeecf959ec4283a33.tar yuzu-458da8a94877677f086f06cdeecf959ec4283a33.tar.gz yuzu-458da8a94877677f086f06cdeecf959ec4283a33.tar.bz2 yuzu-458da8a94877677f086f06cdeecf959ec4283a33.tar.lz yuzu-458da8a94877677f086f06cdeecf959ec4283a33.tar.xz yuzu-458da8a94877677f086f06cdeecf959ec4283a33.tar.zst yuzu-458da8a94877677f086f06cdeecf959ec4283a33.zip |
Diffstat (limited to '')
-rw-r--r-- | src/audio_core/algorithm/interpolate.h | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/src/audio_core/algorithm/interpolate.h b/src/audio_core/algorithm/interpolate.h deleted file mode 100644 index 5e59f4d70..000000000 --- a/src/audio_core/algorithm/interpolate.h +++ /dev/null @@ -1,43 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include <array> -#include <vector> - -#include "common/common_types.h" - -namespace AudioCore { - -struct InterpolationState { - static constexpr std::size_t taps{4}; - static constexpr std::size_t history_size{taps * 2 - 1}; - std::array<std::array<s16, 2>, history_size> history{}; - double position{}; - s32 fraction{}; -}; - -/// Interpolates input signal to produce output signal. -/// @param input The signal to interpolate. -/// @param ratio Interpolation ratio. -/// ratio > 1.0 results in fewer output samples. -/// ratio < 1.0 results in more output samples. -/// @returns Output signal. -std::vector<s16> Interpolate(InterpolationState& state, std::vector<s16> input, double ratio); - -/// Interpolates input signal to produce output signal. -/// @param input The signal to interpolate. -/// @param input_rate The sample rate of input. -/// @param output_rate The desired sample rate of the output. -/// @returns Output signal. -inline std::vector<s16> Interpolate(InterpolationState& state, std::vector<s16> input, - u32 input_rate, u32 output_rate) { - const double ratio = static_cast<double>(input_rate) / static_cast<double>(output_rate); - return Interpolate(state, std::move(input), ratio); -} - -/// Nintendo Switchs DSP resampling algorithm. Based on a single channel -void Resample(s32* output, const s32* input, s32 pitch, s32& fraction, std::size_t sample_count); - -} // namespace AudioCore |