summaryrefslogtreecommitdiff
path: root/src/audio_core/codec.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/audio_core/codec.h')
-rw-r--r--src/audio_core/codec.h51
1 files changed, 0 insertions, 51 deletions
diff --git a/src/audio_core/codec.h b/src/audio_core/codec.h
deleted file mode 100644
index 877b2202d..000000000
--- a/src/audio_core/codec.h
+++ /dev/null
@@ -1,51 +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 "common/common_types.h"
10
11namespace Codec {
12
13/// A variable length buffer of signed PCM16 stereo samples.
14using StereoBuffer16 = std::deque<std::array<s16, 2>>;
15
16/// See: Codec::DecodeADPCM
17struct ADPCMState {
18 // Two historical samples from previous processed buffer,
19 // required for ADPCM decoding
20 s16 yn1; ///< y[n-1]
21 s16 yn2; ///< y[n-2]
22};
23
24/**
25 * @param data Pointer to buffer that contains ADPCM data to decode
26 * @param sample_count Length of buffer in terms of number of samples
27 * @param adpcm_coeff ADPCM coefficients
28 * @param state ADPCM state, this is updated with new state
29 * @return Decoded stereo signed PCM16 data, sample_count in length
30 */
31StereoBuffer16 DecodeADPCM(const u8* const data, const size_t sample_count,
32 const std::array<s16, 16>& adpcm_coeff, ADPCMState& state);
33
34/**
35 * @param num_channels Number of channels
36 * @param data Pointer to buffer that contains PCM8 data to decode
37 * @param sample_count Length of buffer in terms of number of samples
38 * @return Decoded stereo signed PCM16 data, sample_count in length
39 */
40StereoBuffer16 DecodePCM8(const unsigned num_channels, const u8* const data,
41 const size_t sample_count);
42
43/**
44 * @param num_channels Number of channels
45 * @param data Pointer to buffer that contains PCM16 data to decode
46 * @param sample_count Length of buffer in terms of number of samples
47 * @return Decoded stereo signed PCM16 data, sample_count in length
48 */
49StereoBuffer16 DecodePCM16(const unsigned num_channels, const u8* const data,
50 const size_t sample_count);
51};