]> granicus.if.org Git - libvpx/commitdiff
Merge "Improve the performance by caching the left_mi and right_mi in macroblockd."
authorhkuang <hkuang@google.com>
Mon, 8 Dec 2014 18:24:17 +0000 (10:24 -0800)
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>
Mon, 8 Dec 2014 18:24:17 +0000 (10:24 -0800)
1  2 
vp9/common/vp9_onyxc_int.h

index f2c2d255fb00862fd0d88e3c8ba05c4cfc9b511f,c5af6eaf9b793641e1576f30e21dc3dbce37af15..ed56bed1a283b45292ef6bc0bf8441aec1cc3676
@@@ -309,8 -309,34 +309,23 @@@ static INLINE void set_mi_row_col(MACRO
    // Are edges available for intra prediction?
    xd->up_available    = (mi_row != 0);
    xd->left_available  = (mi_col > tile->mi_col_start);
+   if (xd->up_available) {
+     xd->above_mi = xd->mi[-xd->mi_stride].src_mi;
+     xd->above_mbmi = &xd->above_mi->mbmi;;
+   } else {
+     xd->above_mi = NULL;
+     xd->above_mbmi = NULL;
+   }
+   if (xd->left_available) {
+     xd->left_mi = xd->mi[-1].src_mi;
+     xd->left_mbmi = &xd->left_mi->mbmi;;
+   } else {
+     xd->left_mi = NULL;
+     xd->left_mbmi = NULL;
+   }
  }
  
 -static INLINE void set_prev_mi(VP9_COMMON *cm) {
 -  const int use_prev_in_find_mv_refs = cm->width == cm->last_width &&
 -                                       cm->height == cm->last_height &&
 -                                       !cm->intra_only &&
 -                                       cm->last_show_frame;
 -  // Special case: set prev_mi to NULL when the previous mode info
 -  // context cannot be used.
 -  cm->prev_mi = use_prev_in_find_mv_refs ?
 -                  cm->prev_mip + cm->mi_stride + 1 : NULL;
 -}
 -
  static INLINE void update_partition_context(MACROBLOCKD *xd,
                                              int mi_row, int mi_col,
                                              BLOCK_SIZE subsize,