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 coefficient table used for DCT computation in
22  *  analysis.
23  *
24  ******************************************************************************/
25 
26 #include "sbc_encoder.h"
27 /*DCT coeff for 4 sub-band case.*/
28 #if (SBC_FAST_DCT == FALSE)
29 const int16_t gas16AnalDCTcoeff4[] = {
30         (int16_t)(0.7071 * 32768),  (int16_t)(0.9239 * 32768),  (int16_t)(1.0000 * 32767),
31         (int16_t)(0.9239 * 32768),  (int16_t)(0.7071 * 32768),  (int16_t)(0.3827 * 32768),
32         (int16_t)(0.0000 * 32768),  (int16_t)(-0.3827 * 32768),
33 
34         (int16_t)(-0.7071 * 32768), (int16_t)(0.3827 * 32768),  (int16_t)(1.0000 * 32767),
35         (int16_t)(0.3827 * 32768),  (int16_t)(-0.7071 * 32768), (int16_t)(-0.9239 * 32768),
36         (int16_t)(-0.0000 * 32768), (int16_t)(0.9239 * 32768),
37 
38         (int16_t)(-0.7071 * 32768), (int16_t)(-0.3827 * 32768), (int16_t)(1.0000 * 32767),
39         (int16_t)(-0.3827 * 32768), (int16_t)(-0.7071 * 32768), (int16_t)(0.9239 * 32768),
40         (int16_t)(0.0000 * 32768),  (int16_t)(-0.9239 * 32768),
41 
42         (int16_t)(0.7071 * 32768),  (int16_t)(-0.9239 * 32768), (int16_t)(1.0000 * 32767),
43         (int16_t)(-0.9239 * 32768), (int16_t)(0.7071 * 32768),  (int16_t)(-0.3827 * 32768),
44         (int16_t)(-0.0000 * 32768), (int16_t)(0.3827 * 32768)};
45 
46 /*DCT coeff for 8 sub-band case.*/
47 const int16_t gas16AnalDCTcoeff8[] = {
48         (int16_t)(0.7071 * 32768),  (int16_t)(0.8315 * 32768),  (int16_t)(0.9239 * 32768),
49         (int16_t)(0.9808 * 32768),  (int16_t)(1.0000 * 32767),  (int16_t)(0.9808 * 32768),
50         (int16_t)(0.9239 * 32768),  (int16_t)(0.8315 * 32768),  (int16_t)(0.7071 * 32768),
51         (int16_t)(0.5556 * 32768),  (int16_t)(0.3827 * 32768),  (int16_t)(0.1951 * 32768),
52         (int16_t)(0.0000 * 32768),  (int16_t)(-0.1951 * 32768), (int16_t)(-0.3827 * 32768),
53         (int16_t)(-0.5556 * 32768), (int16_t)(-0.7071 * 32768), (int16_t)(-0.1951 * 32768),
54         (int16_t)(0.3827 * 32768),  (int16_t)(0.8315 * 32768),  (int16_t)(1.0000 * 32767),
55         (int16_t)(0.8315 * 32768),  (int16_t)(0.3827 * 32768),  (int16_t)(-0.1951 * 32768),
56         (int16_t)(-0.7071 * 32768), (int16_t)(-0.9808 * 32768), (int16_t)(-0.9239 * 32768),
57         (int16_t)(-0.5556 * 32768), (int16_t)(-0.0000 * 32768), (int16_t)(0.5556 * 32768),
58         (int16_t)(0.9239 * 32768),  (int16_t)(0.9808 * 32768),  (int16_t)(-0.7071 * 32768),
59         (int16_t)(-0.9808 * 32768), (int16_t)(-0.3827 * 32768), (int16_t)(0.5556 * 32768),
60         (int16_t)(1.0000 * 32767),  (int16_t)(0.5556 * 32768),  (int16_t)(-0.3827 * 32768),
61         (int16_t)(-0.9808 * 32768), (int16_t)(-0.7071 * 32768), (int16_t)(0.1951 * 32768),
62         (int16_t)(0.9239 * 32768),  (int16_t)(0.8315 * 32768),  (int16_t)(0.0000 * 32768),
63         (int16_t)(-0.8315 * 32768), (int16_t)(-0.9239 * 32768), (int16_t)(-0.1951 * 32768),
64         (int16_t)(0.7071 * 32768),  (int16_t)(-0.5556 * 32768), (int16_t)(-0.9239 * 32768),
65         (int16_t)(0.1951 * 32768),  (int16_t)(1.0000 * 32767),  (int16_t)(0.1951 * 32768),
66         (int16_t)(-0.9239 * 32768), (int16_t)(-0.5556 * 32768), (int16_t)(0.7071 * 32768),
67         (int16_t)(0.8315 * 32768),  (int16_t)(-0.3827 * 32768), (int16_t)(-0.9808 * 32768),
68         (int16_t)(-0.0000 * 32768), (int16_t)(0.9808 * 32768),  (int16_t)(0.3827 * 32768),
69         (int16_t)(-0.8315 * 32768), (int16_t)(0.7071 * 32768),  (int16_t)(0.5556 * 32768),
70         (int16_t)(-0.9239 * 32768), (int16_t)(-0.1951 * 32768), (int16_t)(1.0000 * 32767),
71         (int16_t)(-0.1951 * 32768), (int16_t)(-0.9239 * 32768), (int16_t)(0.5556 * 32768),
72         (int16_t)(0.7071 * 32768),  (int16_t)(-0.8315 * 32768), (int16_t)(-0.3827 * 32768),
73         (int16_t)(0.9808 * 32768),  (int16_t)(0.0000 * 32768),  (int16_t)(-0.9808 * 32768),
74         (int16_t)(0.3827 * 32768),  (int16_t)(0.8315 * 32768),  (int16_t)(-0.7071 * 32768),
75         (int16_t)(0.9808 * 32768),  (int16_t)(-0.3827 * 32768), (int16_t)(-0.5556 * 32768),
76         (int16_t)(1.0000 * 32767),  (int16_t)(-0.5556 * 32768), (int16_t)(-0.3827 * 32768),
77         (int16_t)(0.9808 * 32768),  (int16_t)(-0.7071 * 32768), (int16_t)(-0.1951 * 32768),
78         (int16_t)(0.9239 * 32768),  (int16_t)(-0.8315 * 32768), (int16_t)(-0.0000 * 32768),
79         (int16_t)(0.8315 * 32768),  (int16_t)(-0.9239 * 32768), (int16_t)(0.1951 * 32768),
80         (int16_t)(-0.7071 * 32768), (int16_t)(0.1951 * 32768),  (int16_t)(0.3827 * 32768),
81         (int16_t)(-0.8315 * 32768), (int16_t)(1.0000 * 32767),  (int16_t)(-0.8315 * 32768),
82         (int16_t)(0.3827 * 32768),  (int16_t)(0.1951 * 32768),  (int16_t)(-0.7071 * 32768),
83         (int16_t)(0.9808 * 32768),  (int16_t)(-0.9239 * 32768), (int16_t)(0.5556 * 32768),
84         (int16_t)(-0.0000 * 32768), (int16_t)(-0.5556 * 32768), (int16_t)(0.9239 * 32768),
85         (int16_t)(-0.9808 * 32768), (int16_t)(0.7071 * 32768),  (int16_t)(-0.8315 * 32768),
86         (int16_t)(0.9239 * 32768),  (int16_t)(-0.9808 * 32768), (int16_t)(1.0000 * 32767),
87         (int16_t)(-0.9808 * 32768), (int16_t)(0.9239 * 32768),  (int16_t)(-0.8315 * 32768),
88         (int16_t)(0.7071 * 32768),  (int16_t)(-0.5556 * 32768), (int16_t)(0.3827 * 32768),
89         (int16_t)(-0.1951 * 32768), (int16_t)(-0.0000 * 32768), (int16_t)(0.1951 * 32768),
90         (int16_t)(-0.3827 * 32768), (int16_t)(0.5556 * 32768)};
91 #endif
92