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