av1_convolve_ x,y _avx2() -- use 256 bit load/store
[aom.git] / test / av1_fht16x32_test.cc
blobe6b960a2e25ab343a6c86906dbe602156061c464
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 #include "third_party/googletest/src/googletest/include/gtest/gtest.h"
14 #include "./aom_dsp_rtcd.h"
15 #include "./av1_rtcd.h"
17 #include "aom_ports/mem.h"
18 #include "test/acm_random.h"
19 #include "test/clear_system_state.h"
20 #include "test/register_state_check.h"
21 #include "test/transform_test_base.h"
22 #include "test/util.h"
24 using libaom_test::ACMRandom;
26 #if !CONFIG_DAALA_TX
28 namespace {
29 typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride,
30 const TxfmParam *txfm_param);
31 using std::tr1::tuple;
32 using libaom_test::FhtFunc;
33 typedef tuple<FhtFunc, IhtFunc, TX_TYPE, aom_bit_depth_t, int> Ht16x32Param;
35 void fht16x32_ref(const int16_t *in, tran_low_t *out, int stride,
36 TxfmParam *txfm_param) {
37 av1_fht16x32_c(in, out, stride, txfm_param);
40 void iht16x32_ref(const tran_low_t *in, uint8_t *out, int stride,
41 const TxfmParam *txfm_param) {
42 av1_iht16x32_512_add_c(in, out, stride, txfm_param);
45 class AV1Trans16x32HT : public libaom_test::TransformTestBase,
46 public ::testing::TestWithParam<Ht16x32Param> {
47 public:
48 virtual ~AV1Trans16x32HT() {}
50 virtual void SetUp() {
51 fwd_txfm_ = GET_PARAM(0);
52 inv_txfm_ = GET_PARAM(1);
53 pitch_ = 16;
54 height_ = 32;
55 fwd_txfm_ref = fht16x32_ref;
56 inv_txfm_ref = iht16x32_ref;
57 bit_depth_ = GET_PARAM(3);
58 mask_ = (1 << bit_depth_) - 1;
59 num_coeffs_ = GET_PARAM(4);
60 txfm_param_.tx_type = GET_PARAM(2);
62 virtual void TearDown() { libaom_test::ClearSystemState(); }
64 protected:
65 void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) {
66 fwd_txfm_(in, out, stride, &txfm_param_);
69 void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) {
70 inv_txfm_(out, dst, stride, &txfm_param_);
73 FhtFunc fwd_txfm_;
74 IhtFunc inv_txfm_;
77 TEST_P(AV1Trans16x32HT, AccuracyCheck) { RunAccuracyCheck(4, 0.2); }
78 TEST_P(AV1Trans16x32HT, CoeffCheck) { RunCoeffCheck(); }
79 TEST_P(AV1Trans16x32HT, MemCheck) { RunMemCheck(); }
80 TEST_P(AV1Trans16x32HT, InvCoeffCheck) { RunInvCoeffCheck(); }
81 TEST_P(AV1Trans16x32HT, InvAccuracyCheck) { RunInvAccuracyCheck(4); }
83 using std::tr1::make_tuple;
84 const Ht16x32Param kArrayHt16x32Param_c[] = {
85 make_tuple(&av1_fht16x32_c, &av1_iht16x32_512_add_c, DCT_DCT, AOM_BITS_8,
86 512),
87 make_tuple(&av1_fht16x32_c, &av1_iht16x32_512_add_c, ADST_DCT, AOM_BITS_8,
88 512),
89 make_tuple(&av1_fht16x32_c, &av1_iht16x32_512_add_c, DCT_ADST, AOM_BITS_8,
90 512),
91 make_tuple(&av1_fht16x32_c, &av1_iht16x32_512_add_c, ADST_ADST, AOM_BITS_8,
92 512),
93 make_tuple(&av1_fht16x32_c, &av1_iht16x32_512_add_c, FLIPADST_DCT, AOM_BITS_8,
94 512),
95 make_tuple(&av1_fht16x32_c, &av1_iht16x32_512_add_c, DCT_FLIPADST, AOM_BITS_8,
96 512),
97 make_tuple(&av1_fht16x32_c, &av1_iht16x32_512_add_c, FLIPADST_FLIPADST,
98 AOM_BITS_8, 512),
99 make_tuple(&av1_fht16x32_c, &av1_iht16x32_512_add_c, ADST_FLIPADST,
100 AOM_BITS_8, 512),
101 make_tuple(&av1_fht16x32_c, &av1_iht16x32_512_add_c, FLIPADST_ADST,
102 AOM_BITS_8, 512),
103 make_tuple(&av1_fht16x32_c, &av1_iht16x32_512_add_c, IDTX, AOM_BITS_8, 512),
104 make_tuple(&av1_fht16x32_c, &av1_iht16x32_512_add_c, V_DCT, AOM_BITS_8, 512),
105 make_tuple(&av1_fht16x32_c, &av1_iht16x32_512_add_c, H_DCT, AOM_BITS_8, 512),
106 make_tuple(&av1_fht16x32_c, &av1_iht16x32_512_add_c, V_ADST, AOM_BITS_8, 512),
107 make_tuple(&av1_fht16x32_c, &av1_iht16x32_512_add_c, H_ADST, AOM_BITS_8, 512),
108 make_tuple(&av1_fht16x32_c, &av1_iht16x32_512_add_c, V_FLIPADST, AOM_BITS_8,
109 512),
110 make_tuple(&av1_fht16x32_c, &av1_iht16x32_512_add_c, H_FLIPADST, AOM_BITS_8,
111 512)
113 INSTANTIATE_TEST_CASE_P(C, AV1Trans16x32HT,
114 ::testing::ValuesIn(kArrayHt16x32Param_c));
116 #if HAVE_SSE2
117 const Ht16x32Param kArrayHt16x32Param_sse2[] = {
118 make_tuple(&av1_fht16x32_sse2, &av1_iht16x32_512_add_sse2, DCT_DCT,
119 AOM_BITS_8, 512),
120 make_tuple(&av1_fht16x32_sse2, &av1_iht16x32_512_add_sse2, ADST_DCT,
121 AOM_BITS_8, 512),
122 make_tuple(&av1_fht16x32_sse2, &av1_iht16x32_512_add_sse2, DCT_ADST,
123 AOM_BITS_8, 512),
124 make_tuple(&av1_fht16x32_sse2, &av1_iht16x32_512_add_sse2, ADST_ADST,
125 AOM_BITS_8, 512),
126 make_tuple(&av1_fht16x32_sse2, &av1_iht16x32_512_add_sse2, FLIPADST_DCT,
127 AOM_BITS_8, 512),
128 make_tuple(&av1_fht16x32_sse2, &av1_iht16x32_512_add_sse2, DCT_FLIPADST,
129 AOM_BITS_8, 512),
130 make_tuple(&av1_fht16x32_sse2, &av1_iht16x32_512_add_sse2, FLIPADST_FLIPADST,
131 AOM_BITS_8, 512),
132 make_tuple(&av1_fht16x32_sse2, &av1_iht16x32_512_add_sse2, ADST_FLIPADST,
133 AOM_BITS_8, 512),
134 make_tuple(&av1_fht16x32_sse2, &av1_iht16x32_512_add_sse2, FLIPADST_ADST,
135 AOM_BITS_8, 512),
136 make_tuple(&av1_fht16x32_sse2, &av1_iht16x32_512_add_sse2, IDTX, AOM_BITS_8,
137 512),
138 make_tuple(&av1_fht16x32_sse2, &av1_iht16x32_512_add_sse2, V_DCT, AOM_BITS_8,
139 512),
140 make_tuple(&av1_fht16x32_sse2, &av1_iht16x32_512_add_sse2, H_DCT, AOM_BITS_8,
141 512),
142 make_tuple(&av1_fht16x32_sse2, &av1_iht16x32_512_add_sse2, V_ADST, AOM_BITS_8,
143 512),
144 make_tuple(&av1_fht16x32_sse2, &av1_iht16x32_512_add_sse2, H_ADST, AOM_BITS_8,
145 512),
146 make_tuple(&av1_fht16x32_sse2, &av1_iht16x32_512_add_sse2, V_FLIPADST,
147 AOM_BITS_8, 512),
148 make_tuple(&av1_fht16x32_sse2, &av1_iht16x32_512_add_sse2, H_FLIPADST,
149 AOM_BITS_8, 512)
151 INSTANTIATE_TEST_CASE_P(SSE2, AV1Trans16x32HT,
152 ::testing::ValuesIn(kArrayHt16x32Param_sse2));
153 #endif // HAVE_SSE2
155 } // namespace
157 #endif // !CONFIG_DAALA_TX