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 | 10 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 reference_32x32_dct_1d(temp_in, temp_out, 1); | 70 reference_32x32_dct_1d(temp_in, temp_out, 1); |
71 // Scale by some magic number | 71 // Scale by some magic number |
72 for (int j = 0; j < 32; ++j) | 72 for (int j = 0; j < 32; ++j) |
73 output[j + i * 32] = temp_out[j] / 4; | 73 output[j + i * 32] = temp_out[j] / 4; |
74 } | 74 } |
75 } | 75 } |
76 | 76 |
77 typedef void (*fwd_txfm_t)(const int16_t *in, int16_t *out, int stride); | 77 typedef void (*fwd_txfm_t)(const int16_t *in, int16_t *out, int stride); |
78 typedef void (*inv_txfm_t)(const int16_t *in, uint8_t *out, int stride); | 78 typedef void (*inv_txfm_t)(const int16_t *in, uint8_t *out, int stride); |
79 | 79 |
80 class Trans32x32Test : public PARAMS(fwd_txfm_t, inv_txfm_t, int) { | 80 typedef std::tr1::tuple<fwd_txfm_t, inv_txfm_t, int> trans_32x32_param_t; |
| 81 |
| 82 class Trans32x32Test : public ::testing::TestWithParam<trans_32x32_param_t> { |
81 public: | 83 public: |
82 virtual ~Trans32x32Test() {} | 84 virtual ~Trans32x32Test() {} |
83 virtual void SetUp() { | 85 virtual void SetUp() { |
84 fwd_txfm_ = GET_PARAM(0); | 86 fwd_txfm_ = GET_PARAM(0); |
85 inv_txfm_ = GET_PARAM(1); | 87 inv_txfm_ = GET_PARAM(1); |
86 version_ = GET_PARAM(2); // 0: high precision forward transform | 88 version_ = GET_PARAM(2); // 0: high precision forward transform |
87 // 1: low precision version for rd loop | 89 // 1: low precision version for rd loop |
88 } | 90 } |
89 | 91 |
90 virtual void TearDown() { libvpx_test::ClearSystemState(); } | 92 virtual void TearDown() { libvpx_test::ClearSystemState(); } |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 | 253 |
252 #if HAVE_SSE2 | 254 #if HAVE_SSE2 |
253 INSTANTIATE_TEST_CASE_P( | 255 INSTANTIATE_TEST_CASE_P( |
254 SSE2, Trans32x32Test, | 256 SSE2, Trans32x32Test, |
255 ::testing::Values( | 257 ::testing::Values( |
256 make_tuple(&vp9_fdct32x32_sse2, | 258 make_tuple(&vp9_fdct32x32_sse2, |
257 &vp9_idct32x32_1024_add_sse2, 0), | 259 &vp9_idct32x32_1024_add_sse2, 0), |
258 make_tuple(&vp9_fdct32x32_rd_sse2, | 260 make_tuple(&vp9_fdct32x32_rd_sse2, |
259 &vp9_idct32x32_1024_add_sse2, 1))); | 261 &vp9_idct32x32_1024_add_sse2, 1))); |
260 #endif | 262 #endif |
| 263 |
| 264 #if HAVE_AVX2 |
| 265 INSTANTIATE_TEST_CASE_P( |
| 266 AVX2, Trans32x32Test, |
| 267 ::testing::Values( |
| 268 make_tuple(&vp9_fdct32x32_avx2, |
| 269 &vp9_idct32x32_1024_add_sse2, 0), |
| 270 make_tuple(&vp9_fdct32x32_rd_avx2, |
| 271 &vp9_idct32x32_1024_add_sse2, 1))); |
| 272 #endif |
261 } // namespace | 273 } // namespace |
OLD | NEW |