OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 | 10 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 }; | 79 }; |
80 | 80 |
81 int is_extension_y4m(const char *filename) { | 81 int is_extension_y4m(const char *filename) { |
82 const char *dot = strrchr(filename, '.'); | 82 const char *dot = strrchr(filename, '.'); |
83 if (!dot || dot == filename) | 83 if (!dot || dot == filename) |
84 return 0; | 84 return 0; |
85 else | 85 else |
86 return !strcmp(dot, ".y4m"); | 86 return !strcmp(dot, ".y4m"); |
87 } | 87 } |
88 | 88 |
89 class Vp9EncoderParmsGetToDecoder | 89 class VpxEncoderParmsGetToDecoder |
90 : public ::libvpx_test::EncoderTest, | 90 : public ::libvpx_test::EncoderTest, |
91 public ::libvpx_test::CodecTestWith2Params<EncodeParameters, \ | 91 public ::libvpx_test::CodecTestWith2Params<EncodeParameters, \ |
92 EncodePerfTestVideo> { | 92 EncodePerfTestVideo> { |
93 protected: | 93 protected: |
94 Vp9EncoderParmsGetToDecoder() | 94 VpxEncoderParmsGetToDecoder() |
95 : EncoderTest(GET_PARAM(0)), | 95 : EncoderTest(GET_PARAM(0)), |
96 encode_parms(GET_PARAM(1)) { | 96 encode_parms(GET_PARAM(1)) { |
97 } | 97 } |
98 | 98 |
99 virtual ~Vp9EncoderParmsGetToDecoder() {} | 99 virtual ~VpxEncoderParmsGetToDecoder() {} |
100 | 100 |
101 virtual void SetUp() { | 101 virtual void SetUp() { |
102 InitializeConfig(); | 102 InitializeConfig(); |
103 SetMode(::libvpx_test::kTwoPassGood); | 103 SetMode(::libvpx_test::kTwoPassGood); |
104 cfg_.g_lag_in_frames = 25; | 104 cfg_.g_lag_in_frames = 25; |
105 cfg_.g_error_resilient = encode_parms.error_resilient; | 105 cfg_.g_error_resilient = encode_parms.error_resilient; |
106 dec_cfg_.threads = 4; | 106 dec_cfg_.threads = 4; |
107 test_video_ = GET_PARAM(2); | 107 test_video_ = GET_PARAM(2); |
108 cfg_.rc_target_bitrate = test_video_.bitrate; | 108 cfg_.rc_target_bitrate = test_video_.bitrate; |
109 } | 109 } |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 } | 159 } |
160 | 160 |
161 EncodePerfTestVideo test_video_; | 161 EncodePerfTestVideo test_video_; |
162 | 162 |
163 private: | 163 private: |
164 EncodeParameters encode_parms; | 164 EncodeParameters encode_parms; |
165 }; | 165 }; |
166 | 166 |
167 // TODO(hkuang): This test conflicts with frame parallel decode. So disable it | 167 // TODO(hkuang): This test conflicts with frame parallel decode. So disable it |
168 // for now until fix. | 168 // for now until fix. |
169 TEST_P(Vp9EncoderParmsGetToDecoder, DISABLED_BitstreamParms) { | 169 TEST_P(VpxEncoderParmsGetToDecoder, DISABLED_BitstreamParms) { |
170 init_flags_ = VPX_CODEC_USE_PSNR; | 170 init_flags_ = VPX_CODEC_USE_PSNR; |
171 | 171 |
172 libvpx_test::VideoSource *video; | 172 libvpx_test::VideoSource *video; |
173 if (is_extension_y4m(test_video_.name)) { | 173 if (is_extension_y4m(test_video_.name)) { |
174 video = new libvpx_test::Y4mVideoSource(test_video_.name, | 174 video = new libvpx_test::Y4mVideoSource(test_video_.name, |
175 0, test_video_.frames); | 175 0, test_video_.frames); |
176 } else { | 176 } else { |
177 video = new libvpx_test::YUVVideoSource(test_video_.name, | 177 video = new libvpx_test::YUVVideoSource(test_video_.name, |
178 VPX_IMG_FMT_I420, | 178 VPX_IMG_FMT_I420, |
179 test_video_.width, | 179 test_video_.width, |
180 test_video_.height, | 180 test_video_.height, |
181 kFramerate, 1, 0, | 181 kFramerate, 1, 0, |
182 test_video_.frames); | 182 test_video_.frames); |
183 } | 183 } |
184 | 184 |
185 ASSERT_NO_FATAL_FAILURE(RunLoop(video)); | 185 ASSERT_NO_FATAL_FAILURE(RunLoop(video)); |
186 delete(video); | 186 delete(video); |
187 } | 187 } |
188 | 188 |
189 VP9_INSTANTIATE_TEST_CASE( | 189 VP9_INSTANTIATE_TEST_CASE( |
190 Vp9EncoderParmsGetToDecoder, | 190 VpxEncoderParmsGetToDecoder, |
191 ::testing::ValuesIn(kVP9EncodeParameterSet), | 191 ::testing::ValuesIn(kVP9EncodeParameterSet), |
192 ::testing::ValuesIn(kVP9EncodePerfTestVectors)); | 192 ::testing::ValuesIn(kVP9EncodePerfTestVectors)); |
193 | 193 |
| 194 VP10_INSTANTIATE_TEST_CASE( |
| 195 VpxEncoderParmsGetToDecoder, |
| 196 ::testing::ValuesIn(kVP9EncodeParameterSet), |
| 197 ::testing::ValuesIn(kVP9EncodePerfTestVectors)); |
194 } // namespace | 198 } // namespace |
OLD | NEW |