Commit 418d4e21 authored by Gildas Bazin's avatar Gildas Bazin

* modules/codec/ffmpeg: added ffmpeg-skiploopfilter option for H264 decoding.

parent b26f433d
...@@ -70,6 +70,10 @@ struct decoder_sys_t ...@@ -70,6 +70,10 @@ struct decoder_sys_t
static int OpenDecoder( vlc_object_t * ); static int OpenDecoder( vlc_object_t * );
static void CloseDecoder( vlc_object_t * ); static void CloseDecoder( vlc_object_t * );
static int nloopf_list[] = { 0, 1, 2, 3, 4 };
static char *nloopf_list_text[] =
{ N_("None"), N_("Non-ref"), N_("Bidir"), N_("Non-key"), N_("All") };
static char *enc_hq_list[] = { "rd", "bits", "simple" }; static char *enc_hq_list[] = { "rd", "bits", "simple" };
static char *enc_hq_list_text[] = { N_("rd"), N_("bits"), N_("simple") }; static char *enc_hq_list_text[] = { N_("rd"), N_("bits"), N_("simple") };
/***************************************************************************** /*****************************************************************************
...@@ -104,6 +108,9 @@ vlc_module_begin(); ...@@ -104,6 +108,9 @@ vlc_module_begin();
add_integer ( "ffmpeg-lowres", 0, NULL, LOWRES_TEXT, LOWRES_LONGTEXT, add_integer ( "ffmpeg-lowres", 0, NULL, LOWRES_TEXT, LOWRES_LONGTEXT,
VLC_TRUE ); VLC_TRUE );
change_integer_range( 0, 2 ); change_integer_range( 0, 2 );
add_integer ( "ffmpeg-skiploopfilter", 0, NULL, SKIPLOOPF_TEXT,
SKIPLOOPF_LONGTEXT, VLC_TRUE );
change_integer_list( nloopf_list, nloopf_list_text, 0 );
#ifdef LIBAVCODEC_PP #ifdef LIBAVCODEC_PP
add_integer( "ffmpeg-pp-q", 0, NULL, PP_Q_TEXT, PP_Q_LONGTEXT, VLC_FALSE ); add_integer( "ffmpeg-pp-q", 0, NULL, PP_Q_TEXT, PP_Q_LONGTEXT, VLC_FALSE );
......
...@@ -128,6 +128,11 @@ void E_(ClosePostproc)( decoder_t *, void * ); ...@@ -128,6 +128,11 @@ void E_(ClosePostproc)( decoder_t *, void * );
#define LOWRES_LONGTEXT N_( "Will only decode a low resolution version of " \ #define LOWRES_LONGTEXT N_( "Will only decode a low resolution version of " \
"the video." ) "the video." )
#define SKIPLOOPF_TEXT N_( "Skip the loop filter for H.264 decoding" )
#define SKIPLOOPF_LONGTEXT N_( "Skipping the loop filter (aka deblocking) " \
"usually has a detrimental effect on quality. However for HDTV streams " \
"this provides a big speedup." )
#define LIBAVCODEC_PP_TEXT N_("ffmpeg post processing filter chains") #define LIBAVCODEC_PP_TEXT N_("ffmpeg post processing filter chains")
/* FIXME (cut/past from ffmpeg */ /* FIXME (cut/past from ffmpeg */
#define LIBAVCODEC_PP_LONGTEXT \ #define LIBAVCODEC_PP_LONGTEXT \
......
...@@ -275,6 +275,16 @@ int E_(InitVideoDec)( decoder_t *p_dec, AVCodecContext *p_context, ...@@ -275,6 +275,16 @@ int E_(InitVideoDec)( decoder_t *p_dec, AVCodecContext *p_context,
if( val.i_int > 0 && val.i_int <= 2 ) p_sys->p_context->lowres = val.i_int; if( val.i_int > 0 && val.i_int <= 2 ) p_sys->p_context->lowres = val.i_int;
#endif #endif
var_Create( p_dec, "ffmpeg-skiploopfilter",
VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
var_Get( p_dec, "ffmpeg-skiploopfilter", &val );
#if LIBAVCODEC_BUILD >= 4758
if( val.i_int > 0 ) p_sys->p_context->skip_loop_filter = AVDISCARD_NONREF;
if( val.i_int > 1 ) p_sys->p_context->skip_loop_filter = AVDISCARD_BIDIR;
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;
#endif
/* ***** ffmpeg frame skipping ***** */ /* ***** ffmpeg frame skipping ***** */
var_Create( p_dec, "ffmpeg-hurry-up", VLC_VAR_BOOL | VLC_VAR_DOINHERIT ); var_Create( p_dec, "ffmpeg-hurry-up", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
var_Get( p_dec, "ffmpeg-hurry-up", &val ); 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