From: Jason Garrett-Glaser Date: Wed, 14 Jan 2009 01:22:36 +0000 (-0500) Subject: Support forced frametypes with scenecut/b-adapt X-Git-Url: http://www.zmx.ovh/git.videolan.org/?a=commitdiff_plain;h=79bfb039de253c986986fbd99935c0d4a95ad503;p=x264.git Support forced frametypes with scenecut/b-adapt This allows an input qpfile to be used to force I-frames, for example. The same can be done through the library interface. Document the format of the qpfile in --longhelp and the forcing of frametypes in x264.h Note that forcing B-frames and B-refs may not always have the intended result. Patch partially by Steven Walters . --- diff --git a/encoder/slicetype.c b/encoder/slicetype.c index b24e5b6f..e00be6f8 100644 --- a/encoder/slicetype.c +++ b/encoder/slicetype.c @@ -489,7 +489,7 @@ static void x264_slicetype_analyse( x264_t *h ) if( !h->frames.last_nonb ) return; frames[0] = h->frames.last_nonb; - for( j = 0; h->frames.next[j]; j++ ) + for( j = 0; h->frames.next[j] && h->frames.next[j]->i_type == X264_TYPE_AUTO; j++ ) frames[j+1] = h->frames.next[j]; keyint_limit = h->param.i_keyint_max - frames[0]->i_frame + h->frames.i_last_idr - 1; num_frames = X264_MIN( j, keyint_limit ); @@ -630,10 +630,8 @@ void x264_slicetype_decide( x264_t *h ) frm->i_type = X264_TYPE_P; } - if( frm->i_type != X264_TYPE_AUTO && frm->i_type != X264_TYPE_B && frm->i_type != X264_TYPE_BREF ) - break; - - frm->i_type = X264_TYPE_B; + if( frm->i_type == X264_TYPE_AUTO ) frm->i_type = X264_TYPE_B; + else if( !IS_X264_TYPE_B( frm->i_type ) ) break; } } diff --git a/x264.c b/x264.c index a1a8c94f..e1499452 100644 --- a/x264.c +++ b/x264.c @@ -220,7 +220,9 @@ static void Help( x264_param_t *defaults, int b_longhelp ) " where