change the meaning of --ref: it now selects DPB size (including B-frames), rather...
authorLoren Merritt <pengvado@videolan.org>
Fri, 18 Jan 2008 00:42:38 +0000 (00:42 +0000)
committerLoren Merritt <pengvado@videolan.org>
Fri, 18 Jan 2008 00:42:38 +0000 (00:42 +0000)
git-svn-id: svn://svn.videolan.org/x264/trunk@721 df754926-b1dd-0310-bc7b-ec298dee348c

encoder/encoder.c
encoder/set.c

index 5ebf000..4b8647c 100644 (file)
@@ -885,7 +885,7 @@ static inline void x264_reference_build_list( x264_t *h, int i_poc )
     h->i_ref1 = X264_MIN( h->i_ref1, h->frames.i_max_ref1 );
     h->i_ref0 = X264_MIN( h->i_ref0, h->frames.i_max_ref0 );
     h->i_ref0 = X264_MIN( h->i_ref0, h->param.i_frame_reference ); // if reconfig() has lowered the limit
-    h->i_ref0 = X264_MIN( h->i_ref0, 16 - h->i_ref1 );
+    assert( h->i_ref0 + h->i_ref1 <= 16 );
     h->mb.pic.i_fref[0] = h->i_ref0;
     h->mb.pic.i_fref[1] = h->i_ref1;
 }
index 023bec3..63b1134 100644 (file)
@@ -196,7 +196,7 @@ void x264_sps_init( x264_sps_t *sps, int i_id, x264_param_t *param )
     /* extra slot with pyramid so that we don't have to override the
      * order of forgetting old pictures */
     sps->vui.i_max_dec_frame_buffering =
-    sps->i_num_ref_frames = X264_MIN(16, param->i_frame_reference + sps->vui.i_num_reorder_frames + param->b_bframe_pyramid);
+    sps->i_num_ref_frames = X264_MIN(16, X264_MAX(param->i_frame_reference, 1 + sps->vui.i_num_reorder_frames));
 
     sps->vui.b_bitstream_restriction = 1;
     if( sps->vui.b_bitstream_restriction )