summaryrefslogtreecommitdiff
path: root/src/audio_core/interpolate.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/audio_core/interpolate.h')
-rw-r--r--src/audio_core/interpolate.h49
1 files changed, 0 insertions, 49 deletions
diff --git a/src/audio_core/interpolate.h b/src/audio_core/interpolate.h
deleted file mode 100644
index 8dff6111a..000000000
--- a/src/audio_core/interpolate.h
+++ /dev/null
@@ -1,49 +0,0 @@
1// Copyright 2016 Citra Emulator Project
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7#include <array>
8#include <deque>
9#include "audio_core/hle/common.h"
10#include "common/common_types.h"
11
12namespace AudioInterp {
13
14/// A variable length buffer of signed PCM16 stereo samples.
15using StereoBuffer16 = std::deque<std::array<s16, 2>>;
16
17struct State {
18 /// Two historical samples.
19 std::array<s16, 2> xn1 = {}; ///< x[n-1]
20 std::array<s16, 2> xn2 = {}; ///< x[n-2]
21 /// Current fractional position.
22 u64 fposition = 0;
23};
24
25/**
26 * No interpolation. This is equivalent to a zero-order hold. There is a two-sample predelay.
27 * @param state Interpolation state.
28 * @param input Input buffer.
29 * @param rate Stretch factor. Must be a positive non-zero value.
30 * rate > 1.0 performs decimation and rate < 1.0 performs upsampling.
31 * @param output The resampled audio buffer.
32 * @param outputi The index of output to start writing to.
33 */
34void None(State& state, StereoBuffer16& input, float rate, DSP::HLE::StereoFrame16& output,
35 size_t& outputi);
36
37/**
38 * Linear interpolation. This is equivalent to a first-order hold. There is a two-sample predelay.
39 * @param state Interpolation state.
40 * @param input Input buffer.
41 * @param rate Stretch factor. Must be a positive non-zero value.
42 * rate > 1.0 performs decimation and rate < 1.0 performs upsampling.
43 * @param output The resampled audio buffer.
44 * @param outputi The index of output to start writing to.
45 */
46void Linear(State& state, StereoBuffer16& input, float rate, DSP::HLE::StereoFrame16& output,
47 size_t& outputi);
48
49} // namespace AudioInterp