From 1e68d5dd78914f7b5ff843a26ccef4ad22dcb307 Mon Sep 17 00:00:00 2001 From: Hui Su Date: Thu, 2 Nov 2017 12:31:52 -0700 Subject: [PATCH] intrabc: only consider intrabc blocks' mvs for ref mv When generating ref mv list, only consider neighbor blocks that use intrabc. Change-Id: I69f838a38478ce118f936dbf431048d3d42d4f34 --- av1/common/mvref_common.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/av1/common/mvref_common.c b/av1/common/mvref_common.c index 5c18f170a..d92585a5a 100644 --- a/av1/common/mvref_common.c +++ b/av1/common/mvref_common.c @@ -60,6 +60,9 @@ static uint8_t add_ref_mv_candidate( #endif BLOCK_SIZE bsize, int mi_row, int mi_col, int subsampling_x, int subsampling_y) { +#if CONFIG_INTRABC + if (!is_inter_block(candidate)) return 0; +#endif // CONFIG_INTRABC int index = 0, ref; int newmv_count = 0; assert(weight % 2 == 0); @@ -1054,6 +1057,9 @@ static void find_mv_refs_idx(const AV1_COMMON *cm, const MACROBLOCKD *xd, const MODE_INFO *const candidate_mi = xd->mi[mv_ref->col + mv_ref->row * xd->mi_stride]; const MB_MODE_INFO *const candidate = &candidate_mi->mbmi; +#if CONFIG_INTRABC + if (ref_frame == INTRA_FRAME && !is_intrabc_block(candidate)) continue; +#endif // CONFIG_INTRABC // Keep counts for entropy encoding. context_counter += mode_2_counter[candidate->mode]; different_ref_found = 1; @@ -1078,6 +1084,9 @@ static void find_mv_refs_idx(const AV1_COMMON *cm, const MACROBLOCKD *xd, ? NULL : &xd->mi[mv_ref->col + mv_ref->row * xd->mi_stride]->mbmi; if (candidate == NULL) continue; +#if CONFIG_INTRABC + if (ref_frame == INTRA_FRAME && !is_intrabc_block(candidate)) continue; +#endif // CONFIG_INTRABC if ((mi_row & (sb_mi_size - 1)) + mv_ref->row >= sb_mi_size || (mi_col & (sb_mi_size - 1)) + mv_ref->col >= sb_mi_size) continue; @@ -1123,7 +1132,11 @@ static void find_mv_refs_idx(const AV1_COMMON *cm, const MACROBLOCKD *xd, // Since we couldn't find 2 mvs from the same reference frame // go back through the neighbors and find motion vectors from // different reference frames. - if (different_ref_found) { + if (different_ref_found +#if CONFIG_INTRABC + && ref_frame != INTRA_FRAME +#endif // CONFIG_INTRABC + ) { for (i = 0; i < MVREF_NEIGHBOURS; ++i) { const POSITION *mv_ref = &mv_ref_search[i]; if (is_inside(tile, mi_col, mi_row, cm->mi_rows, cm, mv_ref)) { @@ -1207,7 +1220,9 @@ void av1_update_mv_context(const AV1_COMMON *cm, const MACROBLOCKD *xd, const MODE_INFO *const candidate_mi = xd->mi[mv_ref->col + mv_ref->row * xd->mi_stride]; const MB_MODE_INFO *const candidate = &candidate_mi->mbmi; - +#if CONFIG_INTRABC + if (ref_frame == INTRA_FRAME && !is_intrabc_block(candidate)) continue; +#endif // CONFIG_INTRABC // Keep counts for entropy encoding. context_counter += mode_2_counter[candidate->mode]; -- GitLab