Silence a bunch of MSVC warnings
authorYaowu Xu <yaowu@google.com>
Tue, 17 Sep 2013 16:45:13 +0000 (09:45 -0700)
committerYaowu Xu <yaowu@google.com>
Tue, 17 Sep 2013 19:08:51 +0000 (12:08 -0700)
Change-Id: I16633269582a640809dca27572bbe99efa6369fc

vp8/decoder/decodframe.c
vp9/common/vp9_convolve.c
vp9/encoder/vp9_encodeframe.c
vp9/encoder/vp9_rdopt.c
vp9/vp9_cx_iface.c

index 51eeb02..0050c11 100644 (file)
@@ -1026,7 +1026,7 @@ int vp8_decode_frame(VP8D_COMP *pbi)
         const unsigned char *clear = data;
         if (pbi->decrypt_cb)
         {
-            int n = data_end - data;
+            int n = (int)(data_end - data);
             if (n > 10) n = 10;
             pbi->decrypt_cb(pbi->decrypt_state, data, clear_buffer, n);
             clear = clear_buffer;
index 94231a1..abedf6b 100644 (file)
@@ -35,7 +35,7 @@ static void convolve_horiz_c(const uint8_t *src, ptrdiff_t src_stride,
 
   for (y = 0; y < h; ++y) {
     /* Initial phase offset */
-    int x_q4 = (filter_x0 - filter_x_base) / taps;
+    int x_q4 = (int)(filter_x0 - filter_x_base) / taps;
 
     for (x = 0; x < w; ++x) {
       /* Per-pixel src offset */
@@ -76,7 +76,7 @@ static void convolve_avg_horiz_c(const uint8_t *src, ptrdiff_t src_stride,
 
   for (y = 0; y < h; ++y) {
     /* Initial phase offset */
-    int x_q4 = (filter_x0 - filter_x_base) / taps;
+    int x_q4 = (int)(filter_x0 - filter_x_base) / taps;
 
     for (x = 0; x < w; ++x) {
       /* Per-pixel src offset */
@@ -118,7 +118,7 @@ static void convolve_vert_c(const uint8_t *src, ptrdiff_t src_stride,
 
   for (x = 0; x < w; ++x) {
     /* Initial phase offset */
-    int y_q4 = (filter_y0 - filter_y_base) / taps;
+    int y_q4 = (int)(filter_y0 - filter_y_base) / taps;
 
     for (y = 0; y < h; ++y) {
       /* Per-pixel src offset */
@@ -160,7 +160,7 @@ static void convolve_avg_vert_c(const uint8_t *src, ptrdiff_t src_stride,
 
   for (x = 0; x < w; ++x) {
     /* Initial phase offset */
-    int y_q4 = (filter_y0 - filter_y_base) / taps;
+    int y_q4 = (int)(filter_y0 - filter_y_base) / taps;
 
     for (y = 0; y < h; ++y) {
       /* Per-pixel src offset */
index 44ab02d..3b92a39 100644 (file)
@@ -936,7 +936,7 @@ static void copy_partitioning(VP9_COMP *cpi, MODE_INFO **mi_8x8,
     for (block_col = 0; block_col < 8; ++block_col) {
       MODE_INFO * prev_mi = prev_mi_8x8[block_row * mis + block_col];
       BLOCK_SIZE sb_type = prev_mi ? prev_mi->mbmi.sb_type : 0;
-      int offset;
+      ptrdiff_t offset;
 
       if (prev_mi) {
         offset = prev_mi - cm->prev_mi;
@@ -1044,9 +1044,9 @@ static void fill_variance(var *v, int64_t s2, int64_t s, int c) {
   v->sum_error = s;
   v->count = c;
   if (c > 0)
-    v->variance = 256
+    v->variance = (int)(256
         * (v->sum_square_error - v->sum_error * v->sum_error / v->count)
-        / v->count;
+        / v->count);
   else
     v->variance = 0;
 }
index df00334..4b25fcb 100644 (file)
@@ -369,8 +369,8 @@ static void model_rd_from_var_lapndz(int var, int n, int qstep,
     double s2 = (double) var / n;
     double x = qstep / sqrt(s2);
     model_rd_norm(x, &R, &D);
-    *rate = ((n << 8) * R + 0.5);
-    *dist = (var * D + 0.5);
+    *rate = (int)((n << 8) * R + 0.5);
+    *dist = (int)(var * D + 0.5);
   }
   vp9_clear_system_state();
 }
@@ -397,7 +397,7 @@ static void model_rd_for_sb(VP9_COMP *cpi, BLOCK_SIZE bsize,
                              pd->dequant[1] >> 3, &rate, &dist);
 
     rate_sum += rate;
-    dist_sum += dist;
+    dist_sum += (int)dist;
   }
 
   *out_rate_sum = rate_sum;
@@ -868,8 +868,8 @@ static void choose_txfm_size_from_modelrd(VP9_COMP *cpi, MACROBLOCK *x,
     }
   }
   for (n = TX_4X4; n <= max_txfm_size; n++) {
-    rd[n][0] = (scale_rd[n] * rd[n][0]);
-    rd[n][1] = (scale_rd[n] * rd[n][1]);
+    rd[n][0] = (int64_t)(scale_rd[n] * rd[n][0]);
+    rd[n][1] = (int64_t)(scale_rd[n] * rd[n][1]);
   }
 
   if (max_txfm_size == TX_32X32 &&
@@ -2904,7 +2904,7 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
       unsigned int thresh_ac;
       // The encode_breakout input
       unsigned int encode_breakout = x->encode_breakout << 4;
-      int max_thresh = 36000;
+      unsigned int max_thresh = 36000;
 
       // Use extreme low threshold for static frames to limit skipping.
       if (cpi->enable_encode_breakout == 2)
@@ -3251,7 +3251,7 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
             assert(!"Invalid Reference frame");
         }
       }
-      if (cpi->mode_skip_mask & (1 << mode_index))
+      if (cpi->mode_skip_mask & ((int64_t)1 << mode_index))
         continue;
     }
 
@@ -3448,7 +3448,7 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
       // Disable intra modes other than DC_PRED for blocks with low variance
       // Threshold for intra skipping based on source variance
       // TODO(debargha): Specialize the threshold for super block sizes
-      static const int skip_intra_var_thresh[BLOCK_SIZES] = {
+      static const unsigned int skip_intra_var_thresh[BLOCK_SIZES] = {
         64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
       };
       if ((cpi->sf.mode_search_skip_flags & FLAG_SKIP_INTRA_LOWVAR) &&
index 48866d2..28d8f36 100644 (file)
@@ -589,7 +589,8 @@ static void pick_quickcompress_mode(vpx_codec_alg_priv_t  *ctx,
 
 static int write_superframe_index(vpx_codec_alg_priv_t *ctx) {
   uint8_t marker = 0xc0;
-  int mag, mask, index_sz;
+  unsigned int mask;
+  int mag, index_sz;
 
   assert(ctx->pending_frame_count);
   assert(ctx->pending_frame_count <= 8);