Remove sub-4x4 block sizes

Removes unused BLOCK_2X2, BLOCK_2X4 and BLOCK_4X2 from the
BLOCK_SIZE enum.

Change-Id: I964d99718026c51a1eaf30d4a1fc83cc52f94083
diff --git a/av1/encoder/bitstream.c b/av1/encoder/bitstream.c
index 8a3d423..8f5eec5 100644
--- a/av1/encoder/bitstream.c
+++ b/av1/encoder/bitstream.c
@@ -1941,8 +1941,7 @@
   const BLOCK_SIZE bsizec =
       scale_chroma_bsize(bsize, pd->subsampling_x, pd->subsampling_y);
 
-  const BLOCK_SIZE plane_bsize =
-      AOMMAX(BLOCK_4X4, get_plane_block_size(bsizec, pd));
+  const BLOCK_SIZE plane_bsize = get_plane_block_size(bsizec, pd);
 
   TX_SIZE max_tx_size = get_vartx_max_txsize(
       xd, plane_bsize, pd->subsampling_x || pd->subsampling_y);
@@ -2057,8 +2056,7 @@
       const BLOCK_SIZE bsize = mbmi->sb_type;
       const BLOCK_SIZE bsizec =
           scale_chroma_bsize(bsize, pd->subsampling_x, pd->subsampling_y);
-      const BLOCK_SIZE plane_bsize =
-          AOMMAX(BLOCK_4X4, get_plane_block_size(bsizec, pd));
+      const BLOCK_SIZE plane_bsize = get_plane_block_size(bsizec, pd);
 
       const int num_4x4_w =
           block_size_wide[plane_bsize] >> tx_size_wide_log2[0];
diff --git a/av1/encoder/encodeframe.c b/av1/encoder/encodeframe.c
index 2a0ce53..45b76c6 100644
--- a/av1/encoder/encodeframe.c
+++ b/av1/encoder/encodeframe.c
@@ -153,54 +153,28 @@
 
 #if CONFIG_FP_MB_STATS
 static const uint8_t num_16x16_blocks_wide_lookup[BLOCK_SIZES_ALL] = {
-  1,
-  1,
-  1,
-  1,
-  1,
-  1,
-  1,
-  1,
-  1,
-  1,
-  1,
-  2,
-  2,
-  2,
-  4,
-  4,
-  IF_EXT_PARTITION(4, 8, 8) 1,
-  1,
-  1,
-  2,
-  2,
-  4,
-  IF_EXT_PARTITION(2, 8)
+  1, 1,
+  1, 1,
+  1, 1,
+  1, 1,
+  2, 2,
+  2, 4,
+  4, IF_EXT_PARTITION(4, 8, 8) 1,
+  1, 1,
+  2, 2,
+  4, IF_EXT_PARTITION(2, 8)
 };
 static const uint8_t num_16x16_blocks_high_lookup[BLOCK_SIZES_ALL] = {
-  1,
-  1,
-  1,
-  1,
-  1,
-  1,
-  1,
-  1,
-  1,
-  1,
-  2,
-  1,
-  2,
-  4,
-  2,
-  4,
-  IF_EXT_PARTITION(8, 4, 8) 1,
-  1,
-  2,
-  1,
-  4,
-  2,
-  IF_EXT_PARTITION(8, 2)
+  1, 1,
+  1, 1,
+  1, 1,
+  1, 2,
+  1, 2,
+  4, 2,
+  4, IF_EXT_PARTITION(8, 4, 8) 1,
+  1, 2,
+  1, 4,
+  2, IF_EXT_PARTITION(8, 2)
 };
 #endif  // CONFIG_FP_MB_STATS
 
