av1_convolve_ x,y _avx2() -- use 256 bit load/store
[aom.git] / test / av1_fht8x4_test.cc
blobb221e6105d9ec5b69568a5681279c4799a55d0b8
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.
11 #include "third_party/googletest/src/googletest/include/gtest/gtest.h"
13 #include "./aom_dsp_rtcd.h"
14 #include "./av1_rtcd.h"
16 #include "aom_ports/mem.h"
17 #include "test/acm_random.h"
18 #include "test/clear_system_state.h"
19 #include "test/register_state_check.h"
20 #include "test/transform_test_base.h"
21 #include "test/util.h"
23 using libaom_test::ACMRandom;
25 #if !CONFIG_DAALA_TX
26 namespace {
27 typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride,
28 const TxfmParam *txfm_param);
29 using std::tr1::tuple;
30 using libaom_test::FhtFunc;
31 typedef tuple<FhtFunc, IhtFunc, TX_TYPE, aom_bit_depth_t, int> Ht8x4Param;
33 void fht8x4_ref(const int16_t *in, tran_low_t *out, int stride,
34 TxfmParam *txfm_param) {
35 av1_fht8x4_c(in, out, stride, txfm_param);
38 void iht8x4_ref(const tran_low_t *in, uint8_t *out, int stride,
39 const TxfmParam *txfm_param) {
40 av1_iht8x4_32_add_c(in, out, stride, txfm_param);
43 class AV1Trans8x4HT : public libaom_test::TransformTestBase,
44 public ::testing::TestWithParam<Ht8x4Param> {
45 public:
46 virtual ~AV1Trans8x4HT() {}
48 virtual void SetUp() {
49 fwd_txfm_ = GET_PARAM(0);
50 inv_txfm_ = GET_PARAM(1);
51 pitch_ = 8;
52 height_ = 4;
53 fwd_txfm_ref = fht8x4_ref;
54 inv_txfm_ref = iht8x4_ref;
55 bit_depth_ = GET_PARAM(3);
56 mask_ = (1 << bit_depth_) - 1;
57 num_coeffs_ = GET_PARAM(4);
58 txfm_param_.tx_type = GET_PARAM(2);
60 virtual void TearDown() { libaom_test::ClearSystemState(); }
62 protected:
63 void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) {
64 fwd_txfm_(in, out, stride, &txfm_param_);
67 void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) {
68 inv_txfm_(out, dst, stride, &txfm_param_);
71 FhtFunc fwd_txfm_;
72 IhtFunc inv_txfm_;
75 TEST_P(AV1Trans8x4HT, AccuracyCheck) { RunAccuracyCheck(0, 0.00001); }
76 TEST_P(AV1Trans8x4HT, CoeffCheck) { RunCoeffCheck(); }
77 TEST_P(AV1Trans8x4HT, MemCheck) { RunMemCheck(); }
78 TEST_P(AV1Trans8x4HT, InvCoeffCheck) { RunInvCoeffCheck(); }
79 TEST_P(AV1Trans8x4HT, InvAccuracyCheck) { RunInvAccuracyCheck(0); }
81 using std::tr1::make_tuple;
83 const Ht8x4Param kArrayHt8x4Param_c[] = {
84 make_tuple(&av1_fht8x4_c, &av1_iht8x4_32_add_c, DCT_DCT, AOM_BITS_8, 32),
85 make_tuple(&av1_fht8x4_c, &av1_iht8x4_32_add_c, ADST_DCT, AOM_BITS_8, 32),
86 make_tuple(&av1_fht8x4_c, &av1_iht8x4_32_add_c, DCT_ADST, AOM_BITS_8, 32),
87 make_tuple(&av1_fht8x4_c, &av1_iht8x4_32_add_c, ADST_ADST, AOM_BITS_8, 32),
88 make_tuple(&av1_fht8x4_c, &av1_iht8x4_32_add_c, FLIPADST_DCT, AOM_BITS_8, 32),
89 make_tuple(&av1_fht8x4_c, &av1_iht8x4_32_add_c, DCT_FLIPADST, AOM_BITS_8, 32),
90 make_tuple(&av1_fht8x4_c, &av1_iht8x4_32_add_c, FLIPADST_FLIPADST, AOM_BITS_8,
91 32),
92 make_tuple(&av1_fht8x4_c, &av1_iht8x4_32_add_c, ADST_FLIPADST, AOM_BITS_8,
93 32),
94 make_tuple(&av1_fht8x4_c, &av1_iht8x4_32_add_c, FLIPADST_ADST, AOM_BITS_8,
95 32),
96 make_tuple(&av1_fht8x4_c, &av1_iht8x4_32_add_c, IDTX, AOM_BITS_8, 32),
97 make_tuple(&av1_fht8x4_c, &av1_iht8x4_32_add_c, V_DCT, AOM_BITS_8, 32),
98 make_tuple(&av1_fht8x4_c, &av1_iht8x4_32_add_c, H_DCT, AOM_BITS_8, 32),
99 make_tuple(&av1_fht8x4_c, &av1_iht8x4_32_add_c, V_ADST, AOM_BITS_8, 32),
100 make_tuple(&av1_fht8x4_c, &av1_iht8x4_32_add_c, H_ADST, AOM_BITS_8, 32),
101 make_tuple(&av1_fht8x4_c, &av1_iht8x4_32_add_c, V_FLIPADST, AOM_BITS_8, 32),
102 make_tuple(&av1_fht8x4_c, &av1_iht8x4_32_add_c, H_FLIPADST, AOM_BITS_8, 32)
104 INSTANTIATE_TEST_CASE_P(C, AV1Trans8x4HT,
105 ::testing::ValuesIn(kArrayHt8x4Param_c));
107 #if HAVE_SSE2
108 const Ht8x4Param kArrayHt8x4Param_sse2[] = {
109 make_tuple(&av1_fht8x4_sse2, &av1_iht8x4_32_add_sse2, DCT_DCT, AOM_BITS_8,
110 32),
111 make_tuple(&av1_fht8x4_sse2, &av1_iht8x4_32_add_sse2, ADST_DCT, AOM_BITS_8,
112 32),
113 make_tuple(&av1_fht8x4_sse2, &av1_iht8x4_32_add_sse2, DCT_ADST, AOM_BITS_8,
114 32),
115 make_tuple(&av1_fht8x4_sse2, &av1_iht8x4_32_add_sse2, ADST_ADST, AOM_BITS_8,
116 32),
117 make_tuple(&av1_fht8x4_sse2, &av1_iht8x4_32_add_sse2, FLIPADST_DCT,
118 AOM_BITS_8, 32),
119 make_tuple(&av1_fht8x4_sse2, &av1_iht8x4_32_add_sse2, DCT_FLIPADST,
120 AOM_BITS_8, 32),
121 make_tuple(&av1_fht8x4_sse2, &av1_iht8x4_32_add_sse2, FLIPADST_FLIPADST,
122 AOM_BITS_8, 32),
123 make_tuple(&av1_fht8x4_sse2, &av1_iht8x4_32_add_sse2, ADST_FLIPADST,
124 AOM_BITS_8, 32),
125 make_tuple(&av1_fht8x4_sse2, &av1_iht8x4_32_add_sse2, FLIPADST_ADST,
126 AOM_BITS_8, 32),
127 make_tuple(&av1_fht8x4_sse2, &av1_iht8x4_32_add_sse2, IDTX, AOM_BITS_8, 32),
128 make_tuple(&av1_fht8x4_sse2, &av1_iht8x4_32_add_sse2, V_DCT, AOM_BITS_8, 32),
129 make_tuple(&av1_fht8x4_sse2, &av1_iht8x4_32_add_sse2, H_DCT, AOM_BITS_8, 32),
130 make_tuple(&av1_fht8x4_sse2, &av1_iht8x4_32_add_sse2, V_ADST, AOM_BITS_8, 32),
131 make_tuple(&av1_fht8x4_sse2, &av1_iht8x4_32_add_sse2, H_ADST, AOM_BITS_8, 32),
132 make_tuple(&av1_fht8x4_sse2, &av1_iht8x4_32_add_sse2, V_FLIPADST, AOM_BITS_8,
133 32),
134 make_tuple(&av1_fht8x4_sse2, &av1_iht8x4_32_add_sse2, H_FLIPADST, AOM_BITS_8,
137 INSTANTIATE_TEST_CASE_P(SSE2, AV1Trans8x4HT,
138 ::testing::ValuesIn(kArrayHt8x4Param_sse2));
139 #endif // HAVE_SSE2
141 } // namespace
142 #endif // !CONFIG_DAALA_TX