summaryrefslogtreecommitdiff
path: root/vp9
diff options
context:
space:
mode:
authorDmitry Kovalev <dkovalev@google.com>2013-08-12 15:52:08 -0700
committerDmitry Kovalev <dkovalev@google.com>2013-08-12 15:52:08 -0700
commit1a5e6ffb0216994989ed189787ade65866699f5e (patch)
tree20400bf940d200eeb9384fa9e89f3351c2925b06 /vp9
parentc66320b3e4283b72dba38333ea9861354e159758 (diff)
downloadlibvpx-1a5e6ffb0216994989ed189787ade65866699f5e.tar
libvpx-1a5e6ffb0216994989ed189787ade65866699f5e.tar.gz
libvpx-1a5e6ffb0216994989ed189787ade65866699f5e.tar.bz2
libvpx-1a5e6ffb0216994989ed189787ade65866699f5e.zip
Simplifying vp9_mvref_common.c.
Change-Id: I272df2e33fa05310466acf06c179728514dd7494
Diffstat (limited to 'vp9')
-rw-r--r--vp9/common/vp9_mvref_common.c30
1 files changed, 12 insertions, 18 deletions
diff --git a/vp9/common/vp9_mvref_common.c b/vp9/common/vp9_mvref_common.c
index f6bb0f126..bb02649ff 100644
--- a/vp9/common/vp9_mvref_common.c
+++ b/vp9/common/vp9_mvref_common.c
@@ -129,18 +129,15 @@ static INLINE int_mv get_sub_block_mv(const MODE_INFO *candidate,
// Performs mv sign inversion if indicated by the reference frame combination.
-static INLINE int_mv scale_mv(const MODE_INFO *candidate, const int which_mv,
+static INLINE int_mv scale_mv(const MB_MODE_INFO *mbmi, int ref,
const MV_REFERENCE_FRAME this_ref_frame,
const int *ref_sign_bias) {
- int_mv return_mv = candidate->mbmi.mv[which_mv];
-
- // Sign inversion where appropriate.
- if (ref_sign_bias[candidate->mbmi.ref_frame[which_mv]] !=
- ref_sign_bias[this_ref_frame]) {
- return_mv.as_mv.row *= -1;
- return_mv.as_mv.col *= -1;
+ int_mv mv = mbmi->mv[ref];
+ if (ref_sign_bias[mbmi->ref_frame[ref]] != ref_sign_bias[this_ref_frame]) {
+ mv.as_mv.row *= -1;
+ mv.as_mv.col *= -1;
}
- return return_mv;
+ return mv;
}
// This macro is used to add a motion vector mv_ref list if it isn't
@@ -159,12 +156,12 @@ static INLINE int_mv scale_mv(const MODE_INFO *candidate, const int which_mv,
// If either reference frame is different, not INTRA, and they
// are different from each other scale and add the mv to our list.
#define IF_DIFF_REF_FRAME_ADD_MV(CANDIDATE) \
- if ((CANDIDATE)->mbmi.ref_frame[0] != ref_frame) { \
+ if ((CANDIDATE)->ref_frame[0] != ref_frame) { \
ADD_MV_REF_LIST(scale_mv((CANDIDATE), 0, ref_frame, ref_sign_bias)); \
} \
- if ((CANDIDATE)->mbmi.ref_frame[1] != ref_frame && \
- (CANDIDATE)->mbmi.ref_frame[1] > INTRA_FRAME && \
- (CANDIDATE)->mbmi.mv[1].as_int != (CANDIDATE)->mbmi.mv[0].as_int) { \
+ if ((CANDIDATE)->ref_frame[1] != ref_frame && \
+ (CANDIDATE)->ref_frame[1] > INTRA_FRAME && \
+ (CANDIDATE)->mv[1].as_int != (CANDIDATE)->mv[0].as_int) { \
ADD_MV_REF_LIST(scale_mv((CANDIDATE), 1, ref_frame, ref_sign_bias)); \
}
@@ -273,13 +270,13 @@ void vp9_find_mv_refs_idx(VP9_COMMON *cm, MACROBLOCKD *xd, MODE_INFO *here,
if (!is_inter_block(&candidate->mbmi))
continue;
- IF_DIFF_REF_FRAME_ADD_MV(candidate);
+ IF_DIFF_REF_FRAME_ADD_MV(&candidate->mbmi);
}
}
// Since we still don't have a candidate we'll try the last frame.
if (lf_here != NULL && is_inter_block(&lf_here->mbmi)) {
- IF_DIFF_REF_FRAME_ADD_MV(lf_here);
+ IF_DIFF_REF_FRAME_ADD_MV(&lf_here->mbmi);
}
Done:
@@ -290,6 +287,3 @@ void vp9_find_mv_refs_idx(VP9_COMMON *cm, MACROBLOCKD *xd, MODE_INFO *here,
for (idx = 0; idx < MAX_MV_REF_CANDIDATES; ++idx)
clamp_mv_ref(&mv_ref_list[idx].as_mv, xd);
}
-
-#undef ADD_MV_REF_LIST
-#undef IF_DIFF_REF_FRAME_ADD_MV