]> granicus.if.org Git - libx264/commitdiff
Fix bug in b-adapt 1
authorFiona Glaser <fiona@x264.com>
Fri, 14 Aug 2009 14:20:07 +0000 (07:20 -0700)
committerFiona Glaser <fiona@x264.com>
Fri, 14 Aug 2009 14:20:07 +0000 (07:20 -0700)
B-adapt 1 didn't use more than MAX(1,bframes-1) B-frames when MB-tree was off.

encoder/slicetype.c

index 6ef4320322e00319510f51ee055709536d8297ca..04305afd78ec70ae007f55fcac52eec72f29e1ba 100644 (file)
@@ -739,7 +739,7 @@ static void x264_slicetype_analyse( x264_t *h, int keyframe )
                 frames[i+1]->i_type = X264_TYPE_B;
                 frames[i+2]->i_type = X264_TYPE_P;
 
-                for( j = i+2; j <= X264_MIN( h->param.i_bframe, num_frames-2 ); j++ )
+                for( j = i+2; j <= X264_MIN( h->param.i_bframe, num_frames-1 ); j++ )
                 {
                     int pthresh = X264_MAX(INTER_THRESH - P_SENS_BIAS * (j-i-1), INTER_THRESH/10);
                     int pcost = x264_slicetype_frame_cost( h, &a, frames, i+0, j+1, j+1, 1 );