| 112 | } |
| 113 | |
| 114 | video::yuv::PixelFormatYUV ParserAnnexBVVC::getPixelFormat() const |
| 115 | { |
| 116 | using Subsampling = video::yuv::Subsampling; |
| 117 | |
| 118 | // Get the subsampling and bit-depth from the sps |
| 119 | int bitDepthY = -1; |
| 120 | int bitDepthC = -1; |
| 121 | auto subsampling = Subsampling::UNKNOWN; |
| 122 | for (const auto &nal : this->nalUnitsForSeeking) |
| 123 | { |
| 124 | if (nal->header.nal_unit_type == vvc::NalType::SPS_NUT) |
| 125 | { |
| 126 | auto sps = std::dynamic_pointer_cast<seq_parameter_set_rbsp>(nal->rbsp); |
| 127 | if (sps->sps_chroma_format_idc == 0) |
| 128 | subsampling = Subsampling::YUV_400; |
| 129 | else if (sps->sps_chroma_format_idc == 1) |
| 130 | subsampling = Subsampling::YUV_420; |
| 131 | else if (sps->sps_chroma_format_idc == 2) |
| 132 | subsampling = Subsampling::YUV_422; |
| 133 | else if (sps->sps_chroma_format_idc == 3) |
| 134 | subsampling = Subsampling::YUV_444; |
| 135 | |
| 136 | bitDepthY = sps->sps_bitdepth_minus8 + 8; |
| 137 | bitDepthC = sps->sps_bitdepth_minus8 + 8; |
| 138 | } |
| 139 | |
| 140 | if (bitDepthY != -1 && bitDepthC != -1 && subsampling != Subsampling::UNKNOWN) |
| 141 | { |
| 142 | if (bitDepthY != bitDepthC) |
| 143 | { |
| 144 | // Different luma and chroma bit depths currently not supported |
| 145 | return {}; |
| 146 | } |
| 147 | return video::yuv::PixelFormatYUV(subsampling, bitDepthY); |
| 148 | } |
| 149 | } |
| 150 | |
| 151 | return {}; |
| 152 | } |
| 153 | |
| 154 | std::optional<ParserAnnexB::SeekData> ParserAnnexBVVC::getSeekData(int iFrameNr) |
| 155 | { |
no test coverage detected