summaryrefslogtreecommitdiff
path: root/vp9/encoder/vp9_mcomp.c
diff options
context:
space:
mode:
authorDmitry Kovalev <dkovalev@google.com>2014-02-17 14:51:58 +0100
committerDmitry Kovalev <dkovalev@google.com>2014-02-17 14:51:58 +0100
commit35092585d8a2748d2b0563b69c0cd5aac0c304a2 (patch)
treeeb741989496f26aaabeebb650f572a6ce365be87 /vp9/encoder/vp9_mcomp.c
parentcca8a54cddff214d330609077d2275926b6932a4 (diff)
downloadlibvpx-35092585d8a2748d2b0563b69c0cd5aac0c304a2.tar
libvpx-35092585d8a2748d2b0563b69c0cd5aac0c304a2.tar.gz
libvpx-35092585d8a2748d2b0563b69c0cd5aac0c304a2.tar.bz2
libvpx-35092585d8a2748d2b0563b69c0cd5aac0c304a2.zip
Cleaning up vp9_refining_search_sad() function.
Change-Id: Ife6131d31882177953a22a69d25adc35940429ed
Diffstat (limited to 'vp9/encoder/vp9_mcomp.c')
-rw-r--r--vp9/encoder/vp9_mcomp.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/vp9/encoder/vp9_mcomp.c b/vp9/encoder/vp9_mcomp.c
index 94e49bd4a..8b45f8b3e 100644
--- a/vp9/encoder/vp9_mcomp.c
+++ b/vp9/encoder/vp9_mcomp.c
@@ -1652,11 +1652,7 @@ int vp9_refining_search_sad_c(const MACROBLOCK *x,
const uint8_t *const in_what = xd->plane[0].pre[0].buf;
const uint8_t *best_address = &in_what[ref_mv->row * in_what_stride +
ref_mv->col];
- unsigned int thissad;
-
const MV fcenter_mv = {center_mv->row >> 3, center_mv->col >> 3};
- MV this_mv;
-
const int *mvjsadcost = x->nmvjointsadcost;
int *mvsadcost[2] = {x->nmvsadcost[0], x->nmvsadcost[1]};
@@ -1668,15 +1664,13 @@ int vp9_refining_search_sad_c(const MACROBLOCK *x,
int best_site = -1;
for (j = 0; j < 4; j++) {
- this_mv.row = ref_mv->row + neighbors[j].row;
- this_mv.col = ref_mv->col + neighbors[j].col;
-
+ const MV this_mv = {ref_mv->row + neighbors[j].row,
+ ref_mv->col + neighbors[j].col};
if (is_mv_in(x, &this_mv)) {
const uint8_t *check_here = &in_what[this_mv.row * in_what_stride +
this_mv.col];
- thissad = fn_ptr->sdf(what, what_stride, check_here, in_what_stride,
- bestsad);
-
+ unsigned int thissad = fn_ptr->sdf(what, what_stride, check_here,
+ in_what_stride, bestsad);
if (thissad < bestsad) {
thissad += mvsad_err_cost(&this_mv, &fcenter_mv,
mvjsadcost, mvsadcost, error_per_bit);
@@ -1698,15 +1692,15 @@ int vp9_refining_search_sad_c(const MACROBLOCK *x,
}
}
- this_mv.row = ref_mv->row * 8;
- this_mv.col = ref_mv->col * 8;
-
- if (bestsad < INT_MAX)
+ if (bestsad < INT_MAX) {
+ unsigned int unused;
+ const MV mv = {ref_mv->row * 8, ref_mv->col * 8};
return fn_ptr->vf(what, what_stride, best_address, in_what_stride,
- (unsigned int *)(&thissad)) +
- mv_err_cost(&this_mv, center_mv, mvjcost, mvcost, x->errorperbit);
- else
+ &unused) +
+ mv_err_cost(&mv, center_mv, mvjcost, mvcost, x->errorperbit);
+ } else {
return INT_MAX;
+ }
}
int vp9_refining_search_sadx4(const MACROBLOCK *x,