| 40 | using namespace parser::reader; |
| 41 | |
| 42 | void sequence_header::parse(SubByteReaderLogging &reader) |
| 43 | { |
| 44 | SubByteReaderLoggingSubLevel subLevel(reader, "sequence_header"); |
| 45 | |
| 46 | this->horizontal_size_value = reader.readBits("horizontal_size_value", 12); |
| 47 | this->vertical_size_value = reader.readBits("vertical_size_value", 12); |
| 48 | |
| 49 | this->aspect_ratio_information = reader.readBits( |
| 50 | "aspect_ratio_information", |
| 51 | 4, |
| 52 | Options() |
| 53 | .withMeaningVector( |
| 54 | {"Forbidden", "SAR 1.0 (Square Sample)", "DAR 3:4", "DAR 9:16", "DAR 1:2.21"}) |
| 55 | .withMeaning("Reserved")); |
| 56 | |
| 57 | this->frame_rate_code = reader.readBits("frame_rate_code", |
| 58 | 4, |
| 59 | Options() |
| 60 | .withMeaningVector({"Forbidden", |
| 61 | "24000:1001 (23.976...)", |
| 62 | "24", |
| 63 | "25", |
| 64 | "30000:1001 (29.97...)", |
| 65 | "30", |
| 66 | "50", |
| 67 | "60000:1001 (59.94)", |
| 68 | "60"}) |
| 69 | .withMeaning("Reserved")); |
| 70 | |
| 71 | this->bit_rate_value = reader.readBits( |
| 72 | "bit_rate_value", 18, Options().withMeaning("The lower 18 bits of bit_rate.")); |
| 73 | this->marker_bit = reader.readFlag("marker_bit", Options().withCheckEqualTo(1)); |
| 74 | this->vbv_buffer_size_value = reader.readBits( |
| 75 | "vbv_buffer_size_value", 10, Options().withMeaning("the lower 10 bits of vbv_buffer_size")); |
| 76 | this->constrained_parameters_flag = reader.readFlag("constrained_parameters_flag"); |
| 77 | this->load_intra_quantiser_matrix = reader.readFlag("load_intra_quantiser_matrix"); |
| 78 | if (this->load_intra_quantiser_matrix) |
| 79 | { |
| 80 | for (unsigned i = 0; i < 64; i++) |
| 81 | this->intra_quantiser_matrix[i] = |
| 82 | reader.readBits(formatArray("intra_quantiser_matrix", i), 8); |
| 83 | } |
| 84 | this->load_non_intra_quantiser_matrix = reader.readFlag("load_non_intra_quantiser_matrix"); |
| 85 | if (this->load_non_intra_quantiser_matrix) |
| 86 | { |
| 87 | for (unsigned i = 0; i < 64; i++) |
| 88 | this->non_intra_quantiser_matrix[i] = |
| 89 | reader.readBits(formatArray("non_intra_quantiser_matrix", i), 8); |
| 90 | } |
| 91 | } |
| 92 | |
| 93 | } // namespace parser::mpeg2 |
nothing calls this directly
no test coverage detected