]> git.sesse.net Git - x264/commitdiff
Make keyint_min auto by default
authorFiona Glaser <fiona@x264.com>
Sat, 10 Apr 2010 20:15:30 +0000 (13:15 -0700)
committerFiona Glaser <fiona@x264.com>
Sun, 11 Apr 2010 04:00:33 +0000 (21:00 -0700)
Gives more reasonable default settings when using short GOPs.

common/common.c
encoder/encoder.c
x264.c
x264.h

index 2d166af97f2743dc7207f9263eb70d41d30f0042..d6c299137d4ee85f5ade1c6a3548a043cd375941 100644 (file)
@@ -70,7 +70,7 @@ void x264_param_default( x264_param_t *param )
     /* Encoder parameters */
     param->i_frame_reference = 3;
     param->i_keyint_max = 250;
-    param->i_keyint_min = 25;
+    param->i_keyint_min = X264_KEYINT_MIN_AUTO;
     param->i_bframe = 3;
     param->i_scenecut_threshold = 40;
     param->i_bframe_adaptive = X264_B_ADAPT_FAST;
index 10c5e3ab6205395f752b1b51f67f210f41bbdc96..e47f7787c54f3ca9ebb828c64626c1fe896f5ce2 100644 (file)
@@ -577,6 +577,8 @@ static int x264_validate_parameters( x264_t *h )
         x264_log( h, X264_LOG_WARNING, "ref > 1 + intra-refresh is not supported\n" );
         h->param.i_frame_reference = 1;
     }
+    if( h->param.i_keyint_min == X264_KEYINT_MIN_AUTO )
+        h->param.i_keyint_min = h->param.i_keyint_max / 10;
     h->param.i_keyint_min = x264_clip3( h->param.i_keyint_min, 1, h->param.i_keyint_max/2+1 );
     h->param.rc.i_lookahead = x264_clip3( h->param.rc.i_lookahead, 0, X264_LOOKAHEAD_MAX );
     {
diff --git a/x264.c b/x264.c
index 76ff85dbbcf3b700ed9d79afad225b2bf0596d94..add23b3bb61e380e13a4de6ef3b8cd7310d28fbe 100644 (file)
--- a/x264.c
+++ b/x264.c
@@ -363,7 +363,7 @@ static void Help( x264_param_t *defaults, int longhelp )
     H0( "Frame-type options:\n" );
     H0( "\n" );
     H0( "  -I, --keyint <integer>      Maximum GOP size [%d]\n", defaults->i_keyint_max );
-    H2( "  -i, --min-keyint <integer>  Minimum GOP size [%d]\n", defaults->i_keyint_min );
+    H2( "  -i, --min-keyint <integer>  Minimum GOP size [auto]\n" );
     H2( "      --no-scenecut           Disable adaptive I-frame decision\n" );
     H2( "      --scenecut <integer>    How aggressively to insert extra I-frames [%d]\n", defaults->i_scenecut_threshold );
     H2( "      --intra-refresh         Use Periodic Intra Refresh instead of IDR frames\n" );
diff --git a/x264.h b/x264.h
index 9157d76e6ee49754af8b35fb7a03162f19ae01d2..d30effef13c768462da6bb631e663827f4a365c1 100644 (file)
--- a/x264.h
+++ b/x264.h
@@ -35,7 +35,7 @@
 
 #include <stdarg.h>
 
-#define X264_BUILD 92
+#define X264_BUILD 93
 
 /* x264_t:
  *      opaque handler for encoder */
@@ -101,6 +101,7 @@ typedef struct x264_t x264_t;
 #define X264_B_PYRAMID_NONE          0
 #define X264_B_PYRAMID_STRICT        1
 #define X264_B_PYRAMID_NORMAL        2
+#define X264_KEYINT_MIN_AUTO         0
 
 static const char * const x264_direct_pred_names[] = { "none", "spatial", "temporal", "auto", 0 };
 static const char * const x264_motion_est_names[] = { "dia", "hex", "umh", "esa", "tesa", 0 };