Commit 8d13b0d1 authored by Dmitry Kovalev's avatar Dmitry Kovalev

Removing LOW_PRECISION_MV_UPDATE define.

Change-Id: I78d16ee758e1fae0200b746f00031f6d9c6d6ce7
parent a9bbabd9
......@@ -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
......
......@@ -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) {
......
......@@ -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;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment