shithub: libvpx

Download patch

ref: 8d13b0d1dfccf2359ea4b8e93d016b28eab538cd
parent: a9bbabd94b30f4b065542e859a3353a394f41fe6
author: Dmitry Kovalev <[email protected]>
date: Tue Jul 23 11:41:45 EDT 2013

Removing LOW_PRECISION_MV_UPDATE define.

Change-Id: I78d16ee758e1fae0200b746f00031f6d9c6d6ce7

--- a/vp9/common/vp9_entropymv.h
+++ b/vp9/common/vp9_entropymv.h
@@ -25,7 +25,6 @@
 int vp9_use_mv_hp(const MV *ref);
 
 #define VP9_NMV_UPDATE_PROB  252
-#define LOW_PRECISION_MV_UPDATE  /* Use 7 bit forward update */
 
 /* Symbols for coding which components are zero jointly */
 #define MV_JOINTS     4
--- a/vp9/decoder/vp9_decodemv.c
+++ b/vp9/decoder/vp9_decodemv.c
@@ -246,13 +246,8 @@
 }
 
 static void update_mv(vp9_reader *r, vp9_prob *p, vp9_prob upd_p) {
-  if (vp9_read(r, upd_p)) {
-#ifdef LOW_PRECISION_MV_UPDATE
+  if (vp9_read(r, upd_p))
     *p = (vp9_read_literal(r, 7) << 1) | 1;
-#else
-    *p = vp9_read_literal(r, 8);
-#endif
-  }
 }
 
 static void read_mv_probs(vp9_reader *r, nmv_context *mvc, int usehp) {
--- a/vp9/encoder/vp9_encodemv.c
+++ b/vp9/encoder/vp9_encodemv.c
@@ -128,58 +128,19 @@
   }
 }
 
-static int update_nmv_savings(const unsigned int ct[2],
-                              const vp9_prob cur_p,
-                              const vp9_prob new_p,
-                              const vp9_prob upd_p) {
-
-#ifdef LOW_PRECISION_MV_UPDATE
-  vp9_prob mod_p = new_p | 1;
-#else
-  vp9_prob mod_p = new_p;
-#endif
-  const int cur_b = cost_branch256(ct, cur_p);
-  const int mod_b = cost_branch256(ct, mod_p);
-  const int cost = 7 * 256 +
-#ifndef LOW_PRECISION_MV_UPDATE
-      256 +
-#endif
-      (vp9_cost_one(upd_p) - vp9_cost_zero(upd_p));
-  if (cur_b - mod_b - cost > 0) {
-    return cur_b - mod_b - cost;
-  } else {
-    return 0 - vp9_cost_zero(upd_p);
-  }
-}
-
-static int update_mv(vp9_writer *bc, const unsigned int ct[2],
+static int update_mv(vp9_writer *w, const unsigned int ct[2],
                      vp9_prob *cur_p, vp9_prob new_p, vp9_prob upd_p) {
-
-#ifdef LOW_PRECISION_MV_UPDATE
   vp9_prob mod_p = new_p | 1;
-#else
-  vp9_prob mod_p = new_p;
-#endif
-
   const int cur_b = cost_branch256(ct, *cur_p);
   const int mod_b = cost_branch256(ct, mod_p);
-  const int cost = 7 * 256 +
-#ifndef LOW_PRECISION_MV_UPDATE
-      256 +
-#endif
-      (vp9_cost_one(upd_p) - vp9_cost_zero(upd_p));
-
+  const int cost = 7 * 256 + (vp9_cost_one(upd_p) - vp9_cost_zero(upd_p));
   if (cur_b - mod_b > cost) {
     *cur_p = mod_p;
-    vp9_write(bc, 1, upd_p);
-#ifdef LOW_PRECISION_MV_UPDATE
-    vp9_write_literal(bc, mod_p >> 1, 7);
-#else
-    vp9_write_literal(bc, mod_p, 8);
-#endif
+    vp9_write(w, 1, upd_p);
+    vp9_write_literal(w, mod_p >> 1, 7);
     return 1;
   } else {
-    vp9_write(bc, 0, upd_p);
+    vp9_write(w, 0, upd_p);
     return 0;
   }
 }