Commit 6ea16503 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

FFmpeg: create --ffmpeg-fast to enable CODEC_FLAG2_FAST

This makes decoding faster but could lead to errors.
Pointed by Jason, and original code by Ludovic Fauvet.
parent 185e50a6
......@@ -121,6 +121,7 @@ vlc_module_begin ()
add_integer ( "ffmpeg-lowres", 0, NULL, LOWRES_TEXT, LOWRES_LONGTEXT,
true )
change_integer_range( 0, 2 )
add_bool( "ffmpeg-fast", 0, NULL, FAST_TEXT, FAST_LONGTEXT, true )
add_integer ( "ffmpeg-skiploopfilter", 0, NULL, SKIPLOOPF_TEXT,
SKIPLOOPF_LONGTEXT, true )
change_safe ()
......
......@@ -91,6 +91,10 @@ void EndAudioDec( decoder_t *p_dec );
"when there is not enough time. It's useful with low CPU power " \
"but it can produce distorted pictures.")
#define FAST_TEXT N_("Allow speed tricks")
#define FAST_LONGTEXT N_( \
"Allow non specification compliant speedup tricks. Faster but error-prone.")
#define SKIP_FRAME_TEXT N_("Skip frame (default=0)")
#define SKIP_FRAME_LONGTEXT N_( \
"Force skipping of frames to speed up decoding " \
......
......@@ -228,6 +228,9 @@ int InitVideoDec( decoder_t *p_dec, AVCodecContext *p_context,
if( val.i_int > 2 ) p_sys->p_context->skip_loop_filter = AVDISCARD_NONKEY;
if( val.i_int > 3 ) p_sys->p_context->skip_loop_filter = AVDISCARD_ALL;
bool b_fast = var_CreateGetBool( p_dec, "ffmpeg-fast" );
if( b_fast ) p_sys->p_context->flags2 |= CODEC_FLAG2_FAST;
/* ***** ffmpeg frame skipping ***** */
var_Create( p_dec, "ffmpeg-hurry-up", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
var_Get( p_dec, "ffmpeg-hurry-up", &val );
......
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