• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 <ixheaacd_type_def.h>
22 
23 #include "ixheaacd_constants.h"
24 #include <ixheaacd_basic_ops32.h>
25 #include <ixheaacd_basic_ops16.h>
26 #include <ixheaacd_basic_ops40.h>
27 #include "ixheaacd_basic_ops.h"
28 #include "ixheaacd_common_rom.h"
29 #include "ixheaacd_dsp_fft32x32s.h"
30 #include "ixheaacd_intrinsics.h"
31 
32 #include <ixheaacd_basic_op.h>
33 
ixheaacd_inv_dit_fft_8pt_dec(WORD32 * y,WORD32 * real,WORD32 * imag)34 VOID ixheaacd_inv_dit_fft_8pt_dec(WORD32 *y, WORD32 *real, WORD32 *imag) {
35   WORD32 a0, a1, a2, a3, a00, a10, a20, a30;
36   WORD32 vr, vi;
37 
38   WORD32 x[16];
39 
40   a00 = ixheaacd_add32_sat(y[0], y[8]);
41   a0 = ixheaacd_sub32_sat(y[0], y[8]);
42 
43   a20 = ixheaacd_add32_sat(y[1], y[9]);
44   a3 = ixheaacd_sub32_sat(y[1], y[9]);
45 
46   a10 = ixheaacd_add32_sat(y[4], y[12]);
47   a2 = ixheaacd_sub32_sat(y[4], y[12]);
48 
49   a30 = ixheaacd_add32_sat(y[5], y[13]);
50   a1 = ixheaacd_sub32_sat(y[5], y[13]);
51 
52   x[0] = ixheaacd_add32_sat(a00, a10);
53   x[4] = ixheaacd_sub32_sat(a00, a10);
54   x[1] = ixheaacd_add32_sat(a20, a30);
55   x[5] = ixheaacd_sub32_sat(a20, a30);
56 
57   x[2] = ixheaacd_sub32_sat(a0, a1);
58   x[6] = ixheaacd_add32_sat(a0, a1);
59   x[3] = ixheaacd_add32_sat(a3, a2);
60   x[7] = ixheaacd_sub32_sat(a3, a2);
61 
62   a00 = ixheaacd_add32_sat(y[2], y[10]);
63   a0 = ixheaacd_sub32_sat(y[2], y[10]);
64 
65   a20 = ixheaacd_add32_sat(y[3], y[11]);
66   a3 = ixheaacd_sub32_sat(y[3], y[11]);
67 
68   a10 = ixheaacd_add32_sat(y[6], y[14]);
69   a2 = ixheaacd_sub32_sat(y[6], y[14]);
70 
71   a30 = ixheaacd_add32_sat(y[7], y[15]);
72   a1 = ixheaacd_sub32_sat(y[7], y[15]);
73 
74   x[8] = ixheaacd_add32_sat(a00, a10);
75   x[12] = ixheaacd_sub32_sat(a00, a10);
76   x[9] = ixheaacd_add32_sat(a20, a30);
77   x[13] = ixheaacd_sub32_sat(a20, a30);
78 
79   x[10] = ixheaacd_sub32_sat(a0, a1);
80   x[14] = ixheaacd_add32_sat(a0, a1);
81   x[11] = ixheaacd_add32_sat(a3, a2);
82   x[15] = ixheaacd_sub32_sat(a3, a2);
83 
84   real[0] = ixheaacd_add32_sat(x[0], x[8]);
85   imag[0] = ixheaacd_add32_sat(x[1], x[9]);
86   a00 = ixheaacd_sub32_sat(x[0], x[8]);
87   a10 = ixheaacd_sub32_sat(x[1], x[9]);
88 
89   a0 = ixheaacd_sub32_sat(x[4], x[13]);
90   a1 = ixheaacd_add32_sat(x[5], x[12]);
91 
92   real[4] = ixheaacd_add32_sat(x[4], x[13]);
93   imag[4] = ixheaacd_sub32_sat(x[5], x[12]);
94 
95   vr = ixheaacd_mult32x16in32_shl_sat(ixheaacd_sub32_sat(x[10], x[11]), 0x5A82);
96   vi = ixheaacd_mult32x16in32_shl_sat(ixheaacd_add32_sat(x[10], x[11]), 0x5A82);
97 
98   real[1] = ixheaacd_add32_sat(x[2], vr);
99   imag[1] = ixheaacd_add32_sat(x[3], vi);
100 
101   a2 = ixheaacd_sub32_sat(x[2], vr);
102   a3 = ixheaacd_sub32_sat(x[3], vi);
103 
104   real[2] = ixheaacd_add32_sat(a0, a2);
105   imag[2] = ixheaacd_add32_sat(a1, a3);
106   vr = ixheaacd_mult32x16in32_shl_sat(ixheaacd_add32_sat(x[14], x[15]), 0x5A82);
107   vi = ixheaacd_mult32x16in32_shl_sat(ixheaacd_sub32_sat(x[14], x[15]), 0x5A82);
108 
109   a20 = ixheaacd_sub32_sat(x[6], vr);
110   a30 = ixheaacd_add32_sat(x[7], vi);
111 
112   real[3] = ixheaacd_add32_sat(a00, a20);
113   imag[3] = ixheaacd_add32_sat(a10, a30);
114 
115   real[5] = ixheaacd_add32_sat(x[6], vr);
116   imag[5] = ixheaacd_sub32_sat(x[7], vi);
117 }
118