diff options
author | Yunqing Wang <yunqingwang@google.com> | 2011-06-30 11:20:13 -0400 |
---|---|---|
committer | Yunqing Wang <yunqingwang@google.com> | 2011-06-30 11:20:13 -0400 |
commit | b7480454706a6b15bf091e659cd6227ab373c1a6 (patch) | |
tree | bc695dcfaf24572130f10be7a0fb64ab8073491d /vp8/encoder/mcomp.c | |
parent | 034cea5e726b851294baad4d77e81bb6ce45703c (diff) | |
download | libvpx-b7480454706a6b15bf091e659cd6227ab373c1a6.tar libvpx-b7480454706a6b15bf091e659cd6227ab373c1a6.tar.gz libvpx-b7480454706a6b15bf091e659cd6227ab373c1a6.tar.bz2 libvpx-b7480454706a6b15bf091e659cd6227ab373c1a6.zip |
Bug fix in motion vector limit calculation
Motion vector limits are calculated using right shifts, which
could give wrong results for negative numbers. James Berry's
test on one clip showed encoder produced some artifacts. This
change fixed that.
Change-Id: I035fc02280b10455b7f6eb388f7c2e33b796b018
Diffstat (limited to 'vp8/encoder/mcomp.c')
-rw-r--r-- | vp8/encoder/mcomp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/vp8/encoder/mcomp.c b/vp8/encoder/mcomp.c index 416948870..6f314a386 100644 --- a/vp8/encoder/mcomp.c +++ b/vp8/encoder/mcomp.c @@ -286,8 +286,8 @@ int vp8_find_best_sub_pixel_step_iteratively(MACROBLOCK *x, BLOCK *b, BLOCKD *d, bestmv->as_mv.row = br << 1; bestmv->as_mv.col = bc << 1; - if ((abs(bestmv->as_mv.col - ref_mv->as_mv.col) > MAX_FULL_PEL_VAL) || - (abs(bestmv->as_mv.row - ref_mv->as_mv.row) > MAX_FULL_PEL_VAL)) + if ((abs(bestmv->as_mv.col - ref_mv->as_mv.col) > (MAX_FULL_PEL_VAL<<3)) || + (abs(bestmv->as_mv.row - ref_mv->as_mv.row) > (MAX_FULL_PEL_VAL<<3))) return INT_MAX; return besterr; |