From 2b3bfaa9ce6eeefaa7ba3ee85ef69dfb99d31db2 Mon Sep 17 00:00:00 2001 From: Jingning Han <jingning@google.com> Date: Tue, 17 Sep 2013 12:08:45 -0700 Subject: [PATCH] Remove redundant argument in get_sub_block_mv The sub8x8 check can be directly inferred from block_idx, hence removed from the arguments if get_sub_block_mv. Change-Id: Ib766d57e81248fb92df0f6d9b163e6c77b933ccd --- vp9/common/vp9_mvref_common.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/vp9/common/vp9_mvref_common.c b/vp9/common/vp9_mvref_common.c index bfeeb57bfa..a444b85554 100644 --- a/vp9/common/vp9_mvref_common.c +++ b/vp9/common/vp9_mvref_common.c @@ -119,10 +119,9 @@ static void clamp_mv_ref(MV *mv, const MACROBLOCKD *xd) { // This function returns either the appropriate sub block or block's mv // on whether the block_size < 8x8 and we have check_sub_blocks set. -static INLINE int_mv get_sub_block_mv(const MODE_INFO *candidate, - int check_sub_blocks, int which_mv, +static INLINE int_mv get_sub_block_mv(const MODE_INFO *candidate, int which_mv, int search_col, int block_idx) { - return check_sub_blocks && candidate->mbmi.sb_type < BLOCK_8X8 + return block_idx >= 0 && candidate->mbmi.sb_type < BLOCK_8X8 ? candidate->bmi[idx_n_column_to_subblock[block_idx][search_col == 0]] .as_mv[which_mv] : candidate->mbmi.mv[which_mv]; @@ -203,7 +202,6 @@ void vp9_find_mv_refs_idx(const VP9_COMMON *cm, const MACROBLOCKD *xd, for (i = 0; i < 2; ++i) { const MV *const mv_ref = &mv_ref_search[i]; if (is_inside(cm, mi_col, mi_row, mv_ref)) { - const int check_sub_blocks = block_idx >= 0; const MODE_INFO *const candidate_mi = xd->mi_8x8[mv_ref->col + mv_ref->row * xd->mode_info_stride]; const MB_MODE_INFO *const candidate = &candidate_mi->mbmi; @@ -212,13 +210,13 @@ void vp9_find_mv_refs_idx(const VP9_COMMON *cm, const MACROBLOCKD *xd, // Check if the candidate comes from the same reference frame. if (candidate->ref_frame[0] == ref_frame) { - ADD_MV_REF_LIST(get_sub_block_mv(candidate_mi, check_sub_blocks, 0, + ADD_MV_REF_LIST(get_sub_block_mv(candidate_mi, 0, mv_ref->col, block_idx)); different_ref_found = candidate->ref_frame[1] != ref_frame; } else { if (candidate->ref_frame[1] == ref_frame) // Add second motion vector if it has the same ref_frame. - ADD_MV_REF_LIST(get_sub_block_mv(candidate_mi, check_sub_blocks, 1, + ADD_MV_REF_LIST(get_sub_block_mv(candidate_mi, 1, mv_ref->col, block_idx)); different_ref_found = 1; } -- GitLab