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

Function parse_2_bit_pixel_code_string

YUViewLib/src/parser/Subtitles/SubtitleDVB.cpp:142–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140}
141
142std::tuple<bool, unsigned> parse_2_bit_pixel_code_string(SubByteReaderLogging &reader)
143{
144 SubByteReaderLoggingSubLevel s(reader, "2-bit/pixel_code_string()");
145
146 bool end = false;
147 auto bitsRead = 0u;
148
149 auto next_bits = reader.readBits("next_bits", 2);
150 bitsRead += 2;
151
152 if (next_bits == 0)
153 {
154 auto switch_1 = reader.readFlag("switch_1");
155 bitsRead++;
156 if (switch_1)
157 {
158 reader.readBits("run_length_3_10", 3);
159 reader.readBits("two_bit_pixel_code", 2);
160 bitsRead += 5;
161 }
162 else
163 {
164 auto switch_2 = reader.readFlag("switch_2");
165 bitsRead++;
166 if (!switch_2)
167 {
168 auto switch_3 = reader.readBits("switch_3", 2);
169 bitsRead += 2;
170 if (switch_3 == 0)
171 {
172 end = true;
173 }
174 if (switch_3 == 2)
175 {
176 reader.readBits("run_length_12_27", 4);
177 reader.readBits("two_bit_pixel_code", 2);
178 bitsRead += 6;
179 }
180 if (switch_3 == 3)
181 {
182 reader.readBits("run_length_29_284", 8);
183 reader.readBits("two_bit_pixel_code", 2);
184 bitsRead += 10;
185 }
186 }
187 }
188 }
189
190 return {end, bitsRead};
191}
192
193std::tuple<bool, unsigned> parse_4_bit_pixel_code_string(SubByteReaderLogging &reader)
194{

Callers 1

parsePixelDataSubBlockFunction · 0.85

Calls 2

readFlagMethod · 0.80
readBitsMethod · 0.45

Tested by

no test coverage detected