Coverage Report

Created: 2026-12-01 07:00

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libxaac/decoder/ixheaacd_mps_hybrid_filt.c
Line
Count
Source
1
/******************************************************************************
2
 *                                                                            *
3
 * Copyright (C) 2018 The Android Open Source Project
4
 *
5
 * Licensed under the Apache License, Version 2.0 (the "License");
6
 * you may not use this file except in compliance with the License.
7
 * You may obtain a copy of the License at:
8
 *
9
 * http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 *
17
 *****************************************************************************
18
 * Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore
19
*/
20
#include <string.h>
21
#include "ixheaac_type_def.h"
22
#include "ixheaacd_bitbuffer.h"
23
#include "ixheaacd_common_rom.h"
24
#include "ixheaacd_sbrdecsettings.h"
25
#include "ixheaacd_sbr_scale.h"
26
#include "ixheaacd_env_extr_part.h"
27
#include "ixheaacd_sbr_rom.h"
28
#include "ixheaacd_hybrid.h"
29
#include "ixheaacd_ps_dec.h"
30
#include "ixheaacd_config.h"
31
#include "ixheaacd_qmf_dec.h"
32
#include "ixheaacd_mps_polyphase.h"
33
#include "ixheaac_constants.h"
34
#include "ixheaacd_mps_struct_def.h"
35
#include "ixheaacd_mps_res_rom.h"
36
#include "ixheaacd_mps_aac_struct.h"
37
#include "ixheaacd_mps_dec.h"
38
#include "ixheaac_basic_ops32.h"
39
#include "ixheaac_basic_ops40.h"
40
#include "ixheaacd_mps_macro_def.h"
41
#include "ixheaacd_mps_basic_op.h"
42
43
extern const FLOAT32 ixheaacd_ia_mps_hyb_filter_coeff_8[QMF_HYBRID_FILT_ORDER];
44
extern const FLOAT32 ixheaacd_mps_hyb_filter_coeff_2[QMF_HYBRID_FILT_ORDER];
45
46
extern const FLOAT32 ixheaacd_sine[8][8];
47
extern const FLOAT32 ixheaacd_cosine[8][8];
48
49
static VOID ixheaacd_mps_hyb_filt_type1(ia_cmplx_flt_struct *input,
50
                                        ia_cmplx_flt_struct output[8][MAX_TIME_SLOTS],
51
197k
                                        WORD32 num_samples, const FLOAT32 *filt_coeff) {
52
197k
  WORD32 i, n, q;
53
54
197k
  FLOAT32 in_re, in_im;
55
197k
  FLOAT32 coeff;
56
197k
  FLOAT32 acc_re_l, acc_re_h, acc_im_l, acc_im_h;
57
58
7.83M
  for (i = 0; i < num_samples; i++) {
59
7.64M
    FLOAT32 x0_re[13], x0_im[13], x0_1_re[8], x0_1_im[8];
60
7.64M
    FLOAT32 acc_re_val[8], acc_im_val[8];
61
106M
    for (n = 0; n < QMF_HYBRID_FILT_ORDER; n++) {
62
99.3M
      in_re = input[n + i].re;
63
99.3M
      in_im = input[n + i].im;
64
65
99.3M
      coeff = filt_coeff[QMF_HYBRID_FILT_ORDER - 1 - n];
66
67
99.3M
      x0_re[n] = coeff * in_re;
68
99.3M
      x0_im[n] = coeff * in_im;
69
99.3M
    }
70
71
7.64M
    x0_1_re[0] = x0_re[6];
72
7.64M
    x0_1_im[0] = x0_im[6];
73
74
7.64M
    x0_1_re[1] = x0_re[7];
75
7.64M
    x0_1_im[1] = x0_im[7];
76
77
7.64M
    x0_1_re[2] = x0_re[8] - x0_re[0];
78
7.64M
    x0_1_im[2] = x0_im[8] - x0_im[0];
79
80
7.64M
    x0_1_re[3] = x0_re[9] - x0_re[1];
81
7.64M
    x0_1_im[3] = x0_im[9] - x0_im[1];
82
83
7.64M
    x0_1_re[4] = x0_re[10] - x0_re[2];
84
7.64M
    x0_1_im[4] = x0_im[10] - x0_im[2];
85
86
7.64M
    x0_1_re[5] = x0_re[11] - x0_re[3];
87
7.64M
    x0_1_im[5] = x0_im[11] - x0_im[3];
88
89
7.64M
    x0_1_re[6] = x0_re[12] - x0_re[4];
90
7.64M
    x0_1_im[6] = x0_im[12] - x0_im[4];
91
92
7.64M
    x0_1_re[7] = -(x0_re[5]);
93
7.64M
    x0_1_im[7] = -(x0_im[5]);
94
95
7.64M
    acc_re_val[0] = x0_1_re[0];
96
7.64M
    acc_re_val[1] = x0_1_re[1] - x0_1_re[7];
97
7.64M
    acc_re_val[2] = x0_1_re[2] - x0_1_re[6];
98
7.64M
    acc_re_val[3] = x0_1_re[3] - x0_1_re[5];
99
7.64M
    acc_re_val[4] = x0_1_im[1] + x0_1_im[7];
100
7.64M
    acc_re_val[5] = x0_1_im[2] + x0_1_im[6];
101
7.64M
    acc_re_val[6] = x0_1_im[3] + x0_1_im[5];
102
7.64M
    acc_re_val[7] = x0_1_im[4];
103
104
7.64M
    acc_im_val[0] = x0_1_im[0];
105
7.64M
    acc_im_val[1] = x0_1_im[1] - x0_1_im[7];
106
7.64M
    acc_im_val[2] = x0_1_im[2] - x0_1_im[6];
107
7.64M
    acc_im_val[3] = x0_1_im[3] - x0_1_im[5];
108
7.64M
    acc_im_val[4] = x0_1_re[1] + x0_1_re[7];
109
7.64M
    acc_im_val[5] = x0_1_re[2] + x0_1_re[6];
110
7.64M
    acc_im_val[6] = x0_1_re[3] + x0_1_re[5];
111
7.64M
    acc_im_val[7] = x0_1_re[4];
112
113
38.2M
    for (q = 0; q < 4; q++) {
114
30.5M
      acc_re_l = 0;
115
30.5M
      acc_im_l = 0;
116
30.5M
      acc_re_h = 0;
117
30.5M
      acc_im_h = 0;
118
119
30.5M
      acc_re_l += acc_re_val[0];
120
30.5M
      acc_re_l += acc_re_val[1] * ixheaacd_cosine[q][1];
121
30.5M
      acc_re_l += acc_re_val[2] * ixheaacd_cosine[q][2];
122
30.5M
      acc_re_l += acc_re_val[3] * ixheaacd_cosine[q][3];
123
124
30.5M
      acc_re_h = acc_re_l;
125
126
30.5M
      acc_re_l -= acc_re_val[4] * ixheaacd_sine[q][1];
127
30.5M
      acc_re_l -= acc_re_val[5] * ixheaacd_sine[q][2];
128
30.5M
      acc_re_l -= acc_re_val[6] * ixheaacd_sine[q][3];
129
30.5M
      acc_re_l -= acc_re_val[7] * ixheaacd_sine[q][4];
130
131
30.5M
      acc_re_h = acc_re_h - (acc_re_l - acc_re_h);
132
133
30.5M
      acc_im_l += acc_im_val[0];
134
30.5M
      acc_im_l += acc_im_val[1] * ixheaacd_cosine[q][1];
135
30.5M
      acc_im_l += acc_im_val[2] * ixheaacd_cosine[q][2];
136
30.5M
      acc_im_l += acc_im_val[3] * ixheaacd_cosine[q][3];
137
138
30.5M
      acc_im_h = acc_im_l;
139
140
30.5M
      acc_im_l += acc_im_val[4] * ixheaacd_sine[q][1];
141
30.5M
      acc_im_l += acc_im_val[5] * ixheaacd_sine[q][2];
142
30.5M
      acc_im_l += acc_im_val[6] * ixheaacd_sine[q][3];
143
30.5M
      acc_im_l += acc_im_val[7] * ixheaacd_sine[q][4];
144
145
30.5M
      acc_im_h = acc_im_h - (acc_im_l - acc_im_h);
146
147
30.5M
      output[q][i].re = acc_re_l;
148
30.5M
      output[q][i].im = acc_im_l;
149
150
30.5M
      output[7 - q][i].re = acc_re_h;
151
30.5M
      output[7 - q][i].im = acc_im_h;
152
30.5M
    }
153
7.64M
  }
154
197k
}
155
156
static VOID ixheaacd_mps_hyb_filt_type2(ia_cmplx_flt_struct *input,
157
                                        ia_cmplx_flt_struct output[2][MAX_TIME_SLOTS],
158
394k
                                        WORD32 num_samples, const FLOAT32 *filt_coeff) {
159
394k
  WORD32 i, n;
160
161
394k
  FLOAT32 in_re, in_im;
162
394k
  FLOAT32 coeff;
163
394k
  FLOAT32 acc_re[2], acc_im[2];
164
165
15.6M
  for (i = 0; i < num_samples; i++) {
166
15.2M
    FLOAT32 x_0_re[13], x_0_im[13];
167
168
61.1M
    for (n = 1; n < 6; n = n + 2) {
169
45.8M
      in_re = input[n + i].re;
170
45.8M
      in_im = input[n + i].im;
171
172
45.8M
      in_re += input[12 - n + i].re;
173
45.8M
      in_im += input[12 - n + i].im;
174
175
45.8M
      coeff = filt_coeff[QMF_HYBRID_FILT_ORDER - 1 - n];
176
177
45.8M
      x_0_re[n] = coeff * in_re;
178
45.8M
      x_0_im[n] = coeff * in_im;
179
45.8M
    }
180
181
15.2M
    n = 6;
182
15.2M
    in_re = input[n + i].re;
183
15.2M
    in_im = input[n + i].im;
184
185
15.2M
    coeff = filt_coeff[QMF_HYBRID_FILT_ORDER - 1 - n];
186
187
15.2M
    x_0_re[n] = coeff * in_re;
188
15.2M
    x_0_im[n] = coeff * in_im;
189
190
15.2M
    x_0_re[1] = x_0_re[1] + x_0_re[3] + x_0_re[5];
191
15.2M
    x_0_im[1] = x_0_im[1] + x_0_im[3] + x_0_im[5];
192
193
15.2M
    acc_re[0] = x_0_re[6] + x_0_re[1];
194
15.2M
    acc_im[0] = x_0_im[6] + x_0_im[1];
195
196
15.2M
    acc_re[1] = x_0_re[6] - x_0_re[1];
197
15.2M
    acc_im[1] = x_0_im[6] - x_0_im[1];
198
199
15.2M
    output[0][i].re = acc_re[0];
200
15.2M
    output[0][i].im = acc_im[0];
201
202
15.2M
    output[1][i].re = acc_re[1];
203
15.2M
    output[1][i].im = acc_im[1];
204
15.2M
  }
205
394k
}
206
207
5.98k
VOID ixheaacd_mps_qmf_hybrid_analysis_init(ia_mps_hybrid_filt_struct *handle) {
208
5.98k
  memset(handle->lf_buffer, 0,
209
5.98k
         QMF_BANDS_TO_HYBRID * BUFFER_LEN_LF_MPS * sizeof(ia_cmplx_w32_struct));
210
5.98k
  memset(handle->hf_buffer, 0,
211
5.98k
         MAX_NUM_QMF_BANDS_MPS * BUFFER_LEN_HF_MPS * sizeof(ia_cmplx_flt_struct));
212
5.98k
}
213
214
VOID ixheaacd_mps_qmf_hybrid_analysis_no_pre_mix(
215
    ia_mps_hybrid_filt_struct *handle,
216
    ia_cmplx_flt_struct in_qmf[MAX_NUM_QMF_BANDS_MPS][MAX_TIME_SLOTS], WORD32 num_bands,
217
166k
    WORD32 num_samples, ia_cmplx_flt_struct v[MAX_TIME_SLOTS][MAX_HYBRID_BANDS_MPS]) {
218
166k
  WORD32 lf_samples_shift;
219
166k
  WORD32 hf_samples_shift;
220
166k
  WORD32 lf_qmf_bands;
221
166k
  WORD32 k, n;
222
223
166k
  ia_cmplx_flt_struct scratch[MAX_HYBRID_ONLY_BANDS_PER_QMF][MAX_TIME_SLOTS];
224
225
166k
  lf_samples_shift = BUFFER_LEN_LF_MPS - num_samples;
226
166k
  hf_samples_shift = BUFFER_LEN_HF_MPS - num_samples;
227
228
166k
  lf_qmf_bands = QMF_BANDS_TO_HYBRID;
229
230
664k
  for (k = 0; k < lf_qmf_bands; k++) {
231
498k
    memmove(&handle->lf_buffer[k][0].re, &handle->lf_buffer[k][num_samples].re,
232
498k
            2 * lf_samples_shift * sizeof(FLOAT32));
233
498k
  }
234
235
664k
  for (k = 0; k < lf_qmf_bands; k++) {
236
498k
    memcpy(&handle->lf_buffer[k][lf_samples_shift].re, &in_qmf[k][0].re,
237
498k
           2 * num_samples * sizeof(FLOAT32));
238
498k
  }
239
240
10.2M
  for (k = 0; k < MAX_NUM_QMF_BANDS_SAC / 2 - lf_qmf_bands; k++) {
241
10.1M
    memmove(&handle->hf_buffer[k][0].re, &handle->hf_buffer[k][num_samples].re,
242
10.1M
            2 * hf_samples_shift * sizeof(FLOAT32));
243
10.1M
  }
244
245
5.26M
  for (k = 0; k < num_bands - lf_qmf_bands; k++) {
246
5.10M
    memcpy(&handle->hf_buffer[k][hf_samples_shift].re, &in_qmf[k + lf_qmf_bands][0].re,
247
5.10M
           2 * num_samples * sizeof(FLOAT32));
248
5.10M
  }
249
250
166k
  ixheaacd_mps_hyb_filt_type1(
251
166k
      &(handle->lf_buffer[0][lf_samples_shift + 1 - QMF_HYBRID_FILT_ORDER]), scratch, num_samples,
252
166k
      ixheaacd_ia_mps_hyb_filter_coeff_8);
253
254
498k
  for (k = 0; k < 2; k++) {
255
12.9M
    for (n = 0; n < num_samples; n++) {
256
12.6M
      v[n][k].re = scratch[k + 6][n].re;
257
12.6M
      v[n][k + 2].re = scratch[k][n].re;
258
12.6M
      v[n][k + 4].re = scratch[k + 2][n].re;
259
12.6M
      v[n][k + 4].re += scratch[5 - k][n].re;
260
261
12.6M
      v[n][k].im = scratch[k + 6][n].im;
262
12.6M
      v[n][k + 2].im = scratch[k][n].im;
263
12.6M
      v[n][k + 4].im = scratch[k + 2][n].im;
264
12.6M
      v[n][k + 4].im += scratch[5 - k][n].im;
265
12.6M
    }
266
332k
  }
267
268
166k
  ixheaacd_mps_hyb_filt_type2(
269
166k
      &(handle->lf_buffer[1][lf_samples_shift + 1 - QMF_HYBRID_FILT_ORDER]), scratch, num_samples,
270
166k
      ixheaacd_mps_hyb_filter_coeff_2);
271
272
498k
  for (k = 0; k < 2; k++) {
273
12.9M
    for (n = 0; n < num_samples; n++) {
274
12.6M
      v[n][k + 6].re = scratch[1 - k][n].re;
275
12.6M
      v[n][k + 6].im = scratch[1 - k][n].im;
276
12.6M
    }
277
332k
  }
278
279
166k
  ixheaacd_mps_hyb_filt_type2(
280
166k
      &(handle->lf_buffer[2][lf_samples_shift + 1 - QMF_HYBRID_FILT_ORDER]), scratch, num_samples,
281
166k
      ixheaacd_mps_hyb_filter_coeff_2);
282
283
498k
  for (k = 0; k < 2; k++) {
284
12.9M
    for (n = 0; n < num_samples; n++) {
285
12.6M
      v[n][k + 8].re = scratch[k][n].re;
286
12.6M
      v[n][k + 8].im = scratch[k][n].im;
287
12.6M
    }
288
332k
  }
289
290
5.26M
  for (k = 0; k < num_bands - lf_qmf_bands; k++) {
291
186M
    for (n = 0; n < num_samples; n++) {
292
181M
      v[n][k + 10].re = (handle->hf_buffer[k][n + hf_samples_shift].re);
293
181M
      v[n][k + 10].im = (handle->hf_buffer[k][n + hf_samples_shift].im);
294
181M
    }
295
5.10M
  }
296
166k
}
297
298
VOID ixheaacd_mps_qmf_hybrid_analysis(
299
    ia_mps_hybrid_filt_struct *handle,
300
    ia_cmplx_flt_struct in_qmf[MAX_NUM_QMF_BANDS_MPS_NEW][MAX_TIME_SLOTS], WORD32 num_bands,
301
31.0k
    WORD32 num_samples, ia_cmplx_flt_struct hyb[MAX_HYBRID_BANDS_MPS][MAX_TIME_SLOTS]) {
302
31.0k
  WORD32 lf_samples_shift;
303
31.0k
  WORD32 hf_samples_shift;
304
31.0k
  WORD32 lf_qmf_bands;
305
31.0k
  WORD32 k, n;
306
307
31.0k
  ia_cmplx_flt_struct scratch[MAX_HYBRID_ONLY_BANDS_PER_QMF][MAX_TIME_SLOTS];
308
309
31.0k
  lf_samples_shift = BUFFER_LEN_LF_MPS - num_samples;
310
31.0k
  hf_samples_shift = BUFFER_LEN_HF_MPS - num_samples;
311
312
31.0k
  lf_qmf_bands = QMF_BANDS_TO_HYBRID;
313
314
124k
  for (k = 0; k < lf_qmf_bands; k++) {
315
93.1k
    memmove(&handle->lf_buffer[k][0].re, &handle->lf_buffer[k][num_samples].re,
316
93.1k
            2 * lf_samples_shift * sizeof(FLOAT32));
317
93.1k
  }
318
319
124k
  for (k = 0; k < lf_qmf_bands; k++) {
320
93.1k
    memcpy(&handle->lf_buffer[k][lf_samples_shift].re, &in_qmf[k][0].re,
321
93.1k
           2 * num_samples * sizeof(FLOAT32));
322
93.1k
  }
323
324
1.92M
  for (k = 0; k < MAX_NUM_QMF_BANDS_SAC / 2 - lf_qmf_bands; k++) {
325
1.89M
    memmove(&handle->hf_buffer[k][0].re, &handle->hf_buffer[k][num_samples].re,
326
1.89M
            2 * hf_samples_shift * sizeof(FLOAT32));
327
1.89M
  }
328
329
1.49M
  for (k = 0; k < num_bands - lf_qmf_bands; k++) {
330
1.45M
    memcpy(&handle->hf_buffer[k][hf_samples_shift].re, &in_qmf[k + lf_qmf_bands][0].re,
331
1.45M
           2 * num_samples * sizeof(FLOAT32));
332
1.45M
  }
333
334
31.0k
  ixheaacd_mps_hyb_filt_type1(
335
31.0k
      &(handle->lf_buffer[0][lf_samples_shift + 1 - QMF_HYBRID_FILT_ORDER]), scratch, num_samples,
336
31.0k
      ixheaacd_ia_mps_hyb_filter_coeff_8);
337
338
93.1k
  for (k = 0; k < 2; k++) {
339
2.73M
    for (n = 0; n < num_samples; n++) {
340
2.66M
      hyb[k][n].re = scratch[k + 6][n].re;
341
2.66M
      hyb[k + 2][n].re = scratch[k][n].re;
342
2.66M
      hyb[k + 4][n].re = scratch[k + 2][n].re;
343
2.66M
      hyb[k + 4][n].re += scratch[5 - k][n].re;
344
345
2.66M
      hyb[k][n].im = scratch[k + 6][n].im;
346
2.66M
      hyb[k + 2][n].im = scratch[k][n].im;
347
2.66M
      hyb[k + 4][n].im = scratch[k + 2][n].im;
348
2.66M
      hyb[k + 4][n].im += scratch[5 - k][n].im;
349
2.66M
    }
350
62.0k
  }
351
352
31.0k
  ixheaacd_mps_hyb_filt_type2(
353
31.0k
      &(handle->lf_buffer[1][lf_samples_shift + 1 - QMF_HYBRID_FILT_ORDER]), scratch, num_samples,
354
31.0k
      ixheaacd_mps_hyb_filter_coeff_2);
355
356
93.1k
  for (k = 0; k < 2; k++) {
357
2.73M
    for (n = 0; n < num_samples; n++) {
358
2.66M
      hyb[k + 6][n].re = scratch[1 - k][n].re;
359
2.66M
      hyb[k + 6][n].im = scratch[1 - k][n].im;
360
2.66M
    }
361
62.0k
  }
362
363
31.0k
  ixheaacd_mps_hyb_filt_type2(
364
31.0k
      &(handle->lf_buffer[2][lf_samples_shift + 1 - QMF_HYBRID_FILT_ORDER]), scratch, num_samples,
365
31.0k
      ixheaacd_mps_hyb_filter_coeff_2);
366
367
93.1k
  for (k = 0; k < 2; k++) {
368
2.73M
    for (n = 0; n < num_samples; n++) {
369
2.66M
      hyb[k + 8][n].re = scratch[k][n].re;
370
2.66M
      hyb[k + 8][n].im = scratch[k][n].im;
371
2.66M
    }
372
62.0k
  }
373
374
1.49M
  for (k = 0; k < num_bands - lf_qmf_bands; k++) {
375
1.45M
    memcpy(&hyb[k + 10][0].re, &handle->hf_buffer[k][hf_samples_shift].re,
376
1.45M
           2 * num_samples * sizeof(FLOAT32));
377
1.45M
  }
378
31.0k
}
379
380
VOID ixheaacd_mps_qmf_hybrid_synthesis(
381
    ia_cmplx_flt_struct hyb[MAX_TIME_SLOTS][MAX_HYBRID_BANDS_MPS], WORD32 num_bands,
382
245k
    WORD32 num_samples, ia_cmplx_flt_struct in_qmf[MAX_TIME_SLOTS][MAX_NUM_QMF_BANDS_MPS]) {
383
245k
  WORD32 k, n;
384
385
9.62M
  for (n = 0; n < num_samples; n++) {
386
9.37M
    in_qmf[n][0].re = hyb[n][0].re;
387
9.37M
    in_qmf[n][0].im = hyb[n][0].im;
388
389
56.2M
    for (k = 1; k < 6; k++) {
390
46.8M
      in_qmf[n][0].re += hyb[n][k].re;
391
46.8M
      in_qmf[n][0].im += hyb[n][k].im;
392
46.8M
    }
393
394
9.37M
    in_qmf[n][1].re = hyb[n][6].re + hyb[n][7].re;
395
9.37M
    in_qmf[n][1].im = hyb[n][6].im + hyb[n][7].im;
396
397
9.37M
    in_qmf[n][2].re = hyb[n][8].re + hyb[n][9].re;
398
9.37M
    in_qmf[n][2].im = hyb[n][8].im + hyb[n][9].im;
399
400
9.37M
    memcpy(&in_qmf[n][3].re, &hyb[n][10].re, 2 * (num_bands - 3) * sizeof(FLOAT32));
401
9.37M
  }
402
245k
}
403
404
VOID ixheaacd_mps_fft(complex *out, LOOPINDEX idx, WORD32 nob,
405
3.46M
                      const ia_mps_dec_hybrid_tables_struct *hyb_tab) {
406
3.46M
  LOOPINDEX block_per_stage, stage_num, inner;
407
3.46M
  const WORD32 *cosine_array = hyb_tab->cosine_array;
408
3.46M
  const WORD32 *sine_array = hyb_tab->sine_array;
409
3.46M
  WORD32 index_1, index_2, index, tab_modifier;
410
3.46M
  WORD32 len, increment, i;
411
412
3.46M
  WORD32 cos_val;
413
3.46M
  WORD32 sin_val;
414
415
3.46M
  WORD16 index1;
416
3.46M
  WORD32 re_temp;
417
3.46M
  WORD32 im_temp;
418
3.46M
  WORD32 *out1_w32, *out2_w32;
419
420
3.46M
  len = idx;
421
3.46M
  i = 1;
422
3.46M
  increment = 0;
423
424
3.46M
  len = len >> 1;
425
3.46M
  index_1 = 0;
426
3.46M
  increment += 1;
427
428
3.46M
  index = 11 - increment;
429
3.46M
  tab_modifier = ixheaac_shl32(1, index);
430
431
3.46M
  out1_w32 = (WORD32 *)&out[index_1];
432
3.46M
  out2_w32 = (WORD32 *)&out[index_1 + 1];
433
434
17.3M
  for (block_per_stage = 0; block_per_stage < len; block_per_stage++) {
435
13.8M
    re_temp = out2_w32[0];
436
13.8M
    im_temp = out2_w32[1];
437
438
13.8M
    out2_w32[0] = ixheaac_sub32_sat(out1_w32[0], re_temp);
439
13.8M
    out2_w32[1] = ixheaac_sub32_sat(out1_w32[1], im_temp);
440
441
13.8M
    out1_w32[0] = ixheaac_add32_sat(re_temp, out1_w32[0]);
442
13.8M
    out1_w32[1] = ixheaac_add32_sat(im_temp, out1_w32[1]);
443
444
13.8M
    out1_w32 += 4;
445
13.8M
    out2_w32 += 4;
446
13.8M
  }
447
448
3.46M
  i <<= 1;
449
450
10.3M
  for (stage_num = 1; stage_num < nob; stage_num++) {
451
6.92M
    len = len >> 1;
452
6.92M
    index_1 = 0;
453
6.92M
    increment += 1;
454
455
6.92M
    index = 11 - increment;
456
6.92M
    tab_modifier = ixheaac_shl32(1, index);
457
458
17.3M
    for (block_per_stage = 0; block_per_stage < len; block_per_stage++) {
459
10.3M
      index_2 = index_1 + i;
460
461
10.3M
      out1_w32 = (WORD32 *)&out[index_1];
462
10.3M
      out2_w32 = (WORD32 *)&out[index_2];
463
464
10.3M
      re_temp = out1_w32[0];
465
10.3M
      im_temp = out1_w32[1];
466
467
10.3M
      out1_w32[0] = ((WORD64)re_temp + (WORD64)out2_w32[0]) >> 1;
468
10.3M
      out1_w32[1] = ((WORD64)im_temp + (WORD64)out2_w32[1]) >> 1;
469
470
10.3M
      out2_w32[0] = ((WORD64)re_temp - (WORD64)out2_w32[0]) >> 1;
471
10.3M
      out2_w32[1] = ((WORD64)im_temp - (WORD64)out2_w32[1]) >> 1;
472
473
10.3M
      index1 = tab_modifier;
474
475
10.3M
      out1_w32 += 2;
476
10.3M
      out2_w32 += 2;
477
478
27.6M
      for (inner = 0; inner < ((i - 1) << 1); inner += 2) {
479
17.3M
        cos_val = cosine_array[index1];
480
17.3M
        sin_val = sine_array[index1];
481
482
17.3M
        re_temp = ixheaacd_mps_mult32x16_shr_16(out2_w32[inner], cos_val) +
483
17.3M
                  ixheaacd_mps_mult32x16_shr_16(out2_w32[inner + 1], sin_val);
484
17.3M
        im_temp = ixheaacd_mps_mult32x16_shr_16(out2_w32[inner + 1], cos_val) -
485
17.3M
                  ixheaacd_mps_mult32x16_shr_16(out2_w32[inner], sin_val);
486
487
17.3M
        out1_w32[inner] >>= 1;
488
17.3M
        out1_w32[inner + 1] >>= 1;
489
490
17.3M
        out2_w32[inner] = ixheaac_sub32_sat(out1_w32[inner], re_temp);
491
17.3M
        out2_w32[inner + 1] = ixheaac_sub32_sat(out1_w32[inner + 1], im_temp);
492
493
17.3M
        out1_w32[inner] = ixheaac_add32_sat(out1_w32[inner], re_temp);
494
17.3M
        out1_w32[inner + 1] = ixheaac_add32_sat(out1_w32[inner + 1], im_temp);
495
496
17.3M
        index1 += tab_modifier;
497
17.3M
      }
498
499
10.3M
      index_1 += ixheaac_shl32(1, increment);
500
10.3M
    }
501
6.92M
    i <<= 1;
502
6.92M
  }
503
3.46M
}
504
505
VOID ixheaacd_8ch_filtering(const WORD32 *p_qmf_real, const WORD32 *p_qmf_imag,
506
                            WORD32 *m_hybrid_real, WORD32 *m_hybrid_imag,
507
3.46M
                            const ia_mps_dec_hybrid_tables_struct *hyb_tab) {
508
3.46M
  WORD32 n;
509
3.46M
  WORD32 real, imag;
510
3.46M
  const WORD16 tcos = COS_PI_BY_8;
511
3.46M
  const WORD16 tsin = SIN_PI_BY_8;
512
3.46M
  WORD32 cum[16];
513
3.46M
  WORD32 *p_complex;
514
3.46M
  const WORD16 *p8_13 = hyb_tab->p8_13;
515
516
3.46M
  real = ixheaac_shl32((ixheaac_mult32x16in32(p_qmf_real[4], p8_13[4]) +
517
3.46M
                         ixheaac_mult32x16in32(p_qmf_real[12], p8_13[12])),
518
3.46M
                        1);
519
3.46M
  imag = ixheaac_shl32((ixheaac_mult32x16in32(p_qmf_imag[4], p8_13[4]) +
520
3.46M
                         ixheaac_mult32x16in32(p_qmf_imag[12], p8_13[12])),
521
3.46M
                        1);
522
523
3.46M
  cum[5] = ixheaac_sub32_sat(imag, real);
524
3.46M
  cum[4] = -ixheaac_add32_sat(imag, real);
525
526
3.46M
  real = ixheaac_shl32((ixheaac_mult32x16in32(p_qmf_real[3], p8_13[3]) +
527
3.46M
                         ixheaac_mult32x16in32(p_qmf_real[11], p8_13[11])),
528
3.46M
                        1);
529
3.46M
  imag = ixheaac_shl32((ixheaac_mult32x16in32(p_qmf_imag[3], p8_13[3]) +
530
3.46M
                         ixheaac_mult32x16in32(p_qmf_imag[11], p8_13[11])),
531
3.46M
                        1);
532
533
3.46M
  cum[13] = ixheaac_shl32(
534
3.46M
      (ixheaac_mult32x16in32(imag, tcos) - ixheaac_mult32x16in32(real, tsin)), 1);
535
3.46M
  cum[12] = ixheaac_shl32(
536
3.46M
      -((ixheaac_mult32x16in32(imag, tsin) + ixheaac_mult32x16in32(real, tcos))), 1);
537
538
3.46M
  cum[2] = ixheaac_shl32((ixheaac_mult32x16in32(p_qmf_real[2], p8_13[10]) -
539
3.46M
                          ixheaac_mult32x16in32(p_qmf_real[10], p8_13[10])),
540
3.46M
                         1);
541
3.46M
  cum[3] = ixheaac_shl32((ixheaac_mult32x16in32(p_qmf_imag[2], p8_13[2]) -
542
3.46M
                          ixheaac_mult32x16in32(p_qmf_imag[10], p8_13[2])),
543
3.46M
                         1);
544
3.46M
  real = ixheaac_shl32((ixheaac_mult32x16in32(p_qmf_real[1], p8_13[1]) +
545
3.46M
                         ixheaac_mult32x16in32(p_qmf_real[9], p8_13[9])),
546
3.46M
                        1);
547
3.46M
  imag = ixheaac_shl32((ixheaac_mult32x16in32(p_qmf_imag[1], p8_13[1]) +
548
3.46M
                         ixheaac_mult32x16in32(p_qmf_imag[9], p8_13[9])),
549
3.46M
                        1);
550
551
3.46M
  cum[11] = ixheaac_shl32(
552
3.46M
      (ixheaac_mult32x16in32(imag, tcos) + ixheaac_mult32x16in32(real, tsin)), 1);
553
3.46M
  cum[10] = ixheaac_shl32(
554
3.46M
      (ixheaac_mult32x16in32(imag, tsin) - ixheaac_mult32x16in32(real, tcos)), 1);
555
556
3.46M
  real = ixheaac_shl32((ixheaac_mult32x16in32(p_qmf_real[0], p8_13[0]) +
557
3.46M
                         ixheaac_mult32x16in32(p_qmf_real[8], p8_13[8])),
558
3.46M
                        1);
559
3.46M
  imag = ixheaac_shl32((ixheaac_mult32x16in32(p_qmf_imag[0], p8_13[0]) +
560
3.46M
                         ixheaac_mult32x16in32(p_qmf_imag[8], p8_13[8])),
561
3.46M
                        1);
562
563
3.46M
  cum[7] = ixheaac_add32_sat(imag, real);
564
3.46M
  cum[6] = ixheaac_sub32_sat(imag, real);
565
566
3.46M
  cum[15] = ixheaac_shl32((ixheaac_mult32x16in32(p_qmf_imag[7], p8_13[14]) +
567
3.46M
                            ixheaac_mult32x16in32(p_qmf_real[7], p8_13[13])),
568
3.46M
                           1);
569
3.46M
  cum[14] = ixheaac_shl32((ixheaac_mult32x16in32(p_qmf_imag[7], p8_13[13]) -
570
3.46M
                            ixheaac_mult32x16in32(p_qmf_real[7], p8_13[14])),
571
3.46M
                           1);
572
573
3.46M
  cum[1] = ixheaac_shl32(
574
3.46M
      ixheaac_mult32x16in32(p_qmf_real[HYBRID_FILTER_DELAY], p8_13[HYBRID_FILTER_DELAY]), 1);
575
3.46M
  cum[0] = ixheaac_shl32(
576
3.46M
      ixheaac_mult32x16in32(p_qmf_imag[HYBRID_FILTER_DELAY], p8_13[HYBRID_FILTER_DELAY]), 1);
577
578
3.46M
  cum[9] = ixheaac_shl32((ixheaac_mult32x16in32(p_qmf_real[5], p8_13[13]) -
579
3.46M
                           ixheaac_mult32x16in32(p_qmf_imag[5], p8_13[14])),
580
3.46M
                          1);
581
3.46M
  cum[8] = ixheaac_shl32((ixheaac_mult32x16in32(p_qmf_real[5], p8_13[14]) +
582
3.46M
                           ixheaac_mult32x16in32(p_qmf_imag[5], p8_13[13])),
583
3.46M
                          1);
584
585
3.46M
  ixheaacd_mps_fft((complex *)cum, 8, 3, hyb_tab);
586
587
3.46M
  p_complex = cum;
588
589
31.1M
  for (n = 0; n < 8; n++) {
590
27.6M
    m_hybrid_imag[n] = *p_complex++;
591
27.6M
    m_hybrid_real[n] = *p_complex++;
592
27.6M
  }
593
3.46M
}
594
595
VOID ixheaacd_2ch_filtering(WORD32 *p_qmf, WORD32 *m_hybrid,
596
13.8M
                            const ia_mps_dec_hybrid_tables_struct *hyb_tab_ptr) {
597
13.8M
  WORD32 cum0, cum1;
598
13.8M
  WORD64 temp;
599
13.8M
  const WORD16 *p2_6 = hyb_tab_ptr->p2_6;
600
601
13.8M
  cum0 = (WORD32)p_qmf[HYBRID_FILTER_DELAY] >> 1;
602
603
13.8M
  temp = (WORD64)((WORD64)p2_6[0] * ((WORD64)p_qmf[1] + (WORD64)p_qmf[11]) +
604
13.8M
                  (WORD64)p2_6[1] * ((WORD64)p_qmf[3] + (WORD64)p_qmf[9]));
605
13.8M
  temp += (WORD64)p2_6[2] * ((WORD64)p_qmf[5] + (WORD64)p_qmf[7]);
606
13.8M
  cum1 = (WORD32)(temp >> 16);
607
608
13.8M
  m_hybrid[0] = ixheaac_add32_sat(cum0, cum1);
609
13.8M
  m_hybrid[1] = ixheaac_sub32_sat(cum0, cum1);
610
13.8M
}
611
612
WORD32 ixheaacd_get_qmf_sb(
613
    WORD32 hybrid_subband,
614
4.80M
    const ia_mps_dec_mdct2qmf_table_struct *ixheaacd_mps_dec_mdct2qmf_table) {
615
4.80M
  return ixheaacd_mps_dec_mdct2qmf_table->hybrid_2_qmf[hybrid_subband];
616
4.80M
}
617
618
22.2k
VOID ixheaacd_init_ana_hyb_filt_bank(ia_mps_dec_thyb_filter_state_struct *hyb_state) {
619
22.2k
  WORD32 k, n;
620
621
88.8k
  for (k = 0; k < QMF_BANDS_TO_HYBRID; k++) {
622
5.66M
    for (n = 0; n < PROTO_LEN - 1 + MAX_TIME_SLOTS; n++) {
623
5.59M
      hyb_state->buffer_lf_real[k][n] = 0;
624
5.59M
      hyb_state->buffer_lf_imag[k][n] = 0;
625
5.59M
      hyb_state->qmf_lf_real[k][n] = 0;
626
5.59M
      hyb_state->qmf_lf_imag[k][n] = 0;
627
5.59M
    }
628
66.6k
  }
629
630
1.44M
  for (k = 0; k < MAX_NUM_QMF_BANDS; k++) {
631
112M
    for (n = 0; n < ((PROTO_LEN - 1) >> 1) + MAX_TIME_SLOTS; n++) {
632
110M
      hyb_state->buffer_hf_real[k][n] = 0;
633
110M
      hyb_state->buffer_hf_imag[k][n] = 0;
634
110M
    }
635
1.42M
  }
636
22.2k
}
637
638
VOID ixheaacd_apply_ana_hyb_filt_bank_create_x(
639
    ia_mps_dec_thyb_filter_state_struct *hyb_state, WORD32 *m_qmf_real, WORD32 *m_qmf_imag,
640
    WORD32 nr_bands, WORD32 nr_samples, WORD32 *m_hybrid_real, WORD32 *m_hybrid_imag,
641
125k
    const ia_mps_dec_hybrid_tables_struct *hyb_tab_ptr) {
642
125k
  WORD32 nr_samples_shift_lf;
643
125k
  WORD32 nr_qmf_bands_lf;
644
125k
  WORD32 k, n;
645
125k
  WORD32 time_slot;
646
647
125k
  WORD32 proto_len = (PROTO_LEN - 1) >> 1;
648
125k
  WORD32 val = nr_samples - proto_len;
649
125k
  WORD32 val_xhb = val * MAX_HYBRID_BANDS;
650
125k
  WORD32 loop_cnt, loop_cnt_x4;
651
125k
  WORD32 *p_qmf_real, *p_qmf_re, *p_qmf_imag, *p_qmf_im;
652
653
125k
  WORD32 m_temp_output_real[MAX_HYBRID_ONLY_BANDS_PER_QMF];
654
125k
  WORD32 m_temp_output_imag[MAX_HYBRID_ONLY_BANDS_PER_QMF];
655
656
125k
  WORD32 *p_hybrid_real = m_hybrid_real + 10;
657
125k
  WORD32 *p_hybrid_imag = m_hybrid_imag + 10;
658
659
125k
  WORD32 *p_hybrid_re, *p_hybrid_im;
660
661
125k
  nr_samples_shift_lf = BUFFER_LEN_LF - nr_samples;
662
663
125k
  nr_qmf_bands_lf = QMF_BANDS_TO_HYBRID;
664
125k
  loop_cnt = nr_bands - nr_qmf_bands_lf;
665
125k
  loop_cnt_x4 = (loop_cnt << 2);
666
667
503k
  for (k = 0; k < nr_qmf_bands_lf; k++) {
668
21.8M
    for (n = 0; n < nr_samples_shift_lf; n++) {
669
21.4M
      hyb_state->buffer_lf_real[k][n] = hyb_state->buffer_lf_real[k][n + nr_samples];
670
21.4M
      hyb_state->buffer_lf_imag[k][n] = hyb_state->buffer_lf_imag[k][n + nr_samples];
671
672
21.4M
      hyb_state->qmf_lf_real[k][n] = hyb_state->qmf_lf_real[k][n + nr_samples];
673
21.4M
      hyb_state->qmf_lf_imag[k][n] = hyb_state->qmf_lf_imag[k][n + nr_samples];
674
21.4M
    }
675
377k
  }
676
677
125k
  p_qmf_real = m_qmf_real;
678
125k
  p_qmf_imag = m_qmf_imag;
679
503k
  for (k = 0; k < nr_qmf_bands_lf; k++) {
680
377k
    p_qmf_re = p_qmf_real;
681
377k
    p_qmf_im = p_qmf_imag;
682
683
10.6M
    for (n = 0; n < nr_samples; n++) {
684
10.2M
      hyb_state->buffer_lf_real[k][n + nr_samples_shift_lf] = *p_qmf_re;
685
10.2M
      hyb_state->buffer_lf_imag[k][n + nr_samples_shift_lf] = *p_qmf_im;
686
687
10.2M
      hyb_state->qmf_lf_imag[k][n + nr_samples_shift_lf] = *p_qmf_im;
688
10.2M
      hyb_state->qmf_lf_real[k][n + nr_samples_shift_lf] = *p_qmf_re;
689
690
10.2M
      p_qmf_re += MAX_HYBRID_BANDS;
691
10.2M
      p_qmf_im += MAX_HYBRID_BANDS;
692
10.2M
    }
693
694
377k
    p_qmf_real++;
695
377k
    p_qmf_imag++;
696
377k
  }
697
698
125k
  p_qmf_real = m_qmf_real + nr_qmf_bands_lf + val_xhb;
699
125k
  p_qmf_imag = m_qmf_imag + nr_qmf_bands_lf + val_xhb;
700
701
880k
  for (n = 0; n < proto_len; n++) {
702
754k
    p_qmf_re = p_qmf_real;
703
754k
    p_qmf_im = p_qmf_imag;
704
705
754k
    p_hybrid_re = p_hybrid_real;
706
754k
    p_hybrid_im = p_hybrid_imag;
707
708
36.0M
    for (k = 0; k < loop_cnt; k++) {
709
35.3M
      *p_hybrid_re++ = hyb_state->buffer_hf_real[k][n];
710
35.3M
      *p_hybrid_im++ = hyb_state->buffer_hf_imag[k][n];
711
712
35.3M
      hyb_state->buffer_hf_real[k][n] = *p_qmf_re++;
713
35.3M
      hyb_state->buffer_hf_imag[k][n] = *p_qmf_im++;
714
35.3M
    }
715
754k
    p_qmf_real += MAX_HYBRID_BANDS;
716
754k
    p_qmf_imag += MAX_HYBRID_BANDS;
717
718
754k
    p_hybrid_real += MAX_HYBRID_BANDS;
719
754k
    p_hybrid_imag += MAX_HYBRID_BANDS;
720
754k
  }
721
722
125k
  p_qmf_real = m_qmf_real;
723
125k
  p_qmf_imag = m_qmf_imag;
724
725
125k
  p_hybrid_real = m_hybrid_real + 10;
726
125k
  p_hybrid_imag = m_hybrid_imag + 10;
727
728
125k
  k = proto_len * MAX_HYBRID_BANDS;
729
730
125k
  p_hybrid_re = p_hybrid_real + k;
731
125k
  p_hybrid_im = p_hybrid_imag + k;
732
733
125k
  p_qmf_re = p_qmf_real + nr_qmf_bands_lf;
734
125k
  p_qmf_im = p_qmf_imag + nr_qmf_bands_lf;
735
736
2.79M
  for (n = 0; n < val; n++) {
737
2.67M
    memcpy(p_hybrid_re, p_qmf_re, loop_cnt_x4);
738
2.67M
    memcpy(p_hybrid_im, p_qmf_im, loop_cnt_x4);
739
740
2.67M
    p_qmf_re += MAX_HYBRID_BANDS;
741
2.67M
    p_qmf_im += MAX_HYBRID_BANDS;
742
743
2.67M
    p_hybrid_re += MAX_HYBRID_BANDS;
744
2.67M
    p_hybrid_im += MAX_HYBRID_BANDS;
745
2.67M
  }
746
747
125k
  p_hybrid_real = m_hybrid_real;
748
125k
  p_hybrid_imag = m_hybrid_imag;
749
750
3.55M
  for (time_slot = 0; time_slot < nr_samples; time_slot++) {
751
3.42M
    p_hybrid_re = p_hybrid_real;
752
3.42M
    p_hybrid_im = p_hybrid_imag;
753
754
3.42M
    ixheaacd_8ch_filtering(
755
3.42M
        &(hyb_state->buffer_lf_real[0][time_slot + nr_samples_shift_lf + 1 - PROTO_LEN]),
756
3.42M
        &(hyb_state->buffer_lf_imag[0][time_slot + nr_samples_shift_lf + 1 - PROTO_LEN]),
757
3.42M
        m_temp_output_real, m_temp_output_imag, hyb_tab_ptr);
758
759
3.42M
    *p_hybrid_re++ = m_temp_output_real[6];
760
3.42M
    *p_hybrid_re++ = m_temp_output_real[7];
761
3.42M
    *p_hybrid_re++ = m_temp_output_real[0];
762
3.42M
    *p_hybrid_re++ = m_temp_output_real[1];
763
3.42M
    *p_hybrid_re++ = ixheaac_add32_sat(m_temp_output_real[2], m_temp_output_real[5]);
764
3.42M
    *p_hybrid_re++ = ixheaac_add32_sat(m_temp_output_real[3], m_temp_output_real[4]);
765
766
3.42M
    *p_hybrid_im++ = m_temp_output_imag[6];
767
3.42M
    *p_hybrid_im++ = m_temp_output_imag[7];
768
3.42M
    *p_hybrid_im++ = m_temp_output_imag[0];
769
3.42M
    *p_hybrid_im++ = m_temp_output_imag[1];
770
3.42M
    *p_hybrid_im++ = ixheaac_add32_sat(m_temp_output_imag[2], m_temp_output_imag[5]);
771
3.42M
    *p_hybrid_im++ = ixheaac_add32_sat(m_temp_output_imag[3], m_temp_output_imag[4]);
772
773
3.42M
    ixheaacd_2ch_filtering(
774
3.42M
        &(hyb_state->buffer_lf_real[1][time_slot + nr_samples_shift_lf + 1 - PROTO_LEN]),
775
3.42M
        m_temp_output_real, hyb_tab_ptr);
776
777
3.42M
    ixheaacd_2ch_filtering(
778
3.42M
        &(hyb_state->buffer_lf_imag[1][time_slot + nr_samples_shift_lf + 1 - PROTO_LEN]),
779
3.42M
        m_temp_output_imag, hyb_tab_ptr);
780
781
3.42M
    *p_hybrid_re++ = m_temp_output_real[1];
782
3.42M
    *p_hybrid_re++ = m_temp_output_real[0];
783
784
3.42M
    *p_hybrid_im++ = m_temp_output_imag[1];
785
3.42M
    *p_hybrid_im++ = m_temp_output_imag[0];
786
787
3.42M
    ixheaacd_2ch_filtering(
788
3.42M
        &(hyb_state->buffer_lf_real[2][time_slot + nr_samples_shift_lf + 1 - PROTO_LEN]),
789
3.42M
        m_temp_output_real, hyb_tab_ptr);
790
791
3.42M
    ixheaacd_2ch_filtering(
792
3.42M
        &(hyb_state->buffer_lf_imag[2][time_slot + nr_samples_shift_lf + 1 - PROTO_LEN]),
793
3.42M
        m_temp_output_imag, hyb_tab_ptr);
794
795
3.42M
    *p_hybrid_re++ = m_temp_output_real[0];
796
3.42M
    *p_hybrid_re++ = m_temp_output_real[1];
797
798
3.42M
    *p_hybrid_im++ = m_temp_output_imag[0];
799
3.42M
    *p_hybrid_im++ = m_temp_output_imag[1];
800
801
3.42M
    p_hybrid_real += MAX_HYBRID_BANDS;
802
3.42M
    p_hybrid_imag += MAX_HYBRID_BANDS;
803
3.42M
  }
804
805
125k
  p_qmf_real = m_qmf_real;
806
125k
  p_qmf_imag = m_qmf_imag;
807
503k
  for (k = 0; k < nr_qmf_bands_lf; k++) {
808
377k
    p_qmf_re = p_qmf_real;
809
377k
    p_qmf_im = p_qmf_imag;
810
377k
    for (n = MAX_TIME_SLOTS; n < nr_samples_shift_lf; n++) {
811
0
      hyb_state->buffer_lf_real[k][n] = hyb_state->qmf_lf_real[k][n];
812
0
      hyb_state->buffer_lf_imag[k][n] = hyb_state->qmf_lf_imag[k][n];
813
0
    }
814
10.6M
    for (n = 0; n < nr_samples; n++) {
815
10.2M
      hyb_state->buffer_lf_real[k][n + nr_samples_shift_lf] = *p_qmf_re;
816
10.2M
      hyb_state->buffer_lf_imag[k][n + nr_samples_shift_lf] = *p_qmf_im;
817
818
10.2M
      p_qmf_re += MAX_HYBRID_BANDS;
819
10.2M
      p_qmf_im += MAX_HYBRID_BANDS;
820
10.2M
    }
821
377k
    p_qmf_real++;
822
377k
    p_qmf_imag++;
823
377k
  }
824
125k
}
825
826
ATTR_NO_SANITIZE_INTEGER
827
VOID ixheaacd_apply_ana_hyb_filt_bank_merge_res_decor(
828
    ia_mps_dec_thyb_filter_state_struct *hyb_state, WORD32 *m_qmf_real, WORD32 *m_qmf_imag,
829
    WORD32 nr_bands, WORD32 nr_samples, WORD32 *m_hybrid_real, WORD32 *m_hybrid_imag,
830
855
    const ia_mps_dec_hybrid_tables_struct *hyb_tab_ptr) {
831
855
  WORD32 nr_samples_shift_lf;
832
855
  WORD32 nr_qmf_bands_lf;
833
855
  WORD32 k, n;
834
855
  WORD32 time_slot;
835
836
855
  WORD32 m_temp_output_real[MAX_HYBRID_ONLY_BANDS_PER_QMF];
837
855
  WORD32 m_temp_output_imag[MAX_HYBRID_ONLY_BANDS_PER_QMF];
838
839
855
  WORD32 proto_len = (PROTO_LEN - 1) >> 1;
840
855
  WORD32 val = nr_samples - proto_len;
841
855
  WORD32 loop_cnt;
842
843
855
  WORD32 *p_qmf_real = m_qmf_real;
844
855
  WORD32 *p_qmf_imag = m_qmf_imag;
845
846
855
  WORD32 *p_hybrid_real = m_hybrid_real + 10;
847
855
  WORD32 *p_hybrid_imag = m_hybrid_imag + 10;
848
855
  WORD32 *p_buffer_lf_real, *p_buffer_lf_imag;
849
850
855
  WORD32 nr_samples_x4 = nr_samples << 2;
851
852
855
  nr_samples_shift_lf = BUFFER_LEN_LF - nr_samples;
853
854
855
  nr_qmf_bands_lf = QMF_BANDS_TO_HYBRID;
855
855
  loop_cnt = nr_bands - nr_qmf_bands_lf;
856
857
3.42k
  for (k = 0; k < nr_qmf_bands_lf; k++) {
858
153k
    for (n = 0; n < nr_samples_shift_lf; n++) {
859
150k
      hyb_state->buffer_lf_real[k][n] = hyb_state->buffer_lf_real[k][n + nr_samples];
860
150k
      hyb_state->buffer_lf_imag[k][n] = hyb_state->buffer_lf_imag[k][n + nr_samples];
861
862
150k
      hyb_state->qmf_lf_real[k][n] = hyb_state->qmf_lf_real[k][n + nr_samples];
863
150k
      hyb_state->qmf_lf_imag[k][n] = hyb_state->qmf_lf_imag[k][n + nr_samples];
864
150k
    }
865
2.56k
  }
866
3.42k
  for (k = 0; k < nr_qmf_bands_lf; k++) {
867
2.56k
    WORD32 *qmf_real = p_qmf_real;
868
2.56k
    WORD32 *qmf_imag = p_qmf_imag;
869
67.4k
    for (n = 0; n < nr_samples; n++) {
870
64.9k
      hyb_state->buffer_lf_real[k][n + nr_samples_shift_lf] = *qmf_real;
871
64.9k
      hyb_state->buffer_lf_imag[k][n + nr_samples_shift_lf] = *qmf_imag;
872
873
64.9k
      hyb_state->qmf_lf_imag[k][n + nr_samples_shift_lf] = *qmf_imag++;
874
64.9k
      hyb_state->qmf_lf_real[k][n + nr_samples_shift_lf] = *qmf_real++;
875
64.9k
    }
876
2.56k
    p_qmf_real += MAX_TIME_SLOTS;
877
2.56k
    p_qmf_imag += MAX_TIME_SLOTS;
878
2.56k
  }
879
880
855
  p_qmf_real = m_qmf_real + nr_qmf_bands_lf * MAX_TIME_SLOTS;
881
855
  p_qmf_imag = m_qmf_imag + nr_qmf_bands_lf * MAX_TIME_SLOTS;
882
883
25.6k
  for (k = 0; k < loop_cnt; k++) {
884
24.7k
    WORD32 *qmf_real = p_qmf_real + val;
885
24.7k
    WORD32 *qmf_imag = p_qmf_imag + val;
886
887
24.7k
    WORD32 *hybrid_real = p_hybrid_real;
888
24.7k
    WORD32 *hybrid_imag = p_hybrid_imag;
889
890
173k
    for (n = 0; n < proto_len; n++) {
891
148k
      *hybrid_real = hyb_state->buffer_hf_real[k][n];
892
148k
      *hybrid_imag = hyb_state->buffer_hf_imag[k][n];
893
894
148k
      hyb_state->buffer_hf_real[k][n] = *qmf_real++;
895
148k
      hyb_state->buffer_hf_imag[k][n] = *qmf_imag++;
896
897
148k
      hybrid_real += MAX_HYBRID_BANDS;
898
148k
      hybrid_imag += MAX_HYBRID_BANDS;
899
148k
    }
900
901
24.7k
    p_qmf_real += MAX_TIME_SLOTS;
902
24.7k
    p_qmf_imag += MAX_TIME_SLOTS;
903
904
24.7k
    p_hybrid_real++;
905
24.7k
    p_hybrid_imag++;
906
24.7k
  }
907
908
855
  p_qmf_real = m_qmf_real + NR_QMF_BANDS_LFXTS;
909
855
  p_qmf_imag = m_qmf_imag + NR_QMF_BANDS_LFXTS;
910
911
855
  p_hybrid_real = m_hybrid_real + 10;
912
855
  p_hybrid_imag = m_hybrid_imag + 10;
913
914
25.6k
  for (k = 0; k < loop_cnt; k++) {
915
24.7k
    WORD32 *qmf_real = p_qmf_real;
916
24.7k
    WORD32 *qmf_imag = p_qmf_imag;
917
918
24.7k
    WORD32 *hybrid_real = p_hybrid_real + proto_len * MAX_HYBRID_BANDS;
919
24.7k
    WORD32 *hybrid_imag = p_hybrid_imag + proto_len * MAX_HYBRID_BANDS;
920
921
503k
    for (n = 0; n < val; n++) {
922
478k
      *hybrid_real = *qmf_real++;
923
478k
      *hybrid_imag = *qmf_imag++;
924
925
478k
      hybrid_real += MAX_HYBRID_BANDS;
926
478k
      hybrid_imag += MAX_HYBRID_BANDS;
927
478k
    }
928
929
24.7k
    p_qmf_real += MAX_TIME_SLOTS;
930
24.7k
    p_qmf_imag += MAX_TIME_SLOTS;
931
932
24.7k
    p_hybrid_real++;
933
24.7k
    p_hybrid_imag++;
934
24.7k
  }
935
936
855
  p_hybrid_real = m_hybrid_real;
937
855
  p_hybrid_imag = m_hybrid_imag;
938
939
22.4k
  for (time_slot = 0; time_slot < nr_samples; time_slot++) {
940
21.6k
    WORD32 *hybrid_real = p_hybrid_real;
941
21.6k
    WORD32 *hybrid_imag = p_hybrid_imag;
942
943
21.6k
    ixheaacd_8ch_filtering(
944
21.6k
        &(hyb_state->buffer_lf_real[0][time_slot + nr_samples_shift_lf + 1 - PROTO_LEN]),
945
21.6k
        &(hyb_state->buffer_lf_imag[0][time_slot + nr_samples_shift_lf + 1 - PROTO_LEN]),
946
21.6k
        m_temp_output_real, m_temp_output_imag, hyb_tab_ptr);
947
948
21.6k
    *hybrid_real++ = m_temp_output_real[6];
949
21.6k
    *hybrid_real++ = m_temp_output_real[7];
950
21.6k
    *hybrid_real++ = m_temp_output_real[0];
951
21.6k
    *hybrid_real++ = m_temp_output_real[1];
952
21.6k
    *hybrid_imag++ = (m_temp_output_imag[2] + m_temp_output_imag[5]);
953
21.6k
    *hybrid_real++ = (m_temp_output_real[3] + m_temp_output_real[4]);
954
955
21.6k
    *hybrid_imag++ = m_temp_output_imag[6];
956
21.6k
    *hybrid_imag++ = m_temp_output_imag[7];
957
21.6k
    *hybrid_imag++ = m_temp_output_imag[0];
958
21.6k
    *hybrid_imag++ = m_temp_output_imag[1];
959
21.6k
    *hybrid_real++ = (m_temp_output_real[2] + m_temp_output_real[5]);
960
21.6k
    *hybrid_imag++ = (m_temp_output_imag[3] + m_temp_output_imag[4]);
961
962
21.6k
    ixheaacd_2ch_filtering(
963
21.6k
        &(hyb_state->buffer_lf_real[1][time_slot + nr_samples_shift_lf + 1 - PROTO_LEN]),
964
21.6k
        m_temp_output_real, hyb_tab_ptr);
965
966
21.6k
    ixheaacd_2ch_filtering(
967
21.6k
        &(hyb_state->buffer_lf_imag[1][time_slot + nr_samples_shift_lf + 1 - PROTO_LEN]),
968
21.6k
        m_temp_output_imag, hyb_tab_ptr);
969
970
21.6k
    *hybrid_real++ = m_temp_output_real[1];
971
21.6k
    *hybrid_real++ = m_temp_output_real[0];
972
973
21.6k
    *hybrid_imag++ = m_temp_output_imag[0];
974
21.6k
    *hybrid_imag++ = m_temp_output_imag[1];
975
976
21.6k
    ixheaacd_2ch_filtering(
977
21.6k
        &(hyb_state->buffer_lf_real[2][time_slot + nr_samples_shift_lf + 1 - PROTO_LEN]),
978
21.6k
        m_temp_output_real, hyb_tab_ptr);
979
980
21.6k
    ixheaacd_2ch_filtering(
981
21.6k
        &(hyb_state->buffer_lf_imag[2][time_slot + nr_samples_shift_lf + 1 - PROTO_LEN]),
982
21.6k
        m_temp_output_imag, hyb_tab_ptr);
983
984
21.6k
    *hybrid_real++ = m_temp_output_real[0];
985
21.6k
    *hybrid_real++ = m_temp_output_real[1];
986
987
21.6k
    *hybrid_imag++ = m_temp_output_imag[0];
988
21.6k
    *hybrid_imag++ = m_temp_output_imag[1];
989
990
21.6k
    p_hybrid_real += MAX_HYBRID_BANDS;
991
21.6k
    p_hybrid_imag += MAX_HYBRID_BANDS;
992
21.6k
  }
993
994
855
  p_qmf_real = m_qmf_real;
995
855
  p_qmf_imag = m_qmf_imag;
996
997
855
  p_buffer_lf_real = &hyb_state->buffer_lf_real[0][nr_samples_shift_lf];
998
855
  p_buffer_lf_imag = &hyb_state->buffer_lf_imag[0][nr_samples_shift_lf];
999
1000
3.42k
  for (k = 0; k < nr_qmf_bands_lf; k++) {
1001
2.56k
    for (n = MAX_TIME_SLOTS; n < nr_samples_shift_lf; n++) {
1002
0
      hyb_state->buffer_lf_real[k][n] = hyb_state->qmf_lf_real[k][n];
1003
0
      hyb_state->buffer_lf_imag[k][n] = hyb_state->qmf_lf_imag[k][n];
1004
0
    }
1005
2.56k
    {
1006
2.56k
      memcpy(p_buffer_lf_real, p_qmf_real, nr_samples_x4);
1007
2.56k
      memcpy(p_buffer_lf_imag, p_qmf_imag, nr_samples_x4);
1008
2.56k
    }
1009
2.56k
    p_qmf_real += MAX_TIME_SLOTS;
1010
2.56k
    p_qmf_imag += MAX_TIME_SLOTS;
1011
1012
2.56k
    p_buffer_lf_real += BUFFER_LEN_LF;
1013
2.56k
    p_buffer_lf_imag += BUFFER_LEN_LF;
1014
2.56k
  }
1015
855
}
1016
1017
VOID ixheaacd_apply_ana_hyb_filt_bank_create_x_res(
1018
    ia_mps_dec_thyb_filter_state_struct *hyb_state, WORD32 *m_qmf_real, WORD32 *m_qmf_imag,
1019
    WORD32 nr_bands, WORD32 nr_samples, WORD32 *m_hybrid_real, WORD32 *m_hybrid_imag,
1020
    SIZE_T *indx, WORD32 res, WORD32 hyb_bands, WORD32 num_parameter_bands, WORD32 *counter,
1021
512
    const ia_mps_dec_hybrid_tables_struct *hyb_tab_ptr) {
1022
512
  WORD32 nr_samples_shift_lf;
1023
512
  WORD32 nr_qmf_bands_lf;
1024
512
  WORD32 k, n, qs;
1025
512
  WORD32 time_slot, ch_off_set;
1026
512
  SIZE_T *idx = indx;
1027
1028
512
  WORD32 proto_len = (PROTO_LEN - 1) >> 1;
1029
512
  WORD32 val = nr_samples - proto_len;
1030
1031
512
  WORD32 *p_qmf_real = m_qmf_real;
1032
512
  WORD32 *p_qmf_imag = m_qmf_imag;
1033
512
  WORD32 loop_cnt;
1034
1035
512
  WORD32 m_temp_output_real[MAX_HYBRID_ONLY_BANDS_PER_QMF];
1036
512
  WORD32 m_temp_output_imag[MAX_HYBRID_ONLY_BANDS_PER_QMF];
1037
1038
512
  WORD32 *p_hybrid_real = m_hybrid_real + 10;
1039
512
  WORD32 *p_hybrid_imag = m_hybrid_imag + 10;
1040
1041
512
  WORD32 *p_hybrid_re, *p_hybrid_im;
1042
1043
512
  WORD32 *p_buffer_lf_real, *p_buffer_lf_imag;
1044
1045
512
  WORD32 nr_samples_x4 = nr_samples << 2;
1046
1047
512
  nr_samples_shift_lf = BUFFER_LEN_LF - nr_samples;
1048
1049
512
  nr_qmf_bands_lf = QMF_BANDS_TO_HYBRID;
1050
512
  loop_cnt = nr_bands - nr_qmf_bands_lf;
1051
512
  ch_off_set = 0;
1052
1053
2.04k
  for (k = 0; k < nr_qmf_bands_lf; k++) {
1054
89.1k
    for (n = 0; n < nr_samples_shift_lf; n++) {
1055
87.6k
      hyb_state->buffer_lf_real[k][n] = hyb_state->buffer_lf_real[k][n + nr_samples];
1056
87.6k
      hyb_state->buffer_lf_imag[k][n] = hyb_state->buffer_lf_imag[k][n + nr_samples];
1057
1058
87.6k
      hyb_state->qmf_lf_real[k][n] = hyb_state->qmf_lf_real[k][n + nr_samples];
1059
87.6k
      hyb_state->qmf_lf_imag[k][n] = hyb_state->qmf_lf_imag[k][n + nr_samples];
1060
87.6k
    }
1061
1.53k
  }
1062
2.04k
  for (k = 0; k < nr_qmf_bands_lf; k++) {
1063
1.53k
    WORD32 *qmf_real = p_qmf_real;
1064
1.53k
    WORD32 *qmf_imag = p_qmf_imag;
1065
1066
42.9k
    for (n = 0; n < nr_samples; n++) {
1067
41.3k
      hyb_state->buffer_lf_real[k][n + nr_samples_shift_lf] = *qmf_real;
1068
41.3k
      hyb_state->buffer_lf_imag[k][n + nr_samples_shift_lf] = *qmf_imag;
1069
1070
41.3k
      hyb_state->qmf_lf_imag[k][n + nr_samples_shift_lf] = *qmf_imag++;
1071
41.3k
      hyb_state->qmf_lf_real[k][n + nr_samples_shift_lf] = *qmf_real++;
1072
41.3k
    }
1073
1.53k
    p_qmf_real += MAX_TIME_SLOTS;
1074
1.53k
    p_qmf_imag += MAX_TIME_SLOTS;
1075
1.53k
  }
1076
1077
512
  p_qmf_real = m_qmf_real + NR_QMF_BANDS_LFXTS;
1078
512
  p_qmf_imag = m_qmf_imag + NR_QMF_BANDS_LFXTS;
1079
1080
15.4k
  for (k = 0; k < loop_cnt; k++) {
1081
14.9k
    WORD32 *qmf_real = p_qmf_real + val;
1082
14.9k
    WORD32 *qmf_imag = p_qmf_imag + val;
1083
1084
14.9k
    p_hybrid_re = p_hybrid_real;
1085
14.9k
    p_hybrid_im = p_hybrid_imag;
1086
1087
104k
    for (n = 0; n < proto_len; n++) {
1088
89.4k
      *p_hybrid_re = hyb_state->buffer_hf_real[k][n];
1089
89.4k
      *p_hybrid_im = hyb_state->buffer_hf_imag[k][n];
1090
1091
89.4k
      hyb_state->buffer_hf_real[k][n] = *qmf_real++;
1092
89.4k
      hyb_state->buffer_hf_imag[k][n] = *qmf_imag++;
1093
1094
89.4k
      p_hybrid_re += MAX_HYBRID_BANDS;
1095
89.4k
      p_hybrid_im += MAX_HYBRID_BANDS;
1096
89.4k
    }
1097
14.9k
    p_qmf_real += MAX_TIME_SLOTS;
1098
14.9k
    p_qmf_imag += MAX_TIME_SLOTS;
1099
1100
14.9k
    p_hybrid_real++;
1101
14.9k
    p_hybrid_imag++;
1102
14.9k
  }
1103
1104
512
  p_qmf_real = m_qmf_real + NR_QMF_BANDS_LFXTS;
1105
512
  p_qmf_imag = m_qmf_imag + NR_QMF_BANDS_LFXTS;
1106
1107
512
  p_hybrid_real = m_hybrid_real + 10;
1108
512
  p_hybrid_imag = m_hybrid_imag + 10;
1109
1110
15.4k
  for (k = 0; k < loop_cnt; k++) {
1111
14.9k
    WORD32 *qmf_real = p_qmf_real;
1112
14.9k
    WORD32 *qmf_imag = p_qmf_imag;
1113
1114
14.9k
    p_hybrid_re = p_hybrid_real + proto_len * MAX_HYBRID_BANDS;
1115
14.9k
    p_hybrid_im = p_hybrid_imag + proto_len * MAX_HYBRID_BANDS;
1116
1117
326k
    for (n = 0; n < val; n++) {
1118
311k
      *p_hybrid_re = *qmf_real++;
1119
311k
      *p_hybrid_im = *qmf_imag++;
1120
1121
311k
      p_hybrid_re += MAX_HYBRID_BANDS;
1122
311k
      p_hybrid_im += MAX_HYBRID_BANDS;
1123
311k
    }
1124
14.9k
    p_qmf_real += MAX_TIME_SLOTS;
1125
14.9k
    p_qmf_imag += MAX_TIME_SLOTS;
1126
1127
14.9k
    p_hybrid_real++;
1128
14.9k
    p_hybrid_imag++;
1129
14.9k
  }
1130
1131
512
  if (res == 1 && (num_parameter_bands == 20 || num_parameter_bands == 28))
1132
51
    *counter = 3;
1133
461
  else {
1134
461
    idx = indx;
1135
9.22k
    for (qs = 0; qs < hyb_bands; qs++) {
1136
8.76k
      if (*idx++ >= (SIZE_T)res) {
1137
421
        *counter = qs;
1138
421
        qs = hyb_bands;
1139
421
      }
1140
8.76k
    }
1141
461
  }
1142
1143
512
  p_hybrid_real = m_hybrid_real;
1144
512
  p_hybrid_imag = m_hybrid_imag;
1145
14.3k
  for (time_slot = 0; time_slot < nr_samples; time_slot++) {
1146
13.7k
    idx = indx;
1147
13.7k
    p_hybrid_re = p_hybrid_real;
1148
13.7k
    p_hybrid_im = p_hybrid_imag;
1149
1150
13.7k
    ixheaacd_8ch_filtering(
1151
13.7k
        &(hyb_state->buffer_lf_real[0][time_slot + nr_samples_shift_lf + 1 - PROTO_LEN]),
1152
13.7k
        &(hyb_state->buffer_lf_imag[0][time_slot + nr_samples_shift_lf + 1 - PROTO_LEN]),
1153
13.7k
        m_temp_output_real, m_temp_output_imag, hyb_tab_ptr);
1154
1155
13.7k
    *p_hybrid_re++ = m_temp_output_real[6];
1156
13.7k
    *p_hybrid_re++ = m_temp_output_real[7];
1157
13.7k
    *p_hybrid_re++ = m_temp_output_real[0];
1158
1159
13.7k
    *p_hybrid_re++ = m_temp_output_real[1];
1160
1161
13.7k
    *p_hybrid_im++ = m_temp_output_imag[6];
1162
13.7k
    *p_hybrid_im++ = m_temp_output_imag[7];
1163
13.7k
    *p_hybrid_im++ = m_temp_output_imag[0];
1164
13.7k
    *p_hybrid_im++ = m_temp_output_imag[1];
1165
1166
13.7k
    if (*counter > 4) {
1167
10.2k
      *p_hybrid_re++ = ixheaac_add32_sat(m_temp_output_real[2], m_temp_output_real[5]);
1168
10.2k
      *p_hybrid_im++ = ixheaac_add32_sat(m_temp_output_imag[2], m_temp_output_imag[5]);
1169
10.2k
    }
1170
1171
13.7k
    if (*counter > 5) {
1172
9.52k
      *p_hybrid_re++ = ixheaac_add32_sat(m_temp_output_real[3], m_temp_output_real[4]);
1173
9.52k
      *p_hybrid_im++ = ixheaac_add32_sat(m_temp_output_imag[3], m_temp_output_imag[4]);
1174
9.52k
    }
1175
1176
13.7k
    ch_off_set = 6;
1177
13.7k
    p_hybrid_re = p_hybrid_real + ch_off_set;
1178
13.7k
    p_hybrid_im = p_hybrid_imag + ch_off_set;
1179
1180
13.7k
    ixheaacd_2ch_filtering(
1181
13.7k
        &(hyb_state->buffer_lf_real[1][time_slot + nr_samples_shift_lf + 1 - PROTO_LEN]),
1182
13.7k
        m_temp_output_real, hyb_tab_ptr);
1183
1184
13.7k
    ixheaacd_2ch_filtering(
1185
13.7k
        &(hyb_state->buffer_lf_imag[1][time_slot + nr_samples_shift_lf + 1 - PROTO_LEN]),
1186
13.7k
        m_temp_output_imag, hyb_tab_ptr);
1187
1188
13.7k
    *p_hybrid_re++ = m_temp_output_real[1];
1189
13.7k
    *p_hybrid_re++ = m_temp_output_real[0];
1190
1191
13.7k
    *p_hybrid_im++ = m_temp_output_imag[1];
1192
13.7k
    *p_hybrid_im++ = m_temp_output_imag[0];
1193
1194
13.7k
    ixheaacd_2ch_filtering(
1195
13.7k
        &(hyb_state->buffer_lf_real[2][time_slot + nr_samples_shift_lf + 1 - PROTO_LEN]),
1196
13.7k
        m_temp_output_real, hyb_tab_ptr);
1197
1198
13.7k
    ixheaacd_2ch_filtering(
1199
13.7k
        &(hyb_state->buffer_lf_imag[2][time_slot + nr_samples_shift_lf + 1 - PROTO_LEN]),
1200
13.7k
        m_temp_output_imag, hyb_tab_ptr);
1201
1202
13.7k
    *p_hybrid_re++ = m_temp_output_real[0];
1203
13.7k
    *p_hybrid_re++ = m_temp_output_real[1];
1204
1205
13.7k
    *p_hybrid_im++ = m_temp_output_imag[0];
1206
13.7k
    *p_hybrid_im++ = m_temp_output_imag[1];
1207
1208
13.7k
    p_hybrid_real += MAX_HYBRID_BANDS;
1209
13.7k
    p_hybrid_imag += MAX_HYBRID_BANDS;
1210
13.7k
  }
1211
512
  p_qmf_real = m_qmf_real;
1212
512
  p_qmf_imag = m_qmf_imag;
1213
1214
512
  p_buffer_lf_real = &hyb_state->buffer_lf_real[0][nr_samples_shift_lf];
1215
512
  p_buffer_lf_imag = &hyb_state->buffer_lf_imag[0][nr_samples_shift_lf];
1216
1217
2.04k
  for (k = 0; k < nr_qmf_bands_lf; k++) {
1218
1.53k
    for (n = MAX_TIME_SLOTS; n < nr_samples_shift_lf; n++) {
1219
0
      hyb_state->buffer_lf_real[k][n] = hyb_state->qmf_lf_real[k][n];
1220
0
      hyb_state->buffer_lf_imag[k][n] = hyb_state->qmf_lf_imag[k][n];
1221
0
    }
1222
1.53k
    {
1223
1.53k
      memcpy(p_buffer_lf_real, p_qmf_real, nr_samples_x4);
1224
1.53k
      memcpy(p_buffer_lf_imag, p_qmf_imag, nr_samples_x4);
1225
1.53k
    }
1226
1.53k
    p_qmf_real += MAX_TIME_SLOTS;
1227
1.53k
    p_qmf_imag += MAX_TIME_SLOTS;
1228
1229
1.53k
    p_buffer_lf_real += BUFFER_LEN_LF;
1230
1.53k
    p_buffer_lf_imag += BUFFER_LEN_LF;
1231
1.53k
  }
1232
512
}