]> git.sesse.net Git - vlc/commitdiff
* modules/codec/ffmpeg: added ffmpeg-skiploopfilter option for H264 decoding.
authorGildas Bazin <gbazin@videolan.org>
Sun, 13 Nov 2005 10:52:33 +0000 (10:52 +0000)
committerGildas Bazin <gbazin@videolan.org>
Sun, 13 Nov 2005 10:52:33 +0000 (10:52 +0000)
modules/codec/ffmpeg/ffmpeg.c
modules/codec/ffmpeg/ffmpeg.h
modules/codec/ffmpeg/video.c

index e6a4ed86a8aab4f9c6342d1c21154e87344f9816..bcb2b0efc39b114acb8151eb1f2d9387f3592fd5 100644 (file)
@@ -70,6 +70,10 @@ struct decoder_sys_t
 static int OpenDecoder( 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_text[] = { N_("rd"), N_("bits"), N_("simple") };
 /*****************************************************************************
@@ -104,6 +108,9 @@ vlc_module_begin();
     add_integer ( "ffmpeg-lowres", 0, NULL, LOWRES_TEXT, LOWRES_LONGTEXT,
         VLC_TRUE );
         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
     add_integer( "ffmpeg-pp-q", 0, NULL, PP_Q_TEXT, PP_Q_LONGTEXT, VLC_FALSE );
index 0469ff0455be60f932a724c4edd32fc76937bbdc..c8d9d18c391b2e285f1a6ce0df49838f5cd8984c 100644 (file)
@@ -128,6 +128,11 @@ void E_(ClosePostproc)( decoder_t *, void * );
 #define LOWRES_LONGTEXT N_( "Will only decode a low resolution version of " \
     "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")
 /* FIXME (cut/past from ffmpeg */
 #define LIBAVCODEC_PP_LONGTEXT \
index 70b28b60228fc4164b49832ef465ed2c4c00f320..9155af11103b28f37f92b4003a34d9a5a2dfd9f4 100644 (file)
@@ -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;
 #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 ***** */
     var_Create( p_dec, "ffmpeg-hurry-up", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
     var_Get( p_dec, "ffmpeg-hurry-up", &val );