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 "third_party/googletest/src/include/gtest/gtest.h" | 10 #include "third_party/googletest/src/include/gtest/gtest.h" |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 cfg_.rc_min_quantizer = 0; | 241 cfg_.rc_min_quantizer = 0; |
242 cfg_.rc_max_quantizer = 63; | 242 cfg_.rc_max_quantizer = 63; |
243 cfg_.rc_end_usage = VPX_CBR; | 243 cfg_.rc_end_usage = VPX_CBR; |
244 | 244 |
245 ::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288, | 245 ::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288, |
246 30, 1, 0, 140); | 246 30, 1, 0, 140); |
247 for (int i = 150; i < 800; i += 200) { | 247 for (int i = 150; i < 800; i += 200) { |
248 cfg_.rc_target_bitrate = i; | 248 cfg_.rc_target_bitrate = i; |
249 ResetModel(); | 249 ResetModel(); |
250 ASSERT_NO_FATAL_FAILURE(RunLoop(&video)); | 250 ASSERT_NO_FATAL_FAILURE(RunLoop(&video)); |
251 ASSERT_GE(cfg_.rc_target_bitrate, effective_datarate_ * 0.8) | 251 ASSERT_GE(static_cast<double>(cfg_.rc_target_bitrate), |
| 252 effective_datarate_ * 0.85) |
252 << " The datarate for the file exceeds the target by too much!"; | 253 << " The datarate for the file exceeds the target by too much!"; |
253 ASSERT_LE(cfg_.rc_target_bitrate, effective_datarate_ * 1.3) | 254 ASSERT_LE(static_cast<double>(cfg_.rc_target_bitrate), |
| 255 effective_datarate_ * 1.15) |
254 << " The datarate for the file missed the target!"; | 256 << " The datarate for the file missed the target!"; |
255 } | 257 } |
256 } | 258 } |
257 | 259 |
258 VP8_INSTANTIATE_TEST_CASE(DatarateTest, ALL_TEST_MODES); | 260 VP8_INSTANTIATE_TEST_CASE(DatarateTest, ALL_TEST_MODES); |
259 VP9_INSTANTIATE_TEST_CASE(DatarateTestVP9, | 261 VP9_INSTANTIATE_TEST_CASE(DatarateTestVP9, |
260 ::testing::Values(::libvpx_test::kOnePassGood), | 262 ::testing::Values(::libvpx_test::kOnePassGood), |
261 ::testing::Range(1, 5)); | 263 ::testing::Range(1, 5)); |
262 } // namespace | 264 } // namespace |
OLD | NEW |