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 AOM_TEST_AV1_CONVOLVE_2D_TEST_UTIL_H_
13 #define AOM_TEST_AV1_CONVOLVE_2D_TEST_UTIL_H_
15 #include "config/av1_rtcd.h"
16 #include "config/aom_dsp_rtcd.h"
18 #include "third_party/googletest/src/googletest/include/gtest/gtest.h"
19 #include "test/acm_random.h"
20 #include "test/util.h"
22 #include "test/clear_system_state.h"
23 #include "test/register_state_check.h"
25 namespace libaom_test
{
27 namespace AV1Convolve2D
{
29 typedef void (*convolve_2d_func
)(const uint8_t *src
, int src_stride
,
30 uint8_t *dst
, int dst_stride
, int w
, int h
,
31 const InterpFilterParams
*filter_params_x
,
32 const InterpFilterParams
*filter_params_y
,
33 const int subpel_x_q4
, const int subpel_y_q4
,
34 ConvolveParams
*conv_params
);
36 typedef ::testing::tuple
<convolve_2d_func
, int, int, BLOCK_SIZE
>
39 ::testing::internal::ParamGenerator
<Convolve2DParam
> BuildParams(
40 convolve_2d_func filter
, int subx_exist
, int suby_exist
);
42 class AV1Convolve2DSrTest
: public ::testing::TestWithParam
<Convolve2DParam
> {
44 virtual ~AV1Convolve2DSrTest();
47 virtual void TearDown();
50 void RunCheckOutput(convolve_2d_func test_impl
);
51 void RunSpeedTest(convolve_2d_func test_impl
);
53 libaom_test::ACMRandom rnd_
;
56 class AV1JntConvolve2DTest
: public ::testing::TestWithParam
<Convolve2DParam
> {
58 virtual ~AV1JntConvolve2DTest();
61 virtual void TearDown();
64 void RunCheckOutput(convolve_2d_func test_impl
);
65 void RunSpeedTest(convolve_2d_func test_impl
);
67 libaom_test::ACMRandom rnd_
;
69 } // namespace AV1Convolve2D
71 namespace AV1HighbdConvolve2D
{
72 typedef void (*highbd_convolve_2d_func
)(
73 const uint16_t *src
, int src_stride
, uint16_t *dst
, int dst_stride
, int w
,
74 int h
, const InterpFilterParams
*filter_params_x
,
75 const InterpFilterParams
*filter_params_y
, const int subpel_x_q4
,
76 const int subpel_y_q4
, ConvolveParams
*conv_params
, int bd
);
78 typedef ::testing::tuple
<int, highbd_convolve_2d_func
, int, int, BLOCK_SIZE
>
79 HighbdConvolve2DParam
;
81 ::testing::internal::ParamGenerator
<HighbdConvolve2DParam
> BuildParams(
82 highbd_convolve_2d_func filter
, int subx_exist
, int suby_exist
);
84 class AV1HighbdConvolve2DSrTest
85 : public ::testing::TestWithParam
<HighbdConvolve2DParam
> {
87 virtual ~AV1HighbdConvolve2DSrTest();
90 virtual void TearDown();
93 void RunCheckOutput(highbd_convolve_2d_func test_impl
);
94 void RunSpeedTest(highbd_convolve_2d_func test_impl
);
96 libaom_test::ACMRandom rnd_
;
99 class AV1HighbdJntConvolve2DTest
100 : public ::testing::TestWithParam
<HighbdConvolve2DParam
> {
102 virtual ~AV1HighbdJntConvolve2DTest();
103 virtual void SetUp();
105 virtual void TearDown();
108 void RunCheckOutput(highbd_convolve_2d_func test_impl
);
109 void RunSpeedTest(highbd_convolve_2d_func test_impl
);
111 libaom_test::ACMRandom rnd_
;
113 } // namespace AV1HighbdConvolve2D
115 } // namespace libaom_test
117 #endif // AOM_TEST_AV1_CONVOLVE_2D_TEST_UTIL_H_