realvideo2: fix dequant for I-frames
authorKostya Shishkov <kostya.shishkov@gmail.com>
Sat, 24 Feb 2018 14:09:08 +0000 (15:09 +0100)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Sat, 24 Feb 2018 17:35:30 +0000 (18:35 +0100)
src/codecs/h263/rv20.rs

index 3298fab3aaafe38912b73cac63e395b758704fd9..c734bc923a6a773641daf9931b1e8bc181637bf4 100644 (file)
@@ -128,7 +128,7 @@ impl<'a> RealVideo20BR<'a> {
                 };
 
         let rl_cb = if sstate.is_iframe { &self.tables.aic_rl_cb } else { &self.tables.rl_cb };
-        let q_add = if quant == 0 { 0i16 } else { ((quant - 1) | 1) as i16 };
+        let q_add = if quant == 0 || sstate.is_iframe { 0i16 } else { ((quant - 1) | 1) as i16 };
         let q = (quant * 2) as i16;
         while idx < 64 {
             let code = br.read_cb(rl_cb)?;