[vlc-commits] [Git][videolan/vlc][master] avcodec: use a choice list for --avcodec-skip-idct as per description

Hugo Beauzée-Luyssen (@chouquette) gitlab at videolan.org
Fri Jan 7 08:02:23 UTC 2022



Hugo Beauzée-Luyssen pushed to branch master at VideoLAN / VLC


Commits:
0444c754 by Lyndon Brown at 2022-01-07T07:36:24+00:00
avcodec: use a choice list for --avcodec-skip-idct as per description

gives much better UX in gui prefs.

the range was dropped, even though ranges are enforced (mostly) unlike
value-lists within the option system, and so it can be sensible to have
them in addition to value-lists, since the avcodec module has code handling
the value of this option which maps each valid value to a specific constant
and uses a default constant for unmapped values, so keeping the range would
be pointless here.

- - - - -


2 changed files:

- modules/codec/avcodec/avcodec.c
- modules/codec/avcodec/avcodec.h


Changes:

=====================================
modules/codec/avcodec/avcodec.c
=====================================
@@ -48,6 +48,10 @@ static const int  frame_skip_list[] = { -1, 0, 1, 2, 3, 4 };
 static const char *const frame_skip_list_text[] =
   { N_("None"), N_("Default"), N_("Non-ref"), N_("Bidir"), N_("Non-key"), N_("All") };
 
+static const int  idct_skip_list[] = { -1, 0, 1, 2, 3, 4 };
+static const char *const idct_skip_list_text[] =
+  { N_("None"), N_("Default"), N_("Non-ref"), N_("Bidir"), N_("Non-key"), N_("All") };
+
 static const int  nloopf_list[] = { 0, 1, 2, 3, 4 };
 static const char *const nloopf_list_text[] =
   { N_("None"), N_("Non-ref"), N_("Bidir"), N_("Non-key"), N_("All") };
@@ -104,7 +108,7 @@ vlc_module_begin ()
         change_integer_list( frame_skip_list, frame_skip_list_text )
     add_integer( "avcodec-skip-idct", 0, SKIP_IDCT_TEXT,
         SKIP_IDCT_LONGTEXT )
-        change_integer_range( -1, 4 )
+        change_integer_list( idct_skip_list, idct_skip_list_text )
     add_obsolete_integer( "avcodec-vismv" ) /* removed since 3.0.0 */
     add_obsolete_bool( "avcodec-fast" ) /* removed since 4.0.0 */
     add_integer ( "avcodec-skiploopfilter", 0, SKIPLOOPF_TEXT,


=====================================
modules/codec/avcodec/avcodec.h
=====================================
@@ -91,8 +91,7 @@ int ffmpeg_OpenCodec( decoder_t *p_dec, AVCodecContext *, const AVCodec * );
 
 #define SKIP_IDCT_TEXT N_("Skip idct (default=0)")
 #define SKIP_IDCT_LONGTEXT N_( \
-    "Force skipping of idct to speed up decoding for frame types " \
-    "(-1=None, 0=Default, 1=B-frames, 2=P-frames, 3=B+P frames, 4=all frames)." )
+    "Force skipping of idct to speed up decoding for frame types." )
 
 #define DEBUG_TEXT N_( "Debug mask" )
 #define DEBUG_LONGTEXT NULL



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/0444c75486589a7952bfea86e2b3ba5099cd5ea8

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/0444c75486589a7952bfea86e2b3ba5099cd5ea8
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list