From 08e19ed8f28e5bb1fdd951eb2bab04c0248f9af1 Mon Sep 17 00:00:00 2001 From: Loren Merritt Date: Tue, 1 Nov 2005 03:34:48 +0000 Subject: [PATCH] allow 1pass ratecontrol with keyint=1 git-svn-id: svn://svn.videolan.org/x264/trunk@352 df754926-b1dd-0310-bc7b-ec298dee348c --- encoder/ratecontrol.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/encoder/ratecontrol.c b/encoder/ratecontrol.c index 71a9cbc5..e10de4c2 100644 --- a/encoder/ratecontrol.c +++ b/encoder/ratecontrol.c @@ -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); -- 2.47.3