vp9[loongarch]: Optimize fdct4x4/8x8_lsx
[platform/upstream/libvpx.git] / test / keyframe_test.cc
index d8b21a1..a13dec9 100644 (file)
@@ -17,8 +17,9 @@
 
 namespace {
 
-class KeyframeTest : public ::libvpx_test::EncoderTest,
-    public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
+class KeyframeTest
+    : public ::libvpx_test::EncoderTest,
+      public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
  protected:
   KeyframeTest() : EncoderTest(GET_PARAM(0)) {}
   virtual ~KeyframeTest() {}
@@ -34,10 +35,12 @@ class KeyframeTest : public ::libvpx_test::EncoderTest,
 
   virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
                                   ::libvpx_test::Encoder *encoder) {
-    if (kf_do_force_kf_)
+    if (kf_do_force_kf_) {
       frame_flags_ = (video->frame() % 3) ? 0 : VPX_EFLAG_FORCE_KF;
-    if (set_cpu_used_ && video->frame() == 1)
+    }
+    if (set_cpu_used_ && video->frame() == 0) {
       encoder->Control(VP8E_SET_CPUUSED, set_cpu_used_);
+    }
   }
 
   virtual void FramePktHook(const vpx_codec_cx_pkt_t *pkt) {
@@ -65,8 +68,9 @@ 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)
+  if (GET_PARAM(1) > 0) {
     EXPECT_GT(kf_count_, 1);
+  }
 }
 
 TEST_P(KeyframeTest, TestDisableKeyframes) {
@@ -114,8 +118,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
@@ -127,19 +130,20 @@ TEST_P(KeyframeTest, TestAutoKeyframe) {
 
   // In realtime mode - auto placed keyframes are exceedingly rare,  don't
   // bother with this check
-  if (GET_PARAM(1) > 0)
+  if (GET_PARAM(1) > 0) {
     EXPECT_EQ(2u, kf_pts_list_.size()) << " Not the right number of keyframes ";
+  }
 
   // Verify that keyframes match the file keyframes in the file.
   for (std::vector<vpx_codec_pts_t>::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;
+      EXPECT_EQ(0, (*iter - 1) % 30)
+          << "Unexpected keyframe at frame " << *iter;
     else
       EXPECT_EQ(0, *iter % 30) << "Unexpected keyframe at frame " << *iter;
   }
 }
 
-VP8_INSTANTIATE_TEST_CASE(KeyframeTest, ALL_TEST_MODES);
+VP8_INSTANTIATE_TEST_SUITE(KeyframeTest, ALL_TEST_MODES);
 }  // namespace