}
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) {
}
}
-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;
}
}