diff options
-rw-r--r-- | vp9/encoder/vp9_firstpass.c | 70 | ||||
-rw-r--r-- | vp9/encoder/vp9_onyx_if.c | 64 | ||||
-rw-r--r-- | vp9/encoder/vp9_quantize.c | 4 | ||||
-rw-r--r-- | vp9/encoder/vp9_tokenize.c | 3 | ||||
-rw-r--r-- | vp9/vp9_cx_iface.c | 6 | ||||
-rw-r--r-- | vp9/vp9_dx_iface.c | 4 | ||||
-rw-r--r-- | vpxdec.c | 7 |
7 files changed, 82 insertions, 76 deletions
diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c index 556197cd4..c2aac3ecf 100644 --- a/vp9/encoder/vp9_firstpass.c +++ b/vp9/encoder/vp9_firstpass.c @@ -65,7 +65,7 @@ static int select_cq_level(int qindex) { double target_q = (vp9_convert_qindex_to_q(qindex) * 0.5847) + 1.0; - for (i = 0; i < QINDEX_RANGE; i++) { + for (i = 0; i < QINDEX_RANGE; ++i) { if (target_q <= vp9_convert_qindex_to_q(i)) { ret_val = i; break; @@ -399,7 +399,7 @@ static void first_pass_motion_search(VP9_COMP *cpi, MACROBLOCK *x, // Refine the motion search range according to the frame dimension // for first pass test. while ((quart_frm << sr) < MAX_FULL_PEL_VAL) - sr++; + ++sr; step_param += sr; further_steps -= sr; @@ -427,10 +427,10 @@ static void first_pass_motion_search(VP9_COMP *cpi, MACROBLOCK *x, num00 = 0; while (n < further_steps) { - n++; + ++n; if (num00) { - num00--; + --num00; } else { tmp_err = cpi->diamond_search_sad(x, &ref_mv_full, &tmp_mv, step_param + n, x->sadperbit16, @@ -522,7 +522,7 @@ void vp9_first_pass(VP9_COMP *cpi) { // Tiling is ignored in the first pass. vp9_tile_init(&tile, cm, 0, 0); - for (mb_row = 0; mb_row < cm->mb_rows; mb_row++) { + for (mb_row = 0; mb_row < cm->mb_rows; ++mb_row) { int_mv best_ref_mv; best_ref_mv.as_int = 0; @@ -538,7 +538,7 @@ void vp9_first_pass(VP9_COMP *cpi) { x->mv_row_max = ((cm->mb_rows - 1 - mb_row) * 16) + BORDER_MV_PIXELS_B16; - for (mb_col = 0; mb_col < cm->mb_cols; mb_col++) { + for (mb_col = 0; mb_col < cm->mb_cols; ++mb_col) { int this_error; const int use_dc_pred = (mb_col || mb_row) && (!mb_col || !mb_row); double error_weight = 1.0; @@ -638,7 +638,7 @@ void vp9_first_pass(VP9_COMP *cpi) { } if (gf_motion_error < motion_error && gf_motion_error < this_error) - second_ref_count++; + ++second_ref_count; // Reset to last frame as reference buffer. xd->plane[0].pre[0].buf = lst_yv12->y_buffer + recon_yoffset; @@ -665,7 +665,7 @@ void vp9_first_pass(VP9_COMP *cpi) { // cropped clips with black bars at the sides or top and bottom. if (((this_error - intrapenalty) * 9 <= motion_error * 10) && this_error < 2 * intrapenalty) - neutral_count++; + ++neutral_count; mv.as_mv.row *= 8; mv.as_mv.col *= 8; @@ -682,42 +682,42 @@ void vp9_first_pass(VP9_COMP *cpi) { sum_mvc_abs += abs(mv.as_mv.col); sum_mvrs += mv.as_mv.row * mv.as_mv.row; sum_mvcs += mv.as_mv.col * mv.as_mv.col; - intercount++; + ++intercount; best_ref_mv.as_int = mv.as_int; if (mv.as_int) { - mvcount++; + ++mvcount; // Non-zero vector, was it different from the last non zero vector? if (mv.as_int != lastmv_as_int) - new_mv_count++; + ++new_mv_count; lastmv_as_int = mv.as_int; // Does the row vector point inwards or outwards? if (mb_row < cm->mb_rows / 2) { if (mv.as_mv.row > 0) - sum_in_vectors--; + --sum_in_vectors; else if (mv.as_mv.row < 0) - sum_in_vectors++; + ++sum_in_vectors; } else if (mb_row > cm->mb_rows / 2) { if (mv.as_mv.row > 0) - sum_in_vectors++; + ++sum_in_vectors; else if (mv.as_mv.row < 0) - sum_in_vectors--; + --sum_in_vectors; } // Does the col vector point inwards or outwards? if (mb_col < cm->mb_cols / 2) { if (mv.as_mv.col > 0) - sum_in_vectors--; + --sum_in_vectors; else if (mv.as_mv.col < 0) - sum_in_vectors++; + ++sum_in_vectors; } else if (mb_col > cm->mb_cols / 2) { if (mv.as_mv.col > 0) - sum_in_vectors++; + ++sum_in_vectors; else if (mv.as_mv.col < 0) - sum_in_vectors--; + --sum_in_vectors; } } } @@ -802,7 +802,7 @@ void vp9_first_pass(VP9_COMP *cpi) { vp8_yv12_copy_frame(lst_yv12, gld_yv12); twopass->sr_update_lag = 1; } else { - twopass->sr_update_lag++; + ++twopass->sr_update_lag; } // Swap frame pointers so last frame refers to the frame we just compressed. swap_yv12(lst_yv12, new_yv12); @@ -830,7 +830,7 @@ void vp9_first_pass(VP9_COMP *cpi) { fclose(recon_file); } - cm->current_video_frame++; + ++cm->current_video_frame; } // Estimate a cost per mb attributable to overheads such as the coding of modes @@ -910,7 +910,7 @@ int vp9_twopass_worst_quality(VP9_COMP *cpi, FIRSTPASS_STATS *fpstats, // Try and pick a max Q that will be high enough to encode the // content at the given rate. - for (q = rc->best_quality; q < rc->worst_quality; q++) { + for (q = rc->best_quality; q < rc->worst_quality; ++q) { const double err_correction_factor = calc_correction_factor(err_per_mb, ERR_DIVISOR, 0.5, 0.90, q); const int bits_per_mb_at_this_q = vp9_rc_bits_per_mb(INTER_FRAME, q, @@ -1045,7 +1045,7 @@ static int detect_transition_to_still(VP9_COMP *cpi, int frame_interval, FIRSTPASS_STATS tmp_next_frame; // Look ahead a few frames to see if static condition persists... - for (j = 0; j < still_interval; j++) { + for (j = 0; j < still_interval; ++j) { if (EOF == input_stats(&cpi->twopass, &tmp_next_frame)) break; @@ -1164,7 +1164,7 @@ static int calc_arf_boost(VP9_COMP *cpi, int offset, int flash_detected = 0; // Search forward from the proposed arf/next gf position. - for (i = 0; i < f_frames; i++) { + for (i = 0; i < f_frames; ++i) { if (read_frame_stats(twopass, &this_frame, (i + offset)) == EOF) break; @@ -1201,7 +1201,7 @@ static int calc_arf_boost(VP9_COMP *cpi, int offset, abs_mv_in_out_accumulator = 0.0; // Search backward towards last gf position. - for (i = -1; i >= -b_frames; i--) { + for (i = -1; i >= -b_frames; --i) { if (read_frame_stats(twopass, &this_frame, (i + offset)) == EOF) break; @@ -1443,7 +1443,7 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) { i = 0; while (i < twopass->static_scene_max_gf_interval && i < rc->frames_to_key) { - i++; + ++i; // Accumulate error score of frames in this gf group. mod_frame_err = calculate_modified_err(cpi, this_frame); @@ -1515,7 +1515,7 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) { // Don't allow a gf too near the next kf. if ((rc->frames_to_key - i) < MIN_GF_INTERVAL) { while (i < (rc->frames_to_key + !rc->next_key_frame_forced)) { - i++; + ++i; if (EOF == input_stats(twopass, this_frame)) break; @@ -1752,7 +1752,7 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) { zero_stats(§ionstats); reset_fpf_position(twopass, start_pos); - for (i = 0; i < rc->baseline_gf_interval; i++) { + for (i = 0; i < rc->baseline_gf_interval; ++i) { input_stats(twopass, &next_frame); accumulate_stats(§ionstats, &next_frame); } @@ -1837,7 +1837,7 @@ static int test_candidate_kf(VP9_COMP *cpi, start_pos = cpi->twopass.stats_in; // Examine how well the key frame predicts subsequent frames. - for (i = 0; i < 16; i++) { + for (i = 0; i < 16; ++i) { double next_iiratio = (IIKFACTOR1 * local_next_frame.intra_error / DOUBLE_DIVIDE_CHECK(local_next_frame.coded_error)); @@ -1956,7 +1956,7 @@ static void find_next_key_frame(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) { // quality since the last GF or KF. recent_loop_decay[i % 8] = loop_decay_rate; decay_accumulator = 1.0; - for (j = 0; j < 8; j++) + for (j = 0; j < 8; ++j) decay_accumulator *= recent_loop_decay[j]; // Special check for transition or high motion followed by a @@ -1966,7 +1966,7 @@ static void find_next_key_frame(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) { break; // Step on to the next frame. - rc->frames_to_key++; + ++rc->frames_to_key; // If we don't have a real key frame within the next two // key_frame_frequency intervals then break out of the loop. @@ -1975,7 +1975,7 @@ static void find_next_key_frame(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) { } else { ++rc->frames_to_key; } - i++; + ++i; } // If there is a max kf interval set by the user we must obey it. @@ -1997,7 +1997,7 @@ static void find_next_key_frame(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) { kf_group_err = 0; // Rescan to get the correct error data for the forced kf group. - for (i = 0; i < rc->frames_to_key; i++) { + for (i = 0; i < rc->frames_to_key; ++i) { // Accumulate kf group errors. kf_group_err += calculate_modified_err(cpi, &tmp_frame); @@ -2046,7 +2046,7 @@ static void find_next_key_frame(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) { boost_score = 0.0; // Scan through the kf group collating various stats. - for (i = 0; i < rc->frames_to_key; i++) { + for (i = 0; i < rc->frames_to_key; ++i) { double r; if (EOF == input_stats(twopass, &next_frame)) @@ -2089,7 +2089,7 @@ static void find_next_key_frame(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) { zero_stats(§ionstats); reset_fpf_position(twopass, start_position); - for (i = 0; i < rc->frames_to_key; i++) { + for (i = 0; i < rc->frames_to_key; ++i) { input_stats(twopass, &next_frame); accumulate_stats(§ionstats, &next_frame); } diff --git a/vp9/encoder/vp9_onyx_if.c b/vp9/encoder/vp9_onyx_if.c index 69372bd59..22076a09b 100644 --- a/vp9/encoder/vp9_onyx_if.c +++ b/vp9/encoder/vp9_onyx_if.c @@ -218,8 +218,8 @@ int vp9_compute_qdelta(const VP9_COMP *cpi, double qstart, double qtarget) { // Computes a q delta (in "q index" terms) to get from a starting q value // to a value that should equate to thegiven rate ratio. -int vp9_compute_qdelta_by_rate(VP9_COMP *cpi, - double base_q_index, double rate_target_ratio) { +static int compute_qdelta_by_rate(VP9_COMP *cpi, int base_q_index, + double rate_target_ratio) { int i; int base_bits_per_mb; int target_bits_per_mb; @@ -233,7 +233,7 @@ int vp9_compute_qdelta_by_rate(VP9_COMP *cpi, base_q_index, 1.0); // Find the target bits per mb based on the base value and given ratio. - target_bits_per_mb = rate_target_ratio * base_bits_per_mb; + target_bits_per_mb = (int)(rate_target_ratio * base_bits_per_mb); // Convert the q target to an index for (i = cpi->rc.best_quality; i < cpi->rc.worst_quality; i++) { @@ -278,9 +278,8 @@ static void setup_in_frame_q_adj(VP9_COMP *cpi) { // Use some of the segments for in frame Q adjustment for (segment = 1; segment < 2; segment++) { - qindex_delta = - vp9_compute_qdelta_by_rate(cpi, cm->base_qindex, - in_frame_q_adj_ratio[segment]); + qindex_delta = compute_qdelta_by_rate(cpi, cm->base_qindex, + in_frame_q_adj_ratio[segment]); vp9_enable_segfeature(seg, segment, SEG_LVL_ALT_Q); vp9_set_segdata(seg, segment, SEG_LVL_ALT_Q, qindex_delta); } @@ -1112,7 +1111,7 @@ int vp9_reverse_trans(int x) { void vp9_new_framerate(VP9_COMP *cpi, double framerate) { VP9_COMMON *const cm = &cpi->common; - int64_t vbr_max_bits; + int vbr_max_bits; if (framerate < 0.1) framerate = 30; @@ -1136,10 +1135,10 @@ void vp9_new_framerate(VP9_COMP *cpi, double framerate) { // be acheived because of a user specificed max q (e.g. when the user // specifies lossless encode. // - vbr_max_bits = ((int64_t)cpi->rc.av_per_frame_bandwidth * - (int64_t)cpi->oxcf.two_pass_vbrmax_section) / 100; + vbr_max_bits = (int)(((int64_t)cpi->rc.av_per_frame_bandwidth * + cpi->oxcf.two_pass_vbrmax_section) / 100); cpi->rc.max_frame_bandwidth = - MAX(MAX((cm->MBs * MAX_MB_RATE), MAXRATE_1080P), vbr_max_bits); + MAX(MAX((cm->MBs * MAX_MB_RATE), MAXRATE_1080P), vbr_max_bits); // Set Maximum gf/arf interval cpi->rc.max_gf_interval = 16; @@ -1160,7 +1159,7 @@ void vp9_new_framerate(VP9_COMP *cpi, double framerate) { cpi->rc.max_gf_interval = cpi->twopass.static_scene_max_gf_interval; } -static int64_t rescale(int val, int64_t num, int denom) { +static int64_t rescale(int64_t val, int64_t num, int denom) { int64_t llnum = num; int64_t llden = denom; int64_t llval = val; @@ -1213,9 +1212,12 @@ static void update_layer_context_change_config(VP9_COMP *const cpi, lc->target_bandwidth = oxcf->ts_target_bitrate[temporal_layer] * 1000; bitrate_alloc = (float)lc->target_bandwidth / (float)target_bandwidth; // Update buffer-related quantities. - lc->starting_buffer_level = oxcf->starting_buffer_level * bitrate_alloc; - lc->optimal_buffer_level = oxcf->optimal_buffer_level * bitrate_alloc; - lc->maximum_buffer_size = oxcf->maximum_buffer_size * bitrate_alloc; + lc->starting_buffer_level = + (int64_t)(oxcf->starting_buffer_level * bitrate_alloc); + lc->optimal_buffer_level = + (int64_t)(oxcf->optimal_buffer_level * bitrate_alloc); + lc->maximum_buffer_size = + (int64_t)(oxcf->maximum_buffer_size * bitrate_alloc); lrc->bits_off_target = MIN(lrc->bits_off_target, lc->maximum_buffer_size); lrc->buffer_level = MIN(lrc->buffer_level, lc->maximum_buffer_size); // Update framerate-related quantities. @@ -1247,8 +1249,8 @@ static void update_layer_framerate(VP9_COMP *const cpi) { int prev_layer_target_bandwidth = oxcf->ts_target_bitrate[temporal_layer - 1] * 1000; lc->avg_frame_size = - (int)(lc->target_bandwidth - prev_layer_target_bandwidth) / - (lc->framerate - prev_layer_framerate); + (int)((lc->target_bandwidth - prev_layer_target_bandwidth) / + (lc->framerate - prev_layer_framerate)); } } @@ -1276,7 +1278,7 @@ static void save_layer_context(VP9_COMP *const cpi) { int temporal_layer = cpi->svc.temporal_layer_id; LAYER_CONTEXT *lc = &cpi->svc.layer_context[temporal_layer]; lc->rc = cpi->rc; - lc->target_bandwidth = cpi->oxcf.target_bandwidth; + lc->target_bandwidth = (int)cpi->oxcf.target_bandwidth; lc->starting_buffer_level = cpi->oxcf.starting_buffer_level; lc->optimal_buffer_level = cpi->oxcf.optimal_buffer_level; lc->maximum_buffer_size = cpi->oxcf.maximum_buffer_size; @@ -1493,7 +1495,7 @@ void vp9_change_config(VP9_PTR ptr, VP9_CONFIG *oxcf) { if (cpi->svc.number_temporal_layers > 1 && cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) { - update_layer_context_change_config(cpi, cpi->oxcf.target_bandwidth); + update_layer_context_change_config(cpi, (int)cpi->oxcf.target_bandwidth); } cpi->speed = abs(cpi->oxcf.cpu_used); @@ -2031,10 +2033,12 @@ void vp9_remove_compressor(VP9_PTR *ptr) { / time_encoded; if (cpi->b_calculate_psnr) { - const double total_psnr = vp9_mse2psnr(cpi->total_samples, 255.0, - cpi->total_sq_error); - const double totalp_psnr = vp9_mse2psnr(cpi->totalp_samples, 255.0, - cpi->totalp_sq_error); + const double total_psnr = + vp9_mse2psnr((double)cpi->total_samples, 255.0, + (double)cpi->total_sq_error); + const double totalp_psnr = + vp9_mse2psnr((double)cpi->totalp_samples, 255.0, + (double)cpi->totalp_sq_error); const double total_ssim = 100 * pow(cpi->summed_quality / cpi->summed_weights, 8.0); const double totalp_ssim = 100 * pow(cpi->summedp_quality / @@ -2210,20 +2214,20 @@ static void calc_psnr(const YV12_BUFFER_CONFIG *a, const YV12_BUFFER_CONFIG *b, const int w = widths[i]; const int h = heights[i]; const uint32_t samples = w * h; - const double sse = calc_plane_error(a_planes[i], a_strides[i], - b_planes[i], b_strides[i], - w, h); + const uint64_t sse = calc_plane_error(a_planes[i], a_strides[i], + b_planes[i], b_strides[i], + w, h); psnr->sse[1 + i] = sse; psnr->samples[1 + i] = samples; - psnr->psnr[1 + i] = vp9_mse2psnr(samples, 255.0, sse); + psnr->psnr[1 + i] = vp9_mse2psnr(samples, 255.0, (double) sse); - total_sse += sse; + total_sse += (uint64_t)sse; total_samples += samples; } psnr->sse[0] = total_sse; psnr->samples[0] = total_samples; - psnr->psnr[0] = vp9_mse2psnr(total_samples, 255.0, total_sse); + psnr->psnr[0] = vp9_mse2psnr((double)total_samples, 255.0, (double)total_sse); } static void generate_psnr_packet(VP9_COMP *cpi) { @@ -2894,7 +2898,7 @@ static void encode_with_recode_loop(VP9_COMP *cpi, if (!cpi->sf.use_pick_mode) vp9_pack_bitstream(cpi, dest, size); - cpi->rc.projected_frame_size = (*size) << 3; + cpi->rc.projected_frame_size = (int)(*size) << 3; vp9_restore_coding_context(cpi); if (frame_over_shoot_limit == 0) @@ -3764,7 +3768,7 @@ int vp9_get_compressed_data(VP9_PTR ptr, unsigned int *frame_flags, #if CONFIG_INTERNAL_STATS if (cpi->pass != 1) { - cpi->bytes += *size; + cpi->bytes += (int)(*size); if (cm->show_frame) { cpi->count++; diff --git a/vp9/encoder/vp9_quantize.c b/vp9/encoder/vp9_quantize.c index 862573f3f..372c36221 100644 --- a/vp9/encoder/vp9_quantize.c +++ b/vp9/encoder/vp9_quantize.c @@ -26,7 +26,7 @@ void vp9_quantize_b_c(const int16_t *coeff_ptr, intptr_t count, const int16_t *dequant_ptr, int zbin_oq_value, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan) { - int i, non_zero_count = count, eob = -1; + int i, non_zero_count = (int)count, eob = -1; const int zbins[2] = { zbin_ptr[0] + zbin_oq_value, zbin_ptr[1] + zbin_oq_value }; const int nzbins[2] = { zbins[0] * -1, @@ -37,7 +37,7 @@ void vp9_quantize_b_c(const int16_t *coeff_ptr, intptr_t count, if (!skip_block) { // Pre-scan pass - for (i = count - 1; i >= 0; i--) { + for (i = (int)count - 1; i >= 0; i--) { const int rc = scan[i]; const int coeff = coeff_ptr[rc]; diff --git a/vp9/encoder/vp9_tokenize.c b/vp9/encoder/vp9_tokenize.c index 4e2e26816..2be00ff62 100644 --- a/vp9/encoder/vp9_tokenize.c +++ b/vp9/encoder/vp9_tokenize.c @@ -257,7 +257,8 @@ static void tokenize_b(int plane, int block, BLOCK_SIZE plane_bsize, add_token(&t, coef_probs[band[c]][pt], vp9_dct_value_tokens_ptr[v].extra, - vp9_dct_value_tokens_ptr[v].token, skip_eob, + (uint8_t)vp9_dct_value_tokens_ptr[v].token, + (uint8_t)skip_eob, counts[band[c]][pt]); eob_branch[band[c]][pt] += !skip_eob; diff --git a/vp9/vp9_cx_iface.c b/vp9/vp9_cx_iface.c index 8072f78a0..fbdad7414 100644 --- a/vp9/vp9_cx_iface.c +++ b/vp9/vp9_cx_iface.c @@ -365,7 +365,7 @@ static vpx_codec_err_t set_vp9e_config(VP9_CONFIG *oxcf, memcpy(oxcf->ts_rate_decimator, cfg.ts_rate_decimator, sizeof(cfg.ts_rate_decimator)); } else if (oxcf->ts_number_layers == 1) { - oxcf->ts_target_bitrate[0] = oxcf->target_bandwidth; + oxcf->ts_target_bitrate[0] = (int)oxcf->target_bandwidth; oxcf->ts_rate_decimator[0] = 1; } @@ -639,7 +639,7 @@ static int write_superframe_index(vpx_codec_alg_priv_t *ctx) { *x++ = marker; for (i = 0; i < ctx->pending_frame_count; i++) { - int this_sz = ctx->pending_frame_sizes[i]; + unsigned int this_sz = (unsigned int)ctx->pending_frame_sizes[i]; for (j = 0; j <= mag; j++) { *x++ = this_sz & 0xff; @@ -1049,7 +1049,7 @@ static vpx_codec_err_t vp9e_set_svc_layer_id(vpx_codec_alg_priv_t *ctx, return VPX_CODEC_INVALID_PARAM; } if (cpi->svc.spatial_layer_id < 0 || - cpi->svc.spatial_layer_id >= ctx->cfg.ss_number_layers) { + cpi->svc.spatial_layer_id >= (int)ctx->cfg.ss_number_layers) { return VPX_CODEC_INVALID_PARAM; } return VPX_CODEC_OK; diff --git a/vp9/vp9_dx_iface.c b/vp9/vp9_dx_iface.c index 1941fc042..76cbebf19 100644 --- a/vp9/vp9_dx_iface.c +++ b/vp9/vp9_dx_iface.c @@ -214,7 +214,7 @@ static vpx_codec_err_t vp9_get_si(vpx_codec_alg_priv_t *ctx, ? sizeof(vp9_stream_info_t) : sizeof(vpx_codec_stream_info_t); memcpy(si, &ctx->si, sz); - si->sz = sz; + si->sz = (unsigned int)sz; return VPX_CODEC_OK; } @@ -462,7 +462,7 @@ static vpx_codec_err_t vp9_decode(vpx_codec_alg_priv_t *ctx, while (data_start < data_end && *data_start == 0) data_start++; - data_sz = data_end - data_start; + data_sz = (unsigned int)(data_end - data_start); } while (data_start < data_end); return res; } @@ -791,7 +791,8 @@ int main_loop(int argc, const char **argv_) { vpx_usec_timer_start(&timer); - if (vpx_codec_decode(&decoder, buf, bytes_in_buffer, NULL, 0)) { + if (vpx_codec_decode(&decoder, buf, (unsigned int)bytes_in_buffer, + NULL, 0)) { const char *detail = vpx_codec_error_detail(&decoder); warn("Failed to decode frame %d: %s", frame_in, vpx_codec_error(&decoder)); @@ -873,7 +874,7 @@ int main_loop(int argc, const char **argv_) { vpx_input_ctx.height, &vpx_input_ctx.framerate, img->fmt); if (do_md5) { - MD5Update(&md5_ctx, (md5byte *)buf, len); + MD5Update(&md5_ctx, (md5byte *)buf, (unsigned int)len); } else { fputs(buf, outfile); } @@ -882,7 +883,7 @@ int main_loop(int argc, const char **argv_) { // Y4M frame header len = y4m_write_frame_header(buf, sizeof(buf)); if (do_md5) { - MD5Update(&md5_ctx, (md5byte *)buf, len); + MD5Update(&md5_ctx, (md5byte *)buf, (unsigned int)len); } else { fputs(buf, outfile); } |