80 std::ostream & operator<<( std::ostream & ,
const Avc::Sps & ) ;
81 std::ostream & operator<<( std::ostream & ,
const Avc::Pps & ) ;
110 std::string
reason()
const ;
116 const std::vector<std::string> &
spsList()
const ;
121 const std::vector<std::string> &
ppsList()
const ;
134 const Sps &
sps(
size_t i )
const ;
137 const Pps &
pps(
size_t i )
const ;
140 std::string
nalus()
const ;
147 void initFmtp(
const std::string & ) ;
148 void initAvcc(
const std::string & ) ;
151 void spsListParse() ;
152 void ppsListParse() ;
155 void report(
const std::string & ) ;
160 unsigned int configuration_version ;
161 unsigned int profile ;
162 unsigned int profile_compat ;
164 unsigned int length_size_minus_one ;
168 unsigned int profile ;
170 unsigned int packetisation_mode ;
174 AvccInfo m_avcc_info ;
175 FmtpInfo m_fmtp_info ;
176 std::string m_reason ;
177 std::vector<std::string> m_sps_list ;
178 std::vector<std::string> m_pps_list ;
179 std::vector<Sps> m_sps ;
180 std::vector<Pps> m_pps ;
190 explicit Sps(
const std::string & binary_sps_buffer ) ;
196 std::string
reason()
const ;
202 unsigned int dx()
const ;
205 unsigned int dy()
const ;
209 unsigned int m_nalu_type ;
210 unsigned int m_profile_idc ;
211 bool m_constraint_set0_flag ;
212 bool m_constraint_set1_flag ;
213 bool m_constraint_set2_flag ;
214 bool m_constraint_set3_flag ;
215 bool m_constraint_set4_flag ;
216 bool m_constraint_set5_flag ;
217 unsigned int m_zero ;
218 unsigned int m_level_idc ;
219 unsigned int m_sequence_parameter_set_id ;
220 unsigned int m_chroma_format_idc ;
221 bool m_separate_colour_plane_flag ;
222 unsigned int m_bit_depth_luma_minus8 ;
223 unsigned int m_bit_depth_chroma_minus8 ;
224 bool m_qpprime_y_zero_transform_bypass_flag ;
225 bool m_seq_scaling_matrix_present_flag ;
226 unsigned int m_log2_max_frame_num_minus4 ;
227 unsigned int m_pic_order_cnt_type ;
228 unsigned int m_log2_max_pic_order_cnt_lsb_minus4 ;
229 bool m_delta_pic_order_always_zero_flag ;
230 int m_offset_for_non_ref_pic ;
231 int m_offset_for_top_to_bottom_field ;
232 unsigned int m_num_ref_frames_in_pic_order_cnt_cycle ;
233 unsigned int m_max_num_ref_frames ;
234 bool m_gaps_in_frame_num_value_allowed_flag ;
235 unsigned int m_pic_width_in_mbs_minus1 ;
236 unsigned int m_pic_height_in_map_units_minus1 ;
237 bool m_frame_mbs_only_flag ;
238 bool m_mb_adaptive_frame_field_flag ;
239 bool m_direct_8x8_inference_flag ;
240 bool m_frame_cropping_flag ;
241 unsigned int m_frame_crop_left_offset ;
242 unsigned int m_frame_crop_right_offset ;
243 unsigned int m_frame_crop_top_offset ;
244 unsigned int m_frame_crop_bottom_offset ;
245 bool m_vui_parameters_present_flag ;
246 bool m_nal_hrd_parameters_present_flag ;
247 bool m_vcl_hrd_parameters_present_flag ;
251 void report(
const std::string & ,
unsigned int = 0U ,
const std::string & = std::string() ) ;
252 void report_extra(
const std::string & ) ;
255 std::string m_reason ;
265 Pps(
const std::string & binary_pps_buffer ,
int sps_chroma_format_idc ) ;
271 std::string
reason()
const ;
278 unsigned int m_nalu_type ;
279 unsigned int m_pic_parameter_set_id ;
280 unsigned int m_seq_parameter_set_id ;
281 bool m_entropy_coding_mode_flag ;
282 bool m_bottom_field_pic_order_in_frame_present_flag ;
283 unsigned int m_num_slice_groups_minus1 ;
284 unsigned int m_num_ref_idx_10_default_active_minus1 ;
285 unsigned int m_num_ref_idx_11_default_active_minus1 ;
286 bool m_weighted_pred_flag ;
287 unsigned int m_weighted_bipred_idc ;
288 int m_pic_init_qp_minus26 ;
289 int m_pic_init_qs_minus26 ;
290 int m_chroma_qp_index_offset ;
291 bool m_deblocking_filter_control_present_flag ;
292 bool m_constrained_intra_pred_flag ;
293 bool m_redundant_pic_cnt_present_flag ;
294 bool m_transform_8x8_mode_flag ;
295 bool m_pic_scaling_matrix_present_flag ;
296 int m_second_chroma_qp_index_offset ;
299 std::string m_reason ;
302 void report(
const std::string & ) ;
314 static std::string
byteStuffed(
const std::string & s ) ;
320 static bool hasMarkers(
const std::string & s ) ;
324 static size_t findStopBit(
const std::string & s ,
size_t fail = 0U ) ;
328 static const std::string &
_000() ;
331 static const std::string &
_001() ;
334 static const std::string &
_002() ;
337 static const std::string &
_0001() ;
const std::vector< std::string > & spsList() const
Returns a list of binary strings for the sps structures.
Sps(const std::string &binary_sps_buffer)
Constructor taking a binary byte-stuffed sps buffer.
static Configuration fromAvcc(const std::string &binary_string)
Factory function taking an "avcC" binary string, including RBSP byte-stuffing (but no start code) – s...
void streamOut(std::ostream &) const
Streams out the sps info.
size_t spsCount() const
Returns sps().size().
static const std::string & _002()
Returns the 00-00-02 string.
Contains AVC configuration parameters, initialised from an "avcC" file segment or from an SDP "fmtp" ...
size_t ppsCount() const
Returns pps().size().
Pps(const std::string &binary_pps_buffer, int sps_chroma_format_idc)
Constructor taking a binary byte-stuffed pps buffer.
void streamOut(std::ostream &) const
Streams out the pps info.
bool valid() const
Returns true if a usable object.
unsigned int dx() const
Returns the picture width in pixels.
A Picture Sequence Parameter Set (PPS) structure.
A Sequence Parameter Set (SPS) structure.
static const std::string & _001()
Returns the 00-00-01 string.
A class for pulling integer values of various widths out of a bit stream.
static Configuration fromFmtp(const std::string &fmtp)
Factory function taking a SDP (Session Description Protocol) "fmtp" attribute string, something like "profile-level-id=...; ...; sprop-parameters-sets=Z00AKZpmA8==,aO48gA==".
std::string reason() const
Returns the in-valid() reason.
A bit-by-bit input iterator that extracts bits in msb-to-lsb order from a sequence of bytes...
static std::string removeByteStuffing(const std::string &s)
Removes byte stuffing from a byte-stuffed RBSP buffer.
unsigned int dy() const
Returns the picture height in pixels.
bool valid() const
Returns true if a usable object.
bool valid() const
Returns true if a usable object.
static std::string byteStuffed(const std::string &s)
Returns a byte-stuffed version of the given unstuffed RBSP buffer.
const Pps & pps(size_t i) const
Returns a reference to the i-th pps structure.
static bool hasMarkers(const std::string &s)
Returns true if the string contains one of the inter-RBSP markers (000, 001, 002).
std::string reason() const
Returns the in-valid() reason.
static void addByteStuffing(std::string &s)
Adds byte-stuffing to the given unstuffed RBSP buffer.
const Sps & sps(size_t i) const
Returns a reference to the i-th sps structure.
const std::vector< std::string > & ppsList() const
Returns a list of binary strings for the pps structures.
Provides static helper functions that relate to RBSP formatting.
static size_t findStopBit(const std::string &s, size_t fail=0U)
Returns the bit offset of the RBSP stop bit.
std::string reason() const
Returns the in-valid() reason.
std::string nalus() const
Returns the NALU byte-stream comprising the four-byte 00-00-00-01 start-code followed by the byte-stu...
static const std::string & _000()
Returns the 00-00-00 string.
unsigned int nalu_length_size() const
Returns the size of the nalu length values, typically 2.
static const std::string & _0001()
Returns the 00-00-00-01 string.
Configuration()
A default constructor for an in-valid() object.