1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

avcodec/mpegvideo_enc: Only enforce rc_max_available_vbv_use on first encoding attempt

This reduces repeatly re-encoding to achieve VBV compliance

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2014-09-28 23:40:02 +02:00
parent b1a0fccd02
commit 755f7929c6

View File

@ -1746,7 +1746,7 @@ vbv_retry:
if (avctx->rc_buffer_size) {
RateControlContext *rcc = &s->rc_context;
int max_size = rcc->buffer_index * avctx->rc_max_available_vbv_use;
int max_size = FFMAX(rcc->buffer_index * avctx->rc_max_available_vbv_use, rcc->buffer_index - 500);
if (put_bits_count(&s->pb) > max_size &&
s->lambda < s->avctx->lmax) {