ref: 85fd8bdb01674e5eebe91cef2a944e71b3738031
parent: c437bbcde0ca07fc406d52e05240e458be474604
parent: a783da80e7929d4de5180336a4a620767555d9a0
author: Yaowu Xu <[email protected]>
date: Tue Sep 17 13:10:58 EDT 2013
Merge "Silence a bunch of MSVC warnings"
--- a/vp8/decoder/decodframe.c
+++ b/vp8/decoder/decodframe.c
@@ -1026,7 +1026,7 @@
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;
--- a/vp9/common/vp9_convolve.c
+++ b/vp9/common/vp9_convolve.c
@@ -35,7 +35,7 @@
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 @@
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 @@
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 @@
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 */
--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -936,7 +936,7 @@
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 @@
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;
}
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -369,8 +369,8 @@
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 @@
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 @@
}
}
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 &&
@@ -2906,7 +2906,7 @@
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)
@@ -3253,7 +3253,7 @@
assert(!"Invalid Reference frame");
}
}
- if (cpi->mode_skip_mask & (1 << mode_index))
+ if (cpi->mode_skip_mask & ((int64_t)1 << mode_index))
continue;
}
@@ -3450,7 +3450,7 @@
// 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) &&
--- a/vp9/vp9_cx_iface.c
+++ b/vp9/vp9_cx_iface.c
@@ -589,7 +589,8 @@
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);