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 17 matching lines...) Expand all Loading... |
28 using libvpx_test::ACMRandom; | 28 using libvpx_test::ACMRandom; |
29 | 29 |
30 namespace { | 30 namespace { |
31 typedef void (*fdct_t)(const int16_t *in, int16_t *out, int stride); | 31 typedef void (*fdct_t)(const int16_t *in, int16_t *out, int stride); |
32 typedef void (*idct_t)(const int16_t *in, uint8_t *out, int stride); | 32 typedef void (*idct_t)(const int16_t *in, uint8_t *out, int stride); |
33 typedef void (*fht_t) (const int16_t *in, int16_t *out, int stride, | 33 typedef void (*fht_t) (const int16_t *in, int16_t *out, int stride, |
34 int tx_type); | 34 int tx_type); |
35 typedef void (*iht_t) (const int16_t *in, uint8_t *out, int stride, | 35 typedef void (*iht_t) (const int16_t *in, uint8_t *out, int stride, |
36 int tx_type); | 36 int tx_type); |
37 | 37 |
| 38 typedef std::tr1::tuple<fdct_t, idct_t, int> dct_8x8_param_t; |
| 39 typedef std::tr1::tuple<fht_t, iht_t, int> ht_8x8_param_t; |
| 40 |
38 void fdct8x8_ref(const int16_t *in, int16_t *out, int stride, int tx_type) { | 41 void fdct8x8_ref(const int16_t *in, int16_t *out, int stride, int tx_type) { |
39 vp9_fdct8x8_c(in, out, stride); | 42 vp9_fdct8x8_c(in, out, stride); |
40 } | 43 } |
41 | 44 |
42 void fht8x8_ref(const int16_t *in, int16_t *out, int stride, int tx_type) { | 45 void fht8x8_ref(const int16_t *in, int16_t *out, int stride, int tx_type) { |
43 vp9_short_fht8x8_c(in, out, stride, tx_type); | 46 vp9_short_fht8x8_c(in, out, stride, tx_type); |
44 } | 47 } |
45 | 48 |
46 class FwdTrans8x8TestBase { | 49 class FwdTrans8x8TestBase { |
47 public: | 50 public: |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 << "Error: Extremal 8x8 FDCT/IDCT or FHT/IHT has average" | 211 << "Error: Extremal 8x8 FDCT/IDCT or FHT/IHT has average" |
209 << " roundtrip error > 1/5 per block"; | 212 << " roundtrip error > 1/5 per block"; |
210 } | 213 } |
211 } | 214 } |
212 | 215 |
213 int pitch_; | 216 int pitch_; |
214 int tx_type_; | 217 int tx_type_; |
215 fht_t fwd_txfm_ref; | 218 fht_t fwd_txfm_ref; |
216 }; | 219 }; |
217 | 220 |
218 class FwdTrans8x8DCT : public FwdTrans8x8TestBase, | 221 class FwdTrans8x8DCT |
219 public PARAMS(fdct_t, idct_t, int) { | 222 : public FwdTrans8x8TestBase, |
| 223 public ::testing::TestWithParam<dct_8x8_param_t> { |
220 public: | 224 public: |
221 virtual ~FwdTrans8x8DCT() {} | 225 virtual ~FwdTrans8x8DCT() {} |
222 | 226 |
223 virtual void SetUp() { | 227 virtual void SetUp() { |
224 fwd_txfm_ = GET_PARAM(0); | 228 fwd_txfm_ = GET_PARAM(0); |
225 inv_txfm_ = GET_PARAM(1); | 229 inv_txfm_ = GET_PARAM(1); |
226 tx_type_ = GET_PARAM(2); | 230 tx_type_ = GET_PARAM(2); |
227 pitch_ = 8; | 231 pitch_ = 8; |
228 fwd_txfm_ref = fdct8x8_ref; | 232 fwd_txfm_ref = fdct8x8_ref; |
229 } | 233 } |
(...skipping 17 matching lines...) Expand all Loading... |
247 } | 251 } |
248 | 252 |
249 TEST_P(FwdTrans8x8DCT, RoundTripErrorCheck) { | 253 TEST_P(FwdTrans8x8DCT, RoundTripErrorCheck) { |
250 RunRoundTripErrorCheck(); | 254 RunRoundTripErrorCheck(); |
251 } | 255 } |
252 | 256 |
253 TEST_P(FwdTrans8x8DCT, ExtremalCheck) { | 257 TEST_P(FwdTrans8x8DCT, ExtremalCheck) { |
254 RunExtremalCheck(); | 258 RunExtremalCheck(); |
255 } | 259 } |
256 | 260 |
257 class FwdTrans8x8HT : public FwdTrans8x8TestBase, | 261 class FwdTrans8x8HT |
258 public PARAMS(fht_t, iht_t, int) { | 262 : public FwdTrans8x8TestBase, |
| 263 public ::testing::TestWithParam<ht_8x8_param_t> { |
259 public: | 264 public: |
260 virtual ~FwdTrans8x8HT() {} | 265 virtual ~FwdTrans8x8HT() {} |
261 | 266 |
262 virtual void SetUp() { | 267 virtual void SetUp() { |
263 fwd_txfm_ = GET_PARAM(0); | 268 fwd_txfm_ = GET_PARAM(0); |
264 inv_txfm_ = GET_PARAM(1); | 269 inv_txfm_ = GET_PARAM(1); |
265 tx_type_ = GET_PARAM(2); | 270 tx_type_ = GET_PARAM(2); |
266 pitch_ = 8; | 271 pitch_ = 8; |
267 fwd_txfm_ref = fht8x8_ref; | 272 fwd_txfm_ref = fht8x8_ref; |
268 } | 273 } |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 make_tuple(&vp9_fdct8x8_sse2, &vp9_idct8x8_64_add_sse2, 0))); | 319 make_tuple(&vp9_fdct8x8_sse2, &vp9_idct8x8_64_add_sse2, 0))); |
315 INSTANTIATE_TEST_CASE_P( | 320 INSTANTIATE_TEST_CASE_P( |
316 SSE2, FwdTrans8x8HT, | 321 SSE2, FwdTrans8x8HT, |
317 ::testing::Values( | 322 ::testing::Values( |
318 make_tuple(&vp9_short_fht8x8_sse2, &vp9_iht8x8_64_add_sse2, 0), | 323 make_tuple(&vp9_short_fht8x8_sse2, &vp9_iht8x8_64_add_sse2, 0), |
319 make_tuple(&vp9_short_fht8x8_sse2, &vp9_iht8x8_64_add_sse2, 1), | 324 make_tuple(&vp9_short_fht8x8_sse2, &vp9_iht8x8_64_add_sse2, 1), |
320 make_tuple(&vp9_short_fht8x8_sse2, &vp9_iht8x8_64_add_sse2, 2), | 325 make_tuple(&vp9_short_fht8x8_sse2, &vp9_iht8x8_64_add_sse2, 2), |
321 make_tuple(&vp9_short_fht8x8_sse2, &vp9_iht8x8_64_add_sse2, 3))); | 326 make_tuple(&vp9_short_fht8x8_sse2, &vp9_iht8x8_64_add_sse2, 3))); |
322 #endif | 327 #endif |
323 } // namespace | 328 } // namespace |
OLD | NEW |