add Acorn Moving Blocks HQ decoder
[nihav.git] / nihav-duck / src / codecs / truemotion1.rs
index 4af75d1f664770de70ec7b843c0d7a2878035406..858ef3d4951fb33370a1a5b9c4474d3488d9d608 100644 (file)
@@ -1,5 +1,6 @@
 use nihav_core::codecs::*;
 use nihav_core::io::byteio::*;
+use super::truemotion1data::*;
 
 struct MaskState<'a> {
     is_intra:   bool,
@@ -128,6 +129,7 @@ impl Default for DeltaTables {
     }
 }
 
+#[derive(Default)]
 struct FrameBuf {
     last16: Option<NAVideoBufferRef<u16>>,
     last24: Option<NAVideoBufferRef<u8>>,
@@ -160,12 +162,6 @@ impl FrameBuf {
     }
 }
 
-impl Default for FrameBuf {
-    fn default() -> Self {
-        Self { last16: None, last24: None }
-    }
-}
-
 #[derive(Default)]
 struct TM1Decoder {
     info:           NACodecInfoRef,
@@ -178,21 +174,6 @@ struct TM1Decoder {
     lastframe:      FrameBuf,
 }
 
-const RGB555_FORMAT: NAPixelFormaton = NAPixelFormaton { model: ColorModel::RGB(RGBSubmodel::RGB), components: 3,
-                                        comp_info: [
-                                            Some(NAPixelChromaton{ h_ss: 0, v_ss: 0, packed: true, depth: 5, shift: 10, comp_offs: 0, next_elem: 2 }),
-                                            Some(NAPixelChromaton{ h_ss: 0, v_ss: 0, packed: true, depth: 5, shift:  5, comp_offs: 0, next_elem: 2 }),
-                                            Some(NAPixelChromaton{ h_ss: 0, v_ss: 0, packed: true, depth: 5, shift:  0, comp_offs: 0, next_elem: 2 }),
-                                            None, None],
-                                        elem_size: 2, be: false, alpha: false, palette: false };
-const BGR0_FORMAT: NAPixelFormaton = NAPixelFormaton { model: ColorModel::RGB(RGBSubmodel::RGB), components: 3,
-                                        comp_info: [
-                                            Some(NAPixelChromaton{ h_ss: 0, v_ss: 0, packed: true, depth: 8, shift: 0, comp_offs: 2, next_elem: 4 }),
-                                            Some(NAPixelChromaton{ h_ss: 0, v_ss: 0, packed: true, depth: 8, shift: 0, comp_offs: 1, next_elem: 4 }),
-                                            Some(NAPixelChromaton{ h_ss: 0, v_ss: 0, packed: true, depth: 8, shift: 0, comp_offs: 0, next_elem: 4 }),
-                                            None, None],
-                                        elem_size: 4, be: false, alpha: false, palette: false };
-
 impl TM1Decoder {
     fn new() -> Self { Self::default() }
     fn set_delta_tables(&mut self, delta_set: usize, table_idx: usize, is_24bit: bool) {
@@ -599,7 +580,7 @@ impl NADecoder for TM1Decoder {
         let mask_bits = &src[hdr_size..][..mask_size];
         let index_bytes = &src[hdr_size+mask_size..];
         validate!(src.len() >= hdr_size + mask_size);
-        self.vert_pred.truncate(0);
+        self.vert_pred.clear();
         self.vert_pred.resize(out_width, 0);
 
         if is_intra || is_sprite {
@@ -616,8 +597,8 @@ impl NADecoder for TM1Decoder {
 
         self.blk_w = compr_info.block_w;
         self.blk_h = compr_info.block_h;
-        let mut mask = MaskState::new(is_intra && !is_sprite, &mask_bits, mask_row_size);
-        let mut index = IndexState::new(&index_bytes);
+        let mut mask = MaskState::new(is_intra && !is_sprite, mask_bits, mask_row_size);
+        let mut index = IndexState::new(index_bytes);
         let bufinfo;
         if !is_24bit {
             if let Some(mut buf) = self.lastframe.get16() {
@@ -659,6 +640,12 @@ impl NADecoder for TM1Decoder {
     }
 }
 
+impl NAOptionHandler for TM1Decoder {
+    fn get_supported_options(&self) -> &[NAOptionDefinition] { &[] }
+    fn set_options(&mut self, _options: &[NAOption]) { }
+    fn query_option_value(&self, _name: &str) -> Option<NAValue> { None }
+}
+
 pub fn get_decoder() -> Box<dyn NADecoder + Send> {
     Box::new(TM1Decoder::new())
 }
@@ -667,16 +654,17 @@ pub fn get_decoder() -> Box<dyn NADecoder + Send> {
 mod test {
     use nihav_core::codecs::RegisteredDecoders;
     use nihav_core::demuxers::RegisteredDemuxers;
-    use nihav_core::test::dec_video::*;
-    use crate::codecs::duck_register_all_codecs;
-    use nihav_commonfmt::demuxers::generic_register_all_demuxers;
+    use nihav_codec_support::test::dec_video::*;
+    use crate::duck_register_all_decoders;
+    use nihav_commonfmt::generic_register_all_demuxers;
     #[test]
     fn test_tm1() {
         let mut dmx_reg = RegisteredDemuxers::new();
         generic_register_all_demuxers(&mut dmx_reg);
         let mut dec_reg = RegisteredDecoders::new();
-        duck_register_all_codecs(&mut dec_reg);
+        duck_register_all_decoders(&mut dec_reg);
 
+        // sample: https://samples.mplayerhq.hu/V-codecs/DUCK/phant2-940.duk
         test_decoding("avi", "truemotion1", "assets/Duck/phant2-940.duk", Some(12), &dmx_reg, &dec_reg,
                       ExpectedTestResult::MD5Frames(vec![
                         [0x989e62b8, 0x5d85c23c, 0x1cffba6d, 0xe599f1c4],
@@ -704,832 +692,3 @@ mod test {
         //test_file_decoding("avi", file, Some(42), true, false, None/*Some("tm1-")*/, &dmx_reg, &dec_reg);
     }
 }
-
-#[derive(Clone,Copy)]
-struct TM1ComprInfo {
-    is_24bit:   bool,
-    block_w:    usize,
-    block_h:    usize,
-}
-
-const TM1_COMPR_TYPES: [Option<TM1ComprInfo>; 17] = [
-    None,
-    Some(TM1ComprInfo { is_24bit: false, block_w: 4, block_h: 4 }),
-    Some(TM1ComprInfo { is_24bit: false, block_w: 4, block_h: 4 }),
-    Some(TM1ComprInfo { is_24bit: false, block_w: 4, block_h: 2 }),
-    Some(TM1ComprInfo { is_24bit: false, block_w: 4, block_h: 2 }),
-    Some(TM1ComprInfo { is_24bit: false, block_w: 2, block_h: 4 }),
-    Some(TM1ComprInfo { is_24bit: false, block_w: 2, block_h: 4 }),
-    Some(TM1ComprInfo { is_24bit: false, block_w: 2, block_h: 2 }),
-    Some(TM1ComprInfo { is_24bit: false, block_w: 2, block_h: 2 }),
-    None,
-    Some(TM1ComprInfo { is_24bit: true,  block_w: 4, block_h: 4 }),
-    None,
-    Some(TM1ComprInfo { is_24bit: true,  block_w: 4, block_h: 2 }),
-    None,
-    Some(TM1ComprInfo { is_24bit: true,  block_w: 2, block_h: 4 }),
-    None,
-    Some(TM1ComprInfo { is_24bit: true,  block_w: 2, block_h: 2 }),
-];
-
-const DUCK_Y_DELTAS: [[i32; 8]; 4] = [
-    [ 0, -1,  1,  -3,  3,  -6,  6,  -6 ],
-    [ 0, -1,  2,  -3,  4,  -6,  6,  -6 ],
-    [ 2, -3, 10, -10, 23, -23, 47, -47 ],
-    [ 0, -2,  2,  -8,  8, -18, 18, -40 ]
-];
-const DUCK_Y_FAT_DELTA3: [i32; 8] = [ 0, -15, 50, -50, 115, -115, 235, -235 ];
-const DUCK_Y_FAT_DELTA4: [i32; 8] = [ 0,  40, 80, -76, 160, -154, 236, -236 ];
-const DUCK_Y_FAT_DELTAS: [&[i32]; 4] = [
-    &DUCK_Y_FAT_DELTA3, &DUCK_Y_FAT_DELTA3, &DUCK_Y_FAT_DELTA3, &DUCK_Y_FAT_DELTA4
-];
-
-const DUCK_C_DELTAS: [[i32; 8]; 4] = [
-    [ 0, -1, 1,  -2,  3,  -4,  5,  -4 ],
-    [ 0, -1, 1,  -2,  3,  -4,  5,  -4 ],
-    [ 0, -4, 3, -16, 20, -32, 36, -32 ],
-    [ 0, -2, 2,  -8,  8, -18, 18, -40 ]
-];
-const DUCK_C_FAT_DELTA3: [i32; 8] = [ 0, -20, 15, -80, 100, -160, 180, -160 ];
-const DUCK_C_FAT_DELTAS: [&[i32]; 4] = [
-    &DUCK_C_FAT_DELTA3, &DUCK_C_FAT_DELTA3, &DUCK_C_FAT_DELTA3, &DUCK_Y_FAT_DELTA4
-];
-
-const DUCK_VECTBL2: &[u8] = &[
-0x8,0x00,0x00,0x00,0x00,
-0x8,0x00,0x00,0x00,0x00,
-0x8,0x10,0x00,0x00,0x00,
-0x8,0x01,0x00,0x00,0x00,
-0x8,0x00,0x10,0x00,0x00,
-0x8,0x00,0x01,0x00,0x00,
-0x8,0x00,0x00,0x10,0x00,
-0x8,0x00,0x00,0x01,0x00,
-0x8,0x00,0x00,0x00,0x10,
-0x8,0x00,0x00,0x00,0x01,
-0x6,0x00,0x00,0x00,
-0x6,0x10,0x00,0x00,
-0x6,0x01,0x00,0x00,
-0x6,0x00,0x10,0x00,
-0x6,0x00,0x01,0x00,
-0x6,0x00,0x00,0x01,
-0x6,0x00,0x00,0x10,
-0x6,0x00,0x00,0x02,
-0x6,0x00,0x00,0x20,
-0x6,0x20,0x10,0x00,
-0x6,0x00,0x02,0x01,
-0x6,0x00,0x20,0x10,
-0x6,0x02,0x01,0x00,
-0x6,0x11,0x00,0x00,
-0x6,0x00,0x20,0x00,
-0x6,0x00,0x02,0x00,
-0x6,0x20,0x00,0x00,
-0x6,0x01,0x10,0x00,
-0x6,0x02,0x00,0x00,
-0x6,0x01,0x00,0x02,
-0x6,0x10,0x00,0x20,
-0x6,0x00,0x01,0x02,
-0x6,0x10,0x01,0x00,
-0x6,0x00,0x10,0x20,
-0x6,0x10,0x10,0x00,
-0x6,0x10,0x00,0x01,
-0x6,0x20,0x00,0x10,
-0x6,0x02,0x00,0x01,
-0x6,0x01,0x01,0x00,
-0x6,0x01,0x00,0x10,
-0x6,0x00,0x11,0x00,
-0x6,0x10,0x00,0x02,
-0x6,0x00,0x01,0x10,
-0x6,0x00,0x00,0x11,
-0x6,0x10,0x00,0x10,
-0x6,0x01,0x00,0x01,
-0x6,0x00,0x00,0x22,
-0x6,0x02,0x01,0x01,
-0x6,0x10,0x20,0x10,
-0x6,0x01,0x02,0x01,
-0x6,0x20,0x10,0x10,
-0x6,0x01,0x00,0x20,
-0x6,0x00,0x10,0x01,
-0x6,0x21,0x10,0x00,
-0x6,0x10,0x02,0x01,
-0x6,0x12,0x01,0x00,
-0x6,0x01,0x20,0x10,
-0x6,0x01,0x02,0x00,
-0x6,0x10,0x20,0x00,
-0x6,0x00,0x10,0x02,
-0x6,0x00,0x01,0x20,
-0x6,0x00,0x02,0x21,
-0x6,0x00,0x02,0x20,
-0x6,0x00,0x00,0x12,
-0x6,0x00,0x00,0x21,
-0x6,0x20,0x11,0x00,
-0x6,0x00,0x01,0x01,
-0x6,0x11,0x10,0x00,
-0x6,0x00,0x20,0x12,
-0x6,0x00,0x20,0x11,
-0x6,0x20,0x10,0x02,
-0x6,0x02,0x01,0x20,
-0x6,0x00,0x22,0x11,
-0x6,0x00,0x10,0x10,
-0x6,0x02,0x11,0x00,
-0x6,0x00,0x21,0x10,
-0x6,0x00,0x02,0x03,
-0x6,0x20,0x10,0x01,
-0x6,0x00,0x12,0x01,
-0x4,0x11,0x00,
-0x4,0x00,0x22,
-0x4,0x20,0x00,
-0x4,0x01,0x10,
-0x4,0x02,0x20,
-0x4,0x00,0x20,
-0x4,0x02,0x00,
-0x4,0x10,0x01,
-0x4,0x00,0x11,
-0x4,0x02,0x01,
-0x4,0x02,0x21,
-0x4,0x00,0x02,
-0x4,0x20,0x02,
-0x4,0x01,0x01,
-0x4,0x10,0x10,
-0x4,0x10,0x02,
-0x4,0x22,0x00,
-0x4,0x10,0x00,
-0x4,0x01,0x00,
-0x4,0x21,0x00,
-0x4,0x12,0x00,
-0x4,0x00,0x10,
-0x4,0x20,0x12,
-0x4,0x01,0x11,
-0x4,0x00,0x01,
-0x4,0x01,0x02,
-0x4,0x11,0x02,
-0x4,0x11,0x01,
-0x4,0x10,0x20,
-0x4,0x20,0x01,
-0x4,0x22,0x11,
-0x4,0x00,0x12,
-0x4,0x20,0x10,
-0x4,0x22,0x01,
-0x4,0x01,0x20,
-0x4,0x00,0x21,
-0x4,0x10,0x11,
-0x4,0x21,0x10,
-0x4,0x10,0x22,
-0x4,0x02,0x03,
-0x4,0x12,0x01,
-0x4,0x20,0x11,
-0x4,0x11,0x10,
-0x4,0x20,0x30,
-0x4,0x11,0x20,
-0x4,0x02,0x10,
-0x4,0x22,0x10,
-0x4,0x11,0x11,
-0x4,0x30,0x20,
-0x4,0x30,0x00,
-0x4,0x01,0x22,
-0x4,0x01,0x12,
-0x4,0x02,0x11,
-0x4,0x03,0x02,
-0x4,0x03,0x00,
-0x4,0x10,0x21,
-0x4,0x12,0x20,
-0x4,0x00,0x00,
-0x4,0x12,0x21,
-0x4,0x21,0x11,
-0x4,0x02,0x22,
-0x4,0x10,0x12,
-0x4,0x31,0x00,
-0x4,0x20,0x20,
-0x4,0x00,0x03,
-0x4,0x02,0x02,
-0x4,0x22,0x20,
-0x4,0x01,0x21,
-0x4,0x21,0x02,
-0x4,0x21,0x12,
-0x4,0x11,0x22,
-0x4,0x00,0x30,
-0x4,0x12,0x11,
-0x4,0x20,0x22,
-0x4,0x31,0x20,
-0x4,0x21,0x30,
-0x4,0x22,0x02,
-0x4,0x22,0x22,
-0x4,0x20,0x31,
-0x4,0x13,0x02,
-0x4,0x03,0x10,
-0x4,0x11,0x12,
-0x4,0x00,0x13,
-0x4,0x21,0x01,
-0x4,0x12,0x03,
-0x4,0x13,0x00,
-0x4,0x13,0x10,
-0x4,0x02,0x13,
-0x4,0x30,0x01,
-0x4,0x12,0x10,
-0x4,0x22,0x13,
-0x4,0x03,0x12,
-0x4,0x31,0x01,
-0x4,0x30,0x22,
-0x4,0x00,0x31,
-0x4,0x01,0x31,
-0x4,0x02,0x23,
-0x4,0x01,0x30,
-0x4,0x11,0x21,
-0x4,0x22,0x21,
-0x4,0x01,0x13,
-0x4,0x10,0x03,
-0x4,0x22,0x03,
-0x4,0x30,0x21,
-0x4,0x21,0x31,
-0x4,0x33,0x00,
-0x4,0x13,0x12,
-0x4,0x11,0x31,
-0x4,0x30,0x02,
-0x4,0x12,0x02,
-0x4,0x11,0x13,
-0x4,0x12,0x22,
-0x4,0x20,0x32,
-0x4,0x10,0x13,
-0x4,0x22,0x31,
-0x4,0x21,0x20,
-0x4,0x01,0x33,
-0x4,0x33,0x10,
-0x4,0x20,0x13,
-0x4,0x31,0x22,
-0x4,0x13,0x30,
-0x4,0x01,0x03,
-0x4,0x11,0x33,
-0x4,0x20,0x21,
-0x4,0x13,0x31,
-0x4,0x03,0x22,
-0x4,0x31,0x02,
-0x4,0x00,0x24,
-0x2,0x00,
-0x2,0x10,
-0x2,0x20,
-0x2,0x30,
-0x2,0x40,
-0x2,0x50,
-0x2,0x60,
-0x2,0x01,
-0x2,0x11,
-0x2,0x21,
-0x2,0x31,
-0x2,0x41,
-0x2,0x51,
-0x2,0x61,
-0x2,0x02,
-0x2,0x12,
-0x2,0x22,
-0x2,0x32,
-0x2,0x42,
-0x2,0x52,
-0x2,0x62,
-0x2,0x03,
-0x2,0x13,
-0x2,0x23,
-0x2,0x33,
-0x2,0x43,
-0x2,0x53,
-0x2,0x63,
-0x2,0x04,
-0x2,0x14,
-0x2,0x24,
-0x2,0x34,
-0x2,0x44,
-0x2,0x54,
-0x2,0x64,
-0x2,0x05,
-0x2,0x15,
-0x2,0x25,
-0x2,0x35,
-0x2,0x45,
-0x2,0x55,
-0x2,0x65,
-0x2,0x06,
-0x2,0x16,
-0x2,0x26,
-0x2,0x36,
-0x2,0x46,
-0x2,0x56,
-0x2,0x66
-];
-
-const DUCK_VECTBL3: &[u8] = &[
-0x6,0x00,0x00,0x00,
-0x6,0x00,0x00,0x00,
-0x6,0x00,0x00,0x01,
-0x6,0x00,0x00,0x10,
-0x6,0x00,0x00,0x11,
-0x6,0x00,0x01,0x00,
-0x6,0x00,0x01,0x01,
-0x6,0x00,0x01,0x10,
-0x6,0x00,0x01,0x11,
-0x6,0x00,0x10,0x00,
-0x6,0x00,0x10,0x01,
-0x6,0x00,0x10,0x10,
-0x6,0x00,0x10,0x11,
-0x6,0x00,0x11,0x00,
-0x6,0x00,0x11,0x01,
-0x6,0x00,0x11,0x10,
-0x6,0x00,0x11,0x11,
-0x6,0x01,0x00,0x00,
-0x6,0x01,0x00,0x01,
-0x6,0x01,0x00,0x10,
-0x6,0x01,0x00,0x11,
-0x6,0x01,0x01,0x00,
-0x6,0x01,0x01,0x01,
-0x6,0x01,0x01,0x10,
-0x6,0x01,0x01,0x11,
-0x6,0x01,0x10,0x00,
-0x6,0x01,0x10,0x01,
-0x6,0x01,0x10,0x10,
-0x6,0x01,0x10,0x11,
-0x6,0x01,0x11,0x00,
-0x6,0x01,0x11,0x01,
-0x6,0x01,0x11,0x10,
-0x6,0x01,0x11,0x11,
-0x6,0x10,0x00,0x00,
-0x6,0x10,0x00,0x01,
-0x6,0x10,0x00,0x10,
-0x6,0x10,0x00,0x11,
-0x6,0x10,0x01,0x00,
-0x6,0x10,0x01,0x01,
-0x6,0x10,0x01,0x10,
-0x6,0x10,0x01,0x11,
-0x6,0x10,0x10,0x00,
-0x6,0x10,0x10,0x01,
-0x6,0x10,0x10,0x10,
-0x6,0x10,0x10,0x11,
-0x6,0x10,0x11,0x00,
-0x6,0x10,0x11,0x01,
-0x6,0x10,0x11,0x10,
-0x6,0x10,0x11,0x11,
-0x6,0x11,0x00,0x00,
-0x6,0x11,0x00,0x01,
-0x6,0x11,0x00,0x10,
-0x6,0x11,0x00,0x11,
-0x6,0x11,0x01,0x00,
-0x6,0x11,0x01,0x01,
-0x6,0x11,0x01,0x10,
-0x6,0x11,0x01,0x11,
-0x6,0x11,0x10,0x00,
-0x6,0x11,0x10,0x01,
-0x6,0x11,0x10,0x10,
-0x6,0x11,0x10,0x11,
-0x6,0x11,0x11,0x00,
-0x6,0x11,0x11,0x01,
-0x6,0x11,0x11,0x10,
-0x4,0x00,0x00,
-0x4,0x00,0x01,
-0x4,0x00,0x02,
-0x4,0x00,0x03,
-0x4,0x00,0x10,
-0x4,0x00,0x11,
-0x4,0x00,0x12,
-0x4,0x00,0x13,
-0x4,0x00,0x20,
-0x4,0x00,0x21,
-0x4,0x00,0x22,
-0x4,0x00,0x23,
-0x4,0x00,0x30,
-0x4,0x00,0x31,
-0x4,0x00,0x32,
-0x4,0x00,0x33,
-0x4,0x01,0x00,
-0x4,0x01,0x01,
-0x4,0x01,0x02,
-0x4,0x01,0x03,
-0x4,0x01,0x10,
-0x4,0x01,0x11,
-0x4,0x01,0x12,
-0x4,0x01,0x13,
-0x4,0x01,0x20,
-0x4,0x01,0x21,
-0x4,0x01,0x22,
-0x4,0x01,0x23,
-0x4,0x01,0x30,
-0x4,0x01,0x31,
-0x4,0x01,0x32,
-0x4,0x01,0x33,
-0x4,0x02,0x00,
-0x4,0x02,0x01,
-0x4,0x02,0x02,
-0x4,0x02,0x03,
-0x4,0x02,0x10,
-0x4,0x02,0x11,
-0x4,0x02,0x12,
-0x4,0x02,0x13,
-0x4,0x02,0x20,
-0x4,0x02,0x21,
-0x4,0x02,0x22,
-0x4,0x02,0x23,
-0x4,0x02,0x30,
-0x4,0x02,0x31,
-0x4,0x02,0x32,
-0x4,0x02,0x33,
-0x4,0x03,0x00,
-0x4,0x03,0x01,
-0x4,0x03,0x02,
-0x4,0x03,0x03,
-0x4,0x03,0x10,
-0x4,0x03,0x11,
-0x4,0x03,0x12,
-0x4,0x03,0x13,
-0x4,0x03,0x20,
-0x4,0x03,0x21,
-0x4,0x03,0x22,
-0x4,0x03,0x23,
-0x4,0x03,0x30,
-0x4,0x03,0x31,
-0x4,0x03,0x32,
-0x4,0x03,0x33,
-0x4,0x10,0x00,
-0x4,0x10,0x01,
-0x4,0x10,0x02,
-0x4,0x10,0x03,
-0x4,0x10,0x10,
-0x4,0x10,0x11,
-0x4,0x10,0x12,
-0x4,0x10,0x13,
-0x4,0x10,0x20,
-0x4,0x10,0x21,
-0x4,0x10,0x22,
-0x4,0x10,0x23,
-0x4,0x10,0x30,
-0x4,0x10,0x31,
-0x4,0x10,0x32,
-0x4,0x10,0x33,
-0x4,0x11,0x00,
-0x4,0x11,0x01,
-0x4,0x11,0x02,
-0x4,0x11,0x03,
-0x4,0x11,0x10,
-0x4,0x11,0x11,
-0x4,0x11,0x12,
-0x4,0x11,0x13,
-0x4,0x11,0x20,
-0x4,0x11,0x21,
-0x4,0x11,0x22,
-0x4,0x11,0x23,
-0x4,0x11,0x30,
-0x4,0x11,0x31,
-0x4,0x11,0x32,
-0x4,0x11,0x33,
-0x4,0x12,0x00,
-0x4,0x12,0x01,
-0x4,0x12,0x02,
-0x4,0x12,0x03,
-0x4,0x12,0x10,
-0x4,0x12,0x11,
-0x4,0x12,0x12,
-0x4,0x12,0x13,
-0x4,0x12,0x20,
-0x4,0x12,0x21,
-0x4,0x12,0x22,
-0x4,0x12,0x23,
-0x4,0x12,0x30,
-0x4,0x12,0x31,
-0x4,0x12,0x32,
-0x4,0x12,0x33,
-0x4,0x13,0x00,
-0x4,0x13,0x01,
-0x4,0x13,0x02,
-0x4,0x13,0x03,
-0x4,0x13,0x10,
-0x4,0x13,0x11,
-0x4,0x13,0x12,
-0x4,0x13,0x13,
-0x4,0x13,0x20,
-0x4,0x13,0x21,
-0x4,0x13,0x22,
-0x4,0x13,0x23,
-0x4,0x13,0x30,
-0x4,0x13,0x31,
-0x4,0x13,0x32,
-0x4,0x13,0x33,
-0x2,0x00,
-0x2,0x10,
-0x2,0x20,
-0x2,0x30,
-0x2,0x40,
-0x2,0x50,
-0x2,0x60,
-0x2,0x70,
-0x2,0x01,
-0x2,0x11,
-0x2,0x21,
-0x2,0x31,
-0x2,0x41,
-0x2,0x51,
-0x2,0x61,
-0x2,0x71,
-0x2,0x02,
-0x2,0x12,
-0x2,0x22,
-0x2,0x32,
-0x2,0x42,
-0x2,0x52,
-0x2,0x62,
-0x2,0x72,
-0x2,0x03,
-0x2,0x13,
-0x2,0x23,
-0x2,0x33,
-0x2,0x43,
-0x2,0x53,
-0x2,0x63,
-0x2,0x73,
-0x2,0x04,
-0x2,0x14,
-0x2,0x24,
-0x2,0x34,
-0x2,0x44,
-0x2,0x54,
-0x2,0x64,
-0x2,0x74,
-0x2,0x05,
-0x2,0x15,
-0x2,0x25,
-0x2,0x35,
-0x2,0x45,
-0x2,0x55,
-0x2,0x65,
-0x2,0x75,
-0x2,0x06,
-0x2,0x16,
-0x2,0x26,
-0x2,0x36,
-0x2,0x46,
-0x2,0x56,
-0x2,0x66,
-0x2,0x76,
-0x2,0x07,
-0x2,0x17,
-0x2,0x27,
-0x2,0x37,
-0x2,0x47,
-0x2,0x57,
-0x2,0x67,
-0x2,0x77
-];
-
-const DUCK_VECTBL4: &[u8] = &[
-0x8,0x00,0x00,0x00,0x00,
-0x8,0x00,0x00,0x00,0x00,
-0x8,0x20,0x00,0x00,0x00,
-0x8,0x00,0x00,0x00,0x01,
-0x8,0x10,0x00,0x00,0x00,
-0x8,0x00,0x00,0x00,0x02,
-0x8,0x01,0x00,0x00,0x00,
-0x8,0x00,0x00,0x00,0x10,
-0x8,0x02,0x00,0x00,0x00,
-0x6,0x00,0x00,0x00,
-0x6,0x20,0x00,0x00,
-0x6,0x00,0x00,0x01,
-0x6,0x10,0x00,0x00,
-0x6,0x00,0x00,0x02,
-0x6,0x00,0x10,0x00,
-0x6,0x00,0x20,0x00,
-0x6,0x00,0x02,0x00,
-0x6,0x00,0x01,0x00,
-0x6,0x01,0x00,0x00,
-0x6,0x00,0x00,0x20,
-0x6,0x02,0x00,0x00,
-0x6,0x00,0x00,0x10,
-0x6,0x10,0x00,0x20,
-0x6,0x01,0x00,0x02,
-0x6,0x20,0x00,0x10,
-0x6,0x02,0x00,0x01,
-0x6,0x20,0x10,0x00,
-0x6,0x00,0x12,0x00,
-0x6,0x00,0x02,0x01,
-0x6,0x02,0x01,0x00,
-0x6,0x00,0x21,0x00,
-0x6,0x00,0x01,0x02,
-0x6,0x00,0x20,0x10,
-0x6,0x00,0x00,0x21,
-0x6,0x00,0x00,0x12,
-0x6,0x00,0x01,0x20,
-0x6,0x12,0x00,0x00,
-0x6,0x00,0x10,0x20,
-0x6,0x01,0x20,0x00,
-0x6,0x02,0x10,0x00,
-0x6,0x10,0x20,0x00,
-0x6,0x01,0x02,0x00,
-0x6,0x21,0x00,0x00,
-0x6,0x00,0x02,0x10,
-0x6,0x20,0x01,0x00,
-0x6,0x00,0x22,0x00,
-0x6,0x10,0x02,0x00,
-0x6,0x00,0x10,0x02,
-0x6,0x11,0x00,0x00,
-0x6,0x00,0x11,0x00,
-0x6,0x22,0x00,0x00,
-0x6,0x20,0x00,0x02,
-0x6,0x10,0x00,0x01,
-0x6,0x00,0x20,0x01,
-0x6,0x02,0x20,0x00,
-0x6,0x01,0x10,0x00,
-0x6,0x01,0x00,0x20,
-0x6,0x00,0x20,0x02,
-0x6,0x01,0x20,0x02,
-0x6,0x10,0x01,0x00,
-0x6,0x02,0x00,0x10,
-0x6,0x00,0x10,0x01,
-0x6,0x10,0x01,0x20,
-0x6,0x20,0x02,0x10,
-0x6,0x00,0x00,0x22,
-0x6,0x10,0x00,0x02,
-0x6,0x00,0x02,0x20,
-0x6,0x20,0x02,0x00,
-0x6,0x00,0x00,0x11,
-0x6,0x02,0x10,0x01,
-0x6,0x00,0x01,0x10,
-0x6,0x00,0x02,0x11,
-0x4,0x01,0x02,
-0x4,0x02,0x01,
-0x4,0x01,0x00,
-0x4,0x10,0x20,
-0x4,0x20,0x10,
-0x4,0x20,0x00,
-0x4,0x11,0x00,
-0x4,0x02,0x00,
-0x4,0x12,0x00,
-0x4,0x00,0x21,
-0x4,0x22,0x00,
-0x4,0x00,0x12,
-0x4,0x21,0x00,
-0x4,0x02,0x11,
-0x4,0x00,0x01,
-0x4,0x10,0x02,
-0x4,0x02,0x20,
-0x4,0x20,0x11,
-0x4,0x01,0x10,
-0x4,0x21,0x10,
-0x4,0x10,0x00,
-0x4,0x10,0x22,
-0x4,0x20,0x20,
-0x4,0x00,0x22,
-0x4,0x01,0x22,
-0x4,0x20,0x01,
-0x4,0x02,0x02,
-0x4,0x00,0x20,
-0x4,0x00,0x10,
-0x4,0x00,0x11,
-0x4,0x22,0x01,
-0x4,0x11,0x20,
-0x4,0x12,0x01,
-0x4,0x12,0x20,
-0x4,0x11,0x02,
-0x4,0x10,0x10,
-0x4,0x01,0x01,
-0x4,0x02,0x21,
-0x4,0x20,0x12,
-0x4,0x01,0x12,
-0x4,0x22,0x11,
-0x4,0x21,0x12,
-0x4,0x22,0x10,
-0x4,0x21,0x02,
-0x4,0x20,0x02,
-0x4,0x10,0x01,
-0x4,0x00,0x02,
-0x4,0x10,0x21,
-0x4,0x01,0x20,
-0x4,0x11,0x22,
-0x4,0x12,0x21,
-0x4,0x22,0x20,
-0x4,0x02,0x10,
-0x4,0x02,0x22,
-0x4,0x11,0x10,
-0x4,0x22,0x02,
-0x4,0x20,0x21,
-0x4,0x01,0x11,
-0x4,0x11,0x01,
-0x4,0x10,0x12,
-0x4,0x02,0x12,
-0x4,0x20,0x22,
-0x4,0x21,0x20,
-0x4,0x01,0x21,
-0x4,0x12,0x02,
-0x4,0x21,0x11,
-0x4,0x12,0x22,
-0x4,0x12,0x10,
-0x4,0x22,0x21,
-0x4,0x10,0x11,
-0x4,0x21,0x01,
-0x4,0x11,0x12,
-0x4,0x12,0x11,
-0x4,0x66,0x66,
-0x4,0x22,0x22,
-0x4,0x11,0x21,
-0x4,0x11,0x11,
-0x4,0x21,0x22,
-0x4,0x00,0x00,
-0x4,0x22,0x12,
-0x4,0x12,0x12,
-0x4,0x21,0x21,
-0x4,0x42,0x00,
-0x4,0x00,0x04,
-0x4,0x40,0x00,
-0x4,0x30,0x00,
-0x4,0x31,0x00,
-0x4,0x00,0x03,
-0x4,0x00,0x14,
-0x4,0x00,0x13,
-0x4,0x01,0x24,
-0x4,0x20,0x13,
-0x4,0x01,0x42,
-0x4,0x14,0x20,
-0x4,0x42,0x02,
-0x4,0x13,0x00,
-0x4,0x00,0x24,
-0x4,0x31,0x20,
-0x4,0x22,0x13,
-0x4,0x11,0x24,
-0x4,0x12,0x66,
-0x4,0x30,0x01,
-0x4,0x02,0x13,
-0x4,0x12,0x42,
-0x4,0x40,0x10,
-0x4,0x40,0x02,
-0x4,0x01,0x04,
-0x4,0x24,0x00,
-0x4,0x42,0x10,
-0x4,0x21,0x13,
-0x4,0x13,0x12,
-0x4,0x31,0x21,
-0x4,0x21,0x24,
-0x4,0x00,0x40,
-0x4,0x10,0x24,
-0x4,0x10,0x42,
-0x4,0x32,0x01,
-0x4,0x11,0x42,
-0x4,0x20,0x31,
-0x4,0x12,0x40,
-0x2,0x00,
-0x2,0x10,
-0x2,0x20,
-0x2,0x30,
-0x2,0x40,
-0x2,0x50,
-0x2,0x60,
-0x2,0x70,
-0x2,0x01,
-0x2,0x11,
-0x2,0x21,
-0x2,0x31,
-0x2,0x41,
-0x2,0x51,
-0x2,0x61,
-0x2,0x71,
-0x2,0x02,
-0x2,0x12,
-0x2,0x22,
-0x2,0x32,
-0x2,0x42,
-0x2,0x52,
-0x2,0x62,
-0x2,0x72,
-0x2,0x03,
-0x2,0x13,
-0x2,0x23,
-0x2,0x33,
-0x2,0x43,
-0x2,0x53,
-0x2,0x63,
-0x2,0x73,
-0x2,0x04,
-0x2,0x14,
-0x2,0x24,
-0x2,0x34,
-0x2,0x44,
-0x2,0x54,
-0x2,0x64,
-0x2,0x74,
-0x2,0x05,
-0x2,0x15,
-0x2,0x25,
-0x2,0x35,
-0x2,0x45,
-0x2,0x55,
-0x2,0x65,
-0x2,0x75,
-0x2,0x06,
-0x2,0x16,
-0x2,0x26,
-0x2,0x36,
-0x2,0x46,
-0x2,0x56,
-0x2,0x66,
-0x2,0x76,
-0x2,0x07,
-0x2,0x17,
-0x2,0x27,
-0x2,0x37,
-0x2,0x47,
-0x2,0x57,
-0x2,0x67,
-0x2,0x77
-];
-
-const DUCK_VECTABLES: [&[u8]; 3] = [ DUCK_VECTBL2, DUCK_VECTBL3, DUCK_VECTBL4 ];