欣赏一下JM8.6代码中的SPS和PPS:
typedef struct { Boolean Valid; // indicates the parameter set is valid // 指明profile号 unsigned profile_idc; // u(8) // 指明是否遵从某些限制条件 Boolean constrained_set0_flag; // u(1) Boolean constrained_set1_flag; // u(1) Boolean constrained_set2_flag; // u(1) // 指明level号 unsigned level_idc; // u(8) // 指明sps的序列号[0, 31],此id会被pps引用 unsigned seq_parameter_set_id; // ue(v) // 为读取fram_num服务 unsigned log2_max_frame_num_minus4; // ue(v) // 指明POC的编码方法 unsigned pic_order_cnt_type; // if( pic_order_cnt_type == 0 ) unsigned log2_max_pic_order_cnt_lsb_minus4; // ue(v) // else if( pic_order_cnt_type == 1 ) Boolean delta_pic_order_always_zero_flag; // u(1) int offset_for_non_ref_pic; // se(v) int offset_for_top_to_bottom_field; // se(v) unsigned num_ref_frames_in_pic_order_cnt_cycle; // ue(v) // for( i = 0; i < num_ref_frames_in_pic_order_cnt_cycle; i++ ) int offset_for_ref_frame[MAXnum_ref_frames_in_pic_order_cnt_cycle]; // se(v) // 参考帧数,最大值为16.如果是场,则为32 unsigned num_ref_frames; // ue(v) Boolean gaps_in_frame_num_value_allowed_flag; // u(1) // 指明图像宽度,以宏块为单位 unsigned pic_width_in_mbs_minus1; // ue(v) // 指明图像高度,以宏块为单位 unsigned pic_height_in_map_units_minus1; // ue(v) Boolean frame_mbs_only_flag; // u(1) // if( !frame_mbs_only_flag ) Boolean mb_adaptive_frame_field_flag; // u(1) Boolean direct_8x8_inference_flag; // u(1) Boolean frame_cropping_flag; // u(1) unsigned frame_cropping_rect_left_offset; // ue(v) unsigned frame_cropping_rect_right_offset; // ue(v) unsigned frame_cropping_rect_top_offset; // ue(v) unsigned frame_cropping_rect_bottom_offset; // ue(v) Boolean vui_parameters_present_flag; // u(1) vui_seq_parameters_t vui_seq_parameters; // vui_seq_parameters_t } seq_parameter_set_rbsp_t;
typedef struct { Boolean Valid; // indicates the parameter set is valid // 指明图像参数级号码 unsigned pic_parameter_set_id; // ue(v) // 引用序列参数集的相应号码 unsigned seq_parameter_set_id; // ue(v) // 指明熵编码类型. 0:CAVLC 1:CABAC Boolean entropy_coding_mode_flag; // u(1) // if( pic_order_cnt_type < 2 ) in the sequence parameter set Boolean pic_order_present_flag; // u(1) unsigned num_slice_groups_minus1; // ue(v) unsigned slice_group_map_type; // ue(v) // if( slice_group_map_type = = 0 ) unsigned run_length_minus1[MAXnum_slice_groups_minus1]; // ue(v) // else if( slice_group_map_type = = 2 ) unsigned top_left[MAXnum_slice_groups_minus1]; // ue(v) unsigned bottom_right[MAXnum_slice_groups_minus1]; // ue(v) // else if( slice_group_map_type = = 3 || 4 || 5 Boolean slice_group_change_direction_flag; // u(1) unsigned slice_group_change_rate_minus1; // ue(v) // else if( slice_group_map_type = = 6 ) unsigned pic_size_in_map_units_minus1; // ue(v) unsigned *slice_group_id; // complete MBAmap u(v) int num_ref_idx_l0_active_minus1; // ue(v) int num_ref_idx_l1_active_minus1; // ue(v) Boolean weighted_pred_flag; // u(1) Boolean weighted_bipred_idc; // u(2) int pic_init_qp_minus26; // se(v) int pic_init_qs_minus26; // se(v) int chroma_qp_index_offset; // se(v) Boolean deblocking_filter_control_present_flag; // u(1) Boolean constrained_intra_pred_flag; // u(1) Boolean redundant_pic_cnt_present_flag; // u(1) Boolean vui_pic_parameters_flag; // u(1) } pic_parameter_set_rbsp_t;