00001
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef _PARSETCOMMON_H_
00027 #define _PARSETCOMMON_H_
00028
00029 #include "defines.h"
00030
00031 #define MAXIMUMPARSETRBSPSIZE 1500
00032 #define MAXIMUMPARSETNALUSIZE 1500
00033
00034 #define MAXSPS 32
00035 #define MAXPPS 256
00036
00038 #ifdef FALSE
00039 # define Boolean int
00040 #else
00041 typedef enum {
00042 FALSE,
00043 TRUE
00044 } Boolean;
00045 #endif
00046
00047 #define MAXIMUMVALUEOFcpb_cnt 32
00048 typedef struct
00049 {
00050 unsigned int cpb_cnt_minus1;
00051 unsigned int bit_rate_scale;
00052 unsigned int cpb_size_scale;
00053 unsigned int bit_rate_value_minus1 [MAXIMUMVALUEOFcpb_cnt];
00054 unsigned int cpb_size_value_minus1 [MAXIMUMVALUEOFcpb_cnt];
00055 unsigned int cbr_flag [MAXIMUMVALUEOFcpb_cnt];
00056 unsigned int initial_cpb_removal_delay_length_minus1;
00057 unsigned int cpb_removal_delay_length_minus1;
00058 unsigned int dpb_output_delay_length_minus1;
00059 unsigned int time_offset_length;
00060 } hrd_parameters_t;
00061
00062
00063 typedef struct
00064 {
00065 Boolean aspect_ratio_info_present_flag;
00066 unsigned int aspect_ratio_idc;
00067 unsigned short sar_width;
00068 unsigned short sar_height;
00069 Boolean overscan_info_present_flag;
00070 Boolean overscan_appropriate_flag;
00071 Boolean video_signal_type_present_flag;
00072 unsigned int video_format;
00073 Boolean video_full_range_flag;
00074 Boolean colour_description_present_flag;
00075 unsigned int colour_primaries;
00076 unsigned int transfer_characteristics;
00077 unsigned int matrix_coefficients;
00078 Boolean chroma_location_info_present_flag;
00079 unsigned int chroma_sample_loc_type_top_field;
00080 unsigned int chroma_sample_loc_type_bottom_field;
00081 Boolean timing_info_present_flag;
00082 unsigned int num_units_in_tick;
00083 unsigned int time_scale;
00084 Boolean fixed_frame_rate_flag;
00085 Boolean nal_hrd_parameters_present_flag;
00086 hrd_parameters_t nal_hrd_parameters;
00087 Boolean vcl_hrd_parameters_present_flag;
00088 hrd_parameters_t vcl_hrd_parameters;
00089
00090 Boolean low_delay_hrd_flag;
00091 Boolean pic_struct_present_flag;
00092 Boolean bitstream_restriction_flag;
00093 Boolean motion_vectors_over_pic_boundaries_flag;
00094 unsigned int max_bytes_per_pic_denom;
00095 unsigned int max_bits_per_mb_denom;
00096 unsigned int log2_max_mv_length_vertical;
00097 unsigned int log2_max_mv_length_horizontal;
00098 unsigned int num_reorder_frames;
00099 unsigned int max_dec_frame_buffering;
00100 } vui_seq_parameters_t;
00101
00102
00103 #define MAXnum_slice_groups_minus1 8
00104 typedef struct
00105 {
00106 Boolean Valid;
00107 unsigned int pic_parameter_set_id;
00108 unsigned int seq_parameter_set_id;
00109 Boolean entropy_coding_mode_flag;
00110 Boolean transform_8x8_mode_flag;
00111
00112 Boolean pic_scaling_matrix_present_flag;
00113 int pic_scaling_list_present_flag[12];
00114 int ScalingList4x4[6][16];
00115 int ScalingList8x8[6][64];
00116 Boolean UseDefaultScalingMatrix4x4Flag[6];
00117 Boolean UseDefaultScalingMatrix8x8Flag[6];
00118
00119
00120 Boolean bottom_field_pic_order_in_frame_present_flag;
00121 unsigned int num_slice_groups_minus1;
00122 unsigned int slice_group_map_type;
00123
00124 unsigned int run_length_minus1[MAXnum_slice_groups_minus1];
00125
00126 unsigned int top_left[MAXnum_slice_groups_minus1];
00127 unsigned int bottom_right[MAXnum_slice_groups_minus1];
00128
00129 Boolean slice_group_change_direction_flag;
00130 unsigned int slice_group_change_rate_minus1;
00131
00132 unsigned int pic_size_in_map_units_minus1;
00133 byte *slice_group_id;
00134
00135 int num_ref_idx_l0_active_minus1;
00136 int num_ref_idx_l1_active_minus1;
00137 Boolean weighted_pred_flag;
00138 unsigned int weighted_bipred_idc;
00139 int pic_init_qp_minus26;
00140 int pic_init_qs_minus26;
00141 int chroma_qp_index_offset;
00142
00143 int second_chroma_qp_index_offset;
00144
00145 Boolean deblocking_filter_control_present_flag;
00146 Boolean constrained_intra_pred_flag;
00147 Boolean redundant_pic_cnt_present_flag;
00148 } pic_parameter_set_rbsp_t;
00149
00150
00151 #define MAXnum_ref_frames_in_pic_order_cnt_cycle 256
00152 typedef struct
00153 {
00154 Boolean Valid;
00155
00156 unsigned int profile_idc;
00157 Boolean constrained_set0_flag;
00158 Boolean constrained_set1_flag;
00159 Boolean constrained_set2_flag;
00160 Boolean constrained_set3_flag;
00161 unsigned int level_idc;
00162 unsigned int seq_parameter_set_id;
00163 unsigned int chroma_format_idc;
00164
00165 Boolean seq_scaling_matrix_present_flag;
00166 int seq_scaling_list_present_flag[12];
00167 int ScalingList4x4[6][16];
00168 int ScalingList8x8[6][64];
00169 Boolean UseDefaultScalingMatrix4x4Flag[6];
00170 Boolean UseDefaultScalingMatrix8x8Flag[6];
00171
00172 unsigned int bit_depth_luma_minus8;
00173 unsigned int bit_depth_chroma_minus8;
00174 unsigned int log2_max_frame_num_minus4;
00175 unsigned int pic_order_cnt_type;
00176
00177 unsigned int log2_max_pic_order_cnt_lsb_minus4;
00178
00179 Boolean delta_pic_order_always_zero_flag;
00180 int offset_for_non_ref_pic;
00181 int offset_for_top_to_bottom_field;
00182 unsigned int num_ref_frames_in_pic_order_cnt_cycle;
00183
00184 int offset_for_ref_frame[MAXnum_ref_frames_in_pic_order_cnt_cycle];
00185 unsigned int num_ref_frames;
00186 Boolean gaps_in_frame_num_value_allowed_flag;
00187 unsigned int pic_width_in_mbs_minus1;
00188 unsigned int pic_height_in_map_units_minus1;
00189 Boolean frame_mbs_only_flag;
00190
00191 Boolean mb_adaptive_frame_field_flag;
00192 Boolean direct_8x8_inference_flag;
00193 Boolean frame_cropping_flag;
00194 unsigned int frame_cropping_rect_left_offset;
00195 unsigned int frame_cropping_rect_right_offset;
00196 unsigned int frame_cropping_rect_top_offset;
00197 unsigned int frame_cropping_rect_bottom_offset;
00198 Boolean vui_parameters_present_flag;
00199 vui_seq_parameters_t vui_seq_parameters;
00200 unsigned separate_colour_plane_flag;
00201 } seq_parameter_set_rbsp_t;
00202
00203 pic_parameter_set_rbsp_t *AllocPPS (void);
00204 seq_parameter_set_rbsp_t *AllocSPS (void);
00205
00206 void FreePPS (pic_parameter_set_rbsp_t *pps);
00207 void FreeSPS (seq_parameter_set_rbsp_t *sps);
00208
00209 int sps_is_equal(seq_parameter_set_rbsp_t *sps1, seq_parameter_set_rbsp_t *sps2);
00210 int pps_is_equal(pic_parameter_set_rbsp_t *pps1, pic_parameter_set_rbsp_t *pps2);
00211
00212 #endif