| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebM project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 | 11 |
| 12 #include <string.h> | 12 #include <string.h> |
| 13 #include <limits.h> | 13 #include <limits.h> |
| 14 #include <stdio.h> | 14 #include <stdio.h> |
| 15 | 15 |
| 16 #include "./vpx_config.h" | 16 #include "./vpx_config.h" |
| 17 #if CONFIG_VP8_ENCODER | 17 #include "./vpx_dsp_rtcd.h" |
| 18 #include "./vp8_rtcd.h" | |
| 19 #endif | |
| 20 #if CONFIG_VP9_ENCODER | |
| 21 #include "./vp9_rtcd.h" | |
| 22 #endif | |
| 23 #include "vpx_mem/vpx_mem.h" | 18 #include "vpx_mem/vpx_mem.h" |
| 24 | 19 |
| 20 /* Needed for ROUND_POWER_OF_TWO and CONVERT_TO* macros, both of which should be |
| 21 * moved to a more generic location. Alternatively the *avg functions could be |
| 22 * restricted to VP9 builds, but it would be better to avoid that sort of |
| 23 * specificity. |
| 24 * TODO(johannkoenig): move these macros to a common location. |
| 25 */ |
| 26 #if CONFIG_VP9_HIGHBITDEPTH |
| 27 #include "vp9/common/vp9_common.h" |
| 28 #endif // CONFIG_VP9_HIGHBITDEPTH |
| 29 |
| 30 #ifndef ROUND_POWER_OF_TWO |
| 31 #define ROUND_POWER_OF_TWO(value, n) \ |
| 32 (((value) + (1 << ((n) - 1))) >> (n)) |
| 33 #endif // ROUND_POWER_OF_TWO |
| 34 |
| 35 |
| 25 #include "test/acm_random.h" | 36 #include "test/acm_random.h" |
| 26 #include "test/clear_system_state.h" | 37 #include "test/clear_system_state.h" |
| 27 #include "test/register_state_check.h" | 38 #include "test/register_state_check.h" |
| 28 #include "test/util.h" | 39 #include "test/util.h" |
| 29 #include "third_party/googletest/src/include/gtest/gtest.h" | 40 #include "third_party/googletest/src/include/gtest/gtest.h" |
| 30 #include "vpx/vpx_codec.h" | 41 #include "vpx/vpx_codec.h" |
| 31 | 42 |
| 32 | 43 |
| 33 #if CONFIG_VP8_ENCODER | 44 typedef unsigned int (*SadMxNFunc)(const uint8_t *src_ptr, |
| 34 typedef unsigned int (*SadMxNFunc)(const unsigned char *source_ptr, | 45 int src_stride, |
| 35 int source_stride, | 46 const uint8_t *ref_ptr, |
| 36 const unsigned char *reference_ptr, | 47 int ref_stride); |
| 37 int reference_stride, | |
| 38 unsigned int max_sad); | |
| 39 typedef std::tr1::tuple<int, int, SadMxNFunc, int> SadMxNParam; | 48 typedef std::tr1::tuple<int, int, SadMxNFunc, int> SadMxNParam; |
| 40 #endif | 49 |
| 41 #if CONFIG_VP9_ENCODER | 50 typedef uint32_t (*SadMxNAvgFunc)(const uint8_t *src_ptr, |
| 42 typedef unsigned int (*SadMxNVp9Func)(const unsigned char *source_ptr, | 51 int src_stride, |
| 43 int source_stride, | 52 const uint8_t *ref_ptr, |
| 44 const unsigned char *reference_ptr, | 53 int ref_stride, |
| 45 int reference_stride); | 54 const uint8_t *second_pred); |
| 46 typedef std::tr1::tuple<int, int, SadMxNVp9Func, int> SadMxNVp9Param; | 55 typedef std::tr1::tuple<int, int, SadMxNAvgFunc, int> SadMxNAvgParam; |
| 47 typedef uint32_t (*SadMxNAvgVp9Func)(const uint8_t *source_ptr, | |
| 48 int source_stride, | |
| 49 const uint8_t *reference_ptr, | |
| 50 int reference_stride, | |
| 51 const uint8_t *second_pred); | |
| 52 typedef std::tr1::tuple<int, int, SadMxNAvgVp9Func, int> SadMxNAvgVp9Param; | |
| 53 #endif | |
| 54 | 56 |
| 55 typedef void (*SadMxNx4Func)(const uint8_t *src_ptr, | 57 typedef void (*SadMxNx4Func)(const uint8_t *src_ptr, |
| 56 int src_stride, | 58 int src_stride, |
| 57 const uint8_t *const ref_ptr[], | 59 const uint8_t *const ref_ptr[], |
| 58 int ref_stride, | 60 int ref_stride, |
| 59 uint32_t *sad_array); | 61 uint32_t *sad_array); |
| 60 typedef std::tr1::tuple<int, int, SadMxNx4Func, int> SadMxNx4Param; | 62 typedef std::tr1::tuple<int, int, SadMxNx4Func, int> SadMxNx4Param; |
| 61 | 63 |
| 62 using libvpx_test::ACMRandom; | 64 using libvpx_test::ACMRandom; |
| 63 | 65 |
| 64 namespace { | 66 namespace { |
| 65 class SADTestBase : public ::testing::Test { | 67 class SADTestBase : public ::testing::Test { |
| 66 public: | 68 public: |
| 67 SADTestBase(int width, int height, int bit_depth) : | 69 SADTestBase(int width, int height, int bit_depth) : |
| 68 width_(width), height_(height), bd_(bit_depth) {} | 70 width_(width), height_(height), bd_(bit_depth) {} |
| 69 | 71 |
| 70 static void SetUpTestCase() { | 72 static void SetUpTestCase() { |
| 71 #if CONFIG_VP9_HIGHBITDEPTH | |
| 72 source_data8_ = reinterpret_cast<uint8_t*>( | 73 source_data8_ = reinterpret_cast<uint8_t*>( |
| 73 vpx_memalign(kDataAlignment, kDataBlockSize)); | 74 vpx_memalign(kDataAlignment, kDataBlockSize)); |
| 74 reference_data8_ = reinterpret_cast<uint8_t*>( | 75 reference_data8_ = reinterpret_cast<uint8_t*>( |
| 75 vpx_memalign(kDataAlignment, kDataBufferSize)); | 76 vpx_memalign(kDataAlignment, kDataBufferSize)); |
| 76 second_pred8_ = reinterpret_cast<uint8_t*>( | 77 second_pred8_ = reinterpret_cast<uint8_t*>( |
| 77 vpx_memalign(kDataAlignment, 64*64)); | 78 vpx_memalign(kDataAlignment, 64*64)); |
| 78 source_data16_ = reinterpret_cast<uint16_t*>( | 79 source_data16_ = reinterpret_cast<uint16_t*>( |
| 79 vpx_memalign(kDataAlignment, kDataBlockSize*sizeof(uint16_t))); | 80 vpx_memalign(kDataAlignment, kDataBlockSize*sizeof(uint16_t))); |
| 80 reference_data16_ = reinterpret_cast<uint16_t*>( | 81 reference_data16_ = reinterpret_cast<uint16_t*>( |
| 81 vpx_memalign(kDataAlignment, kDataBufferSize*sizeof(uint16_t))); | 82 vpx_memalign(kDataAlignment, kDataBufferSize*sizeof(uint16_t))); |
| 82 second_pred16_ = reinterpret_cast<uint16_t*>( | 83 second_pred16_ = reinterpret_cast<uint16_t*>( |
| 83 vpx_memalign(kDataAlignment, 64*64*sizeof(uint16_t))); | 84 vpx_memalign(kDataAlignment, 64*64*sizeof(uint16_t))); |
| 84 #else | |
| 85 source_data_ = reinterpret_cast<uint8_t*>( | |
| 86 vpx_memalign(kDataAlignment, kDataBlockSize)); | |
| 87 reference_data_ = reinterpret_cast<uint8_t*>( | |
| 88 vpx_memalign(kDataAlignment, kDataBufferSize)); | |
| 89 second_pred_ = reinterpret_cast<uint8_t*>( | |
| 90 vpx_memalign(kDataAlignment, 64*64)); | |
| 91 #endif | |
| 92 } | 85 } |
| 93 | 86 |
| 94 static void TearDownTestCase() { | 87 static void TearDownTestCase() { |
| 95 #if CONFIG_VP9_HIGHBITDEPTH | |
| 96 vpx_free(source_data8_); | 88 vpx_free(source_data8_); |
| 97 source_data8_ = NULL; | 89 source_data8_ = NULL; |
| 98 vpx_free(reference_data8_); | 90 vpx_free(reference_data8_); |
| 99 reference_data8_ = NULL; | 91 reference_data8_ = NULL; |
| 100 vpx_free(second_pred8_); | 92 vpx_free(second_pred8_); |
| 101 second_pred8_ = NULL; | 93 second_pred8_ = NULL; |
| 102 vpx_free(source_data16_); | 94 vpx_free(source_data16_); |
| 103 source_data16_ = NULL; | 95 source_data16_ = NULL; |
| 104 vpx_free(reference_data16_); | 96 vpx_free(reference_data16_); |
| 105 reference_data16_ = NULL; | 97 reference_data16_ = NULL; |
| 106 vpx_free(second_pred16_); | 98 vpx_free(second_pred16_); |
| 107 second_pred16_ = NULL; | 99 second_pred16_ = NULL; |
| 108 #else | |
| 109 vpx_free(source_data_); | |
| 110 source_data_ = NULL; | |
| 111 vpx_free(reference_data_); | |
| 112 reference_data_ = NULL; | |
| 113 vpx_free(second_pred_); | |
| 114 second_pred_ = NULL; | |
| 115 #endif | |
| 116 } | 100 } |
| 117 | 101 |
| 118 virtual void TearDown() { | 102 virtual void TearDown() { |
| 119 libvpx_test::ClearSystemState(); | 103 libvpx_test::ClearSystemState(); |
| 120 } | 104 } |
| 121 | 105 |
| 122 protected: | 106 protected: |
| 123 // Handle blocks up to 4 blocks 64x64 with stride up to 128 | 107 // Handle blocks up to 4 blocks 64x64 with stride up to 128 |
| 124 static const int kDataAlignment = 16; | 108 static const int kDataAlignment = 16; |
| 125 static const int kDataBlockSize = 64 * 128; | 109 static const int kDataBlockSize = 64 * 128; |
| 126 static const int kDataBufferSize = 4 * kDataBlockSize; | 110 static const int kDataBufferSize = 4 * kDataBlockSize; |
| 127 | 111 |
| 128 virtual void SetUp() { | 112 virtual void SetUp() { |
| 129 #if CONFIG_VP9_HIGHBITDEPTH | |
| 130 if (bd_ == -1) { | 113 if (bd_ == -1) { |
| 131 use_high_bit_depth_ = false; | 114 use_high_bit_depth_ = false; |
| 132 bit_depth_ = VPX_BITS_8; | 115 bit_depth_ = VPX_BITS_8; |
| 133 source_data_ = source_data8_; | 116 source_data_ = source_data8_; |
| 134 reference_data_ = reference_data8_; | 117 reference_data_ = reference_data8_; |
| 135 second_pred_ = second_pred8_; | 118 second_pred_ = second_pred8_; |
| 119 #if CONFIG_VP9_HIGHBITDEPTH |
| 136 } else { | 120 } else { |
| 137 use_high_bit_depth_ = true; | 121 use_high_bit_depth_ = true; |
| 138 bit_depth_ = static_cast<vpx_bit_depth_t>(bd_); | 122 bit_depth_ = static_cast<vpx_bit_depth_t>(bd_); |
| 139 source_data_ = CONVERT_TO_BYTEPTR(source_data16_); | 123 source_data_ = CONVERT_TO_BYTEPTR(source_data16_); |
| 140 reference_data_ = CONVERT_TO_BYTEPTR(reference_data16_); | 124 reference_data_ = CONVERT_TO_BYTEPTR(reference_data16_); |
| 141 second_pred_ = CONVERT_TO_BYTEPTR(second_pred16_); | 125 second_pred_ = CONVERT_TO_BYTEPTR(second_pred16_); |
| 126 #endif // CONFIG_VP9_HIGHBITDEPTH |
| 142 } | 127 } |
| 143 #else | |
| 144 bit_depth_ = VPX_BITS_8; | |
| 145 #endif | |
| 146 mask_ = (1 << bit_depth_) - 1; | 128 mask_ = (1 << bit_depth_) - 1; |
| 147 source_stride_ = (width_ + 31) & ~31; | 129 source_stride_ = (width_ + 31) & ~31; |
| 148 reference_stride_ = width_ * 2; | 130 reference_stride_ = width_ * 2; |
| 149 rnd_.Reset(ACMRandom::DeterministicSeed()); | 131 rnd_.Reset(ACMRandom::DeterministicSeed()); |
| 150 } | 132 } |
| 151 | 133 |
| 152 virtual uint8_t *GetReference(int block_idx) { | 134 virtual uint8_t *GetReference(int block_idx) { |
| 153 #if CONFIG_VP9_HIGHBITDEPTH | 135 #if CONFIG_VP9_HIGHBITDEPTH |
| 154 if (!use_high_bit_depth_) { | 136 if (use_high_bit_depth_) |
| 155 return reference_data_ + block_idx * kDataBlockSize; | |
| 156 } else { | |
| 157 return CONVERT_TO_BYTEPTR(CONVERT_TO_SHORTPTR(reference_data_) + | 137 return CONVERT_TO_BYTEPTR(CONVERT_TO_SHORTPTR(reference_data_) + |
| 158 block_idx * kDataBlockSize); | 138 block_idx * kDataBlockSize); |
| 159 } | 139 #endif // CONFIG_VP9_HIGHBITDEPTH |
| 160 #else | |
| 161 return reference_data_ + block_idx * kDataBlockSize; | 140 return reference_data_ + block_idx * kDataBlockSize; |
| 162 #endif | |
| 163 } | 141 } |
| 164 | 142 |
| 165 // Sum of Absolute Differences. Given two blocks, calculate the absolute | 143 // Sum of Absolute Differences. Given two blocks, calculate the absolute |
| 166 // difference between two pixels in the same relative location; accumulate. | 144 // difference between two pixels in the same relative location; accumulate. |
| 167 unsigned int ReferenceSAD(unsigned int max_sad, int block_idx) { | 145 unsigned int ReferenceSAD(int block_idx) { |
| 168 unsigned int sad = 0; | 146 unsigned int sad = 0; |
| 169 #if CONFIG_VP9_HIGHBITDEPTH | |
| 170 const uint8_t *const reference8 = GetReference(block_idx); | 147 const uint8_t *const reference8 = GetReference(block_idx); |
| 171 const uint8_t *const source8 = source_data_; | 148 const uint8_t *const source8 = source_data_; |
| 149 #if CONFIG_VP9_HIGHBITDEPTH |
| 172 const uint16_t *const reference16 = | 150 const uint16_t *const reference16 = |
| 173 CONVERT_TO_SHORTPTR(GetReference(block_idx)); | 151 CONVERT_TO_SHORTPTR(GetReference(block_idx)); |
| 174 const uint16_t *const source16 = CONVERT_TO_SHORTPTR(source_data_); | 152 const uint16_t *const source16 = CONVERT_TO_SHORTPTR(source_data_); |
| 175 #else | 153 #endif // CONFIG_VP9_HIGHBITDEPTH |
| 176 const uint8_t *const reference = GetReference(block_idx); | |
| 177 const uint8_t *const source = source_data_; | |
| 178 #endif | |
| 179 for (int h = 0; h < height_; ++h) { | 154 for (int h = 0; h < height_; ++h) { |
| 180 for (int w = 0; w < width_; ++w) { | 155 for (int w = 0; w < width_; ++w) { |
| 156 if (!use_high_bit_depth_) { |
| 157 sad += abs(source8[h * source_stride_ + w] - |
| 158 reference8[h * reference_stride_ + w]); |
| 181 #if CONFIG_VP9_HIGHBITDEPTH | 159 #if CONFIG_VP9_HIGHBITDEPTH |
| 182 if (!use_high_bit_depth_) { | |
| 183 sad += | |
| 184 abs(source8[h * source_stride_ + w] - | |
| 185 reference8[h * reference_stride_ + w]); | |
| 186 } else { | 160 } else { |
| 187 sad += | 161 sad += abs(source16[h * source_stride_ + w] - |
| 188 abs(source16[h * source_stride_ + w] - | 162 reference16[h * reference_stride_ + w]); |
| 189 reference16[h * reference_stride_ + w]); | 163 #endif // CONFIG_VP9_HIGHBITDEPTH |
| 190 } | 164 } |
| 191 #else | |
| 192 sad += | |
| 193 abs(source[h * source_stride_ + w] - | |
| 194 reference[h * reference_stride_ + w]); | |
| 195 #endif | |
| 196 } | |
| 197 if (sad > max_sad) { | |
| 198 break; | |
| 199 } | 165 } |
| 200 } | 166 } |
| 201 return sad; | 167 return sad; |
| 202 } | 168 } |
| 203 | 169 |
| 204 // Sum of Absolute Differences Average. Given two blocks, and a prediction | 170 // Sum of Absolute Differences Average. Given two blocks, and a prediction |
| 205 // calculate the absolute difference between one pixel and average of the | 171 // calculate the absolute difference between one pixel and average of the |
| 206 // corresponding and predicted pixels; accumulate. | 172 // corresponding and predicted pixels; accumulate. |
| 207 unsigned int ReferenceSADavg(unsigned int max_sad, int block_idx) { | 173 unsigned int ReferenceSADavg(int block_idx) { |
| 208 unsigned int sad = 0; | 174 unsigned int sad = 0; |
| 175 const uint8_t *const reference8 = GetReference(block_idx); |
| 176 const uint8_t *const source8 = source_data_; |
| 177 const uint8_t *const second_pred8 = second_pred_; |
| 209 #if CONFIG_VP9_HIGHBITDEPTH | 178 #if CONFIG_VP9_HIGHBITDEPTH |
| 210 const uint8_t *const reference8 = GetReference(block_idx); | 179 const uint16_t *const reference16 = |
| 211 const uint8_t *const source8 = source_data_; | 180 CONVERT_TO_SHORTPTR(GetReference(block_idx)); |
| 212 const uint8_t *const second_pred8 = second_pred_; | 181 const uint16_t *const source16 = CONVERT_TO_SHORTPTR(source_data_); |
| 213 const uint16_t *const reference16 = | 182 const uint16_t *const second_pred16 = CONVERT_TO_SHORTPTR(second_pred_); |
| 214 CONVERT_TO_SHORTPTR(GetReference(block_idx)); | 183 #endif // CONFIG_VP9_HIGHBITDEPTH |
| 215 const uint16_t *const source16 = CONVERT_TO_SHORTPTR(source_data_); | |
| 216 const uint16_t *const second_pred16 = CONVERT_TO_SHORTPTR(second_pred_); | |
| 217 #else | |
| 218 const uint8_t *const reference = GetReference(block_idx); | |
| 219 const uint8_t *const source = source_data_; | |
| 220 const uint8_t *const second_pred = second_pred_; | |
| 221 #endif | |
| 222 for (int h = 0; h < height_; ++h) { | 184 for (int h = 0; h < height_; ++h) { |
| 223 for (int w = 0; w < width_; ++w) { | 185 for (int w = 0; w < width_; ++w) { |
| 224 #if CONFIG_VP9_HIGHBITDEPTH | |
| 225 if (!use_high_bit_depth_) { | 186 if (!use_high_bit_depth_) { |
| 226 const int tmp = second_pred8[h * width_ + w] + | 187 const int tmp = second_pred8[h * width_ + w] + |
| 227 reference8[h * reference_stride_ + w]; | 188 reference8[h * reference_stride_ + w]; |
| 228 const uint8_t comp_pred = ROUND_POWER_OF_TWO(tmp, 1); | 189 const uint8_t comp_pred = ROUND_POWER_OF_TWO(tmp, 1); |
| 229 sad += abs(source8[h * source_stride_ + w] - comp_pred); | 190 sad += abs(source8[h * source_stride_ + w] - comp_pred); |
| 191 #if CONFIG_VP9_HIGHBITDEPTH |
| 230 } else { | 192 } else { |
| 231 const int tmp = second_pred16[h * width_ + w] + | 193 const int tmp = second_pred16[h * width_ + w] + |
| 232 reference16[h * reference_stride_ + w]; | 194 reference16[h * reference_stride_ + w]; |
| 233 const uint16_t comp_pred = ROUND_POWER_OF_TWO(tmp, 1); | 195 const uint16_t comp_pred = ROUND_POWER_OF_TWO(tmp, 1); |
| 234 sad += abs(source16[h * source_stride_ + w] - comp_pred); | 196 sad += abs(source16[h * source_stride_ + w] - comp_pred); |
| 197 #endif // CONFIG_VP9_HIGHBITDEPTH |
| 235 } | 198 } |
| 236 #else | |
| 237 const int tmp = second_pred[h * width_ + w] + | |
| 238 reference[h * reference_stride_ + w]; | |
| 239 const uint8_t comp_pred = (tmp + 1) >> 1; | |
| 240 sad += abs(source[h * source_stride_ + w] - comp_pred); | |
| 241 #endif | |
| 242 } | |
| 243 if (sad > max_sad) { | |
| 244 break; | |
| 245 } | 199 } |
| 246 } | 200 } |
| 247 return sad; | 201 return sad; |
| 248 } | 202 } |
| 249 | 203 |
| 250 void FillConstant(uint8_t *data, int stride, uint16_t fill_constant) { | 204 void FillConstant(uint8_t *data, int stride, uint16_t fill_constant) { |
| 205 uint8_t *data8 = data; |
| 251 #if CONFIG_VP9_HIGHBITDEPTH | 206 #if CONFIG_VP9_HIGHBITDEPTH |
| 252 uint8_t *data8 = data; | |
| 253 uint16_t *data16 = CONVERT_TO_SHORTPTR(data); | 207 uint16_t *data16 = CONVERT_TO_SHORTPTR(data); |
| 254 #endif | 208 #endif // CONFIG_VP9_HIGHBITDEPTH |
| 255 for (int h = 0; h < height_; ++h) { | 209 for (int h = 0; h < height_; ++h) { |
| 256 for (int w = 0; w < width_; ++w) { | 210 for (int w = 0; w < width_; ++w) { |
| 257 #if CONFIG_VP9_HIGHBITDEPTH | |
| 258 if (!use_high_bit_depth_) { | 211 if (!use_high_bit_depth_) { |
| 259 data8[h * stride + w] = static_cast<uint8_t>(fill_constant); | 212 data8[h * stride + w] = static_cast<uint8_t>(fill_constant); |
| 213 #if CONFIG_VP9_HIGHBITDEPTH |
| 260 } else { | 214 } else { |
| 261 data16[h * stride + w] = fill_constant; | 215 data16[h * stride + w] = fill_constant; |
| 216 #endif // CONFIG_VP9_HIGHBITDEPTH |
| 262 } | 217 } |
| 263 #else | |
| 264 data[h * stride + w] = static_cast<uint8_t>(fill_constant); | |
| 265 #endif | |
| 266 } | 218 } |
| 267 } | 219 } |
| 268 } | 220 } |
| 269 | 221 |
| 270 void FillRandom(uint8_t *data, int stride) { | 222 void FillRandom(uint8_t *data, int stride) { |
| 223 uint8_t *data8 = data; |
| 271 #if CONFIG_VP9_HIGHBITDEPTH | 224 #if CONFIG_VP9_HIGHBITDEPTH |
| 272 uint8_t *data8 = data; | |
| 273 uint16_t *data16 = CONVERT_TO_SHORTPTR(data); | 225 uint16_t *data16 = CONVERT_TO_SHORTPTR(data); |
| 274 #endif | 226 #endif // CONFIG_VP9_HIGHBITDEPTH |
| 275 for (int h = 0; h < height_; ++h) { | 227 for (int h = 0; h < height_; ++h) { |
| 276 for (int w = 0; w < width_; ++w) { | 228 for (int w = 0; w < width_; ++w) { |
| 277 #if CONFIG_VP9_HIGHBITDEPTH | |
| 278 if (!use_high_bit_depth_) { | 229 if (!use_high_bit_depth_) { |
| 279 data8[h * stride + w] = rnd_.Rand8(); | 230 data8[h * stride + w] = rnd_.Rand8(); |
| 231 #if CONFIG_VP9_HIGHBITDEPTH |
| 280 } else { | 232 } else { |
| 281 data16[h * stride + w] = rnd_.Rand16() & mask_; | 233 data16[h * stride + w] = rnd_.Rand16() & mask_; |
| 234 #endif // CONFIG_VP9_HIGHBITDEPTH |
| 282 } | 235 } |
| 283 #else | |
| 284 data[h * stride + w] = rnd_.Rand8(); | |
| 285 #endif | |
| 286 } | 236 } |
| 287 } | 237 } |
| 288 } | 238 } |
| 289 | 239 |
| 290 int width_, height_, mask_, bd_; | 240 int width_, height_, mask_, bd_; |
| 291 vpx_bit_depth_t bit_depth_; | 241 vpx_bit_depth_t bit_depth_; |
| 292 static uint8_t *source_data_; | 242 static uint8_t *source_data_; |
| 293 static uint8_t *reference_data_; | 243 static uint8_t *reference_data_; |
| 294 static uint8_t *second_pred_; | 244 static uint8_t *second_pred_; |
| 295 int source_stride_; | 245 int source_stride_; |
| 296 #if CONFIG_VP9_HIGHBITDEPTH | |
| 297 bool use_high_bit_depth_; | 246 bool use_high_bit_depth_; |
| 298 static uint8_t *source_data8_; | 247 static uint8_t *source_data8_; |
| 299 static uint8_t *reference_data8_; | 248 static uint8_t *reference_data8_; |
| 300 static uint8_t *second_pred8_; | 249 static uint8_t *second_pred8_; |
| 301 static uint16_t *source_data16_; | 250 static uint16_t *source_data16_; |
| 302 static uint16_t *reference_data16_; | 251 static uint16_t *reference_data16_; |
| 303 static uint16_t *second_pred16_; | 252 static uint16_t *second_pred16_; |
| 304 #endif | |
| 305 int reference_stride_; | 253 int reference_stride_; |
| 306 | 254 |
| 307 ACMRandom rnd_; | 255 ACMRandom rnd_; |
| 308 }; | 256 }; |
| 309 | 257 |
| 310 class SADx4Test | 258 class SADx4Test |
| 311 : public SADTestBase, | 259 : public SADTestBase, |
| 312 public ::testing::WithParamInterface<SadMxNx4Param> { | 260 public ::testing::WithParamInterface<SadMxNx4Param> { |
| 313 public: | 261 public: |
| 314 SADx4Test() : SADTestBase(GET_PARAM(0), GET_PARAM(1), GET_PARAM(3)) {} | 262 SADx4Test() : SADTestBase(GET_PARAM(0), GET_PARAM(1), GET_PARAM(3)) {} |
| 315 | 263 |
| 316 protected: | 264 protected: |
| 317 void SADs(unsigned int *results) { | 265 void SADs(unsigned int *results) { |
| 318 const uint8_t *refs[] = {GetReference(0), GetReference(1), | 266 const uint8_t *references[] = {GetReference(0), GetReference(1), |
| 319 GetReference(2), GetReference(3)}; | 267 GetReference(2), GetReference(3)}; |
| 320 | 268 |
| 321 ASM_REGISTER_STATE_CHECK(GET_PARAM(2)(source_data_, source_stride_, | 269 ASM_REGISTER_STATE_CHECK(GET_PARAM(2)(source_data_, source_stride_, |
| 322 refs, reference_stride_, | 270 references, reference_stride_, |
| 323 results)); | 271 results)); |
| 324 } | 272 } |
| 325 | 273 |
| 326 void CheckSADs() { | 274 void CheckSADs() { |
| 327 unsigned int reference_sad, exp_sad[4]; | 275 unsigned int reference_sad, exp_sad[4]; |
| 328 | 276 |
| 329 SADs(exp_sad); | 277 SADs(exp_sad); |
| 330 for (int block = 0; block < 4; ++block) { | 278 for (int block = 0; block < 4; ++block) { |
| 331 reference_sad = ReferenceSAD(UINT_MAX, block); | 279 reference_sad = ReferenceSAD(block); |
| 332 | 280 |
| 333 EXPECT_EQ(reference_sad, exp_sad[block]) << "block " << block; | 281 EXPECT_EQ(reference_sad, exp_sad[block]) << "block " << block; |
| 334 } | 282 } |
| 335 } | 283 } |
| 336 }; | 284 }; |
| 337 | 285 |
| 338 #if CONFIG_VP8_ENCODER | |
| 339 class SADTest | 286 class SADTest |
| 340 : public SADTestBase, | 287 : public SADTestBase, |
| 341 public ::testing::WithParamInterface<SadMxNParam> { | 288 public ::testing::WithParamInterface<SadMxNParam> { |
| 342 public: | 289 public: |
| 343 SADTest() : SADTestBase(GET_PARAM(0), GET_PARAM(1), GET_PARAM(3)) {} | 290 SADTest() : SADTestBase(GET_PARAM(0), GET_PARAM(1), GET_PARAM(3)) {} |
| 344 | 291 |
| 345 protected: | 292 protected: |
| 346 unsigned int SAD(unsigned int max_sad, int block_idx) { | |
| 347 unsigned int ret; | |
| 348 const uint8_t *const reference = GetReference(block_idx); | |
| 349 | |
| 350 ASM_REGISTER_STATE_CHECK(ret = GET_PARAM(2)(source_data_, source_stride_, | |
| 351 reference, reference_stride_, | |
| 352 max_sad)); | |
| 353 return ret; | |
| 354 } | |
| 355 | |
| 356 void CheckSAD(unsigned int max_sad) { | |
| 357 const unsigned int reference_sad = ReferenceSAD(max_sad, 0); | |
| 358 const unsigned int exp_sad = SAD(max_sad, 0); | |
| 359 | |
| 360 if (reference_sad <= max_sad) { | |
| 361 ASSERT_EQ(exp_sad, reference_sad); | |
| 362 } else { | |
| 363 // Alternative implementations are not required to check max_sad | |
| 364 ASSERT_GE(exp_sad, reference_sad); | |
| 365 } | |
| 366 } | |
| 367 }; | |
| 368 #endif // CONFIG_VP8_ENCODER | |
| 369 | |
| 370 #if CONFIG_VP9_ENCODER | |
| 371 class SADVP9Test | |
| 372 : public SADTestBase, | |
| 373 public ::testing::WithParamInterface<SadMxNVp9Param> { | |
| 374 public: | |
| 375 SADVP9Test() : SADTestBase(GET_PARAM(0), GET_PARAM(1), GET_PARAM(3)) {} | |
| 376 | |
| 377 protected: | |
| 378 unsigned int SAD(int block_idx) { | 293 unsigned int SAD(int block_idx) { |
| 379 unsigned int ret; | 294 unsigned int ret; |
| 380 const uint8_t *const reference = GetReference(block_idx); | 295 const uint8_t *const reference = GetReference(block_idx); |
| 381 | 296 |
| 382 ASM_REGISTER_STATE_CHECK(ret = GET_PARAM(2)(source_data_, source_stride_, | 297 ASM_REGISTER_STATE_CHECK(ret = GET_PARAM(2)(source_data_, source_stride_, |
| 383 reference, reference_stride_)); | 298 reference, reference_stride_)); |
| 384 return ret; | 299 return ret; |
| 385 } | 300 } |
| 386 | 301 |
| 387 void CheckSAD() { | 302 void CheckSAD() { |
| 388 const unsigned int reference_sad = ReferenceSAD(UINT_MAX, 0); | 303 const unsigned int reference_sad = ReferenceSAD(0); |
| 389 const unsigned int exp_sad = SAD(0); | 304 const unsigned int exp_sad = SAD(0); |
| 390 | 305 |
| 391 ASSERT_EQ(reference_sad, exp_sad); | 306 ASSERT_EQ(reference_sad, exp_sad); |
| 392 } | 307 } |
| 393 }; | 308 }; |
| 394 | 309 |
| 395 class SADavgVP9Test | 310 class SADavgTest |
| 396 : public SADTestBase, | 311 : public SADTestBase, |
| 397 public ::testing::WithParamInterface<SadMxNAvgVp9Param> { | 312 public ::testing::WithParamInterface<SadMxNAvgParam> { |
| 398 public: | 313 public: |
| 399 SADavgVP9Test() : SADTestBase(GET_PARAM(0), GET_PARAM(1), GET_PARAM(3)) {} | 314 SADavgTest() : SADTestBase(GET_PARAM(0), GET_PARAM(1), GET_PARAM(3)) {} |
| 400 | 315 |
| 401 protected: | 316 protected: |
| 402 unsigned int SAD_avg(int block_idx) { | 317 unsigned int SAD_avg(int block_idx) { |
| 403 unsigned int ret; | 318 unsigned int ret; |
| 404 const uint8_t *const reference = GetReference(block_idx); | 319 const uint8_t *const reference = GetReference(block_idx); |
| 405 | 320 |
| 406 ASM_REGISTER_STATE_CHECK(ret = GET_PARAM(2)(source_data_, source_stride_, | 321 ASM_REGISTER_STATE_CHECK(ret = GET_PARAM(2)(source_data_, source_stride_, |
| 407 reference, reference_stride_, | 322 reference, reference_stride_, |
| 408 second_pred_)); | 323 second_pred_)); |
| 409 return ret; | 324 return ret; |
| 410 } | 325 } |
| 411 | 326 |
| 412 void CheckSAD() { | 327 void CheckSAD() { |
| 413 const unsigned int reference_sad = ReferenceSADavg(UINT_MAX, 0); | 328 const unsigned int reference_sad = ReferenceSADavg(0); |
| 414 const unsigned int exp_sad = SAD_avg(0); | 329 const unsigned int exp_sad = SAD_avg(0); |
| 415 | 330 |
| 416 ASSERT_EQ(reference_sad, exp_sad); | 331 ASSERT_EQ(reference_sad, exp_sad); |
| 417 } | 332 } |
| 418 }; | 333 }; |
| 419 #endif // CONFIG_VP9_ENCODER | |
| 420 | 334 |
| 421 uint8_t *SADTestBase::source_data_ = NULL; | 335 uint8_t *SADTestBase::source_data_ = NULL; |
| 422 uint8_t *SADTestBase::reference_data_ = NULL; | 336 uint8_t *SADTestBase::reference_data_ = NULL; |
| 423 uint8_t *SADTestBase::second_pred_ = NULL; | 337 uint8_t *SADTestBase::second_pred_ = NULL; |
| 424 #if CONFIG_VP9_ENCODER && CONFIG_VP9_HIGHBITDEPTH | |
| 425 uint8_t *SADTestBase::source_data8_ = NULL; | 338 uint8_t *SADTestBase::source_data8_ = NULL; |
| 426 uint8_t *SADTestBase::reference_data8_ = NULL; | 339 uint8_t *SADTestBase::reference_data8_ = NULL; |
| 427 uint8_t *SADTestBase::second_pred8_ = NULL; | 340 uint8_t *SADTestBase::second_pred8_ = NULL; |
| 428 uint16_t *SADTestBase::source_data16_ = NULL; | 341 uint16_t *SADTestBase::source_data16_ = NULL; |
| 429 uint16_t *SADTestBase::reference_data16_ = NULL; | 342 uint16_t *SADTestBase::reference_data16_ = NULL; |
| 430 uint16_t *SADTestBase::second_pred16_ = NULL; | 343 uint16_t *SADTestBase::second_pred16_ = NULL; |
| 431 #endif | |
| 432 | 344 |
| 433 #if CONFIG_VP8_ENCODER | |
| 434 TEST_P(SADTest, MaxRef) { | 345 TEST_P(SADTest, MaxRef) { |
| 435 FillConstant(source_data_, source_stride_, 0); | 346 FillConstant(source_data_, source_stride_, 0); |
| 436 FillConstant(reference_data_, reference_stride_, mask_); | 347 FillConstant(reference_data_, reference_stride_, mask_); |
| 437 CheckSAD(UINT_MAX); | 348 CheckSAD(); |
| 438 } | 349 } |
| 439 | 350 |
| 440 TEST_P(SADTest, MaxSrc) { | 351 TEST_P(SADTest, MaxSrc) { |
| 441 FillConstant(source_data_, source_stride_, mask_); | 352 FillConstant(source_data_, source_stride_, mask_); |
| 442 FillConstant(reference_data_, reference_stride_, 0); | 353 FillConstant(reference_data_, reference_stride_, 0); |
| 443 CheckSAD(UINT_MAX); | 354 CheckSAD(); |
| 444 } | 355 } |
| 445 | 356 |
| 446 TEST_P(SADTest, ShortRef) { | 357 TEST_P(SADTest, ShortRef) { |
| 447 int tmp_stride = reference_stride_; | |
| 448 reference_stride_ >>= 1; | |
| 449 FillRandom(source_data_, source_stride_); | |
| 450 FillRandom(reference_data_, reference_stride_); | |
| 451 CheckSAD(UINT_MAX); | |
| 452 reference_stride_ = tmp_stride; | |
| 453 } | |
| 454 | |
| 455 TEST_P(SADTest, UnalignedRef) { | |
| 456 // The reference frame, but not the source frame, may be unaligned for | |
| 457 // certain types of searches. | |
| 458 const int tmp_stride = reference_stride_; | |
| 459 reference_stride_ -= 1; | |
| 460 FillRandom(source_data_, source_stride_); | |
| 461 FillRandom(reference_data_, reference_stride_); | |
| 462 CheckSAD(UINT_MAX); | |
| 463 reference_stride_ = tmp_stride; | |
| 464 } | |
| 465 | |
| 466 TEST_P(SADTest, ShortSrc) { | |
| 467 const int tmp_stride = source_stride_; | |
| 468 source_stride_ >>= 1; | |
| 469 FillRandom(source_data_, source_stride_); | |
| 470 FillRandom(reference_data_, reference_stride_); | |
| 471 CheckSAD(UINT_MAX); | |
| 472 source_stride_ = tmp_stride; | |
| 473 } | |
| 474 | |
| 475 TEST_P(SADTest, MaxSAD) { | |
| 476 // Verify that, when max_sad is set, the implementation does not return a | |
| 477 // value lower than the reference. | |
| 478 FillConstant(source_data_, source_stride_, mask_); | |
| 479 FillConstant(reference_data_, reference_stride_, 0); | |
| 480 CheckSAD(128); | |
| 481 } | |
| 482 #endif // CONFIG_VP8_ENCODER | |
| 483 | |
| 484 #if CONFIG_VP9_ENCODER | |
| 485 TEST_P(SADVP9Test, MaxRef) { | |
| 486 FillConstant(source_data_, source_stride_, 0); | |
| 487 FillConstant(reference_data_, reference_stride_, mask_); | |
| 488 CheckSAD(); | |
| 489 } | |
| 490 | |
| 491 TEST_P(SADVP9Test, MaxSrc) { | |
| 492 FillConstant(source_data_, source_stride_, mask_); | |
| 493 FillConstant(reference_data_, reference_stride_, 0); | |
| 494 CheckSAD(); | |
| 495 } | |
| 496 | |
| 497 TEST_P(SADVP9Test, ShortRef) { | |
| 498 const int tmp_stride = reference_stride_; | 358 const int tmp_stride = reference_stride_; |
| 499 reference_stride_ >>= 1; | 359 reference_stride_ >>= 1; |
| 500 FillRandom(source_data_, source_stride_); | 360 FillRandom(source_data_, source_stride_); |
| 501 FillRandom(reference_data_, reference_stride_); | 361 FillRandom(reference_data_, reference_stride_); |
| 502 CheckSAD(); | 362 CheckSAD(); |
| 503 reference_stride_ = tmp_stride; | 363 reference_stride_ = tmp_stride; |
| 504 } | 364 } |
| 505 | 365 |
| 506 TEST_P(SADVP9Test, UnalignedRef) { | 366 TEST_P(SADTest, UnalignedRef) { |
| 507 // The reference frame, but not the source frame, may be unaligned for | 367 // The reference frame, but not the source frame, may be unaligned for |
| 508 // certain types of searches. | 368 // certain types of searches. |
| 509 const int tmp_stride = reference_stride_; | 369 const int tmp_stride = reference_stride_; |
| 510 reference_stride_ -= 1; | 370 reference_stride_ -= 1; |
| 511 FillRandom(source_data_, source_stride_); | 371 FillRandom(source_data_, source_stride_); |
| 512 FillRandom(reference_data_, reference_stride_); | 372 FillRandom(reference_data_, reference_stride_); |
| 513 CheckSAD(); | 373 CheckSAD(); |
| 514 reference_stride_ = tmp_stride; | 374 reference_stride_ = tmp_stride; |
| 515 } | 375 } |
| 516 | 376 |
| 517 TEST_P(SADVP9Test, ShortSrc) { | 377 TEST_P(SADTest, ShortSrc) { |
| 518 const int tmp_stride = source_stride_; | 378 const int tmp_stride = source_stride_; |
| 519 source_stride_ >>= 1; | 379 source_stride_ >>= 1; |
| 520 FillRandom(source_data_, source_stride_); | 380 FillRandom(source_data_, source_stride_); |
| 521 FillRandom(reference_data_, reference_stride_); | 381 FillRandom(reference_data_, reference_stride_); |
| 522 CheckSAD(); | 382 CheckSAD(); |
| 523 source_stride_ = tmp_stride; | 383 source_stride_ = tmp_stride; |
| 524 } | 384 } |
| 525 | 385 |
| 526 TEST_P(SADavgVP9Test, MaxRef) { | 386 TEST_P(SADavgTest, MaxRef) { |
| 527 FillConstant(source_data_, source_stride_, 0); | 387 FillConstant(source_data_, source_stride_, 0); |
| 528 FillConstant(reference_data_, reference_stride_, mask_); | 388 FillConstant(reference_data_, reference_stride_, mask_); |
| 529 FillConstant(second_pred_, width_, 0); | 389 FillConstant(second_pred_, width_, 0); |
| 530 CheckSAD(); | 390 CheckSAD(); |
| 531 } | 391 } |
| 532 TEST_P(SADavgVP9Test, MaxSrc) { | 392 TEST_P(SADavgTest, MaxSrc) { |
| 533 FillConstant(source_data_, source_stride_, mask_); | 393 FillConstant(source_data_, source_stride_, mask_); |
| 534 FillConstant(reference_data_, reference_stride_, 0); | 394 FillConstant(reference_data_, reference_stride_, 0); |
| 535 FillConstant(second_pred_, width_, 0); | 395 FillConstant(second_pred_, width_, 0); |
| 536 CheckSAD(); | 396 CheckSAD(); |
| 537 } | 397 } |
| 538 | 398 |
| 539 TEST_P(SADavgVP9Test, ShortRef) { | 399 TEST_P(SADavgTest, ShortRef) { |
| 540 const int tmp_stride = reference_stride_; | 400 const int tmp_stride = reference_stride_; |
| 541 reference_stride_ >>= 1; | 401 reference_stride_ >>= 1; |
| 542 FillRandom(source_data_, source_stride_); | 402 FillRandom(source_data_, source_stride_); |
| 543 FillRandom(reference_data_, reference_stride_); | 403 FillRandom(reference_data_, reference_stride_); |
| 544 FillRandom(second_pred_, width_); | 404 FillRandom(second_pred_, width_); |
| 545 CheckSAD(); | 405 CheckSAD(); |
| 546 reference_stride_ = tmp_stride; | 406 reference_stride_ = tmp_stride; |
| 547 } | 407 } |
| 548 | 408 |
| 549 TEST_P(SADavgVP9Test, UnalignedRef) { | 409 TEST_P(SADavgTest, UnalignedRef) { |
| 550 // The reference frame, but not the source frame, may be unaligned for | 410 // The reference frame, but not the source frame, may be unaligned for |
| 551 // certain types of searches. | 411 // certain types of searches. |
| 552 const int tmp_stride = reference_stride_; | 412 const int tmp_stride = reference_stride_; |
| 553 reference_stride_ -= 1; | 413 reference_stride_ -= 1; |
| 554 FillRandom(source_data_, source_stride_); | 414 FillRandom(source_data_, source_stride_); |
| 555 FillRandom(reference_data_, reference_stride_); | 415 FillRandom(reference_data_, reference_stride_); |
| 556 FillRandom(second_pred_, width_); | 416 FillRandom(second_pred_, width_); |
| 557 CheckSAD(); | 417 CheckSAD(); |
| 558 reference_stride_ = tmp_stride; | 418 reference_stride_ = tmp_stride; |
| 559 } | 419 } |
| 560 | 420 |
| 561 TEST_P(SADavgVP9Test, ShortSrc) { | 421 TEST_P(SADavgTest, ShortSrc) { |
| 562 const int tmp_stride = source_stride_; | 422 const int tmp_stride = source_stride_; |
| 563 source_stride_ >>= 1; | 423 source_stride_ >>= 1; |
| 564 FillRandom(source_data_, source_stride_); | 424 FillRandom(source_data_, source_stride_); |
| 565 FillRandom(reference_data_, reference_stride_); | 425 FillRandom(reference_data_, reference_stride_); |
| 566 FillRandom(second_pred_, width_); | 426 FillRandom(second_pred_, width_); |
| 567 CheckSAD(); | 427 CheckSAD(); |
| 568 source_stride_ = tmp_stride; | 428 source_stride_ = tmp_stride; |
| 569 } | 429 } |
| 570 #endif // CONFIG_VP9_ENCODER | |
| 571 | 430 |
| 572 TEST_P(SADx4Test, MaxRef) { | 431 TEST_P(SADx4Test, MaxRef) { |
| 573 FillConstant(source_data_, source_stride_, 0); | 432 FillConstant(source_data_, source_stride_, 0); |
| 574 FillConstant(GetReference(0), reference_stride_, mask_); | 433 FillConstant(GetReference(0), reference_stride_, mask_); |
| 575 FillConstant(GetReference(1), reference_stride_, mask_); | 434 FillConstant(GetReference(1), reference_stride_, mask_); |
| 576 FillConstant(GetReference(2), reference_stride_, mask_); | 435 FillConstant(GetReference(2), reference_stride_, mask_); |
| 577 FillConstant(GetReference(3), reference_stride_, mask_); | 436 FillConstant(GetReference(3), reference_stride_, mask_); |
| 578 CheckSADs(); | 437 CheckSADs(); |
| 579 } | 438 } |
| 580 | 439 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 634 FillRandom(GetReference(2), reference_stride_); | 493 FillRandom(GetReference(2), reference_stride_); |
| 635 FillRandom(GetReference(3), reference_stride_); | 494 FillRandom(GetReference(3), reference_stride_); |
| 636 CheckSADs(); | 495 CheckSADs(); |
| 637 source_data_ = tmp_source_data; | 496 source_data_ = tmp_source_data; |
| 638 } | 497 } |
| 639 | 498 |
| 640 using std::tr1::make_tuple; | 499 using std::tr1::make_tuple; |
| 641 | 500 |
| 642 //------------------------------------------------------------------------------ | 501 //------------------------------------------------------------------------------ |
| 643 // C functions | 502 // C functions |
| 644 #if CONFIG_VP8_ENCODER | 503 const SadMxNFunc sad64x64_c = vpx_sad64x64_c; |
| 645 const SadMxNFunc sad_16x16_c = vp8_sad16x16_c; | 504 const SadMxNFunc sad64x32_c = vpx_sad64x32_c; |
| 646 const SadMxNFunc sad_8x16_c = vp8_sad8x16_c; | 505 const SadMxNFunc sad32x64_c = vpx_sad32x64_c; |
| 647 const SadMxNFunc sad_16x8_c = vp8_sad16x8_c; | 506 const SadMxNFunc sad32x32_c = vpx_sad32x32_c; |
| 648 const SadMxNFunc sad_8x8_c = vp8_sad8x8_c; | 507 const SadMxNFunc sad32x16_c = vpx_sad32x16_c; |
| 649 const SadMxNFunc sad_4x4_c = vp8_sad4x4_c; | 508 const SadMxNFunc sad16x32_c = vpx_sad16x32_c; |
| 509 const SadMxNFunc sad16x16_c = vpx_sad16x16_c; |
| 510 const SadMxNFunc sad16x8_c = vpx_sad16x8_c; |
| 511 const SadMxNFunc sad8x16_c = vpx_sad8x16_c; |
| 512 const SadMxNFunc sad8x8_c = vpx_sad8x8_c; |
| 513 const SadMxNFunc sad8x4_c = vpx_sad8x4_c; |
| 514 const SadMxNFunc sad4x8_c = vpx_sad4x8_c; |
| 515 const SadMxNFunc sad4x4_c = vpx_sad4x4_c; |
| 516 #if CONFIG_VP9_HIGHBITDEPTH |
| 517 const SadMxNFunc highbd_sad64x64_c = vpx_highbd_sad64x64_c; |
| 518 const SadMxNFunc highbd_sad64x32_c = vpx_highbd_sad64x32_c; |
| 519 const SadMxNFunc highbd_sad32x64_c = vpx_highbd_sad32x64_c; |
| 520 const SadMxNFunc highbd_sad32x32_c = vpx_highbd_sad32x32_c; |
| 521 const SadMxNFunc highbd_sad32x16_c = vpx_highbd_sad32x16_c; |
| 522 const SadMxNFunc highbd_sad16x32_c = vpx_highbd_sad16x32_c; |
| 523 const SadMxNFunc highbd_sad16x16_c = vpx_highbd_sad16x16_c; |
| 524 const SadMxNFunc highbd_sad16x8_c = vpx_highbd_sad16x8_c; |
| 525 const SadMxNFunc highbd_sad8x16_c = vpx_highbd_sad8x16_c; |
| 526 const SadMxNFunc highbd_sad8x8_c = vpx_highbd_sad8x8_c; |
| 527 const SadMxNFunc highbd_sad8x4_c = vpx_highbd_sad8x4_c; |
| 528 const SadMxNFunc highbd_sad4x8_c = vpx_highbd_sad4x8_c; |
| 529 const SadMxNFunc highbd_sad4x4_c = vpx_highbd_sad4x4_c; |
| 530 #endif // CONFIG_VP9_HIGHBITDEPTH |
| 650 const SadMxNParam c_tests[] = { | 531 const SadMxNParam c_tests[] = { |
| 651 make_tuple(16, 16, sad_16x16_c, -1), | 532 make_tuple(64, 64, sad64x64_c, -1), |
| 652 make_tuple(8, 16, sad_8x16_c, -1), | 533 make_tuple(64, 32, sad64x32_c, -1), |
| 653 make_tuple(16, 8, sad_16x8_c, -1), | 534 make_tuple(32, 64, sad32x64_c, -1), |
| 654 make_tuple(8, 8, sad_8x8_c, -1), | 535 make_tuple(32, 32, sad32x32_c, -1), |
| 655 make_tuple(4, 4, sad_4x4_c, -1), | 536 make_tuple(32, 16, sad32x16_c, -1), |
| 537 make_tuple(16, 32, sad16x32_c, -1), |
| 538 make_tuple(16, 16, sad16x16_c, -1), |
| 539 make_tuple(16, 8, sad16x8_c, -1), |
| 540 make_tuple(8, 16, sad8x16_c, -1), |
| 541 make_tuple(8, 8, sad8x8_c, -1), |
| 542 make_tuple(8, 4, sad8x4_c, -1), |
| 543 make_tuple(4, 8, sad4x8_c, -1), |
| 544 make_tuple(4, 4, sad4x4_c, -1), |
| 545 #if CONFIG_VP9_HIGHBITDEPTH |
| 546 make_tuple(64, 64, highbd_sad64x64_c, 8), |
| 547 make_tuple(64, 32, highbd_sad64x32_c, 8), |
| 548 make_tuple(32, 64, highbd_sad32x64_c, 8), |
| 549 make_tuple(32, 32, highbd_sad32x32_c, 8), |
| 550 make_tuple(32, 16, highbd_sad32x16_c, 8), |
| 551 make_tuple(16, 32, highbd_sad16x32_c, 8), |
| 552 make_tuple(16, 16, highbd_sad16x16_c, 8), |
| 553 make_tuple(16, 8, highbd_sad16x8_c, 8), |
| 554 make_tuple(8, 16, highbd_sad8x16_c, 8), |
| 555 make_tuple(8, 8, highbd_sad8x8_c, 8), |
| 556 make_tuple(8, 4, highbd_sad8x4_c, 8), |
| 557 make_tuple(4, 8, highbd_sad4x8_c, 8), |
| 558 make_tuple(4, 4, highbd_sad4x4_c, 8), |
| 559 make_tuple(64, 64, highbd_sad64x64_c, 10), |
| 560 make_tuple(64, 32, highbd_sad64x32_c, 10), |
| 561 make_tuple(32, 64, highbd_sad32x64_c, 10), |
| 562 make_tuple(32, 32, highbd_sad32x32_c, 10), |
| 563 make_tuple(32, 16, highbd_sad32x16_c, 10), |
| 564 make_tuple(16, 32, highbd_sad16x32_c, 10), |
| 565 make_tuple(16, 16, highbd_sad16x16_c, 10), |
| 566 make_tuple(16, 8, highbd_sad16x8_c, 10), |
| 567 make_tuple(8, 16, highbd_sad8x16_c, 10), |
| 568 make_tuple(8, 8, highbd_sad8x8_c, 10), |
| 569 make_tuple(8, 4, highbd_sad8x4_c, 10), |
| 570 make_tuple(4, 8, highbd_sad4x8_c, 10), |
| 571 make_tuple(4, 4, highbd_sad4x4_c, 10), |
| 572 make_tuple(64, 64, highbd_sad64x64_c, 12), |
| 573 make_tuple(64, 32, highbd_sad64x32_c, 12), |
| 574 make_tuple(32, 64, highbd_sad32x64_c, 12), |
| 575 make_tuple(32, 32, highbd_sad32x32_c, 12), |
| 576 make_tuple(32, 16, highbd_sad32x16_c, 12), |
| 577 make_tuple(16, 32, highbd_sad16x32_c, 12), |
| 578 make_tuple(16, 16, highbd_sad16x16_c, 12), |
| 579 make_tuple(16, 8, highbd_sad16x8_c, 12), |
| 580 make_tuple(8, 16, highbd_sad8x16_c, 12), |
| 581 make_tuple(8, 8, highbd_sad8x8_c, 12), |
| 582 make_tuple(8, 4, highbd_sad8x4_c, 12), |
| 583 make_tuple(4, 8, highbd_sad4x8_c, 12), |
| 584 make_tuple(4, 4, highbd_sad4x4_c, 12), |
| 585 #endif // CONFIG_VP9_HIGHBITDEPTH |
| 656 }; | 586 }; |
| 657 INSTANTIATE_TEST_CASE_P(C, SADTest, ::testing::ValuesIn(c_tests)); | 587 INSTANTIATE_TEST_CASE_P(C, SADTest, ::testing::ValuesIn(c_tests)); |
| 658 #endif // CONFIG_VP8_ENCODER | 588 |
| 659 | 589 const SadMxNAvgFunc sad64x64_avg_c = vpx_sad64x64_avg_c; |
| 660 #if CONFIG_VP9_ENCODER | 590 const SadMxNAvgFunc sad64x32_avg_c = vpx_sad64x32_avg_c; |
| 661 const SadMxNVp9Func sad_64x64_c_vp9 = vp9_sad64x64_c; | 591 const SadMxNAvgFunc sad32x64_avg_c = vpx_sad32x64_avg_c; |
| 662 const SadMxNVp9Func sad_32x32_c_vp9 = vp9_sad32x32_c; | 592 const SadMxNAvgFunc sad32x32_avg_c = vpx_sad32x32_avg_c; |
| 663 const SadMxNVp9Func sad_16x16_c_vp9 = vp9_sad16x16_c; | 593 const SadMxNAvgFunc sad32x16_avg_c = vpx_sad32x16_avg_c; |
| 664 const SadMxNVp9Func sad_8x16_c_vp9 = vp9_sad8x16_c; | 594 const SadMxNAvgFunc sad16x32_avg_c = vpx_sad16x32_avg_c; |
| 665 const SadMxNVp9Func sad_16x8_c_vp9 = vp9_sad16x8_c; | 595 const SadMxNAvgFunc sad16x16_avg_c = vpx_sad16x16_avg_c; |
| 666 const SadMxNVp9Func sad_8x8_c_vp9 = vp9_sad8x8_c; | 596 const SadMxNAvgFunc sad16x8_avg_c = vpx_sad16x8_avg_c; |
| 667 const SadMxNVp9Func sad_8x4_c_vp9 = vp9_sad8x4_c; | 597 const SadMxNAvgFunc sad8x16_avg_c = vpx_sad8x16_avg_c; |
| 668 const SadMxNVp9Func sad_4x8_c_vp9 = vp9_sad4x8_c; | 598 const SadMxNAvgFunc sad8x8_avg_c = vpx_sad8x8_avg_c; |
| 669 const SadMxNVp9Func sad_4x4_c_vp9 = vp9_sad4x4_c; | 599 const SadMxNAvgFunc sad8x4_avg_c = vpx_sad8x4_avg_c; |
| 670 const SadMxNVp9Param c_vp9_tests[] = { | 600 const SadMxNAvgFunc sad4x8_avg_c = vpx_sad4x8_avg_c; |
| 671 make_tuple(64, 64, sad_64x64_c_vp9, -1), | 601 const SadMxNAvgFunc sad4x4_avg_c = vpx_sad4x4_avg_c; |
| 672 make_tuple(32, 32, sad_32x32_c_vp9, -1), | 602 #if CONFIG_VP9_HIGHBITDEPTH |
| 673 make_tuple(16, 16, sad_16x16_c_vp9, -1), | 603 const SadMxNAvgFunc highbd_sad64x64_avg_c = vpx_highbd_sad64x64_avg_c; |
| 674 make_tuple(8, 16, sad_8x16_c_vp9, -1), | 604 const SadMxNAvgFunc highbd_sad64x32_avg_c = vpx_highbd_sad64x32_avg_c; |
| 675 make_tuple(16, 8, sad_16x8_c_vp9, -1), | 605 const SadMxNAvgFunc highbd_sad32x64_avg_c = vpx_highbd_sad32x64_avg_c; |
| 676 make_tuple(8, 8, sad_8x8_c_vp9, -1), | 606 const SadMxNAvgFunc highbd_sad32x32_avg_c = vpx_highbd_sad32x32_avg_c; |
| 677 make_tuple(8, 4, sad_8x4_c_vp9, -1), | 607 const SadMxNAvgFunc highbd_sad32x16_avg_c = vpx_highbd_sad32x16_avg_c; |
| 678 make_tuple(4, 8, sad_4x8_c_vp9, -1), | 608 const SadMxNAvgFunc highbd_sad16x32_avg_c = vpx_highbd_sad16x32_avg_c; |
| 679 make_tuple(4, 4, sad_4x4_c_vp9, -1), | 609 const SadMxNAvgFunc highbd_sad16x16_avg_c = vpx_highbd_sad16x16_avg_c; |
| 680 }; | 610 const SadMxNAvgFunc highbd_sad16x8_avg_c = vpx_highbd_sad16x8_avg_c; |
| 681 INSTANTIATE_TEST_CASE_P(C, SADVP9Test, ::testing::ValuesIn(c_vp9_tests)); | 611 const SadMxNAvgFunc highbd_sad8x16_avg_c = vpx_highbd_sad8x16_avg_c; |
| 682 | 612 const SadMxNAvgFunc highbd_sad8x8_avg_c = vpx_highbd_sad8x8_avg_c; |
| 683 const SadMxNx4Func sad_64x64x4d_c = vp9_sad64x64x4d_c; | 613 const SadMxNAvgFunc highbd_sad8x4_avg_c = vpx_highbd_sad8x4_avg_c; |
| 684 const SadMxNx4Func sad_64x32x4d_c = vp9_sad64x32x4d_c; | 614 const SadMxNAvgFunc highbd_sad4x8_avg_c = vpx_highbd_sad4x8_avg_c; |
| 685 const SadMxNx4Func sad_32x64x4d_c = vp9_sad32x64x4d_c; | 615 const SadMxNAvgFunc highbd_sad4x4_avg_c = vpx_highbd_sad4x4_avg_c; |
| 686 const SadMxNx4Func sad_32x32x4d_c = vp9_sad32x32x4d_c; | 616 #endif // CONFIG_VP9_HIGHBITDEPTH |
| 687 const SadMxNx4Func sad_32x16x4d_c = vp9_sad32x16x4d_c; | 617 const SadMxNAvgParam avg_c_tests[] = { |
| 688 const SadMxNx4Func sad_16x32x4d_c = vp9_sad16x32x4d_c; | 618 make_tuple(64, 64, sad64x64_avg_c, -1), |
| 689 const SadMxNx4Func sad_16x16x4d_c = vp9_sad16x16x4d_c; | 619 make_tuple(64, 32, sad64x32_avg_c, -1), |
| 690 const SadMxNx4Func sad_16x8x4d_c = vp9_sad16x8x4d_c; | 620 make_tuple(32, 64, sad32x64_avg_c, -1), |
| 691 const SadMxNx4Func sad_8x16x4d_c = vp9_sad8x16x4d_c; | 621 make_tuple(32, 32, sad32x32_avg_c, -1), |
| 692 const SadMxNx4Func sad_8x8x4d_c = vp9_sad8x8x4d_c; | 622 make_tuple(32, 16, sad32x16_avg_c, -1), |
| 693 const SadMxNx4Func sad_8x4x4d_c = vp9_sad8x4x4d_c; | 623 make_tuple(16, 32, sad16x32_avg_c, -1), |
| 694 const SadMxNx4Func sad_4x8x4d_c = vp9_sad4x8x4d_c; | 624 make_tuple(16, 16, sad16x16_avg_c, -1), |
| 695 const SadMxNx4Func sad_4x4x4d_c = vp9_sad4x4x4d_c; | 625 make_tuple(16, 8, sad16x8_avg_c, -1), |
| 696 INSTANTIATE_TEST_CASE_P(C, SADx4Test, ::testing::Values( | 626 make_tuple(8, 16, sad8x16_avg_c, -1), |
| 697 make_tuple(64, 64, sad_64x64x4d_c, -1), | 627 make_tuple(8, 8, sad8x8_avg_c, -1), |
| 698 make_tuple(64, 32, sad_64x32x4d_c, -1), | 628 make_tuple(8, 4, sad8x4_avg_c, -1), |
| 699 make_tuple(32, 64, sad_32x64x4d_c, -1), | 629 make_tuple(4, 8, sad4x8_avg_c, -1), |
| 700 make_tuple(32, 32, sad_32x32x4d_c, -1), | 630 make_tuple(4, 4, sad4x4_avg_c, -1), |
| 701 make_tuple(32, 16, sad_32x16x4d_c, -1), | 631 #if CONFIG_VP9_HIGHBITDEPTH |
| 702 make_tuple(16, 32, sad_16x32x4d_c, -1), | 632 make_tuple(64, 64, highbd_sad64x64_avg_c, 8), |
| 703 make_tuple(16, 16, sad_16x16x4d_c, -1), | 633 make_tuple(64, 32, highbd_sad64x32_avg_c, 8), |
| 704 make_tuple(16, 8, sad_16x8x4d_c, -1), | 634 make_tuple(32, 64, highbd_sad32x64_avg_c, 8), |
| 705 make_tuple(8, 16, sad_8x16x4d_c, -1), | 635 make_tuple(32, 32, highbd_sad32x32_avg_c, 8), |
| 706 make_tuple(8, 8, sad_8x8x4d_c, -1), | 636 make_tuple(32, 16, highbd_sad32x16_avg_c, 8), |
| 707 make_tuple(8, 4, sad_8x4x4d_c, -1), | 637 make_tuple(16, 32, highbd_sad16x32_avg_c, 8), |
| 708 make_tuple(4, 8, sad_4x8x4d_c, -1), | 638 make_tuple(16, 16, highbd_sad16x16_avg_c, 8), |
| 709 make_tuple(4, 4, sad_4x4x4d_c, -1))); | 639 make_tuple(16, 8, highbd_sad16x8_avg_c, 8), |
| 710 | 640 make_tuple(8, 16, highbd_sad8x16_avg_c, 8), |
| 711 #if CONFIG_VP9_HIGHBITDEPTH | 641 make_tuple(8, 8, highbd_sad8x8_avg_c, 8), |
| 712 const SadMxNVp9Func highbd_sad_64x64_c_vp9 = vp9_highbd_sad64x64_c; | 642 make_tuple(8, 4, highbd_sad8x4_avg_c, 8), |
| 713 const SadMxNVp9Func highbd_sad_32x32_c_vp9 = vp9_highbd_sad32x32_c; | 643 make_tuple(4, 8, highbd_sad4x8_avg_c, 8), |
| 714 const SadMxNVp9Func highbd_sad_16x16_c_vp9 = vp9_highbd_sad16x16_c; | 644 make_tuple(4, 4, highbd_sad4x4_avg_c, 8), |
| 715 const SadMxNVp9Func highbd_sad_8x16_c_vp9 = vp9_highbd_sad8x16_c; | 645 make_tuple(64, 64, highbd_sad64x64_avg_c, 10), |
| 716 const SadMxNVp9Func highbd_sad_16x8_c_vp9 = vp9_highbd_sad16x8_c; | 646 make_tuple(64, 32, highbd_sad64x32_avg_c, 10), |
| 717 const SadMxNVp9Func highbd_sad_8x8_c_vp9 = vp9_highbd_sad8x8_c; | 647 make_tuple(32, 64, highbd_sad32x64_avg_c, 10), |
| 718 const SadMxNVp9Func highbd_sad_8x4_c_vp9 = vp9_highbd_sad8x4_c; | 648 make_tuple(32, 32, highbd_sad32x32_avg_c, 10), |
| 719 const SadMxNVp9Func highbd_sad_4x8_c_vp9 = vp9_highbd_sad4x8_c; | 649 make_tuple(32, 16, highbd_sad32x16_avg_c, 10), |
| 720 const SadMxNVp9Func highbd_sad_4x4_c_vp9 = vp9_highbd_sad4x4_c; | 650 make_tuple(16, 32, highbd_sad16x32_avg_c, 10), |
| 721 const SadMxNVp9Param c_vp9_highbd_8_tests[] = { | 651 make_tuple(16, 16, highbd_sad16x16_avg_c, 10), |
| 722 make_tuple(64, 64, highbd_sad_64x64_c_vp9, 8), | 652 make_tuple(16, 8, highbd_sad16x8_avg_c, 10), |
| 723 make_tuple(32, 32, highbd_sad_32x32_c_vp9, 8), | 653 make_tuple(8, 16, highbd_sad8x16_avg_c, 10), |
| 724 make_tuple(16, 16, highbd_sad_16x16_c_vp9, 8), | 654 make_tuple(8, 8, highbd_sad8x8_avg_c, 10), |
| 725 make_tuple(8, 16, highbd_sad_8x16_c_vp9, 8), | 655 make_tuple(8, 4, highbd_sad8x4_avg_c, 10), |
| 726 make_tuple(16, 8, highbd_sad_16x8_c_vp9, 8), | 656 make_tuple(4, 8, highbd_sad4x8_avg_c, 10), |
| 727 make_tuple(8, 8, highbd_sad_8x8_c_vp9, 8), | 657 make_tuple(4, 4, highbd_sad4x4_avg_c, 10), |
| 728 make_tuple(8, 4, highbd_sad_8x4_c_vp9, 8), | 658 make_tuple(64, 64, highbd_sad64x64_avg_c, 12), |
| 729 make_tuple(4, 8, highbd_sad_4x8_c_vp9, 8), | 659 make_tuple(64, 32, highbd_sad64x32_avg_c, 12), |
| 730 make_tuple(4, 4, highbd_sad_4x4_c_vp9, 8), | 660 make_tuple(32, 64, highbd_sad32x64_avg_c, 12), |
| 731 }; | 661 make_tuple(32, 32, highbd_sad32x32_avg_c, 12), |
| 732 INSTANTIATE_TEST_CASE_P(C_8, SADVP9Test, | 662 make_tuple(32, 16, highbd_sad32x16_avg_c, 12), |
| 733 ::testing::ValuesIn(c_vp9_highbd_8_tests)); | 663 make_tuple(16, 32, highbd_sad16x32_avg_c, 12), |
| 734 | 664 make_tuple(16, 16, highbd_sad16x16_avg_c, 12), |
| 735 const SadMxNVp9Param c_vp9_highbd_10_tests[] = { | 665 make_tuple(16, 8, highbd_sad16x8_avg_c, 12), |
| 736 make_tuple(64, 64, highbd_sad_64x64_c_vp9, 10), | 666 make_tuple(8, 16, highbd_sad8x16_avg_c, 12), |
| 737 make_tuple(32, 32, highbd_sad_32x32_c_vp9, 10), | 667 make_tuple(8, 8, highbd_sad8x8_avg_c, 12), |
| 738 make_tuple(16, 16, highbd_sad_16x16_c_vp9, 10), | 668 make_tuple(8, 4, highbd_sad8x4_avg_c, 12), |
| 739 make_tuple(8, 16, highbd_sad_8x16_c_vp9, 10), | 669 make_tuple(4, 8, highbd_sad4x8_avg_c, 12), |
| 740 make_tuple(16, 8, highbd_sad_16x8_c_vp9, 10), | 670 make_tuple(4, 4, highbd_sad4x4_avg_c, 12), |
| 741 make_tuple(8, 8, highbd_sad_8x8_c_vp9, 10), | 671 #endif // CONFIG_VP9_HIGHBITDEPTH |
| 742 make_tuple(8, 4, highbd_sad_8x4_c_vp9, 10), | 672 }; |
| 743 make_tuple(4, 8, highbd_sad_4x8_c_vp9, 10), | 673 INSTANTIATE_TEST_CASE_P(C, SADavgTest, ::testing::ValuesIn(avg_c_tests)); |
| 744 make_tuple(4, 4, highbd_sad_4x4_c_vp9, 10), | 674 |
| 745 }; | 675 const SadMxNx4Func sad64x64x4d_c = vpx_sad64x64x4d_c; |
| 746 INSTANTIATE_TEST_CASE_P(C_10, SADVP9Test, | 676 const SadMxNx4Func sad64x32x4d_c = vpx_sad64x32x4d_c; |
| 747 ::testing::ValuesIn(c_vp9_highbd_10_tests)); | 677 const SadMxNx4Func sad32x64x4d_c = vpx_sad32x64x4d_c; |
| 748 | 678 const SadMxNx4Func sad32x32x4d_c = vpx_sad32x32x4d_c; |
| 749 const SadMxNVp9Param c_vp9_highbd_12_tests[] = { | 679 const SadMxNx4Func sad32x16x4d_c = vpx_sad32x16x4d_c; |
| 750 make_tuple(64, 64, highbd_sad_64x64_c_vp9, 12), | 680 const SadMxNx4Func sad16x32x4d_c = vpx_sad16x32x4d_c; |
| 751 make_tuple(32, 32, highbd_sad_32x32_c_vp9, 12), | 681 const SadMxNx4Func sad16x16x4d_c = vpx_sad16x16x4d_c; |
| 752 make_tuple(16, 16, highbd_sad_16x16_c_vp9, 12), | 682 const SadMxNx4Func sad16x8x4d_c = vpx_sad16x8x4d_c; |
| 753 make_tuple(8, 16, highbd_sad_8x16_c_vp9, 12), | 683 const SadMxNx4Func sad8x16x4d_c = vpx_sad8x16x4d_c; |
| 754 make_tuple(16, 8, highbd_sad_16x8_c_vp9, 12), | 684 const SadMxNx4Func sad8x8x4d_c = vpx_sad8x8x4d_c; |
| 755 make_tuple(8, 8, highbd_sad_8x8_c_vp9, 12), | 685 const SadMxNx4Func sad8x4x4d_c = vpx_sad8x4x4d_c; |
| 756 make_tuple(8, 4, highbd_sad_8x4_c_vp9, 12), | 686 const SadMxNx4Func sad4x8x4d_c = vpx_sad4x8x4d_c; |
| 757 make_tuple(4, 8, highbd_sad_4x8_c_vp9, 12), | 687 const SadMxNx4Func sad4x4x4d_c = vpx_sad4x4x4d_c; |
| 758 make_tuple(4, 4, highbd_sad_4x4_c_vp9, 12), | 688 #if CONFIG_VP9_HIGHBITDEPTH |
| 759 }; | 689 const SadMxNx4Func highbd_sad64x64x4d_c = vpx_highbd_sad64x64x4d_c; |
| 760 INSTANTIATE_TEST_CASE_P(C_12, SADVP9Test, | 690 const SadMxNx4Func highbd_sad64x32x4d_c = vpx_highbd_sad64x32x4d_c; |
| 761 ::testing::ValuesIn(c_vp9_highbd_12_tests)); | 691 const SadMxNx4Func highbd_sad32x64x4d_c = vpx_highbd_sad32x64x4d_c; |
| 762 | 692 const SadMxNx4Func highbd_sad32x32x4d_c = vpx_highbd_sad32x32x4d_c; |
| 763 const SadMxNAvgVp9Func highbd_sad8x4_avg_c_vp9 = vp9_highbd_sad8x4_avg_c; | 693 const SadMxNx4Func highbd_sad32x16x4d_c = vpx_highbd_sad32x16x4d_c; |
| 764 const SadMxNAvgVp9Func highbd_sad8x8_avg_c_vp9 = vp9_highbd_sad8x8_avg_c; | 694 const SadMxNx4Func highbd_sad16x32x4d_c = vpx_highbd_sad16x32x4d_c; |
| 765 const SadMxNAvgVp9Func highbd_sad8x16_avg_c_vp9 = vp9_highbd_sad8x16_avg_c; | 695 const SadMxNx4Func highbd_sad16x16x4d_c = vpx_highbd_sad16x16x4d_c; |
| 766 const SadMxNAvgVp9Func highbd_sad16x8_avg_c_vp9 = vp9_highbd_sad16x8_avg_c; | 696 const SadMxNx4Func highbd_sad16x8x4d_c = vpx_highbd_sad16x8x4d_c; |
| 767 const SadMxNAvgVp9Func highbd_sad16x16_avg_c_vp9 = vp9_highbd_sad16x16_avg_c; | 697 const SadMxNx4Func highbd_sad8x16x4d_c = vpx_highbd_sad8x16x4d_c; |
| 768 const SadMxNAvgVp9Func highbd_sad16x32_avg_c_vp9 = vp9_highbd_sad16x32_avg_c; | 698 const SadMxNx4Func highbd_sad8x8x4d_c = vpx_highbd_sad8x8x4d_c; |
| 769 const SadMxNAvgVp9Func highbd_sad32x16_avg_c_vp9 = vp9_highbd_sad32x16_avg_c; | 699 const SadMxNx4Func highbd_sad8x4x4d_c = vpx_highbd_sad8x4x4d_c; |
| 770 const SadMxNAvgVp9Func highbd_sad32x32_avg_c_vp9 = vp9_highbd_sad32x32_avg_c; | 700 const SadMxNx4Func highbd_sad4x8x4d_c = vpx_highbd_sad4x8x4d_c; |
| 771 const SadMxNAvgVp9Func highbd_sad32x64_avg_c_vp9 = vp9_highbd_sad32x64_avg_c; | 701 const SadMxNx4Func highbd_sad4x4x4d_c = vpx_highbd_sad4x4x4d_c; |
| 772 const SadMxNAvgVp9Func highbd_sad64x32_avg_c_vp9 = vp9_highbd_sad64x32_avg_c; | 702 #endif // CONFIG_VP9_HIGHBITDEPTH |
| 773 const SadMxNAvgVp9Func highbd_sad64x64_avg_c_vp9 = vp9_highbd_sad64x64_avg_c; | 703 const SadMxNx4Param x4d_c_tests[] = { |
| 774 SadMxNAvgVp9Param avg_c_vp9_highbd_8_tests[] = { | 704 make_tuple(64, 64, sad64x64x4d_c, -1), |
| 775 make_tuple(8, 4, highbd_sad8x4_avg_c_vp9, 8), | 705 make_tuple(64, 32, sad64x32x4d_c, -1), |
| 776 make_tuple(8, 8, highbd_sad8x8_avg_c_vp9, 8), | 706 make_tuple(32, 64, sad32x64x4d_c, -1), |
| 777 make_tuple(8, 16, highbd_sad8x16_avg_c_vp9, 8), | 707 make_tuple(32, 32, sad32x32x4d_c, -1), |
| 778 make_tuple(16, 8, highbd_sad16x8_avg_c_vp9, 8), | 708 make_tuple(32, 16, sad32x16x4d_c, -1), |
| 779 make_tuple(16, 16, highbd_sad16x16_avg_c_vp9, 8), | 709 make_tuple(16, 32, sad16x32x4d_c, -1), |
| 780 make_tuple(16, 32, highbd_sad16x32_avg_c_vp9, 8), | 710 make_tuple(16, 16, sad16x16x4d_c, -1), |
| 781 make_tuple(32, 16, highbd_sad32x16_avg_c_vp9, 8), | 711 make_tuple(16, 8, sad16x8x4d_c, -1), |
| 782 make_tuple(32, 32, highbd_sad32x32_avg_c_vp9, 8), | 712 make_tuple(8, 16, sad8x16x4d_c, -1), |
| 783 make_tuple(32, 64, highbd_sad32x64_avg_c_vp9, 8), | 713 make_tuple(8, 8, sad8x8x4d_c, -1), |
| 784 make_tuple(64, 32, highbd_sad64x32_avg_c_vp9, 8), | 714 make_tuple(8, 4, sad8x4x4d_c, -1), |
| 785 make_tuple(64, 64, highbd_sad64x64_avg_c_vp9, 8)}; | 715 make_tuple(4, 8, sad4x8x4d_c, -1), |
| 786 INSTANTIATE_TEST_CASE_P(C_8, SADavgVP9Test, | 716 make_tuple(4, 4, sad4x4x4d_c, -1), |
| 787 ::testing::ValuesIn(avg_c_vp9_highbd_8_tests)); | 717 #if CONFIG_VP9_HIGHBITDEPTH |
| 788 | 718 make_tuple(64, 64, highbd_sad64x64x4d_c, 8), |
| 789 SadMxNAvgVp9Param avg_c_vp9_highbd_10_tests[] = { | 719 make_tuple(64, 32, highbd_sad64x32x4d_c, 8), |
| 790 make_tuple(8, 4, highbd_sad8x4_avg_c_vp9, 10), | 720 make_tuple(32, 64, highbd_sad32x64x4d_c, 8), |
| 791 make_tuple(8, 8, highbd_sad8x8_avg_c_vp9, 10), | 721 make_tuple(32, 32, highbd_sad32x32x4d_c, 8), |
| 792 make_tuple(8, 16, highbd_sad8x16_avg_c_vp9, 10), | 722 make_tuple(32, 16, highbd_sad32x16x4d_c, 8), |
| 793 make_tuple(16, 8, highbd_sad16x8_avg_c_vp9, 10), | 723 make_tuple(16, 32, highbd_sad16x32x4d_c, 8), |
| 794 make_tuple(16, 16, highbd_sad16x16_avg_c_vp9, 10), | 724 make_tuple(16, 16, highbd_sad16x16x4d_c, 8), |
| 795 make_tuple(16, 32, highbd_sad16x32_avg_c_vp9, 10), | 725 make_tuple(16, 8, highbd_sad16x8x4d_c, 8), |
| 796 make_tuple(32, 16, highbd_sad32x16_avg_c_vp9, 10), | 726 make_tuple(8, 16, highbd_sad8x16x4d_c, 8), |
| 797 make_tuple(32, 32, highbd_sad32x32_avg_c_vp9, 10), | 727 make_tuple(8, 8, highbd_sad8x8x4d_c, 8), |
| 798 make_tuple(32, 64, highbd_sad32x64_avg_c_vp9, 10), | 728 make_tuple(8, 4, highbd_sad8x4x4d_c, 8), |
| 799 make_tuple(64, 32, highbd_sad64x32_avg_c_vp9, 10), | 729 make_tuple(4, 8, highbd_sad4x8x4d_c, 8), |
| 800 make_tuple(64, 64, highbd_sad64x64_avg_c_vp9, 10)}; | 730 make_tuple(4, 4, highbd_sad4x4x4d_c, 8), |
| 801 INSTANTIATE_TEST_CASE_P(C_10, SADavgVP9Test, | 731 make_tuple(64, 64, highbd_sad64x64x4d_c, 10), |
| 802 ::testing::ValuesIn(avg_c_vp9_highbd_10_tests)); | 732 make_tuple(64, 32, highbd_sad64x32x4d_c, 10), |
| 803 | 733 make_tuple(32, 64, highbd_sad32x64x4d_c, 10), |
| 804 SadMxNAvgVp9Param avg_c_vp9_highbd_12_tests[] = { | 734 make_tuple(32, 32, highbd_sad32x32x4d_c, 10), |
| 805 make_tuple(8, 4, highbd_sad8x4_avg_c_vp9, 12), | 735 make_tuple(32, 16, highbd_sad32x16x4d_c, 10), |
| 806 make_tuple(8, 8, highbd_sad8x8_avg_c_vp9, 12), | 736 make_tuple(16, 32, highbd_sad16x32x4d_c, 10), |
| 807 make_tuple(8, 16, highbd_sad8x16_avg_c_vp9, 12), | 737 make_tuple(16, 16, highbd_sad16x16x4d_c, 10), |
| 808 make_tuple(16, 8, highbd_sad16x8_avg_c_vp9, 12), | 738 make_tuple(16, 8, highbd_sad16x8x4d_c, 10), |
| 809 make_tuple(16, 16, highbd_sad16x16_avg_c_vp9, 12), | 739 make_tuple(8, 16, highbd_sad8x16x4d_c, 10), |
| 810 make_tuple(16, 32, highbd_sad16x32_avg_c_vp9, 12), | 740 make_tuple(8, 8, highbd_sad8x8x4d_c, 10), |
| 811 make_tuple(32, 16, highbd_sad32x16_avg_c_vp9, 12), | 741 make_tuple(8, 4, highbd_sad8x4x4d_c, 10), |
| 812 make_tuple(32, 32, highbd_sad32x32_avg_c_vp9, 12), | 742 make_tuple(4, 8, highbd_sad4x8x4d_c, 10), |
| 813 make_tuple(32, 64, highbd_sad32x64_avg_c_vp9, 12), | 743 make_tuple(4, 4, highbd_sad4x4x4d_c, 10), |
| 814 make_tuple(64, 32, highbd_sad64x32_avg_c_vp9, 12), | 744 make_tuple(64, 64, highbd_sad64x64x4d_c, 12), |
| 815 make_tuple(64, 64, highbd_sad64x64_avg_c_vp9, 12)}; | 745 make_tuple(64, 32, highbd_sad64x32x4d_c, 12), |
| 816 INSTANTIATE_TEST_CASE_P(C_12, SADavgVP9Test, | 746 make_tuple(32, 64, highbd_sad32x64x4d_c, 12), |
| 817 ::testing::ValuesIn(avg_c_vp9_highbd_12_tests)); | 747 make_tuple(32, 32, highbd_sad32x32x4d_c, 12), |
| 818 | 748 make_tuple(32, 16, highbd_sad32x16x4d_c, 12), |
| 819 const SadMxNx4Func highbd_sad_64x64x4d_c = vp9_highbd_sad64x64x4d_c; | 749 make_tuple(16, 32, highbd_sad16x32x4d_c, 12), |
| 820 const SadMxNx4Func highbd_sad_64x32x4d_c = vp9_highbd_sad64x32x4d_c; | 750 make_tuple(16, 16, highbd_sad16x16x4d_c, 12), |
| 821 const SadMxNx4Func highbd_sad_32x64x4d_c = vp9_highbd_sad32x64x4d_c; | 751 make_tuple(16, 8, highbd_sad16x8x4d_c, 12), |
| 822 const SadMxNx4Func highbd_sad_32x32x4d_c = vp9_highbd_sad32x32x4d_c; | 752 make_tuple(8, 16, highbd_sad8x16x4d_c, 12), |
| 823 const SadMxNx4Func highbd_sad_32x16x4d_c = vp9_highbd_sad32x16x4d_c; | 753 make_tuple(8, 8, highbd_sad8x8x4d_c, 12), |
| 824 const SadMxNx4Func highbd_sad_16x32x4d_c = vp9_highbd_sad16x32x4d_c; | 754 make_tuple(8, 4, highbd_sad8x4x4d_c, 12), |
| 825 const SadMxNx4Func highbd_sad_16x16x4d_c = vp9_highbd_sad16x16x4d_c; | 755 make_tuple(4, 8, highbd_sad4x8x4d_c, 12), |
| 826 const SadMxNx4Func highbd_sad_16x8x4d_c = vp9_highbd_sad16x8x4d_c; | 756 make_tuple(4, 4, highbd_sad4x4x4d_c, 12), |
| 827 const SadMxNx4Func highbd_sad_8x16x4d_c = vp9_highbd_sad8x16x4d_c; | 757 #endif // CONFIG_VP9_HIGHBITDEPTH |
| 828 const SadMxNx4Func highbd_sad_8x8x4d_c = vp9_highbd_sad8x8x4d_c; | 758 }; |
| 829 const SadMxNx4Func highbd_sad_8x4x4d_c = vp9_highbd_sad8x4x4d_c; | 759 INSTANTIATE_TEST_CASE_P(C, SADx4Test, ::testing::ValuesIn(x4d_c_tests)); |
| 830 const SadMxNx4Func highbd_sad_4x8x4d_c = vp9_highbd_sad4x8x4d_c; | |
| 831 const SadMxNx4Func highbd_sad_4x4x4d_c = vp9_highbd_sad4x4x4d_c; | |
| 832 INSTANTIATE_TEST_CASE_P(C_8, SADx4Test, ::testing::Values( | |
| 833 make_tuple(64, 64, highbd_sad_64x64x4d_c, 8), | |
| 834 make_tuple(64, 32, highbd_sad_64x32x4d_c, 8), | |
| 835 make_tuple(32, 64, highbd_sad_32x64x4d_c, 8), | |
| 836 make_tuple(32, 32, highbd_sad_32x32x4d_c, 8), | |
| 837 make_tuple(32, 16, highbd_sad_32x16x4d_c, 8), | |
| 838 make_tuple(16, 32, highbd_sad_16x32x4d_c, 8), | |
| 839 make_tuple(16, 16, highbd_sad_16x16x4d_c, 8), | |
| 840 make_tuple(16, 8, highbd_sad_16x8x4d_c, 8), | |
| 841 make_tuple(8, 16, highbd_sad_8x16x4d_c, 8), | |
| 842 make_tuple(8, 8, highbd_sad_8x8x4d_c, 8), | |
| 843 make_tuple(8, 4, highbd_sad_8x4x4d_c, 8), | |
| 844 make_tuple(4, 8, highbd_sad_4x8x4d_c, 8), | |
| 845 make_tuple(4, 4, highbd_sad_4x4x4d_c, 8))); | |
| 846 | |
| 847 INSTANTIATE_TEST_CASE_P(C_10, SADx4Test, ::testing::Values( | |
| 848 make_tuple(64, 64, highbd_sad_64x64x4d_c, 10), | |
| 849 make_tuple(64, 32, highbd_sad_64x32x4d_c, 10), | |
| 850 make_tuple(32, 64, highbd_sad_32x64x4d_c, 10), | |
| 851 make_tuple(32, 32, highbd_sad_32x32x4d_c, 10), | |
| 852 make_tuple(32, 16, highbd_sad_32x16x4d_c, 10), | |
| 853 make_tuple(16, 32, highbd_sad_16x32x4d_c, 10), | |
| 854 make_tuple(16, 16, highbd_sad_16x16x4d_c, 10), | |
| 855 make_tuple(16, 8, highbd_sad_16x8x4d_c, 10), | |
| 856 make_tuple(8, 16, highbd_sad_8x16x4d_c, 10), | |
| 857 make_tuple(8, 8, highbd_sad_8x8x4d_c, 10), | |
| 858 make_tuple(8, 4, highbd_sad_8x4x4d_c, 10), | |
| 859 make_tuple(4, 8, highbd_sad_4x8x4d_c, 10), | |
| 860 make_tuple(4, 4, highbd_sad_4x4x4d_c, 10))); | |
| 861 | |
| 862 INSTANTIATE_TEST_CASE_P(C_12, SADx4Test, ::testing::Values( | |
| 863 make_tuple(64, 64, highbd_sad_64x64x4d_c, 12), | |
| 864 make_tuple(64, 32, highbd_sad_64x32x4d_c, 12), | |
| 865 make_tuple(32, 64, highbd_sad_32x64x4d_c, 12), | |
| 866 make_tuple(32, 32, highbd_sad_32x32x4d_c, 12), | |
| 867 make_tuple(32, 16, highbd_sad_32x16x4d_c, 12), | |
| 868 make_tuple(16, 32, highbd_sad_16x32x4d_c, 12), | |
| 869 make_tuple(16, 16, highbd_sad_16x16x4d_c, 12), | |
| 870 make_tuple(16, 8, highbd_sad_16x8x4d_c, 12), | |
| 871 make_tuple(8, 16, highbd_sad_8x16x4d_c, 12), | |
| 872 make_tuple(8, 8, highbd_sad_8x8x4d_c, 12), | |
| 873 make_tuple(8, 4, highbd_sad_8x4x4d_c, 12), | |
| 874 make_tuple(4, 8, highbd_sad_4x8x4d_c, 12), | |
| 875 make_tuple(4, 4, highbd_sad_4x4x4d_c, 12))); | |
| 876 #endif // CONFIG_VP9_HIGHBITDEPTH | |
| 877 #endif // CONFIG_VP9_ENCODER | |
| 878 | 760 |
| 879 //------------------------------------------------------------------------------ | 761 //------------------------------------------------------------------------------ |
| 880 // ARM functions | 762 // ARM functions |
| 881 #if HAVE_MEDIA | 763 #if HAVE_MEDIA |
| 882 #if CONFIG_VP8_ENCODER | 764 const SadMxNFunc sad16x16_media = vpx_sad16x16_media; |
| 883 const SadMxNFunc sad_16x16_armv6 = vp8_sad16x16_armv6; | 765 const SadMxNParam media_tests[] = { |
| 884 INSTANTIATE_TEST_CASE_P(MEDIA, SADTest, ::testing::Values( | 766 make_tuple(16, 16, sad16x16_media, -1), |
| 885 make_tuple(16, 16, sad_16x16_armv6, -1))); | 767 }; |
| 886 #endif // CONFIG_VP8_ENCODER | 768 INSTANTIATE_TEST_CASE_P(MEDIA, SADTest, ::testing::ValuesIn(media_tests)); |
| 887 #endif // HAVE_MEDIA | 769 #endif // HAVE_MEDIA |
| 888 | 770 |
| 889 #if HAVE_NEON | 771 #if HAVE_NEON |
| 890 #if CONFIG_VP8_ENCODER | 772 const SadMxNFunc sad64x64_neon = vpx_sad64x64_neon; |
| 891 const SadMxNFunc sad_16x16_neon = vp8_sad16x16_neon; | 773 const SadMxNFunc sad32x32_neon = vpx_sad32x32_neon; |
| 892 const SadMxNFunc sad_8x16_neon = vp8_sad8x16_neon; | 774 const SadMxNFunc sad16x16_neon = vpx_sad16x16_neon; |
| 893 const SadMxNFunc sad_16x8_neon = vp8_sad16x8_neon; | 775 const SadMxNFunc sad16x8_neon = vpx_sad16x8_neon; |
| 894 const SadMxNFunc sad_8x8_neon = vp8_sad8x8_neon; | 776 const SadMxNFunc sad8x16_neon = vpx_sad8x16_neon; |
| 895 const SadMxNFunc sad_4x4_neon = vp8_sad4x4_neon; | 777 const SadMxNFunc sad8x8_neon = vpx_sad8x8_neon; |
| 896 INSTANTIATE_TEST_CASE_P(NEON, SADTest, ::testing::Values( | 778 const SadMxNFunc sad4x4_neon = vpx_sad4x4_neon; |
| 897 make_tuple(16, 16, sad_16x16_neon, -1), | 779 |
| 898 make_tuple(8, 16, sad_8x16_neon, -1), | 780 const SadMxNParam neon_tests[] = { |
| 899 make_tuple(16, 8, sad_16x8_neon, -1), | 781 make_tuple(64, 64, sad64x64_neon, -1), |
| 900 make_tuple(8, 8, sad_8x8_neon, -1), | 782 make_tuple(32, 32, sad32x32_neon, -1), |
| 901 make_tuple(4, 4, sad_4x4_neon, -1))); | 783 make_tuple(16, 16, sad16x16_neon, -1), |
| 902 #endif // CONFIG_VP8_ENCODER | 784 make_tuple(16, 8, sad16x8_neon, -1), |
| 903 #if CONFIG_VP9_ENCODER | 785 make_tuple(8, 16, sad8x16_neon, -1), |
| 904 const SadMxNVp9Func sad_64x64_neon_vp9 = vp9_sad64x64_neon; | 786 make_tuple(8, 8, sad8x8_neon, -1), |
| 905 const SadMxNVp9Func sad_32x32_neon_vp9 = vp9_sad32x32_neon; | 787 make_tuple(4, 4, sad4x4_neon, -1), |
| 906 const SadMxNVp9Func sad_16x16_neon_vp9 = vp9_sad16x16_neon; | 788 }; |
| 907 const SadMxNVp9Func sad_8x8_neon_vp9 = vp9_sad8x8_neon; | 789 INSTANTIATE_TEST_CASE_P(NEON, SADTest, ::testing::ValuesIn(neon_tests)); |
| 908 const SadMxNVp9Param neon_vp9_tests[] = { | 790 |
| 909 make_tuple(64, 64, sad_64x64_neon_vp9, -1), | 791 const SadMxNx4Func sad64x64x4d_neon = vpx_sad64x64x4d_neon; |
| 910 make_tuple(32, 32, sad_32x32_neon_vp9, -1), | 792 const SadMxNx4Func sad32x32x4d_neon = vpx_sad32x32x4d_neon; |
| 911 make_tuple(16, 16, sad_16x16_neon_vp9, -1), | 793 const SadMxNx4Func sad16x16x4d_neon = vpx_sad16x16x4d_neon; |
| 912 make_tuple(8, 8, sad_8x8_neon_vp9, -1), | 794 const SadMxNx4Param x4d_neon_tests[] = { |
| 913 }; | 795 make_tuple(64, 64, sad64x64x4d_neon, -1), |
| 914 INSTANTIATE_TEST_CASE_P(NEON, SADVP9Test, ::testing::ValuesIn(neon_vp9_tests)); | 796 make_tuple(32, 32, sad32x32x4d_neon, -1), |
| 915 #endif // CONFIG_VP9_ENCODER | 797 make_tuple(16, 16, sad16x16x4d_neon, -1), |
| 798 }; |
| 799 INSTANTIATE_TEST_CASE_P(NEON, SADx4Test, ::testing::ValuesIn(x4d_neon_tests)); |
| 916 #endif // HAVE_NEON | 800 #endif // HAVE_NEON |
| 917 | 801 |
| 918 //------------------------------------------------------------------------------ | 802 //------------------------------------------------------------------------------ |
| 919 // x86 functions | 803 // x86 functions |
| 920 #if HAVE_MMX | 804 #if HAVE_MMX |
| 921 #if CONFIG_VP8_ENCODER | 805 const SadMxNFunc sad16x16_mmx = vpx_sad16x16_mmx; |
| 922 const SadMxNFunc sad_16x16_mmx = vp8_sad16x16_mmx; | 806 const SadMxNFunc sad16x8_mmx = vpx_sad16x8_mmx; |
| 923 const SadMxNFunc sad_8x16_mmx = vp8_sad8x16_mmx; | 807 const SadMxNFunc sad8x16_mmx = vpx_sad8x16_mmx; |
| 924 const SadMxNFunc sad_16x8_mmx = vp8_sad16x8_mmx; | 808 const SadMxNFunc sad8x8_mmx = vpx_sad8x8_mmx; |
| 925 const SadMxNFunc sad_8x8_mmx = vp8_sad8x8_mmx; | 809 const SadMxNFunc sad4x4_mmx = vpx_sad4x4_mmx; |
| 926 const SadMxNFunc sad_4x4_mmx = vp8_sad4x4_mmx; | |
| 927 const SadMxNParam mmx_tests[] = { | 810 const SadMxNParam mmx_tests[] = { |
| 928 make_tuple(16, 16, sad_16x16_mmx, -1), | 811 make_tuple(16, 16, sad16x16_mmx, -1), |
| 929 make_tuple(8, 16, sad_8x16_mmx, -1), | 812 make_tuple(16, 8, sad16x8_mmx, -1), |
| 930 make_tuple(16, 8, sad_16x8_mmx, -1), | 813 make_tuple(8, 16, sad8x16_mmx, -1), |
| 931 make_tuple(8, 8, sad_8x8_mmx, -1), | 814 make_tuple(8, 8, sad8x8_mmx, -1), |
| 932 make_tuple(4, 4, sad_4x4_mmx, -1), | 815 make_tuple(4, 4, sad4x4_mmx, -1), |
| 933 }; | 816 }; |
| 934 INSTANTIATE_TEST_CASE_P(MMX, SADTest, ::testing::ValuesIn(mmx_tests)); | 817 INSTANTIATE_TEST_CASE_P(MMX, SADTest, ::testing::ValuesIn(mmx_tests)); |
| 935 #endif // CONFIG_VP8_ENCODER | |
| 936 | |
| 937 #endif // HAVE_MMX | 818 #endif // HAVE_MMX |
| 938 | 819 |
| 939 #if HAVE_SSE | 820 #if HAVE_SSE |
| 940 #if CONFIG_VP9_ENCODER | |
| 941 #if CONFIG_USE_X86INC | 821 #if CONFIG_USE_X86INC |
| 942 const SadMxNVp9Func sad_4x4_sse_vp9 = vp9_sad4x4_sse; | 822 const SadMxNFunc sad4x8_sse = vpx_sad4x8_sse; |
| 943 const SadMxNVp9Func sad_4x8_sse_vp9 = vp9_sad4x8_sse; | 823 const SadMxNFunc sad4x4_sse = vpx_sad4x4_sse; |
| 944 INSTANTIATE_TEST_CASE_P(SSE, SADVP9Test, ::testing::Values( | 824 const SadMxNParam sse_tests[] = { |
| 945 make_tuple(4, 4, sad_4x4_sse_vp9, -1), | 825 make_tuple(4, 8, sad4x8_sse, -1), |
| 946 make_tuple(4, 8, sad_4x8_sse_vp9, -1))); | 826 make_tuple(4, 4, sad4x4_sse, -1), |
| 947 | 827 }; |
| 948 const SadMxNx4Func sad_4x8x4d_sse = vp9_sad4x8x4d_sse; | 828 INSTANTIATE_TEST_CASE_P(SSE, SADTest, ::testing::ValuesIn(sse_tests)); |
| 949 const SadMxNx4Func sad_4x4x4d_sse = vp9_sad4x4x4d_sse; | 829 |
| 950 INSTANTIATE_TEST_CASE_P(SSE, SADx4Test, ::testing::Values( | 830 const SadMxNAvgFunc sad4x8_avg_sse = vpx_sad4x8_avg_sse; |
| 951 make_tuple(4, 8, sad_4x8x4d_sse, -1), | 831 const SadMxNAvgFunc sad4x4_avg_sse = vpx_sad4x4_avg_sse; |
| 952 make_tuple(4, 4, sad_4x4x4d_sse, -1))); | 832 const SadMxNAvgParam avg_sse_tests[] = { |
| 833 make_tuple(4, 8, sad4x8_avg_sse, -1), |
| 834 make_tuple(4, 4, sad4x4_avg_sse, -1), |
| 835 }; |
| 836 INSTANTIATE_TEST_CASE_P(SSE, SADavgTest, ::testing::ValuesIn(avg_sse_tests)); |
| 837 |
| 838 const SadMxNx4Func sad4x8x4d_sse = vpx_sad4x8x4d_sse; |
| 839 const SadMxNx4Func sad4x4x4d_sse = vpx_sad4x4x4d_sse; |
| 840 const SadMxNx4Param x4d_sse_tests[] = { |
| 841 make_tuple(4, 8, sad4x8x4d_sse, -1), |
| 842 make_tuple(4, 4, sad4x4x4d_sse, -1), |
| 843 }; |
| 844 INSTANTIATE_TEST_CASE_P(SSE, SADx4Test, ::testing::ValuesIn(x4d_sse_tests)); |
| 953 #endif // CONFIG_USE_X86INC | 845 #endif // CONFIG_USE_X86INC |
| 954 #endif // CONFIG_VP9_ENCODER | |
| 955 #endif // HAVE_SSE | 846 #endif // HAVE_SSE |
| 956 | 847 |
| 957 #if HAVE_SSE2 | 848 #if HAVE_SSE2 |
| 958 #if CONFIG_VP8_ENCODER | 849 #if CONFIG_USE_X86INC |
| 959 const SadMxNFunc sad_16x16_wmt = vp8_sad16x16_wmt; | 850 const SadMxNFunc sad64x64_sse2 = vpx_sad64x64_sse2; |
| 960 const SadMxNFunc sad_8x16_wmt = vp8_sad8x16_wmt; | 851 const SadMxNFunc sad64x32_sse2 = vpx_sad64x32_sse2; |
| 961 const SadMxNFunc sad_16x8_wmt = vp8_sad16x8_wmt; | 852 const SadMxNFunc sad32x64_sse2 = vpx_sad32x64_sse2; |
| 962 const SadMxNFunc sad_8x8_wmt = vp8_sad8x8_wmt; | 853 const SadMxNFunc sad32x32_sse2 = vpx_sad32x32_sse2; |
| 963 const SadMxNFunc sad_4x4_wmt = vp8_sad4x4_wmt; | 854 const SadMxNFunc sad32x16_sse2 = vpx_sad32x16_sse2; |
| 855 const SadMxNFunc sad16x32_sse2 = vpx_sad16x32_sse2; |
| 856 const SadMxNFunc sad16x16_sse2 = vpx_sad16x16_sse2; |
| 857 const SadMxNFunc sad16x8_sse2 = vpx_sad16x8_sse2; |
| 858 const SadMxNFunc sad8x16_sse2 = vpx_sad8x16_sse2; |
| 859 const SadMxNFunc sad8x8_sse2 = vpx_sad8x8_sse2; |
| 860 const SadMxNFunc sad8x4_sse2 = vpx_sad8x4_sse2; |
| 861 #if CONFIG_VP9_HIGHBITDEPTH |
| 862 const SadMxNFunc highbd_sad64x64_sse2 = vpx_highbd_sad64x64_sse2; |
| 863 const SadMxNFunc highbd_sad64x32_sse2 = vpx_highbd_sad64x32_sse2; |
| 864 const SadMxNFunc highbd_sad32x64_sse2 = vpx_highbd_sad32x64_sse2; |
| 865 const SadMxNFunc highbd_sad32x32_sse2 = vpx_highbd_sad32x32_sse2; |
| 866 const SadMxNFunc highbd_sad32x16_sse2 = vpx_highbd_sad32x16_sse2; |
| 867 const SadMxNFunc highbd_sad16x32_sse2 = vpx_highbd_sad16x32_sse2; |
| 868 const SadMxNFunc highbd_sad16x16_sse2 = vpx_highbd_sad16x16_sse2; |
| 869 const SadMxNFunc highbd_sad16x8_sse2 = vpx_highbd_sad16x8_sse2; |
| 870 const SadMxNFunc highbd_sad8x16_sse2 = vpx_highbd_sad8x16_sse2; |
| 871 const SadMxNFunc highbd_sad8x8_sse2 = vpx_highbd_sad8x8_sse2; |
| 872 const SadMxNFunc highbd_sad8x4_sse2 = vpx_highbd_sad8x4_sse2; |
| 873 #endif // CONFIG_VP9_HIGHBITDEPTH |
| 964 const SadMxNParam sse2_tests[] = { | 874 const SadMxNParam sse2_tests[] = { |
| 965 make_tuple(16, 16, sad_16x16_wmt, -1), | 875 make_tuple(64, 64, sad64x64_sse2, -1), |
| 966 make_tuple(8, 16, sad_8x16_wmt, -1), | 876 make_tuple(64, 32, sad64x32_sse2, -1), |
| 967 make_tuple(16, 8, sad_16x8_wmt, -1), | 877 make_tuple(32, 64, sad32x64_sse2, -1), |
| 968 make_tuple(8, 8, sad_8x8_wmt, -1), | 878 make_tuple(32, 32, sad32x32_sse2, -1), |
| 969 make_tuple(4, 4, sad_4x4_wmt, -1), | 879 make_tuple(32, 16, sad32x16_sse2, -1), |
| 880 make_tuple(16, 32, sad16x32_sse2, -1), |
| 881 make_tuple(16, 16, sad16x16_sse2, -1), |
| 882 make_tuple(16, 8, sad16x8_sse2, -1), |
| 883 make_tuple(8, 16, sad8x16_sse2, -1), |
| 884 make_tuple(8, 8, sad8x8_sse2, -1), |
| 885 make_tuple(8, 4, sad8x4_sse2, -1), |
| 886 #if CONFIG_VP9_HIGHBITDEPTH |
| 887 make_tuple(64, 64, highbd_sad64x64_sse2, 8), |
| 888 make_tuple(64, 32, highbd_sad64x32_sse2, 8), |
| 889 make_tuple(32, 64, highbd_sad32x64_sse2, 8), |
| 890 make_tuple(32, 32, highbd_sad32x32_sse2, 8), |
| 891 make_tuple(32, 16, highbd_sad32x16_sse2, 8), |
| 892 make_tuple(16, 32, highbd_sad16x32_sse2, 8), |
| 893 make_tuple(16, 16, highbd_sad16x16_sse2, 8), |
| 894 make_tuple(16, 8, highbd_sad16x8_sse2, 8), |
| 895 make_tuple(8, 16, highbd_sad8x16_sse2, 8), |
| 896 make_tuple(8, 8, highbd_sad8x8_sse2, 8), |
| 897 make_tuple(8, 4, highbd_sad8x4_sse2, 8), |
| 898 make_tuple(64, 64, highbd_sad64x64_sse2, 10), |
| 899 make_tuple(64, 32, highbd_sad64x32_sse2, 10), |
| 900 make_tuple(32, 64, highbd_sad32x64_sse2, 10), |
| 901 make_tuple(32, 32, highbd_sad32x32_sse2, 10), |
| 902 make_tuple(32, 16, highbd_sad32x16_sse2, 10), |
| 903 make_tuple(16, 32, highbd_sad16x32_sse2, 10), |
| 904 make_tuple(16, 16, highbd_sad16x16_sse2, 10), |
| 905 make_tuple(16, 8, highbd_sad16x8_sse2, 10), |
| 906 make_tuple(8, 16, highbd_sad8x16_sse2, 10), |
| 907 make_tuple(8, 8, highbd_sad8x8_sse2, 10), |
| 908 make_tuple(8, 4, highbd_sad8x4_sse2, 10), |
| 909 make_tuple(64, 64, highbd_sad64x64_sse2, 12), |
| 910 make_tuple(64, 32, highbd_sad64x32_sse2, 12), |
| 911 make_tuple(32, 64, highbd_sad32x64_sse2, 12), |
| 912 make_tuple(32, 32, highbd_sad32x32_sse2, 12), |
| 913 make_tuple(32, 16, highbd_sad32x16_sse2, 12), |
| 914 make_tuple(16, 32, highbd_sad16x32_sse2, 12), |
| 915 make_tuple(16, 16, highbd_sad16x16_sse2, 12), |
| 916 make_tuple(16, 8, highbd_sad16x8_sse2, 12), |
| 917 make_tuple(8, 16, highbd_sad8x16_sse2, 12), |
| 918 make_tuple(8, 8, highbd_sad8x8_sse2, 12), |
| 919 make_tuple(8, 4, highbd_sad8x4_sse2, 12), |
| 920 #endif // CONFIG_VP9_HIGHBITDEPTH |
| 970 }; | 921 }; |
| 971 INSTANTIATE_TEST_CASE_P(SSE2, SADTest, ::testing::ValuesIn(sse2_tests)); | 922 INSTANTIATE_TEST_CASE_P(SSE2, SADTest, ::testing::ValuesIn(sse2_tests)); |
| 972 #endif // CONFIG_VP8_ENCODER | 923 |
| 973 | 924 const SadMxNAvgFunc sad64x64_avg_sse2 = vpx_sad64x64_avg_sse2; |
| 974 #if CONFIG_VP9_ENCODER | 925 const SadMxNAvgFunc sad64x32_avg_sse2 = vpx_sad64x32_avg_sse2; |
| 975 #if CONFIG_USE_X86INC | 926 const SadMxNAvgFunc sad32x64_avg_sse2 = vpx_sad32x64_avg_sse2; |
| 976 const SadMxNVp9Func sad_64x64_sse2_vp9 = vp9_sad64x64_sse2; | 927 const SadMxNAvgFunc sad32x32_avg_sse2 = vpx_sad32x32_avg_sse2; |
| 977 const SadMxNVp9Func sad_64x32_sse2_vp9 = vp9_sad64x32_sse2; | 928 const SadMxNAvgFunc sad32x16_avg_sse2 = vpx_sad32x16_avg_sse2; |
| 978 const SadMxNVp9Func sad_32x64_sse2_vp9 = vp9_sad32x64_sse2; | 929 const SadMxNAvgFunc sad16x32_avg_sse2 = vpx_sad16x32_avg_sse2; |
| 979 const SadMxNVp9Func sad_32x32_sse2_vp9 = vp9_sad32x32_sse2; | 930 const SadMxNAvgFunc sad16x16_avg_sse2 = vpx_sad16x16_avg_sse2; |
| 980 const SadMxNVp9Func sad_32x16_sse2_vp9 = vp9_sad32x16_sse2; | 931 const SadMxNAvgFunc sad16x8_avg_sse2 = vpx_sad16x8_avg_sse2; |
| 981 const SadMxNVp9Func sad_16x32_sse2_vp9 = vp9_sad16x32_sse2; | 932 const SadMxNAvgFunc sad8x16_avg_sse2 = vpx_sad8x16_avg_sse2; |
| 982 const SadMxNVp9Func sad_16x16_sse2_vp9 = vp9_sad16x16_sse2; | 933 const SadMxNAvgFunc sad8x8_avg_sse2 = vpx_sad8x8_avg_sse2; |
| 983 const SadMxNVp9Func sad_16x8_sse2_vp9 = vp9_sad16x8_sse2; | 934 const SadMxNAvgFunc sad8x4_avg_sse2 = vpx_sad8x4_avg_sse2; |
| 984 const SadMxNVp9Func sad_8x16_sse2_vp9 = vp9_sad8x16_sse2; | 935 #if CONFIG_VP9_HIGHBITDEPTH |
| 985 const SadMxNVp9Func sad_8x8_sse2_vp9 = vp9_sad8x8_sse2; | 936 const SadMxNAvgFunc highbd_sad64x64_avg_sse2 = vpx_highbd_sad64x64_avg_sse2; |
| 986 const SadMxNVp9Func sad_8x4_sse2_vp9 = vp9_sad8x4_sse2; | 937 const SadMxNAvgFunc highbd_sad64x32_avg_sse2 = vpx_highbd_sad64x32_avg_sse2; |
| 987 | 938 const SadMxNAvgFunc highbd_sad32x64_avg_sse2 = vpx_highbd_sad32x64_avg_sse2; |
| 988 const SadMxNx4Func sad_64x64x4d_sse2 = vp9_sad64x64x4d_sse2; | 939 const SadMxNAvgFunc highbd_sad32x32_avg_sse2 = vpx_highbd_sad32x32_avg_sse2; |
| 989 const SadMxNx4Func sad_64x32x4d_sse2 = vp9_sad64x32x4d_sse2; | 940 const SadMxNAvgFunc highbd_sad32x16_avg_sse2 = vpx_highbd_sad32x16_avg_sse2; |
| 990 const SadMxNx4Func sad_32x64x4d_sse2 = vp9_sad32x64x4d_sse2; | 941 const SadMxNAvgFunc highbd_sad16x32_avg_sse2 = vpx_highbd_sad16x32_avg_sse2; |
| 991 const SadMxNx4Func sad_32x32x4d_sse2 = vp9_sad32x32x4d_sse2; | 942 const SadMxNAvgFunc highbd_sad16x16_avg_sse2 = vpx_highbd_sad16x16_avg_sse2; |
| 992 const SadMxNx4Func sad_32x16x4d_sse2 = vp9_sad32x16x4d_sse2; | 943 const SadMxNAvgFunc highbd_sad16x8_avg_sse2 = vpx_highbd_sad16x8_avg_sse2; |
| 993 const SadMxNx4Func sad_16x32x4d_sse2 = vp9_sad16x32x4d_sse2; | 944 const SadMxNAvgFunc highbd_sad8x16_avg_sse2 = vpx_highbd_sad8x16_avg_sse2; |
| 994 const SadMxNx4Func sad_16x16x4d_sse2 = vp9_sad16x16x4d_sse2; | 945 const SadMxNAvgFunc highbd_sad8x8_avg_sse2 = vpx_highbd_sad8x8_avg_sse2; |
| 995 const SadMxNx4Func sad_16x8x4d_sse2 = vp9_sad16x8x4d_sse2; | 946 const SadMxNAvgFunc highbd_sad8x4_avg_sse2 = vpx_highbd_sad8x4_avg_sse2; |
| 996 const SadMxNx4Func sad_8x16x4d_sse2 = vp9_sad8x16x4d_sse2; | 947 #endif // CONFIG_VP9_HIGHBITDEPTH |
| 997 const SadMxNx4Func sad_8x8x4d_sse2 = vp9_sad8x8x4d_sse2; | 948 const SadMxNAvgParam avg_sse2_tests[] = { |
| 998 const SadMxNx4Func sad_8x4x4d_sse2 = vp9_sad8x4x4d_sse2; | 949 make_tuple(64, 64, sad64x64_avg_sse2, -1), |
| 999 | 950 make_tuple(64, 32, sad64x32_avg_sse2, -1), |
| 1000 #if CONFIG_VP9_HIGHBITDEPTH | 951 make_tuple(32, 64, sad32x64_avg_sse2, -1), |
| 1001 const SadMxNVp9Func highbd_sad8x4_sse2_vp9 = vp9_highbd_sad8x4_sse2; | 952 make_tuple(32, 32, sad32x32_avg_sse2, -1), |
| 1002 const SadMxNVp9Func highbd_sad8x8_sse2_vp9 = vp9_highbd_sad8x8_sse2; | 953 make_tuple(32, 16, sad32x16_avg_sse2, -1), |
| 1003 const SadMxNVp9Func highbd_sad8x16_sse2_vp9 = vp9_highbd_sad8x16_sse2; | 954 make_tuple(16, 32, sad16x32_avg_sse2, -1), |
| 1004 const SadMxNVp9Func highbd_sad16x8_sse2_vp9 = vp9_highbd_sad16x8_sse2; | 955 make_tuple(16, 16, sad16x16_avg_sse2, -1), |
| 1005 const SadMxNVp9Func highbd_sad16x16_sse2_vp9 = vp9_highbd_sad16x16_sse2; | 956 make_tuple(16, 8, sad16x8_avg_sse2, -1), |
| 1006 const SadMxNVp9Func highbd_sad16x32_sse2_vp9 = vp9_highbd_sad16x32_sse2; | 957 make_tuple(8, 16, sad8x16_avg_sse2, -1), |
| 1007 const SadMxNVp9Func highbd_sad32x16_sse2_vp9 = vp9_highbd_sad32x16_sse2; | 958 make_tuple(8, 8, sad8x8_avg_sse2, -1), |
| 1008 const SadMxNVp9Func highbd_sad32x32_sse2_vp9 = vp9_highbd_sad32x32_sse2; | 959 make_tuple(8, 4, sad8x4_avg_sse2, -1), |
| 1009 const SadMxNVp9Func highbd_sad32x64_sse2_vp9 = vp9_highbd_sad32x64_sse2; | 960 #if CONFIG_VP9_HIGHBITDEPTH |
| 1010 const SadMxNVp9Func highbd_sad64x32_sse2_vp9 = vp9_highbd_sad64x32_sse2; | 961 make_tuple(64, 64, highbd_sad64x64_avg_sse2, 8), |
| 1011 const SadMxNVp9Func highbd_sad64x64_sse2_vp9 = vp9_highbd_sad64x64_sse2; | 962 make_tuple(64, 32, highbd_sad64x32_avg_sse2, 8), |
| 1012 | 963 make_tuple(32, 64, highbd_sad32x64_avg_sse2, 8), |
| 1013 INSTANTIATE_TEST_CASE_P(SSE2, SADVP9Test, ::testing::Values( | 964 make_tuple(32, 32, highbd_sad32x32_avg_sse2, 8), |
| 1014 make_tuple(64, 64, sad_64x64_sse2_vp9, -1), | 965 make_tuple(32, 16, highbd_sad32x16_avg_sse2, 8), |
| 1015 make_tuple(64, 32, sad_64x32_sse2_vp9, -1), | 966 make_tuple(16, 32, highbd_sad16x32_avg_sse2, 8), |
| 1016 make_tuple(32, 64, sad_32x64_sse2_vp9, -1), | 967 make_tuple(16, 16, highbd_sad16x16_avg_sse2, 8), |
| 1017 make_tuple(32, 32, sad_32x32_sse2_vp9, -1), | 968 make_tuple(16, 8, highbd_sad16x8_avg_sse2, 8), |
| 1018 make_tuple(32, 16, sad_32x16_sse2_vp9, -1), | 969 make_tuple(8, 16, highbd_sad8x16_avg_sse2, 8), |
| 1019 make_tuple(16, 32, sad_16x32_sse2_vp9, -1), | 970 make_tuple(8, 8, highbd_sad8x8_avg_sse2, 8), |
| 1020 make_tuple(16, 16, sad_16x16_sse2_vp9, -1), | 971 make_tuple(8, 4, highbd_sad8x4_avg_sse2, 8), |
| 1021 make_tuple(16, 8, sad_16x8_sse2_vp9, -1), | 972 make_tuple(64, 64, highbd_sad64x64_avg_sse2, 10), |
| 1022 make_tuple(8, 16, sad_8x16_sse2_vp9, -1), | 973 make_tuple(64, 32, highbd_sad64x32_avg_sse2, 10), |
| 1023 make_tuple(8, 8, sad_8x8_sse2_vp9, -1), | 974 make_tuple(32, 64, highbd_sad32x64_avg_sse2, 10), |
| 1024 make_tuple(8, 4, sad_8x4_sse2_vp9, -1), | 975 make_tuple(32, 32, highbd_sad32x32_avg_sse2, 10), |
| 1025 make_tuple(8, 4, highbd_sad8x4_sse2_vp9, 8), | 976 make_tuple(32, 16, highbd_sad32x16_avg_sse2, 10), |
| 1026 make_tuple(8, 8, highbd_sad8x8_sse2_vp9, 8), | 977 make_tuple(16, 32, highbd_sad16x32_avg_sse2, 10), |
| 1027 make_tuple(8, 16, highbd_sad8x16_sse2_vp9, 8), | 978 make_tuple(16, 16, highbd_sad16x16_avg_sse2, 10), |
| 1028 make_tuple(16, 8, highbd_sad16x8_sse2_vp9, 8), | 979 make_tuple(16, 8, highbd_sad16x8_avg_sse2, 10), |
| 1029 make_tuple(16, 16, highbd_sad16x16_sse2_vp9, 8), | 980 make_tuple(8, 16, highbd_sad8x16_avg_sse2, 10), |
| 1030 make_tuple(16, 32, highbd_sad16x32_sse2_vp9, 8), | 981 make_tuple(8, 8, highbd_sad8x8_avg_sse2, 10), |
| 1031 make_tuple(32, 16, highbd_sad32x16_sse2_vp9, 8), | 982 make_tuple(8, 4, highbd_sad8x4_avg_sse2, 10), |
| 1032 make_tuple(32, 32, highbd_sad32x32_sse2_vp9, 8), | 983 make_tuple(64, 64, highbd_sad64x64_avg_sse2, 12), |
| 1033 make_tuple(32, 64, highbd_sad32x64_sse2_vp9, 8), | 984 make_tuple(64, 32, highbd_sad64x32_avg_sse2, 12), |
| 1034 make_tuple(64, 32, highbd_sad64x32_sse2_vp9, 8), | 985 make_tuple(32, 64, highbd_sad32x64_avg_sse2, 12), |
| 1035 make_tuple(64, 64, highbd_sad64x64_sse2_vp9, 8), | 986 make_tuple(32, 32, highbd_sad32x32_avg_sse2, 12), |
| 1036 make_tuple(8, 4, highbd_sad8x4_sse2_vp9, 10), | 987 make_tuple(32, 16, highbd_sad32x16_avg_sse2, 12), |
| 1037 make_tuple(8, 8, highbd_sad8x8_sse2_vp9, 10), | 988 make_tuple(16, 32, highbd_sad16x32_avg_sse2, 12), |
| 1038 make_tuple(8, 16, highbd_sad8x16_sse2_vp9, 10), | 989 make_tuple(16, 16, highbd_sad16x16_avg_sse2, 12), |
| 1039 make_tuple(16, 8, highbd_sad16x8_sse2_vp9, 10), | 990 make_tuple(16, 8, highbd_sad16x8_avg_sse2, 12), |
| 1040 make_tuple(16, 16, highbd_sad16x16_sse2_vp9, 10), | 991 make_tuple(8, 16, highbd_sad8x16_avg_sse2, 12), |
| 1041 make_tuple(16, 32, highbd_sad16x32_sse2_vp9, 10), | 992 make_tuple(8, 8, highbd_sad8x8_avg_sse2, 12), |
| 1042 make_tuple(32, 16, highbd_sad32x16_sse2_vp9, 10), | 993 make_tuple(8, 4, highbd_sad8x4_avg_sse2, 12), |
| 1043 make_tuple(32, 32, highbd_sad32x32_sse2_vp9, 10), | 994 #endif // CONFIG_VP9_HIGHBITDEPTH |
| 1044 make_tuple(32, 64, highbd_sad32x64_sse2_vp9, 10), | 995 }; |
| 1045 make_tuple(64, 32, highbd_sad64x32_sse2_vp9, 10), | 996 INSTANTIATE_TEST_CASE_P(SSE2, SADavgTest, ::testing::ValuesIn(avg_sse2_tests)); |
| 1046 make_tuple(64, 64, highbd_sad64x64_sse2_vp9, 10), | 997 |
| 1047 make_tuple(8, 4, highbd_sad8x4_sse2_vp9, 12), | 998 const SadMxNx4Func sad64x64x4d_sse2 = vpx_sad64x64x4d_sse2; |
| 1048 make_tuple(8, 8, highbd_sad8x8_sse2_vp9, 12), | 999 const SadMxNx4Func sad64x32x4d_sse2 = vpx_sad64x32x4d_sse2; |
| 1049 make_tuple(8, 16, highbd_sad8x16_sse2_vp9, 12), | 1000 const SadMxNx4Func sad32x64x4d_sse2 = vpx_sad32x64x4d_sse2; |
| 1050 make_tuple(16, 8, highbd_sad16x8_sse2_vp9, 12), | 1001 const SadMxNx4Func sad32x32x4d_sse2 = vpx_sad32x32x4d_sse2; |
| 1051 make_tuple(16, 16, highbd_sad16x16_sse2_vp9, 12), | 1002 const SadMxNx4Func sad32x16x4d_sse2 = vpx_sad32x16x4d_sse2; |
| 1052 make_tuple(16, 32, highbd_sad16x32_sse2_vp9, 12), | 1003 const SadMxNx4Func sad16x32x4d_sse2 = vpx_sad16x32x4d_sse2; |
| 1053 make_tuple(32, 16, highbd_sad32x16_sse2_vp9, 12), | 1004 const SadMxNx4Func sad16x16x4d_sse2 = vpx_sad16x16x4d_sse2; |
| 1054 make_tuple(32, 32, highbd_sad32x32_sse2_vp9, 12), | 1005 const SadMxNx4Func sad16x8x4d_sse2 = vpx_sad16x8x4d_sse2; |
| 1055 make_tuple(32, 64, highbd_sad32x64_sse2_vp9, 12), | 1006 const SadMxNx4Func sad8x16x4d_sse2 = vpx_sad8x16x4d_sse2; |
| 1056 make_tuple(64, 32, highbd_sad64x32_sse2_vp9, 12), | 1007 const SadMxNx4Func sad8x8x4d_sse2 = vpx_sad8x8x4d_sse2; |
| 1057 make_tuple(64, 64, highbd_sad64x64_sse2_vp9, 12))); | 1008 const SadMxNx4Func sad8x4x4d_sse2 = vpx_sad8x4x4d_sse2; |
| 1058 | 1009 #if CONFIG_VP9_HIGHBITDEPTH |
| 1059 const SadMxNAvgVp9Func highbd_sad8x4_avg_sse2_vp9 = vp9_highbd_sad8x4_avg_sse2; | 1010 const SadMxNx4Func highbd_sad64x64x4d_sse2 = vpx_highbd_sad64x64x4d_sse2; |
| 1060 const SadMxNAvgVp9Func highbd_sad8x8_avg_sse2_vp9 = vp9_highbd_sad8x8_avg_sse2; | 1011 const SadMxNx4Func highbd_sad64x32x4d_sse2 = vpx_highbd_sad64x32x4d_sse2; |
| 1061 const SadMxNAvgVp9Func highbd_sad8x16_avg_sse2_vp9 = | 1012 const SadMxNx4Func highbd_sad32x64x4d_sse2 = vpx_highbd_sad32x64x4d_sse2; |
| 1062 vp9_highbd_sad8x16_avg_sse2; | 1013 const SadMxNx4Func highbd_sad32x32x4d_sse2 = vpx_highbd_sad32x32x4d_sse2; |
| 1063 const SadMxNAvgVp9Func highbd_sad16x8_avg_sse2_vp9 = | 1014 const SadMxNx4Func highbd_sad32x16x4d_sse2 = vpx_highbd_sad32x16x4d_sse2; |
| 1064 vp9_highbd_sad16x8_avg_sse2; | 1015 const SadMxNx4Func highbd_sad16x32x4d_sse2 = vpx_highbd_sad16x32x4d_sse2; |
| 1065 const SadMxNAvgVp9Func highbd_sad16x16_avg_sse2_vp9 = | 1016 const SadMxNx4Func highbd_sad16x16x4d_sse2 = vpx_highbd_sad16x16x4d_sse2; |
| 1066 vp9_highbd_sad16x16_avg_sse2; | 1017 const SadMxNx4Func highbd_sad16x8x4d_sse2 = vpx_highbd_sad16x8x4d_sse2; |
| 1067 const SadMxNAvgVp9Func highbd_sad16x32_avg_sse2_vp9 = | 1018 const SadMxNx4Func highbd_sad8x16x4d_sse2 = vpx_highbd_sad8x16x4d_sse2; |
| 1068 vp9_highbd_sad16x32_avg_sse2; | 1019 const SadMxNx4Func highbd_sad8x8x4d_sse2 = vpx_highbd_sad8x8x4d_sse2; |
| 1069 const SadMxNAvgVp9Func highbd_sad32x16_avg_sse2_vp9 = | 1020 const SadMxNx4Func highbd_sad8x4x4d_sse2 = vpx_highbd_sad8x4x4d_sse2; |
| 1070 vp9_highbd_sad32x16_avg_sse2; | 1021 const SadMxNx4Func highbd_sad4x8x4d_sse2 = vpx_highbd_sad4x8x4d_sse2; |
| 1071 const SadMxNAvgVp9Func highbd_sad32x32_avg_sse2_vp9 = | 1022 const SadMxNx4Func highbd_sad4x4x4d_sse2 = vpx_highbd_sad4x4x4d_sse2; |
| 1072 vp9_highbd_sad32x32_avg_sse2; | 1023 #endif // CONFIG_VP9_HIGHBITDEPTH |
| 1073 const SadMxNAvgVp9Func highbd_sad32x64_avg_sse2_vp9 = | 1024 const SadMxNx4Param x4d_sse2_tests[] = { |
| 1074 vp9_highbd_sad32x64_avg_sse2; | 1025 make_tuple(64, 64, sad64x64x4d_sse2, -1), |
| 1075 const SadMxNAvgVp9Func highbd_sad64x32_avg_sse2_vp9 = | 1026 make_tuple(64, 32, sad64x32x4d_sse2, -1), |
| 1076 vp9_highbd_sad64x32_avg_sse2; | 1027 make_tuple(32, 64, sad32x64x4d_sse2, -1), |
| 1077 const SadMxNAvgVp9Func highbd_sad64x64_avg_sse2_vp9 = | 1028 make_tuple(32, 32, sad32x32x4d_sse2, -1), |
| 1078 vp9_highbd_sad64x64_avg_sse2; | 1029 make_tuple(32, 16, sad32x16x4d_sse2, -1), |
| 1079 | 1030 make_tuple(16, 32, sad16x32x4d_sse2, -1), |
| 1080 INSTANTIATE_TEST_CASE_P(SSE2, SADavgVP9Test, ::testing::Values( | 1031 make_tuple(16, 16, sad16x16x4d_sse2, -1), |
| 1081 make_tuple(8, 4, highbd_sad8x4_avg_sse2_vp9, 8), | 1032 make_tuple(16, 8, sad16x8x4d_sse2, -1), |
| 1082 make_tuple(8, 8, highbd_sad8x8_avg_sse2_vp9, 8), | 1033 make_tuple(8, 16, sad8x16x4d_sse2, -1), |
| 1083 make_tuple(8, 16, highbd_sad8x16_avg_sse2_vp9, 8), | 1034 make_tuple(8, 8, sad8x8x4d_sse2, -1), |
| 1084 make_tuple(16, 8, highbd_sad16x8_avg_sse2_vp9, 8), | 1035 make_tuple(8, 4, sad8x4x4d_sse2, -1), |
| 1085 make_tuple(16, 16, highbd_sad16x16_avg_sse2_vp9, 8), | 1036 #if CONFIG_VP9_HIGHBITDEPTH |
| 1086 make_tuple(16, 32, highbd_sad16x32_avg_sse2_vp9, 8), | 1037 make_tuple(64, 64, highbd_sad64x64x4d_sse2, 8), |
| 1087 make_tuple(32, 16, highbd_sad32x16_avg_sse2_vp9, 8), | 1038 make_tuple(64, 32, highbd_sad64x32x4d_sse2, 8), |
| 1088 make_tuple(32, 32, highbd_sad32x32_avg_sse2_vp9, 8), | 1039 make_tuple(32, 64, highbd_sad32x64x4d_sse2, 8), |
| 1089 make_tuple(32, 64, highbd_sad32x64_avg_sse2_vp9, 8), | 1040 make_tuple(32, 32, highbd_sad32x32x4d_sse2, 8), |
| 1090 make_tuple(64, 32, highbd_sad64x32_avg_sse2_vp9, 8), | 1041 make_tuple(32, 16, highbd_sad32x16x4d_sse2, 8), |
| 1091 make_tuple(64, 64, highbd_sad64x64_avg_sse2_vp9, 8), | 1042 make_tuple(16, 32, highbd_sad16x32x4d_sse2, 8), |
| 1092 make_tuple(8, 4, highbd_sad8x4_avg_sse2_vp9, 10), | 1043 make_tuple(16, 16, highbd_sad16x16x4d_sse2, 8), |
| 1093 make_tuple(8, 8, highbd_sad8x8_avg_sse2_vp9, 10), | 1044 make_tuple(16, 8, highbd_sad16x8x4d_sse2, 8), |
| 1094 make_tuple(8, 16, highbd_sad8x16_avg_sse2_vp9, 10), | 1045 make_tuple(8, 16, highbd_sad8x16x4d_sse2, 8), |
| 1095 make_tuple(16, 8, highbd_sad16x8_avg_sse2_vp9, 10), | 1046 make_tuple(8, 8, highbd_sad8x8x4d_sse2, 8), |
| 1096 make_tuple(16, 16, highbd_sad16x16_avg_sse2_vp9, 10), | 1047 make_tuple(8, 4, highbd_sad8x4x4d_sse2, 8), |
| 1097 make_tuple(16, 32, highbd_sad16x32_avg_sse2_vp9, 10), | 1048 make_tuple(4, 8, highbd_sad4x8x4d_sse2, 8), |
| 1098 make_tuple(32, 16, highbd_sad32x16_avg_sse2_vp9, 10), | 1049 make_tuple(4, 4, highbd_sad4x4x4d_sse2, 8), |
| 1099 make_tuple(32, 32, highbd_sad32x32_avg_sse2_vp9, 10), | 1050 make_tuple(64, 64, highbd_sad64x64x4d_sse2, 10), |
| 1100 make_tuple(32, 64, highbd_sad32x64_avg_sse2_vp9, 10), | 1051 make_tuple(64, 32, highbd_sad64x32x4d_sse2, 10), |
| 1101 make_tuple(64, 32, highbd_sad64x32_avg_sse2_vp9, 10), | 1052 make_tuple(32, 64, highbd_sad32x64x4d_sse2, 10), |
| 1102 make_tuple(64, 64, highbd_sad64x64_avg_sse2_vp9, 10), | 1053 make_tuple(32, 32, highbd_sad32x32x4d_sse2, 10), |
| 1103 make_tuple(8, 4, highbd_sad8x4_avg_sse2_vp9, 12), | 1054 make_tuple(32, 16, highbd_sad32x16x4d_sse2, 10), |
| 1104 make_tuple(8, 8, highbd_sad8x8_avg_sse2_vp9, 12), | 1055 make_tuple(16, 32, highbd_sad16x32x4d_sse2, 10), |
| 1105 make_tuple(8, 16, highbd_sad8x16_avg_sse2_vp9, 12), | 1056 make_tuple(16, 16, highbd_sad16x16x4d_sse2, 10), |
| 1106 make_tuple(16, 8, highbd_sad16x8_avg_sse2_vp9, 12), | 1057 make_tuple(16, 8, highbd_sad16x8x4d_sse2, 10), |
| 1107 make_tuple(16, 16, highbd_sad16x16_avg_sse2_vp9, 12), | 1058 make_tuple(8, 16, highbd_sad8x16x4d_sse2, 10), |
| 1108 make_tuple(16, 32, highbd_sad16x32_avg_sse2_vp9, 12), | 1059 make_tuple(8, 8, highbd_sad8x8x4d_sse2, 10), |
| 1109 make_tuple(32, 16, highbd_sad32x16_avg_sse2_vp9, 12), | 1060 make_tuple(8, 4, highbd_sad8x4x4d_sse2, 10), |
| 1110 make_tuple(32, 32, highbd_sad32x32_avg_sse2_vp9, 12), | 1061 make_tuple(4, 8, highbd_sad4x8x4d_sse2, 10), |
| 1111 make_tuple(32, 64, highbd_sad32x64_avg_sse2_vp9, 12), | 1062 make_tuple(4, 4, highbd_sad4x4x4d_sse2, 10), |
| 1112 make_tuple(64, 32, highbd_sad64x32_avg_sse2_vp9, 12), | 1063 make_tuple(64, 64, highbd_sad64x64x4d_sse2, 12), |
| 1113 make_tuple(64, 64, highbd_sad64x64_avg_sse2_vp9, 12))); | 1064 make_tuple(64, 32, highbd_sad64x32x4d_sse2, 12), |
| 1114 | 1065 make_tuple(32, 64, highbd_sad32x64x4d_sse2, 12), |
| 1115 const SadMxNx4Func highbd_sad_64x64x4d_sse2 = vp9_highbd_sad64x64x4d_sse2; | 1066 make_tuple(32, 32, highbd_sad32x32x4d_sse2, 12), |
| 1116 const SadMxNx4Func highbd_sad_64x32x4d_sse2 = vp9_highbd_sad64x32x4d_sse2; | 1067 make_tuple(32, 16, highbd_sad32x16x4d_sse2, 12), |
| 1117 const SadMxNx4Func highbd_sad_32x64x4d_sse2 = vp9_highbd_sad32x64x4d_sse2; | 1068 make_tuple(16, 32, highbd_sad16x32x4d_sse2, 12), |
| 1118 const SadMxNx4Func highbd_sad_32x32x4d_sse2 = vp9_highbd_sad32x32x4d_sse2; | 1069 make_tuple(16, 16, highbd_sad16x16x4d_sse2, 12), |
| 1119 const SadMxNx4Func highbd_sad_32x16x4d_sse2 = vp9_highbd_sad32x16x4d_sse2; | 1070 make_tuple(16, 8, highbd_sad16x8x4d_sse2, 12), |
| 1120 const SadMxNx4Func highbd_sad_16x32x4d_sse2 = vp9_highbd_sad16x32x4d_sse2; | 1071 make_tuple(8, 16, highbd_sad8x16x4d_sse2, 12), |
| 1121 const SadMxNx4Func highbd_sad_16x16x4d_sse2 = vp9_highbd_sad16x16x4d_sse2; | 1072 make_tuple(8, 8, highbd_sad8x8x4d_sse2, 12), |
| 1122 const SadMxNx4Func highbd_sad_16x8x4d_sse2 = vp9_highbd_sad16x8x4d_sse2; | 1073 make_tuple(8, 4, highbd_sad8x4x4d_sse2, 12), |
| 1123 const SadMxNx4Func highbd_sad_8x16x4d_sse2 = vp9_highbd_sad8x16x4d_sse2; | 1074 make_tuple(4, 8, highbd_sad4x8x4d_sse2, 12), |
| 1124 const SadMxNx4Func highbd_sad_8x8x4d_sse2 = vp9_highbd_sad8x8x4d_sse2; | 1075 make_tuple(4, 4, highbd_sad4x4x4d_sse2, 12), |
| 1125 const SadMxNx4Func highbd_sad_8x4x4d_sse2 = vp9_highbd_sad8x4x4d_sse2; | 1076 #endif // CONFIG_VP9_HIGHBITDEPTH |
| 1126 const SadMxNx4Func highbd_sad_4x8x4d_sse2 = vp9_highbd_sad4x8x4d_sse2; | 1077 }; |
| 1127 const SadMxNx4Func highbd_sad_4x4x4d_sse2 = vp9_highbd_sad4x4x4d_sse2; | 1078 INSTANTIATE_TEST_CASE_P(SSE2, SADx4Test, ::testing::ValuesIn(x4d_sse2_tests)); |
| 1128 | |
| 1129 INSTANTIATE_TEST_CASE_P(SSE2, SADx4Test, ::testing::Values( | |
| 1130 make_tuple(64, 64, sad_64x64x4d_sse2, -1), | |
| 1131 make_tuple(64, 32, sad_64x32x4d_sse2, -1), | |
| 1132 make_tuple(32, 64, sad_32x64x4d_sse2, -1), | |
| 1133 make_tuple(32, 32, sad_32x32x4d_sse2, -1), | |
| 1134 make_tuple(32, 16, sad_32x16x4d_sse2, -1), | |
| 1135 make_tuple(16, 32, sad_16x32x4d_sse2, -1), | |
| 1136 make_tuple(16, 16, sad_16x16x4d_sse2, -1), | |
| 1137 make_tuple(16, 8, sad_16x8x4d_sse2, -1), | |
| 1138 make_tuple(8, 16, sad_8x16x4d_sse2, -1), | |
| 1139 make_tuple(8, 8, sad_8x8x4d_sse2, -1), | |
| 1140 make_tuple(8, 4, sad_8x4x4d_sse2, -1), | |
| 1141 make_tuple(64, 64, highbd_sad_64x64x4d_sse2, 8), | |
| 1142 make_tuple(64, 32, highbd_sad_64x32x4d_sse2, 8), | |
| 1143 make_tuple(32, 64, highbd_sad_32x64x4d_sse2, 8), | |
| 1144 make_tuple(32, 32, highbd_sad_32x32x4d_sse2, 8), | |
| 1145 make_tuple(32, 16, highbd_sad_32x16x4d_sse2, 8), | |
| 1146 make_tuple(16, 32, highbd_sad_16x32x4d_sse2, 8), | |
| 1147 make_tuple(16, 16, highbd_sad_16x16x4d_sse2, 8), | |
| 1148 make_tuple(16, 8, highbd_sad_16x8x4d_sse2, 8), | |
| 1149 make_tuple(8, 16, highbd_sad_8x16x4d_sse2, 8), | |
| 1150 make_tuple(8, 8, highbd_sad_8x8x4d_sse2, 8), | |
| 1151 make_tuple(8, 4, highbd_sad_8x4x4d_sse2, 8), | |
| 1152 make_tuple(4, 8, highbd_sad_4x8x4d_sse2, 8), | |
| 1153 make_tuple(4, 4, highbd_sad_4x4x4d_sse2, 8), | |
| 1154 make_tuple(64, 64, highbd_sad_64x64x4d_sse2, 10), | |
| 1155 make_tuple(64, 32, highbd_sad_64x32x4d_sse2, 10), | |
| 1156 make_tuple(32, 64, highbd_sad_32x64x4d_sse2, 10), | |
| 1157 make_tuple(32, 32, highbd_sad_32x32x4d_sse2, 10), | |
| 1158 make_tuple(32, 16, highbd_sad_32x16x4d_sse2, 10), | |
| 1159 make_tuple(16, 32, highbd_sad_16x32x4d_sse2, 10), | |
| 1160 make_tuple(16, 16, highbd_sad_16x16x4d_sse2, 10), | |
| 1161 make_tuple(16, 8, highbd_sad_16x8x4d_sse2, 10), | |
| 1162 make_tuple(8, 16, highbd_sad_8x16x4d_sse2, 10), | |
| 1163 make_tuple(8, 8, highbd_sad_8x8x4d_sse2, 10), | |
| 1164 make_tuple(8, 4, highbd_sad_8x4x4d_sse2, 10), | |
| 1165 make_tuple(4, 8, highbd_sad_4x8x4d_sse2, 10), | |
| 1166 make_tuple(4, 4, highbd_sad_4x4x4d_sse2, 10), | |
| 1167 make_tuple(64, 64, highbd_sad_64x64x4d_sse2, 12), | |
| 1168 make_tuple(64, 32, highbd_sad_64x32x4d_sse2, 12), | |
| 1169 make_tuple(32, 64, highbd_sad_32x64x4d_sse2, 12), | |
| 1170 make_tuple(32, 32, highbd_sad_32x32x4d_sse2, 12), | |
| 1171 make_tuple(32, 16, highbd_sad_32x16x4d_sse2, 12), | |
| 1172 make_tuple(16, 32, highbd_sad_16x32x4d_sse2, 12), | |
| 1173 make_tuple(16, 16, highbd_sad_16x16x4d_sse2, 12), | |
| 1174 make_tuple(16, 8, highbd_sad_16x8x4d_sse2, 12), | |
| 1175 make_tuple(8, 16, highbd_sad_8x16x4d_sse2, 12), | |
| 1176 make_tuple(8, 8, highbd_sad_8x8x4d_sse2, 12), | |
| 1177 make_tuple(8, 4, highbd_sad_8x4x4d_sse2, 12), | |
| 1178 make_tuple(4, 8, highbd_sad_4x8x4d_sse2, 12), | |
| 1179 make_tuple(4, 4, highbd_sad_4x4x4d_sse2, 12))); | |
| 1180 #else | |
| 1181 INSTANTIATE_TEST_CASE_P(SSE2, SADVP9Test, ::testing::Values( | |
| 1182 make_tuple(64, 64, sad_64x64_sse2_vp9, -1), | |
| 1183 make_tuple(64, 32, sad_64x32_sse2_vp9, -1), | |
| 1184 make_tuple(32, 64, sad_32x64_sse2_vp9, -1), | |
| 1185 make_tuple(32, 32, sad_32x32_sse2_vp9, -1), | |
| 1186 make_tuple(32, 16, sad_32x16_sse2_vp9, -1), | |
| 1187 make_tuple(16, 32, sad_16x32_sse2_vp9, -1), | |
| 1188 make_tuple(16, 16, sad_16x16_sse2_vp9, -1), | |
| 1189 make_tuple(16, 8, sad_16x8_sse2_vp9, -1), | |
| 1190 make_tuple(8, 16, sad_8x16_sse2_vp9, -1), | |
| 1191 make_tuple(8, 8, sad_8x8_sse2_vp9, -1), | |
| 1192 make_tuple(8, 4, sad_8x4_sse2_vp9, -1))); | |
| 1193 | |
| 1194 INSTANTIATE_TEST_CASE_P(SSE2, SADx4Test, ::testing::Values( | |
| 1195 make_tuple(64, 64, sad_64x64x4d_sse2, -1), | |
| 1196 make_tuple(64, 32, sad_64x32x4d_sse2, -1), | |
| 1197 make_tuple(32, 64, sad_32x64x4d_sse2, -1), | |
| 1198 make_tuple(32, 32, sad_32x32x4d_sse2, -1), | |
| 1199 make_tuple(32, 16, sad_32x16x4d_sse2, -1), | |
| 1200 make_tuple(16, 32, sad_16x32x4d_sse2, -1), | |
| 1201 make_tuple(16, 16, sad_16x16x4d_sse2, -1), | |
| 1202 make_tuple(16, 8, sad_16x8x4d_sse2, -1), | |
| 1203 make_tuple(8, 16, sad_8x16x4d_sse2, -1), | |
| 1204 make_tuple(8, 8, sad_8x8x4d_sse2, -1), | |
| 1205 make_tuple(8, 4, sad_8x4x4d_sse2, -1))); | |
| 1206 #endif // CONFIG_VP9_HIGHBITDEPTH | |
| 1207 #endif // CONFIG_USE_X86INC | 1079 #endif // CONFIG_USE_X86INC |
| 1208 #endif // CONFIG_VP9_ENCODER | |
| 1209 #endif // HAVE_SSE2 | 1080 #endif // HAVE_SSE2 |
| 1210 | 1081 |
| 1211 #if HAVE_SSE3 | 1082 #if HAVE_SSE3 |
| 1212 #if CONFIG_VP8_ENCODER | 1083 // Only functions are x3, which do not have tests. |
| 1213 const SadMxNx4Func sad_16x16x4d_sse3 = vp8_sad16x16x4d_sse3; | |
| 1214 const SadMxNx4Func sad_16x8x4d_sse3 = vp8_sad16x8x4d_sse3; | |
| 1215 const SadMxNx4Func sad_8x16x4d_sse3 = vp8_sad8x16x4d_sse3; | |
| 1216 const SadMxNx4Func sad_8x8x4d_sse3 = vp8_sad8x8x4d_sse3; | |
| 1217 const SadMxNx4Func sad_4x4x4d_sse3 = vp8_sad4x4x4d_sse3; | |
| 1218 INSTANTIATE_TEST_CASE_P(SSE3, SADx4Test, ::testing::Values( | |
| 1219 make_tuple(16, 16, sad_16x16x4d_sse3, -1), | |
| 1220 make_tuple(16, 8, sad_16x8x4d_sse3, -1), | |
| 1221 make_tuple(8, 16, sad_8x16x4d_sse3, -1), | |
| 1222 make_tuple(8, 8, sad_8x8x4d_sse3, -1), | |
| 1223 make_tuple(4, 4, sad_4x4x4d_sse3, -1))); | |
| 1224 #endif // CONFIG_VP8_ENCODER | |
| 1225 #endif // HAVE_SSE3 | 1084 #endif // HAVE_SSE3 |
| 1226 | 1085 |
| 1227 #if HAVE_SSSE3 | 1086 #if HAVE_SSSE3 |
| 1228 #if CONFIG_USE_X86INC | 1087 // Only functions are x3, which do not have tests. |
| 1229 #if CONFIG_VP8_ENCODER | |
| 1230 const SadMxNFunc sad_16x16_sse3 = vp8_sad16x16_sse3; | |
| 1231 INSTANTIATE_TEST_CASE_P(SSE3, SADTest, ::testing::Values( | |
| 1232 make_tuple(16, 16, sad_16x16_sse3, -1))); | |
| 1233 #endif // CONFIG_VP8_ENCODER | |
| 1234 #endif // CONFIG_USE_X86INC | |
| 1235 #endif // HAVE_SSSE3 | 1088 #endif // HAVE_SSSE3 |
| 1236 | 1089 |
| 1237 #if CONFIG_VP9_ENCODER | 1090 #if HAVE_SSE4_1 |
| 1091 // Only functions are x8, which do not have tests. |
| 1092 #endif // HAVE_SSE4_1 |
| 1093 |
| 1238 #if HAVE_AVX2 | 1094 #if HAVE_AVX2 |
| 1239 const SadMxNx4Func sad_64x64x4d_avx2 = vp9_sad64x64x4d_avx2; | 1095 const SadMxNFunc sad64x64_avx2 = vpx_sad64x64_avx2; |
| 1240 const SadMxNx4Func sad_32x32x4d_avx2 = vp9_sad32x32x4d_avx2; | 1096 const SadMxNFunc sad64x32_avx2 = vpx_sad64x32_avx2; |
| 1241 INSTANTIATE_TEST_CASE_P(AVX2, SADx4Test, ::testing::Values( | 1097 const SadMxNFunc sad32x64_avx2 = vpx_sad32x64_avx2; |
| 1242 make_tuple(32, 32, sad_32x32x4d_avx2, -1), | 1098 const SadMxNFunc sad32x32_avx2 = vpx_sad32x32_avx2; |
| 1243 make_tuple(64, 64, sad_64x64x4d_avx2, -1))); | 1099 const SadMxNFunc sad32x16_avx2 = vpx_sad32x16_avx2; |
| 1100 const SadMxNParam avx2_tests[] = { |
| 1101 make_tuple(64, 64, sad64x64_avx2, -1), |
| 1102 make_tuple(64, 32, sad64x32_avx2, -1), |
| 1103 make_tuple(32, 64, sad32x64_avx2, -1), |
| 1104 make_tuple(32, 32, sad32x32_avx2, -1), |
| 1105 make_tuple(32, 16, sad32x16_avx2, -1), |
| 1106 }; |
| 1107 INSTANTIATE_TEST_CASE_P(AVX2, SADTest, ::testing::ValuesIn(avx2_tests)); |
| 1108 |
| 1109 const SadMxNAvgFunc sad64x64_avg_avx2 = vpx_sad64x64_avg_avx2; |
| 1110 const SadMxNAvgFunc sad64x32_avg_avx2 = vpx_sad64x32_avg_avx2; |
| 1111 const SadMxNAvgFunc sad32x64_avg_avx2 = vpx_sad32x64_avg_avx2; |
| 1112 const SadMxNAvgFunc sad32x32_avg_avx2 = vpx_sad32x32_avg_avx2; |
| 1113 const SadMxNAvgFunc sad32x16_avg_avx2 = vpx_sad32x16_avg_avx2; |
| 1114 const SadMxNAvgParam avg_avx2_tests[] = { |
| 1115 make_tuple(64, 64, sad64x64_avg_avx2, -1), |
| 1116 make_tuple(64, 32, sad64x32_avg_avx2, -1), |
| 1117 make_tuple(32, 64, sad32x64_avg_avx2, -1), |
| 1118 make_tuple(32, 32, sad32x32_avg_avx2, -1), |
| 1119 make_tuple(32, 16, sad32x16_avg_avx2, -1), |
| 1120 }; |
| 1121 INSTANTIATE_TEST_CASE_P(AVX2, SADavgTest, ::testing::ValuesIn(avg_avx2_tests)); |
| 1122 |
| 1123 const SadMxNx4Func sad64x64x4d_avx2 = vpx_sad64x64x4d_avx2; |
| 1124 const SadMxNx4Func sad32x32x4d_avx2 = vpx_sad32x32x4d_avx2; |
| 1125 const SadMxNx4Param x4d_avx2_tests[] = { |
| 1126 make_tuple(64, 64, sad64x64x4d_avx2, -1), |
| 1127 make_tuple(32, 32, sad32x32x4d_avx2, -1), |
| 1128 }; |
| 1129 INSTANTIATE_TEST_CASE_P(AVX2, SADx4Test, ::testing::ValuesIn(x4d_avx2_tests)); |
| 1244 #endif // HAVE_AVX2 | 1130 #endif // HAVE_AVX2 |
| 1245 | 1131 |
| 1246 #if HAVE_NEON | |
| 1247 const SadMxNx4Func sad_16x16x4d_neon = vp9_sad16x16x4d_neon; | |
| 1248 const SadMxNx4Func sad_32x32x4d_neon = vp9_sad32x32x4d_neon; | |
| 1249 const SadMxNx4Func sad_64x64x4d_neon = vp9_sad64x64x4d_neon; | |
| 1250 INSTANTIATE_TEST_CASE_P(NEON, SADx4Test, ::testing::Values( | |
| 1251 make_tuple(16, 16, sad_16x16x4d_neon, -1), | |
| 1252 make_tuple(32, 32, sad_32x32x4d_neon, -1), | |
| 1253 make_tuple(64, 64, sad_64x64x4d_neon, -1))); | |
| 1254 #endif // HAVE_NEON | |
| 1255 #endif // CONFIG_VP9_ENCODER | |
| 1256 | |
| 1257 } // namespace | 1132 } // namespace |
| OLD | NEW |