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

Method parse

YUViewLib/src/parser/HEVC/SEI/active_parameter_sets.cpp:43–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41using namespace reader;
42
43SEIParsingResult active_parameter_sets::parse(SubByteReaderLogging & reader,
44 bool reparse,
45 VPSMap & vpsMap,
46 SPSMap & spsMap,
47 std::shared_ptr<seq_parameter_set_rbsp> associatedSPS)
48{
49 (void)spsMap;
50 (void)associatedSPS;
51
52 std::unique_ptr<SubByteReaderLoggingSubLevel> subLevel;
53 if (reparse)
54 reader.stashAndReplaceCurrentTreeItem(this->reparseTreeItem);
55 else
56 subLevel.reset(new SubByteReaderLoggingSubLevel(reader, "active_parameter_sets()"));
57
58 this->active_video_parameter_set_id = reader.readBits("active_video_parameter_set_id", 4);
59 this->self_contained_cvs_flag = reader.readFlag("self_contained_cvs_flag");
60 this->no_parameter_set_update_flag = reader.readFlag("no_parameter_set_update_flag");
61 this->num_sps_ids_minus1 = reader.readUEV("num_sps_ids_minus1");
62 for (unsigned i = 0; i <= this->num_sps_ids_minus1; i++)
63 this->active_seq_parameter_set_id.push_back(
64 reader.readUEV(formatArray("active_seq_parameter_set_id", i)));
65
66 if (!reparse)
67 {
68 if (vpsMap.count(this->active_video_parameter_set_id) == 0)
69 {
70 this->reparseTreeItem = reader.getCurrentItemTree();
71 return SEIParsingResult::WAIT_FOR_PARAMETER_SETS;
72 }
73 }
74 else
75 {
76 if (vpsMap.count(this->active_video_parameter_set_id) == 0)
77 throw std::logic_error("VPS with the given active_video_parameter_set_id not found");
78 }
79 auto vps = vpsMap.at(this->active_video_parameter_set_id);
80
81 unsigned int MaxLayersMinus1 = std::min((unsigned int)62, vps->vps_max_layers_minus1);
82 for (unsigned int i = (vps->vps_base_layer_internal_flag ? 1 : 0); i <= MaxLayersMinus1; i++)
83 this->layer_sps_idx.push_back(reader.readUEV(formatArray("layer_sps_idx", i)));
84
85 reader.popTreeItem();
86 return SEIParsingResult::OK;
87}
88
89} // namespace parser::hevc

Callers

nothing calls this directly

Calls 8

formatArrayFunction · 0.85
readFlagMethod · 0.80
readUEVMethod · 0.80
getCurrentItemTreeMethod · 0.80
popTreeItemMethod · 0.80
readBitsMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected