]> git.nihav.org Git - nihav.git/blobdiff - src/codecs/h263/intel263.rs
h263: decoder should use BlockDSP interface
[nihav.git] / src / codecs / h263 / intel263.rs
index f519b9c76d75e00cf3c51e4843f07408c68b8d23..14ddeac75237b4c85841aa9017024bce78363e46 100644 (file)
@@ -140,7 +140,7 @@ impl<'a> BlockDecoder for Intel263BR<'a> {
         let mut 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,7 +205,8 @@ 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)
     }
 
@@ -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(),
         }
@@ -405,6 +404,6 @@ mod test {
     use test::dec_video::test_file_decoding;
     #[test]
     fn test_intel263() {
-         test_file_decoding("avi", "assets/neal73_saber.avi", Some(16), true, false, Some("i263"));
+         test_file_decoding("avi", "assets/neal73_saber.avi", Some(16), true, false, None/*Some("i263")*/);
     }
 }