ref: c8167f5ba7168d8a384eade87841be90ba3b43d2
parent: 35c18baa266550c7c07bd4330d82db9fc7962ec5
author: Dmitry Kovalev <[email protected]>
date: Thu Apr 10 11:16:48 EDT 2014
Fixing invalid ref buffer in vp9_diamond_search_sad_c(). Problem has been introduced recently with the cleanup patch I0816ec12ec0a6f21d0f25f10c214b5fd327afc6c Change-Id: Iaacb956a6039eb5826b82618dc03be32053fb892
--- a/vp9/encoder/vp9_mcomp.c
+++ b/vp9/encoder/vp9_mcomp.c
@@ -993,7 +993,7 @@
const MV fcenter_mv = {center_mv->row >> 3, center_mv->col >> 3};
const int *mvjsadcost = x->nmvjointsadcost;
int *mvsadcost[2] = {x->nmvsadcost[0], x->nmvsadcost[1]};
- const uint8_t *best_address;
+ const uint8_t *best_address, *in_what_ref;
int best_sad = INT_MAX;
int best_site = 0;
int last_site = 0;
@@ -1000,13 +1000,14 @@
int i, j, step;
clamp_mv(ref_mv, x->mv_col_min, x->mv_col_max, x->mv_row_min, x->mv_row_max);
- best_address = get_buf_from_mv(in_what, ref_mv);
+ in_what_ref = get_buf_from_mv(in_what, ref_mv);
+ best_address = in_what_ref;
*num00 = 0;
*best_mv = *ref_mv;
// Check the starting position
best_sad = fn_ptr->sdf(what->buf, what->stride,
- in_what->buf, in_what->stride, 0x7fffffff) +
+ best_address, in_what->stride, 0x7fffffff) +
mvsad_err_cost(best_mv, &fcenter_mv, mvjsadcost, mvsadcost, sad_per_bit);
i = 1;
@@ -1060,7 +1061,7 @@
break;
};
#endif
- } else if (best_address == in_what->buf) {
+ } else if (best_address == in_what_ref) {
(*num00)++;
}
}