X-Git-Url: https://git.nihav.org/?p=nihav.git;a=blobdiff_plain;f=nihav-ms%2Fsrc%2Fcodecs%2Fmsvideo1.rs;h=a3bfebcb026481261fc7c032e9d49a1285c9c1f1;hp=34de8943bc946605f2e033dbf29ad620c71f6b40;hb=8d7a1c5c2b1c41d284cbe7ab3d3ee344755db7bc;hpb=c75dce78e4ee295c8ceeac769275921ac5ebb1f5 diff --git a/nihav-ms/src/codecs/msvideo1.rs b/nihav-ms/src/codecs/msvideo1.rs index 34de894..a3bfebc 100644 --- a/nihav-ms/src/codecs/msvideo1.rs +++ b/nihav-ms/src/codecs/msvideo1.rs @@ -2,36 +2,6 @@ use nihav_core::codecs::*; use nihav_core::io::byteio::*; use nihav_codec_support::codecs::HAMShuffler; -struct HAMShuffler16 { - lastframe: Option>, -} - -impl HAMShuffler16 { - fn clear(&mut self) { self.lastframe = None; } - fn add_frame(&mut self, buf: NAVideoBufferRef) { - self.lastframe = Some(buf); - } - fn clone_ref(&mut self) -> Option> { - if let Some(ref mut frm) = self.lastframe { - let newfrm = frm.copy_buffer(); - *frm = newfrm.clone().into_ref(); - Some(newfrm.into_ref()) - } else { - None - } - } - fn get_output_frame(&mut self) -> Option> { - match self.lastframe { - Some(ref frm) => Some(frm.clone()), - None => None, - } - } -} - -impl Default for HAMShuffler16 { - fn default() -> Self { Self { lastframe: None } } -} - const RGB555_FORMAT: NAPixelFormaton = NAPixelFormaton { model: ColorModel::RGB(RGBSubmodel::RGB), components: 3, comp_info: [ @@ -44,8 +14,8 @@ const RGB555_FORMAT: NAPixelFormaton = NAPixelFormaton { #[derive(Default)] struct Video1Decoder { info: NACodecInfoRef, - hams: HAMShuffler, - hams16: HAMShuffler16, + hams: HAMShuffler, + hams16: HAMShuffler, width: usize, height: usize, is_16bit: bool,