summaryrefslogtreecommitdiff
path: root/lib/rbcodec/codecs/libfaad/codebook
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rbcodec/codecs/libfaad/codebook')
-rw-r--r--lib/rbcodec/codecs/libfaad/codebook/hcb.h142
-rw-r--r--lib/rbcodec/codecs/libfaad/codebook/hcb_1.h183
-rw-r--r--lib/rbcodec/codecs/libfaad/codebook/hcb_10.h309
-rw-r--r--lib/rbcodec/codecs/libfaad/codebook/hcb_11.h412
-rw-r--r--lib/rbcodec/codecs/libfaad/codebook/hcb_2.h182
-rw-r--r--lib/rbcodec/codecs/libfaad/codebook/hcb_3.h193
-rw-r--r--lib/rbcodec/codecs/libfaad/codebook/hcb_4.h196
-rw-r--r--lib/rbcodec/codecs/libfaad/codebook/hcb_5.h193
-rw-r--r--lib/rbcodec/codecs/libfaad/codebook/hcb_6.h179
-rw-r--r--lib/rbcodec/codecs/libfaad/codebook/hcb_7.h159
-rw-r--r--lib/rbcodec/codecs/libfaad/codebook/hcb_8.h170
-rw-r--r--lib/rbcodec/codecs/libfaad/codebook/hcb_9.h369
-rw-r--r--lib/rbcodec/codecs/libfaad/codebook/hcb_sf.h273
13 files changed, 2960 insertions, 0 deletions
diff --git a/lib/rbcodec/codecs/libfaad/codebook/hcb.h b/lib/rbcodec/codecs/libfaad/codebook/hcb.h
new file mode 100644
index 0000000000..eaefdbf437
--- /dev/null
+++ b/lib/rbcodec/codecs/libfaad/codebook/hcb.h
@@ -0,0 +1,142 @@
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#ifndef __HCB_H__
29#define __HCB_H__
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/*
36 * Optimal huffman decoding for AAC taken from:
37 * "SELECTING AN OPTIMAL HUFFMAN DECODER FOR AAC" by
38 * VLADIMIR Z. MESAROVIC , RAGHUNATH RAO, MIROSLAV V. DOKIC, and SACHIN DEO
39 * AES paper 5436
40 *
41 * 2 methods are used for huffman decoding:
42 * - binary search
43 * - 2-step table lookup
44 *
45 * The choice of the "optimal" method is based on the fact that if the
46 * memory size for the Two-step is exorbitantly high then the decision
47 * is Binary search for that codebook. However, for marginally more memory
48 * size, if Twostep outperforms even the best case of Binary then the
49 * decision is Two-step for that codebook.
50 *
51 * The following methods are used for the different tables.
52 * codebook "optimal" method
53 * HCB_1 2-Step
54 * HCB_2 2-Step
55 * HCB_3 Binary
56 * HCB_4 2-Step
57 * HCB_5 Binary
58 * HCB_6 2-Step
59 * HCB_7 Binary
60 * HCB_8 2-Step
61 * HCB_9 Binary
62 * HCB_10 2-Step
63 * HCB_11 2-Step
64 * HCB_SF Binary
65 *
66 */
67
68
69#define ZERO_HCB 0
70#define FIRST_PAIR_HCB 5
71#define ESC_HCB 11
72#define QUAD_LEN 4
73#define PAIR_LEN 2
74#define NOISE_HCB 13
75#define INTENSITY_HCB2 14
76#define INTENSITY_HCB 15
77
78/* 1st step table */
79typedef struct
80{
81 uint8_t offset;
82 uint8_t extra_bits;
83} hcb;
84
85/* 2nd step table with quadruple data */
86typedef struct
87{
88 uint8_t bits;
89 int8_t x;
90 int8_t y;
91} hcb_2_pair;
92
93typedef struct
94{
95 uint8_t bits;
96 int8_t x;
97 int8_t y;
98 int8_t v;
99 int8_t w;
100} hcb_2_quad;
101
102/* binary search table */
103typedef struct
104{
105 uint8_t is_leaf;
106 int8_t data[4];
107} hcb_bin_quad;
108
109typedef struct
110{
111 uint8_t is_leaf;
112 int8_t data[2];
113} hcb_bin_pair;
114
115hcb *hcb_table[];
116hcb_2_quad *hcb_2_quad_table[];
117hcb_2_pair *hcb_2_pair_table[];
118hcb_bin_pair *hcb_bin_table[];
119uint8_t hcbN[];
120uint8_t unsigned_cb[];
121int hcb_2_quad_table_size[];
122int hcb_2_pair_table_size[];
123int hcb_bin_table_size[];
124
125#include "codebook/hcb_1.h"
126#include "codebook/hcb_2.h"
127#include "codebook/hcb_3.h"
128#include "codebook/hcb_4.h"
129#include "codebook/hcb_5.h"
130#include "codebook/hcb_6.h"
131#include "codebook/hcb_7.h"
132#include "codebook/hcb_8.h"
133#include "codebook/hcb_9.h"
134#include "codebook/hcb_10.h"
135#include "codebook/hcb_11.h"
136#include "codebook/hcb_sf.h"
137
138
139#ifdef __cplusplus
140}
141#endif
142#endif
diff --git a/lib/rbcodec/codecs/libfaad/codebook/hcb_1.h b/lib/rbcodec/codecs/libfaad/codebook/hcb_1.h
new file mode 100644
index 0000000000..88c04b6012
--- /dev/null
+++ b/lib/rbcodec/codecs/libfaad/codebook/hcb_1.h
@@ -0,0 +1,183 @@
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_1 */
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 */
36static hcb hcb1_1[] ICONST_ATTR_FAAD_LARGE_IRAM = {
37 { /* 00000 */ 0, 0 },
38 { /* */ 0, 0 },
39 { /* */ 0, 0 },
40 { /* */ 0, 0 },
41 { /* */ 0, 0 },
42 { /* */ 0, 0 },
43 { /* */ 0, 0 },
44 { /* */ 0, 0 },
45 { /* */ 0, 0 },
46 { /* */ 0, 0 },
47 { /* */ 0, 0 },
48 { /* */ 0, 0 },
49 { /* */ 0, 0 },
50 { /* */ 0, 0 },
51 { /* */ 0, 0 },
52 { /* */ 0, 0 },
53 { /* 10000 */ 1, 0 },
54 { /* 10001 */ 2, 0 },
55 { /* 10010 */ 3, 0 },
56 { /* 10011 */ 4, 0 },
57 { /* 10100 */ 5, 0 },
58 { /* 10101 */ 6, 0 },
59 { /* 10110 */ 7, 0 },
60 { /* 10111 */ 8, 0 },
61
62 /* 7 bit codewords */
63 { /* 11000 */ 9, 2 },
64 { /* 11001 */ 13, 2 },
65 { /* 11010 */ 17, 2 },
66 { /* 11011 */ 21, 2 },
67 { /* 11100 */ 25, 2 },
68 { /* 11101 */ 29, 2 },
69
70 /* 9 bit codewords */
71 { /* 11110 */ 33, 4 },
72
73 /* 9/10/11 bit codewords */
74 { /* 11111 */ 49, 6 }
75};
76
77/* 2nd step table
78 *
79 * Gives size of codeword and actual data (x,y,v,w)
80 */
81static hcb_2_quad hcb1_2[] ICONST_ATTR_FAAD_LARGE_IRAM = {
82 /* 1 bit codeword */
83 { 1, 0, 0, 0, 0 },
84
85 /* 5 bit codewords */
86 { 5, 1, 0, 0, 0 },
87 { 5, -1, 0, 0, 0 },
88 { 5, 0, 0, 0, -1 },
89 { 5, 0, 1, 0, 0 },
90 { 5, 0, 0, 0, 1 },
91 { 5, 0, 0, -1, 0 },
92 { 5, 0, 0, 1, 0 },
93 { 5, 0, -1, 0, 0 },
94
95 /* 7 bit codewords */
96 /* first 5 bits: 11000 */
97 { 7, 1, -1, 0, 0 },
98 { 7, -1, 1, 0, 0 },
99 { 7, 0, 0, -1, 1 },
100 { 7, 0, 1, -1, 0 },
101 /* first 5 bits: 11001 */
102 { 7, 0, -1, 1, 0 },
103 { 7, 0, 0, 1, -1 },
104 { 7, 1, 1, 0, 0 },
105 { 7, 0, 0, -1, -1 },
106 /* first 5 bits: 11010 */
107 { 7, -1, -1, 0, 0 },
108 { 7, 0, -1, -1, 0 },
109 { 7, 1, 0, -1, 0 },
110 { 7, 0, 1, 0, -1 },
111 /* first 5 bits: 11011 */
112 { 7, -1, 0, 1, 0 },
113 { 7, 0, 0, 1, 1 },
114 { 7, 1, 0, 1, 0 },
115 { 7, 0, -1, 0, 1 },
116 /* first 5 bits: 11100 */
117 { 7, 0, 1, 1, 0 },
118 { 7, 0, 1, 0, 1 },
119 { 7, -1, 0, -1, 0 },
120 { 7, 1, 0, 0, 1 },
121 /* first 5 bits: 11101 */
122 { 7, -1, 0, 0, -1 },
123 { 7, 1, 0, 0, -1 },
124 { 7, -1, 0, 0, 1 },
125 { 7, 0, -1, 0, -1 },
126
127 /* 9 bit codeword */
128 /* first 5 bits: 11110 */
129 { 9, 1, 1, -1, 0 },
130 { 9, -1, 1, -1, 0 },
131 { 9, 1, -1, 1, 0 },
132 { 9, 0, 1, 1, -1 },
133 { 9, 0, 1, -1, 1 },
134 { 9, 0, -1, 1, 1 },
135 { 9, 0, -1, 1, -1 },
136 { 9, 1, -1, -1, 0 },
137 { 9, 1, 0, -1, 1 },
138 { 9, 0, 1, -1, -1 },
139 { 9, -1, 1, 1, 0 },
140 { 9, -1, 0, 1, -1 },
141 { 9, -1, -1, 1, 0 },
142 { 9, 0, -1, -1, 1 },
143 { 9, 1, -1, 0, 1 },
144 { 9, 1, -1, 0, -1 },
145
146 /* 9/10/11 bit codewords */
147 /* first 5 bits: 11111 */
148 /* 9 bit: reading 11 bits -> 2 too much so 4 entries for each codeword */
149 { 9, -1, 1, 0, -1 }, { 9, -1, 1, 0, -1 }, { 9, -1, 1, 0, -1 }, { 9, -1, 1, 0, -1 },
150 { 9, -1, -1, -1, 0 }, { 9, -1, -1, -1, 0 }, { 9, -1, -1, -1, 0 }, { 9, -1, -1, -1, 0 },
151 { 9, 0, -1, -1, -1 }, { 9, 0, -1, -1, -1 }, { 9, 0, -1, -1, -1 }, { 9, 0, -1, -1, -1 },
152 { 9, 0, 1, 1, 1 }, { 9, 0, 1, 1, 1 }, { 9, 0, 1, 1, 1 }, { 9, 0, 1, 1, 1 },
153 { 9, 1, 0, 1, -1 }, { 9, 1, 0, 1, -1 }, { 9, 1, 0, 1, -1 }, { 9, 1, 0, 1, -1 },
154 { 9, 1, 1, 0, 1 }, { 9, 1, 1, 0, 1 }, { 9, 1, 1, 0, 1 }, { 9, 1, 1, 0, 1 },
155 { 9, -1, 1, 0, 1 }, { 9, -1, 1, 0, 1 }, { 9, -1, 1, 0, 1 }, { 9, -1, 1, 0, 1 },
156 { 9, 1, 1, 1, 0 }, { 9, 1, 1, 1, 0 }, { 9, 1, 1, 1, 0 }, { 9, 1, 1, 1, 0 },
157 /* 10 bit: reading 11 bits -> 1 too much so 2 entries for each codeword */
158 { 10, -1, -1, 0, 1 }, { 10, -1, -1, 0, 1 },
159 { 10, -1, 0, -1, -1 }, { 10, -1, 0, -1, -1 },
160 { 10, 1, 1, 0, -1 }, { 10, 1, 1, 0, -1 },
161 { 10, 1, 0, -1, -1 }, { 10, 1, 0, -1, -1 },
162 { 10, -1, 0, -1, 1 }, { 10, -1, 0, -1, 1 },
163 { 10, -1, -1, 0, -1 }, { 10, -1, -1, 0, -1 },
164 { 10, -1, 0, 1, 1 }, { 10, -1, 0, 1, 1 },
165 { 10, 1, 0, 1, 1 }, { 10, 1, 0, 1, 1 },
166 /* 11 bit */
167 { 11, 1, -1, 1, -1 },
168 { 11, -1, 1, -1, 1 },
169 { 11, -1, 1, 1, -1 },
170 { 11, 1, -1, -1, 1 },
171 { 11, 1, 1, 1, 1 },
172 { 11, -1, -1, 1, 1 },
173 { 11, 1, 1, -1, -1 },
174 { 11, -1, -1, 1, -1 },
175 { 11, -1, -1, -1, -1 },
176 { 11, 1, 1, -1, 1 },
177 { 11, 1, -1, 1, 1 },
178 { 11, -1, 1, 1, 1 },
179 { 11, -1, 1, -1, -1 },
180 { 11, -1, -1, -1, 1 },
181 { 11, 1, -1, -1, -1 },
182 { 11, 1, 1, 1, -1 }
183};
diff --git a/lib/rbcodec/codecs/libfaad/codebook/hcb_10.h b/lib/rbcodec/codecs/libfaad/codebook/hcb_10.h
new file mode 100644
index 0000000000..af48711460
--- /dev/null
+++ b/lib/rbcodec/codecs/libfaad/codebook/hcb_10.h
@@ -0,0 +1,309 @@
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_10 */
29
30
31/* 1st step: 6 bits
32 * 2^6 = 64 entries
33 *
34 * Used to find offset into 2nd step table and number of extra bits to get
35 */
36static hcb hcb10_1[] ICONST_ATTR_FAAD_LARGE_IRAM = {
37 /* 4 bit codewords */
38 { /* 000000 */ 0, 0 },
39 { /* */ 0, 0 },
40 { /* */ 0, 0 },
41 { /* */ 0, 0 },
42 { /* 000100 */ 1, 0 },
43 { /* */ 1, 0 },
44 { /* */ 1, 0 },
45 { /* */ 1, 0 },
46 { /* 001000 */ 2, 0 },
47 { /* */ 2, 0 },
48 { /* */ 2, 0 },
49 { /* */ 2, 0 },
50 /* 5 bit codewords */
51 { /* 001100 */ 3, 0 },
52 { /* */ 3, 0 },
53 { /* 001110 */ 4, 0 },
54 { /* */ 4, 0 },
55 { /* 010000 */ 5, 0 },
56 { /* */ 5, 0 },
57 { /* 010010 */ 6, 0 },
58 { /* */ 6, 0 },
59 { /* 010100 */ 7, 0 },
60 { /* */ 7, 0 },
61 { /* 010110 */ 8, 0 },
62 { /* */ 8, 0 },
63 { /* 011000 */ 9, 0 },
64 { /* */ 9, 0 },
65 { /* 011010 */ 10, 0 },
66 { /* */ 10, 0 },
67 /* 6 bit codewords */
68 { /* 011100 */ 11, 0 },
69 { /* 011101 */ 12, 0 },
70 { /* 011110 */ 13, 0 },
71 { /* 011111 */ 14, 0 },
72 { /* 100000 */ 15, 0 },
73 { /* 100001 */ 16, 0 },
74 { /* 100010 */ 17, 0 },
75 { /* 100011 */ 18, 0 },
76 { /* 100100 */ 19, 0 },
77 { /* 100101 */ 20, 0 },
78 { /* 100110 */ 21, 0 },
79 { /* 100111 */ 22, 0 },
80 { /* 101000 */ 23, 0 },
81 { /* 101001 */ 24, 0 },
82 /* 7 bit codewords */
83 { /* 101010 */ 25, 1 },
84 { /* 101011 */ 27, 1 },
85 { /* 101100 */ 29, 1 },
86 { /* 101101 */ 31, 1 },
87 { /* 101110 */ 33, 1 },
88 { /* 101111 */ 35, 1 },
89 { /* 110000 */ 37, 1 },
90 { /* 110001 */ 39, 1 },
91 /* 7/8 bit codewords */
92 { /* 110010 */ 41, 2 },
93 /* 8 bit codewords */
94 { /* 110011 */ 45, 2 },
95 { /* 110100 */ 49, 2 },
96 { /* 110101 */ 53, 2 },
97 { /* 110110 */ 57, 2 },
98 { /* 110111 */ 61, 2 },
99 /* 8/9 bit codewords */
100 { /* 111000 */ 65, 3 },
101 /* 9 bit codewords */
102 { /* 111001 */ 73, 3 },
103 { /* 111010 */ 81, 3 },
104 { /* 111011 */ 89, 3 },
105 /* 9/10 bit codewords */
106 { /* 111100 */ 97, 4 },
107 /* 10 bit codewords */
108 { /* 111101 */ 113, 4 },
109 { /* 111110 */ 129, 4 },
110 /* 10/11/12 bit codewords */
111 { /* 111111 */ 145, 6 }
112};
113
114/* 2nd step table
115 *
116 * Gives size of codeword and actual data (x,y,v,w)
117 */
118static hcb_2_pair hcb10_2[] ICONST_ATTR_FAAD_LARGE_IRAM = {
119 /* 4 bit codewords */
120 { 4, 1, 1 },
121 { 4, 1, 2 },
122 { 4, 2, 1 },
123
124 /* 5 bit codewords */
125 { 5, 2, 2 },
126 { 5, 1, 0 },
127 { 5, 0, 1 },
128 { 5, 1, 3 },
129 { 5, 3, 2 },
130 { 5, 3, 1 },
131 { 5, 2, 3 },
132 { 5, 3, 3 },
133
134 /* 6 bit codewords */
135 { 6, 2, 0 },
136 { 6, 0, 2 },
137 { 6, 2, 4 },
138 { 6, 4, 2 },
139 { 6, 1, 4 },
140 { 6, 4, 1 },
141 { 6, 0, 0 },
142 { 6, 4, 3 },
143 { 6, 3, 4 },
144 { 6, 3, 0 },
145 { 6, 0, 3 },
146 { 6, 4, 4 },
147 { 6, 2, 5 },
148 { 6, 5, 2 },
149
150 /* 7 bit codewords */
151 { 7, 1, 5 },
152 { 7, 5, 1 },
153 { 7, 5, 3 },
154 { 7, 3, 5 },
155 { 7, 5, 4 },
156 { 7, 4, 5 },
157 { 7, 6, 2 },
158 { 7, 2, 6 },
159 { 7, 6, 3 },
160 { 7, 4, 0 },
161 { 7, 6, 1 },
162 { 7, 0, 4 },
163 { 7, 1, 6 },
164 { 7, 3, 6 },
165 { 7, 5, 5 },
166 { 7, 6, 4 },
167
168 /* 7/8 bit codewords */
169 { 7, 4, 6 }, { 7, 4, 6 },
170 { 8, 6, 5 },
171 { 8, 7, 2 },
172
173 /* 8 bit codewords */
174 { 8, 3, 7 },
175 { 8, 2, 7 },
176 { 8, 5, 6 },
177 { 8, 8, 2 },
178 { 8, 7, 3 },
179 { 8, 5, 0 },
180 { 8, 7, 1 },
181 { 8, 0, 5 },
182 { 8, 8, 1 },
183 { 8, 1, 7 },
184 { 8, 8, 3 },
185 { 8, 7, 4 },
186 { 8, 4, 7 },
187 { 8, 2, 8 },
188 { 8, 6, 6 },
189 { 8, 7, 5 },
190 { 8, 1, 8 },
191 { 8, 3, 8 },
192 { 8, 8, 4 },
193 { 8, 4, 8 },
194
195 /* 8/9 bit codewords */
196 { 8, 5, 7 }, { 8, 5, 7 },
197 { 8, 8, 5 }, { 8, 8, 5 },
198 { 8, 5, 8 }, { 8, 5, 8 },
199 { 9, 7, 6 },
200 { 9, 6, 7 },
201
202 /* 9 bit codewords */
203 { 9, 9, 2 },
204 { 9, 6, 0 },
205 { 9, 6, 8 },
206 { 9, 9, 3 },
207 { 9, 3, 9 },
208 { 9, 9, 1 },
209 { 9, 2, 9 },
210 { 9, 0, 6 },
211 { 9, 8, 6 },
212 { 9, 9, 4 },
213 { 9, 4, 9 },
214 { 9, 10, 2 },
215 { 9, 1, 9 },
216 { 9, 7, 7 },
217 { 9, 8, 7 },
218 { 9, 9, 5 },
219 { 9, 7, 8 },
220 { 9, 10, 3 },
221 { 9, 5, 9 },
222 { 9, 10, 4 },
223 { 9, 2, 10 },
224 { 9, 10, 1 },
225 { 9, 3, 10 },
226 { 9, 9, 6 },
227
228 /* 9/10 bit codewords */
229 { 9, 6, 9 }, { 9, 6, 9 },
230 { 9, 8, 0 }, { 9, 8, 0 },
231 { 9, 4, 10 }, { 9, 4, 10 },
232 { 9, 7, 0 }, { 9, 7, 0 },
233 { 9, 11, 2 }, { 9, 11, 2 },
234 { 10, 7, 9 },
235 { 10, 11, 3 },
236 { 10, 10, 6 },
237 { 10, 1, 10 },
238 { 10, 11, 1 },
239 { 10, 9, 7 },
240
241 /* 10 bit codewords */
242 { 10, 0, 7 },
243 { 10, 8, 8 },
244 { 10, 10, 5 },
245 { 10, 3, 11 },
246 { 10, 5, 10 },
247 { 10, 8, 9 },
248 { 10, 11, 5 },
249 { 10, 0, 8 },
250 { 10, 11, 4 },
251 { 10, 2, 11 },
252 { 10, 7, 10 },
253 { 10, 6, 10 },
254 { 10, 10, 7 },
255 { 10, 4, 11 },
256 { 10, 1, 11 },
257 { 10, 12, 2 },
258 { 10, 9, 8 },
259 { 10, 12, 3 },
260 { 10, 11, 6 },
261 { 10, 5, 11 },
262 { 10, 12, 4 },
263 { 10, 11, 7 },
264 { 10, 12, 5 },
265 { 10, 3, 12 },
266 { 10, 6, 11 },
267 { 10, 9, 0 },
268 { 10, 10, 8 },
269 { 10, 10, 0 },
270 { 10, 12, 1 },
271 { 10, 0, 9 },
272 { 10, 4, 12 },
273 { 10, 9, 9 },
274
275 /* 10/11/12 bit codewords */
276 { 10, 12, 6 }, { 10, 12, 6 }, { 10, 12, 6 }, { 10, 12, 6 },
277 { 10, 2, 12 }, { 10, 2, 12 }, { 10, 2, 12 }, { 10, 2, 12 },
278 { 10, 8, 10 }, { 10, 8, 10 }, { 10, 8, 10 }, { 10, 8, 10 },
279 { 11, 9, 10 }, { 11, 9, 10 },
280 { 11, 1, 12 }, { 11, 1, 12 },
281 { 11, 11, 8 }, { 11, 11, 8 },
282 { 11, 12, 7 }, { 11, 12, 7 },
283 { 11, 7, 11 }, { 11, 7, 11 },
284 { 11, 5, 12 }, { 11, 5, 12 },
285 { 11, 6, 12 }, { 11, 6, 12 },
286 { 11, 10, 9 }, { 11, 10, 9 },
287 { 11, 8, 11 }, { 11, 8, 11 },
288 { 11, 12, 8 }, { 11, 12, 8 },
289 { 11, 0, 10 }, { 11, 0, 10 },
290 { 11, 7, 12 }, { 11, 7, 12 },
291 { 11, 11, 0 }, { 11, 11, 0 },
292 { 11, 10, 10 }, { 11, 10, 10 },
293 { 11, 11, 9 }, { 11, 11, 9 },
294 { 11, 11, 10 }, { 11, 11, 10 },
295 { 11, 0, 11 }, { 11, 0, 11 },
296 { 11, 11, 11 }, { 11, 11, 11 },
297 { 11, 9, 11 }, { 11, 9, 11 },
298 { 11, 10, 11 }, { 11, 10, 11 },
299 { 11, 12, 0 }, { 11, 12, 0 },
300 { 11, 8, 12 }, { 11, 8, 12 },
301 { 12, 12, 9 },
302 { 12, 10, 12 },
303 { 12, 9, 12 },
304 { 12, 11, 12 },
305 { 12, 12, 11 },
306 { 12, 0, 12 },
307 { 12, 12, 10 },
308 { 12, 12, 12 }
309};
diff --git a/lib/rbcodec/codecs/libfaad/codebook/hcb_11.h b/lib/rbcodec/codecs/libfaad/codebook/hcb_11.h
new file mode 100644
index 0000000000..49e97af23f
--- /dev/null
+++ b/lib/rbcodec/codecs/libfaad/codebook/hcb_11.h
@@ -0,0 +1,412 @@
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_11 */
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 */
36static hcb hcb11_1[] ICONST_ATTR_FAAD_LARGE_IRAM = {
37 /* 4 bits */
38 { /* 00000 */ 0, 0 },
39 { /* */ 0, 0 },
40 { /* 00010 */ 1, 0 },
41 { /* */ 1, 0 },
42
43 /* 5 bits */
44 { /* 00100 */ 2, 0 },
45 { /* 00101 */ 3, 0 },
46 { /* 00110 */ 4, 0 },
47 { /* 00111 */ 5, 0 },
48 { /* 01000 */ 6, 0 },
49 { /* 01001 */ 7, 0 },
50
51 /* 6 bits */
52 { /* 01010 */ 8, 1 },
53 { /* 01011 */ 10, 1 },
54 { /* 01100 */ 12, 1 },
55
56 /* 6/7 bits */
57 { /* 01101 */ 14, 2 },
58
59 /* 7 bits */
60 { /* 01110 */ 18, 2 },
61 { /* 01111 */ 22, 2 },
62 { /* 10000 */ 26, 2 },
63
64 /* 7/8 bits */
65 { /* 10001 */ 30, 3 },
66
67 /* 8 bits */
68 { /* 10010 */ 38, 3 },
69 { /* 10011 */ 46, 3 },
70 { /* 10100 */ 54, 3 },
71 { /* 10101 */ 62, 3 },
72 { /* 10110 */ 70, 3 },
73 { /* 10111 */ 78, 3 },
74
75 /* 8/9 bits */
76 { /* 11000 */ 86, 4 },
77
78 /* 9 bits */
79 { /* 11001 */ 102, 4 },
80 { /* 11010 */ 118, 4 },
81 { /* 11011 */ 134, 4 },
82
83 /* 9/10 bits */
84 { /* 11100 */ 150, 5 },
85
86 /* 10 bits */
87 { /* 11101 */ 182, 5 },
88 { /* 11110 */ 214, 5 },
89
90 /* 10/11/12 bits */
91 { /* 11111 */ 246, 7 }
92};
93
94/* 2nd step table
95 *
96 * Gives size of codeword and actual data (x,y,v,w)
97 */
98static hcb_2_pair hcb11_2[] ICONST_ATTR_FAAD_LARGE_IRAM = {
99 /* 4 */
100 { 4, 0, 0 },
101 { 4, 1, 1 },
102
103 /* 5 */
104 { 5, 16, 16 },
105 { 5, 1, 0 },
106 { 5, 0, 1 },
107 { 5, 2, 1 },
108 { 5, 1, 2 },
109 { 5, 2, 2 },
110
111 /* 6 */
112 { 6, 1, 3 },
113 { 6, 3, 1 },
114 { 6, 3, 2 },
115 { 6, 2, 0 },
116 { 6, 2, 3 },
117 { 6, 0, 2 },
118
119 /* 6/7 */
120 { 6, 3, 3 }, { 6, 3, 3 },
121 { 7, 4, 1 },
122 { 7, 1, 4 },
123
124 /* 7 */
125 { 7, 4, 2 },
126 { 7, 2, 4 },
127 { 7, 4, 3 },
128 { 7, 3, 4 },
129 { 7, 3, 0 },
130 { 7, 0, 3 },
131 { 7, 5, 1 },
132 { 7, 5, 2 },
133 { 7, 2, 5 },
134 { 7, 4, 4 },
135 { 7, 1, 5 },
136 { 7, 5, 3 },
137
138 /* 7/8 */
139 { 7, 3, 5 }, { 7, 3, 5 },
140 { 7, 5, 4 }, { 7, 5, 4 },
141 { 8, 4, 5 },
142 { 8, 6, 2 },
143 { 8, 2, 6 },
144 { 8, 6, 1 },
145
146 /* 8 */
147 { 8, 6, 3 },
148 { 8, 3, 6 },
149 { 8, 1, 6 },
150 { 8, 4, 16 },
151 { 8, 3, 16 },
152 { 8, 16, 5 },
153 { 8, 16, 3 },
154 { 8, 16, 4 },
155 { 8, 6, 4 },
156 { 8, 16, 6 },
157 { 8, 4, 0 },
158 { 8, 4, 6 },
159 { 8, 0, 4 },
160 { 8, 2, 16 },
161 { 8, 5, 5 },
162 { 8, 5, 16 },
163 { 8, 16, 7 },
164 { 8, 16, 2 },
165 { 8, 16, 8 },
166 { 8, 2, 7 },
167 { 8, 7, 2 },
168 { 8, 3, 7 },
169 { 8, 6, 5 },
170 { 8, 5, 6 },
171 { 8, 6, 16 },
172 { 8, 16, 10 },
173 { 8, 7, 3 },
174 { 8, 7, 1 },
175 { 8, 16, 9 },
176 { 8, 7, 16 },
177 { 8, 1, 16 },
178 { 8, 1, 7 },
179 { 8, 4, 7 },
180 { 8, 16, 11 },
181 { 8, 7, 4 },
182 { 8, 16, 12 },
183 { 8, 8, 16 },
184 { 8, 16, 1 },
185 { 8, 6, 6 },
186 { 8, 9, 16 },
187 { 8, 2, 8 },
188 { 8, 5, 7 },
189 { 8, 10, 16 },
190 { 8, 16, 13 },
191 { 8, 8, 3 },
192 { 8, 8, 2 },
193 { 8, 3, 8 },
194 { 8, 5, 0 },
195
196 /* 8/9 */
197 { 8, 16, 14 }, { 8, 16, 14 },
198 { 8, 11, 16 }, { 8, 11, 16 },
199 { 8, 7, 5 }, { 8, 7, 5 },
200 { 8, 4, 8 }, { 8, 4, 8 },
201 { 8, 6, 7 }, { 8, 6, 7 },
202 { 8, 7, 6 }, { 8, 7, 6 },
203 { 8, 0, 5 }, { 8, 0, 5 },
204 { 9, 8, 4 },
205 { 9, 16, 15 },
206
207 /* 9 */
208 { 9, 12, 16 },
209 { 9, 1, 8 },
210 { 9, 8, 1 },
211 { 9, 14, 16 },
212 { 9, 5, 8 },
213 { 9, 13, 16 },
214 { 9, 3, 9 },
215 { 9, 8, 5 },
216 { 9, 7, 7 },
217 { 9, 2, 9 },
218 { 9, 8, 6 },
219 { 9, 9, 2 },
220 { 9, 9, 3 },
221 { 9, 15, 16 },
222 { 9, 4, 9 },
223 { 9, 6, 8 },
224 { 9, 6, 0 },
225 { 9, 9, 4 },
226 { 9, 5, 9 },
227 { 9, 8, 7 },
228 { 9, 7, 8 },
229 { 9, 1, 9 },
230 { 9, 10, 3 },
231 { 9, 0, 6 },
232 { 9, 10, 2 },
233 { 9, 9, 1 },
234 { 9, 9, 5 },
235 { 9, 4, 10 },
236 { 9, 2, 10 },
237 { 9, 9, 6 },
238 { 9, 3, 10 },
239 { 9, 6, 9 },
240 { 9, 10, 4 },
241 { 9, 8, 8 },
242 { 9, 10, 5 },
243 { 9, 9, 7 },
244 { 9, 11, 3 },
245 { 9, 1, 10 },
246 { 9, 7, 0 },
247 { 9, 10, 6 },
248 { 9, 7, 9 },
249 { 9, 3, 11 },
250 { 9, 5, 10 },
251 { 9, 10, 1 },
252 { 9, 4, 11 },
253 { 9, 11, 2 },
254 { 9, 13, 2 },
255 { 9, 6, 10 },
256
257 /* 9/10 */
258 { 9, 13, 3 }, { 9, 13, 3 },
259 { 9, 2, 11 }, { 9, 2, 11 },
260 { 9, 16, 0 }, { 9, 16, 0 },
261 { 9, 5, 11 }, { 9, 5, 11 },
262 { 9, 11, 5 }, { 9, 11, 5 },
263 { 10, 11, 4 },
264 { 10, 9, 8 },
265 { 10, 7, 10 },
266 { 10, 8, 9 },
267 { 10, 0, 16 },
268 { 10, 4, 13 },
269 { 10, 0, 7 },
270 { 10, 3, 13 },
271 { 10, 11, 6 },
272 { 10, 13, 1 },
273 { 10, 13, 4 },
274 { 10, 12, 3 },
275 { 10, 2, 13 },
276 { 10, 13, 5 },
277 { 10, 8, 10 },
278 { 10, 6, 11 },
279 { 10, 10, 8 },
280 { 10, 10, 7 },
281 { 10, 14, 2 },
282 { 10, 12, 4 },
283 { 10, 1, 11 },
284 { 10, 4, 12 },
285
286 /* 10 */
287 { 10, 11, 1 },
288 { 10, 3, 12 },
289 { 10, 1, 13 },
290 { 10, 12, 2 },
291 { 10, 7, 11 },
292 { 10, 3, 14 },
293 { 10, 5, 12 },
294 { 10, 5, 13 },
295 { 10, 14, 4 },
296 { 10, 4, 14 },
297 { 10, 11, 7 },
298 { 10, 14, 3 },
299 { 10, 12, 5 },
300 { 10, 13, 6 },
301 { 10, 12, 6 },
302 { 10, 8, 0 },
303 { 10, 11, 8 },
304 { 10, 2, 12 },
305 { 10, 9, 9 },
306 { 10, 14, 5 },
307 { 10, 6, 13 },
308 { 10, 10, 10 },
309 { 10, 15, 2 },
310 { 10, 8, 11 },
311 { 10, 9, 10 },
312 { 10, 14, 6 },
313 { 10, 10, 9 },
314 { 10, 5, 14 },
315 { 10, 11, 9 },
316 { 10, 14, 1 },
317 { 10, 2, 14 },
318 { 10, 6, 12 },
319 { 10, 1, 12 },
320 { 10, 13, 8 },
321 { 10, 0, 8 },
322 { 10, 13, 7 },
323 { 10, 7, 12 },
324 { 10, 12, 7 },
325 { 10, 7, 13 },
326 { 10, 15, 3 },
327 { 10, 12, 1 },
328 { 10, 6, 14 },
329 { 10, 2, 15 },
330 { 10, 15, 5 },
331 { 10, 15, 4 },
332 { 10, 1, 14 },
333 { 10, 9, 11 },
334 { 10, 4, 15 },
335 { 10, 14, 7 },
336 { 10, 8, 13 },
337 { 10, 13, 9 },
338 { 10, 8, 12 },
339 { 10, 5, 15 },
340 { 10, 3, 15 },
341 { 10, 10, 11 },
342 { 10, 11, 10 },
343 { 10, 12, 8 },
344 { 10, 15, 6 },
345 { 10, 15, 7 },
346 { 10, 8, 14 },
347 { 10, 15, 1 },
348 { 10, 7, 14 },
349 { 10, 9, 0 },
350 { 10, 0, 9 },
351
352 /* 10/11/12 */
353 { 10, 9, 13 }, { 10, 9, 13 }, { 10, 9, 13 }, { 10, 9, 13 },
354 { 10, 9, 12 }, { 10, 9, 12 }, { 10, 9, 12 }, { 10, 9, 12 },
355 { 10, 12, 9 }, { 10, 12, 9 }, { 10, 12, 9 }, { 10, 12, 9 },
356 { 10, 14, 8 }, { 10, 14, 8 }, { 10, 14, 8 }, { 10, 14, 8 },
357 { 10, 10, 13 }, { 10, 10, 13 }, { 10, 10, 13 }, { 10, 10, 13 },
358 { 10, 14, 9 }, { 10, 14, 9 }, { 10, 14, 9 }, { 10, 14, 9 },
359 { 10, 12, 10 }, { 10, 12, 10 }, { 10, 12, 10 }, { 10, 12, 10 },
360 { 10, 6, 15 }, { 10, 6, 15 }, { 10, 6, 15 }, { 10, 6, 15 },
361 { 10, 7, 15 }, { 10, 7, 15 }, { 10, 7, 15 }, { 10, 7, 15 },
362
363 { 11, 9, 14 }, { 11, 9, 14 },
364 { 11, 15, 8 }, { 11, 15, 8 },
365 { 11, 11, 11 }, { 11, 11, 11 },
366 { 11, 11, 14 }, { 11, 11, 14 },
367 { 11, 1, 15 }, { 11, 1, 15 },
368 { 11, 10, 12 }, { 11, 10, 12 },
369 { 11, 10, 14 }, { 11, 10, 14 },
370 { 11, 13, 11 }, { 11, 13, 11 },
371 { 11, 13, 10 }, { 11, 13, 10 },
372 { 11, 11, 13 }, { 11, 11, 13 },
373 { 11, 11, 12 }, { 11, 11, 12 },
374 { 11, 8, 15 }, { 11, 8, 15 },
375 { 11, 14, 11 }, { 11, 14, 11 },
376 { 11, 13, 12 }, { 11, 13, 12 },
377 { 11, 12, 13 }, { 11, 12, 13 },
378 { 11, 15, 9 }, { 11, 15, 9 },
379 { 11, 14, 10 }, { 11, 14, 10 },
380 { 11, 10, 0 }, { 11, 10, 0 },
381 { 11, 12, 11 }, { 11, 12, 11 },
382 { 11, 9, 15 }, { 11, 9, 15 },
383 { 11, 0, 10 }, { 11, 0, 10 },
384 { 11, 12, 12 }, { 11, 12, 12 },
385 { 11, 11, 0 }, { 11, 11, 0 },
386 { 11, 12, 14 }, { 11, 12, 14 },
387 { 11, 10, 15 }, { 11, 10, 15 },
388 { 11, 13, 13 }, { 11, 13, 13 },
389 { 11, 0, 13 }, { 11, 0, 13 },
390 { 11, 14, 12 }, { 11, 14, 12 },
391 { 11, 15, 10 }, { 11, 15, 10 },
392 { 11, 15, 11 }, { 11, 15, 11 },
393 { 11, 11, 15 }, { 11, 11, 15 },
394 { 11, 14, 13 }, { 11, 14, 13 },
395 { 11, 13, 0 }, { 11, 13, 0 },
396 { 11, 0, 11 }, { 11, 0, 11 },
397 { 11, 13, 14 }, { 11, 13, 14 },
398 { 11, 15, 12 }, { 11, 15, 12 },
399 { 11, 15, 13 }, { 11, 15, 13 },
400 { 11, 12, 15 }, { 11, 12, 15 },
401 { 11, 14, 0 }, { 11, 14, 0 },
402 { 11, 14, 14 }, { 11, 14, 14 },
403 { 11, 13, 15 }, { 11, 13, 15 },
404 { 11, 12, 0 }, { 11, 12, 0 },
405 { 11, 14, 15 }, { 11, 14, 15 },
406 { 12, 0, 14 },
407 { 12, 0, 12 },
408 { 12, 15, 14 },
409 { 12, 15, 0 },
410 { 12, 0, 15 },
411 { 12, 15, 15 }
412};
diff --git a/lib/rbcodec/codecs/libfaad/codebook/hcb_2.h b/lib/rbcodec/codecs/libfaad/codebook/hcb_2.h
new file mode 100644
index 0000000000..15e7d57084
--- /dev/null
+++ b/lib/rbcodec/codecs/libfaad/codebook/hcb_2.h
@@ -0,0 +1,182 @@
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_2 */
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 */
36static hcb hcb2_1[] ICONST_ATTR_FAAD_LARGE_IRAM = {
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 },
50
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 },
64
65 /* 7 bit codewords */
66 { /* 11001 */ 33, 2 },
67 { /* 11010 */ 37, 2 },
68 { /* 11011 */ 41, 2 },
69
70 /* 7/8 bit codewords */
71 { /* 11100 */ 45, 3 },
72
73 /* 8 bit codewords */
74 { /* 11101 */ 53, 3 },
75 { /* 11110 */ 61, 3 },
76
77 /* 8/9 bit codewords */
78 { /* 11111 */ 69, 4 }
79};
80
81/* 2nd step table
82 *
83 * Gives size of codeword and actual data (x,y,v,w)
84 */
85static hcb_2_quad hcb2_2[] ICONST_ATTR_FAAD_LARGE_IRAM = {
86 /* 3 bit codeword */
87 { 3, 0, 0, 0, 0 },
88
89 /* 4 bit codeword */
90 { 4, 1, 0, 0, 0 },
91
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 },
100
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 },
126
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 },
140
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 },
147
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 },
165
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 }
182};
diff --git a/lib/rbcodec/codecs/libfaad/codebook/hcb_3.h b/lib/rbcodec/codecs/libfaad/codebook/hcb_3.h
new file mode 100644
index 0000000000..3b12fdff60
--- /dev/null
+++ b/lib/rbcodec/codecs/libfaad/codebook/hcb_3.h
@@ -0,0 +1,193 @@
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/* Binary search huffman table HCB_3 */
29
30
31static hcb_bin_quad hcb3[] ICONST_ATTR_FAAD_LARGE_IRAM = {
32 { /* 0 */ 0, { 1, 2, 0, 0 } },
33 { /* 1 */ 1, { 0, 0, 0, 0 } }, /* 0 */
34 { /* 2 */ 0, { 1, 2, 0, 0 } },
35 { /* 3 */ 0, { 2, 3, 0, 0 } },
36 { /* 4 */ 0, { 3, 4, 0, 0 } },
37 { /* 5 */ 0, { 4, 5, 0, 0 } },
38 { /* 6 */ 0, { 5, 6, 0, 0 } },
39 { /* 7 */ 0, { 6, 7, 0, 0 } },
40 { /* 8 */ 0, { 7, 8, 0, 0 } },
41 { /* 9 */ 1, { 1, 0, 0, 0 } }, /* 1000 */
42 { /* 10 */ 1, { 0, 0, 0, 1 } }, /* 1001 */
43 { /* 11 */ 1, { 0, 1, 0, 0 } }, /* 1010 */
44 { /* 12 */ 1, { 0, 0, 1, 0 } }, /* 1011 */
45 { /* 13 */ 0, { 4, 5, 0, 0 } },
46 { /* 14 */ 0, { 5, 6, 0, 0 } },
47 { /* 15 */ 0, { 6, 7, 0, 0 } },
48 { /* 16 */ 0, { 7, 8, 0, 0 } },
49 { /* 17 */ 1, { 1, 1, 0, 0 } },
50 { /* 18 */ 1, { 0, 0, 1, 1 } },
51 { /* 19 */ 0, { 6, 7, 0, 0 } },
52 { /* 20 */ 0, { 7, 8, 0, 0 } },
53 { /* 21 */ 0, { 8, 9, 0, 0 } },
54 { /* 22 */ 0, { 9, 10, 0, 0 } },
55 { /* 23 */ 0, { 10, 11, 0, 0 } },
56 { /* 24 */ 0, { 11, 12, 0, 0 } },
57 { /* 25 */ 1, { 0, 1, 1, 0 } }, /* 110100 */
58 { /* 26 */ 1, { 0, 1, 0, 1 } }, /* 110101 */
59 { /* 27 */ 1, { 1, 0, 1, 0 } }, /* 110110 */
60 { /* 28 */ 1, { 0, 1, 1, 1 } }, /* 110111 */
61 { /* 29 */ 1, { 1, 0, 0, 1 } }, /* 111000 */
62 { /* 30 */ 1, { 1, 1, 1, 0 } }, /* 111001 */
63 { /* 31 */ 0, { 6, 7, 0, 0 } },
64 { /* 32 */ 0, { 7, 8, 0, 0 } },
65 { /* 33 */ 0, { 8, 9, 0, 0 } },
66 { /* 34 */ 0, { 9, 10, 0, 0 } },
67 { /* 35 */ 0, { 10, 11, 0, 0 } },
68 { /* 36 */ 0, { 11, 12, 0, 0 } },
69 { /* 37 */ 1, { 1, 1, 1, 1 } }, /* 1110100 */
70 { /* 38 */ 1, { 1, 0, 1, 1 } }, /* 1110101 */
71 { /* 39 */ 1, { 1, 1, 0, 1 } }, /* 1110110 */
72 { /* 40 */ 0, { 9, 10, 0, 0 } },
73 { /* 41 */ 0, { 10, 11, 0, 0 } },
74 { /* 42 */ 0, { 11, 12, 0, 0 } },
75 { /* 43 */ 0, { 12, 13, 0, 0 } },
76 { /* 44 */ 0, { 13, 14, 0, 0 } },
77 { /* 45 */ 0, { 14, 15, 0, 0 } },
78 { /* 46 */ 0, { 15, 16, 0, 0 } },
79 { /* 47 */ 0, { 16, 17, 0, 0 } },
80 { /* 48 */ 0, { 17, 18, 0, 0 } },
81 { /* 49 */ 1, { 2, 0, 0, 0 } }, /* 11101110 */
82 { /* 50 */ 1, { 0, 0, 0, 2 } }, /* 11101111 */
83 { /* 51 */ 1, { 0, 0, 1, 2 } }, /* 11110000 */
84 { /* 52 */ 1, { 2, 1, 0, 0 } }, /* 11110001 */
85 { /* 53 */ 1, { 1, 2, 1, 0 } }, /* 11110010 */
86 { /* 54 */ 0, { 13, 14, 0, 0 } },
87 { /* 55 */ 0, { 14, 15, 0, 0 } },
88 { /* 56 */ 0, { 15, 16, 0, 0 } },
89 { /* 57 */ 0, { 16, 17, 0, 0 } },
90 { /* 58 */ 0, { 17, 18, 0, 0 } },
91 { /* 59 */ 0, { 18, 19, 0, 0 } },
92 { /* 60 */ 0, { 19, 20, 0, 0 } },
93 { /* 61 */ 0, { 20, 21, 0, 0 } },
94 { /* 62 */ 0, { 21, 22, 0, 0 } },
95 { /* 63 */ 0, { 22, 23, 0, 0 } },
96 { /* 64 */ 0, { 23, 24, 0, 0 } },
97 { /* 65 */ 0, { 24, 25, 0, 0 } },
98 { /* 66 */ 0, { 25, 26, 0, 0 } },
99 { /* 67 */ 1, { 0, 0, 2, 1 } },
100 { /* 68 */ 1, { 0, 1, 2, 1 } },
101 { /* 69 */ 1, { 1, 2, 0, 0 } },
102 { /* 70 */ 1, { 0, 1, 1, 2 } },
103 { /* 71 */ 1, { 2, 1, 1, 0 } },
104 { /* 72 */ 1, { 0, 0, 2, 0 } },
105 { /* 73 */ 1, { 0, 2, 1, 0 } },
106 { /* 74 */ 1, { 0, 1, 2, 0 } },
107 { /* 75 */ 1, { 0, 2, 0, 0 } },
108 { /* 76 */ 1, { 0, 1, 0, 2 } },
109 { /* 77 */ 1, { 2, 0, 1, 0 } },
110 { /* 78 */ 1, { 1, 2, 1, 1 } },
111 { /* 79 */ 1, { 0, 2, 1, 1 } },
112 { /* 80 */ 1, { 1, 1, 2, 0 } },
113 { /* 81 */ 1, { 1, 1, 2, 1 } },
114 { /* 82 */ 0, { 11, 12, 0, 0 } },
115 { /* 83 */ 0, { 12, 13, 0, 0 } },
116 { /* 84 */ 0, { 13, 14, 0, 0 } },
117 { /* 85 */ 0, { 14, 15, 0, 0 } },
118 { /* 86 */ 0, { 15, 16, 0, 0 } },
119 { /* 87 */ 0, { 16, 17, 0, 0 } },
120 { /* 88 */ 0, { 17, 18, 0, 0 } },
121 { /* 89 */ 0, { 18, 19, 0, 0 } },
122 { /* 90 */ 0, { 19, 20, 0, 0 } },
123 { /* 91 */ 0, { 20, 21, 0, 0 } },
124 { /* 92 */ 0, { 21, 22, 0, 0 } },
125 { /* 93 */ 1, { 1, 2, 0, 1 } }, /* 1111101010 */
126 { /* 94 */ 1, { 1, 0, 2, 0 } }, /* 1111101011 */
127 { /* 95 */ 1, { 1, 0, 2, 1 } }, /* 1111101100 */
128 { /* 96 */ 1, { 0, 2, 0, 1 } }, /* 1111101101 */
129 { /* 97 */ 1, { 2, 1, 1, 1 } }, /* 1111101110 */
130 { /* 98 */ 1, { 1, 1, 1, 2 } }, /* 1111101111 */
131 { /* 99 */ 1, { 2, 1, 0, 1 } }, /* 1111110000 */
132 { /* 00 */ 1, { 1, 0, 1, 2 } }, /* 1111110001 */
133 { /* 01 */ 1, { 0, 0, 2, 2 } }, /* 1111110010 */
134 { /* 02 */ 1, { 0, 1, 2, 2 } }, /* 1111110011 */
135 { /* 03 */ 1, { 2, 2, 1, 0 } }, /* 1111110100 */
136 { /* 04 */ 1, { 1, 2, 2, 0 } }, /* 1111110101 */
137 { /* 05 */ 1, { 1, 0, 0, 2 } }, /* 1111110110 */
138 { /* 06 */ 1, { 2, 0, 0, 1 } }, /* 1111110111 */
139 { /* 07 */ 1, { 0, 2, 2, 1 } }, /* 1111111000 */
140 { /* 08 */ 0, { 7, 8, 0, 0 } },
141 { /* 09 */ 0, { 8, 9, 0, 0 } },
142 { /* 10 */ 0, { 9, 10, 0, 0 } },
143 { /* 11 */ 0, { 10, 11, 0, 0 } },
144 { /* 12 */ 0, { 11, 12, 0, 0 } },
145 { /* 13 */ 0, { 12, 13, 0, 0 } },
146 { /* 14 */ 0, { 13, 14, 0, 0 } },
147 { /* 15 */ 1, { 2, 2, 0, 0 } }, /* 11111110010 */
148 { /* 16 */ 1, { 1, 2, 2, 1 } }, /* 11111110011 */
149 { /* 17 */ 1, { 1, 1, 0, 2 } }, /* 11111110100 */
150 { /* 18 */ 1, { 2, 0, 1, 1 } }, /* 11111110101 */
151 { /* 19 */ 1, { 1, 1, 2, 2 } }, /* 11111110110 */
152 { /* 20 */ 1, { 2, 2, 1, 1 } }, /* 11111110111 */
153 { /* 21 */ 1, { 0, 2, 2, 0 } }, /* 11111111000 */
154 { /* 22 */ 1, { 0, 2, 1, 2 } }, /* 11111111001 */
155 { /* 23 */ 0, { 6, 7, 0, 0 } },
156 { /* 24 */ 0, { 7, 8, 0, 0 } },
157 { /* 25 */ 0, { 8, 9, 0, 0 } },
158 { /* 26 */ 0, { 9, 10, 0, 0 } },
159 { /* 27 */ 0, { 10, 11, 0, 0 } },
160 { /* 28 */ 0, { 11, 12, 0, 0 } },
161 { /* 29 */ 1, { 1, 0, 2, 2 } }, /* 111111110100 */
162 { /* 30 */ 1, { 2, 2, 0, 1 } }, /* 111111110101 */
163 { /* 31 */ 1, { 2, 1, 2, 0 } }, /* 111111110110 */
164 { /* 32 */ 1, { 2, 2, 2, 0 } }, /* 111111110111 */
165 { /* 33 */ 1, { 0, 2, 2, 2 } }, /* 111111111000 */
166 { /* 34 */ 1, { 2, 2, 2, 1 } }, /* 111111111001 */
167 { /* 35 */ 1, { 2, 1, 2, 1 } }, /* 111111111010 */
168 { /* 36 */ 1, { 1, 2, 1, 2 } }, /* 111111111011 */
169 { /* 37 */ 1, { 1, 2, 2, 2 } }, /* 111111111100 */
170 { /* 38 */ 0, { 3, 4, 0, 0 } },
171 { /* 39 */ 0, { 4, 5, 0, 0 } },
172 { /* 40 */ 0, { 5, 6, 0, 0 } },
173 { /* 41 */ 1, { 0, 2, 0, 2 } }, /* 1111111111010 */
174 { /* 42 */ 1, { 2, 0, 2, 0 } }, /* 1111111111011 */
175 { /* 43 */ 1, { 1, 2, 0, 2 } }, /* 1111111111100 */
176 { /* 44 */ 0, { 3, 4, 0, 0 } },
177 { /* 45 */ 0, { 4, 5, 0, 0 } },
178 { /* 46 */ 0, { 5, 6, 0, 0 } },
179 { /* 47 */ 1, { 2, 0, 2, 1 } }, /* 11111111111010 */
180 { /* 48 */ 1, { 2, 1, 1, 2 } }, /* 11111111111011 */
181 { /* 49 */ 1, { 2, 1, 0, 2 } }, /* 11111111111100 */
182 { /* 50 */ 0, { 3, 4, 0, 0 } },
183 { /* 51 */ 0, { 4, 5, 0, 0 } },
184 { /* 52 */ 0, { 5, 6, 0, 0 } },
185 { /* 53 */ 1, { 2, 2, 2, 2 } }, /* 111111111111010 */
186 { /* 54 */ 1, { 2, 2, 1, 2 } }, /* 111111111111011 */
187 { /* 55 */ 1, { 2, 1, 2, 2 } }, /* 111111111111100 */
188 { /* 56 */ 1, { 2, 0, 1, 2 } }, /* 111111111111101 */
189 { /* 57 */ 1, { 2, 0, 0, 2 } }, /* 111111111111110 */
190 { /* 58 */ 0, { 1, 2, 0, 0 } },
191 { /* 59 */ 1, { 2, 2, 0, 2 } }, /* 1111111111111110 */
192 { /* 60 */ 1, { 2, 0, 2, 2 } } /* 1111111111111111 */
193};
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 */
36static 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 */
88static 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};
diff --git a/lib/rbcodec/codecs/libfaad/codebook/hcb_5.h b/lib/rbcodec/codecs/libfaad/codebook/hcb_5.h
new file mode 100644
index 0000000000..0143482901
--- /dev/null
+++ b/lib/rbcodec/codecs/libfaad/codebook/hcb_5.h
@@ -0,0 +1,193 @@
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/* Binary search huffman table HCB_5 */
29
30
31static hcb_bin_pair hcb5[] ICONST_ATTR_FAAD_LARGE_IRAM = {
32 { /* 0 */ 0, { 1, 2 } },
33 { /* 1 */ 1, { 0, 0 } }, /* 0 */
34 { /* 2 */ 0, { 1, 2 } },
35 { /* 3 */ 0, { 2, 3 } },
36 { /* 4 */ 0, { 3, 4 } },
37 { /* 5 */ 0, { 4, 5 } },
38 { /* 6 */ 0, { 5, 6 } },
39 { /* 7 */ 0, { 6, 7 } },
40 { /* 8 */ 0, { 7, 8 } },
41 { /* 9 */ 1, { -1, 0 } }, /* 1000 */
42 { /* 10 */ 1, { 1, 0 } }, /* 1001 */
43 { /* 11 */ 1, { 0, 1 } }, /* 1010 */
44 { /* 12 */ 1, { 0, -1 } }, /* 1011 */
45 { /* 13 */ 0, { 4, 5 } },
46 { /* 14 */ 0, { 5, 6 } },
47 { /* 15 */ 0, { 6, 7 } },
48 { /* 16 */ 0, { 7, 8 } },
49 { /* 17 */ 1, { 1, -1 } },
50 { /* 18 */ 1, { -1, 1 } },
51 { /* 19 */ 1, { -1, -1 } },
52 { /* 20 */ 1, { 1, 1 } },
53 { /* 21 */ 0, { 4, 5 } },
54 { /* 22 */ 0, { 5, 6 } },
55 { /* 23 */ 0, { 6, 7 } },
56 { /* 24 */ 0, { 7, 8 } },
57 { /* 25 */ 0, { 8, 9 } },
58 { /* 26 */ 0, { 9, 10 } },
59 { /* 27 */ 0, { 10, 11 } },
60 { /* 28 */ 0, { 11, 12 } },
61 { /* 29 */ 0, { 12, 13 } },
62 { /* 30 */ 0, { 13, 14 } },
63 { /* 31 */ 0, { 14, 15 } },
64 { /* 32 */ 0, { 15, 16 } },
65 { /* 33 */ 1, { -2, 0 } },
66 { /* 34 */ 1, { 0, 2 } },
67 { /* 35 */ 1, { 2, 0 } },
68 { /* 36 */ 1, { 0, -2 } },
69 { /* 37 */ 0, { 12, 13 } },
70 { /* 38 */ 0, { 13, 14 } },
71 { /* 39 */ 0, { 14, 15 } },
72 { /* 40 */ 0, { 15, 16 } },
73 { /* 41 */ 0, { 16, 17 } },
74 { /* 42 */ 0, { 17, 18 } },
75 { /* 43 */ 0, { 18, 19 } },
76 { /* 44 */ 0, { 19, 20 } },
77 { /* 45 */ 0, { 20, 21 } },
78 { /* 46 */ 0, { 21, 22 } },
79 { /* 47 */ 0, { 22, 23 } },
80 { /* 48 */ 0, { 23, 24 } },
81 { /* 49 */ 1, { -2, -1 } },
82 { /* 50 */ 1, { 2, 1 } },
83 { /* 51 */ 1, { -1, -2 } },
84 { /* 52 */ 1, { 1, 2 } },
85 { /* 53 */ 1, { -2, 1 } },
86 { /* 54 */ 1, { 2, -1 } },
87 { /* 55 */ 1, { -1, 2 } },
88 { /* 56 */ 1, { 1, -2 } },
89 { /* 57 */ 1, { -3, 0 } },
90 { /* 58 */ 1, { 3, 0 } },
91 { /* 59 */ 1, { 0, -3 } },
92 { /* 60 */ 1, { 0, 3 } },
93 { /* 61 */ 0, { 12, 13 } },
94 { /* 62 */ 0, { 13, 14 } },
95 { /* 63 */ 0, { 14, 15 } },
96 { /* 64 */ 0, { 15, 16 } },
97 { /* 65 */ 0, { 16, 17 } },
98 { /* 66 */ 0, { 17, 18 } },
99 { /* 67 */ 0, { 18, 19 } },
100 { /* 68 */ 0, { 19, 20 } },
101 { /* 69 */ 0, { 20, 21 } },
102 { /* 70 */ 0, { 21, 22 } },
103 { /* 71 */ 0, { 22, 23 } },
104 { /* 72 */ 0, { 23, 24 } },
105 { /* 73 */ 1, { -3, -1 } },
106 { /* 74 */ 1, { 1, 3 } },
107 { /* 75 */ 1, { 3, 1 } },
108 { /* 76 */ 1, { -1, -3 } },
109 { /* 77 */ 1, { -3, 1 } },
110 { /* 78 */ 1, { 3, -1 } },
111 { /* 79 */ 1, { 1, -3 } },
112 { /* 80 */ 1, { -1, 3 } },
113 { /* 81 */ 1, { -2, 2 } },
114 { /* 82 */ 1, { 2, 2 } },
115 { /* 83 */ 1, { -2, -2 } },
116 { /* 84 */ 1, { 2, -2 } },
117 { /* 85 */ 0, { 12, 13 } },
118 { /* 86 */ 0, { 13, 14 } },
119 { /* 87 */ 0, { 14, 15 } },
120 { /* 88 */ 0, { 15, 16 } },
121 { /* 89 */ 0, { 16, 17 } },
122 { /* 90 */ 0, { 17, 18 } },
123 { /* 91 */ 0, { 18, 19 } },
124 { /* 92 */ 0, { 19, 20 } },
125 { /* 93 */ 0, { 20, 21 } },
126 { /* 94 */ 0, { 21, 22 } },
127 { /* 95 */ 0, { 22, 23 } },
128 { /* 96 */ 0, { 23, 24 } },
129 { /* 97 */ 1, { -3, -2 } },
130 { /* 98 */ 1, { 3, -2 } },
131 { /* 99 */ 1, { -2, 3 } },
132 { /* 00 */ 1, { 2, -3 } },
133 { /* 01 */ 1, { 3, 2 } },
134 { /* 02 */ 1, { 2, 3 } },
135 { /* 03 */ 1, { -3, 2 } },
136 { /* 04 */ 1, { -2, -3 } },
137 { /* 05 */ 1, { 0, -4 } },
138 { /* 06 */ 1, { -4, 0 } },
139 { /* 07 */ 1, { 4, 1 } },
140 { /* 08 */ 1, { 4, 0 } },
141 { /* 09 */ 0, { 12, 13 } },
142 { /* 10 */ 0, { 13, 14 } },
143 { /* 11 */ 0, { 14, 15 } },
144 { /* 12 */ 0, { 15, 16 } },
145 { /* 13 */ 0, { 16, 17 } },
146 { /* 14 */ 0, { 17, 18 } },
147 { /* 15 */ 0, { 18, 19 } },
148 { /* 16 */ 0, { 19, 20 } },
149 { /* 17 */ 0, { 20, 21 } },
150 { /* 18 */ 0, { 21, 22 } },
151 { /* 19 */ 0, { 22, 23 } },
152 { /* 20 */ 0, { 23, 24 } },
153 { /* 21 */ 1, { -4, -1 } },
154 { /* 22 */ 1, { 0, 4 } },
155 { /* 23 */ 1, { 4, -1 } },
156 { /* 24 */ 1, { -1, -4 } },
157 { /* 25 */ 1, { 1, 4 } },
158 { /* 26 */ 1, { -1, 4 } },
159 { /* 27 */ 1, { -4, 1 } },
160 { /* 28 */ 1, { 1, -4 } },
161 { /* 29 */ 1, { 3, -3 } },
162 { /* 30 */ 1, { -3, -3 } },
163 { /* 31 */ 1, { -3, 3 } },
164 { /* 32 */ 1, { -2, 4 } },
165 { /* 33 */ 1, { -4, -2 } },
166 { /* 34 */ 1, { 4, 2 } },
167 { /* 35 */ 1, { 2, -4 } },
168 { /* 36 */ 1, { 2, 4 } },
169 { /* 37 */ 1, { 3, 3 } },
170 { /* 38 */ 1, { -4, 2 } },
171 { /* 39 */ 0, { 6, 7 } },
172 { /* 40 */ 0, { 7, 8 } },
173 { /* 41 */ 0, { 8, 9 } },
174 { /* 42 */ 0, { 9, 10 } },
175 { /* 43 */ 0, { 10, 11 } },
176 { /* 44 */ 0, { 11, 12 } },
177 { /* 45 */ 1, { -2, -4 } },
178 { /* 46 */ 1, { 4, -2 } },
179 { /* 47 */ 1, { 3, -4 } },
180 { /* 48 */ 1, { -4, -3 } },
181 { /* 49 */ 1, { -4, 3 } },
182 { /* 50 */ 1, { 3, 4 } },
183 { /* 51 */ 1, { -3, 4 } },
184 { /* 52 */ 1, { 4, 3 } },
185 { /* 53 */ 1, { 4, -3 } },
186 { /* 54 */ 1, { -3, -4 } },
187 { /* 55 */ 0, { 2, 3 } },
188 { /* 56 */ 0, { 3, 4 } },
189 { /* 57 */ 1, { 4, -4 } },
190 { /* 58 */ 1, { -4, 4 } },
191 { /* 59 */ 1, { 4, 4 } },
192 { /* 60 */ 1, { -4, -4 } }
193};
diff --git a/lib/rbcodec/codecs/libfaad/codebook/hcb_6.h b/lib/rbcodec/codecs/libfaad/codebook/hcb_6.h
new file mode 100644
index 0000000000..9988133552
--- /dev/null
+++ b/lib/rbcodec/codecs/libfaad/codebook/hcb_6.h
@@ -0,0 +1,179 @@
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_6 */
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 */
36static hcb hcb6_1[] ICONST_ATTR = {
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
57 /* 6 bit codewords */
58 { /* 10010 */ 9, 1 },
59 { /* 10011 */ 11, 1 },
60 { /* 10100 */ 13, 1 },
61 { /* 10101 */ 15, 1 },
62 { /* 10110 */ 17, 1 },
63 { /* 10111 */ 19, 1 },
64 { /* 11000 */ 21, 1 },
65 { /* 11001 */ 23, 1 },
66
67 /* 7 bit codewords */
68 { /* 11010 */ 25, 2 },
69 { /* 11011 */ 29, 2 },
70 { /* 11100 */ 33, 2 },
71
72 /* 7/8 bit codewords */
73 { /* 11101 */ 37, 3 },
74
75 /* 8/9 bit codewords */
76 { /* 11110 */ 45, 4 },
77
78 /* 9/10/11 bit codewords */
79 { /* 11111 */ 61, 6 }
80};
81
82/* 2nd step table
83 *
84 * Gives size of codeword and actual data (x,y,v,w)
85 */
86static hcb_2_pair hcb6_2[] ICONST_ATTR = {
87 /* 4 bit codewords */
88 { 4, 0, 0 },
89 { 4, 1, 0 },
90 { 4, 0, -1 },
91 { 4, 0, 1 },
92 { 4, -1, 0 },
93 { 4, 1, 1 },
94 { 4, -1, 1 },
95 { 4, 1, -1 },
96 { 4, -1, -1 },
97
98 /* 6 bit codewords */
99 { 6, 2, -1 },
100 { 6, 2, 1 },
101 { 6, -2, 1 },
102 { 6, -2, -1 },
103 { 6, -2, 0 },
104 { 6, -1, 2 },
105 { 6, 2, 0 },
106 { 6, 1, -2 },
107 { 6, 1, 2 },
108 { 6, 0, -2 },
109 { 6, -1, -2 },
110 { 6, 0, 2 },
111 { 6, 2, -2 },
112 { 6, -2, 2 },
113 { 6, -2, -2 },
114 { 6, 2, 2 },
115
116 /* 7 bit codewords */
117 { 7, -3, 1 },
118 { 7, 3, 1 },
119 { 7, 3, -1 },
120 { 7, -1, 3 },
121 { 7, -3, -1 },
122 { 7, 1, 3 },
123 { 7, 1, -3 },
124 { 7, -1, -3 },
125 { 7, 3, 0 },
126 { 7, -3, 0 },
127 { 7, 0, -3 },
128 { 7, 0, 3 },
129
130 /* 7/8 bit codewords */
131 { 7, 3, 2 }, { 7, 3, 2 },
132 { 8, -3, -2 },
133 { 8, -2, 3 },
134 { 8, 2, 3 },
135 { 8, 3, -2 },
136 { 8, 2, -3 },
137 { 8, -2, -3 },
138
139 /* 8 bit codewords */
140 { 8, -3, 2 }, { 8, -3, 2 },
141 { 8, 3, 3 }, { 8, 3, 3 },
142 { 9, 3, -3 },
143 { 9, -3, -3 },
144 { 9, -3, 3 },
145 { 9, 1, -4 },
146 { 9, -1, -4 },
147 { 9, 4, 1 },
148 { 9, -4, 1 },
149 { 9, -4, -1 },
150 { 9, 1, 4 },
151 { 9, 4, -1 },
152 { 9, -1, 4 },
153 { 9, 0, -4 },
154
155 /* 9/10/11 bit codewords */
156 { 9, -4, 2 }, { 9, -4, 2 }, { 9, -4, 2 }, { 9, -4, 2 },
157 { 9, -4, -2 }, { 9, -4, -2 }, { 9, -4, -2 }, { 9, -4, -2 },
158 { 9, 2, 4 }, { 9, 2, 4 }, { 9, 2, 4 }, { 9, 2, 4 },
159 { 9, -2, -4 }, { 9, -2, -4 }, { 9, -2, -4 }, { 9, -2, -4 },
160 { 9, -4, 0 }, { 9, -4, 0 }, { 9, -4, 0 }, { 9, -4, 0 },
161 { 9, 4, 2 }, { 9, 4, 2 }, { 9, 4, 2 }, { 9, 4, 2 },
162 { 9, 4, -2 }, { 9, 4, -2 }, { 9, 4, -2 }, { 9, 4, -2 },
163 { 9, -2, 4 }, { 9, -2, 4 }, { 9, -2, 4 }, { 9, -2, 4 },
164 { 9, 4, 0 }, { 9, 4, 0 }, { 9, 4, 0 }, { 9, 4, 0 },
165 { 9, 2, -4 }, { 9, 2, -4 }, { 9, 2, -4 }, { 9, 2, -4 },
166 { 9, 0, 4 }, { 9, 0, 4 }, { 9, 0, 4 }, { 9, 0, 4 },
167 { 10, -3, -4 }, { 10, -3, -4 },
168 { 10, -3, 4 }, { 10, -3, 4 },
169 { 10, 3, -4 }, { 10, 3, -4 },
170 { 10, 4, -3 }, { 10, 4, -3 },
171 { 10, 3, 4 }, { 10, 3, 4 },
172 { 10, 4, 3 }, { 10, 4, 3 },
173 { 10, -4, 3 }, { 10, -4, 3 },
174 { 10, -4, -3 }, { 10, -4, -3 },
175 { 11, 4, 4 },
176 { 11, -4, 4 },
177 { 11, -4, -4 },
178 { 11, 4, -4 }
179};
diff --git a/lib/rbcodec/codecs/libfaad/codebook/hcb_7.h b/lib/rbcodec/codecs/libfaad/codebook/hcb_7.h
new file mode 100644
index 0000000000..3b378dc5cd
--- /dev/null
+++ b/lib/rbcodec/codecs/libfaad/codebook/hcb_7.h
@@ -0,0 +1,159 @@
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/* Binary search huffman table HCB_7 */
29
30
31static hcb_bin_pair hcb7[] ICONST_ATTR_FAAD_LARGE_IRAM = {
32 { /* 0 */ 0, { 1, 2 } },
33 { /* 1 */ 1, { 0, 0 } },
34 { /* 2 */ 0, { 1, 2 } },
35 { /* 3 */ 0, { 2, 3 } },
36 { /* 4 */ 0, { 3, 4 } },
37 { /* 5 */ 1, { 1, 0 } },
38 { /* 6 */ 1, { 0, 1 } },
39 { /* 7 */ 0, { 2, 3 } },
40 { /* 8 */ 0, { 3, 4 } },
41 { /* 9 */ 1, { 1, 1 } },
42 { /* 10 */ 0, { 3, 4 } },
43 { /* 11 */ 0, { 4, 5 } },
44 { /* 12 */ 0, { 5, 6 } },
45 { /* 13 */ 0, { 6, 7 } },
46 { /* 14 */ 0, { 7, 8 } },
47 { /* 15 */ 0, { 8, 9 } },
48 { /* 16 */ 0, { 9, 10 } },
49 { /* 17 */ 0, { 10, 11 } },
50 { /* 18 */ 0, { 11, 12 } },
51 { /* 19 */ 1, { 2, 1 } },
52 { /* 20 */ 1, { 1, 2 } },
53 { /* 21 */ 1, { 2, 0 } },
54 { /* 22 */ 1, { 0, 2 } },
55 { /* 23 */ 0, { 8, 9 } },
56 { /* 24 */ 0, { 9, 10 } },
57 { /* 25 */ 0, { 10, 11 } },
58 { /* 26 */ 0, { 11, 12 } },
59 { /* 27 */ 0, { 12, 13 } },
60 { /* 28 */ 0, { 13, 14 } },
61 { /* 29 */ 0, { 14, 15 } },
62 { /* 30 */ 0, { 15, 16 } },
63 { /* 31 */ 1, { 3, 1 } },
64 { /* 32 */ 1, { 1, 3 } },
65 { /* 33 */ 1, { 2, 2 } },
66 { /* 34 */ 1, { 3, 0 } },
67 { /* 35 */ 1, { 0, 3 } },
68 { /* 36 */ 0, { 11, 12 } },
69 { /* 37 */ 0, { 12, 13 } },
70 { /* 38 */ 0, { 13, 14 } },
71 { /* 39 */ 0, { 14, 15 } },
72 { /* 40 */ 0, { 15, 16 } },
73 { /* 41 */ 0, { 16, 17 } },
74 { /* 42 */ 0, { 17, 18 } },
75 { /* 43 */ 0, { 18, 19 } },
76 { /* 44 */ 0, { 19, 20 } },
77 { /* 45 */ 0, { 20, 21 } },
78 { /* 46 */ 0, { 21, 22 } },
79 { /* 47 */ 1, { 2, 3 } },
80 { /* 48 */ 1, { 3, 2 } },
81 { /* 49 */ 1, { 1, 4 } },
82 { /* 50 */ 1, { 4, 1 } },
83 { /* 51 */ 1, { 1, 5 } },
84 { /* 52 */ 1, { 5, 1 } },
85 { /* 53 */ 1, { 3, 3 } },
86 { /* 54 */ 1, { 2, 4 } },
87 { /* 55 */ 1, { 0, 4 } },
88 { /* 56 */ 1, { 4, 0 } },
89 { /* 57 */ 0, { 12, 13 } },
90 { /* 58 */ 0, { 13, 14 } },
91 { /* 59 */ 0, { 14, 15 } },
92 { /* 60 */ 0, { 15, 16 } },
93 { /* 61 */ 0, { 16, 17 } },
94 { /* 62 */ 0, { 17, 18 } },
95 { /* 63 */ 0, { 18, 19 } },
96 { /* 64 */ 0, { 19, 20 } },
97 { /* 65 */ 0, { 20, 21 } },
98 { /* 66 */ 0, { 21, 22 } },
99 { /* 67 */ 0, { 22, 23 } },
100 { /* 68 */ 0, { 23, 24 } },
101 { /* 69 */ 1, { 4, 2 } },
102 { /* 70 */ 1, { 2, 5 } },
103 { /* 71 */ 1, { 5, 2 } },
104 { /* 72 */ 1, { 0, 5 } },
105 { /* 73 */ 1, { 6, 1 } },
106 { /* 74 */ 1, { 5, 0 } },
107 { /* 75 */ 1, { 1, 6 } },
108 { /* 76 */ 1, { 4, 3 } },
109 { /* 77 */ 1, { 3, 5 } },
110 { /* 78 */ 1, { 3, 4 } },
111 { /* 79 */ 1, { 5, 3 } },
112 { /* 80 */ 1, { 2, 6 } },
113 { /* 81 */ 1, { 6, 2 } },
114 { /* 82 */ 1, { 1, 7 } },
115 { /* 83 */ 0, { 10, 11 } },
116 { /* 84 */ 0, { 11, 12 } },
117 { /* 85 */ 0, { 12, 13 } },
118 { /* 86 */ 0, { 13, 14 } },
119 { /* 87 */ 0, { 14, 15 } },
120 { /* 88 */ 0, { 15, 16 } },
121 { /* 89 */ 0, { 16, 17 } },
122 { /* 90 */ 0, { 17, 18 } },
123 { /* 91 */ 0, { 18, 19 } },
124 { /* 92 */ 0, { 19, 20 } },
125 { /* 93 */ 1, { 3, 6 } },
126 { /* 94 */ 1, { 0, 6 } },
127 { /* 95 */ 1, { 6, 0 } },
128 { /* 96 */ 1, { 4, 4 } },
129 { /* 97 */ 1, { 7, 1 } },
130 { /* 98 */ 1, { 4, 5 } },
131 { /* 99 */ 1, { 7, 2 } },
132 { /* 00 */ 1, { 5, 4 } },
133 { /* 01 */ 1, { 6, 3 } },
134 { /* 02 */ 1, { 2, 7 } },
135 { /* 03 */ 1, { 7, 3 } },
136 { /* 04 */ 1, { 6, 4 } },
137 { /* 05 */ 1, { 5, 5 } },
138 { /* 06 */ 1, { 4, 6 } },
139 { /* 07 */ 1, { 3, 7 } },
140 { /* 08 */ 0, { 5, 6 } },
141 { /* 09 */ 0, { 6, 7 } },
142 { /* 10 */ 0, { 7, 8 } },
143 { /* 11 */ 0, { 8, 9 } },
144 { /* 12 */ 0, { 9, 10 } },
145 { /* 13 */ 1, { 7, 0 } },
146 { /* 14 */ 1, { 0, 7 } },
147 { /* 15 */ 1, { 6, 5 } },
148 { /* 16 */ 1, { 5, 6 } },
149 { /* 17 */ 1, { 7, 4 } },
150 { /* 18 */ 1, { 4, 7 } },
151 { /* 19 */ 1, { 5, 7 } },
152 { /* 20 */ 1, { 7, 5 } },
153 { /* 21 */ 0, { 2, 3 } },
154 { /* 22 */ 0, { 3, 4 } },
155 { /* 23 */ 1, { 7, 6 } },
156 { /* 24 */ 1, { 6, 6 } },
157 { /* 25 */ 1, { 6, 7 } },
158 { /* 26 */ 1, { 7, 7 } }
159};
diff --git a/lib/rbcodec/codecs/libfaad/codebook/hcb_8.h b/lib/rbcodec/codecs/libfaad/codebook/hcb_8.h
new file mode 100644
index 0000000000..b76eb8f667
--- /dev/null
+++ b/lib/rbcodec/codecs/libfaad/codebook/hcb_8.h
@@ -0,0 +1,170 @@
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_8 */
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 */
36static hcb hcb8_1[] ICONST_ATTR = {
37 /* 3 bit codeword */
38 { /* 00000 */ 0, 0 },
39 { /* */ 0, 0 },
40 { /* */ 0, 0 },
41 { /* */ 0, 0 },
42
43 /* 4 bit codewords */
44 { /* 00100 */ 1, 0 },
45 { /* */ 1, 0 },
46 { /* 00110 */ 2, 0 },
47 { /* */ 2, 0 },
48 { /* 01000 */ 3, 0 },
49 { /* */ 3, 0 },
50 { /* 01010 */ 4, 0 },
51 { /* */ 4, 0 },
52 { /* 01100 */ 5, 0 },
53 { /* */ 5, 0 },
54
55 /* 5 bit codewords */
56 { /* 01110 */ 6, 0 },
57 { /* 01111 */ 7, 0 },
58 { /* 10000 */ 8, 0 },
59 { /* 10001 */ 9, 0 },
60 { /* 10010 */ 10, 0 },
61 { /* 10011 */ 11, 0 },
62 { /* 10100 */ 12, 0 },
63
64 /* 6 bit codewords */
65 { /* 10101 */ 13, 1 },
66 { /* 10110 */ 15, 1 },
67 { /* 10111 */ 17, 1 },
68 { /* 11000 */ 19, 1 },
69 { /* 11001 */ 21, 1 },
70
71 /* 7 bit codewords */
72 { /* 11010 */ 23, 2 },
73 { /* 11011 */ 27, 2 },
74 { /* 11100 */ 31, 2 },
75
76 /* 7/8 bit codewords */
77 { /* 11101 */ 35, 3 },
78
79 /* 8 bit codewords */
80 { /* 11110 */ 43, 3 },
81
82 /* 8/9/10 bit codewords */
83 { /* 11111 */ 51, 5 }
84};
85
86/* 2nd step table
87 *
88 * Gives size of codeword and actual data (x,y,v,w)
89 */
90static hcb_2_pair hcb8_2[] ICONST_ATTR = {
91 /* 3 bit codeword */
92 { 3, 1, 1 },
93
94 /* 4 bit codewords */
95 { 4, 2, 1 },
96 { 4, 1, 0 },
97 { 4, 1, 2 },
98 { 4, 0, 1 },
99 { 4, 2, 2 },
100
101 /* 5 bit codewords */
102 { 5, 0, 0 },
103 { 5, 2, 0 },
104 { 5, 0, 2 },
105 { 5, 3, 1 },
106 { 5, 1, 3 },
107 { 5, 3, 2 },
108 { 5, 2, 3 },
109
110 /* 6 bit codewords */
111 { 6, 3, 3 },
112 { 6, 4, 1 },
113 { 6, 1, 4 },
114 { 6, 4, 2 },
115 { 6, 2, 4 },
116 { 6, 3, 0 },
117 { 6, 0, 3 },
118 { 6, 4, 3 },
119 { 6, 3, 4 },
120 { 6, 5, 2 },
121
122 /* 7 bit codewords */
123 { 7, 5, 1 },
124 { 7, 2, 5 },
125 { 7, 1, 5 },
126 { 7, 5, 3 },
127 { 7, 3, 5 },
128 { 7, 4, 4 },
129 { 7, 5, 4 },
130 { 7, 0, 4 },
131 { 7, 4, 5 },
132 { 7, 4, 0 },
133 { 7, 2, 6 },
134 { 7, 6, 2 },
135
136 /* 7/8 bit codewords */
137 { 7, 6, 1 }, { 7, 6, 1 },
138 { 7, 1, 6 }, { 7, 1, 6 },
139 { 8, 3, 6 },
140 { 8, 6, 3 },
141 { 8, 5, 5 },
142 { 8, 5, 0 },
143
144 /* 8 bit codewords */
145 { 8, 6, 4 },
146 { 8, 0, 5 },
147 { 8, 4, 6 },
148 { 8, 7, 1 },
149 { 8, 7, 2 },
150 { 8, 2, 7 },
151 { 8, 6, 5 },
152 { 8, 7, 3 },
153
154 /* 8/9/10 bit codewords */
155 { 8, 1, 7 }, { 8, 1, 7 }, { 8, 1, 7 }, { 8, 1, 7 },
156 { 8, 5, 6 }, { 8, 5, 6 }, { 8, 5, 6 }, { 8, 5, 6 },
157 { 8, 3, 7 }, { 8, 3, 7 }, { 8, 3, 7 }, { 8, 3, 7 },
158 { 9, 6, 6 }, { 9, 6, 6 },
159 { 9, 7, 4 }, { 9, 7, 4 },
160 { 9, 6, 0 }, { 9, 6, 0 },
161 { 9, 4, 7 }, { 9, 4, 7 },
162 { 9, 0, 6 }, { 9, 0, 6 },
163 { 9, 7, 5 }, { 9, 7, 5 },
164 { 9, 7, 6 }, { 9, 7, 6 },
165 { 9, 6, 7 }, { 9, 6, 7 },
166 { 10, 5, 7 },
167 { 10, 7, 0 },
168 { 10, 0, 7 },
169 { 10, 7, 7 }
170};
diff --git a/lib/rbcodec/codecs/libfaad/codebook/hcb_9.h b/lib/rbcodec/codecs/libfaad/codebook/hcb_9.h
new file mode 100644
index 0000000000..2932001294
--- /dev/null
+++ b/lib/rbcodec/codecs/libfaad/codebook/hcb_9.h
@@ -0,0 +1,369 @@
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/* Binary search huffman table HCB_9 */
29
30
31static hcb_bin_pair hcb9[] ICONST_ATTR_FAAD_LARGE_IRAM = {
32 { /* 0 */ 0, { 1, 2 } },
33 { /* 1 */ 1, { 0, 0 } },
34 { /* 2 */ 0, { 1, 2 } },
35 { /* 3 */ 0, { 2, 3 } },
36 { /* 4 */ 0, { 3, 4 } },
37 { /* 5 */ 1, { 1, 0 } },
38 { /* 6 */ 1, { 0, 1 } },
39 { /* 7 */ 0, { 2, 3 } },
40 { /* 8 */ 0, { 3, 4 } },
41 { /* 9 */ 1, { 1, 1 } },
42 { /* 10 */ 0, { 3, 4 } },
43 { /* 11 */ 0, { 4, 5 } },
44 { /* 12 */ 0, { 5, 6 } },
45 { /* 13 */ 0, { 6, 7 } },
46 { /* 14 */ 0, { 7, 8 } },
47 { /* 15 */ 0, { 8, 9 } },
48 { /* 16 */ 0, { 9, 10 } },
49 { /* 17 */ 0, { 10, 11 } },
50 { /* 18 */ 0, { 11, 12 } },
51 { /* 19 */ 1, { 2, 1 } },
52 { /* 20 */ 1, { 1, 2 } },
53 { /* 21 */ 1, { 2, 0 } },
54 { /* 22 */ 1, { 0, 2 } },
55 { /* 23 */ 0, { 8, 9 } },
56 { /* 24 */ 0, { 9, 10 } },
57 { /* 25 */ 0, { 10, 11 } },
58 { /* 26 */ 0, { 11, 12 } },
59 { /* 27 */ 0, { 12, 13 } },
60 { /* 28 */ 0, { 13, 14 } },
61 { /* 29 */ 0, { 14, 15 } },
62 { /* 30 */ 0, { 15, 16 } },
63 { /* 31 */ 1, { 3, 1 } },
64 { /* 32 */ 1, { 2, 2 } },
65 { /* 33 */ 1, { 1, 3 } },
66 { /* 34 */ 0, { 13, 14 } },
67 { /* 35 */ 0, { 14, 15 } },
68 { /* 36 */ 0, { 15, 16 } },
69 { /* 37 */ 0, { 16, 17 } },
70 { /* 38 */ 0, { 17, 18 } },
71 { /* 39 */ 0, { 18, 19 } },
72 { /* 40 */ 0, { 19, 20 } },
73 { /* 41 */ 0, { 20, 21 } },
74 { /* 42 */ 0, { 21, 22 } },
75 { /* 43 */ 0, { 22, 23 } },
76 { /* 44 */ 0, { 23, 24 } },
77 { /* 45 */ 0, { 24, 25 } },
78 { /* 46 */ 0, { 25, 26 } },
79 { /* 47 */ 1, { 3, 0 } },
80 { /* 48 */ 1, { 0, 3 } },
81 { /* 49 */ 1, { 2, 3 } },
82 { /* 50 */ 1, { 3, 2 } },
83 { /* 51 */ 1, { 1, 4 } },
84 { /* 52 */ 1, { 4, 1 } },
85 { /* 53 */ 1, { 2, 4 } },
86 { /* 54 */ 1, { 1, 5 } },
87 { /* 55 */ 0, { 18, 19 } },
88 { /* 56 */ 0, { 19, 20 } },
89 { /* 57 */ 0, { 20, 21 } },
90 { /* 58 */ 0, { 21, 22 } },
91 { /* 59 */ 0, { 22, 23 } },
92 { /* 60 */ 0, { 23, 24 } },
93 { /* 61 */ 0, { 24, 25 } },
94 { /* 62 */ 0, { 25, 26 } },
95 { /* 63 */ 0, { 26, 27 } },
96 { /* 64 */ 0, { 27, 28 } },
97 { /* 65 */ 0, { 28, 29 } },
98 { /* 66 */ 0, { 29, 30 } },
99 { /* 67 */ 0, { 30, 31 } },
100 { /* 68 */ 0, { 31, 32 } },
101 { /* 69 */ 0, { 32, 33 } },
102 { /* 70 */ 0, { 33, 34 } },
103 { /* 71 */ 0, { 34, 35 } },
104 { /* 72 */ 0, { 35, 36 } },
105 { /* 73 */ 1, { 4, 2 } },
106 { /* 74 */ 1, { 3, 3 } },
107 { /* 75 */ 1, { 0, 4 } },
108 { /* 76 */ 1, { 4, 0 } },
109 { /* 77 */ 1, { 5, 1 } },
110 { /* 78 */ 1, { 2, 5 } },
111 { /* 79 */ 1, { 1, 6 } },
112 { /* 80 */ 1, { 3, 4 } },
113 { /* 81 */ 1, { 5, 2 } },
114 { /* 82 */ 1, { 6, 1 } },
115 { /* 83 */ 1, { 4, 3 } },
116 { /* 84 */ 0, { 25, 26 } },
117 { /* 85 */ 0, { 26, 27 } },
118 { /* 86 */ 0, { 27, 28 } },
119 { /* 87 */ 0, { 28, 29 } },
120 { /* 88 */ 0, { 29, 30 } },
121 { /* 89 */ 0, { 30, 31 } },
122 { /* 90 */ 0, { 31, 32 } },
123 { /* 91 */ 0, { 32, 33 } },
124 { /* 92 */ 0, { 33, 34 } },
125 { /* 93 */ 0, { 34, 35 } },
126 { /* 94 */ 0, { 35, 36 } },
127 { /* 95 */ 0, { 36, 37 } },
128 { /* 96 */ 0, { 37, 38 } },
129 { /* 97 */ 0, { 38, 39 } },
130 { /* 98 */ 0, { 39, 40 } },
131 { /* 99 */ 0, { 40, 41 } },
132 { /* 00 */ 0, { 41, 42 } },
133 { /* 01 */ 0, { 42, 43 } },
134 { /* 02 */ 0, { 43, 44 } },
135 { /* 03 */ 0, { 44, 45 } },
136 { /* 04 */ 0, { 45, 46 } },
137 { /* 05 */ 0, { 46, 47 } },
138 { /* 06 */ 0, { 47, 48 } },
139 { /* 07 */ 0, { 48, 49 } },
140 { /* 08 */ 0, { 49, 50 } },
141 { /* 09 */ 1, { 0, 5 } },
142 { /* 10 */ 1, { 2, 6 } },
143 { /* 11 */ 1, { 5, 0 } },
144 { /* 12 */ 1, { 1, 7 } },
145 { /* 13 */ 1, { 3, 5 } },
146 { /* 14 */ 1, { 1, 8 } },
147 { /* 15 */ 1, { 8, 1 } },
148 { /* 16 */ 1, { 4, 4 } },
149 { /* 17 */ 1, { 5, 3 } },
150 { /* 18 */ 1, { 6, 2 } },
151 { /* 19 */ 1, { 7, 1 } },
152 { /* 20 */ 1, { 0, 6 } },
153 { /* 21 */ 1, { 8, 2 } },
154 { /* 22 */ 1, { 2, 8 } },
155 { /* 23 */ 1, { 3, 6 } },
156 { /* 24 */ 1, { 2, 7 } },
157 { /* 25 */ 1, { 4, 5 } },
158 { /* 26 */ 1, { 9, 1 } },
159 { /* 27 */ 1, { 1, 9 } },
160 { /* 28 */ 1, { 7, 2 } },
161 { /* 29 */ 0, { 30, 31 } },
162 { /* 30 */ 0, { 31, 32 } },
163 { /* 31 */ 0, { 32, 33 } },
164 { /* 32 */ 0, { 33, 34 } },
165 { /* 33 */ 0, { 34, 35 } },
166 { /* 34 */ 0, { 35, 36 } },
167 { /* 35 */ 0, { 36, 37 } },
168 { /* 36 */ 0, { 37, 38 } },
169 { /* 37 */ 0, { 38, 39 } },
170 { /* 38 */ 0, { 39, 40 } },
171 { /* 39 */ 0, { 40, 41 } },
172 { /* 40 */ 0, { 41, 42 } },
173 { /* 41 */ 0, { 42, 43 } },
174 { /* 42 */ 0, { 43, 44 } },
175 { /* 43 */ 0, { 44, 45 } },
176 { /* 44 */ 0, { 45, 46 } },
177 { /* 45 */ 0, { 46, 47 } },
178 { /* 46 */ 0, { 47, 48 } },
179 { /* 47 */ 0, { 48, 49 } },
180 { /* 48 */ 0, { 49, 50 } },
181 { /* 49 */ 0, { 50, 51 } },
182 { /* 50 */ 0, { 51, 52 } },
183 { /* 51 */ 0, { 52, 53 } },
184 { /* 52 */ 0, { 53, 54 } },
185 { /* 53 */ 0, { 54, 55 } },
186 { /* 54 */ 0, { 55, 56 } },
187 { /* 55 */ 0, { 56, 57 } },
188 { /* 56 */ 0, { 57, 58 } },
189 { /* 57 */ 0, { 58, 59 } },
190 { /* 58 */ 0, { 59, 60 } },
191 { /* 59 */ 1, { 6, 0 } },
192 { /* 60 */ 1, { 5, 4 } },
193 { /* 61 */ 1, { 6, 3 } },
194 { /* 62 */ 1, { 8, 3 } },
195 { /* 63 */ 1, { 0, 7 } },
196 { /* 64 */ 1, { 9, 2 } },
197 { /* 65 */ 1, { 3, 8 } },
198 { /* 66 */ 1, { 4, 6 } },
199 { /* 67 */ 1, { 3, 7 } },
200 { /* 68 */ 1, { 0, 8 } },
201 { /* 69 */ 1, { 10, 1 } },
202 { /* 70 */ 1, { 6, 4 } },
203 { /* 71 */ 1, { 2, 9 } },
204 { /* 72 */ 1, { 5, 5 } },
205 { /* 73 */ 1, { 8, 0 } },
206 { /* 74 */ 1, { 7, 0 } },
207 { /* 75 */ 1, { 7, 3 } },
208 { /* 76 */ 1, { 10, 2 } },
209 { /* 77 */ 1, { 9, 3 } },
210 { /* 78 */ 1, { 8, 4 } },
211 { /* 79 */ 1, { 1, 10 } },
212 { /* 80 */ 1, { 7, 4 } },
213 { /* 81 */ 1, { 6, 5 } },
214 { /* 82 */ 1, { 5, 6 } },
215 { /* 83 */ 1, { 4, 8 } },
216 { /* 84 */ 1, { 4, 7 } },
217 { /* 85 */ 1, { 3, 9 } },
218 { /* 86 */ 1, { 11, 1 } },
219 { /* 87 */ 1, { 5, 8 } },
220 { /* 88 */ 1, { 9, 0 } },
221 { /* 89 */ 1, { 8, 5 } },
222 { /* 90 */ 0, { 29, 30 } },
223 { /* 91 */ 0, { 30, 31 } },
224 { /* 92 */ 0, { 31, 32 } },
225 { /* 93 */ 0, { 32, 33 } },
226 { /* 94 */ 0, { 33, 34 } },
227 { /* 95 */ 0, { 34, 35 } },
228 { /* 96 */ 0, { 35, 36 } },
229 { /* 97 */ 0, { 36, 37 } },
230 { /* 98 */ 0, { 37, 38 } },
231 { /* 99 */ 0, { 38, 39 } },
232 { /* 00 */ 0, { 39, 40 } },
233 { /* 01 */ 0, { 40, 41 } },
234 { /* 02 */ 0, { 41, 42 } },
235 { /* 03 */ 0, { 42, 43 } },
236 { /* 04 */ 0, { 43, 44 } },
237 { /* 05 */ 0, { 44, 45 } },
238 { /* 06 */ 0, { 45, 46 } },
239 { /* 07 */ 0, { 46, 47 } },
240 { /* 08 */ 0, { 47, 48 } },
241 { /* 09 */ 0, { 48, 49 } },
242 { /* 10 */ 0, { 49, 50 } },
243 { /* 11 */ 0, { 50, 51 } },
244 { /* 12 */ 0, { 51, 52 } },
245 { /* 13 */ 0, { 52, 53 } },
246 { /* 14 */ 0, { 53, 54 } },
247 { /* 15 */ 0, { 54, 55 } },
248 { /* 16 */ 0, { 55, 56 } },
249 { /* 17 */ 0, { 56, 57 } },
250 { /* 18 */ 0, { 57, 58 } },
251 { /* 19 */ 1, { 10, 3 } },
252 { /* 20 */ 1, { 2, 10 } },
253 { /* 21 */ 1, { 0, 9 } },
254 { /* 22 */ 1, { 11, 2 } },
255 { /* 23 */ 1, { 9, 4 } },
256 { /* 24 */ 1, { 6, 6 } },
257 { /* 25 */ 1, { 12, 1 } },
258 { /* 26 */ 1, { 4, 9 } },
259 { /* 27 */ 1, { 8, 6 } },
260 { /* 28 */ 1, { 1, 11 } },
261 { /* 29 */ 1, { 9, 5 } },
262 { /* 30 */ 1, { 10, 4 } },
263 { /* 31 */ 1, { 5, 7 } },
264 { /* 32 */ 1, { 7, 5 } },
265 { /* 33 */ 1, { 2, 11 } },
266 { /* 34 */ 1, { 1, 12 } },
267 { /* 35 */ 1, { 12, 2 } },
268 { /* 36 */ 1, { 11, 3 } },
269 { /* 37 */ 1, { 3, 10 } },
270 { /* 38 */ 1, { 5, 9 } },
271 { /* 39 */ 1, { 6, 7 } },
272 { /* 40 */ 1, { 8, 7 } },
273 { /* 41 */ 1, { 11, 4 } },
274 { /* 42 */ 1, { 0, 10 } },
275 { /* 43 */ 1, { 7, 6 } },
276 { /* 44 */ 1, { 12, 3 } },
277 { /* 45 */ 1, { 10, 0 } },
278 { /* 46 */ 1, { 10, 5 } },
279 { /* 47 */ 1, { 4, 10 } },
280 { /* 48 */ 1, { 6, 8 } },
281 { /* 49 */ 1, { 2, 12 } },
282 { /* 50 */ 1, { 9, 6 } },
283 { /* 51 */ 1, { 9, 7 } },
284 { /* 52 */ 1, { 4, 11 } },
285 { /* 53 */ 1, { 11, 0 } },
286 { /* 54 */ 1, { 6, 9 } },
287 { /* 55 */ 1, { 3, 11 } },
288 { /* 56 */ 1, { 5, 10 } },
289 { /* 57 */ 0, { 20, 21 } },
290 { /* 58 */ 0, { 21, 22 } },
291 { /* 59 */ 0, { 22, 23 } },
292 { /* 60 */ 0, { 23, 24 } },
293 { /* 61 */ 0, { 24, 25 } },
294 { /* 62 */ 0, { 25, 26 } },
295 { /* 63 */ 0, { 26, 27 } },
296 { /* 64 */ 0, { 27, 28 } },
297 { /* 65 */ 0, { 28, 29 } },
298 { /* 66 */ 0, { 29, 30 } },
299 { /* 67 */ 0, { 30, 31 } },
300 { /* 68 */ 0, { 31, 32 } },
301 { /* 69 */ 0, { 32, 33 } },
302 { /* 70 */ 0, { 33, 34 } },
303 { /* 71 */ 0, { 34, 35 } },
304 { /* 72 */ 0, { 35, 36 } },
305 { /* 73 */ 0, { 36, 37 } },
306 { /* 74 */ 0, { 37, 38 } },
307 { /* 75 */ 0, { 38, 39 } },
308 { /* 76 */ 0, { 39, 40 } },
309 { /* 77 */ 1, { 8, 8 } },
310 { /* 78 */ 1, { 7, 8 } },
311 { /* 79 */ 1, { 12, 5 } },
312 { /* 80 */ 1, { 3, 12 } },
313 { /* 81 */ 1, { 11, 5 } },
314 { /* 82 */ 1, { 7, 7 } },
315 { /* 83 */ 1, { 12, 4 } },
316 { /* 84 */ 1, { 11, 6 } },
317 { /* 85 */ 1, { 10, 6 } },
318 { /* 86 */ 1, { 4, 12 } },
319 { /* 87 */ 1, { 7, 9 } },
320 { /* 88 */ 1, { 5, 11 } },
321 { /* 89 */ 1, { 0, 11 } },
322 { /* 90 */ 1, { 12, 6 } },
323 { /* 91 */ 1, { 6, 10 } },
324 { /* 92 */ 1, { 12, 0 } },
325 { /* 93 */ 1, { 10, 7 } },
326 { /* 94 */ 1, { 5, 12 } },
327 { /* 95 */ 1, { 7, 10 } },
328 { /* 96 */ 1, { 9, 8 } },
329 { /* 97 */ 1, { 0, 12 } },
330 { /* 98 */ 1, { 11, 7 } },
331 { /* 99 */ 1, { 8, 9 } },
332 { /* 00 */ 1, { 9, 9 } },
333 { /* 01 */ 1, { 10, 8 } },
334 { /* 02 */ 1, { 7, 11 } },
335 { /* 03 */ 1, { 12, 7 } },
336 { /* 04 */ 1, { 6, 11 } },
337 { /* 05 */ 1, { 8, 11 } },
338 { /* 06 */ 1, { 11, 8 } },
339 { /* 07 */ 1, { 7, 12 } },
340 { /* 08 */ 1, { 6, 12 } },
341 { /* 09 */ 0, { 8, 9 } },
342 { /* 10 */ 0, { 9, 10 } },
343 { /* 11 */ 0, { 10, 11 } },
344 { /* 12 */ 0, { 11, 12 } },
345 { /* 13 */ 0, { 12, 13 } },
346 { /* 14 */ 0, { 13, 14 } },
347 { /* 15 */ 0, { 14, 15 } },
348 { /* 16 */ 0, { 15, 16 } },
349 { /* 17 */ 1, { 8, 10 } },
350 { /* 18 */ 1, { 10, 9 } },
351 { /* 19 */ 1, { 8, 12 } },
352 { /* 20 */ 1, { 9, 10 } },
353 { /* 21 */ 1, { 9, 11 } },
354 { /* 22 */ 1, { 9, 12 } },
355 { /* 23 */ 1, { 10, 11 } },
356 { /* 24 */ 1, { 12, 9 } },
357 { /* 25 */ 1, { 10, 10 } },
358 { /* 26 */ 1, { 11, 9 } },
359 { /* 27 */ 1, { 12, 8 } },
360 { /* 28 */ 1, { 11, 10 } },
361 { /* 29 */ 1, { 12, 10 } },
362 { /* 30 */ 1, { 12, 11 } },
363 { /* 31 */ 0, { 2, 3 } },
364 { /* 32 */ 0, { 3, 4 } },
365 { /* 33 */ 1, { 10, 12 } },
366 { /* 34 */ 1, { 11, 11 } },
367 { /* 35 */ 1, { 11, 12 } },
368 { /* 36 */ 1, { 12, 12 } }
369};
diff --git a/lib/rbcodec/codecs/libfaad/codebook/hcb_sf.h b/lib/rbcodec/codecs/libfaad/codebook/hcb_sf.h
new file mode 100644
index 0000000000..66762e2fce
--- /dev/null
+++ b/lib/rbcodec/codecs/libfaad/codebook/hcb_sf.h
@@ -0,0 +1,273 @@
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/* Binary search huffman table HCB_SF */
29
30
31static uint8_t hcb_sf[][2] ICONST_ATTR_FAAD_LARGE_IRAM = {
32 { /* 0 */ 1, 2 },
33 { /* 1 */ 60, 0 },
34 { /* 2 */ 1, 2 },
35 { /* 3 */ 2, 3 },
36 { /* 4 */ 3, 4 },
37 { /* 5 */ 59, 0 },
38 { /* 6 */ 3, 4 },
39 { /* 7 */ 4, 5 },
40 { /* 8 */ 5, 6 },
41 { /* 9 */ 61, 0 },
42 { /* 10 */ 58, 0 },
43 { /* 11 */ 62, 0 },
44 { /* 12 */ 3, 4 },
45 { /* 13 */ 4, 5 },
46 { /* 14 */ 5, 6 },
47 { /* 15 */ 57, 0 },
48 { /* 16 */ 63, 0 },
49 { /* 17 */ 4, 5 },
50 { /* 18 */ 5, 6 },
51 { /* 19 */ 6, 7 },
52 { /* 20 */ 7, 8 },
53 { /* 21 */ 56, 0 },
54 { /* 22 */ 64, 0 },
55 { /* 23 */ 55, 0 },
56 { /* 24 */ 65, 0 },
57 { /* 25 */ 4, 5 },
58 { /* 26 */ 5, 6 },
59 { /* 27 */ 6, 7 },
60 { /* 28 */ 7, 8 },
61 { /* 29 */ 66, 0 },
62 { /* 30 */ 54, 0 },
63 { /* 31 */ 67, 0 },
64 { /* 32 */ 5, 6 },
65 { /* 33 */ 6, 7 },
66 { /* 34 */ 7, 8 },
67 { /* 35 */ 8, 9 },
68 { /* 36 */ 9, 10 },
69 { /* 37 */ 53, 0 },
70 { /* 38 */ 68, 0 },
71 { /* 39 */ 52, 0 },
72 { /* 40 */ 69, 0 },
73 { /* 41 */ 51, 0 },
74 { /* 42 */ 5, 6 },
75 { /* 43 */ 6, 7 },
76 { /* 44 */ 7, 8 },
77 { /* 45 */ 8, 9 },
78 { /* 46 */ 9, 10 },
79 { /* 47 */ 70, 0 },
80 { /* 48 */ 50, 0 },
81 { /* 49 */ 49, 0 },
82 { /* 50 */ 71, 0 },
83 { /* 51 */ 6, 7 },
84 { /* 52 */ 7, 8 },
85 { /* 53 */ 8, 9 },
86 { /* 54 */ 9, 10 },
87 { /* 55 */ 10, 11 },
88 { /* 56 */ 11, 12 },
89 { /* 57 */ 72, 0 },
90 { /* 58 */ 48, 0 },
91 { /* 59 */ 73, 0 },
92 { /* 60 */ 47, 0 },
93 { /* 61 */ 74, 0 },
94 { /* 62 */ 46, 0 },
95 { /* 63 */ 6, 7 },
96 { /* 64 */ 7, 8 },
97 { /* 65 */ 8, 9 },
98 { /* 66 */ 9, 10 },
99 { /* 67 */ 10, 11 },
100 { /* 68 */ 11, 12 },
101 { /* 69 */ 76, 0 },
102 { /* 70 */ 75, 0 },
103 { /* 71 */ 77, 0 },
104 { /* 72 */ 78, 0 },
105 { /* 73 */ 45, 0 },
106 { /* 74 */ 43, 0 },
107 { /* 75 */ 6, 7 },
108 { /* 76 */ 7, 8 },
109 { /* 77 */ 8, 9 },
110 { /* 78 */ 9, 10 },
111 { /* 79 */ 10, 11 },
112 { /* 80 */ 11, 12 },
113 { /* 81 */ 44, 0 },
114 { /* 82 */ 79, 0 },
115 { /* 83 */ 42, 0 },
116 { /* 84 */ 41, 0 },
117 { /* 85 */ 80, 0 },
118 { /* 86 */ 40, 0 },
119 { /* 87 */ 6, 7 },
120 { /* 88 */ 7, 8 },
121 { /* 89 */ 8, 9 },
122 { /* 90 */ 9, 10 },
123 { /* 91 */ 10, 11 },
124 { /* 92 */ 11, 12 },
125 { /* 93 */ 81, 0 },
126 { /* 94 */ 39, 0 },
127 { /* 95 */ 82, 0 },
128 { /* 96 */ 38, 0 },
129 { /* 97 */ 83, 0 },
130 { /* 98 */ 7, 8 },
131 { /* 99 */ 8, 9 },
132 { /* 00 */ 9, 10 },
133 { /* 01 */ 10, 11 },
134 { /* 02 */ 11, 12 },
135 { /* 03 */ 12, 13 },
136 { /* 04 */ 13, 14 },
137 { /* 05 */ 37, 0 },
138 { /* 06 */ 35, 0 },
139 { /* 07 */ 85, 0 },
140 { /* 08 */ 33, 0 },
141 { /* 09 */ 36, 0 },
142 { /* 10 */ 34, 0 },
143 { /* 11 */ 84, 0 },
144 { /* 12 */ 32, 0 },
145 { /* 13 */ 6, 7 },
146 { /* 14 */ 7, 8 },
147 { /* 15 */ 8, 9 },
148 { /* 16 */ 9, 10 },
149 { /* 17 */ 10, 11 },
150 { /* 18 */ 11, 12 },
151 { /* 19 */ 87, 0 },
152 { /* 20 */ 89, 0 },
153 { /* 21 */ 30, 0 },
154 { /* 22 */ 31, 0 },
155 { /* 23 */ 8, 9 },
156 { /* 24 */ 9, 10 },
157 { /* 25 */ 10, 11 },
158 { /* 26 */ 11, 12 },
159 { /* 27 */ 12, 13 },
160 { /* 28 */ 13, 14 },
161 { /* 29 */ 14, 15 },
162 { /* 30 */ 15, 16 },
163 { /* 31 */ 86, 0 },
164 { /* 32 */ 29, 0 },
165 { /* 33 */ 26, 0 },
166 { /* 34 */ 27, 0 },
167 { /* 35 */ 28, 0 },
168 { /* 36 */ 24, 0 },
169 { /* 37 */ 88, 0 },
170 { /* 38 */ 9, 10 },
171 { /* 39 */ 10, 11 },
172 { /* 40 */ 11, 12 },
173 { /* 41 */ 12, 13 },
174 { /* 42 */ 13, 14 },
175 { /* 43 */ 14, 15 },
176 { /* 44 */ 15, 16 },
177 { /* 45 */ 16, 17 },
178 { /* 46 */ 17, 18 },
179 { /* 47 */ 25, 0 },
180 { /* 48 */ 22, 0 },
181 { /* 49 */ 23, 0 },
182 { /* 50 */ 15, 16 },
183 { /* 51 */ 16, 17 },
184 { /* 52 */ 17, 18 },
185 { /* 53 */ 18, 19 },
186 { /* 54 */ 19, 20 },
187 { /* 55 */ 20, 21 },
188 { /* 56 */ 21, 22 },
189 { /* 57 */ 22, 23 },
190 { /* 58 */ 23, 24 },
191 { /* 59 */ 24, 25 },
192 { /* 60 */ 25, 26 },
193 { /* 61 */ 26, 27 },
194 { /* 62 */ 27, 28 },
195 { /* 63 */ 28, 29 },
196 { /* 64 */ 29, 30 },
197 { /* 65 */ 90, 0 },
198 { /* 66 */ 21, 0 },
199 { /* 67 */ 19, 0 },
200 { /* 68 */ 3, 0 },
201 { /* 69 */ 1, 0 },
202 { /* 70 */ 2, 0 },
203 { /* 71 */ 0, 0 },
204 { /* 72 */ 23, 24 },
205 { /* 73 */ 24, 25 },
206 { /* 74 */ 25, 26 },
207 { /* 75 */ 26, 27 },
208 { /* 76 */ 27, 28 },
209 { /* 77 */ 28, 29 },
210 { /* 78 */ 29, 30 },
211 { /* 79 */ 30, 31 },
212 { /* 80 */ 31, 32 },
213 { /* 81 */ 32, 33 },
214 { /* 82 */ 33, 34 },
215 { /* 83 */ 34, 35 },
216 { /* 84 */ 35, 36 },
217 { /* 85 */ 36, 37 },
218 { /* 86 */ 37, 38 },
219 { /* 87 */ 38, 39 },
220 { /* 88 */ 39, 40 },
221 { /* 89 */ 40, 41 },
222 { /* 90 */ 41, 42 },
223 { /* 91 */ 42, 43 },
224 { /* 92 */ 43, 44 },
225 { /* 93 */ 44, 45 },
226 { /* 94 */ 45, 46 },
227 { /* 95 */ 98, 0 },
228 { /* 96 */ 99, 0 },
229 { /* 97 */ 100, 0 },
230 { /* 98 */ 101, 0 },
231 { /* 99 */ 102, 0 },
232 { /* 00 */ 117, 0 },
233 { /* 01 */ 97, 0 },
234 { /* 02 */ 91, 0 },
235 { /* 03 */ 92, 0 },
236 { /* 04 */ 93, 0 },
237 { /* 05 */ 94, 0 },
238 { /* 06 */ 95, 0 },
239 { /* 07 */ 96, 0 },
240 { /* 08 */ 104, 0 },
241 { /* 09 */ 111, 0 },
242 { /* 10 */ 112, 0 },
243 { /* 11 */ 113, 0 },
244 { /* 12 */ 114, 0 },
245 { /* 13 */ 115, 0 },
246 { /* 14 */ 116, 0 },
247 { /* 15 */ 110, 0 },
248 { /* 16 */ 105, 0 },
249 { /* 17 */ 106, 0 },
250 { /* 18 */ 107, 0 },
251 { /* 19 */ 108, 0 },
252 { /* 20 */ 109, 0 },
253 { /* 21 */ 118, 0 },
254 { /* 22 */ 6, 0 },
255 { /* 23 */ 8, 0 },
256 { /* 24 */ 9, 0 },
257 { /* 25 */ 10, 0 },
258 { /* 26 */ 5, 0 },
259 { /* 27 */ 103, 0 },
260 { /* 28 */ 120, 0 },
261 { /* 29 */ 119, 0 },
262 { /* 30 */ 4, 0 },
263 { /* 31 */ 7, 0 },
264 { /* 32 */ 15, 0 },
265 { /* 33 */ 16, 0 },
266 { /* 34 */ 18, 0 },
267 { /* 35 */ 20, 0 },
268 { /* 36 */ 17, 0 },
269 { /* 37 */ 11, 0 },
270 { /* 38 */ 12, 0 },
271 { /* 39 */ 14, 0 },
272 { /* 40 */ 13, 0 }
273};