Commit f6c84ffe authored by Urvang Joshi's avatar Urvang Joshi
Browse files

Refactor av1_adapt_mv_probs().

Move common code out of #if CONFIG_REF_MV.

Change-Id: Ieb778448f125bdbcd0f400875289bc219aa63873
parent 77118729
......@@ -239,6 +239,11 @@ void av1_adapt_mv_probs(AV1_COMMON *cm, int allow_hp) {
const nmv_context *pre_fc =
&cm->frame_contexts[cm->frame_context_idx].nmvc[idx];
const nmv_context_counts *counts = &cm->counts.mv[idx];
#else
nmv_context *fc = &cm->fc->nmvc;
const nmv_context *pre_fc = &cm->frame_contexts[cm->frame_context_idx].nmvc;
const nmv_context_counts *counts = &cm->counts.mv;
#endif // CONFIG_REF_MV
aom_tree_merge_probs(av1_mv_joint_tree, pre_fc->joints, counts->joints,
fc->joints);
for (i = 0; i < 2; ++i) {
......@@ -267,41 +272,9 @@ void av1_adapt_mv_probs(AV1_COMMON *cm, int allow_hp) {
comp->hp = av1_mode_mv_merge_probs(pre_comp->hp, c->hp);
}
}
#if CONFIG_REF_MV
}
#else
nmv_context *fc = &cm->fc->nmvc;
const nmv_context *pre_fc = &cm->frame_contexts[cm->frame_context_idx].nmvc;
const nmv_context_counts *counts = &cm->counts.mv;
aom_tree_merge_probs(av1_mv_joint_tree, pre_fc->joints, counts->joints,
fc->joints);
for (i = 0; i < 2; ++i) {
nmv_component *comp = &fc->comps[i];
const nmv_component *pre_comp = &pre_fc->comps[i];
const nmv_component_counts *c = &counts->comps[i];
comp->sign = av1_mode_mv_merge_probs(pre_comp->sign, c->sign);
aom_tree_merge_probs(av1_mv_class_tree, pre_comp->classes, c->classes,
comp->classes);
aom_tree_merge_probs(av1_mv_class0_tree, pre_comp->class0, c->class0,
comp->class0);
for (j = 0; j < MV_OFFSET_BITS; ++j)
comp->bits[j] = av1_mode_mv_merge_probs(pre_comp->bits[j], c->bits[j]);
for (j = 0; j < CLASS0_SIZE; ++j)
aom_tree_merge_probs(av1_mv_fp_tree, pre_comp->class0_fp[j],
c->class0_fp[j], comp->class0_fp[j]);
aom_tree_merge_probs(av1_mv_fp_tree, pre_comp->fp, c->fp, comp->fp);
if (allow_hp) {
comp->class0_hp =
av1_mode_mv_merge_probs(pre_comp->class0_hp, c->class0_hp);
comp->hp = av1_mode_mv_merge_probs(pre_comp->hp, c->hp);
}
}
#endif
#endif // CONFIG_REF_MV
}
#if CONFIG_EC_MULTISYMBOL && !CONFIG_EC_ADAPT
......
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