Linfeng Zhang | 0ba23e8 | 2017-12-20 16:27:28 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2017, Alliance for Open Media. All rights reserved |
| 3 | * |
| 4 | * This source code is subject to the terms of the BSD 2 Clause License and |
| 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License |
| 6 | * was not distributed with this source code in the LICENSE file, you can |
| 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open |
| 8 | * Media Patent License 1.0 was not distributed with this source code in the |
| 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. |
| 10 | */ |
| 11 | |
| 12 | #include <stdint.h> |
| 13 | #include <stdio.h> |
| 14 | #include <string.h> |
sarahparker | a543df5 | 2018-11-02 16:02:05 -0700 | [diff] [blame] | 15 | #include <tuple> |
Linfeng Zhang | 0ba23e8 | 2017-12-20 16:27:28 -0800 | [diff] [blame] | 16 | |
| 17 | #include "third_party/googletest/src/googletest/include/gtest/gtest.h" |
| 18 | |
Tom Finegan | 60e653d | 2018-05-22 11:34:58 -0700 | [diff] [blame] | 19 | #include "config/aom_config.h" |
Tom Finegan | 44702c8 | 2018-05-22 13:00:39 -0700 | [diff] [blame] | 20 | #include "config/av1_rtcd.h" |
Tom Finegan | 60e653d | 2018-05-22 11:34:58 -0700 | [diff] [blame] | 21 | |
Linfeng Zhang | 0ba23e8 | 2017-12-20 16:27:28 -0800 | [diff] [blame] | 22 | #include "aom_ports/aom_timer.h" |
| 23 | #include "aom_ports/mem.h" |
Wan-Teh Chang | f2d15ee | 2020-03-10 09:24:43 -0700 | [diff] [blame] | 24 | #include "av1/common/av1_common_int.h" |
Linfeng Zhang | 0ba23e8 | 2017-12-20 16:27:28 -0800 | [diff] [blame] | 25 | #include "av1/common/idct.h" |
Linfeng Zhang | 0ba23e8 | 2017-12-20 16:27:28 -0800 | [diff] [blame] | 26 | #include "av1/common/scan.h" |
| 27 | #include "av1/common/txb_common.h" |
Linfeng Zhang | 0ba23e8 | 2017-12-20 16:27:28 -0800 | [diff] [blame] | 28 | #include "test/acm_random.h" |
Linfeng Zhang | 0ba23e8 | 2017-12-20 16:27:28 -0800 | [diff] [blame] | 29 | #include "test/register_state_check.h" |
| 30 | #include "test/util.h" |
| 31 | |
| 32 | namespace { |
| 33 | using libaom_test::ACMRandom; |
| 34 | |
| 35 | typedef void (*GetNzMapContextsFunc)(const uint8_t *const levels, |
| 36 | const int16_t *const scan, |
| 37 | const uint16_t eob, const TX_SIZE tx_size, |
Katsuhisa Yuasa | 55c95f8 | 2018-04-03 00:51:22 +0900 | [diff] [blame] | 38 | const TX_CLASS tx_class, |
Linfeng Zhang | 0ba23e8 | 2017-12-20 16:27:28 -0800 | [diff] [blame] | 39 | int8_t *const coeff_contexts); |
| 40 | |
| 41 | class EncodeTxbTest : public ::testing::TestWithParam<GetNzMapContextsFunc> { |
| 42 | public: |
| 43 | EncodeTxbTest() : get_nz_map_contexts_func_(GetParam()) {} |
| 44 | |
James Zern | f1fa1eb | 2023-07-25 15:34:13 -0700 | [diff] [blame] | 45 | ~EncodeTxbTest() override = default; |
Linfeng Zhang | 0ba23e8 | 2017-12-20 16:27:28 -0800 | [diff] [blame] | 46 | |
James Zern | faa2dcf | 2023-07-24 18:29:51 -0700 | [diff] [blame] | 47 | void SetUp() override { |
Linfeng Zhang | 0ba23e8 | 2017-12-20 16:27:28 -0800 | [diff] [blame] | 48 | coeff_contexts_ref_ = reinterpret_cast<int8_t *>( |
| 49 | aom_memalign(16, sizeof(*coeff_contexts_ref_) * MAX_TX_SQUARE)); |
James Zern | 9dea04e | 2022-04-28 13:18:36 -0700 | [diff] [blame] | 50 | ASSERT_NE(coeff_contexts_ref_, nullptr); |
Linfeng Zhang | 0ba23e8 | 2017-12-20 16:27:28 -0800 | [diff] [blame] | 51 | coeff_contexts_ = reinterpret_cast<int8_t *>( |
| 52 | aom_memalign(16, sizeof(*coeff_contexts_) * MAX_TX_SQUARE)); |
James Zern | 9dea04e | 2022-04-28 13:18:36 -0700 | [diff] [blame] | 53 | ASSERT_NE(coeff_contexts_, nullptr); |
Linfeng Zhang | 0ba23e8 | 2017-12-20 16:27:28 -0800 | [diff] [blame] | 54 | } |
| 55 | |
James Zern | faa2dcf | 2023-07-24 18:29:51 -0700 | [diff] [blame] | 56 | void TearDown() override { |
Linfeng Zhang | 0ba23e8 | 2017-12-20 16:27:28 -0800 | [diff] [blame] | 57 | aom_free(coeff_contexts_ref_); |
| 58 | aom_free(coeff_contexts_); |
Linfeng Zhang | 0ba23e8 | 2017-12-20 16:27:28 -0800 | [diff] [blame] | 59 | } |
| 60 | |
| 61 | void GetNzMapContextsRun() { |
| 62 | const int kNumTests = 10; |
| 63 | int result = 0; |
| 64 | |
| 65 | for (int is_inter = 0; is_inter < 2; ++is_inter) { |
| 66 | for (int tx_type = DCT_DCT; tx_type < TX_TYPES; ++tx_type) { |
Katsuhisa Yuasa | 55c95f8 | 2018-04-03 00:51:22 +0900 | [diff] [blame] | 67 | const TX_CLASS tx_class = tx_type_to_class[tx_type]; |
Linfeng Zhang | 0ba23e8 | 2017-12-20 16:27:28 -0800 | [diff] [blame] | 68 | for (int tx_size = TX_4X4; tx_size < TX_SIZES_ALL; ++tx_size) { |
Kyle Siefring | 7bb4c54 | 2022-12-09 10:27:41 -0500 | [diff] [blame] | 69 | const int bhl = get_txb_bhl((TX_SIZE)tx_size); |
Linfeng Zhang | 0ba23e8 | 2017-12-20 16:27:28 -0800 | [diff] [blame] | 70 | const int width = get_txb_wide((TX_SIZE)tx_size); |
| 71 | const int height = get_txb_high((TX_SIZE)tx_size); |
| 72 | const int real_width = tx_size_wide[tx_size]; |
| 73 | const int real_height = tx_size_high[tx_size]; |
Yaowu Xu | 5251fd4 | 2018-02-24 10:52:18 -0800 | [diff] [blame] | 74 | const int16_t *const scan = av1_scan_orders[tx_size][tx_type].scan; |
Linfeng Zhang | 0ba23e8 | 2017-12-20 16:27:28 -0800 | [diff] [blame] | 75 | |
Kyle Siefring | 7bb4c54 | 2022-12-09 10:27:41 -0500 | [diff] [blame] | 76 | levels_ = set_levels(levels_buf_, height); |
Linfeng Zhang | 0ba23e8 | 2017-12-20 16:27:28 -0800 | [diff] [blame] | 77 | for (int i = 0; i < kNumTests && !result; ++i) { |
| 78 | for (int eob = 1; eob <= width * height && !result; ++eob) { |
Kyle Siefring | 7bb4c54 | 2022-12-09 10:27:41 -0500 | [diff] [blame] | 79 | InitDataWithEob(scan, bhl, eob); |
Linfeng Zhang | 0ba23e8 | 2017-12-20 16:27:28 -0800 | [diff] [blame] | 80 | |
| 81 | av1_get_nz_map_contexts_c(levels_, scan, eob, (TX_SIZE)tx_size, |
Katsuhisa Yuasa | 55c95f8 | 2018-04-03 00:51:22 +0900 | [diff] [blame] | 82 | tx_class, coeff_contexts_ref_); |
Linfeng Zhang | 0ba23e8 | 2017-12-20 16:27:28 -0800 | [diff] [blame] | 83 | get_nz_map_contexts_func_(levels_, scan, eob, (TX_SIZE)tx_size, |
Katsuhisa Yuasa | 55c95f8 | 2018-04-03 00:51:22 +0900 | [diff] [blame] | 84 | tx_class, coeff_contexts_); |
Linfeng Zhang | 0ba23e8 | 2017-12-20 16:27:28 -0800 | [diff] [blame] | 85 | |
| 86 | result = Compare(scan, eob); |
| 87 | |
| 88 | EXPECT_EQ(result, 0) |
Kyle Siefring | 7bb4c54 | 2022-12-09 10:27:41 -0500 | [diff] [blame] | 89 | << " tx_class " << (int)tx_class << " width " << real_width |
Katsuhisa Yuasa | 55c95f8 | 2018-04-03 00:51:22 +0900 | [diff] [blame] | 90 | << " height " << real_height << " eob " << eob; |
Linfeng Zhang | 0ba23e8 | 2017-12-20 16:27:28 -0800 | [diff] [blame] | 91 | } |
| 92 | } |
| 93 | } |
| 94 | } |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | void SpeedTestGetNzMapContextsRun() { |
| 99 | const int kNumTests = 2000000000; |
| 100 | aom_usec_timer timer; |
Vitalii Dziumenko | 903ca2f | 2020-07-08 16:47:57 +0300 | [diff] [blame] | 101 | aom_usec_timer timer_ref; |
Linfeng Zhang | 0ba23e8 | 2017-12-20 16:27:28 -0800 | [diff] [blame] | 102 | |
| 103 | printf("Note: Only test the largest possible eob case!\n"); |
| 104 | for (int tx_size = TX_4X4; tx_size < TX_SIZES_ALL; ++tx_size) { |
Kyle Siefring | 7bb4c54 | 2022-12-09 10:27:41 -0500 | [diff] [blame] | 105 | const int bhl = get_txb_bhl((TX_SIZE)tx_size); |
Linfeng Zhang | 0ba23e8 | 2017-12-20 16:27:28 -0800 | [diff] [blame] | 106 | const int width = get_txb_wide((TX_SIZE)tx_size); |
| 107 | const int height = get_txb_high((TX_SIZE)tx_size); |
| 108 | const int real_width = tx_size_wide[tx_size]; |
| 109 | const int real_height = tx_size_high[tx_size]; |
| 110 | const TX_TYPE tx_type = DCT_DCT; |
Katsuhisa Yuasa | 55c95f8 | 2018-04-03 00:51:22 +0900 | [diff] [blame] | 111 | const TX_CLASS tx_class = tx_type_to_class[tx_type]; |
Yaowu Xu | 5251fd4 | 2018-02-24 10:52:18 -0800 | [diff] [blame] | 112 | const int16_t *const scan = av1_scan_orders[tx_size][tx_type].scan; |
Linfeng Zhang | 0ba23e8 | 2017-12-20 16:27:28 -0800 | [diff] [blame] | 113 | const int eob = width * height; |
| 114 | const int numTests = kNumTests / (width * height); |
| 115 | |
Kyle Siefring | 7bb4c54 | 2022-12-09 10:27:41 -0500 | [diff] [blame] | 116 | levels_ = set_levels(levels_buf_, height); |
| 117 | InitDataWithEob(scan, bhl, eob); |
Linfeng Zhang | 0ba23e8 | 2017-12-20 16:27:28 -0800 | [diff] [blame] | 118 | |
Vitalii Dziumenko | 903ca2f | 2020-07-08 16:47:57 +0300 | [diff] [blame] | 119 | aom_usec_timer_start(&timer_ref); |
| 120 | for (int i = 0; i < numTests; ++i) { |
| 121 | av1_get_nz_map_contexts_c(levels_, scan, eob, (TX_SIZE)tx_size, |
| 122 | tx_class, coeff_contexts_ref_); |
| 123 | } |
| 124 | aom_usec_timer_mark(&timer_ref); |
| 125 | |
Kyle Siefring | 7bb4c54 | 2022-12-09 10:27:41 -0500 | [diff] [blame] | 126 | levels_ = set_levels(levels_buf_, height); |
| 127 | InitDataWithEob(scan, bhl, eob); |
Vitalii Dziumenko | 903ca2f | 2020-07-08 16:47:57 +0300 | [diff] [blame] | 128 | |
Linfeng Zhang | 0ba23e8 | 2017-12-20 16:27:28 -0800 | [diff] [blame] | 129 | aom_usec_timer_start(&timer); |
| 130 | for (int i = 0; i < numTests; ++i) { |
Katsuhisa Yuasa | 55c95f8 | 2018-04-03 00:51:22 +0900 | [diff] [blame] | 131 | get_nz_map_contexts_func_(levels_, scan, eob, (TX_SIZE)tx_size, |
| 132 | tx_class, coeff_contexts_); |
Linfeng Zhang | 0ba23e8 | 2017-12-20 16:27:28 -0800 | [diff] [blame] | 133 | } |
| 134 | aom_usec_timer_mark(&timer); |
| 135 | |
Vitalii Dziumenko | 903ca2f | 2020-07-08 16:47:57 +0300 | [diff] [blame] | 136 | const int elapsed_time_ref = |
| 137 | static_cast<int>(aom_usec_timer_elapsed(&timer_ref)); |
Linfeng Zhang | 0ba23e8 | 2017-12-20 16:27:28 -0800 | [diff] [blame] | 138 | const int elapsed_time = static_cast<int>(aom_usec_timer_elapsed(&timer)); |
Vitalii Dziumenko | 903ca2f | 2020-07-08 16:47:57 +0300 | [diff] [blame] | 139 | |
| 140 | printf("get_nz_map_contexts_%2dx%2d: %7.1f ms ref %7.1f ms gain %4.2f\n", |
| 141 | real_width, real_height, elapsed_time / 1000.0, |
| 142 | elapsed_time_ref / 1000.0, |
| 143 | (elapsed_time_ref * 1.0) / (elapsed_time * 1.0)); |
Linfeng Zhang | 0ba23e8 | 2017-12-20 16:27:28 -0800 | [diff] [blame] | 144 | } |
| 145 | } |
| 146 | |
| 147 | private: |
Kyle Siefring | 7bb4c54 | 2022-12-09 10:27:41 -0500 | [diff] [blame] | 148 | void InitDataWithEob(const int16_t *const scan, const int bhl, |
Linfeng Zhang | 0ba23e8 | 2017-12-20 16:27:28 -0800 | [diff] [blame] | 149 | const int eob) { |
| 150 | memset(levels_buf_, 0, sizeof(levels_buf_)); |
| 151 | memset(coeff_contexts_, 0, sizeof(*coeff_contexts_) * MAX_TX_SQUARE); |
| 152 | |
| 153 | for (int c = 0; c < eob; ++c) { |
Kyle Siefring | 7bb4c54 | 2022-12-09 10:27:41 -0500 | [diff] [blame] | 154 | levels_[get_padded_idx(scan[c], bhl)] = |
Linfeng Zhang | 0ba23e8 | 2017-12-20 16:27:28 -0800 | [diff] [blame] | 155 | static_cast<uint8_t>(clamp(rnd_.Rand8(), 0, INT8_MAX)); |
Hien Ho | efd650a | 2019-08-27 15:36:23 -0700 | [diff] [blame] | 156 | coeff_contexts_[scan[c]] = static_cast<int8_t>(rnd_.Rand16() >> 1); |
Linfeng Zhang | 0ba23e8 | 2017-12-20 16:27:28 -0800 | [diff] [blame] | 157 | } |
| 158 | |
| 159 | memcpy(coeff_contexts_ref_, coeff_contexts_, |
| 160 | sizeof(*coeff_contexts_) * MAX_TX_SQUARE); |
| 161 | } |
| 162 | |
| 163 | bool Compare(const int16_t *const scan, const int eob) const { |
| 164 | bool result = false; |
| 165 | if (memcmp(coeff_contexts_, coeff_contexts_ref_, |
| 166 | sizeof(*coeff_contexts_ref_) * MAX_TX_SQUARE)) { |
| 167 | for (int i = 0; i < eob; i++) { |
| 168 | const int pos = scan[i]; |
| 169 | if (coeff_contexts_ref_[pos] != coeff_contexts_[pos]) { |
| 170 | printf("coeff_contexts_[%d] diff:%6d (ref),%6d (opt)\n", pos, |
| 171 | coeff_contexts_ref_[pos], coeff_contexts_[pos]); |
| 172 | result = true; |
| 173 | break; |
| 174 | } |
| 175 | } |
| 176 | } |
| 177 | return result; |
| 178 | } |
| 179 | |
| 180 | GetNzMapContextsFunc get_nz_map_contexts_func_; |
| 181 | ACMRandom rnd_; |
| 182 | uint8_t levels_buf_[TX_PAD_2D]; |
| 183 | uint8_t *levels_; |
| 184 | int8_t *coeff_contexts_ref_; |
| 185 | int8_t *coeff_contexts_; |
| 186 | }; |
chiyotsai | 9dfac72 | 2020-07-07 17:43:02 -0700 | [diff] [blame] | 187 | GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(EncodeTxbTest); |
Linfeng Zhang | 0ba23e8 | 2017-12-20 16:27:28 -0800 | [diff] [blame] | 188 | |
| 189 | TEST_P(EncodeTxbTest, GetNzMapContexts) { GetNzMapContextsRun(); } |
| 190 | |
| 191 | TEST_P(EncodeTxbTest, DISABLED_SpeedTestGetNzMapContexts) { |
| 192 | SpeedTestGetNzMapContextsRun(); |
| 193 | } |
| 194 | |
| 195 | #if HAVE_SSE2 |
Cheng Chen | 96786fe | 2020-02-14 17:28:25 -0800 | [diff] [blame] | 196 | INSTANTIATE_TEST_SUITE_P(SSE2, EncodeTxbTest, |
| 197 | ::testing::Values(av1_get_nz_map_contexts_sse2)); |
Linfeng Zhang | 0ba23e8 | 2017-12-20 16:27:28 -0800 | [diff] [blame] | 198 | #endif |
Peng Bin | 27d7ca9 | 2018-03-22 22:25:56 +0800 | [diff] [blame] | 199 | |
Vitalii Dziumenko | 903ca2f | 2020-07-08 16:47:57 +0300 | [diff] [blame] | 200 | #if HAVE_NEON |
| 201 | INSTANTIATE_TEST_SUITE_P(NEON, EncodeTxbTest, |
| 202 | ::testing::Values(av1_get_nz_map_contexts_neon)); |
| 203 | #endif |
| 204 | |
Xing Jin | a7106c3 | 2018-08-14 16:27:56 +0800 | [diff] [blame] | 205 | typedef void (*av1_txb_init_levels_func)(const tran_low_t *const coeff, |
| 206 | const int width, const int height, |
| 207 | uint8_t *const levels); |
| 208 | |
sarahparker | a543df5 | 2018-11-02 16:02:05 -0700 | [diff] [blame] | 209 | typedef std::tuple<av1_txb_init_levels_func, int> TxbInitLevelParam; |
Xing Jin | a7106c3 | 2018-08-14 16:27:56 +0800 | [diff] [blame] | 210 | |
| 211 | class EncodeTxbInitLevelTest |
| 212 | : public ::testing::TestWithParam<TxbInitLevelParam> { |
Peng Bin | 27d7ca9 | 2018-03-22 22:25:56 +0800 | [diff] [blame] | 213 | public: |
James Zern | f1fa1eb | 2023-07-25 15:34:13 -0700 | [diff] [blame] | 214 | ~EncodeTxbInitLevelTest() override = default; |
Xing Jin | a7106c3 | 2018-08-14 16:27:56 +0800 | [diff] [blame] | 215 | void RunTest(av1_txb_init_levels_func test_func, int tx_size, int is_speed); |
Peng Bin | 27d7ca9 | 2018-03-22 22:25:56 +0800 | [diff] [blame] | 216 | }; |
chiyotsai | 9dfac72 | 2020-07-07 17:43:02 -0700 | [diff] [blame] | 217 | GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(EncodeTxbInitLevelTest); |
Peng Bin | 27d7ca9 | 2018-03-22 22:25:56 +0800 | [diff] [blame] | 218 | |
Xing Jin | a7106c3 | 2018-08-14 16:27:56 +0800 | [diff] [blame] | 219 | void EncodeTxbInitLevelTest::RunTest(av1_txb_init_levels_func test_func, |
| 220 | int tx_size, int is_speed) { |
Peng Bin | 27d7ca9 | 2018-03-22 22:25:56 +0800 | [diff] [blame] | 221 | const int width = get_txb_wide((TX_SIZE)tx_size); |
| 222 | const int height = get_txb_high((TX_SIZE)tx_size); |
| 223 | tran_low_t coeff[MAX_TX_SQUARE]; |
| 224 | |
| 225 | uint8_t levels_buf[2][TX_PAD_2D]; |
Kyle Siefring | 7bb4c54 | 2022-12-09 10:27:41 -0500 | [diff] [blame] | 226 | uint8_t *const levels0 = set_levels(levels_buf[0], height); |
| 227 | uint8_t *const levels1 = set_levels(levels_buf[1], height); |
Peng Bin | 27d7ca9 | 2018-03-22 22:25:56 +0800 | [diff] [blame] | 228 | |
| 229 | ACMRandom rnd(ACMRandom::DeterministicSeed()); |
| 230 | for (int i = 0; i < width * height; i++) { |
James Zern | 6e66150 | 2022-08-31 16:21:18 -0700 | [diff] [blame] | 231 | coeff[i] = rnd.Rand16Signed(); |
Peng Bin | 27d7ca9 | 2018-03-22 22:25:56 +0800 | [diff] [blame] | 232 | } |
| 233 | for (int i = 0; i < TX_PAD_2D; i++) { |
| 234 | levels_buf[0][i] = rnd.Rand8(); |
| 235 | levels_buf[1][i] = rnd.Rand8(); |
| 236 | } |
| 237 | const int run_times = is_speed ? (width * height) * 10000 : 1; |
| 238 | aom_usec_timer timer; |
| 239 | aom_usec_timer_start(&timer); |
| 240 | for (int i = 0; i < run_times; ++i) { |
| 241 | av1_txb_init_levels_c(coeff, width, height, levels0); |
| 242 | } |
| 243 | const double t1 = get_time_mark(&timer); |
| 244 | aom_usec_timer_start(&timer); |
| 245 | for (int i = 0; i < run_times; ++i) { |
Xing Jin | a7106c3 | 2018-08-14 16:27:56 +0800 | [diff] [blame] | 246 | test_func(coeff, width, height, levels1); |
Peng Bin | 27d7ca9 | 2018-03-22 22:25:56 +0800 | [diff] [blame] | 247 | } |
| 248 | const double t2 = get_time_mark(&timer); |
| 249 | if (is_speed) { |
| 250 | printf("init %3dx%-3d:%7.2f/%7.2fns", width, height, t1, t2); |
| 251 | printf("(%3.2f)\n", t1 / t2); |
| 252 | } |
| 253 | const int stride = width + TX_PAD_HOR; |
| 254 | for (int r = 0; r < height + TX_PAD_VER; ++r) { |
| 255 | for (int c = 0; c < stride; ++c) { |
| 256 | ASSERT_EQ(levels_buf[0][c + r * stride], levels_buf[1][c + r * stride]) |
| 257 | << "[" << r << "," << c << "] " << run_times << width << "x" |
| 258 | << height; |
| 259 | } |
| 260 | } |
| 261 | } |
| 262 | |
Xing Jin | a7106c3 | 2018-08-14 16:27:56 +0800 | [diff] [blame] | 263 | TEST_P(EncodeTxbInitLevelTest, match) { |
| 264 | RunTest(GET_PARAM(0), GET_PARAM(1), 0); |
| 265 | } |
Peng Bin | 27d7ca9 | 2018-03-22 22:25:56 +0800 | [diff] [blame] | 266 | |
Xing Jin | a7106c3 | 2018-08-14 16:27:56 +0800 | [diff] [blame] | 267 | TEST_P(EncodeTxbInitLevelTest, DISABLED_Speed) { |
| 268 | RunTest(GET_PARAM(0), GET_PARAM(1), 1); |
| 269 | } |
| 270 | |
| 271 | #if HAVE_SSE4_1 |
Cheng Chen | 96786fe | 2020-02-14 17:28:25 -0800 | [diff] [blame] | 272 | INSTANTIATE_TEST_SUITE_P( |
Xing Jin | a7106c3 | 2018-08-14 16:27:56 +0800 | [diff] [blame] | 273 | SSE4_1, EncodeTxbInitLevelTest, |
| 274 | ::testing::Combine(::testing::Values(&av1_txb_init_levels_sse4_1), |
| 275 | ::testing::Range(0, static_cast<int>(TX_SIZES_ALL), 1))); |
Peng Bin | 27d7ca9 | 2018-03-22 22:25:56 +0800 | [diff] [blame] | 276 | #endif |
Xing Jin | a7106c3 | 2018-08-14 16:27:56 +0800 | [diff] [blame] | 277 | #if HAVE_AVX2 |
Cheng Chen | 96786fe | 2020-02-14 17:28:25 -0800 | [diff] [blame] | 278 | INSTANTIATE_TEST_SUITE_P( |
Xing Jin | a7106c3 | 2018-08-14 16:27:56 +0800 | [diff] [blame] | 279 | AVX2, EncodeTxbInitLevelTest, |
| 280 | ::testing::Combine(::testing::Values(&av1_txb_init_levels_avx2), |
| 281 | ::testing::Range(0, static_cast<int>(TX_SIZES_ALL), 1))); |
| 282 | #endif |
Vitalii Dziumenko | e403754 | 2020-04-17 15:36:36 +0300 | [diff] [blame] | 283 | #if HAVE_NEON |
| 284 | INSTANTIATE_TEST_SUITE_P( |
| 285 | NEON, EncodeTxbInitLevelTest, |
| 286 | ::testing::Combine(::testing::Values(&av1_txb_init_levels_neon), |
| 287 | ::testing::Range(0, static_cast<int>(TX_SIZES_ALL), 1))); |
| 288 | #endif |
Linfeng Zhang | 0ba23e8 | 2017-12-20 16:27:28 -0800 | [diff] [blame] | 289 | } // namespace |