Use txb_entropy_ctx to store entropy ctx of lv_map
1) Add txb_entropy_ctx into MACROBLOCK_PLANE and PICK_MODE_CONTEXT
2) Add av1_get_txb_entropy_context() to compute the entropy context
3) Compute and sore the entropy context before av1_xform_quant()
return
Change-Id: Ia2170523af3163b9456f7c6a305c1e77ad2b23be
diff --git a/av1/encoder/encodemb.c b/av1/encoder/encodemb.c
index bd01860..cac0abf 100644
--- a/av1/encoder/encodemb.c
+++ b/av1/encoder/encodemb.c
@@ -25,6 +25,9 @@
#include "av1/encoder/av1_quantize.h"
#include "av1/encoder/encodemb.h"
+#if CONFIG_LV_MAP
+#include "av1/encoder/encodetxb.h"
+#endif
#include "av1/encoder/hybrid_fwd_txfm.h"
#include "av1/encoder/rd.h"
#include "av1/encoder/tokenize.h"
@@ -633,6 +636,10 @@
av1_quantize_skip(tx2d_size, qcoeff, dqcoeff, eob);
}
}
+#if CONFIG_LV_MAP
+ p->txb_entropy_ctx[block] =
+ (uint8_t)av1_get_txb_entropy_context(qcoeff, scan_order, *eob);
+#endif // CONFIG_LV_MAP
return;
}
#endif // CONFIG_AOM_HIGHBITDEPTH
@@ -645,7 +652,11 @@
av1_quantize_skip(tx2d_size, qcoeff, dqcoeff, eob);
}
}
-#else // #if !CONFIG_PVQ
+#if CONFIG_LV_MAP
+ p->txb_entropy_ctx[block] =
+ (uint8_t)av1_get_txb_entropy_context(qcoeff, scan_order, *eob);
+#endif // CONFIG_LV_MAP
+#else // #if !CONFIG_PVQ
(void)xform_quant_idx;
#if CONFIG_AOM_HIGHBITDEPTH
fwd_txfm_param.bd = xd->bd;
@@ -1015,7 +1026,11 @@
(void)tx_size;
struct macroblock_plane *p = &x->plane[plane];
+#if !CONFIG_LV_MAP
*a = *l = p->eobs[block] > 0;
+#else // !CONFIG_LV_MAP
+ *a = *l = p->txb_entropy_ctx[block];
+#endif // !CONFIG_LV_MAP
#if CONFIG_VAR_TX || CONFIG_LV_MAP
int i;