X-Git-Url: https://git.nihav.org/?a=blobdiff_plain;f=nihav-core%2Fsrc%2Fcodecs%2Fmod.rs;h=2999cb66315cd47b33481e0c5ae73fe97caccafd;hb=a191f568b14cfba727449e77444cf0bcc931c01a;hp=76c683d0a9adae6cb7d0fd97fe9a2e37b7e42961;hpb=38953fb529efad1b0b609eec77f7839e62ad2719;p=nihav.git diff --git a/nihav-core/src/codecs/mod.rs b/nihav-core/src/codecs/mod.rs index 76c683d..2999cb6 100644 --- a/nihav-core/src/codecs/mod.rs +++ b/nihav-core/src/codecs/mod.rs @@ -1,9 +1,8 @@ use std::fmt; use std::ops::{Add, AddAssign, Sub, SubAssign}; -use crate::frame::*; -use std::rc::Rc; -use std::cell::RefCell; +pub use crate::frame::*; +pub use std::rc::Rc; use std::mem; use crate::io::byteio::ByteIOError; use crate::io::bitreader::BitReaderError; @@ -45,10 +44,6 @@ impl From for DecoderError { fn from(_: AllocatorError) -> Self { DecoderError::AllocError } } -macro_rules! validate { - ($a:expr) => { if !$a { println!("check failed at {}:{}", file!(), line!()); return Err(DecoderError::InvalidData); } }; -} - #[allow(dead_code)] pub struct HAMShuffler { lastframe: Option>, @@ -82,6 +77,10 @@ impl HAMShuffler { } } +impl Default for HAMShuffler { + fn default() -> Self { Self { lastframe: None } } +} + #[allow(dead_code)] pub struct IPShuffler { lastframe: Option>, @@ -106,6 +105,10 @@ impl IPShuffler { } } +impl Default for IPShuffler { + fn default() -> Self { Self { lastframe: None } } +} + #[allow(dead_code)] pub struct IPBShuffler { lastframe: Option>, @@ -156,6 +159,10 @@ impl IPBShuffler { } } +impl Default for IPBShuffler { + fn default() -> Self { Self { lastframe: None, nextframe: None } } +} + #[derive(Debug,Clone,Copy,PartialEq)] pub struct MV { pub x: i16,