00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef _PARSETCOMMON_H_
00027 #define _PARSETCOMMON_H_
00028
00029 #define MAXIMUMPARSETRBSPSIZE 1500
00030 #define MAXIMUMPARSETNALUSIZE 1500
00031
00032 #define MAXSPS 32
00033 #define MAXPPS 256
00034
00035
00036 #ifdef FALSE
00037 # define Boolean int
00038 #else
00039 typedef enum {
00040 FALSE,
00041 TRUE
00042 } Boolean;
00043 #endif
00044
00045 #define MAXIMUMVALUEOFcpb_cnt 32
00046 typedef struct
00047 {
00048 unsigned int cpb_cnt_minus1;
00049 unsigned int bit_rate_scale;
00050 unsigned int cpb_size_scale;
00051 unsigned int bit_rate_value_minus1 [MAXIMUMVALUEOFcpb_cnt];
00052 unsigned int cpb_size_value_minus1 [MAXIMUMVALUEOFcpb_cnt];
00053 unsigned int cbr_flag [MAXIMUMVALUEOFcpb_cnt];
00054 unsigned int initial_cpb_removal_delay_length_minus1;
00055 unsigned int cpb_removal_delay_length_minus1;
00056 unsigned int dpb_output_delay_length_minus1;
00057 unsigned int time_offset_length;
00058 } hrd_parameters_t;
00059
00060
00061 typedef struct
00062 {
00063 Boolean aspect_ratio_info_present_flag;
00064 unsigned int aspect_ratio_idc;
00065 unsigned int sar_width;
00066 unsigned int sar_height;
00067 Boolean overscan_info_present_flag;
00068 Boolean overscan_appropriate_flag;
00069 Boolean video_signal_type_present_flag;
00070 unsigned int video_format;
00071 Boolean video_full_range_flag;
00072 Boolean colour_description_present_flag;
00073 unsigned int colour_primaries;
00074 unsigned int transfer_characteristics;
00075 unsigned int matrix_coefficients;
00076 Boolean chroma_location_info_present_flag;
00077 unsigned int chroma_sample_loc_type_top_field;
00078 unsigned int chroma_sample_loc_type_bottom_field;
00079 Boolean timing_info_present_flag;
00080 unsigned int num_units_in_tick;
00081 unsigned int time_scale;
00082 Boolean fixed_frame_rate_flag;
00083 Boolean nal_hrd_parameters_present_flag;
00084 hrd_parameters_t nal_hrd_parameters;
00085 Boolean vcl_hrd_parameters_present_flag;
00086 hrd_parameters_t vcl_hrd_parameters;
00087
00088 Boolean low_delay_hrd_flag;
00089 Boolean pic_struct_present_flag;
00090 Boolean bitstream_restriction_flag;
00091 Boolean motion_vectors_over_pic_boundaries_flag;
00092 unsigned int max_bytes_per_pic_denom;
00093 unsigned int max_bits_per_mb_denom;
00094 unsigned int log2_max_mv_length_vertical;
00095 unsigned int log2_max_mv_length_horizontal;
00096 unsigned int num_reorder_frames;
00097 unsigned int max_dec_frame_buffering;
00098 } vui_seq_parameters_t;
00099
00100
00101 #define MAXnum_slice_groups_minus1 8
00102 typedef struct
00103 {
00104 Boolean Valid;
00105 unsigned int pic_parameter_set_id;
00106 unsigned int seq_parameter_set_id;
00107 Boolean entropy_coding_mode_flag;
00108
00109 Boolean transform_8x8_mode_flag;
00110
00111 Boolean pic_scaling_matrix_present_flag;
00112 int pic_scaling_list_present_flag[12];
00113
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 char num_ref_idx_l0_active_minus1;
00136 char num_ref_idx_l1_active_minus1;
00137 byte weighted_pred_flag;
00138 byte weighted_bipred_idc;
00139 int pic_init_qp_minus26;
00140 int pic_init_qs_minus26;
00141 int chroma_qp_index_offset;
00142
00143 int cb_qp_index_offset;
00144 int cr_qp_index_offset;
00145 int second_chroma_qp_index_offset;
00146
00147 Boolean deblocking_filter_control_present_flag;
00148 Boolean constrained_intra_pred_flag;
00149 Boolean redundant_pic_cnt_present_flag;
00150 Boolean vui_pic_parameters_flag;
00151 } pic_parameter_set_rbsp_t;
00152
00153
00154 #define MAXnum_ref_frames_in_pic_order_cnt_cycle 256
00155 typedef struct
00156 {
00157 Boolean Valid;
00158
00159 unsigned int profile_idc;
00160 Boolean constrained_set0_flag;
00161 Boolean constrained_set1_flag;
00162 Boolean constrained_set2_flag;
00163 Boolean constrained_set3_flag;
00164 unsigned int level_idc;
00165 unsigned int seq_parameter_set_id;
00166 unsigned int chroma_format_idc;
00167
00168 Boolean seq_scaling_matrix_present_flag;
00169 int seq_scaling_list_present_flag[12];
00170
00171 unsigned int bit_depth_luma_minus8;
00172 unsigned int bit_depth_chroma_minus8;
00173 unsigned int log2_max_frame_num_minus4;
00174 unsigned int pic_order_cnt_type;
00175
00176 unsigned int log2_max_pic_order_cnt_lsb_minus4;
00177
00178 Boolean delta_pic_order_always_zero_flag;
00179 int offset_for_non_ref_pic;
00180 int offset_for_top_to_bottom_field;
00181 unsigned int num_ref_frames_in_pic_order_cnt_cycle;
00182
00183 int offset_for_ref_frame[MAXnum_ref_frames_in_pic_order_cnt_cycle];
00184 unsigned char num_ref_frames;
00185 Boolean gaps_in_frame_num_value_allowed_flag;
00186 unsigned int pic_width_in_mbs_minus1;
00187 unsigned int pic_height_in_map_units_minus1;
00188 Boolean frame_mbs_only_flag;
00189
00190 Boolean mb_adaptive_frame_field_flag;
00191 Boolean direct_8x8_inference_flag;
00192 Boolean frame_cropping_flag;
00193 unsigned int frame_cropping_rect_left_offset;
00194 unsigned int frame_cropping_rect_right_offset;
00195 unsigned int frame_cropping_rect_top_offset;
00196 unsigned int frame_cropping_rect_bottom_offset;
00197 Boolean vui_parameters_present_flag;
00198 vui_seq_parameters_t vui_seq_parameters;
00199 unsigned separate_colour_plane_flag;
00200 } seq_parameter_set_rbsp_t;
00201
00202 extern pic_parameter_set_rbsp_t *AllocPPS (void);
00203 extern seq_parameter_set_rbsp_t *AllocSPS (void);
00204
00205 extern void FreePPS (pic_parameter_set_rbsp_t *pps);
00206 extern void FreeSPS (seq_parameter_set_rbsp_t *sps);
00207
00208 #endif