shithub: libvpx

Download patch

ref: 454139ae139b5d7984c3469fe21054167839279a
parent: a6bc3dfb0f8e46017d7823985f8383a8dc6cc68b
parent: 3e9e77008c631091c9b6ee51d03b414c334e6480
author: Yaowu Xu <[email protected]>
date: Thu Sep 1 19:37:04 EDT 2016

Merge "Casts to remove some warnings."

--- a/vp9/encoder/vp9_aq_variance.c
+++ b/vp9/encoder/vp9_aq_variance.c
@@ -166,7 +166,7 @@
     aq_variance(x->plane[0].src.buf, x->plane[0].src.stride, vp9_64_zeros, 0,
                 bw, bh, &sse, &avg);
 #endif  // CONFIG_VP9_HIGHBITDEPTH
-    var = sse - (((int64_t)avg * avg) / (bw * bh));
+    var = sse - (unsigned int)(((int64_t)avg * avg) / (bw * bh));
     return (unsigned int)(((uint64_t)256 * var) / (bw * bh));
   } else {
 #if CONFIG_VP9_HIGHBITDEPTH
--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -1788,7 +1788,10 @@
           d32[i].sum += d16[j]->sum;
         }
 
-        d32[i].var = d32[i].sse - (((int64_t)d32[i].sum * d32[i].sum) >> 10);
+        d32[i].var =
+            (unsigned int)(d32[i].sse -
+                           (unsigned int)(((int64_t)d32[i].sum * d32[i].sum) >>
+                                          10));
 
         index = coord_lookup[i * 4].row * mis + coord_lookup[i * 4].col;
         mi_8x8[index] = mi_upper_left + index;
--- a/vp9/encoder/vp9_firstpass.c
+++ b/vp9/encoder/vp9_firstpass.c
@@ -1388,7 +1388,7 @@
     const double speed_term = 1.0 + 0.04 * oxcf->speed;
     double last_group_rate_err;
     const int target_norm_bits_per_mb =
-        ((uint64_t)target_rate << BPER_MB_NORMBITS) / active_mbs;
+        (int)(((uint64_t)target_rate << BPER_MB_NORMBITS) / active_mbs);
     int q;
     int is_svc_upper_layer = 0;
 
--- a/vp9/encoder/vp9_pickmode.c
+++ b/vp9/encoder/vp9_pickmode.c
@@ -336,7 +336,7 @@
                  cpi->common.use_highbitdepth, bd,
 #endif
                  sse8x8, sum8x8, var8x8);
-  var = sse - (((int64_t)sum * sum) >> (bw + bh + 4));
+  var = sse - (unsigned int)(((int64_t)sum * sum) >> (bw + bh + 4));
 
   *var_y = var;
   *sse_y = sse;
--- a/vp9/encoder/vp9_ratectrl.c
+++ b/vp9/encoder/vp9_ratectrl.c
@@ -529,7 +529,7 @@
   // Calculate required scaling factor based on target frame size and size of
   // frame produced using previous Q.
   target_bits_per_mb =
-      ((uint64_t)target_bits_per_frame << BPER_MB_NORMBITS) / cm->MBs;
+      (int)(((uint64_t)target_bits_per_frame << BPER_MB_NORMBITS) / cm->MBs);
 
   i = active_best_quality;
 
@@ -1254,8 +1254,8 @@
                                   rate_thresh_mult[rc->frame_size_selector]);
 
   // Target rate per SB64 (including partial SB64s.
-  rc->sb64_target_rate =
-      ((int64_t)rc->this_frame_target * 64 * 64) / (cm->width * cm->height);
+  rc->sb64_target_rate = (int)(((int64_t)rc->this_frame_target * 64 * 64) /
+                               (cm->width * cm->height));
 }
 
 static void update_alt_ref_frame_stats(VP9_COMP *cpi) {
@@ -2323,7 +2323,8 @@
     cpi->rc.rc_1_frame = 0;
     cpi->rc.rc_2_frame = 0;
     // Adjust rate correction factor.
-    target_bits_per_mb = ((uint64_t)target_size << BPER_MB_NORMBITS) / cm->MBs;
+    target_bits_per_mb =
+        (int)(((uint64_t)target_size << BPER_MB_NORMBITS) / cm->MBs);
     // Rate correction factor based on target_bits_per_mb and qp (==max_QP).
     // This comes from the inverse computation of vp9_rc_bits_per_mb().
     q2 = vp9_convert_qindex_to_q(*q, cm->bit_depth);