Johann | fbea897 | 2012-06-28 11:43:58 -0700 | [diff] [blame] | 1 | /* |
Krishna Rapaka | 7319db5 | 2021-09-28 20:35:29 -0700 | [diff] [blame] | 2 | * Copyright (c) 2021, Alliance for Open Media. All rights reserved |
Johann | fbea897 | 2012-06-28 11:43:58 -0700 | [diff] [blame] | 3 | * |
Vibhoothi | 41c6dd7 | 2021-10-12 18:48:26 +0000 | [diff] [blame] | 4 | * This source code is subject to the terms of the BSD 3-Clause Clear License |
| 5 | * and the Alliance for Open Media Patent License 1.0. If the BSD 3-Clause Clear |
| 6 | * License was not distributed with this source code in the LICENSE file, you |
| 7 | * can obtain it at aomedia.org/license/software-license/bsd-3-c-c/. If the |
| 8 | * Alliance for Open Media Patent License 1.0 was not distributed with this |
| 9 | * source code in the PATENTS file, you can obtain it at |
| 10 | * aomedia.org/license/patent-license/. |
Johann | 123e8a6 | 2017-12-28 14:40:49 -0800 | [diff] [blame] | 11 | */ |
Johann | fbea897 | 2012-06-28 11:43:58 -0700 | [diff] [blame] | 12 | |
Johann | fbea897 | 2012-06-28 11:43:58 -0700 | [diff] [blame] | 13 | #include <string.h> |
| 14 | #include <limits.h> |
| 15 | #include <stdio.h> |
sarahparker | a543df5 | 2018-11-02 16:02:05 -0700 | [diff] [blame] | 16 | #include <tuple> |
Johann | fbea897 | 2012-06-28 11:43:58 -0700 | [diff] [blame] | 17 | |
Tom Finegan | 7a07ece | 2017-02-07 17:14:05 -0800 | [diff] [blame] | 18 | #include "third_party/googletest/src/googletest/include/gtest/gtest.h" |
Jingning Han | 097d59c | 2015-07-29 14:51:36 -0700 | [diff] [blame] | 19 | |
Tom Finegan | 60e653d | 2018-05-22 11:34:58 -0700 | [diff] [blame] | 20 | #include "config/aom_config.h" |
Tom Finegan | 44702c8 | 2018-05-22 13:00:39 -0700 | [diff] [blame] | 21 | #include "config/aom_dsp_rtcd.h" |
Tom Finegan | 60e653d | 2018-05-22 11:34:58 -0700 | [diff] [blame] | 22 | |
Johann | fbea897 | 2012-06-28 11:43:58 -0700 | [diff] [blame] | 23 | #include "test/acm_random.h" |
James Zern | 5b75674 | 2013-06-17 22:58:40 -0700 | [diff] [blame] | 24 | #include "test/clear_system_state.h" |
James Zern | eebb648 | 2012-11-27 13:08:05 -0800 | [diff] [blame] | 25 | #include "test/register_state_check.h" |
Johann | fbea897 | 2012-06-28 11:43:58 -0700 | [diff] [blame] | 26 | #include "test/util.h" |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 27 | #include "aom/aom_codec.h" |
| 28 | #include "aom_mem/aom_mem.h" |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 29 | #include "aom_ports/mem.h" |
Johann | fbea897 | 2012-06-28 11:43:58 -0700 | [diff] [blame] | 30 | |
James Almer | 756717c | 2022-10-19 17:32:48 +0000 | [diff] [blame] | 31 | typedef unsigned int (*SadMxNFunc)(const uint16_t *src_ptr, int src_stride, |
| 32 | const uint16_t *ref_ptr, int ref_stride); |
sarahparker | a543df5 | 2018-11-02 16:02:05 -0700 | [diff] [blame] | 33 | typedef std::tuple<int, int, SadMxNFunc, int> SadMxNParam; |
Johann | d5d9289 | 2015-04-17 16:11:38 -0400 | [diff] [blame] | 34 | |
James Almer | 756717c | 2022-10-19 17:32:48 +0000 | [diff] [blame] | 35 | typedef unsigned int (*SadSkipMxNFunc)(const uint16_t *src_ptr, int src_stride, |
| 36 | const uint16_t *ref_ptr, int ref_stride); |
chiyotsai | c814afb | 2020-08-04 13:12:35 -0700 | [diff] [blame] | 37 | typedef std::tuple<int, int, SadSkipMxNFunc, int> SadSkipMxNParam; |
| 38 | |
James Almer | 756717c | 2022-10-19 17:32:48 +0000 | [diff] [blame] | 39 | typedef uint32_t (*SadMxNAvgFunc)(const uint16_t *src_ptr, int src_stride, |
| 40 | const uint16_t *ref_ptr, int ref_stride, |
| 41 | const uint16_t *second_pred); |
sarahparker | a543df5 | 2018-11-02 16:02:05 -0700 | [diff] [blame] | 42 | typedef std::tuple<int, int, SadMxNAvgFunc, int> SadMxNAvgParam; |
Johann | fbea897 | 2012-06-28 11:43:58 -0700 | [diff] [blame] | 43 | |
James Almer | 756717c | 2022-10-19 17:32:48 +0000 | [diff] [blame] | 44 | typedef void (*DistWtdCompAvgFunc)(uint16_t *comp_pred, const uint16_t *pred, |
| 45 | int width, int height, const uint16_t *ref, |
Debargha Mukherjee | 0c96c11 | 2018-12-20 16:04:18 -0800 | [diff] [blame] | 46 | int ref_stride, |
| 47 | const DIST_WTD_COMP_PARAMS *jcp_param); |
sarahparker | a543df5 | 2018-11-02 16:02:05 -0700 | [diff] [blame] | 48 | typedef std::tuple<int, int, DistWtdCompAvgFunc, int> DistWtdCompAvgParam; |
Cheng Chen | a0367dc | 2017-11-16 19:20:42 -0800 | [diff] [blame] | 49 | |
James Almer | 756717c | 2022-10-19 17:32:48 +0000 | [diff] [blame] | 50 | typedef unsigned int (*DistWtdSadMxhFunc)(const uint16_t *src_ptr, |
Debargha Mukherjee | 0c96c11 | 2018-12-20 16:04:18 -0800 | [diff] [blame] | 51 | int src_stride, |
James Almer | 756717c | 2022-10-19 17:32:48 +0000 | [diff] [blame] | 52 | const uint16_t *ref_ptr, |
Debargha Mukherjee | 0c96c11 | 2018-12-20 16:04:18 -0800 | [diff] [blame] | 53 | int ref_stride, int width, |
| 54 | int height); |
sarahparker | a543df5 | 2018-11-02 16:02:05 -0700 | [diff] [blame] | 55 | typedef std::tuple<int, int, DistWtdSadMxhFunc, int> DistWtdSadMxhParam; |
Cheng Chen | a0367dc | 2017-11-16 19:20:42 -0800 | [diff] [blame] | 56 | |
James Almer | 756717c | 2022-10-19 17:32:48 +0000 | [diff] [blame] | 57 | typedef uint32_t (*DistWtdSadMxNAvgFunc)(const uint16_t *src_ptr, |
| 58 | int src_stride, |
| 59 | const uint16_t *ref_ptr, |
| 60 | int ref_stride, |
| 61 | const uint16_t *second_pred, |
Debargha Mukherjee | 0c96c11 | 2018-12-20 16:04:18 -0800 | [diff] [blame] | 62 | const DIST_WTD_COMP_PARAMS *jcp_param); |
sarahparker | a543df5 | 2018-11-02 16:02:05 -0700 | [diff] [blame] | 63 | typedef std::tuple<int, int, DistWtdSadMxNAvgFunc, int> DistWtdSadMxNAvgParam; |
Cheng Chen | a0367dc | 2017-11-16 19:20:42 -0800 | [diff] [blame] | 64 | |
James Almer | 756717c | 2022-10-19 17:32:48 +0000 | [diff] [blame] | 65 | typedef void (*SadMxNx4Func)(const uint16_t *src_ptr, int src_stride, |
| 66 | const uint16_t *const ref_ptr[], int ref_stride, |
Peter de Rivaz | 7eee487 | 2014-10-16 13:41:55 +0100 | [diff] [blame] | 67 | uint32_t *sad_array); |
sarahparker | a543df5 | 2018-11-02 16:02:05 -0700 | [diff] [blame] | 68 | typedef std::tuple<int, int, SadMxNx4Func, int> SadMxNx4Param; |
John Koleszar | 1cfc86e | 2013-03-01 12:43:41 -0800 | [diff] [blame] | 69 | |
James Almer | 756717c | 2022-10-19 17:32:48 +0000 | [diff] [blame] | 70 | typedef void (*SadSkipMxNx4Func)(const uint16_t *src_ptr, int src_stride, |
| 71 | const uint16_t *const ref_ptr[], |
| 72 | int ref_stride, uint32_t *sad_array); |
chiyotsai | c814afb | 2020-08-04 13:12:35 -0700 | [diff] [blame] | 73 | typedef std::tuple<int, int, SadSkipMxNx4Func, int> SadSkipMxNx4Param; |
| 74 | |
James Almer | 756717c | 2022-10-19 17:32:48 +0000 | [diff] [blame] | 75 | typedef void (*SadMxNx4AvgFunc)(const uint16_t *src_ptr, int src_stride, |
| 76 | const uint16_t *const ref_ptr[], int ref_stride, |
| 77 | const uint16_t *second_pred, |
Ruiling Song | 8dc32d7 | 2020-01-20 15:33:37 +0800 | [diff] [blame] | 78 | uint32_t *sad_array); |
| 79 | typedef std::tuple<int, int, SadMxNx4AvgFunc, int> SadMxNx4AvgParam; |
| 80 | |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 81 | using libaom_test::ACMRandom; |
Johann | fbea897 | 2012-06-28 11:43:58 -0700 | [diff] [blame] | 82 | |
| 83 | namespace { |
John Koleszar | 1cfc86e | 2013-03-01 12:43:41 -0800 | [diff] [blame] | 84 | class SADTestBase : public ::testing::Test { |
James Zern | 10f8b36 | 2012-08-27 17:13:09 -0700 | [diff] [blame] | 85 | public: |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 86 | SADTestBase(int width, int height, int bit_depth) |
| 87 | : width_(width), height_(height), bd_(bit_depth) {} |
John Koleszar | 1cfc86e | 2013-03-01 12:43:41 -0800 | [diff] [blame] | 88 | |
chiyotsai | 9dfac72 | 2020-07-07 17:43:02 -0700 | [diff] [blame] | 89 | static void SetUpTestSuite() { |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 90 | source_data16_ = reinterpret_cast<uint16_t *>( |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 91 | aom_memalign(kDataAlignment, kDataBlockSize * sizeof(uint16_t))); |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 92 | reference_data16_ = reinterpret_cast<uint16_t *>( |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 93 | aom_memalign(kDataAlignment, kDataBufferSize * sizeof(uint16_t))); |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 94 | second_pred16_ = reinterpret_cast<uint16_t *>( |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 95 | aom_memalign(kDataAlignment, 128 * 128 * sizeof(uint16_t))); |
Cheng Chen | a0367dc | 2017-11-16 19:20:42 -0800 | [diff] [blame] | 96 | comp_pred16_ = reinterpret_cast<uint16_t *>( |
| 97 | aom_memalign(kDataAlignment, 128 * 128 * sizeof(uint16_t))); |
| 98 | comp_pred16_test_ = reinterpret_cast<uint16_t *>( |
| 99 | aom_memalign(kDataAlignment, 128 * 128 * sizeof(uint16_t))); |
James Zern | 10f8b36 | 2012-08-27 17:13:09 -0700 | [diff] [blame] | 100 | } |
| 101 | |
chiyotsai | 9dfac72 | 2020-07-07 17:43:02 -0700 | [diff] [blame] | 102 | static void TearDownTestSuite() { |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 103 | aom_free(source_data16_); |
Peter de Rivaz | 7eee487 | 2014-10-16 13:41:55 +0100 | [diff] [blame] | 104 | source_data16_ = NULL; |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 105 | aom_free(reference_data16_); |
Peter de Rivaz | 7eee487 | 2014-10-16 13:41:55 +0100 | [diff] [blame] | 106 | reference_data16_ = NULL; |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 107 | aom_free(second_pred16_); |
Peter de Rivaz | 7eee487 | 2014-10-16 13:41:55 +0100 | [diff] [blame] | 108 | second_pred16_ = NULL; |
Cheng Chen | a0367dc | 2017-11-16 19:20:42 -0800 | [diff] [blame] | 109 | aom_free(comp_pred16_); |
| 110 | comp_pred16_ = NULL; |
| 111 | aom_free(comp_pred16_test_); |
| 112 | comp_pred16_test_ = NULL; |
James Zern | 10f8b36 | 2012-08-27 17:13:09 -0700 | [diff] [blame] | 113 | } |
| 114 | |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 115 | virtual void TearDown() { libaom_test::ClearSystemState(); } |
James Zern | 5b75674 | 2013-06-17 22:58:40 -0700 | [diff] [blame] | 116 | |
James Zern | 10f8b36 | 2012-08-27 17:13:09 -0700 | [diff] [blame] | 117 | protected: |
Geza Lore | 697bf5b | 2016-03-02 11:12:52 +0000 | [diff] [blame] | 118 | // Handle up to 4 128x128 blocks, with stride up to 256 |
James Zern | 10f8b36 | 2012-08-27 17:13:09 -0700 | [diff] [blame] | 119 | static const int kDataAlignment = 16; |
Geza Lore | 697bf5b | 2016-03-02 11:12:52 +0000 | [diff] [blame] | 120 | static const int kDataBlockSize = 128 * 256; |
John Koleszar | 1cfc86e | 2013-03-01 12:43:41 -0800 | [diff] [blame] | 121 | static const int kDataBufferSize = 4 * kDataBlockSize; |
James Zern | 10f8b36 | 2012-08-27 17:13:09 -0700 | [diff] [blame] | 122 | |
Johann | fbea897 | 2012-06-28 11:43:58 -0700 | [diff] [blame] | 123 | virtual void SetUp() { |
James Almer | 756717c | 2022-10-19 17:32:48 +0000 | [diff] [blame] | 124 | bit_depth_ = static_cast<aom_bit_depth_t>(bd_); |
| 125 | source_data_ = source_data16_; |
| 126 | reference_data_ = reference_data16_; |
| 127 | second_pred_ = second_pred16_; |
| 128 | comp_pred_ = comp_pred16_; |
| 129 | comp_pred_test_ = comp_pred16_test_; |
Peter de Rivaz | 7eee487 | 2014-10-16 13:41:55 +0100 | [diff] [blame] | 130 | mask_ = (1 << bit_depth_) - 1; |
John Koleszar | 6b653cb | 2013-02-28 17:03:02 -0800 | [diff] [blame] | 131 | source_stride_ = (width_ + 31) & ~31; |
Johann | fbea897 | 2012-06-28 11:43:58 -0700 | [diff] [blame] | 132 | reference_stride_ = width_ * 2; |
| 133 | rnd_.Reset(ACMRandom::DeterministicSeed()); |
| 134 | } |
| 135 | |
James Almer | 756717c | 2022-10-19 17:32:48 +0000 | [diff] [blame] | 136 | virtual uint16_t *GetReference(int block_idx) { |
John Koleszar | 1cfc86e | 2013-03-01 12:43:41 -0800 | [diff] [blame] | 137 | return reference_data_ + block_idx * kDataBlockSize; |
Johann | fbea897 | 2012-06-28 11:43:58 -0700 | [diff] [blame] | 138 | } |
| 139 | |
| 140 | // Sum of Absolute Differences. Given two blocks, calculate the absolute |
| 141 | // difference between two pixels in the same relative location; accumulate. |
Johann | d5d9289 | 2015-04-17 16:11:38 -0400 | [diff] [blame] | 142 | unsigned int ReferenceSAD(int block_idx) { |
Johann | fbea897 | 2012-06-28 11:43:58 -0700 | [diff] [blame] | 143 | unsigned int sad = 0; |
James Almer | 756717c | 2022-10-19 17:32:48 +0000 | [diff] [blame] | 144 | const uint16_t *const reference16 = GetReference(block_idx); |
| 145 | const uint16_t *const source16 = source_data_; |
Johann | fbea897 | 2012-06-28 11:43:58 -0700 | [diff] [blame] | 146 | for (int h = 0; h < height_; ++h) { |
| 147 | for (int w = 0; w < width_; ++w) { |
James Almer | 756717c | 2022-10-19 17:32:48 +0000 | [diff] [blame] | 148 | sad += abs(source16[h * source_stride_ + w] - |
| 149 | reference16[h * reference_stride_ + w]); |
Jim Bankoski | a16794d | 2014-05-15 08:31:20 -0700 | [diff] [blame] | 150 | } |
Johann | fbea897 | 2012-06-28 11:43:58 -0700 | [diff] [blame] | 151 | } |
| 152 | return sad; |
| 153 | } |
| 154 | |
chiyotsai | c814afb | 2020-08-04 13:12:35 -0700 | [diff] [blame] | 155 | // Sum of Absolute Differences Skip rows. Given two blocks, |
| 156 | // calculate the absolute difference between two pixels in the same |
| 157 | // relative location every other row; accumulate and double the result at the |
| 158 | // end. |
| 159 | unsigned int ReferenceSADSkip(int block_idx) { |
| 160 | unsigned int sad = 0; |
James Almer | 756717c | 2022-10-19 17:32:48 +0000 | [diff] [blame] | 161 | const uint16_t *const reference16 = GetReference(block_idx); |
| 162 | const uint16_t *const source16 = source_data_; |
chiyotsai | c814afb | 2020-08-04 13:12:35 -0700 | [diff] [blame] | 163 | for (int h = 0; h < height_; h += 2) { |
| 164 | for (int w = 0; w < width_; ++w) { |
James Almer | 756717c | 2022-10-19 17:32:48 +0000 | [diff] [blame] | 165 | sad += abs(source16[h * source_stride_ + w] - |
| 166 | reference16[h * reference_stride_ + w]); |
chiyotsai | c814afb | 2020-08-04 13:12:35 -0700 | [diff] [blame] | 167 | } |
| 168 | } |
| 169 | return sad * 2; |
| 170 | } |
| 171 | |
Peter de Rivaz | 7eee487 | 2014-10-16 13:41:55 +0100 | [diff] [blame] | 172 | // Sum of Absolute Differences Average. Given two blocks, and a prediction |
| 173 | // calculate the absolute difference between one pixel and average of the |
| 174 | // corresponding and predicted pixels; accumulate. |
Johann | d5d9289 | 2015-04-17 16:11:38 -0400 | [diff] [blame] | 175 | unsigned int ReferenceSADavg(int block_idx) { |
Peter de Rivaz | 7eee487 | 2014-10-16 13:41:55 +0100 | [diff] [blame] | 176 | unsigned int sad = 0; |
James Almer | 756717c | 2022-10-19 17:32:48 +0000 | [diff] [blame] | 177 | const uint16_t *const reference16 = GetReference(block_idx); |
| 178 | const uint16_t *const source16 = source_data_; |
| 179 | const uint16_t *const second_pred16 = second_pred_; |
Johann | fbea897 | 2012-06-28 11:43:58 -0700 | [diff] [blame] | 180 | for (int h = 0; h < height_; ++h) { |
| 181 | for (int w = 0; w < width_; ++w) { |
James Almer | 756717c | 2022-10-19 17:32:48 +0000 | [diff] [blame] | 182 | const int tmp = second_pred16[h * width_ + w] + |
| 183 | reference16[h * reference_stride_ + w]; |
| 184 | const uint16_t comp_pred = ROUND_POWER_OF_TWO(tmp, 1); |
| 185 | sad += abs(source16[h * source_stride_ + w] - comp_pred); |
Peter de Rivaz | 7eee487 | 2014-10-16 13:41:55 +0100 | [diff] [blame] | 186 | } |
| 187 | } |
| 188 | return sad; |
| 189 | } |
| 190 | |
Debargha Mukherjee | 0c96c11 | 2018-12-20 16:04:18 -0800 | [diff] [blame] | 191 | void ReferenceDistWtdCompAvg(int block_idx) { |
James Almer | 756717c | 2022-10-19 17:32:48 +0000 | [diff] [blame] | 192 | const uint16_t *const reference16 = GetReference(block_idx); |
| 193 | const uint16_t *const second_pred16 = second_pred_; |
| 194 | uint16_t *const comp_pred16 = comp_pred_; |
Cheng Chen | a0367dc | 2017-11-16 19:20:42 -0800 | [diff] [blame] | 195 | for (int h = 0; h < height_; ++h) { |
| 196 | for (int w = 0; w < width_; ++w) { |
James Almer | 756717c | 2022-10-19 17:32:48 +0000 | [diff] [blame] | 197 | const int tmp = |
| 198 | second_pred16[h * width_ + w] * jcp_param_.bck_offset + |
| 199 | reference16[h * reference_stride_ + w] * jcp_param_.fwd_offset; |
| 200 | comp_pred16[h * width_ + w] = ROUND_POWER_OF_TWO(tmp, 4); |
Cheng Chen | a0367dc | 2017-11-16 19:20:42 -0800 | [diff] [blame] | 201 | } |
| 202 | } |
| 203 | } |
| 204 | |
Debargha Mukherjee | 0c96c11 | 2018-12-20 16:04:18 -0800 | [diff] [blame] | 205 | unsigned int ReferenceDistWtdSADavg(int block_idx) { |
Cheng Chen | a0367dc | 2017-11-16 19:20:42 -0800 | [diff] [blame] | 206 | unsigned int sad = 0; |
James Almer | 756717c | 2022-10-19 17:32:48 +0000 | [diff] [blame] | 207 | const uint16_t *const reference16 = GetReference(block_idx); |
| 208 | const uint16_t *const source16 = source_data_; |
| 209 | const uint16_t *const second_pred16 = second_pred_; |
Cheng Chen | a0367dc | 2017-11-16 19:20:42 -0800 | [diff] [blame] | 210 | for (int h = 0; h < height_; ++h) { |
| 211 | for (int w = 0; w < width_; ++w) { |
James Almer | 756717c | 2022-10-19 17:32:48 +0000 | [diff] [blame] | 212 | const int tmp = |
| 213 | second_pred16[h * width_ + w] * jcp_param_.bck_offset + |
| 214 | reference16[h * reference_stride_ + w] * jcp_param_.fwd_offset; |
| 215 | const uint16_t comp_pred = ROUND_POWER_OF_TWO(tmp, 4); |
| 216 | sad += abs(source16[h * source_stride_ + w] - comp_pred); |
Cheng Chen | a0367dc | 2017-11-16 19:20:42 -0800 | [diff] [blame] | 217 | } |
| 218 | } |
| 219 | return sad; |
| 220 | } |
Cheng Chen | a0367dc | 2017-11-16 19:20:42 -0800 | [diff] [blame] | 221 | |
James Almer | 756717c | 2022-10-19 17:32:48 +0000 | [diff] [blame] | 222 | void FillConstant(uint16_t *data, int stride, uint16_t fill_constant) { |
| 223 | uint16_t *data16 = data; |
Peter de Rivaz | 7eee487 | 2014-10-16 13:41:55 +0100 | [diff] [blame] | 224 | for (int h = 0; h < height_; ++h) { |
| 225 | for (int w = 0; w < width_; ++w) { |
James Almer | 756717c | 2022-10-19 17:32:48 +0000 | [diff] [blame] | 226 | data16[h * stride + w] = fill_constant; |
Johann | fbea897 | 2012-06-28 11:43:58 -0700 | [diff] [blame] | 227 | } |
| 228 | } |
| 229 | } |
| 230 | |
James Almer | 756717c | 2022-10-19 17:32:48 +0000 | [diff] [blame] | 231 | void FillRandom(uint16_t *data, int stride) { |
| 232 | uint16_t *data16 = data; |
Johann | fbea897 | 2012-06-28 11:43:58 -0700 | [diff] [blame] | 233 | for (int h = 0; h < height_; ++h) { |
| 234 | for (int w = 0; w < width_; ++w) { |
James Almer | 756717c | 2022-10-19 17:32:48 +0000 | [diff] [blame] | 235 | data16[h * stride + w] = rnd_.Rand16() & mask_; |
Johann | fbea897 | 2012-06-28 11:43:58 -0700 | [diff] [blame] | 236 | } |
| 237 | } |
| 238 | } |
| 239 | |
Peter de Rivaz | 7eee487 | 2014-10-16 13:41:55 +0100 | [diff] [blame] | 240 | int width_, height_, mask_, bd_; |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 241 | aom_bit_depth_t bit_depth_; |
James Almer | 756717c | 2022-10-19 17:32:48 +0000 | [diff] [blame] | 242 | static uint16_t *source_data_; |
| 243 | static uint16_t *reference_data_; |
| 244 | static uint16_t *second_pred_; |
John Koleszar | 1cfc86e | 2013-03-01 12:43:41 -0800 | [diff] [blame] | 245 | int source_stride_; |
Peter de Rivaz | 7eee487 | 2014-10-16 13:41:55 +0100 | [diff] [blame] | 246 | static uint16_t *source_data16_; |
| 247 | static uint16_t *reference_data16_; |
| 248 | static uint16_t *second_pred16_; |
John Koleszar | 1cfc86e | 2013-03-01 12:43:41 -0800 | [diff] [blame] | 249 | int reference_stride_; |
James Almer | 756717c | 2022-10-19 17:32:48 +0000 | [diff] [blame] | 250 | static uint16_t *comp_pred_; |
Cheng Chen | a0367dc | 2017-11-16 19:20:42 -0800 | [diff] [blame] | 251 | static uint16_t *comp_pred16_; |
James Almer | 756717c | 2022-10-19 17:32:48 +0000 | [diff] [blame] | 252 | static uint16_t *comp_pred_test_; |
Cheng Chen | a0367dc | 2017-11-16 19:20:42 -0800 | [diff] [blame] | 253 | static uint16_t *comp_pred16_test_; |
Debargha Mukherjee | f90004a | 2018-12-20 13:35:06 -0800 | [diff] [blame] | 254 | DIST_WTD_COMP_PARAMS jcp_param_; |
John Koleszar | 1cfc86e | 2013-03-01 12:43:41 -0800 | [diff] [blame] | 255 | |
| 256 | ACMRandom rnd_; |
| 257 | }; |
| 258 | |
Sebastien Alaiwan | 4322bc1 | 2017-06-05 10:18:28 +0200 | [diff] [blame] | 259 | class SADx4Test : public ::testing::WithParamInterface<SadMxNx4Param>, |
| 260 | public SADTestBase { |
John Koleszar | 1cfc86e | 2013-03-01 12:43:41 -0800 | [diff] [blame] | 261 | public: |
Peter de Rivaz | 7eee487 | 2014-10-16 13:41:55 +0100 | [diff] [blame] | 262 | SADx4Test() : SADTestBase(GET_PARAM(0), GET_PARAM(1), GET_PARAM(3)) {} |
John Koleszar | 1cfc86e | 2013-03-01 12:43:41 -0800 | [diff] [blame] | 263 | |
| 264 | protected: |
| 265 | void SADs(unsigned int *results) { |
James Almer | 756717c | 2022-10-19 17:32:48 +0000 | [diff] [blame] | 266 | const uint16_t *references[] = { GetReference(0), GetReference(1), |
| 267 | GetReference(2), GetReference(3) }; |
John Koleszar | 1cfc86e | 2013-03-01 12:43:41 -0800 | [diff] [blame] | 268 | |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 269 | ASM_REGISTER_STATE_CHECK(GET_PARAM(2)( |
| 270 | source_data_, source_stride_, references, reference_stride_, results)); |
John Koleszar | 1cfc86e | 2013-03-01 12:43:41 -0800 | [diff] [blame] | 271 | } |
| 272 | |
| 273 | void CheckSADs() { |
| 274 | unsigned int reference_sad, exp_sad[4]; |
| 275 | |
| 276 | SADs(exp_sad); |
Deb Mukherjee | fc88292 | 2014-05-13 10:11:42 -0700 | [diff] [blame] | 277 | for (int block = 0; block < 4; ++block) { |
Johann | d5d9289 | 2015-04-17 16:11:38 -0400 | [diff] [blame] | 278 | reference_sad = ReferenceSAD(block); |
John Koleszar | 1cfc86e | 2013-03-01 12:43:41 -0800 | [diff] [blame] | 279 | |
Deb Mukherjee | fc88292 | 2014-05-13 10:11:42 -0700 | [diff] [blame] | 280 | EXPECT_EQ(reference_sad, exp_sad[block]) << "block " << block; |
John Koleszar | 1cfc86e | 2013-03-01 12:43:41 -0800 | [diff] [blame] | 281 | } |
| 282 | } |
chiyotsai | c814afb | 2020-08-04 13:12:35 -0700 | [diff] [blame] | 283 | |
| 284 | void SpeedSAD() { |
| 285 | int test_count = 2000000; |
| 286 | unsigned int exp_sad[4]; |
| 287 | while (test_count > 0) { |
| 288 | SADs(exp_sad); |
| 289 | test_count -= 1; |
| 290 | } |
| 291 | } |
| 292 | }; |
| 293 | |
| 294 | class SADSkipx4Test : public ::testing::WithParamInterface<SadMxNx4Param>, |
| 295 | public SADTestBase { |
| 296 | public: |
| 297 | SADSkipx4Test() : SADTestBase(GET_PARAM(0), GET_PARAM(1), GET_PARAM(3)) {} |
| 298 | |
| 299 | protected: |
| 300 | void SADs(unsigned int *results) { |
James Almer | 756717c | 2022-10-19 17:32:48 +0000 | [diff] [blame] | 301 | const uint16_t *references[] = { GetReference(0), GetReference(1), |
| 302 | GetReference(2), GetReference(3) }; |
chiyotsai | c814afb | 2020-08-04 13:12:35 -0700 | [diff] [blame] | 303 | |
| 304 | ASM_REGISTER_STATE_CHECK(GET_PARAM(2)( |
| 305 | source_data_, source_stride_, references, reference_stride_, results)); |
| 306 | } |
| 307 | |
| 308 | void CheckSADs() { |
| 309 | unsigned int reference_sad, exp_sad[4]; |
| 310 | |
| 311 | SADs(exp_sad); |
| 312 | for (int block = 0; block < 4; ++block) { |
| 313 | reference_sad = ReferenceSADSkip(block); |
| 314 | |
| 315 | EXPECT_EQ(reference_sad, exp_sad[block]) << "block " << block; |
| 316 | } |
| 317 | } |
| 318 | |
| 319 | void SpeedSAD() { |
| 320 | int test_count = 2000000; |
| 321 | unsigned int exp_sad[4]; |
| 322 | while (test_count > 0) { |
| 323 | SADs(exp_sad); |
| 324 | test_count -= 1; |
| 325 | } |
| 326 | } |
John Koleszar | 1cfc86e | 2013-03-01 12:43:41 -0800 | [diff] [blame] | 327 | }; |
| 328 | |
Ruiling Song | 8dc32d7 | 2020-01-20 15:33:37 +0800 | [diff] [blame] | 329 | class SADx4AvgTest : public ::testing::WithParamInterface<SadMxNx4AvgParam>, |
| 330 | public SADTestBase { |
| 331 | public: |
| 332 | SADx4AvgTest() : SADTestBase(GET_PARAM(0), GET_PARAM(1), GET_PARAM(3)) {} |
| 333 | |
| 334 | protected: |
| 335 | void SADs(unsigned int *results) { |
James Almer | 756717c | 2022-10-19 17:32:48 +0000 | [diff] [blame] | 336 | const uint16_t *references[] = { GetReference(0), GetReference(1), |
| 337 | GetReference(2), GetReference(3) }; |
Ruiling Song | 8dc32d7 | 2020-01-20 15:33:37 +0800 | [diff] [blame] | 338 | |
| 339 | ASM_REGISTER_STATE_CHECK(GET_PARAM(2)(source_data_, source_stride_, |
| 340 | references, reference_stride_, |
| 341 | second_pred_, results)); |
| 342 | } |
| 343 | |
| 344 | void CheckSADs() { |
| 345 | unsigned int reference_sad, exp_sad[4]; |
| 346 | |
| 347 | SADs(exp_sad); |
| 348 | for (int block = 0; block < 4; ++block) { |
| 349 | reference_sad = ReferenceSADavg(block); |
| 350 | |
| 351 | EXPECT_EQ(reference_sad, exp_sad[block]) << "block " << block; |
| 352 | } |
| 353 | } |
| 354 | |
| 355 | void SpeedSAD() { |
| 356 | int test_count = 200000; |
| 357 | unsigned int exp_sad[4]; |
| 358 | while (test_count > 0) { |
| 359 | SADs(exp_sad); |
| 360 | test_count -= 1; |
| 361 | } |
| 362 | } |
| 363 | }; |
James Almer | 857e93f | 2022-05-25 16:44:43 +0000 | [diff] [blame] | 364 | GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(SADx4AvgTest); |
Ruiling Song | 8dc32d7 | 2020-01-20 15:33:37 +0800 | [diff] [blame] | 365 | |
Sebastien Alaiwan | 4322bc1 | 2017-06-05 10:18:28 +0200 | [diff] [blame] | 366 | class SADTest : public ::testing::WithParamInterface<SadMxNParam>, |
| 367 | public SADTestBase { |
Deb Mukherjee | fc88292 | 2014-05-13 10:11:42 -0700 | [diff] [blame] | 368 | public: |
Peter de Rivaz | 7eee487 | 2014-10-16 13:41:55 +0100 | [diff] [blame] | 369 | SADTest() : SADTestBase(GET_PARAM(0), GET_PARAM(1), GET_PARAM(3)) {} |
Deb Mukherjee | fc88292 | 2014-05-13 10:11:42 -0700 | [diff] [blame] | 370 | |
| 371 | protected: |
Deb Mukherjee | fc88292 | 2014-05-13 10:11:42 -0700 | [diff] [blame] | 372 | unsigned int SAD(int block_idx) { |
| 373 | unsigned int ret; |
James Almer | 756717c | 2022-10-19 17:32:48 +0000 | [diff] [blame] | 374 | const uint16_t *const reference = GetReference(block_idx); |
Deb Mukherjee | fc88292 | 2014-05-13 10:11:42 -0700 | [diff] [blame] | 375 | |
James Zern | 29e1b1a | 2014-07-09 21:02:02 -0700 | [diff] [blame] | 376 | ASM_REGISTER_STATE_CHECK(ret = GET_PARAM(2)(source_data_, source_stride_, |
| 377 | reference, reference_stride_)); |
Deb Mukherjee | fc88292 | 2014-05-13 10:11:42 -0700 | [diff] [blame] | 378 | return ret; |
| 379 | } |
| 380 | |
| 381 | void CheckSAD() { |
Johann | d5d9289 | 2015-04-17 16:11:38 -0400 | [diff] [blame] | 382 | const unsigned int reference_sad = ReferenceSAD(0); |
Deb Mukherjee | fc88292 | 2014-05-13 10:11:42 -0700 | [diff] [blame] | 383 | const unsigned int exp_sad = SAD(0); |
| 384 | |
| 385 | ASSERT_EQ(reference_sad, exp_sad); |
| 386 | } |
Yi Luo | e983258 | 2016-11-29 19:38:12 -0800 | [diff] [blame] | 387 | |
| 388 | void SpeedSAD() { |
| 389 | int test_count = 20000000; |
| 390 | while (test_count > 0) { |
| 391 | SAD(0); |
| 392 | test_count -= 1; |
| 393 | } |
| 394 | } |
Deb Mukherjee | fc88292 | 2014-05-13 10:11:42 -0700 | [diff] [blame] | 395 | }; |
Peter de Rivaz | 7eee487 | 2014-10-16 13:41:55 +0100 | [diff] [blame] | 396 | |
chiyotsai | c814afb | 2020-08-04 13:12:35 -0700 | [diff] [blame] | 397 | class SADSkipTest : public ::testing::WithParamInterface<SadMxNParam>, |
| 398 | public SADTestBase { |
| 399 | public: |
| 400 | SADSkipTest() : SADTestBase(GET_PARAM(0), GET_PARAM(1), GET_PARAM(3)) {} |
| 401 | |
| 402 | protected: |
| 403 | unsigned int SAD(int block_idx) { |
| 404 | unsigned int ret; |
James Almer | 756717c | 2022-10-19 17:32:48 +0000 | [diff] [blame] | 405 | const uint16_t *const reference = GetReference(block_idx); |
chiyotsai | c814afb | 2020-08-04 13:12:35 -0700 | [diff] [blame] | 406 | |
| 407 | ASM_REGISTER_STATE_CHECK(ret = GET_PARAM(2)(source_data_, source_stride_, |
| 408 | reference, reference_stride_)); |
| 409 | return ret; |
| 410 | } |
| 411 | |
| 412 | void CheckSAD() { |
| 413 | const unsigned int reference_sad = ReferenceSADSkip(0); |
| 414 | const unsigned int exp_sad = SAD(0); |
| 415 | |
| 416 | ASSERT_EQ(reference_sad, exp_sad); |
| 417 | } |
| 418 | |
| 419 | void SpeedSAD() { |
| 420 | int test_count = 20000000; |
| 421 | while (test_count > 0) { |
| 422 | SAD(0); |
| 423 | test_count -= 1; |
| 424 | } |
| 425 | } |
| 426 | }; |
| 427 | |
Sebastien Alaiwan | 4322bc1 | 2017-06-05 10:18:28 +0200 | [diff] [blame] | 428 | class SADavgTest : public ::testing::WithParamInterface<SadMxNAvgParam>, |
| 429 | public SADTestBase { |
Peter de Rivaz | 7eee487 | 2014-10-16 13:41:55 +0100 | [diff] [blame] | 430 | public: |
Johann | d5d9289 | 2015-04-17 16:11:38 -0400 | [diff] [blame] | 431 | SADavgTest() : SADTestBase(GET_PARAM(0), GET_PARAM(1), GET_PARAM(3)) {} |
Peter de Rivaz | 7eee487 | 2014-10-16 13:41:55 +0100 | [diff] [blame] | 432 | |
| 433 | protected: |
| 434 | unsigned int SAD_avg(int block_idx) { |
| 435 | unsigned int ret; |
James Almer | 756717c | 2022-10-19 17:32:48 +0000 | [diff] [blame] | 436 | const uint16_t *const reference = GetReference(block_idx); |
Peter de Rivaz | 7eee487 | 2014-10-16 13:41:55 +0100 | [diff] [blame] | 437 | |
| 438 | ASM_REGISTER_STATE_CHECK(ret = GET_PARAM(2)(source_data_, source_stride_, |
| 439 | reference, reference_stride_, |
| 440 | second_pred_)); |
| 441 | return ret; |
| 442 | } |
| 443 | |
| 444 | void CheckSAD() { |
Johann | d5d9289 | 2015-04-17 16:11:38 -0400 | [diff] [blame] | 445 | const unsigned int reference_sad = ReferenceSADavg(0); |
Peter de Rivaz | 7eee487 | 2014-10-16 13:41:55 +0100 | [diff] [blame] | 446 | const unsigned int exp_sad = SAD_avg(0); |
| 447 | |
| 448 | ASSERT_EQ(reference_sad, exp_sad); |
| 449 | } |
| 450 | }; |
Deb Mukherjee | fc88292 | 2014-05-13 10:11:42 -0700 | [diff] [blame] | 451 | |
Debargha Mukherjee | 0c96c11 | 2018-12-20 16:04:18 -0800 | [diff] [blame] | 452 | class DistWtdCompAvgTest |
| 453 | : public ::testing::WithParamInterface<DistWtdCompAvgParam>, |
| 454 | public SADTestBase { |
Cheng Chen | a0367dc | 2017-11-16 19:20:42 -0800 | [diff] [blame] | 455 | public: |
Debargha Mukherjee | 0c96c11 | 2018-12-20 16:04:18 -0800 | [diff] [blame] | 456 | DistWtdCompAvgTest() |
| 457 | : SADTestBase(GET_PARAM(0), GET_PARAM(1), GET_PARAM(3)) {} |
Cheng Chen | a0367dc | 2017-11-16 19:20:42 -0800 | [diff] [blame] | 458 | |
| 459 | protected: |
Debargha Mukherjee | 0c96c11 | 2018-12-20 16:04:18 -0800 | [diff] [blame] | 460 | void dist_wtd_comp_avg(int block_idx) { |
James Almer | 756717c | 2022-10-19 17:32:48 +0000 | [diff] [blame] | 461 | const uint16_t *const reference = GetReference(block_idx); |
Cheng Chen | a0367dc | 2017-11-16 19:20:42 -0800 | [diff] [blame] | 462 | |
| 463 | ASM_REGISTER_STATE_CHECK(GET_PARAM(2)(comp_pred_test_, second_pred_, width_, |
| 464 | height_, reference, reference_stride_, |
| 465 | &jcp_param_)); |
| 466 | } |
| 467 | |
| 468 | void CheckCompAvg() { |
| 469 | for (int j = 0; j < 2; ++j) { |
| 470 | for (int i = 0; i < 4; ++i) { |
Urvang Joshi | f96d93f | 2021-05-10 13:53:07 -0700 | [diff] [blame] | 471 | jcp_param_.fwd_offset = quant_dist_lookup_table[i][j]; |
| 472 | jcp_param_.bck_offset = quant_dist_lookup_table[i][1 - j]; |
Cheng Chen | a0367dc | 2017-11-16 19:20:42 -0800 | [diff] [blame] | 473 | |
Debargha Mukherjee | 0c96c11 | 2018-12-20 16:04:18 -0800 | [diff] [blame] | 474 | ReferenceDistWtdCompAvg(0); |
| 475 | dist_wtd_comp_avg(0); |
Cheng Chen | a0367dc | 2017-11-16 19:20:42 -0800 | [diff] [blame] | 476 | |
| 477 | for (int y = 0; y < height_; ++y) |
| 478 | for (int x = 0; x < width_; ++x) |
| 479 | ASSERT_EQ(comp_pred_[y * width_ + x], |
| 480 | comp_pred_test_[y * width_ + x]); |
| 481 | } |
| 482 | } |
| 483 | } |
| 484 | }; |
James Almer | 857e93f | 2022-05-25 16:44:43 +0000 | [diff] [blame] | 485 | GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(DistWtdCompAvgTest); |
Cheng Chen | a0367dc | 2017-11-16 19:20:42 -0800 | [diff] [blame] | 486 | |
Debargha Mukherjee | 0c96c11 | 2018-12-20 16:04:18 -0800 | [diff] [blame] | 487 | class DistWtdSADTest : public ::testing::WithParamInterface<DistWtdSadMxhParam>, |
| 488 | public SADTestBase { |
Cheng Chen | a0367dc | 2017-11-16 19:20:42 -0800 | [diff] [blame] | 489 | public: |
Debargha Mukherjee | 0c96c11 | 2018-12-20 16:04:18 -0800 | [diff] [blame] | 490 | DistWtdSADTest() : SADTestBase(GET_PARAM(0), GET_PARAM(1), GET_PARAM(3)) {} |
Cheng Chen | a0367dc | 2017-11-16 19:20:42 -0800 | [diff] [blame] | 491 | |
| 492 | protected: |
| 493 | unsigned int SAD(int block_idx) { |
| 494 | unsigned int ret; |
James Almer | 756717c | 2022-10-19 17:32:48 +0000 | [diff] [blame] | 495 | const uint16_t *const reference = GetReference(block_idx); |
Cheng Chen | a0367dc | 2017-11-16 19:20:42 -0800 | [diff] [blame] | 496 | |
| 497 | ASM_REGISTER_STATE_CHECK(ret = GET_PARAM(2)(source_data_, source_stride_, |
| 498 | reference, reference_stride_, |
| 499 | GET_PARAM(0), GET_PARAM(1))); |
| 500 | return ret; |
| 501 | } |
| 502 | |
| 503 | void CheckSAD() { |
| 504 | const unsigned int reference_sad = ReferenceSAD(0); |
| 505 | const unsigned int exp_sad = SAD(0); |
| 506 | |
| 507 | ASSERT_EQ(reference_sad, exp_sad); |
| 508 | } |
| 509 | |
| 510 | void SpeedSAD() { |
| 511 | int test_count = 20000000; |
| 512 | while (test_count > 0) { |
| 513 | SAD(0); |
| 514 | test_count -= 1; |
| 515 | } |
| 516 | } |
| 517 | }; |
chiyotsai | 9dfac72 | 2020-07-07 17:43:02 -0700 | [diff] [blame] | 518 | GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(DistWtdSADTest); |
Cheng Chen | a0367dc | 2017-11-16 19:20:42 -0800 | [diff] [blame] | 519 | |
Debargha Mukherjee | 0c96c11 | 2018-12-20 16:04:18 -0800 | [diff] [blame] | 520 | class DistWtdSADavgTest |
| 521 | : public ::testing::WithParamInterface<DistWtdSadMxNAvgParam>, |
| 522 | public SADTestBase { |
Cheng Chen | a0367dc | 2017-11-16 19:20:42 -0800 | [diff] [blame] | 523 | public: |
Debargha Mukherjee | 0c96c11 | 2018-12-20 16:04:18 -0800 | [diff] [blame] | 524 | DistWtdSADavgTest() : SADTestBase(GET_PARAM(0), GET_PARAM(1), GET_PARAM(3)) {} |
Cheng Chen | a0367dc | 2017-11-16 19:20:42 -0800 | [diff] [blame] | 525 | |
| 526 | protected: |
Debargha Mukherjee | 0c96c11 | 2018-12-20 16:04:18 -0800 | [diff] [blame] | 527 | unsigned int dist_wtd_SAD_avg(int block_idx) { |
Cheng Chen | a0367dc | 2017-11-16 19:20:42 -0800 | [diff] [blame] | 528 | unsigned int ret; |
James Almer | 756717c | 2022-10-19 17:32:48 +0000 | [diff] [blame] | 529 | const uint16_t *const reference = GetReference(block_idx); |
Cheng Chen | a0367dc | 2017-11-16 19:20:42 -0800 | [diff] [blame] | 530 | |
| 531 | ASM_REGISTER_STATE_CHECK(ret = GET_PARAM(2)(source_data_, source_stride_, |
| 532 | reference, reference_stride_, |
| 533 | second_pred_, &jcp_param_)); |
| 534 | return ret; |
| 535 | } |
| 536 | |
| 537 | void CheckSAD() { |
| 538 | for (int j = 0; j < 2; ++j) { |
| 539 | for (int i = 0; i < 4; ++i) { |
Urvang Joshi | f96d93f | 2021-05-10 13:53:07 -0700 | [diff] [blame] | 540 | jcp_param_.fwd_offset = quant_dist_lookup_table[i][j]; |
| 541 | jcp_param_.bck_offset = quant_dist_lookup_table[i][1 - j]; |
Cheng Chen | a0367dc | 2017-11-16 19:20:42 -0800 | [diff] [blame] | 542 | |
Debargha Mukherjee | 0c96c11 | 2018-12-20 16:04:18 -0800 | [diff] [blame] | 543 | const unsigned int reference_sad = ReferenceDistWtdSADavg(0); |
| 544 | const unsigned int exp_sad = dist_wtd_SAD_avg(0); |
Cheng Chen | a0367dc | 2017-11-16 19:20:42 -0800 | [diff] [blame] | 545 | |
| 546 | ASSERT_EQ(reference_sad, exp_sad); |
| 547 | } |
| 548 | } |
| 549 | } |
| 550 | }; |
James Almer | 857e93f | 2022-05-25 16:44:43 +0000 | [diff] [blame] | 551 | GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(DistWtdSADavgTest); |
Cheng Chen | a0367dc | 2017-11-16 19:20:42 -0800 | [diff] [blame] | 552 | |
James Almer | 756717c | 2022-10-19 17:32:48 +0000 | [diff] [blame] | 553 | uint16_t *SADTestBase::source_data_ = NULL; |
| 554 | uint16_t *SADTestBase::reference_data_ = NULL; |
| 555 | uint16_t *SADTestBase::second_pred_ = NULL; |
| 556 | uint16_t *SADTestBase::comp_pred_ = NULL; |
| 557 | uint16_t *SADTestBase::comp_pred_test_ = NULL; |
Peter de Rivaz | 7eee487 | 2014-10-16 13:41:55 +0100 | [diff] [blame] | 558 | uint16_t *SADTestBase::source_data16_ = NULL; |
| 559 | uint16_t *SADTestBase::reference_data16_ = NULL; |
| 560 | uint16_t *SADTestBase::second_pred16_ = NULL; |
Cheng Chen | a0367dc | 2017-11-16 19:20:42 -0800 | [diff] [blame] | 561 | uint16_t *SADTestBase::comp_pred16_ = NULL; |
| 562 | uint16_t *SADTestBase::comp_pred16_test_ = NULL; |
James Zern | 10f8b36 | 2012-08-27 17:13:09 -0700 | [diff] [blame] | 563 | |
Johann | fbea897 | 2012-06-28 11:43:58 -0700 | [diff] [blame] | 564 | TEST_P(SADTest, MaxRef) { |
| 565 | FillConstant(source_data_, source_stride_, 0); |
Peter de Rivaz | 7eee487 | 2014-10-16 13:41:55 +0100 | [diff] [blame] | 566 | FillConstant(reference_data_, reference_stride_, mask_); |
Johann | d5d9289 | 2015-04-17 16:11:38 -0400 | [diff] [blame] | 567 | CheckSAD(); |
Johann | fbea897 | 2012-06-28 11:43:58 -0700 | [diff] [blame] | 568 | } |
| 569 | |
Deb Mukherjee | fc88292 | 2014-05-13 10:11:42 -0700 | [diff] [blame] | 570 | TEST_P(SADTest, MaxSrc) { |
Peter de Rivaz | 7eee487 | 2014-10-16 13:41:55 +0100 | [diff] [blame] | 571 | FillConstant(source_data_, source_stride_, mask_); |
Deb Mukherjee | fc88292 | 2014-05-13 10:11:42 -0700 | [diff] [blame] | 572 | FillConstant(reference_data_, reference_stride_, 0); |
Johann | d5d9289 | 2015-04-17 16:11:38 -0400 | [diff] [blame] | 573 | CheckSAD(); |
Deb Mukherjee | fc88292 | 2014-05-13 10:11:42 -0700 | [diff] [blame] | 574 | } |
| 575 | |
| 576 | TEST_P(SADTest, ShortRef) { |
Johann | d5d9289 | 2015-04-17 16:11:38 -0400 | [diff] [blame] | 577 | const int tmp_stride = reference_stride_; |
Deb Mukherjee | fc88292 | 2014-05-13 10:11:42 -0700 | [diff] [blame] | 578 | reference_stride_ >>= 1; |
| 579 | FillRandom(source_data_, source_stride_); |
| 580 | FillRandom(reference_data_, reference_stride_); |
Johann | d5d9289 | 2015-04-17 16:11:38 -0400 | [diff] [blame] | 581 | CheckSAD(); |
Deb Mukherjee | fc88292 | 2014-05-13 10:11:42 -0700 | [diff] [blame] | 582 | reference_stride_ = tmp_stride; |
| 583 | } |
| 584 | |
| 585 | TEST_P(SADTest, UnalignedRef) { |
| 586 | // The reference frame, but not the source frame, may be unaligned for |
| 587 | // certain types of searches. |
| 588 | const int tmp_stride = reference_stride_; |
| 589 | reference_stride_ -= 1; |
| 590 | FillRandom(source_data_, source_stride_); |
| 591 | FillRandom(reference_data_, reference_stride_); |
Johann | d5d9289 | 2015-04-17 16:11:38 -0400 | [diff] [blame] | 592 | CheckSAD(); |
Deb Mukherjee | fc88292 | 2014-05-13 10:11:42 -0700 | [diff] [blame] | 593 | reference_stride_ = tmp_stride; |
| 594 | } |
| 595 | |
| 596 | TEST_P(SADTest, ShortSrc) { |
| 597 | const int tmp_stride = source_stride_; |
| 598 | source_stride_ >>= 1; |
Yi Luo | e983258 | 2016-11-29 19:38:12 -0800 | [diff] [blame] | 599 | int test_count = 2000; |
| 600 | while (test_count > 0) { |
| 601 | FillRandom(source_data_, source_stride_); |
| 602 | FillRandom(reference_data_, reference_stride_); |
| 603 | CheckSAD(); |
| 604 | test_count -= 1; |
| 605 | } |
Deb Mukherjee | fc88292 | 2014-05-13 10:11:42 -0700 | [diff] [blame] | 606 | source_stride_ = tmp_stride; |
| 607 | } |
Peter de Rivaz | 7eee487 | 2014-10-16 13:41:55 +0100 | [diff] [blame] | 608 | |
Sarah Parker | d1da748 | 2021-04-16 17:39:25 -0700 | [diff] [blame] | 609 | TEST_P(SADTest, DISABLED_Speed) { |
Yi Luo | e983258 | 2016-11-29 19:38:12 -0800 | [diff] [blame] | 610 | const int tmp_stride = source_stride_; |
| 611 | source_stride_ >>= 1; |
| 612 | FillRandom(source_data_, source_stride_); |
| 613 | FillRandom(reference_data_, reference_stride_); |
| 614 | SpeedSAD(); |
| 615 | source_stride_ = tmp_stride; |
| 616 | } |
Yi Luo | e983258 | 2016-11-29 19:38:12 -0800 | [diff] [blame] | 617 | |
chiyotsai | c814afb | 2020-08-04 13:12:35 -0700 | [diff] [blame] | 618 | TEST_P(SADSkipTest, MaxRef) { |
| 619 | FillConstant(source_data_, source_stride_, 0); |
| 620 | FillConstant(reference_data_, reference_stride_, mask_); |
| 621 | CheckSAD(); |
| 622 | } |
| 623 | |
| 624 | TEST_P(SADSkipTest, MaxSrc) { |
| 625 | FillConstant(source_data_, source_stride_, mask_); |
| 626 | FillConstant(reference_data_, reference_stride_, 0); |
| 627 | CheckSAD(); |
| 628 | } |
| 629 | |
| 630 | TEST_P(SADSkipTest, ShortRef) { |
| 631 | const int tmp_stride = reference_stride_; |
| 632 | reference_stride_ >>= 1; |
| 633 | FillRandom(source_data_, source_stride_); |
| 634 | FillRandom(reference_data_, reference_stride_); |
| 635 | CheckSAD(); |
| 636 | reference_stride_ = tmp_stride; |
| 637 | } |
| 638 | |
| 639 | TEST_P(SADSkipTest, UnalignedRef) { |
| 640 | // The reference frame, but not the source frame, may be unaligned for |
| 641 | // certain types of searches. |
| 642 | const int tmp_stride = reference_stride_; |
| 643 | reference_stride_ -= 1; |
| 644 | FillRandom(source_data_, source_stride_); |
| 645 | FillRandom(reference_data_, reference_stride_); |
| 646 | CheckSAD(); |
| 647 | reference_stride_ = tmp_stride; |
| 648 | } |
| 649 | |
| 650 | TEST_P(SADSkipTest, ShortSrc) { |
| 651 | const int tmp_stride = source_stride_; |
| 652 | source_stride_ >>= 1; |
| 653 | int test_count = 2000; |
| 654 | while (test_count > 0) { |
| 655 | FillRandom(source_data_, source_stride_); |
| 656 | FillRandom(reference_data_, reference_stride_); |
| 657 | CheckSAD(); |
| 658 | test_count -= 1; |
| 659 | } |
| 660 | source_stride_ = tmp_stride; |
| 661 | } |
| 662 | |
Sarah Parker | d1da748 | 2021-04-16 17:39:25 -0700 | [diff] [blame] | 663 | TEST_P(SADSkipTest, DISABLED_Speed) { |
chiyotsai | c814afb | 2020-08-04 13:12:35 -0700 | [diff] [blame] | 664 | const int tmp_stride = source_stride_; |
| 665 | source_stride_ >>= 1; |
| 666 | FillRandom(source_data_, source_stride_); |
| 667 | FillRandom(reference_data_, reference_stride_); |
| 668 | SpeedSAD(); |
| 669 | source_stride_ = tmp_stride; |
| 670 | } |
chiyotsai | c814afb | 2020-08-04 13:12:35 -0700 | [diff] [blame] | 671 | |
Johann | d5d9289 | 2015-04-17 16:11:38 -0400 | [diff] [blame] | 672 | TEST_P(SADavgTest, MaxRef) { |
Peter de Rivaz | 7eee487 | 2014-10-16 13:41:55 +0100 | [diff] [blame] | 673 | FillConstant(source_data_, source_stride_, 0); |
| 674 | FillConstant(reference_data_, reference_stride_, mask_); |
| 675 | FillConstant(second_pred_, width_, 0); |
| 676 | CheckSAD(); |
| 677 | } |
Johann | d5d9289 | 2015-04-17 16:11:38 -0400 | [diff] [blame] | 678 | TEST_P(SADavgTest, MaxSrc) { |
Peter de Rivaz | 7eee487 | 2014-10-16 13:41:55 +0100 | [diff] [blame] | 679 | FillConstant(source_data_, source_stride_, mask_); |
| 680 | FillConstant(reference_data_, reference_stride_, 0); |
| 681 | FillConstant(second_pred_, width_, 0); |
| 682 | CheckSAD(); |
| 683 | } |
| 684 | |
Johann | d5d9289 | 2015-04-17 16:11:38 -0400 | [diff] [blame] | 685 | TEST_P(SADavgTest, ShortRef) { |
Peter de Rivaz | 7eee487 | 2014-10-16 13:41:55 +0100 | [diff] [blame] | 686 | const int tmp_stride = reference_stride_; |
| 687 | reference_stride_ >>= 1; |
| 688 | FillRandom(source_data_, source_stride_); |
| 689 | FillRandom(reference_data_, reference_stride_); |
| 690 | FillRandom(second_pred_, width_); |
| 691 | CheckSAD(); |
| 692 | reference_stride_ = tmp_stride; |
| 693 | } |
| 694 | |
Johann | d5d9289 | 2015-04-17 16:11:38 -0400 | [diff] [blame] | 695 | TEST_P(SADavgTest, UnalignedRef) { |
Peter de Rivaz | 7eee487 | 2014-10-16 13:41:55 +0100 | [diff] [blame] | 696 | // The reference frame, but not the source frame, may be unaligned for |
| 697 | // certain types of searches. |
| 698 | const int tmp_stride = reference_stride_; |
| 699 | reference_stride_ -= 1; |
| 700 | FillRandom(source_data_, source_stride_); |
| 701 | FillRandom(reference_data_, reference_stride_); |
| 702 | FillRandom(second_pred_, width_); |
| 703 | CheckSAD(); |
| 704 | reference_stride_ = tmp_stride; |
| 705 | } |
| 706 | |
Johann | d5d9289 | 2015-04-17 16:11:38 -0400 | [diff] [blame] | 707 | TEST_P(SADavgTest, ShortSrc) { |
Peter de Rivaz | 7eee487 | 2014-10-16 13:41:55 +0100 | [diff] [blame] | 708 | const int tmp_stride = source_stride_; |
| 709 | source_stride_ >>= 1; |
Yi Luo | e983258 | 2016-11-29 19:38:12 -0800 | [diff] [blame] | 710 | int test_count = 2000; |
| 711 | while (test_count > 0) { |
| 712 | FillRandom(source_data_, source_stride_); |
| 713 | FillRandom(reference_data_, reference_stride_); |
| 714 | FillRandom(second_pred_, width_); |
| 715 | CheckSAD(); |
| 716 | test_count -= 1; |
| 717 | } |
Peter de Rivaz | 7eee487 | 2014-10-16 13:41:55 +0100 | [diff] [blame] | 718 | source_stride_ = tmp_stride; |
| 719 | } |
Deb Mukherjee | fc88292 | 2014-05-13 10:11:42 -0700 | [diff] [blame] | 720 | |
Debargha Mukherjee | 0c96c11 | 2018-12-20 16:04:18 -0800 | [diff] [blame] | 721 | TEST_P(DistWtdCompAvgTest, MaxRef) { |
Cheng Chen | a0367dc | 2017-11-16 19:20:42 -0800 | [diff] [blame] | 722 | FillConstant(reference_data_, reference_stride_, mask_); |
| 723 | FillConstant(second_pred_, width_, 0); |
| 724 | CheckCompAvg(); |
| 725 | } |
| 726 | |
Debargha Mukherjee | 0c96c11 | 2018-12-20 16:04:18 -0800 | [diff] [blame] | 727 | TEST_P(DistWtdCompAvgTest, MaxSecondPred) { |
Cheng Chen | a0367dc | 2017-11-16 19:20:42 -0800 | [diff] [blame] | 728 | FillConstant(reference_data_, reference_stride_, 0); |
| 729 | FillConstant(second_pred_, width_, mask_); |
| 730 | CheckCompAvg(); |
| 731 | } |
| 732 | |
Debargha Mukherjee | 0c96c11 | 2018-12-20 16:04:18 -0800 | [diff] [blame] | 733 | TEST_P(DistWtdCompAvgTest, ShortRef) { |
Cheng Chen | a0367dc | 2017-11-16 19:20:42 -0800 | [diff] [blame] | 734 | const int tmp_stride = reference_stride_; |
| 735 | reference_stride_ >>= 1; |
| 736 | FillRandom(reference_data_, reference_stride_); |
| 737 | FillRandom(second_pred_, width_); |
| 738 | CheckCompAvg(); |
| 739 | reference_stride_ = tmp_stride; |
| 740 | } |
| 741 | |
Debargha Mukherjee | 0c96c11 | 2018-12-20 16:04:18 -0800 | [diff] [blame] | 742 | TEST_P(DistWtdCompAvgTest, UnalignedRef) { |
Cheng Chen | a0367dc | 2017-11-16 19:20:42 -0800 | [diff] [blame] | 743 | // The reference frame, but not the source frame, may be unaligned for |
| 744 | // certain types of searches. |
| 745 | const int tmp_stride = reference_stride_; |
| 746 | reference_stride_ -= 1; |
| 747 | FillRandom(reference_data_, reference_stride_); |
| 748 | FillRandom(second_pred_, width_); |
| 749 | CheckCompAvg(); |
| 750 | reference_stride_ = tmp_stride; |
| 751 | } |
| 752 | |
Debargha Mukherjee | 0c96c11 | 2018-12-20 16:04:18 -0800 | [diff] [blame] | 753 | TEST_P(DistWtdSADTest, MaxRef) { |
Cheng Chen | a0367dc | 2017-11-16 19:20:42 -0800 | [diff] [blame] | 754 | FillConstant(source_data_, source_stride_, 0); |
| 755 | FillConstant(reference_data_, reference_stride_, mask_); |
| 756 | CheckSAD(); |
| 757 | } |
| 758 | |
Debargha Mukherjee | 0c96c11 | 2018-12-20 16:04:18 -0800 | [diff] [blame] | 759 | TEST_P(DistWtdSADTest, MaxSrc) { |
Cheng Chen | a0367dc | 2017-11-16 19:20:42 -0800 | [diff] [blame] | 760 | FillConstant(source_data_, source_stride_, mask_); |
| 761 | FillConstant(reference_data_, reference_stride_, 0); |
| 762 | CheckSAD(); |
| 763 | } |
| 764 | |
Debargha Mukherjee | 0c96c11 | 2018-12-20 16:04:18 -0800 | [diff] [blame] | 765 | TEST_P(DistWtdSADTest, ShortRef) { |
Cheng Chen | a0367dc | 2017-11-16 19:20:42 -0800 | [diff] [blame] | 766 | const int tmp_stride = reference_stride_; |
| 767 | reference_stride_ >>= 1; |
| 768 | FillRandom(source_data_, source_stride_); |
| 769 | FillRandom(reference_data_, reference_stride_); |
| 770 | CheckSAD(); |
| 771 | reference_stride_ = tmp_stride; |
| 772 | } |
| 773 | |
Debargha Mukherjee | 0c96c11 | 2018-12-20 16:04:18 -0800 | [diff] [blame] | 774 | TEST_P(DistWtdSADTest, UnalignedRef) { |
Cheng Chen | a0367dc | 2017-11-16 19:20:42 -0800 | [diff] [blame] | 775 | // The reference frame, but not the source frame, may be unaligned for |
| 776 | // certain types of searches. |
| 777 | const int tmp_stride = reference_stride_; |
| 778 | reference_stride_ -= 1; |
| 779 | FillRandom(source_data_, source_stride_); |
| 780 | FillRandom(reference_data_, reference_stride_); |
| 781 | CheckSAD(); |
| 782 | reference_stride_ = tmp_stride; |
| 783 | } |
| 784 | |
Debargha Mukherjee | 0c96c11 | 2018-12-20 16:04:18 -0800 | [diff] [blame] | 785 | TEST_P(DistWtdSADTest, ShortSrc) { |
Cheng Chen | a0367dc | 2017-11-16 19:20:42 -0800 | [diff] [blame] | 786 | const int tmp_stride = source_stride_; |
| 787 | source_stride_ >>= 1; |
| 788 | int test_count = 2000; |
| 789 | while (test_count > 0) { |
| 790 | FillRandom(source_data_, source_stride_); |
| 791 | FillRandom(reference_data_, reference_stride_); |
| 792 | CheckSAD(); |
| 793 | test_count -= 1; |
| 794 | } |
| 795 | source_stride_ = tmp_stride; |
| 796 | } |
| 797 | |
Debargha Mukherjee | 0c96c11 | 2018-12-20 16:04:18 -0800 | [diff] [blame] | 798 | TEST_P(DistWtdSADavgTest, MaxRef) { |
Cheng Chen | a0367dc | 2017-11-16 19:20:42 -0800 | [diff] [blame] | 799 | FillConstant(source_data_, source_stride_, 0); |
| 800 | FillConstant(reference_data_, reference_stride_, mask_); |
| 801 | FillConstant(second_pred_, width_, 0); |
| 802 | CheckSAD(); |
| 803 | } |
Debargha Mukherjee | 0c96c11 | 2018-12-20 16:04:18 -0800 | [diff] [blame] | 804 | TEST_P(DistWtdSADavgTest, MaxSrc) { |
Cheng Chen | a0367dc | 2017-11-16 19:20:42 -0800 | [diff] [blame] | 805 | FillConstant(source_data_, source_stride_, mask_); |
| 806 | FillConstant(reference_data_, reference_stride_, 0); |
| 807 | FillConstant(second_pred_, width_, 0); |
| 808 | CheckSAD(); |
| 809 | } |
| 810 | |
Debargha Mukherjee | 0c96c11 | 2018-12-20 16:04:18 -0800 | [diff] [blame] | 811 | TEST_P(DistWtdSADavgTest, ShortRef) { |
Cheng Chen | a0367dc | 2017-11-16 19:20:42 -0800 | [diff] [blame] | 812 | const int tmp_stride = reference_stride_; |
| 813 | reference_stride_ >>= 1; |
| 814 | FillRandom(source_data_, source_stride_); |
| 815 | FillRandom(reference_data_, reference_stride_); |
| 816 | FillRandom(second_pred_, width_); |
| 817 | CheckSAD(); |
| 818 | reference_stride_ = tmp_stride; |
| 819 | } |
| 820 | |
Debargha Mukherjee | 0c96c11 | 2018-12-20 16:04:18 -0800 | [diff] [blame] | 821 | TEST_P(DistWtdSADavgTest, UnalignedRef) { |
Cheng Chen | a0367dc | 2017-11-16 19:20:42 -0800 | [diff] [blame] | 822 | // The reference frame, but not the source frame, may be unaligned for |
| 823 | // certain types of searches. |
| 824 | const int tmp_stride = reference_stride_; |
| 825 | reference_stride_ -= 1; |
| 826 | FillRandom(source_data_, source_stride_); |
| 827 | FillRandom(reference_data_, reference_stride_); |
| 828 | FillRandom(second_pred_, width_); |
| 829 | CheckSAD(); |
| 830 | reference_stride_ = tmp_stride; |
| 831 | } |
| 832 | |
Debargha Mukherjee | 0c96c11 | 2018-12-20 16:04:18 -0800 | [diff] [blame] | 833 | TEST_P(DistWtdSADavgTest, ShortSrc) { |
Cheng Chen | a0367dc | 2017-11-16 19:20:42 -0800 | [diff] [blame] | 834 | const int tmp_stride = source_stride_; |
| 835 | source_stride_ >>= 1; |
| 836 | int test_count = 2000; |
| 837 | while (test_count > 0) { |
| 838 | FillRandom(source_data_, source_stride_); |
| 839 | FillRandom(reference_data_, reference_stride_); |
| 840 | FillRandom(second_pred_, width_); |
| 841 | CheckSAD(); |
| 842 | test_count -= 1; |
| 843 | } |
| 844 | source_stride_ = tmp_stride; |
| 845 | } |
Cheng Chen | a0367dc | 2017-11-16 19:20:42 -0800 | [diff] [blame] | 846 | |
John Koleszar | 1cfc86e | 2013-03-01 12:43:41 -0800 | [diff] [blame] | 847 | TEST_P(SADx4Test, MaxRef) { |
| 848 | FillConstant(source_data_, source_stride_, 0); |
Peter de Rivaz | 7eee487 | 2014-10-16 13:41:55 +0100 | [diff] [blame] | 849 | FillConstant(GetReference(0), reference_stride_, mask_); |
| 850 | FillConstant(GetReference(1), reference_stride_, mask_); |
| 851 | FillConstant(GetReference(2), reference_stride_, mask_); |
| 852 | FillConstant(GetReference(3), reference_stride_, mask_); |
John Koleszar | 1cfc86e | 2013-03-01 12:43:41 -0800 | [diff] [blame] | 853 | CheckSADs(); |
| 854 | } |
| 855 | |
John Koleszar | 1cfc86e | 2013-03-01 12:43:41 -0800 | [diff] [blame] | 856 | TEST_P(SADx4Test, MaxSrc) { |
Peter de Rivaz | 7eee487 | 2014-10-16 13:41:55 +0100 | [diff] [blame] | 857 | FillConstant(source_data_, source_stride_, mask_); |
John Koleszar | 1cfc86e | 2013-03-01 12:43:41 -0800 | [diff] [blame] | 858 | FillConstant(GetReference(0), reference_stride_, 0); |
| 859 | FillConstant(GetReference(1), reference_stride_, 0); |
| 860 | FillConstant(GetReference(2), reference_stride_, 0); |
| 861 | FillConstant(GetReference(3), reference_stride_, 0); |
| 862 | CheckSADs(); |
| 863 | } |
| 864 | |
John Koleszar | 1cfc86e | 2013-03-01 12:43:41 -0800 | [diff] [blame] | 865 | TEST_P(SADx4Test, ShortRef) { |
| 866 | int tmp_stride = reference_stride_; |
| 867 | reference_stride_ >>= 1; |
| 868 | FillRandom(source_data_, source_stride_); |
| 869 | FillRandom(GetReference(0), reference_stride_); |
| 870 | FillRandom(GetReference(1), reference_stride_); |
| 871 | FillRandom(GetReference(2), reference_stride_); |
| 872 | FillRandom(GetReference(3), reference_stride_); |
| 873 | CheckSADs(); |
| 874 | reference_stride_ = tmp_stride; |
| 875 | } |
| 876 | |
John Koleszar | 1cfc86e | 2013-03-01 12:43:41 -0800 | [diff] [blame] | 877 | TEST_P(SADx4Test, UnalignedRef) { |
| 878 | // The reference frame, but not the source frame, may be unaligned for |
| 879 | // certain types of searches. |
| 880 | int tmp_stride = reference_stride_; |
| 881 | reference_stride_ -= 1; |
| 882 | FillRandom(source_data_, source_stride_); |
| 883 | FillRandom(GetReference(0), reference_stride_); |
| 884 | FillRandom(GetReference(1), reference_stride_); |
| 885 | FillRandom(GetReference(2), reference_stride_); |
| 886 | FillRandom(GetReference(3), reference_stride_); |
| 887 | CheckSADs(); |
| 888 | reference_stride_ = tmp_stride; |
| 889 | } |
| 890 | |
John Koleszar | 1cfc86e | 2013-03-01 12:43:41 -0800 | [diff] [blame] | 891 | TEST_P(SADx4Test, ShortSrc) { |
| 892 | int tmp_stride = source_stride_; |
| 893 | source_stride_ >>= 1; |
Yi Luo | e983258 | 2016-11-29 19:38:12 -0800 | [diff] [blame] | 894 | int test_count = 1000; |
| 895 | while (test_count > 0) { |
| 896 | FillRandom(source_data_, source_stride_); |
| 897 | FillRandom(GetReference(0), reference_stride_); |
| 898 | FillRandom(GetReference(1), reference_stride_); |
| 899 | FillRandom(GetReference(2), reference_stride_); |
| 900 | FillRandom(GetReference(3), reference_stride_); |
| 901 | CheckSADs(); |
| 902 | test_count -= 1; |
| 903 | } |
John Koleszar | 1cfc86e | 2013-03-01 12:43:41 -0800 | [diff] [blame] | 904 | source_stride_ = tmp_stride; |
| 905 | } |
| 906 | |
Peter de Rivaz | 7eee487 | 2014-10-16 13:41:55 +0100 | [diff] [blame] | 907 | TEST_P(SADx4Test, SrcAlignedByWidth) { |
James Almer | 756717c | 2022-10-19 17:32:48 +0000 | [diff] [blame] | 908 | uint16_t *tmp_source_data = source_data_; |
Peter de Rivaz | 7eee487 | 2014-10-16 13:41:55 +0100 | [diff] [blame] | 909 | source_data_ += width_; |
| 910 | FillRandom(source_data_, source_stride_); |
| 911 | FillRandom(GetReference(0), reference_stride_); |
| 912 | FillRandom(GetReference(1), reference_stride_); |
| 913 | FillRandom(GetReference(2), reference_stride_); |
| 914 | FillRandom(GetReference(3), reference_stride_); |
| 915 | CheckSADs(); |
| 916 | source_data_ = tmp_source_data; |
| 917 | } |
| 918 | |
Sarah Parker | d1da748 | 2021-04-16 17:39:25 -0700 | [diff] [blame] | 919 | TEST_P(SADx4Test, DISABLED_Speed) { |
chiyotsai | c814afb | 2020-08-04 13:12:35 -0700 | [diff] [blame] | 920 | FillRandom(source_data_, source_stride_); |
| 921 | FillRandom(GetReference(0), reference_stride_); |
| 922 | FillRandom(GetReference(1), reference_stride_); |
| 923 | FillRandom(GetReference(2), reference_stride_); |
| 924 | FillRandom(GetReference(3), reference_stride_); |
| 925 | SpeedSAD(); |
| 926 | } |
chiyotsai | c814afb | 2020-08-04 13:12:35 -0700 | [diff] [blame] | 927 | |
| 928 | // SADSkipx4 |
| 929 | TEST_P(SADSkipx4Test, MaxRef) { |
| 930 | FillConstant(source_data_, source_stride_, 0); |
| 931 | FillConstant(GetReference(0), reference_stride_, mask_); |
| 932 | FillConstant(GetReference(1), reference_stride_, mask_); |
| 933 | FillConstant(GetReference(2), reference_stride_, mask_); |
| 934 | FillConstant(GetReference(3), reference_stride_, mask_); |
| 935 | CheckSADs(); |
| 936 | } |
| 937 | |
| 938 | TEST_P(SADSkipx4Test, MaxSrc) { |
| 939 | FillConstant(source_data_, source_stride_, mask_); |
| 940 | FillConstant(GetReference(0), reference_stride_, 0); |
| 941 | FillConstant(GetReference(1), reference_stride_, 0); |
| 942 | FillConstant(GetReference(2), reference_stride_, 0); |
| 943 | FillConstant(GetReference(3), reference_stride_, 0); |
| 944 | CheckSADs(); |
| 945 | } |
| 946 | |
| 947 | TEST_P(SADSkipx4Test, ShortRef) { |
| 948 | int tmp_stride = reference_stride_; |
| 949 | reference_stride_ >>= 1; |
| 950 | FillRandom(source_data_, source_stride_); |
| 951 | FillRandom(GetReference(0), reference_stride_); |
| 952 | FillRandom(GetReference(1), reference_stride_); |
| 953 | FillRandom(GetReference(2), reference_stride_); |
| 954 | FillRandom(GetReference(3), reference_stride_); |
| 955 | CheckSADs(); |
| 956 | reference_stride_ = tmp_stride; |
| 957 | } |
| 958 | |
| 959 | TEST_P(SADSkipx4Test, UnalignedRef) { |
| 960 | // The reference frame, but not the source frame, may be unaligned for |
| 961 | // certain types of searches. |
| 962 | int tmp_stride = reference_stride_; |
| 963 | reference_stride_ -= 1; |
| 964 | FillRandom(source_data_, source_stride_); |
| 965 | FillRandom(GetReference(0), reference_stride_); |
| 966 | FillRandom(GetReference(1), reference_stride_); |
| 967 | FillRandom(GetReference(2), reference_stride_); |
| 968 | FillRandom(GetReference(3), reference_stride_); |
| 969 | CheckSADs(); |
| 970 | reference_stride_ = tmp_stride; |
| 971 | } |
| 972 | |
| 973 | TEST_P(SADSkipx4Test, ShortSrc) { |
| 974 | int tmp_stride = source_stride_; |
| 975 | source_stride_ >>= 1; |
| 976 | int test_count = 1000; |
| 977 | while (test_count > 0) { |
| 978 | FillRandom(source_data_, source_stride_); |
| 979 | FillRandom(GetReference(0), reference_stride_); |
| 980 | FillRandom(GetReference(1), reference_stride_); |
| 981 | FillRandom(GetReference(2), reference_stride_); |
| 982 | FillRandom(GetReference(3), reference_stride_); |
| 983 | CheckSADs(); |
| 984 | test_count -= 1; |
| 985 | } |
| 986 | source_stride_ = tmp_stride; |
| 987 | } |
| 988 | |
| 989 | TEST_P(SADSkipx4Test, SrcAlignedByWidth) { |
James Almer | 756717c | 2022-10-19 17:32:48 +0000 | [diff] [blame] | 990 | uint16_t *tmp_source_data = source_data_; |
chiyotsai | c814afb | 2020-08-04 13:12:35 -0700 | [diff] [blame] | 991 | source_data_ += width_; |
| 992 | FillRandom(source_data_, source_stride_); |
| 993 | FillRandom(GetReference(0), reference_stride_); |
| 994 | FillRandom(GetReference(1), reference_stride_); |
| 995 | FillRandom(GetReference(2), reference_stride_); |
| 996 | FillRandom(GetReference(3), reference_stride_); |
| 997 | CheckSADs(); |
| 998 | source_data_ = tmp_source_data; |
| 999 | } |
| 1000 | |
Sarah Parker | d1da748 | 2021-04-16 17:39:25 -0700 | [diff] [blame] | 1001 | TEST_P(SADSkipx4Test, DISABLED_Speed) { |
chiyotsai | c814afb | 2020-08-04 13:12:35 -0700 | [diff] [blame] | 1002 | FillRandom(source_data_, source_stride_); |
| 1003 | FillRandom(GetReference(0), reference_stride_); |
| 1004 | FillRandom(GetReference(1), reference_stride_); |
| 1005 | FillRandom(GetReference(2), reference_stride_); |
| 1006 | FillRandom(GetReference(3), reference_stride_); |
| 1007 | SpeedSAD(); |
| 1008 | } |
chiyotsai | c814afb | 2020-08-04 13:12:35 -0700 | [diff] [blame] | 1009 | |
sarahparker | a543df5 | 2018-11-02 16:02:05 -0700 | [diff] [blame] | 1010 | using std::make_tuple; |
James Zern | 12ddb75 | 2012-08-15 11:54:41 -0700 | [diff] [blame] | 1011 | |
Sarah Parker | d1da748 | 2021-04-16 17:39:25 -0700 | [diff] [blame] | 1012 | TEST_P(SADx4AvgTest, DISABLED_Speed) { |
Ruiling Song | 8dc32d7 | 2020-01-20 15:33:37 +0800 | [diff] [blame] | 1013 | int tmp_stride = reference_stride_; |
| 1014 | reference_stride_ >>= 1; |
| 1015 | FillRandom(source_data_, source_stride_); |
| 1016 | FillRandom(GetReference(0), reference_stride_); |
| 1017 | FillRandom(GetReference(1), reference_stride_); |
| 1018 | FillRandom(GetReference(2), reference_stride_); |
| 1019 | FillRandom(GetReference(3), reference_stride_); |
| 1020 | FillRandom(second_pred_, width_); |
| 1021 | SpeedSAD(); |
| 1022 | reference_stride_ = tmp_stride; |
| 1023 | } |
Ruiling Song | 8dc32d7 | 2020-01-20 15:33:37 +0800 | [diff] [blame] | 1024 | |
| 1025 | TEST_P(SADx4AvgTest, MaxRef) { |
| 1026 | FillConstant(source_data_, source_stride_, 0); |
| 1027 | FillConstant(GetReference(0), reference_stride_, mask_); |
| 1028 | FillConstant(GetReference(1), reference_stride_, mask_); |
| 1029 | FillConstant(GetReference(2), reference_stride_, mask_); |
| 1030 | FillConstant(GetReference(3), reference_stride_, mask_); |
| 1031 | FillConstant(second_pred_, width_, 0); |
| 1032 | CheckSADs(); |
| 1033 | } |
| 1034 | |
| 1035 | TEST_P(SADx4AvgTest, MaxSrc) { |
| 1036 | FillConstant(source_data_, source_stride_, mask_); |
| 1037 | FillConstant(GetReference(0), reference_stride_, 0); |
| 1038 | FillConstant(GetReference(1), reference_stride_, 0); |
| 1039 | FillConstant(GetReference(2), reference_stride_, 0); |
| 1040 | FillConstant(GetReference(3), reference_stride_, 0); |
| 1041 | FillConstant(second_pred_, width_, 0); |
| 1042 | CheckSADs(); |
| 1043 | } |
| 1044 | |
| 1045 | TEST_P(SADx4AvgTest, ShortRef) { |
| 1046 | int tmp_stride = reference_stride_; |
| 1047 | reference_stride_ >>= 1; |
| 1048 | FillRandom(source_data_, source_stride_); |
| 1049 | FillRandom(GetReference(0), reference_stride_); |
| 1050 | FillRandom(GetReference(1), reference_stride_); |
| 1051 | FillRandom(GetReference(2), reference_stride_); |
| 1052 | FillRandom(GetReference(3), reference_stride_); |
| 1053 | FillRandom(second_pred_, width_); |
| 1054 | CheckSADs(); |
| 1055 | reference_stride_ = tmp_stride; |
| 1056 | } |
| 1057 | |
| 1058 | TEST_P(SADx4AvgTest, UnalignedRef) { |
| 1059 | // The reference frame, but not the source frame, may be unaligned for |
| 1060 | // certain types of searches. |
| 1061 | int tmp_stride = reference_stride_; |
| 1062 | reference_stride_ -= 1; |
| 1063 | FillRandom(source_data_, source_stride_); |
| 1064 | FillRandom(GetReference(0), reference_stride_); |
| 1065 | FillRandom(GetReference(1), reference_stride_); |
| 1066 | FillRandom(GetReference(2), reference_stride_); |
| 1067 | FillRandom(GetReference(3), reference_stride_); |
| 1068 | FillRandom(second_pred_, width_); |
| 1069 | CheckSADs(); |
| 1070 | reference_stride_ = tmp_stride; |
| 1071 | } |
| 1072 | |
James Zern | d7cff28 | 2014-02-27 12:49:02 -0800 | [diff] [blame] | 1073 | //------------------------------------------------------------------------------ |
| 1074 | // C functions |
James Zern | 18e733b | 2014-07-16 18:59:28 -0700 | [diff] [blame] | 1075 | const SadMxNParam c_tests[] = { |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 1076 | make_tuple(128, 128, &aom_highbd_sad128x128_c, 8), |
| 1077 | make_tuple(128, 64, &aom_highbd_sad128x64_c, 8), |
| 1078 | make_tuple(64, 128, &aom_highbd_sad64x128_c, 8), |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 1079 | make_tuple(64, 64, &aom_highbd_sad64x64_c, 8), |
| 1080 | make_tuple(64, 32, &aom_highbd_sad64x32_c, 8), |
| 1081 | make_tuple(32, 64, &aom_highbd_sad32x64_c, 8), |
| 1082 | make_tuple(32, 32, &aom_highbd_sad32x32_c, 8), |
| 1083 | make_tuple(32, 16, &aom_highbd_sad32x16_c, 8), |
| 1084 | make_tuple(16, 32, &aom_highbd_sad16x32_c, 8), |
| 1085 | make_tuple(16, 16, &aom_highbd_sad16x16_c, 8), |
| 1086 | make_tuple(16, 8, &aom_highbd_sad16x8_c, 8), |
| 1087 | make_tuple(8, 16, &aom_highbd_sad8x16_c, 8), |
| 1088 | make_tuple(8, 8, &aom_highbd_sad8x8_c, 8), |
| 1089 | make_tuple(8, 4, &aom_highbd_sad8x4_c, 8), |
| 1090 | make_tuple(4, 8, &aom_highbd_sad4x8_c, 8), |
| 1091 | make_tuple(4, 4, &aom_highbd_sad4x4_c, 8), |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 1092 | make_tuple(128, 128, &aom_highbd_sad128x128_c, 10), |
| 1093 | make_tuple(128, 64, &aom_highbd_sad128x64_c, 10), |
| 1094 | make_tuple(64, 128, &aom_highbd_sad64x128_c, 10), |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 1095 | make_tuple(64, 64, &aom_highbd_sad64x64_c, 10), |
| 1096 | make_tuple(64, 32, &aom_highbd_sad64x32_c, 10), |
| 1097 | make_tuple(32, 64, &aom_highbd_sad32x64_c, 10), |
| 1098 | make_tuple(32, 32, &aom_highbd_sad32x32_c, 10), |
| 1099 | make_tuple(32, 16, &aom_highbd_sad32x16_c, 10), |
| 1100 | make_tuple(16, 32, &aom_highbd_sad16x32_c, 10), |
| 1101 | make_tuple(16, 16, &aom_highbd_sad16x16_c, 10), |
| 1102 | make_tuple(16, 8, &aom_highbd_sad16x8_c, 10), |
| 1103 | make_tuple(8, 16, &aom_highbd_sad8x16_c, 10), |
| 1104 | make_tuple(8, 8, &aom_highbd_sad8x8_c, 10), |
| 1105 | make_tuple(8, 4, &aom_highbd_sad8x4_c, 10), |
| 1106 | make_tuple(4, 8, &aom_highbd_sad4x8_c, 10), |
| 1107 | make_tuple(4, 4, &aom_highbd_sad4x4_c, 10), |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 1108 | make_tuple(128, 128, &aom_highbd_sad128x128_c, 12), |
| 1109 | make_tuple(128, 64, &aom_highbd_sad128x64_c, 12), |
| 1110 | make_tuple(64, 128, &aom_highbd_sad64x128_c, 12), |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 1111 | make_tuple(64, 64, &aom_highbd_sad64x64_c, 12), |
| 1112 | make_tuple(64, 32, &aom_highbd_sad64x32_c, 12), |
| 1113 | make_tuple(32, 64, &aom_highbd_sad32x64_c, 12), |
| 1114 | make_tuple(32, 32, &aom_highbd_sad32x32_c, 12), |
| 1115 | make_tuple(32, 16, &aom_highbd_sad32x16_c, 12), |
| 1116 | make_tuple(16, 32, &aom_highbd_sad16x32_c, 12), |
| 1117 | make_tuple(16, 16, &aom_highbd_sad16x16_c, 12), |
| 1118 | make_tuple(16, 8, &aom_highbd_sad16x8_c, 12), |
| 1119 | make_tuple(8, 16, &aom_highbd_sad8x16_c, 12), |
| 1120 | make_tuple(8, 8, &aom_highbd_sad8x8_c, 12), |
| 1121 | make_tuple(8, 4, &aom_highbd_sad8x4_c, 12), |
| 1122 | make_tuple(4, 8, &aom_highbd_sad4x8_c, 12), |
| 1123 | make_tuple(4, 4, &aom_highbd_sad4x4_c, 12), |
Ryan Lei | 2a67637 | 2020-09-28 16:58:52 -0700 | [diff] [blame] | 1124 | |
Debargha Mukherjee | 5b5cbbd | 2019-07-15 15:43:57 -0700 | [diff] [blame] | 1125 | make_tuple(64, 16, &aom_highbd_sad64x16_c, 8), |
| 1126 | make_tuple(16, 64, &aom_highbd_sad16x64_c, 8), |
| 1127 | make_tuple(64, 16, &aom_highbd_sad64x16_c, 10), |
| 1128 | make_tuple(16, 64, &aom_highbd_sad16x64_c, 10), |
| 1129 | make_tuple(64, 16, &aom_highbd_sad64x16_c, 12), |
| 1130 | make_tuple(16, 64, &aom_highbd_sad16x64_c, 12), |
Ryan Lei | 2a67637 | 2020-09-28 16:58:52 -0700 | [diff] [blame] | 1131 | |
Debargha Mukherjee | 5b5cbbd | 2019-07-15 15:43:57 -0700 | [diff] [blame] | 1132 | make_tuple(32, 8, &aom_highbd_sad32x8_c, 8), |
| 1133 | make_tuple(8, 32, &aom_highbd_sad8x32_c, 8), |
| 1134 | make_tuple(32, 8, &aom_highbd_sad32x8_c, 10), |
| 1135 | make_tuple(8, 32, &aom_highbd_sad8x32_c, 10), |
| 1136 | make_tuple(32, 8, &aom_highbd_sad32x8_c, 12), |
| 1137 | make_tuple(8, 32, &aom_highbd_sad8x32_c, 12), |
Ryan Lei | 2a67637 | 2020-09-28 16:58:52 -0700 | [diff] [blame] | 1138 | |
Debargha Mukherjee | 5b5cbbd | 2019-07-15 15:43:57 -0700 | [diff] [blame] | 1139 | make_tuple(16, 4, &aom_highbd_sad16x4_c, 8), |
| 1140 | make_tuple(4, 16, &aom_highbd_sad4x16_c, 8), |
| 1141 | make_tuple(16, 4, &aom_highbd_sad16x4_c, 10), |
| 1142 | make_tuple(4, 16, &aom_highbd_sad4x16_c, 10), |
| 1143 | make_tuple(16, 4, &aom_highbd_sad16x4_c, 12), |
| 1144 | make_tuple(4, 16, &aom_highbd_sad4x16_c, 12), |
Deb Mukherjee | fc88292 | 2014-05-13 10:11:42 -0700 | [diff] [blame] | 1145 | }; |
Cheng Chen | 96786fe | 2020-02-14 17:28:25 -0800 | [diff] [blame] | 1146 | INSTANTIATE_TEST_SUITE_P(C, SADTest, ::testing::ValuesIn(c_tests)); |
Deb Mukherjee | fc88292 | 2014-05-13 10:11:42 -0700 | [diff] [blame] | 1147 | |
chiyotsai | c814afb | 2020-08-04 13:12:35 -0700 | [diff] [blame] | 1148 | const SadSkipMxNParam skip_c_tests[] = { |
chiyotsai | c814afb | 2020-08-04 13:12:35 -0700 | [diff] [blame] | 1149 | make_tuple(128, 128, &aom_highbd_sad_skip_128x128_c, 8), |
| 1150 | make_tuple(128, 64, &aom_highbd_sad_skip_128x64_c, 8), |
| 1151 | make_tuple(64, 128, &aom_highbd_sad_skip_64x128_c, 8), |
| 1152 | make_tuple(64, 64, &aom_highbd_sad_skip_64x64_c, 8), |
| 1153 | make_tuple(64, 32, &aom_highbd_sad_skip_64x32_c, 8), |
| 1154 | make_tuple(32, 64, &aom_highbd_sad_skip_32x64_c, 8), |
| 1155 | make_tuple(32, 32, &aom_highbd_sad_skip_32x32_c, 8), |
| 1156 | make_tuple(32, 16, &aom_highbd_sad_skip_32x16_c, 8), |
| 1157 | make_tuple(16, 32, &aom_highbd_sad_skip_16x32_c, 8), |
| 1158 | make_tuple(16, 16, &aom_highbd_sad_skip_16x16_c, 8), |
| 1159 | make_tuple(16, 8, &aom_highbd_sad_skip_16x8_c, 8), |
| 1160 | make_tuple(8, 16, &aom_highbd_sad_skip_8x16_c, 8), |
| 1161 | make_tuple(8, 8, &aom_highbd_sad_skip_8x8_c, 8), |
| 1162 | make_tuple(8, 4, &aom_highbd_sad_skip_8x4_c, 8), |
| 1163 | make_tuple(4, 8, &aom_highbd_sad_skip_4x8_c, 8), |
| 1164 | make_tuple(4, 4, &aom_highbd_sad_skip_4x4_c, 8), |
| 1165 | make_tuple(64, 16, &aom_highbd_sad_skip_64x16_c, 8), |
| 1166 | make_tuple(16, 64, &aom_highbd_sad_skip_16x64_c, 8), |
| 1167 | make_tuple(32, 8, &aom_highbd_sad_skip_32x8_c, 8), |
| 1168 | make_tuple(8, 32, &aom_highbd_sad_skip_8x32_c, 8), |
| 1169 | make_tuple(16, 4, &aom_highbd_sad_skip_16x4_c, 8), |
| 1170 | make_tuple(4, 16, &aom_highbd_sad_skip_4x16_c, 8), |
| 1171 | |
| 1172 | make_tuple(128, 128, &aom_highbd_sad_skip_128x128_c, 10), |
| 1173 | make_tuple(128, 64, &aom_highbd_sad_skip_128x64_c, 10), |
| 1174 | make_tuple(64, 128, &aom_highbd_sad_skip_64x128_c, 10), |
| 1175 | make_tuple(64, 64, &aom_highbd_sad_skip_64x64_c, 10), |
| 1176 | make_tuple(64, 32, &aom_highbd_sad_skip_64x32_c, 10), |
| 1177 | make_tuple(32, 64, &aom_highbd_sad_skip_32x64_c, 10), |
| 1178 | make_tuple(32, 32, &aom_highbd_sad_skip_32x32_c, 10), |
| 1179 | make_tuple(32, 16, &aom_highbd_sad_skip_32x16_c, 10), |
| 1180 | make_tuple(16, 32, &aom_highbd_sad_skip_16x32_c, 10), |
| 1181 | make_tuple(16, 16, &aom_highbd_sad_skip_16x16_c, 10), |
| 1182 | make_tuple(16, 8, &aom_highbd_sad_skip_16x8_c, 10), |
| 1183 | make_tuple(8, 16, &aom_highbd_sad_skip_8x16_c, 10), |
| 1184 | make_tuple(8, 8, &aom_highbd_sad_skip_8x8_c, 10), |
| 1185 | make_tuple(8, 4, &aom_highbd_sad_skip_8x4_c, 10), |
| 1186 | make_tuple(4, 8, &aom_highbd_sad_skip_4x8_c, 10), |
| 1187 | make_tuple(4, 4, &aom_highbd_sad_skip_4x4_c, 10), |
| 1188 | make_tuple(64, 16, &aom_highbd_sad_skip_64x16_c, 10), |
| 1189 | make_tuple(16, 64, &aom_highbd_sad_skip_16x64_c, 10), |
| 1190 | make_tuple(32, 8, &aom_highbd_sad_skip_32x8_c, 10), |
| 1191 | make_tuple(8, 32, &aom_highbd_sad_skip_8x32_c, 10), |
| 1192 | make_tuple(16, 4, &aom_highbd_sad_skip_16x4_c, 10), |
| 1193 | make_tuple(4, 16, &aom_highbd_sad_skip_4x16_c, 10), |
| 1194 | |
| 1195 | make_tuple(128, 128, &aom_highbd_sad_skip_128x128_c, 12), |
| 1196 | make_tuple(128, 64, &aom_highbd_sad_skip_128x64_c, 12), |
| 1197 | make_tuple(64, 128, &aom_highbd_sad_skip_64x128_c, 12), |
| 1198 | make_tuple(64, 64, &aom_highbd_sad_skip_64x64_c, 12), |
| 1199 | make_tuple(64, 32, &aom_highbd_sad_skip_64x32_c, 12), |
| 1200 | make_tuple(32, 64, &aom_highbd_sad_skip_32x64_c, 12), |
| 1201 | make_tuple(32, 32, &aom_highbd_sad_skip_32x32_c, 12), |
| 1202 | make_tuple(32, 16, &aom_highbd_sad_skip_32x16_c, 12), |
| 1203 | make_tuple(16, 32, &aom_highbd_sad_skip_16x32_c, 12), |
| 1204 | make_tuple(16, 16, &aom_highbd_sad_skip_16x16_c, 12), |
| 1205 | make_tuple(16, 8, &aom_highbd_sad_skip_16x8_c, 12), |
| 1206 | make_tuple(8, 16, &aom_highbd_sad_skip_8x16_c, 12), |
| 1207 | make_tuple(8, 8, &aom_highbd_sad_skip_8x8_c, 12), |
| 1208 | make_tuple(8, 4, &aom_highbd_sad_skip_8x4_c, 12), |
| 1209 | make_tuple(4, 8, &aom_highbd_sad_skip_4x8_c, 12), |
| 1210 | make_tuple(4, 4, &aom_highbd_sad_skip_4x4_c, 12), |
| 1211 | make_tuple(64, 16, &aom_highbd_sad_skip_64x16_c, 12), |
| 1212 | make_tuple(16, 64, &aom_highbd_sad_skip_16x64_c, 12), |
| 1213 | make_tuple(32, 8, &aom_highbd_sad_skip_32x8_c, 12), |
| 1214 | make_tuple(8, 32, &aom_highbd_sad_skip_8x32_c, 12), |
| 1215 | make_tuple(16, 4, &aom_highbd_sad_skip_16x4_c, 12), |
| 1216 | make_tuple(4, 16, &aom_highbd_sad_skip_4x16_c, 12), |
chiyotsai | c814afb | 2020-08-04 13:12:35 -0700 | [diff] [blame] | 1217 | }; |
| 1218 | INSTANTIATE_TEST_SUITE_P(C, SADSkipTest, ::testing::ValuesIn(skip_c_tests)); |
| 1219 | |
Johann | d5d9289 | 2015-04-17 16:11:38 -0400 | [diff] [blame] | 1220 | const SadMxNAvgParam avg_c_tests[] = { |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 1221 | make_tuple(128, 128, &aom_highbd_sad128x128_avg_c, 8), |
| 1222 | make_tuple(128, 64, &aom_highbd_sad128x64_avg_c, 8), |
| 1223 | make_tuple(64, 128, &aom_highbd_sad64x128_avg_c, 8), |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 1224 | make_tuple(64, 64, &aom_highbd_sad64x64_avg_c, 8), |
| 1225 | make_tuple(64, 32, &aom_highbd_sad64x32_avg_c, 8), |
| 1226 | make_tuple(32, 64, &aom_highbd_sad32x64_avg_c, 8), |
| 1227 | make_tuple(32, 32, &aom_highbd_sad32x32_avg_c, 8), |
| 1228 | make_tuple(32, 16, &aom_highbd_sad32x16_avg_c, 8), |
| 1229 | make_tuple(16, 32, &aom_highbd_sad16x32_avg_c, 8), |
| 1230 | make_tuple(16, 16, &aom_highbd_sad16x16_avg_c, 8), |
| 1231 | make_tuple(16, 8, &aom_highbd_sad16x8_avg_c, 8), |
| 1232 | make_tuple(8, 16, &aom_highbd_sad8x16_avg_c, 8), |
| 1233 | make_tuple(8, 8, &aom_highbd_sad8x8_avg_c, 8), |
| 1234 | make_tuple(8, 4, &aom_highbd_sad8x4_avg_c, 8), |
| 1235 | make_tuple(4, 8, &aom_highbd_sad4x8_avg_c, 8), |
| 1236 | make_tuple(4, 4, &aom_highbd_sad4x4_avg_c, 8), |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 1237 | make_tuple(128, 128, &aom_highbd_sad128x128_avg_c, 10), |
| 1238 | make_tuple(128, 64, &aom_highbd_sad128x64_avg_c, 10), |
| 1239 | make_tuple(64, 128, &aom_highbd_sad64x128_avg_c, 10), |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 1240 | make_tuple(64, 64, &aom_highbd_sad64x64_avg_c, 10), |
| 1241 | make_tuple(64, 32, &aom_highbd_sad64x32_avg_c, 10), |
| 1242 | make_tuple(32, 64, &aom_highbd_sad32x64_avg_c, 10), |
| 1243 | make_tuple(32, 32, &aom_highbd_sad32x32_avg_c, 10), |
| 1244 | make_tuple(32, 16, &aom_highbd_sad32x16_avg_c, 10), |
| 1245 | make_tuple(16, 32, &aom_highbd_sad16x32_avg_c, 10), |
| 1246 | make_tuple(16, 16, &aom_highbd_sad16x16_avg_c, 10), |
| 1247 | make_tuple(16, 8, &aom_highbd_sad16x8_avg_c, 10), |
| 1248 | make_tuple(8, 16, &aom_highbd_sad8x16_avg_c, 10), |
| 1249 | make_tuple(8, 8, &aom_highbd_sad8x8_avg_c, 10), |
| 1250 | make_tuple(8, 4, &aom_highbd_sad8x4_avg_c, 10), |
| 1251 | make_tuple(4, 8, &aom_highbd_sad4x8_avg_c, 10), |
| 1252 | make_tuple(4, 4, &aom_highbd_sad4x4_avg_c, 10), |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 1253 | make_tuple(128, 128, &aom_highbd_sad128x128_avg_c, 12), |
| 1254 | make_tuple(128, 64, &aom_highbd_sad128x64_avg_c, 12), |
| 1255 | make_tuple(64, 128, &aom_highbd_sad64x128_avg_c, 12), |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 1256 | make_tuple(64, 64, &aom_highbd_sad64x64_avg_c, 12), |
| 1257 | make_tuple(64, 32, &aom_highbd_sad64x32_avg_c, 12), |
| 1258 | make_tuple(32, 64, &aom_highbd_sad32x64_avg_c, 12), |
| 1259 | make_tuple(32, 32, &aom_highbd_sad32x32_avg_c, 12), |
| 1260 | make_tuple(32, 16, &aom_highbd_sad32x16_avg_c, 12), |
| 1261 | make_tuple(16, 32, &aom_highbd_sad16x32_avg_c, 12), |
| 1262 | make_tuple(16, 16, &aom_highbd_sad16x16_avg_c, 12), |
| 1263 | make_tuple(16, 8, &aom_highbd_sad16x8_avg_c, 12), |
| 1264 | make_tuple(8, 16, &aom_highbd_sad8x16_avg_c, 12), |
| 1265 | make_tuple(8, 8, &aom_highbd_sad8x8_avg_c, 12), |
| 1266 | make_tuple(8, 4, &aom_highbd_sad8x4_avg_c, 12), |
| 1267 | make_tuple(4, 8, &aom_highbd_sad4x8_avg_c, 12), |
| 1268 | make_tuple(4, 4, &aom_highbd_sad4x4_avg_c, 12), |
Ryan Lei | 2a67637 | 2020-09-28 16:58:52 -0700 | [diff] [blame] | 1269 | |
Debargha Mukherjee | 5b5cbbd | 2019-07-15 15:43:57 -0700 | [diff] [blame] | 1270 | make_tuple(64, 16, &aom_highbd_sad64x16_avg_c, 8), |
| 1271 | make_tuple(16, 64, &aom_highbd_sad16x64_avg_c, 8), |
| 1272 | make_tuple(64, 16, &aom_highbd_sad64x16_avg_c, 10), |
| 1273 | make_tuple(16, 64, &aom_highbd_sad16x64_avg_c, 10), |
| 1274 | make_tuple(64, 16, &aom_highbd_sad64x16_avg_c, 12), |
| 1275 | make_tuple(16, 64, &aom_highbd_sad16x64_avg_c, 12), |
Ryan Lei | 2a67637 | 2020-09-28 16:58:52 -0700 | [diff] [blame] | 1276 | |
Debargha Mukherjee | 5b5cbbd | 2019-07-15 15:43:57 -0700 | [diff] [blame] | 1277 | make_tuple(32, 8, &aom_highbd_sad32x8_avg_c, 8), |
| 1278 | make_tuple(8, 32, &aom_highbd_sad8x32_avg_c, 8), |
| 1279 | make_tuple(32, 8, &aom_highbd_sad32x8_avg_c, 10), |
| 1280 | make_tuple(8, 32, &aom_highbd_sad8x32_avg_c, 10), |
| 1281 | make_tuple(32, 8, &aom_highbd_sad32x8_avg_c, 12), |
| 1282 | make_tuple(8, 32, &aom_highbd_sad8x32_avg_c, 12), |
Ryan Lei | 2a67637 | 2020-09-28 16:58:52 -0700 | [diff] [blame] | 1283 | |
Debargha Mukherjee | 5b5cbbd | 2019-07-15 15:43:57 -0700 | [diff] [blame] | 1284 | make_tuple(16, 4, &aom_highbd_sad16x4_avg_c, 8), |
| 1285 | make_tuple(4, 16, &aom_highbd_sad4x16_avg_c, 8), |
| 1286 | make_tuple(16, 4, &aom_highbd_sad16x4_avg_c, 10), |
| 1287 | make_tuple(4, 16, &aom_highbd_sad4x16_avg_c, 10), |
| 1288 | make_tuple(16, 4, &aom_highbd_sad16x4_avg_c, 12), |
| 1289 | make_tuple(4, 16, &aom_highbd_sad4x16_avg_c, 12), |
Johann | d5d9289 | 2015-04-17 16:11:38 -0400 | [diff] [blame] | 1290 | }; |
Cheng Chen | 96786fe | 2020-02-14 17:28:25 -0800 | [diff] [blame] | 1291 | INSTANTIATE_TEST_SUITE_P(C, SADavgTest, ::testing::ValuesIn(avg_c_tests)); |
Johann | d5d9289 | 2015-04-17 16:11:38 -0400 | [diff] [blame] | 1292 | |
Johann | d5d9289 | 2015-04-17 16:11:38 -0400 | [diff] [blame] | 1293 | const SadMxNx4Param x4d_c_tests[] = { |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 1294 | make_tuple(128, 128, &aom_highbd_sad128x128x4d_c, 8), |
| 1295 | make_tuple(128, 64, &aom_highbd_sad128x64x4d_c, 8), |
| 1296 | make_tuple(64, 128, &aom_highbd_sad64x128x4d_c, 8), |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 1297 | make_tuple(64, 64, &aom_highbd_sad64x64x4d_c, 8), |
| 1298 | make_tuple(64, 32, &aom_highbd_sad64x32x4d_c, 8), |
| 1299 | make_tuple(32, 64, &aom_highbd_sad32x64x4d_c, 8), |
| 1300 | make_tuple(32, 32, &aom_highbd_sad32x32x4d_c, 8), |
| 1301 | make_tuple(32, 16, &aom_highbd_sad32x16x4d_c, 8), |
| 1302 | make_tuple(16, 32, &aom_highbd_sad16x32x4d_c, 8), |
| 1303 | make_tuple(16, 16, &aom_highbd_sad16x16x4d_c, 8), |
| 1304 | make_tuple(16, 8, &aom_highbd_sad16x8x4d_c, 8), |
| 1305 | make_tuple(8, 16, &aom_highbd_sad8x16x4d_c, 8), |
| 1306 | make_tuple(8, 8, &aom_highbd_sad8x8x4d_c, 8), |
| 1307 | make_tuple(8, 4, &aom_highbd_sad8x4x4d_c, 8), |
| 1308 | make_tuple(4, 8, &aom_highbd_sad4x8x4d_c, 8), |
| 1309 | make_tuple(4, 4, &aom_highbd_sad4x4x4d_c, 8), |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 1310 | make_tuple(128, 128, &aom_highbd_sad128x128x4d_c, 10), |
| 1311 | make_tuple(128, 64, &aom_highbd_sad128x64x4d_c, 10), |
| 1312 | make_tuple(64, 128, &aom_highbd_sad64x128x4d_c, 10), |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 1313 | make_tuple(64, 64, &aom_highbd_sad64x64x4d_c, 10), |
| 1314 | make_tuple(64, 32, &aom_highbd_sad64x32x4d_c, 10), |
| 1315 | make_tuple(32, 64, &aom_highbd_sad32x64x4d_c, 10), |
| 1316 | make_tuple(32, 32, &aom_highbd_sad32x32x4d_c, 10), |
| 1317 | make_tuple(32, 16, &aom_highbd_sad32x16x4d_c, 10), |
| 1318 | make_tuple(16, 32, &aom_highbd_sad16x32x4d_c, 10), |
| 1319 | make_tuple(16, 16, &aom_highbd_sad16x16x4d_c, 10), |
| 1320 | make_tuple(16, 8, &aom_highbd_sad16x8x4d_c, 10), |
| 1321 | make_tuple(8, 16, &aom_highbd_sad8x16x4d_c, 10), |
| 1322 | make_tuple(8, 8, &aom_highbd_sad8x8x4d_c, 10), |
| 1323 | make_tuple(8, 4, &aom_highbd_sad8x4x4d_c, 10), |
| 1324 | make_tuple(4, 8, &aom_highbd_sad4x8x4d_c, 10), |
| 1325 | make_tuple(4, 4, &aom_highbd_sad4x4x4d_c, 10), |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 1326 | make_tuple(128, 128, &aom_highbd_sad128x128x4d_c, 12), |
| 1327 | make_tuple(128, 64, &aom_highbd_sad128x64x4d_c, 12), |
| 1328 | make_tuple(64, 128, &aom_highbd_sad64x128x4d_c, 12), |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 1329 | make_tuple(64, 64, &aom_highbd_sad64x64x4d_c, 12), |
| 1330 | make_tuple(64, 32, &aom_highbd_sad64x32x4d_c, 12), |
| 1331 | make_tuple(32, 64, &aom_highbd_sad32x64x4d_c, 12), |
| 1332 | make_tuple(32, 32, &aom_highbd_sad32x32x4d_c, 12), |
| 1333 | make_tuple(32, 16, &aom_highbd_sad32x16x4d_c, 12), |
| 1334 | make_tuple(16, 32, &aom_highbd_sad16x32x4d_c, 12), |
| 1335 | make_tuple(16, 16, &aom_highbd_sad16x16x4d_c, 12), |
| 1336 | make_tuple(16, 8, &aom_highbd_sad16x8x4d_c, 12), |
| 1337 | make_tuple(8, 16, &aom_highbd_sad8x16x4d_c, 12), |
| 1338 | make_tuple(8, 8, &aom_highbd_sad8x8x4d_c, 12), |
| 1339 | make_tuple(8, 4, &aom_highbd_sad8x4x4d_c, 12), |
| 1340 | make_tuple(4, 8, &aom_highbd_sad4x8x4d_c, 12), |
| 1341 | make_tuple(4, 4, &aom_highbd_sad4x4x4d_c, 12), |
Ryan Lei | 2a67637 | 2020-09-28 16:58:52 -0700 | [diff] [blame] | 1342 | |
Debargha Mukherjee | 5b5cbbd | 2019-07-15 15:43:57 -0700 | [diff] [blame] | 1343 | make_tuple(64, 16, &aom_highbd_sad64x16x4d_c, 8), |
| 1344 | make_tuple(16, 64, &aom_highbd_sad16x64x4d_c, 8), |
| 1345 | make_tuple(64, 16, &aom_highbd_sad64x16x4d_c, 10), |
| 1346 | make_tuple(16, 64, &aom_highbd_sad16x64x4d_c, 10), |
| 1347 | make_tuple(64, 16, &aom_highbd_sad64x16x4d_c, 12), |
| 1348 | make_tuple(16, 64, &aom_highbd_sad16x64x4d_c, 12), |
Ryan Lei | 2a67637 | 2020-09-28 16:58:52 -0700 | [diff] [blame] | 1349 | |
Debargha Mukherjee | 5b5cbbd | 2019-07-15 15:43:57 -0700 | [diff] [blame] | 1350 | make_tuple(32, 8, &aom_highbd_sad32x8x4d_c, 8), |
| 1351 | make_tuple(8, 32, &aom_highbd_sad8x32x4d_c, 8), |
| 1352 | make_tuple(32, 8, &aom_highbd_sad32x8x4d_c, 10), |
| 1353 | make_tuple(8, 32, &aom_highbd_sad8x32x4d_c, 10), |
| 1354 | make_tuple(32, 8, &aom_highbd_sad32x8x4d_c, 12), |
| 1355 | make_tuple(8, 32, &aom_highbd_sad8x32x4d_c, 12), |
Ryan Lei | 2a67637 | 2020-09-28 16:58:52 -0700 | [diff] [blame] | 1356 | |
Debargha Mukherjee | 5b5cbbd | 2019-07-15 15:43:57 -0700 | [diff] [blame] | 1357 | make_tuple(16, 4, &aom_highbd_sad16x4x4d_c, 8), |
| 1358 | make_tuple(4, 16, &aom_highbd_sad4x16x4d_c, 8), |
| 1359 | make_tuple(16, 4, &aom_highbd_sad16x4x4d_c, 10), |
| 1360 | make_tuple(4, 16, &aom_highbd_sad4x16x4d_c, 10), |
| 1361 | make_tuple(16, 4, &aom_highbd_sad16x4x4d_c, 12), |
| 1362 | make_tuple(4, 16, &aom_highbd_sad4x16x4d_c, 12), |
Johann | d5d9289 | 2015-04-17 16:11:38 -0400 | [diff] [blame] | 1363 | }; |
Cheng Chen | 96786fe | 2020-02-14 17:28:25 -0800 | [diff] [blame] | 1364 | INSTANTIATE_TEST_SUITE_P(C, SADx4Test, ::testing::ValuesIn(x4d_c_tests)); |
John Koleszar | 1cfc86e | 2013-03-01 12:43:41 -0800 | [diff] [blame] | 1365 | |
chiyotsai | c814afb | 2020-08-04 13:12:35 -0700 | [diff] [blame] | 1366 | const SadMxNx4Param skip_x4d_c_tests[] = { |
chiyotsai | c814afb | 2020-08-04 13:12:35 -0700 | [diff] [blame] | 1367 | make_tuple(128, 128, &aom_highbd_sad_skip_128x128x4d_c, 8), |
| 1368 | make_tuple(128, 64, &aom_highbd_sad_skip_128x64x4d_c, 8), |
| 1369 | make_tuple(64, 128, &aom_highbd_sad_skip_64x128x4d_c, 8), |
| 1370 | make_tuple(64, 64, &aom_highbd_sad_skip_64x64x4d_c, 8), |
| 1371 | make_tuple(64, 32, &aom_highbd_sad_skip_64x32x4d_c, 8), |
| 1372 | make_tuple(32, 64, &aom_highbd_sad_skip_32x64x4d_c, 8), |
| 1373 | make_tuple(32, 32, &aom_highbd_sad_skip_32x32x4d_c, 8), |
| 1374 | make_tuple(32, 16, &aom_highbd_sad_skip_32x16x4d_c, 8), |
| 1375 | make_tuple(16, 32, &aom_highbd_sad_skip_16x32x4d_c, 8), |
| 1376 | make_tuple(16, 16, &aom_highbd_sad_skip_16x16x4d_c, 8), |
| 1377 | make_tuple(16, 8, &aom_highbd_sad_skip_16x8x4d_c, 8), |
| 1378 | make_tuple(8, 16, &aom_highbd_sad_skip_8x16x4d_c, 8), |
| 1379 | make_tuple(8, 8, &aom_highbd_sad_skip_8x8x4d_c, 8), |
| 1380 | make_tuple(8, 4, &aom_highbd_sad_skip_8x4x4d_c, 8), |
| 1381 | make_tuple(4, 8, &aom_highbd_sad_skip_4x8x4d_c, 8), |
| 1382 | make_tuple(4, 4, &aom_highbd_sad_skip_4x4x4d_c, 8), |
| 1383 | make_tuple(64, 16, &aom_highbd_sad_skip_64x16x4d_c, 8), |
| 1384 | make_tuple(16, 64, &aom_highbd_sad_skip_16x64x4d_c, 8), |
| 1385 | make_tuple(32, 8, &aom_highbd_sad_skip_32x8x4d_c, 8), |
| 1386 | make_tuple(8, 32, &aom_highbd_sad_skip_8x32x4d_c, 8), |
| 1387 | make_tuple(16, 4, &aom_highbd_sad_skip_16x4x4d_c, 8), |
| 1388 | make_tuple(4, 16, &aom_highbd_sad_skip_4x16x4d_c, 8), |
| 1389 | |
| 1390 | make_tuple(128, 128, &aom_highbd_sad_skip_128x128x4d_c, 10), |
| 1391 | make_tuple(128, 64, &aom_highbd_sad_skip_128x64x4d_c, 10), |
| 1392 | make_tuple(64, 128, &aom_highbd_sad_skip_64x128x4d_c, 10), |
| 1393 | make_tuple(64, 64, &aom_highbd_sad_skip_64x64x4d_c, 10), |
| 1394 | make_tuple(64, 32, &aom_highbd_sad_skip_64x32x4d_c, 10), |
| 1395 | make_tuple(32, 64, &aom_highbd_sad_skip_32x64x4d_c, 10), |
| 1396 | make_tuple(32, 32, &aom_highbd_sad_skip_32x32x4d_c, 10), |
| 1397 | make_tuple(32, 16, &aom_highbd_sad_skip_32x16x4d_c, 10), |
| 1398 | make_tuple(16, 32, &aom_highbd_sad_skip_16x32x4d_c, 10), |
| 1399 | make_tuple(16, 16, &aom_highbd_sad_skip_16x16x4d_c, 10), |
| 1400 | make_tuple(16, 8, &aom_highbd_sad_skip_16x8x4d_c, 10), |
| 1401 | make_tuple(8, 16, &aom_highbd_sad_skip_8x16x4d_c, 10), |
| 1402 | make_tuple(8, 8, &aom_highbd_sad_skip_8x8x4d_c, 10), |
| 1403 | make_tuple(8, 4, &aom_highbd_sad_skip_8x4x4d_c, 10), |
| 1404 | make_tuple(4, 8, &aom_highbd_sad_skip_4x8x4d_c, 10), |
| 1405 | make_tuple(4, 4, &aom_highbd_sad_skip_4x4x4d_c, 10), |
| 1406 | make_tuple(64, 16, &aom_highbd_sad_skip_64x16x4d_c, 10), |
| 1407 | make_tuple(16, 64, &aom_highbd_sad_skip_16x64x4d_c, 10), |
| 1408 | make_tuple(32, 8, &aom_highbd_sad_skip_32x8x4d_c, 10), |
| 1409 | make_tuple(8, 32, &aom_highbd_sad_skip_8x32x4d_c, 10), |
| 1410 | make_tuple(16, 4, &aom_highbd_sad_skip_16x4x4d_c, 10), |
| 1411 | make_tuple(4, 16, &aom_highbd_sad_skip_4x16x4d_c, 10), |
| 1412 | |
| 1413 | make_tuple(128, 128, &aom_highbd_sad_skip_128x128x4d_c, 12), |
| 1414 | make_tuple(128, 64, &aom_highbd_sad_skip_128x64x4d_c, 12), |
| 1415 | make_tuple(64, 128, &aom_highbd_sad_skip_64x128x4d_c, 12), |
| 1416 | make_tuple(64, 64, &aom_highbd_sad_skip_64x64x4d_c, 12), |
| 1417 | make_tuple(64, 32, &aom_highbd_sad_skip_64x32x4d_c, 12), |
| 1418 | make_tuple(32, 64, &aom_highbd_sad_skip_32x64x4d_c, 12), |
| 1419 | make_tuple(32, 32, &aom_highbd_sad_skip_32x32x4d_c, 12), |
| 1420 | make_tuple(32, 16, &aom_highbd_sad_skip_32x16x4d_c, 12), |
| 1421 | make_tuple(16, 32, &aom_highbd_sad_skip_16x32x4d_c, 12), |
| 1422 | make_tuple(16, 16, &aom_highbd_sad_skip_16x16x4d_c, 12), |
| 1423 | make_tuple(16, 8, &aom_highbd_sad_skip_16x8x4d_c, 12), |
| 1424 | make_tuple(8, 16, &aom_highbd_sad_skip_8x16x4d_c, 12), |
| 1425 | make_tuple(8, 8, &aom_highbd_sad_skip_8x8x4d_c, 12), |
| 1426 | make_tuple(8, 4, &aom_highbd_sad_skip_8x4x4d_c, 12), |
| 1427 | make_tuple(4, 8, &aom_highbd_sad_skip_4x8x4d_c, 12), |
| 1428 | make_tuple(4, 4, &aom_highbd_sad_skip_4x4x4d_c, 12), |
| 1429 | make_tuple(64, 16, &aom_highbd_sad_skip_64x16x4d_c, 12), |
| 1430 | make_tuple(16, 64, &aom_highbd_sad_skip_16x64x4d_c, 12), |
| 1431 | make_tuple(32, 8, &aom_highbd_sad_skip_32x8x4d_c, 12), |
| 1432 | make_tuple(8, 32, &aom_highbd_sad_skip_8x32x4d_c, 12), |
| 1433 | make_tuple(16, 4, &aom_highbd_sad_skip_16x4x4d_c, 12), |
| 1434 | make_tuple(4, 16, &aom_highbd_sad_skip_4x16x4d_c, 12), |
chiyotsai | c814afb | 2020-08-04 13:12:35 -0700 | [diff] [blame] | 1435 | }; |
| 1436 | INSTANTIATE_TEST_SUITE_P(C, SADSkipx4Test, |
| 1437 | ::testing::ValuesIn(skip_x4d_c_tests)); |
James Zern | d7cff28 | 2014-02-27 12:49:02 -0800 | [diff] [blame] | 1438 | //------------------------------------------------------------------------------ |
| 1439 | // x86 functions |
Johann | fbea897 | 2012-06-28 11:43:58 -0700 | [diff] [blame] | 1440 | #if HAVE_SSE2 |
James Zern | 18e733b | 2014-07-16 18:59:28 -0700 | [diff] [blame] | 1441 | const SadMxNParam sse2_tests[] = { |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 1442 | make_tuple(64, 64, &aom_highbd_sad64x64_sse2, 8), |
| 1443 | make_tuple(64, 32, &aom_highbd_sad64x32_sse2, 8), |
| 1444 | make_tuple(32, 64, &aom_highbd_sad32x64_sse2, 8), |
| 1445 | make_tuple(32, 32, &aom_highbd_sad32x32_sse2, 8), |
| 1446 | make_tuple(32, 16, &aom_highbd_sad32x16_sse2, 8), |
| 1447 | make_tuple(16, 32, &aom_highbd_sad16x32_sse2, 8), |
| 1448 | make_tuple(16, 16, &aom_highbd_sad16x16_sse2, 8), |
| 1449 | make_tuple(16, 8, &aom_highbd_sad16x8_sse2, 8), |
| 1450 | make_tuple(8, 16, &aom_highbd_sad8x16_sse2, 8), |
| 1451 | make_tuple(8, 8, &aom_highbd_sad8x8_sse2, 8), |
| 1452 | make_tuple(8, 4, &aom_highbd_sad8x4_sse2, 8), |
chiyotsai | c6b9f6b | 2019-07-16 10:39:32 -0700 | [diff] [blame] | 1453 | make_tuple(4, 8, &aom_highbd_sad4x8_sse2, 8), |
| 1454 | make_tuple(4, 4, &aom_highbd_sad4x4_sse2, 8), |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 1455 | make_tuple(64, 64, &aom_highbd_sad64x64_sse2, 10), |
| 1456 | make_tuple(64, 32, &aom_highbd_sad64x32_sse2, 10), |
| 1457 | make_tuple(32, 64, &aom_highbd_sad32x64_sse2, 10), |
| 1458 | make_tuple(32, 32, &aom_highbd_sad32x32_sse2, 10), |
| 1459 | make_tuple(32, 16, &aom_highbd_sad32x16_sse2, 10), |
| 1460 | make_tuple(16, 32, &aom_highbd_sad16x32_sse2, 10), |
| 1461 | make_tuple(16, 16, &aom_highbd_sad16x16_sse2, 10), |
| 1462 | make_tuple(16, 8, &aom_highbd_sad16x8_sse2, 10), |
| 1463 | make_tuple(8, 16, &aom_highbd_sad8x16_sse2, 10), |
| 1464 | make_tuple(8, 8, &aom_highbd_sad8x8_sse2, 10), |
| 1465 | make_tuple(8, 4, &aom_highbd_sad8x4_sse2, 10), |
chiyotsai | c6b9f6b | 2019-07-16 10:39:32 -0700 | [diff] [blame] | 1466 | make_tuple(4, 8, &aom_highbd_sad4x8_sse2, 10), |
| 1467 | make_tuple(4, 4, &aom_highbd_sad4x4_sse2, 10), |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 1468 | make_tuple(64, 64, &aom_highbd_sad64x64_sse2, 12), |
| 1469 | make_tuple(64, 32, &aom_highbd_sad64x32_sse2, 12), |
| 1470 | make_tuple(32, 64, &aom_highbd_sad32x64_sse2, 12), |
| 1471 | make_tuple(32, 32, &aom_highbd_sad32x32_sse2, 12), |
| 1472 | make_tuple(32, 16, &aom_highbd_sad32x16_sse2, 12), |
| 1473 | make_tuple(16, 32, &aom_highbd_sad16x32_sse2, 12), |
| 1474 | make_tuple(16, 16, &aom_highbd_sad16x16_sse2, 12), |
| 1475 | make_tuple(16, 8, &aom_highbd_sad16x8_sse2, 12), |
| 1476 | make_tuple(8, 16, &aom_highbd_sad8x16_sse2, 12), |
| 1477 | make_tuple(8, 8, &aom_highbd_sad8x8_sse2, 12), |
| 1478 | make_tuple(8, 4, &aom_highbd_sad8x4_sse2, 12), |
chiyotsai | c6b9f6b | 2019-07-16 10:39:32 -0700 | [diff] [blame] | 1479 | make_tuple(4, 8, &aom_highbd_sad4x8_sse2, 12), |
| 1480 | make_tuple(4, 4, &aom_highbd_sad4x4_sse2, 12), |
Ryan Lei | 2a67637 | 2020-09-28 16:58:52 -0700 | [diff] [blame] | 1481 | |
Debargha Mukherjee | 5b5cbbd | 2019-07-15 15:43:57 -0700 | [diff] [blame] | 1482 | make_tuple(64, 16, &aom_highbd_sad64x16_sse2, 8), |
| 1483 | make_tuple(16, 64, &aom_highbd_sad16x64_sse2, 8), |
| 1484 | make_tuple(64, 16, &aom_highbd_sad64x16_sse2, 10), |
| 1485 | make_tuple(16, 64, &aom_highbd_sad16x64_sse2, 10), |
| 1486 | make_tuple(64, 16, &aom_highbd_sad64x16_sse2, 12), |
| 1487 | make_tuple(16, 64, &aom_highbd_sad16x64_sse2, 12), |
Ryan Lei | 2a67637 | 2020-09-28 16:58:52 -0700 | [diff] [blame] | 1488 | |
Debargha Mukherjee | 5b5cbbd | 2019-07-15 15:43:57 -0700 | [diff] [blame] | 1489 | make_tuple(32, 8, &aom_highbd_sad32x8_sse2, 8), |
| 1490 | make_tuple(8, 32, &aom_highbd_sad8x32_sse2, 8), |
| 1491 | make_tuple(32, 8, &aom_highbd_sad32x8_sse2, 10), |
| 1492 | make_tuple(8, 32, &aom_highbd_sad8x32_sse2, 10), |
| 1493 | make_tuple(32, 8, &aom_highbd_sad32x8_sse2, 12), |
| 1494 | make_tuple(8, 32, &aom_highbd_sad8x32_sse2, 12), |
Ryan Lei | 2a67637 | 2020-09-28 16:58:52 -0700 | [diff] [blame] | 1495 | |
Debargha Mukherjee | 5b5cbbd | 2019-07-15 15:43:57 -0700 | [diff] [blame] | 1496 | make_tuple(16, 4, &aom_highbd_sad16x4_sse2, 8), |
chiyotsai | c6b9f6b | 2019-07-16 10:39:32 -0700 | [diff] [blame] | 1497 | make_tuple(4, 16, &aom_highbd_sad4x16_sse2, 8), |
Debargha Mukherjee | 5b5cbbd | 2019-07-15 15:43:57 -0700 | [diff] [blame] | 1498 | make_tuple(16, 4, &aom_highbd_sad16x4_sse2, 10), |
chiyotsai | c6b9f6b | 2019-07-16 10:39:32 -0700 | [diff] [blame] | 1499 | make_tuple(4, 16, &aom_highbd_sad4x16_sse2, 10), |
Debargha Mukherjee | 5b5cbbd | 2019-07-15 15:43:57 -0700 | [diff] [blame] | 1500 | make_tuple(16, 4, &aom_highbd_sad16x4_sse2, 12), |
chiyotsai | c6b9f6b | 2019-07-16 10:39:32 -0700 | [diff] [blame] | 1501 | make_tuple(4, 16, &aom_highbd_sad4x16_sse2, 12), |
Deb Mukherjee | fc88292 | 2014-05-13 10:11:42 -0700 | [diff] [blame] | 1502 | }; |
Cheng Chen | 96786fe | 2020-02-14 17:28:25 -0800 | [diff] [blame] | 1503 | INSTANTIATE_TEST_SUITE_P(SSE2, SADTest, ::testing::ValuesIn(sse2_tests)); |
Deb Mukherjee | fc88292 | 2014-05-13 10:11:42 -0700 | [diff] [blame] | 1504 | |
chiyotsai | c814afb | 2020-08-04 13:12:35 -0700 | [diff] [blame] | 1505 | const SadSkipMxNParam skip_sse2_tests[] = { |
chiyotsai | c814afb | 2020-08-04 13:12:35 -0700 | [diff] [blame] | 1506 | make_tuple(64, 64, &aom_highbd_sad_skip_64x64_sse2, 8), |
| 1507 | make_tuple(64, 32, &aom_highbd_sad_skip_64x32_sse2, 8), |
| 1508 | make_tuple(32, 64, &aom_highbd_sad_skip_32x64_sse2, 8), |
| 1509 | make_tuple(32, 32, &aom_highbd_sad_skip_32x32_sse2, 8), |
| 1510 | make_tuple(32, 16, &aom_highbd_sad_skip_32x16_sse2, 8), |
| 1511 | make_tuple(16, 32, &aom_highbd_sad_skip_16x32_sse2, 8), |
| 1512 | make_tuple(16, 16, &aom_highbd_sad_skip_16x16_sse2, 8), |
| 1513 | make_tuple(16, 8, &aom_highbd_sad_skip_16x8_sse2, 8), |
| 1514 | make_tuple(8, 16, &aom_highbd_sad_skip_8x16_sse2, 8), |
| 1515 | make_tuple(8, 8, &aom_highbd_sad_skip_8x8_sse2, 8), |
| 1516 | make_tuple(4, 8, &aom_highbd_sad_skip_4x8_sse2, 8), |
| 1517 | make_tuple(64, 16, &aom_highbd_sad_skip_64x16_sse2, 8), |
| 1518 | make_tuple(16, 64, &aom_highbd_sad_skip_16x64_sse2, 8), |
| 1519 | make_tuple(32, 8, &aom_highbd_sad_skip_32x8_sse2, 8), |
| 1520 | make_tuple(8, 32, &aom_highbd_sad_skip_8x32_sse2, 8), |
| 1521 | make_tuple(4, 16, &aom_highbd_sad_skip_4x16_sse2, 8), |
| 1522 | |
| 1523 | make_tuple(64, 64, &aom_highbd_sad_skip_64x64_sse2, 10), |
| 1524 | make_tuple(64, 32, &aom_highbd_sad_skip_64x32_sse2, 10), |
| 1525 | make_tuple(32, 64, &aom_highbd_sad_skip_32x64_sse2, 10), |
| 1526 | make_tuple(32, 32, &aom_highbd_sad_skip_32x32_sse2, 10), |
| 1527 | make_tuple(32, 16, &aom_highbd_sad_skip_32x16_sse2, 10), |
| 1528 | make_tuple(16, 32, &aom_highbd_sad_skip_16x32_sse2, 10), |
| 1529 | make_tuple(16, 16, &aom_highbd_sad_skip_16x16_sse2, 10), |
| 1530 | make_tuple(16, 8, &aom_highbd_sad_skip_16x8_sse2, 10), |
| 1531 | make_tuple(8, 16, &aom_highbd_sad_skip_8x16_sse2, 10), |
| 1532 | make_tuple(8, 8, &aom_highbd_sad_skip_8x8_sse2, 10), |
| 1533 | make_tuple(4, 8, &aom_highbd_sad_skip_4x8_sse2, 10), |
| 1534 | make_tuple(64, 16, &aom_highbd_sad_skip_64x16_sse2, 10), |
| 1535 | make_tuple(16, 64, &aom_highbd_sad_skip_16x64_sse2, 10), |
| 1536 | make_tuple(32, 8, &aom_highbd_sad_skip_32x8_sse2, 10), |
| 1537 | make_tuple(8, 32, &aom_highbd_sad_skip_8x32_sse2, 10), |
| 1538 | make_tuple(4, 16, &aom_highbd_sad_skip_4x16_sse2, 10), |
| 1539 | |
| 1540 | make_tuple(64, 64, &aom_highbd_sad_skip_64x64_sse2, 12), |
| 1541 | make_tuple(64, 32, &aom_highbd_sad_skip_64x32_sse2, 12), |
| 1542 | make_tuple(32, 64, &aom_highbd_sad_skip_32x64_sse2, 12), |
| 1543 | make_tuple(32, 32, &aom_highbd_sad_skip_32x32_sse2, 12), |
| 1544 | make_tuple(32, 16, &aom_highbd_sad_skip_32x16_sse2, 12), |
| 1545 | make_tuple(16, 32, &aom_highbd_sad_skip_16x32_sse2, 12), |
| 1546 | make_tuple(16, 16, &aom_highbd_sad_skip_16x16_sse2, 12), |
| 1547 | make_tuple(16, 8, &aom_highbd_sad_skip_16x8_sse2, 12), |
| 1548 | make_tuple(8, 16, &aom_highbd_sad_skip_8x16_sse2, 12), |
| 1549 | make_tuple(8, 8, &aom_highbd_sad_skip_8x8_sse2, 12), |
| 1550 | make_tuple(4, 8, &aom_highbd_sad_skip_4x8_sse2, 12), |
| 1551 | make_tuple(64, 16, &aom_highbd_sad_skip_64x16_sse2, 12), |
| 1552 | make_tuple(16, 64, &aom_highbd_sad_skip_16x64_sse2, 12), |
| 1553 | make_tuple(32, 8, &aom_highbd_sad_skip_32x8_sse2, 12), |
| 1554 | make_tuple(8, 32, &aom_highbd_sad_skip_8x32_sse2, 12), |
| 1555 | make_tuple(4, 16, &aom_highbd_sad_skip_4x16_sse2, 12), |
chiyotsai | c814afb | 2020-08-04 13:12:35 -0700 | [diff] [blame] | 1556 | }; |
| 1557 | INSTANTIATE_TEST_SUITE_P(SSE2, SADSkipTest, |
| 1558 | ::testing::ValuesIn(skip_sse2_tests)); |
| 1559 | |
Johann | d5d9289 | 2015-04-17 16:11:38 -0400 | [diff] [blame] | 1560 | const SadMxNAvgParam avg_sse2_tests[] = { |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 1561 | make_tuple(64, 64, &aom_highbd_sad64x64_avg_sse2, 8), |
| 1562 | make_tuple(64, 32, &aom_highbd_sad64x32_avg_sse2, 8), |
| 1563 | make_tuple(32, 64, &aom_highbd_sad32x64_avg_sse2, 8), |
| 1564 | make_tuple(32, 32, &aom_highbd_sad32x32_avg_sse2, 8), |
| 1565 | make_tuple(32, 16, &aom_highbd_sad32x16_avg_sse2, 8), |
| 1566 | make_tuple(16, 32, &aom_highbd_sad16x32_avg_sse2, 8), |
| 1567 | make_tuple(16, 16, &aom_highbd_sad16x16_avg_sse2, 8), |
| 1568 | make_tuple(16, 8, &aom_highbd_sad16x8_avg_sse2, 8), |
| 1569 | make_tuple(8, 16, &aom_highbd_sad8x16_avg_sse2, 8), |
| 1570 | make_tuple(8, 8, &aom_highbd_sad8x8_avg_sse2, 8), |
| 1571 | make_tuple(8, 4, &aom_highbd_sad8x4_avg_sse2, 8), |
chiyotsai | c6b9f6b | 2019-07-16 10:39:32 -0700 | [diff] [blame] | 1572 | make_tuple(4, 8, &aom_highbd_sad4x8_avg_sse2, 8), |
| 1573 | make_tuple(4, 4, &aom_highbd_sad4x4_avg_sse2, 8), |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 1574 | make_tuple(64, 64, &aom_highbd_sad64x64_avg_sse2, 10), |
| 1575 | make_tuple(64, 32, &aom_highbd_sad64x32_avg_sse2, 10), |
| 1576 | make_tuple(32, 64, &aom_highbd_sad32x64_avg_sse2, 10), |
| 1577 | make_tuple(32, 32, &aom_highbd_sad32x32_avg_sse2, 10), |
| 1578 | make_tuple(32, 16, &aom_highbd_sad32x16_avg_sse2, 10), |
| 1579 | make_tuple(16, 32, &aom_highbd_sad16x32_avg_sse2, 10), |
| 1580 | make_tuple(16, 16, &aom_highbd_sad16x16_avg_sse2, 10), |
| 1581 | make_tuple(16, 8, &aom_highbd_sad16x8_avg_sse2, 10), |
| 1582 | make_tuple(8, 16, &aom_highbd_sad8x16_avg_sse2, 10), |
| 1583 | make_tuple(8, 8, &aom_highbd_sad8x8_avg_sse2, 10), |
| 1584 | make_tuple(8, 4, &aom_highbd_sad8x4_avg_sse2, 10), |
chiyotsai | c6b9f6b | 2019-07-16 10:39:32 -0700 | [diff] [blame] | 1585 | make_tuple(4, 8, &aom_highbd_sad4x8_avg_sse2, 10), |
| 1586 | make_tuple(4, 4, &aom_highbd_sad4x4_avg_sse2, 10), |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 1587 | make_tuple(64, 64, &aom_highbd_sad64x64_avg_sse2, 12), |
| 1588 | make_tuple(64, 32, &aom_highbd_sad64x32_avg_sse2, 12), |
| 1589 | make_tuple(32, 64, &aom_highbd_sad32x64_avg_sse2, 12), |
| 1590 | make_tuple(32, 32, &aom_highbd_sad32x32_avg_sse2, 12), |
| 1591 | make_tuple(32, 16, &aom_highbd_sad32x16_avg_sse2, 12), |
| 1592 | make_tuple(16, 32, &aom_highbd_sad16x32_avg_sse2, 12), |
| 1593 | make_tuple(16, 16, &aom_highbd_sad16x16_avg_sse2, 12), |
| 1594 | make_tuple(16, 8, &aom_highbd_sad16x8_avg_sse2, 12), |
| 1595 | make_tuple(8, 16, &aom_highbd_sad8x16_avg_sse2, 12), |
| 1596 | make_tuple(8, 8, &aom_highbd_sad8x8_avg_sse2, 12), |
| 1597 | make_tuple(8, 4, &aom_highbd_sad8x4_avg_sse2, 12), |
chiyotsai | c6b9f6b | 2019-07-16 10:39:32 -0700 | [diff] [blame] | 1598 | make_tuple(4, 8, &aom_highbd_sad4x8_avg_sse2, 12), |
| 1599 | make_tuple(4, 4, &aom_highbd_sad4x4_avg_sse2, 12), |
Ryan Lei | 2a67637 | 2020-09-28 16:58:52 -0700 | [diff] [blame] | 1600 | |
Debargha Mukherjee | 5b5cbbd | 2019-07-15 15:43:57 -0700 | [diff] [blame] | 1601 | make_tuple(64, 16, &aom_highbd_sad64x16_avg_sse2, 8), |
| 1602 | make_tuple(16, 64, &aom_highbd_sad16x64_avg_sse2, 8), |
| 1603 | make_tuple(64, 16, &aom_highbd_sad64x16_avg_sse2, 10), |
| 1604 | make_tuple(16, 64, &aom_highbd_sad16x64_avg_sse2, 10), |
| 1605 | make_tuple(64, 16, &aom_highbd_sad64x16_avg_sse2, 12), |
| 1606 | make_tuple(16, 64, &aom_highbd_sad16x64_avg_sse2, 12), |
Ryan Lei | 2a67637 | 2020-09-28 16:58:52 -0700 | [diff] [blame] | 1607 | |
Debargha Mukherjee | 5b5cbbd | 2019-07-15 15:43:57 -0700 | [diff] [blame] | 1608 | make_tuple(32, 8, &aom_highbd_sad32x8_avg_sse2, 8), |
| 1609 | make_tuple(8, 32, &aom_highbd_sad8x32_avg_sse2, 8), |
| 1610 | make_tuple(32, 8, &aom_highbd_sad32x8_avg_sse2, 10), |
| 1611 | make_tuple(8, 32, &aom_highbd_sad8x32_avg_sse2, 10), |
| 1612 | make_tuple(32, 8, &aom_highbd_sad32x8_avg_sse2, 12), |
| 1613 | make_tuple(8, 32, &aom_highbd_sad8x32_avg_sse2, 12), |
Ryan Lei | 2a67637 | 2020-09-28 16:58:52 -0700 | [diff] [blame] | 1614 | |
Debargha Mukherjee | 5b5cbbd | 2019-07-15 15:43:57 -0700 | [diff] [blame] | 1615 | make_tuple(16, 4, &aom_highbd_sad16x4_avg_sse2, 8), |
chiyotsai | c6b9f6b | 2019-07-16 10:39:32 -0700 | [diff] [blame] | 1616 | make_tuple(4, 16, &aom_highbd_sad4x16_avg_sse2, 8), |
Debargha Mukherjee | 5b5cbbd | 2019-07-15 15:43:57 -0700 | [diff] [blame] | 1617 | make_tuple(16, 4, &aom_highbd_sad16x4_avg_sse2, 10), |
chiyotsai | c6b9f6b | 2019-07-16 10:39:32 -0700 | [diff] [blame] | 1618 | make_tuple(4, 16, &aom_highbd_sad4x16_avg_sse2, 10), |
Debargha Mukherjee | 5b5cbbd | 2019-07-15 15:43:57 -0700 | [diff] [blame] | 1619 | make_tuple(16, 4, &aom_highbd_sad16x4_avg_sse2, 12), |
chiyotsai | c6b9f6b | 2019-07-16 10:39:32 -0700 | [diff] [blame] | 1620 | make_tuple(4, 16, &aom_highbd_sad4x16_avg_sse2, 12), |
Johann | d5d9289 | 2015-04-17 16:11:38 -0400 | [diff] [blame] | 1621 | }; |
Cheng Chen | 96786fe | 2020-02-14 17:28:25 -0800 | [diff] [blame] | 1622 | INSTANTIATE_TEST_SUITE_P(SSE2, SADavgTest, ::testing::ValuesIn(avg_sse2_tests)); |
Johann | d5d9289 | 2015-04-17 16:11:38 -0400 | [diff] [blame] | 1623 | |
Johann | d5d9289 | 2015-04-17 16:11:38 -0400 | [diff] [blame] | 1624 | const SadMxNx4Param x4d_sse2_tests[] = { |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 1625 | make_tuple(64, 64, &aom_highbd_sad64x64x4d_sse2, 8), |
| 1626 | make_tuple(64, 32, &aom_highbd_sad64x32x4d_sse2, 8), |
| 1627 | make_tuple(32, 64, &aom_highbd_sad32x64x4d_sse2, 8), |
| 1628 | make_tuple(32, 32, &aom_highbd_sad32x32x4d_sse2, 8), |
| 1629 | make_tuple(32, 16, &aom_highbd_sad32x16x4d_sse2, 8), |
| 1630 | make_tuple(16, 32, &aom_highbd_sad16x32x4d_sse2, 8), |
| 1631 | make_tuple(16, 16, &aom_highbd_sad16x16x4d_sse2, 8), |
| 1632 | make_tuple(16, 8, &aom_highbd_sad16x8x4d_sse2, 8), |
| 1633 | make_tuple(8, 16, &aom_highbd_sad8x16x4d_sse2, 8), |
| 1634 | make_tuple(8, 8, &aom_highbd_sad8x8x4d_sse2, 8), |
| 1635 | make_tuple(8, 4, &aom_highbd_sad8x4x4d_sse2, 8), |
| 1636 | make_tuple(4, 8, &aom_highbd_sad4x8x4d_sse2, 8), |
| 1637 | make_tuple(4, 4, &aom_highbd_sad4x4x4d_sse2, 8), |
| 1638 | make_tuple(64, 64, &aom_highbd_sad64x64x4d_sse2, 10), |
| 1639 | make_tuple(64, 32, &aom_highbd_sad64x32x4d_sse2, 10), |
| 1640 | make_tuple(32, 64, &aom_highbd_sad32x64x4d_sse2, 10), |
| 1641 | make_tuple(32, 32, &aom_highbd_sad32x32x4d_sse2, 10), |
| 1642 | make_tuple(32, 16, &aom_highbd_sad32x16x4d_sse2, 10), |
| 1643 | make_tuple(16, 32, &aom_highbd_sad16x32x4d_sse2, 10), |
| 1644 | make_tuple(16, 16, &aom_highbd_sad16x16x4d_sse2, 10), |
| 1645 | make_tuple(16, 8, &aom_highbd_sad16x8x4d_sse2, 10), |
| 1646 | make_tuple(8, 16, &aom_highbd_sad8x16x4d_sse2, 10), |
| 1647 | make_tuple(8, 8, &aom_highbd_sad8x8x4d_sse2, 10), |
| 1648 | make_tuple(8, 4, &aom_highbd_sad8x4x4d_sse2, 10), |
| 1649 | make_tuple(4, 8, &aom_highbd_sad4x8x4d_sse2, 10), |
| 1650 | make_tuple(4, 4, &aom_highbd_sad4x4x4d_sse2, 10), |
| 1651 | make_tuple(64, 64, &aom_highbd_sad64x64x4d_sse2, 12), |
| 1652 | make_tuple(64, 32, &aom_highbd_sad64x32x4d_sse2, 12), |
| 1653 | make_tuple(32, 64, &aom_highbd_sad32x64x4d_sse2, 12), |
| 1654 | make_tuple(32, 32, &aom_highbd_sad32x32x4d_sse2, 12), |
| 1655 | make_tuple(32, 16, &aom_highbd_sad32x16x4d_sse2, 12), |
| 1656 | make_tuple(16, 32, &aom_highbd_sad16x32x4d_sse2, 12), |
| 1657 | make_tuple(16, 16, &aom_highbd_sad16x16x4d_sse2, 12), |
| 1658 | make_tuple(16, 8, &aom_highbd_sad16x8x4d_sse2, 12), |
| 1659 | make_tuple(8, 16, &aom_highbd_sad8x16x4d_sse2, 12), |
| 1660 | make_tuple(8, 8, &aom_highbd_sad8x8x4d_sse2, 12), |
| 1661 | make_tuple(8, 4, &aom_highbd_sad8x4x4d_sse2, 12), |
| 1662 | make_tuple(4, 8, &aom_highbd_sad4x8x4d_sse2, 12), |
| 1663 | make_tuple(4, 4, &aom_highbd_sad4x4x4d_sse2, 12), |
Ryan Lei | 2a67637 | 2020-09-28 16:58:52 -0700 | [diff] [blame] | 1664 | |
Debargha Mukherjee | 5b5cbbd | 2019-07-15 15:43:57 -0700 | [diff] [blame] | 1665 | make_tuple(64, 16, &aom_highbd_sad64x16x4d_sse2, 8), |
| 1666 | make_tuple(16, 64, &aom_highbd_sad16x64x4d_sse2, 8), |
| 1667 | make_tuple(64, 16, &aom_highbd_sad64x16x4d_sse2, 10), |
| 1668 | make_tuple(16, 64, &aom_highbd_sad16x64x4d_sse2, 10), |
| 1669 | make_tuple(64, 16, &aom_highbd_sad64x16x4d_sse2, 12), |
| 1670 | make_tuple(16, 64, &aom_highbd_sad16x64x4d_sse2, 12), |
Ryan Lei | 2a67637 | 2020-09-28 16:58:52 -0700 | [diff] [blame] | 1671 | |
Debargha Mukherjee | 5b5cbbd | 2019-07-15 15:43:57 -0700 | [diff] [blame] | 1672 | make_tuple(32, 8, &aom_highbd_sad32x8x4d_sse2, 8), |
| 1673 | make_tuple(8, 32, &aom_highbd_sad8x32x4d_sse2, 8), |
| 1674 | make_tuple(32, 8, &aom_highbd_sad32x8x4d_sse2, 10), |
| 1675 | make_tuple(8, 32, &aom_highbd_sad8x32x4d_sse2, 10), |
| 1676 | make_tuple(32, 8, &aom_highbd_sad32x8x4d_sse2, 12), |
| 1677 | make_tuple(8, 32, &aom_highbd_sad8x32x4d_sse2, 12), |
Ryan Lei | 2a67637 | 2020-09-28 16:58:52 -0700 | [diff] [blame] | 1678 | |
Debargha Mukherjee | 5b5cbbd | 2019-07-15 15:43:57 -0700 | [diff] [blame] | 1679 | make_tuple(16, 4, &aom_highbd_sad16x4x4d_sse2, 8), |
| 1680 | make_tuple(4, 16, &aom_highbd_sad4x16x4d_sse2, 8), |
| 1681 | make_tuple(16, 4, &aom_highbd_sad16x4x4d_sse2, 10), |
| 1682 | make_tuple(4, 16, &aom_highbd_sad4x16x4d_sse2, 10), |
| 1683 | make_tuple(16, 4, &aom_highbd_sad16x4x4d_sse2, 12), |
| 1684 | make_tuple(4, 16, &aom_highbd_sad4x16x4d_sse2, 12), |
Johann | d5d9289 | 2015-04-17 16:11:38 -0400 | [diff] [blame] | 1685 | }; |
Cheng Chen | 96786fe | 2020-02-14 17:28:25 -0800 | [diff] [blame] | 1686 | INSTANTIATE_TEST_SUITE_P(SSE2, SADx4Test, ::testing::ValuesIn(x4d_sse2_tests)); |
Ruiling Song | 8dc32d7 | 2020-01-20 15:33:37 +0800 | [diff] [blame] | 1687 | |
chiyotsai | c814afb | 2020-08-04 13:12:35 -0700 | [diff] [blame] | 1688 | const SadSkipMxNx4Param skip_x4d_sse2_tests[] = { |
chiyotsai | c814afb | 2020-08-04 13:12:35 -0700 | [diff] [blame] | 1689 | make_tuple(64, 64, &aom_highbd_sad_skip_64x64x4d_sse2, 8), |
| 1690 | make_tuple(64, 32, &aom_highbd_sad_skip_64x32x4d_sse2, 8), |
| 1691 | make_tuple(32, 64, &aom_highbd_sad_skip_32x64x4d_sse2, 8), |
| 1692 | make_tuple(32, 32, &aom_highbd_sad_skip_32x32x4d_sse2, 8), |
| 1693 | make_tuple(32, 16, &aom_highbd_sad_skip_32x16x4d_sse2, 8), |
| 1694 | make_tuple(16, 32, &aom_highbd_sad_skip_16x32x4d_sse2, 8), |
| 1695 | make_tuple(16, 16, &aom_highbd_sad_skip_16x16x4d_sse2, 8), |
| 1696 | make_tuple(16, 8, &aom_highbd_sad_skip_16x8x4d_sse2, 8), |
| 1697 | make_tuple(8, 16, &aom_highbd_sad_skip_8x16x4d_sse2, 8), |
| 1698 | make_tuple(8, 8, &aom_highbd_sad_skip_8x8x4d_sse2, 8), |
| 1699 | make_tuple(4, 8, &aom_highbd_sad_skip_4x8x4d_sse2, 8), |
| 1700 | make_tuple(64, 16, &aom_highbd_sad_skip_64x16x4d_sse2, 8), |
| 1701 | make_tuple(16, 64, &aom_highbd_sad_skip_16x64x4d_sse2, 8), |
| 1702 | make_tuple(32, 8, &aom_highbd_sad_skip_32x8x4d_sse2, 8), |
| 1703 | make_tuple(8, 32, &aom_highbd_sad_skip_8x32x4d_sse2, 8), |
| 1704 | make_tuple(4, 16, &aom_highbd_sad_skip_4x16x4d_sse2, 8), |
| 1705 | |
| 1706 | make_tuple(64, 64, &aom_highbd_sad_skip_64x64x4d_sse2, 10), |
| 1707 | make_tuple(64, 32, &aom_highbd_sad_skip_64x32x4d_sse2, 10), |
| 1708 | make_tuple(32, 64, &aom_highbd_sad_skip_32x64x4d_sse2, 10), |
| 1709 | make_tuple(32, 32, &aom_highbd_sad_skip_32x32x4d_sse2, 10), |
| 1710 | make_tuple(32, 16, &aom_highbd_sad_skip_32x16x4d_sse2, 10), |
| 1711 | make_tuple(16, 32, &aom_highbd_sad_skip_16x32x4d_sse2, 10), |
| 1712 | make_tuple(16, 16, &aom_highbd_sad_skip_16x16x4d_sse2, 10), |
| 1713 | make_tuple(16, 8, &aom_highbd_sad_skip_16x8x4d_sse2, 10), |
| 1714 | make_tuple(8, 16, &aom_highbd_sad_skip_8x16x4d_sse2, 10), |
| 1715 | make_tuple(8, 8, &aom_highbd_sad_skip_8x8x4d_sse2, 10), |
| 1716 | make_tuple(4, 8, &aom_highbd_sad_skip_4x8x4d_sse2, 10), |
| 1717 | make_tuple(64, 16, &aom_highbd_sad_skip_64x16x4d_sse2, 10), |
| 1718 | make_tuple(16, 64, &aom_highbd_sad_skip_16x64x4d_sse2, 10), |
| 1719 | make_tuple(32, 8, &aom_highbd_sad_skip_32x8x4d_sse2, 10), |
| 1720 | make_tuple(8, 32, &aom_highbd_sad_skip_8x32x4d_sse2, 10), |
| 1721 | make_tuple(4, 16, &aom_highbd_sad_skip_4x16x4d_sse2, 10), |
| 1722 | |
| 1723 | make_tuple(64, 64, &aom_highbd_sad_skip_64x64x4d_sse2, 12), |
| 1724 | make_tuple(64, 32, &aom_highbd_sad_skip_64x32x4d_sse2, 12), |
| 1725 | make_tuple(32, 64, &aom_highbd_sad_skip_32x64x4d_sse2, 12), |
| 1726 | make_tuple(32, 32, &aom_highbd_sad_skip_32x32x4d_sse2, 12), |
| 1727 | make_tuple(32, 16, &aom_highbd_sad_skip_32x16x4d_sse2, 12), |
| 1728 | make_tuple(16, 32, &aom_highbd_sad_skip_16x32x4d_sse2, 12), |
| 1729 | make_tuple(16, 16, &aom_highbd_sad_skip_16x16x4d_sse2, 12), |
| 1730 | make_tuple(16, 8, &aom_highbd_sad_skip_16x8x4d_sse2, 12), |
| 1731 | make_tuple(8, 16, &aom_highbd_sad_skip_8x16x4d_sse2, 12), |
| 1732 | make_tuple(8, 8, &aom_highbd_sad_skip_8x8x4d_sse2, 12), |
| 1733 | make_tuple(4, 8, &aom_highbd_sad_skip_4x8x4d_sse2, 12), |
| 1734 | make_tuple(64, 16, &aom_highbd_sad_skip_64x16x4d_sse2, 12), |
| 1735 | make_tuple(16, 64, &aom_highbd_sad_skip_16x64x4d_sse2, 12), |
| 1736 | make_tuple(32, 8, &aom_highbd_sad_skip_32x8x4d_sse2, 12), |
| 1737 | make_tuple(8, 32, &aom_highbd_sad_skip_8x32x4d_sse2, 12), |
| 1738 | make_tuple(4, 16, &aom_highbd_sad_skip_4x16x4d_sse2, 12), |
chiyotsai | c814afb | 2020-08-04 13:12:35 -0700 | [diff] [blame] | 1739 | }; |
| 1740 | INSTANTIATE_TEST_SUITE_P(SSE2, SADSkipx4Test, |
| 1741 | ::testing::ValuesIn(skip_x4d_sse2_tests)); |
Urvang Joshi | b8b8dad | 2018-05-08 19:23:30 -0400 | [diff] [blame] | 1742 | #endif // HAVE_SSE2 |
Cheng Chen | a0367dc | 2017-11-16 19:20:42 -0800 | [diff] [blame] | 1743 | |
Johann | d5d9289 | 2015-04-17 16:11:38 -0400 | [diff] [blame] | 1744 | #if HAVE_AVX2 |
Johann | d5d9289 | 2015-04-17 16:11:38 -0400 | [diff] [blame] | 1745 | const SadMxNParam avx2_tests[] = { |
Yi Luo | e983258 | 2016-11-29 19:38:12 -0800 | [diff] [blame] | 1746 | make_tuple(128, 128, &aom_highbd_sad128x128_avx2, 8), |
| 1747 | make_tuple(128, 128, &aom_highbd_sad128x128_avx2, 10), |
| 1748 | make_tuple(128, 128, &aom_highbd_sad128x128_avx2, 12), |
| 1749 | make_tuple(128, 64, &aom_highbd_sad128x64_avx2, 8), |
| 1750 | make_tuple(128, 64, &aom_highbd_sad128x64_avx2, 10), |
| 1751 | make_tuple(128, 64, &aom_highbd_sad128x64_avx2, 12), |
| 1752 | make_tuple(64, 128, &aom_highbd_sad64x128_avx2, 8), |
| 1753 | make_tuple(64, 128, &aom_highbd_sad64x128_avx2, 10), |
| 1754 | make_tuple(64, 128, &aom_highbd_sad64x128_avx2, 12), |
Yi Luo | e983258 | 2016-11-29 19:38:12 -0800 | [diff] [blame] | 1755 | make_tuple(64, 64, &aom_highbd_sad64x64_avx2, 8), |
| 1756 | make_tuple(64, 64, &aom_highbd_sad64x64_avx2, 10), |
| 1757 | make_tuple(64, 64, &aom_highbd_sad64x64_avx2, 12), |
| 1758 | make_tuple(64, 32, &aom_highbd_sad64x32_avx2, 8), |
| 1759 | make_tuple(64, 32, &aom_highbd_sad64x32_avx2, 10), |
| 1760 | make_tuple(64, 32, &aom_highbd_sad64x32_avx2, 12), |
| 1761 | make_tuple(32, 64, &aom_highbd_sad32x64_avx2, 8), |
| 1762 | make_tuple(32, 64, &aom_highbd_sad32x64_avx2, 10), |
| 1763 | make_tuple(32, 64, &aom_highbd_sad32x64_avx2, 12), |
| 1764 | make_tuple(32, 32, &aom_highbd_sad32x32_avx2, 8), |
| 1765 | make_tuple(32, 32, &aom_highbd_sad32x32_avx2, 10), |
| 1766 | make_tuple(32, 32, &aom_highbd_sad32x32_avx2, 12), |
| 1767 | make_tuple(32, 16, &aom_highbd_sad32x16_avx2, 8), |
| 1768 | make_tuple(32, 16, &aom_highbd_sad32x16_avx2, 10), |
| 1769 | make_tuple(32, 16, &aom_highbd_sad32x16_avx2, 12), |
| 1770 | make_tuple(16, 32, &aom_highbd_sad16x32_avx2, 8), |
| 1771 | make_tuple(16, 32, &aom_highbd_sad16x32_avx2, 10), |
| 1772 | make_tuple(16, 32, &aom_highbd_sad16x32_avx2, 12), |
| 1773 | make_tuple(16, 16, &aom_highbd_sad16x16_avx2, 8), |
| 1774 | make_tuple(16, 16, &aom_highbd_sad16x16_avx2, 10), |
| 1775 | make_tuple(16, 16, &aom_highbd_sad16x16_avx2, 12), |
| 1776 | make_tuple(16, 8, &aom_highbd_sad16x8_avx2, 8), |
| 1777 | make_tuple(16, 8, &aom_highbd_sad16x8_avx2, 10), |
| 1778 | make_tuple(16, 8, &aom_highbd_sad16x8_avx2, 12), |
Debargha Mukherjee | 42451f7 | 2019-07-16 00:45:13 -0700 | [diff] [blame] | 1779 | |
| 1780 | make_tuple(64, 16, &aom_highbd_sad64x16_avx2, 8), |
| 1781 | make_tuple(64, 16, &aom_highbd_sad64x16_avx2, 10), |
| 1782 | make_tuple(64, 16, &aom_highbd_sad64x16_avx2, 12), |
| 1783 | make_tuple(16, 64, &aom_highbd_sad16x64_avx2, 8), |
| 1784 | make_tuple(16, 64, &aom_highbd_sad16x64_avx2, 10), |
| 1785 | make_tuple(16, 64, &aom_highbd_sad16x64_avx2, 12), |
| 1786 | make_tuple(32, 8, &aom_highbd_sad32x8_avx2, 8), |
| 1787 | make_tuple(32, 8, &aom_highbd_sad32x8_avx2, 10), |
| 1788 | make_tuple(32, 8, &aom_highbd_sad32x8_avx2, 12), |
| 1789 | make_tuple(16, 4, &aom_highbd_sad16x4_avx2, 8), |
| 1790 | make_tuple(16, 4, &aom_highbd_sad16x4_avx2, 10), |
| 1791 | make_tuple(16, 4, &aom_highbd_sad16x4_avx2, 12), |
Johann | d5d9289 | 2015-04-17 16:11:38 -0400 | [diff] [blame] | 1792 | }; |
Cheng Chen | 96786fe | 2020-02-14 17:28:25 -0800 | [diff] [blame] | 1793 | INSTANTIATE_TEST_SUITE_P(AVX2, SADTest, ::testing::ValuesIn(avx2_tests)); |
Johann | d5d9289 | 2015-04-17 16:11:38 -0400 | [diff] [blame] | 1794 | |
chiyotsai | c814afb | 2020-08-04 13:12:35 -0700 | [diff] [blame] | 1795 | const SadSkipMxNParam skip_avx2_tests[] = { |
Ryan Lei | 2a67637 | 2020-09-28 16:58:52 -0700 | [diff] [blame] | 1796 | |
chiyotsai | c814afb | 2020-08-04 13:12:35 -0700 | [diff] [blame] | 1797 | make_tuple(128, 128, &aom_highbd_sad_skip_128x128_avx2, 8), |
| 1798 | make_tuple(128, 64, &aom_highbd_sad_skip_128x64_avx2, 8), |
| 1799 | make_tuple(64, 128, &aom_highbd_sad_skip_64x128_avx2, 8), |
| 1800 | make_tuple(64, 64, &aom_highbd_sad_skip_64x64_avx2, 8), |
| 1801 | make_tuple(64, 32, &aom_highbd_sad_skip_64x32_avx2, 8), |
| 1802 | make_tuple(32, 64, &aom_highbd_sad_skip_32x64_avx2, 8), |
| 1803 | make_tuple(32, 32, &aom_highbd_sad_skip_32x32_avx2, 8), |
| 1804 | make_tuple(32, 16, &aom_highbd_sad_skip_32x16_avx2, 8), |
| 1805 | make_tuple(16, 64, &aom_highbd_sad_skip_16x64_avx2, 8), |
| 1806 | make_tuple(16, 32, &aom_highbd_sad_skip_16x32_avx2, 8), |
| 1807 | make_tuple(16, 16, &aom_highbd_sad_skip_16x16_avx2, 8), |
| 1808 | make_tuple(16, 8, &aom_highbd_sad_skip_16x8_avx2, 8), |
| 1809 | |
| 1810 | make_tuple(128, 128, &aom_highbd_sad_skip_128x128_avx2, 10), |
| 1811 | make_tuple(128, 64, &aom_highbd_sad_skip_128x64_avx2, 10), |
| 1812 | make_tuple(64, 128, &aom_highbd_sad_skip_64x128_avx2, 10), |
| 1813 | make_tuple(64, 64, &aom_highbd_sad_skip_64x64_avx2, 10), |
| 1814 | make_tuple(64, 32, &aom_highbd_sad_skip_64x32_avx2, 10), |
| 1815 | make_tuple(32, 64, &aom_highbd_sad_skip_32x64_avx2, 10), |
| 1816 | make_tuple(32, 32, &aom_highbd_sad_skip_32x32_avx2, 10), |
| 1817 | make_tuple(32, 16, &aom_highbd_sad_skip_32x16_avx2, 10), |
| 1818 | make_tuple(16, 64, &aom_highbd_sad_skip_16x64_avx2, 10), |
| 1819 | make_tuple(16, 32, &aom_highbd_sad_skip_16x32_avx2, 10), |
| 1820 | make_tuple(16, 16, &aom_highbd_sad_skip_16x16_avx2, 10), |
| 1821 | make_tuple(16, 8, &aom_highbd_sad_skip_16x8_avx2, 10), |
| 1822 | |
| 1823 | make_tuple(128, 128, &aom_highbd_sad_skip_128x128_avx2, 12), |
| 1824 | make_tuple(128, 64, &aom_highbd_sad_skip_128x64_avx2, 12), |
| 1825 | make_tuple(64, 128, &aom_highbd_sad_skip_64x128_avx2, 12), |
| 1826 | make_tuple(64, 64, &aom_highbd_sad_skip_64x64_avx2, 12), |
| 1827 | make_tuple(64, 32, &aom_highbd_sad_skip_64x32_avx2, 12), |
| 1828 | make_tuple(32, 64, &aom_highbd_sad_skip_32x64_avx2, 12), |
| 1829 | make_tuple(32, 32, &aom_highbd_sad_skip_32x32_avx2, 12), |
| 1830 | make_tuple(32, 16, &aom_highbd_sad_skip_32x16_avx2, 12), |
| 1831 | make_tuple(16, 64, &aom_highbd_sad_skip_16x64_avx2, 12), |
| 1832 | make_tuple(16, 32, &aom_highbd_sad_skip_16x32_avx2, 12), |
| 1833 | make_tuple(16, 16, &aom_highbd_sad_skip_16x16_avx2, 12), |
| 1834 | make_tuple(16, 8, &aom_highbd_sad_skip_16x8_avx2, 12), |
chiyotsai | c814afb | 2020-08-04 13:12:35 -0700 | [diff] [blame] | 1835 | }; |
| 1836 | INSTANTIATE_TEST_SUITE_P(AVX2, SADSkipTest, |
| 1837 | ::testing::ValuesIn(skip_avx2_tests)); |
| 1838 | |
Johann | d5d9289 | 2015-04-17 16:11:38 -0400 | [diff] [blame] | 1839 | const SadMxNAvgParam avg_avx2_tests[] = { |
Yi Luo | e983258 | 2016-11-29 19:38:12 -0800 | [diff] [blame] | 1840 | make_tuple(128, 128, &aom_highbd_sad128x128_avg_avx2, 8), |
| 1841 | make_tuple(128, 128, &aom_highbd_sad128x128_avg_avx2, 10), |
| 1842 | make_tuple(128, 128, &aom_highbd_sad128x128_avg_avx2, 12), |
| 1843 | make_tuple(128, 64, &aom_highbd_sad128x64_avg_avx2, 8), |
| 1844 | make_tuple(128, 64, &aom_highbd_sad128x64_avg_avx2, 10), |
| 1845 | make_tuple(128, 64, &aom_highbd_sad128x64_avg_avx2, 12), |
| 1846 | make_tuple(64, 128, &aom_highbd_sad64x128_avg_avx2, 8), |
| 1847 | make_tuple(64, 128, &aom_highbd_sad64x128_avg_avx2, 10), |
| 1848 | make_tuple(64, 128, &aom_highbd_sad64x128_avg_avx2, 12), |
Yi Luo | e983258 | 2016-11-29 19:38:12 -0800 | [diff] [blame] | 1849 | make_tuple(64, 64, &aom_highbd_sad64x64_avg_avx2, 8), |
| 1850 | make_tuple(64, 64, &aom_highbd_sad64x64_avg_avx2, 10), |
| 1851 | make_tuple(64, 64, &aom_highbd_sad64x64_avg_avx2, 12), |
| 1852 | make_tuple(64, 32, &aom_highbd_sad64x32_avg_avx2, 8), |
| 1853 | make_tuple(64, 32, &aom_highbd_sad64x32_avg_avx2, 10), |
| 1854 | make_tuple(64, 32, &aom_highbd_sad64x32_avg_avx2, 12), |
| 1855 | make_tuple(32, 64, &aom_highbd_sad32x64_avg_avx2, 8), |
| 1856 | make_tuple(32, 64, &aom_highbd_sad32x64_avg_avx2, 10), |
| 1857 | make_tuple(32, 64, &aom_highbd_sad32x64_avg_avx2, 12), |
| 1858 | make_tuple(32, 32, &aom_highbd_sad32x32_avg_avx2, 8), |
| 1859 | make_tuple(32, 32, &aom_highbd_sad32x32_avg_avx2, 10), |
| 1860 | make_tuple(32, 32, &aom_highbd_sad32x32_avg_avx2, 12), |
| 1861 | make_tuple(32, 16, &aom_highbd_sad32x16_avg_avx2, 8), |
| 1862 | make_tuple(32, 16, &aom_highbd_sad32x16_avg_avx2, 10), |
| 1863 | make_tuple(32, 16, &aom_highbd_sad32x16_avg_avx2, 12), |
| 1864 | make_tuple(16, 32, &aom_highbd_sad16x32_avg_avx2, 8), |
| 1865 | make_tuple(16, 32, &aom_highbd_sad16x32_avg_avx2, 10), |
| 1866 | make_tuple(16, 32, &aom_highbd_sad16x32_avg_avx2, 12), |
| 1867 | make_tuple(16, 16, &aom_highbd_sad16x16_avg_avx2, 8), |
| 1868 | make_tuple(16, 16, &aom_highbd_sad16x16_avg_avx2, 10), |
| 1869 | make_tuple(16, 16, &aom_highbd_sad16x16_avg_avx2, 12), |
| 1870 | make_tuple(16, 8, &aom_highbd_sad16x8_avg_avx2, 8), |
| 1871 | make_tuple(16, 8, &aom_highbd_sad16x8_avg_avx2, 10), |
| 1872 | make_tuple(16, 8, &aom_highbd_sad16x8_avg_avx2, 12), |
Debargha Mukherjee | 42451f7 | 2019-07-16 00:45:13 -0700 | [diff] [blame] | 1873 | |
| 1874 | make_tuple(64, 16, &aom_highbd_sad64x16_avg_avx2, 8), |
| 1875 | make_tuple(64, 16, &aom_highbd_sad64x16_avg_avx2, 10), |
| 1876 | make_tuple(64, 16, &aom_highbd_sad64x16_avg_avx2, 12), |
| 1877 | make_tuple(16, 64, &aom_highbd_sad16x64_avg_avx2, 8), |
| 1878 | make_tuple(16, 64, &aom_highbd_sad16x64_avg_avx2, 10), |
| 1879 | make_tuple(16, 64, &aom_highbd_sad16x64_avg_avx2, 12), |
| 1880 | make_tuple(32, 8, &aom_highbd_sad32x8_avg_avx2, 8), |
| 1881 | make_tuple(32, 8, &aom_highbd_sad32x8_avg_avx2, 10), |
| 1882 | make_tuple(32, 8, &aom_highbd_sad32x8_avg_avx2, 12), |
| 1883 | make_tuple(16, 4, &aom_highbd_sad16x4_avg_avx2, 8), |
| 1884 | make_tuple(16, 4, &aom_highbd_sad16x4_avg_avx2, 10), |
| 1885 | make_tuple(16, 4, &aom_highbd_sad16x4_avg_avx2, 12), |
Johann | d5d9289 | 2015-04-17 16:11:38 -0400 | [diff] [blame] | 1886 | }; |
Cheng Chen | 96786fe | 2020-02-14 17:28:25 -0800 | [diff] [blame] | 1887 | INSTANTIATE_TEST_SUITE_P(AVX2, SADavgTest, ::testing::ValuesIn(avg_avx2_tests)); |
Johann | d5d9289 | 2015-04-17 16:11:38 -0400 | [diff] [blame] | 1888 | |
chiyotsai | c814afb | 2020-08-04 13:12:35 -0700 | [diff] [blame] | 1889 | const SadSkipMxNx4Param skip_x4d_avx2_tests[] = { |
chiyotsai | c814afb | 2020-08-04 13:12:35 -0700 | [diff] [blame] | 1890 | make_tuple(128, 128, &aom_highbd_sad_skip_128x128x4d_avx2, 8), |
| 1891 | make_tuple(128, 64, &aom_highbd_sad_skip_128x64x4d_avx2, 8), |
| 1892 | make_tuple(64, 128, &aom_highbd_sad_skip_64x128x4d_avx2, 8), |
| 1893 | make_tuple(64, 64, &aom_highbd_sad_skip_64x64x4d_avx2, 8), |
| 1894 | make_tuple(64, 32, &aom_highbd_sad_skip_64x32x4d_avx2, 8), |
| 1895 | make_tuple(64, 16, &aom_highbd_sad_skip_64x16x4d_avx2, 8), |
| 1896 | make_tuple(32, 64, &aom_highbd_sad_skip_32x64x4d_avx2, 8), |
| 1897 | make_tuple(32, 32, &aom_highbd_sad_skip_32x32x4d_avx2, 8), |
| 1898 | make_tuple(32, 16, &aom_highbd_sad_skip_32x16x4d_avx2, 8), |
| 1899 | make_tuple(32, 8, &aom_highbd_sad_skip_32x8x4d_avx2, 8), |
| 1900 | make_tuple(16, 64, &aom_highbd_sad_skip_16x64x4d_avx2, 8), |
| 1901 | make_tuple(16, 32, &aom_highbd_sad_skip_16x32x4d_avx2, 8), |
| 1902 | make_tuple(16, 16, &aom_highbd_sad_skip_16x16x4d_avx2, 8), |
| 1903 | make_tuple(16, 8, &aom_highbd_sad_skip_16x8x4d_avx2, 8), |
| 1904 | |
| 1905 | make_tuple(128, 128, &aom_highbd_sad_skip_128x128x4d_avx2, 10), |
| 1906 | make_tuple(128, 64, &aom_highbd_sad_skip_128x64x4d_avx2, 10), |
| 1907 | make_tuple(64, 128, &aom_highbd_sad_skip_64x128x4d_avx2, 10), |
| 1908 | make_tuple(64, 64, &aom_highbd_sad_skip_64x64x4d_avx2, 10), |
| 1909 | make_tuple(64, 32, &aom_highbd_sad_skip_64x32x4d_avx2, 10), |
| 1910 | make_tuple(64, 16, &aom_highbd_sad_skip_64x16x4d_avx2, 10), |
| 1911 | make_tuple(32, 64, &aom_highbd_sad_skip_32x64x4d_avx2, 10), |
| 1912 | make_tuple(32, 32, &aom_highbd_sad_skip_32x32x4d_avx2, 10), |
| 1913 | make_tuple(32, 16, &aom_highbd_sad_skip_32x16x4d_avx2, 10), |
| 1914 | make_tuple(32, 8, &aom_highbd_sad_skip_32x8x4d_avx2, 10), |
| 1915 | make_tuple(16, 64, &aom_highbd_sad_skip_16x64x4d_avx2, 10), |
| 1916 | make_tuple(16, 32, &aom_highbd_sad_skip_16x32x4d_avx2, 10), |
| 1917 | make_tuple(16, 16, &aom_highbd_sad_skip_16x16x4d_avx2, 10), |
| 1918 | make_tuple(16, 8, &aom_highbd_sad_skip_16x8x4d_avx2, 10), |
| 1919 | |
| 1920 | make_tuple(128, 128, &aom_highbd_sad_skip_128x128x4d_avx2, 12), |
| 1921 | make_tuple(128, 64, &aom_highbd_sad_skip_128x64x4d_avx2, 12), |
| 1922 | make_tuple(64, 128, &aom_highbd_sad_skip_64x128x4d_avx2, 12), |
| 1923 | make_tuple(64, 64, &aom_highbd_sad_skip_64x64x4d_avx2, 12), |
| 1924 | make_tuple(64, 32, &aom_highbd_sad_skip_64x32x4d_avx2, 12), |
| 1925 | make_tuple(64, 16, &aom_highbd_sad_skip_64x16x4d_avx2, 12), |
| 1926 | make_tuple(32, 64, &aom_highbd_sad_skip_32x64x4d_avx2, 12), |
| 1927 | make_tuple(32, 32, &aom_highbd_sad_skip_32x32x4d_avx2, 12), |
| 1928 | make_tuple(32, 16, &aom_highbd_sad_skip_32x16x4d_avx2, 12), |
| 1929 | make_tuple(32, 8, &aom_highbd_sad_skip_32x8x4d_avx2, 12), |
| 1930 | make_tuple(16, 64, &aom_highbd_sad_skip_16x64x4d_avx2, 12), |
| 1931 | make_tuple(16, 32, &aom_highbd_sad_skip_16x32x4d_avx2, 12), |
| 1932 | make_tuple(16, 16, &aom_highbd_sad_skip_16x16x4d_avx2, 12), |
| 1933 | make_tuple(16, 8, &aom_highbd_sad_skip_16x8x4d_avx2, 12), |
chiyotsai | c814afb | 2020-08-04 13:12:35 -0700 | [diff] [blame] | 1934 | }; |
| 1935 | INSTANTIATE_TEST_SUITE_P(AVX2, SADSkipx4Test, |
| 1936 | ::testing::ValuesIn(skip_x4d_avx2_tests)); |
| 1937 | |
Johann | d5d9289 | 2015-04-17 16:11:38 -0400 | [diff] [blame] | 1938 | const SadMxNx4Param x4d_avx2_tests[] = { |
Yi Luo | e983258 | 2016-11-29 19:38:12 -0800 | [diff] [blame] | 1939 | make_tuple(128, 128, &aom_highbd_sad128x128x4d_avx2, 8), |
| 1940 | make_tuple(128, 128, &aom_highbd_sad128x128x4d_avx2, 10), |
| 1941 | make_tuple(128, 128, &aom_highbd_sad128x128x4d_avx2, 12), |
| 1942 | make_tuple(128, 64, &aom_highbd_sad128x64x4d_avx2, 8), |
| 1943 | make_tuple(128, 64, &aom_highbd_sad128x64x4d_avx2, 10), |
| 1944 | make_tuple(128, 64, &aom_highbd_sad128x64x4d_avx2, 12), |
| 1945 | make_tuple(64, 128, &aom_highbd_sad64x128x4d_avx2, 8), |
| 1946 | make_tuple(64, 128, &aom_highbd_sad64x128x4d_avx2, 10), |
| 1947 | make_tuple(64, 128, &aom_highbd_sad64x128x4d_avx2, 12), |
Yi Luo | e983258 | 2016-11-29 19:38:12 -0800 | [diff] [blame] | 1948 | make_tuple(64, 64, &aom_highbd_sad64x64x4d_avx2, 8), |
| 1949 | make_tuple(64, 64, &aom_highbd_sad64x64x4d_avx2, 10), |
| 1950 | make_tuple(64, 64, &aom_highbd_sad64x64x4d_avx2, 12), |
| 1951 | make_tuple(64, 32, &aom_highbd_sad64x32x4d_avx2, 8), |
| 1952 | make_tuple(64, 32, &aom_highbd_sad64x32x4d_avx2, 10), |
| 1953 | make_tuple(64, 32, &aom_highbd_sad64x32x4d_avx2, 12), |
| 1954 | make_tuple(32, 64, &aom_highbd_sad32x64x4d_avx2, 8), |
| 1955 | make_tuple(32, 64, &aom_highbd_sad32x64x4d_avx2, 10), |
| 1956 | make_tuple(32, 64, &aom_highbd_sad32x64x4d_avx2, 12), |
| 1957 | make_tuple(32, 32, &aom_highbd_sad32x32x4d_avx2, 8), |
| 1958 | make_tuple(32, 32, &aom_highbd_sad32x32x4d_avx2, 10), |
| 1959 | make_tuple(32, 32, &aom_highbd_sad32x32x4d_avx2, 12), |
| 1960 | make_tuple(32, 16, &aom_highbd_sad32x16x4d_avx2, 8), |
| 1961 | make_tuple(32, 16, &aom_highbd_sad32x16x4d_avx2, 10), |
| 1962 | make_tuple(32, 16, &aom_highbd_sad32x16x4d_avx2, 12), |
| 1963 | make_tuple(16, 32, &aom_highbd_sad16x32x4d_avx2, 8), |
| 1964 | make_tuple(16, 32, &aom_highbd_sad16x32x4d_avx2, 10), |
| 1965 | make_tuple(16, 32, &aom_highbd_sad16x32x4d_avx2, 12), |
| 1966 | make_tuple(16, 16, &aom_highbd_sad16x16x4d_avx2, 8), |
| 1967 | make_tuple(16, 16, &aom_highbd_sad16x16x4d_avx2, 10), |
| 1968 | make_tuple(16, 16, &aom_highbd_sad16x16x4d_avx2, 12), |
| 1969 | make_tuple(16, 8, &aom_highbd_sad16x8x4d_avx2, 8), |
| 1970 | make_tuple(16, 8, &aom_highbd_sad16x8x4d_avx2, 10), |
| 1971 | make_tuple(16, 8, &aom_highbd_sad16x8x4d_avx2, 12), |
Debargha Mukherjee | 42451f7 | 2019-07-16 00:45:13 -0700 | [diff] [blame] | 1972 | |
| 1973 | make_tuple(16, 64, &aom_highbd_sad16x64x4d_avx2, 8), |
| 1974 | make_tuple(16, 64, &aom_highbd_sad16x64x4d_avx2, 10), |
| 1975 | make_tuple(16, 64, &aom_highbd_sad16x64x4d_avx2, 12), |
| 1976 | make_tuple(64, 16, &aom_highbd_sad64x16x4d_avx2, 8), |
| 1977 | make_tuple(64, 16, &aom_highbd_sad64x16x4d_avx2, 10), |
| 1978 | make_tuple(64, 16, &aom_highbd_sad64x16x4d_avx2, 12), |
| 1979 | make_tuple(32, 8, &aom_highbd_sad32x8x4d_avx2, 8), |
| 1980 | make_tuple(32, 8, &aom_highbd_sad32x8x4d_avx2, 10), |
| 1981 | make_tuple(32, 8, &aom_highbd_sad32x8x4d_avx2, 12), |
| 1982 | make_tuple(16, 4, &aom_highbd_sad16x4x4d_avx2, 8), |
| 1983 | make_tuple(16, 4, &aom_highbd_sad16x4x4d_avx2, 10), |
| 1984 | make_tuple(16, 4, &aom_highbd_sad16x4x4d_avx2, 12), |
Johann | d5d9289 | 2015-04-17 16:11:38 -0400 | [diff] [blame] | 1985 | }; |
Cheng Chen | 96786fe | 2020-02-14 17:28:25 -0800 | [diff] [blame] | 1986 | INSTANTIATE_TEST_SUITE_P(AVX2, SADx4Test, ::testing::ValuesIn(x4d_avx2_tests)); |
Johann | d5d9289 | 2015-04-17 16:11:38 -0400 | [diff] [blame] | 1987 | #endif // HAVE_AVX2 |
Frank Galligan | 54fa956 | 2015-01-24 12:11:16 -0800 | [diff] [blame] | 1988 | |
Johann | fbea897 | 2012-06-28 11:43:58 -0700 | [diff] [blame] | 1989 | } // namespace |