[x264-devel] commit: Fix keyint=1 + VBV + rc-lookahead (Jason Garrett-Glaser )

git version control git at videolan.org
Thu Aug 27 08:57:54 CEST 2009


x264 | branch: master | Jason Garrett-Glaser <darkshikari at gmail.com> | Wed Aug 26 20:30:47 2009 -0700| [448b1387254bbf186b83db0fd393477ea1d01a55] | committer: Jason Garrett-Glaser 

Fix keyint=1 + VBV + rc-lookahead

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=448b1387254bbf186b83db0fd393477ea1d01a55
---

 encoder/encoder.c   |    2 ++
 encoder/slicetype.c |    2 +-
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/encoder/encoder.c b/encoder/encoder.c
index a7c2f7f..e679688 100644
--- a/encoder/encoder.c
+++ b/encoder/encoder.c
@@ -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 )
diff --git a/encoder/slicetype.c b/encoder/slicetype.c
index 14ab0b8..dfd242c 100644
--- a/encoder/slicetype.c
+++ b/encoder/slicetype.c
@@ -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 );



More information about the x264-devel mailing list