From 7c37f176d137984aba6778adb241d195f986b60d Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Sun, 26 Nov 2017 19:17:05 +0100 Subject: [PATCH] rv20: fix RPR --- src/codecs/h263/rv20.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/codecs/h263/rv20.rs b/src/codecs/h263/rv20.rs index 6836759..643b550 100644 --- a/src/codecs/h263/rv20.rs +++ b/src/codecs/h263/rv20.rs @@ -361,8 +361,8 @@ impl<'a> RealVideo20BR<'a> { w = self.w; h = self.h; } else { - w = self.rpr.widths[rpr]; - h = self.rpr.heights[rpr]; + w = self.rpr.widths[rpr - 1]; + h = self.rpr.heights[rpr - 1]; validate!((w != 0) && (h != 0)); } } else { @@ -448,7 +448,7 @@ println!("ver {:06X}", ver); self.rpr.present = false; } else { self.rpr.present = true; - self.rpr.bits = rprb as u8; + self.rpr.bits = ((rprb >> 1) + 1) as u8; for i in 4..(src.len()/2) { self.rpr.widths [i - 4] = (src[i * 2] as usize) * 4; self.rpr.heights[i - 4] = (src[i * 2 + 1] as usize) * 4; @@ -456,7 +456,6 @@ println!("ver {:06X}", ver); } Ok(()) } else { -println!(".unwrap().unwrap().unwrap()"); Err(DecoderError::InvalidData) } } @@ -495,6 +494,7 @@ mod test { use test::dec_video::test_file_decoding; #[test] fn test_rv20() { - test_file_decoding("realmedia", "assets/RV/rv20_cook_640x352_realproducer_plus_8.51.rm", /*None*/Some(1000), true, false, Some("rv20")); + test_file_decoding("realmedia", "assets/RV/rv20_svt_atrc_640x352_realproducer_plus_8.51.rm", None, true, false, Some("rv20")); +// test_file_decoding("realmedia", "assets/RV/rv20_cook_640x352_realproducer_plus_8.51.rm", /*None*/Some(1000), true, false, Some("rv20")); } } -- 2.39.5