aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-09-28 23:40:02 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-09-28 23:59:44 +0200
commit755f7929c6aa919918df534ae68cc78441b186e7 (patch)
tree87e6ab119db21c986a694e0a1c6a542965c2508d
parentb1a0fccd023d9261274a92ec9482da03c4aa82fa (diff)
downloadffmpeg-755f7929c6aa919918df534ae68cc78441b186e7.tar.gz
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>
-rw-r--r--libavcodec/mpegvideo_enc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 03b96e5ec9..81298c85b2 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -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) {