From 9a76e73836c7c15c8e2d9039474495048bf4bc4f Mon Sep 17 00:00:00 2001 From: Ilkka Ollakka Date: Wed, 26 May 2010 00:16:15 +0300 Subject: [PATCH] x264: default b-pyramid to "normal" from X264_BUILD >= 87 libx264 changed default to normal in that build too, also change logic littebit so b-pyramid selection works better. --- modules/codec/x264.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/modules/codec/x264.c b/modules/codec/x264.c index e291eaaa12..5072446701 100644 --- a/modules/codec/x264.c +++ b/modules/codec/x264.c @@ -437,8 +437,13 @@ vlc_module_begin () B_BIAS_LONGTEXT, false ) change_integer_range( -100, 100 ) +#if X264_BUILD >= 87 + add_string( SOUT_CFG_PREFIX "bpyramid", "normal", NULL, BPYRAMID_TEXT, + BPYRAMID_LONGTEXT, false ) +#else add_string( SOUT_CFG_PREFIX "bpyramid", "none", NULL, BPYRAMID_TEXT, BPYRAMID_LONGTEXT, false ) +#endif change_string_list( bpyramid_list, bpyramid_list, 0 ); add_bool( SOUT_CFG_PREFIX "cabac", true, NULL, CABAC_TEXT, CABAC_LONGTEXT, @@ -902,16 +907,19 @@ static int Open ( vlc_object_t *p_this ) p_sys->param.b_intra_refresh = var_GetBool( p_enc, SOUT_CFG_PREFIX "intra-refresh" ); psz_val = var_GetString( p_enc, SOUT_CFG_PREFIX "bpyramid" ); - if( strcmp( psz_val, "none" ) ) + if( !strcmp( psz_val, "normal" ) ) { - if ( !strcmp( psz_val, "strict" ) ) - { - p_sys->param.i_bframe_pyramid = X264_B_PYRAMID_STRICT; - } else if ( !strcmp( psz_val, "normal" ) ) - { - p_sys->param.i_bframe_pyramid = X264_B_PYRAMID_NORMAL; - } + p_sys->param.i_bframe_pyramid = X264_B_PYRAMID_NORMAL; } + else if ( !strcmp( psz_val, "strict" ) ) + { + p_sys->param.i_bframe_pyramid = X264_B_PYRAMID_STRICT; + } + else if ( !strcmp( psz_val, "none" ) ) + { + p_sys->param.i_bframe_pyramid = X264_B_PYRAMID_NONE; + } + free( psz_val ); i_val = var_GetInteger( p_enc, SOUT_CFG_PREFIX "ref" ); -- 2.39.2