Fix tokenization process in palette when lv-map is on
This commit resolves an encoding failure issue due to the
tokenization in palette when the lv-map experiment is turned on.
BUG=aomedia:689
Change-Id: I8e476ae81e4d5d11c6aab7611dff9deb7fa63e9e
diff --git a/av1/encoder/bitstream.c b/av1/encoder/bitstream.c
index 4f93f1c..21d3c9b 100644
--- a/av1/encoder/bitstream.c
+++ b/av1/encoder/bitstream.c
@@ -2529,7 +2529,9 @@
&cols);
assert(*tok < tok_end);
pack_palette_tokens(w, tok, palette_size_plane, rows * cols);
+#if !CONFIG_LV_MAP
assert(*tok < tok_end + mbmi->skip);
+#endif // !CONFIG_LV_MAP
}
}
@@ -2618,7 +2620,9 @@
if (!is_chroma_reference(mi_row, mi_col, mbmi->sb_type,
xd->plane[plane].subsampling_x,
xd->plane[plane].subsampling_y)) {
+#if !CONFIG_LV_MAP
(*tok)++;
+#endif // !CONFIG_LV_MAP
continue;
}
#endif
diff --git a/av1/encoder/tokenize.c b/av1/encoder/tokenize.c
index bc7d2a3..e82263f 100644
--- a/av1/encoder/tokenize.c
+++ b/av1/encoder/tokenize.c
@@ -694,7 +694,7 @@
if (!is_chroma_reference(mi_row, mi_col, bsize,
xd->plane[plane].subsampling_x,
xd->plane[plane].subsampling_y)) {
-#if !CONFIG_PVQ || !CONFIG_LV_MAP
+#if !CONFIG_PVQ && !CONFIG_LV_MAP
if (!dry_run) {
(*t)->token = EOSB_TOKEN;
(*t)++;