Remove mi_row and mi_col from CFL_CTX
Not really needed.
Change-Id: I0ccd4f24c851e90096f4c0dfebbaab6396e93673
diff --git a/av1/common/blockd.h b/av1/common/blockd.h
index 5ac144b..cc6f25d 100644
--- a/av1/common/blockd.h
+++ b/av1/common/blockd.h
@@ -459,8 +459,6 @@
// Chroma subsampling
int subsampling_x, subsampling_y;
- int mi_row, mi_col;
-
// Whether the reconstructed luma pixels need to be stored
int store_y;
diff --git a/av1/common/cfl.c b/av1/common/cfl.c
index 171bfdd..4553540 100644
--- a/av1/common/cfl.c
+++ b/av1/common/cfl.c
@@ -372,16 +372,17 @@
// Adjust the row and column of blocks smaller than 8X8, as chroma-referenced
// and non-chroma-referenced blocks are stored together in the CfL buffer.
-static INLINE void sub8x8_adjust_offset(const CFL_CTX *cfl, int *row_out,
+static INLINE void sub8x8_adjust_offset(const CFL_CTX *cfl, int mi_row,
+ int mi_col, int *row_out,
int *col_out) {
// Increment row index for bottom: 8x4, 16x4 or both bottom 4x4s.
- if ((cfl->mi_row & 0x01) && cfl->subsampling_y) {
+ if ((mi_row & 0x01) && cfl->subsampling_y) {
assert(*row_out == 0);
(*row_out)++;
}
// Increment col index for right: 4x8, 4x16 or both right 4x4s.
- if ((cfl->mi_col & 0x01) && cfl->subsampling_x) {
+ if ((mi_col & 0x01) && cfl->subsampling_x) {
assert(*col_out == 0);
(*col_out)++;
}
@@ -397,7 +398,7 @@
// Only dimensions of size 4 can have an odd offset.
assert(!((col & 1) && tx_size_wide[tx_size] != 4));
assert(!((row & 1) && tx_size_high[tx_size] != 4));
- sub8x8_adjust_offset(cfl, &row, &col);
+ sub8x8_adjust_offset(cfl, xd->mi_row, xd->mi_col, &row, &col);
}
cfl_store(cfl, dst, pd->dst.stride, row, col, tx_size, is_cur_buf_hbd(xd));
}
@@ -409,7 +410,7 @@
int col = 0;
if (block_size_high[bsize] == 4 || block_size_wide[bsize] == 4) {
- sub8x8_adjust_offset(cfl, &row, &col);
+ sub8x8_adjust_offset(cfl, xd->mi_row, xd->mi_col, &row, &col);
}
const int width = max_intra_block_width(xd, bsize, AOM_PLANE_Y, tx_size);
const int height = max_intra_block_height(xd, bsize, AOM_PLANE_Y, tx_size);
diff --git a/av1/decoder/decodeframe.c b/av1/decoder/decodeframe.c
index 0fd451f..6bb5775 100644
--- a/av1/decoder/decodeframe.c
+++ b/av1/decoder/decodeframe.c
@@ -345,8 +345,6 @@
xd->mi[0]->mi_row = mi_row;
xd->mi[0]->mi_col = mi_col;
#endif
- xd->cfl.mi_row = mi_row;
- xd->cfl.mi_col = mi_col;
assert(x_mis && y_mis);
for (int x = 1; x < x_mis; ++x) xd->mi[x] = xd->mi[0];
@@ -1511,8 +1509,6 @@
xd->mi = cm->mi_grid_base + offset;
xd->tx_type_map = &cm->tx_type_map[mi_row * cm->mi_stride + mi_col];
xd->tx_type_map_stride = cm->mi_stride;
- xd->cfl.mi_row = mi_row;
- xd->cfl.mi_col = mi_col;
set_plane_n4(xd, bw, bh, num_planes);
diff --git a/av1/encoder/encodeframe.c b/av1/encoder/encodeframe.c
index d5f59a3..1e4b9a2 100644
--- a/av1/encoder/encodeframe.c
+++ b/av1/encoder/encodeframe.c
@@ -421,9 +421,6 @@
// required by av1_append_sub8x8_mvs_for_idx() and av1_find_best_ref_mvs()
xd->tile = *tile;
-
- xd->cfl.mi_row = mi_row;
- xd->cfl.mi_col = mi_col;
}
static AOM_INLINE void set_offsets(const AV1_COMP *const cpi,