]> git.nihav.org Git - nihav.git/blobdiff - src/codecs/h263/intel263.rs
fix let mut foo = &mut bar warning
[nihav.git] / src / codecs / h263 / intel263.rs
index 55e49a91955ac10d229c5403df0e549da94077c8..e47073de03e1bd9b7bc223cd9113677e78d55415 100644 (file)
@@ -50,7 +50,7 @@ impl<'a> Intel263BR<'a> {
     }
 
     fn decode_block(&mut self, quant: u8, intra: bool, coded: bool, blk: &mut [i16; 64]) -> DecoderResult<()> {
-        let mut br = &mut self.br;
+        let br = &mut self.br;
         let mut idx = 0;
         if intra {
             let mut dc = br.read(8)?;
@@ -137,10 +137,10 @@ impl<'a> BlockDecoder for Intel263BR<'a> {
 
 #[allow(unused_variables)]
     fn decode_pichdr(&mut self) -> DecoderResult<PicInfo> {
-        let mut br = &mut self.br;
+        let br = &mut self.br;
         let syncw = br.read(22)?;
         validate!(syncw == 0x000020);
-        let tr = br.read(8)? as u8;
+        let tr = (br.read(8)? << 8) as u16;
         check_marker(br)?;
         let id = br.read(1)?;
         validate!(id == 0);
@@ -205,13 +205,14 @@ impl<'a> BlockDecoder for Intel263BR<'a> {
 
         let ftype = if is_intra { Type::I } else { Type::P };
         let plusinfo = if deblock { Some(PlusInfo::new(false, deblock, false, false)) } else { None };
-        let picinfo = PicInfo::new(w, h, ftype, umv, apm, quant as u8, tr, pbinfo, plusinfo);
+        let mvmode = if umv { MVMode::UMV } else { MVMode::Old };
+        let picinfo = PicInfo::new(w, h, ftype, mvmode, umv, apm, quant as u8, tr, pbinfo, plusinfo);
         Ok(picinfo)
     }
 
     #[allow(unused_variables)]
     fn decode_slice_header(&mut self, info: &PicInfo) -> DecoderResult<SliceInfo> {
-        let mut br = &mut self.br;
+        let br = &mut self.br;
         let gbsc = br.read(17)?;
         validate!(gbsc == 1);
         let gn = br.read(5)?;
@@ -225,7 +226,7 @@ impl<'a> BlockDecoder for Intel263BR<'a> {
 
     #[allow(unused_variables)]
     fn decode_block_header(&mut self, info: &PicInfo, slice: &SliceInfo, sstate: &SliceState) -> DecoderResult<BlockInfo> {
-        let mut br = &mut self.br;
+        let br = &mut self.br;
         let mut q = slice.get_quant();
         match info.get_mode() {
             Type::I => {
@@ -316,8 +317,6 @@ impl<'a> BlockDecoder for Intel263BR<'a> {
     }
 
     fn is_slice_end(&mut self) -> bool { self.br.peek(16) == 0 }
-
-    fn is_gob(&mut self) -> bool { true }
 }
 
 impl Intel263Decoder {
@@ -345,7 +344,7 @@ impl Intel263Decoder {
 
         Intel263Decoder{
             info:           Rc::new(DUMMY_CODEC_INFO),
-            dec:            H263BaseDecoder::new(),
+            dec:            H263BaseDecoder::new(true),
             tables:         tables,
             bdsp:           H263BlockDSP::new(),
         }