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

Method parse

YUViewLib/src/parser/VVC/pic_parameter_set_rbsp.cpp:44–385  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42using namespace parser::reader;
43
44void pic_parameter_set_rbsp::parse(SubByteReaderLogging &reader, SPSMap &spsMap)
45{
46 SubByteReaderLoggingSubLevel subLevel(reader, "pic_parameter_set_rbsp");
47
48 this->pps_pic_parameter_set_id = reader.readBits("pps_pic_parameter_set_id", 6);
49 this->pps_seq_parameter_set_id =
50 reader.readBits("pps_seq_parameter_set_id", 4, Options().withCheckRange({0, 15}));
51
52 if (spsMap.count(this->pps_seq_parameter_set_id) == 0)
53 throw std::logic_error("SPS with given pps_seq_parameter_set_id not found.");
54 auto sps = spsMap[this->pps_seq_parameter_set_id];
55
56 this->pps_mixed_nalu_types_in_pic_flag = reader.readFlag("pps_mixed_nalu_types_in_pic_flag");
57 {
58 auto check = sps->sps_res_change_in_clvs_allowed_flag
59 ? Options().withCheckSmaller(sps->sps_pic_width_max_in_luma_samples)
60 : Options().withCheckEqualTo(sps->sps_pic_width_max_in_luma_samples);
61 this->pps_pic_width_in_luma_samples = reader.readUEV("pps_pic_width_in_luma_samples", check);
62 }
63 {
64 auto check = sps->sps_res_change_in_clvs_allowed_flag
65 ? Options().withCheckSmaller(sps->sps_pic_height_max_in_luma_samples)
66 : Options().withCheckEqualTo(sps->sps_pic_height_max_in_luma_samples);
67 this->pps_pic_height_in_luma_samples = reader.readUEV("pps_pic_height_in_luma_samples", check);
68 }
69
70 // (64) -> (72)
71 this->PicWidthInCtbsY = std::ceil(this->pps_pic_width_in_luma_samples / sps->CtbSizeY);
72 this->PicHeightInCtbsY = std::ceil(this->pps_pic_height_in_luma_samples / sps->CtbSizeY);
73 this->PicSizeInCtbsY = this->PicWidthInCtbsY * this->PicHeightInCtbsY;
74 this->PicWidthInMinCbsY = this->pps_pic_width_in_luma_samples / sps->MinCbSizeY;
75 this->PicHeightInMinCbsY = this->pps_pic_height_in_luma_samples / sps->MinCbSizeY;
76 this->PicSizeInMinCbsY = this->PicWidthInMinCbsY * this->PicHeightInMinCbsY;
77 this->PicSizeInSamplesY =
78 this->pps_pic_width_in_luma_samples * this->pps_pic_height_in_luma_samples;
79 this->PicWidthInSamplesC = this->pps_pic_width_in_luma_samples / sps->SubWidthC;
80 this->PicHeightInSamplesC = this->pps_pic_height_in_luma_samples / sps->SubHeightC;
81
82 {
83 Options opt;
84 if (this->pps_pic_width_in_luma_samples == sps->sps_pic_width_max_in_luma_samples &&
85 this->pps_pic_height_in_luma_samples == sps->sps_pic_height_max_in_luma_samples)
86 opt = Options().withCheckEqualTo(0);
87 this->pps_conformance_window_flag = reader.readFlag("pps_conformance_window_flag", opt);
88 }
89 if (this->pps_conformance_window_flag)
90 {
91 this->pps_conf_win_left_offset = reader.readUEV("pps_conf_win_left_offset");
92 this->pps_conf_win_right_offset = reader.readUEV("pps_conf_win_right_offset");
93 this->pps_conf_win_top_offset = reader.readUEV("pps_conf_win_top_offset");
94 this->pps_conf_win_bottom_offset = reader.readUEV("pps_conf_win_bottom_offset");
95 }
96 {
97 Options opt;
98 if (!sps->sps_ref_pic_resampling_enabled_flag)
99 opt = Options().withCheckEqualTo(0);
100 this->pps_scaling_window_explicit_signalling_flag =
101 reader.readFlag("pps_scaling_window_explicit_signalling_flag", opt);

Callers

nothing calls this directly

Calls 9

OptionsClass · 0.85
readFlagMethod · 0.80
readUEVMethod · 0.80
readSEVMethod · 0.80
more_rbsp_dataMethod · 0.80
readBitsMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected