Add block size in pixels lookup table

This prepares for the next refactoring to support 2x2 transform
block sizes.

Change-Id: Ia06bc487da34e853ef9323cd13e3d482e819db43
diff --git a/av1/common/blockd.h b/av1/common/blockd.h
index bc1970c..8d7c7f8 100644
--- a/av1/common/blockd.h
+++ b/av1/common/blockd.h
@@ -307,6 +307,8 @@
   uint16_t n4_w, n4_h;
   // log2 of n4_w, n4_h
   uint8_t n4_wl, n4_hl;
+  // block size in pixels
+  uint8_t width, height;
 
 #if CONFIG_AOM_QM
   const qm_val_t *seg_iqmatrix[MAX_SEGMENTS][2][TX_SIZES];
diff --git a/av1/common/common_data.h b/av1/common/common_data.h
index 528343b..88bfb0a 100644
--- a/av1/common/common_data.h
+++ b/av1/common/common_data.h
@@ -42,6 +42,12 @@
 };
 
 // Width/height lookup tables in units of various block sizes
+static const uint8_t block_size_wide[BLOCK_SIZES] = {
+  4, 4, 8, 8, 8, 16, 16, 16, 32, 32, 32, 64, 64, IF_EXT_PARTITION(64, 128, 128)
+};
+static const uint8_t block_size_high[BLOCK_SIZES] = {
+  4, 8, 4, 8, 16, 8, 16, 32, 16, 32, 64, 32, 64, IF_EXT_PARTITION(128, 64, 128)
+};
 static const uint8_t num_4x4_blocks_wide_lookup[BLOCK_SIZES] = {
   1, 1, 2, 2, 2, 4, 4, 4, 8, 8, 8, 16, 16, IF_EXT_PARTITION(16, 32, 32)
 };
diff --git a/av1/common/onyxc_int.h b/av1/common/onyxc_int.h
index 3c8eac8..bd810d4 100644
--- a/av1/common/onyxc_int.h
+++ b/av1/common/onyxc_int.h
@@ -524,6 +524,10 @@
                                 int bhl) {
   int i;
   for (i = 0; i < MAX_MB_PLANE; i++) {
+    xd->plane[i].width =
+        block_size_wide[xd->mi[0]->mbmi.sb_type] >> xd->plane[i].subsampling_x;
+    xd->plane[i].height =
+        block_size_high[xd->mi[0]->mbmi.sb_type] >> xd->plane[i].subsampling_y;
     xd->plane[i].n4_w = (bw << 1) >> xd->plane[i].subsampling_x;
     xd->plane[i].n4_h = (bh << 1) >> xd->plane[i].subsampling_y;
     xd->plane[i].n4_wl = bwl - xd->plane[i].subsampling_x;