summaryrefslogtreecommitdiff
path: root/vp8/common
diff options
context:
space:
mode:
authorYaowu Xu <yaowu@google.com>2012-08-06 10:51:20 -0700
committerYaowu Xu <yaowu@google.com>2012-08-14 09:12:15 -0700
commite52e8b70250b0f897e6947b5c24db365e489ba07 (patch)
treea9fd79226859255bb74bf0caae44e4953f4981d0 /vp8/common
parentb91219e29eb52d429cc5051c7e7ab5aaac8e7d02 (diff)
downloadlibvpx-e52e8b70250b0f897e6947b5c24db365e489ba07.tar
libvpx-e52e8b70250b0f897e6947b5c24db365e489ba07.tar.gz
libvpx-e52e8b70250b0f897e6947b5c24db365e489ba07.tar.bz2
libvpx-e52e8b70250b0f897e6947b5c24db365e489ba07.zip
Changed to use reference mv as nearest mv
The reference motion vector selected by surrounding pixels that has the best matching score is used as nearest motion vector. The change has shown consistent gain on all test sets, compression gains range from .2% to .6%. The variation is largely dependent on various other experiments on or off. Change-Id: I5552e1c2f6fc57c3e8818a5ee41ffda89af05e75
Diffstat (limited to 'vp8/common')
-rw-r--r--vp8/common/findnearmv.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/vp8/common/findnearmv.c b/vp8/common/findnearmv.c
index 1087ee4f8..05789aff2 100644
--- a/vp8/common/findnearmv.c
+++ b/vp8/common/findnearmv.c
@@ -202,7 +202,9 @@ vp8_prob *vp8_mv_ref_probs(VP8_COMMON *pc,
void vp8_find_best_ref_mvs(MACROBLOCKD *xd,
unsigned char *ref_y_buffer,
int ref_y_stride,
- int_mv *best_mv){
+ int_mv *best_mv,
+ int_mv *nearest,
+ int_mv *near) {
int_mv *ref_mv = xd->ref_mv;
int bestsad = INT_MAX;
int i;
@@ -259,6 +261,13 @@ void vp8_find_best_ref_mvs(MACROBLOCKD *xd,
lower_mv_precision(best_mv);
vp8_clamp_mv2(best_mv, xd);
+
+ if (best_mv->as_int != 0 &&
+ (best_mv->as_mv.row >> 3) != (nearest->as_mv.row >>3 ) &&
+ (best_mv->as_mv.col >> 3) != (nearest->as_mv.col >>3 )) {
+ near->as_int = nearest->as_int;
+ nearest->as_int = best_mv->as_int;
+ }
}
#endif