summaryrefslogtreecommitdiff
path: root/vp9/decoder/vp9_decodemv.c
diff options
context:
space:
mode:
authorJingning Han <jingning@google.com>2013-09-27 17:22:59 -0700
committerJingning Han <jingning@google.com>2013-10-02 10:29:45 -0700
commit6d3bd966075fdb76e415095f6165d0541f4bd0d8 (patch)
tree31c93784deae42509987b8be43835db804926e61 /vp9/decoder/vp9_decodemv.c
parent6c2082db7126964fc0a09a659ea8e69faca50e78 (diff)
downloadlibvpx-6d3bd966075fdb76e415095f6165d0541f4bd0d8.tar
libvpx-6d3bd966075fdb76e415095f6165d0541f4bd0d8.tar.gz
libvpx-6d3bd966075fdb76e415095f6165d0541f4bd0d8.tar.bz2
libvpx-6d3bd966075fdb76e415095f6165d0541f4bd0d8.zip
BITSTREAM - CLARIFICATION OF MV SIZE RANGE
The codec should effectively run with motion vector of range (-2048, 2047) in full pixels, for sequences of 1080p and below. Add assertions to clarify this behavior. Change-Id: Ia0cac28249f587d8f8882205228fa480263ab313
Diffstat (limited to 'vp9/decoder/vp9_decodemv.c')
-rw-r--r--vp9/decoder/vp9_decodemv.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/vp9/decoder/vp9_decodemv.c b/vp9/decoder/vp9_decodemv.c
index c697d665d..18e6ea0ef 100644
--- a/vp9/decoder/vp9_decodemv.c
+++ b/vp9/decoder/vp9_decodemv.c
@@ -522,8 +522,14 @@ static void read_inter_block_mode_info(VP9D_COMP *pbi, MODE_INFO *mi,
assert(!"Invalid inter mode value");
}
mi->bmi[j].as_mv[0].as_int = block[0].as_int;
- if (is_compound)
+ assert(block[0].as_mv.row < MV_UPP && block[0].as_mv.row > MV_LOW);
+ assert(block[0].as_mv.col < MV_UPP && block[0].as_mv.col > MV_LOW);
+
+ if (is_compound) {
mi->bmi[j].as_mv[1].as_int = block[1].as_int;
+ assert(block[1].as_mv.row < MV_UPP && block[1].as_mv.row > MV_LOW);
+ assert(block[1].as_mv.col < MV_UPP && block[1].as_mv.col > MV_LOW);
+ }
if (num_4x4_h == 2)
mi->bmi[j + 2] = mi->bmi[j];
@@ -564,6 +570,12 @@ static void read_inter_block_mode_info(VP9D_COMP *pbi, MODE_INFO *mi,
default:
assert(!"Invalid inter mode value");
}
+ assert(mv0->as_mv.row < MV_UPP && mv0->as_mv.row > MV_LOW);
+ assert(mv0->as_mv.col < MV_UPP && mv0->as_mv.col > MV_LOW);
+ if (is_compound) {
+ assert(mv1->as_mv.row < MV_UPP && mv1->as_mv.row > MV_LOW);
+ assert(mv1->as_mv.col < MV_UPP && mv1->as_mv.col > MV_LOW);
+ }
}
}