Commit 1b33845c authored by Romain Vimont's avatar Romain Vimont Committed by Romain Vimont

Remove cols and rows from BlockContext

They are redundant with those of FrameBlocks.
parent 3c29f358
......@@ -1444,8 +1444,6 @@ pub struct BlockContextCheckpoint {
#[derive(Clone)]
pub struct BlockContext {
pub cols: usize,
pub rows: usize,
pub cdef_coded: bool,
pub code_deltas: bool,
pub update_seg: bool,
......@@ -1468,8 +1466,6 @@ impl BlockContext {
cols << (MI_SIZE_LOG2 - TxSize::width_log2(TxSize::TX_4X4));
BlockContext {
cols,
rows,
cdef_coded: false,
code_deltas: false,
update_seg: false,
......@@ -2017,8 +2013,8 @@ impl ContextWriter {
debug_assert!(bsize.is_sqr());
assert!(bsize >= BlockSize::BLOCK_8X8 );
let hbs = bsize.width_mi() / 2;
let has_cols = (bo.x + hbs) < self.bc.cols;
let has_rows = (bo.y + hbs) < self.bc.rows;
let has_cols = (bo.x + hbs) < self.bc.blocks.cols;
let has_rows = (bo.y + hbs) < self.bc.blocks.rows;
let ctx = self.bc.partition_plane_context(bo, bsize);
assert!(ctx < PARTITION_CONTEXTS);
let partition_cdf = if bsize <= BlockSize::BLOCK_8X8 {
......@@ -2360,7 +2356,7 @@ impl ContextWriter {
let bc = &self.bc;
let target_n4_w = bsize.width_mi();
let end_mi = cmp::min(cmp::min(target_n4_w, bc.cols - bo.x),
let end_mi = cmp::min(cmp::min(target_n4_w, bc.blocks.cols - bo.x),
BLOCK_64X64.width_mi());
let n4_w_8 = BLOCK_8X8.width_mi();
let n4_w_16 = BLOCK_16X16.width_mi();
......@@ -2415,7 +2411,7 @@ impl ContextWriter {
let target_n4_h = bsize.height_mi();
let end_mi = cmp::min(cmp::min(target_n4_h, bc.rows - bo.y),
let end_mi = cmp::min(cmp::min(target_n4_h, bc.blocks.rows - bo.y),
BLOCK_64X64.height_mi());
let n4_h_8 = BLOCK_8X8.height_mi();
let n4_h_16 = BLOCK_16X16.height_mi();
......@@ -2464,7 +2460,7 @@ impl ContextWriter {
fn scan_blk_mbmi(&mut self, bo: BlockOffset, ref_frames: [RefType; 2],
mv_stack: &mut Vec<CandidateMV>, newmv_count: &mut usize,
is_compound: bool) -> bool {
if bo.x >= self.bc.cols || bo.y >= self.bc.rows {
if bo.x >= self.bc.blocks.cols || bo.y >= self.bc.blocks.rows {
return false;
}
......@@ -2508,7 +2504,7 @@ impl ContextWriter {
max_row_offs = -2 * 2 + row_adj as isize;
}
let rows = self.bc.rows;
let rows = self.bc.blocks.rows;
max_row_offs = self.find_valid_row_offs(max_row_offs, bo.y, rows);
}
......@@ -2592,8 +2588,8 @@ impl ContextWriter {
if mv_stack.len() < 2 {
// 7.10.2.12 Extra search process
let w4 = bsize.width_mi().min(16).min(self.bc.cols - bo.x);
let h4 = bsize.height_mi().min(16).min(self.bc.rows - bo.y);
let w4 = bsize.width_mi().min(16).min(self.bc.blocks.cols - bo.x);
let h4 = bsize.height_mi().min(16).min(self.bc.blocks.rows - bo.y);
let num4x4 = w4.min(h4);
let passes = if up_avail { 0 } else { 1 } .. if left_avail { 2 } else { 1 };
......@@ -2685,9 +2681,9 @@ impl ContextWriter {
let border_w = 128 + blk_w as isize * 8;
let border_h = 128 + blk_h as isize * 8;
let mvx_min = -(bo.x as isize) * (8 * MI_SIZE) as isize - border_w;
let mvx_max = (self.bc.cols - bo.x - blk_w / MI_SIZE) as isize * (8 * MI_SIZE) as isize + border_w;
let mvx_max = (self.bc.blocks.cols - bo.x - blk_w / MI_SIZE) as isize * (8 * MI_SIZE) as isize + border_w;
let mvy_min = -(bo.y as isize) * (8 * MI_SIZE) as isize - border_h;
let mvy_max = (self.bc.rows - bo.y - blk_h / MI_SIZE) as isize * (8 * MI_SIZE) as isize + border_h;
let mvy_max = (self.bc.blocks.rows - bo.y - blk_h / MI_SIZE) as isize * (8 * MI_SIZE) as isize + border_h;
mv.this_mv.row = (mv.this_mv.row as isize).max(mvy_min).min(mvy_max) as i16;
mv.this_mv.col = (mv.this_mv.col as isize).max(mvx_min).min(mvx_max) as i16;
mv.comp_mv.row = (mv.comp_mv.row as isize).max(mvy_min).min(mvy_max) as i16;
......
......@@ -1573,7 +1573,7 @@ fn encode_partition_bottomup<T: Pixel>(
part_modes: Vec::new()
};
if bo.x >= cw.bc.cols || bo.y >= cw.bc.rows {
if bo.x >= cw.bc.blocks.cols || bo.y >= cw.bc.blocks.rows {
return rdo_output
}
......@@ -1781,7 +1781,7 @@ fn encode_partition_topdown<T: Pixel>(
pmvs: &[[Option<MotionVector>; REF_FRAMES]; 5]
) {
if bo.x >= cw.bc.cols || bo.y >= cw.bc.rows {
if bo.x >= cw.bc.blocks.cols || bo.y >= cw.bc.blocks.rows {
return;
}
let bsw = bsize.width_mi();
......
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