This commit is contained in:
Jim Bankoski 2010-10-26 07:34:57 -04:00
Родитель bdc9262a6d 39f41a4f36
Коммит 0a5a638c60
2 изменённых файлов: 5 добавлений и 0 удалений

Просмотреть файл

@ -1429,6 +1429,9 @@ int vp8_reverse_trans(int x)
}; };
void vp8_new_frame_rate(VP8_COMP *cpi, double framerate) void vp8_new_frame_rate(VP8_COMP *cpi, double framerate)
{ {
if(framerate < .1)
framerate = 30;
cpi->oxcf.frame_rate = framerate; cpi->oxcf.frame_rate = framerate;
cpi->output_frame_rate = cpi->oxcf.frame_rate; cpi->output_frame_rate = cpi->oxcf.frame_rate;
cpi->per_frame_bandwidth = (int)(cpi->oxcf.target_bandwidth / cpi->output_frame_rate); cpi->per_frame_bandwidth = (int)(cpi->oxcf.target_bandwidth / cpi->output_frame_rate);

Просмотреть файл

@ -1481,6 +1481,8 @@ void vp8_adjust_key_frame_context(VP8_COMP *cpi)
// allocated than those following other gfs. // allocated than those following other gfs.
cpi->kf_overspend_bits += (cpi->projected_frame_size - cpi->per_frame_bandwidth) * 7 / 8; cpi->kf_overspend_bits += (cpi->projected_frame_size - cpi->per_frame_bandwidth) * 7 / 8;
cpi->gf_overspend_bits += (cpi->projected_frame_size - cpi->per_frame_bandwidth) * 1 / 8; cpi->gf_overspend_bits += (cpi->projected_frame_size - cpi->per_frame_bandwidth) * 1 / 8;
if(!av_key_frame_frequency)
av_key_frame_frequency = 60;
// Work out how much to try and recover per frame. // Work out how much to try and recover per frame.
// For one pass we estimate the number of frames to spread it over based upon past history. // For one pass we estimate the number of frames to spread it over based upon past history.