summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Kovalev <dkovalev@google.com>2014-03-06 16:27:15 -0800
committerDmitry Kovalev <dkovalev@google.com>2014-03-06 16:27:15 -0800
commitee7d26d50caf169c48b1d0bad25442f14229a091 (patch)
treee3c6b181de7e1cd60739cfbd6c9a5c487aae083b
parentd1aeef94a510ffcef8411954697a9fd7e113572d (diff)
downloadlibvpx-ee7d26d50caf169c48b1d0bad25442f14229a091.tar
libvpx-ee7d26d50caf169c48b1d0bad25442f14229a091.tar.gz
libvpx-ee7d26d50caf169c48b1d0bad25442f14229a091.tar.bz2
libvpx-ee7d26d50caf169c48b1d0bad25442f14229a091.zip
Cleaning up vp9_get_mvpred_var().
Change-Id: Ic535f0a1c2501c1af143237af3b2b51b4b4980f4
-rw-r--r--vp9/encoder/vp9_mcomp.c18
-rw-r--r--vp9/encoder/vp9_mcomp.h3
2 files changed, 9 insertions, 12 deletions
diff --git a/vp9/encoder/vp9_mcomp.c b/vp9/encoder/vp9_mcomp.c
index 158bb6849..d40f7133c 100644
--- a/vp9/encoder/vp9_mcomp.c
+++ b/vp9/encoder/vp9_mcomp.c
@@ -711,23 +711,21 @@ static int vp9_pattern_search(const MACROBLOCK *x,
}
int vp9_get_mvpred_var(const MACROBLOCK *x,
- MV *best_mv,
- const MV *center_mv,
+ const MV *best_mv, const MV *center_mv,
const vp9_variance_fn_ptr_t *vfp,
int use_mvcost) {
- unsigned int bestsad;
- MV this_mv;
+ unsigned int unused;
+
const MACROBLOCKD *const xd = &x->e_mbd;
const uint8_t *what = x->plane[0].src.buf;
const int what_stride = x->plane[0].src.stride;
const int in_what_stride = xd->plane[0].pre[0].stride;
const uint8_t *base_offset = xd->plane[0].pre[0].buf;
- const uint8_t *this_offset = base_offset + (best_mv->row * in_what_stride) +
- best_mv->col;
- this_mv.row = best_mv->row * 8;
- this_mv.col = best_mv->col * 8;
- return vfp->vf(what, what_stride, this_offset, in_what_stride, &bestsad) +
- (use_mvcost ? mv_err_cost(&this_mv, center_mv, x->nmvjointcost,
+ const uint8_t *this_offset = &base_offset[best_mv->row * in_what_stride +
+ best_mv->col];
+ const MV mv = {best_mv->row * 8, best_mv->col * 8};
+ return vfp->vf(what, what_stride, this_offset, in_what_stride, &unused) +
+ (use_mvcost ? mv_err_cost(&mv, center_mv, x->nmvjointcost,
x->mvcost, x->errorperbit) : 0);
}
diff --git a/vp9/encoder/vp9_mcomp.h b/vp9/encoder/vp9_mcomp.h
index 39360f1b4..0d127106c 100644
--- a/vp9/encoder/vp9_mcomp.h
+++ b/vp9/encoder/vp9_mcomp.h
@@ -38,8 +38,7 @@ int vp9_mv_bit_cost(const MV *mv, const MV *ref,
// Utility to compute variance + MV rate cost for a given MV
int vp9_get_mvpred_var(const MACROBLOCK *x,
- MV *best_mv,
- const MV *center_mv,
+ const MV *best_mv, const MV *center_mv,
const vp9_variance_fn_ptr_t *vfp,
int use_mvcost);
int vp9_get_mvpred_av_var(const MACROBLOCK *x,