]> git.videolan.org Git - x264.git/commitdiff
Don't use 2 L1 refs with pyramid + ref=1
authorJason Garrett-Glaser <darkshikari@gmail.com>
Mon, 29 Mar 2010 03:40:42 +0000 (20:40 -0700)
committerJason Garrett-Glaser <darkshikari@gmail.com>
Wed, 31 Mar 2010 17:42:30 +0000 (10:42 -0700)
Slightly faster encoding with ref=1.

encoder/encoder.c

index 9f45e6a98e63d4e47e294bb2efad72d85864f2bf..0ef50175e4b4b80082e944b3c9d7b43b45b3d197 100644 (file)
@@ -957,7 +957,7 @@ x264_t *x264_encoder_open( x264_param_t *param )
     h->frames.i_bframe_delay = h->param.i_bframe ? (h->param.i_bframe_pyramid ? 2 : 1) : 0;
 
     h->frames.i_max_ref0 = h->param.i_frame_reference;
-    h->frames.i_max_ref1 = h->sps->vui.i_num_reorder_frames;
+    h->frames.i_max_ref1 = X264_MIN( h->sps->vui.i_num_reorder_frames, h->param.i_frame_reference );
     h->frames.i_max_dpb  = h->sps->vui.i_max_dec_frame_buffering;
     h->frames.b_have_lowres = !h->param.rc.b_stat_read
         && ( h->param.rc.i_rc_method == X264_RC_ABR