Commit 731af49c authored by Jingning Han's avatar Jingning Han

Sync reference frame type use case

This commit re-synchronize the reference frame type use cases in
the dynamic motion vector referencing system.

Change-Id: Ib25231c716db4176cd67cbdc889472a06b607194
parent 6c48b8c8
......@@ -433,12 +433,7 @@ static INLINE int16_t av1_mode_context_analyzer(
return mode_ctx;
}
if (rf[1] > INTRA_FRAME)
return mode_context[rf[0]] & (mode_context[rf[1]] | 0x00ff);
else if (rf[0] != ALTREF_FRAME)
return mode_context[rf[0]] & ~(mode_context[ALTREF_FRAME] & 0xfe00);
else
return mode_context[ref_frame_type];
return mode_context[ref_frame_type];
}
static INLINE uint8_t av1_drl_ctx(const CANDIDATE_MV *ref_mv_stack,
......
......@@ -1415,7 +1415,7 @@ static void read_inter_block_mode_info(AV1Decoder *const pbi,
av1_setup_pre_planes(xd, ref, ref_buf->buf, mi_row, mi_col, &ref_buf->sf);
}
for (ref_frame = LAST_FRAME; ref_frame < MODE_CTX_REF_FRAMES; ++ref_frame) {
for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) {
av1_find_mv_refs(cm, xd, mi, ref_frame,
#if CONFIG_REF_MV
&xd->ref_mv_count[ref_frame], xd->ref_mv_stack[ref_frame],
......
......@@ -8590,6 +8590,15 @@ void av1_rd_pick_inter_mode_sb(const AV1_COMP *cpi, TileDataEnc *tile_data,
#endif // CONFIG_EXT_INTER
candidates, mi_row, mi_col, NULL, NULL,
mbmi_ext->mode_context);
if (mbmi_ext->ref_mv_count[ref_frame] < 2) {
MV_REFERENCE_FRAME rf[2];
av1_set_ref_frame(rf, ref_frame);
if (mbmi_ext->ref_mvs[rf[0]][0].as_int != 0 ||
mbmi_ext->ref_mvs[rf[0]][1].as_int != 0 ||
mbmi_ext->ref_mvs[rf[1]][0].as_int != 0 ||
mbmi_ext->ref_mvs[rf[1]][1].as_int != 0)
mbmi_ext->mode_context[ref_frame] &= ~(1 << ALL_ZERO_FLAG_OFFSET);
}
}
#endif // CONFIG_REF_MV
......@@ -9910,7 +9919,8 @@ PALETTE_EXIT:
(best_mbmode.ref_frame[1] == NONE || best_mbmode.mv[1].as_int == 0)
#endif // CONFIG_EXT_INTER
) {
int16_t mode_ctx = mbmi_ext->mode_context[best_mbmode.ref_frame[0]];
int8_t ref_frame_type = av1_ref_frame_type(best_mbmode.ref_frame);
int16_t mode_ctx = mbmi_ext->mode_context[ref_frame_type];
#if !CONFIG_EXT_INTER
if (best_mbmode.ref_frame[1] > NONE)
mode_ctx &= (mbmi_ext->mode_context[best_mbmode.ref_frame[1]] | 0x00ff);
......
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