joint_motion_search: Make assumption explicit.

Use assert to test the assumption noted in the comment.

Ran some encodes with varying per-frame resolutions (using
SUPERRES_RANDOM and RESIZE_RANDOM modes) to ensure that these
asserts are indeed valid.

Change-Id: I30021fff05f9793f80e42c5319bed02b0ae04cbd
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c
index 84d8807..b2ea183 100644
--- a/av1/encoder/rdopt.c
+++ b/av1/encoder/rdopt.c
@@ -5641,6 +5641,12 @@
 
   // Since we have scaled the reference frames to match the size of the current
   // frame we must use a unit scaling factor during mode selection.
+  assert(IMPLIES(scaled_ref_frame[0] != NULL,
+                 cm->width == scaled_ref_frame[0]->y_crop_width &&
+                     cm->height == scaled_ref_frame[0]->y_crop_height));
+  assert(IMPLIES(scaled_ref_frame[1] != NULL,
+                 cm->width == scaled_ref_frame[1]->y_crop_width &&
+                     cm->height == scaled_ref_frame[1]->y_crop_height));
   av1_setup_scale_factors_for_frame(&sf, cm->width, cm->height, cm->width,
                                     cm->height, cm->use_highbitdepth);