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

Method parse

YUViewLib/src/parser/VVC/scaling_list_data.cpp:87–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85using namespace parser::reader;
86
87void scaling_list_data::parse(SubByteReaderLogging &reader, adaptation_parameter_set_rbsp *aps)
88{
89 SubByteReaderLoggingSubLevel subLevel(reader, "scaling_list_data");
90
91 auto DiagScanOrder = calcDiagScanOrder();
92
93 for (unsigned id = 0; id < 28; id++)
94 {
95 auto matrixSize = id < 2 ? 2u : (id < 8 ? 4u : 8u);
96 this->ScalingList.push_back({});
97 if (aps->aps_chroma_present_flag || id % 3 == 2 || id == 27)
98 {
99 this->scaling_list_copy_mode_flag[id] = reader.readFlag("scaling_list_copy_mode_flag");
100 if (!this->scaling_list_copy_mode_flag[id])
101 {
102 this->scaling_list_pred_mode_flag[id] = reader.readFlag("scaling_list_pred_mode_flag");
103 }
104 if ((this->scaling_list_copy_mode_flag[id] || this->scaling_list_pred_mode_flag[id]) &&
105 id != 0 && id != 2 && id != 8)
106 {
107 this->scaling_list_pred_id_delta[id] = reader.readUEV("scaling_list_pred_id_delta");
108 }
109 if (!this->scaling_list_copy_mode_flag[id])
110 {
111 auto nextCoef = 0;
112 if (id > 13)
113 {
114 this->scaling_list_dc_coef[id] = reader.readSEV("scaling_list_dc_coef");
115 nextCoef += this->scaling_list_dc_coef[id - 14];
116 }
117
118 for (unsigned i = 0; i < matrixSize * matrixSize; i++)
119 {
120 auto x = DiagScanOrder[3][3][i][0];
121 auto y = DiagScanOrder[3][3][i][1];
122 if (!(id > 25 && x >= 4 && y >= 4))
123 {
124 this->scaling_list_delta_coef[id][i] = reader.readSEV("scaling_list_delta_coef");
125 nextCoef += this->scaling_list_delta_coef[id][i];
126 }
127 this->ScalingList[id].push_back(nextCoef);
128 }
129 }
130 }
131 else
132 {
133 this->scaling_list_copy_mode_flag[id] = true;
134 }
135 }
136}
137
138} // namespace parser::vvc

Callers

nothing calls this directly

Calls 4

calcDiagScanOrderFunction · 0.85
readFlagMethod · 0.80
readUEVMethod · 0.80
readSEVMethod · 0.80

Tested by

no test coverage detected