+ pub fn prune_extra_mvs(&mut self, tree: &mut Box<Indeo3PrimaryTree>) {
+ let cell = Indeo3Cell::new(self.width, self.height, true);
+ self.prune_pri(cell, tree)
+ }
+ fn prune_pri(&mut self, cell: Indeo3Cell, tree: &mut Box<Indeo3PrimaryTree>) {
+ match tree.deref_mut() {
+ Indeo3PrimaryTree::HSplit(ref mut tree1, ref mut tree2) => {
+ let (cell1, cell2) = cell.split_h();
+ self.prune_pri(cell1, tree1);
+ self.prune_pri(cell2, tree2);
+ },
+ Indeo3PrimaryTree::VSplit(ref mut tree1, ref mut tree2) => {
+ let (cell1, cell2) = cell.split_v(self.stripw);
+ self.prune_pri(cell1, tree1);
+ self.prune_pri(cell2, tree2);
+ },
+ Indeo3PrimaryTree::AbsFill(_) => {},
+ Indeo3PrimaryTree::RelFill(ref mv, ref _sec) => {
+ if find_mv(*mv, &self.mvs).is_none() {
+ let sec = self.split_sec(cell);
+ *tree = Box::new(Indeo3PrimaryTree::AbsFill(sec));
+ }
+ },
+ }
+ }