diff --git a/modules/video_coding/utility/vp9_uncompressed_header_parser.cc b/modules/video_coding/utility/vp9_uncompressed_header_parser.cc index b8daf362af..b0650694ec 100644 --- a/modules/video_coding/utility/vp9_uncompressed_header_parser.cc +++ b/modules/video_coding/utility/vp9_uncompressed_header_parser.cc @@ -386,6 +386,11 @@ bool Vp9ReadSegmentationParams(BitstreamReader* br, for (size_t i = 0; i < kVp9MaxSegments; ++i) { for (size_t j = 0; j < kVp9SegLvlMax; ++j) { RETURN_IF_FALSE(br->IfNextBoolean([&] { // feature_enabled + if (kSegmentationFeatureBits[j] == 0) { + // No feature bits used and no sign, just mark it and return. + frame_info->segmentation_features[i][j] = 1; + return true; + } READ_OR_RETURN( br->ReadUnsigned(kSegmentationFeatureBits[j]), [&](uint8_t feature_value) { diff --git a/modules/video_coding/utility/vp9_uncompressed_header_parser_unittest.cc b/modules/video_coding/utility/vp9_uncompressed_header_parser_unittest.cc index e6cf6694cb..913f43eba7 100644 --- a/modules/video_coding/utility/vp9_uncompressed_header_parser_unittest.cc +++ b/modules/video_coding/utility/vp9_uncompressed_header_parser_unittest.cc @@ -84,5 +84,15 @@ TEST(Vp9UncompressedHeaderParserTest, SegmentationWithDefaultPredProbs) { Optional(ElementsAre(255, 255, 255))); } +TEST(Vp9UncompressedHeaderParserTest, SegmentationWithSkipLevel) { + const uint8_t kHeader[] = {0x90, 0x49, 0x83, 0x42, 0x80, 0x2e, 0x30, 0x00, + 0xb0, 0x00, 0x37, 0xff, 0x0d, 0x00, 0x02, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; + absl::optional frame_info = + ParseUncompressedVp9Header(kHeader); + ASSERT_TRUE(frame_info.has_value()); + EXPECT_THAT(frame_info->segmentation_features[0][kVp9SegLvlSkip], Eq(1)); +} + } // namespace vp9 } // namespace webrtc