rtc-svc: Fix to skip mv search for spatial ref

This is a follow-up to:
https://aomedia-review.googlesource.com/c/aom/+/172461
which removed the skipping of scaling the references when
svc->force_zero_mode_spatial_ref is enabled. Removing this
can slow down the spatial SVC encoder by ~10%.

This fix adds that feature back in, and accounts for
dyanmic change in SVC and resized frames.
The check to skip the reference scaling is done per
reference inside av1_scale_references(), based on the
skip_mvsearch_last/gf/altref.

Removed the TODOs.

Change-Id: Id7fc91c706071dea7d8400f09195889f26d614ec
diff --git a/av1/encoder/encoder_utils.c b/av1/encoder/encoder_utils.c
index bc136b1..eb9acd7 100644
--- a/av1/encoder/encoder_utils.c
+++ b/av1/encoder/encoder_utils.c
@@ -691,6 +691,17 @@
         continue;
       }
 
+      // For RTC-SVC: if force_zero_mode_spatial_ref is enabled, check if the
+      // motion search can be skipped for the references: last, golden, altref.
+      // If so, we can skip scaling that reference.
+      if (cpi->ppi->use_svc && cpi->svc.force_zero_mode_spatial_ref &&
+          cpi->ppi->rtc_ref.set_ref_frame_config) {
+        if (ref_frame == LAST_FRAME && cpi->svc.skip_mvsearch_last) continue;
+        if (ref_frame == GOLDEN_FRAME && cpi->svc.skip_mvsearch_gf) continue;
+        if (ref_frame == ALTREF_FRAME && cpi->svc.skip_mvsearch_altref)
+          continue;
+      }
+
       if (ref->y_crop_width != cm->width || ref->y_crop_height != cm->height) {
         // Replace the reference buffer with a copy having a thicker border,
         // if the reference buffer is higher resolution than the current