Refactor tx_size to pixel number in decodeframe.c

Use the table access to retrieve pixel numbers from tx_size.

Change-Id: I9459f2c3292c2f9ddf963f16b79e142de7432031
diff --git a/av1/common/common_data.h b/av1/common/common_data.h
index 4165e35..f068ee7 100644
--- a/av1/common/common_data.h
+++ b/av1/common/common_data.h
@@ -444,7 +444,12 @@
 
 static const int tx_size_1d[TX_SIZES] = { 4, 8, 16, 32 };
 
-static const int tx_size_2d[TX_SIZES] = { 16, 64, 256, 1024 };
+static const int tx_size_2d[TX_SIZES_ALL] = {
+  16, 64, 256, 1024,
+#if CONFIG_EXT_TX
+  32, 32, 128, 128,  512, 512,
+#endif
+};
 
 static const uint8_t tx_size_1d_log2[TX_SIZES] = { 2, 3, 4, 5 };
 
diff --git a/av1/decoder/decodeframe.c b/av1/decoder/decodeframe.c
index 402dc06..27640b7 100644
--- a/av1/decoder/decodeframe.c
+++ b/av1/decoder/decodeframe.c
@@ -253,22 +253,12 @@
     }
 #endif  // CONFIG_AOM_HIGHBITDEPTH
 
-    if (eob == 1) {
+    // TODO(jingning): This cleans up different reset requests from various
+    // experiments, but incurs unnecessary memset size.
+    if (eob == 1)
       dqcoeff[0] = 0;
-    } else {
-      if (tx_type == DCT_DCT && tx_size <= TX_16X16 && eob <= 10)
-        memset(dqcoeff, 0, 4 * 4 * num_4x4_blocks_wide_txsize_lookup[tx_size] *
-                               sizeof(dqcoeff[0]));
-#if CONFIG_EXT_TX
-      else
-        memset(dqcoeff, 0, get_tx2d_size(tx_size) * sizeof(dqcoeff[0]));
-#else
-      else if (tx_size == TX_32X32 && eob <= 34)
-        memset(dqcoeff, 0, 256 * sizeof(dqcoeff[0]));
-      else
-        memset(dqcoeff, 0, get_tx2d_size(tx_size) * sizeof(dqcoeff[0]));
-#endif
-    }
+    else
+      memset(dqcoeff, 0, tx_size_2d[tx_size] * sizeof(dqcoeff[0]));
   }
 }