Commit 7bca32a6 authored by Dmitry Kovalev's avatar Dmitry Kovalev Committed by Gerrit Code Review
Browse files

Merge "Changing vp9_full_search_sad{, x3, x8} signatures."

parents 55214924 36420009
......@@ -737,7 +737,7 @@ specialize vp9_fdct32x32_rd sse2 avx2
#
# Motion search
#
prototype int vp9_full_search_sad "const struct macroblock *x, const struct mv *ref_mv, int sad_per_bit, int distance, const struct vp9_variance_vtable *fn_ptr, DEC_MVCOSTS, const struct mv *center_mv, int n"
prototype int vp9_full_search_sad "const struct macroblock *x, const struct mv *ref_mv, int sad_per_bit, int distance, const struct vp9_variance_vtable *fn_ptr, DEC_MVCOSTS, const struct mv *center_mv, struct mv *best_mv"
specialize vp9_full_search_sad sse3 sse4_1
vp9_full_search_sad_sse3=vp9_full_search_sadx3
vp9_full_search_sad_sse4_1=vp9_full_search_sadx8
......
......@@ -1525,7 +1525,7 @@ int vp9_full_search_sad_c(const MACROBLOCK *x, const MV *ref_mv,
int sad_per_bit, int distance,
const vp9_variance_fn_ptr_t *fn_ptr,
int *mvjcost, int *mvcost[2],
const MV *center_mv, int block) {
const MV *center_mv, MV *best_mv) {
int r, c;
const MACROBLOCKD *const xd = &x->e_mbd;
const uint8_t *const what = x->plane[0].src.buf;
......@@ -1544,7 +1544,6 @@ int vp9_full_search_sad_c(const MACROBLOCK *x, const MV *ref_mv,
int best_sad = fn_ptr->sdf(what, what_stride, best_address, in_what_stride,
0x7fffffff) +
mvsad_err_cost(ref_mv, &fcenter_mv, mvjsadcost, mvsadcost, sad_per_bit);
MV *best_mv = &xd->mi_8x8[0]->bmi[block].as_mv[0].as_mv;
*best_mv = *ref_mv;
for (r = row_min; r < row_max; ++r) {
......@@ -1578,13 +1577,12 @@ int vp9_full_search_sadx3(const MACROBLOCK *x, const MV *ref_mv,
int sad_per_bit, int distance,
const vp9_variance_fn_ptr_t *fn_ptr,
int *mvjcost, int *mvcost[2],
const MV *center_mv, int n) {
const MV *center_mv, MV *best_mv) {
const MACROBLOCKD *const xd = &x->e_mbd;
const uint8_t *const what = x->plane[0].src.buf;
const int what_stride = x->plane[0].src.stride;
const uint8_t *const in_what = xd->plane[0].pre[0].buf;
const int in_what_stride = xd->plane[0].pre[0].stride;
MV *best_mv = &xd->mi_8x8[0]->bmi[n].as_mv[0].as_mv;
MV this_mv;
unsigned int bestsad = INT_MAX;
int r, c;
......@@ -1684,13 +1682,12 @@ int vp9_full_search_sadx8(const MACROBLOCK *x, const MV *ref_mv,
int sad_per_bit, int distance,
const vp9_variance_fn_ptr_t *fn_ptr,
int *mvjcost, int *mvcost[2],
const MV *center_mv, int n) {
const MV *center_mv, MV *best_mv) {
const MACROBLOCKD *const xd = &x->e_mbd;
const uint8_t *const what = x->plane[0].src.buf;
const int what_stride = x->plane[0].src.stride;
const uint8_t *const in_what = xd->plane[0].pre[0].buf;
const int in_what_stride = xd->plane[0].pre[0].stride;
MV *best_mv = &xd->mi_8x8[0]->bmi[n].as_mv[0].as_mv;
MV this_mv;
unsigned int bestsad = INT_MAX;
int r, c;
......
......@@ -119,7 +119,7 @@ typedef int (*vp9_full_search_fn_t)(const MACROBLOCK *x,
int distance,
const vp9_variance_fn_ptr_t *fn_ptr,
int *mvjcost, int *mvcost[2],
const MV *center_mv, int n);
const MV *center_mv, MV *best_mv);
typedef int (*vp9_refining_search_fn_t)(const MACROBLOCK *x,
MV *ref_mv, int sad_per_bit,
......
......@@ -1851,22 +1851,22 @@ static void rd_check_segment_txsize(VP9_COMP *cpi, MACROBLOCK *x,
// Should we do a full search (best quality only)
if (cpi->oxcf.mode == MODE_BESTQUALITY ||
cpi->oxcf.mode == MODE_SECONDPASS_BEST) {
int_mv *const best_mv = &mi->bmi[i].as_mv[0];
/* Check if mvp_full is within the range. */
clamp_mv(&mvp_full, x->mv_col_min, x->mv_col_max,
x->mv_row_min, x->mv_row_max);
thissme = cpi->full_search_sad(x, &mvp_full,
sadpb, 16, v_fn_ptr,
x->nmvjointcost, x->mvcost,
&bsi->ref_mv->as_mv, i);
&bsi->ref_mv->as_mv,
&best_mv->as_mv);
if (thissme < bestsme) {
bestsme = thissme;
new_mv->as_int = mi->bmi[i].as_mv[0].as_int;
new_mv->as_int = best_mv->as_int;
} else {
/* The full search result is actually worse so re-instate the
* previous best vector */
mi->bmi[i].as_mv[0].as_int = new_mv->as_int;
// The full search result is actually worse so re-instate the
// previous best vector
best_mv->as_int = new_mv->as_int;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment