Use av1_optimize_txb for lv_map experiment
Comparing to lv_map experiment using the old av1_optimize_b
function, This change gives 0.8% gain on lowres and midres
datasets
Comparing to the baseline with greedy optimize_b, the lv_map
experiment will have 1.2% on lowres and 1.49% on midres.
The gains are similar to the one that under the condition of
turning off av1_optimize_b for baseline and lv_map.
Change-Id: Ie17c4ecbd9ed8418ef657a526d8363e0746b5af5
diff --git a/av1/encoder/encodemb.c b/av1/encoder/encodemb.c
index 5fd265a..7c97815 100644
--- a/av1/encoder/encodemb.c
+++ b/av1/encoder/encodemb.c
@@ -132,6 +132,7 @@
return token_costs[token == ZERO_TOKEN || token == EOB_TOKEN][ctx][token];
}
+#if !CONFIG_LV_MAP
#define USE_GREEDY_OPTIMIZE_B 0
#if USE_GREEDY_OPTIMIZE_B
@@ -801,6 +802,7 @@
}
#endif // USE_GREEDY_OPTIMIZE_B
+#endif // !CONFIG_LV_MAP
int av1_optimize_b(const AV1_COMMON *cm, MACROBLOCK *mb, int plane, int block,
BLOCK_SIZE plane_bsize, TX_SIZE tx_size,
@@ -811,26 +813,32 @@
assert((mb->qindex == 0) ^ (xd->lossless[xd->mi[0]->mbmi.segment_id] == 0));
if (eob == 0) return eob;
if (xd->lossless[xd->mi[0]->mbmi.segment_id]) return eob;
+#if CONFIG_PVQ
+ (void)cm;
+ (void)tx_size;
+ (void)a;
+ (void)l;
+ return eob;
+#endif
+#if !CONFIG_LV_MAP
+ (void)plane_bsize;
#if CONFIG_VAR_TX
int ctx = get_entropy_context(tx_size, a, l);
#else
int ctx = combine_entropy_contexts(*a, *l);
#endif
-#if CONFIG_PVQ
- (void)cm;
- (void)tx_size;
- (void)ctx;
- return eob;
-#endif
-
- (void)plane_bsize;
#if USE_GREEDY_OPTIMIZE_B
return optimize_b_greedy(cm, mb, plane, block, tx_size, ctx);
#else // USE_GREEDY_OPTIMIZE_B
return optimize_b_org(cm, mb, plane, block, tx_size, ctx);
#endif // USE_GREEDY_OPTIMIZE_B
+#else // !CONFIG_LV_MAP
+ TXB_CTX txb_ctx;
+ get_txb_ctx(plane_bsize, tx_size, plane, a, l, &txb_ctx);
+ return av1_optimize_txb(cm, mb, plane, block, tx_size, &txb_ctx);
+#endif // !CONFIG_LV_MAP
}
#if !CONFIG_PVQ