Remove av1_nmv_ctx function
The function is deprecated with opt-ref-mv merged.
Change-Id: I25cf550f906466a189f05d90d091297b9672dc3a
diff --git a/av1/decoder/decodemv.c b/av1/decoder/decodemv.c
index df8de05..87e139f 100644
--- a/av1/decoder/decodemv.c
+++ b/av1/decoder/decodemv.c
@@ -1193,11 +1193,7 @@
switch (mode) {
case NEWMV: {
for (int i = 0; i < 1 + is_compound; ++i) {
- int8_t rf_type = av1_ref_frame_type(mbmi->ref_frame);
- int nmv_ctx =
- av1_nmv_ctx(xd->ref_mv_count[rf_type], xd->ref_mv_stack[rf_type], i,
- mbmi->ref_mv_idx);
- nmv_context *const nmvc = &ec_ctx->nmvc[nmv_ctx];
+ nmv_context *const nmvc = &ec_ctx->nmvc[0];
read_mv(r, &mv[i].as_mv, &ref_mv[i].as_mv, nmvc, allow_hp);
ret = ret && is_mv_valid(&mv[i].as_mv);
@@ -1249,11 +1245,7 @@
case NEW_NEWMV: {
assert(is_compound);
for (int i = 0; i < 2; ++i) {
- int8_t rf_type = av1_ref_frame_type(mbmi->ref_frame);
- int nmv_ctx =
- av1_nmv_ctx(xd->ref_mv_count[rf_type], xd->ref_mv_stack[rf_type], i,
- mbmi->ref_mv_idx);
- nmv_context *const nmvc = &ec_ctx->nmvc[nmv_ctx];
+ nmv_context *const nmvc = &ec_ctx->nmvc[0];
read_mv(r, &mv[i].as_mv, &ref_mv[i].as_mv, nmvc, allow_hp);
ret = ret && is_mv_valid(&mv[i].as_mv);
}
@@ -1272,10 +1264,7 @@
break;
}
case NEW_NEARESTMV: {
- int8_t rf_type = av1_ref_frame_type(mbmi->ref_frame);
- int nmv_ctx = av1_nmv_ctx(xd->ref_mv_count[rf_type],
- xd->ref_mv_stack[rf_type], 0, mbmi->ref_mv_idx);
- nmv_context *const nmvc = &ec_ctx->nmvc[nmv_ctx];
+ nmv_context *const nmvc = &ec_ctx->nmvc[0];
read_mv(r, &mv[0].as_mv, &ref_mv[0].as_mv, nmvc, allow_hp);
assert(is_compound);
ret = ret && is_mv_valid(&mv[0].as_mv);
@@ -1283,10 +1272,7 @@
break;
}
case NEAREST_NEWMV: {
- int8_t rf_type = av1_ref_frame_type(mbmi->ref_frame);
- int nmv_ctx = av1_nmv_ctx(xd->ref_mv_count[rf_type],
- xd->ref_mv_stack[rf_type], 1, mbmi->ref_mv_idx);
- nmv_context *const nmvc = &ec_ctx->nmvc[nmv_ctx];
+ nmv_context *const nmvc = &ec_ctx->nmvc[0];
mv[0].as_int = nearest_mv[0].as_int;
read_mv(r, &mv[1].as_mv, &ref_mv[1].as_mv, nmvc, allow_hp);
assert(is_compound);
@@ -1294,11 +1280,7 @@
break;
}
case NEAR_NEWMV: {
- int8_t rf_type = av1_ref_frame_type(mbmi->ref_frame);
- int nmv_ctx =
- av1_nmv_ctx(xd->ref_mv_count[rf_type], xd->ref_mv_stack[rf_type], 1,
- mbmi->ref_mv_idx + 1);
- nmv_context *const nmvc = &ec_ctx->nmvc[nmv_ctx];
+ nmv_context *const nmvc = &ec_ctx->nmvc[0];
mv[0].as_int = near_mv[0].as_int;
read_mv(r, &mv[1].as_mv, &ref_mv[1].as_mv, nmvc, allow_hp);
assert(is_compound);
@@ -1307,11 +1289,7 @@
break;
}
case NEW_NEARMV: {
- int8_t rf_type = av1_ref_frame_type(mbmi->ref_frame);
- int nmv_ctx =
- av1_nmv_ctx(xd->ref_mv_count[rf_type], xd->ref_mv_stack[rf_type], 0,
- mbmi->ref_mv_idx + 1);
- nmv_context *const nmvc = &ec_ctx->nmvc[nmv_ctx];
+ nmv_context *const nmvc = &ec_ctx->nmvc[0];
read_mv(r, &mv[0].as_mv, &ref_mv[0].as_mv, nmvc, allow_hp);
assert(is_compound);
ret = ret && is_mv_valid(&mv[0].as_mv);
diff --git a/av1/encoder/bitstream.c b/av1/encoder/bitstream.c
index af9f6f4..3153c9e 100644
--- a/av1/encoder/bitstream.c
+++ b/av1/encoder/bitstream.c
@@ -1115,30 +1115,18 @@
if (mode == NEWMV || mode == NEW_NEWMV) {
int_mv ref_mv;
for (ref = 0; ref < 1 + is_compound; ++ref) {
- int8_t rf_type = av1_ref_frame_type(mbmi->ref_frame);
- int nmv_ctx =
- av1_nmv_ctx(mbmi_ext->ref_mv_count[rf_type],
- mbmi_ext->ref_mv_stack[rf_type], ref, mbmi->ref_mv_idx);
- nmv_context *nmvc = &ec_ctx->nmvc[nmv_ctx];
+ nmv_context *nmvc = &ec_ctx->nmvc[0];
ref_mv = mbmi_ext->ref_mvs[mbmi->ref_frame[ref]][0];
av1_encode_mv(cpi, w, &mbmi->mv[ref].as_mv, &ref_mv.as_mv, nmvc,
allow_hp);
}
} else if (mode == NEAREST_NEWMV || mode == NEAR_NEWMV) {
- int8_t rf_type = av1_ref_frame_type(mbmi->ref_frame);
- int nmv_ctx = av1_nmv_ctx(
- mbmi_ext->ref_mv_count[rf_type], mbmi_ext->ref_mv_stack[rf_type], 1,
- mbmi->ref_mv_idx + (mode == NEAR_NEWMV ? 1 : 0));
- nmv_context *nmvc = &ec_ctx->nmvc[nmv_ctx];
+ nmv_context *nmvc = &ec_ctx->nmvc[0];
av1_encode_mv(cpi, w, &mbmi->mv[1].as_mv,
&mbmi_ext->ref_mvs[mbmi->ref_frame[1]][0].as_mv, nmvc,
allow_hp);
} else if (mode == NEW_NEARESTMV || mode == NEW_NEARMV) {
- int8_t rf_type = av1_ref_frame_type(mbmi->ref_frame);
- int nmv_ctx = av1_nmv_ctx(
- mbmi_ext->ref_mv_count[rf_type], mbmi_ext->ref_mv_stack[rf_type], 0,
- mbmi->ref_mv_idx + (mode == NEW_NEARMV ? 1 : 0));
- nmv_context *nmvc = &ec_ctx->nmvc[nmv_ctx];
+ nmv_context *nmvc = &ec_ctx->nmvc[0];
av1_encode_mv(cpi, w, &mbmi->mv[0].as_mv,
&mbmi_ext->ref_mvs[mbmi->ref_frame[0]][0].as_mv, nmvc,
allow_hp);
diff --git a/av1/encoder/rd.c b/av1/encoder/rd.c
index a62d8e8..81ea460 100644
--- a/av1/encoder/rd.c
+++ b/av1/encoder/rd.c
@@ -443,12 +443,10 @@
}
void av1_set_mvcost(MACROBLOCK *x, int ref, int ref_mv_idx) {
- MB_MODE_INFO_EXT *mbmi_ext = x->mbmi_ext;
- int8_t rf_type = av1_ref_frame_type(x->e_mbd.mi[0]->mbmi.ref_frame);
- int nmv_ctx = av1_nmv_ctx(mbmi_ext->ref_mv_count[rf_type],
- mbmi_ext->ref_mv_stack[rf_type], ref, ref_mv_idx);
- x->mvcost = x->mv_cost_stack[nmv_ctx];
- x->nmvjointcost = x->nmv_vec_cost[nmv_ctx];
+ (void)ref;
+ (void)ref_mv_idx;
+ x->mvcost = x->mv_cost_stack[0];
+ x->nmvjointcost = x->nmv_vec_cost[0];
}
void av1_fill_coeff_costs(MACROBLOCK *x, FRAME_CONTEXT *fc,