Moving from int_mv* to MV* (3).
Change-Id: I9795d0937bc07793c13d067281995e0750f694d9
This commit is contained in:
parent
f9e2140cab
commit
8266da1cd1
@ -46,9 +46,9 @@ static unsigned int do_16x16_motion_iteration(VP9_COMP *cpi,
|
|||||||
ref_full.as_mv.row = ref_mv->as_mv.row >> 3;
|
ref_full.as_mv.row = ref_mv->as_mv.row >> 3;
|
||||||
|
|
||||||
/*cpi->sf.search_method == HEX*/
|
/*cpi->sf.search_method == HEX*/
|
||||||
best_err = vp9_hex_search(x, &ref_full, step_param, x->errorperbit,
|
best_err = vp9_hex_search(x, &ref_full.as_mv, step_param, x->errorperbit,
|
||||||
0, &v_fn_ptr,
|
0, &v_fn_ptr,
|
||||||
0, ref_mv, dst_mv);
|
0, &ref_mv->as_mv, &dst_mv->as_mv);
|
||||||
|
|
||||||
// Try sub-pixel MC
|
// Try sub-pixel MC
|
||||||
// if (bestsme > error_thresh && bestsme < INT_MAX)
|
// if (bestsme > error_thresh && bestsme < INT_MAX)
|
||||||
|
@ -680,10 +680,10 @@ int vp9_find_best_sub_pixel_comp_tree(MACROBLOCK *x,
|
|||||||
|
|
||||||
#define CHECK_POINT \
|
#define CHECK_POINT \
|
||||||
{\
|
{\
|
||||||
if (this_mv.as_mv.col < x->mv_col_min) continue;\
|
if (this_mv.col < x->mv_col_min) continue;\
|
||||||
if (this_mv.as_mv.col > x->mv_col_max) continue;\
|
if (this_mv.col > x->mv_col_max) continue;\
|
||||||
if (this_mv.as_mv.row < x->mv_row_min) continue;\
|
if (this_mv.row < x->mv_row_min) continue;\
|
||||||
if (this_mv.as_mv.row > x->mv_row_max) continue;\
|
if (this_mv.row > x->mv_row_max) continue;\
|
||||||
}
|
}
|
||||||
|
|
||||||
#define CHECK_BETTER \
|
#define CHECK_BETTER \
|
||||||
@ -691,7 +691,7 @@ int vp9_find_best_sub_pixel_comp_tree(MACROBLOCK *x,
|
|||||||
if (thissad < bestsad)\
|
if (thissad < bestsad)\
|
||||||
{\
|
{\
|
||||||
if (use_mvcost) \
|
if (use_mvcost) \
|
||||||
thissad += mvsad_err_cost(&this_mv.as_mv, &fcenter_mv.as_mv, \
|
thissad += mvsad_err_cost(&this_mv, &fcenter_mv.as_mv, \
|
||||||
mvjsadcost, mvsadcost, \
|
mvjsadcost, mvsadcost, \
|
||||||
sad_per_bit);\
|
sad_per_bit);\
|
||||||
if (thissad < bestsad)\
|
if (thissad < bestsad)\
|
||||||
@ -716,14 +716,14 @@ int vp9_find_best_sub_pixel_comp_tree(MACROBLOCK *x,
|
|||||||
// candidates as indicated in the num_candidates and candidates arrays
|
// candidates as indicated in the num_candidates and candidates arrays
|
||||||
// passed into this function
|
// passed into this function
|
||||||
static int vp9_pattern_search(MACROBLOCK *x,
|
static int vp9_pattern_search(MACROBLOCK *x,
|
||||||
int_mv *ref_mv,
|
MV *ref_mv,
|
||||||
int search_param,
|
int search_param,
|
||||||
int sad_per_bit,
|
int sad_per_bit,
|
||||||
int do_init_search,
|
int do_init_search,
|
||||||
int do_refine,
|
int do_refine,
|
||||||
const vp9_variance_fn_ptr_t *vfp,
|
const vp9_variance_fn_ptr_t *vfp,
|
||||||
int use_mvcost,
|
int use_mvcost,
|
||||||
int_mv *center_mv, int_mv *best_mv,
|
const MV *center_mv, MV *best_mv,
|
||||||
const int num_candidates[MAX_PATTERN_SCALES],
|
const int num_candidates[MAX_PATTERN_SCALES],
|
||||||
const MV candidates[MAX_PATTERN_SCALES]
|
const MV candidates[MAX_PATTERN_SCALES]
|
||||||
[MAX_PATTERN_CANDIDATES]) {
|
[MAX_PATTERN_CANDIDATES]) {
|
||||||
@ -736,7 +736,7 @@ static int vp9_pattern_search(MACROBLOCK *x,
|
|||||||
int what_stride = x->plane[0].src.stride;
|
int what_stride = x->plane[0].src.stride;
|
||||||
int in_what_stride = xd->plane[0].pre[0].stride;
|
int in_what_stride = xd->plane[0].pre[0].stride;
|
||||||
int br, bc;
|
int br, bc;
|
||||||
int_mv this_mv;
|
MV this_mv;
|
||||||
int bestsad = INT_MAX;
|
int bestsad = INT_MAX;
|
||||||
int thissad;
|
int thissad;
|
||||||
uint8_t *base_offset;
|
uint8_t *base_offset;
|
||||||
@ -749,22 +749,21 @@ static int vp9_pattern_search(MACROBLOCK *x,
|
|||||||
int *mvjsadcost = x->nmvjointsadcost;
|
int *mvjsadcost = x->nmvjointsadcost;
|
||||||
int *mvsadcost[2] = {x->nmvsadcost[0], x->nmvsadcost[1]};
|
int *mvsadcost[2] = {x->nmvsadcost[0], x->nmvsadcost[1]};
|
||||||
|
|
||||||
fcenter_mv.as_mv.row = center_mv->as_mv.row >> 3;
|
fcenter_mv.as_mv.row = center_mv->row >> 3;
|
||||||
fcenter_mv.as_mv.col = center_mv->as_mv.col >> 3;
|
fcenter_mv.as_mv.col = center_mv->col >> 3;
|
||||||
|
|
||||||
// adjust ref_mv to make sure it is within MV range
|
// adjust ref_mv to make sure it is within MV range
|
||||||
clamp_mv(&ref_mv->as_mv,
|
clamp_mv(ref_mv, x->mv_col_min, x->mv_col_max, x->mv_row_min, x->mv_row_max);
|
||||||
x->mv_col_min, x->mv_col_max, x->mv_row_min, x->mv_row_max);
|
br = ref_mv->row;
|
||||||
br = ref_mv->as_mv.row;
|
bc = ref_mv->col;
|
||||||
bc = ref_mv->as_mv.col;
|
|
||||||
|
|
||||||
// Work out the start point for the search
|
// Work out the start point for the search
|
||||||
base_offset = (uint8_t *)(xd->plane[0].pre[0].buf);
|
base_offset = (uint8_t *)(xd->plane[0].pre[0].buf);
|
||||||
this_offset = base_offset + (br * in_what_stride) + bc;
|
this_offset = base_offset + (br * in_what_stride) + bc;
|
||||||
this_mv.as_mv.row = br;
|
this_mv.row = br;
|
||||||
this_mv.as_mv.col = bc;
|
this_mv.col = bc;
|
||||||
bestsad = vfp->sdf(what, what_stride, this_offset, in_what_stride, 0x7fffffff)
|
bestsad = vfp->sdf(what, what_stride, this_offset, in_what_stride, 0x7fffffff)
|
||||||
+ mvsad_err_cost(&this_mv.as_mv, &fcenter_mv.as_mv,
|
+ mvsad_err_cost(&this_mv, &fcenter_mv.as_mv,
|
||||||
mvjsadcost, mvsadcost, sad_per_bit);
|
mvjsadcost, mvsadcost, sad_per_bit);
|
||||||
|
|
||||||
// Search all possible scales upto the search param around the center point
|
// Search all possible scales upto the search param around the center point
|
||||||
@ -778,21 +777,21 @@ static int vp9_pattern_search(MACROBLOCK *x,
|
|||||||
CHECK_BOUNDS((1 << t))
|
CHECK_BOUNDS((1 << t))
|
||||||
if (all_in) {
|
if (all_in) {
|
||||||
for (i = 0; i < num_candidates[t]; i++) {
|
for (i = 0; i < num_candidates[t]; i++) {
|
||||||
this_mv.as_mv.row = br + candidates[t][i].row;
|
this_mv.row = br + candidates[t][i].row;
|
||||||
this_mv.as_mv.col = bc + candidates[t][i].col;
|
this_mv.col = bc + candidates[t][i].col;
|
||||||
this_offset = base_offset + (this_mv.as_mv.row * in_what_stride) +
|
this_offset = base_offset + (this_mv.row * in_what_stride) +
|
||||||
this_mv.as_mv.col;
|
this_mv.col;
|
||||||
thissad = vfp->sdf(what, what_stride, this_offset, in_what_stride,
|
thissad = vfp->sdf(what, what_stride, this_offset, in_what_stride,
|
||||||
bestsad);
|
bestsad);
|
||||||
CHECK_BETTER
|
CHECK_BETTER
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (i = 0; i < num_candidates[t]; i++) {
|
for (i = 0; i < num_candidates[t]; i++) {
|
||||||
this_mv.as_mv.row = br + candidates[t][i].row;
|
this_mv.row = br + candidates[t][i].row;
|
||||||
this_mv.as_mv.col = bc + candidates[t][i].col;
|
this_mv.col = bc + candidates[t][i].col;
|
||||||
CHECK_POINT
|
CHECK_POINT
|
||||||
this_offset = base_offset + (this_mv.as_mv.row * in_what_stride) +
|
this_offset = base_offset + (this_mv.row * in_what_stride) +
|
||||||
this_mv.as_mv.col;
|
this_mv.col;
|
||||||
thissad = vfp->sdf(what, what_stride, this_offset, in_what_stride,
|
thissad = vfp->sdf(what, what_stride, this_offset, in_what_stride,
|
||||||
bestsad);
|
bestsad);
|
||||||
CHECK_BETTER
|
CHECK_BETTER
|
||||||
@ -822,21 +821,21 @@ static int vp9_pattern_search(MACROBLOCK *x,
|
|||||||
CHECK_BOUNDS((1 << s))
|
CHECK_BOUNDS((1 << s))
|
||||||
if (all_in) {
|
if (all_in) {
|
||||||
for (i = 0; i < num_candidates[s]; i++) {
|
for (i = 0; i < num_candidates[s]; i++) {
|
||||||
this_mv.as_mv.row = br + candidates[s][i].row;
|
this_mv.row = br + candidates[s][i].row;
|
||||||
this_mv.as_mv.col = bc + candidates[s][i].col;
|
this_mv.col = bc + candidates[s][i].col;
|
||||||
this_offset = base_offset + (this_mv.as_mv.row * in_what_stride) +
|
this_offset = base_offset + (this_mv.row * in_what_stride) +
|
||||||
this_mv.as_mv.col;
|
this_mv.col;
|
||||||
thissad = vfp->sdf(what, what_stride, this_offset, in_what_stride,
|
thissad = vfp->sdf(what, what_stride, this_offset, in_what_stride,
|
||||||
bestsad);
|
bestsad);
|
||||||
CHECK_BETTER
|
CHECK_BETTER
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (i = 0; i < num_candidates[s]; i++) {
|
for (i = 0; i < num_candidates[s]; i++) {
|
||||||
this_mv.as_mv.row = br + candidates[s][i].row;
|
this_mv.row = br + candidates[s][i].row;
|
||||||
this_mv.as_mv.col = bc + candidates[s][i].col;
|
this_mv.col = bc + candidates[s][i].col;
|
||||||
CHECK_POINT
|
CHECK_POINT
|
||||||
this_offset = base_offset + (this_mv.as_mv.row * in_what_stride) +
|
this_offset = base_offset + (this_mv.row * in_what_stride) +
|
||||||
this_mv.as_mv.col;
|
this_mv.col;
|
||||||
thissad = vfp->sdf(what, what_stride, this_offset, in_what_stride,
|
thissad = vfp->sdf(what, what_stride, this_offset, in_what_stride,
|
||||||
bestsad);
|
bestsad);
|
||||||
CHECK_BETTER
|
CHECK_BETTER
|
||||||
@ -860,25 +859,21 @@ static int vp9_pattern_search(MACROBLOCK *x,
|
|||||||
get_next_chkpts(next_chkpts_indices, k, num_candidates[s]);
|
get_next_chkpts(next_chkpts_indices, k, num_candidates[s]);
|
||||||
if (all_in) {
|
if (all_in) {
|
||||||
for (i = 0; i < PATTERN_CANDIDATES_REF; i++) {
|
for (i = 0; i < PATTERN_CANDIDATES_REF; i++) {
|
||||||
this_mv.as_mv.row = br +
|
this_mv.row = br + candidates[s][next_chkpts_indices[i]].row;
|
||||||
candidates[s][next_chkpts_indices[i]].row;
|
this_mv.col = bc + candidates[s][next_chkpts_indices[i]].col;
|
||||||
this_mv.as_mv.col = bc +
|
this_offset = base_offset + (this_mv.row * (in_what_stride)) +
|
||||||
candidates[s][next_chkpts_indices[i]].col;
|
this_mv.col;
|
||||||
this_offset = base_offset + (this_mv.as_mv.row * (in_what_stride)) +
|
|
||||||
this_mv.as_mv.col;
|
|
||||||
thissad = vfp->sdf(what, what_stride, this_offset, in_what_stride,
|
thissad = vfp->sdf(what, what_stride, this_offset, in_what_stride,
|
||||||
bestsad);
|
bestsad);
|
||||||
CHECK_BETTER
|
CHECK_BETTER
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (i = 0; i < PATTERN_CANDIDATES_REF; i++) {
|
for (i = 0; i < PATTERN_CANDIDATES_REF; i++) {
|
||||||
this_mv.as_mv.row = br +
|
this_mv.row = br + candidates[s][next_chkpts_indices[i]].row;
|
||||||
candidates[s][next_chkpts_indices[i]].row;
|
this_mv.col = bc + candidates[s][next_chkpts_indices[i]].col;
|
||||||
this_mv.as_mv.col = bc +
|
|
||||||
candidates[s][next_chkpts_indices[i]].col;
|
|
||||||
CHECK_POINT
|
CHECK_POINT
|
||||||
this_offset = base_offset + (this_mv.as_mv.row * (in_what_stride)) +
|
this_offset = base_offset + (this_mv.row * (in_what_stride)) +
|
||||||
this_mv.as_mv.col;
|
this_mv.col;
|
||||||
thissad = vfp->sdf(what, what_stride, this_offset, in_what_stride,
|
thissad = vfp->sdf(what, what_stride, this_offset, in_what_stride,
|
||||||
bestsad);
|
bestsad);
|
||||||
CHECK_BETTER
|
CHECK_BETTER
|
||||||
@ -905,21 +900,21 @@ static int vp9_pattern_search(MACROBLOCK *x,
|
|||||||
CHECK_BOUNDS(1)
|
CHECK_BOUNDS(1)
|
||||||
if (all_in) {
|
if (all_in) {
|
||||||
for (i = 0; i < 4; i++) {
|
for (i = 0; i < 4; i++) {
|
||||||
this_mv.as_mv.row = br + neighbors[i].row;
|
this_mv.row = br + neighbors[i].row;
|
||||||
this_mv.as_mv.col = bc + neighbors[i].col;
|
this_mv.col = bc + neighbors[i].col;
|
||||||
this_offset = base_offset + (this_mv.as_mv.row * (in_what_stride)) +
|
this_offset = base_offset + (this_mv.row * (in_what_stride)) +
|
||||||
this_mv.as_mv.col;
|
this_mv.col;
|
||||||
thissad = vfp->sdf(what, what_stride, this_offset, in_what_stride,
|
thissad = vfp->sdf(what, what_stride, this_offset, in_what_stride,
|
||||||
bestsad);
|
bestsad);
|
||||||
CHECK_BETTER
|
CHECK_BETTER
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (i = 0; i < 4; i++) {
|
for (i = 0; i < 4; i++) {
|
||||||
this_mv.as_mv.row = br + neighbors[i].row;
|
this_mv.row = br + neighbors[i].row;
|
||||||
this_mv.as_mv.col = bc + neighbors[i].col;
|
this_mv.col = bc + neighbors[i].col;
|
||||||
CHECK_POINT
|
CHECK_POINT
|
||||||
this_offset = base_offset + (this_mv.as_mv.row * (in_what_stride)) +
|
this_offset = base_offset + (this_mv.row * (in_what_stride)) +
|
||||||
this_mv.as_mv.col;
|
this_mv.col;
|
||||||
thissad = vfp->sdf(what, what_stride, this_offset, in_what_stride,
|
thissad = vfp->sdf(what, what_stride, this_offset, in_what_stride,
|
||||||
bestsad);
|
bestsad);
|
||||||
CHECK_BETTER
|
CHECK_BETTER
|
||||||
@ -935,32 +930,32 @@ static int vp9_pattern_search(MACROBLOCK *x,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
best_mv->as_mv.row = br;
|
best_mv->row = br;
|
||||||
best_mv->as_mv.col = bc;
|
best_mv->col = bc;
|
||||||
|
|
||||||
this_offset = base_offset + (best_mv->as_mv.row * (in_what_stride)) +
|
this_offset = base_offset + (best_mv->row * in_what_stride) +
|
||||||
best_mv->as_mv.col;
|
best_mv->col;
|
||||||
this_mv.as_mv.row = best_mv->as_mv.row * 8;
|
this_mv.row = best_mv->row * 8;
|
||||||
this_mv.as_mv.col = best_mv->as_mv.col * 8;
|
this_mv.col = best_mv->col * 8;
|
||||||
if (bestsad == INT_MAX)
|
if (bestsad == INT_MAX)
|
||||||
return INT_MAX;
|
return INT_MAX;
|
||||||
|
|
||||||
return vfp->vf(what, what_stride, this_offset, in_what_stride,
|
return vfp->vf(what, what_stride, this_offset, in_what_stride,
|
||||||
(unsigned int *)&bestsad) +
|
(unsigned int *)&bestsad) +
|
||||||
use_mvcost ? mv_err_cost(&this_mv.as_mv, ¢er_mv->as_mv,
|
use_mvcost ? mv_err_cost(&this_mv, center_mv,
|
||||||
x->nmvjointcost, x->mvcost, x->errorperbit)
|
x->nmvjointcost, x->mvcost, x->errorperbit)
|
||||||
: 0;
|
: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int vp9_hex_search(MACROBLOCK *x,
|
int vp9_hex_search(MACROBLOCK *x,
|
||||||
int_mv *ref_mv,
|
MV *ref_mv,
|
||||||
int search_param,
|
int search_param,
|
||||||
int sad_per_bit,
|
int sad_per_bit,
|
||||||
int do_init_search,
|
int do_init_search,
|
||||||
const vp9_variance_fn_ptr_t *vfp,
|
const vp9_variance_fn_ptr_t *vfp,
|
||||||
int use_mvcost,
|
int use_mvcost,
|
||||||
int_mv *center_mv, int_mv *best_mv) {
|
const MV *center_mv, MV *best_mv) {
|
||||||
// First scale has 8-closest points, the rest have 6 points in hex shape
|
// First scale has 8-closest points, the rest have 6 points in hex shape
|
||||||
// at increasing scales
|
// at increasing scales
|
||||||
static const int hex_num_candidates[MAX_PATTERN_SCALES] = {
|
static const int hex_num_candidates[MAX_PATTERN_SCALES] = {
|
||||||
@ -989,14 +984,14 @@ int vp9_hex_search(MACROBLOCK *x,
|
|||||||
}
|
}
|
||||||
|
|
||||||
int vp9_bigdia_search(MACROBLOCK *x,
|
int vp9_bigdia_search(MACROBLOCK *x,
|
||||||
int_mv *ref_mv,
|
MV *ref_mv,
|
||||||
int search_param,
|
int search_param,
|
||||||
int sad_per_bit,
|
int sad_per_bit,
|
||||||
int do_init_search,
|
int do_init_search,
|
||||||
const vp9_variance_fn_ptr_t *vfp,
|
const vp9_variance_fn_ptr_t *vfp,
|
||||||
int use_mvcost,
|
int use_mvcost,
|
||||||
int_mv *center_mv,
|
const MV *center_mv,
|
||||||
int_mv *best_mv) {
|
MV *best_mv) {
|
||||||
// First scale has 4-closest points, the rest have 8 points in diamond
|
// First scale has 4-closest points, the rest have 8 points in diamond
|
||||||
// shape at increasing scales
|
// shape at increasing scales
|
||||||
static const int bigdia_num_candidates[MAX_PATTERN_SCALES] = {
|
static const int bigdia_num_candidates[MAX_PATTERN_SCALES] = {
|
||||||
@ -1023,22 +1018,21 @@ int vp9_bigdia_search(MACROBLOCK *x,
|
|||||||
{{-512, -512}, {0, -1024}, {512, -512}, {1024, 0}, {512, 512}, {0, 1024},
|
{{-512, -512}, {0, -1024}, {512, -512}, {1024, 0}, {512, 512}, {0, 1024},
|
||||||
{-512, 512}, {-1024, 0}},
|
{-512, 512}, {-1024, 0}},
|
||||||
};
|
};
|
||||||
return
|
return vp9_pattern_search(x, ref_mv, search_param, sad_per_bit,
|
||||||
vp9_pattern_search(x, ref_mv, search_param, sad_per_bit,
|
do_init_search, 0, vfp, use_mvcost,
|
||||||
do_init_search, 0, vfp, use_mvcost,
|
center_mv, best_mv,
|
||||||
center_mv, best_mv,
|
bigdia_num_candidates, bigdia_candidates);
|
||||||
bigdia_num_candidates, bigdia_candidates);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int vp9_square_search(MACROBLOCK *x,
|
int vp9_square_search(MACROBLOCK *x,
|
||||||
int_mv *ref_mv,
|
MV *ref_mv,
|
||||||
int search_param,
|
int search_param,
|
||||||
int sad_per_bit,
|
int sad_per_bit,
|
||||||
int do_init_search,
|
int do_init_search,
|
||||||
const vp9_variance_fn_ptr_t *vfp,
|
const vp9_variance_fn_ptr_t *vfp,
|
||||||
int use_mvcost,
|
int use_mvcost,
|
||||||
int_mv *center_mv,
|
const MV *center_mv,
|
||||||
int_mv *best_mv) {
|
MV *best_mv) {
|
||||||
// All scales have 8 closest points in square shape
|
// All scales have 8 closest points in square shape
|
||||||
static const int square_num_candidates[MAX_PATTERN_SCALES] = {
|
static const int square_num_candidates[MAX_PATTERN_SCALES] = {
|
||||||
8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
|
8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
|
||||||
@ -1065,11 +1059,10 @@ int vp9_square_search(MACROBLOCK *x,
|
|||||||
{{-1024, -1024}, {0, -1024}, {1024, -1024}, {1024, 0}, {1024, 1024},
|
{{-1024, -1024}, {0, -1024}, {1024, -1024}, {1024, 0}, {1024, 1024},
|
||||||
{0, 1024}, {-1024, 1024}, {-1024, 0}},
|
{0, 1024}, {-1024, 1024}, {-1024, 0}},
|
||||||
};
|
};
|
||||||
return
|
return vp9_pattern_search(x, ref_mv, search_param, sad_per_bit,
|
||||||
vp9_pattern_search(x, ref_mv, search_param, sad_per_bit,
|
do_init_search, 0, vfp, use_mvcost,
|
||||||
do_init_search, 0, vfp, use_mvcost,
|
center_mv, best_mv,
|
||||||
center_mv, best_mv,
|
square_num_candidates, square_candidates);
|
||||||
square_num_candidates, square_candidates);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#undef CHECK_BOUNDS
|
#undef CHECK_BOUNDS
|
||||||
|
@ -40,32 +40,32 @@ int vp9_full_pixel_diamond(struct VP9_COMP *cpi, MACROBLOCK *x,
|
|||||||
int_mv *ref_mv, int_mv *dst_mv);
|
int_mv *ref_mv, int_mv *dst_mv);
|
||||||
|
|
||||||
int vp9_hex_search(MACROBLOCK *x,
|
int vp9_hex_search(MACROBLOCK *x,
|
||||||
int_mv *ref_mv,
|
MV *ref_mv,
|
||||||
int search_param,
|
int search_param,
|
||||||
int error_per_bit,
|
int error_per_bit,
|
||||||
int do_init_search,
|
int do_init_search,
|
||||||
const vp9_variance_fn_ptr_t *vf,
|
const vp9_variance_fn_ptr_t *vf,
|
||||||
int use_mvcost,
|
int use_mvcost,
|
||||||
int_mv *center_mv,
|
const MV *center_mv,
|
||||||
int_mv *best_mv);
|
MV *best_mv);
|
||||||
int vp9_bigdia_search(MACROBLOCK *x,
|
int vp9_bigdia_search(MACROBLOCK *x,
|
||||||
int_mv *ref_mv,
|
MV *ref_mv,
|
||||||
int search_param,
|
int search_param,
|
||||||
int error_per_bit,
|
int error_per_bit,
|
||||||
int do_init_search,
|
int do_init_search,
|
||||||
const vp9_variance_fn_ptr_t *vf,
|
const vp9_variance_fn_ptr_t *vf,
|
||||||
int use_mvcost,
|
int use_mvcost,
|
||||||
int_mv *center_mv,
|
const MV *center_mv,
|
||||||
int_mv *best_mv);
|
MV *best_mv);
|
||||||
int vp9_square_search(MACROBLOCK *x,
|
int vp9_square_search(MACROBLOCK *x,
|
||||||
int_mv *ref_mv,
|
MV *ref_mv,
|
||||||
int search_param,
|
int search_param,
|
||||||
int error_per_bit,
|
int error_per_bit,
|
||||||
int do_init_search,
|
int do_init_search,
|
||||||
const vp9_variance_fn_ptr_t *vf,
|
const vp9_variance_fn_ptr_t *vf,
|
||||||
int use_mvcost,
|
int use_mvcost,
|
||||||
int_mv *center_mv,
|
const MV *center_mv,
|
||||||
int_mv *best_mv);
|
MV *best_mv);
|
||||||
|
|
||||||
typedef int (fractional_mv_step_fp) (
|
typedef int (fractional_mv_step_fp) (
|
||||||
MACROBLOCK *x,
|
MACROBLOCK *x,
|
||||||
|
@ -1836,20 +1836,23 @@ static void rd_check_segment_txsize(VP9_COMP *cpi, MACROBLOCK *x,
|
|||||||
// adjust src pointer for this block
|
// adjust src pointer for this block
|
||||||
mi_buf_shift(x, i);
|
mi_buf_shift(x, i);
|
||||||
if (cpi->sf.search_method == HEX) {
|
if (cpi->sf.search_method == HEX) {
|
||||||
bestsme = vp9_hex_search(x, &mvp_full,
|
bestsme = vp9_hex_search(x, &mvp_full.as_mv,
|
||||||
step_param,
|
step_param,
|
||||||
sadpb, 1, v_fn_ptr, 1,
|
sadpb, 1, v_fn_ptr, 1,
|
||||||
bsi->ref_mv, &mode_mv[NEWMV]);
|
&bsi->ref_mv->as_mv,
|
||||||
|
&mode_mv[NEWMV].as_mv);
|
||||||
} else if (cpi->sf.search_method == SQUARE) {
|
} else if (cpi->sf.search_method == SQUARE) {
|
||||||
bestsme = vp9_square_search(x, &mvp_full,
|
bestsme = vp9_square_search(x, &mvp_full.as_mv,
|
||||||
step_param,
|
step_param,
|
||||||
sadpb, 1, v_fn_ptr, 1,
|
sadpb, 1, v_fn_ptr, 1,
|
||||||
bsi->ref_mv, &mode_mv[NEWMV]);
|
&bsi->ref_mv->as_mv,
|
||||||
|
&mode_mv[NEWMV].as_mv);
|
||||||
} else if (cpi->sf.search_method == BIGDIA) {
|
} else if (cpi->sf.search_method == BIGDIA) {
|
||||||
bestsme = vp9_bigdia_search(x, &mvp_full,
|
bestsme = vp9_bigdia_search(x, &mvp_full.as_mv,
|
||||||
step_param,
|
step_param,
|
||||||
sadpb, 1, v_fn_ptr, 1,
|
sadpb, 1, v_fn_ptr, 1,
|
||||||
bsi->ref_mv, &mode_mv[NEWMV]);
|
&bsi->ref_mv->as_mv,
|
||||||
|
&mode_mv[NEWMV].as_mv);
|
||||||
} else {
|
} else {
|
||||||
bestsme = vp9_full_pixel_diamond(cpi, x, &mvp_full, step_param,
|
bestsme = vp9_full_pixel_diamond(cpi, x, &mvp_full, step_param,
|
||||||
sadpb, further_steps, 0, v_fn_ptr,
|
sadpb, further_steps, 0, v_fn_ptr,
|
||||||
@ -2446,23 +2449,23 @@ static void single_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
|
|||||||
further_steps = (cpi->sf.max_step_search_steps - 1) - step_param;
|
further_steps = (cpi->sf.max_step_search_steps - 1) - step_param;
|
||||||
|
|
||||||
if (cpi->sf.search_method == HEX) {
|
if (cpi->sf.search_method == HEX) {
|
||||||
bestsme = vp9_hex_search(x, &mvp_full,
|
bestsme = vp9_hex_search(x, &mvp_full.as_mv,
|
||||||
step_param,
|
step_param,
|
||||||
sadpb, 1,
|
sadpb, 1,
|
||||||
&cpi->fn_ptr[block_size], 1,
|
&cpi->fn_ptr[block_size], 1,
|
||||||
&ref_mv, tmp_mv);
|
&ref_mv.as_mv, &tmp_mv->as_mv);
|
||||||
} else if (cpi->sf.search_method == SQUARE) {
|
} else if (cpi->sf.search_method == SQUARE) {
|
||||||
bestsme = vp9_square_search(x, &mvp_full,
|
bestsme = vp9_square_search(x, &mvp_full.as_mv,
|
||||||
step_param,
|
step_param,
|
||||||
sadpb, 1,
|
sadpb, 1,
|
||||||
&cpi->fn_ptr[block_size], 1,
|
&cpi->fn_ptr[block_size], 1,
|
||||||
&ref_mv, tmp_mv);
|
&ref_mv.as_mv, &tmp_mv->as_mv);
|
||||||
} else if (cpi->sf.search_method == BIGDIA) {
|
} else if (cpi->sf.search_method == BIGDIA) {
|
||||||
bestsme = vp9_bigdia_search(x, &mvp_full,
|
bestsme = vp9_bigdia_search(x, &mvp_full.as_mv,
|
||||||
step_param,
|
step_param,
|
||||||
sadpb, 1,
|
sadpb, 1,
|
||||||
&cpi->fn_ptr[block_size], 1,
|
&cpi->fn_ptr[block_size], 1,
|
||||||
&ref_mv, tmp_mv);
|
&ref_mv.as_mv, &tmp_mv->as_mv);
|
||||||
} else {
|
} else {
|
||||||
bestsme = vp9_full_pixel_diamond(cpi, x, &mvp_full, step_param,
|
bestsme = vp9_full_pixel_diamond(cpi, x, &mvp_full, step_param,
|
||||||
sadpb, further_steps, 1,
|
sadpb, further_steps, 1,
|
||||||
|
@ -154,10 +154,10 @@ static int temporal_filter_find_matching_mb_c(VP9_COMP *cpi,
|
|||||||
// TODO Check that the 16x16 vf & sdf are selected here
|
// TODO Check that the 16x16 vf & sdf are selected here
|
||||||
// Ignore mv costing by sending NULL pointer instead of cost arrays
|
// Ignore mv costing by sending NULL pointer instead of cost arrays
|
||||||
ref_mv = &x->e_mbd.mi_8x8[0]->bmi[0].as_mv[0];
|
ref_mv = &x->e_mbd.mi_8x8[0]->bmi[0].as_mv[0];
|
||||||
bestsme = vp9_hex_search(x, &best_ref_mv1_full,
|
bestsme = vp9_hex_search(x, &best_ref_mv1_full.as_mv,
|
||||||
step_param, sadpb, 1,
|
step_param, sadpb, 1,
|
||||||
&cpi->fn_ptr[BLOCK_16X16],
|
&cpi->fn_ptr[BLOCK_16X16],
|
||||||
0, &best_ref_mv1, ref_mv);
|
0, &best_ref_mv1.as_mv, &ref_mv->as_mv);
|
||||||
|
|
||||||
#if ALT_REF_SUBPEL_ENABLED
|
#if ALT_REF_SUBPEL_ENABLED
|
||||||
// Try sub-pixel MC?
|
// Try sub-pixel MC?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user