summaryrefslogtreecommitdiff
path: root/vp8/encoder/pickinter.c
diff options
context:
space:
mode:
authorYaowu Xu <yaowu@google.com>2010-06-30 18:58:54 -0700
committerYaowu Xu <yaowu@google.com>2011-06-01 10:10:44 -0700
commit50916c6a7da357eeee43c36b4d6ab6a723ddbe1e (patch)
tree93e3ce05f72964c33dee4e32e02de136919dde1f /vp8/encoder/pickinter.c
parent9e4f76c154a355bac2a3e005e47882219801bdae (diff)
downloadlibvpx-50916c6a7da357eeee43c36b4d6ab6a723ddbe1e.tar
libvpx-50916c6a7da357eeee43c36b4d6ab6a723ddbe1e.tar.gz
libvpx-50916c6a7da357eeee43c36b4d6ab6a723ddbe1e.tar.bz2
libvpx-50916c6a7da357eeee43c36b4d6ab6a723ddbe1e.zip
remove some magic weights associated with sad_per_bit
sad_per_bit has been used for a number of motion vector search routines with different magic weights: 1, 1/2 and 1/4. This commit remove these magic numbers and use 1/2 for all motion search routines, also reformat a number of source code lines to within 80 column limit. Test on cif set shows overall effect is neutral on all metrics. <=0.01% Change-Id: I8a382821fa4cffc9c0acf8e8431435a03df74885
Diffstat (limited to 'vp8/encoder/pickinter.c')
-rw-r--r--vp8/encoder/pickinter.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/vp8/encoder/pickinter.c b/vp8/encoder/pickinter.c
index 7bc3b5260..24bd245f0 100644
--- a/vp8/encoder/pickinter.c
+++ b/vp8/encoder/pickinter.c
@@ -713,7 +713,7 @@ void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset,
int step_param;
int further_steps;
int n = 0;
- int sadpb = x->sadperbit16;
+ int sadpb = x->sadperbit16/2;
int col_min;
int col_max;
@@ -760,12 +760,17 @@ void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset,
if (cpi->sf.search_method == HEX)
{
- bestsme = vp8_hex_search(x, b, d, &mvp, &d->bmi.mv, step_param, sadpb/*x->errorperbit*/, &num00, &cpi->fn_ptr[BLOCK_16X16], x->mvsadcost, x->mvcost, &best_ref_mv);
+ bestsme = vp8_hex_search(x, b, d, &mvp, &d->bmi.mv, step_param,
+ sadpb, &num00, &cpi->fn_ptr[BLOCK_16X16],
+ x->mvsadcost, x->mvcost, &best_ref_mv);
mode_mv[NEWMV].as_int = d->bmi.mv.as_int;
}
else
{
- bestsme = cpi->diamond_search_sad(x, b, d, &mvp, &d->bmi.mv, step_param, sadpb / 2/*x->errorperbit*/, &num00, &cpi->fn_ptr[BLOCK_16X16], x->mvcost, &best_ref_mv); //sadpb < 9
+ bestsme = cpi->diamond_search_sad(x, b, d, &mvp, &d->bmi.mv,
+ step_param, sadpb, &num00,
+ &cpi->fn_ptr[BLOCK_16X16],
+ x->mvcost, &best_ref_mv);
mode_mv[NEWMV].as_int = d->bmi.mv.as_int;
// Further step/diamond searches as necessary
@@ -787,7 +792,7 @@ void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset,
cpi->diamond_search_sad(x, b, d, &mvp,
&d->bmi.mv,
step_param + n,
- sadpb / 4, &num00,
+ sadpb, &num00,
&cpi->fn_ptr[BLOCK_16X16],
x->mvcost, &best_ref_mv);
if (thissme < bestsme)