Commit d71ba038 authored by Yaowu Xu's avatar Yaowu Xu
Browse files

silent compiling warnings for VC9 build

Change-Id: Iaa947e640f27e6f6eaf7d845f243536bca2df513
parent 2b59e14a
...@@ -24,7 +24,7 @@ void Ebml_WriteLen(EbmlGlobal *glob, int64_t val) ...@@ -24,7 +24,7 @@ void Ebml_WriteLen(EbmlGlobal *glob, int64_t val)
unsigned char size = 8; /* size in bytes to output */ unsigned char size = 8; /* size in bytes to output */
/* mask to compare for byte size */ /* mask to compare for byte size */
uint64_t minVal = 0xff; int64_t minVal = 0xff;
for (size = 1; size < 8; size ++) for (size = 1; size < 8; size ++)
{ {
...@@ -47,7 +47,7 @@ void Ebml_WriteString(EbmlGlobal *glob, const char *str) ...@@ -47,7 +47,7 @@ void Ebml_WriteString(EbmlGlobal *glob, const char *str)
/* TODO: it's not clear from the spec whether the nul terminator /* TODO: it's not clear from the spec whether the nul terminator
* should be serialized too. For now we omit the null terminator. * should be serialized too. For now we omit the null terminator.
*/ */
Ebml_Write(glob, str, size); Ebml_Write(glob, str, (unsigned long)size);
} }
void Ebml_WriteUTF8(EbmlGlobal *glob, const wchar_t *wstr) void Ebml_WriteUTF8(EbmlGlobal *glob, const wchar_t *wstr)
...@@ -60,7 +60,7 @@ void Ebml_WriteUTF8(EbmlGlobal *glob, const wchar_t *wstr) ...@@ -60,7 +60,7 @@ void Ebml_WriteUTF8(EbmlGlobal *glob, const wchar_t *wstr)
const uint64_t size = strlen; const uint64_t size = strlen;
Ebml_WriteLen(glob, size); Ebml_WriteLen(glob, size);
Ebml_Write(glob, wstr, size); Ebml_Write(glob, wstr, (unsigned long)size);
} }
void Ebml_WriteID(EbmlGlobal *glob, unsigned long class_id) void Ebml_WriteID(EbmlGlobal *glob, unsigned long class_id)
......
...@@ -1272,7 +1272,7 @@ ne_read_block(nestegg * ctx, uint64_t block_id, uint64_t block_size, nestegg_pac ...@@ -1272,7 +1272,7 @@ ne_read_block(nestegg * ctx, uint64_t block_id, uint64_t block_size, nestegg_pac
if (total > block_size) if (total > block_size)
return -1; return -1;
entry = ne_find_track_entry(ctx, track - 1); entry = ne_find_track_entry(ctx, (unsigned int)(track - 1));
if (!entry) if (!entry)
return -1; return -1;
...@@ -1291,7 +1291,7 @@ ne_read_block(nestegg * ctx, uint64_t block_id, uint64_t block_size, nestegg_pac ...@@ -1291,7 +1291,7 @@ ne_read_block(nestegg * ctx, uint64_t block_id, uint64_t block_size, nestegg_pac
pkt = ne_alloc(sizeof(*pkt)); pkt = ne_alloc(sizeof(*pkt));
pkt->track = track - 1; pkt->track = track - 1;
pkt->timecode = abs_timecode * tc_scale * track_scale; pkt->timecode = (uint64_t)(abs_timecode * tc_scale * track_scale);
ctx->log(ctx, NESTEGG_LOG_DEBUG, "%sblock t %lld pts %f f %llx frames: %llu", ctx->log(ctx, NESTEGG_LOG_DEBUG, "%sblock t %lld pts %f f %llx frames: %llu",
block_id == ID_BLOCK ? "" : "simple", pkt->track, pkt->timecode / 1e9, flags, frames); block_id == ID_BLOCK ? "" : "simple", pkt->track, pkt->timecode / 1e9, flags, frames);
...@@ -1774,35 +1774,35 @@ nestegg_track_video_params(nestegg * ctx, unsigned int track, ...@@ -1774,35 +1774,35 @@ nestegg_track_video_params(nestegg * ctx, unsigned int track,
if (ne_get_uint(entry->video.pixel_width, &value) != 0) if (ne_get_uint(entry->video.pixel_width, &value) != 0)
return -1; return -1;
params->width = value; params->width = (unsigned int)value;
if (ne_get_uint(entry->video.pixel_height, &value) != 0) if (ne_get_uint(entry->video.pixel_height, &value) != 0)
return -1; return -1;
params->height = value; params->height = (unsigned int)value;
value = 0; value = 0;
ne_get_uint(entry->video.pixel_crop_bottom, &value); ne_get_uint(entry->video.pixel_crop_bottom, &value);
params->crop_bottom = value; params->crop_bottom = (unsigned int)value;
value = 0; value = 0;
ne_get_uint(entry->video.pixel_crop_top, &value); ne_get_uint(entry->video.pixel_crop_top, &value);
params->crop_top = value; params->crop_top = (unsigned int)value;
value = 0; value = 0;
ne_get_uint(entry->video.pixel_crop_left, &value); ne_get_uint(entry->video.pixel_crop_left, &value);
params->crop_left = value; params->crop_left = (unsigned int)value;
value = 0; value = 0;
ne_get_uint(entry->video.pixel_crop_right, &value); ne_get_uint(entry->video.pixel_crop_right, &value);
params->crop_right = value; params->crop_right = (unsigned int)value;
value = params->width; value = params->width;
ne_get_uint(entry->video.display_width, &value); ne_get_uint(entry->video.display_width, &value);
params->display_width = value; params->display_width = (unsigned int)value;
value = params->height; value = params->height;
ne_get_uint(entry->video.display_height, &value); ne_get_uint(entry->video.display_height, &value);
params->display_height = value; params->display_height = (unsigned int)value;
return 0; return 0;
} }
...@@ -1828,11 +1828,11 @@ nestegg_track_audio_params(nestegg * ctx, unsigned int track, ...@@ -1828,11 +1828,11 @@ nestegg_track_audio_params(nestegg * ctx, unsigned int track,
value = 1; value = 1;
ne_get_uint(entry->audio.channels, &value); ne_get_uint(entry->audio.channels, &value);
params->channels = value; params->channels = (unsigned int)value;
value = 16; value = 16;
ne_get_uint(entry->audio.bit_depth, &value); ne_get_uint(entry->audio.bit_depth, &value);
params->depth = value; params->depth = (unsigned int)value;
return 0; return 0;
} }
...@@ -1888,7 +1888,7 @@ nestegg_free_packet(nestegg_packet * pkt) ...@@ -1888,7 +1888,7 @@ nestegg_free_packet(nestegg_packet * pkt)
int int
nestegg_packet_track(nestegg_packet * pkt, unsigned int * track) nestegg_packet_track(nestegg_packet * pkt, unsigned int * track)
{ {
*track = pkt->track; *track = (unsigned int)pkt->track;
return 0; return 0;
} }
......
...@@ -55,7 +55,7 @@ void vp8dx_bool_decoder_fill(BOOL_DECODER *br); ...@@ -55,7 +55,7 @@ void vp8dx_bool_decoder_fill(BOOL_DECODER *br);
int loop_end, x; \ int loop_end, x; \
size_t bits_left = ((_bufend)-(_bufptr))*CHAR_BIT; \ size_t bits_left = ((_bufend)-(_bufptr))*CHAR_BIT; \
\ \
x = shift + CHAR_BIT - bits_left; \ x = (int)(shift + CHAR_BIT - bits_left); \
loop_end = 0; \ loop_end = 0; \
if(x >= 0) \ if(x >= 0) \
{ \ { \
......
...@@ -509,13 +509,13 @@ static unsigned int read_available_partition_size( ...@@ -509,13 +509,13 @@ static unsigned int read_available_partition_size(
if (read_is_valid(partition_size_ptr, 3, first_fragment_end)) if (read_is_valid(partition_size_ptr, 3, first_fragment_end))
partition_size = read_partition_size(partition_size_ptr); partition_size = read_partition_size(partition_size_ptr);
else if (pbi->ec_active) else if (pbi->ec_active)
partition_size = bytes_left; partition_size = (unsigned int)bytes_left;
else else
vpx_internal_error(&pc->error, VPX_CODEC_CORRUPT_FRAME, vpx_internal_error(&pc->error, VPX_CODEC_CORRUPT_FRAME,
"Truncated partition size data"); "Truncated partition size data");
} }
else else
partition_size = bytes_left; partition_size = (unsigned int)bytes_left;
/* Validate the calculated partition length. If the buffer /* Validate the calculated partition length. If the buffer
* described by the partition can't be fully read, then restrict * described by the partition can't be fully read, then restrict
...@@ -524,7 +524,7 @@ static unsigned int read_available_partition_size( ...@@ -524,7 +524,7 @@ static unsigned int read_available_partition_size(
if (!read_is_valid(fragment_start, partition_size, fragment_end)) if (!read_is_valid(fragment_start, partition_size, fragment_end))
{ {
if (pbi->ec_active) if (pbi->ec_active)
partition_size = bytes_left; partition_size = (unsigned int)bytes_left;
else else
vpx_internal_error(&pc->error, VPX_CODEC_CORRUPT_FRAME, vpx_internal_error(&pc->error, VPX_CODEC_CORRUPT_FRAME,
"Truncated packet or corrupt partition " "Truncated packet or corrupt partition "
...@@ -570,10 +570,10 @@ static void setup_token_decoder(VP8D_COMP *pbi, ...@@ -570,10 +570,10 @@ static void setup_token_decoder(VP8D_COMP *pbi,
/* Size of first partition + token partition sizes element */ /* Size of first partition + token partition sizes element */
ptrdiff_t ext_first_part_size = token_part_sizes - ptrdiff_t ext_first_part_size = token_part_sizes -
pbi->fragments[0] + 3 * (num_token_partitions - 1); pbi->fragments[0] + 3 * (num_token_partitions - 1);
fragment_size -= ext_first_part_size; fragment_size -= (unsigned int)ext_first_part_size;
if (fragment_size > 0) if (fragment_size > 0)
{ {
pbi->fragment_sizes[0] = ext_first_part_size; pbi->fragment_sizes[0] = (unsigned int)ext_first_part_size;
/* The fragment contains an additional partition. Move to /* The fragment contains an additional partition. Move to
* next. */ * next. */
fragment_idx++; fragment_idx++;
...@@ -592,8 +592,8 @@ static void setup_token_decoder(VP8D_COMP *pbi, ...@@ -592,8 +592,8 @@ static void setup_token_decoder(VP8D_COMP *pbi,
fragment_end, fragment_end,
fragment_idx - 1, fragment_idx - 1,
num_token_partitions); num_token_partitions);
pbi->fragment_sizes[fragment_idx] = partition_size; pbi->fragment_sizes[fragment_idx] = (unsigned int)partition_size;
fragment_size -= partition_size; fragment_size -= (unsigned int)partition_size;
assert(fragment_idx <= num_token_partitions); assert(fragment_idx <= num_token_partitions);
if (fragment_size > 0) if (fragment_size > 0)
{ {
...@@ -859,7 +859,7 @@ int vp8_decode_frame(VP8D_COMP *pbi) ...@@ -859,7 +859,7 @@ int vp8_decode_frame(VP8D_COMP *pbi)
init_frame(pbi); init_frame(pbi);
if (vp8dx_start_decode(bc, data, data_end - data)) if (vp8dx_start_decode(bc, data, (unsigned int)(data_end - data)))
vpx_internal_error(&pc->error, VPX_CODEC_MEM_ERROR, vpx_internal_error(&pc->error, VPX_CODEC_MEM_ERROR,
"Failed to allocate bool decoder 0"); "Failed to allocate bool decoder 0");
if (pc->frame_type == KEY_FRAME) { if (pc->frame_type == KEY_FRAME) {
......
...@@ -397,7 +397,7 @@ static void pack_tokens_into_partitions_c(VP8_COMP *cpi, unsigned char *cx_data, ...@@ -397,7 +397,7 @@ static void pack_tokens_into_partitions_c(VP8_COMP *cpi, unsigned char *cx_data,
{ {
const TOKENEXTRA *p = cpi->tplist[mb_row].start; const TOKENEXTRA *p = cpi->tplist[mb_row].start;
const TOKENEXTRA *stop = cpi->tplist[mb_row].stop; const TOKENEXTRA *stop = cpi->tplist[mb_row].stop;
int tokens = stop - p; int tokens = (int)(stop - p);
vp8_pack_tokens_c(w, p, tokens); vp8_pack_tokens_c(w, p, tokens);
} }
...@@ -416,7 +416,7 @@ static void pack_mb_row_tokens_c(VP8_COMP *cpi, vp8_writer *w) ...@@ -416,7 +416,7 @@ static void pack_mb_row_tokens_c(VP8_COMP *cpi, vp8_writer *w)
{ {
const TOKENEXTRA *p = cpi->tplist[mb_row].start; const TOKENEXTRA *p = cpi->tplist[mb_row].start;
const TOKENEXTRA *stop = cpi->tplist[mb_row].stop; const TOKENEXTRA *stop = cpi->tplist[mb_row].stop;
int tokens = stop - p; int tokens = (int)(stop - p);
vp8_pack_tokens_c(w, p, tokens); vp8_pack_tokens_c(w, p, tokens);
} }
......
...@@ -256,8 +256,9 @@ void vp8_denoiser_denoise_mb(VP8_DENOISER *denoiser, ...@@ -256,8 +256,9 @@ void vp8_denoiser_denoise_mb(VP8_DENOISER *denoiser,
mv_row = x->best_sse_mv.as_mv.row; mv_row = x->best_sse_mv.as_mv.row;
if (frame == INTRA_FRAME || if (frame == INTRA_FRAME ||
(mv_row *mv_row + mv_col *mv_col <= NOISE_MOTION_THRESHOLD && ((unsigned int)(mv_row *mv_row + mv_col *mv_col)
sse_diff < SSE_DIFF_THRESHOLD)) <= NOISE_MOTION_THRESHOLD &&
sse_diff < (int)SSE_DIFF_THRESHOLD))
{ {
/* /*
* Handle intra blocks as referring to last frame with zero motion * Handle intra blocks as referring to last frame with zero motion
......
...@@ -823,7 +823,8 @@ void vp8_encode_frame(VP8_COMP *cpi) ...@@ -823,7 +823,8 @@ void vp8_encode_frame(VP8_COMP *cpi)
for (mb_row = 0; mb_row < cm->mb_rows; mb_row ++) for (mb_row = 0; mb_row < cm->mb_rows; mb_row ++)
{ {
cpi->tok_count += cpi->tplist[mb_row].stop - cpi->tplist[mb_row].start; cpi->tok_count += (unsigned int)
(cpi->tplist[mb_row].stop - cpi->tplist[mb_row].start);
} }
if (xd->segmentation_enabled) if (xd->segmentation_enabled)
...@@ -867,7 +868,7 @@ void vp8_encode_frame(VP8_COMP *cpi) ...@@ -867,7 +868,7 @@ void vp8_encode_frame(VP8_COMP *cpi)
x->src.v_buffer += 8 * x->src.uv_stride - 8 * cm->mb_cols; x->src.v_buffer += 8 * x->src.uv_stride - 8 * cm->mb_cols;
} }
cpi->tok_count = tp - cpi->tok; cpi->tok_count = (unsigned int)(tp - cpi->tok);
} }
#if CONFIG_REALTIME_ONLY & CONFIG_ONTHEFLY_BITPACKING #if CONFIG_REALTIME_ONLY & CONFIG_ONTHEFLY_BITPACKING
......
...@@ -798,8 +798,8 @@ skip_motion_search: ...@@ -798,8 +798,8 @@ skip_motion_search:
FIRSTPASS_STATS fps; FIRSTPASS_STATS fps;
fps.frame = cm->current_video_frame ; fps.frame = cm->current_video_frame ;
fps.intra_error = intra_error >> 8; fps.intra_error = (double)(intra_error >> 8);
fps.coded_error = coded_error >> 8; fps.coded_error = (double)(coded_error >> 8);
weight = simple_weight(cpi->Source); weight = simple_weight(cpi->Source);
...@@ -841,8 +841,8 @@ skip_motion_search: ...@@ -841,8 +841,8 @@ skip_motion_search:
/* TODO: handle the case when duration is set to 0, or something less /* TODO: handle the case when duration is set to 0, or something less
* than the full time between subsequent cpi->source_time_stamps * than the full time between subsequent cpi->source_time_stamps
*/ */
fps.duration = cpi->source->ts_end fps.duration = (double)(cpi->source->ts_end
- cpi->source->ts_start; - cpi->source->ts_start);
/* don't want to do output stats with a stack variable! */ /* don't want to do output stats with a stack variable! */
memcpy(&cpi->twopass.this_frame_stats, memcpy(&cpi->twopass.this_frame_stats,
...@@ -1030,7 +1030,8 @@ static int estimate_max_q(VP8_COMP *cpi, ...@@ -1030,7 +1030,8 @@ static int estimate_max_q(VP8_COMP *cpi,
/* Estimate of overhead bits per mb */ /* Estimate of overhead bits per mb */
/* Correction to overhead bits for min allowed Q. */ /* Correction to overhead bits for min allowed Q. */
overhead_bits_per_mb = overhead_bits / num_mbs; overhead_bits_per_mb = overhead_bits / num_mbs;
overhead_bits_per_mb *= pow( 0.98, (double)cpi->twopass.maxq_min_limit ); overhead_bits_per_mb = (int)(overhead_bits_per_mb *
pow( 0.98, (double)cpi->twopass.maxq_min_limit ));
/* Try and pick a max Q that will be high enough to encode the /* Try and pick a max Q that will be high enough to encode the
* content at the given rate. * content at the given rate.
...@@ -1073,7 +1074,7 @@ static int estimate_max_q(VP8_COMP *cpi, ...@@ -1073,7 +1074,7 @@ static int estimate_max_q(VP8_COMP *cpi,
* Give average a chance to settle though. * Give average a chance to settle though.
*/ */
if ( (cpi->ni_frames > if ( (cpi->ni_frames >
((unsigned int)cpi->twopass.total_stats.count >> 8)) && ((int)cpi->twopass.total_stats.count >> 8)) &&
(cpi->ni_frames > 150) ) (cpi->ni_frames > 150) )
{ {
cpi->twopass.maxq_max_limit = ((cpi->ni_av_qi + 32) < cpi->worst_quality) cpi->twopass.maxq_max_limit = ((cpi->ni_av_qi + 32) < cpi->worst_quality)
...@@ -1880,7 +1881,7 @@ static void define_gf_group(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame) ...@@ -1880,7 +1881,7 @@ static void define_gf_group(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame)
/* For cbr apply buffer related limits */ /* For cbr apply buffer related limits */
if (cpi->drop_frames_allowed) if (cpi->drop_frames_allowed)
{ {
int df_buffer_level = cpi->oxcf.drop_frames_water_mark * int64_t df_buffer_level = cpi->oxcf.drop_frames_water_mark *
(cpi->oxcf.optimal_buffer_level / 100); (cpi->oxcf.optimal_buffer_level / 100);
if (cpi->buffer_level > df_buffer_level) if (cpi->buffer_level > df_buffer_level)
...@@ -2043,8 +2044,8 @@ static void define_gf_group(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame) ...@@ -2043,8 +2044,8 @@ static void define_gf_group(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame)
* so it now points at the ARF frame. * so it now points at the ARF frame.
*/ */
half_gf_int = cpi->baseline_gf_interval >> 1; half_gf_int = cpi->baseline_gf_interval >> 1;
frames_after_arf = cpi->twopass.total_stats.count - frames_after_arf = (int)(cpi->twopass.total_stats.count -
this_frame->frame - 1; this_frame->frame - 1);
switch (cpi->oxcf.arnr_type) switch (cpi->oxcf.arnr_type)
{ {
...@@ -2120,11 +2121,11 @@ static void define_gf_group(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame) ...@@ -2120,11 +2121,11 @@ static void define_gf_group(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame)
else else
cpi->twopass.gf_group_bits = 0; cpi->twopass.gf_group_bits = 0;
cpi->twopass.gf_group_bits = cpi->twopass.gf_group_bits = (int)(
(cpi->twopass.gf_group_bits < 0) (cpi->twopass.gf_group_bits < 0)
? 0 ? 0
: (cpi->twopass.gf_group_bits > cpi->twopass.kf_group_bits) : (cpi->twopass.gf_group_bits > cpi->twopass.kf_group_bits)
? cpi->twopass.kf_group_bits : cpi->twopass.gf_group_bits; ? cpi->twopass.kf_group_bits : cpi->twopass.gf_group_bits);
/* Clip cpi->twopass.gf_group_bits based on user supplied data rate /* Clip cpi->twopass.gf_group_bits based on user supplied data rate
* variability limit (cpi->oxcf.two_pass_vbrmax_section) * variability limit (cpi->oxcf.two_pass_vbrmax_section)
...@@ -2236,8 +2237,8 @@ static void define_gf_group(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame) ...@@ -2236,8 +2237,8 @@ static void define_gf_group(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame)
/* Apply an additional limit for CBR */ /* Apply an additional limit for CBR */
if (cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) if (cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER)
{ {
if (cpi->twopass.gf_bits > (cpi->buffer_level >> 1)) if (cpi->twopass.gf_bits > (int)(cpi->buffer_level >> 1))
cpi->twopass.gf_bits = cpi->buffer_level >> 1; cpi->twopass.gf_bits = (int)(cpi->buffer_level >> 1);
} }
/* Dont allow a negative value for gf_bits */ /* Dont allow a negative value for gf_bits */
...@@ -2260,7 +2261,7 @@ static void define_gf_group(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame) ...@@ -2260,7 +2261,7 @@ static void define_gf_group(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame)
{ {
/* Adjust KF group bits and error remainin */ /* Adjust KF group bits and error remainin */
cpi->twopass.kf_group_error_left -= gf_group_err; cpi->twopass.kf_group_error_left -= (int64_t)gf_group_err;
cpi->twopass.kf_group_bits -= cpi->twopass.gf_group_bits; cpi->twopass.kf_group_bits -= cpi->twopass.gf_group_bits;
if (cpi->twopass.kf_group_bits < 0) if (cpi->twopass.kf_group_bits < 0)
...@@ -2272,9 +2273,10 @@ static void define_gf_group(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame) ...@@ -2272,9 +2273,10 @@ static void define_gf_group(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame)
* already happened) * already happened)
*/ */
if (!cpi->source_alt_ref_pending && cpi->common.frame_type != KEY_FRAME) if (!cpi->source_alt_ref_pending && cpi->common.frame_type != KEY_FRAME)
cpi->twopass.gf_group_error_left = gf_group_err - gf_first_frame_err; cpi->twopass.gf_group_error_left = (int)(gf_group_err -
gf_first_frame_err);
else else
cpi->twopass.gf_group_error_left = gf_group_err; cpi->twopass.gf_group_error_left = (int) gf_group_err;
cpi->twopass.gf_group_bits -= cpi->twopass.gf_bits - cpi->min_frame_bandwidth; cpi->twopass.gf_group_bits -= cpi->twopass.gf_bits - cpi->min_frame_bandwidth;
...@@ -2330,9 +2332,9 @@ static void define_gf_group(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame) ...@@ -2330,9 +2332,9 @@ static void define_gf_group(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame)
avg_stats(&sectionstats); avg_stats(&sectionstats);
cpi->twopass.section_intra_rating = cpi->twopass.section_intra_rating = (unsigned int)
sectionstats.intra_error / (sectionstats.intra_error /
DOUBLE_DIVIDE_CHECK(sectionstats.coded_error); DOUBLE_DIVIDE_CHECK(sectionstats.coded_error));
Ratio = sectionstats.intra_error / DOUBLE_DIVIDE_CHECK(sectionstats.coded_error); Ratio = sectionstats.intra_error / DOUBLE_DIVIDE_CHECK(sectionstats.coded_error);
cpi->twopass.section_max_qfactor = 1.0 - ((Ratio - 10.0) * 0.025); cpi->twopass.section_max_qfactor = 1.0 - ((Ratio - 10.0) * 0.025);
...@@ -2381,7 +2383,7 @@ static void assign_std_frame_bits(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame) ...@@ -2381,7 +2383,7 @@ static void assign_std_frame_bits(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame)
} }
/* Adjust error and bits remaining */ /* Adjust error and bits remaining */
cpi->twopass.gf_group_error_left -= modified_err; cpi->twopass.gf_group_error_left -= (int)modified_err;
cpi->twopass.gf_group_bits -= target_frame_size; cpi->twopass.gf_group_bits -= target_frame_size;
if (cpi->twopass.gf_group_bits < 0) if (cpi->twopass.gf_group_bits < 0)
...@@ -2443,8 +2445,9 @@ void vp8_second_pass(VP8_COMP *cpi) ...@@ -2443,8 +2445,9 @@ void vp8_second_pass(VP8_COMP *cpi)
*/ */
if (cpi->oxcf.error_resilient_mode) if (cpi->oxcf.error_resilient_mode)
{ {
cpi->twopass.gf_group_bits = cpi->twopass.kf_group_bits; cpi->twopass.gf_group_bits = (int)cpi->twopass.kf_group_bits;
cpi->twopass.gf_group_error_left = cpi->twopass.kf_group_error_left; cpi->twopass.gf_group_error_left =
(int)cpi->twopass.kf_group_error_left;
cpi->baseline_gf_interval = cpi->twopass.frames_to_key; cpi->baseline_gf_interval = cpi->twopass.frames_to_key;
cpi->frames_till_gf_update_due = cpi->baseline_gf_interval; cpi->frames_till_gf_update_due = cpi->baseline_gf_interval;
cpi->source_alt_ref_pending = 0; cpi->source_alt_ref_pending = 0;
...@@ -2508,25 +2511,26 @@ void vp8_second_pass(VP8_COMP *cpi) ...@@ -2508,25 +2511,26 @@ void vp8_second_pass(VP8_COMP *cpi)
} }
/* Keep a globally available copy of this and the next frame's iiratio. */ /* Keep a globally available copy of this and the next frame's iiratio. */
cpi->twopass.this_iiratio = this_frame_intra_error / cpi->twopass.this_iiratio = (unsigned int)(this_frame_intra_error /
DOUBLE_DIVIDE_CHECK(this_frame_coded_error); DOUBLE_DIVIDE_CHECK(this_frame_coded_error));
{ {
FIRSTPASS_STATS next_frame; FIRSTPASS_STATS next_frame;
if ( lookup_next_frame_stats(cpi, &next_frame) != EOF ) if ( lookup_next_frame_stats(cpi, &next_frame) != EOF )
{ {
cpi->twopass.next_iiratio = next_frame.intra_error / cpi->twopass.next_iiratio = (unsigned int)(next_frame.intra_error /
DOUBLE_DIVIDE_CHECK(next_frame.coded_error); DOUBLE_DIVIDE_CHECK(next_frame.coded_error));
} }
} }
/* Set nominal per second bandwidth for this frame */ /* Set nominal per second bandwidth for this frame */
cpi->target_bandwidth = cpi->per_frame_bandwidth * cpi->output_frame_rate; cpi->target_bandwidth = (int)
(cpi->per_frame_bandwidth * cpi->output_frame_rate);
if (cpi->target_bandwidth < 0) if (cpi->target_bandwidth < 0)
cpi->target_bandwidth = 0; cpi->target_bandwidth = 0;
/* Account for mv, mode and other overheads. */ /* Account for mv, mode and other overheads. */
overhead_bits = estimate_modemvcost( overhead_bits = (int)estimate_modemvcost(
cpi, &cpi->twopass.total_left_stats ); cpi, &cpi->twopass.total_left_stats );
/* Special case code for first frame. */ /* Special case code for first frame. */
...@@ -2899,15 +2903,15 @@ static void find_next_key_frame(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame) ...@@ -2899,15 +2903,15 @@ static void find_next_key_frame(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame)
/* Additional special case for CBR if buffer is getting full. */ /* Additional special case for CBR if buffer is getting full. */
if (cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) if (cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER)
{ {
int opt_buffer_lvl = cpi->oxcf.optimal_buffer_level; int64_t opt_buffer_lvl = cpi->oxcf.optimal_buffer_level;
int buffer_lvl = cpi->buffer_level; int64_t buffer_lvl = cpi->buffer_level;
/* If the buffer is near or above the optimal and this kf group is /* If the buffer is near or above the optimal and this kf group is
* not being allocated much then increase the allocation a bit. * not being allocated much then increase the allocation a bit.
*/ */