From 0cedaa363187e7fbd42f513e6d1547dc385f38ed Mon Sep 17 00:00:00 2001
From: Yaowu Xu <yaowu@google.com>
Date: Wed, 7 Nov 2012 10:41:04 -0800
Subject: [PATCH] merge full pixel refmv experiment

Change-Id: Ib39ad47a7d188f3b45416937b7eeb28c3e79b74c
---
 configure                   |  1 -
 vp9/common/blockd.h         |  4 ----
 vp9/common/findnearmv.c     |  3 ---
 vp9/common/findnearmv.h     |  2 --
 vp9/common/mvref_common.c   |  4 ----
 vp9/common/mvref_common.h   |  3 ---
 vp9/common/rtcd_defs.sh     |  2 --
 vp9/common/x86/sadmxn_x86.c |  4 ----
 vp9/decoder/decodemv.c      | 14 +-------------
 vp9/encoder/bitstream.c     |  8 +-------
 vp9/encoder/block.h         |  2 --
 vp9/encoder/encodeframe.c   | 12 +++---------
 vp9/encoder/onyx_if.c       |  4 +---
 vp9/encoder/rdopt.c         |  5 -----
 14 files changed, 6 insertions(+), 62 deletions(-)

diff --git a/configure b/configure
index 6a3044cf04..a9649c6964 100755
--- a/configure
+++ b/configure
@@ -221,7 +221,6 @@ EXPERIMENT_LIST="
     superblocks
     pred_filter
     lossless
-    newbestrefmv
     subpelrefmv
     new_mvref
     implicit_segmentation
diff --git a/vp9/common/blockd.h b/vp9/common/blockd.h
index 1014c803d6..9d5eedc58f 100644
--- a/vp9/common/blockd.h
+++ b/vp9/common/blockd.h
@@ -44,9 +44,7 @@ void vpx_log(const char *format, ...);
 /* Segment Feature Masks */
 #define SEGMENT_DELTADATA   0
 #define SEGMENT_ABSDATA     1
-#if CONFIG_NEWBESTREFMV || CONFIG_NEW_MVREF
 #define MAX_MV_REFS 19
