David Barker | 5d34e6a | 2017-05-18 15:12:50 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved |
| 3 | * |
| 4 | * This source code is subject to the terms of the BSD 2 Clause License and |
| 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License |
| 6 | * was not distributed with this source code in the LICENSE file, you can |
| 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open |
| 8 | * Media Patent License 1.0 was not distributed with this source code in the |
| 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. |
| 10 | */ |
| 11 | |
| 12 | #ifndef TEST_HIPREC_CONVOLVE_TEST_UTIL_H_ |
| 13 | #define TEST_HIPREC_CONVOLVE_TEST_UTIL_H_ |
| 14 | |
| 15 | #include "third_party/googletest/src/googletest/include/gtest/gtest.h" |
| 16 | #include "test/acm_random.h" |
| 17 | #include "test/util.h" |
| 18 | #include "./av1_rtcd.h" |
| 19 | #include "./aom_dsp_rtcd.h" |
| 20 | #include "test/clear_system_state.h" |
| 21 | #include "test/register_state_check.h" |
| 22 | |
| 23 | #include "av1/common/mv.h" |
| 24 | |
| 25 | namespace libaom_test { |
| 26 | |
| 27 | namespace AV1HiprecConvolve { |
| 28 | |
| 29 | typedef void (*hiprec_convolve_func)(const uint8_t *src, ptrdiff_t src_stride, |
| 30 | uint8_t *dst, ptrdiff_t dst_stride, |
| 31 | const int16_t *filter_x, int x_step_q4, |
| 32 | const int16_t *filter_y, int y_step_q4, |
| 33 | int w, int h); |
| 34 | |
| 35 | typedef std::tr1::tuple<int, int, int, hiprec_convolve_func> |
| 36 | HiprecConvolveParam; |
| 37 | |
| 38 | ::testing::internal::ParamGenerator<HiprecConvolveParam> BuildParams( |
| 39 | hiprec_convolve_func filter); |
| 40 | |
| 41 | class AV1HiprecConvolveTest |
| 42 | : public ::testing::TestWithParam<HiprecConvolveParam> { |
| 43 | public: |
| 44 | virtual ~AV1HiprecConvolveTest(); |
| 45 | virtual void SetUp(); |
| 46 | |
| 47 | virtual void TearDown(); |
| 48 | |
| 49 | protected: |
| 50 | void RunCheckOutput(hiprec_convolve_func test_impl); |
| 51 | |
| 52 | libaom_test::ACMRandom rnd_; |
| 53 | }; |
| 54 | |
| 55 | } // namespace AV1HiprecConvolve |
| 56 | |
| 57 | #if CONFIG_HIGHBITDEPTH |
| 58 | namespace AV1HighbdHiprecConvolve { |
| 59 | typedef void (*highbd_hiprec_convolve_func)( |
| 60 | const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, |
| 61 | ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, |
| 62 | const int16_t *filter_y, int y_step_q4, int w, int h, int bps); |
| 63 | |
| 64 | typedef std::tr1::tuple<int, int, int, int, highbd_hiprec_convolve_func> |
| 65 | HighbdHiprecConvolveParam; |
| 66 | |
| 67 | ::testing::internal::ParamGenerator<HighbdHiprecConvolveParam> BuildParams( |
| 68 | highbd_hiprec_convolve_func filter); |
| 69 | |
| 70 | class AV1HighbdHiprecConvolveTest |
| 71 | : public ::testing::TestWithParam<HighbdHiprecConvolveParam> { |
| 72 | public: |
| 73 | virtual ~AV1HighbdHiprecConvolveTest(); |
| 74 | virtual void SetUp(); |
| 75 | |
| 76 | virtual void TearDown(); |
| 77 | |
| 78 | protected: |
| 79 | void RunCheckOutput(highbd_hiprec_convolve_func test_impl); |
| 80 | |
| 81 | libaom_test::ACMRandom rnd_; |
| 82 | }; |
| 83 | |
| 84 | } // namespace AV1HighbdHiprecConvolve |
| 85 | #endif // CONFIG_HIGHBITDEPTH |
| 86 | |
| 87 | } // namespace libaom_test |
| 88 | |
| 89 | #endif // TEST_HIPREC_CONVOLVE_TEST_UTIL_H_ |