]> granicus.if.org Git - libvpx/commit
Correct clamping in use of vp8_find_near_mvs()
authorJohn Koleszar <jkoleszar@google.com>
Wed, 25 Jan 2012 22:55:49 +0000 (14:55 -0800)
committerJohn Koleszar <jkoleszar@google.com>
Thu, 26 Jan 2012 17:37:27 +0000 (09:37 -0800)
commit83cef816fdb16d64be160d5b740a1b242fe3481e
treefec0a43ee0e8012e6c50afdda64fe3a3fa1628a0
parent630d3b95e297405bb95234c7d2036ca218cdd64d
Correct clamping in use of vp8_find_near_mvs()

Commit e06c242ba introduced a change to call vp8_find_near_mvs() only
once instead of once per reference frame by observing that the only
effect that the frame had was on the bias applied to the motion
vector. By keeping track of the sign_bias value, the mv to use could
be flip-flopped by multiplying its components by -1.

This behavior was subtley wrong in the case when clamping was applied
to the motion vectors found by vp8_find_near_mvs(). A motion vector
could be in-bounds with one sign bias, but out of bounds after
inverting the sign, or vice versa. The clamping must match that done
by the decoder.

This change modifies vp8_find_near_mvs() to remove the clamping from
that function. The vp8_pick_inter_mode() and vp8_rd_pick_inter_mode()
functions instead track the correctly clamped values for both bias
values, switching between them by simple assignment. The common
clamping and inversion code is in vp8_find_near_mvs_bias()

Change-Id: I17e1a348d1643497eca0be232e2fbe2acf8478e1
vp8/common/findnearmv.c
vp8/common/findnearmv.h
vp8/encoder/bitstream.c
vp8/encoder/pickinter.c
vp8/encoder/rdopt.c