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

Method parse

YUViewLib/src/parser/VVC/seq_parameter_set_rbsp.cpp:42–592  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40using namespace parser::reader;
41
42void seq_parameter_set_rbsp::parse(SubByteReaderLogging &reader)
43{
44 SubByteReaderLoggingSubLevel subLevel(reader, "seq_parameter_set_rbsp");
45
46 this->sps_seq_parameter_set_id = reader.readBits("sps_seq_parameter_set_id", 4);
47 this->sps_video_parameter_set_id = reader.readBits("sps_video_parameter_set_id", 4);
48 this->sps_max_sublayers_minus1 = reader.readBits("sps_max_sublayers_minus1", 3);
49 this->sps_chroma_format_idc = reader.readBits(
50 "sps_chroma_format_idc",
51 2,
52 Options().withMeaningMap({{0, "Monochrome"}, {1, "4:2:0"}, {2, "4:2:2"}, {3, "4:4:4"}}));
53
54 // Table 2
55 {
56 auto SubWidthCVec = std::vector({1, 2, 2, 1});
57 this->SubWidthC = SubWidthCVec[this->sps_chroma_format_idc];
58 auto SubHeightCVec = std::vector({1, 2, 1, 1});
59 this->SubHeightC = SubHeightCVec[this->sps_chroma_format_idc];
60 }
61
62 this->sps_log2_ctu_size_minus5 =
63 reader.readBits("sps_log2_ctu_size_minus5", 2, Options().withCheckRange({0, 2}));
64 this->sps_ptl_dpb_hrd_params_present_flag =
65 reader.readFlag("sps_ptl_dpb_hrd_params_present_flag");
66
67 // The variables CtbLog2SizeY and CtbSizeY are derived as follows:
68 this->CtbLog2SizeY = this->sps_log2_ctu_size_minus5 + 5; // (35)
69 this->CtbSizeY = 1 << this->CtbLog2SizeY; // (36)
70 if (this->sps_ptl_dpb_hrd_params_present_flag)
71 {
72 this->profile_tier_level_instance.parse(reader, true, sps_max_sublayers_minus1);
73 }
74 this->sps_gdr_enabled_flag = reader.readFlag("sps_gdr_enabled_flag");
75 this->sps_ref_pic_resampling_enabled_flag =
76 reader.readFlag("sps_ref_pic_resampling_enabled_flag");
77 if (this->sps_ref_pic_resampling_enabled_flag)
78 {
79 this->sps_res_change_in_clvs_allowed_flag =
80 reader.readFlag("sps_res_change_in_clvs_allowed_flag");
81 }
82 this->sps_pic_width_max_in_luma_samples = reader.readUEV(
83 "sps_pic_width_max_in_luma_samples"); // SubByteReaderLogging::Options(vps_ols_dpb_pic_width[i],
84 // SubByteReaderLogging::Options::CheckType::SmallerEqual)
85 this->sps_pic_height_max_in_luma_samples = reader.readUEV(
86 "sps_pic_height_max_in_luma_samples"); // SubByteReaderLogging::Options(vps_ols_dpb_pic_height[i],
87 // SubByteReaderLogging::Options::CheckType::SmallerEqual)
88 this->sps_conformance_window_flag = reader.readFlag("sps_conformance_window_flag");
89 if (this->sps_conformance_window_flag)
90 {
91 this->sps_conf_win_left_offset = reader.readUEV("sps_conf_win_left_offset");
92 this->sps_conf_win_right_offset = reader.readUEV("sps_conf_win_right_offset");
93 this->sps_conf_win_top_offset = reader.readUEV("sps_conf_win_top_offset");
94 this->sps_conf_win_bottom_offset = reader.readUEV("sps_conf_win_bottom_offset");
95 }
96 this->sps_subpic_info_present_flag = reader.readFlag(
97 "sps_subpic_info_present_flag",
98 this->sps_res_change_in_clvs_allowed_flag ? Options().withCheckEqualTo(0) : Options());
99 if (this->sps_subpic_info_present_flag)

Callers

nothing calls this directly

Calls 9

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

Tested by

no test coverage detected