summaryrefslogtreecommitdiff
path: root/vp9/encoder
diff options
context:
space:
mode:
authorDmitry Kovalev <dkovalev@google.com>2014-02-12 17:53:50 -0800
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>2014-02-12 17:53:50 -0800
commit8c3ca45dfb5c270c1b534611e8046c2616d3a02c (patch)
treeec2d54732a434ff6f125fe72b29a6da35911254f /vp9/encoder
parentdea1604ed2e2fecc29686559040c95680877353b (diff)
parent733a17d25344b03a3d7a59e28473b4231ebf4074 (diff)
downloadlibvpx-8c3ca45dfb5c270c1b534611e8046c2616d3a02c.tar
libvpx-8c3ca45dfb5c270c1b534611e8046c2616d3a02c.tar.gz
libvpx-8c3ca45dfb5c270c1b534611e8046c2616d3a02c.tar.bz2
libvpx-8c3ca45dfb5c270c1b534611e8046c2616d3a02c.zip
Merge "Converting int_mv to MV."
Diffstat (limited to 'vp9/encoder')
-rw-r--r--vp9/encoder/vp9_rdopt.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c
index 327861f49..6d26e64f6 100644
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -1604,13 +1604,11 @@ typedef struct {
int mvthresh;
} BEST_SEG_INFO;
-static INLINE int mv_check_bounds(MACROBLOCK *x, int_mv *mv) {
- int r = 0;
- r |= (mv->as_mv.row >> 3) < x->mv_row_min;
- r |= (mv->as_mv.row >> 3) > x->mv_row_max;
- r |= (mv->as_mv.col >> 3) < x->mv_col_min;
- r |= (mv->as_mv.col >> 3) > x->mv_col_max;
- return r;
+static INLINE int mv_check_bounds(const MACROBLOCK *x, const MV *mv) {
+ return (mv->row >> 3) < x->mv_row_min ||
+ (mv->row >> 3) > x->mv_row_max ||
+ (mv->col >> 3) < x->mv_col_min ||
+ (mv->col >> 3) > x->mv_col_max;
}
static INLINE void mi_buf_shift(MACROBLOCK *x, int i) {
@@ -1924,10 +1922,9 @@ static void rd_check_segment_txsize(VP9_COMP *cpi, MACROBLOCK *x,
}
// Trap vectors that reach beyond the UMV borders
- if (mv_check_bounds(x, &mode_mv[this_mode]))
- continue;
- if (has_second_rf &&
- mv_check_bounds(x, &second_mode_mv[this_mode]))
+ if (mv_check_bounds(x, &mode_mv[this_mode].as_mv) ||
+ (has_second_rf &&
+ mv_check_bounds(x, &second_mode_mv[this_mode].as_mv)))
continue;
if (filter_idx > 0) {
@@ -2742,7 +2739,7 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
if (this_mode != NEWMV)
clamp_mv2(&cur_mv[i].as_mv, xd);
- if (mv_check_bounds(x, &cur_mv[i]))
+ if (mv_check_bounds(x, &cur_mv[i].as_mv))
return INT64_MAX;
mbmi->mv[i].as_int = cur_mv[i].as_int;
}