Coverage Report

Created: 2026-10-31 07:10

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libxaac/decoder/ixheaacd_aac_imdct.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 "ixheaacd_sbr_common.h"
21
#include "ixheaac_type_def.h"
22
23
#include "ixheaac_constants.h"
24
#include "ixheaac_basic_ops32.h"
25
#include "ixheaac_basic_ops16.h"
26
#include "ixheaac_basic_ops40.h"
27
#include "ixheaac_basic_ops.h"
28
29
#include "ixheaacd_defines.h"
30
#include "ixheaacd_common_rom.h"
31
#include "ixheaacd_basic_funcs.h"
32
#include "ixheaacd_aac_rom.h"
33
#include "ixheaacd_aac_imdct.h"
34
#include "ixheaacd_intrinsics.h"
35
36
#include "ixheaac_basic_op.h"
37
#include "ixheaacd_function_selector.h"
38
39
#include "ixheaacd_audioobjtypes.h"
40
#include "ixheaacd_tns.h"
41
42
#define DIG_REV(i, m, j)                                      \
43
4.48M
  do {                                                        \
44
4.48M
    unsigned _ = (i);                                         \
45
4.48M
    _ = ((_ & 0x33333333) << 2) | ((_ & ~0x33333333) >> 2);   \
46
4.48M
    _ = ((_ & 0x0F0F0F0F) << 4) | ((_ & ~0x0F0F0F0F) >> 4);   \
47
4.48M
    _ = ((_ & 0x00FF00FF) << 8) | ((_ & ~0x00FF00FF) >> 8);   \
48
4.48M
    _ = ((_ & 0x0000FFFF) << 16) | ((_ & ~0x0000FFFF) >> 16); \
49
4.48M
    (j) = _ >> (m);                                           \
50
4.48M
  } while (0)
51
52
#define MPYHIRC(x, y)                                                         \
53
                                                                              \
54
241M
  (((WORD32)((WORD16)(x >> 16) * (UWORD16)(y & 0x0000FFFF) + 0x4000) >>       \
55
241M
    15) +                                                                     \
56
241M
   ((WORD32)((WORD16)(x >> 16) * (WORD16)((y) >> 16)) << 1))
57
58
#define MPYLUHS(x, y) \
59
241M
  ((WORD32)((UWORD16)(x & 0x0000FFFF) * (WORD16)(y >> 16)))
60
61
#define MPYLIRC(x, y) \
62
181M
  (((WORD32)((WORD16)(x) * (UWORD16)(y & 0x0000FFFF) + 0x4000) >> 15)+ \
63
181M
((WORD32)((WORD16)(x) * (WORD16)((y) >> 16)) << 1))
64
65
WORD32 rev_dig[] = { 0, 8, 2, 10 };
66
67
164k
#define MDCT_LEN 480
68
#define FFT15X2 30
69
56.4k
#define MDCT_LEN_BY2 240
70
32.1M
#define FFT5 5
71
2.74M
#define FFT16 16
72
11.8M
#define FFT4 4
73
19.0M
#define FFT3 3
74
16.6M
#define FFT15 15
75
3.31M
#define FFT16X2 32
76
270k
#define MDCT_LEN_960 960
77
78
WORD32 ixheaacd_fft5out[FFT15X2];
79
80
298M
static PLATFORM_INLINE WORD32 ixheaacd_mult32x16lin32(WORD32 a, WORD32 b) {
81
298M
  WORD32 result;
82
298M
  WORD64 temp_result;
83
298M
  temp_result = (WORD64)a * (WORD64)(((b & 0xFFFF) << 16) >> 16);
84
298M
  result = (WORD32)(temp_result >> 16);
85
298M
  return (result);
86
298M
}
87
88
static PLATFORM_INLINE WORD32 ixheaacd_mac32x16lin32(WORD32 a, WORD32 b,
89
90.6M
                                                     WORD32 c) {
90
90.6M
  WORD32 result;
91
90.6M
  result = a + ixheaacd_mult32x16lin32(b, c);
92
90.6M
  return (result);
93
90.6M
}
94
95
65.5M
static PLATFORM_INLINE WORD32 ixheaacd_mult32x16lin32_sat(WORD32 a, WORD32 b) {
96
65.5M
  WORD32 result;
97
65.5M
  WORD64 temp_result;
98
65.5M
  temp_result = (WORD64)a * (WORD64)(((b & 0xFFFF) << 16) >> 16);
99
65.5M
  if (temp_result < (WORD64)MIN_32)
100
6.96M
    result = MIN_32;
101
58.6M
  else if (temp_result > (WORD64)MAX_32)
102
8.20M
    result = MAX_32;
103
50.4M
  else
104
50.4M
    result = (WORD32)(temp_result);
105
65.5M
  return (result);
106
65.5M
}
107
108
87.1k
WORD16 ixheaacd_neg_expo_inc_dec(WORD16 neg_expo) { return (neg_expo + 2); }
109
110
0
WORD16 ixheaacd_neg_expo_inc_arm(WORD16 neg_expo) { return (neg_expo + 3); }
111
112
VOID ixheaacd_pretwiddle_compute_960_dec(
113
    WORD32 *spec_data1, WORD32 *spec_data2, WORD32 *out_ptr,
114
    ia_aac_dec_imdct_tables_struct *ptr_imdct_tables, WORD npoints4,
115
0
    WORD32 neg_expo) {
116
117
0
  WORD32 i;
118
0
  WORD32 tempr, tempi;
119
120
0
  WORD16 c, c1, s, s1;
121
0
  WORD32 *out_ptr1 = out_ptr + ((npoints4 << 2) - 1);
122
0
  const WORD16 *cos_sin_ptr = ptr_imdct_tables->cosine_array_240;
123
124
0
  for (i = 0; i < npoints4; i++) {
125
0
    c = *cos_sin_ptr++;
126
0
    s = *cos_sin_ptr++;
127
128
0
    tempr = *spec_data1++;
129
0
    tempi = *spec_data2--;
130
131
0
    *out_ptr =
132
0
        ixheaac_mac32x16in32(ixheaac_mult32x16in32(tempr, c), tempi, s);
133
134
135
0
    *out_ptr = ixheaac_shl32(*out_ptr, neg_expo);
136
0
    out_ptr++;
137
138
0
    *out_ptr = ixheaac_sub32(ixheaac_mult32x16in32(tempi, c),
139
0
                              ixheaac_mult32x16in32(tempr, s));
140
141
0
    *out_ptr = ixheaac_shl32(*out_ptr, neg_expo);
142
0
    out_ptr++;
143
144
0
    c1 = *cos_sin_ptr++;
145
0
    s1 = *cos_sin_ptr++;
146
147
0
    tempi = *spec_data1++;
148
0
    tempr = *spec_data2--;
149
150
151
0
    *out_ptr1 = ixheaac_sub32(ixheaac_mult32x16in32(tempi, c1),
152
0
                               ixheaac_mult32x16in32(tempr, s1));
153
154
0
    *out_ptr1 = ixheaac_shl32(*out_ptr1, neg_expo);
155
0
    out_ptr1--;
156
157
0
    *out_ptr1 =
158
0
        ixheaac_mac32x16in32(ixheaac_mult32x16in32(tempr, c1), tempi, s1);
159
160
0
    *out_ptr1 = ixheaac_shl32(*out_ptr1, neg_expo);
161
0
    out_ptr1--;
162
0
  }
163
0
}
164
165
VOID ixheaacd_pretwiddle_compute_dec(
166
    WORD32 *spec_data1, WORD32 *spec_data2, WORD32 *out_ptr,
167
    ia_aac_dec_imdct_tables_struct *ptr_imdct_tables, WORD npoints4,
168
198k
    WORD32 neg_expo) {
169
198k
  WORD32 i;
170
198k
  WORD32 tempr, tempi;
171
198k
  WORD32 tempr1, tempi1;
172
198k
  WORD32 npoints2 = npoints4 * 2;
173
198k
  WORD32 *out_ptr1 = out_ptr + (npoints2 << 1) - 1;
174
198k
  const WORD16 *cos_sin_ptr = ptr_imdct_tables->cosine_array_2048_256;
175
176
198k
  WORD16 cos = 0, cos1 = 0, sin = 0, sin1 = 0;
177
198k
  if (neg_expo < 0) {
178
84.8k
    neg_expo = -neg_expo;
179
84.8k
    if (npoints4 == 256) {
180
45.2k
      cos = *cos_sin_ptr++;
181
45.2k
      sin = *cos_sin_ptr++;
182
45.2k
    } else if (npoints4 == 32) {
183
39.5k
      cos = *cos_sin_ptr++;
184
39.5k
      sin = *cos_sin_ptr;
185
39.5k
      cos_sin_ptr += 15;
186
39.5k
    }
187
84.8k
    tempr = *spec_data1++;
188
84.8k
    tempi = *spec_data2--;
189
190
84.8k
    *out_ptr =
191
84.8k
        ixheaac_mac32x16in32(ixheaac_mult32x16in32(tempr, cos), tempi, sin);
192
193
84.8k
    *out_ptr = ixheaac_shl32(*out_ptr, neg_expo);
194
84.8k
    out_ptr++;
195
196
84.8k
    *out_ptr = ixheaac_sub32(ixheaac_mult32x16in32(tempi, cos),
197
84.8k
                              ixheaac_mult32x16in32(tempr, sin));
198
199
84.8k
    *out_ptr = ixheaac_shl32(*out_ptr, neg_expo);
200
84.8k
    out_ptr++;
201
202
12.8M
    for (i = 0; i < npoints4 - 1; i++) {
203
12.7M
      if (npoints4 == 256) {
204
11.5M
        sin = *cos_sin_ptr++;
205
11.5M
        cos = *cos_sin_ptr++;
206
11.5M
      } else if (npoints4 == 32) {
207
1.22M
        sin = *cos_sin_ptr++;
208
1.22M
        cos = *cos_sin_ptr;
209
1.22M
        cos_sin_ptr += 15;
210
1.22M
      }
211
212
12.7M
      tempi1 = *spec_data1++;
213
12.7M
      tempr = *spec_data1++;
214
12.7M
      tempr1 = *spec_data2--;
215
12.7M
      tempi = *spec_data2--;
216
217
12.7M
      *out_ptr1 = ixheaac_sub32(ixheaac_mult32x16in32(tempi1, cos),
218
12.7M
                                 ixheaac_mult32x16in32(tempr1, sin));
219
220
12.7M
      *out_ptr1 = ixheaac_shl32(*out_ptr1, neg_expo);
221
12.7M
      out_ptr1--;
222
223
12.7M
      *out_ptr1 = ixheaac_mac32x16in32(ixheaac_mult32x16in32(tempr1, cos),
224
12.7M
                                        tempi1, sin);
225
12.7M
      *out_ptr1 = ixheaac_shl32(*out_ptr1, neg_expo);
226
12.7M
      out_ptr1--;
227
228
12.7M
      *out_ptr =
229
12.7M
          ixheaac_mac32x16in32(ixheaac_mult32x16in32(tempr, sin), tempi, cos);
230
12.7M
      *out_ptr = ixheaac_shl32(*out_ptr, neg_expo);
231
12.7M
      out_ptr++;
232
233
12.7M
      *out_ptr = ixheaac_sub32(ixheaac_mult32x16in32(tempi, sin),
234
12.7M
                                ixheaac_mult32x16in32(tempr, cos));
235
12.7M
      *out_ptr = ixheaac_shl32(*out_ptr, neg_expo);
236
12.7M
      out_ptr++;
237
12.7M
    }
238
84.8k
    cos1 = *cos_sin_ptr++;
239
84.8k
    sin1 = *cos_sin_ptr;
240
241
84.8k
    tempr1 = *spec_data2;
242
84.8k
    tempi1 = *spec_data1;
243
244
84.8k
    *out_ptr1 = ixheaac_sub32(ixheaac_mult32x16in32(tempi1, cos1),
245
84.8k
                               ixheaac_mult32x16in32(tempr1, sin1));
246
84.8k
    *out_ptr1 = ixheaac_shl32(*out_ptr1, neg_expo);
247
84.8k
    out_ptr1--;
248
249
84.8k
    *out_ptr1 = ixheaac_mac32x16in32(ixheaac_mult32x16in32(tempr1, cos1),
250
84.8k
                                      tempi1, sin1);
251
84.8k
    *out_ptr1 = ixheaac_shl32(*out_ptr1, neg_expo);
252
84.8k
    out_ptr1--;
253
254
114k
  } else {
255
114k
    if (npoints4 == 256) {
256
56.1k
      cos = *cos_sin_ptr++;
257
56.1k
      sin = *cos_sin_ptr++;
258
259
57.8k
    } else if (npoints4 == 32) {
260
57.8k
      cos = *cos_sin_ptr++;
261
57.8k
      sin = *cos_sin_ptr;
262
57.8k
      cos_sin_ptr += 15;
263
57.8k
    }
264
114k
    tempr = *spec_data1++;
265
114k
    tempi = *spec_data2--;
266
267
114k
    *out_ptr =
268
114k
        ixheaac_mac32x16in32(ixheaac_mult32x16in32(tempr, cos), tempi, sin);
269
114k
    *out_ptr = ixheaac_shr32(*out_ptr, neg_expo);
270
114k
    out_ptr++;
271
272
114k
    *out_ptr = ixheaac_sub32(ixheaac_mult32x16in32(tempi, cos),
273
114k
                              ixheaac_mult32x16in32(tempr, sin));
274
275
114k
    *out_ptr = ixheaac_shr32(*out_ptr, neg_expo);
276
114k
    out_ptr++;
277
278
16.2M
    for (i = 0; i < npoints4 - 1; i++) {
279
16.1M
      if (npoints4 == 256) {
280
14.3M
        sin = *cos_sin_ptr++;
281
14.3M
        cos = *cos_sin_ptr++;
282
14.3M
      } else if (npoints4 == 32) {
283
1.79M
        sin = *cos_sin_ptr++;
284
1.79M
        cos = *cos_sin_ptr;
285
1.79M
        cos_sin_ptr += 15;
286
1.79M
      }
287
288
16.1M
      tempi1 = *spec_data1++;
289
16.1M
      tempr = *spec_data1++;
290
16.1M
      tempr1 = *spec_data2--;
291
16.1M
      tempi = *spec_data2--;
292
293
16.1M
      *out_ptr1 = ixheaac_sub32(ixheaac_mult32x16in32(tempi1, cos),
294
16.1M
                                 ixheaac_mult32x16in32(tempr1, sin));
295
16.1M
      *out_ptr1 = ixheaac_shr32(*out_ptr1, neg_expo);
296
16.1M
      out_ptr1--;
297
298
16.1M
      *out_ptr1 = ixheaac_mac32x16in32(ixheaac_mult32x16in32(tempr1, cos),
299
16.1M
                                        tempi1, sin);
300
16.1M
      *out_ptr1 = ixheaac_shr32(*out_ptr1, neg_expo);
301
16.1M
      out_ptr1--;
302
303
16.1M
      *out_ptr =
304
16.1M
          ixheaac_mac32x16in32(ixheaac_mult32x16in32(tempr, sin), tempi, cos);
305
16.1M
      *out_ptr = ixheaac_shr32(*out_ptr, neg_expo);
306
16.1M
      out_ptr++;
307
308
16.1M
      *out_ptr = ixheaac_sub32(ixheaac_mult32x16in32(tempi, sin),
309
16.1M
                                ixheaac_mult32x16in32(tempr, cos));
310
16.1M
      *out_ptr = ixheaac_shr32(*out_ptr, neg_expo);
311
16.1M
      out_ptr++;
312
16.1M
    }
313
114k
    cos1 = *cos_sin_ptr++;
314
114k
    sin1 = *cos_sin_ptr;
315
316
114k
    tempr1 = *spec_data2;
317
114k
    tempi1 = *spec_data1;
318
319
114k
    *out_ptr1 = ixheaac_sub32(ixheaac_mult32x16in32(tempi1, cos1),
320
114k
                               ixheaac_mult32x16in32(tempr1, sin1));
321
114k
    *out_ptr1 = ixheaac_shr32(*out_ptr1, neg_expo);
322
114k
    out_ptr1--;
323
324
114k
    *out_ptr1 = ixheaac_mac32x16in32(ixheaac_mult32x16in32(tempr1, cos1),
325
114k
                                      tempi1, sin1);
326
114k
    *out_ptr1 = ixheaac_shr32(*out_ptr1, neg_expo);
327
114k
    out_ptr1--;
328
114k
  }
329
198k
}
330
331
VOID ixheaacd_post_twiddle_dec(WORD32 out_ptr[], WORD32 spec_data[],
332
                               ia_aac_dec_imdct_tables_struct *ptr_imdct_tables,
333
134k
                               WORD npoints) {
334
134k
  WORD i;
335
134k
  WORD16 cos, cos1, sin, sin1;
336
134k
  WORD32 *spec_data1 = spec_data + npoints - 1;
337
134k
  WORD32 *out_ptr1 = out_ptr + npoints - 1;
338
134k
  WORD16 adjust = 50, adjust1 = -50;
339
134k
  const WORD16 *cos_sin_ptr = ptr_imdct_tables->cosine_array_2048_256;
340
341
134k
  if (npoints == 1024) {
342
37.3k
    WORD32 tempr, tempi, outi, outr, temp1, temp2;
343
37.3k
    tempr = *spec_data++;
344
37.3k
    tempi = *spec_data++;
345
346
37.3k
    cos = *cos_sin_ptr;
347
37.3k
    cos_sin_ptr++;
348
37.3k
    sin = *cos_sin_ptr;
349
37.3k
    cos_sin_ptr++;
350
351
37.3k
    outi = ixheaac_sub32(ixheaac_mult32x16in32(tempr, sin),
352
37.3k
                          ixheaac_mult32x16in32(tempi, cos));
353
37.3k
    outr =
354
37.3k
        ixheaac_mac32x16in32(ixheaac_mult32x16in32(tempr, cos), tempi, sin);
355
356
37.3k
    temp1 = ixheaac_mult32x16in32(outi, adjust1);
357
37.3k
    temp2 = ixheaac_mult32x16in32(outr, adjust);
358
359
37.3k
    outr = outr + temp1;
360
37.3k
    outi = outi + temp2;
361
37.3k
    *out_ptr1-- = outi;
362
37.3k
    *out_ptr++ = outr;
363
364
9.55M
    for (i = 0; i < (npoints / 2 - 2); i++) {
365
9.51M
      sin = *cos_sin_ptr++;
366
9.51M
      cos = *cos_sin_ptr++;
367
368
9.51M
      tempi = *spec_data1--;
369
9.51M
      tempr = *spec_data1--;
370
371
9.51M
      outi = ixheaac_sub32(ixheaac_mult32x16in32(tempr, sin),
372
9.51M
                            ixheaac_mult32x16in32(tempi, cos));
373
9.51M
      outr =
374
9.51M
          ixheaac_mac32x16in32(ixheaac_mult32x16in32(tempr, cos), tempi, sin);
375
376
9.51M
      temp1 = ixheaac_mult32x16in32(outi, adjust1);
377
9.51M
      temp2 = ixheaac_mult32x16in32(outr, adjust);
378
379
9.51M
      outr = outr + temp1;
380
9.51M
      outi = outi + temp2;
381
382
9.51M
      *out_ptr++ = outi;
383
9.51M
      *out_ptr1-- = outr;
384
385
9.51M
      i++;
386
9.51M
      tempr = *spec_data++;
387
9.51M
      tempi = *spec_data++;
388
389
9.51M
      outi = ixheaac_sub32(ixheaac_mult32x16in32(tempr, cos),
390
9.51M
                            ixheaac_mult32x16in32(tempi, sin));
391
9.51M
      outr =
392
9.51M
          ixheaac_mac32x16in32(ixheaac_mult32x16in32(tempr, sin), tempi, cos);
393
394
9.51M
      temp1 = ixheaac_mult32x16in32(outi, adjust1);
395
9.51M
      temp2 = ixheaac_mult32x16in32(outr, adjust);
396
397
9.51M
      outr = outr + temp1;
398
9.51M
      outi = outi + temp2;
399
400
9.51M
      *out_ptr1-- = outi;
401
9.51M
      *out_ptr++ = outr;
402
9.51M
    }
403
37.3k
    cos1 = *cos_sin_ptr++;
404
37.3k
    sin1 = *cos_sin_ptr;
405
406
37.3k
    tempi = *spec_data1--;
407
37.3k
    tempr = *spec_data1--;
408
409
37.3k
    outi = ixheaac_sub32(ixheaac_mult32x16in32(tempr, sin1),
410
37.3k
                          ixheaac_mult32x16in32(tempi, cos1));
411
37.3k
    outr =
412
37.3k
        ixheaac_mac32x16in32(ixheaac_mult32x16in32(tempr, cos1), tempi, sin1);
413
414
37.3k
    temp1 = ixheaac_mult32x16in32(outi, adjust1);
415
37.3k
    temp2 = ixheaac_mult32x16in32(outr, adjust);
416
417
37.3k
    outr = outr + temp1;
418
37.3k
    outi = outi + temp2;
419
420
37.3k
    *out_ptr++ = outi;
421
37.3k
    *out_ptr1-- = outr;
422
97.4k
  } else if (npoints == 128) {
423
97.4k
    WORD32 tempr, tempi, outi, outr, temp1, temp2;
424
97.4k
    tempr = *spec_data++;
425
97.4k
    tempi = *spec_data++;
426
427
97.4k
    cos = *cos_sin_ptr++;
428
97.4k
    sin = *cos_sin_ptr;
429
97.4k
    cos_sin_ptr += 15;
430
431
97.4k
    outi = ixheaac_sub32(ixheaac_mult32x16in32(tempr, sin),
432
97.4k
                          ixheaac_mult32x16in32(tempi, cos));
433
97.4k
    outr =
434
97.4k
        ixheaac_mac32x16in32(ixheaac_mult32x16in32(tempr, cos), tempi, sin);
435
436
97.4k
    temp1 = ixheaac_mult32x16in32(outi, -(201 << 1));
437
97.4k
    temp2 = ixheaac_mult32x16in32(outr, 201 << 1);
438
439
97.4k
    outr = outr + temp1;
440
97.4k
    outi = outi + temp2;
441
97.4k
    *out_ptr1-- = outi;
442
97.4k
    *out_ptr++ = outr;
443
444
3.11M
    for (i = 0; i < (npoints / 2 - 2); i++) {
445
3.02M
      sin = *cos_sin_ptr++;
446
3.02M
      cos = *cos_sin_ptr;
447
3.02M
      cos_sin_ptr += 15;
448
449
3.02M
      tempi = *spec_data1--;
450
3.02M
      tempr = *spec_data1--;
451
452
3.02M
      outi = ixheaac_sub32(ixheaac_mult32x16in32(tempr, sin),
453
3.02M
                            ixheaac_mult32x16in32(tempi, cos));
454
3.02M
      outr =
455
3.02M
          ixheaac_mac32x16in32(ixheaac_mult32x16in32(tempr, cos), tempi, sin);
456
457
3.02M
      temp1 = ixheaac_mult32x16in32(outi, -(201 << 1));
458
3.02M
      temp2 = ixheaac_mult32x16in32(outr, 201 << 1);
459
460
3.02M
      outr = outr + temp1;
461
3.02M
      outi = outi + temp2;
462
463
3.02M
      *out_ptr++ = outi;
464
3.02M
      *out_ptr1-- = outr;
465
466
3.02M
      i++;
467
3.02M
      tempr = *spec_data++;
468
3.02M
      tempi = *spec_data++;
469
470
3.02M
      outi = ixheaac_sub32(ixheaac_mult32x16in32(tempr, cos),
471
3.02M
                            ixheaac_mult32x16in32(tempi, sin));
472
3.02M
      outr =
473
3.02M
          ixheaac_mac32x16in32(ixheaac_mult32x16in32(tempr, sin), tempi, cos);
474
475
3.02M
      temp1 = ixheaac_mult32x16in32(outi, -(201 << 1));
476
3.02M
      temp2 = ixheaac_mult32x16in32(outr, 201 << 1);
477
478
3.02M
      outr = outr + temp1;
479
3.02M
      outi = outi + temp2;
480
481
3.02M
      *out_ptr1-- = outi;
482
3.02M
      *out_ptr++ = outr;
483
3.02M
    }
484
97.4k
    cos1 = *cos_sin_ptr++;
485
97.4k
    sin1 = *cos_sin_ptr;
486
487
97.4k
    tempi = *spec_data1--;
488
97.4k
    tempr = *spec_data1--;
489
490
97.4k
    outi = ixheaac_sub32(ixheaac_mult32x16in32(tempr, sin1),
491
97.4k
                          ixheaac_mult32x16in32(tempi, cos1));
492
97.4k
    outr =
493
97.4k
        ixheaac_mac32x16in32(ixheaac_mult32x16in32(tempr, cos1), tempi, sin1);
494
495
97.4k
    temp1 = ixheaac_mult32x16in32(outi, -(201 << 1));
496
97.4k
    temp2 = ixheaac_mult32x16in32(outr, 201 << 1);
497
498
97.4k
    outr = outr + temp1;
499
97.4k
    outi = outi + temp2;
500
501
97.4k
    *out_ptr++ = outi;
502
97.4k
    *out_ptr1-- = outr;
503
97.4k
  }
504
134k
}
505
506
VOID ixheaacd_post_twid_overlap_add_dec(
507
    WORD32 pcm_out[], WORD32 spec_data[],
508
    ia_aac_dec_imdct_tables_struct *ptr_imdct_tables, WORD npoints,
509
    WORD32 *ptr_overlap_buf, WORD16 q_shift, const WORD16 *window,
510
64.0k
    WORD16 ch_fac) {
511
64.0k
  WORD i;
512
64.0k
  WORD16 cos, cos1, sin, sin1;
513
64.0k
  WORD32 size = npoints / 2;
514
64.0k
  WORD32 *pcmout1 = pcm_out + (ch_fac * size);
515
64.0k
  const WORD16 *cos_sin_ptr = ptr_imdct_tables->cosine_array_2048_256;
516
517
64.0k
  pcm_out = pcmout1 - ch_fac;
518
64.0k
  spec_data += size;
519
520
64.0k
  if (q_shift > 0) {
521
27.9k
    WORD32 tempr, tempi, outr, outi, win1, accu, temp1, temp2;
522
27.9k
    WORD16 adjust, adjust1;
523
27.9k
    WORD32 overlap_data;
524
525
27.9k
    tempr = *(spec_data - size);
526
27.9k
    tempi = *(spec_data - size + 1);
527
27.9k
    adjust = 50;
528
27.9k
    adjust1 = -50;
529
27.9k
    cos = *cos_sin_ptr++;
530
27.9k
    sin = *cos_sin_ptr++;
531
27.9k
    outi = ixheaac_sub32(ixheaac_mult32x16in32(tempr, sin),
532
27.9k
                          ixheaac_mult32x16in32(tempi, cos));
533
27.9k
    outr = ixheaac_add32(ixheaac_mult32x16in32(tempr, cos),
534
27.9k
                          ixheaac_mult32x16in32(tempi, sin));
535
536
27.9k
    overlap_data = *ptr_overlap_buf;
537
538
27.9k
    temp1 = ixheaac_mult32x16in32(outi, adjust1);
539
27.9k
    temp2 = ixheaac_mult32x16in32(outr, adjust);
540
541
27.9k
    outr = outr + temp1;
542
27.9k
    outi = outi + temp2;
543
544
27.9k
    *ptr_overlap_buf++ = ixheaac_shr32_sat(outr, 16 - q_shift);
545
546
27.9k
    win1 = *((WORD32 *)window + size - 1);
547
27.9k
    accu = ixheaac_sub32_sat(
548
27.9k
        ixheaac_shl32_sat(ixheaacd_mult32x16lin32(outi, win1), q_shift),
549
27.9k
        ixheaacd_mult32x16lin32_sat(overlap_data, (WORD16)(win1 >> 16)));
550
551
27.9k
    *pcm_out = accu;
552
553
27.9k
    pcm_out -= ch_fac;
554
27.9k
    accu = ixheaac_sub32_sat(
555
27.9k
        ixheaac_shl32_sat(
556
27.9k
            ixheaac_mult32x16hin32(ixheaac_negate32_sat(outi), win1),
557
27.9k
            q_shift),
558
27.9k
        ixheaacd_mult32x16lin32_sat(overlap_data, (WORD16)(win1)));
559
560
27.9k
    *pcmout1 = accu;
561
562
27.9k
    pcmout1 += ch_fac;
563
564
7.15M
    for (i = size - 2; i != 0;) {
565
7.13M
      sin = *cos_sin_ptr++;
566
7.13M
      cos = *cos_sin_ptr++;
567
568
7.13M
      tempr = *(spec_data + i);
569
7.13M
      tempi = *(spec_data + i + 1);
570
571
7.13M
      outr = ixheaac_add32(ixheaac_mult32x16in32(tempr, cos),
572
7.13M
                            ixheaac_mult32x16in32(tempi, sin));
573
7.13M
      outi = ixheaac_sub32(ixheaac_mult32x16in32(tempr, sin),
574
7.13M
                            ixheaac_mult32x16in32(tempi, cos));
575
576
7.13M
      temp1 = ixheaac_mult32x16in32(outi, adjust1);
577
7.13M
      temp2 = ixheaac_mult32x16in32(outr, adjust);
578
579
7.13M
      outr = outr + temp1;
580
7.13M
      outi = outi + temp2;
581
582
7.13M
      overlap_data = *ptr_overlap_buf;
583
584
7.13M
      *ptr_overlap_buf++ = ixheaac_shr32_sat(outi, 16 - q_shift);
585
586
7.13M
      win1 = *((WORD32 *)window + i);
587
7.13M
      accu = ixheaac_sub32_sat(
588
7.13M
          ixheaac_shl32_sat(ixheaacd_mult32x16lin32(outr, win1), q_shift),
589
7.13M
          ixheaacd_mult32x16lin32_sat(overlap_data, (WORD16)(win1 >> 16)));
590
591
7.13M
      *pcm_out = accu;
592
7.13M
      pcm_out -= ch_fac;
593
7.13M
      accu = ixheaac_sub32_sat(
594
7.13M
          ixheaac_shl32_sat(
595
7.13M
              ixheaac_mult32x16hin32(ixheaac_negate32_sat(outr), win1),
596
7.13M
              q_shift),
597
7.13M
          ixheaacd_mult32x16lin32_sat(overlap_data, (WORD16)win1));
598
599
7.13M
      *pcmout1 = accu;
600
7.13M
      pcmout1 += ch_fac;
601
602
7.13M
      tempr = *(spec_data - i);
603
7.13M
      tempi = *(spec_data - i + 1);
604
605
7.13M
      i -= 2;
606
607
7.13M
      outi = ixheaac_sub32(ixheaac_mult32x16in32(tempr, cos),
608
7.13M
                            ixheaac_mult32x16in32(tempi, sin));
609
7.13M
      outr = ixheaac_add32(ixheaac_mult32x16in32(tempr, sin),
610
7.13M
                            ixheaac_mult32x16in32(tempi, cos));
611
612
7.13M
      overlap_data = *ptr_overlap_buf;
613
614
7.13M
      temp1 = ixheaac_mult32x16in32(outi, adjust1);
615
616
7.13M
      temp2 = ixheaac_mult32x16in32(outr, adjust);
617
618
7.13M
      outr = outr + temp1;
619
7.13M
      outi = outi + temp2;
620
621
7.13M
      *ptr_overlap_buf++ = ixheaac_shr32_sat(outr, 16 - q_shift);
622
623
7.13M
      win1 = *((WORD32 *)window + i + 1);
624
7.13M
      accu = ixheaac_sub32_sat(
625
7.13M
          ixheaac_shl32_sat(ixheaacd_mult32x16lin32(outi, win1), q_shift),
626
7.13M
          ixheaacd_mult32x16lin32_sat(overlap_data, (WORD16)(win1 >> 16)));
627
628
7.13M
      *pcm_out = accu;
629
7.13M
      pcm_out -= ch_fac;
630
7.13M
      accu = ixheaac_sub32_sat(
631
7.13M
          ixheaac_shl32_sat(
632
7.13M
              ixheaac_mult32x16hin32(ixheaac_negate32_sat(outi), win1),
633
7.13M
              q_shift),
634
7.13M
          ixheaacd_mult32x16lin32_sat(overlap_data, (WORD16)(win1)));
635
7.13M
      *pcmout1 = accu;
636
7.13M
      pcmout1 += ch_fac;
637
7.13M
    }
638
27.9k
    cos1 = *cos_sin_ptr++;
639
27.9k
    sin1 = *cos_sin_ptr;
640
641
27.9k
    tempr = *(spec_data + i);
642
27.9k
    tempi = *(spec_data + i + 1);
643
644
27.9k
    outr = ixheaac_add32(ixheaac_mult32x16in32(tempr, cos1),
645
27.9k
                          ixheaac_mult32x16in32(tempi, sin1));
646
27.9k
    outi = ixheaac_sub32(ixheaac_mult32x16in32(tempr, sin1),
647
27.9k
                          ixheaac_mult32x16in32(tempi, cos1));
648
649
27.9k
    temp1 = ixheaac_mult32x16in32(outi, adjust1);
650
651
27.9k
    temp2 = ixheaac_mult32x16in32(outr, adjust);
652
653
27.9k
    outr = outr + temp1;
654
27.9k
    outi = outi + temp2;
655
656
27.9k
    overlap_data = *ptr_overlap_buf;
657
658
27.9k
    *ptr_overlap_buf++ = ixheaac_shr32_sat(outi, 16 - q_shift);
659
27.9k
    win1 = *((WORD32 *)window + i);
660
27.9k
    accu = ixheaac_sub32_sat(
661
27.9k
        ixheaac_shl32_sat(ixheaacd_mult32x16lin32(outr, win1), q_shift),
662
27.9k
        ixheaacd_mult32x16lin32_sat(overlap_data, (WORD16)(win1 >> 16)));
663
664
27.9k
    *pcm_out = accu;
665
27.9k
    pcm_out -= ch_fac;
666
27.9k
    accu = ixheaac_sub32_sat(
667
27.9k
        ixheaac_shl32_sat(
668
27.9k
            ixheaac_mult32x16hin32(ixheaac_negate32_sat(outr), win1),
669
27.9k
            q_shift),
670
27.9k
        ixheaacd_mult32x16lin32_sat(overlap_data, (WORD16)win1));
671
672
27.9k
    *pcmout1 = accu;
673
27.9k
    pcmout1 += ch_fac;
674
36.0k
  } else {
675
36.0k
    q_shift = -q_shift;
676
36.0k
    {
677
36.0k
      WORD32 tempr, tempi, temp1, temp2, outr, outi, win1, accu;
678
36.0k
      WORD16 adjust, adjust1;
679
36.0k
      WORD16 overlap_data;
680
36.0k
      tempr = *(spec_data - size);
681
36.0k
      tempi = *(spec_data - size + 1);
682
683
36.0k
      adjust = 50;
684
36.0k
      adjust1 = -50;
685
36.0k
      cos = *cos_sin_ptr++;
686
36.0k
      sin = *cos_sin_ptr++;
687
688
36.0k
      outi = ixheaac_sub32(ixheaac_mult32x16in32(tempr, sin),
689
36.0k
                            ixheaac_mult32x16in32(tempi, cos));
690
36.0k
      outr = ixheaac_add32(ixheaac_mult32x16in32(tempr, cos),
691
36.0k
                            ixheaac_mult32x16in32(tempi, sin));
692
693
36.0k
      overlap_data = *ptr_overlap_buf;
694
695
36.0k
      temp1 = ixheaac_mult32x16in32(outi, adjust1);
696
36.0k
      temp2 = ixheaac_mult32x16in32(outr, adjust);
697
698
36.0k
      outr = outr + temp1;
699
36.0k
      outi = outi + temp2;
700
701
36.0k
      *ptr_overlap_buf++ = ixheaac_shr32_sat(outr, 16 + q_shift);
702
703
36.0k
      win1 = *((WORD32 *)window + size - 1);
704
36.0k
      accu = ixheaac_sub32_sat(
705
36.0k
          ixheaac_shr32(ixheaacd_mult32x16lin32(outi, win1), q_shift),
706
36.0k
          ixheaacd_mult32x16lin32_sat(overlap_data, (WORD16)(win1 >> 16)));
707
708
36.0k
      *pcm_out = accu;
709
710
36.0k
      pcm_out -= ch_fac;
711
36.0k
      accu = ixheaac_sub32_sat(
712
36.0k
          ixheaac_shr32(
713
36.0k
              ixheaac_mult32x16hin32(ixheaac_negate32_sat(outi), win1),
714
36.0k
              q_shift),
715
36.0k
          ixheaacd_mult32x16lin32_sat(overlap_data, (WORD16)(win1)));
716
717
36.0k
      *pcmout1 = accu;
718
36.0k
      pcmout1 += ch_fac;
719
720
9.23M
      for (i = size - 2; i != 0;) {
721
9.19M
        sin = *cos_sin_ptr++;
722
9.19M
        cos = *cos_sin_ptr++;
723
724
9.19M
        tempr = *(spec_data + i);
725
9.19M
        tempi = *(spec_data + i + 1);
726
727
9.19M
        outr = ixheaac_add32(ixheaac_mult32x16in32(tempr, cos),
728
9.19M
                              ixheaac_mult32x16in32(tempi, sin));
729
9.19M
        outi = ixheaac_sub32(ixheaac_mult32x16in32(tempr, sin),
730
9.19M
                              ixheaac_mult32x16in32(tempi, cos));
731
732
9.19M
        overlap_data = *ptr_overlap_buf;
733
734
9.19M
        temp1 = ixheaac_mult32x16in32(outi, adjust1);
735
736
9.19M
        temp2 = ixheaac_mult32x16in32(outr, adjust);
737
9.19M
        outr = outr + temp1;
738
9.19M
        outi = outi + temp2;
739
9.19M
        *ptr_overlap_buf++ = ixheaac_shr32_sat(outi, 16 + q_shift);
740
741
9.19M
        win1 = *((WORD32 *)window + i);
742
9.19M
        accu = ixheaac_sub32_sat(
743
9.19M
            ixheaac_shr32(ixheaacd_mult32x16lin32(outr, win1), q_shift),
744
9.19M
            ixheaacd_mult32x16lin32_sat(overlap_data, (WORD16)(win1 >> 16)));
745
746
9.19M
        *pcm_out = accu;
747
9.19M
        pcm_out -= ch_fac;
748
749
9.19M
        accu = ixheaac_sub32_sat(
750
9.19M
            ixheaac_shr32(
751
9.19M
                ixheaac_mult32x16hin32(ixheaac_negate32_sat(outr), win1),
752
9.19M
                q_shift),
753
9.19M
            ixheaacd_mult32x16lin32_sat(overlap_data, (WORD16)win1));
754
755
9.19M
        *pcmout1 = accu;
756
9.19M
        pcmout1 += ch_fac;
757
758
9.19M
        tempr = *(spec_data - i);
759
9.19M
        tempi = *(spec_data - i + 1);
760
9.19M
        i -= 2;
761
762
9.19M
        outi = ixheaac_sub32(ixheaac_mult32x16in32(tempr, cos),
763
9.19M
                              ixheaac_mult32x16in32(tempi, sin));
764
9.19M
        outr = ixheaac_add32(ixheaac_mult32x16in32(tempr, sin),
765
9.19M
                              ixheaac_mult32x16in32(tempi, cos));
766
767
9.19M
        overlap_data = *ptr_overlap_buf;
768
769
9.19M
        temp1 = ixheaac_mult32x16in32(outi, adjust1);
770
9.19M
        temp2 = ixheaac_mult32x16in32(outr, adjust);
771
772
9.19M
        outr = outr + temp1;
773
9.19M
        outi = outi + temp2;
774
775
9.19M
        *ptr_overlap_buf++ = ixheaac_shr32_sat(outr, 16 + q_shift);
776
777
9.19M
        win1 = *((WORD32 *)window + i + 1);
778
9.19M
        accu = ixheaac_sub32_sat(
779
9.19M
            ixheaac_shr32(ixheaacd_mult32x16lin32(outi, win1), q_shift),
780
9.19M
            ixheaacd_mult32x16lin32_sat(overlap_data, (WORD16)(win1 >> 16)));
781
782
9.19M
        *pcm_out = accu;
783
9.19M
        pcm_out -= ch_fac;
784
785
9.19M
        accu = ixheaac_sub32_sat(
786
9.19M
            ixheaac_shr32(
787
9.19M
                ixheaac_mult32x16hin32(ixheaac_negate32_sat(outi), win1),
788
9.19M
                q_shift),
789
9.19M
            ixheaacd_mult32x16lin32_sat(overlap_data, (WORD16)(win1)));
790
791
9.19M
        *pcmout1 = accu;
792
9.19M
        pcmout1 += ch_fac;
793
9.19M
      }
794
36.0k
      cos1 = *cos_sin_ptr++;
795
36.0k
      sin1 = *cos_sin_ptr++;
796
797
36.0k
      tempr = *(spec_data + i);
798
36.0k
      tempi = *(spec_data + i + 1);
799
800
36.0k
      outr = ixheaac_add32(ixheaac_mult32x16in32(tempr, cos1),
801
36.0k
                            ixheaac_mult32x16in32(tempi, sin1));
802
36.0k
      outi = ixheaac_sub32(ixheaac_mult32x16in32(tempr, sin1),
803
36.0k
                            ixheaac_mult32x16in32(tempi, cos1));
804
805
36.0k
      overlap_data = *ptr_overlap_buf;
806
807
36.0k
      temp1 = ixheaac_mult32x16in32(outi, adjust1);
808
809
36.0k
      temp2 = ixheaac_mult32x16in32(outr, adjust);
810
811
36.0k
      outr = outr + temp1;
812
36.0k
      outi = outi + temp2;
813
814
36.0k
      *ptr_overlap_buf++ = ixheaac_shr32_sat(outi, 16 + q_shift);
815
816
36.0k
      win1 = *((WORD32 *)window + i);
817
36.0k
      accu = ixheaac_sub32_sat(
818
36.0k
          ixheaac_shr32(ixheaacd_mult32x16lin32(outr, win1), q_shift),
819
36.0k
          ixheaacd_mult32x16lin32_sat(overlap_data, (WORD16)(win1 >> 16)));
820
821
36.0k
      *pcm_out = accu;
822
36.0k
      pcm_out -= ch_fac;
823
36.0k
      accu = ixheaac_sub32_sat(
824
36.0k
          ixheaac_shr32(
825
36.0k
              ixheaac_mult32x16hin32(ixheaac_negate32_sat(outr), win1),
826
36.0k
              q_shift),
827
36.0k
          ixheaacd_mult32x16lin32_sat(overlap_data, (WORD16)win1));
828
36.0k
      *pcmout1 = accu;
829
36.0k
      pcmout1 += ch_fac;
830
36.0k
    }
831
36.0k
  }
832
64.0k
}
833
834
VOID ixheaacd_imdct_using_fft_dec(
835
    ia_aac_dec_imdct_tables_struct *ptr_imdct_tables, WORD32 npoints,
836
    WORD32 *ptr_x, WORD32 *ptr_y)
