Daniel Kang | 58156f1 | 2012-06-26 18:11:33 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2012 The WebM project authors. All Rights Reserved. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license |
| 5 | * that can be found in the LICENSE file in the root of the source |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
| 11 | #include <math.h> |
| 12 | #include <stdlib.h> |
| 13 | #include <string.h> |
| 14 | |
| 15 | #include "third_party/googletest/src/include/gtest/gtest.h" |
Jingning Han | 097d59c | 2015-07-29 14:51:36 -0700 | [diff] [blame] | 16 | |
| 17 | #include "./vp9_rtcd.h" |
| 18 | #include "./vpx_dsp_rtcd.h" |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 19 | #include "test/acm_random.h" |
| 20 | #include "test/clear_system_state.h" |
| 21 | #include "test/register_state_check.h" |
| 22 | #include "test/util.h" |
James Zern | 002ad40 | 2014-01-18 13:03:31 -0800 | [diff] [blame] | 23 | #include "vp9/common/vp9_entropy.h" |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 24 | #include "vpx/vpx_codec.h" |
James Zern | 002ad40 | 2014-01-18 13:03:31 -0800 | [diff] [blame] | 25 | #include "vpx/vpx_integer.h" |
Johann | 1d7ccd5 | 2015-05-11 19:09:22 -0700 | [diff] [blame] | 26 | #include "vpx_ports/mem.h" |
James Zern | 002ad40 | 2014-01-18 13:03:31 -0800 | [diff] [blame] | 27 | |
Daniel Kang | 26641c7 | 2012-06-28 16:26:31 -0700 | [diff] [blame] | 28 | using libvpx_test::ACMRandom; |
| 29 | |
Daniel Kang | 58156f1 | 2012-06-26 18:11:33 -0700 | [diff] [blame] | 30 | namespace { |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 31 | const int kNumCoeffs = 16; |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 32 | typedef void (*FdctFunc)(const int16_t *in, tran_low_t *out, int stride); |
| 33 | typedef void (*IdctFunc)(const tran_low_t *in, uint8_t *out, int stride); |
| 34 | typedef void (*FhtFunc)(const int16_t *in, tran_low_t *out, int stride, |
James Zern | b8b3dd9 | 2014-07-16 18:55:40 -0700 | [diff] [blame] | 35 | int tx_type); |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 36 | typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride, |
James Zern | b8b3dd9 | 2014-07-16 18:55:40 -0700 | [diff] [blame] | 37 | int tx_type); |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 38 | |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 39 | typedef std::tr1::tuple<FdctFunc, IdctFunc, int, vpx_bit_depth_t> Dct4x4Param; |
| 40 | typedef std::tr1::tuple<FhtFunc, IhtFunc, int, vpx_bit_depth_t> Ht4x4Param; |
Joshua Litt | 51490e5 | 2013-11-18 17:07:55 -0800 | [diff] [blame] | 41 | |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 42 | void fdct4x4_ref(const int16_t *in, tran_low_t *out, int stride, |
| 43 | int tx_type) { |
Jingning Han | 4b5109c | 2015-07-28 15:57:40 -0700 | [diff] [blame] | 44 | vpx_fdct4x4_c(in, out, stride); |
Jingning Han | 362809d | 2013-06-18 10:46:33 -0700 | [diff] [blame] | 45 | } |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 46 | |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 47 | void fht4x4_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) { |
Dmitry Kovalev | 005fc69 | 2014-02-06 11:54:15 -0800 | [diff] [blame] | 48 | vp9_fht4x4_c(in, out, stride, tx_type); |
Jingning Han | 362809d | 2013-06-18 10:46:33 -0700 | [diff] [blame] | 49 | } |
Daniel Kang | 58156f1 | 2012-06-26 18:11:33 -0700 | [diff] [blame] | 50 | |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 51 | void fwht4x4_ref(const int16_t *in, tran_low_t *out, int stride, |
| 52 | int tx_type) { |
Alex Converse | 9f9f87c | 2014-05-05 13:50:12 -0700 | [diff] [blame] | 53 | vp9_fwht4x4_c(in, out, stride); |
| 54 | } |
| 55 | |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 56 | #if CONFIG_VP9_HIGHBITDEPTH |
| 57 | void idct4x4_10(const tran_low_t *in, uint8_t *out, int stride) { |
Jingning Han | 08a453b | 2015-08-03 14:51:10 -0700 | [diff] [blame] | 58 | vpx_highbd_idct4x4_16_add_c(in, out, stride, 10); |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 59 | } |
| 60 | |
| 61 | void idct4x4_12(const tran_low_t *in, uint8_t *out, int stride) { |
Jingning Han | 08a453b | 2015-08-03 14:51:10 -0700 | [diff] [blame] | 62 | vpx_highbd_idct4x4_16_add_c(in, out, stride, 12); |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 63 | } |
| 64 | |
| 65 | void iht4x4_10(const tran_low_t *in, uint8_t *out, int stride, int tx_type) { |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 66 | vp9_highbd_iht4x4_16_add_c(in, out, stride, tx_type, 10); |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 67 | } |
| 68 | |
| 69 | void iht4x4_12(const tran_low_t *in, uint8_t *out, int stride, int tx_type) { |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 70 | vp9_highbd_iht4x4_16_add_c(in, out, stride, tx_type, 12); |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 71 | } |
| 72 | |
| 73 | void iwht4x4_10(const tran_low_t *in, uint8_t *out, int stride) { |
Jingning Han | 08a453b | 2015-08-03 14:51:10 -0700 | [diff] [blame] | 74 | vpx_highbd_iwht4x4_16_add_c(in, out, stride, 10); |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 75 | } |
| 76 | |
| 77 | void iwht4x4_12(const tran_low_t *in, uint8_t *out, int stride) { |
Jingning Han | 08a453b | 2015-08-03 14:51:10 -0700 | [diff] [blame] | 78 | vpx_highbd_iwht4x4_16_add_c(in, out, stride, 12); |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 79 | } |
Peter de Rivaz | 7e40a55 | 2014-10-24 08:48:02 +0100 | [diff] [blame] | 80 | |
| 81 | #if HAVE_SSE2 |
| 82 | void idct4x4_10_sse2(const tran_low_t *in, uint8_t *out, int stride) { |
Jingning Han | 08a453b | 2015-08-03 14:51:10 -0700 | [diff] [blame] | 83 | vpx_highbd_idct4x4_16_add_sse2(in, out, stride, 10); |
Peter de Rivaz | 7e40a55 | 2014-10-24 08:48:02 +0100 | [diff] [blame] | 84 | } |
| 85 | |
| 86 | void idct4x4_12_sse2(const tran_low_t *in, uint8_t *out, int stride) { |
Jingning Han | 08a453b | 2015-08-03 14:51:10 -0700 | [diff] [blame] | 87 | vpx_highbd_idct4x4_16_add_sse2(in, out, stride, 12); |
Peter de Rivaz | 7e40a55 | 2014-10-24 08:48:02 +0100 | [diff] [blame] | 88 | } |
| 89 | #endif // HAVE_SSE2 |
| 90 | #endif // CONFIG_VP9_HIGHBITDEPTH |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 91 | |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 92 | class Trans4x4TestBase { |
Jingning Han | 362809d | 2013-06-18 10:46:33 -0700 | [diff] [blame] | 93 | public: |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 94 | virtual ~Trans4x4TestBase() {} |
Jingning Han | 362809d | 2013-06-18 10:46:33 -0700 | [diff] [blame] | 95 | |
| 96 | protected: |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 97 | virtual void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) = 0; |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 98 | |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 99 | virtual void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) = 0; |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 100 | |
Alex Converse | 9f9f87c | 2014-05-05 13:50:12 -0700 | [diff] [blame] | 101 | void RunAccuracyCheck(int limit) { |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 102 | ACMRandom rnd(ACMRandom::DeterministicSeed()); |
| 103 | uint32_t max_error = 0; |
| 104 | int64_t total_error = 0; |
| 105 | const int count_test_block = 10000; |
| 106 | for (int i = 0; i < count_test_block; ++i) { |
James Zern | fd3658b | 2015-05-02 13:24:16 -0700 | [diff] [blame] | 107 | DECLARE_ALIGNED(16, int16_t, test_input_block[kNumCoeffs]); |
| 108 | DECLARE_ALIGNED(16, tran_low_t, test_temp_block[kNumCoeffs]); |
| 109 | DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]); |
| 110 | DECLARE_ALIGNED(16, uint8_t, src[kNumCoeffs]); |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 111 | #if CONFIG_VP9_HIGHBITDEPTH |
James Zern | fd3658b | 2015-05-02 13:24:16 -0700 | [diff] [blame] | 112 | DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]); |
| 113 | DECLARE_ALIGNED(16, uint16_t, src16[kNumCoeffs]); |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 114 | #endif |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 115 | |
| 116 | // Initialize a test block with input range [-255, 255]. |
| 117 | for (int j = 0; j < kNumCoeffs; ++j) { |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 118 | if (bit_depth_ == VPX_BITS_8) { |
| 119 | src[j] = rnd.Rand8(); |
| 120 | dst[j] = rnd.Rand8(); |
| 121 | test_input_block[j] = src[j] - dst[j]; |
| 122 | #if CONFIG_VP9_HIGHBITDEPTH |
| 123 | } else { |
| 124 | src16[j] = rnd.Rand16() & mask_; |
| 125 | dst16[j] = rnd.Rand16() & mask_; |
| 126 | test_input_block[j] = src16[j] - dst16[j]; |
| 127 | #endif |
| 128 | } |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 129 | } |
| 130 | |
James Zern | 29e1b1a | 2014-07-09 21:02:02 -0700 | [diff] [blame] | 131 | ASM_REGISTER_STATE_CHECK(RunFwdTxfm(test_input_block, |
| 132 | test_temp_block, pitch_)); |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 133 | if (bit_depth_ == VPX_BITS_8) { |
| 134 | ASM_REGISTER_STATE_CHECK(RunInvTxfm(test_temp_block, dst, pitch_)); |
| 135 | #if CONFIG_VP9_HIGHBITDEPTH |
| 136 | } else { |
| 137 | ASM_REGISTER_STATE_CHECK(RunInvTxfm(test_temp_block, |
| 138 | CONVERT_TO_BYTEPTR(dst16), pitch_)); |
| 139 | #endif |
| 140 | } |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 141 | |
| 142 | for (int j = 0; j < kNumCoeffs; ++j) { |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 143 | #if CONFIG_VP9_HIGHBITDEPTH |
| 144 | const uint32_t diff = |
| 145 | bit_depth_ == VPX_BITS_8 ? dst[j] - src[j] : dst16[j] - src16[j]; |
| 146 | #else |
James Zern | fd3658b | 2015-05-02 13:24:16 -0700 | [diff] [blame] | 147 | ASSERT_EQ(VPX_BITS_8, bit_depth_); |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 148 | const uint32_t diff = dst[j] - src[j]; |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 149 | #endif |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 150 | const uint32_t error = diff * diff; |
| 151 | if (max_error < error) |
| 152 | max_error = error; |
| 153 | total_error += error; |
| 154 | } |
| 155 | } |
| 156 | |
Alex Converse | 9f9f87c | 2014-05-05 13:50:12 -0700 | [diff] [blame] | 157 | EXPECT_GE(static_cast<uint32_t>(limit), max_error) |
| 158 | << "Error: 4x4 FHT/IHT has an individual round trip error > " |
| 159 | << limit; |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 160 | |
Alex Converse | 9f9f87c | 2014-05-05 13:50:12 -0700 | [diff] [blame] | 161 | EXPECT_GE(count_test_block * limit, total_error) |
| 162 | << "Error: 4x4 FHT/IHT has average round trip error > " << limit |
| 163 | << " per block"; |
Jingning Han | 362809d | 2013-06-18 10:46:33 -0700 | [diff] [blame] | 164 | } |
| 165 | |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 166 | void RunCoeffCheck() { |
| 167 | ACMRandom rnd(ACMRandom::DeterministicSeed()); |
| 168 | const int count_test_block = 5000; |
James Zern | fd3658b | 2015-05-02 13:24:16 -0700 | [diff] [blame] | 169 | DECLARE_ALIGNED(16, int16_t, input_block[kNumCoeffs]); |
| 170 | DECLARE_ALIGNED(16, tran_low_t, output_ref_block[kNumCoeffs]); |
| 171 | DECLARE_ALIGNED(16, tran_low_t, output_block[kNumCoeffs]); |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 172 | |
| 173 | for (int i = 0; i < count_test_block; ++i) { |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 174 | // Initialize a test block with input range [-mask_, mask_]. |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 175 | for (int j = 0; j < kNumCoeffs; ++j) |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 176 | input_block[j] = (rnd.Rand16() & mask_) - (rnd.Rand16() & mask_); |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 177 | |
| 178 | fwd_txfm_ref(input_block, output_ref_block, pitch_, tx_type_); |
James Zern | 29e1b1a | 2014-07-09 21:02:02 -0700 | [diff] [blame] | 179 | ASM_REGISTER_STATE_CHECK(RunFwdTxfm(input_block, output_block, pitch_)); |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 180 | |
| 181 | // The minimum quant value is 4. |
| 182 | for (int j = 0; j < kNumCoeffs; ++j) |
| 183 | EXPECT_EQ(output_block[j], output_ref_block[j]); |
| 184 | } |
Jingning Han | 362809d | 2013-06-18 10:46:33 -0700 | [diff] [blame] | 185 | } |
| 186 | |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 187 | void RunMemCheck() { |
| 188 | ACMRandom rnd(ACMRandom::DeterministicSeed()); |
| 189 | const int count_test_block = 5000; |
James Zern | fd3658b | 2015-05-02 13:24:16 -0700 | [diff] [blame] | 190 | DECLARE_ALIGNED(16, int16_t, input_extreme_block[kNumCoeffs]); |
| 191 | DECLARE_ALIGNED(16, tran_low_t, output_ref_block[kNumCoeffs]); |
| 192 | DECLARE_ALIGNED(16, tran_low_t, output_block[kNumCoeffs]); |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 193 | |
| 194 | for (int i = 0; i < count_test_block; ++i) { |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 195 | // Initialize a test block with input range [-mask_, mask_]. |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 196 | for (int j = 0; j < kNumCoeffs; ++j) { |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 197 | input_extreme_block[j] = rnd.Rand8() % 2 ? mask_ : -mask_; |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 198 | } |
Jingning Han | 5c2696c | 2014-06-02 16:40:01 -0700 | [diff] [blame] | 199 | if (i == 0) { |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 200 | for (int j = 0; j < kNumCoeffs; ++j) |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 201 | input_extreme_block[j] = mask_; |
Jingning Han | 5c2696c | 2014-06-02 16:40:01 -0700 | [diff] [blame] | 202 | } else if (i == 1) { |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 203 | for (int j = 0; j < kNumCoeffs; ++j) |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 204 | input_extreme_block[j] = -mask_; |
Jingning Han | 5c2696c | 2014-06-02 16:40:01 -0700 | [diff] [blame] | 205 | } |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 206 | |
| 207 | fwd_txfm_ref(input_extreme_block, output_ref_block, pitch_, tx_type_); |
James Zern | 29e1b1a | 2014-07-09 21:02:02 -0700 | [diff] [blame] | 208 | ASM_REGISTER_STATE_CHECK(RunFwdTxfm(input_extreme_block, |
| 209 | output_block, pitch_)); |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 210 | |
| 211 | // The minimum quant value is 4. |
| 212 | for (int j = 0; j < kNumCoeffs; ++j) { |
| 213 | EXPECT_EQ(output_block[j], output_ref_block[j]); |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 214 | EXPECT_GE(4 * DCT_MAX_VALUE << (bit_depth_ - 8), abs(output_block[j])) |
| 215 | << "Error: 4x4 FDCT has coefficient larger than 4*DCT_MAX_VALUE"; |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 216 | } |
| 217 | } |
| 218 | } |
| 219 | |
Alex Converse | 9f9f87c | 2014-05-05 13:50:12 -0700 | [diff] [blame] | 220 | void RunInvAccuracyCheck(int limit) { |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 221 | ACMRandom rnd(ACMRandom::DeterministicSeed()); |
| 222 | const int count_test_block = 1000; |
James Zern | fd3658b | 2015-05-02 13:24:16 -0700 | [diff] [blame] | 223 | DECLARE_ALIGNED(16, int16_t, in[kNumCoeffs]); |
| 224 | DECLARE_ALIGNED(16, tran_low_t, coeff[kNumCoeffs]); |
| 225 | DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]); |
| 226 | DECLARE_ALIGNED(16, uint8_t, src[kNumCoeffs]); |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 227 | #if CONFIG_VP9_HIGHBITDEPTH |
James Zern | fd3658b | 2015-05-02 13:24:16 -0700 | [diff] [blame] | 228 | DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]); |
| 229 | DECLARE_ALIGNED(16, uint16_t, src16[kNumCoeffs]); |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 230 | #endif |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 231 | |
| 232 | for (int i = 0; i < count_test_block; ++i) { |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 233 | // Initialize a test block with input range [-mask_, mask_]. |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 234 | for (int j = 0; j < kNumCoeffs; ++j) { |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 235 | if (bit_depth_ == VPX_BITS_8) { |
| 236 | src[j] = rnd.Rand8(); |
| 237 | dst[j] = rnd.Rand8(); |
| 238 | in[j] = src[j] - dst[j]; |
| 239 | #if CONFIG_VP9_HIGHBITDEPTH |
| 240 | } else { |
| 241 | src16[j] = rnd.Rand16() & mask_; |
| 242 | dst16[j] = rnd.Rand16() & mask_; |
| 243 | in[j] = src16[j] - dst16[j]; |
| 244 | #endif |
| 245 | } |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 246 | } |
| 247 | |
| 248 | fwd_txfm_ref(in, coeff, pitch_, tx_type_); |
| 249 | |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 250 | if (bit_depth_ == VPX_BITS_8) { |
| 251 | ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, dst, pitch_)); |
| 252 | #if CONFIG_VP9_HIGHBITDEPTH |
| 253 | } else { |
| 254 | ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, CONVERT_TO_BYTEPTR(dst16), |
| 255 | pitch_)); |
| 256 | #endif |
| 257 | } |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 258 | |
| 259 | for (int j = 0; j < kNumCoeffs; ++j) { |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 260 | #if CONFIG_VP9_HIGHBITDEPTH |
| 261 | const uint32_t diff = |
| 262 | bit_depth_ == VPX_BITS_8 ? dst[j] - src[j] : dst16[j] - src16[j]; |
| 263 | #else |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 264 | const uint32_t diff = dst[j] - src[j]; |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 265 | #endif |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 266 | const uint32_t error = diff * diff; |
Alex Converse | 9f9f87c | 2014-05-05 13:50:12 -0700 | [diff] [blame] | 267 | EXPECT_GE(static_cast<uint32_t>(limit), error) |
| 268 | << "Error: 4x4 IDCT has error " << error |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 269 | << " at index " << j; |
| 270 | } |
| 271 | } |
| 272 | } |
| 273 | |
| 274 | int pitch_; |
Jingning Han | ab36262 | 2013-06-21 11:45:47 -0700 | [diff] [blame] | 275 | int tx_type_; |
James Zern | b8b3dd9 | 2014-07-16 18:55:40 -0700 | [diff] [blame] | 276 | FhtFunc fwd_txfm_ref; |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 277 | vpx_bit_depth_t bit_depth_; |
| 278 | int mask_; |
Jingning Han | 362809d | 2013-06-18 10:46:33 -0700 | [diff] [blame] | 279 | }; |
| 280 | |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 281 | class Trans4x4DCT |
| 282 | : public Trans4x4TestBase, |
James Zern | b8b3dd9 | 2014-07-16 18:55:40 -0700 | [diff] [blame] | 283 | public ::testing::TestWithParam<Dct4x4Param> { |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 284 | public: |
| 285 | virtual ~Trans4x4DCT() {} |
Daniel Kang | 58156f1 | 2012-06-26 18:11:33 -0700 | [diff] [blame] | 286 | |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 287 | virtual void SetUp() { |
| 288 | fwd_txfm_ = GET_PARAM(0); |
| 289 | inv_txfm_ = GET_PARAM(1); |
| 290 | tx_type_ = GET_PARAM(2); |
| 291 | pitch_ = 4; |
| 292 | fwd_txfm_ref = fdct4x4_ref; |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 293 | bit_depth_ = GET_PARAM(3); |
| 294 | mask_ = (1 << bit_depth_) - 1; |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 295 | } |
| 296 | virtual void TearDown() { libvpx_test::ClearSystemState(); } |
Daniel Kang | 58156f1 | 2012-06-26 18:11:33 -0700 | [diff] [blame] | 297 | |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 298 | protected: |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 299 | void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) { |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 300 | fwd_txfm_(in, out, stride); |
| 301 | } |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 302 | void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) { |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 303 | inv_txfm_(out, dst, stride); |
Daniel Kang | 58156f1 | 2012-06-26 18:11:33 -0700 | [diff] [blame] | 304 | } |
| 305 | |
James Zern | b8b3dd9 | 2014-07-16 18:55:40 -0700 | [diff] [blame] | 306 | FdctFunc fwd_txfm_; |
| 307 | IdctFunc inv_txfm_; |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 308 | }; |
Daniel Kang | 58156f1 | 2012-06-26 18:11:33 -0700 | [diff] [blame] | 309 | |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 310 | TEST_P(Trans4x4DCT, AccuracyCheck) { |
Alex Converse | 9f9f87c | 2014-05-05 13:50:12 -0700 | [diff] [blame] | 311 | RunAccuracyCheck(1); |
Jingning Han | 362809d | 2013-06-18 10:46:33 -0700 | [diff] [blame] | 312 | } |
Daniel Kang | 58156f1 | 2012-06-26 18:11:33 -0700 | [diff] [blame] | 313 | |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 314 | TEST_P(Trans4x4DCT, CoeffCheck) { |
| 315 | RunCoeffCheck(); |
Jingning Han | 362809d | 2013-06-18 10:46:33 -0700 | [diff] [blame] | 316 | } |
Daniel Kang | 58156f1 | 2012-06-26 18:11:33 -0700 | [diff] [blame] | 317 | |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 318 | TEST_P(Trans4x4DCT, MemCheck) { |
| 319 | RunMemCheck(); |
| 320 | } |
| 321 | |
| 322 | TEST_P(Trans4x4DCT, InvAccuracyCheck) { |
Alex Converse | 9f9f87c | 2014-05-05 13:50:12 -0700 | [diff] [blame] | 323 | RunInvAccuracyCheck(1); |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 324 | } |
| 325 | |
| 326 | class Trans4x4HT |
| 327 | : public Trans4x4TestBase, |
James Zern | b8b3dd9 | 2014-07-16 18:55:40 -0700 | [diff] [blame] | 328 | public ::testing::TestWithParam<Ht4x4Param> { |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 329 | public: |
| 330 | virtual ~Trans4x4HT() {} |
| 331 | |
| 332 | virtual void SetUp() { |
| 333 | fwd_txfm_ = GET_PARAM(0); |
| 334 | inv_txfm_ = GET_PARAM(1); |
| 335 | tx_type_ = GET_PARAM(2); |
| 336 | pitch_ = 4; |
| 337 | fwd_txfm_ref = fht4x4_ref; |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 338 | bit_depth_ = GET_PARAM(3); |
| 339 | mask_ = (1 << bit_depth_) - 1; |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 340 | } |
| 341 | virtual void TearDown() { libvpx_test::ClearSystemState(); } |
| 342 | |
| 343 | protected: |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 344 | void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) { |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 345 | fwd_txfm_(in, out, stride, tx_type_); |
| 346 | } |
| 347 | |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 348 | void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) { |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 349 | inv_txfm_(out, dst, stride, tx_type_); |
| 350 | } |
| 351 | |
James Zern | b8b3dd9 | 2014-07-16 18:55:40 -0700 | [diff] [blame] | 352 | FhtFunc fwd_txfm_; |
| 353 | IhtFunc inv_txfm_; |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 354 | }; |
| 355 | |
| 356 | TEST_P(Trans4x4HT, AccuracyCheck) { |
Alex Converse | 9f9f87c | 2014-05-05 13:50:12 -0700 | [diff] [blame] | 357 | RunAccuracyCheck(1); |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 358 | } |
| 359 | |
| 360 | TEST_P(Trans4x4HT, CoeffCheck) { |
| 361 | RunCoeffCheck(); |
| 362 | } |
| 363 | |
| 364 | TEST_P(Trans4x4HT, MemCheck) { |
| 365 | RunMemCheck(); |
| 366 | } |
| 367 | |
| 368 | TEST_P(Trans4x4HT, InvAccuracyCheck) { |
Alex Converse | 9f9f87c | 2014-05-05 13:50:12 -0700 | [diff] [blame] | 369 | RunInvAccuracyCheck(1); |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 370 | } |
| 371 | |
Alex Converse | 9f9f87c | 2014-05-05 13:50:12 -0700 | [diff] [blame] | 372 | class Trans4x4WHT |
| 373 | : public Trans4x4TestBase, |
James Zern | b8b3dd9 | 2014-07-16 18:55:40 -0700 | [diff] [blame] | 374 | public ::testing::TestWithParam<Dct4x4Param> { |
Alex Converse | 9f9f87c | 2014-05-05 13:50:12 -0700 | [diff] [blame] | 375 | public: |
| 376 | virtual ~Trans4x4WHT() {} |
| 377 | |
| 378 | virtual void SetUp() { |
| 379 | fwd_txfm_ = GET_PARAM(0); |
| 380 | inv_txfm_ = GET_PARAM(1); |
| 381 | tx_type_ = GET_PARAM(2); |
| 382 | pitch_ = 4; |
| 383 | fwd_txfm_ref = fwht4x4_ref; |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 384 | bit_depth_ = GET_PARAM(3); |
| 385 | mask_ = (1 << bit_depth_) - 1; |
Alex Converse | 9f9f87c | 2014-05-05 13:50:12 -0700 | [diff] [blame] | 386 | } |
| 387 | virtual void TearDown() { libvpx_test::ClearSystemState(); } |
| 388 | |
| 389 | protected: |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 390 | void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) { |
Alex Converse | 9f9f87c | 2014-05-05 13:50:12 -0700 | [diff] [blame] | 391 | fwd_txfm_(in, out, stride); |
| 392 | } |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 393 | void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) { |
Alex Converse | 9f9f87c | 2014-05-05 13:50:12 -0700 | [diff] [blame] | 394 | inv_txfm_(out, dst, stride); |
| 395 | } |
| 396 | |
James Zern | b8b3dd9 | 2014-07-16 18:55:40 -0700 | [diff] [blame] | 397 | FdctFunc fwd_txfm_; |
| 398 | IdctFunc inv_txfm_; |
Alex Converse | 9f9f87c | 2014-05-05 13:50:12 -0700 | [diff] [blame] | 399 | }; |
| 400 | |
| 401 | TEST_P(Trans4x4WHT, AccuracyCheck) { |
| 402 | RunAccuracyCheck(0); |
| 403 | } |
| 404 | |
| 405 | TEST_P(Trans4x4WHT, CoeffCheck) { |
| 406 | RunCoeffCheck(); |
| 407 | } |
| 408 | |
| 409 | TEST_P(Trans4x4WHT, MemCheck) { |
| 410 | RunMemCheck(); |
| 411 | } |
| 412 | |
| 413 | TEST_P(Trans4x4WHT, InvAccuracyCheck) { |
| 414 | RunInvAccuracyCheck(0); |
| 415 | } |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 416 | using std::tr1::make_tuple; |
| 417 | |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 418 | #if CONFIG_VP9_HIGHBITDEPTH |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 419 | INSTANTIATE_TEST_CASE_P( |
| 420 | C, Trans4x4DCT, |
| 421 | ::testing::Values( |
Jingning Han | 4b5109c | 2015-07-28 15:57:40 -0700 | [diff] [blame] | 422 | make_tuple(&vpx_highbd_fdct4x4_c, &idct4x4_10, 0, VPX_BITS_10), |
| 423 | make_tuple(&vpx_highbd_fdct4x4_c, &idct4x4_12, 0, VPX_BITS_12), |
Jingning Han | 08a453b | 2015-08-03 14:51:10 -0700 | [diff] [blame] | 424 | make_tuple(&vpx_fdct4x4_c, &vpx_idct4x4_16_add_c, 0, VPX_BITS_8))); |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 425 | #else |
| 426 | INSTANTIATE_TEST_CASE_P( |
| 427 | C, Trans4x4DCT, |
| 428 | ::testing::Values( |
Jingning Han | 08a453b | 2015-08-03 14:51:10 -0700 | [diff] [blame] | 429 | make_tuple(&vpx_fdct4x4_c, &vpx_idct4x4_16_add_c, 0, VPX_BITS_8))); |
Peter de Rivaz | 7e40a55 | 2014-10-24 08:48:02 +0100 | [diff] [blame] | 430 | #endif // CONFIG_VP9_HIGHBITDEPTH |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 431 | |
| 432 | #if CONFIG_VP9_HIGHBITDEPTH |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 433 | INSTANTIATE_TEST_CASE_P( |
| 434 | C, Trans4x4HT, |
| 435 | ::testing::Values( |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 436 | make_tuple(&vp9_highbd_fht4x4_c, &iht4x4_10, 0, VPX_BITS_10), |
| 437 | make_tuple(&vp9_highbd_fht4x4_c, &iht4x4_10, 1, VPX_BITS_10), |
| 438 | make_tuple(&vp9_highbd_fht4x4_c, &iht4x4_10, 2, VPX_BITS_10), |
| 439 | make_tuple(&vp9_highbd_fht4x4_c, &iht4x4_10, 3, VPX_BITS_10), |
| 440 | make_tuple(&vp9_highbd_fht4x4_c, &iht4x4_12, 0, VPX_BITS_12), |
| 441 | make_tuple(&vp9_highbd_fht4x4_c, &iht4x4_12, 1, VPX_BITS_12), |
| 442 | make_tuple(&vp9_highbd_fht4x4_c, &iht4x4_12, 2, VPX_BITS_12), |
| 443 | make_tuple(&vp9_highbd_fht4x4_c, &iht4x4_12, 3, VPX_BITS_12), |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 444 | make_tuple(&vp9_fht4x4_c, &vp9_iht4x4_16_add_c, 0, VPX_BITS_8), |
| 445 | make_tuple(&vp9_fht4x4_c, &vp9_iht4x4_16_add_c, 1, VPX_BITS_8), |
| 446 | make_tuple(&vp9_fht4x4_c, &vp9_iht4x4_16_add_c, 2, VPX_BITS_8), |
| 447 | make_tuple(&vp9_fht4x4_c, &vp9_iht4x4_16_add_c, 3, VPX_BITS_8))); |
| 448 | #else |
| 449 | INSTANTIATE_TEST_CASE_P( |
| 450 | C, Trans4x4HT, |
| 451 | ::testing::Values( |
| 452 | make_tuple(&vp9_fht4x4_c, &vp9_iht4x4_16_add_c, 0, VPX_BITS_8), |
| 453 | make_tuple(&vp9_fht4x4_c, &vp9_iht4x4_16_add_c, 1, VPX_BITS_8), |
| 454 | make_tuple(&vp9_fht4x4_c, &vp9_iht4x4_16_add_c, 2, VPX_BITS_8), |
| 455 | make_tuple(&vp9_fht4x4_c, &vp9_iht4x4_16_add_c, 3, VPX_BITS_8))); |
Peter de Rivaz | 7e40a55 | 2014-10-24 08:48:02 +0100 | [diff] [blame] | 456 | #endif // CONFIG_VP9_HIGHBITDEPTH |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 457 | |
| 458 | #if CONFIG_VP9_HIGHBITDEPTH |
Alex Converse | 9f9f87c | 2014-05-05 13:50:12 -0700 | [diff] [blame] | 459 | INSTANTIATE_TEST_CASE_P( |
| 460 | C, Trans4x4WHT, |
| 461 | ::testing::Values( |
Deb Mukherjee | 1929c9b | 2014-10-08 12:43:22 -0700 | [diff] [blame] | 462 | make_tuple(&vp9_highbd_fwht4x4_c, &iwht4x4_10, 0, VPX_BITS_10), |
| 463 | make_tuple(&vp9_highbd_fwht4x4_c, &iwht4x4_12, 0, VPX_BITS_12), |
Jingning Han | 08a453b | 2015-08-03 14:51:10 -0700 | [diff] [blame] | 464 | make_tuple(&vp9_fwht4x4_c, &vpx_iwht4x4_16_add_c, 0, VPX_BITS_8))); |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 465 | #else |
| 466 | INSTANTIATE_TEST_CASE_P( |
| 467 | C, Trans4x4WHT, |
| 468 | ::testing::Values( |
Jingning Han | 08a453b | 2015-08-03 14:51:10 -0700 | [diff] [blame] | 469 | make_tuple(&vp9_fwht4x4_c, &vpx_iwht4x4_16_add_c, 0, VPX_BITS_8))); |
Peter de Rivaz | 7e40a55 | 2014-10-24 08:48:02 +0100 | [diff] [blame] | 470 | #endif // CONFIG_VP9_HIGHBITDEPTH |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 471 | |
Deb Mukherjee | d50716f | 2014-10-02 15:43:27 -0700 | [diff] [blame] | 472 | #if HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE |
James Zern | 08c3180 | 2014-02-25 23:11:49 -0800 | [diff] [blame] | 473 | INSTANTIATE_TEST_CASE_P( |
| 474 | NEON, Trans4x4DCT, |
| 475 | ::testing::Values( |
Jingning Han | 4b5109c | 2015-07-28 15:57:40 -0700 | [diff] [blame] | 476 | make_tuple(&vpx_fdct4x4_c, |
Jingning Han | 08a453b | 2015-08-03 14:51:10 -0700 | [diff] [blame] | 477 | &vpx_idct4x4_16_add_neon, 0, VPX_BITS_8))); |
James Yu | 6b71013 | 2014-01-27 18:38:35 +0800 | [diff] [blame] | 478 | #endif // HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE |
| 479 | |
| 480 | #if HAVE_NEON && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE |
James Zern | 08c3180 | 2014-02-25 23:11:49 -0800 | [diff] [blame] | 481 | INSTANTIATE_TEST_CASE_P( |
James Yu | 6b71013 | 2014-01-27 18:38:35 +0800 | [diff] [blame] | 482 | NEON, Trans4x4HT, |
James Zern | 08c3180 | 2014-02-25 23:11:49 -0800 | [diff] [blame] | 483 | ::testing::Values( |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 484 | make_tuple(&vp9_fht4x4_c, &vp9_iht4x4_16_add_neon, 0, VPX_BITS_8), |
| 485 | make_tuple(&vp9_fht4x4_c, &vp9_iht4x4_16_add_neon, 1, VPX_BITS_8), |
| 486 | make_tuple(&vp9_fht4x4_c, &vp9_iht4x4_16_add_neon, 2, VPX_BITS_8), |
| 487 | make_tuple(&vp9_fht4x4_c, &vp9_iht4x4_16_add_neon, 3, VPX_BITS_8))); |
James Yu | 6b71013 | 2014-01-27 18:38:35 +0800 | [diff] [blame] | 488 | #endif // HAVE_NEON && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE |
James Zern | 08c3180 | 2014-02-25 23:11:49 -0800 | [diff] [blame] | 489 | |
Deb Mukherjee | d50716f | 2014-10-02 15:43:27 -0700 | [diff] [blame] | 490 | #if CONFIG_USE_X86INC && HAVE_MMX && !CONFIG_VP9_HIGHBITDEPTH && \ |
| 491 | !CONFIG_EMULATE_HARDWARE |
Alex Converse | b5422fa | 2014-05-07 12:51:11 -0700 | [diff] [blame] | 492 | INSTANTIATE_TEST_CASE_P( |
| 493 | MMX, Trans4x4WHT, |
| 494 | ::testing::Values( |
Jingning Han | 08a453b | 2015-08-03 14:51:10 -0700 | [diff] [blame] | 495 | make_tuple(&vp9_fwht4x4_mmx, &vpx_iwht4x4_16_add_c, 0, VPX_BITS_8))); |
Alex Converse | b5422fa | 2014-05-07 12:51:11 -0700 | [diff] [blame] | 496 | #endif |
| 497 | |
Alex Converse | d8426d6 | 2015-07-13 11:12:45 -0700 | [diff] [blame] | 498 | #if CONFIG_USE_X86INC && HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && \ |
| 499 | !CONFIG_EMULATE_HARDWARE |
| 500 | INSTANTIATE_TEST_CASE_P( |
| 501 | SSE2, Trans4x4WHT, |
| 502 | ::testing::Values( |
Jingning Han | 08a453b | 2015-08-03 14:51:10 -0700 | [diff] [blame] | 503 | make_tuple(&vp9_fwht4x4_c, &vpx_iwht4x4_16_add_sse2, 0, VPX_BITS_8))); |
Alex Converse | d8426d6 | 2015-07-13 11:12:45 -0700 | [diff] [blame] | 504 | #endif |
| 505 | |
Deb Mukherjee | d50716f | 2014-10-02 15:43:27 -0700 | [diff] [blame] | 506 | #if HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 507 | INSTANTIATE_TEST_CASE_P( |
| 508 | SSE2, Trans4x4DCT, |
| 509 | ::testing::Values( |
Jingning Han | 4b5109c | 2015-07-28 15:57:40 -0700 | [diff] [blame] | 510 | make_tuple(&vpx_fdct4x4_sse2, |
Jingning Han | 08a453b | 2015-08-03 14:51:10 -0700 | [diff] [blame] | 511 | &vpx_idct4x4_16_add_sse2, 0, VPX_BITS_8))); |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 512 | INSTANTIATE_TEST_CASE_P( |
| 513 | SSE2, Trans4x4HT, |
| 514 | ::testing::Values( |
Deb Mukherjee | 10783d4 | 2014-09-02 16:34:09 -0700 | [diff] [blame] | 515 | make_tuple(&vp9_fht4x4_sse2, &vp9_iht4x4_16_add_sse2, 0, VPX_BITS_8), |
| 516 | make_tuple(&vp9_fht4x4_sse2, &vp9_iht4x4_16_add_sse2, 1, VPX_BITS_8), |
| 517 | make_tuple(&vp9_fht4x4_sse2, &vp9_iht4x4_16_add_sse2, 2, VPX_BITS_8), |
| 518 | make_tuple(&vp9_fht4x4_sse2, &vp9_iht4x4_16_add_sse2, 3, VPX_BITS_8))); |
Peter de Rivaz | 7e40a55 | 2014-10-24 08:48:02 +0100 | [diff] [blame] | 519 | #endif // HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE |
Jingning Han | 30d4c5e | 2013-11-12 12:47:32 -0800 | [diff] [blame] | 520 | |
Peter de Rivaz | 7e40a55 | 2014-10-24 08:48:02 +0100 | [diff] [blame] | 521 | #if HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE |
| 522 | INSTANTIATE_TEST_CASE_P( |
| 523 | SSE2, Trans4x4DCT, |
| 524 | ::testing::Values( |
Jingning Han | 4b5109c | 2015-07-28 15:57:40 -0700 | [diff] [blame] | 525 | make_tuple(&vpx_highbd_fdct4x4_c, &idct4x4_10_sse2, 0, VPX_BITS_10), |
| 526 | make_tuple(&vpx_highbd_fdct4x4_sse2, &idct4x4_10_sse2, 0, VPX_BITS_10), |
| 527 | make_tuple(&vpx_highbd_fdct4x4_c, &idct4x4_12_sse2, 0, VPX_BITS_12), |
| 528 | make_tuple(&vpx_highbd_fdct4x4_sse2, &idct4x4_12_sse2, 0, VPX_BITS_12), |
Jingning Han | 08a453b | 2015-08-03 14:51:10 -0700 | [diff] [blame] | 529 | make_tuple(&vpx_fdct4x4_sse2, &vpx_idct4x4_16_add_c, 0, |
Peter de Rivaz | 7e40a55 | 2014-10-24 08:48:02 +0100 | [diff] [blame] | 530 | VPX_BITS_8))); |
| 531 | |
| 532 | INSTANTIATE_TEST_CASE_P( |
| 533 | SSE2, Trans4x4HT, |
| 534 | ::testing::Values( |
Peter de Rivaz | 7e40a55 | 2014-10-24 08:48:02 +0100 | [diff] [blame] | 535 | make_tuple(&vp9_fht4x4_sse2, &vp9_iht4x4_16_add_c, 0, VPX_BITS_8), |
| 536 | make_tuple(&vp9_fht4x4_sse2, &vp9_iht4x4_16_add_c, 1, VPX_BITS_8), |
| 537 | make_tuple(&vp9_fht4x4_sse2, &vp9_iht4x4_16_add_c, 2, VPX_BITS_8), |
| 538 | make_tuple(&vp9_fht4x4_sse2, &vp9_iht4x4_16_add_c, 3, VPX_BITS_8))); |
| 539 | #endif // HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE |
Parag Salasakar | 54a6f73 | 2015-06-02 12:16:28 +0530 | [diff] [blame] | 540 | |
Jingning Han | 9aaf523 | 2015-07-22 11:53:21 -0700 | [diff] [blame] | 541 | #if HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE |
Parag Salasakar | 54a6f73 | 2015-06-02 12:16:28 +0530 | [diff] [blame] | 542 | INSTANTIATE_TEST_CASE_P( |
| 543 | MSA, Trans4x4DCT, |
| 544 | ::testing::Values( |
Jingning Han | 08a453b | 2015-08-03 14:51:10 -0700 | [diff] [blame] | 545 | make_tuple(&vpx_fdct4x4_msa, &vpx_idct4x4_16_add_msa, 0, VPX_BITS_8))); |
Parag Salasakar | 54a6f73 | 2015-06-02 12:16:28 +0530 | [diff] [blame] | 546 | INSTANTIATE_TEST_CASE_P( |
| 547 | MSA, Trans4x4HT, |
| 548 | ::testing::Values( |
Parag Salasakar | bc94999 | 2015-06-22 14:30:24 +0530 | [diff] [blame] | 549 | make_tuple(&vp9_fht4x4_msa, &vp9_iht4x4_16_add_msa, 0, VPX_BITS_8), |
| 550 | make_tuple(&vp9_fht4x4_msa, &vp9_iht4x4_16_add_msa, 1, VPX_BITS_8), |
| 551 | make_tuple(&vp9_fht4x4_msa, &vp9_iht4x4_16_add_msa, 2, VPX_BITS_8), |
| 552 | make_tuple(&vp9_fht4x4_msa, &vp9_iht4x4_16_add_msa, 3, VPX_BITS_8))); |
Parag Salasakar | 54a6f73 | 2015-06-02 12:16:28 +0530 | [diff] [blame] | 553 | #endif // HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE |
Daniel Kang | 58156f1 | 2012-06-26 18:11:33 -0700 | [diff] [blame] | 554 | } // namespace |