Improved aom_smooth_predictor_16x 32,16,8
[aom.git] / test / av1_convolve_2d_test_util.h
blob46ac872ce7f24500b02cfa2011c194fdc6d918c1
1 /*
2 * Copyright (c) 2016, Alliance for Open Media. All rights reserved
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.
12 #ifndef TEST_HIPREC_CONVOLVE_TEST_UTIL_H_
13 #define TEST_HIPREC_CONVOLVE_TEST_UTIL_H_
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"
23 namespace libaom_test {
25 namespace AV1Convolve2D {
27 typedef void (*convolve_2d_func)(const uint8_t *src, int src_stride,
28 uint8_t *dst, int dst_stride, int w, int h,
29 InterpFilterParams *filter_params_x,
30 InterpFilterParams *filter_params_y,
31 const int subpel_x_q4, const int subpel_y_q4,
32 ConvolveParams *conv_params);
34 typedef std::tr1::tuple<convolve_2d_func, int, int, BLOCK_SIZE> Convolve2DParam;
36 ::testing::internal::ParamGenerator<Convolve2DParam> BuildParams(
37 convolve_2d_func filter, int subx_exist, int suby_exist);
39 class AV1Convolve2DTest : public ::testing::TestWithParam<Convolve2DParam> {
40 public:
41 virtual ~AV1Convolve2DTest();
42 virtual void SetUp();
44 virtual void TearDown();
46 protected:
47 void RunCheckOutput(convolve_2d_func test_impl);
48 void RunSpeedTest(convolve_2d_func test_impl);
50 libaom_test::ACMRandom rnd_;
53 class AV1Convolve2DSrTest : public ::testing::TestWithParam<Convolve2DParam> {
54 public:
55 virtual ~AV1Convolve2DSrTest();
56 virtual void SetUp();
58 virtual void TearDown();
60 protected:
61 void RunCheckOutput(convolve_2d_func test_impl);
62 void RunSpeedTest(convolve_2d_func test_impl);
64 libaom_test::ACMRandom rnd_;
67 class AV1JntConvolve2DTest : public ::testing::TestWithParam<Convolve2DParam> {
68 public:
69 virtual ~AV1JntConvolve2DTest();
70 virtual void SetUp();
72 virtual void TearDown();
74 protected:
75 void RunCheckOutput(convolve_2d_func test_impl);
77 libaom_test::ACMRandom rnd_;
80 } // namespace AV1Convolve2D
82 namespace AV1HighbdConvolve2D {
83 typedef void (*highbd_convolve_2d_func)(
84 const uint16_t *src, int src_stride, uint16_t *dst, int dst_stride, int w,
85 int h, InterpFilterParams *filter_params_x,
86 InterpFilterParams *filter_params_y, const int subpel_x_q4,
87 const int subpel_y_q4, ConvolveParams *conv_params, int bd);
89 typedef std::tr1::tuple<int, highbd_convolve_2d_func, int, int, BLOCK_SIZE>
90 HighbdConvolve2DParam;
92 ::testing::internal::ParamGenerator<HighbdConvolve2DParam> BuildParams(
93 highbd_convolve_2d_func filter, int subx_exist, int suby_exist);
95 class AV1HighbdConvolve2DTest
96 : public ::testing::TestWithParam<HighbdConvolve2DParam> {
97 public:
98 virtual ~AV1HighbdConvolve2DTest();
99 virtual void SetUp();
101 virtual void TearDown();
103 protected:
104 void RunCheckOutput(highbd_convolve_2d_func test_impl);
106 libaom_test::ACMRandom rnd_;
109 class AV1HighbdConvolve2DSrTest
110 : public ::testing::TestWithParam<HighbdConvolve2DParam> {
111 public:
112 virtual ~AV1HighbdConvolve2DSrTest();
113 virtual void SetUp();
115 virtual void TearDown();
117 protected:
118 void RunCheckOutput(highbd_convolve_2d_func test_impl);
119 void RunSpeedTest(highbd_convolve_2d_func test_impl);
121 libaom_test::ACMRandom rnd_;
124 class AV1HighbdJntConvolve2DTest
125 : public ::testing::TestWithParam<HighbdConvolve2DParam> {
126 public:
127 virtual ~AV1HighbdJntConvolve2DTest();
128 virtual void SetUp();
130 virtual void TearDown();
132 protected:
133 void RunCheckOutput(highbd_convolve_2d_func test_impl);
134 void RunSpeedTest(highbd_convolve_2d_func test_impl);
136 libaom_test::ACMRandom rnd_;
139 } // namespace AV1HighbdConvolve2D
141 } // namespace libaom_test
143 #endif // TEST_HIPREC_CONVOLVE_TEST_UTIL_H_