The bsize == plane_bsize for a luma plane

Change-Id: Ibc21825b9138891941ea50a15a8bae8ad31f9b8f
diff --git a/av1/decoder/decodeframe.c b/av1/decoder/decodeframe.c
index 0e35b22..2ad38ae 100644
--- a/av1/decoder/decodeframe.c
+++ b/av1/decoder/decodeframe.c
@@ -368,13 +368,11 @@
   if (mbmi->skip) av1_reset_skip_context(xd, mi_row, mi_col, bsize, num_planes);
 
   if (!is_inter_block(mbmi)) {
-    const struct macroblockd_plane *const y_pd = &xd->plane[0];
-    const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, y_pd);
     int row, col;
-    const int max_blocks_wide = max_block_wide(xd, plane_bsize, 0);
-    const int max_blocks_high = max_block_high(xd, plane_bsize, 0);
-
-    const BLOCK_SIZE max_unit_bsize = get_plane_block_size(BLOCK_64X64, y_pd);
+    assert(bsize == get_plane_block_size(bsize, &xd->plane[0]));
+    const int max_blocks_wide = max_block_wide(xd, bsize, 0);
+    const int max_blocks_high = max_block_high(xd, bsize, 0);
+    const BLOCK_SIZE max_unit_bsize = BLOCK_64X64;
     int mu_blocks_wide =
         block_size_wide[max_unit_bsize] >> tx_size_wide_log2[0];
     int mu_blocks_high =
@@ -447,12 +445,13 @@
     if (!mbmi->skip) {
       int eobtotal = 0;
 
-      const struct macroblockd_plane *const y_pd = &xd->plane[0];
       const int max_blocks_wide = max_block_wide(xd, bsize, 0);
       const int max_blocks_high = max_block_high(xd, bsize, 0);
       int row, col;
 
-      const BLOCK_SIZE max_unit_bsize = get_plane_block_size(BLOCK_64X64, y_pd);
+      const BLOCK_SIZE max_unit_bsize = BLOCK_64X64;
+      assert(max_unit_bsize ==
+             get_plane_block_size(BLOCK_64X64, &xd->plane[0]));
       int mu_blocks_wide =
           block_size_wide[max_unit_bsize] >> tx_size_wide_log2[0];
       int mu_blocks_high =
diff --git a/av1/encoder/bitstream.c b/av1/encoder/bitstream.c
index 0898112..3c00564 100644
--- a/av1/encoder/bitstream.c
+++ b/av1/encoder/bitstream.c
@@ -1452,8 +1452,8 @@
 
     if (is_inter_block(mbmi)) {
       int block[MAX_MB_PLANE] = { 0 };
-      const struct macroblockd_plane *const y_pd = &xd->plane[0];
-      const BLOCK_SIZE plane_bsize = get_plane_block_size(mbmi->sb_type, y_pd);
+      const BLOCK_SIZE plane_bsize = mbmi->sb_type;
+      assert(plane_bsize == get_plane_block_size(mbmi->sb_type, &xd->plane[0]));
       const int num_4x4_w =
           block_size_wide[plane_bsize] >> tx_size_wide_log2[0];
       const int num_4x4_h =
@@ -1462,7 +1462,9 @@
       TOKEN_STATS token_stats;
       init_token_stats(&token_stats);
 
-      const BLOCK_SIZE max_unit_bsize = get_plane_block_size(BLOCK_64X64, y_pd);
+      const BLOCK_SIZE max_unit_bsize = BLOCK_64X64;
+      assert(max_unit_bsize ==
+             get_plane_block_size(BLOCK_64X64, &xd->plane[0]));
       int mu_blocks_wide =
           block_size_wide[max_unit_bsize] >> tx_size_wide_log2[0];
       int mu_blocks_high =
diff --git a/av1/encoder/encodetxb.c b/av1/encoder/encodetxb.c
index cc79d31..430e6ca 100644
--- a/av1/encoder/encodetxb.c
+++ b/av1/encoder/encodetxb.c
@@ -614,11 +614,10 @@
   const int num_planes = av1_num_planes(cm);
   int block[MAX_MB_PLANE] = { 0 };
   int row, col;
-  const struct macroblockd_plane *const y_pd = &xd->plane[0];
-  const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, y_pd);
-  const int max_blocks_wide = max_block_wide(xd, plane_bsize, 0);
-  const int max_blocks_high = max_block_high(xd, plane_bsize, 0);
-  const BLOCK_SIZE max_unit_bsize = get_plane_block_size(BLOCK_64X64, y_pd);
+  assert(bsize == get_plane_block_size(bsize, &xd->plane[0]));
+  const int max_blocks_wide = max_block_wide(xd, bsize, 0);
+  const int max_blocks_high = max_block_high(xd, bsize, 0);
+  const BLOCK_SIZE max_unit_bsize = BLOCK_64X64;
   int mu_blocks_wide = block_size_wide[max_unit_bsize] >> tx_size_wide_log2[0];
   int mu_blocks_high = block_size_high[max_unit_bsize] >> tx_size_high_log2[0];
   mu_blocks_wide = AOMMIN(max_blocks_wide, mu_blocks_wide);