summaryrefslogtreecommitdiff
path: root/vp9
diff options
context:
space:
mode:
authorDmitry Kovalev <dkovalev@google.com>2014-02-19 13:39:21 -0800
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>2014-02-19 13:39:21 -0800
commit3ba5df491120f798cb1a7e44608866827d4c9e38 (patch)
treecac195a1af19f45129cf5f1ad1d40fd98c3a3ed6 /vp9
parent43b7959dbc2361f5ec23e9fd9aaa8e4f14599783 (diff)
parent9b75f381cfc0482c7ccde92ca0fc83773706b0c5 (diff)
downloadlibvpx-3ba5df491120f798cb1a7e44608866827d4c9e38.tar
libvpx-3ba5df491120f798cb1a7e44608866827d4c9e38.tar.gz
libvpx-3ba5df491120f798cb1a7e44608866827d4c9e38.tar.bz2
libvpx-3ba5df491120f798cb1a7e44608866827d4c9e38.zip
Merge "Adding is_mv_valid() function."
Diffstat (limited to 'vp9')
-rw-r--r--vp9/decoder/vp9_decodemv.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/vp9/decoder/vp9_decodemv.c b/vp9/decoder/vp9_decodemv.c
index 856c8b533..4de8db37c 100644
--- a/vp9/decoder/vp9_decodemv.c
+++ b/vp9/decoder/vp9_decodemv.c
@@ -356,6 +356,11 @@ static void read_intra_block_mode_info(VP9_COMMON *const cm, MODE_INFO *mi,
mbmi->uv_mode = read_intra_mode_uv(cm, r, mbmi->mode);
}
+static INLINE int is_mv_valid(const MV *mv) {
+ return mv->row > MV_LOW && mv->row < MV_UPP &&
+ mv->col > MV_LOW && mv->col < MV_UPP;
+}
+
static INLINE int assign_mv(VP9_COMMON *cm, MB_PREDICTION_MODE mode,
int_mv mv[2], int_mv ref_mv[2],
int_mv nearest_mv[2], int_mv near_mv[2],
@@ -367,14 +372,10 @@ static INLINE int assign_mv(VP9_COMMON *cm, MB_PREDICTION_MODE mode,
case NEWMV: {
nmv_context_counts *const mv_counts = cm->frame_parallel_decoding_mode ?
NULL : &cm->counts.mv;
- read_mv(r, &mv[0].as_mv, &ref_mv[0].as_mv,
- &cm->fc.nmvc, mv_counts, allow_hp);
- if (is_compound)
- read_mv(r, &mv[1].as_mv, &ref_mv[1].as_mv,
- &cm->fc.nmvc, mv_counts, allow_hp);
for (i = 0; i < 1 + is_compound; ++i) {
- ret = ret && mv[i].as_mv.row < MV_UPP && mv[i].as_mv.row > MV_LOW;
- ret = ret && mv[i].as_mv.col < MV_UPP && mv[i].as_mv.col > MV_LOW;
+ read_mv(r, &mv[i].as_mv, &ref_mv[i].as_mv, &cm->fc.nmvc, mv_counts,
+ allow_hp);
+ ret = ret && is_mv_valid(&mv[i].as_mv);
}
break;
}