OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // This file contains an implementation of an H264 Annex-B video stream parser. | 5 // This file contains an implementation of an H264 Annex-B video stream parser. |
6 | 6 |
7 #ifndef MEDIA_FILTERS_H264_PARSER_H_ | 7 #ifndef MEDIA_FILTERS_H264_PARSER_H_ |
8 #define MEDIA_FILTERS_H264_PARSER_H_ | 8 #define MEDIA_FILTERS_H264_PARSER_H_ |
9 | 9 |
10 #include <sys/types.h> | 10 #include <sys/types.h> |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 }; | 56 }; |
57 | 57 |
58 enum { | 58 enum { |
59 kH264ScalingList4x4Length = 16, | 59 kH264ScalingList4x4Length = 16, |
60 kH264ScalingList8x8Length = 64, | 60 kH264ScalingList8x8Length = 64, |
61 }; | 61 }; |
62 | 62 |
63 struct MEDIA_EXPORT H264SPS { | 63 struct MEDIA_EXPORT H264SPS { |
64 H264SPS(); | 64 H264SPS(); |
65 | 65 |
| 66 enum H264ProfileIDC { |
| 67 kProfileIDCBaseline = 66, |
| 68 kProfileIDCConstrainedBaseline = kProfileIDCBaseline, |
| 69 kProfileIDCMain = 77, |
| 70 kProfileIDCHigh = 100, |
| 71 }; |
| 72 |
| 73 enum AspectRatioIdc { |
| 74 kExtendedSar = 255, |
| 75 }; |
| 76 |
| 77 enum { |
| 78 // Constants for HRD parameters (spec ch. E.2.2). |
| 79 kBitRateScaleConstantTerm = 6, // Equation E-37. |
| 80 kCPBSizeScaleConstantTerm = 4, // Equation E-38. |
| 81 kDefaultInitialCPBRemovalDelayLength = 24, |
| 82 kDefaultDPBOutputDelayLength = 24, |
| 83 kDefaultTimeOffsetLength = 24, |
| 84 }; |
| 85 |
66 int profile_idc; | 86 int profile_idc; |
67 bool constraint_set0_flag; | 87 bool constraint_set0_flag; |
68 bool constraint_set1_flag; | 88 bool constraint_set1_flag; |
69 bool constraint_set2_flag; | 89 bool constraint_set2_flag; |
70 bool constraint_set3_flag; | 90 bool constraint_set3_flag; |
71 bool constraint_set4_flag; | 91 bool constraint_set4_flag; |
72 bool constraint_set5_flag; | 92 bool constraint_set5_flag; |
73 int level_idc; | 93 int level_idc; |
74 int seq_parameter_set_id; | 94 int seq_parameter_set_id; |
75 | 95 |
(...skipping 28 matching lines...) Expand all Loading... |
104 int frame_crop_right_offset; | 124 int frame_crop_right_offset; |
105 int frame_crop_top_offset; | 125 int frame_crop_top_offset; |
106 int frame_crop_bottom_offset; | 126 int frame_crop_bottom_offset; |
107 | 127 |
108 bool vui_parameters_present_flag; | 128 bool vui_parameters_present_flag; |
109 int sar_width; // Set to 0 when not specified. | 129 int sar_width; // Set to 0 when not specified. |
110 int sar_height; // Set to 0 when not specified. | 130 int sar_height; // Set to 0 when not specified. |
111 bool bitstream_restriction_flag; | 131 bool bitstream_restriction_flag; |
112 int max_num_reorder_frames; | 132 int max_num_reorder_frames; |
113 int max_dec_frame_buffering; | 133 int max_dec_frame_buffering; |
| 134 bool timing_info_present_flag; |
| 135 int num_units_in_tick; |
| 136 int time_scale; |
| 137 bool fixed_frame_rate_flag; |
| 138 |
| 139 // TODO(posciak): actually parse these instead of ParseAndIgnoreHRDParameters. |
| 140 bool nal_hrd_parameters_present_flag; |
| 141 int cpb_cnt_minus1; |
| 142 int bit_rate_scale; |
| 143 int cpb_size_scale; |
| 144 int bit_rate_value_minus1[32]; |
| 145 int cpb_size_value_minus1[32]; |
| 146 bool cbr_flag[32]; |
| 147 int initial_cpb_removal_delay_length_minus_1; |
| 148 int cpb_removal_delay_length_minus1; |
| 149 int dpb_output_delay_length_minus1; |
| 150 int time_offset_length; |
| 151 |
| 152 bool low_delay_hrd_flag; |
114 | 153 |
115 int chroma_array_type; | 154 int chroma_array_type; |
116 }; | 155 }; |
117 | 156 |
118 struct MEDIA_EXPORT H264PPS { | 157 struct MEDIA_EXPORT H264PPS { |
119 H264PPS(); | 158 H264PPS(); |
120 | 159 |
121 int pic_parameter_set_id; | 160 int pic_parameter_set_id; |
122 int seq_parameter_set_id; | 161 int seq_parameter_set_id; |
123 bool entropy_coding_mode_flag; | 162 bool entropy_coding_mode_flag; |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 typedef std::map<int, H264PPS*> PPSById; | 440 typedef std::map<int, H264PPS*> PPSById; |
402 SPSById active_SPSes_; | 441 SPSById active_SPSes_; |
403 PPSById active_PPSes_; | 442 PPSById active_PPSes_; |
404 | 443 |
405 DISALLOW_COPY_AND_ASSIGN(H264Parser); | 444 DISALLOW_COPY_AND_ASSIGN(H264Parser); |
406 }; | 445 }; |
407 | 446 |
408 } // namespace media | 447 } // namespace media |
409 | 448 |
410 #endif // MEDIA_FILTERS_H264_PARSER_H_ | 449 #endif // MEDIA_FILTERS_H264_PARSER_H_ |
OLD | NEW |