@@ -1853,7 +1827,6 @@
 
 /* clang-format off */
 static const BLOCK_SIZE min_partition_size[BLOCK_SIZES_ALL] = {
-  BLOCK_2X2,   BLOCK_2X2,   BLOCK_2X2,    //    2x2,    2x4,     4x2
                             BLOCK_4X4,    //                     4x4
   BLOCK_4X4,   BLOCK_4X4,   BLOCK_4X4,    //    4x8,    8x4,     8x8
   BLOCK_4X4,   BLOCK_4X4,   BLOCK_8X8,    //   8x16,   16x8,   16x16
@@ -1870,7 +1843,6 @@
 };
 
 static const BLOCK_SIZE max_partition_size[BLOCK_SIZES_ALL] = {
-  BLOCK_4X4,     BLOCK_4X4,       BLOCK_4X4,    //    2x2,    2x4,     4x2
                                   BLOCK_8X8,    //                     4x4
   BLOCK_16X16,   BLOCK_16X16,   BLOCK_16X16,    //    4x8,    8x4,     8x8
   BLOCK_32X32,   BLOCK_32X32,   BLOCK_32X32,    //   8x16,   16x8,   16x16
@@ -1888,7 +1860,6 @@
 
 // Next square block size less or equal than current block size.
 static const BLOCK_SIZE next_square_size[BLOCK_SIZES_ALL] = {
-  BLOCK_2X2,   BLOCK_2X2,     BLOCK_2X2,    //    2x2,    2x4,     4x2
                               BLOCK_4X4,    //                     4x4
   BLOCK_4X4,   BLOCK_4X4,     BLOCK_8X8,    //    4x8,    8x4,     8x8
   BLOCK_8X8,   BLOCK_8X8,     BLOCK_16X16,  //   8x16,   16x8,   16x16
@@ -2257,7 +2228,7 @@
     const int src_stride_uv = x->plane[plane].src.stride;
     const int dst_stride_uv = xd->plane[plane].dst.stride;
     const BLOCK_SIZE plane_bsize =
-        AOMMAX(BLOCK_4X4, get_plane_block_size(BLOCK_8X8, &xd->plane[plane]));
+        get_plane_block_size(BLOCK_8X8, &xd->plane[plane]);
 
     cpi->fn_ptr[plane_bsize].vf(src_plane_8x8[plane], src_stride_uv,
                                 dst_plane_8x8[plane], dst_stride_uv, &sse);
diff --git a/av1/encoder/encoder.c b/av1/encoder/encoder.c
index e12a6f2..6fa3932 100644
--- a/av1/encoder/encoder.c
+++ b/av1/encoder/encoder.c
@@ -1569,13 +1569,6 @@
             aom_highbd_8_sub_pixel_avg_variance4x4, aom_highbd_sad4x4x3_bits8,
             aom_highbd_sad4x4x8_bits8, aom_highbd_sad4x4x4d_bits8)
 
-        HIGHBD_BFP(BLOCK_2X2, NULL, NULL, aom_highbd_8_variance2x2, NULL, NULL,
-                   NULL, NULL, NULL)
-        HIGHBD_BFP(BLOCK_4X2, NULL, NULL, aom_highbd_8_variance4x2, NULL, NULL,
-                   NULL, NULL, NULL)
-        HIGHBD_BFP(BLOCK_2X4, NULL, NULL, aom_highbd_8_variance2x4, NULL, NULL,
-                   NULL, NULL, NULL)
-
 #if CONFIG_EXT_PARTITION
         HIGHBD_BFP(BLOCK_128X128, aom_highbd_sad128x128_bits8,
                    aom_highbd_sad128x128_avg_bits8,
@@ -1884,13 +1877,6 @@
             aom_highbd_10_sub_pixel_avg_variance4x4, aom_highbd_sad4x4x3_bits10,
             aom_highbd_sad4x4x8_bits10, aom_highbd_sad4x4x4d_bits10)
 
-        HIGHBD_BFP(BLOCK_2X2, NULL, NULL, aom_highbd_10_variance2x2, NULL, NULL,
-                   NULL, NULL, NULL)
-        HIGHBD_BFP(BLOCK_4X2, NULL, NULL, aom_highbd_10_variance4x2, NULL, NULL,
-                   NULL, NULL, NULL)
-        HIGHBD_BFP(BLOCK_2X4, NULL, NULL, aom_highbd_10_variance2x4, NULL, NULL,
-                   NULL, NULL, NULL)
-
 #if CONFIG_EXT_PARTITION
         HIGHBD_BFP(
             BLOCK_128X128, aom_highbd_sad128x128_bits10,
@@ -2201,13 +2187,6 @@
             aom_highbd_12_sub_pixel_avg_variance4x4, aom_highbd_sad4x4x3_bits12,
             aom_highbd_sad4x4x8_bits12, aom_highbd_sad4x4x4d_bits12)
 
-        HIGHBD_BFP(BLOCK_2X2, NULL, NULL, aom_highbd_12_variance2x2, NULL, NULL,
-                   NULL, NULL, NULL)
-        HIGHBD_BFP(BLOCK_4X2, NULL, NULL, aom_highbd_12_variance4x2, NULL, NULL,
-                   NULL, NULL, NULL)
-        HIGHBD_BFP(BLOCK_2X4, NULL, NULL, aom_highbd_12_variance2x4, NULL, NULL,
-                   NULL, NULL, NULL)
-
 #if CONFIG_EXT_PARTITION
         HIGHBD_BFP(
             BLOCK_128X128, aom_highbd_sad128x128_bits12,
@@ -2904,12 +2883,6 @@
       aom_sad4x4x8, aom_sad4x4x4d, aom_jnt_sad4x4_avg,
       aom_jnt_sub_pixel_avg_variance4x4)
 
-  BFP(BLOCK_2X2, NULL, NULL, aom_variance2x2, NULL, NULL, NULL, NULL, NULL,
-      NULL, NULL)
-  BFP(BLOCK_2X4, NULL, NULL, aom_variance2x4, NULL, NULL, NULL, NULL, NULL,
-      NULL, NULL)
-  BFP(BLOCK_4X2, NULL, NULL, aom_variance4x2, NULL, NULL, NULL, NULL, NULL,
-      NULL, NULL)
 #else  // CONFIG_JNT_COMP
 #if CONFIG_EXT_PARTITION_TYPES
   BFP(BLOCK_4X16, aom_sad4x16, aom_sad4x16_avg, aom_variance4x16,
@@ -3013,9 +2986,6 @@
       aom_sub_pixel_variance4x4, aom_sub_pixel_avg_variance4x4, aom_sad4x4x3,
       aom_sad4x4x8, aom_sad4x4x4d)
 
-  BFP(BLOCK_2X2, NULL, NULL, aom_variance2x2, NULL, NULL, NULL, NULL, NULL)
-  BFP(BLOCK_2X4, NULL, NULL, aom_variance2x4, NULL, NULL, NULL, NULL, NULL)
-  BFP(BLOCK_4X2, NULL, NULL, aom_variance4x2, NULL, NULL, NULL, NULL, NULL)
 #endif  // CONFIG_JNT_COMP
 
 #define OBFP(BT, OSDF, OVF, OSVF) \
diff --git a/av1/encoder/rd.c b/av1/encoder/rd.c
index 483a1e5..e88794e 100644
--- a/av1/encoder/rd.c
+++ b/av1/encoder/rd.c
@@ -54,7 +54,7 @@
 // This table is used to correct for block size.
 // The factors here are << 2 (2 = x0.5, 32 = x8 etc).
 static const uint8_t rd_thresh_block_size_factor[BLOCK_SIZES_ALL] = {
-  2,  2,  2,  2, 3,  3,  4, 6, 6, 8, 12, 12, 16, 24, 24, 32,
+  2,  3,  3,  4, 6,  6,  8, 12, 12, 16, 24, 24, 32,
 #if CONFIG_EXT_PARTITION
   48, 48, 64,
 #endif  // CONFIG_EXT_PARTITION
@@ -870,8 +870,7 @@
                               const struct macroblockd_plane *pd,
                               ENTROPY_CONTEXT t_above[2 * MAX_MIB_SIZE],
                               ENTROPY_CONTEXT t_left[2 * MAX_MIB_SIZE]) {
-  const BLOCK_SIZE plane_bsize =
-      AOMMAX(BLOCK_4X4, get_plane_block_size(bsize, pd));
+  const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd);
   get_entropy_contexts_plane(plane_bsize, tx_size, pd, t_above, t_left);
 }
 
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c
index 8c26e33..e8498fb 100644
--- a/av1/encoder/rdopt.c
+++ b/av1/encoder/rdopt.c
@@ -1515,7 +1515,7 @@
   for (plane = plane_from; plane <= plane_to; ++plane) {
     struct macroblock_plane *const p = &x->plane[plane];
     struct macroblockd_plane *const pd = &xd->plane[plane];
-    const BLOCK_SIZE bs = AOMMAX(BLOCK_4X4, get_plane_block_size(bsize, pd));
+    const BLOCK_SIZE bs = get_plane_block_size(bsize, pd);
     unsigned int sse;
     int rate;
     int64_t dist;
@@ -1733,8 +1733,7 @@
   const MB_MODE_INFO *mbmi = &xd->mi[0]->mbmi;
   const struct macroblockd_plane *pd = &xd->plane[plane];
   const BLOCK_SIZE bsize = mbmi->sb_type;
-  const BLOCK_SIZE plane_bsize =
-      AOMMAX(BLOCK_4X4, get_plane_block_size(bsize, pd));
+  const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd);
   TXB_CTX txb_ctx;
   get_txb_ctx(plane_bsize, tx_size, plane, a, l, &txb_ctx);
   int cost = av1_cost_coeffs_txb(cm, x, plane, blk_row, blk_col, block, tx_size,
@@ -4683,7 +4682,7 @@
 
 static const uint32_t skip_pred_threshold[3][BLOCK_SIZES_ALL] = {
   {
-      0,  0,  0,  50, 50, 50, 55, 47, 47, 53, 53, 53, 53, 53, 53, 53,
+      50, 50, 50, 55, 47, 47, 53, 53, 53, 53, 53, 53, 53,
 #if CONFIG_EXT_PARTITION
       53, 53, 53,
 #endif
@@ -4693,7 +4692,7 @@
 #endif
   },
   {
-      0,  0,  0,  69, 69, 69, 67, 68, 68, 53, 53, 53, 53, 53, 53, 53,
+      69, 69, 69, 67, 68, 68, 53, 53, 53, 53, 53, 53, 53,
 #if CONFIG_EXT_PARTITION
       53, 53, 53,
 #endif
@@ -4703,7 +4702,7 @@
 #endif
   },
   {
-      0,  0,  0,  70, 73, 73, 70, 73, 73, 58, 58, 58, 58, 58, 58, 58,
+      70, 73, 73, 70, 73, 73, 58, 58, 58, 58, 58, 58, 58,
 #if CONFIG_EXT_PARTITION
       58, 58, 58,
 #endif
@@ -5434,8 +5433,8 @@
   const BLOCK_SIZE bsize = mbmi->sb_type;
 #if CONFIG_DEBUG
   assert(is_cfl_allowed(mbmi));
-  const BLOCK_SIZE plane_bsize = AOMMAX(
-      BLOCK_4X4, get_plane_block_size(mbmi->sb_type, &xd->plane[AOM_PLANE_U]));
+  const BLOCK_SIZE plane_bsize =
+      get_plane_block_size(mbmi->sb_type, &xd->plane[AOM_PLANE_U]);
   assert(plane_bsize < BLOCK_SIZES_ALL);
   assert(block_size_wide[plane_bsize] == tx_size_wide[tx_size]);
   assert(block_size_high[plane_bsize] == tx_size_high[tx_size]);
diff --git a/av1/encoder/tokenize.c b/av1/encoder/tokenize.c
index d2acee8..4348d68 100644
--- a/av1/encoder/tokenize.c
+++ b/av1/encoder/tokenize.c
@@ -620,8 +620,7 @@
     const struct macroblockd_plane *const pd = &xd->plane[plane];
     const BLOCK_SIZE bsizec =
         scale_chroma_bsize(bsize, pd->subsampling_x, pd->subsampling_y);
-    const BLOCK_SIZE plane_bsize =
-        AOMMAX(BLOCK_4X4, get_plane_block_size(bsizec, pd));
+    const BLOCK_SIZE plane_bsize = get_plane_block_size(bsizec, pd);
     const int mi_width = block_size_wide[plane_bsize] >> tx_size_wide_log2[0];
     const int mi_height = block_size_high[plane_bsize] >> tx_size_wide_log2[0];
     TX_SIZE max_tx_size = get_vartx_max_txsize(