| Index: source/libvpx/vp8/encoder/firstpass.c
|
| ===================================================================
|
| --- source/libvpx/vp8/encoder/firstpass.c (revision 191025)
|
| +++ source/libvpx/vp8/encoder/firstpass.c (working copy)
|
| @@ -858,7 +858,9 @@
|
| */
|
| if ((cm->current_video_frame > 0) &&
|
| (cpi->twopass.this_frame_stats.pcnt_inter > 0.20) &&
|
| - ((cpi->twopass.this_frame_stats.intra_error / cpi->twopass.this_frame_stats.coded_error) > 2.0))
|
| + ((cpi->twopass.this_frame_stats.intra_error /
|
| + DOUBLE_DIVIDE_CHECK(cpi->twopass.this_frame_stats.coded_error)) >
|
| + 2.0))
|
| {
|
| vp8_yv12_copy_frame(lst_yv12, gld_yv12);
|
| }
|
| @@ -2116,23 +2118,25 @@
|
| (cpi->twopass.kf_group_error_left > 0))
|
| {
|
| cpi->twopass.gf_group_bits =
|
| - (int)((double)cpi->twopass.kf_group_bits *
|
| - (gf_group_err / (double)cpi->twopass.kf_group_error_left));
|
| + (int64_t)(cpi->twopass.kf_group_bits *
|
| + (gf_group_err / cpi->twopass.kf_group_error_left));
|
| }
|
| else
|
| cpi->twopass.gf_group_bits = 0;
|
|
|
| - cpi->twopass.gf_group_bits = (int)(
|
| + cpi->twopass.gf_group_bits =
|
| (cpi->twopass.gf_group_bits < 0)
|
| ? 0
|
| : (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
|
| * variability limit (cpi->oxcf.two_pass_vbrmax_section)
|
| */
|
| - if (cpi->twopass.gf_group_bits > max_bits * cpi->baseline_gf_interval)
|
| - cpi->twopass.gf_group_bits = max_bits * cpi->baseline_gf_interval;
|
| + if (cpi->twopass.gf_group_bits >
|
| + (int64_t)max_bits * cpi->baseline_gf_interval)
|
| + cpi->twopass.gf_group_bits =
|
| + (int64_t)max_bits * cpi->baseline_gf_interval;
|
|
|
| /* Reset the file position */
|
| reset_fpf_position(cpi, start_pos);
|
| @@ -2446,7 +2450,7 @@
|
| */
|
| if (cpi->oxcf.error_resilient_mode)
|
| {
|
| - cpi->twopass.gf_group_bits = (int)cpi->twopass.kf_group_bits;
|
| + cpi->twopass.gf_group_bits = cpi->twopass.kf_group_bits;
|
| cpi->twopass.gf_group_error_left =
|
| (int)cpi->twopass.kf_group_error_left;
|
| cpi->baseline_gf_interval = cpi->twopass.frames_to_key;
|
|
|