Fix zero block rate estimate in lv-map
Derive the rate cost from the probability model sets effectively
in use.
Change-Id: Ief1851a32ea7a3a52e82f52050cdc3dae6c72287
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c
index 0693b36..2e0f246 100644
--- a/av1/encoder/rdopt.c
+++ b/av1/encoder/rdopt.c
@@ -4686,8 +4686,14 @@
TX_SIZE txs_ctx = get_txsize_context(tx_size);
TXB_CTX txb_ctx;
get_txb_ctx(plane_bsize, tx_size, plane, pta, ptl, &txb_ctx);
+
+#if LV_MAP_PROB
+ zero_blk_rate = x->coeff_costs[txs_ctx][get_plane_type(plane)]
+ .txb_skip_cost[txb_ctx.txb_skip_ctx][1];
+#else
zero_blk_rate =
av1_cost_bit(xd->fc->txb_skip[txs_ctx][txb_ctx.txb_skip_ctx], 1);
+#endif // LV_MAP_PROB
#else
int tx_size_ctx = txsize_sqr_map[tx_size];
int coeff_ctx = get_entropy_context(tx_size, pta, ptl);