Fix the bug that prevents both pvq and ec_adapt work together
Change-Id: Ie7edfbcdd7f5f2cc3aa3aa6c2575d081616da6b6
diff --git a/av1/encoder/bitstream.c b/av1/encoder/bitstream.c
index 5ac1bb6..80b0a95 100644
--- a/av1/encoder/bitstream.c
+++ b/av1/encoder/bitstream.c
@@ -4098,7 +4098,8 @@
// NOTE: This will not work with CONFIG_ANS turned on.
od_adapt_ctx_reset(&cpi->td.mb.daala_enc.state.adapt, 0);
cpi->td.mb.pvq_q = &this_tile->pvq_q;
-#elif CONFIG_EC_ADAPT
+#endif
+#if CONFIG_EC_ADAPT
// Initialise tile context from the frame context
this_tile->tctx = *cm->fc;
cpi->td.mb.e_mbd.tile_ctx = &this_tile->tctx;
diff --git a/av1/encoder/encodeframe.c b/av1/encoder/encodeframe.c
index a4af62a..e3ca946 100644
--- a/av1/encoder/encodeframe.c
+++ b/av1/encoder/encodeframe.c
@@ -4914,10 +4914,12 @@
#error "CONFIG_PVQ currently requires CONFIG_DAALA_EC."
#endif
od_adapt_ctx_reset(adapt, 0);
-#elif CONFIG_EC_ADAPT
+#endif // #if CONFIG_PVQ
+
+#if CONFIG_EC_ADAPT
this_tile->tctx = *cm->fc;
td->mb.e_mbd.tile_ctx = &this_tile->tctx;
-#endif // #if CONFIG_PVQ
+#endif // #if CONFIG_EC_ADAPT
for (mi_row = tile_info->mi_row_start; mi_row < tile_info->mi_row_end;
mi_row += cm->mib_size) {