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

Method parse

YUViewLib/src/parser/Mpeg2/sequence_extension.cpp:42–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40using namespace parser::reader;
41
42void sequence_extension::parse(SubByteReaderLogging &reader)
43{
44 SubByteReaderLoggingSubLevel subLevel(reader, "sequence_extension");
45
46 this->profile_and_level_indication = reader.readBits("profile_and_level_indication", 8);
47
48 this->profile_identification = (this->profile_and_level_indication >> 4) & 0x07;
49 reader.logCalculatedValue(
50 "profile_identification",
51 this->profile_identification,
52 Options()
53 .withMeaningVector(
54 {"Reserved", "High", "Spatially Scalable", "SNR Scalable", "Main", "Simple"})
55 .withMeaning("Reserved"));
56
57 this->level_identification = this->profile_and_level_indication & 0x03;
58 reader.logCalculatedValue(
59 "level_identification",
60 this->level_identification,
61 Options().withMeaningMap(
62 {{0b0100, "High"}, {0b0110, "High 1440"}, {0b1000, "Main"}, {0b1010, "Low"}}));
63
64 this->progressive_sequence = reader.readFlag(
65 "progressive_sequence",
66 Options().withMeaningMap(
67 {{0,
68 "the coded video sequence may contain both frame-pictures and field-pictures, and "
69 "frame-picture may be progressive or interlaced frames."},
70 {1, "the coded video sequence contains only progressive frame-pictures"}}));
71
72 this->chroma_format = reader.readBits(
73 "chroma_format",
74 2,
75 Options().withMeaningMap({{0, "Reserved"}, {1, "4:2:0"}, {2, "4:2:2"}, {3, "4:4:4"}}));
76 this->horizontal_size_extension =
77 reader.readBits("horizontal_size_extension",
78 2,
79 Options().withMeaning("most significant bits from horizontal_size"));
80 this->vertical_size_extension =
81 reader.readBits("vertical_size_extension",
82 2,
83 Options().withMeaning("most significant bits from vertical_size"));
84 this->bit_rate_extension = reader.readBits(
85 "bit_rate_extension", 12, Options().withMeaning("12 most significant bits from bit_rate"));
86 this->marker_bit = reader.readFlag(
87 "marker_bit",
88 Options().withCheckEqualTo(
89 1, "The marker_bit shall be set to 1 to prevent emulation of start codes."));
90 this->vbv_buffer_size_extension =
91 reader.readBits("vbv_buffer_size_extension",
92 8,
93 Options().withMeaning("most significant bits from vbv_buffer_size"));
94 this->low_delay = reader.readFlag(
95 "low_delay",
96 Options().withMeaningMap(
97 {{0,
98 "sequence may contain B-pictures, the frame re-ordering delay is present in the VBV "
99 "description and the bitstream shall not contain big pictures"},

Callers

nothing calls this directly

Calls 4

OptionsClass · 0.85
logCalculatedValueMethod · 0.80
readFlagMethod · 0.80
readBitsMethod · 0.45

Tested by

no test coverage detected