Index: source/libvpx/vp9/common/vp9_findnearmv.h |
=================================================================== |
--- source/libvpx/vp9/common/vp9_findnearmv.h (revision 232232) |
+++ source/libvpx/vp9/common/vp9_findnearmv.h (working copy) |
@@ -23,10 +23,8 @@ |
// check a list of motion vectors by sad score using a number rows of pixels |
// above and a number cols of pixels in the left to select the one with best |
// score to use as ref motion vector |
-void vp9_find_best_ref_mvs(MACROBLOCKD *xd, |
- int_mv *mvlist, |
- int_mv *nearest, |
- int_mv *near); |
+void vp9_find_best_ref_mvs(MACROBLOCKD *xd, int allow_hp, |
+ int_mv *mvlist, int_mv *nearest, int_mv *near); |
// TODO(jingning): this mv clamping function should be block size dependent. |
static void clamp_mv2(MV *mv, const MACROBLOCKD *xd) { |
@@ -36,57 +34,39 @@ |
xd->mb_to_bottom_edge + RIGHT_BOTTOM_MARGIN); |
} |
-void vp9_append_sub8x8_mvs_for_idx(VP9_COMMON *cm, |
- MACROBLOCKD *xd, |
+void vp9_append_sub8x8_mvs_for_idx(VP9_COMMON *cm, MACROBLOCKD *xd, |
+ const TileInfo *const tile, |
int_mv *dst_nearest, |
int_mv *dst_near, |
int block_idx, int ref_idx, |
int mi_row, int mi_col); |
-static MB_PREDICTION_MODE left_block_mode(const MODE_INFO *cur_mb, |
- const MODE_INFO *left_mb, int b) { |
- // FIXME(rbultje, jingning): temporary hack because jenkins doesn't |
- // understand this condition. This will go away soon. |
- const MODE_INFO *mi = cur_mb; |
- |
+static MB_PREDICTION_MODE left_block_mode(const MODE_INFO *cur_mi, |
+ const MODE_INFO *left_mi, int b) { |
if (b == 0 || b == 2) { |
- /* On L edge, get from MB to left of us */ |
- mi = left_mb; |
- if (!mi) |
+ if (!left_mi || is_inter_block(&left_mi->mbmi)) |
return DC_PRED; |
- if (mi->mbmi.ref_frame[0] != INTRA_FRAME) { |
- return DC_PRED; |
- } else if (mi->mbmi.sb_type < BLOCK_8X8) { |
- return ((mi->bmi + 1 + b)->as_mode); |
- } else { |
- return mi->mbmi.mode; |
- } |
+ return left_mi->mbmi.sb_type < BLOCK_8X8 ? left_mi->bmi[b + 1].as_mode |
+ : left_mi->mbmi.mode; |
+ } else { |
+ assert(b == 1 || b == 3); |
+ return cur_mi->bmi[b - 1].as_mode; |
} |
- assert(b == 1 || b == 3); |
- return (mi->bmi + b - 1)->as_mode; |
} |
-static MB_PREDICTION_MODE above_block_mode(const MODE_INFO *cur_mb, |
- const MODE_INFO *above_mb, int b) { |
- const MODE_INFO *mi = cur_mb; |
- |
- if (!(b >> 1)) { |
- /* On top edge, get from MB above us */ |
- mi = above_mb; |
- if (!mi) |
+static MB_PREDICTION_MODE above_block_mode(const MODE_INFO *cur_mi, |
+ const MODE_INFO *above_mi, int b) { |
+ if (b == 0 || b == 1) { |
+ if (!above_mi || is_inter_block(&above_mi->mbmi)) |
return DC_PRED; |
- if (mi->mbmi.ref_frame[0] != INTRA_FRAME) { |
- return DC_PRED; |
- } else if (mi->mbmi.sb_type < BLOCK_8X8) { |
- return ((mi->bmi + 2 + b)->as_mode); |
- } else { |
- return mi->mbmi.mode; |
- } |
+ return above_mi->mbmi.sb_type < BLOCK_8X8 ? above_mi->bmi[b + 2].as_mode |
+ : above_mi->mbmi.mode; |
+ } else { |
+ assert(b == 2 || b == 3); |
+ return cur_mi->bmi[b - 2].as_mode; |
} |
- |
- return (mi->bmi + b - 2)->as_mode; |
} |
#endif // VP9_COMMON_VP9_FINDNEARMV_H_ |