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
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Bandwidth {
NarrowBand = 0,
WideBand = 1,
SemiSuperWideBand = 2,
SuperWideBand = 3,
FullBand = 4,
}
#[derive(Debug)]
pub struct SideInfo {
pub bandwidth: Bandwidth,
pub lastnz: usize,
pub lsb_mode: bool,
pub global_gain_index: usize,
pub num_tns_filters: usize,
pub reflect_coef_order_ari_input: [usize; 2],
pub sns_vq: SnsVq,
pub long_term_post_filter_info: LongTermPostFilterInfo,
pub noise_factor: usize,
}
#[derive(Debug, Clone, Copy)]
pub struct LongTermPostFilterInfo {
pub pitch_present: bool,
pub is_active: bool,
pub pitch_index: usize,
}
impl LongTermPostFilterInfo {
pub fn new(is_active: bool, pitch_present: bool, pitch_index: usize) -> Self {
Self {
is_active,
pitch_present,
pitch_index,
}
}
}
#[derive(Debug)]
pub struct SnsVq {
pub ind_lf: usize,
pub ind_hf: usize,
pub ls_inda: usize,
pub ls_indb: usize,
pub idx_a: usize,
pub idx_b: usize,
pub submode_lsb: u8,
pub submode_msb: u8,
pub g_ind: usize,
}