| 38 | using namespace reader; |
| 39 | |
| 40 | void vui_parameters::parse(SubByteReaderLogging &reader, unsigned sps_max_sub_layers_minus1) |
| 41 | { |
| 42 | SubByteReaderLoggingSubLevel subLevel(reader, "vui_parameters()"); |
| 43 | |
| 44 | this->aspect_ratio_info_present_flag = reader.readFlag("aspect_ratio_info_present_flag"); |
| 45 | if (this->aspect_ratio_info_present_flag) |
| 46 | { |
| 47 | this->aspect_ratio_idc = reader.readBits("aspect_ratio_idc", |
| 48 | 8, |
| 49 | Options().withMeaningVector({"Unspecified", |
| 50 | "1:1 (square)", |
| 51 | "12:11", |
| 52 | "10:11", |
| 53 | "16:11", |
| 54 | "40:33", |
| 55 | "24:11", |
| 56 | "20:11", |
| 57 | "32:11", |
| 58 | "80:33", |
| 59 | "18:11", |
| 60 | "15:11", |
| 61 | "64:33", |
| 62 | "160:99", |
| 63 | "4:3", |
| 64 | "3:2", |
| 65 | "2:1", |
| 66 | "Reserved"})); |
| 67 | if (this->aspect_ratio_idc == 255) // EXTENDED_SAR=255 |
| 68 | { |
| 69 | this->sar_width = reader.readBits("sar_width", 16); |
| 70 | this->sar_height = reader.readBits("sar_height", 16); |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | this->overscan_info_present_flag = reader.readFlag("overscan_info_present_flag"); |
| 75 | if (this->overscan_info_present_flag) |
| 76 | this->overscan_appropriate_flag = reader.readFlag("overscan_appropriate_flag"); |
| 77 | |
| 78 | this->video_signal_type_present_flag = reader.readFlag("video_signal_type_present_flag"); |
| 79 | if (video_signal_type_present_flag) |
| 80 | { |
| 81 | this->video_format = |
| 82 | reader.readBits("video_format", |
| 83 | 3, |
| 84 | Options() |
| 85 | .withMeaningVector({"Component", "PAL", "NTSC", "SECAM", "MAC"}) |
| 86 | .withMeaning("Unspecified video format")); |
| 87 | this->video_full_range_flag = reader.readFlag("video_full_range_flag"); |
| 88 | |
| 89 | this->colour_description_present_flag = reader.readFlag("colour_description_present_flag"); |
| 90 | if (this->colour_description_present_flag) |
| 91 | { |
| 92 | this->colour_primaries = reader.readBits( |
| 93 | "colour_primaries", |
| 94 | 8, |
| 95 | Options() |
| 96 | .withMeaningVector( |
| 97 | {"Reserved For future use by ITU-T | ISO/IEC", |