summaryrefslogtreecommitdiff
path: root/vp8/encoder/mcomp.c
diff options
context:
space:
mode:
authorYunqing Wang <yunqingwang@google.com>2011-02-07 19:16:15 -0500
committerYunqing Wang <yunqingwang@google.com>2011-02-10 13:40:24 -0500
commit41e6eceb28b6b5bda8c4d8b0abbf182b8f30609c (patch)
treea821f64322470d513b21b2d9f5032ff34eb1fa34 /vp8/encoder/mcomp.c
parenteaadfb58695f1b5928be47e87bb00d7a6096a3ab (diff)
downloadlibvpx-41e6eceb28b6b5bda8c4d8b0abbf182b8f30609c.tar
libvpx-41e6eceb28b6b5bda8c4d8b0abbf182b8f30609c.tar.gz
libvpx-41e6eceb28b6b5bda8c4d8b0abbf182b8f30609c.tar.bz2
libvpx-41e6eceb28b6b5bda8c4d8b0abbf182b8f30609c.zip
Improve motion search in real-time mode
Applied better MV prediction in real-time mode, which improves the encoding quality. Used quarter-pixel search instead of iterative sub-pixel search for speed >=5 to improve encoding performance. Tests on the test set showed: 1. For speed=-5, quality improvement: 1.7% on AvgPSNR and 2.1% on SSIM, performance improvement: 3.6% (This counts in the performance lose caused by MV prediction calculation in "Improve MV prediction in vp8_pick_inter_mode() for speed>3"). 2. For speed=-8, quality improvement: 2.1% on AvgPSNR and 2.5% on SSIM. but, 6.9% performance decrease because of MV prediction calculation. This should be improved later. Change-Id: I349a96c452bd691081d8c8e3e54419e7f477bebd
Diffstat (limited to 'vp8/encoder/mcomp.c')
-rw-r--r--vp8/encoder/mcomp.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/vp8/encoder/mcomp.c b/vp8/encoder/mcomp.c
index d9923fbe9..33aaa2ca9 100644
--- a/vp8/encoder/mcomp.c
+++ b/vp8/encoder/mcomp.c
@@ -779,15 +779,17 @@ int vp8_hex_search
int *num00,
const vp8_variance_fn_ptr_t *vfp,
int *mvsadcost[2],
- int *mvcost[2]
+ int *mvcost[2],
+ MV *center_mv
)
{
MV hex[6] = { { -1, -2}, {1, -2}, {2, 0}, {1, 2}, { -1, 2}, { -2, 0} } ;
- MV neighbors[8] = { { -1, -1}, { -1, 0}, { -1, 1}, {0, -1}, {0, 1}, {1, -1}, {1, 0}, {1, 1} } ;
+ MV neighbors[8] = { { -1, -1}, {0, -1}, {1, -1}, { -1, 0}, {1, 0}, { -1, 1}, {0, 1}, {1, 1} } ;
int i, j;
unsigned char *src = (*(b->base_src) + b->src);
int src_stride = b->src_stride;
- int rr = ref_mv->row, rc = ref_mv->col, br = rr >> 3, bc = rc >> 3, tr, tc;
+ int rr = center_mv->row, rc = center_mv->col;
+ int br = ref_mv->row >> 3, bc = ref_mv->col >> 3, tr, tc;
unsigned int besterr, thiserr = 0x7fffffff;
int k = -1, tk;
@@ -892,7 +894,7 @@ cal_neighbors:
best_mv->row = br;
best_mv->col = bc;
- return vfp->vf(src, src_stride, PRE(br, bc), d->pre_stride, &thiserr) + MVC(br, bc) ;
+ return vfp->vf(src, src_stride, PRE(br, bc), d->pre_stride, &thiserr) + vp8_mv_err_cost(best_mv, center_mv, mvcost, error_per_bit) ;
}
#undef MVC
#undef PRE