[x264-devel] commit: Fix keyframe insertion with MB-tree and no B-frames ( Jason Garrett-Glaser )

git version control git at videolan.org
Sat Aug 8 21:53:51 CEST 2009


x264 | branch: master | Jason Garrett-Glaser <darkshikari at gmail.com> | Sat Aug  8 12:53:06 2009 -0700| [6f4054f79d3ff1034d634aabb9f9d9c8eb261bad] | committer: Jason Garrett-Glaser 

Fix keyframe insertion with MB-tree and no B-frames

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

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

diff --git a/encoder/slicetype.c b/encoder/slicetype.c
index 0762269..e4754b6 100644
--- a/encoder/slicetype.c
+++ b/encoder/slicetype.c
@@ -791,6 +791,7 @@ static void x264_slicetype_analyse( x264_t *h, int keyframe )
         for( j = 1; j < num_frames; j++ )
             frames[j]->i_type = X264_TYPE_P;
         reset_start = !keyframe + 1;
+        num_bframes = 0;
     }
 
     /* Perform the actual macroblock tree analysis.
@@ -799,16 +800,15 @@ static void x264_slicetype_analyse( x264_t *h, int keyframe )
         x264_macroblock_tree( h, &a, frames, X264_MIN(num_analysed_frames, h->param.rc.i_lookahead), keyframe );
 
     /* Enforce keyframe limit. */
-    if( h->param.i_bframe )
-        for( j = 0; j <= num_bframes; j++ )
-            if( j+1 > keyint_limit )
-            {
-                if( j )
-                    frames[j]->i_type = X264_TYPE_P;
-                frames[j+1]->i_type = idr_frame_type;
-                reset_start = j+2;
-                break;
-            }
+    for( j = 0; j <= num_bframes; j++ )
+        if( j+1 > keyint_limit )
+        {
+            if( j )
+                frames[j]->i_type = X264_TYPE_P;
+            frames[j+1]->i_type = idr_frame_type;
+            reset_start = j+2;
+            break;
+        }
 
     /* Restore frametypes for all frames that haven't actually been decided yet. */
     for( j = reset_start; j <= num_frames; j++ )



More information about the x264-devel mailing list