From: Marco Paniconi Date: Tue, 5 Dec 2023 19:59:15 +0000 (-0800) Subject: Add unittest for issue b/314857577 X-Git-Tag: accepted/tizen/7.0/unified/20240521.012539~1^2~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c884b2e60e6e4a98144fc8154851e9a35082a1bc;p=platform%2Fupstream%2Flibvpx.git Add unittest for issue b/314857577 Bug: b/314857577 Change-Id: I591036c1ad3362023686d395adb4783c51baa62d (cherry picked from commit 12e928cb342d1d4cc8ac3c71b26da45e4488cb88) --- diff --git a/test/encode_api_test.cc b/test/encode_api_test.cc index dcbd15c..e228f63 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 {