lin
2025-07-30 fcd736bf35fd93b563e9bbf594f2aa7b62028cc9
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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
/******************************************************************************
 *                                                                            *
 * 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_QMF_DEC_H
#define IXHEAACD_QMF_DEC_H
 
typedef struct {
  WORD32 no_channels;
  const WORD16 *analy_win_coeff;
  const WORD16 *p_filter;
  const WORD16 *cos_twiddle;
  const WORD16 *sin_twiddle;
  const WORD16 *alt_sin_twiddle;
  const WORD16 *t_cos;
  const WORD16 *t_sin;
 
  WORD16 *anal_filter_states;
  WORD16 *filter_states;
  WORD16 num_time_slots;
 
  WORD16 lsb;
  WORD16 usb;
 
  WORD16 qmf_filter_state_size;
  WORD16 *core_samples_buffer;
  WORD16 ana_offset;
  WORD16 *filter_pos;
  WORD16 *dummy_0;
  WORD16 ixheaacd_drc_offset;
  WORD16 *filter_pos_syn;
  WORD16 *dummy_1;
 
  WORD32 *analy_win_coeff_32;
  const WORD32 *p_filter_32;
  const WORD32 *esbr_cos_twiddle;
  const WORD32 *esbr_alt_sin_twiddle;
  const WORD32 *esbr_t_cos;
  WORD32 *anal_filter_states_32;
  WORD32 *state_new_samples_pos_low_32;
  WORD32 *filter_states_32;
  WORD32 *filter_pos_32;
  WORD32 *filter_pos_syn_32;
 
  WORD16 *fp1_anal;
  WORD16 *fp2_anal;
  WORD16 *filter_2;
 
  WORD16 *fp1_syn;
  WORD16 *fp2_syn;
  WORD16 sixty4;
 
} ia_sbr_qmf_filter_bank_struct;
 
VOID ixheaacd_cplx_anal_qmffilt(const WORD16 *time_inp,
                                ia_sbr_scale_fact_struct *sbr_scale_factor,
                                WORD32 **qmf_real, WORD32 **qmf_imag,
                                ia_sbr_qmf_filter_bank_struct *qmf_bank,
                                ia_qmf_dec_tables_struct *qmf_dec_tables_ptr,
                                WORD ch_fac, WORD32 low_pow_flag,
                                WORD audio_object_type);
 
VOID ixheaacd_cplx_synt_qmffilt(
    WORD32 **qmf_real, WORD32 **qmf_im, WORD32 split_slot,
    ia_sbr_scale_fact_struct *sbr_scale_factor, WORD16 *time_out,
    ia_sbr_qmf_filter_bank_struct *qmf_bank, ia_ps_dec_struct *ptr_ps_dec,
    FLAG active, FLAG low_pow_flag, ia_sbr_tables_struct *sbr_tables_ptr,
    ixheaacd_misc_tables *pstr_common_tables, WORD ch_fac, FLAG drc_on,
    WORD32 drc_sbr_factors[][64], WORD32 audio_object_type);
 
VOID ixheaacd_esbr_qmfanal32_winadd(WORD32 *inp1, WORD32 *inp2,
                                    WORD32 *tmp_qmf_1, WORD32 *tmp_qmf_2,
                                    WORD32 *out, WORD32 num_band);
 
VOID ixheaacd_esbr_fwd_modulation(const WORD32 *time_in, WORD32 *r_subband,
                                  WORD32 *i_subband,
                                  ia_sbr_qmf_filter_bank_struct *qmf_bank,
                                  ia_qmf_dec_tables_struct *qmf_dec_tables_ptr);
 
VOID ixheaacd_esbr_inv_modulation(WORD32 *qmf_real,
                                  ia_sbr_qmf_filter_bank_struct *syn_qmf,
                                  ia_qmf_dec_tables_struct *qmf_dec_tables_ptr);
 
VOID ixheaacd_shiftrountine_with_rnd_hq(WORD32 *qmf_real, WORD32 *qmf_imag,
                                        WORD32 *filter_states, WORD32 len,
                                        WORD32 shift);
 
VOID ixheaacd_esbr_qmfsyn64_winadd(WORD32 *tmp1, WORD32 *tmp2, WORD32 *tmp3,
                                   WORD32 *sample_buffer, WORD ch_fac);
 
VOID ixheaacd_sbr_qmfanal32_winadds(WORD16 *fp1, WORD16 *fp2, WORD16 *filter_1,
                                    WORD16 *filter_2, WORD32 *analysis_buffer,
                                    WORD16 *filter_states,
                                    const WORD16 *time_sample_buf,
                                    WORD32 ch_fac);
 
VOID ixheaacd_sbr_qmfanal32_winadds_eld(WORD16 *fp1, WORD16 *fp2,
                                        WORD16 *filter_1, WORD16 *filter_2,
                                        WORD32 *analysis_buffer,
                                        WORD16 *filter_states,
                                        const WORD16 *time_sample_buf,
                                        WORD32 ch_fac);
 
VOID ixheaacd_fwd_modulation(const WORD32 *p_time_in1, WORD32 *real_subband,
                             WORD32 *imag_subband,
                             ia_sbr_qmf_filter_bank_struct *qmf_bank,
                             ia_qmf_dec_tables_struct *qmf_dec_tables_ptr);
VOID ixheaacd_dct3_32(WORD32 *input, WORD32 *output,
                      const WORD16 *main_twidle_fwd, const WORD16 *post_tbl,
                      const WORD16 *w_16, const WORD32 *p_table);
 
VOID ixheaacd_dec_DCT2_64_asm(WORD32 *dct_in, WORD32 *ptime_out, WORD32 *w1024,
                              UWORD8 *dig_rev_table2_128, WORD16 *post_fft_tbl,
                              WORD16 *dct23_tw, WORD16 *filter_states);
VOID ixheaacd_cos_sin_mod(WORD32 *subband,
                          ia_sbr_qmf_filter_bank_struct *qmf_bank,
                          WORD16 *p_twiddle, WORD32 *p_dig_rev_tbl);
VOID ixheaacd_shiftrountine(WORD32 *qmf_real, WORD32 *qmf_imag, WORD32 len,
                            WORD32 common_shift);
VOID ixheaacd_shiftrountine_with_rnd(WORD32 *qmf_real, WORD32 *qmf_imag,
                                     WORD16 *filter_states, WORD32 len,
                                     WORD32 shift);
 
VOID ixheaacd_radix4bfly(const WORD16 *w, WORD32 *x, WORD32 npoints,
                         WORD32 ch_fac);
 
VOID ixheaacd_postradixcompute4(WORD32 *ptr_y, WORD32 *ptr_x,
                                const WORD32 *p_dig_rev_tbl, WORD32 npoints);
 
VOID ixheaacd_postradixcompute2(WORD32 *ptr_y, WORD32 *ptr_x,
                                const WORD32 *p_dig_rev_tbl, WORD32 npoints);
 
VOID ixheaacd_shiftrountine_with_rnd_eld(WORD32 *qmf_real, WORD32 *qmf_imag,
                                         WORD16 *filter_states, WORD32 len,
                                         WORD32 shift);
 
void ixheaacd_sbr_imdct_using_fft(const WORD32 *ptr_w, WORD32 npoints,
                                  WORD32 *ptr_x, WORD32 *ptr_y,
                                  UWORD8 *bit_rev_1024, UWORD8 *bit_rev_512,
                                  UWORD8 *bit_rev_128, UWORD8 *bit_rev_32);
 
VOID ixheaacd_esbr_cos_sin_mod_loop1(WORD32 *subband, WORD32 M,
                                     const WORD32 *p_sin_cos,
                                     WORD32 subband_tmp[]);
 
VOID ixheaacd_esbr_cos_sin_mod_loop2(WORD32 *subband, const WORD32 *p_sin,
                                     WORD32 M);
 
VOID ixheaacd_esbr_radix4bfly(const WORD32 *p_twiddle, WORD32 subband_tmp[],
                              WORD32 a, WORD32 npoint);
 
VOID ixheaacd_radix4bfly(const WORD16 *w, WORD32 *x, WORD32 npoints,
                         WORD32 ch_fac);
 
VOID ixheaacd_postradixcompute4(WORD32 *ptr_y, WORD32 *ptr_x,
                                const WORD32 *p_dig_rev_tbl, WORD32 npoints);
 
VOID ixheaacd_postradixcompute2(WORD32 *ptr_y, WORD32 *ptr_x,
                                const WORD32 *p_dig_rev_tbl, WORD32 npoints);
 
VOID ixheaacd_cos_sin_mod_loop1(WORD32 *subband, WORD32 M,
                                const WORD16 *p_sin_cos, WORD32 subband_tmp[]);
 
VOID ixheaacd_cos_sin_mod_loop2(WORD32 *subband, const WORD16 *p_sin, WORD32 M);
 
VOID ixheaacd_sbr_qmfsyn64_winadd(WORD16 *tmp1, WORD16 *tmp2, WORD16 *inp1,
                                  WORD16 *sample_buffer, FLAG shift,
                                  WORD32 ch_fac);
 
VOID ixheaacd_esbr_cos_sin_mod(WORD32 *subband,
                               ia_sbr_qmf_filter_bank_struct *qmf_bank,
                               WORD32 *p_twiddle, WORD32 *p_dig_rev_tbl);
 
VOID ixheaacd_inv_modulation_lp(WORD32 *qmf_real, WORD16 *filter_states,
                                ia_sbr_qmf_filter_bank_struct *syn_qmf,
                                ia_qmf_dec_tables_struct *qmf_dec_tables_ptr);
 
VOID ixheaacd_sbr_pre_twiddle(WORD32 *p_xre, WORD32 *p_xim, WORD16 *p_twiddles);
 
VOID ixheaacd_inv_emodulation(WORD32 *qmf_real,
                              ia_sbr_qmf_filter_bank_struct *syn_qmf,
                              ia_qmf_dec_tables_struct *qmf_dec_tables_ptr);
 
VOID ixheaacd_pretwdct2(WORD32 *inp, WORD32 *out_fwd);
 
VOID ixheaacd_sbr_qmfanal32_winadd_eld(WORD16 *inp1, WORD16 *inp2,
                                       WORD16 *p_qmf1, WORD16 *p_qmf2,
                                       WORD32 *p_out);
 
VOID ixheaacd_dct2_32(WORD32 *inp, WORD32 *out,
                      ia_qmf_dec_tables_struct *qmf_dec_tables_ptr,
                      WORD16 *filter_states);
 
VOID ixheaacd_inv_modulation_lp(WORD32 *qmf_real, WORD16 *filter_states,
                                ia_sbr_qmf_filter_bank_struct *syn_qmf,
                                ia_qmf_dec_tables_struct *qmf_dec_tables_ptr);
 
VOID ixheaacd_fftposttw(WORD32 *out,
                        ia_qmf_dec_tables_struct *qmf_dec_tables_ptr);
 
VOID ixheaacd_posttwdct2(WORD32 *inp, WORD16 *out_fwd,
                         ia_qmf_dec_tables_struct *qmf_dec_tables_ptr);
 
#endif