]> granicus.if.org Git - libvpx/commitdiff
Remove redundant argument in get_sub_block_mv
authorJingning Han <jingning@google.com>
Tue, 17 Sep 2013 19:08:45 +0000 (12:08 -0700)
committerJingning Han <jingning@google.com>
Tue, 17 Sep 2013 19:08:45 +0000 (12:08 -0700)
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

index bfeeb57bfa6a42c4c7756c0515b4ddc719d4d07f..a444b85554b08dce5281d82735deac9947720c2d 100644 (file)
@@ -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;
       }