diff options
author | Sean Bartell <wingedtachikoma@gmail.com> | 2011-06-25 21:32:25 -0400 |
---|---|---|
committer | Nils Wallménius <nils@rockbox.org> | 2012-04-25 22:13:20 +0200 |
commit | f40bfc9267b13b54e6379dfe7539447662879d24 (patch) | |
tree | 9b20069d5e62809ff434061ad730096836f916f2 /lib/rbcodec/codecs/libfaad/codebook/hcb_4.h | |
parent | a0009907de7a0107d49040d8a180f140e2eff299 (diff) | |
download | rockbox-f40bfc9267b13b54e6379dfe7539447662879d24.tar.gz rockbox-f40bfc9267b13b54e6379dfe7539447662879d24.zip |
Add codecs to librbcodec.
Change-Id: Id7f4717d51ed02d67cb9f9cb3c0ada4a81843f97
Reviewed-on: http://gerrit.rockbox.org/137
Reviewed-by: Nils Wallménius <nils@rockbox.org>
Tested-by: Nils Wallménius <nils@rockbox.org>
Diffstat (limited to 'lib/rbcodec/codecs/libfaad/codebook/hcb_4.h')
-rw-r--r-- | lib/rbcodec/codecs/libfaad/codebook/hcb_4.h | 196 |
1 files changed, 196 insertions, 0 deletions
diff --git a/lib/rbcodec/codecs/libfaad/codebook/hcb_4.h b/lib/rbcodec/codecs/libfaad/codebook/hcb_4.h new file mode 100644 index 0000000000..67397e1fb0 --- /dev/null +++ b/lib/rbcodec/codecs/libfaad/codebook/hcb_4.h | |||
@@ -0,0 +1,196 @@ | |||
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. | ||
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 | ** Commercial non-GPL licensing of this software is possible. | ||
23 | ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. | ||
24 | ** | ||
25 | ** $Id$ | ||
26 | **/ | ||
27 | |||
28 | /* 2-step huffman table HCB_4 */ | ||
29 | |||
30 | |||
31 | /* 1st step: 5 bits | ||
32 | * 2^5 = 32 entries | ||
33 | * | ||
34 | * Used to find offset into 2nd step table and number of extra bits to get | ||
35 | */ | ||
36 | static hcb hcb4_1[] ICONST_ATTR_FAAD_LARGE_IRAM = { | ||
37 | /* 4 bit codewords */ | ||
38 | { /* 00000 */ 0, 0 }, | ||
39 | { /* */ 0, 0 }, | ||
40 | { /* 00010 */ 1, 0 }, | ||
41 | { /* */ 1, 0 }, | ||
42 | { /* 00100 */ 2, 0 }, | ||
43 | { /* */ 2, 0 }, | ||
44 | { /* 00110 */ 3, 0 }, | ||
45 | { /* */ 3, 0 }, | ||
46 | { /* 01000 */ 4, 0 }, | ||
47 | { /* */ 4, 0 }, | ||
48 | { /* 01010 */ 5, 0 }, | ||
49 | { /* */ 5, 0 }, | ||
50 | { /* 01100 */ 6, 0 }, | ||
51 | { /* */ 6, 0 }, | ||
52 | { /* 01110 */ 7, 0 }, | ||
53 | { /* */ 7, 0 }, | ||
54 | { /* 10000 */ 8, 0 }, | ||
55 | { /* */ 8, 0 }, | ||
56 | { /* 10010 */ 9, 0 }, | ||
57 | { /* */ 9, 0 }, | ||
58 | |||
59 | /* 5 bit codewords */ | ||
60 | { /* 10100 */ 10, 0 }, | ||
61 | { /* 10101 */ 11, 0 }, | ||
62 | { /* 10110 */ 12, 0 }, | ||
63 | { /* 10111 */ 13, 0 }, | ||
64 | { /* 11000 */ 14, 0 }, | ||
65 | { /* 11001 */ 15, 0 }, | ||
66 | |||
67 | /* 7 bit codewords */ | ||
68 | { /* 11010 */ 16, 2 }, | ||
69 | { /* 11011 */ 20, 2 }, | ||
70 | |||
71 | /* 7/8 bit codewords */ | ||
72 | { /* 11100 */ 24, 3 }, | ||
73 | |||
74 | /* 8 bit codewords */ | ||
75 | { /* 11101 */ 32, 3 }, | ||
76 | |||
77 | /* 8/9 bit codewords */ | ||
78 | { /* 11110 */ 40, 4 }, | ||
79 | |||
80 | /* 9/10/11/12 bit codewords */ | ||
81 | { /* 11111 */ 56, 7 } | ||
82 | }; | ||
83 | |||
84 | /* 2nd step table | ||
85 | * | ||
86 | * Gives size of codeword and actual data (x,y,v,w) | ||
87 | */ | ||
88 | static hcb_2_quad hcb4_2[] ICONST_ATTR_FAAD_LARGE_IRAM = { | ||
89 | /* 4 bit codewords */ | ||
90 | { 4, 1, 1, 1, 1 }, | ||
91 | { 4, 0, 1, 1, 1 }, | ||
92 | { 4, 1, 1, 0, 1 }, | ||
93 | { 4, 1, 1, 1, 0 }, | ||
94 | { 4, 1, 0, 1, 1 }, | ||
95 | { 4, 1, 0, 0, 0 }, | ||
96 | { 4, 1, 1, 0, 0 }, | ||
97 | { 4, 0, 0, 0, 0 }, | ||
98 | { 4, 0, 0, 1, 1 }, | ||
99 | { 4, 1, 0, 1, 0 }, | ||
100 | |||
101 | /* 5 bit codewords */ | ||
102 | { 5, 1, 0, 0, 1 }, | ||
103 | { 5, 0, 1, 1, 0 }, | ||
104 | { 5, 0, 0, 0, 1 }, | ||
105 | { 5, 0, 1, 0, 1 }, | ||
106 | { 5, 0, 0, 1, 0 }, | ||
107 | { 5, 0, 1, 0, 0 }, | ||
108 | |||
109 | /* 7 bit codewords */ | ||
110 | /* first 5 bits: 11010 */ | ||
111 | { 7, 2, 1, 1, 1 }, | ||
112 | { 7, 1, 1, 2, 1 }, | ||
113 | { 7, 1, 2, 1, 1 }, | ||
114 | { 7, 1, 1, 1, 2 }, | ||
115 | /* first 5 bits: 11011 */ | ||
116 | { 7, 2, 1, 1, 0 }, | ||
117 | { 7, 2, 1, 0, 1 }, | ||
118 | { 7, 1, 2, 1, 0 }, | ||
119 | { 7, 2, 0, 1, 1 }, | ||
120 | |||
121 | /* 7/8 bit codewords */ | ||
122 | /* first 5 bits: 11100 */ | ||
123 | { 7, 0, 1, 2, 1 }, { 7, 0, 1, 2, 1 }, | ||
124 | { 8, 0, 1, 1, 2 }, | ||
125 | { 8, 1, 1, 2, 0 }, | ||
126 | { 8, 0, 2, 1, 1 }, | ||
127 | { 8, 1, 0, 1, 2 }, | ||
128 | { 8, 1, 2, 0, 1 }, | ||
129 | { 8, 1, 1, 0, 2 }, | ||
130 | |||
131 | /* 8 bit codewords */ | ||
132 | { 8, 1, 0, 2, 1 }, | ||
133 | { 8, 2, 1, 0, 0 }, | ||
134 | { 8, 2, 0, 1, 0 }, | ||
135 | { 8, 1, 2, 0, 0 }, | ||
136 | { 8, 2, 0, 0, 1 }, | ||
137 | { 8, 0, 1, 0, 2 }, | ||
138 | { 8, 0, 2, 1, 0 }, | ||
139 | { 8, 0, 0, 1, 2 }, | ||
140 | |||
141 | /* 8/9 bit codewords */ | ||
142 | { 8, 0, 1, 2, 0 }, { 8, 0, 1, 2, 0 }, | ||
143 | { 8, 0, 2, 0, 1 }, { 8, 0, 2, 0, 1 }, | ||
144 | { 8, 1, 0, 0, 2 }, { 8, 1, 0, 0, 2 }, | ||
145 | { 8, 0, 0, 2, 1 }, { 8, 0, 0, 2, 1 }, | ||
146 | { 8, 1, 0, 2, 0 }, { 8, 1, 0, 2, 0 }, | ||
147 | { 8, 2, 0, 0, 0 }, { 8, 2, 0, 0, 0 }, | ||
148 | { 8, 0, 0, 0, 2 }, { 8, 0, 0, 0, 2 }, | ||
149 | { 9, 0, 2, 0, 0 }, | ||
150 | { 9, 0, 0, 2, 0 }, | ||
151 | |||
152 | /* 9/10/11 bit codewords */ | ||
153 | /* 9 bit codewords repeated 2^3 = 8 times */ | ||
154 | { 9, 1, 2, 2, 1 }, { 9, 1, 2, 2, 1 }, { 9, 1, 2, 2, 1 }, { 9, 1, 2, 2, 1 }, | ||
155 | { 9, 1, 2, 2, 1 }, { 9, 1, 2, 2, 1 }, { 9, 1, 2, 2, 1 }, { 9, 1, 2, 2, 1 }, | ||
156 | { 9, 2, 2, 1, 1 }, { 9, 2, 2, 1, 1 }, { 9, 2, 2, 1, 1 }, { 9, 2, 2, 1, 1 }, | ||
157 | { 9, 2, 2, 1, 1 }, { 9, 2, 2, 1, 1 }, { 9, 2, 2, 1, 1 }, { 9, 2, 2, 1, 1 }, | ||
158 | { 9, 2, 1, 2, 1 }, { 9, 2, 1, 2, 1 }, { 9, 2, 1, 2, 1 }, { 9, 2, 1, 2, 1 }, | ||
159 | { 9, 2, 1, 2, 1 }, { 9, 2, 1, 2, 1 }, { 9, 2, 1, 2, 1 }, { 9, 2, 1, 2, 1 }, | ||
160 | { 9, 1, 1, 2, 2 }, { 9, 1, 1, 2, 2 }, { 9, 1, 1, 2, 2 }, { 9, 1, 1, 2, 2 }, | ||
161 | { 9, 1, 1, 2, 2 }, { 9, 1, 1, 2, 2 }, { 9, 1, 1, 2, 2 }, { 9, 1, 1, 2, 2 }, | ||
162 | { 9, 1, 2, 1, 2 }, { 9, 1, 2, 1, 2 }, { 9, 1, 2, 1, 2 }, { 9, 1, 2, 1, 2 }, | ||
163 | { 9, 1, 2, 1, 2 }, { 9, 1, 2, 1, 2 }, { 9, 1, 2, 1, 2 }, { 9, 1, 2, 1, 2 }, | ||
164 | { 9, 2, 1, 1, 2 }, { 9, 2, 1, 1, 2 }, { 9, 2, 1, 1, 2 }, { 9, 2, 1, 1, 2 }, | ||
165 | { 9, 2, 1, 1, 2 }, { 9, 2, 1, 1, 2 }, { 9, 2, 1, 1, 2 }, { 9, 2, 1, 1, 2 }, | ||
166 | /* 10 bit codewords repeated 2^2 = 4 times */ | ||
167 | { 10, 1, 2, 2, 0 }, { 10, 1, 2, 2, 0 }, { 10, 1, 2, 2, 0 }, { 10, 1, 2, 2, 0 }, | ||
168 | { 10, 2, 2, 1, 0 }, { 10, 2, 2, 1, 0 }, { 10, 2, 2, 1, 0 }, { 10, 2, 2, 1, 0 }, | ||
169 | { 10, 2, 1, 2, 0 }, { 10, 2, 1, 2, 0 }, { 10, 2, 1, 2, 0 }, { 10, 2, 1, 2, 0 }, | ||
170 | { 10, 0, 2, 2, 1 }, { 10, 0, 2, 2, 1 }, { 10, 0, 2, 2, 1 }, { 10, 0, 2, 2, 1 }, | ||
171 | { 10, 0, 1, 2, 2 }, { 10, 0, 1, 2, 2 }, { 10, 0, 1, 2, 2 }, { 10, 0, 1, 2, 2 }, | ||
172 | { 10, 2, 2, 0, 1 }, { 10, 2, 2, 0, 1 }, { 10, 2, 2, 0, 1 }, { 10, 2, 2, 0, 1 }, | ||
173 | { 10, 0, 2, 1, 2 }, { 10, 0, 2, 1, 2 }, { 10, 0, 2, 1, 2 }, { 10, 0, 2, 1, 2 }, | ||
174 | { 10, 2, 0, 2, 1 }, { 10, 2, 0, 2, 1 }, { 10, 2, 0, 2, 1 }, { 10, 2, 0, 2, 1 }, | ||
175 | { 10, 1, 0, 2, 2 }, { 10, 1, 0, 2, 2 }, { 10, 1, 0, 2, 2 }, { 10, 1, 0, 2, 2 }, | ||
176 | { 10, 2, 2, 2, 1 }, { 10, 2, 2, 2, 1 }, { 10, 2, 2, 2, 1 }, { 10, 2, 2, 2, 1 }, | ||
177 | { 10, 1, 2, 0, 2 }, { 10, 1, 2, 0, 2 }, { 10, 1, 2, 0, 2 }, { 10, 1, 2, 0, 2 }, | ||
178 | { 10, 2, 0, 1, 2 }, { 10, 2, 0, 1, 2 }, { 10, 2, 0, 1, 2 }, { 10, 2, 0, 1, 2 }, | ||
179 | { 10, 2, 1, 0, 2 }, { 10, 2, 1, 0, 2 }, { 10, 2, 1, 0, 2 }, { 10, 2, 1, 0, 2 }, | ||
180 | { 10, 1, 2, 2, 2 }, { 10, 1, 2, 2, 2 }, { 10, 1, 2, 2, 2 }, { 10, 1, 2, 2, 2 }, | ||
181 | /* 11 bit codewords repeated 2^1 = 2 times */ | ||
182 | { 11, 2, 1, 2, 2 }, { 11, 2, 1, 2, 2 }, | ||
183 | { 11, 2, 2, 1, 2 }, { 11, 2, 2, 1, 2 }, | ||
184 | { 11, 0, 2, 2, 0 }, { 11, 0, 2, 2, 0 }, | ||
185 | { 11, 2, 2, 0, 0 }, { 11, 2, 2, 0, 0 }, | ||
186 | { 11, 0, 0, 2, 2 }, { 11, 0, 0, 2, 2 }, | ||
187 | { 11, 2, 0, 2, 0 }, { 11, 2, 0, 2, 0 }, | ||
188 | { 11, 0, 2, 0, 2 }, { 11, 0, 2, 0, 2 }, | ||
189 | { 11, 2, 0, 0, 2 }, { 11, 2, 0, 0, 2 }, | ||
190 | { 11, 2, 2, 2, 2 }, { 11, 2, 2, 2, 2 }, | ||
191 | { 11, 0, 2, 2, 2 }, { 11, 0, 2, 2, 2 }, | ||
192 | { 11, 2, 2, 2, 0 }, { 11, 2, 2, 2, 0 }, | ||
193 | /* 12 bit codewords */ | ||
194 | { 12, 2, 2, 0, 2 }, | ||
195 | { 12, 2, 0, 2, 2 }, | ||
196 | }; | ||