firstpass.c: correct casting around gf_group_bits
gf_group_bits is int64_t remove casts to int. Change-Id: I3b4225905041fac9af9fdfcbcb6f1c357ea4b593
This commit is contained in:
Родитель
67978d1380
Коммит
a07bed2b2b
|
@ -2118,17 +2118,17 @@ static void define_gf_group(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame)
|
||||||
(cpi->twopass.kf_group_error_left > 0))
|
(cpi->twopass.kf_group_error_left > 0))
|
||||||
{
|
{
|
||||||
cpi->twopass.gf_group_bits =
|
cpi->twopass.gf_group_bits =
|
||||||
(int)((double)cpi->twopass.kf_group_bits *
|
(int64_t)(cpi->twopass.kf_group_bits *
|
||||||
(gf_group_err / (double)cpi->twopass.kf_group_error_left));
|
(gf_group_err / cpi->twopass.kf_group_error_left));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
cpi->twopass.gf_group_bits = 0;
|
cpi->twopass.gf_group_bits = 0;
|
||||||
|
|
||||||
cpi->twopass.gf_group_bits = (int)(
|
cpi->twopass.gf_group_bits =
|
||||||
(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)
|
||||||
|
@ -2450,7 +2450,7 @@ void vp8_second_pass(VP8_COMP *cpi)
|
||||||
*/
|
*/
|
||||||
if (cpi->oxcf.error_resilient_mode)
|
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 =
|
cpi->twopass.gf_group_error_left =
|
||||||
(int)cpi->twopass.kf_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;
|
||||||
|
|
|
@ -1695,8 +1695,8 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
|
||||||
if ((cpi->twopass.kf_group_bits > 0) &&
|
if ((cpi->twopass.kf_group_bits > 0) &&
|
||||||
(cpi->twopass.kf_group_error_left > 0)) {
|
(cpi->twopass.kf_group_error_left > 0)) {
|
||||||
cpi->twopass.gf_group_bits =
|
cpi->twopass.gf_group_bits =
|
||||||
(int)((double)cpi->twopass.kf_group_bits *
|
(int64_t)(cpi->twopass.kf_group_bits *
|
||||||
(gf_group_err / cpi->twopass.kf_group_error_left));
|
(gf_group_err / cpi->twopass.kf_group_error_left));
|
||||||
} else
|
} else
|
||||||
cpi->twopass.gf_group_bits = 0;
|
cpi->twopass.gf_group_bits = 0;
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче