Introduce rate based gatings in search_txk_type

If rd cost based on coeff rate is more than best_rd,
skip the calculation of distortion in search_txk_type

cpu-used   Encode time reduction
   4            0.5%
Encode time is averaged across multiple test cases

Change-Id: I6255f4289ce9280801149b10b01dbade5d38a8b3
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c
index 31e22b9..8bfedbe 100644
--- a/av1/encoder/rdopt.c
+++ b/av1/encoder/rdopt.c
@@ -3157,6 +3157,10 @@
       av1_optimize_b(cpi, x, plane, block, tx_size, tx_type, txb_ctx,
                      cpi->sf.trellis_eob_fast, &rate_cost);
     }
+    // If rd cost based on coeff rate is more than best_rd, skip the calculation
+    // of distortion
+    int64_t tmp_rd = RDCOST(x->rdmult, rate_cost, 0);
+    if (tmp_rd > best_rd) continue;
     if (eobs_ptr[block] == 0) {
       // When eob is 0, pixel domain distortion is more efficient and accurate.
       this_rd_stats.dist = this_rd_stats.sse = block_sse;