Commit 6f90fb29 authored by Angie Chiang's avatar Angie Chiang Committed by Jingning Han
Browse files

Avoid changing motion_mode after rd search

Check if the global motion undergoes non-translation mode. If that
is the case, do not force a newmv mode into globalmv mode.

This will resolve a mismatch bug of txk_sel.

Change-Id: I589f1619427f02045f8cf49bdea05f348f076236
parent 19d05210
......@@ -2496,6 +2496,7 @@ int64_t av1_search_txk_type(const AV1_COMP *cpi, MACROBLOCK *x, int plane,
if (plane == 0)
mbmi->txk_type[(blk_row << MAX_MIB_SIZE_LOG2) + blk_col] = best_tx_type;
x->plane[plane].txb_entropy_ctx[block] = best_txb_ctx;
x->plane[plane].eobs[block] = best_eob;
if (!is_inter_block(mbmi)) {
// intra mode needs decoded result such that the next transform block
......
......@@ -10686,6 +10686,14 @@ PALETTE_EXIT:
)
.as_int
: 0;
// Check if the global motion mode is non-translational.
int is_nontran_gm = cm->global_motion[refs[0]].wmtype <= TRANSLATION;
if (comp_pred_mode)
is_nontran_gm &= cm->global_motion[refs[1]].wmtype <= TRANSLATION;
if (AOMMIN(block_size_wide[bsize], block_size_high[bsize]) < 8)
is_nontran_gm = 1;
if (!comp_pred_mode) {
int ref_set = (mbmi_ext->ref_mv_count[rf_type] >= 2)
? AOMMIN(2, mbmi_ext->ref_mv_count[rf_type] - 2)
......@@ -10701,7 +10709,7 @@ PALETTE_EXIT:
if (frame_mv[NEARESTMV][refs[0]].as_int == best_mbmode.mv[0].as_int)
best_mbmode.mode = NEARESTMV;
else if (best_mbmode.mv[0].as_int == zeromv[0].as_int)
else if (best_mbmode.mv[0].as_int == zeromv[0].as_int && is_nontran_gm)
best_mbmode.mode = GLOBALMV;
} else {
int_mv nearestmv[2];
......@@ -10744,7 +10752,7 @@ PALETTE_EXIT:
if (best_mbmode.mode == NEW_NEWMV &&
best_mbmode.mv[0].as_int == zeromv[0].as_int &&
best_mbmode.mv[1].as_int == zeromv[1].as_int)
best_mbmode.mv[1].as_int == zeromv[1].as_int && is_nontran_gm)
best_mbmode.mode = GLOBAL_GLOBALMV;
}
}
......@@ -10815,13 +10823,11 @@ PALETTE_EXIT:
// Correct the motion mode for GLOBALMV
const MOTION_MODE last_motion_mode_allowed =
motion_mode_allowed(xd->global_motion, xd, xd->mi[0]);
if (mbmi->motion_mode > last_motion_mode_allowed)
mbmi->motion_mode = last_motion_mode_allowed;
// Correct the interpolation filter for GLOBALMV
if (mbmi->motion_mode > last_motion_mode_allowed) assert(0);
if (is_nontrans_global_motion(xd)) {
mbmi->interp_filters = av1_broadcast_interp_filter(
av1_unswitchable_filter(cm->interp_filter));
assert(mbmi->interp_filters ==
av1_broadcast_interp_filter(
av1_unswitchable_filter(cm->interp_filter)));
}
}
......
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