OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2010 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 |
11 | 11 |
12 extern "C" { | 12 extern "C" { |
13 #include "./vpx_config.h" | 13 #include "./vpx_config.h" |
14 #include "./vp8_rtcd.h" | 14 #include "./vp8_rtcd.h" |
15 } | 15 } |
| 16 #include "test/clear_system_state.h" |
16 #include "test/register_state_check.h" | 17 #include "test/register_state_check.h" |
17 #include "third_party/googletest/src/include/gtest/gtest.h" | 18 #include "third_party/googletest/src/include/gtest/gtest.h" |
18 | 19 |
19 typedef void (*idct_fn_t)(short *input, unsigned char *pred_ptr, | 20 typedef void (*idct_fn_t)(short *input, unsigned char *pred_ptr, |
20 int pred_stride, unsigned char *dst_ptr, | 21 int pred_stride, unsigned char *dst_ptr, |
21 int dst_stride); | 22 int dst_stride); |
22 namespace { | 23 namespace { |
23 class IDCTTest : public ::testing::TestWithParam<idct_fn_t> { | 24 class IDCTTest : public ::testing::TestWithParam<idct_fn_t> { |
24 protected: | 25 protected: |
25 virtual void SetUp() { | 26 virtual void SetUp() { |
26 int i; | 27 int i; |
27 | 28 |
28 UUT = GetParam(); | 29 UUT = GetParam(); |
29 memset(input, 0, sizeof(input)); | 30 memset(input, 0, sizeof(input)); |
30 /* Set up guard blocks */ | 31 /* Set up guard blocks */ |
31 for (i = 0; i < 256; i++) | 32 for (i = 0; i < 256; i++) |
32 output[i] = ((i & 0xF) < 4 && (i < 64)) ? 0 : -1; | 33 output[i] = ((i & 0xF) < 4 && (i < 64)) ? 0 : -1; |
33 } | 34 } |
34 | 35 |
| 36 virtual void TearDown() { |
| 37 libvpx_test::ClearSystemState(); |
| 38 } |
| 39 |
35 idct_fn_t UUT; | 40 idct_fn_t UUT; |
36 short input[16]; | 41 short input[16]; |
37 unsigned char output[256]; | 42 unsigned char output[256]; |
38 unsigned char predict[256]; | 43 unsigned char predict[256]; |
39 }; | 44 }; |
40 | 45 |
41 TEST_P(IDCTTest, TestGuardBlocks) { | 46 TEST_P(IDCTTest, TestGuardBlocks) { |
42 int i; | 47 int i; |
43 | 48 |
44 for (i = 0; i < 256; i++) | 49 for (i = 0; i < 256; i++) |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 EXPECT_EQ(0, output[i]) << "i==" << i; | 114 EXPECT_EQ(0, output[i]) << "i==" << i; |
110 } | 115 } |
111 | 116 |
112 INSTANTIATE_TEST_CASE_P(C, IDCTTest, | 117 INSTANTIATE_TEST_CASE_P(C, IDCTTest, |
113 ::testing::Values(vp8_short_idct4x4llm_c)); | 118 ::testing::Values(vp8_short_idct4x4llm_c)); |
114 #if HAVE_MMX | 119 #if HAVE_MMX |
115 INSTANTIATE_TEST_CASE_P(MMX, IDCTTest, | 120 INSTANTIATE_TEST_CASE_P(MMX, IDCTTest, |
116 ::testing::Values(vp8_short_idct4x4llm_mmx)); | 121 ::testing::Values(vp8_short_idct4x4llm_mmx)); |
117 #endif | 122 #endif |
118 } | 123 } |
OLD | NEW |