[vlc-devel] commit: x264.c: handle X264_BUILD 78 bpyramid change (Ilkka Ollakka )

git version control git at videolan.org
Tue Oct 20 17:16:46 CEST 2009


vlc | branch: 1.0-bugfix | Ilkka Ollakka <ileoo at videolan.org> | Tue Oct 20 18:14:31 2009 +0300| [3efa5133981b8f28532509204673ccf368f8c7a7] | committer: Ilkka Ollakka 

x264.c: handle X264_BUILD 78 bpyramid change

(cherry picked from commit 0e22b04bd1f6245678585b058d1681e5fe9e5731)

Conflicts:

	modules/codec/x264.c

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

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

diff --git a/modules/codec/x264.c b/modules/codec/x264.c
index f73b0be..6514d2d 100644
--- a/modules/codec/x264.c
+++ b/modules/codec/x264.c
@@ -100,10 +100,21 @@ static void Close( vlc_object_t * );
 #define B_BIAS_LONGTEXT N_( "Bias the choice to use B-frames. Positive values " \
     "cause more B-frames, negative values cause less B-frames." )
 
+
 #define BPYRAMID_TEXT N_("Keep some B-frames as references")
+#if X264_BUILD >= 78
+#define BPYRAMID_LONGTEXT N_( "Allows B-frames to be used as references for " \
+    "predicting other frames. Keeps the middle of 2+ consecutive B-frames " \
+    "as a reference, and reorders frame appropriately.\n" \
+    " - none: Disabled\n" \
+    " - strict: Strictly hierarchical pyramid\n" \
+    " - normal: Non-strict (not Blu-ray compatible)\n"\
+    )
+#else
 #define BPYRAMID_LONGTEXT N_( "Allows B-frames to be used as references for " \
     "predicting other frames. Keeps the middle of 2+ consecutive B-frames " \
     "as a reference, and reorders frame appropriately." )
+#endif
 
 #define CABAC_TEXT N_("CABAC")
 #define CABAC_LONGTEXT N_( "CABAC (Context-Adaptive Binary Arithmetic "\
@@ -405,6 +416,11 @@ static const char *const enc_me_list_text[] =
 static const char *const profile_list[] =
   { "baseline", "main", "high" };
 
+#if X264_BUILD >= 78
+static const char *const bpyramid_list[] =
+  { "none", "strict", "normal" };
+#endif
+
 static const char *const enc_analyse_list[] =
   { "none", "fast", "normal", "slow", "all" };
 static const char *const enc_analyse_list_text[] =
@@ -470,8 +486,14 @@ vlc_module_begin ()
         change_integer_range( -100, 100 )
 #endif
 
-    add_bool( SOUT_CFG_PREFIX "bpyramid", 0, NULL, BPYRAMID_TEXT,
+#if X264_BUILD >= 78
+    add_string( SOUT_CFG_PREFIX "bpyramid", "none", NULL, BPYRAMID_TEXT,
+              BPYRAMID_LONGTEXT, false )
+        change_string_list( bpyramid_list, bpyramid_list, 0 );
+#else
+    add_bool( SOUT_CFG_PREFIX "bpyramid", false, NULL, BPYRAMID_TEXT,
               BPYRAMID_LONGTEXT, false )
+#endif
 
     add_bool( SOUT_CFG_PREFIX "cabac", 1, NULL, CABAC_TEXT, CABAC_LONGTEXT,
               false )
@@ -1001,7 +1023,21 @@ static int  Open ( vlc_object_t *p_this )
     if( val.i_int >= 0 && val.i_int <= 16 )
         p_sys->param.i_bframe = val.i_int;
 
-#if X264_BUILD >= 22
+#if X264_BUILD >= 78
+    var_Get( p_enc, SOUT_CFG_PREFIX "bpyramid", &val );
+    p_sys->param.i_bframe_pyramid = X264_B_PYRAMID_NONE;
+    if( !strcmp( val.psz_string, "none" ) )
+    {
+       p_sys->param.i_bframe_pyramid = X264_B_PYRAMID_NONE;
+    } else if ( !strcmp( val.psz_string, "strict" ) )
+    {
+       p_sys->param.i_bframe_pyramid = X264_B_PYRAMID_STRICT;
+    } else if ( !strcmp( val.psz_string, "normal" ) )
+    {
+       p_sys->param.i_bframe_pyramid = X264_B_PYRAMID_NORMAL;
+    }
+    free( val.psz_string );
+#elif X264_BUILD >= 22
     var_Get( p_enc, SOUT_CFG_PREFIX "bpyramid", &val );
     p_sys->param.b_bframe_pyramid = val.b_bool;
 #endif




More information about the vlc-devel mailing list