huangcm
2024-12-18 9d29be7f7249789d6ffd0440067187a9f040c2cd
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
/******************************************************************************
 *                                                                            *
 * Copyright (C) 2018 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at:
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 *****************************************************************************
 * Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore
*/
#ifndef IXHEAACD_BLOCK_H
#define IXHEAACD_BLOCK_H
 
#define IQ_TABLE_SIZE_HALF 128
 
VOID ixheaacd_inverse_quantize(WORD32 *x_invquant, WORD no_band,
                               WORD32 *ixheaacd_pow_table_Q13,
                               WORD8 *scratch_in);
 
VOID ixheaacd_scale_factor_process_dec(WORD32 *x_invquant, WORD16 *scale_fact,
                                       WORD no_band, WORD8 *width,
                                       WORD32 *scale_tables_ptr,
                                       WORD32 total_channels,
                                       WORD32 object_type,
                                       WORD32 aac_sf_data_resil_flag);
 
VOID ixheaacd_scale_factor_process_armv7(WORD32 *x_invquant, WORD16 *scale_fact,
                                         WORD no_band, WORD8 *width,
                                         WORD32 *scale_tables_ptr,
                                         WORD32 total_channels,
                                         WORD32 object_type,
                                         WORD32 aac_sf_data_resil_flag);
 
VOID ixheaacd_scale_factor_process_armv8(WORD32 *x_invquant, WORD16 *scale_fact,
                                         WORD no_band, WORD8 *width,
                                         WORD32 *scale_tables_ptr,
                                         WORD32 total_channels,
                                         WORD32 object_type,
                                         WORD32 aac_sf_data_resil_flag);
 
void ixheaacd_right_shift_block(WORD32 *p_spectrum, WORD length,
                                WORD shift_val);
 
WORD ixheaacd_decode_huffman(ia_bit_buf_struct *it_bit_buff, WORD32 cb_no,
                             WORD32 *spec_coef, WORD16 *sfb_offset, WORD start,
                             WORD sfb, WORD group_len,
                             ia_aac_dec_tables_struct *ptr_aac_tables);
 
WORD ixheaacd_huffman_dec_word2(ia_bit_buf_struct *it_bit_buff, WORD32 cb_no,
                                WORD32 width,
                                ia_aac_dec_tables_struct *ptr_aac_tables,
                                WORD32 *x_invquant, WORD8 *scratch_ptr);
 
VOID ixheaacd_read_scale_factor_data(
    ia_bit_buf_struct *it_bit_buff,
    ia_aac_dec_channel_info_struct *ptr_aac_dec_channel_info,
    ia_aac_dec_tables_struct *ptr_aac_tables, WORD32 object_type);
 
WORD16 ixheaacd_read_spectral_data(
    ia_bit_buf_struct *it_bit_buff,
    ia_aac_dec_channel_info_struct *ptr_aac_dec_channel_info,
    ia_aac_dec_tables_struct *ptr_aac_tables, WORD32 total_channels,
    WORD32 frame_size, WORD32 object_type, WORD32 aac_spect_data_resil_flag,
    WORD32 aac_sf_data_resil_flag);
 
WORD16 ixheaacd_read_section_data(
    ia_bit_buf_struct *it_bit_buff,
    ia_aac_dec_channel_info_struct *ptr_aac_dec_channel_info,
    WORD32 aac_spect_data_resil_flag, WORD32 aac_sect_data_resil_flag,
    ia_aac_dec_tables_struct *ptr_aac_tables);
 
VOID ixheaacd_over_lap_add1_dec(WORD32 *coef, WORD32 *prev, WORD16 *out,
                                const WORD16 *window, WORD16 q_shift,
                                WORD16 size, WORD16 ch_fac);
 
VOID ixheaacd_over_lap_add1_armv7(WORD32 *coef, WORD32 *prev, WORD16 *out,
                                  const WORD16 *window, WORD16 q_shift,
                                  WORD16 size, WORD16 ch_fac);
 
VOID ixheaacd_over_lap_add1_armv8(WORD32 *coef, WORD32 *prev, WORD16 *out,
                                  const WORD16 *window, WORD16 q_shift,
                                  WORD16 size, WORD16 ch_fac);
 
VOID ixheaacd_over_lap_add2_dec(WORD32 *coef, WORD32 *prev, WORD32 *out,
                                const WORD16 *window, WORD16 q_shift,
                                WORD16 size, WORD16 ch_fac);
 
VOID ixheaacd_over_lap_add2_armv7(WORD32 *coef, WORD32 *prev, WORD32 *out,
                                  const WORD16 *window, WORD16 q_shift,
                                  WORD16 size, WORD16 ch_fac);
 
