Add stats collection for intra tx size

Change-Id: I8111db29640c72cb72045161e82f0b0864a76522
diff --git a/av1/common/entropymode.h b/av1/common/entropymode.h
index 979e0fb..5e3e2d7 100644
--- a/av1/common/entropymode.h
+++ b/av1/common/entropymode.h
@@ -235,6 +235,7 @@
   unsigned int intrabc[2];
 #endif  // CONFIG_ENTROPY_STATS
   unsigned int txfm_partition[TXFM_PARTITION_CONTEXTS][2];
+  unsigned int intra_tx_size[MAX_TX_CATS][TX_SIZE_CONTEXTS][MAX_TX_DEPTH + 1];
   unsigned int skip_mode[SKIP_MODE_CONTEXTS][2];
   unsigned int skip[SKIP_CONTEXTS][2];
   unsigned int compound_index[COMP_INDEX_CONTEXTS][2];
diff --git a/av1/encoder/encodeframe.c b/av1/encoder/encodeframe.c
index 6661f8d..37258c6 100644
--- a/av1/encoder/encodeframe.c
+++ b/av1/encoder/encodeframe.c
@@ -4793,14 +4793,16 @@
         }
       } else {
         intra_tx_size = mbmi->tx_size;
-        if (block_signals_txsize(bsize) && !xd->lossless[mbmi->segment_id] &&
-            tile_data->allow_update_cdf) {
+        if (block_signals_txsize(bsize) && !xd->lossless[mbmi->segment_id]) {
           const int tx_size_ctx = get_tx_size_context(xd);
           const int32_t tx_size_cat = bsize_to_tx_size_cat(bsize, 0);
           const int depth = tx_size_to_depth(intra_tx_size, bsize, 0);
           const int max_depths = bsize_to_max_depth(bsize, 0);
-          update_cdf(xd->tile_ctx->tx_size_cdf[tx_size_cat][tx_size_ctx], depth,
-                     max_depths + 1);
+
+          if (tile_data->allow_update_cdf)
+            update_cdf(xd->tile_ctx->tx_size_cdf[tx_size_cat][tx_size_ctx],
+                       depth, max_depths + 1);
+          ++td->counts->intra_tx_size[tx_size_cat][tx_size_ctx][depth];
         }
       }