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