summaryrefslogtreecommitdiffstats
path: root/src/audio_core/opus/parameters.h
diff options
context:
space:
mode:
authorKelebek1 <eeeedddccc@hotmail.co.uk>2023-08-31 16:09:15 +0200
committerLiam <byteslice@airmail.cc>2023-09-16 17:56:25 +0200
commit67e2d5c28b8423c4f3f1d5b00f87325684158a6f (patch)
treee419a2bb6c064ddc69a49046705b6187772fee48 /src/audio_core/opus/parameters.h
parentMerge pull request #11519 from german77/system-policy (diff)
downloadyuzu-67e2d5c28b8423c4f3f1d5b00f87325684158a6f.tar
yuzu-67e2d5c28b8423c4f3f1d5b00f87325684158a6f.tar.gz
yuzu-67e2d5c28b8423c4f3f1d5b00f87325684158a6f.tar.bz2
yuzu-67e2d5c28b8423c4f3f1d5b00f87325684158a6f.tar.lz
yuzu-67e2d5c28b8423c4f3f1d5b00f87325684158a6f.tar.xz
yuzu-67e2d5c28b8423c4f3f1d5b00f87325684158a6f.tar.zst
yuzu-67e2d5c28b8423c4f3f1d5b00f87325684158a6f.zip
Diffstat (limited to 'src/audio_core/opus/parameters.h')
-rw-r--r--src/audio_core/opus/parameters.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/audio_core/opus/parameters.h b/src/audio_core/opus/parameters.h
new file mode 100644
index 000000000..4c54b2825
--- /dev/null
+++ b/src/audio_core/opus/parameters.h
@@ -0,0 +1,54 @@
+// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#pragma once
+
+#include "common/common_funcs.h"
+#include "common/common_types.h"
+
+namespace AudioCore::OpusDecoder {
+constexpr size_t OpusStreamCountMax = 255;
+constexpr size_t MaxChannels = 2;
+
+struct OpusParameters {
+ /* 0x00 */ u32 sample_rate;
+ /* 0x04 */ u32 channel_count;
+}; // size = 0x8
+static_assert(sizeof(OpusParameters) == 0x8, "OpusParameters has the wrong size!");
+
+struct OpusParametersEx {
+ /* 0x00 */ u32 sample_rate;
+ /* 0x04 */ u32 channel_count;
+ /* 0x08 */ bool use_large_frame_size;
+ /* 0x09 */ INSERT_PADDING_BYTES(7);
+}; // size = 0x10
+static_assert(sizeof(OpusParametersEx) == 0x10, "OpusParametersEx has the wrong size!");
+
+struct OpusMultiStreamParameters {
+ /* 0x00 */ u32 sample_rate;
+ /* 0x04 */ u32 channel_count;
+ /* 0x08 */ u32 total_stream_count;
+ /* 0x0C */ u32 stereo_stream_count;
+ /* 0x10 */ std::array<u8, OpusStreamCountMax + 1> mappings;
+}; // size = 0x110
+static_assert(sizeof(OpusMultiStreamParameters) == 0x110,
+ "OpusMultiStreamParameters has the wrong size!");
+
+struct OpusMultiStreamParametersEx {
+ /* 0x00 */ u32 sample_rate;
+ /* 0x04 */ u32 channel_count;
+ /* 0x08 */ u32 total_stream_count;
+ /* 0x0C */ u32 stereo_stream_count;
+ /* 0x10 */ bool use_large_frame_size;
+ /* 0x11 */ INSERT_PADDING_BYTES(7);
+ /* 0x18 */ std::array<u8, OpusStreamCountMax + 1> mappings;
+}; // size = 0x118
+static_assert(sizeof(OpusMultiStreamParametersEx) == 0x118,
+ "OpusMultiStreamParametersEx has the wrong size!");
+
+struct OpusPacketHeader {
+ /* 0x00 */ u32 size;
+ /* 0x04 */ u32 final_range;
+}; // size = 0x8
+static_assert(sizeof(OpusPacketHeader) == 0x8, "OpusPacketHeader has the wrong size!");
+} // namespace AudioCore::OpusDecoder