shithub: libvpx

Download patch

ref: 2b3bfaa9ce6eeefaa7ba3ee85ef69dfb99d31db2
parent: 84758960db7e18cd77e301ab4a1dc6022e1a3335
author: Jingning Han <[email protected]>
date: Tue Sep 17 08:08:45 EDT 2013

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

--- a/vp9/common/vp9_mvref_common.c
+++ b/vp9/common/vp9_mvref_common.c
@@ -119,10 +119,9 @@
 
 // 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 @@
   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 @@
 
       // 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;
       }