1 /******************************************************************************
2  *
3  *  Copyright 1999-2012 Broadcom Corporation
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 
19 /******************************************************************************
20  *
21  *  This file contains the Windowing coeffs for synthesis filter
22  *
23  ******************************************************************************/
24 
25 #include "sbc_encoder.h"
26 
27 #if (SBC_ARM_ASM_OPT == FALSE && SBC_IPAQ_OPT == FALSE)
28 #if (SBC_IS_64_MULT_IN_WINDOW_ACCU == FALSE)
29 /*Window coeff for 4 sub band case*/
30 const int16_t gas32CoeffFor4SBs[] = {
31     (int16_t)((int32_t)0x00000000 >> 16), (int16_t)0x00000000,
32     (int16_t)((int32_t)0x001194E6 >> 16), (int16_t)0x001194E6,
33     (int16_t)((int32_t)0x0030E2D3 >> 16), (int16_t)0x0030E2D3,
34     (int16_t)((int32_t)0x00599403 >> 16), (int16_t)0x00599403,
35     (int16_t)((int32_t)0x007DBCC8 >> 16), (int16_t)0x007DBCC8,
36     (int16_t)((int32_t)0x007F88E4 >> 16), (int16_t)0x007F88E4,
37     (int16_t)((int32_t)0x003D239B >> 16), (int16_t)0x003D239B,
38     (int16_t)((int32_t)0xFF9BB9D5 >> 16), (int16_t)0xFF9BB9D5,
39 
40     (int16_t)((int32_t)0x01659F45 >> 16), (int16_t)0x01659F45,
41     (int16_t)((int32_t)0x029DBAA3 >> 16), (int16_t)0x029DBAA3,
42     (int16_t)((int32_t)0x03B23341 >> 16), (int16_t)0x03B23341,
43     (int16_t)((int32_t)0x041EEE40 >> 16), (int16_t)0x041EEE40,
44     (int16_t)((int32_t)0x034FEE2C >> 16), (int16_t)0x034FEE2C,
45     (int16_t)((int32_t)0x00C8F2BC >> 16), (int16_t)0x00C8F2BC,
46     (int16_t)((int32_t)0xFC4F91D4 >> 16), (int16_t)0xFC4F91D4,
47     (int16_t)((int32_t)0xF60FAF37 >> 16), (int16_t)0xF60FAF37,
48 
49     (int16_t)((int32_t)0x115B1ED2 >> 16), (int16_t)0x115B1ED2,
50     (int16_t)((int32_t)0x18F55C90 >> 16), (int16_t)0x18F55C90,
51     (int16_t)((int32_t)0x1F91CA46 >> 16), (int16_t)0x1F91CA46,
52     (int16_t)((int32_t)0x2412F251 >> 16), (int16_t)0x2412F251,
53     (int16_t)((int32_t)0x25AC1FF2 >> 16), (int16_t)0x25AC1FF2,
54     (int16_t)((int32_t)0x2412F251 >> 16), (int16_t)0x2412F251,
55     (int16_t)((int32_t)0x1F91CA46 >> 16), (int16_t)0x1F91CA46,
56     (int16_t)((int32_t)0x18F55C90 >> 16), (int16_t)0x18F55C90,
57 
58     (int16_t)((int32_t)0xEEA4E12E >> 16), (int16_t)0xEEA4E12E,
59     (int16_t)((int32_t)0xF60FAF37 >> 16), (int16_t)0xF60FAF37,
60     (int16_t)((int32_t)0xFC4F91D4 >> 16), (int16_t)0xFC4F91D4,
61     (int16_t)((int32_t)0x00C8F2BC >> 16), (int16_t)0x00C8F2BC,
62     (int16_t)((int32_t)0x034FEE2C >> 16), (int16_t)0x034FEE2C,
63     (int16_t)((int32_t)0x041EEE40 >> 16), (int16_t)0x041EEE40,
64     (int16_t)((int32_t)0x03B23341 >> 16), (int16_t)0x03B23341,
65     (int16_t)((int32_t)0x029DBAA3 >> 16), (int16_t)0x029DBAA3,
66 
67     (int16_t)((int32_t)0xFE9A60BB >> 16), (int16_t)0xFE9A60BB,
68     (int16_t)((int32_t)0xFF9BB9D5 >> 16), (int16_t)0xFF9BB9D5,
69     (int16_t)((int32_t)0x003D239B >> 16), (int16_t)0x003D239B,
70     (int16_t)((int32_t)0x007F88E4 >> 16), (int16_t)0x007F88E4,
71     (int16_t)((int32_t)0x007DBCC8 >> 16), (int16_t)0x007DBCC8,
72     (int16_t)((int32_t)0x00599403 >> 16), (int16_t)0x00599403,
73     (int16_t)((int32_t)0x0030E2D3 >> 16), (int16_t)0x0030E2D3,
74     (int16_t)((int32_t)0x001194E6 >> 16), (int16_t)0x001194E6};
75 
76 /*Window coeff for 8 sub band case*/
77 const int16_t gas32CoeffFor8SBs[] = {
78     (int16_t)((int32_t)0x00000000 >> 16), (int16_t)0x00000000,
79     (int16_t)((int32_t)0x00052173 >> 16), (int16_t)0x00052173,
80     (int16_t)((int32_t)0x000B3F71 >> 16), (int16_t)0x000B3F71,
81     (int16_t)((int32_t)0x00122C7D >> 16), (int16_t)0x00122C7D,
82     (int16_t)((int32_t)0x001AFF89 >> 16), (int16_t)0x001AFF89,
83     (int16_t)((int32_t)0x00255A62 >> 16), (int16_t)0x00255A62,
84     (int16_t)((int32_t)0x003060F4 >> 16), (int16_t)0x003060F4,
85     (int16_t)((int32_t)0x003A72E7 >> 16), (int16_t)0x003A72E7,
86 
87     (int16_t)((int32_t)0x0041EC6A >> 16), (int16_t)0x0041EC6A, /* 8 */
88     (int16_t)((int32_t)0x0044EF48 >> 16), (int16_t)0x0044EF48,
89     (int16_t)((int32_t)0x00415B75 >> 16), (int16_t)0x00415B75,
90     (int16_t)((int32_t)0x0034F8B6 >> 16), (int16_t)0x0034F8B6,
91     (int16_t)((int32_t)0x001D8FD2 >> 16), (int16_t)0x001D8FD2,
92     (int16_t)((int32_t)0xFFFA2413 >> 16), (int16_t)0xFFFA2413,
93     (int16_t)((int32_t)0xFFC9F10E >> 16), (int16_t)0xFFC9F10E,
94     (int16_t)((int32_t)0xFF8D6793 >> 16), (int16_t)0xFF8D6793,
95 
96     (int16_t)((int32_t)0x00B97348 >> 16), (int16_t)0x00B97348, /* 16 */
97     (int16_t)((int32_t)0x01071B96 >> 16), (int16_t)0x01071B96,
98     (int16_t)((int32_t)0x0156B3CA >> 16), (int16_t)0x0156B3CA,
99     (int16_t)((int32_t)0x01A1B38B >> 16), (int16_t)0x01A1B38B,
100     (int16_t)((int32_t)0x01E0224C >> 16), (int16_t)0x01E0224C,
101     (int16_t)((int32_t)0x0209291F >> 16), (int16_t)0x0209291F,
102     (int16_t)((int32_t)0x02138653 >> 16), (int16_t)0x02138653,
103     (int16_t)((int32_t)0x01F5F424 >> 16), (int16_t)0x01F5F424,
104 
105     (int16_t)((int32_t)0x01A7ECEF >> 16), (int16_t)0x01A7ECEF, /* 24 */
106     (int16_t)((int32_t)0x01223EBA >> 16), (int16_t)0x01223EBA,
107     (int16_t)((int32_t)0x005FD0FF >> 16), (int16_t)0x005FD0FF,
108     (int16_t)((int32_t)0xFF5EEB73 >> 16), (int16_t)0xFF5EEB73,
109     (int16_t)((int32_t)0xFE20435D >> 16), (int16_t)0xFE20435D,
110     (int16_t)((int32_t)0xFCA86E7E >> 16), (int16_t)0xFCA86E7E,
111     (int16_t)((int32_t)0xFAFF95FC >> 16), (int16_t)0xFAFF95FC,
112     (int16_t)((int32_t)0xF9312891 >> 16), (int16_t)0xF9312891,
113 
114     (int16_t)((int32_t)0x08B4307A >> 16), (int16_t)0x08B4307A, /* 32 */
115     (int16_t)((int32_t)0x0A9F3E9A >> 16), (int16_t)0x0A9F3E9A,
116     (int16_t)((int32_t)0x0C7D59B6 >> 16), (int16_t)0x0C7D59B6,
117     (int16_t)((int32_t)0x0E3BB16F >> 16), (int16_t)0x0E3BB16F,
118     (int16_t)((int32_t)0x0FC721F9 >> 16), (int16_t)0x0FC721F9,
119     (int16_t)((int32_t)0x110ECEF0 >> 16), (int16_t)0x110ECEF0,
120     (int16_t)((int32_t)0x120435FA >> 16), (int16_t)0x120435FA,
121     (int16_t)((int32_t)0x129C226F >> 16), (int16_t)0x129C226F,
122 
123     (int16_t)((int32_t)0x12CF6C75 >> 16), (int16_t)0x12CF6C75, /* 40 */
124     (int16_t)((int32_t)0x129C226F >> 16), (int16_t)0x129C226F,
125     (int16_t)((int32_t)0x120435FA >> 16), (int16_t)0x120435FA,
126     (int16_t)((int32_t)0x110ECEF0 >> 16), (int16_t)0x110ECEF0,
127     (int16_t)((int32_t)0x0FC721F9 >> 16), (int16_t)0x0FC721F9,
128     (int16_t)((int32_t)0x0E3BB16F >> 16), (int16_t)0x0E3BB16F,
129     (int16_t)((int32_t)0x0C7D59B6 >> 16), (int16_t)0x0C7D59B6,
130     (int16_t)((int32_t)0x0A9F3E9A >> 16), (int16_t)0x0A9F3E9A,
131 
132     (int16_t)((int32_t)0xF74BCF86 >> 16), (int16_t)0xF74BCF86, /* 48 */
133     (int16_t)((int32_t)0xF9312891 >> 16), (int16_t)0xF9312891,
134     (int16_t)((int32_t)0xFAFF95FC >> 16), (int16_t)0xFAFF95FC,
135     (int16_t)((int32_t)0xFCA86E7E >> 16), (int16_t)0xFCA86E7E,
136     (int16_t)((int32_t)0xFE20435D >> 16), (int16_t)0xFE20435D,
137     (int16_t)((int32_t)0xFF5EEB73 >> 16), (int16_t)0xFF5EEB73,
138     (int16_t)((int32_t)0x005FD0FF >> 16), (int16_t)0x005FD0FF,
139     (int16_t)((int32_t)0x01223EBA >> 16), (int16_t)0x01223EBA,
140 
141     (int16_t)((int32_t)0x01A7ECEF >> 16), (int16_t)0x01A7ECEF, /* 56 */
142     (int16_t)((int32_t)0x01F5F424 >> 16), (int16_t)0x01F5F424,
143     (int16_t)((int32_t)0x02138653 >> 16), (int16_t)0x02138653,
144     (int16_t)((int32_t)0x0209291F >> 16), (int16_t)0x0209291F,
145     (int16_t)((int32_t)0x01E0224C >> 16), (int16_t)0x01E0224C,
146     (int16_t)((int32_t)0x01A1B38B >> 16), (int16_t)0x01A1B38B,
147     (int16_t)((int32_t)0x0156B3CA >> 16), (int16_t)0x0156B3CA,
148     (int16_t)((int32_t)0x01071B96 >> 16), (int16_t)0x01071B96,
149 
150     (int16_t)((int32_t)0xFF468CB8 >> 16), (int16_t)0xFF468CB8, /* 64 */
151     (int16_t)((int32_t)0xFF8D6793 >> 16), (int16_t)0xFF8D6793,
152     (int16_t)((int32_t)0xFFC9F10E >> 16), (int16_t)0xFFC9F10E,
153     (int16_t)((int32_t)0xFFFA2413 >> 16), (int16_t)0xFFFA2413,
154     (int16_t)((int32_t)0x001D8FD2 >> 16), (int16_t)0x001D8FD2,
155     (int16_t)((int32_t)0x0034F8B6 >> 16), (int16_t)0x0034F8B6,
156     (int16_t)((int32_t)0x00415B75 >> 16), (int16_t)0x00415B75,
157     (int16_t)((int32_t)0x0044EF48 >> 16), (int16_t)0x0044EF48,
158 
159     (int16_t)((int32_t)0x0041EC6A >> 16), (int16_t)0x0041EC6A, /* 72 */
160     (int16_t)((int32_t)0x003A72E7 >> 16), (int16_t)0x003A72E7,
161     (int16_t)((int32_t)0x003060F4 >> 16), (int16_t)0x003060F4,
162     (int16_t)((int32_t)0x00255A62 >> 16), (int16_t)0x00255A62,
163     (int16_t)((int32_t)0x001AFF89 >> 16), (int16_t)0x001AFF89,
164     (int16_t)((int32_t)0x00122C7D >> 16), (int16_t)0x00122C7D,
165     (int16_t)((int32_t)0x000B3F71 >> 16), (int16_t)0x000B3F71,
166     (int16_t)((int32_t)0x00052173 >> 16), (int16_t)0x00052173};
167 
168 #else
169 
170 /*Window coeff for 4 sub band case*/
171 const int32_t gas32CoeffFor4SBs[] = {
172     (int32_t)0x00000000, (int32_t)0x001194E6, (int32_t)0x0030E2D3,
173     (int32_t)0x00599403, (int32_t)0x007DBCC8, (int32_t)0x007F88E4,
174     (int32_t)0x003D239B, (int32_t)0xFF9BB9D5,
175 
176     (int32_t)0x01659F45, (int32_t)0x029DBAA3, (int32_t)0x03B23341,
177     (int32_t)0x041EEE40, (int32_t)0x034FEE2C, (int32_t)0x00C8F2BC,
178     (int32_t)0xFC4F91D4, (int32_t)0xF60FAF37,
179 
180     (int32_t)0x115B1ED2, (int32_t)0x18F55C90, (int32_t)0x1F91CA46,
181     (int32_t)0x2412F251, (int32_t)0x25AC1FF2, (int32_t)0x2412F251,
182     (int32_t)0x1F91CA46, (int32_t)0x18F55C90,
183 
184     (int32_t)0xEEA4E12E, (int32_t)0xF60FAF37, (int32_t)0xFC4F91D4,
185     (int32_t)0x00C8F2BC, (int32_t)0x034FEE2C, (int32_t)0x041EEE40,
186     (int32_t)0x03B23341, (int32_t)0x029DBAA3,
187 
188     (int32_t)0xFE9A60BB, (int32_t)0xFF9BB9D5, (int32_t)0x003D239B,
189     (int32_t)0x007F88E4, (int32_t)0x007DBCC8, (int32_t)0x00599403,
190     (int32_t)0x0030E2D3, (int32_t)0x001194E6};
191 
192 /*Window coeff for 8 sub band case*/
193 const int32_t gas32CoeffFor8SBs[] = {
194     (int32_t)0x00000000, (int32_t)0x00052173, (int32_t)0x000B3F71,
195     (int32_t)0x00122C7D, (int32_t)0x001AFF89, (int32_t)0x00255A62,
196     (int32_t)0x003060F4, (int32_t)0x003A72E7,
197 
198     (int32_t)0x0041EC6A, /* 8 */
199     (int32_t)0x0044EF48, (int32_t)0x00415B75, (int32_t)0x0034F8B6,
200     (int32_t)0x001D8FD2, (int32_t)0xFFFA2413, (int32_t)0xFFC9F10E,
201     (int32_t)0xFF8D6793,
202 
203     (int32_t)0x00B97348, /* 16 */
204     (int32_t)0x01071B96, (int32_t)0x0156B3CA, (int32_t)0x01A1B38B,
205     (int32_t)0x01E0224C, (int32_t)0x0209291F, (int32_t)0x02138653,
206     (int32_t)0x01F5F424,
207 
208     (int32_t)0x01A7ECEF, /* 24 */
209     (int32_t)0x01223EBA, (int32_t)0x005FD0FF, (int32_t)0xFF5EEB73,
210     (int32_t)0xFE20435D, (int32_t)0xFCA86E7E, (int32_t)0xFAFF95FC,
211     (int32_t)0xF9312891,
212 
213     (int32_t)0x08B4307A, /* 32 */
214     (int32_t)0x0A9F3E9A, (int32_t)0x0C7D59B6, (int32_t)0x0E3BB16F,
215     (int32_t)0x0FC721F9, (int32_t)0x110ECEF0, (int32_t)0x120435FA,
216     (int32_t)0x129C226F,
217 
218     (int32_t)0x12CF6C75, /* 40 */
219     (int32_t)0x129C226F, (int32_t)0x120435FA, (int32_t)0x110ECEF0,
220     (int32_t)0x0FC721F9, (int32_t)0x0E3BB16F, (int32_t)0x0C7D59B6,
221     (int32_t)0x0A9F3E9A,
222 
223     (int32_t)0xF74BCF86, /* 48 */
224     (int32_t)0xF9312891, (int32_t)0xFAFF95FC, (int32_t)0xFCA86E7E,
225     (int32_t)0xFE20435D, (int32_t)0xFF5EEB73, (int32_t)0x005FD0FF,
226     (int32_t)0x01223EBA,
227 
228     (int32_t)0x01A7ECEF, /* 56 */
229     (int32_t)0x01F5F424, (int32_t)0x02138653, (int32_t)0x0209291F,
230     (int32_t)0x01E0224C, (int32_t)0x01A1B38B, (int32_t)0x0156B3CA,
231     (int32_t)0x01071B96,
232 
233     (int32_t)0xFF468CB8, /* 64 */
234     (int32_t)0xFF8D6793, (int32_t)0xFFC9F10E, (int32_t)0xFFFA2413,
235     (int32_t)0x001D8FD2, (int32_t)0x0034F8B6, (int32_t)0x00415B75,
236     (int32_t)0x0044EF48,
237 
238     (int32_t)0x0041EC6A, /* 72 */
239     (int32_t)0x003A72E7, (int32_t)0x003060F4, (int32_t)0x00255A62,
240     (int32_t)0x001AFF89, (int32_t)0x00122C7D, (int32_t)0x000B3F71,
241     (int32_t)0x00052173};
242 
243 #endif
244 #endif
245