From 8d13b0d1dfccf2359ea4b8e93d016b28eab538cd Mon Sep 17 00:00:00 2001 From: Dmitry Kovalev Date: Tue, 23 Jul 2013 15:41:45 -0700 Subject: [PATCH] Removing LOW_PRECISION_MV_UPDATE define. Change-Id: I78d16ee758e1fae0200b746f00031f6d9c6d6ce7 --- vp9/common/vp9_entropymv.h | 1 - vp9/decoder/vp9_decodemv.c | 7 +----- vp9/encoder/vp9_encodemv.c | 49 ++++---------------------------------- 3 files changed, 6 insertions(+), 51 deletions(-) diff --git a/vp9/common/vp9_entropymv.h b/vp9/common/vp9_entropymv.h index d7d6576ea..85a1f3aa0 100644 --- a/vp9/common/vp9_entropymv.h +++ b/vp9/common/vp9_entropymv.h @@ -25,7 +25,6 @@ void vp9_adapt_mv_probs(struct VP9Common *cm, int usehp); 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 diff --git a/vp9/decoder/vp9_decodemv.c b/vp9/decoder/vp9_decodemv.c index f180e5c10..7b05ed59c 100644 --- a/vp9/decoder/vp9_decodemv.c +++ b/vp9/decoder/vp9_decodemv.c @@ -246,13 +246,8 @@ static INLINE void read_mv(vp9_reader *r, MV *mv, const MV *ref, } 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) { diff --git a/vp9/encoder/vp9_encodemv.c b/vp9/encoder/vp9_encodemv.c index f0c34b373..2f5e16ccf 100644 --- a/vp9/encoder/vp9_encodemv.c +++ b/vp9/encoder/vp9_encodemv.c @@ -128,58 +128,19 @@ static void build_nmv_component_cost_table(int *mvcost, } } -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; } } -- 2.40.0