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>
pull/86/head
Michael Niedermayer 10 years ago
parent b1a0fccd02
commit 755f7929c6
  1. 2
      libavcodec/mpegvideo_enc.c

@ -1746,7 +1746,7 @@ vbv_retry:
if (avctx->rc_buffer_size) { if (avctx->rc_buffer_size) {
RateControlContext *rcc = &s->rc_context; 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 && if (put_bits_count(&s->pb) > max_size &&
s->lambda < s->avctx->lmax) { s->lambda < s->avctx->lmax) {

Loading…
Cancel
Save