Commit 0d97f931 authored by Ilkka Ollakka's avatar Ilkka Ollakka Committed by 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 f1e222cf)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 197e6a63
...@@ -844,12 +844,7 @@ static int Open ( vlc_object_t *p_this ) ...@@ -844,12 +844,7 @@ static int Open ( vlc_object_t *p_this )
SOUT_CFG_PREFIX "vbv-bufsize" ); SOUT_CFG_PREFIX "vbv-bufsize" );
/* max bitrate = average bitrate -> CBR */ /* max bitrate = average bitrate -> CBR */
i_val = var_GetInteger( p_enc, SOUT_CFG_PREFIX "vbv-maxrate" ); p_sys->param.rc.i_vbv_max_bitrate = 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;
if( !var_GetBool( p_enc, SOUT_CFG_PREFIX "cabac" ) ) if( !var_GetBool( p_enc, SOUT_CFG_PREFIX "cabac" ) )
...@@ -1159,21 +1154,6 @@ static int Open ( vlc_object_t *p_this ) ...@@ -1159,21 +1154,6 @@ static int Open ( vlc_object_t *p_this )
if( i_val > 0 ) if( i_val > 0 )
p_sys->param.i_slice_max_mbs = i_val; 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 /* Check if user has given some profile (baseline,main,high) to limit
* settings, and apply those*/ * settings, and apply those*/
psz_val = var_GetString( p_enc, SOUT_CFG_PREFIX "profile" ); psz_val = var_GetString( p_enc, SOUT_CFG_PREFIX "profile" );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment