Remove hex search's variance calculation while in real-time mode
authorYunqing Wang <yunqingwang@google.com>
Thu, 2 Jun 2011 18:47:06 +0000 (14:47 -0400)
committerYunqing Wang <yunqingwang@google.com>
Mon, 6 Jun 2011 23:11:05 +0000 (19:11 -0400)
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

vp8/encoder/mcomp.c
vp8/encoder/mcomp.h
vp8/encoder/pickinter.c
vp8/encoder/temporal_filter.c

index 50c4745..d22fdb2 100644 (file)
@@ -842,7 +842,6 @@ int vp8_hex_search
     int_mv *best_mv,
     int search_param,
     int sad_per_bit,
-    int *num00,
     const vp8_variance_fn_ptr_t *vfp,
     int *mvsadcost[2],
     int *mvcost[2],
@@ -996,12 +995,8 @@ cal_neighbors:
 
     best_mv->as_mv.row = br;
     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 vfp->vf(what, what_stride, this_offset, in_what_stride, &bestsad)
-        + mv_err_cost(&this_mv, center_mv, mvcost, x->errorperbit) ;
+    return bestsad;
 }
 #undef CHECK_BOUNDS
 #undef CHECK_POINT
index bf9fa6f..44ed055 100644 (file)
@@ -40,7 +40,6 @@ extern int vp8_hex_search
     int_mv *best_mv,
     int search_param,
     int error_per_bit,
-    int *num00,
     const vp8_variance_fn_ptr_t *vf,
     int *mvsadcost[2],
     int *mvcost[2],
index e6716fa..456059c 100644 (file)
@@ -762,7 +762,7 @@ 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, &num00, &cpi->fn_ptr[BLOCK_16X16],
+                                      sadpb, &cpi->fn_ptr[BLOCK_16X16],
                                       x->mvsadcost, x->mvcost, &best_ref_mv);
                 mode_mv[NEWMV].as_int = d->bmi.mv.as_int;
             }
index 2997f77..c1ca7d4 100644 (file)
@@ -153,7 +153,6 @@ static int vp8_temporal_filter_find_matching_mb_c
     int further_steps;
     int sadpb = x->sadperbit16;
     int bestsme = INT_MAX;
-    int num00 = 0;
 
     BLOCK *b = &x->block[0];
     BLOCKD *d = &x->e_mbd.block[0];
@@ -201,7 +200,7 @@ static int vp8_temporal_filter_find_matching_mb_c
         &best_ref_mv1, &d->bmi.mv,
         step_param,
         sadpb,
-        &num00, &cpi->fn_ptr[BLOCK_16X16],
+        &cpi->fn_ptr[BLOCK_16X16],
         mvsadcost, mvcost, &best_ref_mv1);
 
 #if ALT_REF_SUBPEL_ENABLED