]> git.nihav.org Git - nihav.git/blobdiff - nihav-indeo/src/codecs/indeo3enc/cell.rs
aacsbr: fix high<->low resolution envelope mapping
[nihav.git] / nihav-indeo / src / codecs / indeo3enc / cell.rs
index e5ad44c13110885458d29b0744c4c5f3af0f8e4e..582293b92a349ea968de5198673e345811070d97 100644 (file)
@@ -176,7 +176,7 @@ impl CellEncoder {
             buf:    [0; MAX_CELL_SIZE + 160],
             rbuf:   [0; MAX_CELL_SIZE + 160],
             deltas: [0; MAX_CELL_SIZE],
-            cell:   Indeo3Cell::new(0, 0, false),
+            cell:   Indeo3Cell::new(0, 0),
             out:    [0; MAX_CELL_SIZE / 2 + 1],
             osize:  0,
 
@@ -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;
         }