From: Loren Merritt Date: Tue, 19 Apr 2005 23:09:29 +0000 (+0000) Subject: combined L0 & L1 reference lists are limited to a total of 16 pics. X-Git-Url: http://www.zmx.ovh/git.videolan.org/?a=commitdiff_plain;h=9b44391701779bfb0d291592d1d81c70bcf6c116;p=x264.git combined L0 & L1 reference lists are limited to a total of 16 pics. git-svn-id: svn://svn.videolan.org/x264/trunk@214 df754926-b1dd-0310-bc7b-ec298dee348c --- diff --git a/encoder/encoder.c b/encoder/encoder.c index 39c5f1cf..0075f042 100644 --- a/encoder/encoder.c +++ b/encoder/encoder.c @@ -383,7 +383,7 @@ x264_t *x264_encoder_open ( x264_param_t *param ) h->frames.i_max_ref0 = h->param.i_frame_reference; h->frames.i_max_ref1 = h->param.b_bframe_pyramid ? 2 : h->param.i_bframe ? 1 : 0; - h->frames.i_max_dpb = h->frames.i_max_ref0 + h->frames.i_max_ref1 + 1; + h->frames.i_max_dpb = X264_MIN( 16, h->frames.i_max_ref0 + h->frames.i_max_ref1 ) + 1; h->param.i_deblocking_filter_alphac0 = x264_clip3( h->param.i_deblocking_filter_alphac0, -6, 6 ); h->param.i_deblocking_filter_beta = x264_clip3( h->param.i_deblocking_filter_beta, -6, 6 ); @@ -723,8 +723,9 @@ static inline void x264_reference_build_list( x264_t *h, int i_poc, int i_slice_ } } - h->i_ref0 = X264_MIN( h->i_ref0, h->frames.i_max_ref0 ); 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, 16 - h->i_ref1 ); } static inline void x264_reference_update( x264_t *h ) diff --git a/encoder/set.c b/encoder/set.c index e9a5e3ca..d8a8027e 100644 --- a/encoder/set.c +++ b/encoder/set.c @@ -33,9 +33,8 @@ #include #include "x264.h" -#include "common/bs.h" -#include "common/set.h" #include "config.h" +#include "common/common.h" void x264_sps_init( x264_sps_t *sps, int i_id, x264_param_t *param ) { @@ -79,11 +78,10 @@ void x264_sps_init( x264_sps_t *sps, int i_id, x264_param_t *param ) } } - sps->i_num_ref_frames = param->i_frame_reference; - if( param->i_bframe ) - sps->i_num_ref_frames++; /* for backwards ref in B */ - if( param->b_bframe_pyramid ) - sps->i_num_ref_frames++; /* for 2nd backwards ref */ + sps->vui.i_num_reorder_frames = param->b_bframe_pyramid ? 2 : param->i_bframe ? 1 : 0; + 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 + 1); + sps->b_gaps_in_frame_num_value_allowed = 0; sps->i_mb_width = ( param->i_width + 15 ) / 16; sps->i_mb_height= ( param->i_height + 15 )/ 16; @@ -143,8 +141,6 @@ void x264_sps_init( x264_sps_t *sps, int i_id, x264_param_t *param ) sps->vui.i_max_bits_per_mb_denom = 0; sps->vui.i_log2_max_mv_length_horizontal = sps->vui.i_log2_max_mv_length_vertical = (int)(log(param->analyse.i_mv_range*4-1)/log(2)) + 1; - sps->vui.i_num_reorder_frames = param->b_bframe_pyramid ? 2 : param->i_bframe ? 1 : 0; - sps->vui.i_max_dec_frame_buffering = param->i_frame_reference + sps->vui.i_num_reorder_frames + 1; } sps->b_vui |= sps->vui.b_bitstream_restriction; }