Also remove poc type 1 support (it didn't work anyways) to reduce sps size.
uint8_t *nal_buffer;
int nal_buffer_size;
- x264_sps_t *sps;
- x264_pps_t *pps;
-
/**** thread synchronization starts here ****/
/* frame number/poc */
int b_queued_intra_refresh;
int64_t i_last_idr_pts;
- /* We use only one SPS and one PPS */
- x264_sps_t sps_array[1];
- x264_pps_t pps_array[1];
int i_idr_pic_id;
/* quantization matrix for decoding, [cqm][qp%6][coef] */
/* Slice header */
x264_slice_header_t sh;
+ /* SPS / PPS */
+ x264_sps_t sps[1];
+ x264_pps_t pps[1];
+
/* Slice header backup, for SEI_DEC_REF_PIC_MARKING */
int b_sh_backup;
x264_slice_header_t sh_backup;
int i_poc_type;
/* poc 0 */
int i_log2_max_poc_lsb;
- /* poc 1 */
- int b_delta_pic_order_always_zero;
- int i_offset_for_non_ref_pic;
- int i_offset_for_top_to_bottom_field;
- int i_num_ref_frames_in_poc_cycle;
- int i_offset_for_ref_frame[256];
int i_num_ref_frames;
int b_gaps_in_frame_num_value_allowed;
if( sh->pps->b_pic_order && !sh->b_field_pic )
bs_write_se( s, sh->i_delta_poc_bottom );
}
- else if( sh->sps->i_poc_type == 1 && !sh->sps->b_delta_pic_order_always_zero )
- {
- bs_write_se( s, sh->i_delta_poc[0] );
- if( sh->pps->b_pic_order && !sh->b_field_pic )
- bs_write_se( s, sh->i_delta_poc[1] );
- }
if( sh->pps->b_redundant_pic_cnt )
bs_write_ue( s, sh->i_redundant_pic_cnt );
int maxrate_bak = h->param.rc.i_vbv_max_bitrate;
if( h->param.rc.i_rc_method == X264_RC_ABR && h->param.rc.i_vbv_buffer_size <= 0 )
h->param.rc.i_vbv_max_bitrate = h->param.rc.i_bitrate * 2;
- h->sps = h->sps_array;
x264_sps_init( h->sps, h->param.i_sps_id, &h->param );
do h->param.i_level_idc = l->level_idc;
while( l[1].level_idc && x264_validate_levels( h, 0 ) && l++ );
goto fail;
}
- h->sps = &h->sps_array[0];
x264_sps_init( h->sps, h->param.i_sps_id, &h->param );
-
- h->pps = &h->pps_array[0];
x264_pps_init( h->pps, h->param.i_sps_id, &h->param, h->sps );
x264_set_aspect_ratio( h, &h->param, 1 );
else
h->thread[i]->fdec = h->thread[0]->fdec;
- h->thread[i]->sps = &h->thread[i]->sps_array[0];
- h->thread[i]->pps = &h->thread[i]->pps_array[0];
-
CHECKED_MALLOC( h->thread[i]->out.p_bitstream, h->out.i_bitstream );
/* Start each thread with room for init_nal_count NAL units; it'll realloc later if needed. */
CHECKED_MALLOC( h->thread[i]->out.nal, init_nal_count*sizeof(x264_nal_t) );
h->fdec->i_delta_poc[0] = h->sh.i_delta_poc_bottom == -1;
h->fdec->i_delta_poc[1] = h->sh.i_delta_poc_bottom == 1;
}
- else if( h->sps->i_poc_type == 1 )
- {
- /* FIXME TODO FIXME */
- }
else
{
/* Nothing to do ? */
while( (1 << sps->i_log2_max_poc_lsb) <= max_delta_poc * 2 )
sps->i_log2_max_poc_lsb++;
}
- else if( sps->i_poc_type == 1 )
- {
- int i;
-
- /* FIXME */
- sps->b_delta_pic_order_always_zero = 1;
- sps->i_offset_for_non_ref_pic = 0;
- sps->i_offset_for_top_to_bottom_field = 0;
- sps->i_num_ref_frames_in_poc_cycle = 0;
-
- for( i = 0; i < sps->i_num_ref_frames_in_poc_cycle; i++ )
- {
- sps->i_offset_for_ref_frame[i] = 0;
- }
- }
sps->b_vui = 1;
bs_write_ue( s, sps->i_log2_max_frame_num - 4 );
bs_write_ue( s, sps->i_poc_type );
if( sps->i_poc_type == 0 )
- {
bs_write_ue( s, sps->i_log2_max_poc_lsb - 4 );
- }
- else if( sps->i_poc_type == 1 )
- {
- bs_write1( s, sps->b_delta_pic_order_always_zero );
- bs_write_se( s, sps->i_offset_for_non_ref_pic );
- bs_write_se( s, sps->i_offset_for_top_to_bottom_field );
- bs_write_ue( s, sps->i_num_ref_frames_in_poc_cycle );
-
- for( int i = 0; i < sps->i_num_ref_frames_in_poc_cycle; i++ )
- bs_write_se( s, sps->i_offset_for_ref_frame[i] );
- }
bs_write_ue( s, sps->i_num_ref_frames );
bs_write1( s, sps->b_gaps_in_frame_num_value_allowed );
bs_write_ue( s, sps->i_mb_width - 1 );
x264_dct_init( cpu_new, &dct_asm );
memset( h, 0, sizeof(*h) );
- h->pps = h->pps_array;
x264_param_default( &h->param );
h->chroma_qp_table = i_chroma_qp_table + 12;
h->param.analyse.i_luma_deadzone[0] = 0;
x264_t h_buf;
x264_t *h = &h_buf;
memset( h, 0, sizeof(*h) );
- h->pps = h->pps_array;
x264_param_default( &h->param );
h->chroma_qp_table = i_chroma_qp_table + 12;
h->param.analyse.b_transform_8x8 = 1;