Commit 904d94cb authored by Ilkka Ollakka's avatar Ilkka Ollakka

x264.c: add slicing parameters

venc=x264{slices,slice-max-size,slice-max-mbs} options are there now
parent e3e7caad
...@@ -142,6 +142,15 @@ static void Close( vlc_object_t * ); ...@@ -142,6 +142,15 @@ static void Close( vlc_object_t * );
#define INTERLACED_TEXT N_("Interlaced mode") #define INTERLACED_TEXT N_("Interlaced mode")
#define INTERLACED_LONGTEXT N_( "Pure-interlaced mode.") #define INTERLACED_LONGTEXT N_( "Pure-interlaced mode.")
#define SLICE_COUNT N_("Force number of slices per frame")
#define SLICE_COUNT_LONGTEXT N_("Force rectangular slices and is overridden by other slicing optinos")
#define SLICE_MAX_SIZE N_("Limit the size of each slice in bytes")
#define SLICE_MAX_SIZE_LONGTEXT N_("Sets a maximum slice size in bytes, Includes NAL overhead in size")
#define SLICE_MAX_MBS N_("Limit the size of each slice in macroblocks")
#define SLICE_MAX_MBS_LONGTEXT N_("Sets a maximum number of macroblocks per slice")
/* Ratecontrol */ /* Ratecontrol */
#define QP_TEXT N_("Set QP") #define QP_TEXT N_("Set QP")
...@@ -461,6 +470,11 @@ vlc_module_begin () ...@@ -461,6 +470,11 @@ vlc_module_begin ()
add_bool( SOUT_CFG_PREFIX "interlaced", false, NULL, INTERLACED_TEXT, INTERLACED_LONGTEXT, add_bool( SOUT_CFG_PREFIX "interlaced", false, NULL, INTERLACED_TEXT, INTERLACED_LONGTEXT,
false ) false )
add_integer( SOUT_CFG_PREFIX "slices", 0, NULL, SLICE_COUNT, SLICE_COUNT_LONGTEXT, false )
add_integer( SOUT_CFG_PREFIX "slice-max-size", 0, NULL, SLICE_MAX_SIZE, SLICE_MAX_SIZE_LONGTEXT, false )
add_integer( SOUT_CFG_PREFIX "slice-max-mbs", 0, NULL, SLICE_MAX_MBS, SLICE_MAX_MBS_LONGTEXT, false )
/* Ratecontrol */ /* Ratecontrol */
add_integer( SOUT_CFG_PREFIX "qp", -1, NULL, QP_TEXT, QP_LONGTEXT, add_integer( SOUT_CFG_PREFIX "qp", -1, NULL, QP_TEXT, QP_LONGTEXT,
...@@ -1044,6 +1058,18 @@ static int Open ( vlc_object_t *p_this ) ...@@ -1044,6 +1058,18 @@ static int Open ( vlc_object_t *p_this )
p_sys->param.i_fps_den = p_enc->fmt_in.video.i_frame_rate_base; p_sys->param.i_fps_den = p_enc->fmt_in.video.i_frame_rate_base;
} }
/* Check slice-options */
i_val = var_GetInteger( p_enc, SOUT_CFG_PREFIX "slices" );
if( i_val > 0 )
p_sys->param.i_slice_count = i_val;
i_val = var_GetInteger( p_enc, SOUT_CFG_PREFIX "slice-max-size" );
if( i_val > 0 )
p_sys->param.i_slice_max_size = i_val;
i_val = var_GetInteger( p_enc, SOUT_CFG_PREFIX "slice-max-mbs" );
if( i_val > 0 )
p_sys->param.i_slice_max_mbs = i_val;
/* x264 vbv-bufsize = 0 (default). if not provided set period /* x264 vbv-bufsize = 0 (default). if not provided set period
in seconds for local maximum bitrate (cache/bufsize) based in seconds for local maximum bitrate (cache/bufsize) based
on average bitrate when use has told bitrate. on average bitrate when use has told bitrate.
......
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