Commit a74b0084 authored by Yushin Cho's avatar Yushin Cho Committed by Yushin Cho

Move set_tx_size() to encode_block_b()

parent 06204913
......@@ -1493,10 +1493,10 @@ impl BlockContext {
self.for_each(bo, bsize, |block| { block.n4_w = n4_w; block.n4_h = n4_h } );
}
pub fn set_tx_size(&mut self, bo: BlockOffset, txsize: TxSize) {
pub fn set_tx_size(&mut self, bo: BlockOffset, bsize: BlockSize, txsize: TxSize) {
let tx_w = txsize.width_mi();
let tx_h = txsize.height_mi();
self.for_each(bo, txsize.block_size(), |block| { block.tx_w = tx_w; block.tx_h = tx_h } );
self.for_each(bo, bsize, |block| { block.tx_w = tx_w; block.tx_h = tx_h } );
}
pub fn get_mode(&mut self, bo: BlockOffset) -> PredictionMode {
......
......@@ -1168,6 +1168,7 @@ pub fn encode_block_b<T: Pixel>(
}
cw.bc.set_block_size(bo, bsize);
cw.bc.set_mode(bo, bsize, luma_mode);
cw.bc.set_tx_size(bo, bsize, tx_size);
cw.bc.set_ref_frames(bo, bsize, ref_frames);
cw.bc.set_motion_vectors(bo, bsize, mvs);
......@@ -1505,7 +1506,6 @@ pub fn encode_block_with_modes<T: Pixel>(
debug_assert!((tx_size, tx_type) ==
rdo_tx_size_type(fi, fs, cw, bsize, bo, mode_luma, ref_frames, mvs, skip));
cw.bc.set_tx_size(bo, tx_size);
let mut mv_stack = Vec::new();
let is_compound = ref_frames[1] != NONE_FRAME;
......
......@@ -384,8 +384,6 @@ pub fn rdo_tx_size_type<T: Pixel>(
_ => unimplemented!()
}
};
cw.bc.set_tx_size(bo, tx_size);
// Were we not hardcoded to TX_MODE_LARGEST, block tx size would be written here
// Luma plane transform type decision
let is_inter = !luma_mode.is_intra();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment