]> granicus.if.org Git - libx264/commitdiff
Fix keyint=1 + VBV + rc-lookahead
authorFiona Glaser <fiona@x264.com>
Thu, 27 Aug 2009 03:30:47 +0000 (20:30 -0700)
committerFiona Glaser <fiona@x264.com>
Thu, 27 Aug 2009 06:57:39 +0000 (23:57 -0700)
encoder/encoder.c
encoder/slicetype.c

index 955b2ec1b250487f032c07452cb599f64dd1bd3f..c87ae905b88477b85486b5ba767780537cdeb33b 100644 (file)
@@ -478,6 +478,8 @@ static int x264_validate_parameters( x264_t *h )
         h->param.analyse.i_direct_mv_pred = X264_DIRECT_PRED_SPATIAL;
     }
     h->param.i_bframe = x264_clip3( h->param.i_bframe, 0, X264_BFRAME_MAX );
+    if( h->param.i_keyint_max == 1 )
+        h->param.i_bframe = 0;
     h->param.i_bframe_bias = x264_clip3( h->param.i_bframe_bias, -90, 100 );
     h->param.b_bframe_pyramid = h->param.b_bframe_pyramid && h->param.i_bframe > 1;
     if( !h->param.i_bframe )
index 75dc020701c75fd256959a3231f8e474b8d23e37..aec76a4d67967a431f8b0178615971bf31a7107c 100644 (file)
@@ -861,7 +861,7 @@ static void x264_slicetype_analyse( x264_t *h, int keyframe )
     {
         if( ((j-keyint_limit) % h->param.i_keyint_max) == 0 )
         {
-            if( j )
+            if( j && h->param.i_keyint_max > 1 )
                 frames[j]->i_type = X264_TYPE_P;
             frames[j+1]->i_type = X264_TYPE_IDR;
             reset_start = X264_MIN( reset_start, j+2 );