This commit implements a full ATRAC9 decoder, a simple low-delay codec
developed by Sony and used in most PSVita games, some PS3 games and some
PS4 games. Its similar to AAC in that it uses Huffman coded scalefactors
but instead of vector quantization it just Huffman codes the spectral
coefficients (in a way similar to how Opus splits band energy coding
into coarse and fine precision). It opts to write rather large Huffman
codes by packing several small coefficients into one Huffman coded
symbol, though I don't believe this increases efficiency at all.
Band extension implements SBC in a simple way, first it mirrors the
lower spectrum onto the higher frequencies and then it uses one of 5
filters to shape it. Noise substitution is implemented via 2 of them.
Unlike previous ATRAC codecs, there's no QMF, this is a standard MDCT
codec.
Based off of the reverse engineering work of Alex Barney.
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
... | ... |
@@ -2565,6 +2565,7 @@ asv2_encoder_select="bswapdsp fdctdsp pixblockdsp" |
2565 | 2565 |
atrac1_decoder_select="mdct sinewin" |
2566 | 2566 |
atrac3_decoder_select="mdct" |
2567 | 2567 |
atrac3p_decoder_select="mdct sinewin" |
2568 |
+atrac9_decoder_select="mdct" |
|
2568 | 2569 |
avrn_decoder_select="exif jpegtables" |
2569 | 2570 |
bink_decoder_select="blockdsp hpeldsp" |
2570 | 2571 |
binkaudio_dct_decoder_select="mdct rdft dct sinewin wma_freqs" |
... | ... |
@@ -210,6 +210,7 @@ OBJS-$(CONFIG_ATRAC3P_DECODER) += atrac3plusdec.o atrac3plus.o \ |
210 | 210 |
atrac3plusdsp.o atrac.o |
211 | 211 |
OBJS-$(CONFIG_ATRAC3PAL_DECODER) += atrac3plusdec.o atrac3plus.o \ |
212 | 212 |
atrac3plusdsp.o atrac.o |
213 |
+OBJS-$(CONFIG_ATRAC9_DECODER) += atrac9dec.o |
|
213 | 214 |
OBJS-$(CONFIG_AURA_DECODER) += cyuv.o |
214 | 215 |
OBJS-$(CONFIG_AURA2_DECODER) += aura.o |
215 | 216 |
OBJS-$(CONFIG_AVRN_DECODER) += avrndec.o mjpegdec.o |
... | ... |
@@ -392,6 +392,7 @@ extern AVCodec ff_atrac3_decoder; |
392 | 392 |
extern AVCodec ff_atrac3al_decoder; |
393 | 393 |
extern AVCodec ff_atrac3p_decoder; |
394 | 394 |
extern AVCodec ff_atrac3pal_decoder; |
395 |
+extern AVCodec ff_atrac9_decoder; |
|
395 | 396 |
extern AVCodec ff_binkaudio_dct_decoder; |
396 | 397 |
extern AVCodec ff_binkaudio_rdft_decoder; |
397 | 398 |
extern AVCodec ff_bmv_audio_decoder; |
398 | 399 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,929 @@ |
0 |
+/* |
|
1 |
+ * ATRAC9 decoder |
|
2 |
+ * Copyright (c) 2018 Rostislav Pehlivanov <atomnuker@gmail.com> |
|
3 |
+ * |
|
4 |
+ * This file is part of FFmpeg. |
|
5 |
+ * |
|
6 |
+ * FFmpeg is free software; you can redistribute it and/or |
|
7 |
+ * modify it under the terms of the GNU Lesser General Public |
|
8 |
+ * License as published by the Free Software Foundation; either |
|
9 |
+ * version 2.1 of the License, or (at your option) any later version. |
|
10 |
+ * |
|
11 |
+ * FFmpeg is distributed in the hope that it will be useful, |
|
12 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
14 |
+ * Lesser General Public License for more details. |
|
15 |
+ * |
|
16 |
+ * You should have received a copy of the GNU Lesser General Public |
|
17 |
+ * License along with FFmpeg; if not, write to the Free Software |
|
18 |
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
|
19 |
+ */ |
|
20 |
+ |
|
21 |
+#include "internal.h" |
|
22 |
+#include "get_bits.h" |
|
23 |
+#include "fft.h" |
|
24 |
+#include "atrac9tab.h" |
|
25 |
+#include "libavutil/lfg.h" |
|
26 |
+#include "libavutil/float_dsp.h" |
|
27 |
+ |
|
28 |
+typedef struct ATRAC9ChannelData { |
|
29 |
+ int band_ext; |
|
30 |
+ int q_unit_cnt; |
|
31 |
+ int band_ext_data[4]; |
|
32 |
+ int32_t scalefactors[31]; |
|
33 |
+ int32_t scalefactors_prev[31]; |
|
34 |
+ |
|
35 |
+ int precision_coarse[30]; |
|
36 |
+ int precision_fine[30]; |
|
37 |
+ int precision_mask[30]; |
|
38 |
+ |
|
39 |
+ int codebookset[30]; |
|
40 |
+ |
|
41 |
+ int32_t q_coeffs_coarse[256]; |
|
42 |
+ int32_t q_coeffs_fine[256]; |
|
43 |
+ |
|
44 |
+ DECLARE_ALIGNED(32, float, coeffs )[256]; |
|
45 |
+ DECLARE_ALIGNED(32, float, prev_win)[128]; |
|
46 |
+} ATRAC9ChannelData; |
|
47 |
+ |
|
48 |
+typedef struct ATRAC9BlockData { |
|
49 |
+ ATRAC9ChannelData channel[2]; |
|
50 |
+ |
|
51 |
+ /* Base */ |
|
52 |
+ int band_count; |
|
53 |
+ int q_unit_cnt; |
|
54 |
+ int q_unit_cnt_prev; |
|
55 |
+ |
|
56 |
+ /* Stereo block only */ |
|
57 |
+ int stereo_q_unit; |
|
58 |
+ |
|
59 |
+ /* Band extension only */ |
|
60 |
+ int has_band_ext; |
|
61 |
+ int has_band_ext_data; |
|
62 |
+ int band_ext_q_unit; |
|
63 |
+ int band_ext_mode; |
|
64 |
+ |
|
65 |
+ /* Gradient */ |
|
66 |
+ int grad_mode; |
|
67 |
+ int grad_boundary; |
|
68 |
+ int gradient[31]; |
|
69 |
+ |
|
70 |
+ /* Stereo */ |
|
71 |
+ int cpe_base_channel; |
|
72 |
+ int is_signs[30]; |
|
73 |
+ |
|
74 |
+} ATRAC9BlockData; |
|
75 |
+ |
|
76 |
+typedef struct ATRAC9Context { |
|
77 |
+ AVCodecContext *avctx; |
|
78 |
+ AVFloatDSPContext *fdsp; |
|
79 |
+ FFTContext imdct; |
|
80 |
+ ATRAC9BlockData block[5]; |
|
81 |
+ AVLFG lfg; |
|
82 |
+ |
|
83 |
+ /* Set on init */ |
|
84 |
+ int frame_log2; |
|
85 |
+ int avg_frame_size; |
|
86 |
+ int frame_count; |
|
87 |
+ int samplerate_idx; |
|
88 |
+ const ATRAC9BlockConfig *block_config; |
|
89 |
+ |
|
90 |
+ /* Generated on init */ |
|
91 |
+ VLC sf_vlc[2][8]; /* Signed/unsigned, length */ |
|
92 |
+ VLC coeff_vlc[2][8][4]; /* Cookbook, precision, cookbook index */ |
|
93 |
+ uint8_t alloc_curve[48][48]; |
|
94 |
+ DECLARE_ALIGNED(32, float, imdct_win)[256]; |
|
95 |
+ |
|
96 |
+ DECLARE_ALIGNED(32, float, temp)[256]; |
|
97 |
+} ATRAC9Context; |
|
98 |
+ |
|
99 |
+static inline int parse_gradient(ATRAC9Context *s, ATRAC9BlockData *b, |
|
100 |
+ GetBitContext *gb) |
|
101 |
+{ |
|
102 |
+ int grad_range[2]; |
|
103 |
+ int grad_value[2]; |
|
104 |
+ int values, sign, base; |
|
105 |
+ uint8_t *curve; |
|
106 |
+ float scale; |
|
107 |
+ |
|
108 |
+ b->grad_mode = get_bits(gb, 2); |
|
109 |
+ if (b->grad_mode) { |
|
110 |
+ grad_range[0] = get_bits(gb, 5); |
|
111 |
+ grad_range[1] = 31; |
|
112 |
+ grad_value[0] = get_bits(gb, 5); |
|
113 |
+ grad_value[1] = 31; |
|
114 |
+ } else { |
|
115 |
+ grad_range[0] = get_bits(gb, 6); |
|
116 |
+ grad_range[1] = get_bits(gb, 6) + 1; |
|
117 |
+ grad_value[0] = get_bits(gb, 5); |
|
118 |
+ grad_value[1] = get_bits(gb, 5); |
|
119 |
+ } |
|
120 |
+ b->grad_boundary = get_bits(gb, 4); |
|
121 |
+ |
|
122 |
+ if (grad_range[0] >= grad_range[1] || grad_range[1] > 47) |
|
123 |
+ return AVERROR_INVALIDDATA; |
|
124 |
+ |
|
125 |
+ if (grad_value[0] >= grad_value[1] || grad_value[1] >= 32) |
|
126 |
+ return AVERROR_INVALIDDATA; |
|
127 |
+ |
|
128 |
+ if (b->grad_boundary > b->q_unit_cnt) |
|
129 |
+ return AVERROR_INVALIDDATA; |
|
130 |
+ |
|
131 |
+ values = grad_value[1] - grad_value[0]; |
|
132 |
+ sign = 1 - 2*(values < 0); |
|
133 |
+ base = grad_value[0] + sign; |
|
134 |
+ scale = (FFABS(values) - 1) / 31.0f; |
|
135 |
+ curve = s->alloc_curve[grad_range[1] - grad_range[0] - 1]; |
|
136 |
+ |
|
137 |
+ for (int i = 0; i <= b->q_unit_cnt; i++) |
|
138 |
+ b->gradient[i] = grad_value[i >= grad_range[0]]; |
|
139 |
+ |
|
140 |
+ for (int i = grad_range[0]; i < grad_range[1]; i++) |
|
141 |
+ b->gradient[i] = base + sign*((int)(scale*curve[i - grad_range[0]])); |
|
142 |
+ |
|
143 |
+ return 0; |
|
144 |
+} |
|
145 |
+ |
|
146 |
+static inline void calc_precision(ATRAC9Context *s, ATRAC9BlockData *b, |
|
147 |
+ ATRAC9ChannelData *c) |
|
148 |
+{ |
|
149 |
+ memset(c->precision_mask, 0, sizeof(c->precision_mask)); |
|
150 |
+ for (int i = 1; i < b->q_unit_cnt; i++) { |
|
151 |
+ const int delta = FFABS(c->scalefactors[i] - c->scalefactors[i - 1]) - 1; |
|
152 |
+ if (delta > 0) { |
|
153 |
+ const int neg = c->scalefactors[i - 1] > c->scalefactors[i]; |
|
154 |
+ c->precision_mask[i - neg] += FFMIN(delta, 5); |
|
155 |
+ } |
|
156 |
+ } |
|
157 |
+ |
|
158 |
+ if (b->grad_mode) { |
|
159 |
+ for (int i = 0; i < b->q_unit_cnt; i++) { |
|
160 |
+ c->precision_coarse[i] = c->scalefactors[i]; |
|
161 |
+ c->precision_coarse[i] += c->precision_mask[i] - b->gradient[i]; |
|
162 |
+ if (c->precision_coarse[i] < 0) |
|
163 |
+ continue; |
|
164 |
+ switch (b->grad_mode) { |
|
165 |
+ case 1: |
|
166 |
+ c->precision_coarse[i] >>= 1; |
|
167 |
+ break; |
|
168 |
+ case 2: |
|
169 |
+ c->precision_coarse[i] = (3 * c->precision_coarse[i]) >> 3; |
|
170 |
+ break; |
|
171 |
+ case 3: |
|
172 |
+ c->precision_coarse[i] >>= 2; |
|
173 |
+ break; |
|
174 |
+ } |
|
175 |
+ } |
|
176 |
+ } else { |
|
177 |
+ for (int i = 0; i < b->q_unit_cnt; i++) |
|
178 |
+ c->precision_coarse[i] = c->scalefactors[i] - b->gradient[i]; |
|
179 |
+ } |
|
180 |
+ |
|
181 |
+ |
|
182 |
+ for (int i = 0; i < b->q_unit_cnt; i++) |
|
183 |
+ c->precision_coarse[i] = FFMAX(c->precision_coarse[i], 1); |
|
184 |
+ |
|
185 |
+ for (int i = 0; i < b->grad_boundary; i++) |
|
186 |
+ c->precision_coarse[i]++; |
|
187 |
+ |
|
188 |
+ for (int i = 0; i < b->q_unit_cnt; i++) { |
|
189 |
+ c->precision_fine[i] = 0; |
|
190 |
+ if (c->precision_coarse[i] > 15) { |
|
191 |
+ c->precision_fine[i] = c->precision_coarse[i] - 15; |
|
192 |
+ c->precision_coarse[i] = 15; |
|
193 |
+ } |
|
194 |
+ } |
|
195 |
+} |
|
196 |
+ |
|
197 |
+static inline int parse_band_ext(ATRAC9Context *s, ATRAC9BlockData *b, |
|
198 |
+ GetBitContext *gb, int stereo) |
|
199 |
+{ |
|
200 |
+ int ext_band = 0; |
|
201 |
+ |
|
202 |
+ if (b->has_band_ext) { |
|
203 |
+ ext_band = at9_tab_band_ext_group[b->q_unit_cnt - 13][2]; |
|
204 |
+ if (stereo) { |
|
205 |
+ b->channel[1].band_ext = get_bits(gb, 2); |
|
206 |
+ b->channel[1].band_ext = ext_band > 2 ? b->channel[1].band_ext : 4; |
|
207 |
+ } else { |
|
208 |
+ skip_bits1(gb); |
|
209 |
+ } |
|
210 |
+ } |
|
211 |
+ |
|
212 |
+ b->has_band_ext_data = get_bits1(gb); |
|
213 |
+ if (!b->has_band_ext_data) |
|
214 |
+ return 0; |
|
215 |
+ |
|
216 |
+ if (!b->has_band_ext) { |
|
217 |
+ b->band_ext_mode = get_bits(gb, 2); |
|
218 |
+ skip_bits_long(gb, get_bits(gb, 5)); |
|
219 |
+ return 0; |
|
220 |
+ } |
|
221 |
+ |
|
222 |
+ b->channel[0].band_ext = get_bits(gb, 2); |
|
223 |
+ b->channel[0].band_ext = ext_band > 2 ? b->channel[0].band_ext : 4; |
|
224 |
+ |
|
225 |
+ if (!get_bits(gb, 5)) |
|
226 |
+ return 0; |
|
227 |
+ |
|
228 |
+ for (int i = 0; i <= stereo; i++) { |
|
229 |
+ ATRAC9ChannelData *c = &b->channel[i]; |
|
230 |
+ const int count = at9_tab_band_ext_cnt[c->band_ext][ext_band]; |
|
231 |
+ for (int j = 0; j < count; j++) { |
|
232 |
+ int len = at9_tab_band_ext_lengths[c->band_ext][ext_band][j]; |
|
233 |
+ c->band_ext_data[j] = get_bits(gb, len); |
|
234 |
+ } |
|
235 |
+ } |
|
236 |
+ |
|
237 |
+ return 0; |
|
238 |
+} |
|
239 |
+ |
|
240 |
+static inline int read_scalefactors(ATRAC9Context *s, ATRAC9BlockData *b, |
|
241 |
+ ATRAC9ChannelData *c, GetBitContext *gb, |
|
242 |
+ int channel_idx, int first_in_pkt) |
|
243 |
+{ |
|
244 |
+ static const int mode_map[2][4] = { { 0, 1, 2, 3 }, { 0, 2, 3, 4 } }; |
|
245 |
+ const int mode = mode_map[channel_idx][get_bits(gb, 2)]; |
|
246 |
+ |
|
247 |
+ memset(c->scalefactors, 0, sizeof(c->scalefactors)); |
|
248 |
+ |
|
249 |
+ if (first_in_pkt && (mode == 4 || ((mode == 3) && !channel_idx))) { |
|
250 |
+ av_log(s->avctx, AV_LOG_ERROR, "Invalid scalefactor coding mode!\n"); |
|
251 |
+ return AVERROR_INVALIDDATA; |
|
252 |
+ } |
|
253 |
+ |
|
254 |
+ switch (mode) { |
|
255 |
+ case 0: { /* VLC delta offset */ |
|
256 |
+ const uint8_t *sf_weights = at9_tab_sf_weights[get_bits(gb, 3)]; |
|
257 |
+ const int base = get_bits(gb, 5); |
|
258 |
+ const int len = get_bits(gb, 2) + 3; |
|
259 |
+ const VLC *tab = &s->sf_vlc[0][len]; |
|
260 |
+ |
|
261 |
+ c->scalefactors[0] = get_bits(gb, len); |
|
262 |
+ |
|
263 |
+ for (int i = 1; i < b->band_ext_q_unit; i++) { |
|
264 |
+ int val = c->scalefactors[i - 1] + get_vlc2(gb, tab->table, 9, 2); |
|
265 |
+ c->scalefactors[i] = val & ((1 << len) - 1); |
|
266 |
+ } |
|
267 |
+ |
|
268 |
+ for (int i = 0; i < b->band_ext_q_unit; i++) |
|
269 |
+ c->scalefactors[i] += base - sf_weights[i]; |
|
270 |
+ |
|
271 |
+ break; |
|
272 |
+ } |
|
273 |
+ case 1: { /* CLC offset */ |
|
274 |
+ const int len = get_bits(gb, 2) + 2; |
|
275 |
+ const int base = len < 5 ? get_bits(gb, 5) : 0; |
|
276 |
+ for (int i = 0; i < b->band_ext_q_unit; i++) |
|
277 |
+ c->scalefactors[i] = base + get_bits(gb, len); |
|
278 |
+ break; |
|
279 |
+ } |
|
280 |
+ case 2: |
|
281 |
+ case 4: { /* VLC dist to baseline */ |
|
282 |
+ const int *baseline = mode == 4 ? c->scalefactors_prev : |
|
283 |
+ channel_idx ? b->channel[0].scalefactors : |
|
284 |
+ c->scalefactors_prev; |
|
285 |
+ const int baseline_len = mode == 4 ? b->q_unit_cnt_prev : |
|
286 |
+ channel_idx ? b->band_ext_q_unit : |
|
287 |
+ b->q_unit_cnt_prev; |
|
288 |
+ |
|
289 |
+ const int len = get_bits(gb, 2) + 2; |
|
290 |
+ const int unit_cnt = FFMIN(b->band_ext_q_unit, baseline_len); |
|
291 |
+ const VLC *tab = &s->sf_vlc[1][len]; |
|
292 |
+ |
|
293 |
+ for (int i = 0; i < unit_cnt; i++) { |
|
294 |
+ int dist = get_vlc2(gb, tab->table, 9, 2); |
|
295 |
+ c->scalefactors[i] = baseline[i] + dist; |
|
296 |
+ } |
|
297 |
+ |
|
298 |
+ for (int i = unit_cnt; i < b->band_ext_q_unit; i++) |
|
299 |
+ c->scalefactors[i] = get_bits(gb, 5); |
|
300 |
+ |
|
301 |
+ break; |
|
302 |
+ } |
|
303 |
+ case 3: { /* VLC offset with baseline */ |
|
304 |
+ const int *baseline = channel_idx ? b->channel[0].scalefactors : |
|
305 |
+ c->scalefactors_prev; |
|
306 |
+ const int baseline_len = channel_idx ? b->band_ext_q_unit : |
|
307 |
+ b->q_unit_cnt_prev; |
|
308 |
+ |
|
309 |
+ const int base = get_bits(gb, 5) - (1 << (5 - 1)); |
|
310 |
+ const int len = get_bits(gb, 2) + 1; |
|
311 |
+ const int unit_cnt = FFMIN(b->band_ext_q_unit, baseline_len); |
|
312 |
+ const VLC *tab = &s->sf_vlc[0][len]; |
|
313 |
+ |
|
314 |
+ c->scalefactors[0] = get_bits(gb, len); |
|
315 |
+ |
|
316 |
+ for (int i = 1; i < unit_cnt; i++) { |
|
317 |
+ int val = c->scalefactors[i - 1] + get_vlc2(gb, tab->table, 9, 2); |
|
318 |
+ c->scalefactors[i] = val & ((1 << len) - 1); |
|
319 |
+ } |
|
320 |
+ |
|
321 |
+ for (int i = 0; i < unit_cnt; i++) |
|
322 |
+ c->scalefactors[i] += base + baseline[i]; |
|
323 |
+ |
|
324 |
+ for (int i = unit_cnt; i < b->band_ext_q_unit; i++) |
|
325 |
+ c->scalefactors[i] = get_bits(gb, 5); |
|
326 |
+ break; |
|
327 |
+ } |
|
328 |
+ } |
|
329 |
+ |
|
330 |
+ for (int i = 0; i < b->band_ext_q_unit; i++) |
|
331 |
+ if (c->scalefactors[i] < 0 || c->scalefactors[i] > 31) |
|
332 |
+ return AVERROR_INVALIDDATA; |
|
333 |
+ |
|
334 |
+ memcpy(c->scalefactors_prev, c->scalefactors, sizeof(c->scalefactors)); |
|
335 |
+ |
|
336 |
+ return 0; |
|
337 |
+} |
|
338 |
+ |
|
339 |
+static inline void calc_codebook_idx(ATRAC9Context *s, ATRAC9BlockData *b, |
|
340 |
+ ATRAC9ChannelData *c) |
|
341 |
+{ |
|
342 |
+ int avg = 0; |
|
343 |
+ const int last_sf = c->scalefactors[c->q_unit_cnt]; |
|
344 |
+ |
|
345 |
+ memset(c->codebookset, 0, sizeof(c->codebookset)); |
|
346 |
+ |
|
347 |
+ if (c->q_unit_cnt <= 1) |
|
348 |
+ return; |
|
349 |
+ if (s->samplerate_idx > 7) |
|
350 |
+ return; |
|
351 |
+ |
|
352 |
+ c->scalefactors[c->q_unit_cnt] = c->scalefactors[c->q_unit_cnt - 1]; |
|
353 |
+ |
|
354 |
+ if (c->q_unit_cnt > 12) { |
|
355 |
+ for (int i = 0; i < 12; i++) |
|
356 |
+ avg += c->scalefactors[i]; |
|
357 |
+ avg = (avg + 6) / 12; |
|
358 |
+ } |
|
359 |
+ |
|
360 |
+ for (int i = 8; i < c->q_unit_cnt; i++) { |
|
361 |
+ const int prev = c->scalefactors[i - 1]; |
|
362 |
+ const int cur = c->scalefactors[i ]; |
|
363 |
+ const int next = c->scalefactors[i + 1]; |
|
364 |
+ const int min = FFMIN(prev, next); |
|
365 |
+ if ((cur - min >= 3 || 2*cur - prev - next >= 3)) |
|
366 |
+ c->codebookset[i] = 1; |
|
367 |
+ } |
|
368 |
+ |
|
369 |
+ |
|
370 |
+ for (int i = 12; i < c->q_unit_cnt; i++) { |
|
371 |
+ const int cur = c->scalefactors[i]; |
|
372 |
+ const int cnd = at9_q_unit_to_coeff_cnt[i] == 16; |
|
373 |
+ const int min = FFMIN(c->scalefactors[i + 1], c->scalefactors[i - 1]); |
|
374 |
+ if (c->codebookset[i]) |
|
375 |
+ continue; |
|
376 |
+ |
|
377 |
+ c->codebookset[i] = (((cur - min) >= 2) && (cur >= (avg - cnd))); |
|
378 |
+ } |
|
379 |
+ |
|
380 |
+ c->scalefactors[c->q_unit_cnt] = last_sf; |
|
381 |
+} |
|
382 |
+ |
|
383 |
+static inline void read_coeffs_coarse(ATRAC9Context *s, ATRAC9BlockData *b, |
|
384 |
+ ATRAC9ChannelData *c, GetBitContext *gb) |
|
385 |
+{ |
|
386 |
+ const int max_prec = s->samplerate_idx > 7 ? 1 : 7; |
|
387 |
+ |
|
388 |
+ memset(c->q_coeffs_coarse, 0, sizeof(c->q_coeffs_coarse)); |
|
389 |
+ |
|
390 |
+ for (int i = 0; i < c->q_unit_cnt; i++) { |
|
391 |
+ int *coeffs = &c->q_coeffs_coarse[at9_q_unit_to_coeff_idx[i]]; |
|
392 |
+ const int bands = at9_q_unit_to_coeff_cnt[i]; |
|
393 |
+ const int prec = c->precision_coarse[i] + 1; |
|
394 |
+ |
|
395 |
+ if (prec <= max_prec) { |
|
396 |
+ const int cb = c->codebookset[i]; |
|
397 |
+ const int cbi = at9_q_unit_to_codebookidx[i]; |
|
398 |
+ const VLC *tab = &s->coeff_vlc[cb][prec][cbi]; |
|
399 |
+ const HuffmanCodebook *huff = &at9_huffman_coeffs[cb][prec][cbi]; |
|
400 |
+ const int groups = bands >> huff->value_cnt_pow; |
|
401 |
+ |
|
402 |
+ for (int j = 0; j < groups; j++) { |
|
403 |
+ uint16_t val = get_vlc2(gb, tab->table, 9, huff->max_bit_size); |
|
404 |
+ |
|
405 |
+ for (int k = 0; k < huff->value_cnt; k++) { |
|
406 |
+ coeffs[k] = sign_extend(val, huff->value_bits); |
|
407 |
+ val >>= huff->value_bits; |
|
408 |
+ } |
|
409 |
+ |
|
410 |
+ coeffs += huff->value_cnt; |
|
411 |
+ } |
|
412 |
+ } else { |
|
413 |
+ for (int j = 0; j < bands; j++) |
|
414 |
+ coeffs[j] = sign_extend(get_bits(gb, prec), prec); |
|
415 |
+ } |
|
416 |
+ } |
|
417 |
+} |
|
418 |
+ |
|
419 |
+static inline void read_coeffs_fine(ATRAC9Context *s, ATRAC9BlockData *b, |
|
420 |
+ ATRAC9ChannelData *c, GetBitContext *gb) |
|
421 |
+{ |
|
422 |
+ memset(c->q_coeffs_fine, 0, sizeof(c->q_coeffs_fine)); |
|
423 |
+ |
|
424 |
+ for (int i = 0; i < c->q_unit_cnt; i++) { |
|
425 |
+ const int start = at9_q_unit_to_coeff_idx[i + 0]; |
|
426 |
+ const int end = at9_q_unit_to_coeff_idx[i + 1]; |
|
427 |
+ const int len = c->precision_fine[i] + 1; |
|
428 |
+ |
|
429 |
+ if (c->precision_fine[i] <= 0) |
|
430 |
+ continue; |
|
431 |
+ |
|
432 |
+ for (int j = start; j < end; j++) |
|
433 |
+ c->q_coeffs_fine[j] = sign_extend(get_bits(gb, len), len); |
|
434 |
+ } |
|
435 |
+} |
|
436 |
+ |
|
437 |
+static inline void dequantize(ATRAC9Context *s, ATRAC9BlockData *b, |
|
438 |
+ ATRAC9ChannelData *c) |
|
439 |
+{ |
|
440 |
+ memset(c->coeffs, 0, sizeof(c->coeffs)); |
|
441 |
+ |
|
442 |
+ for (int i = 0; i < c->q_unit_cnt; i++) { |
|
443 |
+ const int start = at9_q_unit_to_coeff_idx[i + 0]; |
|
444 |
+ const int end = at9_q_unit_to_coeff_idx[i + 1]; |
|
445 |
+ |
|
446 |
+ const float coarse_c = at9_quant_step_coarse[c->precision_coarse[i]]; |
|
447 |
+ const float fine_c = at9_quant_step_fine[c->precision_fine[i]]; |
|
448 |
+ |
|
449 |
+ for (int j = start; j < end; j++) { |
|
450 |
+ const float vc = c->q_coeffs_coarse[j] * coarse_c; |
|
451 |
+ const float vf = c->q_coeffs_fine[j] * fine_c; |
|
452 |
+ c->coeffs[j] = vc + vf; |
|
453 |
+ } |
|
454 |
+ } |
|
455 |
+} |
|
456 |
+ |
|
457 |
+static inline void apply_intensity_stereo(ATRAC9Context *s, ATRAC9BlockData *b, |
|
458 |
+ const int stereo) |
|
459 |
+{ |
|
460 |
+ float *src = b->channel[ b->cpe_base_channel].coeffs; |
|
461 |
+ float *dst = b->channel[!b->cpe_base_channel].coeffs; |
|
462 |
+ |
|
463 |
+ if (!stereo) |
|
464 |
+ return; |
|
465 |
+ |
|
466 |
+ if (b->q_unit_cnt <= b->stereo_q_unit) |
|
467 |
+ return; |
|
468 |
+ |
|
469 |
+ for (int i = b->stereo_q_unit; i < b->q_unit_cnt; i++) { |
|
470 |
+ const int sign = b->is_signs[i]; |
|
471 |
+ const int start = at9_q_unit_to_coeff_idx[i + 0]; |
|
472 |
+ const int end = at9_q_unit_to_coeff_idx[i + 1]; |
|
473 |
+ for (int j = start; j < end; j++) |
|
474 |
+ dst[j] = sign*src[j]; |
|
475 |
+ } |
|
476 |
+} |
|
477 |
+ |
|
478 |
+static inline void apply_scalefactors(ATRAC9Context *s, ATRAC9BlockData *b, |
|
479 |
+ const int stereo) |
|
480 |
+{ |
|
481 |
+ for (int i = 0; i <= stereo; i++) { |
|
482 |
+ float *coeffs = b->channel[i].coeffs; |
|
483 |
+ for (int j = 0; j < b->q_unit_cnt; j++) { |
|
484 |
+ const int start = at9_q_unit_to_coeff_idx[j + 0]; |
|
485 |
+ const int end = at9_q_unit_to_coeff_idx[j + 1]; |
|
486 |
+ const int scalefactor = b->channel[i].scalefactors[j]; |
|
487 |
+ const float scale = at9_scalefactor_c[scalefactor]; |
|
488 |
+ for (int k = start; k < end; k++) |
|
489 |
+ coeffs[k] *= scale; |
|
490 |
+ } |
|
491 |
+ } |
|
492 |
+} |
|
493 |
+ |
|
494 |
+static inline void fill_with_noise(ATRAC9Context *s, ATRAC9ChannelData *c, |
|
495 |
+ int start, int count) |
|
496 |
+{ |
|
497 |
+ float maxval = 0.0f; |
|
498 |
+ for (int i = 0; i < count; i += 2) { |
|
499 |
+ double tmp[2]; |
|
500 |
+ av_bmg_get(&s->lfg, tmp); |
|
501 |
+ c->coeffs[start + i + 0] = tmp[0]; |
|
502 |
+ c->coeffs[start + i + 1] = tmp[1]; |
|
503 |
+ maxval = FFMAX(FFABS(tmp[0]), FFMAX(FFABS(tmp[1]), maxval)); |
|
504 |
+ } |
|
505 |
+ /* Normalize */ |
|
506 |
+ for (int i = 0; i < count; i++) |
|
507 |
+ c->coeffs[start + i] /= maxval; |
|
508 |
+} |
|
509 |
+ |
|
510 |
+static inline void scale_band_ext_coeffs(ATRAC9ChannelData *c, float sf[6], |
|
511 |
+ const int s_unit, const int e_unit) |
|
512 |
+{ |
|
513 |
+ for (int i = s_unit; i < e_unit; i++) { |
|
514 |
+ const int start = at9_q_unit_to_coeff_idx[i + 0]; |
|
515 |
+ const int end = at9_q_unit_to_coeff_idx[i + 1]; |
|
516 |
+ for (int j = start; j < end; j++) |
|
517 |
+ c->coeffs[j] *= sf[i - s_unit]; |
|
518 |
+ } |
|
519 |
+} |
|
520 |
+ |
|
521 |
+static inline void apply_band_extension(ATRAC9Context *s, ATRAC9BlockData *b, |
|
522 |
+ const int stereo) |
|
523 |
+{ |
|
524 |
+ const int bc = at9_tab_band_ext_group[b->q_unit_cnt - 13][2]; |
|
525 |
+ const int g_units[4] = { /* A, B, C, total units */ |
|
526 |
+ b->q_unit_cnt, |
|
527 |
+ at9_tab_band_ext_group[b->q_unit_cnt - 13][0], |
|
528 |
+ at9_tab_band_ext_group[b->q_unit_cnt - 13][1], |
|
529 |
+ FFMAX(g_units[2], 22), |
|
530 |
+ }; |
|
531 |
+ |
|
532 |
+ const int g_bins[4] = { /* A, B, C, total bins */ |
|
533 |
+ at9_q_unit_to_coeff_idx[g_units[0]], |
|
534 |
+ at9_q_unit_to_coeff_idx[g_units[1]], |
|
535 |
+ at9_q_unit_to_coeff_idx[g_units[2]], |
|
536 |
+ at9_q_unit_to_coeff_idx[g_units[3]], |
|
537 |
+ }; |
|
538 |
+ |
|
539 |
+ if (!b->has_band_ext || !b->has_band_ext_data) |
|
540 |
+ return; |
|
541 |
+ |
|
542 |
+ for (int ch = 0; ch <= stereo; ch++) { |
|
543 |
+ ATRAC9ChannelData *c = &b->channel[ch]; |
|
544 |
+ |
|
545 |
+ /* Mirror the spectrum */ |
|
546 |
+ for (int i = 0; i < 3; i++) |
|
547 |
+ for (int j = 0; j < (g_bins[i + 1] - g_bins[i + 0]); j++) |
|
548 |
+ c->coeffs[g_bins[i] + j] = c->coeffs[g_bins[i] - j - 1]; |
|
549 |
+ |
|
550 |
+ switch (c->band_ext) { |
|
551 |
+ case 0: { |
|
552 |
+ int l; |
|
553 |
+ float sf[6] = { 0.0f }; |
|
554 |
+ const int n_start = at9_q_unit_to_coeff_idx[g_units[3] - 1]; |
|
555 |
+ const int n_cnt = at9_q_unit_to_coeff_cnt[g_units[3] - 1]; |
|
556 |
+ switch (bc) { |
|
557 |
+ case 3: |
|
558 |
+ sf[0] = at9_band_ext_scales_m0[0][0][c->band_ext_data[0]]; |
|
559 |
+ sf[1] = at9_band_ext_scales_m0[0][1][c->band_ext_data[0]]; |
|
560 |
+ sf[2] = at9_band_ext_scales_m0[0][2][c->band_ext_data[1]]; |
|
561 |
+ sf[3] = at9_band_ext_scales_m0[0][3][c->band_ext_data[2]]; |
|
562 |
+ sf[4] = at9_band_ext_scales_m0[0][4][c->band_ext_data[3]]; |
|
563 |
+ break; |
|
564 |
+ case 4: |
|
565 |
+ sf[0] = at9_band_ext_scales_m0[1][0][c->band_ext_data[0]]; |
|
566 |
+ sf[1] = at9_band_ext_scales_m0[1][1][c->band_ext_data[0]]; |
|
567 |
+ sf[2] = at9_band_ext_scales_m0[1][2][c->band_ext_data[1]]; |
|
568 |
+ sf[3] = at9_band_ext_scales_m0[1][3][c->band_ext_data[2]]; |
|
569 |
+ sf[4] = at9_band_ext_scales_m0[1][4][c->band_ext_data[3]]; |
|
570 |
+ break; |
|
571 |
+ case 5: |
|
572 |
+ sf[0] = at9_band_ext_scales_m0[2][0][c->band_ext_data[0]]; |
|
573 |
+ sf[1] = at9_band_ext_scales_m0[2][1][c->band_ext_data[1]]; |
|
574 |
+ sf[2] = at9_band_ext_scales_m0[2][2][c->band_ext_data[1]]; |
|
575 |
+ break; |
|
576 |
+ } |
|
577 |
+ |
|
578 |
+ l = g_units[3] - g_units[0] - 1; |
|
579 |
+ sf[l] = at9_scalefactor_c[c->scalefactors[g_units[0]]]; |
|
580 |
+ |
|
581 |
+ fill_with_noise(s, c, n_start, n_cnt); |
|
582 |
+ scale_band_ext_coeffs(c, sf, g_units[0], g_units[3]); |
|
583 |
+ break; |
|
584 |
+ } |
|
585 |
+ case 1: { |
|
586 |
+ float sf[6]; |
|
587 |
+ for (int i = g_units[0]; i < g_units[3]; i++) |
|
588 |
+ sf[i - g_units[0]] = at9_scalefactor_c[c->scalefactors[i]]; |
|
589 |
+ |
|
590 |
+ fill_with_noise(s, c, g_bins[0], g_bins[3] - g_bins[0]); |
|
591 |
+ scale_band_ext_coeffs(c, sf, g_units[0], g_units[3]); |
|
592 |
+ break; |
|
593 |
+ } |
|
594 |
+ case 2: { |
|
595 |
+ const float g_sf[2] = { |
|
596 |
+ at9_band_ext_scales_m2[c->band_ext_data[0]], |
|
597 |
+ at9_band_ext_scales_m2[c->band_ext_data[1]], |
|
598 |
+ }; |
|
599 |
+ |
|
600 |
+ for (int i = 0; i < 2; i++) |
|
601 |
+ for (int j = g_bins[i + 0]; j < g_bins[i + 1]; j++) |
|
602 |
+ c->coeffs[j] *= g_sf[i]; |
|
603 |
+ break; |
|
604 |
+ } |
|
605 |
+ case 3: { |
|
606 |
+ float scale = at9_band_ext_scales_m3[c->band_ext_data[0]][0]; |
|
607 |
+ float rate = at9_band_ext_scales_m3[c->band_ext_data[1]][1]; |
|
608 |
+ rate = pow(2, rate); |
|
609 |
+ for (int i = g_bins[0]; i < g_bins[3]; i++) { |
|
610 |
+ scale *= rate; |
|
611 |
+ c->coeffs[i] *= scale; |
|
612 |
+ } |
|
613 |
+ break; |
|
614 |
+ } |
|
615 |
+ case 4: { |
|
616 |
+ const float m = at9_band_ext_scales_m4[c->band_ext_data[0]]; |
|
617 |
+ const float g_sf[3] = { 0.7079468f*m, 0.5011902f*m, 0.3548279f*m }; |
|
618 |
+ |
|
619 |
+ for (int i = 0; i < 3; i++) |
|
620 |
+ for (int j = g_bins[i + 0]; j < g_bins[i + 1]; j++) |
|
621 |
+ c->coeffs[j] *= g_sf[i]; |
|
622 |
+ break; |
|
623 |
+ } |
|
624 |
+ } |
|
625 |
+ } |
|
626 |
+} |
|
627 |
+ |
|
628 |
+static int atrac9_decode_block(ATRAC9Context *s, GetBitContext *gb, |
|
629 |
+ ATRAC9BlockData *b, AVFrame *frame, |
|
630 |
+ int frame_idx, int block_idx) |
|
631 |
+{ |
|
632 |
+ const int first_in_pkt = !get_bits1(gb); |
|
633 |
+ const int reuse_params = get_bits1(gb); |
|
634 |
+ const int stereo = s->block_config->type[block_idx] == ATRAC9_BLOCK_TYPE_CPE; |
|
635 |
+ |
|
636 |
+ if (first_in_pkt && reuse_params) { |
|
637 |
+ av_log(s->avctx, AV_LOG_ERROR, "Invalid block flags!\n"); |
|
638 |
+ return AVERROR_INVALIDDATA; |
|
639 |
+ } |
|
640 |
+ |
|
641 |
+ /* Band parameters */ |
|
642 |
+ if (!reuse_params) { |
|
643 |
+ int stereo_band, ext_band; |
|
644 |
+ const int min_band_count = s->samplerate_idx > 7 ? 1 : 3; |
|
645 |
+ b->band_count = get_bits(gb, 4) + min_band_count; |
|
646 |
+ b->q_unit_cnt = at9_tab_band_q_unit_map[b->band_count]; |
|
647 |
+ |
|
648 |
+ b->band_ext_q_unit = b->stereo_q_unit = b->q_unit_cnt; |
|
649 |
+ |
|
650 |
+ if (b->band_count > at9_tab_sri_max_bands[s->samplerate_idx]) { |
|
651 |
+ av_log(s->avctx, AV_LOG_ERROR, "Invalid band count %i!\n", |
|
652 |
+ b->band_count); |
|
653 |
+ return AVERROR_INVALIDDATA; |
|
654 |
+ } |
|
655 |
+ |
|
656 |
+ if (stereo) { |
|
657 |
+ stereo_band = get_bits(gb, 4) + min_band_count; |
|
658 |
+ if (stereo_band > b->band_count) { |
|
659 |
+ av_log(s->avctx, AV_LOG_ERROR, "Invalid stereo band %i!\n", |
|
660 |
+ stereo_band); |
|
661 |
+ return AVERROR_INVALIDDATA; |
|
662 |
+ } |
|
663 |
+ b->stereo_q_unit = at9_tab_band_q_unit_map[stereo_band]; |
|
664 |
+ } |
|
665 |
+ |
|
666 |
+ b->has_band_ext = get_bits1(gb); |
|
667 |
+ if (b->has_band_ext) { |
|
668 |
+ ext_band = get_bits(gb, 4) + min_band_count; |
|
669 |
+ if (ext_band < b->band_count) { |
|
670 |
+ av_log(s->avctx, AV_LOG_ERROR, "Invalid extension band %i!\n", |
|
671 |
+ ext_band); |
|
672 |
+ return AVERROR_INVALIDDATA; |
|
673 |
+ } |
|
674 |
+ b->band_ext_q_unit = at9_tab_band_q_unit_map[ext_band]; |
|
675 |
+ } |
|
676 |
+ } |
|
677 |
+ |
|
678 |
+ /* Calculate bit alloc gradient */ |
|
679 |
+ if (parse_gradient(s, b, gb)) |
|
680 |
+ return AVERROR_INVALIDDATA; |
|
681 |
+ |
|
682 |
+ /* IS data */ |
|
683 |
+ b->cpe_base_channel = 0; |
|
684 |
+ if (stereo) { |
|
685 |
+ b->cpe_base_channel = get_bits1(gb); |
|
686 |
+ if (get_bits1(gb)) { |
|
687 |
+ for (int i = b->stereo_q_unit; i < b->q_unit_cnt; i++) |
|
688 |
+ b->is_signs[i] = 1 - 2*get_bits1(gb); |
|
689 |
+ } else { |
|
690 |
+ for (int i = 0; i < FF_ARRAY_ELEMS(b->is_signs); i++) |
|
691 |
+ b->is_signs[i] = 1; |
|
692 |
+ } |
|
693 |
+ } |
|
694 |
+ |
|
695 |
+ /* Band extension */ |
|
696 |
+ if (parse_band_ext(s, b, gb, stereo)) |
|
697 |
+ return AVERROR_INVALIDDATA; |
|
698 |
+ |
|
699 |
+ /* Scalefactors */ |
|
700 |
+ for (int i = 0; i <= stereo; i++) { |
|
701 |
+ ATRAC9ChannelData *c = &b->channel[i]; |
|
702 |
+ c->q_unit_cnt = i == b->cpe_base_channel ? b->q_unit_cnt : |
|
703 |
+ b->stereo_q_unit; |
|
704 |
+ if (read_scalefactors(s, b, c, gb, i, first_in_pkt)) |
|
705 |
+ return AVERROR_INVALIDDATA; |
|
706 |
+ |
|
707 |
+ calc_precision (s, b, c); |
|
708 |
+ calc_codebook_idx (s, b, c); |
|
709 |
+ read_coeffs_coarse(s, b, c, gb); |
|
710 |
+ read_coeffs_fine (s, b, c, gb); |
|
711 |
+ dequantize (s, b, c); |
|
712 |
+ } |
|
713 |
+ |
|
714 |
+ b->q_unit_cnt_prev = b->has_band_ext ? b->band_ext_q_unit : b->q_unit_cnt; |
|
715 |
+ |
|
716 |
+ apply_intensity_stereo(s, b, stereo); |
|
717 |
+ apply_scalefactors (s, b, stereo); |
|
718 |
+ apply_band_extension (s, b, stereo); |
|
719 |
+ |
|
720 |
+ /* iMDCT */ |
|
721 |
+ for (int i = 0; i <= stereo; i++) { |
|
722 |
+ ATRAC9ChannelData *c = &b->channel[i]; |
|
723 |
+ const int dst_idx = s->block_config->plane_map[block_idx][i]; |
|
724 |
+ const int wsize = 1 << s->frame_log2; |
|
725 |
+ const ptrdiff_t offset = wsize*frame_idx*sizeof(float); |
|
726 |
+ float *dst = (float *)(frame->extended_data[dst_idx] + offset); |
|
727 |
+ |
|
728 |
+ s->imdct.imdct_half(&s->imdct, s->temp, c->coeffs); |
|
729 |
+ s->fdsp->vector_fmul_window(dst, c->prev_win, s->temp, |
|
730 |
+ s->imdct_win, wsize >> 1); |
|
731 |
+ memcpy(c->prev_win, s->temp + (wsize >> 1), sizeof(float)*wsize >> 1); |
|
732 |
+ } |
|
733 |
+ |
|
734 |
+ return 0; |
|
735 |
+} |
|
736 |
+ |
|
737 |
+static int atrac9_decode_frame(AVCodecContext *avctx, void *data, |
|
738 |
+ int *got_frame_ptr, AVPacket *avpkt) |
|
739 |
+{ |
|
740 |
+ int ret; |
|
741 |
+ GetBitContext gb; |
|
742 |
+ AVFrame *frame = data; |
|
743 |
+ ATRAC9Context *s = avctx->priv_data; |
|
744 |
+ const int frames = FFMIN(avpkt->size / s->avg_frame_size, s->frame_count); |
|
745 |
+ |
|
746 |
+ frame->nb_samples = (1 << s->frame_log2) * frames; |
|
747 |
+ ret = ff_get_buffer(avctx, frame, 0); |
|
748 |
+ if (ret < 0) |
|
749 |
+ return ret; |
|
750 |
+ |
|
751 |
+ init_get_bits8(&gb, avpkt->data, avpkt->size); |
|
752 |
+ |
|
753 |
+ for (int i = 0; i < frames; i++) { |
|
754 |
+ for (int j = 0; j < s->block_config->count; j++) { |
|
755 |
+ ret = atrac9_decode_block(s, &gb, &s->block[j], frame, i, j); |
|
756 |
+ if (ret) |
|
757 |
+ return ret; |
|
758 |
+ align_get_bits(&gb); |
|
759 |
+ } |
|
760 |
+ } |
|
761 |
+ |
|
762 |
+ *got_frame_ptr = 1; |
|
763 |
+ |
|
764 |
+ return avctx->block_align; |
|
765 |
+} |
|
766 |
+ |
|
767 |
+static void atrac9_decode_flush(AVCodecContext *avctx) |
|
768 |
+{ |
|
769 |
+ ATRAC9Context *s = avctx->priv_data; |
|
770 |
+ |
|
771 |
+ for (int j = 0; j < s->block_config->count; j++) { |
|
772 |
+ ATRAC9BlockData *b = &s->block[j]; |
|
773 |
+ const int stereo = s->block_config->type[j] == ATRAC9_BLOCK_TYPE_CPE; |
|
774 |
+ for (int i = 0; i <= stereo; i++) { |
|
775 |
+ ATRAC9ChannelData *c = &b->channel[i]; |
|
776 |
+ memset(c->prev_win, 0, sizeof(c->prev_win)); |
|
777 |
+ } |
|
778 |
+ } |
|
779 |
+} |
|
780 |
+ |
|
781 |
+static av_cold int atrac9_decode_close(AVCodecContext *avctx) |
|
782 |
+{ |
|
783 |
+ ATRAC9Context *s = avctx->priv_data; |
|
784 |
+ |
|
785 |
+ for (int i = 1; i < 7; i++) |
|
786 |
+ ff_free_vlc(&s->sf_vlc[0][i]); |
|
787 |
+ for (int i = 2; i < 6; i++) |
|
788 |
+ ff_free_vlc(&s->sf_vlc[1][i]); |
|
789 |
+ for (int i = 0; i < 2; i++) |
|
790 |
+ for (int j = 0; j < 8; j++) |
|
791 |
+ for (int k = 0; k < 4; k++) |
|
792 |
+ ff_free_vlc(&s->coeff_vlc[i][j][k]); |
|
793 |
+ |
|
794 |
+ ff_mdct_end(&s->imdct); |
|
795 |
+ av_free(s->fdsp); |
|
796 |
+ |
|
797 |
+ return 0; |
|
798 |
+} |
|
799 |
+ |
|
800 |
+static av_cold int atrac9_decode_init(AVCodecContext *avctx) |
|
801 |
+{ |
|
802 |
+ GetBitContext gb; |
|
803 |
+ ATRAC9Context *s = avctx->priv_data; |
|
804 |
+ int version, block_config_idx, superframe_idx, alloc_c_len; |
|
805 |
+ |
|
806 |
+ s->avctx = avctx; |
|
807 |
+ |
|
808 |
+ av_lfg_init(&s->lfg, 0xFBADF00D); |
|
809 |
+ |
|
810 |
+ if (avctx->extradata_size != 12) { |
|
811 |
+ av_log(avctx, AV_LOG_ERROR, "Invalid extradata length!\n"); |
|
812 |
+ return AVERROR_INVALIDDATA; |
|
813 |
+ } |
|
814 |
+ |
|
815 |
+ version = AV_RL32(avctx->extradata); |
|
816 |
+ if (version > 2) { |
|
817 |
+ av_log(avctx, AV_LOG_ERROR, "Unsupported version (%i)!\n", version); |
|
818 |
+ return AVERROR_INVALIDDATA; |
|
819 |
+ } |
|
820 |
+ |
|
821 |
+ init_get_bits8(&gb, avctx->extradata + 4, avctx->extradata_size); |
|
822 |
+ |
|
823 |
+ if (get_bits(&gb, 8) != 0xFE) { |
|
824 |
+ av_log(avctx, AV_LOG_ERROR, "Incorrect magic byte!\n"); |
|
825 |
+ return AVERROR_INVALIDDATA; |
|
826 |
+ } |
|
827 |
+ |
|
828 |
+ s->samplerate_idx = get_bits(&gb, 4); |
|
829 |
+ avctx->sample_rate = at9_tab_samplerates[s->samplerate_idx]; |
|
830 |
+ |
|
831 |
+ block_config_idx = get_bits(&gb, 3); |
|
832 |
+ if (block_config_idx > 5) { |
|
833 |
+ av_log(avctx, AV_LOG_ERROR, "Incorrect block config!\n"); |
|
834 |
+ return AVERROR_INVALIDDATA; |
|
835 |
+ } |
|
836 |
+ s->block_config = &at9_block_layout[block_config_idx]; |
|
837 |
+ |
|
838 |
+ avctx->channel_layout = s->block_config->channel_layout; |
|
839 |
+ avctx->sample_fmt = AV_SAMPLE_FMT_FLTP; |
|
840 |
+ |
|
841 |
+ if (get_bits1(&gb)) { |
|
842 |
+ av_log(avctx, AV_LOG_ERROR, "Incorrect verification bit!\n"); |
|
843 |
+ return AVERROR_INVALIDDATA; |
|
844 |
+ } |
|
845 |
+ |
|
846 |
+ /* Average frame size in bytes */ |
|
847 |
+ s->avg_frame_size = get_bits(&gb, 11) + 1; |
|
848 |
+ |
|
849 |
+ superframe_idx = get_bits(&gb, 2); |
|
850 |
+ if (superframe_idx & 1) { |
|
851 |
+ av_log(avctx, AV_LOG_ERROR, "Invalid superframe index!\n"); |
|
852 |
+ return AVERROR_INVALIDDATA; |
|
853 |
+ } |
|
854 |
+ |
|
855 |
+ s->frame_count = 1 << superframe_idx; |
|
856 |
+ s->frame_log2 = at9_tab_sri_frame_log2[s->samplerate_idx]; |
|
857 |
+ |
|
858 |
+ if (ff_mdct_init(&s->imdct, s->frame_log2 + 1, 1, 1.0f / 32768.0f)) |
|
859 |
+ return AVERROR(ENOMEM); |
|
860 |
+ |
|
861 |
+ s->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT); |
|
862 |
+ if (!s->fdsp) |
|
863 |
+ return AVERROR(ENOMEM); |
|
864 |
+ |
|
865 |
+ /* iMDCT window */ |
|
866 |
+ for (int i = 0; i < (1 << s->frame_log2); i++) { |
|
867 |
+ const int len = 1 << s->frame_log2; |
|
868 |
+ const float sidx = ( i + 0.5f) / len; |
|
869 |
+ const float eidx = (len - i - 0.5f) / len; |
|
870 |
+ const float s_c = sinf(sidx*M_PI - M_PI_2)*0.5f + 0.5f; |
|
871 |
+ const float e_c = sinf(eidx*M_PI - M_PI_2)*0.5f + 0.5f; |
|
872 |
+ s->imdct_win[i] = s_c / ((s_c * s_c) + (e_c * e_c)); |
|
873 |
+ } |
|
874 |
+ |
|
875 |
+ /* Allocation curve */ |
|
876 |
+ alloc_c_len = FF_ARRAY_ELEMS(at9_tab_b_dist); |
|
877 |
+ for (int i = 1; i <= alloc_c_len; i++) |
|
878 |
+ for (int j = 0; j < i; j++) |
|
879 |
+ s->alloc_curve[i - 1][j] = at9_tab_b_dist[(j * alloc_c_len) / i]; |
|
880 |
+ |
|
881 |
+ /* Unsigned scalefactor VLCs */ |
|
882 |
+ for (int i = 1; i < 7; i++) { |
|
883 |
+ const HuffmanCodebook *hf = &at9_huffman_sf_unsigned[i]; |
|
884 |
+ |
|
885 |
+ init_vlc(&s->sf_vlc[0][i], 9, hf->size, hf->bits, 1, 1, hf->codes, |
|
886 |
+ 2, 2, 0); |
|
887 |
+ } |
|
888 |
+ |
|
889 |
+ /* Signed scalefactor VLCs */ |
|
890 |
+ for (int i = 2; i < 6; i++) { |
|
891 |
+ const HuffmanCodebook *hf = &at9_huffman_sf_signed[i]; |
|
892 |
+ |
|
893 |
+ int nums = hf->size; |
|
894 |
+ int16_t sym[32]; |
|
895 |
+ for (int j = 0; j < nums; j++) |
|
896 |
+ sym[j] = sign_extend(j, hf->value_bits); |
|
897 |
+ |
|
898 |
+ ff_init_vlc_sparse(&s->sf_vlc[1][i], 9, hf->size, hf->bits, 1, 1, |
|
899 |
+ hf->codes, 2, 2, sym, sizeof(*sym), sizeof(*sym), 0); |
|
900 |
+ } |
|
901 |
+ |
|
902 |
+ /* Coefficient VLCs */ |
|
903 |
+ for (int i = 0; i < 2; i++) { |
|
904 |
+ for (int j = 0; j < 8; j++) { |
|
905 |
+ for (int k = 0; k < 4; k++) { |
|
906 |
+ const HuffmanCodebook *hf = &at9_huffman_coeffs[i][j][k]; |
|
907 |
+ init_vlc(&s->coeff_vlc[i][j][k], 9, hf->size, hf->bits, 1, 1, |
|
908 |
+ hf->codes, 2, 2, 0); |
|
909 |
+ } |
|
910 |
+ } |
|
911 |
+ } |
|
912 |
+ |
|
913 |
+ return 0; |
|
914 |
+} |
|
915 |
+ |
|
916 |
+AVCodec ff_atrac9_decoder = { |
|
917 |
+ .name = "atrac9", |
|
918 |
+ .long_name = NULL_IF_CONFIG_SMALL("ATRAC9 (Adaptive TRansform Acoustic Coding 9)"), |
|
919 |
+ .type = AVMEDIA_TYPE_AUDIO, |
|
920 |
+ .id = AV_CODEC_ID_ATRAC9, |
|
921 |
+ .priv_data_size = sizeof(ATRAC9Context), |
|
922 |
+ .init = atrac9_decode_init, |
|
923 |
+ .close = atrac9_decode_close, |
|
924 |
+ .decode = atrac9_decode_frame, |
|
925 |
+ .flush = atrac9_decode_flush, |
|
926 |
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, |
|
927 |
+ .capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1, |
|
928 |
+}; |
0 | 929 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,1626 @@ |
0 |
+/* |
|
1 |
+ * ATRAC9 decoder |
|
2 |
+ * Copyright (c) 2018 Rostislav Pehlivanov <atomnuker@gmail.com> |
|
3 |
+ * |
|
4 |
+ * This file is part of FFmpeg. |
|
5 |
+ * |
|
6 |
+ * FFmpeg is free software; you can redistribute it and/or |
|
7 |
+ * modify it under the terms of the GNU Lesser General Public |
|
8 |
+ * License as published by the Free Software Foundation; either |
|
9 |
+ * version 2.1 of the License, or (at your option) any later version. |
|
10 |
+ * |
|
11 |
+ * FFmpeg is distributed in the hope that it will be useful, |
|
12 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
14 |
+ * Lesser General Public License for more details. |
|
15 |
+ * |
|
16 |
+ * You should have received a copy of the GNU Lesser General Public |
|
17 |
+ * License along with FFmpeg; if not, write to the Free Software |
|
18 |
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
|
19 |
+ */ |
|
20 |
+ |
|
21 |
+#include <stdint.h> |
|
22 |
+ |
|
23 |
+enum ATRAC9BlockType { |
|
24 |
+ ATRAC9_BLOCK_TYPE_SCE, /* Single channel */ |
|
25 |
+ ATRAC9_BLOCK_TYPE_CPE, /* 2 coupled channels */ |
|
26 |
+ ATRAC9_BLOCK_TYPE_LFE, /* Single LFE channel */ |
|
27 |
+}; |
|
28 |
+ |
|
29 |
+typedef struct ATRAC9BlockConfig { |
|
30 |
+ uint64_t channel_layout; |
|
31 |
+ enum ATRAC9BlockType type[5]; |
|
32 |
+ int plane_map[5][2]; |
|
33 |
+ int count; |
|
34 |
+} ATRAC9BlockConfig; |
|
35 |
+ |
|
36 |
+static const ATRAC9BlockConfig at9_block_layout[] = { |
|
37 |
+ { /* Mono */ |
|
38 |
+ AV_CH_LAYOUT_MONO, |
|
39 |
+ { |
|
40 |
+ ATRAC9_BLOCK_TYPE_SCE, |
|
41 |
+ }, |
|
42 |
+ { { 0 }, }, |
|
43 |
+ 1, |
|
44 |
+ }, |
|
45 |
+ { /* Dual Mono */ |
|
46 |
+ AV_CH_LAYOUT_STEREO, |
|
47 |
+ { |
|
48 |
+ ATRAC9_BLOCK_TYPE_SCE, |
|
49 |
+ ATRAC9_BLOCK_TYPE_SCE, |
|
50 |
+ }, |
|
51 |
+ { { 0 }, { 1 }, }, |
|
52 |
+ 2, |
|
53 |
+ }, |
|
54 |
+ { /* Stereo */ |
|
55 |
+ AV_CH_LAYOUT_STEREO, |
|
56 |
+ { |
|
57 |
+ ATRAC9_BLOCK_TYPE_CPE, |
|
58 |
+ }, |
|
59 |
+ { { 0, 1 }, }, |
|
60 |
+ 1, |
|
61 |
+ }, |
|
62 |
+ { /* 5.1 */ |
|
63 |
+ AV_CH_LAYOUT_5POINT1, |
|
64 |
+ { |
|
65 |
+ ATRAC9_BLOCK_TYPE_CPE, |
|
66 |
+ ATRAC9_BLOCK_TYPE_SCE, |
|
67 |
+ ATRAC9_BLOCK_TYPE_LFE, |
|
68 |
+ ATRAC9_BLOCK_TYPE_CPE, |
|
69 |
+ }, |
|
70 |
+ { { 0, 1 }, { 2 }, { 3 }, { 4, 5 }, }, |
|
71 |
+ 4, |
|
72 |
+ }, |
|
73 |
+ { /* 5.1 */ |
|
74 |
+ AV_CH_LAYOUT_7POINT1, |
|
75 |
+ { |
|
76 |
+ ATRAC9_BLOCK_TYPE_CPE, |
|
77 |
+ ATRAC9_BLOCK_TYPE_SCE, |
|
78 |
+ ATRAC9_BLOCK_TYPE_LFE, |
|
79 |
+ ATRAC9_BLOCK_TYPE_CPE, |
|
80 |
+ ATRAC9_BLOCK_TYPE_CPE, |
|
81 |
+ }, |
|
82 |
+ { { 0, 1 }, { 2 }, { 3 }, { 4, 5 }, { 6, 7 }, }, |
|
83 |
+ 5, |
|
84 |
+ }, |
|
85 |
+ { /* Quad */ |
|
86 |
+ AV_CH_LAYOUT_QUAD, |
|
87 |
+ { |
|
88 |
+ ATRAC9_BLOCK_TYPE_CPE, |
|
89 |
+ ATRAC9_BLOCK_TYPE_CPE, |
|
90 |
+ }, |
|
91 |
+ { { 0, 1 }, { 2, 3 }, }, |
|
92 |
+ 2, |
|
93 |
+ }, |
|
94 |
+}; |
|
95 |
+ |
|
96 |
+static const uint8_t at9_tab_sri_frame_log2[] = { |
|
97 |
+ 6, 6, 7, 7, 7, 8, 8, 8, 6, 6, 7, 7, 7, 8, 8, 8, |
|
98 |
+}; |
|
99 |
+ |
|
100 |
+static const uint8_t at9_tab_band_q_unit_map[] = { |
|
101 |
+ 0, 4, 8, 10, 12, 13, 14, 15, 16, 18, 20, 21, 22, 23, 24, 25, 26, 28, 30, |
|
102 |
+}; |
|
103 |
+ |
|
104 |
+static const uint8_t at9_q_unit_to_coeff_cnt[] = { |
|
105 |
+ 2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 4, 4, 8, 8, 8, |
|
106 |
+ 8, 8, 8, 8, 8, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, |
|
107 |
+}; |
|
108 |
+ |
|
109 |
+static const int at9_q_unit_to_coeff_idx[] = { |
|
110 |
+ 0, 2, 4, 6, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56, 64, |
|
111 |
+ 72, 80, 88, 96, 112, 128, 144, 160, 176, 192, 208, 224, 240, 256 |
|
112 |
+}; |
|
113 |
+ |
|
114 |
+const uint8_t at9_q_unit_to_codebookidx[] = { |
|
115 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, |
|
116 |
+ 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, |
|
117 |
+}; |
|
118 |
+ |
|
119 |
+static const uint8_t at9_tab_sri_max_bands[] = { |
|
120 |
+ 8, 8, 12, 12, 12, 18, 18, 18, 8, 8, 12, 12, 12, 16, 16, 16, |
|
121 |
+}; |
|
122 |
+ |
|
123 |
+static const int at9_tab_samplerates[] = { |
|
124 |
+ 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000, 44100, 48000, |
|
125 |
+ 64000, 88200, 96000, 128000, 176400, 192000, |
|
126 |
+}; |
|
127 |
+ |
|
128 |
+static const uint8_t at9_tab_band_ext_cnt[][6] = { |
|
129 |
+ { 0, 0, 0, 4, 4, 2 }, |
|
130 |
+ { 0, 0, 0, 0, 0, 0 }, |
|
131 |
+ { 0, 0, 0, 2, 2, 1 }, |
|
132 |
+ { 0, 0, 0, 2, 2, 2 }, |
|
133 |
+ { 1, 1, 1, 0, 0, 0 }, |
|
134 |
+}; |
|
135 |
+ |
|
136 |
+/* B unit, C unit, Band count */ |
|
137 |
+static const uint8_t at9_tab_band_ext_group[][3] = { |
|
138 |
+ { 16, 21, 0 }, |
|
139 |
+ { 18, 22, 1 }, |
|
140 |
+ { 20, 22, 2 }, |
|
141 |
+ { 21, 22, 3 }, |
|
142 |
+ { 21, 22, 3 }, |
|
143 |
+ { 23, 24, 4 }, |
|
144 |
+ { 23, 24, 4 }, |
|
145 |
+ { 24, 24, 5 }, |
|
146 |
+}; |
|
147 |
+ |
|
148 |
+static const uint8_t at9_tab_band_ext_lengths[][6][4] = { |
|
149 |
+ { |
|
150 |
+ { 0, 0, 0, 0 }, |
|
151 |
+ { 0, 0, 0, 0 }, |
|
152 |
+ { 0, 0, 0, 0 }, |
|
153 |
+ { 5, 4, 3, 3 }, |
|
154 |
+ { 4, 4, 3, 4 }, |
|
155 |
+ { 4, 5, 0, 0 }, |
|
156 |
+ }, |
|
157 |
+ { |
|
158 |
+ { 0, 0, 0, 0 }, |
|
159 |
+ { 0, 0, 0, 0 }, |
|
160 |
+ { 0, 0, 0, 0 }, |
|
161 |
+ { 0, 0, 0, 0 }, |
|
162 |
+ { 0, 0, 0, 0 }, |
|
163 |
+ { 0, 0, 0, 0 }, |
|
164 |
+ }, |
|
165 |
+ { |
|
166 |
+ { 0, 0, 0, 0 }, |
|
167 |
+ { 0, 0, 0, 0 }, |
|
168 |
+ { 0, 0, 0, 0 }, |
|
169 |
+ { 6, 6, 0, 0 }, |
|
170 |
+ { 6, 6, 0, 0 }, |
|
171 |
+ { 6, 0, 0, 0 }, |
|
172 |
+ }, |
|
173 |
+ { |
|
174 |
+ { 0, 0, 0, 0 }, |
|
175 |
+ { 0, 0, 0, 0 }, |
|
176 |
+ { 0, 0, 0, 0 }, |
|
177 |
+ { 4, 4, 0, 0 }, |
|
178 |
+ { 4, 4, 0, 0 }, |
|
179 |
+ { 4, 4, 0, 0 }, |
|
180 |
+ }, |
|
181 |
+ { |
|
182 |
+ { 3, 0, 0, 0 }, |
|
183 |
+ { 3, 0, 0, 0 }, |
|
184 |
+ { 3, 0, 0, 0 }, |
|
185 |
+ { 0, 0, 0, 0 }, |
|
186 |
+ { 0, 0, 0, 0 }, |
|
187 |
+ { 0, 0, 0, 0 }, |
|
188 |
+ }, |
|
189 |
+}; |
|
190 |
+ |
|
191 |
+static const float at9_band_ext_scales_m0[][5][32] = { |
|
192 |
+ { |
|
193 |
+ { |
|
194 |
+ 0.000000e+0f, 1.988220e-1f, 2.514343e-1f, 2.960510e-1f, |
|
195 |
+ 3.263550e-1f, 3.771362e-1f, 3.786926e-1f, 4.540405e-1f, |
|
196 |
+ 4.877625e-1f, 5.262451e-1f, 5.447083e-1f, 5.737000e-1f, |
|
197 |
+ 6.212158e-1f, 6.222839e-1f, 6.560974e-1f, 6.896667e-1f, |
|
198 |
+ 7.555542e-1f, 7.677917e-1f, 7.918091e-1f, 7.971497e-1f, |
|
199 |
+ 8.188171e-1f, 8.446045e-1f, 9.790649e-1f, 9.822083e-1f, |
|
200 |
+ 9.846191e-1f, 9.859314e-1f, 9.863586e-1f, 9.863892e-1f, |
|
201 |
+ 9.873352e-1f, 9.881287e-1f, 9.898682e-1f, 9.913330e-1f, |
|
202 |
+ }, { |
|
203 |
+ 0.000000e+0f, 9.982910e-1f, 7.592773e-2f, 7.179565e-1f, |
|
204 |
+ 9.851379e-1f, 5.340271e-1f, 9.013672e-1f, 6.349182e-1f, |
|
205 |
+ 7.226257e-1f, 1.948547e-1f, 7.628174e-1f, 9.873657e-1f, |
|
206 |
+ 8.112183e-1f, 2.715454e-1f, 9.734192e-1f, 1.443787e-1f, |
|
207 |
+ 4.640198e-1f, 3.249207e-1f, 3.790894e-1f, 8.276367e-2f, |
|
208 |
+ 5.954590e-1f, 2.864380e-1f, 9.806824e-1f, 7.929077e-1f, |
|
209 |
+ 6.292114e-1f, 4.887085e-1f, 2.905273e-1f, 1.301880e-1f, |
|
210 |
+ 3.140869e-1f, 5.482483e-1f, 4.210815e-1f, 1.182861e-1f, |
|
211 |
+ }, { |
|
212 |
+ 0.000000e+0f, 3.155518e-2f, 8.581543e-2f, 1.364746e-1f, |
|
213 |
+ 1.858826e-1f, 2.368469e-1f, 2.888184e-1f, 3.432617e-1f, |
|
214 |
+ 4.012451e-1f, 4.623108e-1f, 5.271301e-1f, 5.954895e-1f, |
|
215 |
+ 6.681213e-1f, 7.448425e-1f, 8.245239e-1f, 9.097290e-1f, |
|
216 |
+ }, { |
|
217 |
+ 0.000000e+0f, 4.418945e-2f, 1.303711e-1f, 2.273560e-1f, |
|
218 |
+ 3.395996e-1f, 4.735718e-1f, 6.267090e-1f, 8.003845e-1f, |
|
219 |
+ }, { |
|
220 |
+ 0.000000e+0f, 2.804565e-2f, 9.683228e-2f, 1.849976e-1f, |
|
221 |
+ 3.005981e-1f, 4.470520e-1f, 6.168518e-1f, 8.007813e-1f, |
|
222 |
+ }, |
|
223 |
+ }, |
|
224 |
+ { |
|
225 |
+ { |
|
226 |
+ 0.000000e+0f, 2.708740e-1f, 3.479614e-1f, 3.578186e-1f, |
|
227 |
+ 5.083618e-1f, 5.299072e-1f, 5.819092e-1f, 6.381836e-1f, |
|
228 |
+ 7.276917e-1f, 7.595520e-1f, 7.878723e-1f, 9.707336e-1f, |
|
229 |
+ 9.713135e-1f, 9.736023e-1f, 9.759827e-1f, 9.832458e-1f, |
|
230 |
+ }, { |
|
231 |
+ 0.000000e+0f, 2.330627e-1f, 5.891418e-1f, 7.170410e-1f, |
|
232 |
+ 2.036438e-1f, 1.613464e-1f, 6.668701e-1f, 9.481201e-1f, |
|
233 |
+ 9.769897e-1f, 5.111694e-1f, 3.522644e-1f, 8.209534e-1f, |
|
234 |
+ 2.933960e-1f, 9.757690e-1f, 5.289917e-1f, 4.372253e-1f, |
|
235 |
+ }, { |
|
236 |
+ 0.000000e+0f, 4.360962e-2f, 1.056519e-1f, 1.590576e-1f, |
|
237 |
+ 2.078857e-1f, 2.572937e-1f, 3.082581e-1f, 3.616028e-1f, |
|
238 |
+ 4.191589e-1f, 4.792175e-1f, 5.438538e-1f, 6.125183e-1f, |
|
239 |
+ 6.841125e-1f, 7.589417e-1f, 8.365173e-1f, 9.148254e-1f, |
|
240 |
+ }, { |
|
241 |
+ 0.000000e+0f, 4.074097e-2f, 1.164551e-1f, 2.077026e-1f, |
|
242 |
+ 3.184509e-1f, 4.532166e-1f, 6.124268e-1f, 7.932129e-1f, |
|
243 |
+ }, { |
|
244 |
+ 0.000000e+0f, 8.880615e-3f, 2.932739e-2f, 5.593872e-2f, |
|
245 |
+ 8.825684e-2f, 1.259155e-1f, 1.721497e-1f, 2.270813e-1f, |
|
246 |
+ 2.901611e-1f, 3.579712e-1f, 4.334106e-1f, 5.147095e-1f, |
|
247 |
+ 6.023254e-1f, 6.956177e-1f, 7.952881e-1f, 8.977356e-1f, |
|
248 |
+ }, |
|
249 |
+ }, |
|
250 |
+ { |
|
251 |
+ { |
|
252 |
+ 0.000000e+0f, 7.379150e-2f, 1.806335e-1f, 2.687073e-1f, |
|
253 |
+ 3.407898e-1f, 4.047546e-1f, 4.621887e-1f, 5.168762e-1f, |
|
254 |
+ 5.703125e-1f, 6.237488e-1f, 6.763611e-1f, 7.288208e-1f, |
|
255 |
+ 7.808533e-1f, 8.337708e-1f, 8.874512e-1f, 9.418030e-1f, |
|
256 |
+ }, { |
|
257 |
+ 0.000000e+0f, 7.980347e-2f, 1.615295e-1f, 1.665649e-1f, |
|
258 |
+ 1.822205e-1f, 2.185669e-1f, 2.292175e-1f, 2.456665e-1f, |
|
259 |
+ 2.666321e-1f, 3.306580e-1f, 3.330688e-1f, 3.765259e-1f, |
|
260 |
+ 4.085083e-1f, 4.400024e-1f, 4.407654e-1f, 4.817505e-1f, |
|
261 |
+ 4.924011e-1f, 5.320740e-1f, 5.893860e-1f, 6.131287e-1f, |
|
262 |
+ 6.212463e-1f, 6.278076e-1f, 6.308899e-1f, 7.660828e-1f, |
|
263 |
+ 7.850647e-1f, 7.910461e-1f, 7.929382e-1f, 8.038330e-1f, |
|
264 |
+ 9.834900e-1f, 9.846191e-1f, 9.852295e-1f, 9.862671e-1f, |
|
265 |
+ }, { |
|
266 |
+ 0.000000e+0f, 6.084290e-1f, 3.672791e-1f, 3.151855e-1f, |
|
267 |
+ 1.488953e-1f, 2.571716e-1f, 5.103455e-1f, 3.311157e-1f, |
|
268 |
+ 5.426025e-2f, 4.254456e-1f, 7.998352e-1f, 7.873230e-1f, |
|
269 |
+ 5.418701e-1f, 2.925110e-1f, 8.468628e-2f, 1.410522e-1f, |
|
270 |
+ 9.819641e-1f, 9.609070e-1f, 3.530884e-2f, 9.729004e-2f, |
|
271 |
+ 5.758362e-1f, 9.941711e-1f, 7.215576e-1f, 7.183228e-1f, |
|
272 |
+ 2.028809e-1f, 9.588623e-2f, 2.032166e-1f, 1.338806e-1f, |
|
273 |
+ 5.003357e-1f, 1.874390e-1f, 9.804993e-1f, 1.107788e-1f, |
|
274 |
+ }, |
|
275 |
+ }, |
|
276 |
+}; |
|
277 |
+ |
|
278 |
+static const float at9_band_ext_scales_m2[] = { |
|
279 |
+ 4.272461e-4f, 1.312256e-3f, 2.441406e-3f, 3.692627e-3f, |
|
280 |
+ 4.913330e-3f, 6.134033e-3f, 7.507324e-3f, 8.972168e-3f, |
|
281 |
+ 1.049805e-2f, 1.223755e-2f, 1.406860e-2f, 1.599121e-2f, |
|
282 |
+ 1.800537e-2f, 2.026367e-2f, 2.264404e-2f, 2.517700e-2f, |
|
283 |
+ 2.792358e-2f, 3.073120e-2f, 3.344727e-2f, 3.631592e-2f, |
|
284 |
+ 3.952026e-2f, 4.275513e-2f, 4.608154e-2f, 4.968262e-2f, |
|
285 |
+ 5.355835e-2f, 5.783081e-2f, 6.195068e-2f, 6.677246e-2f, |
|
286 |
+ 7.196045e-2f, 7.745361e-2f, 8.319092e-2f, 8.993530e-2f, |
|
287 |
+ 9.759521e-2f, 1.056213e-1f, 1.138916e-1f, 1.236267e-1f, |
|
288 |
+ 1.348267e-1f, 1.470337e-1f, 1.603394e-1f, 1.755676e-1f, |
|
289 |
+ 1.905823e-1f, 2.071228e-1f, 2.245178e-1f, 2.444153e-1f, |
|
290 |
+ 2.658997e-1f, 2.897644e-1f, 3.146057e-1f, 3.450012e-1f, |
|
291 |
+ 3.766174e-1f, 4.122620e-1f, 4.505615e-1f, 4.893799e-1f, |
|
292 |
+ 5.305481e-1f, 5.731201e-1f, 6.157837e-1f, 6.580811e-1f, |
|
293 |
+ 6.985168e-1f, 7.435303e-1f, 7.865906e-1f, 8.302612e-1f, |
|
294 |
+ 8.718567e-1f, 9.125671e-1f, 9.575806e-1f, 9.996643e-1f, |
|
295 |
+}; |
|
296 |
+ |
|
297 |
+static const float at9_band_ext_scales_m3[][2] = { |
|
298 |
+ { 3.491211e-1f, -2.913818e-1f, }, { 5.371094e-1f, -2.541504e-1f, }, |
|
299 |
+ { 6.782227e-1f, -1.664429e-1f, }, { 7.910156e-1f, -1.476440e-1f, }, |
|
300 |
+ { 9.057617e-1f, -1.342163e-1f, }, { 1.024902e+0f, -1.220703e-1f, }, |
|
301 |
+ { 1.156250e+0f, -1.117554e-1f, }, { 1.290527e+0f, -1.026611e-1f, }, |
|
302 |
+ { 1.458984e+0f, -9.436035e-2f, }, { 1.664551e+0f, -8.483887e-2f, }, |
|
303 |
+ { 1.929688e+0f, -7.476807e-2f, }, { 2.278320e+0f, -6.304932e-2f, }, |
|
304 |
+ { 2.831543e+0f, -4.492188e-2f, }, { 3.659180e+0f, -2.447510e-2f, }, |
|
305 |
+ { 5.257813e+0f, +1.831055e-4f, }, { 8.373047e+0f, +4.174805e-2f, }, |
|
306 |
+}; |
|
307 |
+ |
|
308 |
+static const float at9_band_ext_scales_m4[] = { |
|
309 |
+ 3.610229e-2f, 1.260681e-1f, 2.227478e-1f, 3.338318e-1f, |
|
310 |
+ 4.662170e-1f, 6.221313e-1f, 7.989197e-1f, 9.939575e-1f, |
|
311 |
+}; |
|
312 |
+ |
|
313 |
+static const float at9_quant_step_coarse[] = { |
|
314 |
+ 2.0000000000000000e+0f, 6.6666666666666663e-1f, 2.8571428571428570e-1f, |
|
315 |
+ 1.3333333333333333e-1f, 6.4516129032258063e-2f, 3.1746031746031744e-2f, |
|
316 |
+ 1.5748031496062992e-2f, 7.8431372549019607e-3f, 3.9138943248532287e-3f, |
|
317 |
+ 1.9550342130987292e-3f, 9.7703957010258913e-4f, 4.8840048840048840e-4f, |
|
318 |
+ 2.4417043096081065e-4f, 1.2207776353537203e-4f, 6.1037018951994385e-5f, |
|
319 |
+ 3.0518043793392844e-5f, |
|
320 |
+}; |
|
321 |
+ |
|
322 |
+static const float at9_quant_step_fine[] = { |
|
323 |
+ 3.0518043793392844e-05f, 1.0172681264464281e-05f, 4.3597205419132631e-06f, |
|
324 |
+ 2.0345362528928561e-06f, 9.8445302559331759e-07f, 4.8441339354591809e-07f, |
|
325 |
+ 2.4029955742829012e-07f, 1.1967860311134448e-07f, 5.9722199204291275e-08f, |
|
326 |
+ 2.9831909866464167e-08f, 1.4908668194134265e-08f, 7.4525137468602791e-09f, |
|
327 |
+ 3.7258019525568114e-09f, 1.8627872668859698e-09f, 9.3136520869755679e-10f, |
|
328 |
+ 4.6567549848772173e-10f, |
|
329 |
+}; |
|
330 |
+ |
|
331 |
+static const float at9_scalefactor_c[] = { |
|
332 |
+ 3.0517578125e-5f, 6.1035156250e-5f, 1.2207031250e-4f, 2.4414062500e-4f, |
|
333 |
+ 4.8828125000e-4f, 9.7656250000e-4f, 1.9531250000e-3f, 3.9062500000e-3f, |
|
334 |
+ 7.8125000000e-3f, 1.5625000000e-2f, 3.1250000000e-2f, 6.2500000000e-2f, |
|
335 |
+ 1.2500000000e-1f, 2.5000000000e-1f, 5.0000000000e-1f, 1.0000000000e+0f, |
|
336 |
+ 2.0000000000e+0f, 4.0000000000e+0f, 8.0000000000e+0f, 1.6000000000e+1f, |
|
337 |
+ 3.2000000000e+1f, 6.4000000000e+1f, 1.2800000000e+2f, 2.5600000000e+2f, |
|
338 |
+ 5.1200000000e+2f, 1.0240000000e+3f, 2.0480000000e+3f, 4.0960000000e+3f, |
|
339 |
+ 8.1920000000e+3f, 1.6384000000e+4f, 3.2768000000e+4f, 6.5536000000e+4f, |
|
340 |
+}; |
|
341 |
+ |
|
342 |
+static const uint8_t at9_tab_sf_weights[][32] = { |
|
343 |
+ { |
|
344 |
+ 0, 0, 0, 1, 1, 2, 2, 2, 2, 2, 2, 3, 2, 3, 3, 4, 4, 4, |
|
345 |
+ 4, 4, 4, 5, 5, 6, 6, 7, 7, 8, 10, 12, 12, 12, |
|
346 |
+ }, |
|
347 |
+ { |
|
348 |
+ 3, 2, 2, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, |
|
349 |
+ 1, 1, 1, 1, 1, 2, 3, 3, 4, 5, 7, 10, 10, 10, |
|
350 |
+ }, |
|
351 |
+ { |
|
352 |
+ 0, 2, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, |
|
353 |
+ 6, 6, 6, 6, 6, 7, 7, 7, 7, 8, 9, 12, 12, 12, |
|
354 |
+ }, |
|
355 |
+ { |
|
356 |
+ 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, |
|
357 |
+ 6, 6, 6, 7, 8, 8, 10, 11, 11, 12, 13, 13, 13, 13, |
|
358 |
+ }, |
|
359 |
+ { |
|
360 |
+ 0, 2, 2, 3, 3, 4, 4, 5, 4, 5, 5, 5, 5, 6, 7, 8, 8, 8, |
|
361 |
+ 8, 9, 9, 9, 10, 10, 11, 12, 12, 13, 13, 14, 14, 14, |
|
362 |
+ }, |
|
363 |
+ { |
|
364 |
+ 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, |
|
365 |
+ 2, 3, 3, 3, 4, 4, 5, 6, 7, 7, 9, 11, 11, 11, |
|
366 |
+ }, |
|
367 |
+ { |
|
368 |
+ 0, 5, 8, 10, 11, 11, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, |
|
369 |
+ 13, 13, 13, 13, 13, 13, 12, 12, 12, 12, 13, 15, 15, 15, |
|
370 |
+ }, |
|
371 |
+ { |
|
372 |
+ 0, 2, 3, 4, 5, 6, 6, 7, 7, 8, 8, 8, 9, 9, 10, 10, 10, 11, |
|
373 |
+ 11, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 15, 15, 15, |
|
374 |
+ }, |
|
375 |
+}; |
|
376 |
+ |
|
377 |
+static const uint8_t at9_tab_b_dist[] = { |
|
378 |
+ 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 6, 7, 8, |
|
379 |
+ 9, 10, 11, 12, 13, 15, 6, 18, 19, 20, 21, 22, 23, 24, 25, 26, 26, 27, |
|
380 |
+ 27, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30, 30, |
|
381 |
+}; |
|
382 |
+ |
|
383 |
+static const uint8_t huff_sfb_a1_bits[] = { |
|
384 |
+ 1, 1, |
|
385 |
+}; |
|
386 |
+ |
|
387 |
+static const uint16_t huff_sfb_a1_codes[] = { |
|
388 |
+ 0x00, 0x01, |
|
389 |
+}; |
|
390 |
+ |
|
391 |
+static const uint8_t huff_sfb_a2_bits[] = { |
|
392 |
+ 1, 3, 3, 2, |
|
393 |
+}; |
|
394 |
+ |
|
395 |
+static const uint16_t huff_sfb_a2_codes[] = { |
|
396 |
+ 0x00, 0x06, 0x07, 0x02, |
|
397 |
+}; |
|
398 |
+ |
|
399 |
+static const uint8_t huff_sfb_a3_bits[] = { |
|
400 |
+ 2, 2, 4, 6, 6, 5, 3, 2, |
|
401 |
+}; |
|
402 |
+ |
|
403 |
+static const uint16_t huff_sfb_a3_codes[] = { |
|
404 |
+ 0x00, 0x01, 0x0E, 0x3E, 0x3F, 0x1E, 0x06, 0x02, |
|
405 |
+}; |
|
406 |
+ |
|
407 |
+static const uint8_t huff_sfb_a4_bits[] = { |
|
408 |
+ 2, 2, 4, 5, 6, 7, 8, 8, 8, 8, 8, 8, 6, 5, 4, 2, |
|
409 |
+}; |
|
410 |
+ |
|
411 |
+static const uint16_t huff_sfb_a4_codes[] = { |
|
412 |
+ 0x01, 0x02, 0x00, 0x06, 0x0F, 0x13, 0x23, 0x24, |
|
413 |
+ 0x25, 0x22, 0x21, 0x20, 0x0E, 0x05, 0x01, 0x03, |
|
414 |
+}; |
|
415 |
+ |
|
416 |
+static const uint8_t huff_sfb_a5_bits[] = { |
|
417 |
+ 2, 3, 3, 4, 5, 5, 6, 7, 7, 8, 8, 8, 8, 8, 8, 8, |
|
418 |
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 6, 5, 5, 4, 3, |
|
419 |
+}; |
|
420 |
+ |
|
421 |
+static const uint16_t huff_sfb_a5_codes[] = { |
|
422 |
+ 0x02, 0x01, 0x07, 0x0D, 0x0C, 0x18, 0x1B, 0x21, 0x3F, 0x6A, 0x6B, 0x68, |
|
423 |
+ 0x73, 0x79, 0x7C, 0x7D, 0x7A, 0x7B, 0x78, 0x72, 0x44, 0x45, 0x47, 0x46, |
|
424 |
+ 0x69, 0x38, 0x20, 0x1D, 0x19, 0x09, 0x05, 0x00, |
|
425 |
+}; |
|
426 |
+ |
|
427 |
+static const uint8_t huff_sfb_a6_bits[] = { |
|
428 |
+ 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, 8, 8, 8, 8, 8, |
|
429 |
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, |
|
430 |
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, |
|
431 |
+ 8, 8, 8, 8, 8, 7, 7, 7, 6, 6, 5, 5, 5, 4, 4, 4, |
|
432 |
+}; |
|
433 |
+ |
|
434 |
+static const uint16_t huff_sfb_a6_codes[] = { |
|
435 |
+ 0x00, 0x01, 0x04, 0x05, 0x12, 0x13, 0x2E, 0x2F, 0x30, 0x66, 0x67, 0xD6, |
|
436 |
+ 0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF, 0xE0, 0xE1, 0xE2, |
|
437 |
+ 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, |
|
438 |
+ 0xEF, 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, |
|
439 |
+ 0xFB, 0xFC, 0xFD, 0xFE, 0xFF, 0x68, 0x69, 0x6A, 0x31, 0x32, 0x14, 0x15, |
|
440 |
+ 0x16, 0x06, 0x07, 0x08, |
|
441 |
+}; |
|
442 |
+ |
|
443 |
+static const uint8_t huff_sfb_b2_bits[] = { |
|
444 |
+ 1, 2, 0, 2, |
|
445 |
+}; |
|
446 |
+ |
|
447 |
+static const uint16_t huff_sfb_b2_codes[] = { |
|
448 |
+ 0x00, 0x03, 0x00, 0x02, |
|
449 |
+}; |
|
450 |
+ |
|
451 |
+static const uint8_t huff_sfb_b3_bits[] = { |
|
452 |
+ 1, 3, 5, 6, 0, 6, 4, 2, |
|
453 |
+}; |
|
454 |
+ |
|
455 |
+static const uint16_t huff_sfb_b3_codes[] = { |
|
456 |
+ 0x01, 0x00, 0x04, 0x0B, 0x00, 0x0A, 0x03, 0x01, |
|
457 |
+}; |
|
458 |
+ |
|
459 |
+static const uint8_t huff_sfb_b4_bits[] = { |
|
460 |
+ 1, 3, 4, 5, 5, 7, 8, 8, 0, 8, 8, 7, 6, 6, 4, 3, |
|
461 |
+}; |
|
462 |
+ |
|
463 |
+static const uint16_t huff_sfb_b4_codes[] = { |
|
464 |
+ 0x01, 0x01, 0x04, 0x0E, 0x0F, 0x2C, 0x5A, 0x5D, 0x00, 0x5C, 0x5B, 0x2F, |
|
465 |
+ 0x15, 0x14, 0x06, 0x00, |
|
466 |
+}; |
|
467 |
+ |
|
468 |
+static const uint8_t huff_sfb_b5_bits[] = { |
|
469 |
+ 3, 3, 4, 4, 4, 4, 4, 4, 4, 5, 6, 7, 7, 7, 8, 8, |
|
470 |
+ 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 3, |
|
471 |
+}; |
|
472 |
+ |
|
473 |
+static const uint16_t huff_sfb_b5_codes[] = { |
|
474 |
+ 0x00, 0x05, 0x07, 0x0C, 0x04, 0x02, 0x03, 0x05, 0x09, 0x10, 0x23, 0x33, |
|
475 |
+ 0x36, 0x6E, 0x60, 0x65, 0x62, 0x61, 0x63, 0x64, 0x6F, 0x6D, 0x6C, 0x6B, |
|
476 |
+ 0x6A, 0x68, 0x69, 0x45, 0x44, 0x37, 0x1A, 0x07, |
|
477 |
+}; |
|
478 |
+ |
|
479 |
+typedef struct HuffmanCodebook { |
|
480 |
+ const uint8_t *bits; |
|
481 |
+ const uint16_t *codes; |
|
482 |
+ const int size; |
|
483 |
+ const int value_cnt; |
|
484 |
+ const int value_cnt_pow; |
|
485 |
+ const int value_bits; |
|
486 |
+ const int max_bit_size; |
|
487 |
+} HuffmanCodebook; |
|
488 |
+ |
|
489 |
+static const HuffmanCodebook at9_huffman_sf_unsigned[] = { |
|
490 |
+ { 0 }, |
|
491 |
+ { huff_sfb_a1_bits, huff_sfb_a1_codes, 2, 1, 0, 1, 1, }, |
|
492 |
+ { huff_sfb_a2_bits, huff_sfb_a2_codes, 4, 1, 0, 2, 3, }, |
|
493 |
+ { huff_sfb_a3_bits, huff_sfb_a3_codes, 8, 1, 0, 3, 6, }, |
|
494 |
+ { huff_sfb_a4_bits, huff_sfb_a4_codes, 16, 1, 0, 4, 8, }, |
|
495 |
+ { huff_sfb_a5_bits, huff_sfb_a5_codes, 32, 1, 0, 5, 8, }, |
|
496 |
+ { huff_sfb_a6_bits, huff_sfb_a6_codes, 64, 1, 0, 6, 8, }, |
|
497 |
+}; |
|
498 |
+ |
|
499 |
+static const HuffmanCodebook at9_huffman_sf_signed[] = { |
|
500 |
+ { 0 }, |
|
501 |
+ { 0 }, |
|
502 |
+ { huff_sfb_b2_bits, huff_sfb_b2_codes, 4, 1, 0, 2, 2, }, |
|
503 |
+ { huff_sfb_b3_bits, huff_sfb_b3_codes, 8, 1, 0, 3, 6, }, |
|
504 |
+ { huff_sfb_b4_bits, huff_sfb_b4_codes, 16, 1, 0, 4, 8, }, |
|
505 |
+ { huff_sfb_b5_bits, huff_sfb_b5_codes, 32, 1, 0, 5, 8, }, |
|
506 |
+}; |
|
507 |
+ |
|
508 |
+static const uint8_t huff_spec_a21_bits[] = { |
|
509 |
+ 0, 3, 0, 3, 3, 3, 0, 3, 0, 0, 0, 0, 3, 3, 0, 3, |
|
510 |
+}; |
|
511 |
+ |
|
512 |
+static const uint16_t huff_spec_a21_codes[] = { |
|
513 |
+ 0x00, 0x00, 0x00, 0x01, 0x03, 0x07, 0x00, 0x04, |
|
514 |
+ 0x00, 0x00, 0x00, 0x00, 0x02, 0x05, 0x00, 0x06, |
|
515 |
+}; |
|
516 |
+ |
|
517 |
+static const uint8_t huff_spec_a22_bits[] = { |
|
518 |
+ 0, 4, 0, 4, 5, 6, 0, 6, 0, 0, 0, 0, 5, 6, 0, 6, |
|
519 |
+ 5, 6, 0, 6, 6, 7, 0, 7, 0, 0, 0, 0, 6, 7, 0, 7, |
|
520 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
521 |
+ 5, 6, 0, 6, 6, 7, 0, 7, 0, 0, 0, 0, 6, 7, 0, 7, |
|
522 |
+ 5, 6, 0, 6, 7, 7, 0, 7, 0, 0, 0, 0, 6, 7, 0, 7, |
|
523 |
+ 6, 7, 0, 7, 7, 8, 0, 8, 0, 0, 0, 0, 7, 8, 0, 7, |
|
524 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
525 |
+ 6, 7, 0, 7, 7, 8, 0, 8, 0, 0, 0, 0, 7, 7, 0, 8, |
|
526 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
527 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
528 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
529 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
530 |
+ 5, 6, 0, 6, 6, 7, 0, 7, 0, 0, 0, 0, 7, 7, 0, 7, |
|
531 |
+ 6, 7, 0, 7, 7, 8, 0, 7, 0, 0, 0, 0, 7, 8, 0, 8, |
|
532 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
533 |
+ 6, 7, 0, 7, 7, 7, 0, 8, 0, 0, 0, 0, 7, 8, 0, 8, |
|
534 |
+}; |
|
535 |
+ |
|
536 |
+static const uint16_t huff_spec_a22_codes[] = { |
|
537 |
+ 0x00, 0x02, 0x00, 0x03, 0x10, 0x3C, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x11, 0x3E, 0x00, 0x3D, |
|
538 |
+ 0x0E, 0x00, 0x00, 0x39, 0x18, 0x26, 0x00, 0x75, 0x00, 0x00, 0x00, 0x00, 0x1B, 0x24, 0x00, 0x6D, |
|
539 |
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
|
540 |
+ 0x0F, 0x38, 0x00, 0x01, 0x1A, 0x6C, 0x00, 0x25, 0x00, 0x00, 0x00, 0x00, 0x19, 0x74, 0x00, 0x27, |
|
541 |
+ 0x16, 0x14, 0x00, 0x17, 0x76, 0x06, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x35, 0x64, 0x00, 0x6F, |
|
542 |
+ 0x26, 0x04, 0x00, 0x63, 0x22, 0xA2, 0x00, 0x97, 0x00, 0x00, 0x00, 0x00, 0x67, 0xA0, 0x00, 0x0D, |
|
543 |
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
|
544 |
+ 0x2B, 0x52, 0x00, 0x0B, 0x20, 0x92, 0x00, 0x91, 0x00, 0x00, 0x00, 0x00, 0x61, 0x0E, 0x00, 0x95, |
|
545 |
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
|
546 |
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
|
547 |
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
|
548 |
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
|
549 |
+ 0x17, 0x16, 0x00, 0x15, 0x34, 0x6E, 0x00, 0x65, 0x00, 0x00, 0x00, 0x00, 0x77, 0x08, 0x00, 0x07, |
|
550 |
+ 0x2A, 0x0A, 0x00, 0x53, 0x60, 0x94, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x21, 0x90, 0x00, 0x93, |
|
551 |
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
|
552 |
+ 0x27, 0x62, 0x00, 0x05, 0x66, 0x0C, 0x00, 0xA1, 0x00, 0x00, 0x00, 0x00, 0x23, 0x96, 0x00, 0xA3, |
|
553 |
+}; |
|
554 |
+ |
|
555 |
+static const uint8_t huff_spec_a23_bits[] = { |
|
556 |
+ 3, 4, 0, 4, 5, 6, 0, 6, 0, 0, 0, 0, 5, 6, 0, 6, |
|
557 |
+ 5, 7, 0, 6, 6, 8, 0, 7, 0, 0, 0, 0, 6, 8, 0, 7, |
|
558 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
559 |
+ 5, 6, 0, 7, 6, 7, 0, 8, 0, 0, 0, 0, 6, 7, 0, 8, |
|
560 |
+ 5, 6, 0, 6, 7, 8, 0, 8, 0, 0, 0, 0, 6, 7, 0, 7, |
|
561 |
+ 6, 8, 0, 7, 8, 9, 0, 9, 0, 0, 0, 0, 7, 9, 0, 8, |
|
562 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
563 |
+ 6, 8, 0, 8, 8, 9, 0, 9, 0, 0, 0, 0, 7, 8, 0, 9, |
|
564 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
565 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
566 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
567 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
568 |
+ 5, 6, 0, 6, 6, 7, 0, 7, 0, 0, 0, 0, 7, 8, 0, 8, |
|
569 |
+ 6, 8, 0, 8, 7, 9, 0, 8, 0, 0, 0, 0, 8, 9, 0, 9, |
|
570 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
571 |
+ 6, 7, 0, 8, 7, 8, 0, 9, 0, 0, 0, 0, 8, 9, 0, 9, |
|
572 |
+}; |
|
573 |
+ |
|
574 |
+static const uint16_t huff_spec_a23_codes[] = { |
|
575 |
+ 0x006, 0x002, 0x000, 0x003, 0x016, 0x01E, 0x000, 0x021, 0x000, 0x000, 0x000, 0x000, |
|
576 |
+ 0x017, 0x020, 0x000, 0x01F, 0x01C, 0x054, 0x000, 0x027, 0x010, 0x0A6, 0x000, 0x027, |
|
577 |
+ 0x000, 0x000, 0x000, 0x000, 0x015, 0x0A4, 0x000, 0x02D, 0x000, 0x000, 0x000, 0x000, |
|
578 |
+ 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, |
|
579 |
+ 0x01D, 0x026, 0x000, 0x055, 0x014, 0x02C, 0x000, 0x0A5, 0x000, 0x000, 0x000, 0x000, |
|
580 |
+ 0x011, 0x026, 0x000, 0x0A7, 0x01E, 0x000, 0x000, 0x003, 0x04A, 0x074, 0x000, 0x071, |
|
581 |
+ 0x000, 0x000, 0x000, 0x000, 0x023, 0x00A, 0x000, 0x009, 0x018, 0x072, 0x000, 0x00D, |
|
582 |
+ 0x0A2, 0x15A, 0x000, 0x123, 0x000, 0x000, 0x000, 0x000, 0x00F, 0x158, 0x000, 0x05D, |
|
583 |
+ 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, |
|
584 |
+ 0x000, 0x000, 0x000, 0x000, 0x01B, 0x0AE, 0x000, 0x077, 0x092, 0x140, 0x000, 0x121, |
|
585 |
+ 0x000, 0x000, 0x000, 0x000, 0x025, 0x05E, 0x000, 0x143, 0x000, 0x000, 0x000, 0x000, |
|
586 |
+ 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, |
|
587 |
+ 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, |
|
588 |
+ 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, |
|
589 |
+ 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, |
|
590 |
+ 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, |
|
591 |
+ 0x01F, 0x002, 0x000, 0x001, 0x022, 0x008, 0x000, 0x00B, 0x000, 0x000, 0x000, 0x000, |
|
592 |
+ 0x04B, 0x070, 0x000, 0x075, 0x01A, 0x076, 0x000, 0x0AF, 0x024, 0x142, 0x000, 0x05F, |
|
593 |
+ 0x000, 0x000, 0x000, 0x000, 0x093, 0x120, 0x000, 0x141, 0x000, 0x000, 0x000, 0x000, |
|
594 |
+ 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, |
|
595 |
+ 0x019, 0x00C, 0x000, 0x073, 0x00E, 0x05C, 0x000, 0x159, 0x000, 0x000, 0x000, 0x000, |
|
596 |
+ 0x0A3, 0x122, 0x000, 0x15B, |
|
597 |
+}; |
|
598 |
+ |
|
599 |
+static const uint8_t huff_spec_a24_bits[] = { |
|
600 |
+ 2, 4, 0, 4, 5, 6, 0, 6, 0, 0, 0, 0, 5, 6, 0, 6, |
|
601 |
+ 5, 7, 0, 6, 6, 8, 0, 8, 0, 0, 0, 0, 6, 8, 0, 8, |
|
602 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
603 |
+ 5, 6, 0, 7, 6, 8, 0, 8, 0, 0, 0, 0, 6, 8, 0, 8, |
|
604 |
+ 5, 7, 0, 7, 7, 9, 0, 9, 0, 0, 0, 0, 6, 8, 0, 8, |
|
605 |
+ 6, 9, 0, 8, 8, 10, 0, 10, 0, 0, 0, 0, 8, 10, 0, 9, |
|
606 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
607 |
+ 6, 8, 0, 9, 9, 10, 0, 10, 0, 0, 0, 0, 8, 9, 0, 10, |
|
608 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
609 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
610 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
611 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
612 |
+ 5, 7, 0, 7, 6, 8, 0, 8, 0, 0, 0, 0, 7, 9, 0, 9, |
|
613 |
+ 6, 9, 0, 8, 8, 10, 0, 9, 0, 0, 0, 0, 9, 10, 0, 10, |
|
614 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
615 |
+ 6, 8, 0, 9, 8, 9, 0, 10, 0, 0, 0, 0, 8, 10, 0, 10, |
|
616 |
+}; |
|
617 |
+ |
|
618 |
+static const uint16_t huff_spec_a24_codes[] = { |
|
619 |
+ 0x002, 0x002, 0x000, 0x003, 0x01E, 0x010, 0x000, 0x013, 0x000, 0x000, 0x000, 0x000, |
|
620 |
+ 0x01F, 0x012, 0x000, 0x011, 0x01A, 0x030, 0x000, 0x01B, 0x000, 0x064, 0x000, 0x0C1, |
|
621 |
+ 0x000, 0x000, 0x000, 0x000, 0x003, 0x052, 0x000, 0x07D, 0x000, 0x000, 0x000, 0x000, |
|
622 |
+ 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, |
|
623 |
+ 0x01B, 0x01A, 0x000, 0x031, 0x002, 0x07C, 0x000, 0x053, 0x000, 0x000, 0x000, 0x000, |
|
624 |
+ 0x001, 0x0C0, 0x000, 0x065, 0x01C, 0x062, 0x000, 0x065, 0x02A, 0x198, 0x000, 0x19B, |
|
625 |
+ 0x000, 0x000, 0x000, 0x000, 0x017, 0x078, 0x000, 0x07B, 0x004, 0x0FE, 0x000, 0x077, |
|
626 |
+ 0x050, 0x33A, 0x000, 0x1F9, 0x000, 0x000, 0x000, 0x000, 0x073, 0x338, 0x000, 0x0E1, |
|
627 |
+ 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, |
|
628 |
+ 0x000, 0x000, 0x000, 0x000, 0x007, 0x066, 0x000, 0x187, 0x19E, 0x308, 0x000, 0x30B, |
|
629 |
+ 0x000, 0x000, 0x000, 0x000, 0x075, 0x0E2, 0x000, 0x1FB, 0x000, 0x000, 0x000, 0x000, |
|
630 |
+ 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, |
|
631 |
+ 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, |
|
632 |
+ 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, |
|
633 |
+ 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, |
|
634 |
+ 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, |
|
635 |
+ 0x01D, 0x064, 0x000, 0x063, 0x016, 0x07A, 0x000, 0x079, 0x000, 0x000, 0x000, 0x000, |
|
636 |
+ 0x02B, 0x19A, 0x000, 0x199, 0x006, 0x186, 0x000, 0x067, 0x074, 0x1FA, 0x000, 0x0E3, |
|
637 |
+ 0x000, 0x000, 0x000, 0x000, 0x19F, 0x30A, 0x000, 0x309, 0x000, 0x000, 0x000, 0x000, |
|
638 |
+ 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, |
|
639 |
+ 0x005, 0x076, 0x000, 0x0FF, 0x072, 0x0E0, 0x000, 0x339, 0x000, 0x000, 0x000, 0x000, |
|
640 |
+ 0x051, 0x1F8, 0x000, 0x33B, |
|
641 |
+}; |
|
642 |
+ |
|
643 |
+static const uint8_t huff_spec_a31_bits[] = { |
|
644 |
+ 0, 0, 4, 5, 0, 5, 4, 0, 0, 0, 5, 5, 0, 5, 5, 0, |
|
645 |
+ 5, 5, 6, 6, 0, 6, 5, 5, 5, 6, 6, 7, 0, 7, 6, 6, |
|
646 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 5, 6, 6, 7, 0, 7, 6, 6, |
|
647 |
+ 5, 5, 5, 6, 0, 6, 6, 5, 0, 0, 5, 5, 0, 5, 5, 0, |
|
648 |
+}; |
|
649 |
+ |
|
650 |
+static const uint16_t huff_spec_a31_codes[] = { |
|
651 |
+ 0x00, 0x00, 0x02, 0x18, 0x00, 0x19, 0x03, 0x00, 0x00, 0x00, 0x12, 0x02, 0x00, 0x09, 0x15, 0x00, |
|
652 |
+ 0x1A, 0x0A, 0x3E, 0x2C, 0x00, 0x2F, 0x01, 0x0D, 0x0E, 0x38, 0x20, 0x78, 0x00, 0x7B, 0x23, 0x3B, |
|
653 |
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x3A, 0x22, 0x7A, 0x00, 0x79, 0x21, 0x39, |
|
654 |
+ 0x1B, 0x0C, 0x00, 0x2E, 0x00, 0x2D, 0x3F, 0x0B, 0x00, 0x00, 0x14, 0x08, 0x00, 0x03, 0x13, 0x00, |
|
655 |
+}; |
|
656 |
+ |
|
657 |
+static const uint8_t huff_spec_a32_bits[] = { |
|
658 |
+ 4, 5, 5, 6, 0, 6, 5, 5, 5, 6, 5, 6, 0, 6, 5, 5, |
|
659 |
+ 5, 5, 6, 7, 0, 7, 6, 5, 6, 6, 7, 7, 0, 7, 7, 6, |
|
660 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, 7, 7, 0, 7, 7, 6, |
|
661 |
+ 5, 5, 6, 7, 0, 7, 6, 5, 5, 5, 5, 6, 0, 6, 5, 6, |
|
662 |
+}; |
|
663 |
+ |
|
664 |
+static const uint16_t huff_spec_a32_codes[] = { |
|
665 |
+ 0x0D, 0x18, 0x16, 0x3A, 0x00, 0x3B, 0x17, 0x19, 0x12, 0x3E, 0x08, 0x1C, 0x00, 0x1B, 0x07, 0x01, |
|
666 |
+ 0x10, 0x02, 0x28, 0x78, 0x00, 0x7B, 0x1F, 0x05, 0x2A, 0x16, 0x72, 0x2A, 0x00, 0x29, 0x71, 0x19, |
|
667 |
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2B, 0x18, 0x70, 0x28, 0x00, 0x2B, 0x73, 0x17, |
|
668 |
+ 0x11, 0x04, 0x1E, 0x7A, 0x00, 0x79, 0x29, 0x03, 0x13, 0x00, 0x06, 0x1A, 0x00, 0x1D, 0x09, 0x3F, |
|
669 |
+}; |
|
670 |
+ |
|
671 |
+static const uint8_t huff_spec_a33_bits[] = { |
|
672 |
+ 3, 4, 5, 6, 0, 6, 5, 4, 4, 5, 6, 7, 0, 7, 6, 5, |
|
673 |
+ 5, 6, 6, 7, 0, 7, 6, 6, 6, 7, 8, 8, 0, 8, 8, 7, |
|
674 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 6, 7, 8, 8, 0, 8, 8, 7, |
|
675 |
+ 5, 6, 6, 7, 0, 7, 6, 6, 4, 5, 6, 7, 0, 7, 6, 5, |
|
676 |
+}; |
|
677 |
+ |
|
678 |
+static const uint16_t huff_spec_a33_codes[] = { |
|
679 |
+ 0x05, 0x06, 0x10, 0x08, 0x00, 0x09, 0x11, 0x07, 0x04, 0x12, 0x3E, 0x6A, 0x00, 0x6D, 0x3D, 0x19, |
|
680 |
+ 0x06, 0x3A, 0x06, 0x02, 0x00, 0x01, 0x05, 0x39, 0x02, 0x16, 0xDC, 0x2A, 0x00, 0x29, 0xDF, 0x69, |
|
681 |
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x68, 0xDE, 0x28, 0x00, 0x2B, 0xDD, 0x17, |
|
682 |
+ 0x07, 0x38, 0x04, 0x00, 0x00, 0x03, 0x07, 0x3B, 0x05, 0x18, 0x3C, 0x6C, 0x00, 0x6B, 0x3F, 0x13, |
|
683 |
+}; |
|
684 |
+ |
|
685 |
+static const uint8_t huff_spec_a34_bits[] = { |
|
686 |
+ 2, 4, 5, 7, 0, 7, 5, 4, 4, 5, 6, 8, 0, 8, 6, 5, |
|
687 |
+ 5, 6, 7, 8, 0, 8, 7, 6, 7, 8, 8, 10, 0, 10, 9, 8, |
|
688 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 7, 8, 9, 10, 0, 10, 8, 8, |
|
689 |
+ 5, 6, 7, 8, 0, 8, 7, 6, 4, 5, 6, 8, 0, 8, 6, 5, |
|
690 |
+}; |
|
691 |
+ |
|
692 |
+static const uint16_t huff_spec_a34_codes[] = { |
|
693 |
+ 0x000, 0x00A, 0x00A, 0x034, 0x000, 0x035, 0x00B, 0x00B, 0x008, 0x01C, 0x032, 0x0DA, |
|
694 |
+ 0x000, 0x0DD, 0x035, 0x01F, 0x008, 0x01E, 0x03A, 0x06C, 0x000, 0x063, 0x039, 0x031, |
|
695 |
+ 0x032, 0x06E, 0x060, 0x37A, 0x000, 0x379, 0x1BF, 0x0D9, 0x000, 0x000, 0x000, 0x000, |
|
696 |
+ 0x000, 0x000, 0x000, 0x000, 0x033, 0x0D8, 0x1BE, 0x378, 0x000, 0x37B, 0x061, 0x06F, |
|
697 |
+ 0x009, 0x030, 0x038, 0x062, 0x000, 0x06D, 0x03B, 0x01F, 0x009, 0x01E, 0x034, 0x0DC, |
|
698 |
+ 0x000, 0x0DB, 0x033, 0x01D, |
|
699 |
+}; |
|
700 |
+ |
|
701 |
+static const uint8_t huff_spec_a41_bits[] = { |
|
702 |
+ 0, 0, 0, 0, 6, 6, 7, 7, 0, 7, 7, 6, 6, 0, 0, 0, |
|
703 |
+ 0, 0, 0, 0, 7, 7, 7, 7, 0, 7, 7, 7, 6, 0, 0, 0, |
|
704 |
+ 0, 0, 0, 0, 7, 7, 7, 8, 0, 8, 7, 7, 7, 0, 0, 0, |
|
705 |
+ 0, 0, 0, 0, 7, 7, 8, 8, 0, 8, 8, 7, 7, 0, 0, 0, |
|
706 |
+ 7, 7, 7, 8, 7, 8, 8, 8, 0, 8, 8, 8, 7, 8, 7, 7, |
|
707 |
+ 7, 7, 7, 7, 8, 8, 8, 9, 0, 8, 8, 8, 8, 7, 7, 7, |
|
708 |
+ 7, 7, 8, 8, 8, 8, 9, 9, 0, 9, 8, 8, 8, 8, 8, 7, |
|
709 |
+ 8, 8, 8, 8, 8, 9, 9, 9, 0, 9, 9, 9, 8, 8, 8, 8, |
|
710 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
711 |
+ 8, 8, 8, 8, 8, 9, 9, 9, 0, 9, 9, 9, 8, 8, 8, 8, |
|
712 |
+ 7, 7, 8, 8, 8, 8, 8, 9, 0, 9, 9, 8, 8, 8, 8, 7, |
|
713 |
+ 7, 7, 7, 7, 8, 8, 8, 8, 0, 9, 8, 8, 8, 7, 7, 7, |
|
714 |
+ 7, 7, 7, 8, 7, 8, 8, 8, 0, 8, 8, 8, 7, 8, 7, 7, |
|
715 |
+ 0, 0, 0, 0, 7, 7, 8, 8, 0, 8, 8, 7, 7, 0, 0, 0, |
|
716 |
+ 0, 0, 0, 0, 7, 7, 7, 8, 0, 8, 7, 7, 7, 0, 0, 0, |
|
717 |
+ 0, 0, 0, 0, 6, 7, 7, 7, 0, 7, 7, 7, 7, 0, 0, 0, |
|
718 |
+}; |
|
719 |
+ |
|
720 |
+static const uint16_t huff_spec_a41_codes[] = { |
|
721 |
+ 0x000, 0x000, 0x000, 0x000, 0x018, 0x00E, 0x05E, 0x028, 0x000, 0x029, 0x05F, 0x00F, |
|
722 |
+ 0x019, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x076, 0x06E, 0x03E, 0x004, |
|
723 |
+ 0x000, 0x017, 0x045, 0x07B, 0x013, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, |
|
724 |
+ 0x04A, 0x048, 0x010, 0x0CE, 0x000, 0x0E1, 0x023, 0x055, 0x053, 0x000, 0x000, 0x000, |
|
725 |
+ 0x000, 0x000, 0x000, 0x000, 0x008, 0x018, 0x0D6, 0x09E, 0x000, 0x09D, 0x0E5, 0x02B, |
|
726 |
+ 0x01B, 0x000, 0x000, 0x000, 0x07C, 0x05C, 0x038, 0x0FC, 0x002, 0x0D2, 0x09A, 0x05C, |
|
727 |
+ 0x000, 0x06B, 0x0A3, 0x0D9, 0x00F, 0x0FF, 0x03D, 0x061, 0x074, 0x056, 0x036, 0x000, |
|
728 |
+ 0x0CC, 0x08C, 0x058, 0x1E2, 0x000, 0x00F, 0x05F, 0x0A1, 0x0D5, 0x00D, 0x03B, 0x059, |
|
729 |
+ 0x040, 0x014, 0x0DA, 0x0B6, 0x084, 0x040, 0x1E0, 0x196, 0x000, 0x1A1, 0x00D, 0x043, |
|
730 |
+ 0x087, 0x0C7, 0x0E3, 0x00B, 0x0F2, 0x0C4, 0x08E, 0x05A, 0x024, 0x1CC, 0x194, 0x168, |
|
731 |
+ 0x000, 0x16B, 0x1A3, 0x1CF, 0x027, 0x069, 0x099, 0x0C9, 0x000, 0x000, 0x000, 0x000, |
|
732 |
+ 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, |
|
733 |
+ 0x0F3, 0x0C8, 0x098, 0x068, 0x026, 0x1CE, 0x1A2, 0x16A, 0x000, 0x169, 0x195, 0x1CD, |
|
734 |
+ 0x025, 0x05B, 0x08F, 0x0C5, 0x041, 0x00A, 0x0E2, 0x0C6, 0x086, 0x042, 0x00C, 0x1A0, |
|
735 |
+ 0x000, 0x197, 0x1E1, 0x041, 0x085, 0x0B7, 0x0DB, 0x015, 0x075, 0x058, 0x03A, 0x00C, |
|
736 |
+ 0x0D4, 0x0A0, 0x05E, 0x00E, 0x000, 0x1E3, 0x059, 0x08D, 0x0CD, 0x001, 0x037, 0x057, |
|
737 |
+ 0x07D, 0x060, 0x03C, 0x0FE, 0x00E, 0x0D8, 0x0A2, 0x06A, 0x000, 0x05D, 0x09B, 0x0D3, |
|
738 |
+ 0x003, 0x0FD, 0x039, 0x05D, 0x000, 0x000, 0x000, 0x000, 0x01A, 0x02A, 0x0E4, 0x09C, |
|
739 |
+ 0x000, 0x09F, 0x0D7, 0x019, 0x009, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, |
|
740 |
+ 0x052, 0x054, 0x022, 0x0E0, 0x000, 0x0CF, 0x011, 0x049, 0x04B, 0x000, 0x000, 0x000, |
|
741 |
+ 0x000, 0x000, 0x000, 0x000, 0x012, 0x07A, 0x044, 0x016, 0x000, 0x005, 0x03F, 0x06F, |
|
742 |
+ 0x077, 0x000, 0x000, 0x000, |
|
743 |
+}; |
|
744 |
+ |
|
745 |
+static const uint8_t huff_spec_a42_bits[] = { |
|
746 |
+ 5, 6, 7, 7, 7, 7, 8, 8, 0, 8, 8, 7, 7, 7, 7, 6, |
|
747 |
+ 6, 7, 7, 8, 7, 7, 8, 8, 0, 8, 8, 7, 7, 8, 7, 7, |
|
748 |
+ 7, 7, 8, 8, 7, 8, 8, 9, 0, 9, 8, 8, 7, 8, 8, 7, |
|
749 |
+ 8, 8, 8, 8, 8, 8, 8, 9, 0, 9, 8, 8, 8, 8, 8, 8, |
|
750 |
+ 7, 7, 7, 8, 8, 8, 9, 9, 0, 9, 9, 8, 8, 8, 7, 7, |
|
751 |
+ 7, 7, 8, 8, 8, 9, 9, 9, 0, 9, 9, 9, 8, 8, 8, 7, |
|
752 |
+ 8, 8, 8, 8, 9, 9, 9, 10, 0, 10, 9, 9, 9, 8, 8, 8, |
|
753 |
+ 8, 8, 9, 9, 9, 9, 10, 10, 0, 10, 10, 9, 9, 9, 9, 9, |
|
754 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
755 |
+ 8, 9, 9, 9, 9, 9, 10, 10, 0, 10, 10, 9, 9, 9, 9, 8, |
|
756 |
+ 8, 8, 8, 8, 9, 9, 9, 10, 0, 10, 9, 9, 9, 8, 8, 8, |
|
757 |
+ 7, 7, 8, 8, 8, 9, 9, 9, 0, 9, 9, 9, 8, 8, 8, 7, |
|
758 |
+ 7, 7, 7, 8, 8, 8, 9, 9, 0, 9, 9, 8, 8, 8, 7, 7, |
|
759 |
+ 8, 8, 8, 8, 8, 8, 8, 9, 0, 9, 8, 8, 8, 8, 8, 8, |
|
760 |
+ 7, 7, 8, 8, 7, 8, 8, 9, 0, 9, 8, 8, 7, 8, 8, 7, |
|
761 |
+ 6, 7, 7, 8, 7, 7, 8, 8, 0, 8, 8, 7, 7, 8, 7, 7, |
|
762 |
+}; |
|
763 |
+ |
|
764 |
+static const uint16_t huff_spec_a42_codes[] = { |
|
765 |
+ 0x003, 0x018, 0x058, 0x000, 0x066, 0x03C, 0x0D6, 0x07C, 0x000, 0x07D, 0x0D7, 0x03D, |
|
766 |
+ 0x067, 0x001, 0x059, 0x019, 0x002, 0x064, 0x036, 0x0DA, 0x04C, 0x01C, 0x0BE, 0x02C, |
|
767 |
+ 0x000, 0x037, 0x0C5, 0x029, 0x04B, 0x0E7, 0x03B, 0x069, 0x044, 0x02E, 0x0FA, 0x092, |
|
768 |
+ 0x020, 0x0F8, 0x086, 0x1FC, 0x000, 0x1E7, 0x07F, 0x0F5, 0x023, 0x0AD, 0x0FD, 0x02D, |
|
769 |
+ 0x0F6, 0x0DC, 0x09C, 0x03E, 0x0F0, 0x0B6, 0x026, 0x186, 0x000, 0x18D, 0x02F, 0x0B5, |
|
770 |
+ 0x0E1, 0x03D, 0x0AF, 0x0D9, 0x054, 0x040, 0x014, 0x0EC, 0x0BC, 0x054, 0x1C6, 0x108, |
|
771 |
+ 0x000, 0x10B, 0x1C5, 0x069, 0x0B9, 0x0DF, 0x019, 0x047, 0x026, 0x008, 0x0E4, 0x0A2, |
|
772 |
+ 0x056, 0x1DC, 0x142, 0x06A, 0x000, 0x091, 0x123, 0x1DF, 0x04B, 0x0A7, 0x0EB, 0x00B, |
|
773 |
+ 0x0C0, 0x09E, 0x06A, 0x022, 0x1AA, 0x140, 0x092, 0x3CA, 0x000, 0x3A7, 0x04B, 0x121, |
|
774 |
+ 0x18F, 0x007, 0x071, 0x0A5, 0x020, 0x004, 0x1A8, 0x174, 0x0E4, 0x068, 0x3A4, 0x2EE, |
|
775 |
+ 0x000, 0x2ED, 0x3C9, 0x049, 0x0E7, 0x185, 0x1D1, 0x1FF, 0x000, 0x000, 0x000, 0x000, |
|
776 |
+ 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, |
|
777 |
+ 0x021, 0x1FE, 0x1D0, 0x184, 0x0E6, 0x048, 0x3C8, 0x2EC, 0x000, 0x2EF, 0x3A5, 0x069, |
|
778 |
+ 0x0E5, 0x175, 0x1A9, 0x005, 0x0C1, 0x0A4, 0x070, 0x006, 0x18E, 0x120, 0x04A, 0x3A6, |
|
779 |
+ 0x000, 0x3CB, 0x093, 0x141, 0x1AB, 0x023, 0x06B, 0x09F, 0x027, 0x00A, 0x0EA, 0x0A6, |
|
780 |
+ 0x04A, 0x1DE, 0x122, 0x090, 0x000, 0x06B, 0x143, 0x1DD, 0x057, 0x0A3, 0x0E5, 0x009, |
|
781 |
+ 0x055, 0x046, 0x018, 0x0DE, 0x0B8, 0x068, 0x1C4, 0x10A, 0x000, 0x109, 0x1C7, 0x055, |
|
782 |
+ 0x0BD, 0x0ED, 0x015, 0x041, 0x0F7, 0x0D8, 0x0AE, 0x03C, 0x0E0, 0x0B4, 0x02E, 0x18C, |
|
783 |
+ 0x000, 0x187, 0x027, 0x0B7, 0x0F1, 0x03F, 0x09D, 0x0DD, 0x045, 0x02C, 0x0FC, 0x0AC, |
|
784 |
+ 0x022, 0x0F4, 0x07E, 0x1E6, 0x000, 0x1FD, 0x087, 0x0F9, 0x021, 0x093, 0x0FB, 0x02F, |
|
785 |
+ 0x003, 0x068, 0x03A, 0x0E6, 0x04A, 0x028, 0x0C4, 0x036, 0x000, 0x02D, 0x0BF, 0x01D, |
|
786 |
+ 0x04D, 0x0DB, 0x037, 0x065, |
|
787 |
+}; |
|
788 |
+ |
|
789 |
+static const uint8_t huff_spec_a43_bits[] = { |
|
790 |
+ 4, 6, 6, 7, 7, 8, 8, 9, 0, 9, 8, 8, 7, 7, 6, 6, |
|
791 |
+ 5, 6, 7, 7, 7, 8, 8, 9, 0, 9, 8, 8, 7, 7, 7, 6, |
|
792 |
+ 6, 7, 7, 7, 8, 8, 9, 9, 0, 9, 9, 8, 8, 7, 7, 7, |
|
793 |
+ 7, 7, 7, 8, 8, 8, 9, 10, 0, 10, 9, 9, 8, 8, 7, 7, |
|
794 |
+ 7, 7, 8, 8, 8, 9, 10, 10, 0, 10, 10, 9, 8, 8, 8, 7, |
|
795 |
+ 8, 8, 8, 9, 9, 9, 10, 10, 0, 10, 10, 9, 9, 9, 8, 8, |
|
796 |
+ 8, 9, 9, 9, 10, 10, 10, 10, 0, 10, 10, 10, 10, 9, 9, 9, |
|
797 |
+ 9, 9, 10, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 9, |
|
798 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
799 |
+ 9, 9, 10, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 9, |
|
800 |
+ 8, 9, 9, 9, 10, 10, 10, 10, 0, 10, 10, 10, 10, 9, 9, 9, |
|
801 |
+ 8, 8, 8, 9, 9, 9, 10, 10, 0, 10, 10, 9, 9, 9, 8, 8, |
|
802 |
+ 7, 7, 8, 8, 8, 9, 10, 10, 0, 10, 10, 9, 8, 8, 8, 7, |
|
803 |
+ 7, 7, 7, 8, 8, 9, 9, 10, 0, 10, 9, 8, 8, 8, 7, 7, |
|
804 |
+ 6, 7, 7, 7, 8, 8, 9, 9, 0, 9, 9, 8, 8, 7, 7, 7, |
|
805 |
+ 5, 6, 7, 7, 7, 8, 8, 9, 0, 9, 8, 8, 7, 7, 7, 6, |
|
806 |
+}; |
|
807 |
+ |
|
808 |
+static const uint16_t huff_spec_a43_codes[] = { |
|
809 |
+ 0x002, 0x03E, 0x016, 0x060, 0x04E, 0x0DC, 0x04A, 0x130, 0x000, 0x131, 0x04B, 0x0DD, |
|
810 |
+ 0x04F, 0x061, 0x017, 0x03F, 0x002, 0x02C, 0x076, 0x042, 0x034, 0x0CE, 0x002, 0x0E8, |
|
811 |
+ 0x000, 0x0CF, 0x001, 0x0D1, 0x037, 0x045, 0x07B, 0x02F, 0x014, 0x072, 0x052, 0x01A, |
|
812 |
+ 0x0E0, 0x080, 0x198, 0x01E, 0x000, 0x01D, 0x19B, 0x083, 0x0DF, 0x019, 0x055, 0x079, |
|
813 |
+ 0x050, 0x03C, 0x004, 0x0C4, 0x096, 0x00C, 0x0EA, 0x34A, 0x000, 0x34F, 0x0ED, 0x1D7, |
|
814 |
+ 0x095, 0x0AF, 0x003, 0x03F, 0x046, 0x026, 0x0D6, 0x092, 0x046, 0x15A, 0x3A8, 0x108, |
|
815 |
+ 0x000, 0x10F, 0x3A3, 0x135, 0x039, 0x091, 0x0D9, 0x031, 0x0D4, 0x0CA, 0x072, 0x1C6, |
|
816 |
+ 0x136, 0x090, 0x2B2, 0x104, 0x000, 0x103, 0x111, 0x08B, 0x133, 0x1D3, 0x071, 0x0C9, |
|
817 |
+ 0x03E, 0x1B4, 0x18C, 0x0CC, 0x38A, 0x2B0, 0x106, 0x0F2, 0x000, 0x0EF, 0x101, 0x113, |
|
818 |
+ 0x3A1, 0x0CB, 0x18F, 0x1B7, 0x0EE, 0x092, 0x388, 0x348, 0x10A, 0x0F4, 0x0F0, 0x0EA, |
|
819 |
+ 0x000, 0x0E9, 0x0ED, 0x0F7, 0x10D, 0x34D, 0x3AB, 0x0C9, 0x000, 0x000, 0x000, 0x000, |
|
820 |
+ 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, |
|
821 |
+ 0x0EF, 0x0C8, 0x3AA, 0x34C, 0x10C, 0x0F6, 0x0EC, 0x0E8, 0x000, 0x0EB, 0x0F1, 0x0F5, |
|
822 |
+ 0x10B, 0x349, 0x389, 0x093, 0x03F, 0x1B6, 0x18E, 0x0CA, 0x3A0, 0x112, 0x100, 0x0EE, |
|
823 |
+ 0x000, 0x0F3, 0x107, 0x2B1, 0x38B, 0x0CD, 0x18D, 0x1B5, 0x0D5, 0x0C8, 0x070, 0x1D2, |
|
824 |
+ 0x132, 0x08A, 0x110, 0x102, 0x000, 0x105, 0x2B3, 0x091, 0x137, 0x1C7, 0x073, 0x0CB, |
|
825 |
+ 0x047, 0x030, 0x0D8, 0x090, 0x038, 0x134, 0x3A2, 0x10E, 0x000, 0x109, 0x3A9, 0x15B, |
|
826 |
+ 0x047, 0x093, 0x0D7, 0x027, 0x051, 0x03E, 0x002, 0x0AE, 0x094, 0x1D6, 0x0EC, 0x34E, |
|
827 |
+ 0x000, 0x34B, 0x0EB, 0x00D, 0x097, 0x0C5, 0x005, 0x03D, 0x015, 0x078, 0x054, 0x018, |
|
828 |
+ 0x0DE, 0x082, 0x19A, 0x01C, 0x000, 0x01F, 0x199, 0x081, 0x0E1, 0x01B, 0x053, 0x073, |
|
829 |
+ 0x003, 0x02E, 0x07A, 0x044, 0x036, 0x0D0, 0x000, 0x0CE, 0x000, 0x0E9, 0x003, 0x0CF, |
|
830 |
+ 0x035, 0x043, 0x077, 0x02D, |
|
831 |
+}; |
|
832 |
+ |
|
833 |
+static const uint8_t huff_spec_a44_bits[] = { |
|
834 |
+ 4, 5, 6, 7, 7, 8, 9, 10, 0, 10, 9, 8, 7, 7, 6, 5, |
|
835 |
+ 5, 6, 6, 7, 7, 8, 9, 10, 0, 10, 9, 8, 7, 7, 6, 6, |
|
836 |
+ 6, 6, 7, 7, 8, 9, 10, 10, 0, 10, 10, 9, 8, 7, 7, 6, |
|
837 |
+ 7, 7, 7, 8, 8, 9, 10, 10, 0, 10, 10, 9, 8, 8, 7, 7, |
|
838 |
+ 7, 8, 8, 8, 9, 10, 10, 10, 0, 10, 10, 10, 9, 8, 8, 7, |
|
839 |
+ 8, 8, 9, 9, 10, 10, 10, 10, 0, 10, 10, 10, 10, 9, 9, 8, |
|
840 |
+ 9, 9, 10, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 9, |
|
841 |
+ 10, 10, 10, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 10, |
|
842 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
843 |
+ 10, 10, 10, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 10, |
|
844 |
+ 9, 9, 10, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 9, |
|
845 |
+ 8, 8, 9, 9, 10, 10, 10, 10, 0, 10, 10, 10, 10, 9, 9, 8, |
|
846 |
+ 7, 7, 8, 8, 9, 10, 10, 10, 0, 10, 10, 10, 9, 8, 8, 8, |
|
847 |
+ 7, 7, 7, 8, 8, 9, 10, 10, 0, 10, 10, 9, 8, 8, 7, 7, |
|
848 |
+ 6, 6, 7, 7, 8, 9, 10, 10, 0, 10, 10, 9, 8, 7, 7, 6, |
|
849 |
+ 5, 6, 6, 7, 7, 8, 9, 10, 0, 10, 9, 8, 7, 7, 6, 6, |
|
850 |
+}; |
|
851 |
+ |
|
852 |
+static const uint16_t huff_spec_a44_codes[] = { |
|
853 |
+ 0x00A, 0x012, 0x030, 0x06E, 0x024, 0x074, 0x0EC, 0x07E, 0x000, 0x07F, 0x0ED, 0x075, |
|
854 |
+ 0x025, 0x06F, 0x031, 0x013, 0x010, 0x03C, 0x018, 0x05A, 0x002, 0x046, 0x09E, 0x07C, |
|
855 |
+ 0x000, 0x079, 0x0E5, 0x04D, 0x007, 0x065, 0x01B, 0x03F, 0x02E, 0x016, 0x072, 0x01A, |
|
856 |
+ 0x0D6, 0x1C6, 0x3B4, 0x066, 0x000, 0x06B, 0x3B7, 0x1D9, 0x0D5, 0x021, 0x075, 0x015, |
|
857 |
+ 0x06C, 0x03E, 0x01E, 0x0CC, 0x044, 0x0F2, 0x082, 0x05C, 0x000, 0x05F, 0x087, 0x0F5, |
|
858 |
+ 0x031, 0x0CF, 0x017, 0x059, 0x01C, 0x0EE, 0x0D0, 0x024, 0x1C0, 0x08E, 0x06E, 0x048, |
|
859 |
+ 0x000, 0x04D, 0x06D, 0x089, 0x0F7, 0x033, 0x0D3, 0x001, 0x070, 0x028, 0x1C2, 0x0F0, |
|
860 |
+ 0x08A, 0x074, 0x054, 0x040, 0x000, 0x043, 0x053, 0x073, 0x099, 0x0EF, 0x1C5, 0x02B, |
|
861 |
+ 0x0E6, 0x04E, 0x08C, 0x080, 0x068, 0x058, 0x046, 0x02A, 0x000, 0x029, 0x045, 0x051, |
|
862 |
+ 0x065, 0x085, 0x09B, 0x09D, 0x07A, 0x076, 0x060, 0x056, 0x04E, 0x02C, 0x024, 0x022, |
|
863 |
+ 0x000, 0x021, 0x027, 0x02F, 0x04B, 0x05B, 0x063, 0x071, 0x000, 0x000, 0x000, 0x000, |
|
864 |
+ 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, |
|
865 |
+ 0x07B, 0x070, 0x062, 0x05A, 0x04A, 0x02E, 0x026, 0x020, 0x000, 0x023, 0x025, 0x02D, |
|
866 |
+ 0x04F, 0x057, 0x061, 0x077, 0x0E7, 0x09C, 0x09A, 0x084, 0x064, 0x050, 0x044, 0x028, |
|
867 |
+ 0x000, 0x02B, 0x047, 0x059, 0x069, 0x081, 0x08D, 0x04F, 0x071, 0x02A, 0x1C4, 0x0EE, |
|
868 |
+ 0x098, 0x072, 0x052, 0x042, 0x000, 0x041, 0x055, 0x075, 0x08B, 0x0F1, 0x1C3, 0x029, |
|
869 |
+ 0x01D, 0x000, 0x0D2, 0x032, 0x0F6, 0x088, 0x06C, 0x04C, 0x000, 0x049, 0x06F, 0x08F, |
|
870 |
+ 0x1C1, 0x025, 0x0D1, 0x0EF, 0x06D, 0x058, 0x016, 0x0CE, 0x030, 0x0F4, 0x086, 0x05E, |
|
871 |
+ 0x000, 0x05D, 0x083, 0x0F3, 0x045, 0x0CD, 0x01F, 0x03F, 0x02F, 0x014, 0x074, 0x020, |
|
872 |
+ 0x0D4, 0x1D8, 0x3B6, 0x06A, 0x000, 0x067, 0x3B5, 0x1C7, 0x0D7, 0x01B, 0x073, 0x017, |
|
873 |
+ 0x011, 0x03E, 0x01A, 0x064, 0x006, 0x04C, 0x0E4, 0x078, 0x000, 0x07D, 0x09F, 0x047, |
|
874 |
+ 0x003, 0x05B, 0x019, 0x03D, |
|
875 |
+}; |
|
876 |
+ |
|
877 |
+static const uint8_t huff_spec_a51_bits[] = { |
|
878 |
+ 5, 5, 5, 5, 5, 6, 6, 6, 4, 4, 5, 5, 5, 5, 5, 5, |
|
879 |
+ 0, 5, 5, 5, 5, 5, 5, 4, 4, 6, 6, 6, 5, 5, 5, 5, |
|
880 |
+}; |
|
881 |
+ |
|
882 |
+static const uint16_t huff_spec_a51_codes[] = { |
|
883 |
+ 0x19, 0x16, 0x12, 0x0E, 0x06, 0x3A, 0x38, 0x30, 0x00, 0x04, 0x1E, 0x1A, |
|
884 |
+ 0x14, 0x10, 0x0C, 0x04, 0x00, 0x05, 0x0D, 0x11, 0x15, 0x1B, 0x1F, 0x05, |
|
885 |
+ 0x01, 0x31, 0x39, 0x3B, 0x07, 0x0F, 0x13, 0x17, |
|
886 |
+}; |
|
887 |
+ |
|
888 |
+static const uint8_t huff_spec_a52_bits[] = { |
|
889 |
+ 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, |
|
890 |
+ 0, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 4, |
|
891 |
+}; |
|
892 |
+ |
|
893 |
+static const uint16_t huff_spec_a52_codes[] = { |
|
894 |
+ 0x09, 0x04, 0x00, 0x1E, 0x1A, 0x14, 0x0C, 0x06, 0x18, 0x16, 0x0E, 0x04, |
|
895 |
+ 0x3A, 0x38, 0x22, 0x20, 0x00, 0x21, 0x23, 0x39, 0x3B, 0x05, 0x0F, 0x17, |
|
896 |
+ 0x19, 0x07, 0x0D, 0x15, 0x1B, 0x1F, 0x01, 0x05, |
|
897 |
+}; |
|
898 |
+ |
|
899 |
+static const uint8_t huff_spec_a53_bits[] = { |
|
900 |
+ 3, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 7, 7, 7, 7, |
|
901 |
+ 0, 7, 7, 7, 7, 6, 6, 5, 5, 5, 5, 5, 5, 4, 4, 4, |
|
902 |
+}; |
|
903 |
+ |
|
904 |
+static const uint16_t huff_spec_a53_codes[] = { |
|
905 |
+ 0x00, 0x0C, 0x08, 0x04, 0x1E, 0x16, 0x14, 0x06, 0x0C, 0x04, 0x38, 0x1E, |
|
906 |
+ 0x76, 0x74, 0x3A, 0x38, 0x00, 0x39, 0x3B, 0x75, 0x77, 0x1F, 0x39, 0x05, |
|
907 |
+ 0x0D, 0x07, 0x15, 0x17, 0x1F, 0x05, 0x09, 0x0D, |
|
908 |
+}; |
|
909 |
+ |
|
910 |
+static const uint8_t huff_spec_a54_bits[] = { |
|
911 |
+ 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 7, 7, 7, 8, 8, |
|
912 |
+ 0, 8, 8, 7, 7, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, |
|
913 |
+}; |
|
914 |
+ |
|
915 |
+static const uint16_t huff_spec_a54_codes[] = { |
|
916 |
+ 0x02, 0x0E, 0x0A, 0x08, 0x02, 0x1A, 0x0E, 0x02, 0x00, 0x30, 0x18, 0x66, |
|
917 |
+ 0x36, 0x34, 0xCA, 0xC8, 0x00, 0xC9, 0xCB, 0x35, 0x37, 0x67, 0x19, 0x31, |
|
918 |
+ 0x01, 0x03, 0x0F, 0x1B, 0x03, 0x09, 0x0B, 0x0F, |
|
919 |
+}; |
|
920 |
+ |
|
921 |
+static const uint8_t huff_spec_a61_bits[] = { |
|
922 |
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, |
|
923 |
+ 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, |
|
924 |
+ 0, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, |
|
925 |
+ 5, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, |
|
926 |
+}; |
|
927 |
+ |
|
928 |
+static const uint16_t huff_spec_a61_codes[] = { |
|
929 |
+ 0x35, 0x30, 0x2A, 0x28, 0x24, 0x20, 0x18, 0x0E, 0x0C, 0x7E, 0x7C, 0x72, |
|
930 |
+ 0x70, 0x68, 0x5E, 0x5C, 0x04, 0x0E, 0x08, 0x00, 0x3C, 0x3A, 0x36, 0x32, |
|
931 |
+ 0x2C, 0x26, 0x22, 0x1A, 0x16, 0x14, 0x06, 0x04, 0x00, 0x05, 0x07, 0x15, |
|
932 |
+ 0x17, 0x1B, 0x23, 0x27, 0x2D, 0x33, 0x37, 0x3B, 0x3D, 0x01, 0x09, 0x0F, |
|
933 |
+ 0x05, 0x5D, 0x5F, 0x69, 0x71, 0x73, 0x7D, 0x7F, 0x0D, 0x0F, 0x19, 0x21, |
|
934 |
+ 0x25, 0x29, 0x2B, 0x31, |
|
935 |
+}; |
|
936 |
+ |
|
937 |
+static const uint8_t huff_spec_a62_bits[] = { |
|
938 |
+ 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, |
|
939 |
+ 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, |
|
940 |
+ 0, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, |
|
941 |
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, |
|
942 |
+}; |
|
943 |
+ |
|
944 |
+static const uint16_t huff_spec_a62_codes[] = { |
|
945 |
+ 0x14, 0x0E, 0x08, 0x04, 0x02, 0x3E, 0x3C, 0x38, 0x34, 0x30, 0x2A, 0x24, |
|
946 |
+ 0x1A, 0x18, 0x0E, 0x02, 0x32, 0x36, 0x2C, 0x26, 0x20, 0x16, 0x0C, 0x00, |
|
947 |
+ 0x76, 0x74, 0x5E, 0x5C, 0x46, 0x44, 0x2A, 0x28, 0x00, 0x29, 0x2B, 0x45, |
|
948 |
+ 0x47, 0x5D, 0x5F, 0x75, 0x77, 0x01, 0x0D, 0x17, 0x21, 0x27, 0x2D, 0x37, |
|
949 |
+ 0x33, 0x03, 0x0F, 0x19, 0x1B, 0x25, 0x2B, 0x31, 0x35, 0x39, 0x3D, 0x3F, |
|
950 |
+ 0x03, 0x05, 0x09, 0x0F, |
|
951 |
+}; |
|
952 |
+ |
|
953 |
+static const uint8_t huff_spec_a63_bits[] = { |
|
954 |
+ 4, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, |
|
955 |
+ 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, |
|
956 |
+ 0, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, 6, 6, |
|
957 |
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, |
|
958 |
+}; |
|
959 |
+ |
|
960 |
+static const uint16_t huff_spec_a63_codes[] = { |
|
961 |
+ 0x00, 0x1C, 0x18, 0x14, 0x10, 0x0A, 0x08, 0x02, 0x3E, 0x36, 0x2E, 0x2C, |
|
962 |
+ 0x24, 0x1C, 0x0E, 0x08, 0x1E, 0x1A, 0x0C, 0x7A, 0x6A, 0x68, 0x4C, 0x32, |
|
963 |
+ 0x16, 0x14, 0xF2, 0xF0, 0x9E, 0x9C, 0x62, 0x60, 0x00, 0x61, 0x63, 0x9D, |
|
964 |
+ 0x9F, 0xF1, 0xF3, 0x15, 0x17, 0x33, 0x4D, 0x69, 0x6B, 0x7B, 0x0D, 0x1B, |
|
965 |
+ 0x1F, 0x09, 0x0F, 0x1D, 0x25, 0x2D, 0x2F, 0x37, 0x3F, 0x03, 0x09, 0x0B, |
|
966 |
+ 0x11, 0x15, 0x19, 0x1D, |
|
967 |
+}; |
|
968 |
+ |
|
969 |
+static const uint8_t huff_spec_a64_bits[] = { |
|
970 |
+ 4, 4, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, |
|
971 |
+ 6, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, |
|
972 |
+ 0, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, |
|
973 |
+ 6, 7, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 4, |
|
974 |
+}; |
|
975 |
+ |
|
976 |
+static const uint16_t huff_spec_a64_codes[] = { |
|
977 |
+ 0x006, 0x002, 0x01C, 0x01A, 0x016, 0x012, 0x00E, 0x00A, 0x002, 0x03E, |
|
978 |
+ 0x032, 0x02A, 0x022, 0x020, 0x010, 0x07A, 0x000, 0x078, 0x060, 0x050, |
|
979 |
+ 0x024, 0x006, 0x0C6, 0x0C4, 0x0A4, 0x04E, 0x00A, 0x008, 0x14E, 0x14C, |
|
980 |
+ 0x09A, 0x098, 0x000, 0x099, 0x09B, 0x14D, 0x14F, 0x009, 0x00B, 0x04F, |
|
981 |
+ 0x0A5, 0x0C5, 0x0C7, 0x007, 0x025, 0x051, 0x061, 0x079, 0x001, 0x07B, |
|
982 |
+ 0x011, 0x021, 0x023, 0x02B, 0x033, 0x03F, 0x003, 0x00B, 0x00F, 0x013, |
|
983 |
+ 0x017, 0x01B, 0x01D, 0x003, |
|
984 |
+}; |
|
985 |
+ |
|
986 |
+static const uint8_t huff_spec_a71_bits[] = { |
|
987 |
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, |
|
988 |
+ 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, |
|
989 |
+ 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, |
|
990 |
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, |
|
991 |
+ 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, |
|
992 |
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, |
|
993 |
+ 6, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, |
|
994 |
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, |
|
995 |
+}; |
|
996 |
+ |
|
997 |
+static const uint16_t huff_spec_a71_codes[] = { |
|
998 |
+ 0x6C, 0x66, 0x62, 0x5C, 0x56, 0x50, 0x52, 0x4E, 0x48, 0x3E, 0x36, 0x34, 0x2A, 0x26, 0x1E, 0x16, |
|
999 |
+ 0x0E, 0x08, 0x00, 0xF6, 0xF4, 0xEE, 0xEC, 0xE2, 0xE0, 0xDA, 0xD2, 0xD0, 0xBE, 0xBC, 0xB2, 0xB0, |
|
1000 |
+ 0x0C, 0x20, 0x1C, 0x16, 0x10, 0x08, 0x02, 0x7E, 0x7C, 0x78, 0x74, 0x72, 0x6E, 0x6A, 0x64, 0x60, |
|
1001 |
+ 0x5A, 0x54, 0x4C, 0x4A, 0x46, 0x44, 0x3C, 0x32, 0x30, 0x28, 0x24, 0x1C, 0x14, 0x0C, 0x0A, 0x02, |
|
1002 |
+ 0x00, 0x03, 0x0B, 0x0D, 0x15, 0x1D, 0x25, 0x29, 0x31, 0x33, 0x3D, 0x45, 0x47, 0x4B, 0x4D, 0x55, |
|
1003 |
+ 0x5B, 0x61, 0x65, 0x6B, 0x6F, 0x73, 0x75, 0x79, 0x7D, 0x7F, 0x03, 0x09, 0x11, 0x17, 0x1D, 0x21, |
|
1004 |
+ 0x0D, 0xB1, 0xB3, 0xBD, 0xBF, 0xD1, 0xD3, 0xDB, 0xE1, 0xE3, 0xED, 0xEF, 0xF5, 0xF7, 0x01, 0x09, |
|
1005 |
+ 0x0F, 0x17, 0x1F, 0x27, 0x2B, 0x35, 0x37, 0x3F, 0x49, 0x4F, 0x53, 0x51, 0x57, 0x5D, 0x63, 0x67, |
|
1006 |
+}; |
|
1007 |
+ |
|
1008 |
+static const uint8_t huff_spec_a72_bits[] = { |
|
1009 |
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, |
|
1010 |
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, |
|
1011 |
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, |
|
1012 |
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, |
|
1013 |
+ 0, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, |
|
1014 |
+ 8, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, |
|
1015 |
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, |
|
1016 |
+ 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, |
|
1017 |
+}; |
|
1018 |
+ |
|
1019 |
+static const uint16_t huff_spec_a72_codes[] = { |
|
1020 |
+ 0x2A, 0x24, 0x1C, 0x18, 0x12, 0x0E, 0x0A, 0x06, 0x02, 0x7E, 0x7C, 0x7A, 0x76, 0x72, 0x70, 0x6A, |
|
1021 |
+ 0x68, 0x62, 0x5C, 0x5A, 0x52, 0x4E, 0x46, 0x42, 0x3C, 0x34, 0x2A, 0x28, 0x20, 0x12, 0x10, 0x08, |
|
1022 |
+ 0x66, 0x74, 0x6C, 0x64, 0x5E, 0x58, 0x50, 0x44, 0x40, 0x36, 0x2C, 0x22, 0x1A, 0x0A, 0x02, 0x00, |
|
1023 |
+ 0xF2, 0xF0, 0xDE, 0xDC, 0xC2, 0xC0, 0xAE, 0xAC, 0x9A, 0x98, 0x7E, 0x7C, 0x5E, 0x5C, 0x32, 0x30, |
|
1024 |
+ 0x00, 0x31, 0x33, 0x5D, 0x5F, 0x7D, 0x7F, 0x99, 0x9B, 0xAD, 0xAF, 0xC1, 0xC3, 0xDD, 0xDF, 0xF1, |
|
1025 |
+ 0xF3, 0x01, 0x03, 0x0B, 0x1B, 0x23, 0x2D, 0x37, 0x41, 0x45, 0x51, 0x59, 0x5F, 0x65, 0x6D, 0x75, |
|
1026 |
+ 0x67, 0x09, 0x11, 0x13, 0x21, 0x29, 0x2B, 0x35, 0x3D, 0x43, 0x47, 0x4F, 0x53, 0x5B, 0x5D, 0x63, |
|
1027 |
+ 0x69, 0x6B, 0x71, 0x73, 0x77, 0x7B, 0x7D, 0x7F, 0x03, 0x07, 0x0B, 0x0F, 0x13, 0x19, 0x1D, 0x25, |
|
1028 |
+}; |
|
1029 |
+ |
|
1030 |
+static const uint8_t huff_spec_a73_bits[] = { |
|
1031 |
+ 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, |
|
1032 |
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, |
|
1033 |
+ 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, |
|
1034 |
+ 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, |
|
1035 |
+ 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, |
|
1036 |
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, |
|
1037 |
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, |
|
1038 |
+ 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, |
|
1039 |
+}; |
|
1040 |
+ |
|
1041 |
+static const uint16_t huff_spec_a73_codes[] = { |
|
1042 |
+ 0x003, 0x03E, 0x038, 0x034, 0x030, 0x02C, 0x028, 0x024, 0x020, 0x01C, 0x016, 0x014, |
|
1043 |
+ 0x00E, 0x00A, 0x004, 0x000, 0x07A, 0x076, 0x06E, 0x06C, 0x064, 0x05E, 0x056, 0x04E, |
|
1044 |
+ 0x04C, 0x044, 0x036, 0x030, 0x022, 0x018, 0x012, 0x004, 0x03C, 0x03E, 0x032, 0x024, |
|
1045 |
+ 0x020, 0x010, 0x0F2, 0x0F0, 0x0E8, 0x0CE, 0x0BA, 0x0B8, 0x0A8, 0x08C, 0x06A, 0x04E, |
|
1046 |
+ 0x04C, 0x034, 0x00E, 0x00C, 0x1D6, 0x1D4, 0x19A, 0x198, 0x156, 0x154, 0x11E, 0x11C, |
|
1047 |
+ 0x0D2, 0x0D0, 0x06E, 0x06C, 0x000, 0x06D, 0x06F, 0x0D1, 0x0D3, 0x11D, 0x11F, 0x155, |
|
1048 |
+ 0x157, 0x199, 0x19B, 0x1D5, 0x1D7, 0x00D, 0x00F, 0x035, 0x04D, 0x04F, 0x06B, 0x08D, |
|
1049 |
+ 0x0A9, 0x0B9, 0x0BB, 0x0CF, 0x0E9, 0x0F1, 0x0F3, 0x011, 0x021, 0x025, 0x033, 0x03F, |
|
1050 |
+ 0x03D, 0x005, 0x013, 0x019, 0x023, 0x031, 0x037, 0x045, 0x04D, 0x04F, 0x057, 0x05F, |
|
1051 |
+ 0x065, 0x06D, 0x06F, 0x077, 0x07B, 0x001, 0x005, 0x00B, 0x00F, 0x015, 0x017, 0x01D, |
|
1052 |
+ 0x021, 0x025, 0x029, 0x02D, 0x031, 0x035, 0x039, 0x03F, |
|
1053 |
+}; |
|
1054 |
+ |
|
1055 |
+static const uint8_t huff_spec_a74_bits[] = { |
|
1056 |
+ 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, |
|
1057 |
+ 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, |
|
1058 |
+ 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, |
|
1059 |
+ 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, |
|
1060 |
+ 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 9, 9, 9, 9, 9, |
|
1061 |
+ 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, |
|
1062 |
+ 7, 8, 8, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, |
|
1063 |
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, |
|
1064 |
+}; |
|
1065 |
+ |
|
1066 |
+static const uint16_t huff_spec_a74_codes[] = { |
|
1067 |
+ 0x00D, 0x00A, 0x004, 0x000, 0x03A, 0x036, 0x032, 0x030, 0x02C, 0x028, 0x026, 0x022, |
|
1068 |
+ 0x01E, 0x018, 0x012, 0x00E, 0x006, 0x07E, 0x07A, 0x070, 0x06A, 0x05E, 0x056, 0x054, |
|
1069 |
+ 0x048, 0x040, 0x038, 0x022, 0x01A, 0x00A, 0x0F8, 0x0E6, 0x008, 0x0FA, 0x0F0, 0x0D2, |
|
1070 |
+ 0x0BA, 0x0B8, 0x094, 0x084, 0x074, 0x042, 0x032, 0x1E6, 0x1CA, 0x1C8, 0x1A2, 0x12E, |
|
1071 |
+ 0x10E, 0x10C, 0x0EC, 0x082, 0x062, 0x060, 0x3CA, 0x3C8, 0x342, 0x340, 0x25A, 0x258, |
|
1072 |
+ 0x1DE, 0x1DC, 0x102, 0x100, 0x000, 0x101, 0x103, 0x1DD, 0x1DF, 0x259, 0x25B, 0x341, |
|
1073 |
+ 0x343, 0x3C9, 0x3CB, 0x061, 0x063, 0x083, 0x0ED, 0x10D, 0x10F, 0x12F, 0x1A3, 0x1C9, |
|
1074 |
+ 0x1CB, 0x1E7, 0x033, 0x043, 0x075, 0x085, 0x095, 0x0B9, 0x0BB, 0x0D3, 0x0F1, 0x0FB, |
|
1075 |
+ 0x009, 0x0E7, 0x0F9, 0x00B, 0x01B, 0x023, 0x039, 0x041, 0x049, 0x055, 0x057, 0x05F, |
|
1076 |
+ 0x06B, 0x071, 0x07B, 0x07F, 0x007, 0x00F, 0x013, 0x019, 0x01F, 0x023, 0x027, 0x029, |
|
1077 |
+ 0x02D, 0x031, 0x033, 0x037, 0x03B, 0x001, 0x005, 0x00B, |
|
1078 |
+}; |
|
1079 |
+ |
|
1080 |
+static const uint8_t huff_spec_b22_bits[] = { |
|
1081 |
+ 0, 4, 0, 4, 4, 5, 0, 5, 0, 0, 0, 0, 4, 5, 0, 5, |
|
1082 |
+ 4, 7, 0, 6, 6, 9, 0, 7, 0, 0, 0, 0, 6, 9, 0, 7, |
|
1083 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
1084 |
+ 4, 6, 0, 7, 6, 7, 0, 9, 0, 0, 0, 0, 6, 7, 0, 9, |
|
1085 |
+ 4, 8, 0, 8, 8, 10, 0, 10, 0, 0, 0, 0, 6, 9, 0, 9, |
|
1086 |
+ 5, 10, 0, 9, 9, 10, 0, 10, 0, 0, 0, 0, 7, 10, 0, 10, |
|
1087 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
1088 |
+ 6, 9, 0, 10, 9, 10, 0, 10, 0, 0, 0, 0, 7, 10, 0, 10, |
|
1089 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
1090 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
1091 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
1092 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
1093 |
+ 4, 8, 0, 8, 6, 9, 0, 9, 0, 0, 0, 0, 8, 10, 0, 10, |
|
1094 |
+ 6, 10, 0, 9, 7, 10, 0, 10, 0, 0, 0, 0, 9, 10, 0, 10, |
|
1095 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
1096 |
+ 5, 9, 0, 10, 7, 10, 0, 10, 0, 0, 0, 0, 9, 10, 0, 10, |
|
1097 |
+}; |
|
1098 |
+ |
|
1099 |
+static const uint16_t huff_spec_b22_codes[] = { |
|
1100 |
+ 0x000, 0x00E, 0x000, 0x00F, 0x008, 0x006, 0x000, 0x00B, 0x000, 0x000, 0x000, 0x000, |
|
1101 |
+ 0x009, 0x00A, 0x000, 0x007, 0x006, 0x00A, 0x000, 0x029, 0x006, 0x158, 0x000, 0x023, |
|
1102 |
+ 0x000, 0x000, 0x000, 0x000, 0x013, 0x174, 0x000, 0x021, 0x000, 0x000, 0x000, 0x000, |
|
1103 |
+ 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, |
|
1104 |
+ 0x007, 0x028, 0x000, 0x00B, 0x012, 0x020, 0x000, 0x175, 0x000, 0x000, 0x000, 0x000, |
|
1105 |
+ 0x007, 0x022, 0x000, 0x159, 0x00C, 0x0BC, 0x000, 0x0BF, 0x022, 0x2B8, 0x000, 0x2BB, |
|
1106 |
+ 0x000, 0x000, 0x000, 0x000, 0x00B, 0x170, 0x000, 0x15B, 0x000, 0x04E, 0x000, 0x15F, |
|
1107 |
+ 0x042, 0x04A, 0x000, 0x041, 0x000, 0x000, 0x000, 0x000, 0x055, 0x044, 0x000, 0x04D, |
|
1108 |
+ 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, |
|
1109 |
+ 0x000, 0x000, 0x000, 0x000, 0x02D, 0x172, 0x000, 0x2ED, 0x040, 0x042, 0x000, 0x047, |
|
1110 |
+ 0x000, 0x000, 0x000, 0x000, 0x013, 0x2EE, 0x000, 0x049, 0x000, 0x000, 0x000, 0x000, |
|
1111 |
+ 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, |
|
1112 |
+ 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, |
|
1113 |
+ 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, |
|
1114 |
+ 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, |
|
1115 |
+ 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, |
|
1116 |
+ 0x00D, 0x0BE, 0x000, 0x0BD, 0x00A, 0x15A, 0x000, 0x171, 0x000, 0x000, 0x000, 0x000, |
|
1117 |
+ 0x023, 0x2BA, 0x000, 0x2B9, 0x02C, 0x2EC, 0x000, 0x173, 0x012, 0x048, 0x000, 0x2EF, |
|
1118 |
+ 0x000, 0x000, 0x000, 0x000, 0x041, 0x046, 0x000, 0x043, 0x000, 0x000, 0x000, 0x000, |
|
1119 |
+ 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, |
|
1120 |
+ 0x001, 0x15E, 0x000, 0x04F, 0x054, 0x04C, 0x000, 0x045, 0x000, 0x000, 0x000, 0x000, |
|
1121 |
+ 0x043, 0x040, 0x000, 0x04B, |
|
1122 |
+}; |
|
1123 |
+ |
|
1124 |
+static const uint8_t huff_spec_b23_bits[] = { |
|
1125 |
+ 2, 4, 0, 4, 4, 6, 0, 6, 0, 0, 0, 0, 4, 6, 0, 6, |
|
1126 |
+ 4, 9, 0, 7, 7, 9, 0, 8, 0, 0, 0, 0, 7, 9, 0, 8, |
|
1127 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
1128 |
+ 4, 7, 0, 9, 7, 8, 0, 9, 0, 0, 0, 0, 7, 8, 0, 9, |
|
1129 |
+ 4, 8, 0, 8, 9, 10, 0, 10, 0, 0, 0, 0, 7, 10, 0, 10, |
|
1130 |
+ 7, 10, 0, 10, 10, 10, 0, 10, 0, 0, 0, 0, 9, 10, 0, 10, |
|
1131 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
1132 |
+ 7, 10, 0, 10, 10, 10, 0, 10, 0, 0, 0, 0, 8, 10, 0, 10, |
|
1133 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
1134 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
1135 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
1136 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
1137 |
+ 4, 8, 0, 8, 7, 10, 0, 10, 0, 0, 0, 0, 9, 10, 0, 10, |
|
1138 |
+ 7, 10, 0, 10, 8, 10, 0, 10, 0, 0, 0, 0, 10, 10, 0, 10, |
|
1139 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
1140 |
+ 7, 10, 0, 10, 9, 10, 0, 10, 0, 0, 0, 0, 10, 10, 0, 10, |
|
1141 |
+}; |
|
1142 |
+ |
|
1143 |
+static const uint16_t huff_spec_b23_codes[] = { |
|
1144 |
+ 0x003, 0x008, 0x000, 0x009, 0x002, 0x018, 0x000, 0x01B, 0x000, 0x000, 0x000, 0x000, |
|
1145 |
+ 0x003, 0x01A, 0x000, 0x019, 0x000, 0x17C, 0x000, 0x055, 0x056, 0x0E8, 0x000, 0x07D, |
|
1146 |
+ 0x000, 0x000, 0x000, 0x000, 0x059, 0x0F6, 0x000, 0x07F, 0x000, 0x000, 0x000, 0x000, |
|
1147 |
+ 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, |
|
1148 |
+ 0x001, 0x054, 0x000, 0x17D, 0x058, 0x07E, 0x000, 0x0F7, 0x000, 0x000, 0x000, 0x000, |
|
1149 |
+ 0x057, 0x07C, 0x000, 0x0E9, 0x004, 0x0A2, 0x000, 0x0A1, 0x17A, 0x1DA, 0x000, 0x1D9, |
|
1150 |
+ 0x000, 0x000, 0x000, 0x000, 0x053, 0x1E8, 0x000, 0x2F3, 0x05C, 0x1D6, 0x000, 0x1E7, |
|
1151 |
+ 0x1EA, 0x1E2, 0x000, 0x1CF, 0x000, 0x000, 0x000, 0x000, 0x17F, 0x1CA, 0x000, 0x1DD, |
|
1152 |
+ 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, |
|
1153 |
+ 0x000, 0x000, 0x000, 0x000, 0x05B, 0x2F0, 0x000, 0x1DF, 0x1E4, 0x1CC, 0x000, 0x1D5, |
|
1154 |
+ 0x000, 0x000, 0x000, 0x000, 0x071, 0x1E0, 0x000, 0x1C9, 0x000, 0x000, 0x000, 0x000, |
|
1155 |
+ 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, |
|
1156 |
+ 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, |
|
1157 |
+ 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, |
|
1158 |
+ 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, |
|
1159 |
+ 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, |
|
1160 |
+ 0x005, 0x0A0, 0x000, 0x0A3, 0x052, 0x2F2, 0x000, 0x1E9, 0x000, 0x000, 0x000, 0x000, |
|
1161 |
+ 0x17B, 0x1D8, 0x000, 0x1DB, 0x05A, 0x1DE, 0x000, 0x2F1, 0x070, 0x1C8, 0x000, 0x1E1, |
|
1162 |
+ 0x000, 0x000, 0x000, 0x000, 0x1E5, 0x1D4, 0x000, 0x1CD, 0x000, 0x000, 0x000, 0x000, |
|
1163 |
+ 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, |
|
1164 |
+ 0x05D, 0x1E6, 0x000, 0x1D7, 0x17E, 0x1DC, 0x000, 0x1CB, 0x000, 0x000, 0x000, 0x000, |
|
1165 |
+ 0x1EB, 0x1CE, 0x000, 0x1E3, |
|
1166 |
+}; |
|
1167 |
+ |
|
1168 |
+static const uint8_t huff_spec_b24_bits[] = { |
|
1169 |
+ 1, 4, 0, 4, 5, 7, 0, 7, 0, 0, 0, 0, 5, 7, 0, 7, |
|
1170 |
+ 5, 9, 0, 7, 8, 10, 0, 9, 0, 0, 0, 0, 7, 10, 0, 9, |
|
1171 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
1172 |
+ 5, 7, 0, 9, 7, 9, 0, 10, 0, 0, 0, 0, 8, 9, 0, 10, |
|
1173 |
+ 5, 9, 0, 8, 9, 10, 0, 10, 0, 0, 0, 0, 7, 10, 0, 10, |
|
1174 |
+ 7, 10, 0, 10, 10, 10, 0, 10, 0, 0, 0, 0, 10, 10, 0, 10, |
|
1175 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
1176 |
+ 7, 10, 0, 10, 10, 10, 0, 10, 0, 0, 0, 0, 10, 10, 0, 10, |
|
1177 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
1178 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
1179 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
1180 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
1181 |
+ 5, 8, 0, 9, 7, 10, 0, 10, 0, 0, 0, 0, 9, 10, 0, 10, |
|
1182 |
+ 7, 10, 0, 10, 10, 10, 0, 10, 0, 0, 0, 0, 10, 10, 0, 10, |
|
1183 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
1184 |
+ 7, 10, 0, 10, 10, 10, 0, 10, 0, 0, 0, 0, 10, 10, 0, 10, |
|
1185 |
+}; |
|
1186 |
+ |
|
1187 |
+static const uint16_t huff_spec_b24_codes[] = { |
|
1188 |
+ 0x001, 0x000, 0x000, 0x001, 0x00A, 0x01C, 0x000, 0x033, 0x000, 0x000, 0x000, 0x000, |
|
1189 |
+ 0x00B, 0x032, 0x000, 0x01D, 0x008, 0x0D8, 0x000, 0x031, 0x06E, 0x0FA, 0x000, 0x0D7, |
|
1190 |
+ 0x000, 0x000, 0x000, 0x000, 0x011, 0x0F4, 0x000, 0x0D5, 0x000, 0x000, 0x000, 0x000, |
|
1191 |
+ 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, |
|
1192 |
+ 0x009, 0x030, 0x000, 0x0D9, 0x010, 0x0D4, 0x000, 0x0F5, 0x000, 0x000, 0x000, 0x000, |
|
1193 |
+ 0x06F, 0x0D6, 0x000, 0x0FB, 0x00E, 0x0DA, 0x000, 0x025, 0x0D2, 0x0D4, 0x000, 0x0DB, |
|
1194 |
+ 0x000, 0x000, 0x000, 0x000, 0x017, 0x0FE, 0x000, 0x0FD, 0x014, 0x0DC, 0x000, 0x0F9, |
|
1195 |
+ 0x0F2, 0x0D6, 0x000, 0x09B, 0x000, 0x000, 0x000, 0x000, 0x1A3, 0x09C, 0x000, 0x0D3, |
|
1196 |
+ 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, |
|
1197 |
+ 0x000, 0x000, 0x000, 0x000, 0x019, 0x0F6, 0x000, 0x0D9, 0x0F0, 0x09E, 0x000, 0x0D1, |
|
1198 |
+ 0x000, 0x000, 0x000, 0x000, 0x1A1, 0x0DE, 0x000, 0x099, 0x000, 0x000, 0x000, 0x000, |
|
1199 |
+ 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, |
|
1200 |
+ 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, |
|
1201 |
+ 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, |
|
1202 |
+ 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, |
|
1203 |
+ 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, |
|
1204 |
+ 0x00F, 0x024, 0x000, 0x0DB, 0x016, 0x0FC, 0x000, 0x0FF, 0x000, 0x000, 0x000, 0x000, |
|
1205 |
+ 0x0D3, 0x0DA, 0x000, 0x0D5, 0x018, 0x0D8, 0x000, 0x0F7, 0x1A0, 0x098, 0x000, 0x0DF, |
|
1206 |
+ 0x000, 0x000, 0x000, 0x000, 0x0F1, 0x0D0, 0x000, 0x09F, 0x000, 0x000, 0x000, 0x000, |
|
1207 |
+ 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, |
|
1208 |
+ 0x015, 0x0F8, 0x000, 0x0DD, 0x1A2, 0x0D2, 0x000, 0x09D, 0x000, 0x000, 0x000, 0x000, |
|
1209 |
+ 0x0F3, 0x09A, 0x000, 0x0D7 |
|
1210 |
+}; |
|
1211 |
+ |
|
1212 |
+static const uint8_t huff_spec_b32_bits[] = { |
|
1213 |
+ 2, 4, 5, 6, 0, 6, 5, 4, 5, 6, 6, 7, 0, 6, 5, 6, |
|
1214 |
+ 5, 6, 7, 7, 0, 8, 7, 6, 6, 7, 8, 9, 0, 9, 8, 7, |
|
1215 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 6, 7, 8, 9, 0, 9, 8, 7, |
|
1216 |
+ 5, 6, 7, 8, 0, 7, 7, 6, 5, 6, 5, 6, 0, 7, 6, 6, |
|
1217 |
+}; |
|
1218 |
+ |
|
1219 |
+static const uint16_t huff_spec_b32_codes[] = { |
|
1220 |
+ 0x001, 0x002, 0x01E, 0x02A, 0x000, 0x02B, 0x01F, 0x003, 0x016, 0x020, 0x03A, 0x064, |
|
1221 |
+ 0x000, 0x005, 0x001, 0x023, 0x01A, 0x026, 0x070, 0x00C, 0x000, 0x0CF, 0x073, 0x031, |
|
1222 |
+ 0x024, 0x00E, 0x0CC, 0x146, 0x000, 0x145, 0x0A1, 0x053, 0x000, 0x000, 0x000, 0x000, |
|
1223 |
+ 0x000, 0x000, 0x000, 0x000, 0x025, 0x052, 0x0A0, 0x144, 0x000, 0x147, 0x0CD, 0x00F, |
|
1224 |
+ 0x01B, 0x030, 0x072, 0x0CE, 0x000, 0x00D, 0x071, 0x027, 0x017, 0x022, 0x000, 0x004, |
|
1225 |
+ 0x000, 0x065, 0x03B, 0x021, |
|
1226 |
+}; |
|
1227 |
+ |
|
1228 |
+static const uint8_t huff_spec_b33_bits[] = { |
|
1229 |
+ 2, 4, 5, 7, 0, 7, 5, 4, 4, 5, 6, 8, 0, 7, 6, 5, |
|
1230 |
+ 5, 6, 7, 9, 0, 8, 7, 6, 7, 8, 9, 10, 0, 10, 9, 8, |
|
1231 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 7, 8, 9, 10, 0, 10, 9, 8, |
|
1232 |
+ 5, 6, 7, 8, 0, 9, 7, 6, 4, 5, 6, 7, 0, 8, 6, 5, |
|
1233 |
+}; |
|
1234 |
+ |
|
1235 |
+static const uint16_t huff_spec_b33_codes[] = { |
|
1236 |
+ 0x003, 0x008, 0x014, 0x05E, 0x000, 0x05F, 0x015, 0x009, 0x004, 0x002, 0x01C, 0x0BA, |
|
1237 |
+ 0x000, 0x011, 0x01F, 0x001, 0x00C, 0x00C, 0x014, 0x166, 0x000, 0x02D, 0x013, 0x00F, |
|
1238 |
+ 0x05A, 0x0B0, 0x05E, 0x0B8, 0x000, 0x0BB, 0x165, 0x0B9, 0x000, 0x000, 0x000, 0x000, |
|
1239 |
+ 0x000, 0x000, 0x000, 0x000, 0x05B, 0x0B8, 0x164, 0x0BA, 0x000, 0x0B9, 0x05F, 0x0B1, |
|
1240 |
+ 0x00D, 0x00E, 0x012, 0x02C, 0x000, 0x167, 0x015, 0x00D, 0x005, 0x000, 0x01E, 0x010, |
|
1241 |
+ 0x000, 0x0BB, 0x01D, 0x003 |
|
1242 |
+}; |
|
1243 |
+ |
|
1244 |
+static const uint8_t huff_spec_b34_bits[] = { |
|
1245 |
+ 1, 4, 6, 8, 0, 8, 6, 4, 4, 6, 7, 9, 0, 8, 7, 6, |
|
1246 |
+ 6, 7, 8, 10, 0, 10, 8, 7, 8, 9, 10, 10, 0, 10, 10, 9, |
|
1247 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 10, 0, 10, 10, 9, |
|
1248 |
+ 6, 7, 8, 10, 0, 10, 8, 7, 4, 6, 7, 8, 0, 9, 7, 6, |
|
1249 |
+}; |
|
1250 |
+ |
|
1251 |
+static const uint16_t huff_spec_b34_codes[] = { |
|
1252 |
+ 0x000, 0x00A, 0x038, 0x0EE, 0x000, 0x0EF, 0x039, 0x00B, 0x008, 0x03C, 0x06E, 0x1D8, |
|
1253 |
+ 0x000, 0x0C1, 0x075, 0x03F, 0x032, 0x068, 0x0C4, 0x358, 0x000, 0x30F, 0x0C7, 0x06D, |
|
1254 |
+ 0x0D4, 0x1AE, 0x30C, 0x308, 0x000, 0x30B, 0x35B, 0x1DB, 0x000, 0x000, 0x000, 0x000, |
|
1255 |
+ 0x000, 0x000, 0x000, 0x000, 0x0D5, 0x1DA, 0x35A, 0x30A, 0x000, 0x309, 0x30D, 0x1AF, |
|
1256 |
+ 0x033, 0x06C, 0x0C6, 0x30E, 0x000, 0x359, 0x0C5, 0x069, 0x009, 0x03E, 0x074, 0x0C0, |
|
1257 |
+ 0x000, 0x1D9, 0x06F, 0x03D, |
|
1258 |
+}; |
|
1259 |
+ |
|
1260 |
+static const uint8_t huff_spec_b42_bits[] = { |
|
1261 |
+ 4, 5, 6, 8, 6, 7, 8, 8, 0, 8, 8, 7, 6, 8, 6, 5, |
|
1262 |
+ 5, 6, 7, 8, 7, 7, 8, 9, 0, 8, 8, 7, 7, 8, 7, 6, |
|
1263 |
+ 7, 7, 8, 9, 7, 8, 9, 9, 0, 9, 9, 8, 7, 9, 8, 7, |
|
1264 |
+ 8, 9, 9, 10, 8, 8, 9, 10, 0, 10, 9, 8, 8, 10, 9, 8, |
|
1265 |
+ 6, 7, 8, 8, 9, 9, 10, 10, 0, 10, 10, 9, 9, 8, 8, 7, |
|
1266 |
+ 7, 7, 8, 9, 9, 10, 10, 10, 0, 10, 10, 10, 9, 9, 8, 7, |
|
1267 |
+ 8, 8, 9, 9, 10, 10, 10, 10, 0, 10, 10, 10, 10, 9, 9, 8, |
|
1268 |
+ 8, 9, 9, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 9, 9, |
|
1269 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
1270 |
+ 8, 9, 9, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 9, 9, |
|
1271 |
+ 8, 8, 9, 9, 10, 10, 10, 10, 0, 10, 10, 10, 10, 9, 9, 8, |
|
1272 |
+ 7, 7, 8, 9, 9, 10, 10, 10, 0, 10, 10, 10, 9, 9, 8, 7, |
|
1273 |
+ 6, 7, 8, 8, 9, 9, 10, 10, 0, 10, 10, 9, 9, 8, 8, 7, |
|
1274 |
+ 8, 8, 9, 10, 8, 8, 9, 10, 0, 10, 9, 8, 8, 10, 9, 9, |
|
1275 |
+ 7, 7, 8, 9, 7, 8, 9, 9, 0, 9, 9, 8, 7, 9, 8, 7, |
|
1276 |
+ 5, 6, 7, 8, 7, 7, 8, 8, 0, 9, 8, 7, 7, 8, 7, 6, |
|
1277 |
+}; |
|
1278 |
+ |
|
1279 |
+static const uint16_t huff_spec_b42_codes[] = { |
|
1280 |
+ 0x00E, 0x018, 0x010, 0x0F0, 0x024, 0x05A, 0x0F6, 0x078, 0x000, 0x079, 0x0F7, 0x05B, |
|
1281 |
+ 0x025, 0x0F1, 0x011, 0x019, 0x00C, 0x014, 0x01C, 0x036, 0x05C, 0x012, 0x09E, 0x1E4, |
|
1282 |
+ 0x000, 0x00B, 0x0A9, 0x03B, 0x05F, 0x071, 0x019, 0x017, 0x06E, 0x000, 0x03E, 0x114, |
|
1283 |
+ 0x002, 0x0B0, 0x1AA, 0x07A, 0x000, 0x099, 0x1E7, 0x0B3, 0x00B, 0x131, 0x07F, 0x00D, |
|
1284 |
+ 0x0D8, 0x1FE, 0x112, 0x22E, 0x086, 0x010, 0x134, 0x35C, 0x000, 0x35F, 0x133, 0x013, |
|
1285 |
+ 0x081, 0x22D, 0x119, 0x07B, 0x00A, 0x050, 0x0F8, 0x04E, 0x1B4, 0x154, 0x3EC, 0x0D2, |
|
1286 |
+ 0x000, 0x0D7, 0x3D7, 0x137, 0x1FD, 0x073, 0x0FD, 0x057, 0x052, 0x010, 0x08E, 0x1E8, |
|
1287 |
+ 0x11A, 0x3EE, 0x0F2, 0x03C, 0x000, 0x03F, 0x0F1, 0x3D5, 0x111, 0x1F5, 0x09D, 0x025, |
|
1288 |
+ 0x0D2, 0x082, 0x1A0, 0x0F8, 0x36E, 0x0D4, 0x072, 0x03A, 0x000, 0x027, 0x071, 0x07D, |
|
1289 |
+ 0x36D, 0x0FB, 0x1AD, 0x085, 0x00C, 0x1A8, 0x03C, 0x346, 0x0D0, 0x076, 0x024, 0x020, |
|
1290 |
+ 0x000, 0x023, 0x039, 0x075, 0x07F, 0x345, 0x09B, 0x157, 0x000, 0x000, 0x000, 0x000, |
|
1291 |
+ 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, |
|
1292 |
+ 0x00D, 0x156, 0x09A, 0x344, 0x07E, 0x074, 0x038, 0x022, 0x000, 0x021, 0x025, 0x077, |
|
1293 |
+ 0x0D1, 0x347, 0x03D, 0x1A9, 0x0D3, 0x084, 0x1AC, 0x0FA, 0x36C, 0x07C, 0x070, 0x026, |
|
1294 |
+ 0x000, 0x03B, 0x073, 0x0D5, 0x36F, 0x0F9, 0x1A1, 0x083, 0x053, 0x024, 0x09C, 0x1F4, |
|
1295 |
+ 0x110, 0x3D4, 0x0F0, 0x03E, 0x000, 0x03D, 0x0F3, 0x3EF, 0x11B, 0x1E9, 0x08F, 0x011, |
|
1296 |
+ 0x00B, 0x056, 0x0FC, 0x072, 0x1FC, 0x136, 0x3D6, 0x0D6, 0x000, 0x0D3, 0x3ED, 0x155, |
|
1297 |
+ 0x1B5, 0x04F, 0x0F9, 0x051, 0x0D9, 0x07A, 0x118, 0x22C, 0x080, 0x012, 0x132, 0x35E, |
|
1298 |
+ 0x000, 0x35D, 0x135, 0x011, 0x087, 0x22F, 0x113, 0x1FF, 0x06F, 0x00C, 0x07E, 0x130, |
|
1299 |
+ 0x00A, 0x0B2, 0x1E6, 0x098, 0x000, 0x07B, 0x1AB, 0x0B1, 0x003, 0x115, 0x03F, 0x001, |
|
1300 |
+ 0x00D, 0x016, 0x018, 0x070, 0x05E, 0x03A, 0x0A8, 0x00A, 0x000, 0x1E5, 0x09F, 0x013, |
|
1301 |
+ 0x05D, 0x037, 0x01D, 0x015, |
|
1302 |
+}; |
|
1303 |
+ |
|
1304 |
+static const uint8_t huff_spec_b43_bits[] = { |
|
1305 |
+ 2, 5, 6, 7, 7, 8, 8, 9, 0, 9, 8, 8, 7, 7, 6, 5, |
|
1306 |
+ 5, 6, 7, 8, 7, 8, 9, 10, 0, 10, 9, 8, 7, 8, 7, 6, |
|
1307 |
+ 6, 7, 8, 9, 8, 9, 10, 10, 0, 10, 10, 9, 8, 9, 8, 7, |
|
1308 |
+ 7, 8, 9, 10, 9, 9, 10, 10, 0, 10, 10, 10, 9, 10, 9, 8, |
|
1309 |
+ 7, 8, 8, 9, 10, 10, 10, 10, 0, 10, 10, 10, 10, 9, 8, 7, |
|
1310 |
+ 8, 8, 9, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 9, 8, |
|
1311 |
+ 9, 9, 10, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 9, |
|
1312 |
+ 10, 10, 10, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 10, |
|
1313 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
1314 |
+ 10, 10, 10, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 10, |
|
1315 |
+ 9, 9, 10, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 9, |
|
1316 |
+ 8, 8, 9, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 9, 8, |
|
1317 |
+ 7, 7, 8, 9, 10, 10, 10, 10, 0, 10, 10, 10, 10, 9, 8, 8, |
|
1318 |
+ 7, 8, 9, 10, 9, 10, 10, 10, 0, 10, 10, 9, 9, 10, 9, 8, |
|
1319 |
+ 6, 7, 8, 9, 8, 9, 10, 10, 0, 10, 10, 9, 8, 9, 8, 7, |
|
1320 |
+ 5, 6, 7, 8, 7, 8, 9, 10, 0, 10, 9, 8, 7, 8, 7, 6, |
|
1321 |
+}; |
|
1322 |
+ |
|
1323 |
+static const uint16_t huff_spec_b43_codes[] = { |
|
1324 |
+ 0x001, 0x01E, 0x022, 0x018, 0x064, 0x0EC, 0x008, 0x100, 0x000, 0x101, 0x009, 0x0ED, |
|
1325 |
+ 0x065, 0x019, 0x023, 0x01F, 0x01A, 0x030, 0x056, 0x09A, 0x00A, 0x090, 0x12C, 0x0A6, |
|
1326 |
+ 0x000, 0x0A9, 0x12F, 0x093, 0x00F, 0x09F, 0x059, 0x039, 0x00E, 0x054, 0x0BC, 0x19E, |
|
1327 |
+ 0x082, 0x176, 0x0AC, 0x088, 0x000, 0x08B, 0x0AF, 0x19D, 0x095, 0x1D1, 0x0BF, 0x051, |
|
1328 |
+ 0x002, 0x098, 0x1D4, 0x0B8, 0x170, 0x046, 0x090, 0x060, 0x000, 0x067, 0x095, 0x0BD, |
|
1329 |
+ 0x173, 0x0B5, 0x1D3, 0x09D, 0x052, 0x0EE, 0x034, 0x174, 0x0BA, 0x09C, 0x080, 0x044, |
|
1330 |
+ 0x000, 0x047, 0x06D, 0x099, 0x0BF, 0x16F, 0x085, 0x001, 0x0CC, 0x036, 0x16C, 0x0B0, |
|
1331 |
+ 0x09A, 0x084, 0x04E, 0x03E, 0x000, 0x037, 0x04B, 0x06B, 0x0A1, 0x0B3, 0x16B, 0x087, |
|
1332 |
+ 0x1D6, 0x102, 0x0A4, 0x092, 0x068, 0x04C, 0x034, 0x030, 0x000, 0x02D, 0x03D, 0x049, |
|
1333 |
+ 0x083, 0x097, 0x0AB, 0x169, 0x0B6, 0x09E, 0x06E, 0x064, 0x040, 0x038, 0x02E, 0x02A, |
|
1334 |
+ 0x000, 0x029, 0x033, 0x03B, 0x043, 0x063, 0x087, 0x0A3, 0x000, 0x000, 0x000, 0x000, |
|
1335 |
+ 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, |
|
1336 |
+ 0x0B7, 0x0A2, 0x086, 0x062, 0x042, 0x03A, 0x032, 0x028, 0x000, 0x02B, 0x02F, 0x039, |
|
1337 |
+ 0x041, 0x065, 0x06F, 0x09F, 0x1D7, 0x168, 0x0AA, 0x096, 0x082, 0x048, 0x03C, 0x02C, |
|
1338 |
+ 0x000, 0x031, 0x035, 0x04D, 0x069, 0x093, 0x0A5, 0x103, 0x0CD, 0x086, 0x16A, 0x0B2, |
|
1339 |
+ 0x0A0, 0x06A, 0x04A, 0x036, 0x000, 0x03F, 0x04F, 0x085, 0x09B, 0x0B1, 0x16D, 0x037, |
|
1340 |
+ 0x053, 0x000, 0x084, 0x16E, 0x0BE, 0x098, 0x06C, 0x046, 0x000, 0x045, 0x081, 0x09D, |
|
1341 |
+ 0x0BB, 0x175, 0x035, 0x0EF, 0x003, 0x09C, 0x1D2, 0x0B4, 0x172, 0x0BC, 0x094, 0x066, |
|
1342 |
+ 0x000, 0x061, 0x091, 0x047, 0x171, 0x0B9, 0x1D5, 0x099, 0x00F, 0x050, 0x0BE, 0x1D0, |
|
1343 |
+ 0x094, 0x19C, 0x0AE, 0x08A, 0x000, 0x089, 0x0AD, 0x177, 0x083, 0x19F, 0x0BD, 0x055, |
|
1344 |
+ 0x01B, 0x038, 0x058, 0x09E, 0x00E, 0x092, 0x12E, 0x0A8, 0x000, 0x0A7, 0x12D, 0x091, |
|
1345 |
+ 0x00B, 0x09B, 0x057, 0x031, |
|
1346 |
+}; |
|
1347 |
+ |
|
1348 |
+static const uint8_t huff_spec_b44_bits[] = { |
|
1349 |
+ 2, 4, 6, 7, 7, 8, 10, 10, 0, 10, 10, 8, 7, 7, 6, 4, |
|
1350 |
+ 5, 5, 7, 8, 8, 10, 10, 10, 0, 10, 10, 10, 8, 8, 7, 5, |
|
1351 |
+ 6, 7, 8, 9, 9, 10, 10, 10, 0, 10, 10, 10, 10, 9, 8, 7, |
|
1352 |
+ 8, 8, 9, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 8, |
|
1353 |
+ 8, 8, 10, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 8, |
|
1354 |
+ 9, 10, 10, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 10, |
|
1355 |
+ 10, 10, 10, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 10, |
|
1356 |
+ 10, 10, 10, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 10, |
|
1357 |
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
1358 |
+ 10, 10, 10, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 10, |
|
1359 |
+ 10, 10, 10, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 10, |
|
1360 |
+ 9, 10, 10, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 10, |
|
1361 |
+ 8, 8, 10, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 8, |
|
1362 |
+ 8, 8, 10, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 9, 8, |
|
1363 |
+ 6, 7, 8, 9, 10, 10, 10, 10, 0, 10, 10, 10, 9, 9, 8, 7, |
|
1364 |
+ 5, 5, 7, 8, 8, 10, 10, 10, 0, 10, 10, 10, 8, 8, 7, 5, |
|
1365 |
+}; |
|
1366 |
+ |
|
1367 |
+static const uint16_t huff_spec_b44_codes[] = { |
|
1368 |
+ 0x002, 0x002, 0x030, 0x000, 0x002, 0x00C, 0x1D2, 0x1AE, 0x000, 0x1AF, 0x1D3, 0x00D, |
|
1369 |
+ 0x003, 0x001, 0x031, 0x003, 0x01E, 0x002, 0x070, 0x0C8, 0x07E, 0x1E8, 0x1C0, 0x176, |
|
1370 |
+ 0x000, 0x17F, 0x1C3, 0x1EB, 0x0CF, 0x0D3, 0x073, 0x009, 0x018, 0x06A, 0x0EC, 0x1DE, |
|
1371 |
+ 0x1A2, 0x1CA, 0x1AA, 0x164, 0x000, 0x16D, 0x1AD, 0x1D1, 0x1EF, 0x1DD, 0x0EB, 0x06D, |
|
1372 |
+ 0x0E8, 0x0CA, 0x1BE, 0x1CE, 0x1DA, 0x1B6, 0x170, 0x154, 0x000, 0x153, 0x173, 0x1B1, |
|
1373 |
+ 0x1D7, 0x1D5, 0x343, 0x0CD, 0x0DC, 0x078, 0x340, 0x1CC, 0x1BA, 0x1A8, 0x156, 0x148, |
|
1374 |
+ 0x000, 0x145, 0x15F, 0x1A1, 0x1BD, 0x1D9, 0x1ED, 0x07D, 0x1BC, 0x1DC, 0x1C4, 0x1B2, |
|
1375 |
+ 0x17C, 0x15A, 0x14A, 0x03A, 0x000, 0x039, 0x147, 0x16B, 0x17B, 0x1B5, 0x1C9, 0x1DF, |
|
1376 |
+ 0x1C6, 0x1B8, 0x1A2, 0x168, 0x160, 0x14C, 0x02E, 0x024, 0x000, 0x027, 0x03D, 0x151, |
|
1377 |
+ 0x15D, 0x16F, 0x1A7, 0x1BF, 0x1A4, 0x174, 0x162, 0x14E, 0x140, 0x02C, 0x02A, 0x022, |
|
1378 |
+ 0x000, 0x021, 0x029, 0x03F, 0x143, 0x159, 0x167, 0x179, 0x000, 0x000, 0x000, 0x000, |
|
1379 |
+ 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, |
|
1380 |
+ 0x1A5, 0x178, 0x166, 0x158, 0x142, 0x03E, 0x028, 0x020, 0x000, 0x023, 0x02B, 0x02D, |
|
1381 |
+ 0x141, 0x14F, 0x163, 0x175, 0x1C7, 0x1BE, 0x1A6, 0x16E, 0x15C, 0x150, 0x03C, 0x026, |
|
1382 |
+ 0x000, 0x025, 0x02F, 0x14D, 0x161, 0x169, 0x1A3, 0x1B9, 0x1BD, 0x1DE, 0x1C8, 0x1B4, |
|
1383 |
+ 0x17A, 0x16A, 0x146, 0x038, 0x000, 0x03B, 0x14B, 0x15B, 0x17D, 0x1B3, 0x1C5, 0x1DD, |
|
1384 |
+ 0x0DD, 0x07C, 0x1EC, 0x1D8, 0x1BC, 0x1A0, 0x15E, 0x144, 0x000, 0x149, 0x157, 0x1A9, |
|
1385 |
+ 0x1BB, 0x1CD, 0x341, 0x079, 0x0E9, 0x0CC, 0x342, 0x1D4, 0x1D6, 0x1B0, 0x172, 0x152, |
|
1386 |
+ 0x000, 0x155, 0x171, 0x1B7, 0x1DB, 0x1CF, 0x1BF, 0x0CB, 0x019, 0x06C, 0x0EA, 0x1DC, |
|
1387 |
+ 0x1EE, 0x1D0, 0x1AC, 0x16C, 0x000, 0x165, 0x1AB, 0x1CB, 0x1A3, 0x1DF, 0x0ED, 0x06B, |
|
1388 |
+ 0x01F, 0x008, 0x072, 0x0D2, 0x0CE, 0x1EA, 0x1C2, 0x17E, 0x000, 0x177, 0x1C1, 0x1E9, |
|
1389 |
+ 0x07F, 0x0C9, 0x071, 0x003, |
|
1390 |
+}; |
|
1391 |
+ |
|
1392 |
+static const uint8_t huff_spec_b52_bits[] = { |
|
1393 |
+ 3, 4, 4, 4, 5, 5, 6, 6, 5, 5, 5, 6, 6, 6, 7, 7, |
|
1394 |
+ 0, 7, 7, 6, 6, 6, 5, 5, 5, 6, 6, 5, 5, 4, 4, 4, |
|
1395 |
+}; |
|
1396 |
+ |
|
1397 |
+static const uint16_t huff_spec_b52_codes[] = { |
|
1398 |
+ 0x06, 0x0E, 0x06, 0x00, 0x0A, 0x04, 0x2C, 0x12, 0x14, 0x10, 0x06, 0x2E, 0x24, 0x10, 0x4E, 0x4C, |
|
1399 |
+ 0x00, 0x4D, 0x4F, 0x11, 0x25, 0x2F, 0x07, 0x11, 0x15, 0x13, 0x2D, 0x05, 0x0B, 0x01, 0x07, 0x0F, |
|
1400 |
+}; |
|
1401 |
+ |
|
1402 |
+static const uint8_t huff_spec_b53_bits[] = { |
|
1403 |
+ 2, 3, 4, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 8, 8, |
|
1404 |
+ 0, 8, 8, 7, 7, 7, 6, 6, 6, 6, 6, 6, 5, 5, 4, 3, |
|
1405 |
+}; |
|
1406 |
+ |
|
1407 |
+static const uint16_t huff_spec_b53_codes[] = { |
|
1408 |
+ 0x02, 0x00, 0x06, 0x1C, 0x18, 0x3E, 0x16, 0x10, 0x3C, 0x36, 0x14, 0x6A, 0x26, 0x24, 0xD2, 0xD0, |
|
1409 |
+ 0x00, 0xD1, 0xD3, 0x25, 0x27, 0x6B, 0x15, 0x37, 0x3D, 0x11, 0x17, 0x3F, 0x19, 0x1D, 0x07, 0x01, |
|
1410 |
+}; |
|
1411 |
+ |
|
1412 |
+static const uint8_t huff_spec_b54_bits[] = { |
|
1413 |
+ 2, 3, 4, 4, 5, 6, 6, 7, 6, 6, 7, 8, 8, 8, 9, 9, |
|
1414 |
+ 0, 9, 9, 8, 8, 8, 7, 6, 6, 7, 6, 6, 5, 4, 4, 3, |
|
1415 |
+}; |
|
1416 |
+ |
|
1417 |
+static const uint16_t huff_spec_b54_codes[] = { |
|
1418 |
+ 0x003, 0x002, 0x008, 0x000, 0x014, 0x02E, 0x00E, 0x05A, 0x00A, 0x008, 0x01A, 0x0B2, |
|
1419 |
+ 0x032, 0x030, 0x162, 0x160, 0x000, 0x161, 0x163, 0x031, 0x033, 0x0B3, 0x01B, 0x009, |
|
1420 |
+ 0x00B, 0x05B, 0x00F, 0x02F, 0x015, 0x001, 0x009, 0x003, |
|
1421 |
+}; |
|
1422 |
+ |
|
1423 |
+static const uint8_t huff_spec_b62_bits[] = { |
|
1424 |
+ 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, |
|
1425 |
+ 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, |
|
1426 |
+ 0, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, |
|
1427 |
+ 6, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 4, |
|
1428 |
+}; |
|
1429 |
+ |
|
1430 |
+static const uint16_t huff_spec_b62_codes[] = { |
|
1431 |
+ 0x0D, 0x06, 0x1C, 0x14, 0x0A, 0x04, 0x3E, 0x2E, 0x22, 0x0E, 0x06, 0x00, 0x5A, 0x4E, 0x40, 0x20, |
|
1432 |
+ 0x30, 0x32, 0x24, 0x12, 0x0C, 0x02, 0x78, 0x58, 0x42, 0x22, 0x0A, 0x08, 0xF6, 0xF4, 0x9A, 0x98, |
|
1433 |
+ 0x00, 0x99, 0x9B, 0xF5, 0xF7, 0x09, 0x0B, 0x23, 0x43, 0x59, 0x79, 0x03, 0x0D, 0x13, 0x25, 0x33, |
|
1434 |
+ 0x31, 0x21, 0x41, 0x4F, 0x5B, 0x01, 0x07, 0x0F, 0x23, 0x2F, 0x3F, 0x05, 0x0B, 0x15, 0x1D, 0x07, |
|
1435 |
+}; |
|
1436 |
+ |
|
1437 |
+static const uint8_t huff_spec_b63_bits[] = { |
|
1438 |
+ 3, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, |
|
1439 |
+ 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, |
|
1440 |
+ 0, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 7, 7, 7, 7, 6, |
|
1441 |
+ 6, 8, 7, 7, 7, 7, 6, 6, 6, 6, 5, 5, 5, 5, 4, 4, |
|
1442 |
+}; |
|
1443 |
+ |
|
1444 |
+static const uint16_t huff_spec_b63_codes[] = { |
|
1445 |
+ 0x006, 0x00E, 0x004, 0x014, 0x010, 0x006, 0x000, 0x026, 0x01C, 0x018, 0x004, 0x05C, |
|
1446 |
+ 0x04A, 0x03C, 0x016, 0x0BC, 0x006, 0x008, 0x058, 0x03E, 0x036, 0x014, 0x0B6, 0x0B4, |
|
1447 |
+ 0x090, 0x068, 0x17E, 0x17C, 0x126, 0x124, 0x0D6, 0x0D4, 0x000, 0x0D5, 0x0D7, 0x125, |
|
1448 |
+ 0x127, 0x17D, 0x17F, 0x069, 0x091, 0x0B5, 0x0B7, 0x015, 0x037, 0x03F, 0x059, 0x009, |
|
1449 |
+ 0x007, 0x0BD, 0x017, 0x03D, 0x04B, 0x05D, 0x005, 0x019, 0x01D, 0x027, 0x001, 0x007, |
|
1450 |
+ 0x011, 0x015, 0x005, 0x00F, |
|
1451 |
+}; |
|
1452 |
+ |
|
1453 |
+static const uint8_t huff_spec_b64_bits[] = { |
|
1454 |
+ 3, 3, 4, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 7, 8, |
|
1455 |
+ 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, |
|
1456 |
+ 0, 10, 10, 10, 10, 9, 9, 9, 9, 9, 9, 8, 8, 8, 7, 7, |
|
1457 |
+ 7, 8, 7, 7, 7, 7, 7, 6, 6, 6, 6, 5, 5, 5, 4, 3, |
|
1458 |
+}; |
|
1459 |
+ |
|
1460 |
+static const uint16_t huff_spec_b64_codes[] = { |
|
1461 |
+ 0x007, 0x000, 0x008, 0x01A, 0x014, 0x00C, 0x032, 0x02E, 0x01E, 0x014, 0x062, 0x05A, |
|
1462 |
+ 0x03A, 0x026, 0x020, 0x0B2, 0x038, 0x02C, 0x022, 0x0C0, 0x05E, 0x04A, 0x186, 0x184, |
|
1463 |
+ 0x160, 0x0BA, 0x092, 0x090, 0x2C6, 0x2C4, 0x172, 0x170, 0x000, 0x171, 0x173, 0x2C5, |
|
1464 |
+ 0x2C7, 0x091, 0x093, 0x0BB, 0x161, 0x185, 0x187, 0x04B, 0x05F, 0x0C1, 0x023, 0x02D, |
|
1465 |
+ 0x039, 0x0B3, 0x021, 0x027, 0x03B, 0x05B, 0x063, 0x015, 0x01F, 0x02F, 0x033, 0x00D, |
|
1466 |
+ 0x015, 0x01B, 0x009, 0x001, |
|
1467 |
+}; |
|
1468 |
+ |
|
1469 |
+static const uint8_t huff_spec_b72_bits[] = { |
|
1470 |
+ 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, |
|
1471 |
+ 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, |
|
1472 |
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, |
|
1473 |
+ 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, |
|
1474 |
+ 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, |
|
1475 |
+ 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, |
|
1476 |
+ 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, |
|
1477 |
+ 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, |
|
1478 |
+}; |
|
1479 |
+ |
|
1480 |
+static const uint16_t huff_spec_b72_codes[] = { |
|
1481 |
+ 0x01E, 0x016, 0x00C, 0x000, 0x038, 0x032, 0x028, 0x022, 0x01C, 0x012, 0x00E, 0x006, |
|
1482 |
+ 0x076, 0x06C, 0x060, 0x04E, 0x03E, 0x02A, 0x022, 0x01A, 0x012, 0x00A, 0x0FC, 0x0DC, |
|
1483 |
+ 0x0C6, 0x0A8, 0x094, 0x086, 0x058, 0x042, 0x040, 0x02A, 0x068, 0x07C, 0x06A, 0x056, |
|
1484 |
+ 0x048, 0x040, 0x02E, 0x028, 0x016, 0x010, 0x008, 0x0EA, 0x0DE, 0x0AA, 0x09A, 0x096, |
|
1485 |
+ 0x07A, 0x078, 0x05A, 0x032, 0x030, 0x028, 0x1FE, 0x1FC, 0x1D2, 0x1D0, 0x18A, 0x188, |
|
1486 |
+ 0x132, 0x130, 0x10A, 0x108, 0x000, 0x109, 0x10B, 0x131, 0x133, 0x189, 0x18B, 0x1D1, |
|
1487 |
+ 0x1D3, 0x1FD, 0x1FF, 0x029, 0x031, 0x033, 0x05B, 0x079, 0x07B, 0x097, 0x09B, 0x0AB, |
|
1488 |
+ 0x0DF, 0x0EB, 0x009, 0x011, 0x017, 0x029, 0x02F, 0x041, 0x049, 0x057, 0x06B, 0x07D, |
|
1489 |
+ 0x069, 0x02B, 0x041, 0x043, 0x059, 0x087, 0x095, 0x0A9, 0x0C7, 0x0DD, 0x0FD, 0x00B, |
|
1490 |
+ 0x013, 0x01B, 0x023, 0x02B, 0x03F, 0x04F, 0x061, 0x06D, 0x077, 0x007, 0x00F, 0x013, |
|
1491 |
+ 0x01D, 0x023, 0x029, 0x033, 0x039, 0x001, 0x00D, 0x017, |
|
1492 |
+}; |
|
1493 |
+ |
|
1494 |
+static const uint8_t huff_spec_b73_bits[] = { |
|
1495 |
+ 3, 4, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, |
|
1496 |
+ 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, |
|
1497 |
+ 8, 7, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, |
|
1498 |
+ 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, |
|
1499 |
+ 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 9, 9, 9, |
|
1500 |
+ 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, 7, |
|
1501 |
+ 8, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, |
|
1502 |
+ 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 5, 5, 5, 4, |
|
1503 |
+}; |
|
1504 |
+ |
|
1505 |
+static const uint16_t huff_spec_b73_codes[] = { |
|
1506 |
+ 0x000, 0x006, 0x018, 0x010, 0x004, 0x03A, 0x034, 0x02A, 0x026, 0x014, 0x010, 0x07E, |
|
1507 |
+ 0x072, 0x06E, 0x05C, 0x052, 0x04A, 0x02C, 0x024, 0x018, 0x0F4, 0x0E0, 0x0DA, 0x0B6, |
|
1508 |
+ 0x0B2, 0x0A0, 0x05E, 0x04E, 0x038, 0x034, 0x1E6, 0x1B2, 0x0FA, 0x01E, 0x0F8, 0x0F0, |
|
1509 |
+ 0x0BE, 0x0B4, 0x0A2, 0x090, 0x04C, 0x03A, 0x1EE, 0x1E4, 0x1C6, 0x1B0, 0x178, 0x162, |
|
1510 |
+ 0x126, 0x124, 0x0B8, 0x06C, 0x3DA, 0x3D8, 0x38A, 0x388, 0x2F6, 0x2F4, 0x2C2, 0x2C0, |
|
1511 |
+ 0x176, 0x174, 0x0DC, 0x0DE, 0x000, 0x0DF, 0x0DD, 0x175, 0x177, 0x2C1, 0x2C3, 0x2F5, |
|
1512 |
+ 0x2F7, 0x389, 0x38B, 0x3D9, 0x3DB, 0x06D, 0x0B9, 0x125, 0x127, 0x163, 0x179, 0x1B1, |
|
1513 |
+ 0x1C7, 0x1E5, 0x1EF, 0x03B, 0x04D, 0x091, 0x0A3, 0x0B5, 0x0BF, 0x0F1, 0x0F9, 0x01F, |
|
1514 |
+ 0x0FB, 0x1B3, 0x1E7, 0x035, 0x039, 0x04F, 0x05F, 0x0A1, 0x0B3, 0x0B7, 0x0DB, 0x0E1, |
|
1515 |
+ 0x0F5, 0x019, 0x025, 0x02D, 0x04B, 0x053, 0x05D, 0x06F, 0x073, 0x07F, 0x011, 0x015, |
|
1516 |
+ 0x027, 0x02B, 0x035, 0x03B, 0x005, 0x011, 0x019, 0x007, |
|
1517 |
+}; |
|
1518 |
+ |
|
1519 |
+static const uint8_t huff_spec_b74_bits[] = { |
|
1520 |
+ 3, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, |
|
1521 |
+ 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, |
|
1522 |
+ 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, |
|
1523 |
+ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, |
|
1524 |
+ 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, |
|
1525 |
+ 10, 10, 10, 10, 10, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, |
|
1526 |
+ 8, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, |
|
1527 |
+ 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 4, |
|
1528 |
+}; |
|
1529 |
+ |
|
1530 |
+static const uint16_t huff_spec_b74_codes[] = { |
|
1531 |
+ 0x001, 0x008, 0x01E, 0x018, 0x00C, 0x002, 0x03A, 0x034, 0x02C, 0x01E, 0x016, 0x012, |
|
1532 |
+ 0x072, 0x06E, 0x05E, 0x056, 0x050, 0x038, 0x022, 0x004, 0x0E2, 0x0DA, 0x0BA, 0x0A8, |
|
1533 |
+ 0x076, 0x054, 0x050, 0x002, 0x000, 0x1C0, 0x1B0, 0x156, 0x0A4, 0x0A6, 0x074, 0x052, |
|
1534 |
+ 0x004, 0x1C2, 0x1B2, 0x170, 0x154, 0x0AE, 0x0AC, 0x086, 0x2E6, 0x2E4, 0x10A, 0x108, |
|
1535 |
+ 0x106, 0x104, 0x102, 0x100, 0x03E, 0x03A, 0x03C, 0x038, 0x036, 0x034, 0x032, 0x030, |
|
1536 |
+ 0x01E, 0x01A, 0x01C, 0x018, 0x000, 0x019, 0x01D, 0x01B, 0x01F, 0x031, 0x033, 0x035, |
|
1537 |
+ 0x037, 0x039, 0x03D, 0x03B, 0x03F, 0x101, 0x103, 0x105, 0x107, 0x109, 0x10B, 0x2E5, |
|
1538 |
+ 0x2E7, 0x087, 0x0AD, 0x0AF, 0x155, 0x171, 0x1B3, 0x1C3, 0x005, 0x053, 0x075, 0x0A7, |
|
1539 |
+ 0x0A5, 0x157, 0x1B1, 0x1C1, 0x001, 0x003, 0x051, 0x055, 0x077, 0x0A9, 0x0BB, 0x0DB, |
|
1540 |
+ 0x0E3, 0x005, 0x023, 0x039, 0x051, 0x057, 0x05F, 0x06F, 0x073, 0x013, 0x017, 0x01F, |
|
1541 |
+ 0x02D, 0x035, 0x03B, 0x003, 0x00D, 0x019, 0x01F, 0x009, |
|
1542 |
+}; |
|
1543 |
+ |
|
1544 |
+static const HuffmanCodebook at9_huffman_coeffs[][8][4] = { |
|
1545 |
+ { |
|
1546 |
+ { { 0 } }, |
|
1547 |
+ { { 0 } }, |
|
1548 |
+ { |
|
1549 |
+ { huff_spec_a21_bits, huff_spec_a21_codes, 16, 2, 1, 2, 3, }, |
|
1550 |
+ { huff_spec_a22_bits, huff_spec_a22_codes, 256, 4, 2, 2, 8, }, |
|
1551 |
+ { huff_spec_a23_bits, huff_spec_a23_codes, 256, 4, 2, 2, 9, }, |
|
1552 |
+ { huff_spec_a24_bits, huff_spec_a24_codes, 256, 4, 2, 2, 10, }, |
|
1553 |
+ }, |
|
1554 |
+ { |
|
1555 |
+ { huff_spec_a31_bits, huff_spec_a31_codes, 64, 2, 1, 3, 7, }, |
|
1556 |
+ { huff_spec_a32_bits, huff_spec_a32_codes, 64, 2, 1, 3, 7, }, |
|
1557 |
+ { huff_spec_a33_bits, huff_spec_a33_codes, 64, 2, 1, 3, 8, }, |
|
1558 |
+ { huff_spec_a34_bits, huff_spec_a34_codes, 64, 2, 1, 3, 10, }, |
|
1559 |
+ }, |
|
1560 |
+ { |
|
1561 |
+ { huff_spec_a41_bits, huff_spec_a41_codes, 256, 2, 1, 4, 9, }, |
|
1562 |
+ { huff_spec_a42_bits, huff_spec_a42_codes, 256, 2, 1, 4, 10, }, |
|
1563 |
+ { huff_spec_a43_bits, huff_spec_a43_codes, 256, 2, 1, 4, 10, }, |
|
1564 |
+ { huff_spec_a44_bits, huff_spec_a44_codes, 256, 2, 1, 4, 10, }, |
|
1565 |
+ }, |
|
1566 |
+ { |
|
1567 |
+ { huff_spec_a51_bits, huff_spec_a51_codes, 32, 1, 0, 5, 6, }, |
|
1568 |
+ { huff_spec_a52_bits, huff_spec_a52_codes, 32, 1, 0, 5, 6, }, |
|
1569 |
+ { huff_spec_a53_bits, huff_spec_a53_codes, 32, 1, 0, 5, 7, }, |
|
1570 |
+ { huff_spec_a54_bits, huff_spec_a54_codes, 32, 1, 0, 5, 8, }, |
|
1571 |
+ }, |
|
1572 |
+ { |
|
1573 |
+ { huff_spec_a61_bits, huff_spec_a61_codes, 64, 1, 0, 6, 7, }, |
|
1574 |
+ { huff_spec_a62_bits, huff_spec_a62_codes, 64, 1, 0, 6, 7, }, |
|
1575 |
+ { huff_spec_a63_bits, huff_spec_a63_codes, 64, 1, 0, 6, 8, }, |
|
1576 |
+ { huff_spec_a64_bits, huff_spec_a64_codes, 64, 1, 0, 6, 9, }, |
|
1577 |
+ }, |
|
1578 |
+ { |
|
1579 |
+ { huff_spec_a71_bits, huff_spec_a71_codes, 128, 1, 0, 7, 8, }, |
|
1580 |
+ { huff_spec_a72_bits, huff_spec_a72_codes, 128, 1, 0, 7, 8, }, |
|
1581 |
+ { huff_spec_a73_bits, huff_spec_a73_codes, 128, 1, 0, 7, 9, }, |
|
1582 |
+ { huff_spec_a74_bits, huff_spec_a74_codes, 128, 1, 0, 7, 10, }, |
|
1583 |
+ }, |
|
1584 |
+ }, |
|
1585 |
+ { |
|
1586 |
+ { { 0 } }, |
|
1587 |
+ { { 0 } }, |
|
1588 |
+ { |
|
1589 |
+ { 0 }, |
|
1590 |
+ { huff_spec_b22_bits, huff_spec_b22_codes, 256, 4, 2, 2, 10, }, |
|
1591 |
+ { huff_spec_b23_bits, huff_spec_b23_codes, 256, 4, 2, 2, 10, }, |
|
1592 |
+ { huff_spec_b24_bits, huff_spec_b24_codes, 256, 4, 2, 2, 10, }, |
|
1593 |
+ }, |
|
1594 |
+ { |
|
1595 |
+ { 0 }, |
|
1596 |
+ { huff_spec_b32_bits, huff_spec_b32_codes, 64, 2, 1, 3, 9, }, |
|
1597 |
+ { huff_spec_b33_bits, huff_spec_b33_codes, 64, 2, 1, 3, 10, }, |
|
1598 |
+ { huff_spec_b34_bits, huff_spec_b34_codes, 64, 2, 1, 3, 10, }, |
|
1599 |
+ }, |
|
1600 |
+ { |
|
1601 |
+ { 0 }, |
|
1602 |
+ { huff_spec_b42_bits, huff_spec_b42_codes, 256, 2, 1, 4, 10, }, |
|
1603 |
+ { huff_spec_b43_bits, huff_spec_b43_codes, 256, 2, 1, 4, 10, }, |
|
1604 |
+ { huff_spec_b44_bits, huff_spec_b44_codes, 256, 2, 1, 4, 10, }, |
|
1605 |
+ }, |
|
1606 |
+ { |
|
1607 |
+ { 0 }, |
|
1608 |
+ { huff_spec_b52_bits, huff_spec_b52_codes, 32, 1, 0, 5, 7, }, |
|
1609 |
+ { huff_spec_b53_bits, huff_spec_b53_codes, 32, 1, 0, 5, 8, }, |
|
1610 |
+ { huff_spec_b54_bits, huff_spec_b54_codes, 32, 1, 0, 5, 9, }, |
|
1611 |
+ }, |
|
1612 |
+ { |
|
1613 |
+ { 0 }, |
|
1614 |
+ { huff_spec_b62_bits, huff_spec_b62_codes, 64, 1, 0, 6, 8, }, |
|
1615 |
+ { huff_spec_b63_bits, huff_spec_b63_codes, 64, 1, 0, 6, 9, }, |
|
1616 |
+ { huff_spec_b64_bits, huff_spec_b64_codes, 64, 1, 0, 6, 10, }, |
|
1617 |
+ }, |
|
1618 |
+ { |
|
1619 |
+ { 0 }, |
|
1620 |
+ { huff_spec_b72_bits, huff_spec_b72_codes, 128, 1, 0, 7, 9, }, |
|
1621 |
+ { huff_spec_b73_bits, huff_spec_b73_codes, 128, 1, 0, 7, 10, }, |
|
1622 |
+ { huff_spec_b74_bits, huff_spec_b74_codes, 128, 1, 0, 7, 10, }, |
|
1623 |
+ }, |
|
1624 |
+ }, |
|
1625 |
+}; |
... | ... |
@@ -2878,6 +2878,13 @@ static const AVCodecDescriptor codec_descriptors[] = { |
2878 | 2878 |
.long_name = NULL_IF_CONFIG_SMALL("SBC (low-complexity subband codec)"), |
2879 | 2879 |
.props = AV_CODEC_PROP_LOSSY, |
2880 | 2880 |
}, |
2881 |
+ { |
|
2882 |
+ .id = AV_CODEC_ID_ATRAC9, |
|
2883 |
+ .type = AVMEDIA_TYPE_AUDIO, |
|
2884 |
+ .name = "atrac9", |
|
2885 |
+ .long_name = NULL_IF_CONFIG_SMALL("ATRAC9 (Adaptive TRansform Acoustic Coding 9)"), |
|
2886 |
+ .props = AV_CODEC_PROP_LOSSY, |
|
2887 |
+ }, |
|
2881 | 2888 |
|
2882 | 2889 |
/* subtitle codecs */ |
2883 | 2890 |
{ |
... | ... |
@@ -1536,6 +1536,7 @@ static int get_audio_frame_duration(enum AVCodecID id, int sr, int ch, int ba, |
1536 | 1536 |
case AV_CODEC_ID_GSM_MS: return 320; |
1537 | 1537 |
case AV_CODEC_ID_MP1: return 384; |
1538 | 1538 |
case AV_CODEC_ID_ATRAC1: return 512; |
1539 |
+ case AV_CODEC_ID_ATRAC9: |
|
1539 | 1540 |
case AV_CODEC_ID_ATRAC3: return 1024 * framecount; |
1540 | 1541 |
case AV_CODEC_ID_ATRAC3P: return 2048; |
1541 | 1542 |
case AV_CODEC_ID_MP2: |
... | ... |
@@ -28,7 +28,7 @@ |
28 | 28 |
#include "libavutil/version.h" |
29 | 29 |
|
30 | 30 |
#define LIBAVCODEC_VERSION_MAJOR 58 |
31 |
-#define LIBAVCODEC_VERSION_MINOR 20 |
|
31 |
+#define LIBAVCODEC_VERSION_MINOR 21 |
|
32 | 32 |
#define LIBAVCODEC_VERSION_MICRO 104 |
33 | 33 |
|
34 | 34 |
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ |