Add av1_write_coeffs_mb
This function go through each transform block in the
prediction block and call av1_write_coeffs_txb to
pack coefficients into the bitstream
Change-Id: I6dedebef6cf8957f9173241a7de60e9936bc0be8
diff --git a/av1/encoder/bitstream.c b/av1/encoder/bitstream.c
index 3a45f47..7ff1e16 100644
--- a/av1/encoder/bitstream.c
+++ b/av1/encoder/bitstream.c
@@ -43,6 +43,9 @@
#if CONFIG_ANS
#include "aom_dsp/buf_ans.h"
#endif // CONFIG_ANS
+#if CONFIG_LV_MAP
+#include "av1/encoder/encodetxb.h"
+#endif // CONFIG_LV_MAP
#include "av1/encoder/bitstream.h"
#include "av1/encoder/cost.h"
#include "av1/encoder/encodemv.h"
@@ -881,7 +884,8 @@
*tp = p;
}
-#else
+#else // CONFIG_NEW_TOKENSET
+#if !CONFIG_LV_MAP
static void pack_mb_tokens(aom_writer *w, const TOKENEXTRA **tp,
const TOKENEXTRA *const stop,
aom_bit_depth_t bit_depth, const TX_SIZE tx_size,
@@ -977,7 +981,8 @@
*tp = p;
}
-#endif
+#endif // !CONFIG_LV_MAP
+#endif // CONFIG_NEW_TOKENSET
#else // !CONFIG_PVQ
static PVQ_INFO *get_pvq_block(PVQ_QUEUE *pvq_q) {
PVQ_INFO *pvq;
@@ -2142,7 +2147,7 @@
MB_MODE_INFO *const mbmi = &m->mbmi;
int plane;
int bh, bw;
-#if CONFIG_PVQ
+#if CONFIG_PVQ || CONFIG_LV_MAP
MACROBLOCK *const x = &cpi->td.mb;
(void)tok;
(void)tok_end;
@@ -2329,7 +2334,13 @@
TOKEN_STATS token_stats;
#if !CONFIG_PVQ
init_token_stats(&token_stats);
+#if CONFIG_LV_MAP
+ (void)tx;
+ av1_write_coeffs_mb(cm, x, w, plane);
+#else // CONFIG_LV_MAP
pack_mb_tokens(w, tok, tok_end, cm->bit_depth, tx, &token_stats);
+#endif // CONFIG_LV_MAP
+
#else
(void)token_stats;
pack_pvq_tokens(w, x, xd, plane, mbmi->sb_type, tx);