[vlc-commits] x264.c: partly revert vbv-bufsize option handling when bitrate is defined
Ilkka Ollakka
git at videolan.org
Thu Jan 5 23:19:03 CET 2012
vlc/vlc-1.2 | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Thu Jan 5 12:44:19 2012 +0200| [0d97f931626af999b602771f55ac8e34c3aa621f] | committer: Jean-Baptiste Kempf
x264.c: partly revert vbv-bufsize option handling when bitrate is defined
Previous code didn't actually behave so well with small keyints etc.
(cherry picked from commit f1e222cf3197da2a0c395b5a8eae745e470d312e)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.2.git/?a=commit;h=0d97f931626af999b602771f55ac8e34c3aa621f
---
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 96cdf3d..e76b89e 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" ) )
@@ -1159,21 +1154,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