Commit 1003ed2d authored by Yaowu Xu's avatar Yaowu Xu

misc-fix: use subexp prob updates for MV probs

This commit merges the fix that changes to use subexp probability
updates for update MV probabilities.

Related tracking issue:
https://bugs.chromium.org/p/webm/issues/detail?id=1040
Original libvpx commit:
177e7b53

Change-Id: Id1c79a507f3ae698c3560a559b7b630974bcf656
parent 2d234c6b
......@@ -208,12 +208,7 @@ static void read_frame_reference_mode_probs(AV1_COMMON *cm, aom_reader *r) {
static void update_mv_probs(aom_prob *p, int n, aom_reader *r) {
int i;
for (i = 0; i < n; ++i)
#if CONFIG_MISC_FIXES
av1_diff_update_prob(r, &p[i], ACCT_STR);
#else
if (aom_read(r, MV_UPDATE_PROB, ACCT_STR))
p[i] = (aom_read_literal(r, 7, ACCT_STR) << 1) | 1;
#endif
}
static void read_mv_probs(nmv_context *ctx, int allow_hp, aom_reader *r) {
......
......@@ -140,7 +140,6 @@ static void build_nmv_component_cost_table(int *mvcost,
static void update_mv(aom_writer *w, const unsigned int ct[2], aom_prob *cur_p,
aom_prob upd_p) {
#if CONFIG_MISC_FIXES
(void)upd_p;
#if CONFIG_TILE_GROUPS
// Just use the maximum number of tile groups to avoid passing in the actual
......@@ -149,16 +148,6 @@ static void update_mv(aom_writer *w, const unsigned int ct[2], aom_prob *cur_p,
#else
av1_cond_prob_diff_update(w, cur_p, ct, 1);
#endif
#else
const aom_prob new_p = get_binary_prob(ct[0], ct[1]) | 1;
const int update = cost_branch256(ct, *cur_p) + av1_cost_zero(upd_p) >
cost_branch256(ct, new_p) + av1_cost_one(upd_p) + 7 * 256;
aom_write(w, update, upd_p);
if (update) {
*cur_p = new_p;
aom_write_literal(w, new_p >> 1, 7);
}
#endif
}
static void write_mv_update(const aom_tree_index *tree,
......
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