diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2015-10-20 15:56:56 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-10-20 15:56:56 +0000 |
commit | 1a645957804a8d090981d13e99897501409bda8f (patch) | |
tree | 459352dd1d60b86580a3646dc2283b49f2b269ba | |
parent | 4a7f012b95170875af20a4e33aaa0d733caa8e57 (diff) | |
parent | dea998997f46a3a15e07284452bd1d7407912bb4 (diff) | |
download | libvpx-1a645957804a8d090981d13e99897501409bda8f.tar libvpx-1a645957804a8d090981d13e99897501409bda8f.tar.gz libvpx-1a645957804a8d090981d13e99897501409bda8f.tar.bz2 libvpx-1a645957804a8d090981d13e99897501409bda8f.zip |
Merge "vp10: allow MV refs to point outside visible image."
-rw-r--r-- | vp10/common/mvref_common.c | 4 | ||||
-rw-r--r-- | vp10/common/mvref_common.h | 15 |
2 files changed, 17 insertions, 2 deletions
diff --git a/vp10/common/mvref_common.c b/vp10/common/mvref_common.c index 9bf701fcc..b2eeaa29e 100644 --- a/vp10/common/mvref_common.c +++ b/vp10/common/mvref_common.c @@ -27,6 +27,8 @@ static void find_mv_refs_idx(const VP10_COMMON *cm, const MACROBLOCKD *xd, const MV_REF *const prev_frame_mvs = cm->use_prev_frame_mvs ? cm->prev_frame->mvs + mi_row * cm->mi_cols + mi_col : NULL; const TileInfo *const tile = &xd->tile; + const int bw = num_8x8_blocks_wide_lookup[mi->mbmi.sb_type] << 3; + const int bh = num_8x8_blocks_high_lookup[mi->mbmi.sb_type] << 3; // Blank the reference vector list memset(mv_ref_list, 0, sizeof(*mv_ref_list) * MAX_MV_REF_CANDIDATES); @@ -145,7 +147,7 @@ static void find_mv_refs_idx(const VP10_COMMON *cm, const MACROBLOCKD *xd, // Clamp vectors for (i = 0; i < MAX_MV_REF_CANDIDATES; ++i) - clamp_mv_ref(&mv_ref_list[i].as_mv, xd); + clamp_mv_ref(&mv_ref_list[i].as_mv, bw, bh, xd); } void vp10_find_mv_refs(const VP10_COMMON *cm, const MACROBLOCKD *xd, diff --git a/vp10/common/mvref_common.h b/vp10/common/mvref_common.h index e92ad52cd..4608df0fe 100644 --- a/vp10/common/mvref_common.h +++ b/vp10/common/mvref_common.h @@ -119,13 +119,26 @@ static const int idx_n_column_to_subblock[4][2] = { }; // clamp_mv_ref +#if CONFIG_MISC_FIXES +#define MV_BORDER (8 << 3) // Allow 8 pels in 1/8th pel units +#else #define MV_BORDER (16 << 3) // Allow 16 pels in 1/8th pel units +#endif -static INLINE void clamp_mv_ref(MV *mv, const MACROBLOCKD *xd) { +static INLINE void clamp_mv_ref(MV *mv, int bw, int bh, const MACROBLOCKD *xd) { +#if CONFIG_MISC_FIXES + clamp_mv(mv, xd->mb_to_left_edge - bw * 8 - MV_BORDER, + xd->mb_to_right_edge + bw * 8 + MV_BORDER, + xd->mb_to_top_edge - bh * 8 - MV_BORDER, + xd->mb_to_bottom_edge + bh * 8 + MV_BORDER); +#else + (void) bw; + (void) bh; clamp_mv(mv, xd->mb_to_left_edge - MV_BORDER, xd->mb_to_right_edge + MV_BORDER, xd->mb_to_top_edge - MV_BORDER, xd->mb_to_bottom_edge + MV_BORDER); +#endif } // This function returns either the appropriate sub block or block's mv |