ref: 3fd96f7d7d848ce8fc3ff27cb689207d191996ed
parent: 14e1b235284d8902a4bb4219f04cfcfc1a287b50
parent: 8a800b52eaee33e71aba7fb59118dcf14ac1dd1c
author: Jerome Jiang <jianj@google.com>
date: Fri May 3 14:13:46 EDT 2019
Merge "vp8: clamp uv mv after calculation."
--- a/vp8/common/reconinter.c
+++ b/vp8/common/reconinter.c
@@ -333,6 +333,13 @@
_16x16mv.as_mv.row &= x->fullpixel_mask;
_16x16mv.as_mv.col &= x->fullpixel_mask;
+ if (2 * _16x16mv.as_mv.col < (x->mb_to_left_edge - (19 << 3)) ||
+ 2 * _16x16mv.as_mv.col > x->mb_to_right_edge + (18 << 3) ||
+ 2 * _16x16mv.as_mv.row < (x->mb_to_top_edge - (19 << 3)) ||
+ 2 * _16x16mv.as_mv.row > x->mb_to_bottom_edge + (18 << 3)) {
+ return;
+ }
+
pre_stride >>= 1;
offset = (_16x16mv.as_mv.row >> 3) * pre_stride + (_16x16mv.as_mv.col >> 3);
uptr = x->pre.u_buffer + offset;