[vlc-devel] commit: x264.c: add option to adjust lookahead (Ilkka Ollakka )

git version control git at videolan.org
Sun Nov 15 13:55:10 CET 2009


vlc | branch: master | Ilkka Ollakka <ileoo at iki.fi> | Sun Nov 15 14:48:33 2009 +0200| [df6af2ed88a5eef071ab92a6d5fba2df461252c0] | committer: Ilkka Ollakka 

x264.c: add option to adjust lookahead

Limit range to 0..60 currently, as x264 tunes doesn't seem to use larger
values than that

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

 modules/codec/x264.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/modules/codec/x264.c b/modules/codec/x264.c
index b557e01..4dae353 100644
--- a/modules/codec/x264.c
+++ b/modules/codec/x264.c
@@ -361,6 +361,11 @@ static void Close( vlc_object_t * );
 #define AUD_TEXT N_("Access unit delimiters")
 #define AUD_LONGTEXT N_( "Generate access unit delimiter NAL units.")
 
+#define LOOKAHEAD_TEXT N_("Framecount to use on frametype lookahead")
+#define LOOKAHEAD_LONGTEXT N_("Framecount to use on frametype lookahead. " \
+    "Currently default is lower than x264 default because unmuxable output" \
+    "doesn't handle larger values that well yet" )
+
 static const char *const enc_me_list[] =
   { "dia", "hex", "umh", "esa", "tesa" };
 static const char *const enc_me_list_text[] =
@@ -585,6 +590,10 @@ vlc_module_begin ()
                  TRELLIS_LONGTEXT, false )
         change_integer_range( 0, 2 )
 
+    add_integer( SOUT_CFG_PREFIX "lookahead", 5, NULL, LOOKAHEAD_TEXT,
+                 LOOKAHEAD_LONGTEXT, false )
+        change_integer_range( 0, 60 )
+
     add_bool( SOUT_CFG_PREFIX "fast-pskip", true, NULL, FAST_PSKIP_TEXT,
               FAST_PSKIP_LONGTEXT, false )
 
@@ -651,7 +660,7 @@ static const char *const ppsz_sout_options[] = {
     "qpmin", "qp-max", "qp-min", "quiet", "ratetol", "ref", "scenecut",
     "sps-id", "ssim", "stats", "subme", "subpel", "tolerance", "trellis",
     "verbose", "vbv-bufsize", "vbv-init", "vbv-maxrate", "weightb", "weightp", "aq-mode",
-    "aq-strength", "psy-rd", "profile", NULL
+    "aq-strength", "psy-rd", "profile", "lookahead", NULL
 };
 
 static block_t *Encode( encoder_t *, picture_t * );
@@ -1141,7 +1150,7 @@ static int  Open ( vlc_object_t *p_this )
     /* Set lookahead value to lower than default,
      * as rtp-output without mux doesn't handle
      * difference that well yet*/
-    p_sys->param.rc.i_lookahead=5;
+    p_sys->param.rc.i_lookahead= var_GetInteger( p_enc, SOUT_CFG_PREFIX "lookahead" );
 
     /* Open the encoder */
     p_sys->h = x264_encoder_open( &p_sys->param );




More information about the vlc-devel mailing list