OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 11 matching lines...) Expand all Loading... |
22 #include "test/util.h" | 22 #include "test/util.h" |
23 #if CONFIG_WEBM_IO | 23 #if CONFIG_WEBM_IO |
24 #include "test/webm_video_source.h" | 24 #include "test/webm_video_source.h" |
25 #endif | 25 #endif |
26 #include "vpx_mem/vpx_mem.h" | 26 #include "vpx_mem/vpx_mem.h" |
27 | 27 |
28 namespace { | 28 namespace { |
29 | 29 |
30 enum DecodeMode { | 30 enum DecodeMode { |
31 kSerialMode, | 31 kSerialMode, |
32 kFrameParallMode | 32 kFrameParallelMode |
33 }; | 33 }; |
34 | 34 |
35 const int kDecodeMode = 0; | 35 const int kDecodeMode = 0; |
36 const int kThreads = 1; | 36 const int kThreads = 1; |
37 const int kFileName = 2; | 37 const int kFileName = 2; |
38 | 38 |
39 typedef std::tr1::tuple<int, int, const char*> DecodeParam; | 39 typedef std::tr1::tuple<int, int, const char*> DecodeParam; |
40 | 40 |
41 class TestVectorTest : public ::libvpx_test::DecoderTest, | 41 class TestVectorTest : public ::libvpx_test::DecoderTest, |
42 public ::libvpx_test::CodecTestWithParam<DecodeParam> { | 42 public ::libvpx_test::CodecTestWithParam<DecodeParam> { |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 TEST_P(TestVectorTest, MD5Match) { | 88 TEST_P(TestVectorTest, MD5Match) { |
89 const DecodeParam input = GET_PARAM(1); | 89 const DecodeParam input = GET_PARAM(1); |
90 const std::string filename = std::tr1::get<kFileName>(input); | 90 const std::string filename = std::tr1::get<kFileName>(input); |
91 const int threads = std::tr1::get<kThreads>(input); | 91 const int threads = std::tr1::get<kThreads>(input); |
92 const int mode = std::tr1::get<kDecodeMode>(input); | 92 const int mode = std::tr1::get<kDecodeMode>(input); |
93 libvpx_test::CompressedVideoSource *video = NULL; | 93 libvpx_test::CompressedVideoSource *video = NULL; |
94 vpx_codec_flags_t flags = 0; | 94 vpx_codec_flags_t flags = 0; |
95 vpx_codec_dec_cfg_t cfg = {0}; | 95 vpx_codec_dec_cfg_t cfg = {0}; |
96 char str[256]; | 96 char str[256]; |
97 | 97 |
98 if (mode == kFrameParallMode) { | 98 if (mode == kFrameParallelMode) { |
99 flags |= VPX_CODEC_USE_FRAME_THREADING; | 99 flags |= VPX_CODEC_USE_FRAME_THREADING; |
100 } | 100 } |
101 | 101 |
102 cfg.threads = threads; | 102 cfg.threads = threads; |
103 | 103 |
104 snprintf(str, sizeof(str) / sizeof(str[0]) - 1, | 104 snprintf(str, sizeof(str) / sizeof(str[0]) - 1, |
105 "file: %s mode: %s threads: %d", | 105 "file: %s mode: %s threads: %d", |
106 filename.c_str(), mode == 0 ? "Serial" : "Parallel", threads); | 106 filename.c_str(), mode == 0 ? "Serial" : "Parallel", threads); |
107 SCOPED_TRACE(str); | 107 SCOPED_TRACE(str); |
108 | 108 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 ::testing::Values( | 163 ::testing::Values( |
164 static_cast<const libvpx_test::CodecFactory *>(&libvpx_test::kVP9)), | 164 static_cast<const libvpx_test::CodecFactory *>(&libvpx_test::kVP9)), |
165 ::testing::Combine( | 165 ::testing::Combine( |
166 ::testing::Values(1), // Frame Parallel mode. | 166 ::testing::Values(1), // Frame Parallel mode. |
167 ::testing::Range(2, 9), // With 2 ~ 8 threads. | 167 ::testing::Range(2, 9), // With 2 ~ 8 threads. |
168 ::testing::ValuesIn(libvpx_test::kVP9TestVectors, | 168 ::testing::ValuesIn(libvpx_test::kVP9TestVectors, |
169 libvpx_test::kVP9TestVectors + | 169 libvpx_test::kVP9TestVectors + |
170 libvpx_test::kNumVP9TestVectors)))); | 170 libvpx_test::kNumVP9TestVectors)))); |
171 #endif | 171 #endif |
172 } // namespace | 172 } // namespace |
OLD | NEW |