Fix global-motion + error-resilient-mode

Patch https://aomedia-review.googlesource.com/c/21783
changed things so that error-resilient frames use the default
global motion parameters as a reference, rather than taking
the reference from the previous frame.

This was implemented by clearing out cm->prev_frame->global_motion
when we have an error-resilient frame. Unfortunately, this causes
an issue: if we have an error resilient frame which isn't stored
into any reference slots, followed by a non-error-resilient frame,
then both frames refer to the same prev_frame. The second frame
then delta-codes against cm->prev_frame->global_motion, but
this was reset to the default values by the intervening
error-resilient frame!

In order to allow the above case to work as intended, expand the
default warp parameter set to a full WarpedMotionParams struct,
and use that as the reference for error-resilient frames.

This also allows us to remove set_default_warp_params, as we
can now just copy directly from default_warp_params.

Change-Id: I9645615db2700c1d3810e6e42f4f1da626fcd5e3
diff --git a/av1/encoder/bitstream.c b/av1/encoder/bitstream.c
index 6384f5b..cdf8b69 100644
--- a/av1/encoder/bitstream.c
+++ b/av1/encoder/bitstream.c
@@ -4396,8 +4396,8 @@
 }
 
 #if CONFIG_GLOBAL_MOTION
-static void write_global_motion_params(WarpedMotionParams *params,
-                                       WarpedMotionParams *ref_params,
+static void write_global_motion_params(const WarpedMotionParams *params,
+                                       const WarpedMotionParams *ref_params,
                                        struct aom_write_bit_buffer *wb,
                                        int allow_hp) {
   TransformationType type = params->wmtype;
@@ -4480,10 +4480,10 @@
   AV1_COMMON *const cm = &cpi->common;
   int frame;
   for (frame = LAST_FRAME; frame <= ALTREF_FRAME; ++frame) {
-    if (cm->error_resilient_mode)
-      set_default_warp_params(&cm->prev_frame->global_motion[frame]);
-    write_global_motion_params(&cm->global_motion[frame],
-                               &cm->prev_frame->global_motion[frame], wb,
+    const WarpedMotionParams *ref_params =
+        cm->error_resilient_mode ? &default_warp_params
+                                 : &cm->prev_frame->global_motion[frame];
+    write_global_motion_params(&cm->global_motion[frame], ref_params, wb,
                                cm->allow_high_precision_mv);
     // TODO(sarahparker, debargha): The logic in the commented out code below
     // does not work currently and causes mismatches when resize is on.