indeo3enc: requant input only in modes 0/3/10
authorKostya Shishkov <kostya.shishkov@gmail.com>
Wed, 15 Feb 2023 19:45:23 +0000 (20:45 +0100)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Wed, 15 Feb 2023 19:45:23 +0000 (20:45 +0100)
nihav-indeo/src/codecs/indeo3enc/cell.rs

index 910418974159e156605e478f6ff01fd9ab76b13f..582293b92a349ea968de5198673e345811070d97 100644 (file)
@@ -368,10 +368,6 @@ impl CellEncoder {
                 }
             }
             self.out[0] = (mode << 4) | (idx as u8);
-
-            if idx >= 8 {
-                requant_idx = Some(idx - 8);
-            }
         } else {
             self.out[0] = (mode << 4) | (cb_no1 as u8);
 
@@ -379,7 +375,7 @@ impl CellEncoder {
                 requant_idx = Some(cb_no1 - 8);
             }
         }
-        if self.cell.get_y() == 0 {
+        if self.cell.get_y() == 0 || !matches!(mode, 0 | 3 | 10) {
             requant_idx = None;
         }