blob: dbbaa42aaaa1c794cc3d73c2250f3db6d67767ac
1 | /* |
2 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
3 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
4 | ** |
5 | ** This program is free software; you can redistribute it and/or modify |
6 | ** it under the terms of the GNU General Public License as published by |
7 | ** the Free Software Foundation; either version 2 of the License, or |
8 | ** (at your option) any later version. |
9 | ** |
10 | ** This program is distributed in the hope that it will be useful, |
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | ** GNU General Public License for more details. |
14 | ** |
15 | ** You should have received a copy of the GNU General Public License |
16 | ** along with this program; if not, write to the Free Software |
17 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | ** |
19 | ** Any non-GPL usage of this software or parts of this software is strictly |
20 | ** forbidden. |
21 | ** |
22 | ** The "appropriate copyright message" mentioned in section 2c of the GPLv2 |
23 | ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com" |
24 | ** |
25 | ** Commercial non-GPL licensing of this software is possible. |
26 | ** For more info contact Nero AG through Mpeg4AAClicense@nero.com. |
27 | ** |
28 | ** $Id: hcb_6.h,v 1.5 2007/11/01 12:34:11 menno Exp $ |
29 | **/ |
30 | |
31 | /* 2-step huffman table HCB_6 */ |
32 | |
33 | |
34 | /* 1st step: 5 bits |
35 | * 2^5 = 32 entries |
36 | * |
37 | * Used to find offset into 2nd step table and number of extra bits to get |
38 | */ |
39 | static hcb hcb6_1[] = { |
40 | /* 4 bit codewords */ |
41 | { /* 00000 */ 0, 0 }, |
42 | { /* */ 0, 0 }, |
43 | { /* 00010 */ 1, 0 }, |
44 | { /* */ 1, 0 }, |
45 | { /* 00100 */ 2, 0 }, |
46 | { /* */ 2, 0 }, |
47 | { /* 00110 */ 3, 0 }, |
48 | { /* */ 3, 0 }, |
49 | { /* 01000 */ 4, 0 }, |
50 | { /* */ 4, 0 }, |
51 | { /* 01010 */ 5, 0 }, |
52 | { /* */ 5, 0 }, |
53 | { /* 01100 */ 6, 0 }, |
54 | { /* */ 6, 0 }, |
55 | { /* 01110 */ 7, 0 }, |
56 | { /* */ 7, 0 }, |
57 | { /* 10000 */ 8, 0 }, |
58 | { /* */ 8, 0 }, |
59 | |
60 | /* 6 bit codewords */ |
61 | { /* 10010 */ 9, 1 }, |
62 | { /* 10011 */ 11, 1 }, |
63 | { /* 10100 */ 13, 1 }, |
64 | { /* 10101 */ 15, 1 }, |
65 | { /* 10110 */ 17, 1 }, |
66 | { /* 10111 */ 19, 1 }, |
67 | { /* 11000 */ 21, 1 }, |
68 | { /* 11001 */ 23, 1 }, |
69 | |
70 | /* 7 bit codewords */ |
71 | { /* 11010 */ 25, 2 }, |
72 | { /* 11011 */ 29, 2 }, |
73 | { /* 11100 */ 33, 2 }, |
74 | |
75 | /* 7/8 bit codewords */ |
76 | { /* 11101 */ 37, 3 }, |
77 | |
78 | /* 8/9 bit codewords */ |
79 | { /* 11110 */ 45, 4 }, |
80 | |
81 | /* 9/10/11 bit codewords */ |
82 | { /* 11111 */ 61, 6 } |
83 | }; |
84 | |
85 | /* 2nd step table |
86 | * |
87 | * Gives size of codeword and actual data (x,y,v,w) |
88 | */ |
89 | static hcb_2_pair hcb6_2[] = { |
90 | /* 4 bit codewords */ |
91 | { 4, 0, 0 }, |
92 | { 4, 1, 0 }, |
93 | { 4, 0, -1 }, |
94 | { 4, 0, 1 }, |
95 | { 4, -1, 0 }, |
96 | { 4, 1, 1 }, |
97 | { 4, -1, 1 }, |
98 | { 4, 1, -1 }, |
99 | { 4, -1, -1 }, |
100 | |
101 | /* 6 bit codewords */ |
102 | { 6, 2, -1 }, |
103 | { 6, 2, 1 }, |
104 | { 6, -2, 1 }, |
105 | { 6, -2, -1 }, |
106 | { 6, -2, 0 }, |
107 | { 6, -1, 2 }, |
108 | { 6, 2, 0 }, |
109 | { 6, 1, -2 }, |
110 | { 6, 1, 2 }, |
111 | { 6, 0, -2 }, |
112 | { 6, -1, -2 }, |
113 | { 6, 0, 2 }, |
114 | { 6, 2, -2 }, |
115 | { 6, -2, 2 }, |
116 | { 6, -2, -2 }, |
117 | { 6, 2, 2 }, |
118 | |
119 | /* 7 bit codewords */ |
120 | { 7, -3, 1 }, |
121 | { 7, 3, 1 }, |
122 | { 7, 3, -1 }, |
123 | { 7, -1, 3 }, |
124 | { 7, -3, -1 }, |
125 | { 7, 1, 3 }, |
126 | { 7, 1, -3 }, |
127 | { 7, -1, -3 }, |
128 | { 7, 3, 0 }, |
129 | { 7, -3, 0 }, |
130 | { 7, 0, -3 }, |
131 | { 7, 0, 3 }, |
132 | |
133 | /* 7/8 bit codewords */ |
134 | { 7, 3, 2 }, { 7, 3, 2 }, |
135 | { 8, -3, -2 }, |
136 | { 8, -2, 3 }, |
137 | { 8, 2, 3 }, |
138 | { 8, 3, -2 }, |
139 | { 8, 2, -3 }, |
140 | { 8, -2, -3 }, |
141 | |
142 | /* 8 bit codewords */ |
143 | { 8, -3, 2 }, { 8, -3, 2 }, |
144 | { 8, 3, 3 }, { 8, 3, 3 }, |
145 | { 9, 3, -3 }, |
146 | { 9, -3, -3 }, |
147 | { 9, -3, 3 }, |
148 | { 9, 1, -4 }, |
149 | { 9, -1, -4 }, |
150 | { 9, 4, 1 }, |
151 | { 9, -4, 1 }, |
152 | { 9, -4, -1 }, |
153 | { 9, 1, 4 }, |
154 | { 9, 4, -1 }, |
155 | { 9, -1, 4 }, |
156 | { 9, 0, -4 }, |
157 | |
158 | /* 9/10/11 bit codewords */ |
159 | { 9, -4, 2 }, { 9, -4, 2 }, { 9, -4, 2 }, { 9, -4, 2 }, |
160 | { 9, -4, -2 }, { 9, -4, -2 }, { 9, -4, -2 }, { 9, -4, -2 }, |
161 | { 9, 2, 4 }, { 9, 2, 4 }, { 9, 2, 4 }, { 9, 2, 4 }, |
162 | { 9, -2, -4 }, { 9, -2, -4 }, { 9, -2, -4 }, { 9, -2, -4 }, |
163 | { 9, -4, 0 }, { 9, -4, 0 }, { 9, -4, 0 }, { 9, -4, 0 }, |
164 | { 9, 4, 2 }, { 9, 4, 2 }, { 9, 4, 2 }, { 9, 4, 2 }, |
165 | { 9, 4, -2 }, { 9, 4, -2 }, { 9, 4, -2 }, { 9, 4, -2 }, |
166 | { 9, -2, 4 }, { 9, -2, 4 }, { 9, -2, 4 }, { 9, -2, 4 }, |
167 | { 9, 4, 0 }, { 9, 4, 0 }, { 9, 4, 0 }, { 9, 4, 0 }, |
168 | { 9, 2, -4 }, { 9, 2, -4 }, { 9, 2, -4 }, { 9, 2, -4 }, |
169 | { 9, 0, 4 }, { 9, 0, 4 }, { 9, 0, 4 }, { 9, 0, 4 }, |
170 | { 10, -3, -4 }, { 10, -3, -4 }, |
171 | { 10, -3, 4 }, { 10, -3, 4 }, |
172 | { 10, 3, -4 }, { 10, 3, -4 }, |
173 | { 10, 4, -3 }, { 10, 4, -3 }, |
174 | { 10, 3, 4 }, { 10, 3, 4 }, |
175 | { 10, 4, 3 }, { 10, 4, 3 }, |
176 | { 10, -4, 3 }, { 10, -4, 3 }, |
177 | { 10, -4, -3 }, { 10, -4, -3 }, |
178 | { 11, 4, 4 }, |
179 | { 11, -4, 4 }, |
180 | { 11, -4, -4 }, |
181 | { 11, 4, -4 } |
182 | }; |
183 |