Commit 27c67ac0 authored by Yaowu Xu's avatar Yaowu Xu

misc-fixes: correct motion vector clamping

This commit merges the fix of motion vector clamping correction.

Related tracking issue:
https://bugs.chromium.org/p/webm/issues/detail?id=1037
Original libvpx commit:
dea99899

Change-Id: If3bc4ddccd5d25d8cc40d273cf0ab14aeefbcfe3
parent d59d8dc0
......@@ -208,25 +208,13 @@ 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, 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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment