2 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
3 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
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.
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.
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.
19 ** Any non-GPL usage of this software or parts of this software is strictly
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"
25 ** Commercial non-GPL licensing of this software is possible.
26 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
28 ** $Id: hcb_4.h,v 1.5 2007/11/01 12:34:11 menno Exp $
31 /* 2-step huffman table HCB_4 */
37 * Used to find offset into 2nd step table and number of extra bits to get
39 static hcb hcb4_1[] = {
63 { /* 10100 */ 10, 0 },
64 { /* 10101 */ 11, 0 },
65 { /* 10110 */ 12, 0 },
66 { /* 10111 */ 13, 0 },
67 { /* 11000 */ 14, 0 },
68 { /* 11001 */ 15, 0 },
71 { /* 11010 */ 16, 2 },
72 { /* 11011 */ 20, 2 },
74 /* 7/8 bit codewords */
75 { /* 11100 */ 24, 3 },
78 { /* 11101 */ 32, 3 },
80 /* 8/9 bit codewords */
81 { /* 11110 */ 40, 4 },
83 /* 9/10/11/12 bit codewords */
89 * Gives size of codeword and actual data (x,y,v,w)
91 static hcb_2_quad hcb4_2[] = {
104 /* 5 bit codewords */
112 /* 7 bit codewords */
113 /* first 5 bits: 11010 */
118 /* first 5 bits: 11011 */
124 /* 7/8 bit codewords */
125 /* first 5 bits: 11100 */
126 { 7, 0, 1, 2, 1 }, { 7, 0, 1, 2, 1 },
134 /* 8 bit codewords */
144 /* 8/9 bit codewords */
145 { 8, 0, 1, 2, 0 }, { 8, 0, 1, 2, 0 },
146 { 8, 0, 2, 0, 1 }, { 8, 0, 2, 0, 1 },
147 { 8, 1, 0, 0, 2 }, { 8, 1, 0, 0, 2 },
148 { 8, 0, 0, 2, 1 }, { 8, 0, 0, 2, 1 },
149 { 8, 1, 0, 2, 0 }, { 8, 1, 0, 2, 0 },
150 { 8, 2, 0, 0, 0 }, { 8, 2, 0, 0, 0 },
151 { 8, 0, 0, 0, 2 }, { 8, 0, 0, 0, 2 },
155 /* 9/10/11 bit codewords */
156 /* 9 bit codewords repeated 2^3 = 8 times */
157 { 9, 1, 2, 2, 1 }, { 9, 1, 2, 2, 1 }, { 9, 1, 2, 2, 1 }, { 9, 1, 2, 2, 1 },
158 { 9, 1, 2, 2, 1 }, { 9, 1, 2, 2, 1 }, { 9, 1, 2, 2, 1 }, { 9, 1, 2, 2, 1 },
159 { 9, 2, 2, 1, 1 }, { 9, 2, 2, 1, 1 }, { 9, 2, 2, 1, 1 }, { 9, 2, 2, 1, 1 },
160 { 9, 2, 2, 1, 1 }, { 9, 2, 2, 1, 1 }, { 9, 2, 2, 1, 1 }, { 9, 2, 2, 1, 1 },
161 { 9, 2, 1, 2, 1 }, { 9, 2, 1, 2, 1 }, { 9, 2, 1, 2, 1 }, { 9, 2, 1, 2, 1 },
162 { 9, 2, 1, 2, 1 }, { 9, 2, 1, 2, 1 }, { 9, 2, 1, 2, 1 }, { 9, 2, 1, 2, 1 },
163 { 9, 1, 1, 2, 2 }, { 9, 1, 1, 2, 2 }, { 9, 1, 1, 2, 2 }, { 9, 1, 1, 2, 2 },
164 { 9, 1, 1, 2, 2 }, { 9, 1, 1, 2, 2 }, { 9, 1, 1, 2, 2 }, { 9, 1, 1, 2, 2 },
165 { 9, 1, 2, 1, 2 }, { 9, 1, 2, 1, 2 }, { 9, 1, 2, 1, 2 }, { 9, 1, 2, 1, 2 },
166 { 9, 1, 2, 1, 2 }, { 9, 1, 2, 1, 2 }, { 9, 1, 2, 1, 2 }, { 9, 1, 2, 1, 2 },
167 { 9, 2, 1, 1, 2 }, { 9, 2, 1, 1, 2 }, { 9, 2, 1, 1, 2 }, { 9, 2, 1, 1, 2 },
168 { 9, 2, 1, 1, 2 }, { 9, 2, 1, 1, 2 }, { 9, 2, 1, 1, 2 }, { 9, 2, 1, 1, 2 },
169 /* 10 bit codewords repeated 2^2 = 4 times */
170 { 10, 1, 2, 2, 0 }, { 10, 1, 2, 2, 0 }, { 10, 1, 2, 2, 0 }, { 10, 1, 2, 2, 0 },
171 { 10, 2, 2, 1, 0 }, { 10, 2, 2, 1, 0 }, { 10, 2, 2, 1, 0 }, { 10, 2, 2, 1, 0 },
172 { 10, 2, 1, 2, 0 }, { 10, 2, 1, 2, 0 }, { 10, 2, 1, 2, 0 }, { 10, 2, 1, 2, 0 },
173 { 10, 0, 2, 2, 1 }, { 10, 0, 2, 2, 1 }, { 10, 0, 2, 2, 1 }, { 10, 0, 2, 2, 1 },
174 { 10, 0, 1, 2, 2 }, { 10, 0, 1, 2, 2 }, { 10, 0, 1, 2, 2 }, { 10, 0, 1, 2, 2 },
175 { 10, 2, 2, 0, 1 }, { 10, 2, 2, 0, 1 }, { 10, 2, 2, 0, 1 }, { 10, 2, 2, 0, 1 },
176 { 10, 0, 2, 1, 2 }, { 10, 0, 2, 1, 2 }, { 10, 0, 2, 1, 2 }, { 10, 0, 2, 1, 2 },
177 { 10, 2, 0, 2, 1 }, { 10, 2, 0, 2, 1 }, { 10, 2, 0, 2, 1 }, { 10, 2, 0, 2, 1 },
178 { 10, 1, 0, 2, 2 }, { 10, 1, 0, 2, 2 }, { 10, 1, 0, 2, 2 }, { 10, 1, 0, 2, 2 },
179 { 10, 2, 2, 2, 1 }, { 10, 2, 2, 2, 1 }, { 10, 2, 2, 2, 1 }, { 10, 2, 2, 2, 1 },
180 { 10, 1, 2, 0, 2 }, { 10, 1, 2, 0, 2 }, { 10, 1, 2, 0, 2 }, { 10, 1, 2, 0, 2 },
181 { 10, 2, 0, 1, 2 }, { 10, 2, 0, 1, 2 }, { 10, 2, 0, 1, 2 }, { 10, 2, 0, 1, 2 },
182 { 10, 2, 1, 0, 2 }, { 10, 2, 1, 0, 2 }, { 10, 2, 1, 0, 2 }, { 10, 2, 1, 0, 2 },
183 { 10, 1, 2, 2, 2 }, { 10, 1, 2, 2, 2 }, { 10, 1, 2, 2, 2 }, { 10, 1, 2, 2, 2 },
184 /* 11 bit codewords repeated 2^1 = 2 times */
185 { 11, 2, 1, 2, 2 }, { 11, 2, 1, 2, 2 },
186 { 11, 2, 2, 1, 2 }, { 11, 2, 2, 1, 2 },
187 { 11, 0, 2, 2, 0 }, { 11, 0, 2, 2, 0 },
188 { 11, 2, 2, 0, 0 }, { 11, 2, 2, 0, 0 },
189 { 11, 0, 0, 2, 2 }, { 11, 0, 0, 2, 2 },
190 { 11, 2, 0, 2, 0 }, { 11, 2, 0, 2, 0 },
191 { 11, 0, 2, 0, 2 }, { 11, 0, 2, 0, 2 },
192 { 11, 2, 0, 0, 2 }, { 11, 2, 0, 0, 2 },
193 { 11, 2, 2, 2, 2 }, { 11, 2, 2, 2, 2 },
194 { 11, 0, 2, 2, 2 }, { 11, 0, 2, 2, 2 },
195 { 11, 2, 2, 2, 0 }, { 11, 2, 2, 2, 0 },
196 /* 12 bit codewords */