From: Kostya Shishkov Date: Tue, 11 Jul 2023 16:49:59 +0000 (+0200) Subject: truemotion1: split off data tables for the upcoming encoder X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=fafc32ef4ac761d2219881a6ab750ce913aa318a;p=nihav.git truemotion1: split off data tables for the upcoming encoder --- diff --git a/nihav-duck/src/codecs/mod.rs b/nihav-duck/src/codecs/mod.rs index e4f115b..ba52f5d 100644 --- a/nihav-duck/src/codecs/mod.rs +++ b/nihav-duck/src/codecs/mod.rs @@ -11,6 +11,8 @@ macro_rules! validate { #[cfg(feature="decoder_truemotion1")] mod truemotion1; +#[cfg(feature="decoder_truemotion1")] +mod truemotion1data; #[cfg(feature="decoder_truemotionrt")] mod truemotionrt; #[cfg(feature="decoder_truemotion2")] diff --git a/nihav-duck/src/codecs/truemotion1.rs b/nihav-duck/src/codecs/truemotion1.rs index 717a32b..858ef3d 100644 --- a/nihav-duck/src/codecs/truemotion1.rs +++ b/nihav-duck/src/codecs/truemotion1.rs @@ -1,5 +1,6 @@ use nihav_core::codecs::*; use nihav_core::io::byteio::*; +use super::truemotion1data::*; struct MaskState<'a> { is_intra: bool, @@ -173,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) { @@ -706,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; 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 ]; diff --git a/nihav-duck/src/codecs/truemotion1data.rs b/nihav-duck/src/codecs/truemotion1data.rs new file mode 100644 index 0000000..2254bc3 --- /dev/null +++ b/nihav-duck/src/codecs/truemotion1data.rs @@ -0,0 +1,845 @@ +use nihav_core::formats::*; + +pub 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 }; +pub 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 }; + +#[derive(Clone,Copy)] +pub struct TM1ComprInfo { + pub is_24bit: bool, + pub block_w: usize, + pub block_h: usize, +} + +pub const TM1_COMPR_TYPES: [Option; 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 }), +]; + +pub 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 ]; +pub const DUCK_Y_FAT_DELTAS: [&[i32]; 4] = [ + &DUCK_Y_FAT_DELTA3, &DUCK_Y_FAT_DELTA3, &DUCK_Y_FAT_DELTA3, &DUCK_Y_FAT_DELTA4 +]; + +pub 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 ]; +pub 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 +]; + +pub const DUCK_VECTABLES: [&[u8]; 3] = [ DUCK_VECTBL2, DUCK_VECTBL3, DUCK_VECTBL4 ];