Commit ab2f29bf authored by Christophe Massiot's avatar Christophe Massiot

* modules/codec/ffmpeg: New --no-sout-ffmpeg-interlace-me option. Fixed

   repeat_first_field handling.
parent 91b6f326
...@@ -134,7 +134,7 @@ struct encoder_sys_t ...@@ -134,7 +134,7 @@ struct encoder_sys_t
float f_rc_buffer_aggressivity; float f_rc_buffer_aggressivity;
vlc_bool_t b_pre_me; vlc_bool_t b_pre_me;
vlc_bool_t b_hurry_up; vlc_bool_t b_hurry_up;
vlc_bool_t b_interlace; vlc_bool_t b_interlace, b_interlace_me;
float f_i_quant_factor; float f_i_quant_factor;
int i_noise_reduction; int i_noise_reduction;
vlc_bool_t b_mpeg4_matrix; vlc_bool_t b_mpeg4_matrix;
...@@ -261,6 +261,9 @@ int E_(OpenEncoder)( vlc_object_t *p_this ) ...@@ -261,6 +261,9 @@ int E_(OpenEncoder)( vlc_object_t *p_this )
var_Get( p_enc, ENC_CFG_PREFIX "interlace", &val ); var_Get( p_enc, ENC_CFG_PREFIX "interlace", &val );
p_sys->b_interlace = val.b_bool; p_sys->b_interlace = val.b_bool;
var_Get( p_enc, ENC_CFG_PREFIX "interlace-me", &val );
p_sys->b_interlace_me = val.b_bool;
var_Get( p_enc, ENC_CFG_PREFIX "pre-me", &val ); var_Get( p_enc, ENC_CFG_PREFIX "pre-me", &val );
p_sys->b_pre_me = val.b_bool; p_sys->b_pre_me = val.b_bool;
...@@ -438,10 +441,20 @@ int E_(OpenEncoder)( vlc_object_t *p_this ) ...@@ -438,10 +441,20 @@ int E_(OpenEncoder)( vlc_object_t *p_this )
} }
if ( p_sys->b_interlace ) if ( p_sys->b_interlace )
{
if ( p_context->height <= 280 )
{
msg_Warn( p_enc,
"disabling interlaced video because height=%d <= 280",
p_context->height );
}
else
{ {
p_context->flags |= CODEC_FLAG_INTERLACED_DCT; p_context->flags |= CODEC_FLAG_INTERLACED_DCT;
#if LIBAVCODEC_BUILD >= 4698 #if LIBAVCODEC_BUILD >= 4698
if ( p_sys->b_interlace_me )
p_context->flags |= CODEC_FLAG_INTERLACED_ME; p_context->flags |= CODEC_FLAG_INTERLACED_ME;
}
#endif #endif
} }
...@@ -664,7 +677,7 @@ static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pict ) ...@@ -664,7 +677,7 @@ static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pict )
/* Let ffmpeg select the frame type */ /* Let ffmpeg select the frame type */
frame.pict_type = 0; frame.pict_type = 0;
frame.repeat_pict = 2 - p_pict->i_nb_fields; frame.repeat_pict = p_pict->i_nb_fields - 2;
#if LIBAVCODEC_BUILD >= 4685 #if LIBAVCODEC_BUILD >= 4685
frame.interlaced_frame = !p_pict->b_progressive; frame.interlaced_frame = !p_pict->b_progressive;
......
...@@ -137,6 +137,8 @@ vlc_module_begin(); ...@@ -137,6 +137,8 @@ vlc_module_begin();
ENC_HURRYUP_LONGTEXT, VLC_FALSE ); ENC_HURRYUP_LONGTEXT, VLC_FALSE );
add_bool( ENC_CFG_PREFIX "interlace", 0, NULL, ENC_INTERLACE_TEXT, add_bool( ENC_CFG_PREFIX "interlace", 0, NULL, ENC_INTERLACE_TEXT,
ENC_INTERLACE_LONGTEXT, VLC_TRUE ); ENC_INTERLACE_LONGTEXT, VLC_TRUE );
add_bool( ENC_CFG_PREFIX "interlace-me", 1, NULL, ENC_INTERLACE_ME_TEXT,
ENC_INTERLACE_ME_LONGTEXT, VLC_TRUE );
add_integer( ENC_CFG_PREFIX "vt", 0, NULL, ENC_VT_TEXT, add_integer( ENC_CFG_PREFIX "vt", 0, NULL, ENC_VT_TEXT,
ENC_VT_LONGTEXT, VLC_TRUE ); ENC_VT_LONGTEXT, VLC_TRUE );
add_bool( ENC_CFG_PREFIX "pre-me", 0, NULL, ENC_PRE_ME_TEXT, add_bool( ENC_CFG_PREFIX "pre-me", 0, NULL, ENC_PRE_ME_TEXT,
......
...@@ -186,6 +186,10 @@ void E_(ClosePostproc)( decoder_t *, void * ); ...@@ -186,6 +186,10 @@ void E_(ClosePostproc)( decoder_t *, void * );
#define ENC_INTERLACE_LONGTEXT N_( "Allows you to enable dedicated " \ #define ENC_INTERLACE_LONGTEXT N_( "Allows you to enable dedicated " \
"algorithms for interlaced frames." ) "algorithms for interlaced frames." )
#define ENC_INTERLACE_ME_TEXT N_( "Enable interlaced motion estimation" )
#define ENC_INTERLACE_ME_LONGTEXT N_( "Allows you to enable interlaced " \
"motion estimation algorithms. It requires more CPU." )
#define ENC_PRE_ME_TEXT N_( "Enable pre motion estimation" ) #define ENC_PRE_ME_TEXT N_( "Enable pre motion estimation" )
#define ENC_PRE_ME_LONGTEXT N_( "Allows you to enable the pre motion " \ #define ENC_PRE_ME_LONGTEXT N_( "Allows you to enable the pre motion " \
"estimation." ) "estimation." )
......
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