]> granicus.if.org Git - libvpx/commitdiff
Adding allow_hp as an argument to mv search functions.
authorDmitry Kovalev <dkovalev@google.com>
Thu, 17 Oct 2013 21:02:04 +0000 (14:02 -0700)
committerDmitry Kovalev <dkovalev@google.com>
Thu, 17 Oct 2013 21:02:04 +0000 (14:02 -0700)
Making this change in order to move allow_high_precision_mv field
from MACROBLOCKD structure to VP9_COMMON (because it is a frame level
flag).

Change-Id: I1d006ba36d938e0caf4d40fa051e2e38df9c1108

vp9/encoder/vp9_mbgraph.c
vp9/encoder/vp9_mcomp.c
vp9/encoder/vp9_mcomp.h
vp9/encoder/vp9_rdopt.c
vp9/encoder/vp9_temporal_filter.c

index 2f147a04ea48c4e25f5382cae6381ce345df9b7e..ea4c9e8b261b057f29149cd7c91aed82b9335c66 100644 (file)
@@ -61,6 +61,7 @@ static unsigned int do_16x16_motion_iteration(VP9_COMP *cpi,
     best_err = cpi->find_fractional_mv_step(
         x,
         &dst_mv->as_mv, &ref_mv->as_mv,
+        xd->allow_high_precision_mv,
         x->errorperbit, &v_fn_ptr,
         0, cpi->sf.subpel_iters_per_step, NULL, NULL,
         & distortion, &sse);
index 561c725b2551b8142e823d162926bc287bc7a4e2..a52f5b1b0af5fc1a9c41c00187fa1dbf2d39f37f 100644 (file)
@@ -275,6 +275,7 @@ void vp9_init3smotion_compensation(MACROBLOCK *x, int stride) {
 
 int vp9_find_best_sub_pixel_iterative(MACROBLOCK *x,
                                       MV *bestmv, const MV *ref_mv,
+                                      int allow_hp,
                                       int error_per_bit,
                                       const vp9_variance_fn_ptr_t *vfp,
                                       int forced_stop,
@@ -348,8 +349,7 @@ int vp9_find_best_sub_pixel_iterative(MACROBLOCK *x,
     }
   }
 
-  if (xd->allow_high_precision_mv && vp9_use_mv_hp(ref_mv) &&
-      forced_stop == 0) {
+  if (allow_hp && vp9_use_mv_hp(ref_mv) && forced_stop == 0) {
     hstep >>= 1;
     while (eighthiters--) {
       FIRST_LEVEL_CHECKS;
@@ -373,6 +373,7 @@ int vp9_find_best_sub_pixel_iterative(MACROBLOCK *x,
 
 int vp9_find_best_sub_pixel_tree(MACROBLOCK *x,
                                  MV *bestmv, const MV *ref_mv,
+                                 int allow_hp,
                                  int error_per_bit,
                                  const vp9_variance_fn_ptr_t *vfp,
                                  int forced_stop,
@@ -436,8 +437,7 @@ int vp9_find_best_sub_pixel_tree(MACROBLOCK *x,
     tc = bc;
   }
 
-  if (xd->allow_high_precision_mv && vp9_use_mv_hp(ref_mv) &&
-      forced_stop == 0) {
+  if (allow_hp && vp9_use_mv_hp(ref_mv) && forced_stop == 0) {
     hstep >>= 1;
     FIRST_LEVEL_CHECKS;
     if (eighthiters > 1) {
@@ -465,6 +465,7 @@ int vp9_find_best_sub_pixel_tree(MACROBLOCK *x,
 
 int vp9_find_best_sub_pixel_comp_iterative(MACROBLOCK *x,
                                            MV *bestmv, const MV *ref_mv,
+                                           int allow_hp,
                                            int error_per_bit,
                                            const vp9_variance_fn_ptr_t *vfp,
                                            int forced_stop,
@@ -544,8 +545,7 @@ int vp9_find_best_sub_pixel_comp_iterative(MACROBLOCK *x,
     }
   }
 
-  if (xd->allow_high_precision_mv && vp9_use_mv_hp(ref_mv) &&
-      forced_stop == 0) {
+  if (allow_hp && vp9_use_mv_hp(ref_mv) && forced_stop == 0) {
     hstep >>= 1;
     while (eighthiters--) {
       FIRST_LEVEL_CHECKS;
@@ -568,6 +568,7 @@ int vp9_find_best_sub_pixel_comp_iterative(MACROBLOCK *x,
 
 int vp9_find_best_sub_pixel_comp_tree(MACROBLOCK *x,
                                       MV *bestmv, const MV *ref_mv,
+                                      int allow_hp,
                                       int error_per_bit,
                                       const vp9_variance_fn_ptr_t *vfp,
                                       int forced_stop,
@@ -642,8 +643,7 @@ int vp9_find_best_sub_pixel_comp_tree(MACROBLOCK *x,
     tc = bc;
   }
 
-  if (xd->allow_high_precision_mv && vp9_use_mv_hp(ref_mv) &&
-      forced_stop == 0) {
+  if (allow_hp && vp9_use_mv_hp(ref_mv) && forced_stop == 0) {
     hstep >>= 1;
     FIRST_LEVEL_CHECKS;
     if (eighthiters > 1) {
index 77c157c5bdf803b85dd3ba7f031974e516da4c59..bcab679c7e61ebeb31cb7789646728ac3995241b 100644 (file)
@@ -74,6 +74,7 @@ int vp9_square_search(MACROBLOCK *x,
 typedef int (fractional_mv_step_fp) (
     MACROBLOCK *x,
     MV *bestmv, const MV *ref_mv,
+    int allow_hp,
     int error_per_bit,
     const vp9_variance_fn_ptr_t *vfp,
     int forced_stop,  // 0 - full, 1 - qtr only, 2 - half only
@@ -88,6 +89,7 @@ extern fractional_mv_step_fp vp9_find_best_sub_pixel_tree;
 typedef int (fractional_mv_step_comp_fp) (
     MACROBLOCK *x,
     MV *bestmv, const MV *ref_mv,
+    int allow_hp,
     int error_per_bit,
     const vp9_variance_fn_ptr_t *vfp,
     int forced_stop,  // 0 - full, 1 - qtr only, 2 - half only
index f1929680317b6a06ca29ebadc381d9286923be2d..7add4940e092c47fecf19859bec67f933e0f2390 100644 (file)
@@ -1870,6 +1870,7 @@ static void rd_check_segment_txsize(VP9_COMP *cpi, MACROBLOCK *x,
             cpi->find_fractional_mv_step(x,
                                          &mode_mv[NEWMV].as_mv,
                                          &bsi->ref_mv->as_mv,
+                                         x->e_mbd.allow_high_precision_mv,
                                          x->errorperbit, v_fn_ptr,
                                          0, cpi->sf.subpel_iters_per_step,
                                          x->nmvjointcost, x->mvcost,
@@ -2450,6 +2451,7 @@ static void single_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
     int dis;  /* TODO: use dis in distortion calculation later. */
     unsigned int sse;
     cpi->find_fractional_mv_step(x, &tmp_mv->as_mv, &ref_mv.as_mv,
+                                 xd->allow_high_precision_mv,
                                  x->errorperbit,
                                  &cpi->fn_ptr[block_size],
                                  0, cpi->sf.subpel_iters_per_step,
@@ -2585,6 +2587,7 @@ static void joint_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
       bestsme = cpi->find_fractional_mv_step_comp(
           x, &tmp_mv.as_mv,
           &ref_mv[id].as_mv,
+          xd->allow_high_precision_mv,
           x->errorperbit,
           &cpi->fn_ptr[block_size],
           0, cpi->sf.subpel_iters_per_step,
index 6ff0de4bf2262f1969025e9d84d3bf794e461c5d..5cf8143fc6b7b498d9e74ea51dca08c6226826ca 100644 (file)
@@ -166,6 +166,7 @@ static int temporal_filter_find_matching_mb_c(VP9_COMP *cpi,
     // Ignore mv costing by sending NULL pointer instead of cost array
     bestsme = cpi->find_fractional_mv_step(x, &ref_mv->as_mv,
                                            &best_ref_mv1.as_mv,
+                                           xd->allow_high_precision_mv,
                                            x->errorperbit,
                                            &cpi->fn_ptr[BLOCK_16X16],
                                            0, cpi->sf.subpel_iters_per_step,