]> granicus.if.org Git - libvpx/commitdiff
Remove av1_use_hp_mv()
authorAlex Converse <aconverse@google.com>
Thu, 29 Sep 2016 21:21:37 +0000 (14:21 -0700)
committerYaowu Xu <yaowu@google.com>
Thu, 27 Oct 2016 21:33:48 +0000 (14:33 -0700)
It always returns true since the related misc_fix[1] was merged.

[1] 23e83574b6a5105bdc686c49f2d5909f33ea721f

Change-Id: Ie3af685572a2f0a42d2b9fb9903c1abeea225dfd

av1/common/entropymv.c
av1/common/entropymv.h
av1/common/mvref_common.h
av1/decoder/decodemv.c
av1/encoder/encodemv.c
av1/encoder/mcomp.c
av1/encoder/rdopt.c

index 0074d980df544b0ef6b792bf13291f265ff3f04c..1ed4dbbb3c63273fdcaf1407c26f08e4d5a42330 100644 (file)
@@ -149,13 +149,6 @@ MV_CLASS_TYPE av1_get_mv_class(int z, int *offset) {
   return c;
 }
 
-// TODO(jingning): This idle function is intentionally left as is for
-// experimental purpose.
-int av1_use_mv_hp(const MV *ref) {
-  (void)ref;
-  return 1;
-}
-
 static void inc_mv_component(int v, nmv_component_counts *comp_counts, int incr,
                              int usehp) {
   int s, z, c, o, d, e, f;
index b26000fa5646ebc46828c1a971de5de573a99fb0..c215d23146b029f51b624f37cc44a9207f882d6b 100644 (file)
@@ -27,7 +27,6 @@ struct AV1Common;
 void av1_init_mv_probs(struct AV1Common *cm);
 
 void av1_adapt_mv_probs(struct AV1Common *cm, int usehp);
-int av1_use_mv_hp(const MV *ref);
 
 #define MV_UPDATE_PROB 252
 
index 25ebbfd76d115c53518107752cf9ec0eddc44f37..55688a958d0829db04480565ef96599d6582d5da 100644 (file)
@@ -341,8 +341,7 @@ static INLINE int is_inside(const TileInfo *const tile, int mi_col, int mi_row,
 }
 
 static INLINE void lower_mv_precision(MV *mv, int allow_hp) {
-  const int use_hp = allow_hp && av1_use_mv_hp(mv);
-  if (!use_hp) {
+  if (!allow_hp) {
     if (mv->row & 1) mv->row += (mv->row > 0 ? -1 : 1);
     if (mv->col & 1) mv->col += (mv->col > 0 ? -1 : 1);
   }
index c5591f82e0904ef81a2db1bba882af9ead4c7367..644c7796136ed73e1f5bf3759557c60bd737241d 100644 (file)
@@ -839,7 +839,6 @@ static INLINE void read_mv(aom_reader *r, MV *mv, const MV *ref,
                            const nmv_context *ctx, nmv_context_counts *counts,
                            int allow_hp) {
   MV_JOINT_TYPE joint_type;
-  const int use_hp = allow_hp && av1_use_mv_hp(ref);
   MV diff = { 0, 0 };
   joint_type =
 #if CONFIG_DAALA_EC || CONFIG_RANS
@@ -849,12 +848,12 @@ static INLINE void read_mv(aom_reader *r, MV *mv, const MV *ref,
 #endif
 
   if (mv_joint_vertical(joint_type))
-    diff.row = read_mv_component(r, &ctx->comps[0], use_hp);
+    diff.row = read_mv_component(r, &ctx->comps[0], allow_hp);
 
   if (mv_joint_horizontal(joint_type))
-    diff.col = read_mv_component(r, &ctx->comps[1], use_hp);
+    diff.col = read_mv_component(r, &ctx->comps[1], allow_hp);
 
-  av1_inc_mv(&diff, counts, use_hp);
+  av1_inc_mv(&diff, counts, allow_hp);
 
   mv->row = ref->row + diff.row;
   mv->col = ref->col + diff.col;
index f970c8fa4081b61abb8a28513db5bab113c0acf0..9b6e0d94323a03c9ca4ab110a8fcc0be47e15595 100644 (file)
@@ -261,7 +261,6 @@ void av1_encode_mv(AV1_COMP *cpi, aom_writer *w, const MV *mv, const MV *ref,
                    const nmv_context *mvctx, int usehp) {
   const MV diff = { mv->row - ref->row, mv->col - ref->col };
   const MV_JOINT_TYPE j = av1_get_mv_joint(&diff);
-  usehp = usehp && av1_use_mv_hp(ref);
 #if CONFIG_REF_MV
   (void)is_compound;
 #endif
@@ -318,7 +317,7 @@ static void inc_mvs(const MB_MODE_INFO *mbmi, const MB_MODE_INFO_EXT *mbmi_ext,
       nmv_context_counts *counts = &nmv_counts[nmv_ctx];
       (void)pred_mvs;
 #endif
-      av1_inc_mv(&diff, counts, av1_use_mv_hp(ref));
+      av1_inc_mv(&diff, counts, 1);
     }
   } else if (mode == NEAREST_NEWMV || mode == NEAR_NEWMV) {
     const MV *ref = &mbmi_ext->ref_mvs[mbmi->ref_frame[1]][0].as_mv;
@@ -331,7 +330,7 @@ static void inc_mvs(const MB_MODE_INFO *mbmi, const MB_MODE_INFO_EXT *mbmi_ext,
                     mbmi_ext->ref_mv_stack[rf_type], 1, mbmi->ref_mv_idx);
     nmv_context_counts *counts = &nmv_counts[nmv_ctx];
 #endif
-    av1_inc_mv(&diff, counts, av1_use_mv_hp(ref));
+    av1_inc_mv(&diff, counts, 1);
   } else if (mode == NEW_NEARESTMV || mode == NEW_NEARMV) {
     const MV *ref = &mbmi_ext->ref_mvs[mbmi->ref_frame[0]][0].as_mv;
     const MV diff = { mvs[0].as_mv.row - ref->row,
@@ -343,7 +342,7 @@ static void inc_mvs(const MB_MODE_INFO *mbmi, const MB_MODE_INFO_EXT *mbmi_ext,
                     mbmi_ext->ref_mv_stack[rf_type], 0, mbmi->ref_mv_idx);
     nmv_context_counts *counts = &nmv_counts[nmv_ctx];
 #endif
-    av1_inc_mv(&diff, counts, av1_use_mv_hp(ref));
+    av1_inc_mv(&diff, counts, 1);
   }
 }
 
@@ -372,7 +371,7 @@ static void inc_mvs_sub8x8(const MODE_INFO *mi, int block, const int_mv mvs[2],
                       mbmi_ext->ref_mv_stack[rf_type], i, mbmi->ref_mv_idx);
       nmv_context_counts *counts = &nmv_counts[nmv_ctx];
 #endif
-      av1_inc_mv(&diff, counts, av1_use_mv_hp(ref));
+      av1_inc_mv(&diff, counts, 1);
     }
   } else if (mode == NEAREST_NEWMV || mode == NEAR_NEWMV) {
     const MV *ref = &mi->bmi[block].ref_mv[1].as_mv;
@@ -385,7 +384,7 @@ static void inc_mvs_sub8x8(const MODE_INFO *mi, int block, const int_mv mvs[2],
                     mbmi_ext->ref_mv_stack[rf_type], 1, mbmi->ref_mv_idx);
     nmv_context_counts *counts = &nmv_counts[nmv_ctx];
 #endif
-    av1_inc_mv(&diff, counts, av1_use_mv_hp(ref));
+    av1_inc_mv(&diff, counts, 1);
   } else if (mode == NEW_NEARESTMV || mode == NEW_NEARMV) {
     const MV *ref = &mi->bmi[block].ref_mv[0].as_mv;
     const MV diff = { mvs[0].as_mv.row - ref->row,
@@ -397,7 +396,7 @@ static void inc_mvs_sub8x8(const MODE_INFO *mi, int block, const int_mv mvs[2],
                     mbmi_ext->ref_mv_stack[rf_type], 0, mbmi->ref_mv_idx);
     nmv_context_counts *counts = &nmv_counts[nmv_ctx];
 #endif
-    av1_inc_mv(&diff, counts, av1_use_mv_hp(ref));
+    av1_inc_mv(&diff, counts, 1);
   }
 }
 #else
@@ -425,7 +424,7 @@ static void inc_mvs(const MB_MODE_INFO *mbmi, const MB_MODE_INFO_EXT *mbmi_ext,
 #endif
     const MV diff = { mvs[i].as_mv.row - ref->row,
                       mvs[i].as_mv.col - ref->col };
-    av1_inc_mv(&diff, counts, av1_use_mv_hp(ref));
+    av1_inc_mv(&diff, counts, 1);
   }
 }
 #endif  // CONFIG_EXT_INTER
index 3fbceabe08088e68dfc99d3574b724851d18401d..4b54a2c1c2306e9a5b4a1f49ed548cbc8ef0d95c 100644 (file)
@@ -424,7 +424,7 @@ int av1_find_best_sub_pixel_tree_pruned_evenmore(
   tr = br;
   tc = bc;
 
-  if (allow_hp && av1_use_mv_hp(ref_mv) && forced_stop == 0) {
+  if (allow_hp && forced_stop == 0) {
     hstep >>= 1;
     FIRST_LEVEL_CHECKS;
     if (eighthiters > 1) {
@@ -484,7 +484,7 @@ int av1_find_best_sub_pixel_tree_pruned_more(
     }
   }
 
-  if (allow_hp && av1_use_mv_hp(ref_mv) && forced_stop == 0) {
+  if (allow_hp && forced_stop == 0) {
     tr = br;
     tc = bc;
     hstep >>= 1;
@@ -572,7 +572,7 @@ int av1_find_best_sub_pixel_tree_pruned(
     tc = bc;
   }
 
-  if (allow_hp && av1_use_mv_hp(ref_mv) && forced_stop == 0) {
+  if (allow_hp && forced_stop == 0) {
     hstep >>= 1;
     FIRST_LEVEL_CHECKS;
     if (eighthiters > 1) {
@@ -687,7 +687,7 @@ int av1_find_best_sub_pixel_tree(MACROBLOCK *x, const MV *ref_mv, int allow_hp,
   unsigned int cost_array[5];
   int kr, kc;
 
-  if (!(allow_hp && av1_use_mv_hp(ref_mv)))
+  if (!allow_hp)
     if (round == 3) round = 2;
 
   bestmv->row *= 8;
@@ -2446,7 +2446,7 @@ int av1_find_best_masked_sub_pixel_tree(
     tc = bc;
   }
 
-  if (allow_hp && av1_use_mv_hp(ref_mv) && forced_stop == 0) {
+  if (allow_hp && forced_stop == 0) {
     hstep >>= 1;
     FIRST_LEVEL_CHECKS;
     if (eighthiters > 1) {
@@ -2581,7 +2581,7 @@ int av1_find_best_masked_sub_pixel_tree_up(
   y_stride = pd->pre[is_second].stride;
   offset = bestmv->row * y_stride + bestmv->col;
 
-  if (!(allow_hp && av1_use_mv_hp(ref_mv)))
+  if (!allow_hp)
     if (round == 3) round = 2;
 
   bestmv->row *= 8;
@@ -3083,7 +3083,7 @@ int av1_find_best_obmc_sub_pixel_tree_up(
   y_stride = pd->pre[is_second].stride;
   offset = bestmv->row * y_stride + bestmv->col;
 
-  if (!(allow_hp && av1_use_mv_hp(ref_mv)))
+  if (!allow_hp)
     if (round == 3) round = 2;
 
   bestmv->row *= 8;
index 008da3cdc9172b4236e119b23e4f0b8d7d768d87..f49446b6ce7110a8b52c9a265c7c9069b82c213c 100644 (file)
@@ -4220,8 +4220,7 @@ static int set_and_cost_bmi_mvs(const AV1_COMP *const cpi, MACROBLOCK *x,
 #endif  // CONFIG_EXT_INTER
       this_mv[0].as_int = seg_mvs[mbmi->ref_frame[0]].as_int;
 #if CONFIG_EXT_INTER
-      if (!cpi->common.allow_high_precision_mv ||
-          !av1_use_mv_hp(&best_ref_mv[0]->as_mv))
+      if (!cpi->common.allow_high_precision_mv)
         lower_mv_precision(&this_mv[0].as_mv, 0);
 #endif  // CONFIG_EXT_INTER
 
@@ -4280,11 +4279,9 @@ static int set_and_cost_bmi_mvs(const AV1_COMP *const cpi, MACROBLOCK *x,
         this_mv[0].as_int = compound_seg_newmvs[0].as_int;
         this_mv[1].as_int = compound_seg_newmvs[1].as_int;
       }
-      if (!cpi->common.allow_high_precision_mv ||
-          !av1_use_mv_hp(&best_ref_mv[0]->as_mv))
+      if (!cpi->common.allow_high_precision_mv)
         lower_mv_precision(&this_mv[0].as_mv, 0);
-      if (!cpi->common.allow_high_precision_mv ||
-          !av1_use_mv_hp(&best_ref_mv[1]->as_mv))
+      if (!cpi->common.allow_high_precision_mv)
         lower_mv_precision(&this_mv[1].as_mv, 0);
       thismvcost += av1_mv_bit_cost(&this_mv[0].as_mv, &best_ref_mv[0]->as_mv,
                                     mvjcost, mvcost, MV_COST_WEIGHT_SUB);
@@ -4294,8 +4291,7 @@ static int set_and_cost_bmi_mvs(const AV1_COMP *const cpi, MACROBLOCK *x,
     case NEW_NEARMV:
     case NEW_NEARESTMV:
       this_mv[0].as_int = seg_mvs[mbmi->ref_frame[0]].as_int;
-      if (!cpi->common.allow_high_precision_mv ||
-          !av1_use_mv_hp(&best_ref_mv[0]->as_mv))
+      if (!cpi->common.allow_high_precision_mv)
         lower_mv_precision(&this_mv[0].as_mv, 0);
       thismvcost += av1_mv_bit_cost(&this_mv[0].as_mv, &best_ref_mv[0]->as_mv,
                                     mvjcost, mvcost, MV_COST_WEIGHT_SUB);
@@ -4305,8 +4301,7 @@ static int set_and_cost_bmi_mvs(const AV1_COMP *const cpi, MACROBLOCK *x,
     case NEAREST_NEWMV:
       this_mv[0].as_int = frame_mv[mode][mbmi->ref_frame[0]].as_int;
       this_mv[1].as_int = seg_mvs[mbmi->ref_frame[1]].as_int;
-      if (!cpi->common.allow_high_precision_mv ||
-          !av1_use_mv_hp(&best_ref_mv[1]->as_mv))
+      if (!cpi->common.allow_high_precision_mv)
         lower_mv_precision(&this_mv[1].as_mv, 0);
       thismvcost += av1_mv_bit_cost(&this_mv[1].as_mv, &best_ref_mv[1]->as_mv,
                                     mvjcost, mvcost, MV_COST_WEIGHT_SUB);
@@ -5147,8 +5142,7 @@ static int64_t rd_pick_best_sub8x8_mode(
         if (!has_second_rf &&
 #if CONFIG_EXT_INTER
             have_newmv_in_inter_mode(this_mode) &&
-            (seg_mvs[index][mv_idx][mbmi->ref_frame[0]].as_int == INVALID_MV ||
-             av1_use_mv_hp(&bsi->ref_mv[0]->as_mv) == 0)
+            (seg_mvs[index][mv_idx][mbmi->ref_frame[0]].as_int == INVALID_MV)
 #else
             this_mode == NEWMV &&
             (seg_mvs[index][mbmi->ref_frame[0]].as_int == INVALID_MV ||