From: Kostya Shishkov Date: Mon, 13 Apr 2020 09:27:26 +0000 (+0200) Subject: core/io: make Codebook fields and TABLE_FILL_VALUE public X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=cec9f863d6272d15d51045c3cf16f2db9d779eff;p=nihav.git core/io: make Codebook fields and TABLE_FILL_VALUE public This allows external implementations for CodebookReader trait. --- diff --git a/nihav-core/src/io/codebook.rs b/nihav-core/src/io/codebook.rs index 0fc6a9c..553f2f9 100644 --- a/nihav-core/src/io/codebook.rs +++ b/nihav-core/src/io/codebook.rs @@ -127,9 +127,9 @@ pub trait CodebookDescReader { /// The codebook structure for code reading. #[allow(dead_code)] pub struct Codebook { - table: Vec, - syms: Vec, - lut_bits: u8, + pub table: Vec, + pub syms: Vec, + pub lut_bits: u8, } /// Trait allowing bitreader to use codebook for decoding bit sequences. @@ -140,7 +140,7 @@ pub trait CodebookReader { fn read_cb(&mut self, cb: &Codebook) -> CodebookResult; } -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, off: usize,