Fix test failures and warnings of WARPED_MOTION

Properly set number of projection samples for seg skip blocks
at the encoder side to clear unit test failure when both seg feature
and warped_motion is on.
Clear 'implicit conversions' warnings

Change-Id: I29e40ffae75880dae2584dbc8772c81321f6d69e
diff --git a/av1/common/warped_motion.c b/av1/common/warped_motion.c
index 7604cc8..5cc11fb 100644
--- a/av1/common/warped_motion.c
+++ b/av1/common/warped_motion.c
@@ -708,7 +708,8 @@
 // at precision of DIV_LUT_PREC_BITS along with the shift.
 static int16_t resolve_divisor_64(uint64_t D, int16_t *shift) {
   int64_t e, f;
-  *shift = (D >> 32) ? get_msb(D >> 32) + 32 : get_msb(D);
+  *shift = (int16_t)((D >> 32) ? get_msb((unsigned int)(D >> 32)) + 32
+                               : get_msb((unsigned int)D));
   // e is obtained from D after resetting the most significant 1 bit.
   e = D - ((uint64_t)1 << *shift);
   // Get the most significant DIV_LUT_BITS (8) bits of e into f
@@ -1554,18 +1555,18 @@
 
   int64_t v;
   v = Px[0] * (int64_t)iDet;
-  wm->wmmat[2] = ROUND_POWER_OF_TWO_SIGNED_64(v, shift);
+  wm->wmmat[2] = (int32_t)(ROUND_POWER_OF_TWO_SIGNED_64(v, shift));
   v = Px[1] * (int64_t)iDet;
-  wm->wmmat[3] = ROUND_POWER_OF_TWO_SIGNED_64(v, shift);
+  wm->wmmat[3] = (int32_t)(ROUND_POWER_OF_TWO_SIGNED_64(v, shift));
   v = (dux << WARPEDMODEL_PREC_BITS) - sux * wm->wmmat[2] - suy * wm->wmmat[3];
-  wm->wmmat[0] = ROUND_POWER_OF_TWO_SIGNED(v, 3);
+  wm->wmmat[0] = (int32_t)(ROUND_POWER_OF_TWO_SIGNED(v, 3));
 
   v = Py[0] * (int64_t)iDet;
-  wm->wmmat[4] = ROUND_POWER_OF_TWO_SIGNED_64(v, shift);
+  wm->wmmat[4] = (int32_t)(ROUND_POWER_OF_TWO_SIGNED_64(v, shift));
   v = Py[1] * (int64_t)iDet;
-  wm->wmmat[5] = ROUND_POWER_OF_TWO_SIGNED_64(v, shift);
+  wm->wmmat[5] = (int32_t)(ROUND_POWER_OF_TWO_SIGNED_64(v, shift));
   v = (duy << WARPEDMODEL_PREC_BITS) - sux * wm->wmmat[4] - suy * wm->wmmat[5];
-  wm->wmmat[1] = ROUND_POWER_OF_TWO_SIGNED(v, 3);
+  wm->wmmat[1] = (int32_t)(ROUND_POWER_OF_TWO_SIGNED(v, 3));
 
   wm->wmmat[6] = wm->wmmat[7] = 0;
 
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c
index eeeb91a..c1f8cc7 100644
--- a/av1/encoder/rdopt.c
+++ b/av1/encoder/rdopt.c
@@ -11517,6 +11517,12 @@
 #if CONFIG_MOTION_VAR
   av1_count_overlappable_neighbors(cm, xd, mi_row, mi_col);
 #endif
+#if CONFIG_WARPED_MOTION
+  if (is_motion_variation_allowed_bsize(bsize) && !has_second_ref(mbmi)) {
+    int pts[SAMPLES_ARRAY_SIZE], pts_inref[SAMPLES_ARRAY_SIZE];
+    mbmi->num_proj_ref[0] = findSamples(cm, xd, mi_row, mi_col, pts, pts_inref);
+  }
+#endif
 
   if (cm->interp_filter != BILINEAR) {
     best_filter = EIGHTTAP_REGULAR;