[vlc-devel] commit: x264.c: add slicing parameters (Ilkka Ollakka )

git version control git at videolan.org
Sat Jan 16 15:01:11 CET 2010


vlc | branch: master | Ilkka Ollakka <ileoo at iki.fi> | Sat Jan 16 15:52:50 2010 +0200| [904d94cbfae22f586e2f5f47d1e68a341be311a9] | committer: Ilkka Ollakka 

x264.c: add slicing parameters

venc=x264{slices,slice-max-size,slice-max-mbs} options are there now

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

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

diff --git a/modules/codec/x264.c b/modules/codec/x264.c
index 6cb4abc..2b4719e 100644
--- a/modules/codec/x264.c
+++ b/modules/codec/x264.c
@@ -142,6 +142,15 @@ static void Close( vlc_object_t * );
 #define INTERLACED_TEXT N_("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 */
 
 #define QP_TEXT N_("Set QP")
@@ -461,6 +470,11 @@ vlc_module_begin ()
     add_bool( SOUT_CFG_PREFIX "interlaced", false, NULL, INTERLACED_TEXT, INTERLACED_LONGTEXT,
               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 */
 
     add_integer( SOUT_CFG_PREFIX "qp", -1, NULL, QP_TEXT, QP_LONGTEXT,
@@ -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;
     }
 
+    /* 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
        in seconds for local maximum bitrate (cache/bufsize) based
        on average bitrate when use has told bitrate.




More information about the vlc-devel mailing list