VOID ixheaacd_over_lap_add2_armv8(WORD32 *coef, WORD32 *prev, WORD32 *out,
                                  const WORD16 *window, WORD16 q_shift,
                                  WORD16 size, WORD16 ch_fac);
 
VOID ixheaacd_set_corr_info(
    ia_aac_dec_channel_info_struct *ptr_aac_dec_channel_info, WORD16 pns_band);
 
VOID ixheaacd_gen_rand_vec(WORD32 scale, WORD shift, WORD32 *spec,
                           WORD32 sfb_width, WORD32 *random_vec);
 
VOID ixheaacd_pns_process(
    ia_aac_dec_channel_info_struct *ptr_aac_dec_channel_info[], WORD32 channel,
    ia_aac_dec_tables_struct *ptr_aac_tables);
 
VOID ixheaacd_spec_to_overlapbuf_dec(WORD32 *ptr_overlap_buf,
                                     WORD32 *ptr_spec_coeff, WORD32 q_shift,
                                     WORD32 size);
 
VOID ixheaacd_spec_to_overlapbuf_armv7(WORD32 *ptr_overlap_buf,
                                       WORD32 *ptr_spec_coeff, WORD32 q_shift,
                                       WORD32 size);
 
VOID ixheaacd_overlap_buf_out_dec(WORD16 *out_samples, WORD32 *ptr_overlap_buf,
                                  WORD32 size, const WORD16 ch_fac);
 
VOID ixheaacd_overlap_buf_out_armv7(WORD16 *out_samples,
                                    WORD32 *ptr_overlap_buf, WORD32 size,
                                    const WORD16 ch_fac);
 
WORD32 ixheaacd_inv_quant(WORD32 *x_quant, WORD32 *ixheaacd_pow_table_Q13);
 
VOID ixheaacd_imdct_process(ia_aac_dec_overlap_info *ptr_aac_dec_overlap_info,
                            WORD32 *ptr_spec_coeff,
                            ia_ics_info_struct *ptr_ics_info,
                            WORD16 out_samples[], const WORD16 ch_fac,
                            WORD32 *scratch,
                            ia_aac_dec_tables_struct *ptr_aac_tables,
                            WORD32 object_type);
 
VOID ixheaacd_neg_shift_spec_dec(WORD32 *coef, WORD16 *out, WORD16 q_shift,
                                 WORD16 ch_fac);
 
VOID ixheaacd_neg_shift_spec_armv7(WORD32 *coef, WORD16 *out, WORD16 q_shift,
                                   WORD16 ch_fac);
 
VOID ixheaacd_neg_shift_spec_armv8(WORD32 *coef, WORD16 *out, WORD16 q_shift,
                                   WORD16 ch_fac);
 
VOID ixheaacd_nolap1_32(WORD32 *coef, WORD32 *out, WORD16 cu_scale,
                        WORD16 stride);
 
VOID ixheaacd_overlap_out_copy_dec(WORD16 *out_samples, WORD32 *ptr_overlap_buf,
                                   WORD32 *ptr_overlap_buf1,
                                   const WORD16 ch_fac);
 
VOID ixheaacd_overlap_out_copy_armv7(WORD16 *out_samples,
                                     WORD32 *ptr_overlap_buf,
                                     WORD32 *ptr_overlap_buf1,
                                     const WORD16 ch_fac);
 
VOID ixheaacd_long_short_win_seq(WORD32 *current, WORD32 *prev, WORD16 *out,
                                 const WORD16 *short_window,
                                 const WORD16 *short_window_prev,
                                 const WORD16 *long_window_prev, WORD16 q_shift,
                                 WORD16 ch_fac);
 
WORD32 ixheaacd_cnt_leading_ones(WORD32 a);
 
VOID ixheaacd_huffman_decode(WORD32 it_bit_buff, WORD16 *huff_index,
                             WORD16 *len, const UWORD16 *input_table,
                             const UWORD32 *idx_table);
 
void ixheaacd_eld_dec_windowing(WORD32 *ptr_spect_coeff, const WORD16 *ptr_win,
                                WORD32 framesize, WORD16 q_shift,
                                WORD32 *ptr_overlap_buf, const WORD16 stride,
                                WORD16 *out_samples);
 
WORD32 ixheaacd_extension_payload(ia_bit_buf_struct *it_bit_buff, WORD32 cnt);
 
VOID ixheaacd_process_single_scf(WORD32 scale_factor, WORD32 *x_invquant,
                                 WORD32 width, WORD32 *ptr_scale_table,
                                 WORD32 total_channels, WORD32 object_type,
                                 WORD32 aac_sf_data_resil_flag);
 
void ixheaacd_lap1_512_480(WORD32 *coef, WORD32 *prev, WORD16 *out,
                           const WORD16 *window, WORD16 q_shift, WORD16 size,
                           WORD16 stride);
 
#endif /* #ifndef IXHEAACD_BLOCK_H */