Merge "Cleaning up vp9_refining_search_sadx4()."
This commit is contained in:
commit
413da97bb6
@ -1674,7 +1674,6 @@ int vp9_refining_search_sadx4(const MACROBLOCK *x,
|
||||
const MACROBLOCKD *const xd = &x->e_mbd;
|
||||
MV neighbors[4] = {{ -1, 0}, {0, -1}, {0, 1}, {1, 0}};
|
||||
int i, j;
|
||||
int this_row_offset, this_col_offset;
|
||||
|
||||
const int what_stride = x->plane[0].src.stride;
|
||||
const int in_what_stride = xd->plane[0].pre[0].stride;
|
||||
@ -1682,8 +1681,6 @@ int vp9_refining_search_sadx4(const MACROBLOCK *x,
|
||||
const uint8_t *best_address = xd->plane[0].pre[0].buf +
|
||||
(ref_mv->row * xd->plane[0].pre[0].stride) +
|
||||
ref_mv->col;
|
||||
unsigned int thissad;
|
||||
MV this_mv;
|
||||
|
||||
const MV fcenter_mv = {center_mv->row >> 3, center_mv->col >> 3};
|
||||
|
||||
@ -1715,8 +1712,8 @@ int vp9_refining_search_sadx4(const MACROBLOCK *x,
|
||||
|
||||
for (j = 0; j < 4; j++) {
|
||||
if (sad_array[j] < bestsad) {
|
||||
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};
|
||||
sad_array[j] += mvsad_err_cost(&this_mv, &fcenter_mv,
|
||||
mvjsadcost, mvsadcost, error_per_bit);
|
||||
|
||||
@ -1728,21 +1725,16 @@ int vp9_refining_search_sadx4(const MACROBLOCK *x,
|
||||
}
|
||||
} else {
|
||||
for (j = 0; j < 4; j++) {
|
||||
this_row_offset = ref_mv->row + neighbors[j].row;
|
||||
this_col_offset = ref_mv->col + neighbors[j].col;
|
||||
const MV this_mv = {ref_mv->row + neighbors[j].row,
|
||||
ref_mv->col + neighbors[j].col};
|
||||
|
||||
if ((this_col_offset > x->mv_col_min) &&
|
||||
(this_col_offset < x->mv_col_max) &&
|
||||
(this_row_offset > x->mv_row_min) &&
|
||||
(this_row_offset < x->mv_row_max)) {
|
||||
if (is_mv_in(x, &this_mv)) {
|
||||
const uint8_t *check_here = neighbors[j].row * in_what_stride +
|
||||
neighbors[j].col + best_address;
|
||||
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) {
|
||||
this_mv.row = this_row_offset;
|
||||
this_mv.col = this_col_offset;
|
||||
thissad += mvsad_err_cost(&this_mv, &fcenter_mv,
|
||||
mvjsadcost, mvsadcost, error_per_bit);
|
||||
|
||||
@ -1764,6 +1756,7 @@ int vp9_refining_search_sadx4(const MACROBLOCK *x,
|
||||
neighbors[best_site].col;
|
||||
}
|
||||
}
|
||||
|
||||
return bestsad;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user