Coverage Report

Created: 2026-10-14 07:21

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