Daniel Kang | 58156f1 | 2012-06-26 18:11:33 -0700 | [diff] [blame] | 1 | /* |
Yaowu Xu | 2ab7ff0 | 2016-09-02 12:04:54 -0700 | [diff] [blame] | 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved |
Daniel Kang | 58156f1 | 2012-06-26 18:11:33 -0700 | [diff] [blame] | 3 | * |
Yaowu Xu | 2ab7ff0 | 2016-09-02 12:04:54 -0700 | [diff] [blame] | 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. |
| 10 | */ |
Daniel Kang | 58156f1 | 2012-06-26 18:11:33 -0700 | [diff] [blame] | 11 | |
| 12 | #include <math.h> |
| 13 | #include <stdlib.h> |
| 14 | #include <string.h> |
| 15 | |
| 16 | #include "third_party/googletest/src/include/gtest/gtest.h" |
Jingning Han | 097d59c | 2015-07-29 14:51:36 -0700 | [diff] [blame] | 17 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 18 | #include "./av1_rtcd.h" |
| 19 | #include "./aom_dsp_rtcd.h" |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 20 | #include "test/acm_random.h" |
| 21 | #include "test/clear_system_state.h" |
| 22 | #include "test/register_state_check.h" |
Yi Luo | 267f73a | 2016-02-29 09:53:42 -0800 | [diff] [blame] | 23 | #include "test/transform_test_base.h" |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 24 | #include "test/util.h" |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 25 | #include "av1/common/entropy.h" |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 26 | #include "aom/aom_codec.h" |
| 27 | #include "aom/aom_integer.h" |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 28 | #include "aom_ports/mem.h" |
James Zern | 002ad40 | 2014-01-18 13:03:31 -0800 | [diff] [blame] | 29 | |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 30 | using libaom_test::ACMRandom; |
Daniel Kang | 26641c7 | 2012-06-28 16:26:31 -0700 | [diff] [blame] | 31 | |
Daniel Kang | 58156f1 | 2012-06-26 18:11:33 -0700 | [diff] [blame] | 32 | namespace { |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 33 | typedef void (*FdctFunc)(const int16_t *in, tran_low_t *out, int stride); |
| 34 | typedef void (*IdctFunc)(const tran_low_t *in, uint8_t *out, int stride); |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 35 | typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride, |
James Zern | b8b3dd9 | 2014-07-16 18:55:40 -0700 | [diff] [blame] | 36 | int tx_type); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 37 | using libaom_test::FhtFunc; |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 38 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 39 | typedef std::tr1::tuple<FdctFunc, IdctFunc, int, aom_bit_depth_t, int> |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 40 | Dct4x4Param; |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 41 | typedef std::tr1::tuple<FhtFunc, IhtFunc, int, aom_bit_depth_t, int> Ht4x4Param; |
Joshua Litt | 51490e5 | 2013-11-18 17:07:55 -0800 | [diff] [blame] | 42 | |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 43 | void fdct4x4_ref(const int16_t *in, tran_low_t *out, int stride, |
James Zern | cffef11 | 2016-02-11 18:27:00 -0800 | [diff] [blame] | 44 | int /*tx_type*/) { |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 45 | aom_fdct4x4_c(in, out, stride); |
Jingning Han | 362809d | 2013-06-18 10:46:33 -0700 | [diff] [blame] | 46 | } |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 47 | |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 48 | void fht4x4_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) { |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 49 | av1_fht4x4_c(in, out, stride, tx_type); |
Jingning Han | 362809d | 2013-06-18 10:46:33 -0700 | [diff] [blame] | 50 | } |
Daniel Kang | 58156f1 | 2012-06-26 18:11:33 -0700 | [diff] [blame] | 51 | |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 52 | void fwht4x4_ref(const int16_t *in, tran_low_t *out, int stride, |
James Zern | cffef11 | 2016-02-11 18:27:00 -0800 | [diff] [blame] | 53 | int /*tx_type*/) { |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 54 | av1_fwht4x4_c(in, out, stride); |
Alex Converse | 9f9f87c | 2014-05-05 13:50:12 -0700 | [diff] [blame] | 55 | } |
| 56 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 57 | #if CONFIG_AOM_HIGHBITDEPTH |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 58 | void idct4x4_10(const tran_low_t *in, uint8_t *out, int stride) { |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 59 | aom_highbd_idct4x4_16_add_c(in, out, stride, 10); |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 60 | } |
| 61 | |
| 62 | void idct4x4_12(const tran_low_t *in, uint8_t *out, int stride) { |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 63 | aom_highbd_idct4x4_16_add_c(in, out, stride, 12); |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 64 | } |
| 65 | |
| 66 | void iht4x4_10(const tran_low_t *in, uint8_t *out, int stride, int tx_type) { |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 67 | av1_highbd_iht4x4_16_add_c(in, out, stride, tx_type, 10); |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 68 | } |
| 69 | |
| 70 | void iht4x4_12(const tran_low_t *in, uint8_t *out, int stride, int tx_type) { |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 71 | av1_highbd_iht4x4_16_add_c(in, out, stride, tx_type, 12); |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 72 | } |
| 73 | |
| 74 | void iwht4x4_10(const tran_low_t *in, uint8_t *out, int stride) { |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 75 | aom_highbd_iwht4x4_16_add_c(in, out, stride, 10); |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 76 | } |
| 77 | |
| 78 | void iwht4x4_12(const tran_low_t *in, uint8_t *out, int stride) { |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 79 | aom_highbd_iwht4x4_16_add_c(in, out, stride, 12); |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 80 | } |
Peter de Rivaz | 7e40a55 | 2014-10-24 08:48:02 +0100 | [diff] [blame] | 81 | |
| 82 | #if HAVE_SSE2 |
| 83 | void idct4x4_10_sse2(const tran_low_t *in, uint8_t *out, int stride) { |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 84 | aom_highbd_idct4x4_16_add_sse2(in, out, stride, 10); |
Peter de Rivaz | 7e40a55 | 2014-10-24 08:48:02 +0100 | [diff] [blame] | 85 | } |
| 86 | |
| 87 | void idct4x4_12_sse2(const tran_low_t *in, uint8_t *out, int stride) { |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 88 | aom_highbd_idct4x4_16_add_sse2(in, out, stride, 12); |
Peter de Rivaz | 7e40a55 | 2014-10-24 08:48:02 +0100 | [diff] [blame] | 89 | } |
| 90 | #endif // HAVE_SSE2 |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 91 | #endif // CONFIG_AOM_HIGHBITDEPTH |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 92 | |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 93 | class Trans4x4DCT : public libaom_test::TransformTestBase, |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 94 | public ::testing::TestWithParam<Dct4x4Param> { |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 95 | public: |
| 96 | virtual ~Trans4x4DCT() {} |
Daniel Kang | 58156f1 | 2012-06-26 18:11:33 -0700 | [diff] [blame] | 97 | |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 98 | virtual void SetUp() { |
| 99 | fwd_txfm_ = GET_PARAM(0); |
| 100 | inv_txfm_ = GET_PARAM(1); |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 101 | tx_type_ = GET_PARAM(2); |
| 102 | pitch_ = 4; |
David Barker | 7825022 | 2016-10-13 15:10:14 +0100 | [diff] [blame] | 103 | height_ = 4; |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 104 | fwd_txfm_ref = fdct4x4_ref; |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 105 | bit_depth_ = GET_PARAM(3); |
| 106 | mask_ = (1 << bit_depth_) - 1; |
Yi Luo | 267f73a | 2016-02-29 09:53:42 -0800 | [diff] [blame] | 107 | num_coeffs_ = GET_PARAM(4); |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 108 | } |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 109 | virtual void TearDown() { libaom_test::ClearSystemState(); } |
Daniel Kang | 58156f1 | 2012-06-26 18:11:33 -0700 | [diff] [blame] | 110 | |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 111 | protected: |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 112 | void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) { |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 113 | fwd_txfm_(in, out, stride); |
| 114 | } |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 115 | void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) { |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 116 | inv_txfm_(out, dst, stride); |
Daniel Kang | 58156f1 | 2012-06-26 18:11:33 -0700 | [diff] [blame] | 117 | } |
| 118 | |
James Zern | b8b3dd9 | 2014-07-16 18:55:40 -0700 | [diff] [blame] | 119 | FdctFunc fwd_txfm_; |
| 120 | IdctFunc inv_txfm_; |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 121 | }; |
Daniel Kang | 58156f1 | 2012-06-26 18:11:33 -0700 | [diff] [blame] | 122 | |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 123 | TEST_P(Trans4x4DCT, AccuracyCheck) { RunAccuracyCheck(1); } |
Daniel Kang | 58156f1 | 2012-06-26 18:11:33 -0700 | [diff] [blame] | 124 | |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 125 | TEST_P(Trans4x4DCT, CoeffCheck) { RunCoeffCheck(); } |
Daniel Kang | 58156f1 | 2012-06-26 18:11:33 -0700 | [diff] [blame] | 126 | |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 127 | TEST_P(Trans4x4DCT, MemCheck) { RunMemCheck(); } |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 128 | |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 129 | TEST_P(Trans4x4DCT, InvAccuracyCheck) { RunInvAccuracyCheck(1); } |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 130 | |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 131 | class Trans4x4HT : public libaom_test::TransformTestBase, |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 132 | public ::testing::TestWithParam<Ht4x4Param> { |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 133 | public: |
| 134 | virtual ~Trans4x4HT() {} |
| 135 | |
| 136 | virtual void SetUp() { |
| 137 | fwd_txfm_ = GET_PARAM(0); |
| 138 | inv_txfm_ = GET_PARAM(1); |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 139 | tx_type_ = GET_PARAM(2); |
| 140 | pitch_ = 4; |
David Barker | 7825022 | 2016-10-13 15:10:14 +0100 | [diff] [blame] | 141 | height_ = 4; |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 142 | fwd_txfm_ref = fht4x4_ref; |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 143 | bit_depth_ = GET_PARAM(3); |
| 144 | mask_ = (1 << bit_depth_) - 1; |
Yi Luo | 267f73a | 2016-02-29 09:53:42 -0800 | [diff] [blame] | 145 | num_coeffs_ = GET_PARAM(4); |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 146 | } |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 147 | virtual void TearDown() { libaom_test::ClearSystemState(); } |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 148 | |
| 149 | protected: |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 150 | void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) { |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 151 | fwd_txfm_(in, out, stride, tx_type_); |
| 152 | } |
| 153 | |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 154 | void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) { |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 155 | inv_txfm_(out, dst, stride, tx_type_); |
| 156 | } |
| 157 | |
James Zern | b8b3dd9 | 2014-07-16 18:55:40 -0700 | [diff] [blame] | 158 | FhtFunc fwd_txfm_; |
| 159 | IhtFunc inv_txfm_; |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 160 | }; |
| 161 | |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 162 | TEST_P(Trans4x4HT, AccuracyCheck) { RunAccuracyCheck(1); } |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 163 | |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 164 | TEST_P(Trans4x4HT, CoeffCheck) { RunCoeffCheck(); } |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 165 | |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 166 | TEST_P(Trans4x4HT, MemCheck) { RunMemCheck(); } |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 167 | |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 168 | TEST_P(Trans4x4HT, InvAccuracyCheck) { RunInvAccuracyCheck(1); } |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 169 | |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 170 | class Trans4x4WHT : public libaom_test::TransformTestBase, |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 171 | public ::testing::TestWithParam<Dct4x4Param> { |
Alex Converse | 9f9f87c | 2014-05-05 13:50:12 -0700 | [diff] [blame] | 172 | public: |
| 173 | virtual ~Trans4x4WHT() {} |
| 174 | |
| 175 | virtual void SetUp() { |
| 176 | fwd_txfm_ = GET_PARAM(0); |
| 177 | inv_txfm_ = GET_PARAM(1); |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 178 | tx_type_ = GET_PARAM(2); |
| 179 | pitch_ = 4; |
David Barker | 7825022 | 2016-10-13 15:10:14 +0100 | [diff] [blame] | 180 | height_ = 4; |
Alex Converse | 9f9f87c | 2014-05-05 13:50:12 -0700 | [diff] [blame] | 181 | fwd_txfm_ref = fwht4x4_ref; |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 182 | bit_depth_ = GET_PARAM(3); |
| 183 | mask_ = (1 << bit_depth_) - 1; |
Yi Luo | 267f73a | 2016-02-29 09:53:42 -0800 | [diff] [blame] | 184 | num_coeffs_ = GET_PARAM(4); |
Alex Converse | 9f9f87c | 2014-05-05 13:50:12 -0700 | [diff] [blame] | 185 | } |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 186 | virtual void TearDown() { libaom_test::ClearSystemState(); } |
Alex Converse | 9f9f87c | 2014-05-05 13:50:12 -0700 | [diff] [blame] | 187 | |
| 188 | protected: |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 189 | void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) { |
Alex Converse | 9f9f87c | 2014-05-05 13:50:12 -0700 | [diff] [blame] | 190 | fwd_txfm_(in, out, stride); |
| 191 | } |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 192 | void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) { |
Alex Converse | 9f9f87c | 2014-05-05 13:50:12 -0700 | [diff] [blame] | 193 | inv_txfm_(out, dst, stride); |
| 194 | } |
| 195 | |
James Zern | b8b3dd9 | 2014-07-16 18:55:40 -0700 | [diff] [blame] | 196 | FdctFunc fwd_txfm_; |
| 197 | IdctFunc inv_txfm_; |
Alex Converse | 9f9f87c | 2014-05-05 13:50:12 -0700 | [diff] [blame] | 198 | }; |
| 199 | |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 200 | TEST_P(Trans4x4WHT, AccuracyCheck) { RunAccuracyCheck(0); } |
Alex Converse | 9f9f87c | 2014-05-05 13:50:12 -0700 | [diff] [blame] | 201 | |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 202 | TEST_P(Trans4x4WHT, CoeffCheck) { RunCoeffCheck(); } |
Alex Converse | 9f9f87c | 2014-05-05 13:50:12 -0700 | [diff] [blame] | 203 | |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 204 | TEST_P(Trans4x4WHT, MemCheck) { RunMemCheck(); } |
Alex Converse | 9f9f87c | 2014-05-05 13:50:12 -0700 | [diff] [blame] | 205 | |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 206 | TEST_P(Trans4x4WHT, InvAccuracyCheck) { RunInvAccuracyCheck(0); } |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 207 | using std::tr1::make_tuple; |
| 208 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 209 | #if CONFIG_AOM_HIGHBITDEPTH |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 210 | INSTANTIATE_TEST_CASE_P( |
| 211 | C, Trans4x4DCT, |
| 212 | ::testing::Values( |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 213 | make_tuple(&aom_highbd_fdct4x4_c, &idct4x4_10, 0, AOM_BITS_10, 16), |
| 214 | make_tuple(&aom_highbd_fdct4x4_c, &idct4x4_12, 0, AOM_BITS_12, 16), |
| 215 | make_tuple(&aom_fdct4x4_c, &aom_idct4x4_16_add_c, 0, AOM_BITS_8, 16))); |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 216 | #else |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 217 | INSTANTIATE_TEST_CASE_P(C, Trans4x4DCT, |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 218 | ::testing::Values(make_tuple(&aom_fdct4x4_c, |
| 219 | &aom_idct4x4_16_add_c, 0, |
| 220 | AOM_BITS_8, 16))); |
| 221 | #endif // CONFIG_AOM_HIGHBITDEPTH |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 222 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 223 | #if CONFIG_AOM_HIGHBITDEPTH |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 224 | INSTANTIATE_TEST_CASE_P( |
| 225 | C, Trans4x4HT, |
| 226 | ::testing::Values( |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 227 | make_tuple(&av1_highbd_fht4x4_c, &iht4x4_10, 0, AOM_BITS_10, 16), |
| 228 | make_tuple(&av1_highbd_fht4x4_c, &iht4x4_10, 1, AOM_BITS_10, 16), |
| 229 | make_tuple(&av1_highbd_fht4x4_c, &iht4x4_10, 2, AOM_BITS_10, 16), |
| 230 | make_tuple(&av1_highbd_fht4x4_c, &iht4x4_10, 3, AOM_BITS_10, 16), |
| 231 | make_tuple(&av1_highbd_fht4x4_c, &iht4x4_12, 0, AOM_BITS_12, 16), |
| 232 | make_tuple(&av1_highbd_fht4x4_c, &iht4x4_12, 1, AOM_BITS_12, 16), |
| 233 | make_tuple(&av1_highbd_fht4x4_c, &iht4x4_12, 2, AOM_BITS_12, 16), |
| 234 | make_tuple(&av1_highbd_fht4x4_c, &iht4x4_12, 3, AOM_BITS_12, 16), |
| 235 | make_tuple(&av1_fht4x4_c, &av1_iht4x4_16_add_c, 0, AOM_BITS_8, 16), |
| 236 | make_tuple(&av1_fht4x4_c, &av1_iht4x4_16_add_c, 1, AOM_BITS_8, 16), |
| 237 | make_tuple(&av1_fht4x4_c, &av1_iht4x4_16_add_c, 2, AOM_BITS_8, 16), |
| 238 | make_tuple(&av1_fht4x4_c, &av1_iht4x4_16_add_c, 3, AOM_BITS_8, 16))); |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 239 | #else |
| 240 | INSTANTIATE_TEST_CASE_P( |
| 241 | C, Trans4x4HT, |
| 242 | ::testing::Values( |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 243 | make_tuple(&av1_fht4x4_c, &av1_iht4x4_16_add_c, 0, AOM_BITS_8, 16), |
| 244 | make_tuple(&av1_fht4x4_c, &av1_iht4x4_16_add_c, 1, AOM_BITS_8, 16), |
| 245 | make_tuple(&av1_fht4x4_c, &av1_iht4x4_16_add_c, 2, AOM_BITS_8, 16), |
| 246 | make_tuple(&av1_fht4x4_c, &av1_iht4x4_16_add_c, 3, AOM_BITS_8, 16))); |
| 247 | #endif // CONFIG_AOM_HIGHBITDEPTH |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 248 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 249 | #if CONFIG_AOM_HIGHBITDEPTH |
Alex Converse | 9f9f87c | 2014-05-05 13:50:12 -0700 | [diff] [blame] | 250 | INSTANTIATE_TEST_CASE_P( |
| 251 | C, Trans4x4WHT, |
| 252 | ::testing::Values( |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 253 | make_tuple(&av1_highbd_fwht4x4_c, &iwht4x4_10, 0, AOM_BITS_10, 16), |
| 254 | make_tuple(&av1_highbd_fwht4x4_c, &iwht4x4_12, 0, AOM_BITS_12, 16), |
| 255 | make_tuple(&av1_fwht4x4_c, &aom_iwht4x4_16_add_c, 0, AOM_BITS_8, 16))); |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 256 | #else |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 257 | INSTANTIATE_TEST_CASE_P(C, Trans4x4WHT, |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 258 | ::testing::Values(make_tuple(&av1_fwht4x4_c, |
| 259 | &aom_iwht4x4_16_add_c, 0, |
| 260 | AOM_BITS_8, 16))); |
| 261 | #endif // CONFIG_AOM_HIGHBITDEPTH |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 262 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 263 | #if HAVE_NEON_ASM && !CONFIG_AOM_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 264 | INSTANTIATE_TEST_CASE_P(NEON, Trans4x4DCT, |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 265 | ::testing::Values(make_tuple(&aom_fdct4x4_c, |
| 266 | &aom_idct4x4_16_add_neon, |
| 267 | 0, AOM_BITS_8, 16))); |
| 268 | #endif // HAVE_NEON_ASM && !CONFIG_AOM_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE |
James Yu | 6b71013 | 2014-01-27 18:38:35 +0800 | [diff] [blame] | 269 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 270 | #if HAVE_NEON && !CONFIG_AOM_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE |
James Zern | 08c3180 | 2014-02-25 23:11:49 -0800 | [diff] [blame] | 271 | INSTANTIATE_TEST_CASE_P( |
James Yu | 6b71013 | 2014-01-27 18:38:35 +0800 | [diff] [blame] | 272 | NEON, Trans4x4HT, |
James Zern | 08c3180 | 2014-02-25 23:11:49 -0800 | [diff] [blame] | 273 | ::testing::Values( |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 274 | make_tuple(&av1_fht4x4_c, &av1_iht4x4_16_add_neon, 0, AOM_BITS_8, 16), |
| 275 | make_tuple(&av1_fht4x4_c, &av1_iht4x4_16_add_neon, 1, AOM_BITS_8, 16), |
| 276 | make_tuple(&av1_fht4x4_c, &av1_iht4x4_16_add_neon, 2, AOM_BITS_8, 16), |
| 277 | make_tuple(&av1_fht4x4_c, &av1_iht4x4_16_add_neon, 3, AOM_BITS_8, 16))); |
| 278 | #endif // HAVE_NEON && !CONFIG_AOM_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE |
James Zern | 08c3180 | 2014-02-25 23:11:49 -0800 | [diff] [blame] | 279 | |
Johann | 2967bf3 | 2016-06-22 16:08:10 -0700 | [diff] [blame] | 280 | #if HAVE_SSE2 && !CONFIG_EMULATE_HARDWARE |
Alex Converse | d8426d6 | 2015-07-13 11:12:45 -0700 | [diff] [blame] | 281 | INSTANTIATE_TEST_CASE_P( |
| 282 | SSE2, Trans4x4WHT, |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 283 | ::testing::Values(make_tuple(&av1_fwht4x4_c, &aom_iwht4x4_16_add_c, 0, |
| 284 | AOM_BITS_8, 16), |
| 285 | make_tuple(&av1_fwht4x4_c, &aom_iwht4x4_16_add_sse2, 0, |
| 286 | AOM_BITS_8, 16))); |
Alex Converse | d8426d6 | 2015-07-13 11:12:45 -0700 | [diff] [blame] | 287 | #endif |
| 288 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 289 | #if HAVE_SSE2 && !CONFIG_AOM_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 290 | INSTANTIATE_TEST_CASE_P(SSE2, Trans4x4DCT, |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 291 | ::testing::Values(make_tuple(&aom_fdct4x4_sse2, |
| 292 | &aom_idct4x4_16_add_sse2, |
| 293 | 0, AOM_BITS_8, 16))); |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 294 | INSTANTIATE_TEST_CASE_P( |
| 295 | SSE2, Trans4x4HT, |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 296 | ::testing::Values(make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_sse2, 0, |
| 297 | AOM_BITS_8, 16), |
| 298 | make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_sse2, 1, |
| 299 | AOM_BITS_8, 16), |
| 300 | make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_sse2, 2, |
| 301 | AOM_BITS_8, 16), |
| 302 | make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_sse2, 3, |
| 303 | AOM_BITS_8, 16))); |
| 304 | #endif // HAVE_SSE2 && !CONFIG_AOM_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 305 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 306 | #if HAVE_SSE2 && CONFIG_AOM_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE |
Peter de Rivaz | 7e40a55 | 2014-10-24 08:48:02 +0100 | [diff] [blame] | 307 | INSTANTIATE_TEST_CASE_P( |
| 308 | SSE2, Trans4x4DCT, |
| 309 | ::testing::Values( |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 310 | make_tuple(&aom_highbd_fdct4x4_c, &idct4x4_10_sse2, 0, AOM_BITS_10, 16), |
| 311 | make_tuple(&aom_highbd_fdct4x4_sse2, &idct4x4_10_sse2, 0, AOM_BITS_10, |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 312 | 16), |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 313 | make_tuple(&aom_highbd_fdct4x4_c, &idct4x4_12_sse2, 0, AOM_BITS_12, 16), |
| 314 | make_tuple(&aom_highbd_fdct4x4_sse2, &idct4x4_12_sse2, 0, AOM_BITS_12, |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 315 | 16), |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 316 | make_tuple(&aom_fdct4x4_sse2, &aom_idct4x4_16_add_c, 0, AOM_BITS_8, |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 317 | 16))); |
Peter de Rivaz | 7e40a55 | 2014-10-24 08:48:02 +0100 | [diff] [blame] | 318 | |
| 319 | INSTANTIATE_TEST_CASE_P( |
| 320 | SSE2, Trans4x4HT, |
| 321 | ::testing::Values( |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 322 | make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_c, 0, AOM_BITS_8, 16), |
| 323 | make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_c, 1, AOM_BITS_8, 16), |
| 324 | make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_c, 2, AOM_BITS_8, 16), |
| 325 | make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_c, 3, AOM_BITS_8, 16))); |
| 326 | #endif // HAVE_SSE2 && CONFIG_AOM_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE |
Parag Salasakar | 54a6f73 | 2015-06-02 12:16:28 +0530 | [diff] [blame] | 327 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 328 | #if HAVE_MSA && !CONFIG_AOM_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 329 | INSTANTIATE_TEST_CASE_P(MSA, Trans4x4DCT, |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 330 | ::testing::Values(make_tuple(&aom_fdct4x4_msa, |
| 331 | &aom_idct4x4_16_add_msa, 0, |
| 332 | AOM_BITS_8, 16))); |
James Zern | 1c25b7f | 2016-08-13 10:58:54 -0700 | [diff] [blame] | 333 | #if !CONFIG_EXT_TX |
Parag Salasakar | 54a6f73 | 2015-06-02 12:16:28 +0530 | [diff] [blame] | 334 | INSTANTIATE_TEST_CASE_P( |
| 335 | MSA, Trans4x4HT, |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 336 | ::testing::Values( |
| 337 | make_tuple(&av1_fht4x4_msa, &av1_iht4x4_16_add_msa, 0, AOM_BITS_8, 16), |
| 338 | make_tuple(&av1_fht4x4_msa, &av1_iht4x4_16_add_msa, 1, AOM_BITS_8, 16), |
| 339 | make_tuple(&av1_fht4x4_msa, &av1_iht4x4_16_add_msa, 2, AOM_BITS_8, 16), |
| 340 | make_tuple(&av1_fht4x4_msa, &av1_iht4x4_16_add_msa, 3, AOM_BITS_8, |
| 341 | 16))); |
James Zern | 1c25b7f | 2016-08-13 10:58:54 -0700 | [diff] [blame] | 342 | #endif // !CONFIG_EXT_TX |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 343 | #endif // HAVE_MSA && !CONFIG_AOM_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE |
Daniel Kang | 58156f1 | 2012-06-26 18:11:33 -0700 | [diff] [blame] | 344 | } // namespace |