Commit 1ca108eb authored by Loren Merritt's avatar Loren Merritt

set the SPS constraint_set[01]_flag based on the profile in use, just in case some decoder cares



git-svn-id: svn://svn.videolan.org/x264/trunk@523 df754926-b1dd-0310-bc7b-ec298dee348c
parent de1af4c2
......@@ -376,6 +376,7 @@ static int x264_validate_parameters( x264_t *h )
h->param.i_bframe_bias = x264_clip3( h->param.i_bframe_bias, -90, 100 );
h->param.b_bframe_pyramid = h->param.b_bframe_pyramid && h->param.i_bframe > 1;
h->param.b_bframe_adaptive = h->param.b_bframe_adaptive && h->param.i_bframe > 0;
h->param.analyse.b_weighted_bipred = h->param.analyse.b_weighted_bipred && h->param.i_bframe > 0;
h->mb.b_direct_auto_write = h->param.analyse.i_direct_mv_pred == X264_DIRECT_PRED_AUTO
&& h->param.i_bframe
&& ( h->param.rc.b_stat_write || !h->param.rc.b_stat_read );
......@@ -441,7 +442,6 @@ static int x264_validate_parameters( x264_t *h )
BOOLIFY( b_cabac );
BOOLIFY( b_deblocking_filter );
BOOLIFY( analyse.b_transform_8x8 );
BOOLIFY( analyse.b_weighted_bipred );
BOOLIFY( analyse.b_bidir_me );
BOOLIFY( analyse.b_chroma_me );
BOOLIFY( analyse.b_fast_pskip );
......
......@@ -88,8 +88,11 @@ void x264_sps_init( x264_sps_t *sps, int i_id, x264_param_t *param )
sps->i_profile_idc = PROFILE_BASELINE;
sps->i_level_idc = param->i_level_idc;
sps->b_constraint_set0 = 0;
sps->b_constraint_set1 = 0;
sps->b_constraint_set0 = sps->i_profile_idc == PROFILE_BASELINE;
/* x264 doesn't support the features that are in Baseline and not in Main,
* namely arbitrary_slice_order and slice_groups. */
sps->b_constraint_set1 = sps->i_profile_idc <= PROFILE_MAIN;
/* Never set constraint_set2, it is not necessary and not used in real world. */
sps->b_constraint_set2 = 0;
sps->i_log2_max_frame_num = 4; /* at least 4 */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment