ncobmc_adapt_weight: avoid transmitting unnecessary bits
Transmit ncobmc modes only when the motion mode,
ncobmc_adapt_weight, is selected.
Change-Id: I19d6dd83278457b1867f8e2e5cd94d25f535fcaf
diff --git a/av1/encoder/bitstream.c b/av1/encoder/bitstream.c
index fe41778..694a0cb 100644
--- a/av1/encoder/bitstream.c
+++ b/av1/encoder/bitstream.c
@@ -549,17 +549,8 @@
static void write_ncobmc_mode(const AV1_COMMON *cm, const MODE_INFO *mi,
aom_writer *w) {
const MB_MODE_INFO *mbmi = &mi->mbmi;
- MOTION_MODE last_motion_mode_allowed =
- motion_mode_allowed_wrapper(0,
-#if CONFIG_GLOBAL_MOTION
- 0, cm->global_motion,
-#endif // CONFIG_GLOBAL_MOTION
-#if CONFIG_WARPED_MOTION
- xd,
-#endif
- mi);
ADAPT_OVERLAP_BLOCK ao_block = adapt_overlap_block_lookup[mbmi->sb_type];
- if (last_motion_mode_allowed < NCOBMC_ADAPT_WEIGHT) return;
+ if (mbmi->motion_mode != NCOBMC_ADAPT_WEIGHT) return;
av1_write_token(w, av1_ncobmc_mode_tree, cm->fc->ncobmc_mode_prob[ao_block],
&ncobmc_mode_encodings[mbmi->ncobmc_mode[0]]);
diff --git a/av1/encoder/encodeframe.c b/av1/encoder/encodeframe.c
index 5e7975a..5d59c56 100644
--- a/av1/encoder/encodeframe.c
+++ b/av1/encoder/encodeframe.c
@@ -1770,7 +1770,7 @@
#endif // CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
#if CONFIG_NCOBMC_ADAPT_WEIGHT
- if (motion_allowed == NCOBMC_ADAPT_WEIGHT) {
+ if (mbmi->motion_mode == NCOBMC_ADAPT_WEIGHT) {
ADAPT_OVERLAP_BLOCK ao_block =
adapt_overlap_block_lookup[mbmi->sb_type];
++counts->ncobmc_mode[ao_block][mbmi->ncobmc_mode[0]];