Remove Global_Motion_Params and GLOBAL_MOTION_TYPE
After https://aomedia-review.googlesource.com/#/c/5589/ ,
the Global_Motion_Params and GLOBAL_MOTION_TYPE types
are redundant, and can be removed in favour of
WarpedMotionParams and TransformationType respectively.
Change-Id: I33f3796e5c469e595fd012ccdb65a672dd1bb86c
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c
index 52114b0..49e8b2d 100644
--- a/av1/encoder/rdopt.c
+++ b/av1/encoder/rdopt.c
@@ -4312,23 +4312,23 @@
}
#if CONFIG_GLOBAL_MOTION
-static int get_gmbitcost(const Global_Motion_Params *gm,
- const aom_prob *probs) {
- int gmtype_cost[GLOBAL_MOTION_TYPES];
+static int get_gmbitcost(const WarpedMotionParams *gm, const aom_prob *probs) {
+ int gmtype_cost[TRANS_TYPES];
int bits;
+ TransformationType type = gm->wmtype;
av1_cost_tokens(gmtype_cost, probs, av1_global_motion_types_tree);
- switch (gm->gmtype) {
- case GLOBAL_AFFINE:
- bits = (GM_ABS_TRANS_BITS + 1) * 2 + 4 * GM_ABS_ALPHA_BITS + 4;
+ switch (type) {
+ case AFFINE:
+ bits = (GM_ABS_TRANS_BITS + 1) * 2 + (GM_ABS_ALPHA_BITS + 1) * 4;
break;
- case GLOBAL_ROTZOOM:
- bits = (GM_ABS_TRANS_BITS + 1) * 2 + 2 * GM_ABS_ALPHA_BITS + 2;
+ case ROTZOOM:
+ bits = (GM_ABS_TRANS_BITS + 1) * 2 + (GM_ABS_ALPHA_BITS + 1) * 2;
break;
- case GLOBAL_TRANSLATION: bits = (GM_ABS_TRANS_BITS + 1) * 2; break;
- case GLOBAL_ZERO: bits = 0; break;
+ case TRANSLATION: bits = (GM_ABS_TRANS_BITS + 1) * 2; break;
+ case IDENTITY: bits = 0; break;
default: assert(0); return 0;
}
- return bits ? (bits << AV1_PROB_COST_SHIFT) + gmtype_cost[gm->gmtype] : 0;
+ return bits ? (bits << AV1_PROB_COST_SHIFT) + gmtype_cost[type] : 0;
}
#define GLOBAL_MOTION_RATE(ref) \
@@ -5337,9 +5337,9 @@
#endif // CONFIG_REF_MV
#if CONFIG_GLOBAL_MOTION
- if (cm->global_motion[mbmi->ref_frame[0]].gmtype == GLOBAL_ZERO &&
+ if (cm->global_motion[mbmi->ref_frame[0]].wmtype == IDENTITY &&
(!has_second_rf ||
- cm->global_motion[mbmi->ref_frame[1]].gmtype == GLOBAL_ZERO))
+ cm->global_motion[mbmi->ref_frame[1]].wmtype == IDENTITY))
#endif // CONFIG_GLOBAL_MOTION
if (!check_best_zero_mv(cpi, mbmi_ext->mode_context,
@@ -8857,9 +8857,9 @@
}
}
#if CONFIG_GLOBAL_MOTION
- } else if (cm->global_motion[ref_frame].gmtype == GLOBAL_ZERO &&
+ } else if (cm->global_motion[ref_frame].wmtype == IDENTITY &&
(!comp_pred ||
- cm->global_motion[second_ref_frame].gmtype == GLOBAL_ZERO)) {
+ cm->global_motion[second_ref_frame].wmtype == IDENTITY)) {
#else // CONFIG_GLOBAL_MOTION
} else {
#endif // CONFIG_GLOBAL_MOTION