Changing vp9_full_search_sad{, x3, x8} signatures.

Passing block MV pointer instead of block index into
vp9_full_search_sad{, x3, x8} functions.

Change-Id: Ica07356633471c2c8f81b583a7aeba85a436bafb
This commit is contained in:
Dmitry Kovalev 2014-02-17 14:24:57 +01:00
parent cca8a54cdd
commit 36420009ea
4 changed files with 12 additions and 15 deletions

View File

@ -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

View File

@ -1347,7 +1347,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;
@ -1366,7 +1366,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) {
@ -1400,13 +1399,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;
@ -1506,13 +1504,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;

View File

@ -111,7 +111,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,

View File

@ -1847,22 +1847,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;
}
}