Commit ec9bebc1 authored by Angie Chiang's avatar Angie Chiang Committed by Jingning Han

Remove all_zero check in read/write_inter_mode

This is a bitstream simplification.
It will reduce motion vector context model generating latency.

Change-Id: I98a496f5d72402ff51a478d5387a0653fa306dc1
parent 9480e7ba
......@@ -1357,11 +1357,7 @@ void av1_find_mv_refs(const AV1_COMMON *cm, const MACROBLOCKD *xd,
if (mv_ref_list[idx].as_int != zeromv[0].as_int) all_zero = 0;
}
#if !CONFIG_OPT_REF_MV
if (all_zero) mode_context[ref_frame] |= (1 << ALL_ZERO_FLAG_OFFSET);
#else
(void)all_zero;
#endif
}
void av1_find_best_ref_mvs(int allow_hp, int_mv *mvlist, int_mv *nearest_mv,
......
......@@ -227,7 +227,6 @@ static PREDICTION_MODE read_inter_mode(FRAME_CONTEXT *ec_ctx, MACROBLOCKD *xd,
return NEWMV;
}
if (counts) ++counts->newmv_mode[mode_ctx][1];
if (ctx & (1 << ALL_ZERO_FLAG_OFFSET)) return GLOBALMV;
mode_ctx = (ctx >> GLOBALMV_OFFSET) & GLOBALMV_CTX_MASK;
is_zeromv =
aom_read_symbol(r, ec_ctx->zeromv_cdf[mode_ctx], 2, ACCT_STR) == 0;
......
......@@ -123,11 +123,6 @@ static void write_inter_mode(aom_writer *w, PREDICTION_MODE mode,
aom_write_symbol(w, mode != NEWMV, ec_ctx->newmv_cdf[newmv_ctx], 2);
if (mode != NEWMV) {
if (mode_ctx & (1 << ALL_ZERO_FLAG_OFFSET)) {
assert(mode == GLOBALMV);
return;
}
const int16_t zeromv_ctx =
(mode_ctx >> GLOBALMV_OFFSET) & GLOBALMV_CTX_MASK;
aom_write_symbol(w, mode != GLOBALMV, ec_ctx->zeromv_cdf[zeromv_ctx], 2);
......
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