[vlc-commits] x264.c: partly revert vbv-bufsize option handling when bitrate is defined

Ilkka Ollakka git at videolan.org
Thu Jan 5 09:25:19 CET 2012


vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Thu Jan  5 12:44:19 2012 +0200| [f1e222cf3197da2a0c395b5a8eae745e470d312e] | committer: Ilkka Ollakka

x264.c: partly revert vbv-bufsize option handling when bitrate is defined

Previous code didn't actually behave so well with small keyints etc.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f1e222cf3197da2a0c395b5a8eae745e470d312e
---

 modules/codec/x264.c |   22 +---------------------
 1 files changed, 1 insertions(+), 21 deletions(-)

diff --git a/modules/codec/x264.c b/modules/codec/x264.c
index c5d63d2..5bcb4ed 100644
--- a/modules/codec/x264.c
+++ b/modules/codec/x264.c
@@ -844,12 +844,7 @@ static int  Open ( vlc_object_t *p_this )
                             SOUT_CFG_PREFIX "vbv-bufsize" );
 
     /* max bitrate = average bitrate -> CBR */
-    i_val = var_GetInteger( p_enc, SOUT_CFG_PREFIX "vbv-maxrate" );
-
-    if( !i_val && p_sys->param.rc.i_rc_method == X264_RC_ABR )
-        p_sys->param.rc.i_vbv_max_bitrate = p_sys->param.rc.i_bitrate;
-    else if ( i_val )
-        p_sys->param.rc.i_vbv_max_bitrate = i_val;
+    p_sys->param.rc.i_vbv_max_bitrate = var_GetInteger( p_enc, SOUT_CFG_PREFIX "vbv-maxrate" );
 
 
     if( !var_GetBool( p_enc, SOUT_CFG_PREFIX "cabac" ) )
@@ -1162,21 +1157,6 @@ static int  Open ( vlc_object_t *p_this )
     if( i_val > 0 )
         p_sys->param.i_slice_max_mbs = i_val;
 
-
-    /* x264 vbv-bufsize = 0 (default). if not provided set period
-       in seconds for local maximum bitrate (cache/bufsize) based
-       on average bitrate when use has told bitrate.
-       vbv-buffer size is set to bitrate * secods between keyframes */
-    if( !p_sys->param.rc.i_vbv_buffer_size &&
-         p_sys->param.rc.i_rc_method == X264_RC_ABR &&
-         p_sys->param.i_fps_num )
-    {
-        p_sys->param.rc.i_vbv_buffer_size = p_sys->param.rc.i_bitrate *
-            p_sys->param.i_fps_den;
-        p_sys->param.rc.i_vbv_buffer_size *= p_sys->param.i_keyint_max;
-        p_sys->param.rc.i_vbv_buffer_size /= p_sys->param.i_fps_num;
-    }
-
     /* Check if user has given some profile (baseline,main,high) to limit
      * settings, and apply those*/
     psz_val = var_GetString( p_enc, SOUT_CFG_PREFIX "profile" );



More information about the vlc-commits mailing list