}
static INLINE void read_mv(aom_reader *r, MV *mv, const MV *ref,
-#if CONFIG_REF_MV
- int is_compound,
-#endif
const nmv_context *ctx, nmv_context_counts *counts,
int allow_hp) {
MV_JOINT_TYPE joint_type;
const int use_hp = allow_hp && av1_use_mv_hp(ref);
MV diff = { 0, 0 };
-
-#if CONFIG_REF_MV && !CONFIG_EXT_INTER
- if (is_compound) {
- int is_zero_rmv = aom_read(r, ctx->zero_rmv);
- if (is_zero_rmv) {
- joint_type = MV_JOINT_ZERO;
- } else {
- joint_type =
- (MV_JOINT_TYPE)aom_read_tree(r, av1_mv_joint_tree, ctx->joints);
- }
- } else {
- joint_type =
- (MV_JOINT_TYPE)aom_read_tree(r, av1_mv_joint_tree, ctx->joints);
- }
-#else
joint_type = (MV_JOINT_TYPE)aom_read_tree(r, av1_mv_joint_tree, ctx->joints);
-#endif
-
-#if CONFIG_REF_MV && CONFIG_EXT_INTER
- (void)is_compound;
-#endif
if (mv_joint_vertical(joint_type))
diff.row = read_mv_component(r, &ctx->comps[0], use_hp);
mbmi->ref_mv_idx);
nmv_context_counts *const mv_counts =
counts ? &counts->mv[nmv_ctx] : NULL;
- read_mv(r, &mv[i].as_mv, &ref_mv[i].as_mv, is_compound,
- &cm->fc->nmvc[nmv_ctx], mv_counts, allow_hp);
+ read_mv(r, &mv[i].as_mv, &ref_mv[i].as_mv, &cm->fc->nmvc[nmv_ctx],
+ mv_counts, allow_hp);
#else
read_mv(r, &mv[i].as_mv, &ref_mv[i].as_mv, &cm->fc->nmvc, mv_counts,
allow_hp);
mbmi->ref_mv_idx);
nmv_context_counts *const mv_counts =
counts ? &counts->mv[nmv_ctx] : NULL;
- read_mv(r, &mv[i].as_mv, &ref_mv[i].as_mv, is_compound,
- &cm->fc->nmvc[nmv_ctx], mv_counts, allow_hp);
+ read_mv(r, &mv[i].as_mv, &ref_mv[i].as_mv, &cm->fc->nmvc[nmv_ctx],
+ mv_counts, allow_hp);
#else
read_mv(r, &mv[i].as_mv, &ref_mv[i].as_mv, &cm->fc->nmvc, mv_counts,
allow_hp);
xd->ref_mv_stack[rf_type], 0, mbmi->ref_mv_idx);
nmv_context_counts *const mv_counts =
counts ? &counts->mv[nmv_ctx] : NULL;
- read_mv(r, &mv[0].as_mv, &ref_mv[0].as_mv, is_compound,
- &cm->fc->nmvc[nmv_ctx], mv_counts, allow_hp);
+ read_mv(r, &mv[0].as_mv, &ref_mv[0].as_mv, &cm->fc->nmvc[nmv_ctx],
+ mv_counts, allow_hp);
#else
nmv_context_counts *const mv_counts = counts ? &counts->mv : NULL;
read_mv(r, &mv[0].as_mv, &ref_mv[0].as_mv, &cm->fc->nmvc, mv_counts,
nmv_context_counts *const mv_counts =
counts ? &counts->mv[nmv_ctx] : NULL;
mv[0].as_int = nearest_mv[0].as_int;
- read_mv(r, &mv[1].as_mv, &ref_mv[1].as_mv, is_compound,
- &cm->fc->nmvc[nmv_ctx], mv_counts, allow_hp);
+ read_mv(r, &mv[1].as_mv, &ref_mv[1].as_mv, &cm->fc->nmvc[nmv_ctx],
+ mv_counts, allow_hp);
#else
nmv_context_counts *const mv_counts = counts ? &counts->mv : NULL;
mv[0].as_int = nearest_mv[0].as_int;
nmv_context_counts *const mv_counts =
counts ? &counts->mv[nmv_ctx] : NULL;
mv[0].as_int = near_mv[0].as_int;
- read_mv(r, &mv[1].as_mv, &ref_mv[1].as_mv, is_compound,
- &cm->fc->nmvc[nmv_ctx], mv_counts, allow_hp);
+ read_mv(r, &mv[1].as_mv, &ref_mv[1].as_mv, &cm->fc->nmvc[nmv_ctx],
+ mv_counts, allow_hp);
#else
nmv_context_counts *const mv_counts = counts ? &counts->mv : NULL;
mv[0].as_int = near_mv[0].as_int;
xd->ref_mv_stack[rf_type], 0, mbmi->ref_mv_idx);
nmv_context_counts *const mv_counts =
counts ? &counts->mv[nmv_ctx] : NULL;
- read_mv(r, &mv[0].as_mv, &ref_mv[0].as_mv, is_compound,
- &cm->fc->nmvc[nmv_ctx], mv_counts, allow_hp);
+ read_mv(r, &mv[0].as_mv, &ref_mv[0].as_mv, &cm->fc->nmvc[nmv_ctx],
+ mv_counts, allow_hp);
#else
nmv_context_counts *const mv_counts = counts ? &counts->mv : NULL;
read_mv(r, &mv[0].as_mv, &ref_mv[0].as_mv, &cm->fc->nmvc, mv_counts,
write_mv_update(av1_mv_joint_tree, mvc->joints, counts->joints, MV_JOINTS,
w);
- av1_cond_prob_diff_update(w, &mvc->zero_rmv, counts->zero_rmv);
-
for (i = 0; i < 2; ++i) {
nmv_component *comp = &mvc->comps[i];
nmv_component_counts *comp_counts = &counts->comps[i];
const MV diff = { mv->row - ref->row, mv->col - ref->col };
const MV_JOINT_TYPE j = av1_get_mv_joint(&diff);
usehp = usehp && av1_use_mv_hp(ref);
-
-#if CONFIG_REF_MV && !CONFIG_EXT_INTER
- if (is_compound) {
- aom_write(w, (j == MV_JOINT_ZERO), mvctx->zero_rmv);
- if (j == MV_JOINT_ZERO) return;
- } else {
- if (j == MV_JOINT_ZERO) assert(0);
- }
-#endif
-
-#if CONFIG_REF_MV && CONFIG_EXT_INTER
+#if CONFIG_REF_MV
(void)is_compound;
#endif
-
av1_write_token(w, av1_mv_joint_tree, mvctx->joints, &mv_joint_encodings[j]);
if (mv_joint_vertical(j))
encode_mv_component(w, diff.row, &mvctx->comps[0], usehp);
x->nmvjointcost = x->nmv_vec_cost[nmv_ctx];
x->mvsadcost = x->mvcost;
x->nmvjointsadcost = x->nmvjointcost;
-
- x->nmv_vec_cost[nmv_ctx][MV_JOINT_ZERO] =
- x->zero_rmv_cost[nmv_ctx][1] - x->zero_rmv_cost[nmv_ctx][0];
}
#endif
int nmv_ctx;
for (nmv_ctx = 0; nmv_ctx < NMV_CONTEXTS; ++nmv_ctx) {
- aom_prob tmp_prob = cm->fc->nmvc[nmv_ctx].joints[MV_JOINT_ZERO];
- cm->fc->nmvc[nmv_ctx].joints[MV_JOINT_ZERO] = 1;
-
av1_build_nmv_cost_table(
x->nmv_vec_cost[nmv_ctx],
cm->allow_high_precision_mv ? x->nmvcost_hp[nmv_ctx]
: x->nmvcost[nmv_ctx],
&cm->fc->nmvc[nmv_ctx], cm->allow_high_precision_mv);
- cm->fc->nmvc[nmv_ctx].joints[MV_JOINT_ZERO] = tmp_prob;
-
- x->nmv_vec_cost[nmv_ctx][MV_JOINT_ZERO] = 0;
- x->zero_rmv_cost[nmv_ctx][0] =
- av1_cost_bit(cm->fc->nmvc[nmv_ctx].zero_rmv, 0);
- x->zero_rmv_cost[nmv_ctx][1] =
- av1_cost_bit(cm->fc->nmvc[nmv_ctx].zero_rmv, 1);
}
x->mvcost = x->mv_cost_stack[0];
x->nmvjointcost = x->nmv_vec_cost[0];