Commit 755f7929 authored by Michael Niedermayer's avatar Michael Niedermayer

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: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent b1a0fccd
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment