Commit f7db531c authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

backport [16929] (x264 interlaced options)

parent 008224da
...@@ -103,6 +103,14 @@ static void Close( vlc_object_t * ); ...@@ -103,6 +103,14 @@ static void Close( vlc_object_t * );
"Range -6 to 6 for both alpha and beta parameters. -6 means light " \ "Range -6 to 6 for both alpha and beta parameters. -6 means light " \
"filter, 6 means strong.") "filter, 6 means strong.")
/* In order to play an interlaced output stream encoded by x264, a decoder needs
mbaff support. r570 is using the 'mb' part and not 'aff' yet; so it's really
'pure-interlaced' mode */
#if X264_BUILD >= 51 /* r570 */
#define INTERLACED_TEXT N_("Interlaced mode")
#define INTERLACED_LONGTEXT N_( "Pure-interlaced mode.")
#endif
/* Ratecontrol */ /* Ratecontrol */
#define QP_TEXT N_("Set QP") #define QP_TEXT N_("Set QP")
...@@ -174,6 +182,14 @@ static void Close( vlc_object_t * ); ...@@ -174,6 +182,14 @@ static void Close( vlc_object_t * );
#define DIRECT_PRED_TEXT N_("Direct MV prediction mode") #define DIRECT_PRED_TEXT N_("Direct MV prediction mode")
#define DIRECT_PRED_LONGTEXT N_( "Direct MV prediction mode.") #define DIRECT_PRED_LONGTEXT N_( "Direct MV prediction mode.")
#if X264_BUILD >= 52 /* r573 */
#define DIRECT_PRED_SIZE_TEXT N_("Direct prediction size")
#define DIRECT_PRED_SIZE_LONGTEXT N_( "Direct prediction size: "\
" - 0: 4x4\n" \
" - 1: 8x8\n" \
" - -1: smallest possible according to level\n" )
#endif
#define WEIGHTB_TEXT N_("Weighted prediction for B-frames") #define WEIGHTB_TEXT N_("Weighted prediction for B-frames")
#define WEIGHTB_LONGTEXT N_( "Weighted prediction for B-frames.") #define WEIGHTB_LONGTEXT N_( "Weighted prediction for B-frames.")
...@@ -248,6 +264,16 @@ static void Close( vlc_object_t * ); ...@@ -248,6 +264,16 @@ static void Close( vlc_object_t * );
#define NR_LONGTEXT N_( "Dct-domain noise reduction. Adaptive pseudo-deadzone. " \ #define NR_LONGTEXT N_( "Dct-domain noise reduction. Adaptive pseudo-deadzone. " \
"10 to 1000 seems to be a useful range." ) "10 to 1000 seems to be a useful range." )
#if X264_BUILD >= 52 /* r573 */
#define DEADZONE_INTER_TEXT N_("Inter luma quantization deadzone")
#define DEADZONE_INTER_LONGTEXT N_( "Set the size of the inter luma quantization deadzone. " \
"Range 0 to 32." )
#define DEADZONE_INTRA_TEXT N_("Intra luma quantization deadzone")
#define DEADZONE_INTRA_LONGTEXT N_( "Set the size of the intra luma quantization deadzone. " \
"Range 0 to 32." )
#endif
/* Input/Output */ /* Input/Output */
#define ASM_TEXT N_("CPU optimizations") #define ASM_TEXT N_("CPU optimizations")
...@@ -343,6 +369,11 @@ vlc_module_begin(); ...@@ -343,6 +369,11 @@ vlc_module_begin();
add_string( SOUT_CFG_PREFIX "filter", "", NULL, FILTER_TEXT, add_string( SOUT_CFG_PREFIX "filter", "", NULL, FILTER_TEXT,
FILTER_LONGTEXT, VLC_FALSE ); FILTER_LONGTEXT, VLC_FALSE );
#if X264_BUILD >= 51 /* r570 */
add_bool( SOUT_CFG_PREFIX "interlaced", 0, NULL, INTERLACED_TEXT, INTERLACED_LONGTEXT,
VLC_FALSE );
#endif
/* Ratecontrol */ /* Ratecontrol */
add_integer( SOUT_CFG_PREFIX "qp", 26, NULL, QP_TEXT, QP_LONGTEXT, add_integer( SOUT_CFG_PREFIX "qp", 26, NULL, QP_TEXT, QP_LONGTEXT,
...@@ -418,6 +449,12 @@ vlc_module_begin(); ...@@ -418,6 +449,12 @@ vlc_module_begin();
DIRECT_PRED_LONGTEXT, VLC_FALSE ); DIRECT_PRED_LONGTEXT, VLC_FALSE );
change_string_list( direct_pred_list, direct_pred_list_text, 0 ); change_string_list( direct_pred_list, direct_pred_list_text, 0 );
#if X264_BUILD >= 52 /* r573 */
add_integer( SOUT_CFG_PREFIX "direct-8x8", 0, NULL, DIRECT_PRED_SIZE_TEXT,
DIRECT_PRED_SIZE_LONGTEXT, VLC_FALSE );
change_integer_range( -1, 1 );
#endif
#if X264_BUILD >= 0x0012 /* r134 */ #if X264_BUILD >= 0x0012 /* r134 */
add_bool( SOUT_CFG_PREFIX "weightb", 0, NULL, WEIGHTB_TEXT, add_bool( SOUT_CFG_PREFIX "weightb", 0, NULL, WEIGHTB_TEXT,
WEIGHTB_LONGTEXT, VLC_FALSE ); WEIGHTB_LONGTEXT, VLC_FALSE );
...@@ -485,6 +522,16 @@ vlc_module_begin(); ...@@ -485,6 +522,16 @@ vlc_module_begin();
change_integer_range( 0, 1000 ); change_integer_range( 0, 1000 );
#endif #endif
#if X264_BUILD >= 52 /* r573 */
add_integer( SOUT_CFG_PREFIX "deadzone-inter", 21, NULL, DEADZONE_INTER_TEXT,
DEADZONE_INTRA_LONGTEXT, VLC_FALSE );
change_integer_range( 0, 32 );
add_integer( SOUT_CFG_PREFIX "deadzone-intra", 11, NULL, DEADZONE_INTRA_TEXT,
DEADZONE_INTRA_LONGTEXT, VLC_FALSE );
change_integer_range( 0, 32 );
#endif
/* Input/Output */ /* Input/Output */
#if defined(__DARWIN__) && defined(__INTEL__) #if defined(__DARWIN__) && defined(__INTEL__)
...@@ -521,13 +568,13 @@ vlc_module_end(); ...@@ -521,13 +568,13 @@ vlc_module_end();
static const char *ppsz_sout_options[] = { static const char *ppsz_sout_options[] = {
"8x8dct", "analyse", "asm", "bframes", "bime", "bpyramid", "b-adapt", "8x8dct", "analyse", "asm", "bframes", "bime", "bpyramid", "b-adapt",
"b-bias", "b-rdo", "cabac", "chroma-me", "chroma-qp-offset", "cplxblur", "b-bias", "b-rdo", "cabac", "chroma-me", "chroma-qp-offset", "cplxblur",
"crf", "dct-decimate", "direct", "filter", "fast-pskip", "frameref", "crf", "dct-decimate", "deadzone-inter", "deadzone-intra", "direct",
"ipratio", "keyint", "keyint-min", "loopfilter", "me", "merange", "direct-8x8", "filter", "fast-pskip", "frameref", "interlaced", "ipratio",
"min-keyint", "mixed-refs", "nf", "nr", "pbratio", "psnr", "qblur", "keyint", "keyint-min", "loopfilter", "me", "merange", "min-keyint",
"qp", "qcomp", "qpstep", "qpmax", "qpmin", "qp-max", "qp-min", "quiet", "mixed-refs", "nf", "nr", "pbratio", "psnr", "qblur", "qp", "qcomp",
"ratetol", "ref", "scenecut", "ssim", "subme", "subpel", "tolerance", "qpstep", "qpmax", "qpmin", "qp-max", "qp-min", "quiet", "ratetol",
"trellis", "verbose", "vbv-bufsize", "vbv-init", "vbv-maxrate", "ref", "scenecut", "ssim", "subme", "subpel", "tolerance", "trellis", "verbose",
"weightb", NULL "vbv-bufsize", "vbv-init", "vbv-maxrate", "weightb", NULL
}; };
static block_t *Encode( encoder_t *, picture_t * ); static block_t *Encode( encoder_t *, picture_t * );
...@@ -673,6 +720,11 @@ static int Open ( vlc_object_t *p_this ) ...@@ -673,6 +720,11 @@ static int Open ( vlc_object_t *p_this )
free( val.psz_string ); free( val.psz_string );
} }
#if X264_BUILD >= 51 /* r570 */
var_Get( p_enc, SOUT_CFG_PREFIX "interlaced", &val );
p_sys->param.b_interlaced = val.b_bool;
#endif
var_Get( p_enc, SOUT_CFG_PREFIX "ipratio", &val ); var_Get( p_enc, SOUT_CFG_PREFIX "ipratio", &val );
p_sys->param.rc.f_ip_factor = val.f_float; p_sys->param.rc.f_ip_factor = val.f_float;
...@@ -856,6 +908,20 @@ static int Open ( vlc_object_t *p_this ) ...@@ -856,6 +908,20 @@ static int Open ( vlc_object_t *p_this )
p_sys->param.analyse.b_dct_decimate = val.b_bool; p_sys->param.analyse.b_dct_decimate = val.b_bool;
#endif #endif
#if X264_BUILD >= 52
var_Get( p_enc, SOUT_CFG_PREFIX "deadzone-inter", &val );
if( val.i_int >= 0 && val.i_int <= 32 )
p_sys->param.analyse.i_luma_deadzone[0] = val.i_int;
var_Get( p_enc, SOUT_CFG_PREFIX "deadzone-intra", &val );
if( val.i_int >= 0 && val.i_int <= 32 )
p_sys->param.analyse.i_luma_deadzone[1] = val.i_int;
var_Get( p_enc, SOUT_CFG_PREFIX "direct-8x8", &val );
if( val.i_int >= -1 && val.i_int <= 1 )
p_sys->param.analyse.i_direct_8x8_inference = val.i_int;
#endif
var_Get( p_enc, SOUT_CFG_PREFIX "asm", &val ); var_Get( p_enc, SOUT_CFG_PREFIX "asm", &val );
if( !val.b_bool ) p_sys->param.cpu = 0; if( !val.b_bool ) p_sys->param.cpu = 0;
......
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