MCPcopy Create free account
hub / github.com/IENT/YUView / parse

Method parse

YUViewLib/src/parser/AVC/SEI/pic_timing.cpp:42–187  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40using namespace reader;
41
42SEIParsingResult pic_timing::parse(SubByteReaderLogging & reader,
43 bool reparse,
44 SPSMap & spsMap,
45 std::shared_ptr<seq_parameter_set_rbsp> associatedSPS)
46{
47 (void)spsMap;
48
49 if (!associatedSPS)
50 {
51 if (reparse)
52 throw std::logic_error("associatedSPS is nullptr");
53 else
54 return SEIParsingResult::WAIT_FOR_PARAMETER_SETS;
55 }
56
57 auto subLevel = SubByteReaderLoggingSubLevel(reader, "pic_timing()");
58
59 // ... is dependent on the content of the sequence parameter set that is active for the primary
60 // coded picture associated with the picture timing SEI message.
61 auto CpbDpbDelaysPresentFlag =
62 associatedSPS->seqParameterSetData.vuiParameters.nal_hrd_parameters_present_flag ||
63 associatedSPS->seqParameterSetData.vuiParameters.vcl_hrd_parameters_present_flag;
64 if (CpbDpbDelaysPresentFlag)
65 {
66 unsigned nrBits_removal_delay = 0;
67 unsigned nrBits_output_delay = 0;
68 auto NalHrdBpPresentFlag =
69 associatedSPS->seqParameterSetData.vuiParameters.nal_hrd_parameters_present_flag;
70 if (NalHrdBpPresentFlag)
71 {
72 nrBits_removal_delay = associatedSPS->seqParameterSetData.vuiParameters.nalHrdParameters
73 .cpb_removal_delay_length_minus1 +
74 1;
75 nrBits_output_delay = associatedSPS->seqParameterSetData.vuiParameters.nalHrdParameters
76 .dpb_output_delay_length_minus1 +
77 1;
78 }
79 auto VclHrdBpPresentFlag =
80 associatedSPS->seqParameterSetData.vuiParameters.vcl_hrd_parameters_present_flag;
81 if (VclHrdBpPresentFlag)
82 {
83 nrBits_removal_delay = associatedSPS->seqParameterSetData.vuiParameters.vclHrdParameters
84 .cpb_removal_delay_length_minus1 +
85 1;
86 nrBits_output_delay = associatedSPS->seqParameterSetData.vuiParameters.vclHrdParameters
87 .dpb_output_delay_length_minus1 +
88 1;
89 }
90
91 if (NalHrdBpPresentFlag || VclHrdBpPresentFlag)
92 {
93 this->cpb_removal_delay = reader.readBits("cpb_removal_delay", nrBits_removal_delay);
94 this->dpb_output_delay = reader.readBits("dpb_output_delay", nrBits_output_delay);
95 }
96 }
97
98 if (associatedSPS->seqParameterSetData.vuiParameters.pic_struct_present_flag)
99 {

Callers

nothing calls this directly

Calls 5

OptionsClass · 0.85
formatArrayFunction · 0.85
readFlagMethod · 0.80
readBitsMethod · 0.45

Tested by

no test coverage detected