Commit 03973017 authored by Yunqing Wang's avatar Yunqing Wang
Browse files

Remove hex search's variance calculation while in real-time mode

In real-time mode motion search, there is no need to calculate
variance. This change improved encoding speed by 1% ~ 2%(speed=-5).

Change-Id: I65b874901eb599ac38fe8cf9cad898c14138d431
parent 04edde2b
...@@ -842,7 +842,6 @@ int vp8_hex_search ...@@ -842,7 +842,6 @@ int vp8_hex_search
int_mv *best_mv, int_mv *best_mv,
int search_param, int search_param,
int sad_per_bit, int sad_per_bit,
int *num00,
const vp8_variance_fn_ptr_t *vfp, const vp8_variance_fn_ptr_t *vfp,
int *mvsadcost[2], int *mvsadcost[2],
int *mvcost[2], int *mvcost[2],
...@@ -996,12 +995,8 @@ cal_neighbors: ...@@ -996,12 +995,8 @@ cal_neighbors:
best_mv->as_mv.row = br; best_mv->as_mv.row = br;
best_mv->as_mv.col = bc; best_mv->as_mv.col = bc;
this_mv.as_mv.row = br<<3;
this_mv.as_mv.col = bc<<3;
this_offset = (unsigned char *)(*(d->base_pre) + d->pre + (br * (in_what_stride)) + bc); return bestsad;
return vfp->vf(what, what_stride, this_offset, in_what_stride, &bestsad)
+ mv_err_cost(&this_mv, center_mv, mvcost, x->errorperbit) ;
} }
#undef CHECK_BOUNDS #undef CHECK_BOUNDS
#undef CHECK_POINT #undef CHECK_POINT
......
...@@ -40,7 +40,6 @@ extern int vp8_hex_search ...@@ -40,7 +40,6 @@ extern int vp8_hex_search
int_mv *best_mv, int_mv *best_mv,
int search_param, int search_param,
int error_per_bit, int error_per_bit,
int *num00,
const vp8_variance_fn_ptr_t *vf, const vp8_variance_fn_ptr_t *vf,
int *mvsadcost[2], int *mvsadcost[2],
int *mvcost[2], int *mvcost[2],
......
...@@ -762,7 +762,7 @@ void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, ...@@ -762,7 +762,7 @@ void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset,
if (cpi->sf.search_method == HEX) if (cpi->sf.search_method == HEX)
{ {
bestsme = vp8_hex_search(x, b, d, &mvp, &d->bmi.mv, step_param, bestsme = vp8_hex_search(x, b, d, &mvp, &d->bmi.mv, step_param,
sadpb, &num00, &cpi->fn_ptr[BLOCK_16X16], sadpb, &cpi->fn_ptr[BLOCK_16X16],
x->mvsadcost, x->mvcost, &best_ref_mv); x->mvsadcost, x->mvcost, &best_ref_mv);
mode_mv[NEWMV].as_int = d->bmi.mv.as_int; mode_mv[NEWMV].as_int = d->bmi.mv.as_int;
} }
......
...@@ -153,7 +153,6 @@ static int vp8_temporal_filter_find_matching_mb_c ...@@ -153,7 +153,6 @@ static int vp8_temporal_filter_find_matching_mb_c
int further_steps; int further_steps;
int sadpb = x->sadperbit16; int sadpb = x->sadperbit16;
int bestsme = INT_MAX; int bestsme = INT_MAX;
int num00 = 0;
BLOCK *b = &x->block[0]; BLOCK *b = &x->block[0];
BLOCKD *d = &x->e_mbd.block[0]; BLOCKD *d = &x->e_mbd.block[0];
...@@ -201,7 +200,7 @@ static int vp8_temporal_filter_find_matching_mb_c ...@@ -201,7 +200,7 @@ static int vp8_temporal_filter_find_matching_mb_c
&best_ref_mv1, &d->bmi.mv, &best_ref_mv1, &d->bmi.mv,
step_param, step_param,
sadpb, sadpb,
&num00, &cpi->fn_ptr[BLOCK_16X16], &cpi->fn_ptr[BLOCK_16X16],
mvsadcost, mvcost, &best_ref_mv1); mvsadcost, mvcost, &best_ref_mv1);
#if ALT_REF_SUBPEL_ENABLED #if ALT_REF_SUBPEL_ENABLED
......
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