Commit 77c41183 authored by Wei-Ting Lin's avatar Wei-Ting Lin Committed by Wei-ting Lin

ncobmc_adapt_weight: avoid transmitting unnecessary bits

Transmit ncobmc modes only when the motion mode,
ncobmc_adapt_weight, is selected.

Change-Id: I19d6dd83278457b1867f8e2e5cd94d25f535fcaf
parent 8e6267fe
......@@ -363,17 +363,8 @@ static void read_ncobmc_mode(AV1_COMMON *cm, MACROBLOCKD *xd, MODE_INFO *mi,
NCOBMC_MODE ncobmc_mode[2], aom_reader *r) {
MB_MODE_INFO *mbmi = &mi->mbmi;
FRAME_COUNTS *counts = xd->counts;
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;
ncobmc_mode[0] = aom_read_tree(r, av1_ncobmc_mode_tree,
cm->fc->ncobmc_mode_prob[ao_block], ACCT_STR);
......
......@@ -549,17 +549,8 @@ static void write_motion_mode(const AV1_COMMON *cm, MACROBLOCKD *xd,
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]]);
......
......@@ -1770,7 +1770,7 @@ static void update_stats(const AV1_COMMON *const cm, ThreadData *td, int mi_row,
#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]];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment