]>
Commit | Line | Data |
---|---|---|
1b8522d6 | 1 | use nihav_core::codecs::*; |
2d90e8b6 KS |
2 | use nihav_core::io::byteio::*; |
3 | ||
4 | struct MaskState<'a> { | |
5 | is_intra: bool, | |
6 | pos: usize, | |
7 | row_pos: usize, | |
8 | row_size: usize, | |
9 | mask: u8, | |
10 | src: &'a [u8], | |
11 | } | |
12 | ||
13 | impl<'a> MaskState<'a> { | |
14 | fn new(is_intra: bool, src: &'a [u8], row_size: usize) -> Self { | |
15 | Self { is_intra, src, pos: 0, row_pos: 0, row_size, mask: 0x01 } | |
16 | } | |
17 | fn get_next(&mut self) -> bool { | |
18 | if self.is_intra { | |
19 | true | |
20 | } else { | |
21 | let res = (self.src[self.pos] & self.mask) == 0; | |
22 | self.mask <<= 1; | |
23 | if self.mask == 0 { | |
24 | self.pos += 1; | |
25 | self.mask = 0x01; | |
26 | } | |
27 | res | |
28 | } | |
29 | } | |
30 | fn reset_row(&mut self) { | |
31 | self.pos = self.row_pos; | |
32 | self.mask = 0x01; | |
33 | } | |
34 | fn next_row(&mut self) { | |
35 | self.row_pos += self.row_size; | |
36 | self.reset_row(); | |
37 | } | |
38 | } | |
39 | ||
40 | struct IndexState<'a> { | |
41 | src: &'a [u8], | |
42 | pos: usize, | |
43 | vec_idx: usize, | |
44 | vec_subidx: usize, | |
45 | } | |
46 | ||
47 | impl<'a> IndexState<'a> { | |
48 | fn new(src: &'a [u8]) -> Self { | |
49 | Self { src, pos: 0, vec_idx: 0, vec_subidx: 0 } | |
50 | } | |
51 | fn get_next(&mut self) -> DecoderResult<()> { | |
52 | validate!(self.pos < self.src.len()); | |
53 | self.vec_idx = self.src[self.pos] as usize; | |
54 | self.vec_subidx = 0; | |
55 | self.pos += 1; | |
56 | Ok(()) | |
57 | } | |
58 | fn get_pred(&self, dtab: &[[u32; 4]; 256]) -> u32 { dtab[self.vec_idx][self.vec_subidx] } | |
59 | fn get_diff16(&mut self, dtab: &[[u32; 4]; 256]) -> DecoderResult<u32> { | |
60 | let pred1 = self.get_pred(dtab); | |
61 | let mut pred = pred1 >> 1; | |
62 | if (pred1 & 1) != 0 { | |
63 | self.get_next()?; | |
64 | if self.vec_idx == 0 { | |
65 | self.get_next()?; | |
66 | let pred2 = self.get_pred(dtab); | |
67 | pred = pred.wrapping_add((pred2 >> 1).wrapping_mul(5)); | |
68 | if (pred2 & 1) != 0 { | |
69 | self.get_next()?; | |
70 | } else { | |
71 | self.vec_subidx += 1; | |
72 | } | |
73 | } | |
74 | } else { | |
75 | self.vec_subidx += 1; | |
76 | } | |
77 | Ok(pred) | |
78 | } | |
79 | fn get_diff16_noesc(&mut self, dtab: &[[u32; 4]; 256]) -> DecoderResult<u32> { | |
80 | let pred1 = self.get_pred(dtab); | |
81 | let pred = pred1 >> 1; | |
82 | if (pred1 & 1) != 0 { | |
83 | self.get_next()?; | |
84 | } else { | |
85 | self.vec_subidx += 1; | |
86 | } | |
87 | Ok(pred) | |
88 | } | |
89 | fn get_diff24(&mut self, dtab: &[[u32; 4]; 256], esctab: &[[u32; 4]; 256]) -> DecoderResult<u32> { | |
90 | let pred1 = self.get_pred(dtab); | |
91 | let mut pred = pred1 >> 1; | |
92 | if (pred1 & 1) != 0 { | |
93 | self.get_next()?; | |
94 | if self.vec_idx == 0 { | |
95 | self.get_next()?; | |
96 | let pred2 = self.get_pred(esctab); | |
97 | pred = pred.wrapping_add(pred2 >> 1); | |
98 | if (pred2 & 1) != 0 { | |
99 | self.get_next()?; | |
100 | } else { | |
101 | self.vec_subidx += 1; | |
102 | } | |
103 | } | |
104 | } else { | |
105 | self.vec_subidx += 1; | |
106 | } | |
107 | Ok(pred) | |
108 | } | |
109 | } | |
110 | ||
111 | struct DeltaTables { | |
112 | ydt: [[u32; 4]; 256], | |
113 | cdt: [[u32; 4]; 256], | |
114 | fat_ydt: [[u32; 4]; 256], | |
115 | fat_cdt: [[u32; 4]; 256], | |
116 | adt: [[u32; 4]; 256], | |
117 | } | |
118 | ||
119 | impl Default for DeltaTables { | |
120 | fn default() -> Self { | |
121 | Self { | |
122 | ydt: [[0; 4]; 256], | |
123 | cdt: [[0; 4]; 256], | |
124 | fat_ydt: [[0; 4]; 256], | |
125 | fat_cdt: [[0; 4]; 256], | |
126 | adt: [[0; 4]; 256], | |
127 | } | |
128 | } | |
129 | } | |
130 | ||
131 | struct FrameBuf { | |
3fc28ece KS |
132 | last16: Option<NAVideoBufferRef<u16>>, |
133 | last24: Option<NAVideoBufferRef<u8>>, | |
2d90e8b6 KS |
134 | } |
135 | ||
136 | impl FrameBuf { | |
3fc28ece KS |
137 | fn set16(&mut self, buf: NAVideoBufferRef<u16>) { self.last16 = Some(buf); } |
138 | fn set24(&mut self, buf: NAVideoBufferRef<u8>) { self.last24 = Some(buf); } | |
139 | fn get16(&mut self) -> Option<NAVideoBufferRef<u16>> { | |
2d90e8b6 KS |
140 | if let Some(ref mut frm) = self.last16 { |
141 | let newfrm = frm.copy_buffer(); | |
3fc28ece KS |
142 | *frm = newfrm.clone().into_ref(); |
143 | Some(newfrm.into_ref()) | |
2d90e8b6 KS |
144 | } else { |
145 | None | |
146 | } | |
147 | } | |
3fc28ece | 148 | fn get24(&mut self) -> Option<NAVideoBufferRef<u8>> { |
2d90e8b6 KS |
149 | if let Some(ref mut frm) = self.last24 { |
150 | let newfrm = frm.copy_buffer(); | |
3fc28ece KS |
151 | *frm = newfrm.clone().into_ref(); |
152 | Some(newfrm.into_ref()) | |
2d90e8b6 KS |
153 | } else { |
154 | None | |
155 | } | |
156 | } | |
157 | fn reset(&mut self) { | |
158 | self.last16 = None; | |
159 | self.last24 = None; | |
160 | } | |
161 | } | |
162 | ||
163 | impl Default for FrameBuf { | |
164 | fn default() -> Self { | |
165 | Self { last16: None, last24: None } | |
166 | } | |
167 | } | |
168 | ||
169 | #[derive(Default)] | |
170 | struct TM1Decoder { | |
2422d969 | 171 | info: NACodecInfoRef, |
2d90e8b6 KS |
172 | last_delta_set: usize, |
173 | last_table_idx: usize, | |
174 | delta_tables: DeltaTables, | |
175 | blk_w: usize, | |
176 | blk_h: usize, | |
177 | vert_pred: Vec<u32>, | |
178 | lastframe: FrameBuf, | |
179 | } | |
180 | ||
181 | const RGB555_FORMAT: NAPixelFormaton = NAPixelFormaton { model: ColorModel::RGB(RGBSubmodel::RGB), components: 3, | |
182 | comp_info: [ | |
183 | Some(NAPixelChromaton{ h_ss: 0, v_ss: 0, packed: true, depth: 5, shift: 10, comp_offs: 0, next_elem: 2 }), | |
184 | Some(NAPixelChromaton{ h_ss: 0, v_ss: 0, packed: true, depth: 5, shift: 5, comp_offs: 0, next_elem: 2 }), | |
185 | Some(NAPixelChromaton{ h_ss: 0, v_ss: 0, packed: true, depth: 5, shift: 0, comp_offs: 0, next_elem: 2 }), | |
186 | None, None], | |
187 | elem_size: 2, be: false, alpha: false, palette: false }; | |
188 | const BGR0_FORMAT: NAPixelFormaton = NAPixelFormaton { model: ColorModel::RGB(RGBSubmodel::RGB), components: 3, | |
189 | comp_info: [ | |
190 | Some(NAPixelChromaton{ h_ss: 0, v_ss: 0, packed: true, depth: 8, shift: 0, comp_offs: 2, next_elem: 4 }), | |
191 | Some(NAPixelChromaton{ h_ss: 0, v_ss: 0, packed: true, depth: 8, shift: 0, comp_offs: 1, next_elem: 4 }), | |
192 | Some(NAPixelChromaton{ h_ss: 0, v_ss: 0, packed: true, depth: 8, shift: 0, comp_offs: 0, next_elem: 4 }), | |
193 | None, None], | |
194 | elem_size: 4, be: false, alpha: false, palette: false }; | |
195 | ||
196 | impl TM1Decoder { | |
197 | fn new() -> Self { Self::default() } | |
198 | fn set_delta_tables(&mut self, delta_set: usize, table_idx: usize, is_24bit: bool) { | |
199 | if (self.last_delta_set == delta_set) && (self.last_table_idx == table_idx) { return; } | |
200 | let ydt = &DUCK_Y_DELTAS[delta_set]; | |
201 | let yfdt = DUCK_Y_FAT_DELTAS[delta_set]; | |
202 | let cdt = &DUCK_C_DELTAS[delta_set]; | |
203 | let cfdt = DUCK_C_FAT_DELTAS[delta_set]; | |
204 | let vec = DUCK_VECTABLES[table_idx - 1]; | |
205 | ||
8a7352c0 | 206 | let mut vec_iter = vec.iter(); |
2d90e8b6 KS |
207 | for i in 0..256 { |
208 | let len = (*vec_iter.next().unwrap() as usize) >> 1; | |
209 | for j in 0..len { | |
210 | let pair = vec_iter.next().unwrap(); | |
211 | let lo = (pair >> 4) as usize; | |
212 | let hi = (pair & 0xF) as usize; | |
213 | if !is_24bit { | |
214 | let d_lo = ydt[lo] + (ydt[lo] << 5) + (ydt[lo] << 10); | |
215 | let d_hi = ydt[hi] + (ydt[hi] << 5) + (ydt[hi] << 10); | |
216 | self.delta_tables.ydt[i][j] = ((d_lo + (d_hi << 16)) << 1) as u32; | |
217 | let d_c = cdt[hi] + (cdt[lo] << 10); | |
218 | self.delta_tables.cdt[i][j] = ((d_c + (d_c << 16)) << 1) as u32; | |
219 | let d_a = lo + hi * 5; | |
220 | self.delta_tables.adt[i][j] = ((d_a << 16) << 1) as u32; | |
221 | } else { | |
222 | self.delta_tables.ydt[i][j] = ((ydt [lo] + (ydt [hi] << 8) + (ydt [hi] << 16)) << 1) as u32; | |
223 | self.delta_tables.fat_ydt[i][j] = ((yfdt[lo] + (yfdt[hi] << 8) + (yfdt[hi] << 16)) << 1) as u32; | |
224 | self.delta_tables.cdt[i][j] = ((cdt [hi] + (cdt [lo] << 16)) << 1) as u32; | |
225 | self.delta_tables.fat_cdt[i][j] = ((cfdt[hi] + (cfdt[lo] << 16)) << 1) as u32; | |
226 | } | |
227 | } | |
228 | self.delta_tables.ydt[i][len - 1] |= 1; | |
229 | self.delta_tables.cdt[i][len - 1] |= 1; | |
230 | self.delta_tables.adt[i][len - 1] |= 1; | |
231 | self.delta_tables.fat_ydt[i][len - 1] |= 1; | |
232 | self.delta_tables.fat_cdt[i][len - 1] |= 1; | |
233 | } | |
234 | ||
235 | self.last_delta_set = delta_set; | |
236 | self.last_table_idx = table_idx; | |
237 | } | |
238 | fn decode_16bit(&mut self, dst: &mut [u16], stride: usize, width: usize, height: usize, mask: &mut MaskState<'_>, index: &mut IndexState<'_>) -> DecoderResult<()> { | |
239 | let mut off = 0; | |
240 | index.get_next()?; | |
241 | for y in 0..height { | |
242 | let mut hor_pred: u32 = 0; | |
243 | for x in (0..width).step_by(4) { | |
244 | if mask.get_next() { | |
245 | match y & 3 { | |
246 | 0 => { | |
247 | let dc0 = index.get_diff16(&self.delta_tables.cdt)?; | |
248 | let dy0 = index.get_diff16(&self.delta_tables.ydt)?; | |
249 | hor_pred = hor_pred.wrapping_add(dc0); | |
250 | hor_pred = hor_pred.wrapping_add(dy0); | |
251 | let cur = hor_pred.wrapping_add(self.vert_pred[(x >> 1) + 0]); | |
252 | self.vert_pred[(x >> 1) + 0] = cur; | |
253 | dst[off + x + 0] = cur as u16; | |
254 | dst[off + x + 1] = (cur >> 16) as u16; | |
255 | if self.blk_w == 2 { | |
256 | let dc1 = index.get_diff16(&self.delta_tables.cdt)?; | |
257 | hor_pred = hor_pred.wrapping_add(dc1); | |
258 | } | |
259 | let dy1 = index.get_diff16(&self.delta_tables.ydt)?; | |
260 | hor_pred = hor_pred.wrapping_add(dy1); | |
261 | let cur = hor_pred.wrapping_add(self.vert_pred[(x >> 1) + 1]); | |
262 | self.vert_pred[(x >> 1) + 1] = cur; | |
263 | dst[off + x + 2] = cur as u16; | |
264 | dst[off + x + 3] = (cur >> 16) as u16; | |
265 | }, | |
266 | 1 | 3 => { | |
267 | let dy0 = index.get_diff16(&self.delta_tables.ydt)?; | |
268 | hor_pred = hor_pred.wrapping_add(dy0); | |
269 | let cur = hor_pred.wrapping_add(self.vert_pred[(x >> 1) + 0]); | |
270 | self.vert_pred[(x >> 1) + 0] = cur; | |
271 | dst[off + x + 0] = cur as u16; | |
272 | dst[off + x + 1] = (cur >> 16) as u16; | |
273 | let dy1 = index.get_diff16(&self.delta_tables.ydt)?; | |
274 | hor_pred = hor_pred.wrapping_add(dy1); | |
275 | let cur = hor_pred.wrapping_add(self.vert_pred[(x >> 1) + 1]); | |
276 | self.vert_pred[(x >> 1) + 1] = cur; | |
277 | dst[off + x + 2] = cur as u16; | |
278 | dst[off + x + 3] = (cur >> 16) as u16; | |
279 | }, | |
280 | 2 => { | |
281 | if self.blk_h == 2 { | |
282 | let dc0 = index.get_diff16(&self.delta_tables.cdt)?; | |
283 | let dy0 = index.get_diff16(&self.delta_tables.ydt)?; | |
284 | hor_pred = hor_pred.wrapping_add(dc0); | |
285 | hor_pred = hor_pred.wrapping_add(dy0); | |
286 | let cur = hor_pred.wrapping_add(self.vert_pred[(x >> 1) + 0]); | |
287 | self.vert_pred[(x >> 1) + 0] = cur; | |
288 | dst[off + x + 0] = cur as u16; | |
289 | dst[off + x + 1] = (cur >> 16) as u16; | |
290 | if self.blk_w == 2 { | |
291 | let dc1 = index.get_diff16(&self.delta_tables.cdt)?; | |
292 | hor_pred = hor_pred.wrapping_add(dc1); | |
293 | } | |
294 | let dy1 = index.get_diff16(&self.delta_tables.ydt)?; | |
295 | hor_pred = hor_pred.wrapping_add(dy1); | |
296 | let cur = hor_pred.wrapping_add(self.vert_pred[(x >> 1) + 1]); | |
297 | self.vert_pred[(x >> 1) + 1] = cur; | |
298 | dst[off + x + 2] = cur as u16; | |
299 | dst[off + x + 3] = (cur >> 16) as u16; | |
300 | } else { | |
301 | let dy0 = index.get_diff16(&self.delta_tables.ydt)?; | |
302 | hor_pred = hor_pred.wrapping_add(dy0); | |
303 | let cur = hor_pred.wrapping_add(self.vert_pred[(x >> 1) + 0]); | |
304 | self.vert_pred[(x >> 1) + 0] = cur; | |
305 | dst[off + x + 0] = cur as u16; | |
306 | dst[off + x + 1] = (cur >> 16) as u16; | |
307 | let dy1 = index.get_diff16(&self.delta_tables.ydt)?; | |
308 | hor_pred = hor_pred.wrapping_add(dy1); | |
309 | let cur = hor_pred.wrapping_add(self.vert_pred[(x >> 1) + 1]); | |
310 | self.vert_pred[(x >> 1) + 1] = cur; | |
311 | dst[off + x + 2] = cur as u16; | |
312 | dst[off + x + 3] = (cur >> 16) as u16; | |
313 | } | |
314 | }, | |
315 | _ => unreachable!(), | |
316 | }; | |
317 | } else { | |
8a7352c0 | 318 | let cur = u32::from(dst[off + x + 0]) | (u32::from(dst[off + x + 1]) << 16); |
2d90e8b6 | 319 | self.vert_pred[(x >> 1) + 0] = cur; |
8a7352c0 | 320 | let cur = u32::from(dst[off + x + 2]) | (u32::from(dst[off + x + 3]) << 16); |
2d90e8b6 KS |
321 | hor_pred = cur.wrapping_sub(self.vert_pred[(x >> 1) + 1]); |
322 | self.vert_pred[(x >> 1) + 1] = cur; | |
323 | } | |
324 | } | |
325 | if (y & 3) != 3 { | |
326 | mask.reset_row(); | |
327 | } else { | |
328 | mask.next_row(); | |
329 | } | |
330 | off += stride; | |
331 | } | |
332 | Ok(()) | |
333 | } | |
334 | fn decode_sprite(&mut self, dst: &mut [u16], stride: usize, width: usize, height: usize, mask: &mut MaskState<'_>, index: &mut IndexState<'_>) -> DecoderResult<()> { | |
335 | let mut off = 0; | |
336 | let _ = index.get_next(); | |
337 | for y in 0..height { | |
338 | let mut hor_pred: u32 = 0; | |
339 | for x in (0..width).step_by(4) { | |
340 | let is_tm = !mask.get_next(); | |
341 | let is_sprite = !mask.get_next(); | |
342 | if is_tm { | |
343 | if (y & 3) == 0 { | |
344 | let dc0 = index.get_diff16(&self.delta_tables.cdt)?; | |
345 | hor_pred = hor_pred.wrapping_add(dc0); | |
346 | } | |
347 | let dy0 = index.get_diff16(&self.delta_tables.ydt)?; | |
348 | hor_pred = hor_pred.wrapping_add(dy0); | |
349 | let cur = hor_pred.wrapping_add(self.vert_pred[(x >> 1) + 0]); | |
350 | self.vert_pred[(x >> 1) + 0] = cur; | |
351 | dst[off + x + 0] = cur as u16; | |
352 | dst[off + x + 1] = (cur >> 16) as u16; | |
353 | let dy1 = index.get_diff16(&self.delta_tables.ydt)?; | |
354 | hor_pred = hor_pred.wrapping_add(dy1); | |
355 | let cur = hor_pred.wrapping_add(self.vert_pred[(x >> 1) + 1]); | |
356 | self.vert_pred[(x >> 1) + 1] = cur; | |
357 | dst[off + x + 2] = cur as u16; | |
358 | dst[off + x + 3] = (cur >> 16) as u16; | |
359 | } else if is_sprite { | |
360 | if (y & 3) == 0 { | |
361 | let dc0 = index.get_diff16(&self.delta_tables.cdt)?; | |
362 | hor_pred = hor_pred.wrapping_add(dc0); | |
363 | } | |
364 | let dy0 = index.get_diff16(&self.delta_tables.ydt)?; | |
365 | hor_pred = hor_pred.wrapping_add(dy0); | |
366 | let _da0 = index.get_diff16_noesc(&self.delta_tables.adt)?; | |
367 | let cur = hor_pred.wrapping_add(self.vert_pred[(x >> 1) + 0]); | |
368 | self.vert_pred[(x >> 1) + 0] = cur; | |
369 | dst[off + x + 0] = cur as u16; | |
370 | dst[off + x + 1] = (cur >> 16) as u16; | |
371 | let dy1 = index.get_diff16(&self.delta_tables.ydt)?; | |
372 | hor_pred = hor_pred.wrapping_add(dy1); | |
373 | let _da1 = index.get_diff16_noesc(&self.delta_tables.adt)?; | |
374 | let cur = hor_pred.wrapping_add(self.vert_pred[(x >> 1) + 1]); | |
375 | self.vert_pred[(x >> 1) + 1] = cur; | |
376 | dst[off + x + 2] = cur as u16; | |
377 | dst[off + x + 3] = (cur >> 16) as u16; | |
378 | } else { | |
379 | hor_pred = 0; | |
380 | dst[off + x + 0] = 0; | |
381 | dst[off + x + 1] = 0; | |
382 | dst[off + x + 2] = 0; | |
383 | dst[off + x + 3] = 0; | |
384 | self.vert_pred[(x >> 1) + 0] = 0; | |
385 | self.vert_pred[(x >> 1) + 1] = 0; | |
386 | } | |
387 | } | |
388 | if (y & 3) != 3 { | |
389 | mask.reset_row(); | |
390 | } else { | |
391 | mask.next_row(); | |
392 | } | |
393 | off += stride; | |
394 | } | |
395 | Ok(()) | |
396 | } | |
397 | fn decode_24bit(&mut self, dst: &mut [u8], stride: usize, width: usize, height: usize, mask: &mut MaskState<'_>, index: &mut IndexState<'_>) -> DecoderResult<()> { | |
398 | let mut off = 0; | |
399 | index.get_next()?; | |
400 | for y in 0..height { | |
401 | let mut hor_pred: u32 = 0; | |
402 | for x in (0..width).step_by(2) { | |
403 | if mask.get_next() { | |
404 | match y & 3 { | |
405 | 0 => { | |
406 | let dc0 = index.get_diff24(&self.delta_tables.cdt, &self.delta_tables.fat_cdt)?; | |
407 | let dy0 = index.get_diff24(&self.delta_tables.ydt, &self.delta_tables.fat_ydt)?; | |
408 | hor_pred = hor_pred.wrapping_add(dc0); | |
409 | hor_pred = hor_pred.wrapping_add(dy0); | |
410 | let cur = hor_pred.wrapping_add(self.vert_pred[x + 0]); | |
411 | self.vert_pred[x + 0] = cur; | |
412 | dst[off + x*4 + 0] = cur as u8; | |
413 | dst[off + x*4 + 1] = (cur >> 8) as u8; | |
414 | dst[off + x*4 + 2] = (cur >> 16) as u8; | |
415 | dst[off + x*4 + 3] = 0; | |
416 | if self.blk_w == 2 { | |
417 | let dc1 = index.get_diff24(&self.delta_tables.cdt, &self.delta_tables.fat_cdt)?; | |
418 | hor_pred = hor_pred.wrapping_add(dc1); | |
419 | } | |
420 | let dy1 = index.get_diff24(&self.delta_tables.ydt, &self.delta_tables.fat_ydt)?; | |
421 | hor_pred = hor_pred.wrapping_add(dy1); | |
422 | let cur = hor_pred.wrapping_add(self.vert_pred[x + 1]); | |
423 | self.vert_pred[x + 1] = cur; | |
424 | dst[off + x*4 + 4] = cur as u8; | |
425 | dst[off + x*4 + 5] = (cur >> 8) as u8; | |
426 | dst[off + x*4 + 6] = (cur >> 16) as u8; | |
427 | dst[off + x*4 + 7] = 0; | |
428 | }, | |
429 | 1 | 3 => { | |
430 | let dy0 = index.get_diff24(&self.delta_tables.ydt, &self.delta_tables.fat_ydt)?; | |
431 | hor_pred = hor_pred.wrapping_add(dy0); | |
432 | let cur = hor_pred.wrapping_add(self.vert_pred[x + 0]); | |
433 | self.vert_pred[x + 0] = cur; | |
434 | dst[off + x*4 + 0] = cur as u8; | |
435 | dst[off + x*4 + 1] = (cur >> 8) as u8; | |
436 | dst[off + x*4 + 2] = (cur >> 16) as u8; | |
437 | dst[off + x*4 + 3] = 0; | |
438 | let dy1 = index.get_diff24(&self.delta_tables.ydt, &self.delta_tables.fat_ydt)?; | |
439 | hor_pred = hor_pred.wrapping_add(dy1); | |
440 | let cur = hor_pred.wrapping_add(self.vert_pred[x + 1]); | |
441 | self.vert_pred[x + 1] = cur; | |
442 | dst[off + x*4 + 4] = cur as u8; | |
443 | dst[off + x*4 + 5] = (cur >> 8) as u8; | |
444 | dst[off + x*4 + 6] = (cur >> 16) as u8; | |
445 | dst[off + x*4 + 7] = 0; | |
446 | }, | |
447 | 2 => { | |
448 | if self.blk_h == 2 { | |
449 | let dc0 = index.get_diff24(&self.delta_tables.cdt, &self.delta_tables.fat_cdt)?; | |
450 | let dy0 = index.get_diff24(&self.delta_tables.ydt, &self.delta_tables.fat_ydt)?; | |
451 | hor_pred = hor_pred.wrapping_add(dc0); | |
452 | hor_pred = hor_pred.wrapping_add(dy0); | |
453 | let cur = hor_pred.wrapping_add(self.vert_pred[x + 0]); | |
454 | self.vert_pred[x + 0] = cur; | |
455 | dst[off + x*4 + 0] = cur as u8; | |
456 | dst[off + x*4 + 1] = (cur >> 8) as u8; | |
457 | dst[off + x*4 + 2] = (cur >> 16) as u8; | |
458 | dst[off + x*4 + 3] = 0; | |
459 | if self.blk_w == 2 { | |
460 | let dc1 = index.get_diff24(&self.delta_tables.cdt, &self.delta_tables.fat_cdt)?; | |
461 | hor_pred = hor_pred.wrapping_add(dc1); | |
462 | } | |
463 | let dy1 = index.get_diff24(&self.delta_tables.ydt, &self.delta_tables.fat_ydt)?; | |
464 | hor_pred = hor_pred.wrapping_add(dy1); | |
465 | let cur = hor_pred.wrapping_add(self.vert_pred[x + 1]); | |
466 | self.vert_pred[x + 1] = cur; | |
467 | dst[off + x*4 + 4] = cur as u8; | |
468 | dst[off + x*4 + 5] = (cur >> 8) as u8; | |
469 | dst[off + x*4 + 6] = (cur >> 16) as u8; | |
470 | dst[off + x*4 + 7] = 0; | |
471 | } else { | |
472 | let dy0 = index.get_diff24(&self.delta_tables.ydt, &self.delta_tables.fat_ydt)?; | |
473 | hor_pred = hor_pred.wrapping_add(dy0); | |
474 | let cur = hor_pred.wrapping_add(self.vert_pred[x + 0]); | |
475 | self.vert_pred[x + 0] = cur; | |
476 | dst[off + x*4 + 0] = cur as u8; | |
477 | dst[off + x*4 + 1] = (cur >> 8) as u8; | |
478 | dst[off + x*4 + 2] = (cur >> 16) as u8; | |
479 | dst[off + x*4 + 3] = 0; | |
480 | let dy1 = index.get_diff24(&self.delta_tables.ydt, &self.delta_tables.fat_ydt)?; | |
481 | hor_pred = hor_pred.wrapping_add(dy1); | |
482 | let cur = hor_pred.wrapping_add(self.vert_pred[x + 1]); | |
483 | self.vert_pred[x + 1] = cur; | |
484 | dst[off + x*4 + 4] = cur as u8; | |
485 | dst[off + x*4 + 5] = (cur >> 8) as u8; | |
486 | dst[off + x*4 + 6] = (cur >> 16) as u8; | |
487 | dst[off + x*4 + 7] = 0; | |
488 | } | |
489 | }, | |
490 | _ => unreachable!(), | |
491 | }; | |
492 | } else { | |
8a7352c0 KS |
493 | let cur = u32::from(dst[off + x*4 + 0]) |
494 | | (u32::from(dst[off + x*4 + 1]) << 8) | |
495 | | (u32::from(dst[off + x*4 + 2]) << 16) | |
496 | | (u32::from(dst[off + x*4 + 3]) << 24); | |
2d90e8b6 | 497 | self.vert_pred[x + 0] = cur; |
8a7352c0 KS |
498 | let cur = u32::from(dst[off + x*4 + 4]) |
499 | | (u32::from(dst[off + x*4 + 5]) << 8) | |
500 | | (u32::from(dst[off + x*4 + 6]) << 16) | |
501 | | (u32::from(dst[off + x*4 + 7]) << 24); | |
2d90e8b6 KS |
502 | hor_pred = cur.wrapping_sub(self.vert_pred[x + 1]); |
503 | self.vert_pred[x + 1] = cur; | |
504 | } | |
505 | } | |
506 | if (y & 3) != 3 { | |
507 | mask.reset_row(); | |
508 | } else { | |
509 | mask.next_row(); | |
510 | } | |
511 | off += stride; | |
512 | } | |
513 | Ok(()) | |
514 | } | |
515 | } | |
516 | ||
517 | impl NADecoder for TM1Decoder { | |
01613464 | 518 | fn init(&mut self, _supp: &mut NADecoderSupport, info: NACodecInfoRef) -> DecoderResult<()> { |
2d90e8b6 KS |
519 | if let NACodecTypeInfo::Video(vinfo) = info.get_properties() { |
520 | let myinfo = NACodecTypeInfo::Video(NAVideoInfo::new(vinfo.get_width(), vinfo.get_height(), false, YUV410_FORMAT)); | |
2422d969 | 521 | self.info = NACodecInfo::new_ref(info.get_name(), myinfo, info.get_extradata()).into_ref(); |
2d90e8b6 KS |
522 | Ok(()) |
523 | } else { | |
524 | Err(DecoderError::InvalidData) | |
525 | } | |
526 | } | |
01613464 | 527 | fn decode(&mut self, _supp: &mut NADecoderSupport, pkt: &NAPacket) -> DecoderResult<NAFrameRef> { |
2d90e8b6 KS |
528 | let src = pkt.get_buffer(); |
529 | validate!(src.len() > 10); | |
530 | let hdr_size = (src[0].rotate_left(3) & 0x7F) as usize; | |
531 | validate!(hdr_size >= 12 && hdr_size < src.len()); | |
532 | let mut hdr: [u8; 127] = [0; 127]; | |
533 | for i in 1..hdr_size { | |
534 | hdr[i - 1] = src[i] ^ src[i + 1]; | |
535 | } | |
536 | let mut mr = MemoryReader::new_read(&hdr[0..hdr_size-1]); | |
537 | let mut br = ByteReader::new(&mut mr); | |
538 | ||
539 | let tm1type = br.read_byte()? as usize; | |
540 | let delta_set = br.read_byte()? as usize; | |
541 | let table_idx = br.read_byte()? as usize; | |
542 | let height = br.read_u16le()? as usize; | |
543 | let width = br.read_u16le()? as usize; | |
544 | let _frameno = br.read_u16le()? as usize; | |
545 | let version = br.read_byte()?; | |
546 | let meta_type = br.read_byte()?; | |
547 | validate!(width > 0 && height > 0); | |
548 | let is_intra; | |
549 | let mut is_sprite = false; | |
550 | let mut spr_xoff = 0; | |
551 | let mut spr_yoff = 0; | |
552 | let mut spr_width = 0; | |
553 | let mut spr_height = 0; | |
554 | if version >= 2 { | |
555 | validate!(meta_type <= 3); | |
556 | if meta_type >= 2 { | |
557 | let frameinfo = br.read_byte()?; | |
558 | let _control = br.read_byte()?; | |
559 | ||
560 | is_intra = ((frameinfo & 0x10) != 0) || ((frameinfo & 0x08) == 0); | |
561 | } else { | |
562 | is_intra = true; | |
563 | } | |
564 | if meta_type == 3 { | |
565 | spr_xoff = br.read_u16le()? as usize; | |
566 | spr_yoff = br.read_u16le()? as usize; | |
567 | spr_width = br.read_u16le()? as usize; | |
568 | spr_height = br.read_u16le()? as usize; | |
569 | is_sprite = true; | |
570 | } | |
571 | } else { | |
572 | is_intra = true; | |
573 | } | |
574 | validate!(tm1type < TM1_COMPR_TYPES.len()); | |
575 | let cinfo = TM1_COMPR_TYPES[tm1type]; | |
576 | if cinfo.is_none() { | |
577 | //check for missing ref | |
578 | let mut frm = NAFrame::new_from_pkt(pkt, self.info.clone(), NABufferType::None); | |
579 | frm.set_keyframe(false); | |
580 | frm.set_frame_type(FrameType::Skip); | |
171860fc | 581 | return Ok(frm.into_ref()); |
2d90e8b6 KS |
582 | } |
583 | let compr_info = cinfo.unwrap(); | |
584 | let is_24bit = !is_sprite && compr_info.is_24bit; | |
585 | ||
586 | let vec_idx = if ((tm1type & 1) != 0) && (meta_type > 0) { 1 } else { table_idx }; | |
587 | validate!((delta_set < DUCK_Y_DELTAS.len()) && (vec_idx > 0) && (vec_idx <= DUCK_VECTABLES.len())); | |
588 | self.set_delta_tables(delta_set, vec_idx, is_24bit); | |
589 | ||
590 | let out_width = if is_24bit { width >> 1 } else { width }; | |
591 | let mask_row_size = if is_sprite { | |
592 | ((spr_width >> 2) + 3) >> 2 | |
593 | } else if is_intra { | |
594 | 0 | |
595 | } else { | |
596 | ((width >> 2) + 7) >> 3 | |
597 | }; | |
598 | let mask_size = mask_row_size * (if is_sprite { spr_height >> 2 } else { height >> 2 }); | |
599 | let mask_bits = &src[hdr_size..][..mask_size]; | |
600 | let index_bytes = &src[hdr_size+mask_size..]; | |
601 | validate!(src.len() >= hdr_size + mask_size); | |
602 | self.vert_pred.truncate(0); | |
603 | self.vert_pred.resize(out_width, 0); | |
604 | ||
605 | if is_intra || is_sprite { | |
606 | let fmt = if is_24bit { BGR0_FORMAT } else { RGB555_FORMAT }; | |
607 | let myinfo = NAVideoInfo::new(out_width, height, false, fmt); | |
8a7352c0 | 608 | let bufinfo = alloc_video_buffer(myinfo, 2)?; |
2d90e8b6 KS |
609 | self.lastframe.reset(); |
610 | if !is_24bit { | |
611 | self.lastframe.set16(bufinfo.get_vbuf16().unwrap()); | |
612 | } else { | |
613 | self.lastframe.set24(bufinfo.get_vbuf().unwrap()); | |
614 | } | |
615 | } | |
616 | ||
617 | self.blk_w = compr_info.block_w; | |
618 | self.blk_h = compr_info.block_h; | |
619 | let mut mask = MaskState::new(is_intra && !is_sprite, &mask_bits, mask_row_size); | |
620 | let mut index = IndexState::new(&index_bytes); | |
621 | let bufinfo; | |
622 | if !is_24bit { | |
623 | if let Some(mut buf) = self.lastframe.get16() { | |
624 | let stride = buf.get_stride(0); | |
625 | { | |
1a967e6b | 626 | let data = buf.get_data_mut().unwrap(); |
2d90e8b6 KS |
627 | if !is_sprite { |
628 | self.decode_16bit(data.as_mut_slice(), stride, out_width, height, &mut mask, &mut index)?; | |
629 | } else { | |
630 | validate!(spr_xoff + spr_width <= out_width); | |
631 | validate!(spr_yoff + spr_height <= height); | |
632 | for el in data.iter_mut() { *el = 0; } | |
633 | let dst = &mut data[spr_xoff + spr_yoff * stride..]; | |
634 | self.decode_sprite(dst, stride, spr_width, spr_height, &mut mask, &mut index)?; | |
635 | } | |
636 | } | |
637 | bufinfo = NABufferType::Video16(buf); | |
638 | } else { | |
639 | return Err(DecoderError::MissingReference); | |
640 | } | |
8a7352c0 KS |
641 | } else if let Some(mut buf) = self.lastframe.get24() { |
642 | let stride = buf.get_stride(0); | |
643 | { | |
644 | let data = buf.get_data_mut().unwrap(); | |
645 | self.decode_24bit(data.as_mut_slice(), stride, out_width, height, &mut mask, &mut index)?; | |
2d90e8b6 | 646 | } |
8a7352c0 KS |
647 | bufinfo = NABufferType::VideoPacked(buf); |
648 | } else { | |
649 | return Err(DecoderError::MissingReference); | |
2d90e8b6 KS |
650 | } |
651 | ||
652 | let mut frm = NAFrame::new_from_pkt(pkt, self.info.clone(), bufinfo); | |
653 | frm.set_keyframe(is_intra || is_sprite); | |
654 | frm.set_frame_type(if is_intra { FrameType::I } else { FrameType::P }); | |
171860fc | 655 | Ok(frm.into_ref()) |
2d90e8b6 | 656 | } |
f9be4e75 KS |
657 | fn flush(&mut self) { |
658 | self.lastframe.reset(); | |
659 | } | |
2d90e8b6 | 660 | } |
1b8522d6 | 661 | |
6011e201 | 662 | pub fn get_decoder() -> Box<dyn NADecoder> { |
2d90e8b6 | 663 | Box::new(TM1Decoder::new()) |
1b8522d6 KS |
664 | } |
665 | ||
2d90e8b6 KS |
666 | #[cfg(test)] |
667 | mod test { | |
668 | use nihav_core::codecs::RegisteredDecoders; | |
669 | use nihav_core::demuxers::RegisteredDemuxers; | |
670 | use nihav_core::test::dec_video::*; | |
671 | use crate::codecs::duck_register_all_codecs; | |
672 | use nihav_commonfmt::demuxers::generic_register_all_demuxers; | |
673 | #[test] | |
674 | fn test_tm1() { | |
675 | let mut dmx_reg = RegisteredDemuxers::new(); | |
676 | generic_register_all_demuxers(&mut dmx_reg); | |
677 | let mut dec_reg = RegisteredDecoders::new(); | |
678 | duck_register_all_codecs(&mut dec_reg); | |
679 | ||
680 | //let file = "assets/Duck/AVI-DUCK-dk3.duk"; | |
681 | let file = "assets/Duck/phant2-940.duk"; | |
682 | //let file = "assets/Duck/bugsampler-m01-16bit.avi"; | |
683 | //let file = "assets/Duck/sonic3dblast_intro.avi"; | |
684 | //let file = "assets/Duck/BUTTONS.AVI"; | |
685 | //let file = "assets/Duck/SPRITES.AVI"; | |
686 | //let file = "assets/Duck/TRICORD.AVI"; | |
687 | test_file_decoding("avi", file, Some(42), true, false, None/*Some("tm1-")*/, &dmx_reg, &dec_reg); | |
688 | } | |
689 | } | |
690 | ||
691 | #[derive(Clone,Copy)] | |
692 | struct TM1ComprInfo { | |
693 | is_24bit: bool, | |
694 | block_w: usize, | |
695 | block_h: usize, | |
696 | } | |
697 | ||
698 | const TM1_COMPR_TYPES: [Option<TM1ComprInfo>; 17] = [ | |
699 | None, | |
700 | Some(TM1ComprInfo { is_24bit: false, block_w: 4, block_h: 4 }), | |
701 | Some(TM1ComprInfo { is_24bit: false, block_w: 4, block_h: 4 }), | |
702 | Some(TM1ComprInfo { is_24bit: false, block_w: 4, block_h: 2 }), | |
703 | Some(TM1ComprInfo { is_24bit: false, block_w: 4, block_h: 2 }), | |
704 | Some(TM1ComprInfo { is_24bit: false, block_w: 2, block_h: 4 }), | |
705 | Some(TM1ComprInfo { is_24bit: false, block_w: 2, block_h: 4 }), | |
706 | Some(TM1ComprInfo { is_24bit: false, block_w: 2, block_h: 2 }), | |
707 | Some(TM1ComprInfo { is_24bit: false, block_w: 2, block_h: 2 }), | |
708 | None, | |
709 | Some(TM1ComprInfo { is_24bit: true, block_w: 4, block_h: 4 }), | |
710 | None, | |
711 | Some(TM1ComprInfo { is_24bit: true, block_w: 4, block_h: 2 }), | |
712 | None, | |
713 | Some(TM1ComprInfo { is_24bit: true, block_w: 2, block_h: 4 }), | |
714 | None, | |
715 | Some(TM1ComprInfo { is_24bit: true, block_w: 2, block_h: 2 }), | |
716 | ]; | |
717 | ||
718 | const DUCK_Y_DELTAS: [[i32; 8]; 4] = [ | |
719 | [ 0, -1, 1, -3, 3, -6, 6, -6 ], | |
720 | [ 0, -1, 2, -3, 4, -6, 6, -6 ], | |
721 | [ 2, -3, 10, -10, 23, -23, 47, -47 ], | |
722 | [ 0, -2, 2, -8, 8, -18, 18, -40 ] | |
723 | ]; | |
724 | const DUCK_Y_FAT_DELTA3: [i32; 8] = [ 0, -15, 50, -50, 115, -115, 235, -235 ]; | |
725 | const DUCK_Y_FAT_DELTA4: [i32; 8] = [ 0, 40, 80, -76, 160, -154, 236, -236 ]; | |
726 | const DUCK_Y_FAT_DELTAS: [&[i32]; 4] = [ | |
727 | &DUCK_Y_FAT_DELTA3, &DUCK_Y_FAT_DELTA3, &DUCK_Y_FAT_DELTA3, &DUCK_Y_FAT_DELTA4 | |
728 | ]; | |
729 | ||
730 | const DUCK_C_DELTAS: [[i32; 8]; 4] = [ | |
731 | [ 0, -1, 1, -2, 3, -4, 5, -4 ], | |
732 | [ 0, -1, 1, -2, 3, -4, 5, -4 ], | |
733 | [ 0, -4, 3, -16, 20, -32, 36, -32 ], | |
734 | [ 0, -2, 2, -8, 8, -18, 18, -40 ] | |
735 | ]; | |
736 | const DUCK_C_FAT_DELTA3: [i32; 8] = [ 0, -20, 15, -80, 100, -160, 180, -160 ]; | |
737 | const DUCK_C_FAT_DELTAS: [&[i32]; 4] = [ | |
738 | &DUCK_C_FAT_DELTA3, &DUCK_C_FAT_DELTA3, &DUCK_C_FAT_DELTA3, &DUCK_Y_FAT_DELTA4 | |
739 | ]; | |
740 | ||
741 | const DUCK_VECTBL2: &[u8] = &[ | |
742 | 0x8,0x00,0x00,0x00,0x00, | |
743 | 0x8,0x00,0x00,0x00,0x00, | |
744 | 0x8,0x10,0x00,0x00,0x00, | |
745 | 0x8,0x01,0x00,0x00,0x00, | |
746 | 0x8,0x00,0x10,0x00,0x00, | |
747 | 0x8,0x00,0x01,0x00,0x00, | |
748 | 0x8,0x00,0x00,0x10,0x00, | |
749 | 0x8,0x00,0x00,0x01,0x00, | |
750 | 0x8,0x00,0x00,0x00,0x10, | |
751 | 0x8,0x00,0x00,0x00,0x01, | |
752 | 0x6,0x00,0x00,0x00, | |
753 | 0x6,0x10,0x00,0x00, | |
754 | 0x6,0x01,0x00,0x00, | |
755 | 0x6,0x00,0x10,0x00, | |
756 | 0x6,0x00,0x01,0x00, | |
757 | 0x6,0x00,0x00,0x01, | |
758 | 0x6,0x00,0x00,0x10, | |
759 | 0x6,0x00,0x00,0x02, | |
760 | 0x6,0x00,0x00,0x20, | |
761 | 0x6,0x20,0x10,0x00, | |
762 | 0x6,0x00,0x02,0x01, | |
763 | 0x6,0x00,0x20,0x10, | |
764 | 0x6,0x02,0x01,0x00, | |
765 | 0x6,0x11,0x00,0x00, | |
766 | 0x6,0x00,0x20,0x00, | |
767 | 0x6,0x00,0x02,0x00, | |
768 | 0x6,0x20,0x00,0x00, | |
769 | 0x6,0x01,0x10,0x00, | |
770 | 0x6,0x02,0x00,0x00, | |
771 | 0x6,0x01,0x00,0x02, | |
772 | 0x6,0x10,0x00,0x20, | |
773 | 0x6,0x00,0x01,0x02, | |
774 | 0x6,0x10,0x01,0x00, | |
775 | 0x6,0x00,0x10,0x20, | |
776 | 0x6,0x10,0x10,0x00, | |
777 | 0x6,0x10,0x00,0x01, | |
778 | 0x6,0x20,0x00,0x10, | |
779 | 0x6,0x02,0x00,0x01, | |
780 | 0x6,0x01,0x01,0x00, | |
781 | 0x6,0x01,0x00,0x10, | |
782 | 0x6,0x00,0x11,0x00, | |
783 | 0x6,0x10,0x00,0x02, | |
784 | 0x6,0x00,0x01,0x10, | |
785 | 0x6,0x00,0x00,0x11, | |
786 | 0x6,0x10,0x00,0x10, | |
787 | 0x6,0x01,0x00,0x01, | |
788 | 0x6,0x00,0x00,0x22, | |
789 | 0x6,0x02,0x01,0x01, | |
790 | 0x6,0x10,0x20,0x10, | |
791 | 0x6,0x01,0x02,0x01, | |
792 | 0x6,0x20,0x10,0x10, | |
793 | 0x6,0x01,0x00,0x20, | |
794 | 0x6,0x00,0x10,0x01, | |
795 | 0x6,0x21,0x10,0x00, | |
796 | 0x6,0x10,0x02,0x01, | |
797 | 0x6,0x12,0x01,0x00, | |
798 | 0x6,0x01,0x20,0x10, | |
799 | 0x6,0x01,0x02,0x00, | |
800 | 0x6,0x10,0x20,0x00, | |
801 | 0x6,0x00,0x10,0x02, | |
802 | 0x6,0x00,0x01,0x20, | |
803 | 0x6,0x00,0x02,0x21, | |
804 | 0x6,0x00,0x02,0x20, | |
805 | 0x6,0x00,0x00,0x12, | |
806 | 0x6,0x00,0x00,0x21, | |
807 | 0x6,0x20,0x11,0x00, | |
808 | 0x6,0x00,0x01,0x01, | |
809 | 0x6,0x11,0x10,0x00, | |
810 | 0x6,0x00,0x20,0x12, | |
811 | 0x6,0x00,0x20,0x11, | |
812 | 0x6,0x20,0x10,0x02, | |
813 | 0x6,0x02,0x01,0x20, | |
814 | 0x6,0x00,0x22,0x11, | |
815 | 0x6,0x00,0x10,0x10, | |
816 | 0x6,0x02,0x11,0x00, | |
817 | 0x6,0x00,0x21,0x10, | |
818 | 0x6,0x00,0x02,0x03, | |
819 | 0x6,0x20,0x10,0x01, | |
820 | 0x6,0x00,0x12,0x01, | |
821 | 0x4,0x11,0x00, | |
822 | 0x4,0x00,0x22, | |
823 | 0x4,0x20,0x00, | |
824 | 0x4,0x01,0x10, | |
825 | 0x4,0x02,0x20, | |
826 | 0x4,0x00,0x20, | |
827 | 0x4,0x02,0x00, | |
828 | 0x4,0x10,0x01, | |
829 | 0x4,0x00,0x11, | |
830 | 0x4,0x02,0x01, | |
831 | 0x4,0x02,0x21, | |
832 | 0x4,0x00,0x02, | |
833 | 0x4,0x20,0x02, | |
834 | 0x4,0x01,0x01, | |
835 | 0x4,0x10,0x10, | |
836 | 0x4,0x10,0x02, | |
837 | 0x4,0x22,0x00, | |
838 | 0x4,0x10,0x00, | |
839 | 0x4,0x01,0x00, | |
840 | 0x4,0x21,0x00, | |
841 | 0x4,0x12,0x00, | |
842 | 0x4,0x00,0x10, | |
843 | 0x4,0x20,0x12, | |
844 | 0x4,0x01,0x11, | |
845 | 0x4,0x00,0x01, | |
846 | 0x4,0x01,0x02, | |
847 | 0x4,0x11,0x02, | |
848 | 0x4,0x11,0x01, | |
849 | 0x4,0x10,0x20, | |
850 | 0x4,0x20,0x01, | |
851 | 0x4,0x22,0x11, | |
852 | 0x4,0x00,0x12, | |
853 | 0x4,0x20,0x10, | |
854 | 0x4,0x22,0x01, | |
855 | 0x4,0x01,0x20, | |
856 | 0x4,0x00,0x21, | |
857 | 0x4,0x10,0x11, | |
858 | 0x4,0x21,0x10, | |
859 | 0x4,0x10,0x22, | |
860 | 0x4,0x02,0x03, | |
861 | 0x4,0x12,0x01, | |
862 | 0x4,0x20,0x11, | |
863 | 0x4,0x11,0x10, | |
864 | 0x4,0x20,0x30, | |
865 | 0x4,0x11,0x20, | |
866 | 0x4,0x02,0x10, | |
867 | 0x4,0x22,0x10, | |
868 | 0x4,0x11,0x11, | |
869 | 0x4,0x30,0x20, | |
870 | 0x4,0x30,0x00, | |
871 | 0x4,0x01,0x22, | |
872 | 0x4,0x01,0x12, | |
873 | 0x4,0x02,0x11, | |
874 | 0x4,0x03,0x02, | |
875 | 0x4,0x03,0x00, | |
876 | 0x4,0x10,0x21, | |
877 | 0x4,0x12,0x20, | |
878 | 0x4,0x00,0x00, | |
879 | 0x4,0x12,0x21, | |
880 | 0x4,0x21,0x11, | |
881 | 0x4,0x02,0x22, | |
882 | 0x4,0x10,0x12, | |
883 | 0x4,0x31,0x00, | |
884 | 0x4,0x20,0x20, | |
885 | 0x4,0x00,0x03, | |
886 | 0x4,0x02,0x02, | |
887 | 0x4,0x22,0x20, | |
888 | 0x4,0x01,0x21, | |
889 | 0x4,0x21,0x02, | |
890 | 0x4,0x21,0x12, | |
891 | 0x4,0x11,0x22, | |
892 | 0x4,0x00,0x30, | |
893 | 0x4,0x12,0x11, | |
894 | 0x4,0x20,0x22, | |
895 | 0x4,0x31,0x20, | |
896 | 0x4,0x21,0x30, | |
897 | 0x4,0x22,0x02, | |
898 | 0x4,0x22,0x22, | |
899 | 0x4,0x20,0x31, | |
900 | 0x4,0x13,0x02, | |
901 | 0x4,0x03,0x10, | |
902 | 0x4,0x11,0x12, | |
903 | 0x4,0x00,0x13, | |
904 | 0x4,0x21,0x01, | |
905 | 0x4,0x12,0x03, | |
906 | 0x4,0x13,0x00, | |
907 | 0x4,0x13,0x10, | |
908 | 0x4,0x02,0x13, | |
909 | 0x4,0x30,0x01, | |
910 | 0x4,0x12,0x10, | |
911 | 0x4,0x22,0x13, | |
912 | 0x4,0x03,0x12, | |
913 | 0x4,0x31,0x01, | |
914 | 0x4,0x30,0x22, | |
915 | 0x4,0x00,0x31, | |
916 | 0x4,0x01,0x31, | |
917 | 0x4,0x02,0x23, | |
918 | 0x4,0x01,0x30, | |
919 | 0x4,0x11,0x21, | |
920 | 0x4,0x22,0x21, | |
921 | 0x4,0x01,0x13, | |
922 | 0x4,0x10,0x03, | |
923 | 0x4,0x22,0x03, | |
924 | 0x4,0x30,0x21, | |
925 | 0x4,0x21,0x31, | |
926 | 0x4,0x33,0x00, | |
927 | 0x4,0x13,0x12, | |
928 | 0x4,0x11,0x31, | |
929 | 0x4,0x30,0x02, | |
930 | 0x4,0x12,0x02, | |
931 | 0x4,0x11,0x13, | |
932 | 0x4,0x12,0x22, | |
933 | 0x4,0x20,0x32, | |
934 | 0x4,0x10,0x13, | |
935 | 0x4,0x22,0x31, | |
936 | 0x4,0x21,0x20, | |
937 | 0x4,0x01,0x33, | |
938 | 0x4,0x33,0x10, | |
939 | 0x4,0x20,0x13, | |
940 | 0x4,0x31,0x22, | |
941 | 0x4,0x13,0x30, | |
942 | 0x4,0x01,0x03, | |
943 | 0x4,0x11,0x33, | |
944 | 0x4,0x20,0x21, | |
945 | 0x4,0x13,0x31, | |
946 | 0x4,0x03,0x22, | |
947 | 0x4,0x31,0x02, | |
948 | 0x4,0x00,0x24, | |
949 | 0x2,0x00, | |
950 | 0x2,0x10, | |
951 | 0x2,0x20, | |
952 | 0x2,0x30, | |
953 | 0x2,0x40, | |
954 | 0x2,0x50, | |
955 | 0x2,0x60, | |
956 | 0x2,0x01, | |
957 | 0x2,0x11, | |
958 | 0x2,0x21, | |
959 | 0x2,0x31, | |
960 | 0x2,0x41, | |
961 | 0x2,0x51, | |
962 | 0x2,0x61, | |
963 | 0x2,0x02, | |
964 | 0x2,0x12, | |
965 | 0x2,0x22, | |
966 | 0x2,0x32, | |
967 | 0x2,0x42, | |
968 | 0x2,0x52, | |
969 | 0x2,0x62, | |
970 | 0x2,0x03, | |
971 | 0x2,0x13, | |
972 | 0x2,0x23, | |
973 | 0x2,0x33, | |
974 | 0x2,0x43, | |
975 | 0x2,0x53, | |
976 | 0x2,0x63, | |
977 | 0x2,0x04, | |
978 | 0x2,0x14, | |
979 | 0x2,0x24, | |
980 | 0x2,0x34, | |
981 | 0x2,0x44, | |
982 | 0x2,0x54, | |
983 | 0x2,0x64, | |
984 | 0x2,0x05, | |
985 | 0x2,0x15, | |
986 | 0x2,0x25, | |
987 | 0x2,0x35, | |
988 | 0x2,0x45, | |
989 | 0x2,0x55, | |
990 | 0x2,0x65, | |
991 | 0x2,0x06, | |
992 | 0x2,0x16, | |
993 | 0x2,0x26, | |
994 | 0x2,0x36, | |
995 | 0x2,0x46, | |
996 | 0x2,0x56, | |
997 | 0x2,0x66 | |
998 | ]; | |
999 | ||
1000 | const DUCK_VECTBL3: &[u8] = &[ | |
1001 | 0x6,0x00,0x00,0x00, | |
1002 | 0x6,0x00,0x00,0x00, | |
1003 | 0x6,0x00,0x00,0x01, | |
1004 | 0x6,0x00,0x00,0x10, | |
1005 | 0x6,0x00,0x00,0x11, | |
1006 | 0x6,0x00,0x01,0x00, | |
1007 | 0x6,0x00,0x01,0x01, | |
1008 | 0x6,0x00,0x01,0x10, | |
1009 | 0x6,0x00,0x01,0x11, | |
1010 | 0x6,0x00,0x10,0x00, | |
1011 | 0x6,0x00,0x10,0x01, | |
1012 | 0x6,0x00,0x10,0x10, | |
1013 | 0x6,0x00,0x10,0x11, | |
1014 | 0x6,0x00,0x11,0x00, | |
1015 | 0x6,0x00,0x11,0x01, | |
1016 | 0x6,0x00,0x11,0x10, | |
1017 | 0x6,0x00,0x11,0x11, | |
1018 | 0x6,0x01,0x00,0x00, | |
1019 | 0x6,0x01,0x00,0x01, | |
1020 | 0x6,0x01,0x00,0x10, | |
1021 | 0x6,0x01,0x00,0x11, | |
1022 | 0x6,0x01,0x01,0x00, | |
1023 | 0x6,0x01,0x01,0x01, | |
1024 | 0x6,0x01,0x01,0x10, | |
1025 | 0x6,0x01,0x01,0x11, | |
1026 | 0x6,0x01,0x10,0x00, | |
1027 | 0x6,0x01,0x10,0x01, | |
1028 | 0x6,0x01,0x10,0x10, | |
1029 | 0x6,0x01,0x10,0x11, | |
1030 | 0x6,0x01,0x11,0x00, | |
1031 | 0x6,0x01,0x11,0x01, | |
1032 | 0x6,0x01,0x11,0x10, | |
1033 | 0x6,0x01,0x11,0x11, | |
1034 | 0x6,0x10,0x00,0x00, | |
1035 | 0x6,0x10,0x00,0x01, | |
1036 | 0x6,0x10,0x00,0x10, | |
1037 | 0x6,0x10,0x00,0x11, | |
1038 | 0x6,0x10,0x01,0x00, | |
1039 | 0x6,0x10,0x01,0x01, | |
1040 | 0x6,0x10,0x01,0x10, | |
1041 | 0x6,0x10,0x01,0x11, | |
1042 | 0x6,0x10,0x10,0x00, | |
1043 | 0x6,0x10,0x10,0x01, | |
1044 | 0x6,0x10,0x10,0x10, | |
1045 | 0x6,0x10,0x10,0x11, | |
1046 | 0x6,0x10,0x11,0x00, | |
1047 | 0x6,0x10,0x11,0x01, | |
1048 | 0x6,0x10,0x11,0x10, | |
1049 | 0x6,0x10,0x11,0x11, | |
1050 | 0x6,0x11,0x00,0x00, | |
1051 | 0x6,0x11,0x00,0x01, | |
1052 | 0x6,0x11,0x00,0x10, | |
1053 | 0x6,0x11,0x00,0x11, | |
1054 | 0x6,0x11,0x01,0x00, | |
1055 | 0x6,0x11,0x01,0x01, | |
1056 | 0x6,0x11,0x01,0x10, | |
1057 | 0x6,0x11,0x01,0x11, | |
1058 | 0x6,0x11,0x10,0x00, | |
1059 | 0x6,0x11,0x10,0x01, | |
1060 | 0x6,0x11,0x10,0x10, | |
1061 | 0x6,0x11,0x10,0x11, | |
1062 | 0x6,0x11,0x11,0x00, | |
1063 | 0x6,0x11,0x11,0x01, | |
1064 | 0x6,0x11,0x11,0x10, | |
1065 | 0x4,0x00,0x00, | |
1066 | 0x4,0x00,0x01, | |
1067 | 0x4,0x00,0x02, | |
1068 | 0x4,0x00,0x03, | |
1069 | 0x4,0x00,0x10, | |
1070 | 0x4,0x00,0x11, | |
1071 | 0x4,0x00,0x12, | |
1072 | 0x4,0x00,0x13, | |
1073 | 0x4,0x00,0x20, | |
1074 | 0x4,0x00,0x21, | |
1075 | 0x4,0x00,0x22, | |
1076 | 0x4,0x00,0x23, | |
1077 | 0x4,0x00,0x30, | |
1078 | 0x4,0x00,0x31, | |
1079 | 0x4,0x00,0x32, | |
1080 | 0x4,0x00,0x33, | |
1081 | 0x4,0x01,0x00, | |
1082 | 0x4,0x01,0x01, | |
1083 | 0x4,0x01,0x02, | |
1084 | 0x4,0x01,0x03, | |
1085 | 0x4,0x01,0x10, | |
1086 | 0x4,0x01,0x11, | |
1087 | 0x4,0x01,0x12, | |
1088 | 0x4,0x01,0x13, | |
1089 | 0x4,0x01,0x20, | |
1090 | 0x4,0x01,0x21, | |
1091 | 0x4,0x01,0x22, | |
1092 | 0x4,0x01,0x23, | |
1093 | 0x4,0x01,0x30, | |
1094 | 0x4,0x01,0x31, | |
1095 | 0x4,0x01,0x32, | |
1096 | 0x4,0x01,0x33, | |
1097 | 0x4,0x02,0x00, | |
1098 | 0x4,0x02,0x01, | |
1099 | 0x4,0x02,0x02, | |
1100 | 0x4,0x02,0x03, | |
1101 | 0x4,0x02,0x10, | |
1102 | 0x4,0x02,0x11, | |
1103 | 0x4,0x02,0x12, | |
1104 | 0x4,0x02,0x13, | |
1105 | 0x4,0x02,0x20, | |
1106 | 0x4,0x02,0x21, | |
1107 | 0x4,0x02,0x22, | |
1108 | 0x4,0x02,0x23, | |
1109 | 0x4,0x02,0x30, | |
1110 | 0x4,0x02,0x31, | |
1111 | 0x4,0x02,0x32, | |
1112 | 0x4,0x02,0x33, | |
1113 | 0x4,0x03,0x00, | |
1114 | 0x4,0x03,0x01, | |
1115 | 0x4,0x03,0x02, | |
1116 | 0x4,0x03,0x03, | |
1117 | 0x4,0x03,0x10, | |
1118 | 0x4,0x03,0x11, | |
1119 | 0x4,0x03,0x12, | |
1120 | 0x4,0x03,0x13, | |
1121 | 0x4,0x03,0x20, | |
1122 | 0x4,0x03,0x21, | |
1123 | 0x4,0x03,0x22, | |
1124 | 0x4,0x03,0x23, | |
1125 | 0x4,0x03,0x30, | |
1126 | 0x4,0x03,0x31, | |
1127 | 0x4,0x03,0x32, | |
1128 | 0x4,0x03,0x33, | |
1129 | 0x4,0x10,0x00, | |
1130 | 0x4,0x10,0x01, | |
1131 | 0x4,0x10,0x02, | |
1132 | 0x4,0x10,0x03, | |
1133 | 0x4,0x10,0x10, | |
1134 | 0x4,0x10,0x11, | |
1135 | 0x4,0x10,0x12, | |
1136 | 0x4,0x10,0x13, | |
1137 | 0x4,0x10,0x20, | |
1138 | 0x4,0x10,0x21, | |
1139 | 0x4,0x10,0x22, | |
1140 | 0x4,0x10,0x23, | |
1141 | 0x4,0x10,0x30, | |
1142 | 0x4,0x10,0x31, | |
1143 | 0x4,0x10,0x32, | |
1144 | 0x4,0x10,0x33, | |
1145 | 0x4,0x11,0x00, | |
1146 | 0x4,0x11,0x01, | |
1147 | 0x4,0x11,0x02, | |
1148 | 0x4,0x11,0x03, | |
1149 | 0x4,0x11,0x10, | |
1150 | 0x4,0x11,0x11, | |
1151 | 0x4,0x11,0x12, | |
1152 | 0x4,0x11,0x13, | |
1153 | 0x4,0x11,0x20, | |
1154 | 0x4,0x11,0x21, | |
1155 | 0x4,0x11,0x22, | |
1156 | 0x4,0x11,0x23, | |
1157 | 0x4,0x11,0x30, | |
1158 | 0x4,0x11,0x31, | |
1159 | 0x4,0x11,0x32, | |
1160 | 0x4,0x11,0x33, | |
1161 | 0x4,0x12,0x00, | |
1162 | 0x4,0x12,0x01, | |
1163 | 0x4,0x12,0x02, | |
1164 | 0x4,0x12,0x03, | |
1165 | 0x4,0x12,0x10, | |
1166 | 0x4,0x12,0x11, | |
1167 | 0x4,0x12,0x12, | |
1168 | 0x4,0x12,0x13, | |
1169 | 0x4,0x12,0x20, | |
1170 | 0x4,0x12,0x21, | |
1171 | 0x4,0x12,0x22, | |
1172 | 0x4,0x12,0x23, | |
1173 | 0x4,0x12,0x30, | |
1174 | 0x4,0x12,0x31, | |
1175 | 0x4,0x12,0x32, | |
1176 | 0x4,0x12,0x33, | |
1177 | 0x4,0x13,0x00, | |
1178 | 0x4,0x13,0x01, | |
1179 | 0x4,0x13,0x02, | |
1180 | 0x4,0x13,0x03, | |
1181 | 0x4,0x13,0x10, | |
1182 | 0x4,0x13,0x11, | |
1183 | 0x4,0x13,0x12, | |
1184 | 0x4,0x13,0x13, | |
1185 | 0x4,0x13,0x20, | |
1186 | 0x4,0x13,0x21, | |
1187 | 0x4,0x13,0x22, | |
1188 | 0x4,0x13,0x23, | |
1189 | 0x4,0x13,0x30, | |
1190 | 0x4,0x13,0x31, | |
1191 | 0x4,0x13,0x32, | |
1192 | 0x4,0x13,0x33, | |
1193 | 0x2,0x00, | |
1194 | 0x2,0x10, | |
1195 | 0x2,0x20, | |
1196 | 0x2,0x30, | |
1197 | 0x2,0x40, | |
1198 | 0x2,0x50, | |
1199 | 0x2,0x60, | |
1200 | 0x2,0x70, | |
1201 | 0x2,0x01, | |
1202 | 0x2,0x11, | |
1203 | 0x2,0x21, | |
1204 | 0x2,0x31, | |
1205 | 0x2,0x41, | |
1206 | 0x2,0x51, | |
1207 | 0x2,0x61, | |
1208 | 0x2,0x71, | |
1209 | 0x2,0x02, | |
1210 | 0x2,0x12, | |
1211 | 0x2,0x22, | |
1212 | 0x2,0x32, | |
1213 | 0x2,0x42, | |
1214 | 0x2,0x52, | |
1215 | 0x2,0x62, | |
1216 | 0x2,0x72, | |
1217 | 0x2,0x03, | |
1218 | 0x2,0x13, | |
1219 | 0x2,0x23, | |
1220 | 0x2,0x33, | |
1221 | 0x2,0x43, | |
1222 | 0x2,0x53, | |
1223 | 0x2,0x63, | |
1224 | 0x2,0x73, | |
1225 | 0x2,0x04, | |
1226 | 0x2,0x14, | |
1227 | 0x2,0x24, | |
1228 | 0x2,0x34, | |
1229 | 0x2,0x44, | |
1230 | 0x2,0x54, | |
1231 | 0x2,0x64, | |
1232 | 0x2,0x74, | |
1233 | 0x2,0x05, | |
1234 | 0x2,0x15, | |
1235 | 0x2,0x25, | |
1236 | 0x2,0x35, | |
1237 | 0x2,0x45, | |
1238 | 0x2,0x55, | |
1239 | 0x2,0x65, | |
1240 | 0x2,0x75, | |
1241 | 0x2,0x06, | |
1242 | 0x2,0x16, | |
1243 | 0x2,0x26, | |
1244 | 0x2,0x36, | |
1245 | 0x2,0x46, | |
1246 | 0x2,0x56, | |
1247 | 0x2,0x66, | |
1248 | 0x2,0x76, | |
1249 | 0x2,0x07, | |
1250 | 0x2,0x17, | |
1251 | 0x2,0x27, | |
1252 | 0x2,0x37, | |
1253 | 0x2,0x47, | |
1254 | 0x2,0x57, | |
1255 | 0x2,0x67, | |
1256 | 0x2,0x77 | |
1257 | ]; | |
1258 | ||
1259 | const DUCK_VECTBL4: &[u8] = &[ | |
1260 | 0x8,0x00,0x00,0x00,0x00, | |
1261 | 0x8,0x00,0x00,0x00,0x00, | |
1262 | 0x8,0x20,0x00,0x00,0x00, | |
1263 | 0x8,0x00,0x00,0x00,0x01, | |
1264 | 0x8,0x10,0x00,0x00,0x00, | |
1265 | 0x8,0x00,0x00,0x00,0x02, | |
1266 | 0x8,0x01,0x00,0x00,0x00, | |
1267 | 0x8,0x00,0x00,0x00,0x10, | |
1268 | 0x8,0x02,0x00,0x00,0x00, | |
1269 | 0x6,0x00,0x00,0x00, | |
1270 | 0x6,0x20,0x00,0x00, | |
1271 | 0x6,0x00,0x00,0x01, | |
1272 | 0x6,0x10,0x00,0x00, | |
1273 | 0x6,0x00,0x00,0x02, | |
1274 | 0x6,0x00,0x10,0x00, | |
1275 | 0x6,0x00,0x20,0x00, | |
1276 | 0x6,0x00,0x02,0x00, | |
1277 | 0x6,0x00,0x01,0x00, | |
1278 | 0x6,0x01,0x00,0x00, | |
1279 | 0x6,0x00,0x00,0x20, | |
1280 | 0x6,0x02,0x00,0x00, | |
1281 | 0x6,0x00,0x00,0x10, | |
1282 | 0x6,0x10,0x00,0x20, | |
1283 | 0x6,0x01,0x00,0x02, | |
1284 | 0x6,0x20,0x00,0x10, | |
1285 | 0x6,0x02,0x00,0x01, | |
1286 | 0x6,0x20,0x10,0x00, | |
1287 | 0x6,0x00,0x12,0x00, | |
1288 | 0x6,0x00,0x02,0x01, | |
1289 | 0x6,0x02,0x01,0x00, | |
1290 | 0x6,0x00,0x21,0x00, | |
1291 | 0x6,0x00,0x01,0x02, | |
1292 | 0x6,0x00,0x20,0x10, | |
1293 | 0x6,0x00,0x00,0x21, | |
1294 | 0x6,0x00,0x00,0x12, | |
1295 | 0x6,0x00,0x01,0x20, | |
1296 | 0x6,0x12,0x00,0x00, | |
1297 | 0x6,0x00,0x10,0x20, | |
1298 | 0x6,0x01,0x20,0x00, | |
1299 | 0x6,0x02,0x10,0x00, | |
1300 | 0x6,0x10,0x20,0x00, | |
1301 | 0x6,0x01,0x02,0x00, | |
1302 | 0x6,0x21,0x00,0x00, | |
1303 | 0x6,0x00,0x02,0x10, | |
1304 | 0x6,0x20,0x01,0x00, | |
1305 | 0x6,0x00,0x22,0x00, | |
1306 | 0x6,0x10,0x02,0x00, | |
1307 | 0x6,0x00,0x10,0x02, | |
1308 | 0x6,0x11,0x00,0x00, | |
1309 | 0x6,0x00,0x11,0x00, | |
1310 | 0x6,0x22,0x00,0x00, | |
1311 | 0x6,0x20,0x00,0x02, | |
1312 | 0x6,0x10,0x00,0x01, | |
1313 | 0x6,0x00,0x20,0x01, | |
1314 | 0x6,0x02,0x20,0x00, | |
1315 | 0x6,0x01,0x10,0x00, | |
1316 | 0x6,0x01,0x00,0x20, | |
1317 | 0x6,0x00,0x20,0x02, | |
1318 | 0x6,0x01,0x20,0x02, | |
1319 | 0x6,0x10,0x01,0x00, | |
1320 | 0x6,0x02,0x00,0x10, | |
1321 | 0x6,0x00,0x10,0x01, | |
1322 | 0x6,0x10,0x01,0x20, | |
1323 | 0x6,0x20,0x02,0x10, | |
1324 | 0x6,0x00,0x00,0x22, | |
1325 | 0x6,0x10,0x00,0x02, | |
1326 | 0x6,0x00,0x02,0x20, | |
1327 | 0x6,0x20,0x02,0x00, | |
1328 | 0x6,0x00,0x00,0x11, | |
1329 | 0x6,0x02,0x10,0x01, | |
1330 | 0x6,0x00,0x01,0x10, | |
1331 | 0x6,0x00,0x02,0x11, | |
1332 | 0x4,0x01,0x02, | |
1333 | 0x4,0x02,0x01, | |
1334 | 0x4,0x01,0x00, | |
1335 | 0x4,0x10,0x20, | |
1336 | 0x4,0x20,0x10, | |
1337 | 0x4,0x20,0x00, | |
1338 | 0x4,0x11,0x00, | |
1339 | 0x4,0x02,0x00, | |
1340 | 0x4,0x12,0x00, | |
1341 | 0x4,0x00,0x21, | |
1342 | 0x4,0x22,0x00, | |
1343 | 0x4,0x00,0x12, | |
1344 | 0x4,0x21,0x00, | |
1345 | 0x4,0x02,0x11, | |
1346 | 0x4,0x00,0x01, | |
1347 | 0x4,0x10,0x02, | |
1348 | 0x4,0x02,0x20, | |
1349 | 0x4,0x20,0x11, | |
1350 | 0x4,0x01,0x10, | |
1351 | 0x4,0x21,0x10, | |
1352 | 0x4,0x10,0x00, | |
1353 | 0x4,0x10,0x22, | |
1354 | 0x4,0x20,0x20, | |
1355 | 0x4,0x00,0x22, | |
1356 | 0x4,0x01,0x22, | |
1357 | 0x4,0x20,0x01, | |
1358 | 0x4,0x02,0x02, | |
1359 | 0x4,0x00,0x20, | |
1360 | 0x4,0x00,0x10, | |
1361 | 0x4,0x00,0x11, | |
1362 | 0x4,0x22,0x01, | |
1363 | 0x4,0x11,0x20, | |
1364 | 0x4,0x12,0x01, | |
1365 | 0x4,0x12,0x20, | |
1366 | 0x4,0x11,0x02, | |
1367 | 0x4,0x10,0x10, | |
1368 | 0x4,0x01,0x01, | |
1369 | 0x4,0x02,0x21, | |
1370 | 0x4,0x20,0x12, | |
1371 | 0x4,0x01,0x12, | |
1372 | 0x4,0x22,0x11, | |
1373 | 0x4,0x21,0x12, | |
1374 | 0x4,0x22,0x10, | |
1375 | 0x4,0x21,0x02, | |
1376 | 0x4,0x20,0x02, | |
1377 | 0x4,0x10,0x01, | |
1378 | 0x4,0x00,0x02, | |
1379 | 0x4,0x10,0x21, | |
1380 | 0x4,0x01,0x20, | |
1381 | 0x4,0x11,0x22, | |
1382 | 0x4,0x12,0x21, | |
1383 | 0x4,0x22,0x20, | |
1384 | 0x4,0x02,0x10, | |
1385 | 0x4,0x02,0x22, | |
1386 | 0x4,0x11,0x10, | |
1387 | 0x4,0x22,0x02, | |
1388 | 0x4,0x20,0x21, | |
1389 | 0x4,0x01,0x11, | |
1390 | 0x4,0x11,0x01, | |
1391 | 0x4,0x10,0x12, | |
1392 | 0x4,0x02,0x12, | |
1393 | 0x4,0x20,0x22, | |
1394 | 0x4,0x21,0x20, | |
1395 | 0x4,0x01,0x21, | |
1396 | 0x4,0x12,0x02, | |
1397 | 0x4,0x21,0x11, | |
1398 | 0x4,0x12,0x22, | |
1399 | 0x4,0x12,0x10, | |
1400 | 0x4,0x22,0x21, | |
1401 | 0x4,0x10,0x11, | |
1402 | 0x4,0x21,0x01, | |
1403 | 0x4,0x11,0x12, | |
1404 | 0x4,0x12,0x11, | |
1405 | 0x4,0x66,0x66, | |
1406 | 0x4,0x22,0x22, | |
1407 | 0x4,0x11,0x21, | |
1408 | 0x4,0x11,0x11, | |
1409 | 0x4,0x21,0x22, | |
1410 | 0x4,0x00,0x00, | |
1411 | 0x4,0x22,0x12, | |
1412 | 0x4,0x12,0x12, | |
1413 | 0x4,0x21,0x21, | |
1414 | 0x4,0x42,0x00, | |
1415 | 0x4,0x00,0x04, | |
1416 | 0x4,0x40,0x00, | |
1417 | 0x4,0x30,0x00, | |
1418 | 0x4,0x31,0x00, | |
1419 | 0x4,0x00,0x03, | |
1420 | 0x4,0x00,0x14, | |
1421 | 0x4,0x00,0x13, | |
1422 | 0x4,0x01,0x24, | |
1423 | 0x4,0x20,0x13, | |
1424 | 0x4,0x01,0x42, | |
1425 | 0x4,0x14,0x20, | |
1426 | 0x4,0x42,0x02, | |
1427 | 0x4,0x13,0x00, | |
1428 | 0x4,0x00,0x24, | |
1429 | 0x4,0x31,0x20, | |
1430 | 0x4,0x22,0x13, | |
1431 | 0x4,0x11,0x24, | |
1432 | 0x4,0x12,0x66, | |
1433 | 0x4,0x30,0x01, | |
1434 | 0x4,0x02,0x13, | |
1435 | 0x4,0x12,0x42, | |
1436 | 0x4,0x40,0x10, | |
1437 | 0x4,0x40,0x02, | |
1438 | 0x4,0x01,0x04, | |
1439 | 0x4,0x24,0x00, | |
1440 | 0x4,0x42,0x10, | |
1441 | 0x4,0x21,0x13, | |
1442 | 0x4,0x13,0x12, | |
1443 | 0x4,0x31,0x21, | |
1444 | 0x4,0x21,0x24, | |
1445 | 0x4,0x00,0x40, | |
1446 | 0x4,0x10,0x24, | |
1447 | 0x4,0x10,0x42, | |
1448 | 0x4,0x32,0x01, | |
1449 | 0x4,0x11,0x42, | |
1450 | 0x4,0x20,0x31, | |
1451 | 0x4,0x12,0x40, | |
1452 | 0x2,0x00, | |
1453 | 0x2,0x10, | |
1454 | 0x2,0x20, | |
1455 | 0x2,0x30, | |
1456 | 0x2,0x40, | |
1457 | 0x2,0x50, | |
1458 | 0x2,0x60, | |
1459 | 0x2,0x70, | |
1460 | 0x2,0x01, | |
1461 | 0x2,0x11, | |
1462 | 0x2,0x21, | |
1463 | 0x2,0x31, | |
1464 | 0x2,0x41, | |
1465 | 0x2,0x51, | |
1466 | 0x2,0x61, | |
1467 | 0x2,0x71, | |
1468 | 0x2,0x02, | |
1469 | 0x2,0x12, | |
1470 | 0x2,0x22, | |
1471 | 0x2,0x32, | |
1472 | 0x2,0x42, | |
1473 | 0x2,0x52, | |
1474 | 0x2,0x62, | |
1475 | 0x2,0x72, | |
1476 | 0x2,0x03, | |
1477 | 0x2,0x13, | |
1478 | 0x2,0x23, | |
1479 | 0x2,0x33, | |
1480 | 0x2,0x43, | |
1481 | 0x2,0x53, | |
1482 | 0x2,0x63, | |
1483 | 0x2,0x73, | |
1484 | 0x2,0x04, | |
1485 | 0x2,0x14, | |
1486 | 0x2,0x24, | |
1487 | 0x2,0x34, | |
1488 | 0x2,0x44, | |
1489 | 0x2,0x54, | |
1490 | 0x2,0x64, | |
1491 | 0x2,0x74, | |
1492 | 0x2,0x05, | |
1493 | 0x2,0x15, | |
1494 | 0x2,0x25, | |
1495 | 0x2,0x35, | |
1496 | 0x2,0x45, | |
1497 | 0x2,0x55, | |
1498 | 0x2,0x65, | |
1499 | 0x2,0x75, | |
1500 | 0x2,0x06, | |
1501 | 0x2,0x16, | |
1502 | 0x2,0x26, | |
1503 | 0x2,0x36, | |
1504 | 0x2,0x46, | |
1505 | 0x2,0x56, | |
1506 | 0x2,0x66, | |
1507 | 0x2,0x76, | |
1508 | 0x2,0x07, | |
1509 | 0x2,0x17, | |
1510 | 0x2,0x27, | |
1511 | 0x2,0x37, | |
1512 | 0x2,0x47, | |
1513 | 0x2,0x57, | |
1514 | 0x2,0x67, | |
1515 | 0x2,0x77 | |
1516 | ]; | |
1517 | ||
1518 | const DUCK_VECTABLES: [&[u8]; 3] = [ DUCK_VECTBL2, DUCK_VECTBL3, DUCK_VECTBL4 ]; |