837
838
198k
{
839
198k
  WORD32 i, j, k, k1, n_stages;
840
198k
  WORD32 x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i, x4r, x4i, x5r, x5i, x6r, x6i,
841
198k
      x7r, x7i;
842
198k
  WORD32 del, nodespacing, in_loop_cnt, tmp, twiddle_val, *ptr_tmp;
843
198k
  const WORD32 *ptr_twiddle;
844
198k
  WORD8 *ptr_dig_rev_table;
845
198k
  n_stages = ixheaac_norm32(npoints);
846
847
198k
  n_stages = (30 - n_stages) / 3;
848
849
198k
  ptr_tmp = ptr_y;
850
851
198k
  ptr_twiddle = ptr_imdct_tables->fft_twiddle;
852
198k
  ptr_dig_rev_table = ((npoints << 1) == 1024)
853
198k
                          ? ptr_imdct_tables->dig_rev_table8_long
854
198k
                          : ptr_imdct_tables->dig_rev_table8_short;
855
856
7.46M
  for (i = npoints; i != 0; i -= 8) {
857
7.26M
    WORD32 *data = ptr_x;
858
7.26M
    data = data + (*ptr_dig_rev_table++ << 1);
859
860
7.26M
    x0r = *data;
861
7.26M
    x0i = *(data + 1);
862
7.26M
    data += (npoints >> 1);
863
864
7.26M
    x2r = *data;
865
7.26M
    x2i = *(data + 1);
866
7.26M
    data += (npoints >> 1);
867
868
7.26M
    x4r = *data;
869
7.26M
    x4i = *(data + 1);
870
7.26M
    data += (npoints >> 1);
871
872
7.26M
    x6r = *data;
873
7.26M
    x6i = *(data + 1);
874
7.26M
    data -= 5 * (npoints >> 2);
875
876
7.26M
    x0r = x0r + x4r;
877
7.26M
    x0i = x0i + x4i;
878
7.26M
    x4r = x0r - (x4r << 1);
879
7.26M
    x4i = x0i - (x4i << 1);
880
881
7.26M
    x2r = x2r + x6r;
882
7.26M
    x2i = x2i + x6i;
883
7.26M
    x6r = x2r - (x6r << 1);
884
7.26M
    x6i = x2i - (x6i << 1);
885
886
7.26M
    x0r = x0r + x2r;
887
7.26M
    x0i = x0i + x2i;
888
7.26M
    x2r = x0r - (x2r << 1);
889
7.26M
    x2i = x0i - (x2i << 1);
890
891
7.26M
    x4r = x4r + x6i;
892
7.26M
    x4i = x4i - x6r;
893
7.26M
    tmp = x6r;
894
7.26M
    x6r = x4r - (x6i << 1);
895
7.26M
    x6i = x4i + (tmp << 1);
896
897
7.26M
    x1r = *data;
898
7.26M
    x1i = *(data + 1);
899
7.26M
    data += (npoints >> 1);
900
901
7.26M
    x3r = *data;
902
7.26M
    x3i = *(data + 1);
903
7.26M
    data += (npoints >> 1);
904
905
7.26M
    x5r = *data;
906
7.26M
    x5i = *(data + 1);
907
7.26M
    data += (npoints >> 1);
908
909
7.26M
    x7r = *data;
910
7.26M
    x7i = *(data + 1);
911
7.26M
    data -= 7 * (npoints >> 2);
912
913
7.26M
    x1r = x1r + x5r;
914
7.26M
    x1i = x1i + x5i;
915
7.26M
    x5r = x1r - (x5r << 1);
916
7.26M
    x5i = x1i - (x5i << 1);
917
918
7.26M
    x3r = x3r + x7r;
919
7.26M
    x3i = x3i + x7i;
920
7.26M
    x7r = x3r - (x7r << 1);
921
7.26M
    x7i = x3i - (x7i << 1);
922
923
7.26M
    x1r = x1r + x3r;
924
7.26M
    x1i = x1i + x3i;
925
7.26M
    x3r = x1r - (x3r << 1);
926
7.26M
    x3i = x1i - (x3i << 1);
927
928
7.26M
    x5r = x5r + x5i;
929
7.26M
    x5i = x5r - (x5i << 1);
930
931
7.26M
    x7r = x7r + x7i;
932
7.26M
    x7i = x7r - (x7i << 1);
933
934
7.26M
    x7i = x5r - x7i;
935
7.26M
    x5r = x7i - (x5r << 1);
936
937
7.26M
    x5i = x7r - x5i;
938
7.26M
    x7r = x5i - (x7r << 1);
939
940
7.26M
    x7i = x7i << 1;
941
7.26M
    x5r = x5r << 1;
942
7.26M
    x5i = x5i << 1;
943
7.26M
    x7r = x7r << 1;
944
945
7.26M
    x0r = x0r + x1r;
946
7.26M
    x0i = x0i + x1i;
947
7.26M
    x1r = x0r - (x1r << 1);
948
7.26M
    x1i = x0i - (x1i << 1);
949
950
7.26M
    x2r = x2r + x3i;
951
7.26M
    tmp = x2r - (x3i << 1);
952
7.26M
    x2i = x2i - x3r;
953
7.26M
    x3i = x2i + (x3r << 1);
954
955
7.26M
    *ptr_tmp = x0r;
956
7.26M
    *(ptr_tmp + 1) = x0i;
957
7.26M
    ptr_tmp += 4;
958
959
7.26M
    *ptr_tmp = x2r;
960
7.26M
    *(ptr_tmp + 1) = x2i;
961
7.26M
    ptr_tmp += 4;
962
963
7.26M
    *ptr_tmp = x1r;
964
7.26M
    *(ptr_tmp + 1) = x1i;
965
7.26M
    ptr_tmp += 4;
966
967
7.26M
    *ptr_tmp = tmp;
968
7.26M
    *(ptr_tmp + 1) = x3i;
969
7.26M
    ptr_tmp -= 10;
970
971
7.26M
    tmp = 0x5A82;
972
973
7.26M
    x7i = x4r + (ixheaacd_mult32x16lin32(x7i, tmp));
974
7.26M
    x4r = x7i - (x4r << 1);
975
976
7.26M
    x7r = x4i + (ixheaacd_mult32x16lin32(x7r, tmp));
977
7.26M
    x4i = x7r - (x4i << 1);
978
979
7.26M
    x5i = x6r + (ixheaacd_mult32x16lin32(x5i, tmp));
980
7.26M
    x6r = x5i - (x6r << 1);
981
982
7.26M
    x5r = x6i + (ixheaacd_mult32x16lin32(x5r, tmp));
983
7.26M
    x6i = x5r - (x6i << 1);
984
985
7.26M
    *ptr_tmp = x7i;
986
7.26M
    *(ptr_tmp + 1) = x7r;
987
7.26M
    ptr_tmp += 4;
988
989
7.26M
    *ptr_tmp = x5i;
990
7.26M
    *(ptr_tmp + 1) = x5r;
991
7.26M
    ptr_tmp += 4;
992
993
7.26M
    *ptr_tmp = -x4r;
994
7.26M
    *(ptr_tmp + 1) = -x4i;
995
7.26M
    ptr_tmp += 4;
996
997
7.26M
    *ptr_tmp = -x6r;
998
7.26M
    *(ptr_tmp + 1) = -x6i;
999
7.26M
    ptr_tmp += 2;
1000
7.26M
  }
1001
1002
198k
  del = 8;
1003
1004
198k
  nodespacing = 64;
1005
198k
  in_loop_cnt = npoints >> 6;
1006
1007
300k
  for (k1 = n_stages - 2; k1 > 0; k1--) {
1008
101k
    WORD32 *data = ptr_y;
1009
101k
    const WORD32 *twiddles;
1010
1011
912k
    for (i = 0; i != npoints; i += 8 * del) {
1012
810k
      data = ptr_y + (i << 1);
1013
810k
      x0r = *data;
1014
810k
      x0i = *(data + 1);
1015
810k
      data += (del << 2);
1016
1017
810k
      x2r = *data;
1018
810k
      x2i = *(data + 1);
1019
810k
      data += (del << 2);
1020
1021
810k
      x4r = *data;
1022
810k
      x4i = *(data + 1);
1023
810k
      data += (del << 2);
1024
1025
810k
      x6r = *data;
1026
810k
      x6i = *(data + 1);
1027
810k
      data -= 5 * (del << 1);
1028
1029
810k
      x0r = x0r + x4r;
1030
810k
      x0i = x0i + x4i;
1031
810k
      x4r = x0r - (x4r << 1);
1032
810k
      x4i = x0i - (x4i << 1);
1033
1034
810k
      x2r = x2r + x6r;
1035
810k
      x2i = x2i + x6i;
1036
810k
      x6r = x2r - (x6r << 1);
1037
810k
      x6i = x2i - (x6i << 1);
1038
1039
810k
      x0r = x0r + x2r;
1040
810k
      x0i = x0i + x2i;
1041
810k
      x2r = x0r - (x2r << 1);
1042
810k
      x2i = x0i - (x2i << 1);
1043
1044
810k
      x4r = x4r + x6i;
1045
810k
      x4i = x4i - x6r;
1046
810k
      tmp = x6r;
1047
810k
      x6r = x4r - (x6i << 1);
1048
810k
      x6i = x4i + (tmp << 1);
1049
1050
810k
      x1r = *data;
1051
810k
      x1i = *(data + 1);
1052
810k
      data += (del << 2);
1053
1054
810k
      x3r = *data;
1055
810k
      x3i = *(data + 1);
1056
810k
      data += (del << 2);
1057
1058
810k
      x5r = *data;
1059
810k
      x5i = *(data + 1);
1060
810k
      data += (del << 2);
1061
1062
810k
      x7r = *data;
1063
810k
      x7i = *(data + 1);
1064
810k
      data -= 7 * (del << 1);
1065
1066
810k
      x1r = x1r + x5r;
1067
810k
      x1i = x1i + x5i;
1068
810k
      x5r = x1r - (x5r << 1);
1069
810k
      x5i = x1i - (x5i << 1);
1070
1071
810k
      x3r = x3r + x7r;
1072
810k
      x3i = x3i + x7i;
1073
810k
      x7r = x3r - (x7r << 1);
1074
810k
      x7i = x3i - (x7i << 1);
1075
1076
810k
      x1r = x1r + x3r;
1077
810k
      x1i = x1i + x3i;
1078
810k
      x3r = x1r - (x3r << 1);
1079
810k
      x3i = x1i - (x3i << 1);
1080
1081
810k
      x5r = x5r + x5i;
1082
810k
      x5i = x5r - (x5i << 1);
1083
1084
810k
      x7r = x7r + x7i;
1085
810k
      x7i = x7r - (x7i << 1);
1086
1087
810k
      x7i = x5r - x7i;
1088
810k
      x5r = x7i - (x5r << 1);
1089
1090
810k
      x5i = x7r - x5i;
1091
810k
      x7r = x5i - (x7r << 1);
1092
1093
810k
      x7i = x7i << 1;
1094
810k
      x5r = x5r << 1;
1095
810k
      x5i = x5i << 1;
1096
810k
      x7r = x7r << 1;
1097
1098
810k
      x0r = x0r + x1r;
1099
810k
      x0i = x0i + x1i;
1100
810k
      x1r = x0r - (x1r << 1);
1101
810k
      x1i = x0i - (x1i << 1);
1102
1103
810k
      x2r = x2r + x3i;
1104
810k
      tmp = x2r - (x3i << 1);
1105
810k
      x2i = x2i - x3r;
1106
810k
      x3i = x2i + (x3r << 1);
1107
1108
810k
      *data = x0r;
1109
810k
      *(data + 1) = x0i;
1110
810k
      data += (del << 2);
1111
1112
810k
      *data = x2r;
1113
810k
      *(data + 1) = x2i;
1114
810k
      data += (del << 2);
1115
1116
810k
      *data = x1r;
1117
810k
      *(data + 1) = x1i;
1118
810k
      data += (del << 2);
1119
1120
810k
      *data = tmp;
1121
810k
      *(data + 1) = x3i;
1122
810k
      data -= 5 * (del << 1);
1123
1124
810k
      tmp = 0x5A82;
1125
1126
810k
      x7i = x4r + (ixheaacd_mult32x16lin32(x7i, tmp));
1127
810k
      x4r = x7i - (x4r << 1);
1128
810k
      x7r = x4i + (ixheaacd_mult32x16lin32(x7r, tmp));
1129
810k
      x4i = x7r - (x4i << 1);
1130
1131
810k
      x5i = x6r + (ixheaacd_mult32x16lin32(x5i, tmp));
1132
810k
      x6r = x5i - (x6r << 1);
1133
810k
      x5r = x6i + (ixheaacd_mult32x16lin32(x5r, tmp));
1134
810k
      x6i = x5r - (x6i << 1);
1135
1136
810k
      *data = x7i;
1137
810k
      *(data + 1) = x7r;
1138
810k
      data += (del << 2);
1139
1140
810k
      *data = x5i;
1141
810k
      *(data + 1) = x5r;
1142
810k
      data += (del << 2);
1143
1144
810k
      *data = -x4r;
1145
810k
      *(data + 1) = -x4i;
1146
810k
      data += (del << 2);
1147
1148
810k
      *data = -x6r;
1149
810k
      *(data + 1) = -x6i;
1150
1151
810k
      data -= 7 * (del << 1);
1152
810k
    }
1153
1154
101k
    twiddles = ptr_twiddle;
1155
101k
    data = ptr_y;
1156
1157
810k
    for (j = nodespacing; j < nodespacing * del; j += nodespacing) {
1158
709k
      data = data + 2;
1159
1160
6.38M
      for (k = in_loop_cnt; k != 0; k--) {
1161
5.67M
        data += (del << 2);
1162
5.67M
        x2r = *data;
1163
5.67M
        x2i = *(data + 1);
1164
1165
5.67M
        data += (del << 2);
1166
5.67M
        x4r = *data;
1167
5.67M
        x4i = *(data + 1);
1168
1169
5.67M
        data += (del << 2);
1170
5.67M
        x6r = *data;
1171
5.67M
        x6i = *(data + 1);
1172
1173
5.67M
        data -= 6 * (del << 1);
1174
1175
5.67M
        twiddles += (j >> 2);
1176
1177
5.67M
        twiddle_val = *(twiddles);
1178
1179
5.67M
        tmp = (ixheaacd_mult32x16lin32(x2r, twiddle_val) -
1180
5.67M
               ixheaac_mult32x16hin32(x2i, twiddle_val));
1181
5.67M
        x2i = (ixheaacd_mac32x16lin32(
1182
5.67M
                  ixheaac_mult32x16hin32(x2r, twiddle_val), x2i,
1183
5.67M
                  twiddle_val))
1184
5.67M
              << 1;
1185
5.67M
        x2r = tmp << 1;
1186
1187
5.67M
        twiddles += (j >> 2);
1188
5.67M
        twiddle_val = *(twiddles);
1189
1190
5.67M
        tmp = (ixheaacd_mult32x16lin32(x4r, twiddle_val) -
1191
5.67M
               ixheaac_mult32x16hin32(x4i, twiddle_val));
1192
5.67M
        x4i = (ixheaacd_mac32x16lin32(
1193
5.67M
                  ixheaac_mult32x16hin32(x4r, twiddle_val), x4i,
1194
5.67M
                  twiddle_val))
1195
5.67M
              << 1;
1196
5.67M
        x4r = tmp << 1;
1197
1198
5.67M
        twiddles += (j >> 2);
1199
5.67M
        twiddle_val = *(twiddles);
1200
1201
5.67M
        tmp = (ixheaacd_mult32x16lin32(x6r, twiddle_val) -
1202
5.67M
               ixheaac_mult32x16hin32(x6i, twiddle_val));
1203
5.67M
        x6i = (ixheaacd_mac32x16lin32(
1204
5.67M
                  ixheaac_mult32x16hin32(x6r, twiddle_val), x6i,
1205
5.67M
                  twiddle_val))
1206
5.67M
              << 1;
1207
5.67M
        x6r = tmp << 1;
1208
1209
5.67M
        x0r = *data;
1210
5.67M
        x0i = *(data + 1);
1211
5.67M
        data += (del << 1);
1212
1213
5.67M
        x0r = x0r + x4r;
1214
5.67M
        x0i = x0i + x4i;
1215
5.67M
        x4r = x0r - (x4r << 1);
1216
5.67M
        x4i = x0i - (x4i << 1);
1217
1218
5.67M
        x2r = x2r + x6r;
1219
5.67M
        x2i = x2i + x6i;
1220
5.67M
        x6r = x2r - (x6r << 1);
1221
5.67M
        x6i = x2i - (x6i << 1);
1222
1223
5.67M
        x0r = x0r + x2r;
1224
5.67M
        x0i = x0i + x2i;
1225
5.67M
        x2r = x0r - (x2r << 1);
1226
5.67M
        x2i = x0i - (x2i << 1);
1227
1228
5.67M
        x4r = x4r + x6i;
1229
5.67M
        x4i = x4i - x6r;
1230
5.67M
        tmp = x6r;
1231
5.67M
        x6r = x4r - (x6i << 1);
1232
5.67M
        x6i = x4i + (tmp << 1);
1233
1234
5.67M
        x1r = *data;
1235
5.67M
        x1i = *(data + 1);
1236
5.67M
        data += (del << 2);
1237
1238
5.67M
        twiddles -= 5 * (j >> 3);
1239
5.67M
        twiddle_val = *(twiddles);
1240
1241
5.67M
        tmp = (ixheaacd_mult32x16lin32(x1r, twiddle_val) -
1242
5.67M
               ixheaac_mult32x16hin32(x1i, twiddle_val));
1243
5.67M
        x1i = (ixheaacd_mac32x16lin32(
1244
5.67M
                  ixheaac_mult32x16hin32(x1r, twiddle_val), x1i,
1245
5.67M
                  twiddle_val))
1246
5.67M
              << 1;
1247
5.67M
        x1r = tmp << 1;
1248
1249
5.67M
        x3r = *data;
1250
5.67M
        x3i = *(data + 1);
1251
5.67M
        data += (del << 2);
1252
1253
5.67M
        twiddles += (j >> 2);
1254
5.67M
        twiddle_val = *(twiddles);
1255
1256
5.67M
        tmp = (ixheaacd_mult32x16lin32(x3r, twiddle_val) -
1257
5.67M
               ixheaac_mult32x16hin32(x3i, twiddle_val));
1258
5.67M
        x3i = (ixheaacd_mac32x16lin32(
1259
5.67M
            ixheaac_mult32x16hin32(x3r, twiddle_val), x3i, twiddle_val));
1260
5.67M
        x3r = tmp;
1261
1262
5.67M
        x5r = *data;
1263
5.67M
        x5i = *(data + 1);
1264
5.67M
        data += (del << 2);
1265
1266
5.67M
        twiddles += (j >> 2);
1267
5.67M
        twiddle_val = *(twiddles);
1268
1269
5.67M
        tmp = (ixheaacd_mult32x16lin32(x5r, twiddle_val) -
1270
5.67M
               ixheaac_mult32x16hin32(x5i, twiddle_val));
1271
5.67M
        x5i = (ixheaacd_mac32x16lin32(
1272
5.67M
            ixheaac_mult32x16hin32(x5r, twiddle_val), x5i, twiddle_val));
1273
5.67M
        x5r = tmp;
1274
1275
5.67M
        x7r = *data;
1276
5.67M
        x7i = *(data + 1);
1277
5.67M
        data -= 7 * (del << 1);
1278
1279
5.67M
        twiddles += (j >> 2);
1280
5.67M
        twiddle_val = *(twiddles);
1281
5.67M
        twiddles -= 7 * (j >> 3);
1282
1283
5.67M
        tmp = (ixheaacd_mult32x16lin32(x7r, twiddle_val) -
1284
5.67M
               ixheaac_mult32x16hin32(x7i, twiddle_val));
1285
5.67M
        x7i = (ixheaacd_mac32x16lin32(
1286
5.67M
            ixheaac_mult32x16hin32(x7r, twiddle_val), x7i, twiddle_val));
1287
5.67M
        x7r = tmp;
1288
1289
5.67M
        x1r = x1r + (x5r << 1);
1290
5.67M
        x1i = x1i + (x5i << 1);
1291
5.67M
        x5r = x1r - (x5r << 2);
1292
5.67M
        x5i = x1i - (x5i << 2);
1293
1294
5.67M
        x3r = x3r + x7r;
1295
5.67M
        x3i = x3i + x7i;
1296
5.67M
        x7r = x3r - (x7r << 1);
1297
5.67M
        x7i = x3i - (x7i << 1);
1298
1299
5.67M
        x1r = x1r + (x3r << 1);
1300
5.67M
        x1i = x1i + (x3i << 1);
1301
5.67M
        x3r = x1r - (x3r << 2);
1302
5.67M
        x3i = x1i - (x3i << 2);
1303
1304
5.67M
        x5r = x5r + x5i;
1305
5.67M
        x5i = x5r - (x5i << 1);
1306
1307
5.67M
        x7r = x7r + x7i;
1308
5.67M
        x7i = x7r - (x7i << 1);
1309
1310
5.67M
        x7i = x5r - (x7i << 1);
1311
5.67M
        x5r = x7i - (x5r << 1);
1312
1313
5.67M
        x5i = (x7r << 1) - x5i;
1314
5.67M
        x7r = x5i - (x7r << 2);
1315
1316
5.67M
        x7i = x7i << 1;
1317
5.67M
        x5r = x5r << 1;
1318
5.67M
        x5i = x5i << 1;
1319
5.67M
        x7r = x7r << 1;
1320
1321
5.67M
        x0r = x0r + x1r;
1322
5.67M
        x0i = x0i + x1i;
1323
5.67M
        x1r = x0r - (x1r << 1);
1324
5.67M
        x1i = x0i - (x1i << 1);
1325
1326
5.67M
        x2r = x2r + x3i;
1327
5.67M
        tmp = x2r - (x3i << 1);
1328
5.67M
        x2i = x2i - x3r;
1329
5.67M
        x3i = x2i + (x3r << 1);
1330
1331
5.67M
        *data = x0r;
1332
5.67M
        *(data + 1) = x0i;
1333
5.67M
        data += (del << 2);
1334
1335
5.67M
        *data = x2r;
1336
5.67M
        *(data + 1) = x2i;
1337
5.67M
        data += (del << 2);
1338
1339
5.67M
        *data = x1r;
1340
5.67M
        *(data + 1) = x1i;
1341
5.67M
        data += (del << 2);
1342
1343
5.67M
        *data = tmp;
1344
5.67M
        *(data + 1) = x3i;
1345
5.67M
        data -= 5 * (del << 1);
1346
1347
5.67M
        tmp = 0x5A82;
1348
1349
5.67M
        x7i = x4r + (ixheaacd_mult32x16lin32(x7i, tmp));
1350
5.67M
        x4r = x7i - (x4r << 1);
1351
1352
5.67M
        x7r = x4i + (ixheaacd_mult32x16lin32(x7r, tmp));
1353
5.67M
        x4i = x7r - (x4i << 1);
1354
1355
5.67M
        x5i = x6r + (ixheaacd_mult32x16lin32(x5i, tmp));
1356
5.67M
        x6r = x5i - (x6r << 1);
1357
1358
5.67M
        x5r = x6i + (ixheaacd_mult32x16lin32(x5r, tmp));
1359
5.67M
        x6i = x5r - (x6i << 1);
1360
1361
5.67M
        *data = x7i;
1362
5.67M
        *(data + 1) = x7r;
1363
5.67M
        data += (del << 2);
1364
1365
5.67M
        *data = x5i;
1366
5.67M
        *(data + 1) = x5r;
1367
5.67M
        data += (del << 2);
1368
1369
5.67M
        *data = -x4r;
1370
5.67M
        *(data + 1) = -x4i;
1371
5.67M
        data += (del << 2);
1372
1373
5.67M
        *data = -x6r;
1374
5.67M
        *(data + 1) = -x6i;
1375
1376
5.67M
        data -= 7 * (del << 1);
1377
5.67M
        data += (del << 4);
1378
5.67M
      }
1379
709k
      data -= npoints << 1;
1380
709k
    }
1381
101k
    nodespacing >>= 3;
1382
101k
    del <<= 3;
1383
101k
    in_loop_cnt >>= 3;
1384
101k
  }
1385
1386
198k
  {
1387
198k
    WORD32 *data = ptr_y;
1388
198k
    const WORD32 *twiddles;
1389
198k
    twiddles = ptr_twiddle;
1390
198k
    data = ptr_y;
1391
198k
    data = data - 2;
1392
1393
7.46M
    for (j = 0; j < nodespacing * del; j += nodespacing) {
1394
7.26M
      data = data + 2;
1395
1396
7.26M
      {
1397
7.26M
        data += (del << 2);
1398
7.26M
        x2r = *data;
1399
7.26M
        x2i = *(data + 1);
1400
1401
7.26M
        data += (del << 2);
1402
7.26M
        x4r = *data;
1403
7.26M
        x4i = *(data + 1);
1404
1405
7.26M
        data += (del << 2);
1406
7.26M
        x6r = *data;
1407
7.26M
        x6i = *(data + 1);
1408
1409
7.26M
        data -= 6 * (del << 1);
1410
1411
7.26M
        twiddles += (j >> 2);
1412
1413
7.26M
        twiddle_val = *(twiddles);
1414
1415
7.26M
        tmp = (ixheaacd_mult32x16lin32(x2r, twiddle_val) -
1416
7.26M
               ixheaac_mult32x16hin32(x2i, twiddle_val));
1417
7.26M
        x2i = (ixheaacd_mac32x16lin32(
1418
7.26M
                  ixheaac_mult32x16hin32(x2r, twiddle_val), x2i,
1419
7.26M
                  twiddle_val))
1420
7.26M
              << 1;
1421
7.26M
        x2r = tmp << 1;
1422
1423
7.26M
        twiddles += (j >> 2);
1424
7.26M
        twiddle_val = *(twiddles);
1425
1426
7.26M
        tmp = (ixheaacd_mult32x16lin32(x4r, twiddle_val) -
1427
7.26M
               ixheaac_mult32x16hin32(x4i, twiddle_val));
1428
7.26M
        x4i = (ixheaacd_mac32x16lin32(
1429
7.26M
                  ixheaac_mult32x16hin32(x4r, twiddle_val), x4i,
1430
7.26M
                  twiddle_val))
1431
7.26M
              << 1;
1432
7.26M
        x4r = tmp << 1;
1433
1434
7.26M
        twiddles += (j >> 2);
1435
7.26M
        twiddle_val = *(twiddles);
1436
1437
7.26M
        tmp = (ixheaacd_mult32x16lin32(x6r, twiddle_val) -
1438
7.26M
               ixheaac_mult32x16hin32(x6i, twiddle_val));
1439
7.26M
        x6i = (ixheaacd_mac32x16lin32(
1440
7.26M
                  ixheaac_mult32x16hin32(x6r, twiddle_val), x6i,
1441
7.26M
                  twiddle_val))
1442
7.26M
              << 1;
1443
7.26M
        x6r = tmp << 1;
1444
1445
7.26M
        x0r = *data;
1446
7.26M
        x0i = *(data + 1);
1447
7.26M
        data += (del << 1);
1448
1449
7.26M
        x0r = x0r + x4r;
1450
7.26M
        x0i = x0i + x4i;
1451
7.26M
        x4r = x0r - (x4r << 1);
1452
7.26M
        x4i = x0i - (x4i << 1);
1453
1454
7.26M
        x2r = x2r + x6r;
1455
7.26M
        x2i = x2i + x6i;
1456
7.26M
        x6r = x2r - (x6r << 1);
1457
7.26M
        x6i = x2i - (x6i << 1);
1458
1459
7.26M
        x0r = x0r + x2r;
1460
7.26M
        x0i = x0i + x2i;
1461
7.26M
        x2r = x0r - (x2r << 1);
1462
7.26M
        x2i = x0i - (x2i << 1);
1463
1464
7.26M
        x4r = x4r + x6i;
1465
7.26M
        x4i = x4i - x6r;
1466
7.26M
        tmp = x6r;
1467
7.26M
        x6r = x4r - (x6i << 1);
1468
7.26M
        x6i = x4i + (tmp << 1);
1469
1470
7.26M
        x1r = *data;
1471
7.26M
        x1i = *(data + 1);
1472
7.26M
        data += (del << 2);
1473
1474
7.26M
        twiddles -= 5 * (j >> 3);
1475
7.26M
        twiddle_val = *(twiddles);
1476
1477
7.26M
        tmp = (ixheaacd_mult32x16lin32(x1r, twiddle_val) -
1478
7.26M
               ixheaac_mult32x16hin32(x1i, twiddle_val));
1479
7.26M
        x1i = (ixheaacd_mac32x16lin32(
1480
7.26M
                  ixheaac_mult32x16hin32(x1r, twiddle_val), x1i,
1481
7.26M
                  twiddle_val))
1482
7.26M
              << 1;
1483
7.26M
        x1r = tmp << 1;
1484
1485
7.26M
        x3r = *data;
1486
7.26M
        x3i = *(data + 1);
1487
7.26M
        data += (del << 2);
1488
1489
7.26M
        twiddles += (j >> 2);
1490
7.26M
        twiddle_val = *(twiddles);
1491
1492
7.26M
        tmp = (ixheaacd_mult32x16lin32(x3r, twiddle_val) -
1493
7.26M
               ixheaac_mult32x16hin32(x3i, twiddle_val));
1494
7.26M
        x3i = (ixheaacd_mac32x16lin32(
1495
7.26M
            ixheaac_mult32x16hin32(x3r, twiddle_val), x3i, twiddle_val));
1496
7.26M
        x3r = tmp;
1497
1498
7.26M
        x5r = *data;
1499
7.26M
        x5i = *(data + 1);
1500
7.26M
        data += (del << 2);
1501
1502
7.26M
        twiddles += (j >> 2);
1503
7.26M
        twiddle_val = *(twiddles);
1504
1505
7.26M
        tmp = (ixheaacd_mult32x16lin32(x5r, twiddle_val) -
1506
7.26M
               ixheaac_mult32x16hin32(x5i, twiddle_val));
1507
7.26M
        x5i = (ixheaacd_mac32x16lin32(
1508
7.26M
            ixheaac_mult32x16hin32(x5r, twiddle_val), x5i, twiddle_val));
1509
7.26M
        x5r = tmp;
1510
1511
7.26M
        x7r = *data;
1512
7.26M
        x7i = *(data + 1);
1513
7.26M
        data -= 7 * (del << 1);
1514
1515
7.26M
        twiddles += (j >> 2);
1516
7.26M
        twiddle_val = *(twiddles);
1517
7.26M
        twiddles -= 7 * (j >> 3);
1518
1519
7.26M
        tmp = (ixheaacd_mult32x16lin32(x7r, twiddle_val) -
1520
7.26M
               ixheaac_mult32x16hin32(x7i, twiddle_val));
1521
7.26M
        x7i = (ixheaacd_mac32x16lin32(
1522
7.26M
            ixheaac_mult32x16hin32(x7r, twiddle_val), x7i, twiddle_val));
1523
7.26M
        x7r = tmp;
1524
1525
7.26M
        x1r = x1r + (x5r << 1);
1526
7.26M
        x1i = x1i + (x5i << 1);
1527
7.26M
        x5r = x1r - (x5r << 2);
1528
7.26M
        x5i = x1i - (x5i << 2);
1529
1530
7.26M
        x3r = x3r + x7r;
1531
7.26M
        x3i = x3i + x7i;
1532
7.26M
        x7r = x3r - (x7r << 1);
1533
7.26M
        x7i = x3i - (x7i << 1);
1534
1535
7.26M
        x1r = x1r + (x3r << 1);
1536
7.26M
        x1i = x1i + (x3i << 1);
1537
7.26M
        x3r = x1r - (x3r << 2);
1538
7.26M
        x3i = x1i - (x3i << 2);
1539
1540
7.26M
        x5r = x5r + x5i;
1541
7.26M
        x5i = x5r - (x5i << 1);
1542
1543
7.26M
        x7r = x7r + x7i;
1544
7.26M
        x7i = x7r - (x7i << 1);
1545
1546
7.26M
        x7i = x5r - (x7i << 1);
1547
7.26M
        x5r = x7i - (x5r << 1);
1548
1549
7.26M
        x5i = (x7r << 1) - x5i;
1550
7.26M
        x7r = x5i - (x7r << 2);
1551
1552
7.26M
        x7i = x7i << 1;
1553
7.26M
        x5r = x5r << 1;
1554
7.26M
        x5i = x5i << 1;
1555
7.26M
        x7r = x7r << 1;
1556
1557
7.26M
        x0r = x0r + x1r;
1558
7.26M
        x0i = x0i + x1i;
1559
7.26M
        x1r = x0r - (x1r << 1);
1560
7.26M
        x1i = x0i - (x1i << 1);
1561
1562
7.26M
        x2r = x2r + x3i;
1563
7.26M
        tmp = x2r - (x3i << 1);
1564
7.26M
        x2i = x2i - x3r;
1565
7.26M
        x3i = x2i + (x3r << 1);
1566
1567
7.26M
        *data = x0r;
1568
7.26M
        *(data + 1) = x0i;
1569
7.26M
        data += (del << 2);
1570
1571
7.26M
        *data = x2r;
1572
7.26M
        *(data + 1) = x2i;
1573
7.26M
        data += (del << 2);
1574
1575
7.26M
        *data = x1r;
1576
7.26M
        *(data + 1) = x1i;
1577
7.26M
        data += (del << 2);
1578
1579
7.26M
        *data = tmp;
1580
7.26M
        *(data + 1) = x3i;
1581
7.26M
        data -= 5 * (del << 1);
1582
1583
7.26M
        tmp = 0x5A82;
1584
1585
7.26M
        x7i = x4r + (ixheaacd_mult32x16lin32(x7i, tmp));
1586
7.26M
        x4r = x7i - (x4r << 1);
1587
1588
7.26M
        x7r = x4i + (ixheaacd_mult32x16lin32(x7r, tmp));
1589
7.26M
        x4i = x7r - (x4i << 1);
1590
1591
7.26M
        x5i = x6r + (ixheaacd_mult32x16lin32(x5i, tmp));
1592
7.26M
        x6r = x5i - (x6r << 1);
1593
1594
7.26M
        x5r = x6i + (ixheaacd_mult32x16lin32(x5r, tmp));
1595
7.26M
        x6i = x5r - (x6i << 1);
1596
1597
7.26M
        *data = x7i;
1598
7.26M
        *(data + 1) = x7r;
1599
7.26M
        data += (del << 2);
1600
1601
7.26M
        *data = x5i;
1602
7.26M
        *(data + 1) = x5r;
1603
7.26M
        data += (del << 2);
1604
1605
7.26M
        *data = -x4r;
1606
7.26M
        *(data + 1) = -x4i;
1607
7.26M
        data += (del << 2);
1608
1609
7.26M
        *data = -x6r;
1610
7.26M
        *(data + 1) = -x6i;
1611
1612
7.26M
        data -= 7 * (del << 1);
1613
7.26M
        data += (del << 4);
1614
7.26M
      }
1615
7.26M
      data -= npoints << 1;
1616
7.26M
    }
1617
1618
198k
    nodespacing >>= 3;
1619
198k
    del <<= 3;
1620
198k
    in_loop_cnt >>= 3;
1621
198k
  }
1622
198k
}
1623
1624
VOID ixheaacd_inverse_transform_960(
1625
    WORD32 spec_data[], WORD32 scratch[],
1626
    ia_aac_dec_imdct_tables_struct *ptr_imdct_tables, WORD32 expo,
1627
339k
    WORD32 *imdct_scale) {
1628
1629
339k
  WORD32 n;
1630
339k
  WORD32 Nd2;
1631
339k
  WORD16 const_mltfac;
1632
339k
  WORD32 neg_expo;
1633
1634
339k
  WORD32 i;
1635
1636
339k
  n = 120;
1637
339k
  Nd2 = n >> 1;
1638
339k
  neg_expo = 4;
1639
1640
339k
  ixheaacd_pre_twiddle_120(spec_data, scratch, n, ptr_imdct_tables->cosine_array_240,
1641
339k
                           neg_expo - expo);
1642
1643
339k
  ixheaacd_fft_120(ptr_imdct_tables, Nd2, spec_data, scratch);
1644
1645
339k
  neg_expo += 2;
1646
339k
  *imdct_scale = neg_expo + 1;
1647
1648
339k
  ixheaacd_post_twiddle_120(spec_data, scratch, ptr_imdct_tables->cosine_array_240,
1649
339k
                            n);
1650
339k
  const_mltfac = 17476;
1651
41.1M
  for (i = 0; i < 120; i++)
1652
40.7M
  {
1653
40.7M
    spec_data[i] = ixheaac_mult32x16in32_shl(spec_data[i], const_mltfac);
1654
40.7M
  }
1655
339k
}
1656
1657
WORD32 ixheaacd_inverse_transform(
1658
    WORD32 spec_data[], WORD32 scratch[],
1659
    ia_aac_dec_imdct_tables_struct *ptr_imdct_tables, WORD32 expo,
1660
198k
    WORD32 npoints) {
1661
198k
  (*ixheaacd_pretwiddle_compute)(spec_data, spec_data + npoints - 1, scratch,
1662
198k
                                 ptr_imdct_tables, (npoints >> 2), expo);
1663
1664
198k
  (*ixheaacd_imdct_using_fft)(ptr_imdct_tables, npoints >> 1, scratch,
1665
198k
                              spec_data);
1666
1667
198k
  expo += 2;
1668
1669
198k
  return expo;
1670
198k
}
1671
1672
VOID ixheaacd_mdct_960(WORD32 *inp, WORD32 *scratch, WORD32 *mdct_scale,
1673
                       WORD32 mdct_flag,
1674
54.0k
                       ia_aac_dec_imdct_tables_struct *imdct_tables_ptr) {
1675
54.0k
  WORD32 expo, neg_expo = 0, k;
1676
1677
54.0k
  WORD16 const_mltfac = 17476;
1678
1679
54.0k
  expo = (*ixheaacd_calc_max_spectral_line)(inp, MDCT_LEN_960) - 1;
1680
54.0k
  ;
1681
1682
54.0k
  memcpy(scratch, inp, sizeof(WORD32) * MDCT_LEN_960);
1683
1684
54.0k
  neg_expo = 7 - expo;
1685
1686
54.0k
  ixheaacd_pre_twiddle_960(inp, scratch, MDCT_LEN_960, imdct_tables_ptr->cosine_array_1920,
1687
54.0k
                           neg_expo);
1688
1689
54.0k
  ixheaacd_fft_960(inp, scratch, imdct_tables_ptr);
1690
1691
54.0k
  ixheaacd_post_twiddle_960(inp, scratch, imdct_tables_ptr->cosine_array_1920,
1692
54.0k
                            MDCT_LEN_960);
1693
1694
54.0k
  if (0 == mdct_flag) {
1695
54.0k
    WORD32 *data = inp;
1696
1697
25.9M
    for (k = MDCT_LEN_960 - 1; k >= 0; k -= 2) {
1698
25.9M
      *data = ixheaac_mult32x16in32_shl(*data, const_mltfac);
1699
25.9M
      data++;
1700
25.9M
      *data = ixheaac_mult32x16in32_shl(*data, const_mltfac);
1701
25.9M
      data++;
1702
25.9M
    }
1703
54.0k
  }
1704
54.0k
  *mdct_scale = neg_expo + 1 + 1 + 1;
1705
54.0k
}
1706
1707
VOID ixheaacd_mdct_480_ld(WORD32 *inp, WORD32 *scratch, WORD32 *mdct_scale,
1708
                          WORD32 mdct_flag,
1709
                          ia_aac_dec_imdct_tables_struct *imdct_tables_ptr,
1710
56.4k
                          WORD32 object_type) {
1711
56.4k
  WORD32 expo, neg_expo = 0, k;
1712
1713
56.4k
  WORD32 const_mltfac = 1145324612;
1714
1715
56.4k
  expo = (*ixheaacd_calc_max_spectral_line)(inp, MDCT_LEN) - 1;
1716
56.4k
  ;
1717
1718
56.4k
  memcpy(scratch, inp, sizeof(WORD32) * MDCT_LEN);
1719
1720
56.4k
  neg_expo = 7 - expo;
1721
1722
56.4k
  ixheaacd_pre_twiddle(inp, scratch, 480, imdct_tables_ptr->cosine_array_960,
1723
56.4k
                       neg_expo);
1724
1725
56.4k
  ixheaacd_fft_480_ld(inp, scratch, imdct_tables_ptr);
1726
1727
56.4k
  if (object_type == AOT_ER_AAC_LD) {
1728
21.2k
    ixheaacd_post_twiddle_ld(inp, scratch, imdct_tables_ptr->cosine_array_960,
1729
21.2k
                             480);
1730
35.2k
  } else if (object_type == AOT_ER_AAC_ELD) {
1731
35.2k
    ixheaacd_post_twiddle_eld(inp + (480), scratch,
1732
35.2k
                              imdct_tables_ptr->cosine_array_960, 480);
1733
35.2k
  }
1734
1735
56.4k
  if (0 == mdct_flag) {
1736
51.4k
    WORD32 *data = inp;
1737
1738
51.4k
    if (object_type != AOT_ER_AAC_ELD) {
1739
3.91M
      for (k = MDCT_LEN - 1; k >= 0; k -= 2) {
1740
3.90M
        *data = ixheaac_mult32_shl(*data, const_mltfac);
1741
3.90M
        data++;
1742
3.90M
        *data = ixheaac_mult32_shl(*data, const_mltfac);
1743
3.90M
        data++;
1744
3.90M
      }
1745
16.2k
      neg_expo += 1;
1746
35.2k
    } else {
1747
35.2k
      data = inp + 480;
1748
16.9M
      for (k = (MDCT_LEN << 1) - 1; k >= 0; k -= 2) {
1749
16.8M
        *data = ixheaac_mult32_shl(*data, const_mltfac);
1750
16.8M
        data++;
1751
16.8M
        *data = ixheaac_mult32_shl(*data, const_mltfac);
1752
16.8M
        data++;
1753
16.8M
      }
1754
35.2k
      neg_expo += 1;
1755
35.2k
    }
1756
51.4k
  }
1757
1758
56.4k
  *mdct_scale = neg_expo + 3;
1759
56.4k
}
1760
1761
VOID ixheaacd_inverse_transform_512(
1762
    WORD32 data[], WORD32 temp[], WORD32 *imdct_scale, WORD32 *cos_sin_ptr,
1763
87.1k
    ia_aac_dec_imdct_tables_struct *imdct_tables_ptr, WORD32 object_type) {
1764
87.1k
  WORD32 n;
1765
87.1k
  WORD32 npoints_2;
1766
87.1k
  WORD16 expo, neg_expo;
1767
1768
87.1k
  n = 512;
1769
1770
87.1k
  npoints_2 = n >> 1;
1771
1772
87.1k
  expo = (*ixheaacd_calc_max_spectral_line)(data, n) - 1;
1773
1774
87.1k
  memcpy(temp, data, sizeof(WORD32) * n);
1775
1776
87.1k
  neg_expo = 7 - expo;
1777
1778
87.1k
  ixheaacd_pre_twiddle(data, temp, n, cos_sin_ptr, neg_expo);
1779
1780
87.1k
  (*ixheaacd_fft32x32_ld)(imdct_tables_ptr, npoints_2, data, temp);
1781
1782
87.1k
  neg_expo = (*ixheaacd_neg_expo_inc)(neg_expo);
1783
1784
87.1k
  *imdct_scale = neg_expo + 1;
1785
1786
87.1k
  if (object_type == AOT_ER_AAC_ELD)
1787
29.5k
    ixheaacd_post_twiddle_eld((data + n), temp, cos_sin_ptr, n);
1788
57.6k
  else
1789
57.6k
    ixheaacd_post_twiddle_ld((data), temp, cos_sin_ptr, n);
1790
87.1k
}
1791
1792
VOID ixheaacd_fft_960(WORD32 *inp, WORD32 *op,
1793
54.0k
                      ia_aac_dec_imdct_tables_struct *imdct_tables_ptr) {
1794
54.0k
  WORD32 i;
1795
54.0k
  WORD32 *buf1, *buf2;
1796
54.0k
  WORD16 *re_arr_tab_sml_480_ptr;
1797
1798
54.0k
  (*ixheaacd_aac_ld_dec_rearrange_960)(inp, op, 480,
1799
54.0k
                                       imdct_tables_ptr->re_arr_tab_32);
1800
1801
54.0k
  buf1 = op;
1802
54.0k
  buf2 = inp;
1803
1804
864k
  for (i = 0; i < FFT15; i++) {
1805
810k
    ixheaacd_fft_32_points(imdct_tables_ptr->w_32,
1806
810k
                           32, buf1, buf2);
1807
1808
810k
    buf1 += (FFT16X2 * 2);
1809
810k
    buf2 += (FFT16X2 * 2);
1810
810k
  }
1811
1812
54.0k
  re_arr_tab_sml_480_ptr = imdct_tables_ptr->re_arr_tab_sml_480;
1813
54.0k
  buf1 = inp;
1814
1815
1.78M
  for (i = 0; i < FFT16 * 2; i++) {
1816
1.72M
    ixheaacd_ld_dec_fft_15_opt(buf1, op,
1817
1.72M
                               ixheaacd_fft5out, re_arr_tab_sml_480_ptr);
1818
1.72M
    buf1 += 2;
1819
1.72M
    re_arr_tab_sml_480_ptr += FFT15;
1820
1.72M
  }
1821
54.0k
}
1822
1823
VOID ixheaacd_fft_32_points(WORD16 *ptr_w, WORD32 npoints,
1824
810k
                            WORD32* ptr_x, WORD32* ptr_y) {
1825
810k
  WORD32   i, j, l1, l2, h2, predj, tw_offset, stride, fft_jmp;
1826
810k
  WORD32   xt0_0, yt0_0, xt1_0, yt1_0, xt2_0, yt2_0;
1827
810k
  WORD32   xh0_0, xh1_0, xh20_0, xh21_0, xl0_0, xl1_0, xl20_0, xl21_0;
1828
810k
  WORD32   x_0, x_1, x_l1_0, x_l1_1, x_l2_0, x_l2_1;
1829
810k
  WORD32   x_h2_0, x_h2_1;
1830
810k
  WORD16 si10, si20, si30, co10, co20, co30;
1831
810k
  WORD16 *w;
1832
810k
  WORD32   *x, *x2, *x0;
1833
810k
  WORD32   *y0, *y1, *y2, *y3;
1834
810k
  WORD32   n0, j0;
1835
810k
  WORD32   radix;
1836
810k
  WORD32   norm;
1837
1838
810k
  radix = 2;
1839
810k
  norm = 25;
1840
1841
810k
  stride = 32;
1842
810k
  tw_offset = 0;
1843
810k
  fft_jmp = 192;
1844
1845
2.43M
  while (stride > radix) {
1846
1.62M
    j = 0;
1847
1.62M
    fft_jmp >>= 2;
1848
1849
1.62M
    h2 = stride >> 1;
1850
1.62M
    l1 = stride;
1851
1.62M
    l2 = stride + (stride >> 1);
1852
1853
1.62M
    x = ptr_x;
1854
1.62M
    w = ptr_w + tw_offset;
1855
1.62M
    tw_offset += fft_jmp;
1856
1857
14.5M
    for (i = 0; i < npoints; i += 4) {
1858
12.9M
      co10 = w[j + 1];            si10 = w[j + 0];
1859
12.9M
      co20 = w[j + 3];            si20 = w[j + 2];
1860
12.9M
      co30 = w[j + 5];            si30 = w[j + 4];
1861
1862
12.9M
      x_0 = x[0];             x_1 = x[1];
1863
12.9M
      x_l1_0 = x[l1];         x_l1_1 = x[l1 + 1];
1864
12.9M
      x_l2_0 = x[l2];         x_l2_1 = x[l2 + 1];
1865
12.9M
      x_h2_0 = x[h2];         x_h2_1 = x[h2 + 1];
1866
1867
12.9M
      xh0_0 = ixheaac_add32_sat(x_0, x_l1_0);
1868
12.9M
      xh1_0 = ixheaac_add32_sat(x_1, x_l1_1);
1869
12.9M
      xl0_0 = ixheaac_sub32_sat(x_0, x_l1_0);
1870
12.9M
      xl1_0 = ixheaac_sub32_sat(x_1, x_l1_1);
1871
12.9M
      xh20_0 = ixheaac_add32_sat(x_h2_0, x_l2_0);
1872
12.9M
      xh21_0 = ixheaac_add32_sat(x_h2_1, x_l2_1);
1873
12.9M
      xl20_0 = ixheaac_sub32_sat(x_h2_0, x_l2_0);
1874
12.9M
      xl21_0 = ixheaac_sub32_sat(x_h2_1, x_l2_1);
1875
1876
12.9M
      x0 = x;
1877
12.9M
      x2 = x0;
1878
1879
12.9M
      j += 6;
1880
12.9M
      x += 2;
1881
12.9M
      predj = (j - fft_jmp);
1882
12.9M
      if (!predj) x += fft_jmp;
1883
12.9M
      if (!predj) j = 0;
1884
1885
12.9M
      x0[0] = ixheaac_add32_sat(xh0_0, xh20_0);
1886
12.9M
      x0[1] = ixheaac_add32_sat(xh1_0, xh21_0);
1887
12.9M
      xt0_0 = ixheaac_sub32_sat(xh0_0, xh20_0);
1888
12.9M
      yt0_0 = ixheaac_sub32_sat(xh1_0, xh21_0);
1889
12.9M
      xt1_0 = ixheaac_add32_sat(xl0_0, xl21_0);
1890
12.9M
      yt2_0 = ixheaac_add32_sat(xl1_0, xl20_0);
1891
12.9M
      xt2_0 = ixheaac_sub32_sat(xl0_0, xl21_0);
1892
12.9M
      yt1_0 = ixheaac_sub32_sat(xl1_0, xl20_0);
1893
1894
12.9M
      x2[h2] = ixheaac_add32_sat(MPYLIRC(si10, yt1_0), MPYLIRC(co10, xt1_0));
1895
1896
12.9M
      x2[h2 + 1] = ixheaac_sub32_sat(MPYLIRC(co10, yt1_0), MPYLIRC(si10, xt1_0));
1897
1898
12.9M
      x2[l1] = ixheaac_add32_sat(MPYLIRC(si20, yt0_0), MPYLIRC(co20, xt0_0));
1899
1900
12.9M
      x2[l1 + 1] = ixheaac_sub32_sat(MPYLIRC(co20, yt0_0), MPYLIRC(si20, xt0_0));
1901
12.9M
      yt0_0 = MPYLIRC(si20, yt0_0);
1902
1903
12.9M
      x2[l2] = ixheaac_add32_sat(MPYLIRC(si30, yt2_0), MPYLIRC(co30, xt2_0));
1904
1905
12.9M
      x2[l2 + 1] = ixheaac_sub32_sat(MPYLIRC(co30, yt2_0), MPYLIRC(si30, xt2_0));
1906
12.9M
      yt2_0 = MPYLIRC(si30, yt2_0);
1907
1908
12.9M
    }
1909
1.62M
    stride >>= 2;
1910
1.62M
  }
1911
1912
810k
  y0 = ptr_y;
1913
810k
  y2 = ptr_y + (int)npoints;
1914
810k
  x0 = ptr_x;
1915
810k
  x2 = ptr_x + (int)(npoints >> 1);
1916
1917
810k
  y1 = y0 + (int)(npoints >> 2);
1918
810k
  y3 = y2 + (int)(npoints >> 2);
1919
810k
  l1 = norm + 1;
1920
810k
  j0 = 8;
1921
810k
  n0 = npoints >> 1;
1922
1923
810k
  j = 0;
1924
4.05M
  for (i = 0; i < 4; i++) {
1925
3.24M
    int t1, t2;
1926
3.24M
    h2 = rev_dig[i];
1927
1928
3.24M
    t1 = h2 << 1;
1929
3.24M
    t2 = t1 + 1;
1930
1931
3.24M
    y0[t1] = ixheaac_add32_sat(x0[0], x0[2]);
1932
3.24M
    y2[t1] = ixheaac_sub32_sat(x0[0], x0[2]);
1933
3.24M
    y0[t2] = ixheaac_add32_sat(x0[1], x0[3]);
1934
3.24M
    y2[t2] = ixheaac_sub32_sat(x0[1], x0[3]);
1935
3.24M
    y1[t1] = ixheaac_add32_sat(x0[4], x0[6]);
1936
3.24M
    y3[t1] = ixheaac_sub32_sat(x0[4], x0[6]);
1937
3.24M
    y1[t2] = ixheaac_add32_sat(x0[5], x0[7]);
1938
3.24M
    y3[t2] = ixheaac_sub32_sat(x0[5], x0[7]);
1939
3.24M
    x0 += 8;
1940
1941
3.24M
    t1 += 2;
1942
3.24M
    t2 += 2;
1943
1944
3.24M
    y0[t1] = ixheaac_add32_sat(x2[0], x2[2]);
1945
3.24M
    y2[t1] = ixheaac_sub32_sat(x2[0], x2[2]);
1946
3.24M
    y0[t2] = ixheaac_add32_sat(x2[1], x2[3]);
1947
3.24M
    y2[t2] = ixheaac_sub32_sat(x2[1], x2[3]);
1948
3.24M
    y1[t1] = ixheaac_add32_sat(x2[4], x2[6]);
1949
3.24M
    y3[t1] = ixheaac_sub32_sat(x2[4], x2[6]);
1950
3.24M
    y1[t2] = ixheaac_add32_sat(x2[5], x2[7]);
1951
3.24M
    y3[t2] = ixheaac_sub32_sat(x2[5], x2[7]);
1952
3.24M
    x2 += 8;
1953
1954
3.24M
    j += j0;
1955
1956
3.24M
    if (j == n0)
1957
810k
    {
1958
810k
      j += n0;
1959
810k
      x0 += (int)npoints >> 1;
1960
810k
      x2 += (int)npoints >> 1;
1961
810k
    }
1962
3.24M
  }
1963
810k
}
1964
1965
5.15M
VOID ixheaacd_dec_rearrange_short(WORD32 *ip, WORD32 *op, WORD32 mdct_len_2, WORD16 *re_arr_tab) {
1966
5.15M
  WORD32 n, i = 0;
1967
1968
153M
  for (n = 0; n < mdct_len_2; n++) {
1969
148M
    WORD32 idx = re_arr_tab[n] << 1;
1970
148M
    op[i++] = ip[idx];
1971
148M
    op[i++] = ip[idx + 1];
1972
148M
  }
1973
5.15M
}
1974
1975
VOID ixheaacd_ld_dec_fft_15_opt(WORD32 *inp, WORD32 *op, WORD32 *fft3out,
1976
1.72M
                                WORD16 *ptr_re_arr_tab_sml_240) {
1977
1.72M
  WORD32 i, n, idx;
1978
1.72M
  WORD32 *buf1, *buf2, *buf1a;
1979
1.72M
  WORD32 add_r, sub_r;
1980
1.72M
  WORD32 add_i, sub_i;
1981
1.72M
  WORD32 x_01_r, x_01_i, temp;
1982
1.72M
  WORD32 p1, p2, p3, p4;
1983
1984
1.72M
  WORD32 sinmu = 1859775393;
1985
1.72M
  WORD32 c_51 = 2042378317;
1986
1.72M
  WORD32 c_52 = -1652318768;
1987
1.72M
  WORD32 c_53 = -780119100;
1988
1.72M
  WORD32 c_54 = 1200479854;
1989
1.72M
  WORD32 c_55 = -1342177280;
1990
1991
1.72M
  WORD32 r1, r2, r3, r4;
1992
1.72M
  WORD32 s1, s2, s3, s4, t, temp1, temp2;
1993
1.72M
  WORD32 *fft3outptr = fft3out;
1994
1995
1.72M
  WORD32 xr_0, xr_1, xr_2;
1996
1.72M
  WORD32 xi_0, xi_1, xi_2;
1997
1998
1.72M
  buf2 = fft3out;
1999
1.72M
  buf1 = buf1a = fft3out;
2000
1.72M
  n = 0;
2001
2002
1.72M
  {
2003
1.72M
    *buf1++ = inp[0];
2004
1.72M
    *buf1++ = inp[1];
2005
2006
1.72M
    *buf1++ = inp[192];
2007
1.72M
    *buf1++ = inp[193];
2008
2009
1.72M
    *buf1++ = inp[384];
2010
1.72M
    *buf1++ = inp[385];
2011
2012
1.72M
    *buf1++ = inp[576];
2013
1.72M
    *buf1++ = inp[577];
2014
2015
1.72M
    *buf1++ = inp[768];
2016
1.72M
    *buf1++ = inp[769];
2017
2018
1.72M
    r1 = ixheaac_add32_sat(buf1a[2], buf1a[8]);
2019
1.72M
    r4 = ixheaac_sub32_sat(buf1a[2], buf1a[8]);
2020
1.72M
    r3 = ixheaac_add32_sat(buf1a[4], buf1a[6]);
2021
1.72M
    r2 = ixheaac_sub32_sat(buf1a[4], buf1a[6]);
2022
2023
1.72M
    t = ixheaac_mult32_shl(ixheaac_sub32_sat(r1, r3), c_54);
2024
2025
1.72M
    r1 = ixheaac_add32_sat(r1, r3);
2026
2027
1.72M
    temp1 = ixheaac_add32_sat(buf1a[0], r1);
2028
2029
1.72M
    r1 = ixheaac_add32_sat(temp1, (ixheaac_mult32_shl(r1, c_55) << 1));
2030
2031
1.72M
    r3 = ixheaac_sub32_sat(r1, t);
2032
1.72M
    r1 = ixheaac_add32_sat(r1, t);
2033
2034
1.72M
    t = ixheaac_mult32_shl(ixheaac_add32_sat(r4, r2), c_51);
2035
1.72M
    r4 = ixheaac_add32_sat(t, (ixheaac_mult32_shl(r4, c_52) << 1));
2036
1.72M
    r2 = ixheaac_add32_sat(t, ixheaac_mult32_shl(r2, c_53));
2037
2038
1.72M
    s1 = ixheaac_add32_sat(buf1a[3], buf1a[9]);
2039
1.72M
    s4 = ixheaac_sub32_sat(buf1a[3], buf1a[9]);
2040
1.72M
    s3 = ixheaac_add32_sat(buf1a[5], buf1a[7]);
2041
1.72M
    s2 = ixheaac_sub32_sat(buf1a[5], buf1a[7]);
2042
2043
1.72M
    t = ixheaac_mult32_shl(ixheaac_sub32_sat(s1, s3), c_54);
2044
2045
1.72M
    s1 = ixheaac_add32_sat(s1, s3);
2046
2047
1.72M
    temp2 = ixheaac_add32_sat(buf1a[1], s1);
2048
2049
2050
1.72M
    s1 = ixheaac_add32_sat(temp2, (ixheaac_mult32_shl(s1, c_55) << 1));
2051
2052
1.72M
    s3 = ixheaac_sub32_sat(s1, t);
2053
1.72M
    s1 = ixheaac_add32_sat(s1, t);
2054
2055
1.72M
    t = ixheaac_mult32_shl(ixheaac_add32_sat(s4, s2), c_51);
2056
1.72M
    s4 = ixheaac_add32_sat(t, (ixheaac_mult32_shl(s4, c_52) << 1));
2057
1.72M
    s2 = ixheaac_add32_sat(t, (ixheaac_mult32_shl(s2, c_53)));
2058
2059
1.72M
    *buf2++ = temp1;
2060
1.72M
    *buf2++ = temp2;
2061
1.72M
    *buf2++ = ixheaac_add32_sat(r1, s2);
2062
1.72M
    *buf2++ = ixheaac_sub32_sat(s1, r2);
2063
1.72M
    *buf2++ = ixheaac_sub32_sat(r3, s4);
2064
1.72M
    *buf2++ = ixheaac_add32_sat(s3, r4);
2065
1.72M
    *buf2++ = ixheaac_add32_sat(r3, s4);
2066
1.72M
    *buf2++ = ixheaac_sub32_sat(s3, r4);
2067
1.72M
    *buf2++ = ixheaac_sub32_sat(r1, s2);
2068
1.72M
    *buf2++ = ixheaac_add32_sat(s1, r2);
2069
1.72M
    buf1a = buf1;
2070
2071
1.72M
    *buf1++ = inp[320];
2072
1.72M
    *buf1++ = inp[321];
2073
2074
1.72M
    *buf1++ = inp[512];
2075
1.72M
    *buf1++ = inp[513];
2076
2077
1.72M
    *buf1++ = inp[704];
2078
1.72M
    *buf1++ = inp[705];
2079
2080
1.72M
    *buf1++ = inp[896];
2081
1.72M
    *buf1++ = inp[897];
2082
2083
1.72M
    *buf1++ = inp[128];
2084
1.72M
    *buf1++ = inp[129];
2085
2086
1.72M
    r1 = ixheaac_add32_sat(buf1a[2], buf1a[8]);
2087
1.72M
    r4 = ixheaac_sub32_sat(buf1a[2], buf1a[8]);
2088
1.72M
    r3 = ixheaac_add32_sat(buf1a[4], buf1a[6]);
2089
1.72M
    r2 = ixheaac_sub32_sat(buf1a[4], buf1a[6]);
2090
2091
1.72M
    t = ixheaac_mult32_shl(ixheaac_sub32_sat(r1, r3), c_54);
2092
2093
1.72M
    r1 = ixheaac_add32_sat(r1, r3);
2094
2095
1.72M
    temp1 = ixheaac_add32_sat(buf1a[0], r1);
2096
2097
1.72M
    r1 = ixheaac_add32_sat(temp1, (ixheaac_mult32_shl(r1, c_55) << 1));
2098
2099
1.72M
    r3 = ixheaac_sub32_sat(r1, t);
2100
1.72M
    r1 = ixheaac_add32_sat(r1, t);
2101
2102
1.72M
    t = ixheaac_mult32_shl(ixheaac_add32_sat(r4, r2), c_51);
2103
1.72M
    r4 = ixheaac_add32_sat(t, (ixheaac_mult32_shl(r4, c_52) << 1));
2104
1.72M
    r2 = ixheaac_add32_sat(t, ixheaac_mult32_shl(r2, c_53));
2105
2106
1.72M
    s1 = ixheaac_add32_sat(buf1a[3], buf1a[9]);
2107
1.72M
    s4 = ixheaac_sub32_sat(buf1a[3], buf1a[9]);
2108
1.72M
    s3 = ixheaac_add32_sat(buf1a[5], buf1a[7]);
2109
1.72M
    s2 = ixheaac_sub32_sat(buf1a[5], buf1a[7]);
2110
2111
1.72M
    t = ixheaac_mult32_shl(ixheaac_sub32_sat(s1, s3), c_54);
2112
2113
1.72M
    s1 = ixheaac_add32_sat(s1, s3);
2114
2115
1.72M
    temp2 = ixheaac_add32_sat(buf1a[1], s1);
2116
2117
1.72M
    s1 = ixheaac_add32_sat(temp2, (ixheaac_mult32_shl(s1, c_55) << 1));
2118
2119
1.72M
    s3 = ixheaac_sub32_sat(s1, t);
2120
1.72M
    s1 = ixheaac_add32_sat(s1, t);
2121
2122
1.72M
    t = ixheaac_mult32_shl(ixheaac_add32_sat(s4, s2), c_51);
2123
1.72M
    s4 = ixheaac_add32_sat(t, (ixheaac_mult32_shl(s4, c_52) << 1));
2124
1.72M
    s2 = ixheaac_add32_sat(t, ixheaac_mult32_shl(s2, c_53));
2125
2126
1.72M
    *buf2++ = temp1;
2127
1.72M
    *buf2++ = temp2;
2128
1.72M
    *buf2++ = ixheaac_add32_sat(r1, s2);
2129
1.72M
    *buf2++ = ixheaac_sub32_sat(s1, r2);
2130
1.72M
    *buf2++ = ixheaac_sub32_sat(r3, s4);
2131
1.72M
    *buf2++ = ixheaac_add32_sat(s3, r4);
2132
1.72M
    *buf2++ = ixheaac_add32_sat(r3, s4);
2133
1.72M
    *buf2++ = ixheaac_sub32_sat(s3, r4);
2134
1.72M
    *buf2++ = ixheaac_sub32_sat(r1, s2);
2135
1.72M
    *buf2++ = ixheaac_add32_sat(s1, r2);
2136
1.72M
    buf1a = buf1;
2137
2138
1.72M
    *buf1++ = inp[640];
2139
1.72M
    *buf1++ = inp[641];
2140
2141
1.72M
    *buf1++ = inp[832];
2142
1.72M
    *buf1++ = inp[833];
2143
2144
1.72M
    *buf1++ = inp[64];
2145
1.72M
    *buf1++ = inp[65];
2146
2147
1.72M
    *buf1++ = inp[256];
2148
1.72M
    *buf1++ = inp[257];
2149
2150
1.72M
    *buf1++ = inp[448];
2151
1.72M
    *buf1++ = inp[449];
2152
2153
1.72M
    r1 = ixheaac_add32_sat(buf1a[2], buf1a[8]);
2154
1.72M
    r4 = ixheaac_sub32_sat(buf1a[2], buf1a[8]);
2155
1.72M
    r3 = ixheaac_add32_sat(buf1a[4], buf1a[6]);
2156
1.72M
    r2 = ixheaac_sub32_sat(buf1a[4], buf1a[6]);
2157
2158
1.72M
    t = ixheaac_mult32_shl(ixheaac_sub32_sat(r1, r3), c_54);
2159
2160
1.72M
    r1 = ixheaac_add32_sat(r1, r3);
2161
2162
1.72M
    temp1 = ixheaac_add32_sat(buf1a[0], r1);
2163
2164
1.72M
    r1 = ixheaac_add32_sat(temp1, (ixheaac_mult32_shl(r1, c_55) << 1));
2165
2166
1.72M
    r3 = ixheaac_sub32_sat(r1, t);
2167
1.72M
    r1 = ixheaac_add32_sat(r1, t);
2168
2169
1.72M
    t = ixheaac_mult32_shl(ixheaac_add32_sat(r4, r2), c_51);
2170
1.72M
    r4 = ixheaac_add32_sat(t, ixheaac_mult32_shl(r4, c_52) << 1);
2171
1.72M
    r2 = ixheaac_add32_sat(t, ixheaac_mult32_shl(r2, c_53));
2172
2173
1.72M
    s1 = ixheaac_add32_sat(buf1a[3], buf1a[9]);
2174
1.72M
    s4 = ixheaac_sub32_sat(buf1a[3], buf1a[9]);
2175
1.72M
    s3 = ixheaac_add32_sat(buf1a[5], buf1a[7]);
2176
1.72M
    s2 = ixheaac_sub32_sat(buf1a[5], buf1a[7]);
2177
2178
1.72M
    t = ixheaac_mult32_shl(ixheaac_sub32_sat(s1, s3), c_54);
2179
2180
1.72M
    s1 = ixheaac_add32_sat(s1, s3);
2181
2182
1.72M
    temp2 = ixheaac_add32_sat(buf1a[1], s1);
2183
2184
1.72M
    s1 = ixheaac_add32_sat(temp2, (ixheaac_mult32_shl(s1, c_55) << 1));
2185
2186
1.72M
    s3 = ixheaac_sub32_sat(s1, t);
2187
1.72M
    s1 = ixheaac_add32_sat(s1, t);
2188
2189
1.72M
    t = ixheaac_mult32_shl(ixheaac_add32_sat(s4, s2), c_51);
2190
1.72M
    s4 = ixheaac_add32_sat(t, (ixheaac_mult32_shl(s4, c_52) << 1));
2191
1.72M
    s2 = ixheaac_add32_sat(t, ixheaac_mult32_shl(s2, c_53));
2192
2193
1.72M
    *buf2++ = temp1;
2194
1.72M
    *buf2++ = temp2;
2195
1.72M
    *buf2++ = ixheaac_add32_sat(r1, s2);
2196
1.72M
    *buf2++ = ixheaac_sub32_sat(s1, r2);
2197
1.72M
    *buf2++ = ixheaac_sub32_sat(r3, s4);
2198
1.72M
    *buf2++ = ixheaac_add32_sat(s3, r4);
2199
1.72M
    *buf2++ = ixheaac_add32_sat(r3, s4);
2200
1.72M
    *buf2++ = ixheaac_sub32_sat(s3, r4);
2201
1.72M
    *buf2++ = ixheaac_sub32_sat(r1, s2);
2202
1.72M
    *buf2++ = ixheaac_add32_sat(s1, r2);
2203
1.72M
    buf1a = buf1;
2204
1.72M
  }
2205
2206
1.72M
  n = 0;
2207
10.3M
  for (i = 0; i < FFT5; i++) {
2208
8.64M
    xr_0 = fft3outptr[0];
2209
8.64M
    xi_0 = fft3outptr[1];
2210
2211
8.64M
    xr_1 = fft3outptr[10];
2212
8.64M
    xi_1 = fft3outptr[11];
2213
2214
8.64M
    xr_2 = fft3outptr[20];
2215
8.64M
    xi_2 = fft3outptr[21];
2216
2217
8.64M
    x_01_r = ixheaac_add32_sat(xr_0, xr_1);
2218
8.64M
    x_01_i = ixheaac_add32_sat(xi_0, xi_1);
2219
2220
8.64M
    add_r = ixheaac_add32_sat(xr_1, xr_2);
2221
8.64M
    add_i = ixheaac_add32_sat(xi_1, xi_2);
2222
2223
8.64M
    sub_r = ixheaac_sub32_sat(xr_1, xr_2);
2224
8.64M
    sub_i = ixheaac_sub32_sat(xi_1, xi_2);
2225
2226
8.64M
    p1 = add_r >> 1;
2227
2228
8.64M
    p2 = ixheaac_mult32_shl(sub_i, sinmu);
2229
8.64M
    p3 = ixheaac_mult32_shl(sub_r, sinmu);
2230
2231
8.64M
    p4 = add_i >> 1;
2232
2233
8.64M
    temp = ixheaac_sub32_sat(xr_0, p1);
2234
8.64M
    temp1 = ixheaac_add32_sat(xi_0, p3);
2235
8.64M
    temp2 = ixheaac_sub32_sat(xi_0, p3);
2236
2237
8.64M
    idx = ptr_re_arr_tab_sml_240[n++] << 1;
2238
8.64M
    op[idx] = ixheaac_add32_sat(x_01_r, xr_2);
2239
8.64M
    op[idx + 1] = ixheaac_add32_sat(x_01_i, xi_2);
2240
2241
8.64M
    idx = ptr_re_arr_tab_sml_240[n++] << 1;
2242
8.64M
    op[idx] = ixheaac_add32_sat(temp, p2);
2243
8.64M
    op[idx + 1] = ixheaac_sub32_sat(temp2, p4);
2244
2245
8.64M
    idx = ptr_re_arr_tab_sml_240[n++] << 1;
2246
8.64M
    op[idx] = ixheaac_sub32_sat(temp, p2);
2247
8.64M
    op[idx + 1] = ixheaac_sub32_sat(temp1, p4);
2248
8.64M
    fft3outptr += 2;
2249
8.64M
  }
2250
1.72M
  return;
2251
1.72M
}
2252
2253
VOID ixheaacd_fft_120(ia_aac_dec_imdct_tables_struct *imdct_tables_ptr,
2254
339k
                      WORD32 npoints, WORD32* ptr_x, WORD32* ptr_y) {
2255
339k
  WORD32 i;
2256
339k
  WORD32 *buf1, *buf2;
2257
339k
  WORD32 *inp, *op;
2258
2259
339k
  inp = ptr_x;
2260
339k
  op = ptr_y;
2261
2262
339k
  ixheaacd_dec_rearrange_short(inp, op, 60, imdct_tables_ptr->re_arr_tab_4);
2263
339k
  buf1 = op;
2264
339k
  buf2 = inp;
2265
2266
5.43M
  for (i = 0; i < FFT15; i++) {
2267
5.09M
    {
2268
5.09M
      WORD32   x_0, x_1, x_2, x_3, x_4, x_5, x_6, x_7;
2269
5.09M
      WORD32   *y0, *y1, *y2, *y3;
2270
5.09M
      WORD32   *x0;
2271
5.09M
      WORD32   xh0_0, xh1_0, xh0_1, xh1_1, xl0_0, xl1_0, xl0_1, xl1_1;
2272
5.09M
      WORD32   h2;
2273
5.09M
      WORD32   n00, n01, n10, n11, n20, n21, n30, n31;
2274
2275
5.09M
      ptr_x = buf1;
2276
5.09M
      ptr_y = buf2;
2277
5.09M
      npoints = 4;
2278
5.09M
      h2 = 0;
2279
2280
5.09M
      y0 = ptr_y;
2281
5.09M
      y2 = ptr_y + (WORD32)npoints;
2282
5.09M
      x0 = ptr_x;
2283
2284
5.09M
      y1 = y0 + (WORD32)(npoints >> 1);
2285
5.09M
      y3 = y2 + (WORD32)(npoints >> 1);
2286
2287
5.09M
      x_0 = x0[0];         x_1 = x0[1];
2288
5.09M
      x_2 = x0[2];         x_3 = x0[3];
2289
5.09M
      x_4 = x0[4];         x_5 = x0[5];
2290
5.09M
      x_6 = x0[6];         x_7 = x0[7];
2291
5.09M
      x0 += 8;
2292
2293
5.09M
      xh0_0 = ixheaac_add32_sat(x_0, x_4);
2294
5.09M
      xh1_0 = ixheaac_add32_sat(x_1, x_5);
2295
5.09M
      xl0_0 = ixheaac_sub32_sat(x_0, x_4);
2296
5.09M
      xl1_0 = ixheaac_sub32_sat(x_1, x_5);
2297
5.09M
      xh0_1 = ixheaac_add32_sat(x_2, x_6);
2298
5.09M
      xh1_1 = ixheaac_add32_sat(x_3, x_7);
2299
5.09M
      xl0_1 = ixheaac_sub32_sat(x_2, x_6);
2300
5.09M
      xl1_1 = ixheaac_sub32_sat(x_3, x_7);
2301
2302
5.09M
      n00 = ixheaac_add32_sat(xh0_0, xh0_1);
2303
5.09M
      n01 = ixheaac_add32_sat(xh1_0, xh1_1);
2304
5.09M
      n10 = ixheaac_add32_sat(xl0_0, xl1_1);
2305
5.09M
      n11 = ixheaac_sub32_sat(xl1_0, xl0_1);
2306
5.09M
      n20 = ixheaac_sub32_sat(xh0_0, xh0_1);
2307
5.09M
      n21 = ixheaac_sub32_sat(xh1_0, xh1_1);
2308
5.09M
      n30 = ixheaac_sub32_sat(xl0_0, xl1_1);
2309
5.09M
      n31 = ixheaac_add32_sat(xl1_0, xl0_1);
2310
2311
5.09M
      y0[2 * h2] = n00;            y0[2 * h2 + 1] = n01;
2312
5.09M
      y1[2 * h2] = n10;            y1[2 * h2 + 1] = n11;
2313
5.09M
      y2[2 * h2] = n20;            y2[2 * h2 + 1] = n21;
2314
5.09M
      y3[2 * h2] = n30;            y3[2 * h2 + 1] = n31;
2315
5.09M
    }
2316
5.09M
    buf1 += (FFT4 * 2);
2317
5.09M
    buf2 += (FFT4 * 2);
2318
5.09M
  }
2319
2320
339k
  ixheaacd_dec_rearrange_short(inp, op, 60, imdct_tables_ptr->re_arr_tab_15_4);
2321
2322
339k
  buf1 = op;
2323
339k
  buf2 = inp;
2324
2325
1.69M
  for (i = 0; i < FFT4; i++) {
2326
1.35M
    ixheaacd_fft_960_15(buf1, buf2, imdct_tables_ptr);
2327
1.35M
    buf1 += (FFT15 * 2);
2328
1.35M
    buf2 += (FFT15 * 2);
2329
1.35M
  }
2330
2331
339k
  ixheaacd_dec_rearrange_short(inp, op, 60, imdct_tables_ptr->re_arr_tab_120);
2332
339k
}
2333
2334
VOID ixheaacd_fft_960_15(WORD32 *inp, WORD32 *op,
2335
1.35M
                         ia_aac_dec_imdct_tables_struct *imdct_tables_ptr) {
2336
1.35M
  WORD32 i;
2337
1.35M
  WORD32 *buf1, *buf2;
2338
2339
1.35M
  ixheaacd_dec_rearrange_short(inp, op, FFT15, imdct_tables_ptr->re_arr_tab_5);
2340
2341
1.35M
  buf1 = op;
2342
1.35M
  buf2 = inp;
2343
2344
5.43M
  for (i = 0; i < FFT3; i++) {
2345
4.07M
    ixheaacd_fft_5(buf1, buf2);
2346
2347
4.07M
    buf1 += (FFT5 * 2);
2348
4.07M
    buf2 += (FFT5 * 2);
2349
4.07M
  }
2350
2351
1.35M
  ixheaacd_dec_rearrange_short(inp, op, FFT15, imdct_tables_ptr->re_arr_tab_3);
2352
2353
1.35M
  buf1 = op;
2354
1.35M
  buf2 = inp;
2355
2356
8.15M
  for (i = 0; i < FFT5; i++) {
2357
6.79M
    ixheaacd_fft_3(buf1, buf2);
2358
2359
6.79M
    buf1 += (FFT3 * 2);
2360
6.79M
    buf2 += (FFT3 * 2);
2361
6.79M
  }
2362
2363
1.35M
  ixheaacd_dec_rearrange_short(inp, op, FFT15, imdct_tables_ptr->re_arr_tab_sml);
2364
1.35M
}
2365
2366
6.79M
VOID ixheaacd_fft_3(WORD32 *inp, WORD32 *op) {
2367
6.79M
  WORD32 add_r, sub_r;
2368
6.79M
  WORD32 add_i, sub_i;
2369
6.79M
  WORD32 x_01_r, x_01_i, temp;
2370
2371
6.79M
  WORD32 p1, p2, p3, p4;
2372
6.79M
  WORD32 sinmu = 1859775393;
2373
2374
6.79M
  x_01_r = ixheaac_add32_sat(inp[0], inp[2]);
2375
6.79M
  x_01_i = ixheaac_add32_sat(inp[1], inp[3]);
2376
2377
6.79M
  add_r = ixheaac_add32_sat(inp[2], inp[4]);
2378
6.79M
  add_i = ixheaac_add32_sat(inp[3], inp[5]);
2379
2380
6.79M
  sub_r = ixheaac_sub32_sat(inp[2], inp[4]);
2381
6.79M
  sub_i = ixheaac_sub32_sat(inp[3], inp[5]);
2382
2383
6.79M
  p1 = add_r >> 1;
2384
6.79M
  p2 = ixheaac_mult32_shl(sub_i, sinmu);
2385
6.79M
  p3 = ixheaac_mult32_shl(sub_r, sinmu);
2386
6.79M
  p4 = add_i >> 1;
2387
2388
6.79M
  temp = ixheaac_sub32_sat(inp[0], p1);
2389
2390
6.79M
  op[0] = ixheaac_add32_sat(x_01_r, inp[4]);
2391
6.79M
  op[1] = ixheaac_add32_sat(x_01_i, inp[5]);
2392
6.79M
  op[2] = ixheaac_add32_sat(temp, p2);
2393
6.79M
  op[3] = ixheaac_sub32_sat(ixheaac_sub32_sat(inp[1], p3), p4);
2394
6.79M
  op[4] = ixheaac_sub32_sat(temp, p2);
2395
6.79M
  op[5] = ixheaac_sub32_sat(ixheaac_add32_sat(inp[1], p3), p4);
2396
6.79M
}
2397
2398
4.07M
VOID ixheaacd_fft_5(WORD32 *inp, WORD32 *op) {
2399
4.07M
  WORD32 c_51 = 2042378317;
2400
4.07M
  WORD32 c_52 = -1652318768;
2401
4.07M
  WORD32 c_53 = -780119100;
2402
4.07M
  WORD32 c_54 = 1200479854;
2403
4.07M
  WORD32 c_55 = -1342177280;
2404
2405
4.07M
  WORD32 r1, r2, r3, r4;
2406
4.07M
  WORD32 s1, s2, s3, s4, t, temp1, temp2;
2407
2408
4.07M
  r1 = ixheaac_add32_sat(inp[2], inp[8]);
2409
4.07M
  r4 = ixheaac_sub32_sat(inp[2], inp[8]);
2410
4.07M
  r3 = ixheaac_add32_sat(inp[4], inp[6]);
2411
4.07M
  r2 = ixheaac_sub32_sat(inp[4], inp[6]);
2412
2413
4.07M
  t = ixheaac_mult32_shl(ixheaac_sub32_sat(r1, r3), c_54);
2414
4.07M
  r1 = ixheaac_add32_sat(r1, r3);
2415
2416
4.07M
  temp1 = ixheaac_add32_sat(inp[0], r1);
2417
4.07M
  r1 = ixheaac_add32_sat(
2418
4.07M
      temp1, ixheaac_shl32_sat((ixheaac_mult32_shl(r1, c_55)), 1));
2419
2420
4.07M
  r3 = ixheaac_sub32_sat(r1, t);
2421
4.07M
  r1 = ixheaac_add32_sat(r1, t);
2422
2423
4.07M
  t = ixheaac_mult32_shl(ixheaac_add32_sat(r4, r2), c_51);
2424
4.07M
  r4 = ixheaac_add32_sat(
2425
4.07M
      t, ixheaac_shl32_sat(ixheaac_mult32_shl(r4, c_52), 1));
2426
4.07M
  r2 = ixheaac_add32_sat(t, ixheaac_mult32_shl(r2, c_53));
2427
2428
4.07M
  s1 = ixheaac_add32_sat(inp[3], inp[9]);
2429
4.07M
  s4 = ixheaac_sub32_sat(inp[3], inp[9]);
2430
4.07M
  s3 = ixheaac_add32_sat(inp[5], inp[7]);
2431
4.07M
  s2 = ixheaac_sub32_sat(inp[5], inp[7]);
2432
2433
4.07M
  t = ixheaac_mult32_shl(ixheaac_sub32_sat(s1, s3), c_54);
2434
4.07M
  s1 = ixheaac_add32_sat(s1, s3);
2435
2436
4.07M
  temp2 = ixheaac_add32_sat(inp[1], s1);
2437
2438
4.07M
  s1 = ixheaac_add32_sat(
2439
4.07M
      temp2, ixheaac_shl32_sat((ixheaac_mult32_shl(s1, c_55)), 1));
2440
2441
4.07M
  s3 = ixheaac_sub32_sat(s1, t);
2442
4.07M
  s1 = ixheaac_add32_sat(s1, t);
2443
2444
4.07M
  t = ixheaac_mult32_shl(ixheaac_add32_sat(s4, s2), c_51);
2445
4.07M
  s4 = ixheaac_add32_sat(
2446
4.07M
      t, ixheaac_shl32_sat((ixheaac_mult32_shl(s4, c_52)), 1));
2447
4.07M
  s2 = ixheaac_add32_sat(t, (ixheaac_mult32_shl(s2, c_53)));
2448
2449
4.07M
  op[0] = temp1;
2450
4.07M
  op[1] = temp2;
2451
4.07M
  op[2] = ixheaac_add32_sat(r1, s2);
2452
4.07M
  op[3] = ixheaac_sub32_sat(s1, r2);
2453
4.07M
  op[4] = ixheaac_sub32_sat(r3, s4);
2454
4.07M
  op[5] = ixheaac_add32_sat(s3, r4);
2455
4.07M
  op[6] = ixheaac_add32_sat(r3, s4);
2456
4.07M
  op[7] = ixheaac_sub32_sat(s3, r4);
2457
4.07M
  op[8] = ixheaac_sub32_sat(r1, s2);
2458
4.07M
  op[9] = ixheaac_add32_sat(s1, r2);
2459
4.07M
}
2460
2461
VOID ixheaacd_fft_480_ld(WORD32 *inp, WORD32 *op,
2462
56.4k
                         ia_aac_dec_imdct_tables_struct *imdct_tables_ptr) {
2463
56.4k
  WORD32 i;
2464
56.4k
  WORD32 *buf1, *buf2;
2465
56.4k
  UWORD8 *re_arr_tab_sml_240_ptr;
2466
2467
56.4k
  (*ixheaacd_aac_ld_dec_rearrange)(inp, op, MDCT_LEN_BY2,
2468
56.4k
                                   imdct_tables_ptr->re_arr_tab_16);
2469
2470
56.4k
  buf1 = op;
2471
56.4k
  buf2 = inp;
2472
2473
902k
  for (i = 0; i < FFT15; i++) {
2474
846k
    (*ixheaacd_fft32x32_ld2)(imdct_tables_ptr, 16, buf1, buf2);
2475
2476
846k
    buf1 += (FFT16X2);
2477
846k
    buf2 += (FFT16X2);
2478
846k
  }
2479
56.4k
  re_arr_tab_sml_240_ptr = imdct_tables_ptr->re_arr_tab_sml_240;
2480
56.4k
  buf1 = inp;
2481
2482
958k
  for (i = 0; i < FFT16; i++) {
2483
902k
    (*ixheaacd_fft_15_ld)(buf1, op, ixheaacd_fft5out, re_arr_tab_sml_240_ptr);
2484
902k
    re_arr_tab_sml_240_ptr += FFT15;
2485
902k
    buf1 += 2;
2486
902k
  }
2487
56.4k
}
2488
2489
VOID ixheaacd_pre_twiddle_960(WORD32 *xptr, WORD32 *data, WORD32 n,
2490
54.0k
                              WORD32 *cos_sin_ptr, WORD32 neg_expo) {
2491
54.0k
  WORD npoints_4, i;
2492
54.0k
  WORD32 tempr, tempi, temp;
2493
54.0k
  WORD32 c, c1, s, s1;
2494
54.0k
  WORD32 *in_ptr1, *in_ptr2;
2495
54.0k
  WORD32 *xprt1 = xptr + (n - 1);
2496
2497
54.0k
  npoints_4 = n >> 2;
2498
2499
54.0k
  in_ptr1 = data;
2500
54.0k
  in_ptr2 = data + n - 1;
2501
2502
13.0M
  for (i = 0; i < npoints_4; i++) {
2503
12.9M
    c = *cos_sin_ptr++;
2504
12.9M
    s = *cos_sin_ptr++;
2505
2506
12.9M
    tempr = *in_ptr1++;
2507
12.9M
    tempi = *in_ptr2--;
2508
2509
12.9M
    temp = -ixheaac_add32(ixheaac_mult32x32in32(tempr, c),
2510
12.9M
                           ixheaac_mult32x32in32(tempi, s));
2511
12.9M
    *xptr++ = ixheaac_shr32_dir_sat(temp, neg_expo);
2512
2513
12.9M
    temp = -ixheaac_sub32(ixheaac_mult32x32in32(tempi, c),
2514
12.9M
                           ixheaac_mult32x32in32(tempr, s));
2515
12.9M
    *xptr++ = ixheaac_shr32_dir_sat(temp, neg_expo);
2516
2517
12.9M
    c1 = *cos_sin_ptr++;
2518
12.9M
    s1 = *cos_sin_ptr++;
2519
2520
12.9M
    tempi = *in_ptr1++;
2521
12.9M
    tempr = *in_ptr2--;
2522
2523
12.9M
    temp = -ixheaac_sub32(ixheaac_mult32x32in32(tempi, c1),
2524
12.9M
                           ixheaac_mult32x32in32(tempr, s1));
2525
12.9M
    *xprt1-- = ixheaac_shr32_dir_sat(temp, neg_expo);
2526
2527
12.9M
    temp = -ixheaac_add32(ixheaac_mult32x32in32(tempr, c1),
2528
12.9M
                           ixheaac_mult32x32in32(tempi, s1));
2529
12.9M
    *xprt1-- = ixheaac_shr32_dir_sat(temp, neg_expo);
2530
12.9M
  }
2531
54.0k
}
2532
2533
VOID ixheaacd_pre_twiddle_120(WORD32 *xptr, WORD32 *data, WORD32 n,
2534
339k
                              WORD16 *cos_sin_ptr, WORD32 neg_expo) {
2535
339k
  WORD npoints_4, i;
2536
339k
  WORD32 tempr, tempi, temp;
2537
339k
  WORD16 c, c1, s, s1;
2538
339k
  WORD32 *in_ptr1, *in_ptr2;
2539
339k
  WORD32 *xprt1 = xptr + (n - 1);
2540
2541
339k
  npoints_4 = n >> 2;
2542
2543
339k
  in_ptr1 = data;
2544
339k
  in_ptr2 = data + n - 1;
2545
2546
10.5M
  for (i = 0; i < npoints_4; i++) {
2547
10.1M
    c = *cos_sin_ptr++;
2548
10.1M
    s = *cos_sin_ptr++;
2549
2550
10.1M
    tempr = *in_ptr1++;
2551
10.1M
    tempi = *in_ptr2--;
2552
2553
10.1M
    temp = -ixheaac_add32(ixheaac_mult32x16in32(tempr, c),
2554
10.1M
                           ixheaac_mult32x16in32(tempi, s));
2555
10.1M
    *xptr++ = ixheaac_shr32_dir_sat(temp, neg_expo);
2556
2557
10.1M
    temp = -ixheaac_sub32(ixheaac_mult32x16in32(tempi, c),
2558
10.1M
                           ixheaac_mult32x16in32(tempr, s));
2559
10.1M
    *xptr++ = ixheaac_shr32_dir_sat(temp, neg_expo);
2560
2561
10.1M
    c1 = *cos_sin_ptr++;
2562
10.1M
    s1 = *cos_sin_ptr++;
2563
2564
10.1M
    tempi = *in_ptr1++;
2565
10.1M
    tempr = *in_ptr2--;
2566
2567
10.1M
    temp = -ixheaac_sub32(ixheaac_mult32x16in32(tempi, c1),
2568
10.1M
                           ixheaac_mult32x16in32(tempr, s1));
2569
10.1M
    *xprt1-- = ixheaac_shr32_dir_sat(temp, neg_expo);
2570
2571
10.1M
    temp = -ixheaac_add32(ixheaac_mult32x16in32(tempr, c1),
2572
10.1M
                           ixheaac_mult32x16in32(tempi, s1));
2573
10.1M
    *xprt1-- = ixheaac_shr32_dir_sat(temp, neg_expo);
2574
10.1M
  }
2575
339k
}
2576
2577
VOID ixheaacd_pre_twiddle(WORD32 *xptr, WORD32 *data, WORD32 n,
2578
143k
                          WORD32 *cos_sin_ptr, WORD32 neg_expo) {
2579
143k
  WORD npoints_4, i;
2580
143k
  WORD32 tempr, tempi, temp;
2581
143k
  WORD32 c, c1, s, s1;
2582
143k
  WORD32 *in_ptr1, *in_ptr2;
2583
2584
143k
  npoints_4 = n >> 2;
2585
2586
143k
  in_ptr1 = data;
2587
143k
  in_ptr2 = data + n - 1;
2588
2589
143k
  if (neg_expo >= 0) {
2590
4.55M
    for (i = npoints_4 - 1; i >= 0; i--) {
2591
4.52M
      c = *cos_sin_ptr++;
2592
4.52M
      c1 = *cos_sin_ptr++;
2593
4.52M
      s = *cos_sin_ptr++;
2594
4.52M
      s1 = *cos_sin_ptr++;
2595
2596
4.52M
      tempr = *in_ptr1;
2597
4.52M
      tempi = *in_ptr2;
2598
2599
4.52M
      in_ptr1 += 2;
2600
4.52M
      in_ptr2 -= 2;
2601
2602
4.52M
      temp =
2603
4.52M
          -ixheaac_add32(ixheaac_mult32(tempr, c), ixheaac_mult32(tempi, s));
2604
4.52M
      *xptr++ = ixheaac_shr32(temp, neg_expo);
2605
2606
4.52M
      temp =
2607
4.52M
          ixheaac_sub32(ixheaac_mult32(tempr, s), ixheaac_mult32(tempi, c));
2608
4.52M
      *xptr++ = ixheaac_shr32(temp, neg_expo);
2609
2610
4.52M
      tempr = *in_ptr1;
2611
4.52M
      tempi = *in_ptr2;
2612
2613
4.52M
      in_ptr1 += 2;
2614
4.52M
      in_ptr2 -= 2;
2615
2616
4.52M
      temp = -ixheaac_add32(ixheaac_mult32(tempr, c1),
2617
4.52M
                             ixheaac_mult32(tempi, s1));
2618
4.52M
      *xptr++ = ixheaac_shr32(temp, neg_expo);
2619
2620
4.52M
      temp = ixheaac_sub32(ixheaac_mult32(tempr, s1),
2621
4.52M
                            ixheaac_mult32(tempi, c1));
2622
4.52M
      *xptr++ = ixheaac_shr32(temp, neg_expo);
2623
4.52M
    }
2624
107k
  } else {
2625
107k
    neg_expo = -neg_expo;
2626
2627
13.5M
    for (i = npoints_4 - 1; i >= 0; i--) {
2628
13.4M
      c = *cos_sin_ptr++;
2629
13.4M
      c1 = *cos_sin_ptr++;
2630
13.4M
      s = *cos_sin_ptr++;
2631
13.4M
      s1 = *cos_sin_ptr++;
2632
2633
13.4M
      tempr = *in_ptr1;
2634
13.4M
      tempi = *in_ptr2;
2635
2636
13.4M
      in_ptr1 += 2;
2637
13.4M
      in_ptr2 -= 2;
2638
2639
13.4M
      temp =
2640
13.4M
          -ixheaac_add32(ixheaac_mult32(tempr, c), ixheaac_mult32(tempi, s));
2641
13.4M
      *xptr++ = ixheaac_shl32(temp, neg_expo);
2642
2643
13.4M
      temp =
2644
13.4M
          ixheaac_sub32(ixheaac_mult32(tempr, s), ixheaac_mult32(tempi, c));
2645
13.4M
      *xptr++ = ixheaac_shl32(temp, neg_expo);
2646
2647
13.4M
      tempr = *in_ptr1;
2648
13.4M
      tempi = *in_ptr2;
2649
2650
13.4M
      in_ptr1 += 2;
2651
13.4M
      in_ptr2 -= 2;
2652
2653
13.4M
      temp = -ixheaac_add32(ixheaac_mult32(tempr, c1),
2654
13.4M
                             ixheaac_mult32(tempi, s1));
2655
13.4M
      *xptr++ = ixheaac_shl32(temp, neg_expo);
2656
2657
13.4M
      temp = ixheaac_sub32(ixheaac_mult32(tempr, s1),
2658
13.4M
                            ixheaac_mult32(tempi, c1));
2659
13.4M
      *xptr++ = ixheaac_shl32(temp, neg_expo);
2660
13.4M
    }
2661
107k
  }
2662
143k
}
2663
2664
VOID ixheaacd_post_twiddle_120(WORD32 out[], WORD32 x[],
2665
339k
                               const WORD16 *cos_sin_ptr, WORD m) {
2666
339k
  WORD i;
2667
339k
  WORD16 c, c1, s, s1;
2668
339k
  WORD32 tempr, tempi, temp;
2669
339k
  WORD32 *in_ptr2 = x + (m - 1);
2670
339k
  WORD32 *in_ptr1 = x;
2671
339k
  WORD32 *xptr = out;
2672
339k
  WORD32 *xptr1 = out + (m - 1);
2673
2674
10.5M
  for (i = 0; i < m; i += 4) {
2675
10.1M
    c = *cos_sin_ptr++;
2676
10.1M
    s = *cos_sin_ptr++;
2677
10.1M
    c1 = *cos_sin_ptr++;
2678
10.1M
    s1 = *cos_sin_ptr++;
2679
2680
10.1M
    tempr = *in_ptr1++;
2681
10.1M
    tempi = *in_ptr1++;
2682
2683
10.1M
    temp = -ixheaac_sub32_sat(ixheaac_mult32x16in32(tempr, s),
2684
10.1M
                               ixheaac_mult32x16in32(tempi, c));
2685
10.1M
    *xptr1-- = temp;
2686
2687
10.1M
    temp = -ixheaac_add32_sat(ixheaac_mult32x16in32(tempr, c),
2688
10.1M
                               ixheaac_mult32x16in32(tempi, s));
2689
10.1M
    *xptr++ = temp;
2690
2691
10.1M
    tempi = *in_ptr2--;
2692
10.1M
    tempr = *in_ptr2--;
2693
2694
10.1M
    temp = -ixheaac_sub32_sat(ixheaac_mult32x16in32(tempr, s1),
2695
10.1M
                               ixheaac_mult32x16in32(tempi, c1));
2696
10.1M
    *xptr++ = temp;
2697
2698
10.1M
    temp = -ixheaac_add32_sat(ixheaac_mult32x16in32(tempr, c1),
2699
10.1M
                               ixheaac_mult32x16in32(tempi, s1));
2700
10.1M
    *xptr1-- = temp;
2701
10.1M
  }
2702
339k
}
2703
2704
VOID ixheaacd_post_twiddle_960(WORD32 out[], WORD32 x[],
2705
54.0k
                               const WORD32 *cos_sin_ptr, WORD m) {
2706
54.0k
  WORD i;
2707
54.0k
  WORD32 c, c1, s, s1;
2708
54.0k
  WORD32 tempr, tempi, temp;
2709
54.0k
  WORD32 *in_ptr2 = x + (m - 1);
2710
54.0k
  WORD32 *in_ptr1 = x;
2711
54.0k
  WORD32 *xptr = out;
2712
54.0k
  WORD32 *xptr1 = out + (m - 1);
2713
2714
13.0M
  for (i = 0; i < m; i += 4) {
2715
12.9M
    c = *cos_sin_ptr++;
2716
12.9M
    s = *cos_sin_ptr++;
2717
12.9M
    c1 = *cos_sin_ptr++;
2718
12.9M
    s1 = *cos_sin_ptr++;
2719
2720
12.9M
    tempr = *in_ptr1++;
2721
12.9M
    tempi = *in_ptr1++;
2722
2723
12.9M
    temp = -ixheaac_sub32_sat(ixheaac_mult32x32in32(tempr, s),
2724
12.9M
                               ixheaac_mult32x32in32(tempi, c));
2725
12.9M
    *xptr1-- = temp;
2726
2727
12.9M
    temp = -ixheaac_add32_sat(ixheaac_mult32x32in32(tempr, c),
2728
12.9M
                               ixheaac_mult32x32in32(tempi, s));
2729
12.9M
    *xptr++ = temp;
2730
2731
12.9M
    tempi = *in_ptr2--;
2732
12.9M
    tempr = *in_ptr2--;
2733
2734
12.9M
    temp = -ixheaac_sub32_sat(ixheaac_mult32x32in32(tempr, s1),
2735
12.9M
                               ixheaac_mult32x32in32(tempi, c1));
2736
12.9M
    *xptr++ = temp;
2737
2738
12.9M
    temp = -ixheaac_add32_sat(ixheaac_mult32x32in32(tempr, c1),
2739
12.9M
                               ixheaac_mult32x32in32(tempi, s1));
2740
12.9M
    *xptr1-- = temp;
2741
12.9M
  }
2742
54.0k
}
2743
2744
VOID ixheaacd_post_twiddle_ld(WORD32 out[], WORD32 x[],
2745
78.8k
                              const WORD32 *cos_sin_ptr, WORD m) {
2746
78.8k
  WORD i;
2747
2748
78.8k
  WORD32 *ptr_x = &x[0];
2749
78.8k
  WORD32 *ptr_out, *ptr_out1;
2750
2751
78.8k
  ptr_out = &out[0];
2752
78.8k
  ptr_out1 = &out[m - 1];
2753
2754
10.0M
  for (i = (m >> 2) - 1; i >= 0; i--) {
2755
9.92M
    WORD32 c, c1, s, s1;
2756
9.92M
    WORD32 re, im;
2757
2758
9.92M
    c = *cos_sin_ptr++;
2759
9.92M
    c1 = *cos_sin_ptr++;
2760
9.92M
    s = *cos_sin_ptr++;
2761
9.92M
    s1 = *cos_sin_ptr++;
2762
2763
9.92M
    re = *ptr_x++;
2764
9.92M
    im = *ptr_x++;
2765
2766
9.92M
    *ptr_out1 = ixheaac_sub32(ixheaac_mult32(im, c), ixheaac_mult32(re, s));
2767
2768
9.92M
    *ptr_out = -ixheaac_add32(ixheaac_mult32(re, c), ixheaac_mult32(im, s));
2769
2770
9.92M
    ptr_out += 2;
2771
9.92M
    ptr_out1 -= 2;
2772
2773
9.92M
    re = *ptr_x++;
2774
9.92M
    im = *ptr_x++;
2775
2776
9.92M
    *ptr_out1 =
2777
9.92M
        ixheaac_sub32(ixheaac_mult32(im, c1), ixheaac_mult32(re, s1));
2778
9.92M
    *ptr_out =
2779
9.92M
        -ixheaac_add32(ixheaac_mult32(re, c1), ixheaac_mult32(im, s1));
2780
2781
9.92M
    ptr_out += 2;
2782
9.92M
    ptr_out1 -= 2;
2783
9.92M
  }
2784
78.8k
}
2785
2786
VOID ixheaacd_post_twiddle_eld(WORD32 out[], WORD32 x[],
2787
64.7k
                               const WORD32 *cos_sin_ptr, WORD m) {
2788
64.7k
  WORD i = 0;
2789
2790
64.7k
  WORD32 *ptr_x = &x[0];
2791
64.7k
  WORD32 *ptr_out_767, *ptr_out_256;
2792
64.7k
  WORD32 *ptr_out_768, *ptr_out_255;
2793
64.7k
  WORD32 *ptr_out_0, *ptr_out_1279;
2794
64.7k
  WORD32 tempr, tempi;
2795
2796
64.7k
  ptr_out_767 = &out[m + (m >> 1) - 1 - 2 * i];
2797
64.7k
  ptr_out_256 = &out[(m >> 1) + 2 * i];
2798
2799
64.7k
  ptr_out_768 = &out[m + (m >> 1) + 2 * i];
2800
64.7k
  ptr_out_255 = &out[(m >> 1) - 1 - 2 * i];
2801
2802
4.06M
  for (i = 0; i < (m >> 3); i++) {
2803
4.00M
    WORD32 c, c1, s, s1;
2804
4.00M
    WORD32 re, im;
2805
2806
4.00M
    c = *cos_sin_ptr++;
2807
4.00M
    c1 = *cos_sin_ptr++;
2808
4.00M
    s = *cos_sin_ptr++;
2809
4.00M
    s1 = *cos_sin_ptr++;
2810
2811
4.00M
    re = *ptr_x++;
2812
4.00M
    im = *ptr_x++;
2813
2814
4.00M
    tempi = ixheaac_sub32(ixheaac_mult32(im, c), ixheaac_mult32(re, s));
2815
4.00M
    tempr = -ixheaac_add32(ixheaac_mult32(re, c), ixheaac_mult32(im, s));
2816
2817
4.00M
    *ptr_out_767 = tempr;
2818
4.00M
    *ptr_out_256 = tempi;
2819
2820
4.00M
    *ptr_out_768 = *ptr_out_767;
2821
4.00M
    *ptr_out_255 = -*ptr_out_256;
2822
2823
4.00M
    ptr_out_256 += 2;
2824
4.00M
    ptr_out_767 -= 2;
2825
4.00M
    ptr_out_768 += 2;
2826
4.00M
    ptr_out_255 -= 2;
2827
2828
4.00M
    re = *ptr_x++;
2829
4.00M
    im = *ptr_x++;
2830
2831
4.00M
    tempi = ixheaac_sub32(ixheaac_mult32(im, c1), ixheaac_mult32(re, s1));
2832
4.00M
    tempr = -ixheaac_add32(ixheaac_mult32(re, c1), ixheaac_mult32(im, s1));
2833
2834
4.00M
    *ptr_out_767 = tempr;
2835
4.00M
    *ptr_out_256 = tempi;
2836
2837
4.00M
    *ptr_out_768 = *ptr_out_767;
2838
4.00M
    *ptr_out_255 = -*ptr_out_256;
2839
2840
4.00M
    ptr_out_256 += 2;
2841
4.00M
    ptr_out_767 -= 2;
2842
4.00M
    ptr_out_768 += 2;
2843
4.00M
    ptr_out_255 -= 2;
2844
4.00M
  }
2845
2846
64.7k
  ptr_out_0 = &out[2 * 2 * i - (m >> 1)];
2847
64.7k
  ptr_out_1279 = &out[m + m + (m >> 1) - 1 - 2 * 2 * i];
2848
2849
4.06M
  for (; i < (m >> 2); i++) {
2850
4.00M
    WORD32 c, c1, s, s1;
2851
4.00M
    WORD32 re, im;
2852
2853
4.00M
    c = *cos_sin_ptr++;
2854
4.00M
    c1 = *cos_sin_ptr++;
2855
4.00M
    s = *cos_sin_ptr++;
2856
4.00M
    s1 = *cos_sin_ptr++;
2857
2858
4.00M
    re = *ptr_x++;
2859
4.00M
    im = *ptr_x++;
2860
2861
4.00M
    tempi = ixheaac_sub32(ixheaac_mult32(im, c), ixheaac_mult32(re, s));
2862
4.00M
    tempr = -ixheaac_add32(ixheaac_mult32(re, c), ixheaac_mult32(im, s));
2863
2864
4.00M
    *ptr_out_767 = tempr;
2865
4.00M
    *ptr_out_256 = tempi;
2866
2867
4.00M
    *ptr_out_0 = -*ptr_out_767;
2868
4.00M
    *ptr_out_1279 = *ptr_out_256;
2869
2870
4.00M
    ptr_out_256 += 2;
2871
4.00M
    ptr_out_767 -= 2;
2872
4.00M
    ptr_out_0 += 2;
2873
4.00M
    ptr_out_1279 -= 2;
2874
2875
4.00M
    re = *ptr_x++;
2876
4.00M
    im = *ptr_x++;
2877
2878
4.00M
    tempi = ixheaac_sub32(ixheaac_mult32(im, c1), ixheaac_mult32(re, s1));
2879
4.00M
    tempr = -ixheaac_add32(ixheaac_mult32(re, c1), ixheaac_mult32(im, s1));
2880
2881
4.00M
    *ptr_out_767 = tempr;
2882
4.00M
    *ptr_out_256 = tempi;
2883
2884
4.00M
    *ptr_out_0 = -*ptr_out_767;
2885
4.00M
    *ptr_out_1279 = *ptr_out_256;
2886
2887
4.00M
    ptr_out_256 += 2;
2888
4.00M
    ptr_out_767 -= 2;
2889
4.00M
    ptr_out_0 += 2;
2890
4.00M
    ptr_out_1279 -= 2;
2891
4.00M
  }
2892
64.7k
}
2893
2894
VOID ixheaacd_fft32x32_ld_dec(ia_aac_dec_imdct_tables_struct *imdct_tables_ptr,
2895
933k
                              WORD32 npoints, WORD32 *ptr_x, WORD32 *ptr_y) {
2896
933k
  WORD32 i, j, l1, l2, h2, predj, tw_offset, stride, fft_jmp, k;
2897
933k
  WORD32 xt0_0, yt0_0, xt1_0, yt1_0, xt2_0, yt2_0;
2898
933k
  WORD32 xh0_0, xh1_0, xh20_0, xh21_0, xl0_0, xl1_0, xl20_0, xl21_0;
2899
933k
  WORD32 xh0_1, xh1_1, xl0_1, xl1_1;
2900
933k
  WORD32 x_0, x_1, x_2, x_3, x_l1_0, x_l1_1, x_l2_0, x_l2_1;
2901
933k
  WORD32 xh0_2, xh1_2, xl0_2, xl1_2, xh0_3, xh1_3, xl0_3, xl1_3;
2902
933k
  WORD32 x_4, x_5, x_6, x_7, x_h2_0, x_h2_1;
2903
933k
  WORD32 x_8, x_9, x_a, x_b, x_c, x_d, x_e, x_f;
2904
933k
  WORD32 si10, si20, si30, co10, co20, co30;
2905
933k
  WORD32 *w;
2906
933k
  WORD32 *x, *x2, *x0;
2907
933k
  WORD32 *y0, *y1, *y2, *y3;
2908
933k
  WORD32 n00, n10, n20, n30, n01, n11, n21, n31;
2909
933k
  WORD32 n02, n12, n22, n32, n03, n13, n23, n33;
2910
933k
  WORD32 n0, j0;
2911
933k
  WORD32 radix;
2912
933k
  WORD32 norm;
2913
933k
  WORD32 m;
2914
933k
  WORD32 *ptr_w;
2915
2916
933k
  if (npoints == 256)
2917
87.1k
    ptr_w = imdct_tables_ptr->w_256;
2918
846k
  else if (npoints == 32)
2919
0
    ptr_w = (WORD32*)imdct_tables_ptr->w_32;
2920
846k
  else
2921
846k
    ptr_w = imdct_tables_ptr->w_16;
2922
2923
25.7M
  for (i = 31, m = 1; (npoints & (1 << i)) == 0; i--, m++)
2924
24.8M
    ;
2925
933k
  radix = m & 1 ? 2 : 4;
2926
933k
  norm = m - 2;
2927
2928
933k
  stride = npoints;
2929
933k
  tw_offset = 0;
2930
933k
  fft_jmp = 6 * stride;
2931
2932
2.04M
  while (stride > radix) {
2933
1.10M
    j = 0;
2934
1.10M
    fft_jmp >>= 2;
2935
2936
1.10M
    h2 = stride >> 1;
2937
1.10M
    l1 = stride;
2938
1.10M
    l2 = stride + (stride >> 1);
2939
2940
1.10M
    x = ptr_x;
2941
1.10M
    w = ptr_w + tw_offset;
2942
1.10M
    tw_offset += fft_jmp;
2943
2944
1.10M
    stride >>= 2;
2945
2946
21.2M
    for (i = 0; i < npoints; i += 4) {
2947
20.1M
      co10 = w[j + 1];
2948
20.1M
      si10 = w[j + 0];
2949
20.1M
      co20 = w[j + 3];
2950
20.1M
      si20 = w[j + 2];
2951
20.1M
      co30 = w[j + 5];
2952
20.1M
      si30 = w[j + 4];
2953
2954
20.1M
      x_0 = x[0];
2955
20.1M
      x_1 = x[1];
2956
20.1M
      x_l1_0 = x[l1];
2957
20.1M
      x_l1_1 = x[l1 + 1];
2958
20.1M
      x_l2_0 = x[l2];
2959
20.1M
      x_l2_1 = x[l2 + 1];
2960
20.1M
      x_h2_0 = x[h2];
2961
20.1M
      x_h2_1 = x[h2 + 1];
2962
2963
20.1M
      xh0_0 = ixheaac_add32_sat(x_0, x_l1_0);
2964
20.1M
      xh1_0 = ixheaac_add32_sat(x_1, x_l1_1);
2965
20.1M
      xl0_0 = ixheaac_sub32_sat(x_0, x_l1_0);
2966
20.1M
      xl1_0 = ixheaac_sub32_sat(x_1, x_l1_1);
2967
20.1M
      xh20_0 = ixheaac_add32_sat(x_h2_0, x_l2_0);
2968
20.1M
      xh21_0 = ixheaac_add32_sat(x_h2_1, x_l2_1);
2969
20.1M
      xl20_0 = ixheaac_sub32_sat(x_h2_0, x_l2_0);
2970
20.1M
      xl21_0 = ixheaac_sub32_sat(x_h2_1, x_l2_1);
2971
2972
20.1M
      x0 = x;
2973
20.1M
      x2 = x0;
2974
2975
20.1M
      j += 6;
2976
20.1M
      x += 2;
2977
20.1M
      predj = (j - fft_jmp);
2978
20.1M
      if (!predj) x += fft_jmp;
2979
20.1M
      if (!predj) j = 0;
2980
2981
20.1M
      x0[0] = ixheaac_add32_sat(xh0_0, xh20_0);
2982
20.1M
      x0[1] = ixheaac_add32_sat(xh1_0, xh21_0);
2983
20.1M
      xt0_0 = ixheaac_sub32_sat(xh0_0, xh20_0);
2984
20.1M
      yt0_0 = ixheaac_sub32_sat(xh1_0, xh21_0);
2985
20.1M
      xt1_0 = ixheaac_add32_sat(xl0_0, xl21_0);
2986
20.1M
      yt2_0 = ixheaac_add32_sat(xl1_0, xl20_0);
2987
20.1M
      xt2_0 = ixheaac_sub32_sat(xl0_0, xl21_0);
2988
20.1M
      yt1_0 = ixheaac_sub32_sat(xl1_0, xl20_0);
2989
2990
20.1M
      x2[h2] =
2991
20.1M
          MPYHIRC(si10, yt1_0) + MPYHIRC(co10, xt1_0) +
2992
20.1M
          (((MPYLUHS(si10, yt1_0) + MPYLUHS(co10, xt1_0) + 0x8000) >> 16) << 1);
2993
2994
20.1M
      x2[h2 + 1] =
2995
20.1M
          MPYHIRC(co10, yt1_0) - MPYHIRC(si10, xt1_0) +
2996
20.1M
          (((MPYLUHS(co10, yt1_0) - MPYLUHS(si10, xt1_0) + 0x8000) >> 16) << 1);
2997
2998
20.1M
      x2[l1] =
2999
20.1M
          MPYHIRC(si20, yt0_0) + MPYHIRC(co20, xt0_0) +
3000
20.1M
          (((MPYLUHS(si20, yt0_0) + MPYLUHS(co20, xt0_0) + 0x8000) >> 16) << 1);
3001
3002
20.1M
      x2[l1 + 1] =
3003
20.1M
          MPYHIRC(co20, yt0_0) - MPYHIRC(si20, xt0_0) +
3004
20.1M
          (((MPYLUHS(co20, yt0_0) - MPYLUHS(si20, xt0_0) + 0x8000) >> 16) << 1);
3005
3006
20.1M
      x2[l2] =
3007
20.1M
          MPYHIRC(si30, yt2_0) + MPYHIRC(co30, xt2_0) +
3008
20.1M
          (((MPYLUHS(si30, yt2_0) + MPYLUHS(co30, xt2_0) + 0x8000) >> 16) << 1);
3009
3010
20.1M
      x2[l2 + 1] =
3011
20.1M
          MPYHIRC(co30, yt2_0) - MPYHIRC(si30, xt2_0) +
3012
20.1M
          (((MPYLUHS(co30, yt2_0) - MPYLUHS(si30, xt2_0) + 0x8000) >> 16) << 1);
3013
20.1M
    }
3014
1.10M
  }
3015
3016
933k
  y0 = ptr_y;
3017
933k
  y2 = ptr_y + (WORD32)npoints;
3018
933k
  x0 = ptr_x;
3019
933k
  x2 = ptr_x + (WORD32)(npoints >> 1);
3020
3021
933k
  if (radix == 2) {
3022
0
    y1 = y0 + (WORD32)(npoints >> 2);
3023
0
    y3 = y2 + (WORD32)(npoints >> 2);
3024
0
    l1 = norm + 1;
3025
0
    j0 = 8;
3026
0
    n0 = npoints >> 1;
3027
933k
  } else {
3028
933k
    y1 = y0 + (WORD32)(npoints >> 1);
3029
933k
    y3 = y2 + (WORD32)(npoints >> 1);
3030
933k
    l1 = norm + 2;
3031
933k
    j0 = 4;
3032
933k
    n0 = npoints >> 2;
3033
933k
  }
3034
3035
933k
  j = 0;
3036
933k
  k = 0;
3037
3038
5.41M
  for (i = 0; i < npoints; i += 8) {
3039
4.48M
    if (npoints == 32)
3040
0
      h2 = rev_dig[k++];
3041
4.48M
    else
3042
4.48M
      DIG_REV(j, l1, h2);
3043
3044
4.48M
    x_0 = x0[0];
3045
4.48M
    x_1 = x0[1];
3046
4.48M
    x_2 = x0[2];
3047
4.48M
    x_3 = x0[3];
3048
4.48M
    x_4 = x0[4];
3049
4.48M
    x_5 = x0[5];
3050
4.48M
    x_6 = x0[6];
3051
4.48M
    x_7 = x0[7];
3052
4.48M
    x0 += 8;
3053
3054
4.48M
    xh0_0 = ixheaac_add32_sat(x_0, x_4);
3055
4.48M
    xh1_0 = ixheaac_add32_sat(x_1, x_5);
3056
4.48M
    xl0_0 = ixheaac_sub32_sat(x_0, x_4);
3057
4.48M
    xl1_0 = ixheaac_sub32_sat(x_1, x_5);
3058
4.48M
    xh0_1 = ixheaac_add32_sat(x_2, x_6);
3059
4.48M
    xh1_1 = ixheaac_add32_sat(x_3, x_7);
3060
4.48M
    xl0_1 = ixheaac_sub32_sat(x_2, x_6);
3061
4.48M
    xl1_1 = ixheaac_sub32_sat(x_3, x_7);
3062
3063
4.48M
    n00 = ixheaac_add32_sat(xh0_0, xh0_1);
3064
4.48M
    n01 = ixheaac_add32_sat(xh1_0, xh1_1);
3065
4.48M
    n10 = ixheaac_add32_sat(xl0_0, xl1_1);
3066
4.48M
    n11 = ixheaac_sub32_sat(xl1_0, xl0_1);
3067
4.48M
    n20 = ixheaac_sub32_sat(xh0_0, xh0_1);
3068
4.48M
    n21 = ixheaac_sub32_sat(xh1_0, xh1_1);
3069
4.48M
    n30 = ixheaac_sub32_sat(xl0_0, xl1_1);
3070
4.48M
    n31 = ixheaac_add32_sat(xl1_0, xl0_1);
3071
3072
4.48M
    if (radix == 2) {
3073
0
      n00 = ixheaac_add32_sat(x_0, x_2);
3074
0
      n01 = ixheaac_add32_sat(x_1, x_3);
3075
0
      n20 = ixheaac_sub32_sat(x_0, x_2);
3076
0
      n21 = ixheaac_sub32_sat(x_1, x_3);
3077
0
      n10 = ixheaac_add32_sat(x_4, x_6);
3078
0
      n11 = ixheaac_add32_sat(x_5, x_7);
3079
0
      n30 = ixheaac_sub32_sat(x_4, x_6);
3080
0
      n31 = ixheaac_sub32_sat(x_5, x_7);
3081
0
    }
3082
3083
4.48M
    y0[2 * h2] = n00;
3084
4.48M
    y0[2 * h2 + 1] = n01;
3085
4.48M
    y1[2 * h2] = n10;
3086
4.48M
    y1[2 * h2 + 1] = n11;
3087
4.48M
    y2[2 * h2] = n20;
3088
4.48M
    y2[2 * h2 + 1] = n21;
3089
4.48M
    y3[2 * h2] = n30;
3090
4.48M
    y3[2 * h2 + 1] = n31;
3091
3092
4.48M
    x_8 = x2[0];
3093
4.48M
    x_9 = x2[1];
3094
4.48M
    x_a = x2[2];
3095
4.48M
    x_b = x2[3];
3096
4.48M
    x_c = x2[4];
3097
4.48M
    x_d = x2[5];
3098
4.48M
    x_e = x2[6];
3099
4.48M
    x_f = x2[7];
3100
4.48M
    x2 += 8;
3101
3102
4.48M
    xh0_2 = ixheaac_add32_sat(x_8, x_c);
3103
4.48M
    xh1_2 = ixheaac_add32_sat(x_9, x_d);
3104
4.48M
    xl0_2 = ixheaac_sub32_sat(x_8, x_c);
3105
4.48M
    xl1_2 = ixheaac_sub32_sat(x_9, x_d);
3106
4.48M
    xh0_3 = ixheaac_add32_sat(x_a, x_e);
3107
4.48M
    xh1_3 = ixheaac_add32_sat(x_b, x_f);
3108
4.48M
    xl0_3 = ixheaac_sub32_sat(x_a, x_e);
3109
4.48M
    xl1_3 = ixheaac_sub32_sat(x_b, x_f);
3110
3111
4.48M
    n02 = ixheaac_add32_sat(xh0_2, xh0_3);
3112
4.48M
    n03 = ixheaac_add32_sat(xh1_2, xh1_3);
3113
4.48M
    n12 = ixheaac_add32_sat(xl0_2, xl1_3);
3114
4.48M
    n13 = ixheaac_sub32_sat(xl1_2, xl0_3);
3115
4.48M
    n22 = ixheaac_sub32_sat(xh0_2, xh0_3);
3116
4.48M
    n23 = ixheaac_sub32_sat(xh1_2, xh1_3);
3117
4.48M
    n32 = ixheaac_sub32_sat(xl0_2, xl1_3);
3118
4.48M
    n33 = ixheaac_add32_sat(xl1_2, xl0_3);
3119
3120
4.48M
    if (radix == 2) {
3121
0
      n02 = ixheaac_add32_sat(x_8, x_a);
3122
0
      n03 = ixheaac_add32_sat(x_9, x_b);
3123
0
      n22 = ixheaac_sub32_sat(x_8, x_a);
3124
0
      n23 = ixheaac_sub32_sat(x_9, x_b);
3125
0
      n12 = ixheaac_add32_sat(x_c, x_e);
3126
0
      n13 = ixheaac_add32_sat(x_d, x_f);
3127
0
      n32 = ixheaac_sub32_sat(x_c, x_e);
3128
0
      n33 = ixheaac_sub32_sat(x_d, x_f);
3129
0
    }
3130
3131
4.48M
    y0[2 * h2 + 2] = n02;
3132
4.48M
    y0[2 * h2 + 3] = n03;
3133
4.48M
    y1[2 * h2 + 2] = n12;
3134
4.48M
    y1[2 * h2 + 3] = n13;
3135
4.48M
    y2[2 * h2 + 2] = n22;
3136
4.48M
    y2[2 * h2 + 3] = n23;
3137
4.48M
    y3[2 * h2 + 2] = n32;
3138
4.48M
    y3[2 * h2 + 3] = n33;
3139
3140
4.48M
    j += j0;
3141
3142
4.48M
    if (j == n0) {
3143
933k
      j += n0;
3144
933k
      x0 += (WORD32)npoints >> 1;
3145
933k
      x2 += (WORD32)npoints >> 1;
3146
933k
    }
3147
4.48M
  }
3148
933k
}
3149
3150
VOID ixheaacd_rearrange_dec(WORD32 *ip, WORD32 *op, WORD32 mdct_len_2,
3151
56.4k
                            UWORD8 *re_arr_tab) {
3152
56.4k
  WORD32 n, i = 0;
3153
3154
13.5M
  for (n = 0; n < mdct_len_2; n++) {
3155
13.5M
    WORD32 idx = re_arr_tab[n] << 1;
3156
3157
13.5M
    op[i++] = ip[idx];
3158
13.5M
    op[i++] = ip[idx + 1];
3159
13.5M
  }
3160
56.4k
}
3161
3162
VOID ixheaacd_fft_15_ld_dec(WORD32 *inp, WORD32 *op, WORD32 *fft3out,
3163
902k
                            UWORD8 *re_arr_tab_sml_240_ptr) {
3164
902k
  WORD32 i, n, idx;
3165
902k
  WORD32 *buf1, *buf2, *buf1a;
3166
902k
  WORD32 add_r, sub_r;
3167
902k
  WORD32 add_i, sub_i;
3168
902k
  WORD32 x01_real, x_01_imag, temp;
3169
902k
  WORD32 p1, p2, p3, p4;
3170
3171
902k
  WORD32 sinmu = 1859775393;
3172
902k
  WORD32 cos_51 = 2042378317;
3173
902k
  WORD32 cos_52 = -1652318768;
3174
902k
  WORD32 cos_53 = -780119100;
3175
902k
  WORD32 cos_54 = 1200479854;
3176
902k
  WORD32 cos_55 = -1342177280;
3177
3178
902k
  WORD32 r1, r2, r3, r4;
3179
902k
  WORD32 s1, s2, s3, s4, t, temp1, temp2;
3180
902k
  WORD32 *fft3outptr = fft3out;
3181
3182
902k
  WORD32 xr_0, xr_1, xr_2;
3183
902k
  WORD32 xi_0, xi_1, xi_2;
3184
3185
902k
  buf2 = fft3out;
3186
902k
  buf1 = buf1a = fft3out;
3187
902k
  n = 0;
3188
3189
902k
  {
3190
902k
    *buf1++ = inp[0];
3191
902k
    *buf1++ = inp[1];
3192
3193
902k
    *buf1++ = inp[96];
3194
902k
    *buf1++ = inp[97];
3195
3196
902k
    *buf1++ = inp[192];
3197
902k
    *buf1++ = inp[193];
3198
3199
902k
    *buf1++ = inp[288];
3200
902k
    *buf1++ = inp[289];
3201
3202
902k
    *buf1++ = inp[384];
3203
902k
    *buf1++ = inp[385];
3204
3205
902k
    r1 = ixheaac_add32_sat(buf1a[2], buf1a[8]);
3206
902k
    r4 = ixheaac_sub32_sat(buf1a[2], buf1a[8]);
3207
902k
    r3 = ixheaac_add32_sat(buf1a[4], buf1a[6]);
3208
902k
    r2 = ixheaac_sub32_sat(buf1a[4], buf1a[6]);
3209
3210
902k
    t = ixheaac_mult32_shl(ixheaac_sub32_sat(r1, r3), cos_54);
3211
3212
902k
    r1 = ixheaac_add32_sat(r1, r3);
3213
3214
902k
    temp1 = ixheaac_add32_sat(buf1a[0], r1);
3215
3216
902k
    r1 = ixheaac_add32_sat(
3217
902k
        temp1, ixheaac_shl32_sat((ixheaac_mult32_shl(r1, cos_55)), 1));
3218
3219
902k
    r3 = ixheaac_sub32_sat(r1, t);
3220
902k
    r1 = ixheaac_add32_sat(r1, t);
3221
3222
902k
    t = ixheaac_mult32_shl(ixheaac_add32_sat(r4, r2), cos_51);
3223
902k
    r4 = ixheaac_add32_sat(
3224
902k
        t, ixheaac_shl32_sat(ixheaac_mult32_shl(r4, cos_52), 1));
3225
902k
    r2 = ixheaac_add32_sat(t, ixheaac_mult32_shl(r2, cos_53));
3226
3227
902k
    s1 = ixheaac_add32_sat(buf1a[3], buf1a[9]);
3228
902k
    s4 = ixheaac_sub32_sat(buf1a[3], buf1a[9]);
3229
902k
    s3 = ixheaac_add32_sat(buf1a[5], buf1a[7]);
3230
902k
    s2 = ixheaac_sub32_sat(buf1a[5], buf1a[7]);
3231
3232
902k
    t = ixheaac_mult32_shl(ixheaac_sub32_sat(s1, s3), cos_54);
3233
902k
    s1 = ixheaac_add32_sat(s1, s3);
3234
3235
902k
    temp2 = ixheaac_add32_sat(buf1a[1], s1);
3236
3237
902k
    s1 = ixheaac_add32_sat(
3238
902k
        temp2, ixheaac_shl32_sat((ixheaac_mult32_shl(s1, cos_55)), 1));
3239
3240
902k
    s3 = ixheaac_sub32_sat(s1, t);
3241
902k
    s1 = ixheaac_add32_sat(s1, t);
3242
3243
902k
    t = ixheaac_mult32_shl(ixheaac_add32_sat(s4, s2), cos_51);
3244
902k
    s4 = ixheaac_add32_sat(
3245
902k
        t, ixheaac_shl32_sat((ixheaac_mult32_shl(s4, cos_52)), 1));
3246
902k
    s2 = ixheaac_add32_sat(t, (ixheaac_mult32_shl(s2, cos_53)));
3247
3248
902k
    *buf2++ = temp1;
3249
902k
    *buf2++ = temp2;
3250
902k
    *buf2++ = ixheaac_add32_sat(r1, s2);
3251
902k
    *buf2++ = ixheaac_sub32_sat(s1, r2);
3252
902k
    *buf2++ = ixheaac_sub32_sat(r3, s4);
3253
902k
    *buf2++ = ixheaac_add32_sat(s3, r4);
3254
902k
    *buf2++ = ixheaac_add32_sat(r3, s4);
3255
902k
    *buf2++ = ixheaac_sub32_sat(s3, r4);
3256
902k
    *buf2++ = ixheaac_sub32_sat(r1, s2);
3257
902k
    *buf2++ = ixheaac_add32_sat(s1, r2);
3258
902k
    buf1a = buf1;
3259
3260
902k
    *buf1++ = inp[160];
3261
902k
    *buf1++ = inp[161];
3262
3263
902k
    *buf1++ = inp[256];
3264
902k
    *buf1++ = inp[257];
3265
3266
902k
    *buf1++ = inp[352];
3267
902k
    *buf1++ = inp[353];
3268
3269
902k
    *buf1++ = inp[448];
3270
902k
    *buf1++ = inp[449];
3271
3272
902k
    *buf1++ = inp[64];
3273
902k
    *buf1++ = inp[65];
3274
3275
902k
    r1 = ixheaac_add32_sat(buf1a[2], buf1a[8]);
3276
902k
    r4 = ixheaac_sub32_sat(buf1a[2], buf1a[8]);
3277
902k
    r3 = ixheaac_add32_sat(buf1a[4], buf1a[6]);
3278
902k
    r2 = ixheaac_sub32_sat(buf1a[4], buf1a[6]);
3279
3280
902k
    t = ixheaac_mult32_shl(ixheaac_sub32_sat(r1, r3), cos_54);
3281
3282
902k
    r1 = ixheaac_add32_sat(r1, r3);
3283
3284
902k
    temp1 = ixheaac_add32_sat(buf1a[0], r1);
3285
3286
902k
    r1 = ixheaac_add32_sat(
3287
902k
        temp1, ixheaac_shl32_sat((ixheaac_mult32_shl(r1, cos_55)), 1));
3288
3289
902k
    r3 = ixheaac_sub32_sat(r1, t);
3290
902k
    r1 = ixheaac_add32_sat(r1, t);
3291
3292
902k
    t = ixheaac_mult32_shl(ixheaac_add32_sat(r4, r2), cos_51);
3293
902k
    r4 = ixheaac_add32_sat(
3294
902k
        t, ixheaac_shl32_sat(ixheaac_mult32_shl(r4, cos_52), 1));
3295
902k
    r2 = ixheaac_add32_sat(t, ixheaac_mult32_shl(r2, cos_53));
3296
3297
902k
    s1 = ixheaac_add32_sat(buf1a[3], buf1a[9]);
3298
902k
    s4 = ixheaac_sub32_sat(buf1a[3], buf1a[9]);
3299
902k
    s3 = ixheaac_add32_sat(buf1a[5], buf1a[7]);
3300
902k
    s2 = ixheaac_sub32_sat(buf1a[5], buf1a[7]);
3301
3302
902k
    t = ixheaac_mult32_shl(ixheaac_sub32_sat(s1, s3), cos_54);
3303
3304
902k
    s1 = ixheaac_add32_sat(s1, s3);
3305
3306
902k
    temp2 = ixheaac_add32_sat(buf1a[1], s1);
3307
3308
902k
    s1 = ixheaac_add32_sat(
3309
902k
        temp2, ixheaac_shl32_sat((ixheaac_mult32_shl(s1, cos_55)), 1));
3310
3311
902k
    s3 = ixheaac_sub32_sat(s1, t);
3312
902k
    s1 = ixheaac_add32_sat(s1, t);
3313
3314
902k
    t = ixheaac_mult32_shl(ixheaac_add32_sat(s4, s2), cos_51);
3315
902k
    s4 = ixheaac_add32_sat(
3316
902k
        t, ixheaac_shl32_sat((ixheaac_mult32_shl(s4, cos_52)), 1));
3317
902k
    s2 = ixheaac_add32_sat(t, (ixheaac_mult32_shl(s2, cos_53)));
3318
3319
902k
    *buf2++ = temp1;
3320
902k
    *buf2++ = temp2;
3321
902k
    *buf2++ = ixheaac_add32_sat(r1, s2);
3322
902k
    *buf2++ = ixheaac_sub32_sat(s1, r2);
3323
902k
    *buf2++ = ixheaac_sub32_sat(r3, s4);
3324
902k
    *buf2++ = ixheaac_add32_sat(s3, r4);
3325
902k
    *buf2++ = ixheaac_add32_sat(r3, s4);
3326
902k
    *buf2++ = ixheaac_sub32_sat(s3, r4);
3327
902k
    *buf2++ = ixheaac_sub32_sat(r1, s2);
3328
902k
    *buf2++ = ixheaac_add32_sat(s1, r2);
3329
902k
    buf1a = buf1;
3330
902k
    ;
3331
3332
902k
    *buf1++ = inp[320];
3333
902k
    *buf1++ = inp[321];
3334
3335
902k
    *buf1++ = inp[416];
3336
902k
    *buf1++ = inp[417];
3337
3338
902k
    *buf1++ = inp[32];
3339
902k
    *buf1++ = inp[33];
3340
3341
902k
    *buf1++ = inp[128];
3342
902k
    *buf1++ = inp[129];
3343
3344
902k
    *buf1++ = inp[224];
3345
902k
    *buf1++ = inp[225];
3346
3347
902k
    r1 = ixheaac_add32_sat(buf1a[2], buf1a[8]);
3348
902k
    r4 = ixheaac_sub32_sat(buf1a[2], buf1a[8]);
3349
902k
    r3 = ixheaac_add32_sat(buf1a[4], buf1a[6]);
3350
902k
    r2 = ixheaac_sub32_sat(buf1a[4], buf1a[6]);
3351
3352
902k
    t = ixheaac_mult32_shl(ixheaac_sub32_sat(r1, r3), cos_54);
3353
3354
902k
    r1 = ixheaac_add32_sat(r1, r3);
3355
3356
902k
    temp1 = ixheaac_add32_sat(buf1a[0], r1);
3357
3358
902k
    r1 = ixheaac_add32_sat(
3359
902k
        temp1, ixheaac_shl32_sat((ixheaac_mult32_shl(r1, cos_55)), 1));
3360
3361
902k
    r3 = ixheaac_sub32_sat(r1, t);
3362
902k
    r1 = ixheaac_add32_sat(r1, t);
3363
3364
902k
    t = ixheaac_mult32_shl(ixheaac_add32_sat(r4, r2), cos_51);
3365
902k
    r4 = ixheaac_add32_sat(
3366
902k
        t, ixheaac_shl32_sat(ixheaac_mult32_shl(r4, cos_52), 1));
3367
902k
    r2 = ixheaac_add32_sat(t, ixheaac_mult32_shl(r2, cos_53));
3368
3369
902k
    s1 = ixheaac_add32_sat(buf1a[3], buf1a[9]);
3370
902k
    s4 = ixheaac_sub32_sat(buf1a[3], buf1a[9]);
3371
902k
    s3 = ixheaac_add32_sat(buf1a[5], buf1a[7]);
3372
902k
    s2 = ixheaac_sub32_sat(buf1a[5], buf1a[7]);
3373
3374
902k
    t = ixheaac_mult32_shl(ixheaac_sub32_sat(s1, s3), cos_54);
3375
3376
902k
    s1 = ixheaac_add32_sat(s1, s3);
3377
3378
902k
    temp2 = ixheaac_add32_sat(buf1a[1], s1);
3379
3380
902k
    s1 = ixheaac_add32_sat(
3381
902k
        temp2, ixheaac_shl32_sat((ixheaac_mult32_shl(s1, cos_55)), 1));
3382
3383
902k
    s3 = ixheaac_sub32_sat(s1, t);
3384
902k
    s1 = ixheaac_add32_sat(s1, t);
3385
3386
902k
    t = ixheaac_mult32_shl(ixheaac_add32_sat(s4, s2), cos_51);
3387
902k
    s4 = ixheaac_add32_sat(
3388
902k
        t, ixheaac_shl32_sat((ixheaac_mult32_shl(s4, cos_52)), 1));
3389
902k
    s2 = ixheaac_add32_sat(t, (ixheaac_mult32_shl(s2, cos_53)));
3390
3391
902k
    *buf2++ = temp1;
3392
902k
    *buf2++ = temp2;
3393
902k
    *buf2++ = ixheaac_add32_sat(r1, s2);
3394
902k
    *buf2++ = ixheaac_sub32_sat(s1, r2);
3395
902k
    *buf2++ = ixheaac_sub32_sat(r3, s4);
3396
902k
    *buf2++ = ixheaac_add32_sat(s3, r4);
3397
902k
    *buf2++ = ixheaac_add32_sat(r3, s4);
3398
902k
    *buf2++ = ixheaac_sub32_sat(s3, r4);
3399
902k
    *buf2++ = ixheaac_sub32_sat(r1, s2);
3400
902k
    *buf2++ = ixheaac_add32_sat(s1, r2);
3401
902k
    buf1a = buf1;
3402
902k
    ;
3403
902k
  }
3404
3405
902k
  n = 0;
3406
5.41M
  for (i = 0; i < FFT5; i++) {
3407
4.51M
    xr_0 = fft3outptr[0];
3408
4.51M
    xi_0 = fft3outptr[1];
3409
3410
4.51M
    xr_1 = fft3outptr[10];
3411
4.51M
    xi_1 = fft3outptr[11];
3412
3413
4.51M
    xr_2 = fft3outptr[20];
3414
4.51M
    xi_2 = fft3outptr[21];
3415
3416
4.51M
    x01_real = ixheaac_add32_sat(xr_0, xr_1);
3417
4.51M
    x_01_imag = ixheaac_add32_sat(xi_0, xi_1);
3418
3419
4.51M
    add_r = ixheaac_add32_sat(xr_1, xr_2);
3420
4.51M
    add_i = ixheaac_add32_sat(xi_1, xi_2);
3421
3422
4.51M
    sub_r = ixheaac_sub32_sat(xr_1, xr_2);
3423
4.51M
    sub_i = ixheaac_sub32_sat(xi_1, xi_2);
3424
3425
4.51M
    p1 = add_r >> 1;
3426
3427
4.51M
    p2 = ixheaac_mult32_shl(sub_i, sinmu);
3428
4.51M
    p3 = ixheaac_mult32_shl(sub_r, sinmu);
3429
3430
4.51M
    p4 = add_i >> 1;
3431
3432
4.51M
    temp = ixheaac_sub32_sat(xr_0, p1);
3433
4.51M
    temp1 = ixheaac_add32_sat(xi_0, p3);
3434
4.51M
    temp2 = ixheaac_sub32_sat(xi_0, p3);
3435
3436
4.51M
    idx = re_arr_tab_sml_240_ptr[n++] << 1;
3437
4.51M
    op[idx] = ixheaac_add32_sat(x01_real, xr_2);
3438
4.51M
    op[idx + 1] = ixheaac_add32_sat(x_01_imag, xi_2);
3439
3440
4.51M
    idx = re_arr_tab_sml_240_ptr[n++] << 1;
3441
4.51M
    op[idx] = ixheaac_add32_sat(temp, p2);
3442
4.51M
    op[idx + 1] = ixheaac_sub32_sat(temp2, p4);
3443
3444
4.51M
    idx = re_arr_tab_sml_240_ptr[n++] << 1;
3445
4.51M
    op[idx] = ixheaac_sub32_sat(temp, p2);
3446
4.51M
    op[idx + 1] = ixheaac_sub32_sat(temp1, p4);
3447
4.51M
    fft3outptr += 2;
3448
4.51M
  }
3449
902k
}