]> granicus.if.org Git - libx264/commitdiff
allow 1pass ratecontrol with keyint=1
authorLoren Merritt <pengvado@videolan.org>
Tue, 1 Nov 2005 03:34:48 +0000 (03:34 +0000)
committerLoren Merritt <pengvado@videolan.org>
Tue, 1 Nov 2005 03:34:48 +0000 (03:34 +0000)
git-svn-id: svn://svn.videolan.org/x264/trunk@352 df754926-b1dd-0310-bc7b-ec298dee348c

encoder/ratecontrol.c

index 71a9cbc5482e44f04ab953b2b1602ca37e832ec4..e10de4c2dfcb51148f15254faaa5828ad21199c2 100644 (file)
@@ -958,7 +958,7 @@ static float rate_estimate_qscale(x264_t *h, int pict_type)
                 q *= overflow;
             }
 
-            if( pict_type == SLICE_TYPE_I
+            if( pict_type == SLICE_TYPE_I && h->param.i_keyint_max > 1
                 /* should test _next_ pict type, but that isn't decided yet */
                 && rcc->last_non_b_pict_type != SLICE_TYPE_I )
             {
@@ -968,7 +968,7 @@ static float rate_estimate_qscale(x264_t *h, int pict_type)
             }
             else
             {
-                if( h->stat.i_slice_count[SLICE_TYPE_P] < 5 )
+                if( h->stat.i_slice_count[h->param.i_keyint_max > 1 ? SLICE_TYPE_P : SLICE_TYPE_I] < 5 )
                 {
                     float w = h->stat.i_slice_count[SLICE_TYPE_P] / 5.;
                     float q2 = qp2qscale(ABR_INIT_QP);