Commit c36b7e7f authored by Olivier Crête's avatar Olivier Crête

Set the constraint_set flags for progressive and constrained high profiles.

parent 6b961924
Pipeline #24371 passed with stages
in 9 minutes and 1 second
......@@ -53,6 +53,8 @@ typedef struct
int b_constraint_set1;
int b_constraint_set2;
int b_constraint_set3;
int b_constraint_set4;
int b_constraint_set5;
int i_log2_max_frame_num;
......
......@@ -133,6 +133,8 @@ void x264_sps_init( x264_sps_t *sps, int i_id, x264_param_t *param )
/* Never set constraint_set2, it is not necessary and not used in real world. */
sps->b_constraint_set2 = 0;
sps->b_constraint_set3 = 0;
sps->b_constraint_set4 = 0;
sps->b_constraint_set5 = 0;
sps->i_level_idc = param->i_level_idc;
if( param->i_level_idc == 9 && ( sps->i_profile_idc == PROFILE_BASELINE || sps->i_profile_idc == PROFILE_MAIN ) )
......@@ -144,6 +146,16 @@ void x264_sps_init( x264_sps_t *sps, int i_id, x264_param_t *param )
if( param->i_keyint_max == 1 && sps->i_profile_idc >= PROFILE_HIGH )
sps->b_constraint_set3 = 1;
if( ( sps->i_profile_idc == PROFILE_HIGH || sps->i_profile_idc == PROFILE_HIGH10 ) && sps->b_frame_mbs_only )
{
sps->b_constraint_set4 = 1;
if( sps->i_profile_idc == PROFILE_HIGH && param->i_bframe == 0 )
{
sps->b_constraint_set5 = 1;
}
}
sps->vui.i_num_reorder_frames = param->i_bframe_pyramid ? 2 : param->i_bframe ? 1 : 0;
/* extra slot with pyramid so that we don't have to override the
* order of forgetting old pictures */
......@@ -309,8 +321,10 @@ void x264_sps_write( bs_t *s, x264_sps_t *sps )
bs_write1( s, sps->b_constraint_set1 );
bs_write1( s, sps->b_constraint_set2 );
bs_write1( s, sps->b_constraint_set3 );
bs_write1( s, sps->b_constraint_set4 );
bs_write1( s, sps->b_constraint_set5 );
bs_write( s, 4, 0 ); /* reserved */
bs_write( s, 2, 0 ); /* reserved */
bs_write( s, 8, sps->i_level_idc );
......
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