-#endif
 
 typedef struct {
   int r, c;
@@ -216,9 +214,7 @@ typedef struct {
   MV_REFERENCE_FRAME ref_frame, second_ref_frame;
   TX_SIZE txfm_size;
   int_mv mv[2]; // for each reference frame used
-#if CONFIG_NEWBESTREFMV || CONFIG_NEW_MVREF
   int_mv ref_mvs[MAX_REF_FRAMES][MAX_MV_REFS];
-#endif
 
   SPLITMV_PARTITIONING_TYPE partitioning;
   unsigned char mb_skip_coeff;                                /* does this mb has coefficients at all, 1=no coefficients, 0=need decode tokens */
diff --git a/vp9/common/findnearmv.c b/vp9/common/findnearmv.c
index 52cf07b2f2..cc560cf3ac 100644
--- a/vp9/common/findnearmv.c
+++ b/vp9/common/findnearmv.c
@@ -168,7 +168,6 @@ vp9_prob *vp9_mv_ref_probs(VP9_COMMON *pc,
   return p;
 }
 
-#if CONFIG_NEWBESTREFMV
 #define SP(x) (((x) & 7) << 1)
 unsigned int vp9_sad3x16_c(
   const unsigned char *src_ptr,
@@ -394,5 +393,3 @@ void vp9_find_best_ref_mvs(MACROBLOCKD *xd,
   // Copy back the re-ordered mv list
   vpx_memcpy(mvlist, sorted_mvs, sizeof(sorted_mvs));
 }
-
-#endif  // CONFIG_NEWBESTREFMV
diff --git a/vp9/common/findnearmv.h b/vp9/common/findnearmv.h
index 3cba90d14c..c53575ea9a 100644
--- a/vp9/common/findnearmv.h
+++ b/vp9/common/findnearmv.h
@@ -18,7 +18,6 @@
 #include "treecoder.h"
 #include "onyxc_int.h"
 
-#if CONFIG_NEWBESTREFMV
 /* check a list of motion vectors by sad score using a number rows of pixels
  * above and a number cols of pixels in the left to select the one with best
  * score to use as ref motion vector
@@ -30,7 +29,6 @@ void vp9_find_best_ref_mvs(MACROBLOCKD *xd,
                            int_mv *best_mv,
                            int_mv *nearest,
                            int_mv *near);
-#endif
 
 static void mv_bias(int refmb_ref_frame_sign_bias, int refframe, int_mv *mvp, const int *ref_frame_sign_bias) {
   MV xmv;
diff --git a/vp9/common/mvref_common.c b/vp9/common/mvref_common.c
index 7fd48b9384..d6faa138d1 100644
--- a/vp9/common/mvref_common.c
+++ b/vp9/common/mvref_common.c
@@ -10,8 +10,6 @@
 
 #include "mvref_common.h"
 
-#if CONFIG_NEWBESTREFMV
-
 #define MVREF_NEIGHBOURS 8
 static int mv_ref_search[MVREF_NEIGHBOURS][2] =
   { {0,-1},{-1,0},{-1,-1},{0,-2},{-2,0},{-1,-2},{-2,-1},{-2,-2} };
@@ -338,5 +336,3 @@ void vp9_find_mv_refs(
   // Copy over the candidate list.
   vpx_memcpy(mv_ref_list, candidate_mvs, sizeof(candidate_mvs));
 }
-
-#endif
diff --git a/vp9/common/mvref_common.h b/vp9/common/mvref_common.h
index 7f396e4d7b..06050406b5 100644
--- a/vp9/common/mvref_common.h
+++ b/vp9/common/mvref_common.h
@@ -11,8 +11,6 @@
 #include "onyxc_int.h"
 #include "blockd.h"
 
-// MR reference entropy header file.
-#if CONFIG_NEWBESTREFMV
 
 #ifndef __INC_MVREF_COMMON_H
 #define __INC_MVREF_COMMON_H
@@ -28,4 +26,3 @@ void vp9_find_mv_refs(
 
 #endif
 
-#endif
diff --git a/vp9/common/rtcd_defs.sh b/vp9/common/rtcd_defs.sh
index ca3844cf66..8964fa2612 100644
--- a/vp9/common/rtcd_defs.sh
+++ b/vp9/common/rtcd_defs.sh
@@ -227,13 +227,11 @@ vp9_loop_filter_simple_bh_neon=vp9_loop_filter_bhs_neon
 #
 # sad 16x3, 3x16
 #
-if [ "$CONFIG_NEWBESTREFMV" = "yes" ]; then
 prototype unsigned int vp9_sad16x3 "const unsigned char *src_ptr, int  src_stride, const unsigned char *ref_ptr, int ref_stride, int max_sad"
 specialize vp9_sad16x3 sse2
 
 prototype unsigned int vp9_sad3x16 "const unsigned char *src_ptr, int  src_stride, const unsigned char *ref_ptr, int ref_stride, int max_sad"
 specialize vp9_sad3x16 sse2
-fi
 
 #
 # Encoder functions below this point.
diff --git a/vp9/common/x86/sadmxn_x86.c b/vp9/common/x86/sadmxn_x86.c
index 71fa320dba..b12680d6c9 100644
--- a/vp9/common/x86/sadmxn_x86.c
+++ b/vp9/common/x86/sadmxn_x86.c
@@ -13,9 +13,6 @@
 #include "./vpx_rtcd.h"
 
 
-#if CONFIG_NEWBESTREFMV
-
-
 #if HAVE_SSE2
 unsigned int vp9_sad16x3_sse2(
   const unsigned char *src_ptr,
@@ -89,4 +86,3 @@ unsigned int vp9_sad3x16_sse2(
 #endif
 
 
-#endif  // CONFIG_NEWBESTREFMV
diff --git a/vp9/decoder/decodemv.c b/vp9/decoder/decodemv.c
index a299b5dffb..5013462a3d 100644
--- a/vp9/decoder/decodemv.c
+++ b/vp9/decoder/decodemv.c
@@ -712,17 +712,13 @@ static void read_mb_modes_mv(VP9D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
     int_mv nearest_second, nearby_second, best_mv_second;
     vp9_prob mv_ref_p [VP9_MVREFS - 1];
 
-#if CONFIG_NEWBESTREFMV
     int recon_y_stride, recon_yoffset;
     int recon_uv_stride, recon_uvoffset;
-#endif
 
     vp9_find_near_mvs(xd, mi,
                       prev_mi,
                       &nearest, &nearby, &best_mv, rct,
                       mbmi->ref_frame, cm->ref_frame_sign_bias);
-
-#if CONFIG_NEWBESTREFMV
     {
       int ref_fb_idx;
       MV_REFERENCE_FRAME ref_frame = mbmi->ref_frame;
@@ -755,7 +751,6 @@ static void read_mb_modes_mv(VP9D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
                             mbmi->ref_mvs[ref_frame],
                             &best_mv, &nearest, &nearby);
     }
-#endif
 
     vp9_mv_ref_probs(&pbi->common, mv_ref_p, rct);
 
@@ -808,7 +803,6 @@ static void read_mb_modes_mv(VP9D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
       mbmi->second_ref_frame = mbmi->ref_frame + 1;
       if (mbmi->second_ref_frame == 4)
         mbmi->second_ref_frame = 1;
-#if CONFIG_NEWBESTREFMV
       if (mbmi->second_ref_frame) {
         int second_ref_fb_idx;
         /* Select the appropriate reference frame for this MB */
@@ -845,13 +839,7 @@ static void read_mb_modes_mv(VP9D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
                               &nearest_second,
                               &nearby_second);
       }
-#else
-      vp9_find_near_mvs(xd, mi, prev_mi,
-                        &nearest_second, &nearby_second, &best_mv_second,
-                        rct,
-                        mbmi->second_ref_frame,
-                        pbi->common.ref_frame_sign_bias);
-#endif
+
     } else {
       mbmi->second_ref_frame = 0;
     }
diff --git a/vp9/encoder/bitstream.c b/vp9/encoder/bitstream.c
index b3ed6cd26b..b7bc99cb30 100644
--- a/vp9/encoder/bitstream.c
+++ b/vp9/encoder/bitstream.c
@@ -29,10 +29,7 @@
 #include "vp9/common/entropy.h"
 #include "vp9/encoder/encodemv.h"
 #include "vp9/common/entropymv.h"
-
-#if CONFIG_NEWBESTREFMV
 #include "vp9/common/mvref_common.h"
-#endif
 
 #if defined(SECTIONBITS_OUTPUT)
 unsigned __int64 Sectionbits[500];
@@ -1059,9 +1056,8 @@ static void pack_inter_mode_mvs(VP9_COMP *const cpi, vp9_writer *const bc) {
             // Only used for context just now and soon to be deprecated.
             vp9_find_near_mvs(xd, m, prev_m, &n1, &n2, &best_mv, ct,
                               rf, cpi->common.ref_frame_sign_bias);
-#if CONFIG_NEWBESTREFMV
+
             best_mv.as_int = mi->ref_mvs[rf][0].as_int;
-#endif
 
             vp9_mv_ref_probs(&cpi->common, mv_ref_p, ct);
 
@@ -1121,10 +1117,8 @@ static void pack_inter_mode_mvs(VP9_COMP *const cpi, vp9_writer *const bc) {
                               mi->second_ref_frame,
                               cpi->common.ref_frame_sign_bias);
 
-#if CONFIG_NEWBESTREFMV
             best_second_mv.as_int =
               mi->ref_mvs[mi->second_ref_frame][0].as_int;
-#endif
           }
 
           // does the feature use compound prediction or not
diff --git a/vp9/encoder/block.h b/vp9/encoder/block.h
index 43c249ca74..3b3794c007 100644
--- a/vp9/encoder/block.h
+++ b/vp9/encoder/block.h
@@ -70,9 +70,7 @@ typedef struct {
   PARTITION_INFO partition_info;
   int_mv best_ref_mv;
   int_mv second_best_ref_mv;
-#if CONFIG_NEWBESTREFMV || CONFIG_NEW_MVREF
   int_mv ref_mvs[MAX_REF_FRAMES][MAX_MV_REFS];
-#endif
   int rate;
   int distortion;
   int64_t intra_error;
diff --git a/vp9/encoder/encodeframe.c b/vp9/encoder/encodeframe.c
index 94fa2f2658..703b49e35a 100644
--- a/vp9/encoder/encodeframe.c
+++ b/vp9/encoder/encodeframe.c
@@ -36,12 +36,9 @@
 #include "vp9/common/subpixel.h"
 #include "vpx_ports/vpx_timer.h"
 #include "vp9/common/pred_common.h"
-
-#define DBG_PRNT_SEGMAP 0
-#if CONFIG_NEWBESTREFMV
 #include "vp9/common/mvref_common.h"
-#endif
 
+#define DBG_PRNT_SEGMAP 0
 
 #if CONFIG_RUNTIME_CPU_DETECT
 #define RTCD(x)     &cpi->common.rtcd.x
@@ -1959,13 +1956,10 @@ static void encode_intra_macro_block(VP9_COMP *cpi, MACROBLOCK *x,
     } else {
       mbmi->txfm_size = TX_4X4;
     }
-  }
-#if CONFIG_NEWBESTREFMV
-  else
+  } else {
     vp9_tokenize_mb(cpi, &x->e_mbd, t, 1);
-#endif
+  }
 }
-
 static void encode_inter_macroblock(VP9_COMP *cpi, MACROBLOCK *x,
                                     TOKENEXTRA **t, int recon_yoffset,
                                     int recon_uvoffset, int output_enabled) {
diff --git a/vp9/encoder/onyx_if.c b/vp9/encoder/onyx_if.c
index 58b2076b15..bd8e6d4d9d 100644
--- a/vp9/encoder/onyx_if.c
+++ b/vp9/encoder/onyx_if.c
@@ -38,10 +38,8 @@
 #include "bitstream.h"
 #include "vp9/encoder/picklpf.h"
 #include "ratectrl.h"
-
-#if CONFIG_NEWBESTREFMV
 #include "vp9/common/mvref_common.h"
-#endif
+
 
 #if ARCH_ARM
 #include "vpx_ports/arm.h"
diff --git a/vp9/encoder/rdopt.c b/vp9/encoder/rdopt.c
index ca8a3ba6b4..19b96af402 100644
--- a/vp9/encoder/rdopt.c
+++ b/vp9/encoder/rdopt.c
@@ -41,9 +41,7 @@
 #include "vp9/common/pred_common.h"
 #include "vp9/common/entropy.h"
 #include "vpx_rtcd.h"
-#if CONFIG_NEWBESTREFMV
 #include "vp9/common/mvref_common.h"
-#endif
 
 #if CONFIG_RUNTIME_CPU_DETECT
 #define IF_RTCD(x)  (x)
@@ -3188,7 +3186,6 @@ static void setup_buffer_inter(VP9_COMP *cpi, MACROBLOCK *x,
   MACROBLOCKD *xd = &x->e_mbd;
   MB_MODE_INFO * mbmi = &xd->mode_info_context->mbmi;
 
-
   vp9_find_near_mvs(xd, xd->mode_info_context,
                     xd->prev_mode_info_context,
                     &frame_nearest_mv[frame_type], &frame_near_mv[frame_type],
@@ -3199,7 +3196,6 @@ static void setup_buffer_inter(VP9_COMP *cpi, MACROBLOCK *x,
   u_buffer[frame_type] = yv12->u_buffer + recon_uvoffset;
   v_buffer[frame_type] = yv12->v_buffer + recon_uvoffset;
 
-#if CONFIG_NEWBESTREFMV
   vp9_find_mv_refs(xd, xd->mode_info_context,
                    xd->prev_mode_info_context,
                    frame_type,
@@ -3212,7 +3208,6 @@ static void setup_buffer_inter(VP9_COMP *cpi, MACROBLOCK *x,
                         &frame_best_ref_mv[frame_type],
                         &frame_nearest_mv[frame_type],
                         &frame_near_mv[frame_type]);
-#endif
 }
 
 static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
-- 
GitLab