summaryrefslogtreecommitdiff
path: root/vp9
diff options
context:
space:
mode:
authorDmitry Kovalev <dkovalev@google.com>2013-07-26 19:05:37 -0700
committerDmitry Kovalev <dkovalev@google.com>2013-07-26 19:05:37 -0700
commitcc0ff7ecfa5e687d617511c9e7e779e943740e31 (patch)
treebbf8d6d787c353aa0ab7108a3a5426d4fd781013 /vp9
parent118ccdcd309c6bdaa967ffe1e13ba6df8aad64db (diff)
downloadlibvpx-cc0ff7ecfa5e687d617511c9e7e779e943740e31.tar
libvpx-cc0ff7ecfa5e687d617511c9e7e779e943740e31.tar.gz
libvpx-cc0ff7ecfa5e687d617511c9e7e779e943740e31.tar.bz2
libvpx-cc0ff7ecfa5e687d617511c9e7e779e943740e31.zip
Cleanup: replacing xd->mode_info_context with temp variable.
Change-Id: I5a3e83102784cabb918a5404405fcab99c5bb9b6
Diffstat (limited to 'vp9')
-rw-r--r--vp9/common/vp9_reconinter.c41
1 files changed, 19 insertions, 22 deletions
diff --git a/vp9/common/vp9_reconinter.c b/vp9/common/vp9_reconinter.c
index 2e42fd057..8c493934c 100644
--- a/vp9/common/vp9_reconinter.c
+++ b/vp9/common/vp9_reconinter.c
@@ -220,20 +220,18 @@ static INLINE int round_mv_comp_q4(int value) {
return (value < 0 ? value - 2 : value + 2) / 4;
}
-static int mi_mv_pred_row_q4(MACROBLOCKD *mb, int idx) {
- const int temp = mb->mode_info_context->bmi[0].as_mv[idx].as_mv.row +
- mb->mode_info_context->bmi[1].as_mv[idx].as_mv.row +
- mb->mode_info_context->bmi[2].as_mv[idx].as_mv.row +
- mb->mode_info_context->bmi[3].as_mv[idx].as_mv.row;
- return round_mv_comp_q4(temp);
+static int mi_mv_pred_row_q4(const MODE_INFO *mi, int idx) {
+ return round_mv_comp_q4(mi->bmi[0].as_mv[idx].as_mv.row +
+ mi->bmi[1].as_mv[idx].as_mv.row +
+ mi->bmi[2].as_mv[idx].as_mv.row +
+ mi->bmi[3].as_mv[idx].as_mv.row);
}
-static int mi_mv_pred_col_q4(MACROBLOCKD *mb, int idx) {
- const int temp = mb->mode_info_context->bmi[0].as_mv[idx].as_mv.col +
- mb->mode_info_context->bmi[1].as_mv[idx].as_mv.col +
- mb->mode_info_context->bmi[2].as_mv[idx].as_mv.col +
- mb->mode_info_context->bmi[3].as_mv[idx].as_mv.col;
- return round_mv_comp_q4(temp);
+static int mi_mv_pred_col_q4(const MODE_INFO *mi, int idx) {
+ return round_mv_comp_q4(mi->bmi[0].as_mv[idx].as_mv.col +
+ mi->bmi[1].as_mv[idx].as_mv.col +
+ mi->bmi[2].as_mv[idx].as_mv.col +
+ mi->bmi[3].as_mv[idx].as_mv.col);
}
// TODO(jkoleszar): yet another mv clamping function :-(
@@ -280,15 +278,14 @@ static void build_inter_predictors(int plane, int block,
const int bwl = b_width_log2(bsize) - xd->plane[plane].subsampling_x;
const int bhl = b_height_log2(bsize) - xd->plane[plane].subsampling_y;
const int x = 4 * (block & ((1 << bwl) - 1)), y = 4 * (block >> bwl);
- const int use_second_ref = xd->mode_info_context->mbmi.ref_frame[1] > 0;
+ const MODE_INFO *const mi = xd->mode_info_context;
+ const int use_second_ref = mi->mbmi.ref_frame[1] > 0;
int which_mv;
assert(x < (4 << bwl));
assert(y < (4 << bhl));
- assert(xd->mode_info_context->mbmi.sb_type < BLOCK_SIZE_SB8X8 ||
- 4 << pred_w == (4 << bwl));
- assert(xd->mode_info_context->mbmi.sb_type < BLOCK_SIZE_SB8X8 ||
- 4 << pred_h == (4 << bhl));
+ assert(mi->mbmi.sb_type < BLOCK_SIZE_SB8X8 || 4 << pred_w == (4 << bwl));
+ assert(mi->mbmi.sb_type < BLOCK_SIZE_SB8X8 || 4 << pred_h == (4 << bhl));
for (which_mv = 0; which_mv < 1 + use_second_ref; ++which_mv) {
// source
@@ -306,20 +303,20 @@ static void build_inter_predictors(int plane, int block,
MV split_chroma_mv;
int_mv clamped_mv;
- if (xd->mode_info_context->mbmi.sb_type < BLOCK_SIZE_SB8X8) {
+ if (mi->mbmi.sb_type < BLOCK_SIZE_SB8X8) {
if (plane == 0) {
- mv = &xd->mode_info_context->bmi[block].as_mv[which_mv].as_mv;
+ mv = &mi->bmi[block].as_mv[which_mv].as_mv;
} else {
// TODO(jkoleszar): All chroma MVs in SPLITMV mode are taken as the
// same MV (the average of the 4 luma MVs) but we could do something
// smarter for non-4:2:0. Just punt for now, pending the changes to get
// rid of SPLITMV mode entirely.
- split_chroma_mv.row = mi_mv_pred_row_q4(xd, which_mv);
- split_chroma_mv.col = mi_mv_pred_col_q4(xd, which_mv);
+ split_chroma_mv.row = mi_mv_pred_row_q4(mi, which_mv);
+ split_chroma_mv.col = mi_mv_pred_col_q4(mi, which_mv);
mv = &split_chroma_mv;
}
} else {
- mv = &xd->mode_info_context->mbmi.mv[which_mv].as_mv;
+ mv = &mi->mbmi.mv[which_mv].as_mv;
}
/* TODO(jkoleszar): This clamping is done in the incorrect place for the