aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/audio_core/opus/parameters.h
blob: 47c418b9fc6345412ca2fe54d51ada400d299919 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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_NOINIT(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_NOINIT(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