af.c: Minor simplification of af_init
[mplayer/glamo.git] / libfaad2 / codebook / hcb_2.h
blobba56a0cf22c7e58fb243a45b2df4943474e636de
1 /*
2 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
3 ** Copyright (C) 2003 M. Bakker, Ahead Software 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.
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
20 ** forbidden.
22 ** Commercial non-GPL licensing of this software is possible.
23 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
25 ** $Id: hcb_2.h,v 1.3 2003/09/09 18:12:01 menno Exp $
26 **/
28 /* 2-step huffman table HCB_2 */
31 /* 1st step: 5 bits
32 * 2^5 = 32 entries
34 * Used to find offset into 2nd step table and number of extra bits to get
36 static hcb hcb2_1[] = {
37 { /* 00000 */ 0, 0 },
38 { /* */ 0, 0 },
39 { /* */ 0, 0 },
40 { /* */ 0, 0 },
41 { /* 00100 */ 1, 0 },
42 { /* */ 1, 0 },
43 { /* 00110 */ 2, 0 },
44 { /* 00111 */ 3, 0 },
45 { /* 01000 */ 4, 0 },
46 { /* 01001 */ 5, 0 },
47 { /* 01010 */ 6, 0 },
48 { /* 01011 */ 7, 0 },
49 { /* 01100 */ 8, 0 },
51 /* 6 bit codewords */
52 { /* 01101 */ 9, 1 },
53 { /* 01110 */ 11, 1 },
54 { /* 01111 */ 13, 1 },
55 { /* 10000 */ 15, 1 },
56 { /* 10001 */ 17, 1 },
57 { /* 10010 */ 19, 1 },
58 { /* 10011 */ 21, 1 },
59 { /* 10100 */ 23, 1 },
60 { /* 10101 */ 25, 1 },
61 { /* 10110 */ 27, 1 },
62 { /* 10111 */ 29, 1 },
63 { /* 11000 */ 31, 1 },
65 /* 7 bit codewords */
66 { /* 11001 */ 33, 2 },
67 { /* 11010 */ 37, 2 },
68 { /* 11011 */ 41, 2 },
70 /* 7/8 bit codewords */
71 { /* 11100 */ 45, 3 },
73 /* 8 bit codewords */
74 { /* 11101 */ 53, 3 },
75 { /* 11110 */ 61, 3 },
77 /* 8/9 bit codewords */
78 { /* 11111 */ 69, 4 }
81 /* 2nd step table
83 * Gives size of codeword and actual data (x,y,v,w)
85 static hcb_2_quad hcb2_2[] = {
86 /* 3 bit codeword */
87 { 3, 0, 0, 0, 0 },
89 /* 4 bit codeword */
90 { 4, 1, 0, 0, 0 },
92 /* 5 bit codewords */
93 { 5, -1, 0, 0, 0 },
94 { 5, 0, 0, 0, 1 },
95 { 5, 0, 0, -1, 0 },
96 { 5, 0, 0, 0, -1 },
97 { 5, 0, -1, 0, 0 },
98 { 5, 0, 0, 1, 0 },
99 { 5, 0, 1, 0, 0 },
101 /* 6 bit codewords */
102 { 6, 0, -1, 1, 0 },
103 { 6, -1, 1, 0, 0 },
104 { 6, 0, 1, -1, 0 },
105 { 6, 0, 0, 1, -1 },
106 { 6, 0, 1, 0, -1 },
107 { 6, 0, 0, -1, 1 },
108 { 6, -1, 0, 0, -1 },
109 { 6, 1, -1, 0, 0 },
110 { 6, 1, 0, -1, 0 },
111 { 6, -1, -1, 0, 0 },
112 { 6, 0, 0, -1, -1 },
113 { 6, 1, 0, 1, 0 },
114 { 6, 1, 0, 0, 1 },
115 { 6, 0, -1, 0, 1 },
116 { 6, -1, 0, 1, 0 },
117 { 6, 0, 1, 0, 1 },
118 { 6, 0, -1, -1, 0 },
119 { 6, -1, 0, 0, 1 },
120 { 6, 0, -1, 0, -1 },
121 { 6, -1, 0, -1, 0 },
122 { 6, 1, 1, 0, 0 },
123 { 6, 0, 1, 1, 0 },
124 { 6, 0, 0, 1, 1 },
125 { 6, 1, 0, 0, -1 },
127 /* 7 bit codewords */
128 { 7, 0, 1, -1, 1 },
129 { 7, 1, 0, -1, 1 },
130 { 7, -1, 1, -1, 0 },
131 { 7, 0, -1, 1, -1 },
132 { 7, 1, -1, 1, 0 },
133 { 7, 1, 1, 0, -1 },
134 { 7, 1, 0, 1, 1 },
135 { 7, -1, 1, 1, 0 },
136 { 7, 0, -1, -1, 1 },
137 { 7, 1, 1, 1, 0 },
138 { 7, -1, 0, 1, -1 },
139 { 7, -1, -1, -1, 0 },
141 /* 7/8 bit codewords */
142 { 7, -1, 0, -1, 1 }, { 7, -1, 0, -1, 1 },
143 { 7, 1, -1, -1, 0 }, { 7, 1, -1, -1, 0 },
144 { 7, 1, 1, -1, 0 }, { 7, 1, 1, -1, 0 },
145 { 8, 1, -1, 0, 1 },
146 { 8, -1, 1, 0, -1 },
148 /* 8 bit codewords */
149 { 8, -1, -1, 1, 0 },
150 { 8, -1, 0, 1, 1 },
151 { 8, -1, -1, 0, 1 },
152 { 8, -1, -1, 0, -1 },
153 { 8, 0, -1, -1, -1 },
154 { 8, 1, 0, 1, -1 },
155 { 8, 1, 0, -1, -1 },
156 { 8, 0, 1, -1, -1 },
157 { 8, 0, 1, 1, 1 },
158 { 8, -1, 1, 0, 1 },
159 { 8, -1, 0, -1, -1 },
160 { 8, 0, 1, 1, -1 },
161 { 8, 1, -1, 0, -1 },
162 { 8, 0, -1, 1, 1 },
163 { 8, 1, 1, 0, 1 },
164 { 8, 1, -1, 1, -1 },
166 /* 8/9 bit codewords */
167 { 8, -1, 1, -1, 1 }, { 8, -1, 1, -1, 1 },
168 { 9, 1, -1, -1, 1 },
169 { 9, -1, -1, -1, -1 },
170 { 9, -1, 1, 1, -1 },
171 { 9, -1, 1, 1, 1 },
172 { 9, 1, 1, 1, 1 },
173 { 9, -1, -1, 1, -1 },
174 { 9, 1, -1, 1, 1 },
175 { 9, -1, 1, -1, -1 },
176 { 9, -1, -1, 1, 1 },
177 { 9, 1, 1, -1, -1 },
178 { 9, 1, -1, -1, -1 },
179 { 9, -1, -1, -1, 1 },
180 { 9, 1, 1, -1, 1 },
181 { 9, 1, 1, 1, -1 }