Daniel Kang | 26641c7 | 2012-06-28 16:26:31 -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 | 26641c7 | 2012-06-28 16:26:31 -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. |
Lester Lu | d8b1ddc | 2017-07-06 16:13:29 -0700 | [diff] [blame] | 10 | */ |
Daniel Kang | 26641c7 | 2012-06-28 16:26:31 -0700 | [diff] [blame] | 11 | |
| 12 | #include <math.h> |
| 13 | #include <stdlib.h> |
| 14 | #include <string.h> |
| 15 | |
Tom Finegan | 7a07ece | 2017-02-07 17:14:05 -0800 | [diff] [blame] | 16 | #include "third_party/googletest/src/googletest/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 | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 20 | #include "test/acm_random.h" |
Yaowu Xu | e494df1 | 2013-09-03 13:50:17 -0700 | [diff] [blame] | 21 | #include "test/clear_system_state.h" |
| 22 | #include "test/register_state_check.h" |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 23 | #include "test/util.h" |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 24 | #include "av1/common/entropy.h" |
| 25 | #include "av1/common/scan.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; |
James Zern | c47d868 | 2015-05-14 19:38:34 -0700 | [diff] [blame] | 31 | |
| 32 | namespace { |
| 33 | |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 34 | const int kNumCoeffs = 64; |
| 35 | const double kPi = 3.141592653589793238462643383279502884; |
James Zern | c47d868 | 2015-05-14 19:38:34 -0700 | [diff] [blame] | 36 | |
| 37 | const int kSignBiasMaxDiff255 = 1500; |
| 38 | const int kSignBiasMaxDiff15 = 10000; |
| 39 | |
| 40 | typedef void (*FdctFunc)(const int16_t *in, tran_low_t *out, int stride); |
| 41 | typedef void (*IdctFunc)(const tran_low_t *in, uint8_t *out, int stride); |
| 42 | typedef void (*FhtFunc)(const int16_t *in, tran_low_t *out, int stride, |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 43 | TxfmParam *txfm_param); |
James Zern | c47d868 | 2015-05-14 19:38:34 -0700 | [diff] [blame] | 44 | typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride, |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 45 | const TxfmParam *txfm_param); |
James Zern | c47d868 | 2015-05-14 19:38:34 -0700 | [diff] [blame] | 46 | |
Urvang Joshi | 2283d37 | 2017-10-02 17:16:45 -0700 | [diff] [blame] | 47 | typedef std::tr1::tuple<FdctFunc, IdctFunc, TX_TYPE, aom_bit_depth_t> |
| 48 | Dct8x8Param; |
| 49 | typedef std::tr1::tuple<FhtFunc, IhtFunc, TX_TYPE, aom_bit_depth_t> Ht8x8Param; |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 50 | typedef std::tr1::tuple<IdctFunc, IdctFunc, int, aom_bit_depth_t> Idct8x8Param; |
James Zern | c47d868 | 2015-05-14 19:38:34 -0700 | [diff] [blame] | 51 | |
James Zern | cffef11 | 2016-02-11 18:27:00 -0800 | [diff] [blame] | 52 | void reference_8x8_dct_1d(const double in[8], double out[8]) { |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 53 | const double kInvSqrt2 = 0.707106781186547524400844362104; |
| 54 | for (int k = 0; k < 8; k++) { |
| 55 | out[k] = 0.0; |
| 56 | for (int n = 0; n < 8; n++) |
| 57 | out[k] += in[n] * cos(kPi * (2 * n + 1) * k / 16.0); |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 58 | if (k == 0) out[k] = out[k] * kInvSqrt2; |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 59 | } |
| 60 | } |
| 61 | |
| 62 | void reference_8x8_dct_2d(const int16_t input[kNumCoeffs], |
| 63 | double output[kNumCoeffs]) { |
| 64 | // First transform columns |
| 65 | for (int i = 0; i < 8; ++i) { |
| 66 | double temp_in[8], temp_out[8]; |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 67 | for (int j = 0; j < 8; ++j) temp_in[j] = input[j * 8 + i]; |
James Zern | cffef11 | 2016-02-11 18:27:00 -0800 | [diff] [blame] | 68 | reference_8x8_dct_1d(temp_in, temp_out); |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 69 | for (int j = 0; j < 8; ++j) output[j * 8 + i] = temp_out[j]; |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 70 | } |
| 71 | // Then transform rows |
| 72 | for (int i = 0; i < 8; ++i) { |
| 73 | double temp_in[8], temp_out[8]; |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 74 | for (int j = 0; j < 8; ++j) temp_in[j] = output[j + i * 8]; |
James Zern | cffef11 | 2016-02-11 18:27:00 -0800 | [diff] [blame] | 75 | reference_8x8_dct_1d(temp_in, temp_out); |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 76 | // Scale by some magic number |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 77 | for (int j = 0; j < 8; ++j) output[j + i * 8] = temp_out[j] * 2; |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 78 | } |
Daniel Kang | 26641c7 | 2012-06-28 16:26:31 -0700 | [diff] [blame] | 79 | } |
Daniel Kang | 26641c7 | 2012-06-28 16:26:31 -0700 | [diff] [blame] | 80 | |
James Zern | cffef11 | 2016-02-11 18:27:00 -0800 | [diff] [blame] | 81 | void fdct8x8_ref(const int16_t *in, tran_low_t *out, int stride, |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 82 | TxfmParam * /*txfm_param*/) { |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 83 | aom_fdct8x8_c(in, out, stride); |
Jingning Han | ab36262 | 2013-06-21 11:45:47 -0700 | [diff] [blame] | 84 | } |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 85 | |
Lester Lu | d8b1ddc | 2017-07-06 16:13:29 -0700 | [diff] [blame] | 86 | void fht8x8_ref(const int16_t *in, tran_low_t *out, int stride, |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 87 | TxfmParam *txfm_param) { |
| 88 | av1_fht8x8_c(in, out, stride, txfm_param); |
Jingning Han | ab36262 | 2013-06-21 11:45:47 -0700 | [diff] [blame] | 89 | } |
Daniel Kang | 26641c7 | 2012-06-28 16:26:31 -0700 | [diff] [blame] | 90 | |
Sebastien Alaiwan | 71e8784 | 2017-04-12 16:03:28 +0200 | [diff] [blame] | 91 | #if CONFIG_HIGHBITDEPTH |
Lester Lu | d8b1ddc | 2017-07-06 16:13:29 -0700 | [diff] [blame] | 92 | void fht8x8_10(const int16_t *in, tran_low_t *out, int stride, |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 93 | TxfmParam *txfm_param) { |
| 94 | av1_fwd_txfm2d_8x8_c(in, out, stride, txfm_param->tx_type, 10); |
Sarah Parker | 31c6650 | 2017-05-19 16:51:07 -0700 | [diff] [blame] | 95 | } |
| 96 | |
Lester Lu | d8b1ddc | 2017-07-06 16:13:29 -0700 | [diff] [blame] | 97 | void fht8x8_12(const int16_t *in, tran_low_t *out, int stride, |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 98 | TxfmParam *txfm_param) { |
| 99 | av1_fwd_txfm2d_8x8_c(in, out, stride, txfm_param->tx_type, 12); |
Sarah Parker | 31c6650 | 2017-05-19 16:51:07 -0700 | [diff] [blame] | 100 | } |
| 101 | |
Lester Lu | d8b1ddc | 2017-07-06 16:13:29 -0700 | [diff] [blame] | 102 | void iht8x8_10(const tran_low_t *in, uint8_t *out, int stride, |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 103 | const TxfmParam *txfm_param) { |
Lester Lu | d8b1ddc | 2017-07-06 16:13:29 -0700 | [diff] [blame] | 104 | av1_inv_txfm2d_add_8x8_c(in, CONVERT_TO_SHORTPTR(out), stride, |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 105 | txfm_param->tx_type, 10); |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 106 | } |
| 107 | |
Lester Lu | d8b1ddc | 2017-07-06 16:13:29 -0700 | [diff] [blame] | 108 | void iht8x8_12(const tran_low_t *in, uint8_t *out, int stride, |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 109 | const TxfmParam *txfm_param) { |
Lester Lu | d8b1ddc | 2017-07-06 16:13:29 -0700 | [diff] [blame] | 110 | av1_inv_txfm2d_add_8x8_c(in, CONVERT_TO_SHORTPTR(out), stride, |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 111 | txfm_param->tx_type, 12); |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 112 | } |
Peter de Rivaz | 7e40a55 | 2014-10-24 08:48:02 +0100 | [diff] [blame] | 113 | |
Sebastien Alaiwan | 71e8784 | 2017-04-12 16:03:28 +0200 | [diff] [blame] | 114 | #endif // CONFIG_HIGHBITDEPTH |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 115 | |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 116 | class FwdTrans8x8TestBase { |
Jingning Han | ab36262 | 2013-06-21 11:45:47 -0700 | [diff] [blame] | 117 | public: |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 118 | virtual ~FwdTrans8x8TestBase() {} |
Jingning Han | ab36262 | 2013-06-21 11:45:47 -0700 | [diff] [blame] | 119 | |
| 120 | protected: |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 121 | virtual void RunFwdTxfm(int16_t *in, tran_low_t *out, int stride) = 0; |
| 122 | virtual void RunInvTxfm(tran_low_t *out, uint8_t *dst, int stride) = 0; |
Jingning Han | ab36262 | 2013-06-21 11:45:47 -0700 | [diff] [blame] | 123 | |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 124 | void RunSignBiasCheck() { |
| 125 | ACMRandom rnd(ACMRandom::DeterministicSeed()); |
James Zern | fd3658b | 2015-05-02 13:24:16 -0700 | [diff] [blame] | 126 | DECLARE_ALIGNED(16, int16_t, test_input_block[64]); |
| 127 | DECLARE_ALIGNED(16, tran_low_t, test_output_block[64]); |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 128 | int count_sign_block[64][2]; |
| 129 | const int count_test_block = 100000; |
Jingning Han | ab36262 | 2013-06-21 11:45:47 -0700 | [diff] [blame] | 130 | |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 131 | memset(count_sign_block, 0, sizeof(count_sign_block)); |
Daniel Kang | 26641c7 | 2012-06-28 16:26:31 -0700 | [diff] [blame] | 132 | |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 133 | for (int i = 0; i < count_test_block; ++i) { |
| 134 | // Initialize a test block with input range [-255, 255]. |
| 135 | for (int j = 0; j < 64; ++j) |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 136 | test_input_block[j] = ((rnd.Rand16() >> (16 - bit_depth_)) & mask_) - |
| 137 | ((rnd.Rand16() >> (16 - bit_depth_)) & mask_); |
James Zern | 29e1b1a | 2014-07-09 21:02:02 -0700 | [diff] [blame] | 138 | ASM_REGISTER_STATE_CHECK( |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 139 | RunFwdTxfm(test_input_block, test_output_block, pitch_)); |
Daniel Kang | 26641c7 | 2012-06-28 16:26:31 -0700 | [diff] [blame] | 140 | |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 141 | for (int j = 0; j < 64; ++j) { |
| 142 | if (test_output_block[j] < 0) |
| 143 | ++count_sign_block[j][0]; |
| 144 | else if (test_output_block[j] > 0) |
| 145 | ++count_sign_block[j][1]; |
| 146 | } |
| 147 | } |
Daniel Kang | 26641c7 | 2012-06-28 16:26:31 -0700 | [diff] [blame] | 148 | |
| 149 | for (int j = 0; j < 64; ++j) { |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 150 | const int diff = abs(count_sign_block[j][0] - count_sign_block[j][1]); |
Deb Mukherjee | 1fe643c | 2014-12-04 16:46:06 -0800 | [diff] [blame] | 151 | const int max_diff = kSignBiasMaxDiff255; |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 152 | EXPECT_LT(diff, max_diff << (bit_depth_ - 8)) |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 153 | << "Error: 8x8 FDCT/FHT has a sign bias > " |
| 154 | << 1. * max_diff / count_test_block * 100 << "%" |
| 155 | << " for input range [-255, 255] at index " << j |
| 156 | << " count0: " << count_sign_block[j][0] |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 157 | << " count1: " << count_sign_block[j][1] << " diff: " << diff; |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 158 | } |
| 159 | |
| 160 | memset(count_sign_block, 0, sizeof(count_sign_block)); |
| 161 | |
| 162 | for (int i = 0; i < count_test_block; ++i) { |
Peter de Rivaz | 7e40a55 | 2014-10-24 08:48:02 +0100 | [diff] [blame] | 163 | // Initialize a test block with input range [-mask_ / 16, mask_ / 16]. |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 164 | for (int j = 0; j < 64; ++j) |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 165 | test_input_block[j] = |
| 166 | ((rnd.Rand16() & mask_) >> 4) - ((rnd.Rand16() & mask_) >> 4); |
James Zern | 29e1b1a | 2014-07-09 21:02:02 -0700 | [diff] [blame] | 167 | ASM_REGISTER_STATE_CHECK( |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 168 | RunFwdTxfm(test_input_block, test_output_block, pitch_)); |
| 169 | |
| 170 | for (int j = 0; j < 64; ++j) { |
| 171 | if (test_output_block[j] < 0) |
| 172 | ++count_sign_block[j][0]; |
| 173 | else if (test_output_block[j] > 0) |
| 174 | ++count_sign_block[j][1]; |
| 175 | } |
| 176 | } |
| 177 | |
| 178 | for (int j = 0; j < 64; ++j) { |
| 179 | const int diff = abs(count_sign_block[j][0] - count_sign_block[j][1]); |
Deb Mukherjee | 1fe643c | 2014-12-04 16:46:06 -0800 | [diff] [blame] | 180 | const int max_diff = kSignBiasMaxDiff15; |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 181 | EXPECT_LT(diff, max_diff << (bit_depth_ - 8)) |
Deb Mukherjee | 1fe643c | 2014-12-04 16:46:06 -0800 | [diff] [blame] | 182 | << "Error: 8x8 FDCT/FHT has a sign bias > " |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 183 | << 1. * max_diff / count_test_block * 100 << "%" |
| 184 | << " for input range [-15, 15] at index " << j |
| 185 | << " count0: " << count_sign_block[j][0] |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 186 | << " count1: " << count_sign_block[j][1] << " diff: " << diff; |
Daniel Kang | 26641c7 | 2012-06-28 16:26:31 -0700 | [diff] [blame] | 187 | } |
| 188 | } |
| 189 | |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 190 | void RunRoundTripErrorCheck() { |
| 191 | ACMRandom rnd(ACMRandom::DeterministicSeed()); |
| 192 | int max_error = 0; |
| 193 | int total_error = 0; |
| 194 | const int count_test_block = 100000; |
James Zern | fd3658b | 2015-05-02 13:24:16 -0700 | [diff] [blame] | 195 | DECLARE_ALIGNED(16, int16_t, test_input_block[64]); |
| 196 | DECLARE_ALIGNED(16, tran_low_t, test_temp_block[64]); |
| 197 | DECLARE_ALIGNED(16, uint8_t, dst[64]); |
| 198 | DECLARE_ALIGNED(16, uint8_t, src[64]); |
Sebastien Alaiwan | 71e8784 | 2017-04-12 16:03:28 +0200 | [diff] [blame] | 199 | #if CONFIG_HIGHBITDEPTH |
James Zern | fd3658b | 2015-05-02 13:24:16 -0700 | [diff] [blame] | 200 | DECLARE_ALIGNED(16, uint16_t, dst16[64]); |
| 201 | DECLARE_ALIGNED(16, uint16_t, src16[64]); |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 202 | #endif |
Daniel Kang | 26641c7 | 2012-06-28 16:26:31 -0700 | [diff] [blame] | 203 | |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 204 | for (int i = 0; i < count_test_block; ++i) { |
Peter de Rivaz | 7e40a55 | 2014-10-24 08:48:02 +0100 | [diff] [blame] | 205 | // Initialize a test block with input range [-mask_, mask_]. |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 206 | for (int j = 0; j < 64; ++j) { |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 207 | if (bit_depth_ == AOM_BITS_8) { |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 208 | src[j] = rnd.Rand8(); |
| 209 | dst[j] = rnd.Rand8(); |
| 210 | test_input_block[j] = src[j] - dst[j]; |
Sebastien Alaiwan | 71e8784 | 2017-04-12 16:03:28 +0200 | [diff] [blame] | 211 | #if CONFIG_HIGHBITDEPTH |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 212 | } else { |
| 213 | src16[j] = rnd.Rand16() & mask_; |
| 214 | dst16[j] = rnd.Rand16() & mask_; |
| 215 | test_input_block[j] = src16[j] - dst16[j]; |
| 216 | #endif |
| 217 | } |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 218 | } |
Daniel Kang | 26641c7 | 2012-06-28 16:26:31 -0700 | [diff] [blame] | 219 | |
James Zern | 29e1b1a | 2014-07-09 21:02:02 -0700 | [diff] [blame] | 220 | ASM_REGISTER_STATE_CHECK( |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 221 | RunFwdTxfm(test_input_block, test_temp_block, pitch_)); |
| 222 | for (int j = 0; j < 64; ++j) { |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 223 | if (test_temp_block[j] > 0) { |
| 224 | test_temp_block[j] += 2; |
| 225 | test_temp_block[j] /= 4; |
| 226 | test_temp_block[j] *= 4; |
| 227 | } else { |
| 228 | test_temp_block[j] -= 2; |
| 229 | test_temp_block[j] /= 4; |
| 230 | test_temp_block[j] *= 4; |
| 231 | } |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 232 | } |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 233 | if (bit_depth_ == AOM_BITS_8) { |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 234 | ASM_REGISTER_STATE_CHECK(RunInvTxfm(test_temp_block, dst, pitch_)); |
Sebastien Alaiwan | 71e8784 | 2017-04-12 16:03:28 +0200 | [diff] [blame] | 235 | #if CONFIG_HIGHBITDEPTH |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 236 | } else { |
| 237 | ASM_REGISTER_STATE_CHECK( |
| 238 | RunInvTxfm(test_temp_block, CONVERT_TO_BYTEPTR(dst16), pitch_)); |
| 239 | #endif |
| 240 | } |
Daniel Kang | 26641c7 | 2012-06-28 16:26:31 -0700 | [diff] [blame] | 241 | |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 242 | for (int j = 0; j < 64; ++j) { |
Sebastien Alaiwan | 71e8784 | 2017-04-12 16:03:28 +0200 | [diff] [blame] | 243 | #if CONFIG_HIGHBITDEPTH |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 244 | const int diff = |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 245 | bit_depth_ == AOM_BITS_8 ? dst[j] - src[j] : dst16[j] - src16[j]; |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 246 | #else |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 247 | const int diff = dst[j] - src[j]; |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 248 | #endif |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 249 | const int error = diff * diff; |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 250 | if (max_error < error) max_error = error; |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 251 | total_error += error; |
| 252 | } |
Daniel Kang | 26641c7 | 2012-06-28 16:26:31 -0700 | [diff] [blame] | 253 | } |
| 254 | |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 255 | EXPECT_GE(1 << 2 * (bit_depth_ - 8), max_error) |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 256 | << "Error: 8x8 FDCT/IDCT or FHT/IHT has an individual" |
| 257 | << " roundtrip error > 1"; |
Daniel Kang | 26641c7 | 2012-06-28 16:26:31 -0700 | [diff] [blame] | 258 | |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 259 | EXPECT_GE((count_test_block << 2 * (bit_depth_ - 8)) / 5, total_error) |
| 260 | << "Error: 8x8 FDCT/IDCT or FHT/IHT has average roundtrip " |
| 261 | << "error > 1/5 per block"; |
Daniel Kang | 26641c7 | 2012-06-28 16:26:31 -0700 | [diff] [blame] | 262 | } |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 263 | |
| 264 | void RunExtremalCheck() { |
| 265 | ACMRandom rnd(ACMRandom::DeterministicSeed()); |
| 266 | int max_error = 0; |
| 267 | int total_error = 0; |
Jingning Han | 5c2696c | 2014-06-02 16:40:01 -0700 | [diff] [blame] | 268 | int total_coeff_error = 0; |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 269 | const int count_test_block = 100000; |
James Zern | fd3658b | 2015-05-02 13:24:16 -0700 | [diff] [blame] | 270 | DECLARE_ALIGNED(16, int16_t, test_input_block[64]); |
| 271 | DECLARE_ALIGNED(16, tran_low_t, test_temp_block[64]); |
| 272 | DECLARE_ALIGNED(16, tran_low_t, ref_temp_block[64]); |
| 273 | DECLARE_ALIGNED(16, uint8_t, dst[64]); |
| 274 | DECLARE_ALIGNED(16, uint8_t, src[64]); |
Sebastien Alaiwan | 71e8784 | 2017-04-12 16:03:28 +0200 | [diff] [blame] | 275 | #if CONFIG_HIGHBITDEPTH |
James Zern | fd3658b | 2015-05-02 13:24:16 -0700 | [diff] [blame] | 276 | DECLARE_ALIGNED(16, uint16_t, dst16[64]); |
| 277 | DECLARE_ALIGNED(16, uint16_t, src16[64]); |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 278 | #endif |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 279 | |
| 280 | for (int i = 0; i < count_test_block; ++i) { |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 281 | // Initialize a test block with input range [-mask_, mask_]. |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 282 | for (int j = 0; j < 64; ++j) { |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 283 | if (bit_depth_ == AOM_BITS_8) { |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 284 | if (i == 0) { |
| 285 | src[j] = 255; |
| 286 | dst[j] = 0; |
| 287 | } else if (i == 1) { |
| 288 | src[j] = 0; |
| 289 | dst[j] = 255; |
| 290 | } else { |
| 291 | src[j] = rnd.Rand8() % 2 ? 255 : 0; |
| 292 | dst[j] = rnd.Rand8() % 2 ? 255 : 0; |
| 293 | } |
| 294 | test_input_block[j] = src[j] - dst[j]; |
Sebastien Alaiwan | 71e8784 | 2017-04-12 16:03:28 +0200 | [diff] [blame] | 295 | #if CONFIG_HIGHBITDEPTH |
Jingning Han | 0343e30 | 2014-06-03 16:45:22 -0700 | [diff] [blame] | 296 | } else { |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 297 | if (i == 0) { |
| 298 | src16[j] = mask_; |
| 299 | dst16[j] = 0; |
| 300 | } else if (i == 1) { |
| 301 | src16[j] = 0; |
| 302 | dst16[j] = mask_; |
| 303 | } else { |
| 304 | src16[j] = rnd.Rand8() % 2 ? mask_ : 0; |
| 305 | dst16[j] = rnd.Rand8() % 2 ? mask_ : 0; |
| 306 | } |
| 307 | test_input_block[j] = src16[j] - dst16[j]; |
| 308 | #endif |
Jingning Han | 5c2696c | 2014-06-02 16:40:01 -0700 | [diff] [blame] | 309 | } |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 310 | } |
| 311 | |
James Zern | 29e1b1a | 2014-07-09 21:02:02 -0700 | [diff] [blame] | 312 | ASM_REGISTER_STATE_CHECK( |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 313 | RunFwdTxfm(test_input_block, test_temp_block, pitch_)); |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 314 | ASM_REGISTER_STATE_CHECK( |
| 315 | fwd_txfm_ref(test_input_block, ref_temp_block, pitch_, &txfm_param_)); |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 316 | if (bit_depth_ == AOM_BITS_8) { |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 317 | ASM_REGISTER_STATE_CHECK(RunInvTxfm(test_temp_block, dst, pitch_)); |
Sebastien Alaiwan | 71e8784 | 2017-04-12 16:03:28 +0200 | [diff] [blame] | 318 | #if CONFIG_HIGHBITDEPTH |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 319 | } else { |
| 320 | ASM_REGISTER_STATE_CHECK( |
| 321 | RunInvTxfm(test_temp_block, CONVERT_TO_BYTEPTR(dst16), pitch_)); |
| 322 | #endif |
| 323 | } |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 324 | |
| 325 | for (int j = 0; j < 64; ++j) { |
Sebastien Alaiwan | 71e8784 | 2017-04-12 16:03:28 +0200 | [diff] [blame] | 326 | #if CONFIG_HIGHBITDEPTH |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 327 | const int diff = |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 328 | bit_depth_ == AOM_BITS_8 ? dst[j] - src[j] : dst16[j] - src16[j]; |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 329 | #else |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 330 | const int diff = dst[j] - src[j]; |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 331 | #endif |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 332 | const int error = diff * diff; |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 333 | if (max_error < error) max_error = error; |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 334 | total_error += error; |
Jingning Han | 5c2696c | 2014-06-02 16:40:01 -0700 | [diff] [blame] | 335 | |
| 336 | const int coeff_diff = test_temp_block[j] - ref_temp_block[j]; |
| 337 | total_coeff_error += abs(coeff_diff); |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 338 | } |
| 339 | |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 340 | EXPECT_GE(1 << 2 * (bit_depth_ - 8), max_error) |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 341 | << "Error: Extremal 8x8 FDCT/IDCT or FHT/IHT has" |
| 342 | << "an individual roundtrip error > 1"; |
| 343 | |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 344 | EXPECT_GE((count_test_block << 2 * (bit_depth_ - 8)) / 5, total_error) |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 345 | << "Error: Extremal 8x8 FDCT/IDCT or FHT/IHT has average" |
| 346 | << " roundtrip error > 1/5 per block"; |
Jingning Han | 5c2696c | 2014-06-02 16:40:01 -0700 | [diff] [blame] | 347 | |
| 348 | EXPECT_EQ(0, total_coeff_error) |
| 349 | << "Error: Extremal 8x8 FDCT/FHT has" |
| 350 | << "overflow issues in the intermediate steps > 1"; |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 351 | } |
| 352 | } |
| 353 | |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 354 | void RunInvAccuracyCheck() { |
| 355 | ACMRandom rnd(ACMRandom::DeterministicSeed()); |
| 356 | const int count_test_block = 1000; |
James Zern | fd3658b | 2015-05-02 13:24:16 -0700 | [diff] [blame] | 357 | DECLARE_ALIGNED(16, int16_t, in[kNumCoeffs]); |
| 358 | DECLARE_ALIGNED(16, tran_low_t, coeff[kNumCoeffs]); |
| 359 | DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]); |
| 360 | DECLARE_ALIGNED(16, uint8_t, src[kNumCoeffs]); |
Sebastien Alaiwan | 71e8784 | 2017-04-12 16:03:28 +0200 | [diff] [blame] | 361 | #if CONFIG_HIGHBITDEPTH |
James Zern | fd3658b | 2015-05-02 13:24:16 -0700 | [diff] [blame] | 362 | DECLARE_ALIGNED(16, uint16_t, src16[kNumCoeffs]); |
| 363 | DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]); |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 364 | #endif |
| 365 | |
| 366 | for (int i = 0; i < count_test_block; ++i) { |
| 367 | double out_r[kNumCoeffs]; |
| 368 | |
| 369 | // Initialize a test block with input range [-255, 255]. |
| 370 | for (int j = 0; j < kNumCoeffs; ++j) { |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 371 | if (bit_depth_ == AOM_BITS_8) { |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 372 | src[j] = rnd.Rand8() % 2 ? 255 : 0; |
| 373 | dst[j] = src[j] > 0 ? 0 : 255; |
| 374 | in[j] = src[j] - dst[j]; |
Sebastien Alaiwan | 71e8784 | 2017-04-12 16:03:28 +0200 | [diff] [blame] | 375 | #if CONFIG_HIGHBITDEPTH |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 376 | } else { |
| 377 | src16[j] = rnd.Rand8() % 2 ? mask_ : 0; |
| 378 | dst16[j] = src16[j] > 0 ? 0 : mask_; |
| 379 | in[j] = src16[j] - dst16[j]; |
| 380 | #endif |
| 381 | } |
| 382 | } |
| 383 | |
| 384 | reference_8x8_dct_2d(in, out_r); |
| 385 | for (int j = 0; j < kNumCoeffs; ++j) |
Deb Mukherjee | 41e6ec4 | 2014-09-13 04:11:50 -0700 | [diff] [blame] | 386 | coeff[j] = static_cast<tran_low_t>(round(out_r[j])); |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 387 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 388 | if (bit_depth_ == AOM_BITS_8) { |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 389 | ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, dst, pitch_)); |
Sebastien Alaiwan | 71e8784 | 2017-04-12 16:03:28 +0200 | [diff] [blame] | 390 | #if CONFIG_HIGHBITDEPTH |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 391 | } else { |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 392 | ASM_REGISTER_STATE_CHECK( |
| 393 | RunInvTxfm(coeff, CONVERT_TO_BYTEPTR(dst16), pitch_)); |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 394 | #endif |
| 395 | } |
| 396 | |
| 397 | for (int j = 0; j < kNumCoeffs; ++j) { |
Sebastien Alaiwan | 71e8784 | 2017-04-12 16:03:28 +0200 | [diff] [blame] | 398 | #if CONFIG_HIGHBITDEPTH |
James Zern | 95d2dc8 | 2016-06-08 17:33:34 -0700 | [diff] [blame] | 399 | const int diff = |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 400 | bit_depth_ == AOM_BITS_8 ? dst[j] - src[j] : dst16[j] - src16[j]; |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 401 | #else |
James Zern | 95d2dc8 | 2016-06-08 17:33:34 -0700 | [diff] [blame] | 402 | const int diff = dst[j] - src[j]; |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 403 | #endif |
| 404 | const uint32_t error = diff * diff; |
| 405 | EXPECT_GE(1u << 2 * (bit_depth_ - 8), error) |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 406 | << "Error: 8x8 IDCT has error " << error << " at index " << j; |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 407 | } |
| 408 | } |
| 409 | } |
| 410 | |
| 411 | void RunFwdAccuracyCheck() { |
| 412 | ACMRandom rnd(ACMRandom::DeterministicSeed()); |
| 413 | const int count_test_block = 1000; |
James Zern | fd3658b | 2015-05-02 13:24:16 -0700 | [diff] [blame] | 414 | DECLARE_ALIGNED(16, int16_t, in[kNumCoeffs]); |
| 415 | DECLARE_ALIGNED(16, tran_low_t, coeff_r[kNumCoeffs]); |
| 416 | DECLARE_ALIGNED(16, tran_low_t, coeff[kNumCoeffs]); |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 417 | |
| 418 | for (int i = 0; i < count_test_block; ++i) { |
| 419 | double out_r[kNumCoeffs]; |
| 420 | |
| 421 | // Initialize a test block with input range [-mask_, mask_]. |
| 422 | for (int j = 0; j < kNumCoeffs; ++j) |
| 423 | in[j] = rnd.Rand8() % 2 == 0 ? mask_ : -mask_; |
| 424 | |
| 425 | RunFwdTxfm(in, coeff, pitch_); |
| 426 | reference_8x8_dct_2d(in, out_r); |
| 427 | for (int j = 0; j < kNumCoeffs; ++j) |
Deb Mukherjee | 41e6ec4 | 2014-09-13 04:11:50 -0700 | [diff] [blame] | 428 | coeff_r[j] = static_cast<tran_low_t>(round(out_r[j])); |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 429 | |
| 430 | for (int j = 0; j < kNumCoeffs; ++j) { |
Yaowu Xu | 6382727 | 2016-05-31 16:54:58 -0700 | [diff] [blame] | 431 | const int32_t diff = coeff[j] - coeff_r[j]; |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 432 | const uint32_t error = diff * diff; |
| 433 | EXPECT_GE(9u << 2 * (bit_depth_ - 8), error) |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 434 | << "Error: 8x8 DCT has error " << error << " at index " << j; |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 435 | } |
| 436 | } |
| 437 | } |
Peter de Rivaz | 7e40a55 | 2014-10-24 08:48:02 +0100 | [diff] [blame] | 438 | |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 439 | void CompareInvReference(IdctFunc ref_txfm, int thresh) { |
Peter de Rivaz | 7e40a55 | 2014-10-24 08:48:02 +0100 | [diff] [blame] | 440 | ACMRandom rnd(ACMRandom::DeterministicSeed()); |
| 441 | const int count_test_block = 10000; |
| 442 | const int eob = 12; |
James Zern | fd3658b | 2015-05-02 13:24:16 -0700 | [diff] [blame] | 443 | DECLARE_ALIGNED(16, tran_low_t, coeff[kNumCoeffs]); |
| 444 | DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]); |
| 445 | DECLARE_ALIGNED(16, uint8_t, ref[kNumCoeffs]); |
Sebastien Alaiwan | 71e8784 | 2017-04-12 16:03:28 +0200 | [diff] [blame] | 446 | #if CONFIG_HIGHBITDEPTH |
James Zern | fd3658b | 2015-05-02 13:24:16 -0700 | [diff] [blame] | 447 | DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]); |
| 448 | DECLARE_ALIGNED(16, uint16_t, ref16[kNumCoeffs]); |
Peter de Rivaz | 7e40a55 | 2014-10-24 08:48:02 +0100 | [diff] [blame] | 449 | #endif |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 450 | const int16_t *scan = av1_default_scan_orders[TX_8X8].scan; |
Peter de Rivaz | 7e40a55 | 2014-10-24 08:48:02 +0100 | [diff] [blame] | 451 | |
| 452 | for (int i = 0; i < count_test_block; ++i) { |
| 453 | for (int j = 0; j < kNumCoeffs; ++j) { |
| 454 | if (j < eob) { |
| 455 | // Random values less than the threshold, either positive or negative |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 456 | coeff[scan[j]] = rnd(thresh) * (1 - 2 * (i % 2)); |
Peter de Rivaz | 7e40a55 | 2014-10-24 08:48:02 +0100 | [diff] [blame] | 457 | } else { |
| 458 | coeff[scan[j]] = 0; |
| 459 | } |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 460 | if (bit_depth_ == AOM_BITS_8) { |
Peter de Rivaz | 7e40a55 | 2014-10-24 08:48:02 +0100 | [diff] [blame] | 461 | dst[j] = 0; |
| 462 | ref[j] = 0; |
Sebastien Alaiwan | 71e8784 | 2017-04-12 16:03:28 +0200 | [diff] [blame] | 463 | #if CONFIG_HIGHBITDEPTH |
Peter de Rivaz | 7e40a55 | 2014-10-24 08:48:02 +0100 | [diff] [blame] | 464 | } else { |
| 465 | dst16[j] = 0; |
| 466 | ref16[j] = 0; |
| 467 | #endif |
| 468 | } |
| 469 | } |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 470 | if (bit_depth_ == AOM_BITS_8) { |
Peter de Rivaz | 7e40a55 | 2014-10-24 08:48:02 +0100 | [diff] [blame] | 471 | ref_txfm(coeff, ref, pitch_); |
| 472 | ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, dst, pitch_)); |
Sebastien Alaiwan | 71e8784 | 2017-04-12 16:03:28 +0200 | [diff] [blame] | 473 | #if CONFIG_HIGHBITDEPTH |
Peter de Rivaz | 7e40a55 | 2014-10-24 08:48:02 +0100 | [diff] [blame] | 474 | } else { |
| 475 | ref_txfm(coeff, CONVERT_TO_BYTEPTR(ref16), pitch_); |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 476 | ASM_REGISTER_STATE_CHECK( |
| 477 | RunInvTxfm(coeff, CONVERT_TO_BYTEPTR(dst16), pitch_)); |
Peter de Rivaz | 7e40a55 | 2014-10-24 08:48:02 +0100 | [diff] [blame] | 478 | #endif |
| 479 | } |
| 480 | |
| 481 | for (int j = 0; j < kNumCoeffs; ++j) { |
Sebastien Alaiwan | 71e8784 | 2017-04-12 16:03:28 +0200 | [diff] [blame] | 482 | #if CONFIG_HIGHBITDEPTH |
James Zern | 95d2dc8 | 2016-06-08 17:33:34 -0700 | [diff] [blame] | 483 | const int diff = |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 484 | bit_depth_ == AOM_BITS_8 ? dst[j] - ref[j] : dst16[j] - ref16[j]; |
Peter de Rivaz | 7e40a55 | 2014-10-24 08:48:02 +0100 | [diff] [blame] | 485 | #else |
James Zern | 95d2dc8 | 2016-06-08 17:33:34 -0700 | [diff] [blame] | 486 | const int diff = dst[j] - ref[j]; |
Peter de Rivaz | 7e40a55 | 2014-10-24 08:48:02 +0100 | [diff] [blame] | 487 | #endif |
| 488 | const uint32_t error = diff * diff; |
clang-format | 4eafefe | 2017-09-04 12:51:20 -0700 | [diff] [blame] | 489 | EXPECT_EQ(0u, error) |
| 490 | << "Error: 8x8 IDCT has error " << error << " at index " << j; |
Peter de Rivaz | 7e40a55 | 2014-10-24 08:48:02 +0100 | [diff] [blame] | 491 | } |
| 492 | } |
| 493 | } |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 494 | int pitch_; |
James Zern | 54697d3 | 2014-07-16 18:56:22 -0700 | [diff] [blame] | 495 | FhtFunc fwd_txfm_ref; |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 496 | aom_bit_depth_t bit_depth_; |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 497 | int mask_; |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 498 | TxfmParam txfm_param_; |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 499 | }; |
| 500 | |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 501 | class FwdTrans8x8DCT : public FwdTrans8x8TestBase, |
| 502 | public ::testing::TestWithParam<Dct8x8Param> { |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 503 | public: |
| 504 | virtual ~FwdTrans8x8DCT() {} |
| 505 | |
| 506 | virtual void SetUp() { |
| 507 | fwd_txfm_ = GET_PARAM(0); |
| 508 | inv_txfm_ = GET_PARAM(1); |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 509 | pitch_ = 8; |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 510 | fwd_txfm_ref = fdct8x8_ref; |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 511 | bit_depth_ = GET_PARAM(3); |
| 512 | mask_ = (1 << bit_depth_) - 1; |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 513 | txfm_param_.tx_type = GET_PARAM(2); |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 514 | } |
| 515 | |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 516 | virtual void TearDown() { libaom_test::ClearSystemState(); } |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 517 | |
| 518 | protected: |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 519 | void RunFwdTxfm(int16_t *in, tran_low_t *out, int stride) { |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 520 | fwd_txfm_(in, out, stride); |
| 521 | } |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 522 | void RunInvTxfm(tran_low_t *out, uint8_t *dst, int stride) { |
Dmitry Kovalev | e5fa44c | 2013-10-18 12:20:26 -0700 | [diff] [blame] | 523 | inv_txfm_(out, dst, stride); |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 524 | } |
| 525 | |
James Zern | 54697d3 | 2014-07-16 18:56:22 -0700 | [diff] [blame] | 526 | FdctFunc fwd_txfm_; |
| 527 | IdctFunc inv_txfm_; |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 528 | }; |
| 529 | |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 530 | TEST_P(FwdTrans8x8DCT, SignBiasCheck) { RunSignBiasCheck(); } |
Daniel Kang | 26641c7 | 2012-06-28 16:26:31 -0700 | [diff] [blame] | 531 | |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 532 | TEST_P(FwdTrans8x8DCT, RoundTripErrorCheck) { RunRoundTripErrorCheck(); } |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 533 | |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 534 | TEST_P(FwdTrans8x8DCT, ExtremalCheck) { RunExtremalCheck(); } |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 535 | |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 536 | TEST_P(FwdTrans8x8DCT, FwdAccuracyCheck) { RunFwdAccuracyCheck(); } |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 537 | |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 538 | TEST_P(FwdTrans8x8DCT, InvAccuracyCheck) { RunInvAccuracyCheck(); } |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 539 | |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 540 | class FwdTrans8x8HT : public FwdTrans8x8TestBase, |
| 541 | public ::testing::TestWithParam<Ht8x8Param> { |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 542 | public: |
| 543 | virtual ~FwdTrans8x8HT() {} |
| 544 | |
| 545 | virtual void SetUp() { |
| 546 | fwd_txfm_ = GET_PARAM(0); |
| 547 | inv_txfm_ = GET_PARAM(1); |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 548 | pitch_ = 8; |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 549 | fwd_txfm_ref = fht8x8_ref; |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 550 | bit_depth_ = GET_PARAM(3); |
| 551 | mask_ = (1 << bit_depth_) - 1; |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 552 | txfm_param_.tx_type = GET_PARAM(2); |
Sarah Parker | 31c6650 | 2017-05-19 16:51:07 -0700 | [diff] [blame] | 553 | #if CONFIG_HIGHBITDEPTH |
| 554 | switch (bit_depth_) { |
| 555 | case AOM_BITS_10: fwd_txfm_ref = fht8x8_10; break; |
| 556 | case AOM_BITS_12: fwd_txfm_ref = fht8x8_12; break; |
| 557 | default: fwd_txfm_ref = fht8x8_ref; break; |
| 558 | } |
| 559 | #endif |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 560 | } |
| 561 | |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 562 | virtual void TearDown() { libaom_test::ClearSystemState(); } |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 563 | |
| 564 | protected: |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 565 | void RunFwdTxfm(int16_t *in, tran_low_t *out, int stride) { |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 566 | fwd_txfm_(in, out, stride, &txfm_param_); |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 567 | } |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 568 | void RunInvTxfm(tran_low_t *out, uint8_t *dst, int stride) { |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 569 | inv_txfm_(out, dst, stride, &txfm_param_); |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 570 | } |
| 571 | |
James Zern | 54697d3 | 2014-07-16 18:56:22 -0700 | [diff] [blame] | 572 | FhtFunc fwd_txfm_; |
| 573 | IhtFunc inv_txfm_; |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 574 | }; |
| 575 | |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 576 | TEST_P(FwdTrans8x8HT, SignBiasCheck) { RunSignBiasCheck(); } |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 577 | |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 578 | TEST_P(FwdTrans8x8HT, RoundTripErrorCheck) { RunRoundTripErrorCheck(); } |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 579 | |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 580 | TEST_P(FwdTrans8x8HT, ExtremalCheck) { RunExtremalCheck(); } |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 581 | |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 582 | class InvTrans8x8DCT : public FwdTrans8x8TestBase, |
| 583 | public ::testing::TestWithParam<Idct8x8Param> { |
Peter de Rivaz | 7e40a55 | 2014-10-24 08:48:02 +0100 | [diff] [blame] | 584 | public: |
| 585 | virtual ~InvTrans8x8DCT() {} |
| 586 | |
| 587 | virtual void SetUp() { |
| 588 | ref_txfm_ = GET_PARAM(0); |
| 589 | inv_txfm_ = GET_PARAM(1); |
| 590 | thresh_ = GET_PARAM(2); |
| 591 | pitch_ = 8; |
| 592 | bit_depth_ = GET_PARAM(3); |
| 593 | mask_ = (1 << bit_depth_) - 1; |
| 594 | } |
| 595 | |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 596 | virtual void TearDown() { libaom_test::ClearSystemState(); } |
Peter de Rivaz | 7e40a55 | 2014-10-24 08:48:02 +0100 | [diff] [blame] | 597 | |
| 598 | protected: |
| 599 | void RunInvTxfm(tran_low_t *out, uint8_t *dst, int stride) { |
| 600 | inv_txfm_(out, dst, stride); |
| 601 | } |
James Zern | cffef11 | 2016-02-11 18:27:00 -0800 | [diff] [blame] | 602 | void RunFwdTxfm(int16_t * /*out*/, tran_low_t * /*dst*/, int /*stride*/) {} |
Peter de Rivaz | 7e40a55 | 2014-10-24 08:48:02 +0100 | [diff] [blame] | 603 | |
| 604 | IdctFunc ref_txfm_; |
| 605 | IdctFunc inv_txfm_; |
| 606 | int thresh_; |
| 607 | }; |
| 608 | |
| 609 | TEST_P(InvTrans8x8DCT, CompareReference) { |
| 610 | CompareInvReference(ref_txfm_, thresh_); |
| 611 | } |
| 612 | |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 613 | using std::tr1::make_tuple; |
| 614 | |
Sebastien Alaiwan | 71e8784 | 2017-04-12 16:03:28 +0200 | [diff] [blame] | 615 | #if CONFIG_HIGHBITDEPTH |
Frederic Barbier | c756e4d | 2017-04-25 17:26:28 +0200 | [diff] [blame] | 616 | INSTANTIATE_TEST_CASE_P(C, FwdTrans8x8DCT, |
| 617 | ::testing::Values(make_tuple(&aom_fdct8x8_c, |
Urvang Joshi | 2283d37 | 2017-10-02 17:16:45 -0700 | [diff] [blame] | 618 | &aom_idct8x8_64_add_c, |
| 619 | DCT_DCT, AOM_BITS_8))); |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 620 | #else |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 621 | INSTANTIATE_TEST_CASE_P(C, FwdTrans8x8DCT, |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 622 | ::testing::Values(make_tuple(&aom_fdct8x8_c, |
Urvang Joshi | 2283d37 | 2017-10-02 17:16:45 -0700 | [diff] [blame] | 623 | &aom_idct8x8_64_add_c, |
| 624 | DCT_DCT, AOM_BITS_8))); |
Sebastien Alaiwan | 71e8784 | 2017-04-12 16:03:28 +0200 | [diff] [blame] | 625 | #endif // CONFIG_HIGHBITDEPTH |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 626 | |
Sebastien Alaiwan | 71e8784 | 2017-04-12 16:03:28 +0200 | [diff] [blame] | 627 | #if CONFIG_HIGHBITDEPTH |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 628 | INSTANTIATE_TEST_CASE_P( |
| 629 | C, FwdTrans8x8HT, |
| 630 | ::testing::Values( |
Urvang Joshi | 2283d37 | 2017-10-02 17:16:45 -0700 | [diff] [blame] | 631 | make_tuple(&av1_fht8x8_c, &av1_iht8x8_64_add_c, DCT_DCT, AOM_BITS_8), |
| 632 | make_tuple(&fht8x8_10, &iht8x8_10, DCT_DCT, AOM_BITS_10), |
| 633 | make_tuple(&fht8x8_10, &iht8x8_10, ADST_DCT, AOM_BITS_10), |
| 634 | make_tuple(&fht8x8_10, &iht8x8_10, DCT_ADST, AOM_BITS_10), |
| 635 | make_tuple(&fht8x8_10, &iht8x8_10, ADST_ADST, AOM_BITS_10), |
| 636 | make_tuple(&fht8x8_12, &iht8x8_12, DCT_DCT, AOM_BITS_12), |
| 637 | make_tuple(&fht8x8_12, &iht8x8_12, ADST_DCT, AOM_BITS_12), |
| 638 | make_tuple(&fht8x8_12, &iht8x8_12, DCT_ADST, AOM_BITS_12), |
| 639 | make_tuple(&fht8x8_12, &iht8x8_12, ADST_ADST, AOM_BITS_12), |
| 640 | make_tuple(&av1_fht8x8_c, &av1_iht8x8_64_add_c, ADST_DCT, AOM_BITS_8), |
| 641 | make_tuple(&av1_fht8x8_c, &av1_iht8x8_64_add_c, DCT_ADST, AOM_BITS_8), |
| 642 | make_tuple(&av1_fht8x8_c, &av1_iht8x8_64_add_c, ADST_ADST, |
| 643 | AOM_BITS_8))); |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 644 | #else |
James Zern | 615230b | 2014-12-01 15:10:00 -0800 | [diff] [blame] | 645 | INSTANTIATE_TEST_CASE_P( |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 646 | C, FwdTrans8x8HT, |
| 647 | ::testing::Values( |
Urvang Joshi | 2283d37 | 2017-10-02 17:16:45 -0700 | [diff] [blame] | 648 | make_tuple(&av1_fht8x8_c, &av1_iht8x8_64_add_c, DCT_DCT, AOM_BITS_8), |
| 649 | make_tuple(&av1_fht8x8_c, &av1_iht8x8_64_add_c, ADST_DCT, AOM_BITS_8), |
| 650 | make_tuple(&av1_fht8x8_c, &av1_iht8x8_64_add_c, DCT_ADST, AOM_BITS_8), |
| 651 | make_tuple(&av1_fht8x8_c, &av1_iht8x8_64_add_c, ADST_ADST, |
| 652 | AOM_BITS_8))); |
Sebastien Alaiwan | 71e8784 | 2017-04-12 16:03:28 +0200 | [diff] [blame] | 653 | #endif // CONFIG_HIGHBITDEPTH |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 654 | |
Sebastien Alaiwan | c6a48a2 | 2017-04-20 10:12:43 +0200 | [diff] [blame] | 655 | #if HAVE_NEON_ASM && !CONFIG_HIGHBITDEPTH |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 656 | INSTANTIATE_TEST_CASE_P(NEON, FwdTrans8x8DCT, |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 657 | ::testing::Values(make_tuple(&aom_fdct8x8_neon, |
| 658 | &aom_idct8x8_64_add_neon, |
Urvang Joshi | 2283d37 | 2017-10-02 17:16:45 -0700 | [diff] [blame] | 659 | DCT_DCT, AOM_BITS_8))); |
Sebastien Alaiwan | c6a48a2 | 2017-04-20 10:12:43 +0200 | [diff] [blame] | 660 | #endif // HAVE_NEON_ASM && !CONFIG_HIGHBITDEPTH |
James Yu | 4f856cd | 2014-01-29 01:31:07 +0800 | [diff] [blame] | 661 | |
Sebastien Alaiwan | c6a48a2 | 2017-04-20 10:12:43 +0200 | [diff] [blame] | 662 | #if HAVE_NEON && !CONFIG_HIGHBITDEPTH |
James Zern | c333110 | 2014-02-25 23:11:49 -0800 | [diff] [blame] | 663 | INSTANTIATE_TEST_CASE_P( |
Deb Mukherjee | 1fe643c | 2014-12-04 16:46:06 -0800 | [diff] [blame] | 664 | NEON, FwdTrans8x8HT, |
Urvang Joshi | 2283d37 | 2017-10-02 17:16:45 -0700 | [diff] [blame] | 665 | ::testing::Values(make_tuple(&av1_fht8x8_c, &av1_iht8x8_64_add_neon, |
| 666 | DCT_DCT, AOM_BITS_8), |
| 667 | make_tuple(&av1_fht8x8_c, &av1_iht8x8_64_add_neon, |
| 668 | ADST_DCT, AOM_BITS_8), |
| 669 | make_tuple(&av1_fht8x8_c, &av1_iht8x8_64_add_neon, |
| 670 | DCT_ADST, AOM_BITS_8), |
| 671 | make_tuple(&av1_fht8x8_c, &av1_iht8x8_64_add_neon, |
| 672 | ADST_ADST, AOM_BITS_8))); |
Sebastien Alaiwan | c6a48a2 | 2017-04-20 10:12:43 +0200 | [diff] [blame] | 673 | #endif // HAVE_NEON && !CONFIG_HIGHBITDEPTH |
James Zern | c333110 | 2014-02-25 23:11:49 -0800 | [diff] [blame] | 674 | |
Sebastien Alaiwan | c6a48a2 | 2017-04-20 10:12:43 +0200 | [diff] [blame] | 675 | #if HAVE_SSE2 && !CONFIG_HIGHBITDEPTH |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 676 | INSTANTIATE_TEST_CASE_P(SSE2, FwdTrans8x8DCT, |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 677 | ::testing::Values(make_tuple(&aom_fdct8x8_sse2, |
| 678 | &aom_idct8x8_64_add_sse2, |
Urvang Joshi | 2283d37 | 2017-10-02 17:16:45 -0700 | [diff] [blame] | 679 | DCT_DCT, AOM_BITS_8))); |
Nathan E. Egge | e554f36 | 2017-10-04 14:44:38 -0400 | [diff] [blame] | 680 | #if !CONFIG_DAALA_TX8 |
Jingning Han | 4bd1711 | 2013-09-16 16:01:50 -0700 | [diff] [blame] | 681 | INSTANTIATE_TEST_CASE_P( |
| 682 | SSE2, FwdTrans8x8HT, |
Urvang Joshi | 2283d37 | 2017-10-02 17:16:45 -0700 | [diff] [blame] | 683 | ::testing::Values(make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_sse2, |
| 684 | DCT_DCT, AOM_BITS_8), |
| 685 | make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_sse2, |
| 686 | ADST_DCT, AOM_BITS_8), |
| 687 | make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_sse2, |
| 688 | DCT_ADST, AOM_BITS_8), |
| 689 | make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_sse2, |
| 690 | ADST_ADST, AOM_BITS_8))); |
Nathan E. Egge | e554f36 | 2017-10-04 14:44:38 -0400 | [diff] [blame] | 691 | #endif // !CONFIG_DAALA_TX8 |
Sebastien Alaiwan | c6a48a2 | 2017-04-20 10:12:43 +0200 | [diff] [blame] | 692 | #endif // HAVE_SSE2 && !CONFIG_HIGHBITDEPTH |
Peter de Rivaz | 7e40a55 | 2014-10-24 08:48:02 +0100 | [diff] [blame] | 693 | |
Sebastien Alaiwan | c6a48a2 | 2017-04-20 10:12:43 +0200 | [diff] [blame] | 694 | #if HAVE_SSE2 && CONFIG_HIGHBITDEPTH |
James Zern | 4a2e3b2 | 2017-04-25 16:34:55 -0700 | [diff] [blame] | 695 | INSTANTIATE_TEST_CASE_P(SSE2, FwdTrans8x8DCT, |
| 696 | ::testing::Values(make_tuple(&aom_fdct8x8_sse2, |
Urvang Joshi | 2283d37 | 2017-10-02 17:16:45 -0700 | [diff] [blame] | 697 | &aom_idct8x8_64_add_c, |
| 698 | DCT_DCT, AOM_BITS_8))); |
Nathan E. Egge | e554f36 | 2017-10-04 14:44:38 -0400 | [diff] [blame] | 699 | #if !CONFIG_DAALA_TX8 |
James Zern | 615230b | 2014-12-01 15:10:00 -0800 | [diff] [blame] | 700 | INSTANTIATE_TEST_CASE_P( |
Peter de Rivaz | 7e40a55 | 2014-10-24 08:48:02 +0100 | [diff] [blame] | 701 | SSE2, FwdTrans8x8HT, |
Urvang Joshi | 2283d37 | 2017-10-02 17:16:45 -0700 | [diff] [blame] | 702 | ::testing::Values(make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_c, |
| 703 | DCT_DCT, AOM_BITS_8), |
| 704 | make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_c, |
| 705 | ADST_DCT, AOM_BITS_8), |
| 706 | make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_c, |
| 707 | DCT_ADST, AOM_BITS_8), |
| 708 | make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_c, |
| 709 | ADST_ADST, AOM_BITS_8))); |
Nathan E. Egge | e554f36 | 2017-10-04 14:44:38 -0400 | [diff] [blame] | 710 | #endif // !CONFIG_DAALA_TX8 |
Sebastien Alaiwan | c6a48a2 | 2017-04-20 10:12:43 +0200 | [diff] [blame] | 711 | #endif // HAVE_SSE2 && CONFIG_HIGHBITDEPTH |
Jingning Han | b466ad5 | 2014-05-08 09:56:38 -0700 | [diff] [blame] | 712 | |
Sebastien Alaiwan | c6a48a2 | 2017-04-20 10:12:43 +0200 | [diff] [blame] | 713 | #if HAVE_SSSE3 && ARCH_X86_64 |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 714 | INSTANTIATE_TEST_CASE_P(SSSE3, FwdTrans8x8DCT, |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 715 | ::testing::Values(make_tuple(&aom_fdct8x8_ssse3, |
| 716 | &aom_idct8x8_64_add_ssse3, |
Urvang Joshi | 2283d37 | 2017-10-02 17:16:45 -0700 | [diff] [blame] | 717 | DCT_DCT, AOM_BITS_8))); |
Jingning Han | b466ad5 | 2014-05-08 09:56:38 -0700 | [diff] [blame] | 718 | #endif |
Parag Salasakar | 7c5f00f | 2015-05-08 12:23:27 +0530 | [diff] [blame] | 719 | |
Sebastien Alaiwan | c6a48a2 | 2017-04-20 10:12:43 +0200 | [diff] [blame] | 720 | #if HAVE_MSA && !CONFIG_HIGHBITDEPTH |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 721 | INSTANTIATE_TEST_CASE_P(MSA, FwdTrans8x8DCT, |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 722 | ::testing::Values(make_tuple(&aom_fdct8x8_msa, |
Urvang Joshi | 2283d37 | 2017-10-02 17:16:45 -0700 | [diff] [blame] | 723 | &aom_idct8x8_64_add_msa, |
| 724 | DCT_DCT, AOM_BITS_8))); |
Sebastien Alaiwan | c6a48a2 | 2017-04-20 10:12:43 +0200 | [diff] [blame] | 725 | #endif // HAVE_MSA && !CONFIG_HIGHBITDEPTH |
Daniel Kang | 26641c7 | 2012-06-28 16:26:31 -0700 | [diff] [blame] | 726 | } // namespace |