7 #ifndef MEDIA_FILTERS_H265_PARSER_H_
8 #define MEDIA_FILTERS_H265_PARSER_H_
13 #include "packager/base/memory/scoped_ptr.h"
14 #include "packager/media/filters/h26x_bit_reader.h"
16 namespace edash_packager {
21 enum H265SliceType { kBSlice = 0, kPSlice = 1, kISlice = 2 };
23 const int kMaxRefPicSetCount = 16;
26 int delta_poc_s0[kMaxRefPicSetCount];
27 int delta_poc_s1[kMaxRefPicSetCount];
28 bool used_by_curr_pic_s0[kMaxRefPicSetCount];
29 bool used_by_curr_pic_s1[kMaxRefPicSetCount];
31 int num_negative_pics;
32 int num_positive_pics;
43 int pic_parameter_set_id = 0;
44 int seq_parameter_set_id = 0;
46 bool dependent_slice_segments_enabled_flag =
false;
47 bool output_flag_present_flag =
false;
48 int num_extra_slice_header_bits = 0;
49 bool sign_data_hiding_enabled_flag =
false;
50 bool cabac_init_present_flag =
false;
52 int num_ref_idx_l0_default_active_minus1 = 0;
53 int num_ref_idx_l1_default_active_minus1 = 0;
54 int init_qp_minus26 = 0;
55 bool constrained_intra_pred_flag =
false;
56 bool transform_skip_enabled_flag =
false;
58 bool cu_qp_delta_enabled_flag = 0;
59 int diff_cu_qp_delta_depth = 0;
63 bool slice_chroma_qp_offsets_present_flag =
false;
64 bool weighted_pred_flag =
false;
65 bool weighted_bipred_flag =
false;
66 bool transquant_bypass_enabled_flag =
false;
67 bool tiles_enabled_flag =
false;
68 bool entropy_coding_sync_enabled_flag =
false;
70 int num_tile_columns_minus1 = 0;
71 int num_tile_rows_minus1 = 0;
72 bool uniform_spacing_flag =
true;
73 std::vector<int> column_width_minus1;
74 std::vector<int> row_height_minus1;
75 bool loop_filter_across_tiles_enabled_flag =
true;
77 bool loop_filter_across_slices_enabled_flag =
false;
78 bool deblocking_filter_control_present_flag =
false;
79 bool deblocking_filter_override_enabled_flag =
false;
80 bool deblocking_filter_disabled_flag =
false;
81 int beta_offset_div2 = 0;
82 int tc_offset_div2 = 0;
84 bool scaling_list_data_present_flag =
false;
87 bool lists_modification_present_flag =
false;
88 int log2_parallel_merge_level_minus2 = 0;
89 bool slice_segment_header_extension_present_flag =
false;
92 bool chroma_qp_offset_list_enabled_flag =
false;
101 int GetPicSizeInCtbsY()
const;
102 int GetChromaArrayType()
const;
107 int video_parameter_set_id = 0;
108 int max_sub_layers_minus1 = 0;
109 bool temporal_id_nesting_flag =
false;
112 int seq_parameter_set_id = 0;
114 int chroma_format_idc = 0;
115 bool separate_colour_plane_flag =
false;
116 int pic_width_in_luma_samples = 0;
117 int pic_height_in_luma_samples = 0;
119 bool conformance_window_flag =
false;
120 int conf_win_left_offset = 0;
121 int conf_win_right_offset = 0;
122 int conf_win_top_offset = 0;
123 int conf_win_bottom_offset = 0;
125 int bit_depth_luma_minus8 = 0;
126 int bit_depth_chroma_minus8 = 0;
127 int log2_max_pic_order_cnt_lsb_minus4 = 0;
129 bool sub_layer_ordering_info_present_flag =
false;
130 int max_dec_pic_buffering_minus1[8];
131 int max_num_reorder_pics[8];
132 int max_latency_increase_plus1[8];
134 int log2_min_luma_coding_block_size_minus3 = 0;
135 int log2_diff_max_min_luma_coding_block_size = 0;
136 int log2_min_luma_transform_block_size_minus2 = 0;
137 int log2_diff_max_min_luma_transform_block_size = 0;
138 int max_transform_hierarchy_depth_inter = 0;
139 int max_transform_hierarchy_depth_intra = 0;
141 bool scaling_list_enabled_flag =
false;
142 bool scaling_list_data_present_flag =
false;
145 bool amp_enabled_flag =
false;
146 bool sample_adaptive_offset_enabled_flag =
false;
147 bool pcm_enabled_flag =
false;
148 int pcm_sample_bit_depth_luma_minus1 = 0;
149 int pcm_sample_bit_depth_chroma_minus1 = 0;
150 int log2_min_pcm_luma_coding_block_size_minus3 = 0;
151 int log2_diff_max_min_pcm_luma_coding_block_size = 0;
152 bool pcm_loop_filter_disabled_flag =
false;
154 int num_short_term_ref_pic_sets = 0;
155 std::vector<H265ReferencePictureSet> st_ref_pic_sets;
157 bool long_term_ref_pic_present_flag =
false;
158 int num_long_term_ref_pics = 0;
159 std::vector<int> lt_ref_pic_poc_lsb;
160 std::vector<bool> used_by_curr_pic_lt_flag;
162 bool temporal_mvp_enabled_flag =
false;
163 bool strong_intra_smoothing_enabled_flag =
false;
172 bool ref_pic_list_modification_flag_l0 =
false;
173 std::vector<int> list_entry_l0;
175 bool ref_pic_list_modification_flag_l1 =
false;
176 std::vector<int> list_entry_l1;
184 bool delta_poc_msb_present_flag;
185 int delta_poc_msb_cycle_lt;
189 int used_by_curr_pic_lt = 0;
194 int header_bit_size = 0;
196 bool first_slice_segment_in_pic_flag =
false;
197 bool no_output_of_prior_pics_flag =
false;
198 int pic_parameter_set_id = 0;
200 bool dependent_slice_segment_flag =
false;
201 int segment_address = 0;
203 bool pic_output_flag =
true;
204 int colour_plane_id = 0;
205 int slice_pic_order_cnt_lsb = 0;
207 bool short_term_ref_pic_set_sps_flag =
false;
209 int short_term_ref_pic_set_idx = 0;
211 int num_long_term_sps = 0;
212 int num_long_term_pics = 0;
213 std::vector<LongTermPicsInfo> long_term_pics_info;
215 bool slice_temporal_mvp_enabled_flag =
false;
216 bool slice_sao_luma_flag =
false;
217 bool slice_sao_chroma_flag =
false;
219 bool num_ref_idx_active_override_flag =
false;
220 int num_ref_idx_l0_active_minus1 = 0;
221 int num_ref_idx_l1_active_minus1 = 0;
225 bool mvd_l1_zero_flag =
false;
226 bool cabac_init_flag =
false;
227 bool collocated_from_l0 =
true;
228 int collocated_ref_idx = 0;
230 int five_minus_max_num_merge_cand = 0;
231 int slice_qp_delta = 0;
232 int slice_cb_qp_offset = 0;
233 int slice_cr_qp_offset = 0;
235 bool cu_chroma_qp_offset_enabled_flag =
false;
236 bool deblocking_filter_override_flag =
false;
237 bool slice_deblocking_filter_disabled_flag =
false;
238 int slice_beta_offset_div2 = 0;
239 int slice_tc_offset_div2 = 0;
240 bool slice_loop_filter_across_slices_enabled_flag =
false;
242 int num_entry_point_offsets = 0;
243 int offset_len_minus1 = 0;
244 std::vector<int> entry_point_offset_minus1;
280 Result ParseReferencePictureSet(
281 int num_short_term_ref_pic_sets,
283 const std::vector<H265ReferencePictureSet>& ref_pic_sets,
287 Result SkipReferencePictureListModification(
290 int num_pic_total_curr,
293 Result SkipPredictionWeightTablePart(
int num_ref_idx_minus1,
294 int chroma_array_type,
297 Result SkipPredictionWeightTable(
bool is_b_slice,
302 Result SkipProfileTierLevel(
bool profile_present,
303 int max_num_sub_layers_minus1,
308 typedef std::map<int, scoped_ptr<H265Sps>> SpsById;
309 typedef std::map<int, scoped_ptr<H265Pps>> PpsById;
311 SpsById active_spses_;
312 PpsById active_ppses_;
320 #endif // MEDIA_FILTERS_H265_PARSER_H_