-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathframe.h
62 lines (51 loc) · 880 Bytes
/
frame.h
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
55
56
57
58
59
60
61
62
#ifndef _FRAME_H_
#define _FRAME_H_
#include <cstdint>
#include "constants.h"
#include "bitwriter.h"
struct Main_header
{
uint8_t channels,
bps;
uint32_t sample_rate;
};
struct Frame_header
{
uint32_t blocksize;
};
enum Subframe_type : uint8_t
{
CONSTANT = 1,
VERBATIUM = 2,
FIXED = 3
};
struct Subframe_Constant
{
int32_t value;
};
struct Subframe_Verbatium
{
const int32_t *data = nullptr;
};
struct Subframe_Fixed
{
uint8_t order, rice_parameter;
int32_t warmup[MAX_FIXED_ORDER];
bitwriter bw_data;
};
struct Subframe_header
{
Subframe_type type;
union _data
{
Subframe_Constant constant;
Subframe_Verbatium verbatium;
Subframe_Fixed fixed;
_data() {}
~_data() {}
} data;
uint8_t wasted_bits;
Subframe_header() {}
~Subframe_header() {}
};
#endif