core/io: make Codebook fields and TABLE_FILL_VALUE public
authorKostya Shishkov <kostya.shishkov@gmail.com>
Mon, 13 Apr 2020 09:27:26 +0000 (11:27 +0200)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Mon, 13 Apr 2020 09:27:26 +0000 (11:27 +0200)
This allows external implementations for CodebookReader trait.

nihav-core/src/io/codebook.rs

index 0fc6a9cb316b673ca66046464e62d1911b5d00ef..553f2f9c84e77415580404ae38fb58c092bd465c 100644 (file)
@@ -127,9 +127,9 @@ pub trait CodebookDescReader<S> {
 /// The codebook structure for code reading.
 #[allow(dead_code)]
 pub struct Codebook<S> {
-    table: Vec<u32>,
-    syms:  Vec<S>,
-    lut_bits: u8,
+    pub table: Vec<u32>,
+    pub syms:  Vec<S>,
+    pub lut_bits: u8,
 }
 
 /// Trait allowing bitreader to use codebook for decoding bit sequences.
@@ -140,7 +140,7 @@ pub trait CodebookReader<S> {
     fn read_cb(&mut self, cb: &Codebook<S>) -> CodebookResult<S>;
 }
 
-const TABLE_FILL_VALUE: u32 = 0x7F;
+pub const TABLE_FILL_VALUE: u32 = 0x7F;
 const MAX_LUT_BITS: u8 = 10;
 
 fn fill_lut_msb(table: &mut Vec<u32>, off: usize,