Merge "Cleaning up first_pass_motion_search() function."
This commit is contained in:
commit
2b6e0fe010
@ -394,42 +394,35 @@ static unsigned int zz_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void first_pass_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
|
static void first_pass_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
MV *ref_mv, MV *best_mv,
|
const MV *ref_mv, MV *best_mv,
|
||||||
YV12_BUFFER_CONFIG *recon_buffer,
|
YV12_BUFFER_CONFIG *recon_buffer,
|
||||||
int *best_motion_err, int recon_yoffset) {
|
int *best_motion_err, int recon_yoffset) {
|
||||||
MACROBLOCKD *const xd = &x->e_mbd;
|
MACROBLOCKD *const xd = &x->e_mbd;
|
||||||
int num00;
|
|
||||||
|
|
||||||
MV tmp_mv = {0, 0};
|
MV tmp_mv = {0, 0};
|
||||||
MV ref_mv_full;
|
MV ref_mv_full = {ref_mv->row >> 3, ref_mv->col >> 3};
|
||||||
|
int num00, tmp_err, n, sr = 0;
|
||||||
int tmp_err;
|
|
||||||
int step_param = 3;
|
int step_param = 3;
|
||||||
int further_steps = (MAX_MVSEARCH_STEPS - 1) - step_param;
|
int further_steps = (MAX_MVSEARCH_STEPS - 1) - step_param;
|
||||||
int n;
|
const BLOCK_SIZE bsize = xd->mi_8x8[0]->mbmi.sb_type;
|
||||||
vp9_variance_fn_ptr_t v_fn_ptr = cpi->fn_ptr[xd->mi_8x8[0]->mbmi.sb_type];
|
vp9_variance_fn_ptr_t v_fn_ptr = cpi->fn_ptr[bsize];
|
||||||
int new_mv_mode_penalty = 256;
|
int new_mv_mode_penalty = 256;
|
||||||
|
const int quart_frm = MIN(cpi->common.width, cpi->common.height);
|
||||||
int sr = 0;
|
|
||||||
int quart_frm = MIN(cpi->common.width, cpi->common.height);
|
|
||||||
|
|
||||||
// refine the motion search range accroding to the frame dimension
|
// refine the motion search range accroding to the frame dimension
|
||||||
// for first pass test
|
// for first pass test
|
||||||
while ((quart_frm << sr) < MAX_FULL_PEL_VAL)
|
while ((quart_frm << sr) < MAX_FULL_PEL_VAL)
|
||||||
sr++;
|
sr++;
|
||||||
|
|
||||||
step_param += sr;
|
step_param += sr;
|
||||||
further_steps -= sr;
|
further_steps -= sr;
|
||||||
|
|
||||||
// override the default variance function to use MSE
|
// override the default variance function to use MSE
|
||||||
v_fn_ptr.vf = get_block_variance_fn(xd->mi_8x8[0]->mbmi.sb_type);
|
v_fn_ptr.vf = get_block_variance_fn(bsize);
|
||||||
|
|
||||||
// Set up pointers for this macro block recon buffer
|
// Set up pointers for this macro block recon buffer
|
||||||
xd->plane[0].pre[0].buf = recon_buffer->y_buffer + recon_yoffset;
|
xd->plane[0].pre[0].buf = recon_buffer->y_buffer + recon_yoffset;
|
||||||
|
|
||||||
// Initial step/diamond search centred on best mv
|
// Initial step/diamond search centred on best mv
|
||||||
ref_mv_full.col = ref_mv->col >> 3;
|
|
||||||
ref_mv_full.row = ref_mv->row >> 3;
|
|
||||||
tmp_err = cpi->diamond_search_sad(x, &ref_mv_full, &tmp_mv,
|
tmp_err = cpi->diamond_search_sad(x, &ref_mv_full, &tmp_mv,
|
||||||
step_param,
|
step_param,
|
||||||
x->sadperbit16, &num00, &v_fn_ptr,
|
x->sadperbit16, &num00, &v_fn_ptr,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user