diff options
author | Marco Paniconi <marpan@google.com> | 2023-12-05 11:59:15 -0800 |
---|---|---|
committer | Wan-Teh Chang <wtc@google.com> | 2023-12-08 01:45:50 +0000 |
commit | c884b2e60e6e4a98144fc8154851e9a35082a1bc (patch) | |
tree | e9205b74a114c1adfe2c19f8ee77eef4c99d46a5 | |
parent | 6fca4de48eaa110ada3ca849f445ca3754fb869a (diff) | |
download | libvpx-c884b2e60e6e4a98144fc8154851e9a35082a1bc.tar.gz |
Add unittest for issue b/314857577
Bug: b/314857577
Change-Id: I591036c1ad3362023686d395adb4783c51baa62d
(cherry picked from commit 12e928cb342d1d4cc8ac3c71b26da45e4488cb88)
-rw-r--r-- | test/encode_api_test.cc | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/test/encode_api_test.cc b/test/encode_api_test.cc index dcbd15c80..e228f635a 100644 --- a/test/encode_api_test.cc +++ b/test/encode_api_test.cc @@ -801,6 +801,55 @@ TEST(EncodeAPI, Buganizer311394513) { encoder.Encode(true); } +// This is a test case from clusterfuzz: based on b/314857577. +// Encode a few frames with multiple change config calls +// with different frame sizes. +TEST(EncodeAPI, Buganizer314857577) { + VP9Encoder encoder(4); + + // Set initial config. + encoder.Configure(12, 1060, 437, VPX_VBR, VPX_DL_REALTIME); + + // Encode first frame. + encoder.Encode(false); + + // Change config. + encoder.Configure(16, 1060, 1, VPX_CBR, VPX_DL_REALTIME); + + // Encode 2nd frame with new config. + encoder.Encode(false); + + // Encode 3rd frame with new config. + encoder.Encode(true); + + // Change config. + encoder.Configure(15, 33, 437, VPX_VBR, VPX_DL_GOOD_QUALITY); + + // Encode 4th frame with new config. + encoder.Encode(true); + + // Encode 5th frame with new config. + encoder.Encode(false); + + // Change config. + encoder.Configure(5, 327, 269, VPX_VBR, VPX_DL_REALTIME); + + // Change config. + encoder.Configure(15, 1060, 437, VPX_CBR, VPX_DL_REALTIME); + + // Encode 6th frame with new config. + encoder.Encode(false); + + // Encode 7th frame with new config. + encoder.Encode(false); + + // Change config. + encoder.Configure(4, 1060, 437, VPX_VBR, VPX_DL_REALTIME); + + // Encode 8th frame with new config. + encoder.Encode(false); +} + class EncodeApiGetTplStatsTest : public ::libvpx_test::EncoderTest, public ::testing::TestWithParam<const libvpx_test::CodecFactory *> { |