cb4x4: Move sub-4X4 TX sizes behind CONFIG_CHROMA_2X2.
cb4x4 itself should not require these sizes.
This simplifies compatibility with other experiments, since we can
first make them work with cb4x4 (which is now on by default), and
then worry about chroma_2x2 (which is not) in separate steps.
Encoder and decoder output should remain unchanged.
Change-Id: I4e9fcdae49f238b5099a3c74a398fe993c2545f8
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c
index 962c4c6..39cd27d 100644
--- a/av1/encoder/rdopt.c
+++ b/av1/encoder/rdopt.c
@@ -2671,7 +2671,7 @@
const int dst_stride = pd->dst.stride;
const uint8_t *src_init = &p->src.buf[row * 4 * src_stride + col * 4];
uint8_t *dst_init = &pd->dst.buf[row * 4 * dst_stride + col * 4];
-#if CONFIG_CB4X4
+#if CONFIG_CHROMA_2X2
// TODO(jingning): This is a temporal change. The whole function should be
// out when cb4x4 is enabled.
ENTROPY_CONTEXT ta[4], tempa[4];
@@ -2679,7 +2679,7 @@
#else
ENTROPY_CONTEXT ta[2], tempa[2];
ENTROPY_CONTEXT tl[2], templ[2];
-#endif // CONFIG_CB4X4
+#endif // CONFIG_CHROMA_2X2
const int pred_width_in_4x4_blocks = num_4x4_blocks_wide_lookup[bsize];
const int pred_height_in_4x4_blocks = num_4x4_blocks_high_lookup[bsize];
@@ -4991,7 +4991,6 @@
rd_pick_intra_sbuv_mode(cpi, x, rate_uv, rate_uv_tokenonly, dist_uv, skip_uv,
bsize, max_tx_size);
#else
- max_tx_size = AOMMAX(max_tx_size, TX_4X4);
if (x->skip_chroma_rd) {
*rate_uv = 0;
*rate_uv_tokenonly = 0;
@@ -5351,13 +5350,13 @@
int_mv ref_mv[2];
#endif // CONFIG_EXT_INTER
-#if CONFIG_CB4X4
+#if CONFIG_CHROMA_2X2
ENTROPY_CONTEXT ta[4];
ENTROPY_CONTEXT tl[4];
#else
ENTROPY_CONTEXT ta[2];
ENTROPY_CONTEXT tl[2];
-#endif // CONFIG_CB4X4
+#endif // CONFIG_CHROMA_2X2
} SEG_RDSTAT;
typedef struct {
@@ -5828,11 +5827,11 @@
const BLOCK_SIZE bsize = mbmi->sb_type;
const int num_4x4_blocks_wide = num_4x4_blocks_wide_lookup[bsize];
const int num_4x4_blocks_high = num_4x4_blocks_high_lookup[bsize];
-#if CONFIG_CB4X4
+#if CONFIG_CHROMA_2X2
ENTROPY_CONTEXT t_above[4], t_left[4];
#else
ENTROPY_CONTEXT t_above[2], t_left[2];
-#endif // CONFIG_CB4X4
+#endif // CONFIG_CHROMA_2X2
int subpelmv = 1, have_ref = 0;
const int has_second_rf = has_second_ref(mbmi);
const int inter_mode_mask = cpi->sf.inter_mode_mask[bsize];
@@ -9481,9 +9480,6 @@
[pd[1].subsampling_x][pd[1].subsampling_y];
init_sbuv_mode(&xd->mi[0]->mbmi);
#if CONFIG_CB4X4
-#if !CONFIG_CHROMA_2X2
- max_uv_tx_size = AOMMAX(max_uv_tx_size, TX_4X4);
-#endif // !CONFIG_CHROMA_2X2
if (!x->skip_chroma_rd)
rd_pick_intra_sbuv_mode(cpi, x, &rate_uv, &rate_uv_tokenonly, &dist_uv,
&uv_skip, bsize, max_uv_tx_size);