X-Git-Url: https://granicus.if.org/sourcecode?a=blobdiff_plain;f=test%2Fkeyframe_test.cc;h=03cdedc1a56e096e0c952f8acf0d7acc7899f9c5;hb=33e40cb5db12309b69ef40e84b2ed522a54da09e;hp=85ca0b97556e0f614760565e656b68bcf6a9e0f2;hpb=69c67c9531b08c1b15985b351677a162739af43e;p=libvpx diff --git a/test/keyframe_test.cc b/test/keyframe_test.cc index 85ca0b975..03cdedc1a 100644 --- a/test/keyframe_test.cc +++ b/test/keyframe_test.cc @@ -17,10 +17,12 @@ namespace { -class KeyframeTest : public ::libvpx_test::EncoderTest, - public ::libvpx_test::CodecTestWithParam { +class KeyframeTest + : public ::libvpx_test::EncoderTest, + public ::libvpx_test::CodecTestWithParam { protected: KeyframeTest() : EncoderTest(GET_PARAM(0)) {} + virtual ~KeyframeTest() {} virtual void SetUp() { InitializeConfig(); @@ -31,10 +33,6 @@ class KeyframeTest : public ::libvpx_test::EncoderTest, set_cpu_used_ = 0; } - virtual bool Continue() const { - return !HasFatalFailure() && !abort_; - } - virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video, ::libvpx_test::Encoder *encoder) { if (kf_do_force_kf_) @@ -68,8 +66,7 @@ TEST_P(KeyframeTest, TestRandomVideoSource) { // In realtime mode - auto placed keyframes are exceedingly rare, don't // bother with this check if(GetParam() > 0) - if (GET_PARAM(1) > 0) - EXPECT_GT(kf_count_, 1); + if (GET_PARAM(1) > 0) EXPECT_GT(kf_count_, 1); } TEST_P(KeyframeTest, TestDisableKeyframes) { @@ -117,8 +114,7 @@ TEST_P(KeyframeTest, TestAutoKeyframe) { // may not produce a keyframe like we expect. This is necessary when running // on very slow environments (like Valgrind). The step -11 was determined // experimentally as the fastest mode that still throws the keyframe. - if (deadline_ == VPX_DL_REALTIME) - set_cpu_used_ = -11; + if (deadline_ == VPX_DL_REALTIME) set_cpu_used_ = -11; // This clip has a cut scene every 30 frames -> Frame 0, 30, 60, 90, 120. // I check only the first 40 frames to make sure there's a keyframe at frame @@ -136,10 +132,9 @@ TEST_P(KeyframeTest, TestAutoKeyframe) { // Verify that keyframes match the file keyframes in the file. for (std::vector::const_iterator iter = kf_pts_list_.begin(); iter != kf_pts_list_.end(); ++iter) { - if (deadline_ == VPX_DL_REALTIME && *iter > 0) EXPECT_EQ(0, (*iter - 1) % 30) << "Unexpected keyframe at frame " - << *iter; + << *iter; else EXPECT_EQ(0, *iter % 30) << "Unexpected keyframe at frame " << *iter; }