[libav-commits] libx264: use the library specific default rc_initial_buffer_occupancy

Luca Barbato git at libav.org
Tue Jan 15 09:14:14 CET 2013


Module: libav
Branch: release/9
Commit: 72eca26bf95dd58ce05b9dbf9b1b3694f496daf6

Author:    Luca Barbato <lu_zero at gentoo.org>
Committer: Luca Barbato <lu_zero at gentoo.org>
Date:      Mon Jan 14 05:32:39 2013 +0100

libx264: use the library specific default rc_initial_buffer_occupancy

By default libav sets it to 3/4 while x264 sets it to 9/10.

CC: libav-stable at libav.org

Signed-off-by: Luca Barbato <lu_zero at gentoo.org>
(cherry picked from commit 47812070a267cbdf74164e154d03d99bf8ced100)

Signed-off-by: Luca Barbato <lu_zero at gentoo.org>

---

 libavcodec/libx264.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index f536f7f..e9cbbad 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -272,7 +272,7 @@ static av_cold int X264_init(AVCodecContext *avctx)
             x4->params.rc.f_rf_constant_max = x4->crf_max;
     }
 
-    if (avctx->rc_buffer_size && avctx->rc_initial_buffer_occupancy &&
+    if (avctx->rc_buffer_size && avctx->rc_initial_buffer_occupancy > 0 &&
         (avctx->rc_initial_buffer_occupancy <= avctx->rc_buffer_size)) {
         x4->params.rc.f_vbv_buffer_init =
             (float)avctx->rc_initial_buffer_occupancy / avctx->rc_buffer_size;
@@ -560,6 +560,7 @@ static const AVCodecDefault x264_defaults[] = {
     { "threads",          AV_STRINGIFY(X264_THREADS_AUTO) },
     { "thread_type",      "0" },
     { "flags",            "+cgop" },
+    { "rc_init_occupancy","-1" },
     { NULL },
 };
 



More information about the libav-commits mailing list