OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebM project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 #include <climits> | 10 #include <climits> |
11 #include <vector> | 11 #include <vector> |
12 #include "third_party/googletest/src/include/gtest/gtest.h" | 12 #include "third_party/googletest/src/include/gtest/gtest.h" |
13 #include "test/codec_factory.h" | 13 #include "test/codec_factory.h" |
14 #include "test/encode_test_driver.h" | 14 #include "test/encode_test_driver.h" |
15 #include "test/i420_video_source.h" | 15 #include "test/i420_video_source.h" |
16 #include "test/util.h" | 16 #include "test/util.h" |
17 | 17 |
18 namespace { | 18 namespace { |
19 | 19 |
20 class KeyframeTest : public ::libvpx_test::EncoderTest, | 20 class KeyframeTest : public ::libvpx_test::EncoderTest, |
21 public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> { | 21 public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> { |
22 protected: | 22 protected: |
23 KeyframeTest() : EncoderTest(GET_PARAM(0)) {} | 23 KeyframeTest() : EncoderTest(GET_PARAM(0)) {} |
| 24 virtual ~KeyframeTest() {} |
24 | 25 |
25 virtual void SetUp() { | 26 virtual void SetUp() { |
26 InitializeConfig(); | 27 InitializeConfig(); |
27 SetMode(GET_PARAM(1)); | 28 SetMode(GET_PARAM(1)); |
28 kf_count_ = 0; | 29 kf_count_ = 0; |
29 kf_count_max_ = INT_MAX; | 30 kf_count_max_ = INT_MAX; |
30 kf_do_force_kf_ = false; | 31 kf_do_force_kf_ = false; |
31 set_cpu_used_ = 0; | 32 set_cpu_used_ = 0; |
32 } | 33 } |
33 | 34 |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 if (deadline_ == VPX_DL_REALTIME && *iter > 0) | 136 if (deadline_ == VPX_DL_REALTIME && *iter > 0) |
136 EXPECT_EQ(0, (*iter - 1) % 30) << "Unexpected keyframe at frame " | 137 EXPECT_EQ(0, (*iter - 1) % 30) << "Unexpected keyframe at frame " |
137 << *iter; | 138 << *iter; |
138 else | 139 else |
139 EXPECT_EQ(0, *iter % 30) << "Unexpected keyframe at frame " << *iter; | 140 EXPECT_EQ(0, *iter % 30) << "Unexpected keyframe at frame " << *iter; |
140 } | 141 } |
141 } | 142 } |
142 | 143 |
143 VP8_INSTANTIATE_TEST_CASE(KeyframeTest, ALL_TEST_MODES); | 144 VP8_INSTANTIATE_TEST_CASE(KeyframeTest, ALL_TEST_MODES); |
144 } // namespace | 145 } // namespace |
OLD | NEW |