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_WARP_FILTER_TEST_UTIL_H_
13 #define AOM_TEST_WARP_FILTER_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"
21 #include "test/clear_system_state.h"
22 #include "test/register_state_check.h"
24 #include "av1/common/mv.h"
25 #include "av1/common/common_data.h"
27 namespace libaom_test
{
29 void generate_warped_model(libaom_test::ACMRandom
*rnd
, int32_t *mat
,
30 int16_t *alpha
, int16_t *beta
, int16_t *gamma
,
31 int16_t *delta
, int is_alpha_zero
, int is_beta_zero
,
32 int is_gamma_zero
, int is_delta_zero
);
34 namespace AV1WarpFilter
{
36 typedef void (*warp_affine_func
)(const int32_t *mat
, const uint8_t *ref
,
37 int width
, int height
, int stride
,
38 uint8_t *pred
, int p_col
, int p_row
,
39 int p_width
, int p_height
, int p_stride
,
40 int subsampling_x
, int subsampling_y
,
41 ConvolveParams
*conv_params
, int16_t alpha
,
42 int16_t beta
, int16_t gamma
, int16_t delta
);
44 typedef ::testing::tuple
<int, int, int, warp_affine_func
> WarpTestParam
;
45 typedef ::testing::tuple
<WarpTestParam
, int, int, int, int> WarpTestParams
;
47 ::testing::internal::ParamGenerator
<WarpTestParams
> BuildParams(
48 warp_affine_func filter
);
50 class AV1WarpFilterTest
: public ::testing::TestWithParam
<WarpTestParams
> {
52 virtual ~AV1WarpFilterTest();
55 virtual void TearDown();
58 void RunCheckOutput(warp_affine_func test_impl
);
59 void RunSpeedTest(warp_affine_func test_impl
);
61 libaom_test::ACMRandom rnd_
;
64 } // namespace AV1WarpFilter
66 namespace AV1HighbdWarpFilter
{
67 typedef void (*highbd_warp_affine_func
)(const int32_t *mat
, const uint16_t *ref
,
68 int width
, int height
, int stride
,
69 uint16_t *pred
, int p_col
, int p_row
,
70 int p_width
, int p_height
, int p_stride
,
71 int subsampling_x
, int subsampling_y
,
72 int bd
, ConvolveParams
*conv_params
,
73 int16_t alpha
, int16_t beta
,
74 int16_t gamma
, int16_t delta
);
76 typedef ::testing::tuple
<int, int, int, int, highbd_warp_affine_func
>
78 typedef ::testing::tuple
<HighbdWarpTestParam
, int, int, int, int>
81 ::testing::internal::ParamGenerator
<HighbdWarpTestParams
> BuildParams(
82 highbd_warp_affine_func filter
);
84 class AV1HighbdWarpFilterTest
85 : public ::testing::TestWithParam
<HighbdWarpTestParams
> {
87 virtual ~AV1HighbdWarpFilterTest();
90 virtual void TearDown();
93 void RunCheckOutput(highbd_warp_affine_func test_impl
);
94 void RunSpeedTest(highbd_warp_affine_func test_impl
);
96 libaom_test::ACMRandom rnd_
;
99 } // namespace AV1HighbdWarpFilter
101 } // namespace libaom_test
103 #endif // AOM_TEST_WARP_FILTER_TEST_UTIL_H_