| 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 #if CONFIG_VP8_ENCODER |
| 18 #include "./vp8_rtcd.h" | 18 #include "./vp8_rtcd.h" |
| 19 #endif | 19 #endif |
| 20 #if CONFIG_VP9_ENCODER | 20 #if CONFIG_VP9_ENCODER |
| 21 #include "./vp9_rtcd.h" | 21 #include "./vp9_rtcd.h" |
| 22 #endif | 22 #endif |
| 23 #include "vpx_mem/vpx_mem.h" | 23 #include "vpx_mem/vpx_mem.h" |
| 24 | 24 |
| 25 #include "test/acm_random.h" | 25 #include "test/acm_random.h" |
| 26 #include "test/clear_system_state.h" | 26 #include "test/clear_system_state.h" |
| 27 #include "test/register_state_check.h" | 27 #include "test/register_state_check.h" |
| 28 #include "test/util.h" | 28 #include "test/util.h" |
| 29 #include "third_party/googletest/src/include/gtest/gtest.h" | 29 #include "third_party/googletest/src/include/gtest/gtest.h" |
| 30 #include "vpx/vpx_codec.h" |
| 30 | 31 |
| 31 | 32 |
| 32 #if CONFIG_VP8_ENCODER | 33 #if CONFIG_VP8_ENCODER |
| 33 typedef unsigned int (*SadMxNFunc)(const unsigned char *source_ptr, | 34 typedef unsigned int (*SadMxNFunc)(const unsigned char *source_ptr, |
| 34 int source_stride, | 35 int source_stride, |
| 35 const unsigned char *reference_ptr, | 36 const unsigned char *reference_ptr, |
| 36 int reference_stride, | 37 int reference_stride, |
| 37 unsigned int max_sad); | 38 unsigned int max_sad); |
| 38 typedef std::tr1::tuple<int, int, SadMxNFunc> SadMxNParam; | 39 typedef std::tr1::tuple<int, int, SadMxNFunc, int> SadMxNParam; |
| 39 #endif | 40 #endif |
| 40 #if CONFIG_VP9_ENCODER | 41 #if CONFIG_VP9_ENCODER |
| 41 typedef unsigned int (*SadMxNVp9Func)(const unsigned char *source_ptr, | 42 typedef unsigned int (*SadMxNVp9Func)(const unsigned char *source_ptr, |
| 42 int source_stride, | 43 int source_stride, |
| 43 const unsigned char *reference_ptr, | 44 const unsigned char *reference_ptr, |
| 44 int reference_stride); | 45 int reference_stride); |
| 45 typedef std::tr1::tuple<int, int, SadMxNVp9Func> SadMxNVp9Param; | 46 typedef std::tr1::tuple<int, int, SadMxNVp9Func, int> SadMxNVp9Param; |
| 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; |
| 46 #endif | 53 #endif |
| 47 | 54 |
| 48 typedef void (*SadMxNx4Func)(const uint8_t *src_ptr, | 55 typedef void (*SadMxNx4Func)(const uint8_t *src_ptr, |
| 49 int src_stride, | 56 int src_stride, |
| 50 const unsigned char *const ref_ptr[], | 57 const uint8_t *const ref_ptr[], |
| 51 int ref_stride, | 58 int ref_stride, |
| 52 unsigned int *sad_array); | 59 uint32_t *sad_array); |
| 53 typedef std::tr1::tuple<int, int, SadMxNx4Func> SadMxNx4Param; | 60 typedef std::tr1::tuple<int, int, SadMxNx4Func, int> SadMxNx4Param; |
| 54 | 61 |
| 55 using libvpx_test::ACMRandom; | 62 using libvpx_test::ACMRandom; |
| 56 | 63 |
| 57 namespace { | 64 namespace { |
| 58 class SADTestBase : public ::testing::Test { | 65 class SADTestBase : public ::testing::Test { |
| 59 public: | 66 public: |
| 60 SADTestBase(int width, int height) : width_(width), height_(height) {} | 67 SADTestBase(int width, int height, int bit_depth) : |
| 68 width_(width), height_(height), bd_(bit_depth) {} |
| 61 | 69 |
| 62 static void SetUpTestCase() { | 70 static void SetUpTestCase() { |
| 71 #if CONFIG_VP9_HIGHBITDEPTH |
| 72 source_data8_ = reinterpret_cast<uint8_t*>( |
| 73 vpx_memalign(kDataAlignment, kDataBlockSize)); |
| 74 reference_data8_ = reinterpret_cast<uint8_t*>( |
| 75 vpx_memalign(kDataAlignment, kDataBufferSize)); |
| 76 second_pred8_ = reinterpret_cast<uint8_t*>( |
| 77 vpx_memalign(kDataAlignment, 64*64)); |
| 78 source_data16_ = reinterpret_cast<uint16_t*>( |
| 79 vpx_memalign(kDataAlignment, kDataBlockSize*sizeof(uint16_t))); |
| 80 reference_data16_ = reinterpret_cast<uint16_t*>( |
| 81 vpx_memalign(kDataAlignment, kDataBufferSize*sizeof(uint16_t))); |
| 82 second_pred16_ = reinterpret_cast<uint16_t*>( |
| 83 vpx_memalign(kDataAlignment, 64*64*sizeof(uint16_t))); |
| 84 #else |
| 63 source_data_ = reinterpret_cast<uint8_t*>( | 85 source_data_ = reinterpret_cast<uint8_t*>( |
| 64 vpx_memalign(kDataAlignment, kDataBlockSize)); | 86 vpx_memalign(kDataAlignment, kDataBlockSize)); |
| 65 reference_data_ = reinterpret_cast<uint8_t*>( | 87 reference_data_ = reinterpret_cast<uint8_t*>( |
| 66 vpx_memalign(kDataAlignment, kDataBufferSize)); | 88 vpx_memalign(kDataAlignment, kDataBufferSize)); |
| 89 second_pred_ = reinterpret_cast<uint8_t*>( |
| 90 vpx_memalign(kDataAlignment, 64*64)); |
| 91 #endif |
| 67 } | 92 } |
| 68 | 93 |
| 69 static void TearDownTestCase() { | 94 static void TearDownTestCase() { |
| 95 #if CONFIG_VP9_HIGHBITDEPTH |
| 96 vpx_free(source_data8_); |
| 97 source_data8_ = NULL; |
| 98 vpx_free(reference_data8_); |
| 99 reference_data8_ = NULL; |
| 100 vpx_free(second_pred8_); |
| 101 second_pred8_ = NULL; |
| 102 vpx_free(source_data16_); |
| 103 source_data16_ = NULL; |
| 104 vpx_free(reference_data16_); |
| 105 reference_data16_ = NULL; |
| 106 vpx_free(second_pred16_); |
| 107 second_pred16_ = NULL; |
| 108 #else |
| 70 vpx_free(source_data_); | 109 vpx_free(source_data_); |
| 71 source_data_ = NULL; | 110 source_data_ = NULL; |
| 72 vpx_free(reference_data_); | 111 vpx_free(reference_data_); |
| 73 reference_data_ = NULL; | 112 reference_data_ = NULL; |
| 113 vpx_free(second_pred_); |
| 114 second_pred_ = NULL; |
| 115 #endif |
| 74 } | 116 } |
| 75 | 117 |
| 76 virtual void TearDown() { | 118 virtual void TearDown() { |
| 77 libvpx_test::ClearSystemState(); | 119 libvpx_test::ClearSystemState(); |
| 78 } | 120 } |
| 79 | 121 |
| 80 protected: | 122 protected: |
| 81 // Handle blocks up to 4 blocks 64x64 with stride up to 128 | 123 // Handle blocks up to 4 blocks 64x64 with stride up to 128 |
| 82 static const int kDataAlignment = 16; | 124 static const int kDataAlignment = 16; |
| 83 static const int kDataBlockSize = 64 * 128; | 125 static const int kDataBlockSize = 64 * 128; |
| 84 static const int kDataBufferSize = 4 * kDataBlockSize; | 126 static const int kDataBufferSize = 4 * kDataBlockSize; |
| 85 | 127 |
| 86 virtual void SetUp() { | 128 virtual void SetUp() { |
| 129 #if CONFIG_VP9_HIGHBITDEPTH |
| 130 if (bd_ == -1) { |
| 131 use_high_bit_depth_ = false; |
| 132 bit_depth_ = VPX_BITS_8; |
| 133 source_data_ = source_data8_; |
| 134 reference_data_ = reference_data8_; |
| 135 second_pred_ = second_pred8_; |
| 136 } else { |
| 137 use_high_bit_depth_ = true; |
| 138 bit_depth_ = static_cast<vpx_bit_depth_t>(bd_); |
| 139 source_data_ = CONVERT_TO_BYTEPTR(source_data16_); |
| 140 reference_data_ = CONVERT_TO_BYTEPTR(reference_data16_); |
| 141 second_pred_ = CONVERT_TO_BYTEPTR(second_pred16_); |
| 142 } |
| 143 #endif |
| 144 mask_ = (1 << bit_depth_) - 1; |
| 87 source_stride_ = (width_ + 31) & ~31; | 145 source_stride_ = (width_ + 31) & ~31; |
| 88 reference_stride_ = width_ * 2; | 146 reference_stride_ = width_ * 2; |
| 89 rnd_.Reset(ACMRandom::DeterministicSeed()); | 147 rnd_.Reset(ACMRandom::DeterministicSeed()); |
| 90 } | 148 } |
| 91 | 149 |
| 92 virtual uint8_t* GetReference(int block_idx) { | 150 virtual uint8_t *GetReference(int block_idx) { |
| 151 #if CONFIG_VP9_HIGHBITDEPTH |
| 152 if (!use_high_bit_depth_) { |
| 153 return reference_data_ + block_idx * kDataBlockSize; |
| 154 } else { |
| 155 return CONVERT_TO_BYTEPTR(CONVERT_TO_SHORTPTR(reference_data_) + |
| 156 block_idx * kDataBlockSize); |
| 157 } |
| 158 #else |
| 93 return reference_data_ + block_idx * kDataBlockSize; | 159 return reference_data_ + block_idx * kDataBlockSize; |
| 160 #endif |
| 94 } | 161 } |
| 95 | 162 |
| 96 // Sum of Absolute Differences. Given two blocks, calculate the absolute | 163 // Sum of Absolute Differences. Given two blocks, calculate the absolute |
| 97 // difference between two pixels in the same relative location; accumulate. | 164 // difference between two pixels in the same relative location; accumulate. |
| 98 unsigned int ReferenceSAD(unsigned int max_sad, int block_idx) { | 165 unsigned int ReferenceSAD(unsigned int max_sad, int block_idx) { |
| 99 unsigned int sad = 0; | 166 unsigned int sad = 0; |
| 100 const uint8_t* const reference = GetReference(block_idx); | 167 #if CONFIG_VP9_HIGHBITDEPTH |
| 101 | 168 const uint8_t *const reference8 = GetReference(block_idx); |
| 169 const uint8_t *const source8 = source_data_; |
| 170 const uint16_t *const reference16 = |
| 171 CONVERT_TO_SHORTPTR(GetReference(block_idx)); |
| 172 const uint16_t *const source16 = CONVERT_TO_SHORTPTR(source_data_); |
| 173 #else |
| 174 const uint8_t *const reference = GetReference(block_idx); |
| 175 const uint8_t *const source = source_data_; |
| 176 #endif |
| 102 for (int h = 0; h < height_; ++h) { | 177 for (int h = 0; h < height_; ++h) { |
| 103 for (int w = 0; w < width_; ++w) { | 178 for (int w = 0; w < width_; ++w) { |
| 104 sad += abs(source_data_[h * source_stride_ + w] | 179 #if CONFIG_VP9_HIGHBITDEPTH |
| 105 - reference[h * reference_stride_ + w]); | 180 if (!use_high_bit_depth_) { |
| 181 sad += |
| 182 abs(source8[h * source_stride_ + w] - |
| 183 reference8[h * reference_stride_ + w]); |
| 184 } else { |
| 185 sad += |
| 186 abs(source16[h * source_stride_ + w] - |
| 187 reference16[h * reference_stride_ + w]); |
| 188 } |
| 189 #else |
| 190 sad += |
| 191 abs(source[h * source_stride_ + w] - |
| 192 reference[h * reference_stride_ + w]); |
| 193 #endif |
| 106 } | 194 } |
| 107 if (sad > max_sad) { | 195 if (sad > max_sad) { |
| 108 break; | 196 break; |
| 197 } |
| 198 } |
| 199 return sad; |
| 200 } |
| 201 |
| 202 // Sum of Absolute Differences Average. Given two blocks, and a prediction |
| 203 // calculate the absolute difference between one pixel and average of the |
| 204 // corresponding and predicted pixels; accumulate. |
| 205 unsigned int ReferenceSADavg(unsigned int max_sad, int block_idx) { |
| 206 unsigned int sad = 0; |
| 207 #if CONFIG_VP9_HIGHBITDEPTH |
| 208 const uint8_t *const reference8 = GetReference(block_idx); |
| 209 const uint8_t *const source8 = source_data_; |
| 210 const uint8_t *const second_pred8 = second_pred_; |
| 211 const uint16_t *const reference16 = |
| 212 CONVERT_TO_SHORTPTR(GetReference(block_idx)); |
| 213 const uint16_t *const source16 = CONVERT_TO_SHORTPTR(source_data_); |
| 214 const uint16_t *const second_pred16 = CONVERT_TO_SHORTPTR(second_pred_); |
| 215 #else |
| 216 const uint8_t *const reference = GetReference(block_idx); |
| 217 const uint8_t *const source = source_data_; |
| 218 const uint8_t *const second_pred = second_pred_; |
| 219 #endif |
| 220 for (int h = 0; h < height_; ++h) { |
| 221 for (int w = 0; w < width_; ++w) { |
| 222 #if CONFIG_VP9_HIGHBITDEPTH |
| 223 if (!use_high_bit_depth_) { |
| 224 const int tmp = second_pred8[h * width_ + w] + |
| 225 reference8[h * reference_stride_ + w]; |
| 226 const uint8_t comp_pred = ROUND_POWER_OF_TWO(tmp, 1); |
| 227 sad += abs(source8[h * source_stride_ + w] - comp_pred); |
| 228 } else { |
| 229 const int tmp = second_pred16[h * width_ + w] + |
| 230 reference16[h * reference_stride_ + w]; |
| 231 const uint16_t comp_pred = ROUND_POWER_OF_TWO(tmp, 1); |
| 232 sad += abs(source16[h * source_stride_ + w] - comp_pred); |
| 233 } |
| 234 #else |
| 235 const int tmp = second_pred[h * width_ + w] + |
| 236 reference[h * reference_stride_ + w]; |
| 237 const uint8_t comp_pred = (tmp + 1) >> 1; |
| 238 sad += abs(source[h * source_stride_ + w] - comp_pred); |
| 239 #endif |
| 240 } |
| 241 if (sad > max_sad) { |
| 242 break; |
| 109 } | 243 } |
| 110 } | 244 } |
| 111 return sad; | 245 return sad; |
| 112 } | 246 } |
| 113 | 247 |
| 114 void FillConstant(uint8_t *data, int stride, uint8_t fill_constant) { | 248 void FillConstant(uint8_t *data, int stride, uint16_t fill_constant) { |
| 249 #if CONFIG_VP9_HIGHBITDEPTH |
| 250 uint8_t *data8 = data; |
| 251 uint16_t *data16 = CONVERT_TO_SHORTPTR(data); |
| 252 #endif |
| 115 for (int h = 0; h < height_; ++h) { | 253 for (int h = 0; h < height_; ++h) { |
| 116 for (int w = 0; w < width_; ++w) { | 254 for (int w = 0; w < width_; ++w) { |
| 117 data[h * stride + w] = fill_constant; | 255 #if CONFIG_VP9_HIGHBITDEPTH |
| 256 if (!use_high_bit_depth_) { |
| 257 data8[h * stride + w] = static_cast<uint8_t>(fill_constant); |
| 258 } else { |
| 259 data16[h * stride + w] = fill_constant; |
| 260 } |
| 261 #else |
| 262 data[h * stride + w] = static_cast<uint8_t>(fill_constant); |
| 263 #endif |
| 118 } | 264 } |
| 119 } | 265 } |
| 120 } | 266 } |
| 121 | 267 |
| 122 void FillRandom(uint8_t *data, int stride) { | 268 void FillRandom(uint8_t *data, int stride) { |
| 269 #if CONFIG_VP9_HIGHBITDEPTH |
| 270 uint8_t *data8 = data; |
| 271 uint16_t *data16 = CONVERT_TO_SHORTPTR(data); |
| 272 #endif |
| 123 for (int h = 0; h < height_; ++h) { | 273 for (int h = 0; h < height_; ++h) { |
| 124 for (int w = 0; w < width_; ++w) { | 274 for (int w = 0; w < width_; ++w) { |
| 275 #if CONFIG_VP9_HIGHBITDEPTH |
| 276 if (!use_high_bit_depth_) { |
| 277 data8[h * stride + w] = rnd_.Rand8(); |
| 278 } else { |
| 279 data16[h * stride + w] = rnd_.Rand16() & mask_; |
| 280 } |
| 281 #else |
| 125 data[h * stride + w] = rnd_.Rand8(); | 282 data[h * stride + w] = rnd_.Rand8(); |
| 283 #endif |
| 126 } | 284 } |
| 127 } | 285 } |
| 128 } | 286 } |
| 129 | 287 |
| 130 int width_, height_; | 288 int width_, height_, mask_, bd_; |
| 131 static uint8_t* source_data_; | 289 vpx_bit_depth_t bit_depth_; |
| 290 static uint8_t *source_data_; |
| 291 static uint8_t *reference_data_; |
| 292 static uint8_t *second_pred_; |
| 132 int source_stride_; | 293 int source_stride_; |
| 133 static uint8_t* reference_data_; | 294 #if CONFIG_VP9_HIGHBITDEPTH |
| 295 bool use_high_bit_depth_; |
| 296 static uint8_t *source_data8_; |
| 297 static uint8_t *reference_data8_; |
| 298 static uint8_t *second_pred8_; |
| 299 static uint16_t *source_data16_; |
| 300 static uint16_t *reference_data16_; |
| 301 static uint16_t *second_pred16_; |
| 302 #endif |
| 134 int reference_stride_; | 303 int reference_stride_; |
| 135 | 304 |
| 136 ACMRandom rnd_; | 305 ACMRandom rnd_; |
| 137 }; | 306 }; |
| 138 | 307 |
| 139 class SADx4Test | 308 class SADx4Test |
| 140 : public SADTestBase, | 309 : public SADTestBase, |
| 141 public ::testing::WithParamInterface<SadMxNx4Param> { | 310 public ::testing::WithParamInterface<SadMxNx4Param> { |
| 142 public: | 311 public: |
| 143 SADx4Test() : SADTestBase(GET_PARAM(0), GET_PARAM(1)) {} | 312 SADx4Test() : SADTestBase(GET_PARAM(0), GET_PARAM(1), GET_PARAM(3)) {} |
| 144 | 313 |
| 145 protected: | 314 protected: |
| 146 void SADs(unsigned int *results) { | 315 void SADs(unsigned int *results) { |
| 147 const uint8_t* refs[] = {GetReference(0), GetReference(1), | 316 const uint8_t *refs[] = {GetReference(0), GetReference(1), |
| 148 GetReference(2), GetReference(3)}; | 317 GetReference(2), GetReference(3)}; |
| 149 | 318 |
| 150 ASM_REGISTER_STATE_CHECK(GET_PARAM(2)(source_data_, source_stride_, | 319 ASM_REGISTER_STATE_CHECK(GET_PARAM(2)(source_data_, source_stride_, |
| 151 refs, reference_stride_, | 320 refs, reference_stride_, |
| 152 results)); | 321 results)); |
| 153 } | 322 } |
| 154 | 323 |
| 155 void CheckSADs() { | 324 void CheckSADs() { |
| 156 unsigned int reference_sad, exp_sad[4]; | 325 unsigned int reference_sad, exp_sad[4]; |
| 157 | 326 |
| 158 SADs(exp_sad); | 327 SADs(exp_sad); |
| 159 for (int block = 0; block < 4; ++block) { | 328 for (int block = 0; block < 4; ++block) { |
| 160 reference_sad = ReferenceSAD(UINT_MAX, block); | 329 reference_sad = ReferenceSAD(UINT_MAX, block); |
| 161 | 330 |
| 162 EXPECT_EQ(reference_sad, exp_sad[block]) << "block " << block; | 331 EXPECT_EQ(reference_sad, exp_sad[block]) << "block " << block; |
| 163 } | 332 } |
| 164 } | 333 } |
| 165 }; | 334 }; |
| 166 | 335 |
| 167 #if CONFIG_VP8_ENCODER | 336 #if CONFIG_VP8_ENCODER |
| 168 class SADTest | 337 class SADTest |
| 169 : public SADTestBase, | 338 : public SADTestBase, |
| 170 public ::testing::WithParamInterface<SadMxNParam> { | 339 public ::testing::WithParamInterface<SadMxNParam> { |
| 171 public: | 340 public: |
| 172 SADTest() : SADTestBase(GET_PARAM(0), GET_PARAM(1)) {} | 341 SADTest() : SADTestBase(GET_PARAM(0), GET_PARAM(1), GET_PARAM(3)) {} |
| 173 | 342 |
| 174 protected: | 343 protected: |
| 175 unsigned int SAD(unsigned int max_sad, int block_idx) { | 344 unsigned int SAD(unsigned int max_sad, int block_idx) { |
| 176 unsigned int ret; | 345 unsigned int ret; |
| 177 const uint8_t* const reference = GetReference(block_idx); | 346 const uint8_t *const reference = GetReference(block_idx); |
| 178 | 347 |
| 179 ASM_REGISTER_STATE_CHECK(ret = GET_PARAM(2)(source_data_, source_stride_, | 348 ASM_REGISTER_STATE_CHECK(ret = GET_PARAM(2)(source_data_, source_stride_, |
| 180 reference, reference_stride_, | 349 reference, reference_stride_, |
| 181 max_sad)); | 350 max_sad)); |
| 182 return ret; | 351 return ret; |
| 183 } | 352 } |
| 184 | 353 |
| 185 void CheckSAD(unsigned int max_sad) { | 354 void CheckSAD(unsigned int max_sad) { |
| 186 const unsigned int reference_sad = ReferenceSAD(max_sad, 0); | 355 const unsigned int reference_sad = ReferenceSAD(max_sad, 0); |
| 187 const unsigned int exp_sad = SAD(max_sad, 0); | 356 const unsigned int exp_sad = SAD(max_sad, 0); |
| 188 | 357 |
| 189 if (reference_sad <= max_sad) { | 358 if (reference_sad <= max_sad) { |
| 190 ASSERT_EQ(exp_sad, reference_sad); | 359 ASSERT_EQ(exp_sad, reference_sad); |
| 191 } else { | 360 } else { |
| 192 // Alternative implementations are not required to check max_sad | 361 // Alternative implementations are not required to check max_sad |
| 193 ASSERT_GE(exp_sad, reference_sad); | 362 ASSERT_GE(exp_sad, reference_sad); |
| 194 } | 363 } |
| 195 } | 364 } |
| 196 }; | 365 }; |
| 197 #endif // CONFIG_VP8_ENCODER | 366 #endif // CONFIG_VP8_ENCODER |
| 198 | 367 |
| 199 #if CONFIG_VP9_ENCODER | 368 #if CONFIG_VP9_ENCODER |
| 200 class SADVP9Test | 369 class SADVP9Test |
| 201 : public SADTestBase, | 370 : public SADTestBase, |
| 202 public ::testing::WithParamInterface<SadMxNVp9Param> { | 371 public ::testing::WithParamInterface<SadMxNVp9Param> { |
| 203 public: | 372 public: |
| 204 SADVP9Test() : SADTestBase(GET_PARAM(0), GET_PARAM(1)) {} | 373 SADVP9Test() : SADTestBase(GET_PARAM(0), GET_PARAM(1), GET_PARAM(3)) {} |
| 205 | 374 |
| 206 protected: | 375 protected: |
| 207 unsigned int SAD(int block_idx) { | 376 unsigned int SAD(int block_idx) { |
| 208 unsigned int ret; | 377 unsigned int ret; |
| 209 const uint8_t* const reference = GetReference(block_idx); | 378 const uint8_t *const reference = GetReference(block_idx); |
| 210 | 379 |
| 211 ASM_REGISTER_STATE_CHECK(ret = GET_PARAM(2)(source_data_, source_stride_, | 380 ASM_REGISTER_STATE_CHECK(ret = GET_PARAM(2)(source_data_, source_stride_, |
| 212 reference, reference_stride_)); | 381 reference, reference_stride_)); |
| 213 return ret; | 382 return ret; |
| 214 } | 383 } |
| 215 | 384 |
| 216 void CheckSAD() { | 385 void CheckSAD() { |
| 217 const unsigned int reference_sad = ReferenceSAD(UINT_MAX, 0); | 386 const unsigned int reference_sad = ReferenceSAD(UINT_MAX, 0); |
| 218 const unsigned int exp_sad = SAD(0); | 387 const unsigned int exp_sad = SAD(0); |
| 219 | 388 |
| 220 ASSERT_EQ(reference_sad, exp_sad); | 389 ASSERT_EQ(reference_sad, exp_sad); |
| 221 } | 390 } |
| 222 }; | 391 }; |
| 392 |
| 393 class SADavgVP9Test |
| 394 : public SADTestBase, |
| 395 public ::testing::WithParamInterface<SadMxNAvgVp9Param> { |
| 396 public: |
| 397 SADavgVP9Test() : SADTestBase(GET_PARAM(0), GET_PARAM(1), GET_PARAM(3)) {} |
| 398 |
| 399 protected: |
| 400 unsigned int SAD_avg(int block_idx) { |
| 401 unsigned int ret; |
| 402 const uint8_t *const reference = GetReference(block_idx); |
| 403 |
| 404 ASM_REGISTER_STATE_CHECK(ret = GET_PARAM(2)(source_data_, source_stride_, |
| 405 reference, reference_stride_, |
| 406 second_pred_)); |
| 407 return ret; |
| 408 } |
| 409 |
| 410 void CheckSAD() { |
| 411 const unsigned int reference_sad = ReferenceSADavg(UINT_MAX, 0); |
| 412 const unsigned int exp_sad = SAD_avg(0); |
| 413 |
| 414 ASSERT_EQ(reference_sad, exp_sad); |
| 415 } |
| 416 }; |
| 223 #endif // CONFIG_VP9_ENCODER | 417 #endif // CONFIG_VP9_ENCODER |
| 224 | 418 |
| 225 uint8_t* SADTestBase::source_data_ = NULL; | 419 uint8_t *SADTestBase::source_data_ = NULL; |
| 226 uint8_t* SADTestBase::reference_data_ = NULL; | 420 uint8_t *SADTestBase::reference_data_ = NULL; |
| 421 uint8_t *SADTestBase::second_pred_ = NULL; |
| 422 #if CONFIG_VP9_ENCODER && CONFIG_VP9_HIGHBITDEPTH |
| 423 uint8_t *SADTestBase::source_data8_ = NULL; |
| 424 uint8_t *SADTestBase::reference_data8_ = NULL; |
| 425 uint8_t *SADTestBase::second_pred8_ = NULL; |
| 426 uint16_t *SADTestBase::source_data16_ = NULL; |
| 427 uint16_t *SADTestBase::reference_data16_ = NULL; |
| 428 uint16_t *SADTestBase::second_pred16_ = NULL; |
| 429 #endif |
| 227 | 430 |
| 228 #if CONFIG_VP8_ENCODER | 431 #if CONFIG_VP8_ENCODER |
| 229 TEST_P(SADTest, MaxRef) { | 432 TEST_P(SADTest, MaxRef) { |
| 230 FillConstant(source_data_, source_stride_, 0); | 433 FillConstant(source_data_, source_stride_, 0); |
| 231 FillConstant(reference_data_, reference_stride_, 255); | 434 FillConstant(reference_data_, reference_stride_, mask_); |
| 232 CheckSAD(UINT_MAX); | 435 CheckSAD(UINT_MAX); |
| 233 } | 436 } |
| 234 | 437 |
| 235 TEST_P(SADTest, MaxSrc) { | 438 TEST_P(SADTest, MaxSrc) { |
| 236 FillConstant(source_data_, source_stride_, 255); | 439 FillConstant(source_data_, source_stride_, mask_); |
| 237 FillConstant(reference_data_, reference_stride_, 0); | 440 FillConstant(reference_data_, reference_stride_, 0); |
| 238 CheckSAD(UINT_MAX); | 441 CheckSAD(UINT_MAX); |
| 239 } | 442 } |
| 240 | 443 |
| 241 TEST_P(SADTest, ShortRef) { | 444 TEST_P(SADTest, ShortRef) { |
| 242 int tmp_stride = reference_stride_; | 445 int tmp_stride = reference_stride_; |
| 243 reference_stride_ >>= 1; | 446 reference_stride_ >>= 1; |
| 244 FillRandom(source_data_, source_stride_); | 447 FillRandom(source_data_, source_stride_); |
| 245 FillRandom(reference_data_, reference_stride_); | 448 FillRandom(reference_data_, reference_stride_); |
| 246 CheckSAD(UINT_MAX); | 449 CheckSAD(UINT_MAX); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 263 source_stride_ >>= 1; | 466 source_stride_ >>= 1; |
| 264 FillRandom(source_data_, source_stride_); | 467 FillRandom(source_data_, source_stride_); |
| 265 FillRandom(reference_data_, reference_stride_); | 468 FillRandom(reference_data_, reference_stride_); |
| 266 CheckSAD(UINT_MAX); | 469 CheckSAD(UINT_MAX); |
| 267 source_stride_ = tmp_stride; | 470 source_stride_ = tmp_stride; |
| 268 } | 471 } |
| 269 | 472 |
| 270 TEST_P(SADTest, MaxSAD) { | 473 TEST_P(SADTest, MaxSAD) { |
| 271 // Verify that, when max_sad is set, the implementation does not return a | 474 // Verify that, when max_sad is set, the implementation does not return a |
| 272 // value lower than the reference. | 475 // value lower than the reference. |
| 273 FillConstant(source_data_, source_stride_, 255); | 476 FillConstant(source_data_, source_stride_, mask_); |
| 274 FillConstant(reference_data_, reference_stride_, 0); | 477 FillConstant(reference_data_, reference_stride_, 0); |
| 275 CheckSAD(128); | 478 CheckSAD(128); |
| 276 } | 479 } |
| 277 #endif // CONFIG_VP8_ENCODER | 480 #endif // CONFIG_VP8_ENCODER |
| 278 | 481 |
| 279 #if CONFIG_VP9_ENCODER | 482 #if CONFIG_VP9_ENCODER |
| 280 TEST_P(SADVP9Test, MaxRef) { | 483 TEST_P(SADVP9Test, MaxRef) { |
| 281 FillConstant(source_data_, source_stride_, 0); | 484 FillConstant(source_data_, source_stride_, 0); |
| 282 FillConstant(reference_data_, reference_stride_, 255); | 485 FillConstant(reference_data_, reference_stride_, mask_); |
| 283 CheckSAD(); | 486 CheckSAD(); |
| 284 } | 487 } |
| 285 | 488 |
| 286 TEST_P(SADVP9Test, MaxSrc) { | 489 TEST_P(SADVP9Test, MaxSrc) { |
| 287 FillConstant(source_data_, source_stride_, 255); | 490 FillConstant(source_data_, source_stride_, mask_); |
| 288 FillConstant(reference_data_, reference_stride_, 0); | 491 FillConstant(reference_data_, reference_stride_, 0); |
| 289 CheckSAD(); | 492 CheckSAD(); |
| 290 } | 493 } |
| 291 | 494 |
| 292 TEST_P(SADVP9Test, ShortRef) { | 495 TEST_P(SADVP9Test, ShortRef) { |
| 293 const int tmp_stride = reference_stride_; | 496 const int tmp_stride = reference_stride_; |
| 294 reference_stride_ >>= 1; | 497 reference_stride_ >>= 1; |
| 295 FillRandom(source_data_, source_stride_); | 498 FillRandom(source_data_, source_stride_); |
| 296 FillRandom(reference_data_, reference_stride_); | 499 FillRandom(reference_data_, reference_stride_); |
| 297 CheckSAD(); | 500 CheckSAD(); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 310 } | 513 } |
| 311 | 514 |
| 312 TEST_P(SADVP9Test, ShortSrc) { | 515 TEST_P(SADVP9Test, ShortSrc) { |
| 313 const int tmp_stride = source_stride_; | 516 const int tmp_stride = source_stride_; |
| 314 source_stride_ >>= 1; | 517 source_stride_ >>= 1; |
| 315 FillRandom(source_data_, source_stride_); | 518 FillRandom(source_data_, source_stride_); |
| 316 FillRandom(reference_data_, reference_stride_); | 519 FillRandom(reference_data_, reference_stride_); |
| 317 CheckSAD(); | 520 CheckSAD(); |
| 318 source_stride_ = tmp_stride; | 521 source_stride_ = tmp_stride; |
| 319 } | 522 } |
| 523 |
| 524 TEST_P(SADavgVP9Test, MaxRef) { |
| 525 FillConstant(source_data_, source_stride_, 0); |
| 526 FillConstant(reference_data_, reference_stride_, mask_); |
| 527 FillConstant(second_pred_, width_, 0); |
| 528 CheckSAD(); |
| 529 } |
| 530 TEST_P(SADavgVP9Test, MaxSrc) { |
| 531 FillConstant(source_data_, source_stride_, mask_); |
| 532 FillConstant(reference_data_, reference_stride_, 0); |
| 533 FillConstant(second_pred_, width_, 0); |
| 534 CheckSAD(); |
| 535 } |
| 536 |
| 537 TEST_P(SADavgVP9Test, ShortRef) { |
| 538 const int tmp_stride = reference_stride_; |
| 539 reference_stride_ >>= 1; |
| 540 FillRandom(source_data_, source_stride_); |
| 541 FillRandom(reference_data_, reference_stride_); |
| 542 FillRandom(second_pred_, width_); |
| 543 CheckSAD(); |
| 544 reference_stride_ = tmp_stride; |
| 545 } |
| 546 |
| 547 TEST_P(SADavgVP9Test, UnalignedRef) { |
| 548 // The reference frame, but not the source frame, may be unaligned for |
| 549 // certain types of searches. |
| 550 const int tmp_stride = reference_stride_; |
| 551 reference_stride_ -= 1; |
| 552 FillRandom(source_data_, source_stride_); |
| 553 FillRandom(reference_data_, reference_stride_); |
| 554 FillRandom(second_pred_, width_); |
| 555 CheckSAD(); |
| 556 reference_stride_ = tmp_stride; |
| 557 } |
| 558 |
| 559 TEST_P(SADavgVP9Test, ShortSrc) { |
| 560 const int tmp_stride = source_stride_; |
| 561 source_stride_ >>= 1; |
| 562 FillRandom(source_data_, source_stride_); |
| 563 FillRandom(reference_data_, reference_stride_); |
| 564 FillRandom(second_pred_, width_); |
| 565 CheckSAD(); |
| 566 source_stride_ = tmp_stride; |
| 567 } |
| 320 #endif // CONFIG_VP9_ENCODER | 568 #endif // CONFIG_VP9_ENCODER |
| 321 | 569 |
| 322 TEST_P(SADx4Test, MaxRef) { | 570 TEST_P(SADx4Test, MaxRef) { |
| 323 FillConstant(source_data_, source_stride_, 0); | 571 FillConstant(source_data_, source_stride_, 0); |
| 324 FillConstant(GetReference(0), reference_stride_, 255); | 572 FillConstant(GetReference(0), reference_stride_, mask_); |
| 325 FillConstant(GetReference(1), reference_stride_, 255); | 573 FillConstant(GetReference(1), reference_stride_, mask_); |
| 326 FillConstant(GetReference(2), reference_stride_, 255); | 574 FillConstant(GetReference(2), reference_stride_, mask_); |
| 327 FillConstant(GetReference(3), reference_stride_, 255); | 575 FillConstant(GetReference(3), reference_stride_, mask_); |
| 328 CheckSADs(); | 576 CheckSADs(); |
| 329 } | 577 } |
| 330 | 578 |
| 331 TEST_P(SADx4Test, MaxSrc) { | 579 TEST_P(SADx4Test, MaxSrc) { |
| 332 FillConstant(source_data_, source_stride_, 255); | 580 FillConstant(source_data_, source_stride_, mask_); |
| 333 FillConstant(GetReference(0), reference_stride_, 0); | 581 FillConstant(GetReference(0), reference_stride_, 0); |
| 334 FillConstant(GetReference(1), reference_stride_, 0); | 582 FillConstant(GetReference(1), reference_stride_, 0); |
| 335 FillConstant(GetReference(2), reference_stride_, 0); | 583 FillConstant(GetReference(2), reference_stride_, 0); |
| 336 FillConstant(GetReference(3), reference_stride_, 0); | 584 FillConstant(GetReference(3), reference_stride_, 0); |
| 337 CheckSADs(); | 585 CheckSADs(); |
| 338 } | 586 } |
| 339 | 587 |
| 340 TEST_P(SADx4Test, ShortRef) { | 588 TEST_P(SADx4Test, ShortRef) { |
| 341 int tmp_stride = reference_stride_; | 589 int tmp_stride = reference_stride_; |
| 342 reference_stride_ >>= 1; | 590 reference_stride_ >>= 1; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 368 source_stride_ >>= 1; | 616 source_stride_ >>= 1; |
| 369 FillRandom(source_data_, source_stride_); | 617 FillRandom(source_data_, source_stride_); |
| 370 FillRandom(GetReference(0), reference_stride_); | 618 FillRandom(GetReference(0), reference_stride_); |
| 371 FillRandom(GetReference(1), reference_stride_); | 619 FillRandom(GetReference(1), reference_stride_); |
| 372 FillRandom(GetReference(2), reference_stride_); | 620 FillRandom(GetReference(2), reference_stride_); |
| 373 FillRandom(GetReference(3), reference_stride_); | 621 FillRandom(GetReference(3), reference_stride_); |
| 374 CheckSADs(); | 622 CheckSADs(); |
| 375 source_stride_ = tmp_stride; | 623 source_stride_ = tmp_stride; |
| 376 } | 624 } |
| 377 | 625 |
| 626 TEST_P(SADx4Test, SrcAlignedByWidth) { |
| 627 uint8_t * tmp_source_data = source_data_; |
| 628 source_data_ += width_; |
| 629 FillRandom(source_data_, source_stride_); |
| 630 FillRandom(GetReference(0), reference_stride_); |
| 631 FillRandom(GetReference(1), reference_stride_); |
| 632 FillRandom(GetReference(2), reference_stride_); |
| 633 FillRandom(GetReference(3), reference_stride_); |
| 634 CheckSADs(); |
| 635 source_data_ = tmp_source_data; |
| 636 } |
| 637 |
| 378 using std::tr1::make_tuple; | 638 using std::tr1::make_tuple; |
| 379 | 639 |
| 380 //------------------------------------------------------------------------------ | 640 //------------------------------------------------------------------------------ |
| 381 // C functions | 641 // C functions |
| 382 #if CONFIG_VP8_ENCODER | 642 #if CONFIG_VP8_ENCODER |
| 383 const SadMxNFunc sad_16x16_c = vp8_sad16x16_c; | 643 const SadMxNFunc sad_16x16_c = vp8_sad16x16_c; |
| 384 const SadMxNFunc sad_8x16_c = vp8_sad8x16_c; | 644 const SadMxNFunc sad_8x16_c = vp8_sad8x16_c; |
| 385 const SadMxNFunc sad_16x8_c = vp8_sad16x8_c; | 645 const SadMxNFunc sad_16x8_c = vp8_sad16x8_c; |
| 386 const SadMxNFunc sad_8x8_c = vp8_sad8x8_c; | 646 const SadMxNFunc sad_8x8_c = vp8_sad8x8_c; |
| 387 const SadMxNFunc sad_4x4_c = vp8_sad4x4_c; | 647 const SadMxNFunc sad_4x4_c = vp8_sad4x4_c; |
| 388 const SadMxNParam c_tests[] = { | 648 const SadMxNParam c_tests[] = { |
| 389 make_tuple(16, 16, sad_16x16_c), | 649 make_tuple(16, 16, sad_16x16_c, -1), |
| 390 make_tuple(8, 16, sad_8x16_c), | 650 make_tuple(8, 16, sad_8x16_c, -1), |
| 391 make_tuple(16, 8, sad_16x8_c), | 651 make_tuple(16, 8, sad_16x8_c, -1), |
| 392 make_tuple(8, 8, sad_8x8_c), | 652 make_tuple(8, 8, sad_8x8_c, -1), |
| 393 make_tuple(4, 4, sad_4x4_c), | 653 make_tuple(4, 4, sad_4x4_c, -1), |
| 394 }; | 654 }; |
| 395 INSTANTIATE_TEST_CASE_P(C, SADTest, ::testing::ValuesIn(c_tests)); | 655 INSTANTIATE_TEST_CASE_P(C, SADTest, ::testing::ValuesIn(c_tests)); |
| 396 #endif // CONFIG_VP8_ENCODER | 656 #endif // CONFIG_VP8_ENCODER |
| 397 | 657 |
| 398 #if CONFIG_VP9_ENCODER | 658 #if CONFIG_VP9_ENCODER |
| 399 const SadMxNVp9Func sad_64x64_c_vp9 = vp9_sad64x64_c; | 659 const SadMxNVp9Func sad_64x64_c_vp9 = vp9_sad64x64_c; |
| 400 const SadMxNVp9Func sad_32x32_c_vp9 = vp9_sad32x32_c; | 660 const SadMxNVp9Func sad_32x32_c_vp9 = vp9_sad32x32_c; |
| 401 const SadMxNVp9Func sad_16x16_c_vp9 = vp9_sad16x16_c; | 661 const SadMxNVp9Func sad_16x16_c_vp9 = vp9_sad16x16_c; |
| 402 const SadMxNVp9Func sad_8x16_c_vp9 = vp9_sad8x16_c; | 662 const SadMxNVp9Func sad_8x16_c_vp9 = vp9_sad8x16_c; |
| 403 const SadMxNVp9Func sad_16x8_c_vp9 = vp9_sad16x8_c; | 663 const SadMxNVp9Func sad_16x8_c_vp9 = vp9_sad16x8_c; |
| 404 const SadMxNVp9Func sad_8x8_c_vp9 = vp9_sad8x8_c; | 664 const SadMxNVp9Func sad_8x8_c_vp9 = vp9_sad8x8_c; |
| 405 const SadMxNVp9Func sad_8x4_c_vp9 = vp9_sad8x4_c; | 665 const SadMxNVp9Func sad_8x4_c_vp9 = vp9_sad8x4_c; |
| 406 const SadMxNVp9Func sad_4x8_c_vp9 = vp9_sad4x8_c; | 666 const SadMxNVp9Func sad_4x8_c_vp9 = vp9_sad4x8_c; |
| 407 const SadMxNVp9Func sad_4x4_c_vp9 = vp9_sad4x4_c; | 667 const SadMxNVp9Func sad_4x4_c_vp9 = vp9_sad4x4_c; |
| 408 const SadMxNVp9Param c_vp9_tests[] = { | 668 const SadMxNVp9Param c_vp9_tests[] = { |
| 409 make_tuple(64, 64, sad_64x64_c_vp9), | 669 make_tuple(64, 64, sad_64x64_c_vp9, -1), |
| 410 make_tuple(32, 32, sad_32x32_c_vp9), | 670 make_tuple(32, 32, sad_32x32_c_vp9, -1), |
| 411 make_tuple(16, 16, sad_16x16_c_vp9), | 671 make_tuple(16, 16, sad_16x16_c_vp9, -1), |
| 412 make_tuple(8, 16, sad_8x16_c_vp9), | 672 make_tuple(8, 16, sad_8x16_c_vp9, -1), |
| 413 make_tuple(16, 8, sad_16x8_c_vp9), | 673 make_tuple(16, 8, sad_16x8_c_vp9, -1), |
| 414 make_tuple(8, 8, sad_8x8_c_vp9), | 674 make_tuple(8, 8, sad_8x8_c_vp9, -1), |
| 415 make_tuple(8, 4, sad_8x4_c_vp9), | 675 make_tuple(8, 4, sad_8x4_c_vp9, -1), |
| 416 make_tuple(4, 8, sad_4x8_c_vp9), | 676 make_tuple(4, 8, sad_4x8_c_vp9, -1), |
| 417 make_tuple(4, 4, sad_4x4_c_vp9), | 677 make_tuple(4, 4, sad_4x4_c_vp9, -1), |
| 418 }; | 678 }; |
| 419 INSTANTIATE_TEST_CASE_P(C, SADVP9Test, ::testing::ValuesIn(c_vp9_tests)); | 679 INSTANTIATE_TEST_CASE_P(C, SADVP9Test, ::testing::ValuesIn(c_vp9_tests)); |
| 420 | 680 |
| 421 const SadMxNx4Func sad_64x64x4d_c = vp9_sad64x64x4d_c; | 681 const SadMxNx4Func sad_64x64x4d_c = vp9_sad64x64x4d_c; |
| 422 const SadMxNx4Func sad_64x32x4d_c = vp9_sad64x32x4d_c; | 682 const SadMxNx4Func sad_64x32x4d_c = vp9_sad64x32x4d_c; |
| 423 const SadMxNx4Func sad_32x64x4d_c = vp9_sad32x64x4d_c; | 683 const SadMxNx4Func sad_32x64x4d_c = vp9_sad32x64x4d_c; |
| 424 const SadMxNx4Func sad_32x32x4d_c = vp9_sad32x32x4d_c; | 684 const SadMxNx4Func sad_32x32x4d_c = vp9_sad32x32x4d_c; |
| 425 const SadMxNx4Func sad_32x16x4d_c = vp9_sad32x16x4d_c; | 685 const SadMxNx4Func sad_32x16x4d_c = vp9_sad32x16x4d_c; |
| 426 const SadMxNx4Func sad_16x32x4d_c = vp9_sad16x32x4d_c; | 686 const SadMxNx4Func sad_16x32x4d_c = vp9_sad16x32x4d_c; |
| 427 const SadMxNx4Func sad_16x16x4d_c = vp9_sad16x16x4d_c; | 687 const SadMxNx4Func sad_16x16x4d_c = vp9_sad16x16x4d_c; |
| 428 const SadMxNx4Func sad_16x8x4d_c = vp9_sad16x8x4d_c; | 688 const SadMxNx4Func sad_16x8x4d_c = vp9_sad16x8x4d_c; |
| 429 const SadMxNx4Func sad_8x16x4d_c = vp9_sad8x16x4d_c; | 689 const SadMxNx4Func sad_8x16x4d_c = vp9_sad8x16x4d_c; |
| 430 const SadMxNx4Func sad_8x8x4d_c = vp9_sad8x8x4d_c; | 690 const SadMxNx4Func sad_8x8x4d_c = vp9_sad8x8x4d_c; |
| 431 const SadMxNx4Func sad_8x4x4d_c = vp9_sad8x4x4d_c; | 691 const SadMxNx4Func sad_8x4x4d_c = vp9_sad8x4x4d_c; |
| 432 const SadMxNx4Func sad_4x8x4d_c = vp9_sad4x8x4d_c; | 692 const SadMxNx4Func sad_4x8x4d_c = vp9_sad4x8x4d_c; |
| 433 const SadMxNx4Func sad_4x4x4d_c = vp9_sad4x4x4d_c; | 693 const SadMxNx4Func sad_4x4x4d_c = vp9_sad4x4x4d_c; |
| 434 INSTANTIATE_TEST_CASE_P(C, SADx4Test, ::testing::Values( | 694 INSTANTIATE_TEST_CASE_P(C, SADx4Test, ::testing::Values( |
| 435 make_tuple(64, 64, sad_64x64x4d_c), | 695 make_tuple(64, 64, sad_64x64x4d_c, -1), |
| 436 make_tuple(64, 32, sad_64x32x4d_c), | 696 make_tuple(64, 32, sad_64x32x4d_c, -1), |
| 437 make_tuple(32, 64, sad_32x64x4d_c), | 697 make_tuple(32, 64, sad_32x64x4d_c, -1), |
| 438 make_tuple(32, 32, sad_32x32x4d_c), | 698 make_tuple(32, 32, sad_32x32x4d_c, -1), |
| 439 make_tuple(32, 16, sad_32x16x4d_c), | 699 make_tuple(32, 16, sad_32x16x4d_c, -1), |
| 440 make_tuple(16, 32, sad_16x32x4d_c), | 700 make_tuple(16, 32, sad_16x32x4d_c, -1), |
| 441 make_tuple(16, 16, sad_16x16x4d_c), | 701 make_tuple(16, 16, sad_16x16x4d_c, -1), |
| 442 make_tuple(16, 8, sad_16x8x4d_c), | 702 make_tuple(16, 8, sad_16x8x4d_c, -1), |
| 443 make_tuple(8, 16, sad_8x16x4d_c), | 703 make_tuple(8, 16, sad_8x16x4d_c, -1), |
| 444 make_tuple(8, 8, sad_8x8x4d_c), | 704 make_tuple(8, 8, sad_8x8x4d_c, -1), |
| 445 make_tuple(8, 4, sad_8x4x4d_c), | 705 make_tuple(8, 4, sad_8x4x4d_c, -1), |
| 446 make_tuple(4, 8, sad_4x8x4d_c), | 706 make_tuple(4, 8, sad_4x8x4d_c, -1), |
| 447 make_tuple(4, 4, sad_4x4x4d_c))); | 707 make_tuple(4, 4, sad_4x4x4d_c, -1))); |
| 708 |
| 709 #if CONFIG_VP9_HIGHBITDEPTH |
| 710 const SadMxNVp9Func highbd_sad_64x64_c_vp9 = vp9_highbd_sad64x64_c; |
| 711 const SadMxNVp9Func highbd_sad_32x32_c_vp9 = vp9_highbd_sad32x32_c; |
| 712 const SadMxNVp9Func highbd_sad_16x16_c_vp9 = vp9_highbd_sad16x16_c; |
| 713 const SadMxNVp9Func highbd_sad_8x16_c_vp9 = vp9_highbd_sad8x16_c; |
| 714 const SadMxNVp9Func highbd_sad_16x8_c_vp9 = vp9_highbd_sad16x8_c; |
| 715 const SadMxNVp9Func highbd_sad_8x8_c_vp9 = vp9_highbd_sad8x8_c; |
| 716 const SadMxNVp9Func highbd_sad_8x4_c_vp9 = vp9_highbd_sad8x4_c; |
| 717 const SadMxNVp9Func highbd_sad_4x8_c_vp9 = vp9_highbd_sad4x8_c; |
| 718 const SadMxNVp9Func highbd_sad_4x4_c_vp9 = vp9_highbd_sad4x4_c; |
| 719 const SadMxNVp9Param c_vp9_highbd_8_tests[] = { |
| 720 make_tuple(64, 64, highbd_sad_64x64_c_vp9, 8), |
| 721 make_tuple(32, 32, highbd_sad_32x32_c_vp9, 8), |
| 722 make_tuple(16, 16, highbd_sad_16x16_c_vp9, 8), |
| 723 make_tuple(8, 16, highbd_sad_8x16_c_vp9, 8), |
| 724 make_tuple(16, 8, highbd_sad_16x8_c_vp9, 8), |
| 725 make_tuple(8, 8, highbd_sad_8x8_c_vp9, 8), |
| 726 make_tuple(8, 4, highbd_sad_8x4_c_vp9, 8), |
| 727 make_tuple(4, 8, highbd_sad_4x8_c_vp9, 8), |
| 728 make_tuple(4, 4, highbd_sad_4x4_c_vp9, 8), |
| 729 }; |
| 730 INSTANTIATE_TEST_CASE_P(C_8, SADVP9Test, |
| 731 ::testing::ValuesIn(c_vp9_highbd_8_tests)); |
| 732 |
| 733 const SadMxNVp9Param c_vp9_highbd_10_tests[] = { |
| 734 make_tuple(64, 64, highbd_sad_64x64_c_vp9, 10), |
| 735 make_tuple(32, 32, highbd_sad_32x32_c_vp9, 10), |
| 736 make_tuple(16, 16, highbd_sad_16x16_c_vp9, 10), |
| 737 make_tuple(8, 16, highbd_sad_8x16_c_vp9, 10), |
| 738 make_tuple(16, 8, highbd_sad_16x8_c_vp9, 10), |
| 739 make_tuple(8, 8, highbd_sad_8x8_c_vp9, 10), |
| 740 make_tuple(8, 4, highbd_sad_8x4_c_vp9, 10), |
| 741 make_tuple(4, 8, highbd_sad_4x8_c_vp9, 10), |
| 742 make_tuple(4, 4, highbd_sad_4x4_c_vp9, 10), |
| 743 }; |
| 744 INSTANTIATE_TEST_CASE_P(C_10, SADVP9Test, |
| 745 ::testing::ValuesIn(c_vp9_highbd_10_tests)); |
| 746 |
| 747 const SadMxNVp9Param c_vp9_highbd_12_tests[] = { |
| 748 make_tuple(64, 64, highbd_sad_64x64_c_vp9, 12), |
| 749 make_tuple(32, 32, highbd_sad_32x32_c_vp9, 12), |
| 750 make_tuple(16, 16, highbd_sad_16x16_c_vp9, 12), |
| 751 make_tuple(8, 16, highbd_sad_8x16_c_vp9, 12), |
| 752 make_tuple(16, 8, highbd_sad_16x8_c_vp9, 12), |
| 753 make_tuple(8, 8, highbd_sad_8x8_c_vp9, 12), |
| 754 make_tuple(8, 4, highbd_sad_8x4_c_vp9, 12), |
| 755 make_tuple(4, 8, highbd_sad_4x8_c_vp9, 12), |
| 756 make_tuple(4, 4, highbd_sad_4x4_c_vp9, 12), |
| 757 }; |
| 758 INSTANTIATE_TEST_CASE_P(C_12, SADVP9Test, |
| 759 ::testing::ValuesIn(c_vp9_highbd_12_tests)); |
| 760 |
| 761 const SadMxNAvgVp9Func highbd_sad8x4_avg_c_vp9 = vp9_highbd_sad8x4_avg_c; |
| 762 const SadMxNAvgVp9Func highbd_sad8x8_avg_c_vp9 = vp9_highbd_sad8x8_avg_c; |
| 763 const SadMxNAvgVp9Func highbd_sad8x16_avg_c_vp9 = vp9_highbd_sad8x16_avg_c; |
| 764 const SadMxNAvgVp9Func highbd_sad16x8_avg_c_vp9 = vp9_highbd_sad16x8_avg_c; |
| 765 const SadMxNAvgVp9Func highbd_sad16x16_avg_c_vp9 = vp9_highbd_sad16x16_avg_c; |
| 766 const SadMxNAvgVp9Func highbd_sad16x32_avg_c_vp9 = vp9_highbd_sad16x32_avg_c; |
| 767 const SadMxNAvgVp9Func highbd_sad32x16_avg_c_vp9 = vp9_highbd_sad32x16_avg_c; |
| 768 const SadMxNAvgVp9Func highbd_sad32x32_avg_c_vp9 = vp9_highbd_sad32x32_avg_c; |
| 769 const SadMxNAvgVp9Func highbd_sad32x64_avg_c_vp9 = vp9_highbd_sad32x64_avg_c; |
| 770 const SadMxNAvgVp9Func highbd_sad64x32_avg_c_vp9 = vp9_highbd_sad64x32_avg_c; |
| 771 const SadMxNAvgVp9Func highbd_sad64x64_avg_c_vp9 = vp9_highbd_sad64x64_avg_c; |
| 772 SadMxNAvgVp9Param avg_c_vp9_highbd_8_tests[] = { |
| 773 make_tuple(8, 4, highbd_sad8x4_avg_c_vp9, 8), |
| 774 make_tuple(8, 8, highbd_sad8x8_avg_c_vp9, 8), |
| 775 make_tuple(8, 16, highbd_sad8x16_avg_c_vp9, 8), |
| 776 make_tuple(16, 8, highbd_sad16x8_avg_c_vp9, 8), |
| 777 make_tuple(16, 16, highbd_sad16x16_avg_c_vp9, 8), |
| 778 make_tuple(16, 32, highbd_sad16x32_avg_c_vp9, 8), |
| 779 make_tuple(32, 16, highbd_sad32x16_avg_c_vp9, 8), |
| 780 make_tuple(32, 32, highbd_sad32x32_avg_c_vp9, 8), |
| 781 make_tuple(32, 64, highbd_sad32x64_avg_c_vp9, 8), |
| 782 make_tuple(64, 32, highbd_sad64x32_avg_c_vp9, 8), |
| 783 make_tuple(64, 64, highbd_sad64x64_avg_c_vp9, 8)}; |
| 784 INSTANTIATE_TEST_CASE_P(C_8, SADavgVP9Test, |
| 785 ::testing::ValuesIn(avg_c_vp9_highbd_8_tests)); |
| 786 |
| 787 SadMxNAvgVp9Param avg_c_vp9_highbd_10_tests[] = { |
| 788 make_tuple(8, 4, highbd_sad8x4_avg_c_vp9, 10), |
| 789 make_tuple(8, 8, highbd_sad8x8_avg_c_vp9, 10), |
| 790 make_tuple(8, 16, highbd_sad8x16_avg_c_vp9, 10), |
| 791 make_tuple(16, 8, highbd_sad16x8_avg_c_vp9, 10), |
| 792 make_tuple(16, 16, highbd_sad16x16_avg_c_vp9, 10), |
| 793 make_tuple(16, 32, highbd_sad16x32_avg_c_vp9, 10), |
| 794 make_tuple(32, 16, highbd_sad32x16_avg_c_vp9, 10), |
| 795 make_tuple(32, 32, highbd_sad32x32_avg_c_vp9, 10), |
| 796 make_tuple(32, 64, highbd_sad32x64_avg_c_vp9, 10), |
| 797 make_tuple(64, 32, highbd_sad64x32_avg_c_vp9, 10), |
| 798 make_tuple(64, 64, highbd_sad64x64_avg_c_vp9, 10)}; |
| 799 INSTANTIATE_TEST_CASE_P(C_10, SADavgVP9Test, |
| 800 ::testing::ValuesIn(avg_c_vp9_highbd_10_tests)); |
| 801 |
| 802 SadMxNAvgVp9Param avg_c_vp9_highbd_12_tests[] = { |
| 803 make_tuple(8, 4, highbd_sad8x4_avg_c_vp9, 12), |
| 804 make_tuple(8, 8, highbd_sad8x8_avg_c_vp9, 12), |
| 805 make_tuple(8, 16, highbd_sad8x16_avg_c_vp9, 12), |
| 806 make_tuple(16, 8, highbd_sad16x8_avg_c_vp9, 12), |
| 807 make_tuple(16, 16, highbd_sad16x16_avg_c_vp9, 12), |
| 808 make_tuple(16, 32, highbd_sad16x32_avg_c_vp9, 12), |
| 809 make_tuple(32, 16, highbd_sad32x16_avg_c_vp9, 12), |
| 810 make_tuple(32, 32, highbd_sad32x32_avg_c_vp9, 12), |
| 811 make_tuple(32, 64, highbd_sad32x64_avg_c_vp9, 12), |
| 812 make_tuple(64, 32, highbd_sad64x32_avg_c_vp9, 12), |
| 813 make_tuple(64, 64, highbd_sad64x64_avg_c_vp9, 12)}; |
| 814 INSTANTIATE_TEST_CASE_P(C_12, SADavgVP9Test, |
| 815 ::testing::ValuesIn(avg_c_vp9_highbd_12_tests)); |
| 816 |
| 817 const SadMxNx4Func highbd_sad_64x64x4d_c = vp9_highbd_sad64x64x4d_c; |
| 818 const SadMxNx4Func highbd_sad_64x32x4d_c = vp9_highbd_sad64x32x4d_c; |
| 819 const SadMxNx4Func highbd_sad_32x64x4d_c = vp9_highbd_sad32x64x4d_c; |
| 820 const SadMxNx4Func highbd_sad_32x32x4d_c = vp9_highbd_sad32x32x4d_c; |
| 821 const SadMxNx4Func highbd_sad_32x16x4d_c = vp9_highbd_sad32x16x4d_c; |
| 822 const SadMxNx4Func highbd_sad_16x32x4d_c = vp9_highbd_sad16x32x4d_c; |
| 823 const SadMxNx4Func highbd_sad_16x16x4d_c = vp9_highbd_sad16x16x4d_c; |
| 824 const SadMxNx4Func highbd_sad_16x8x4d_c = vp9_highbd_sad16x8x4d_c; |
| 825 const SadMxNx4Func highbd_sad_8x16x4d_c = vp9_highbd_sad8x16x4d_c; |
| 826 const SadMxNx4Func highbd_sad_8x8x4d_c = vp9_highbd_sad8x8x4d_c; |
| 827 const SadMxNx4Func highbd_sad_8x4x4d_c = vp9_highbd_sad8x4x4d_c; |
| 828 const SadMxNx4Func highbd_sad_4x8x4d_c = vp9_highbd_sad4x8x4d_c; |
| 829 const SadMxNx4Func highbd_sad_4x4x4d_c = vp9_highbd_sad4x4x4d_c; |
| 830 INSTANTIATE_TEST_CASE_P(C_8, SADx4Test, ::testing::Values( |
| 831 make_tuple(64, 64, highbd_sad_64x64x4d_c, 8), |
| 832 make_tuple(64, 32, highbd_sad_64x32x4d_c, 8), |
| 833 make_tuple(32, 64, highbd_sad_32x64x4d_c, 8), |
| 834 make_tuple(32, 32, highbd_sad_32x32x4d_c, 8), |
| 835 make_tuple(32, 16, highbd_sad_32x16x4d_c, 8), |
| 836 make_tuple(16, 32, highbd_sad_16x32x4d_c, 8), |
| 837 make_tuple(16, 16, highbd_sad_16x16x4d_c, 8), |
| 838 make_tuple(16, 8, highbd_sad_16x8x4d_c, 8), |
| 839 make_tuple(8, 16, highbd_sad_8x16x4d_c, 8), |
| 840 make_tuple(8, 8, highbd_sad_8x8x4d_c, 8), |
| 841 make_tuple(8, 4, highbd_sad_8x4x4d_c, 8), |
| 842 make_tuple(4, 8, highbd_sad_4x8x4d_c, 8), |
| 843 make_tuple(4, 4, highbd_sad_4x4x4d_c, 8))); |
| 844 |
| 845 INSTANTIATE_TEST_CASE_P(C_10, SADx4Test, ::testing::Values( |
| 846 make_tuple(64, 64, highbd_sad_64x64x4d_c, 10), |
| 847 make_tuple(64, 32, highbd_sad_64x32x4d_c, 10), |
| 848 make_tuple(32, 64, highbd_sad_32x64x4d_c, 10), |
| 849 make_tuple(32, 32, highbd_sad_32x32x4d_c, 10), |
| 850 make_tuple(32, 16, highbd_sad_32x16x4d_c, 10), |
| 851 make_tuple(16, 32, highbd_sad_16x32x4d_c, 10), |
| 852 make_tuple(16, 16, highbd_sad_16x16x4d_c, 10), |
| 853 make_tuple(16, 8, highbd_sad_16x8x4d_c, 10), |
| 854 make_tuple(8, 16, highbd_sad_8x16x4d_c, 10), |
| 855 make_tuple(8, 8, highbd_sad_8x8x4d_c, 10), |
| 856 make_tuple(8, 4, highbd_sad_8x4x4d_c, 10), |
| 857 make_tuple(4, 8, highbd_sad_4x8x4d_c, 10), |
| 858 make_tuple(4, 4, highbd_sad_4x4x4d_c, 10))); |
| 859 |
| 860 INSTANTIATE_TEST_CASE_P(C_12, SADx4Test, ::testing::Values( |
| 861 make_tuple(64, 64, highbd_sad_64x64x4d_c, 12), |
| 862 make_tuple(64, 32, highbd_sad_64x32x4d_c, 12), |
| 863 make_tuple(32, 64, highbd_sad_32x64x4d_c, 12), |
| 864 make_tuple(32, 32, highbd_sad_32x32x4d_c, 12), |
| 865 make_tuple(32, 16, highbd_sad_32x16x4d_c, 12), |
| 866 make_tuple(16, 32, highbd_sad_16x32x4d_c, 12), |
| 867 make_tuple(16, 16, highbd_sad_16x16x4d_c, 12), |
| 868 make_tuple(16, 8, highbd_sad_16x8x4d_c, 12), |
| 869 make_tuple(8, 16, highbd_sad_8x16x4d_c, 12), |
| 870 make_tuple(8, 8, highbd_sad_8x8x4d_c, 12), |
| 871 make_tuple(8, 4, highbd_sad_8x4x4d_c, 12), |
| 872 make_tuple(4, 8, highbd_sad_4x8x4d_c, 12), |
| 873 make_tuple(4, 4, highbd_sad_4x4x4d_c, 12))); |
| 874 #endif // CONFIG_VP9_HIGHBITDEPTH |
| 448 #endif // CONFIG_VP9_ENCODER | 875 #endif // CONFIG_VP9_ENCODER |
| 449 | 876 |
| 450 //------------------------------------------------------------------------------ | 877 //------------------------------------------------------------------------------ |
| 451 // ARM functions | 878 // ARM functions |
| 452 #if HAVE_MEDIA | 879 #if HAVE_MEDIA |
| 453 #if CONFIG_VP8_ENCODER | 880 #if CONFIG_VP8_ENCODER |
| 454 const SadMxNFunc sad_16x16_armv6 = vp8_sad16x16_armv6; | 881 const SadMxNFunc sad_16x16_armv6 = vp8_sad16x16_armv6; |
| 455 INSTANTIATE_TEST_CASE_P(MEDIA, SADTest, ::testing::Values( | 882 INSTANTIATE_TEST_CASE_P(MEDIA, SADTest, ::testing::Values( |
| 456 make_tuple(16, 16, sad_16x16_armv6))); | 883 make_tuple(16, 16, sad_16x16_armv6, -1))); |
| 457 #endif // CONFIG_VP8_ENCODER | 884 #endif // CONFIG_VP8_ENCODER |
| 458 #endif // HAVE_MEDIA | 885 #endif // HAVE_MEDIA |
| 459 | 886 |
| 460 #if HAVE_NEON | 887 #if HAVE_NEON |
| 461 #if CONFIG_VP8_ENCODER | 888 #if CONFIG_VP8_ENCODER |
| 462 const SadMxNFunc sad_16x16_neon = vp8_sad16x16_neon; | 889 const SadMxNFunc sad_16x16_neon = vp8_sad16x16_neon; |
| 463 const SadMxNFunc sad_8x16_neon = vp8_sad8x16_neon; | 890 const SadMxNFunc sad_8x16_neon = vp8_sad8x16_neon; |
| 464 const SadMxNFunc sad_16x8_neon = vp8_sad16x8_neon; | 891 const SadMxNFunc sad_16x8_neon = vp8_sad16x8_neon; |
| 465 const SadMxNFunc sad_8x8_neon = vp8_sad8x8_neon; | 892 const SadMxNFunc sad_8x8_neon = vp8_sad8x8_neon; |
| 466 const SadMxNFunc sad_4x4_neon = vp8_sad4x4_neon; | 893 const SadMxNFunc sad_4x4_neon = vp8_sad4x4_neon; |
| 467 INSTANTIATE_TEST_CASE_P(NEON, SADTest, ::testing::Values( | 894 INSTANTIATE_TEST_CASE_P(NEON, SADTest, ::testing::Values( |
| 468 make_tuple(16, 16, sad_16x16_neon), | 895 make_tuple(16, 16, sad_16x16_neon, -1), |
| 469 make_tuple(8, 16, sad_8x16_neon), | 896 make_tuple(8, 16, sad_8x16_neon, -1), |
| 470 make_tuple(16, 8, sad_16x8_neon), | 897 make_tuple(16, 8, sad_16x8_neon, -1), |
| 471 make_tuple(8, 8, sad_8x8_neon), | 898 make_tuple(8, 8, sad_8x8_neon, -1), |
| 472 make_tuple(4, 4, sad_4x4_neon))); | 899 make_tuple(4, 4, sad_4x4_neon, -1))); |
| 473 #endif // CONFIG_VP8_ENCODER | 900 #endif // CONFIG_VP8_ENCODER |
| 474 #if CONFIG_VP9_ENCODER | 901 #if CONFIG_VP9_ENCODER |
| 475 const SadMxNVp9Func sad_64x64_neon_vp9 = vp9_sad64x64_neon; | 902 const SadMxNVp9Func sad_64x64_neon_vp9 = vp9_sad64x64_neon; |
| 476 const SadMxNVp9Func sad_32x32_neon_vp9 = vp9_sad32x32_neon; | 903 const SadMxNVp9Func sad_32x32_neon_vp9 = vp9_sad32x32_neon; |
| 477 const SadMxNVp9Func sad_16x16_neon_vp9 = vp9_sad16x16_neon; | 904 const SadMxNVp9Func sad_16x16_neon_vp9 = vp9_sad16x16_neon; |
| 478 const SadMxNVp9Func sad_8x8_neon_vp9 = vp9_sad8x8_neon; | 905 const SadMxNVp9Func sad_8x8_neon_vp9 = vp9_sad8x8_neon; |
| 479 const SadMxNVp9Param neon_vp9_tests[] = { | 906 const SadMxNVp9Param neon_vp9_tests[] = { |
| 480 make_tuple(64, 64, sad_64x64_neon_vp9), | 907 make_tuple(64, 64, sad_64x64_neon_vp9, -1), |
| 481 make_tuple(32, 32, sad_32x32_neon_vp9), | 908 make_tuple(32, 32, sad_32x32_neon_vp9, -1), |
| 482 make_tuple(16, 16, sad_16x16_neon_vp9), | 909 make_tuple(16, 16, sad_16x16_neon_vp9, -1), |
| 483 make_tuple(8, 8, sad_8x8_neon_vp9), | 910 make_tuple(8, 8, sad_8x8_neon_vp9, -1), |
| 484 }; | 911 }; |
| 485 INSTANTIATE_TEST_CASE_P(NEON, SADVP9Test, ::testing::ValuesIn(neon_vp9_tests)); | 912 INSTANTIATE_TEST_CASE_P(NEON, SADVP9Test, ::testing::ValuesIn(neon_vp9_tests)); |
| 486 #endif // CONFIG_VP9_ENCODER | 913 #endif // CONFIG_VP9_ENCODER |
| 487 #endif // HAVE_NEON | 914 #endif // HAVE_NEON |
| 488 | 915 |
| 489 //------------------------------------------------------------------------------ | 916 //------------------------------------------------------------------------------ |
| 490 // x86 functions | 917 // x86 functions |
| 491 #if HAVE_MMX | 918 #if HAVE_MMX |
| 492 #if CONFIG_VP8_ENCODER | 919 #if CONFIG_VP8_ENCODER |
| 493 const SadMxNFunc sad_16x16_mmx = vp8_sad16x16_mmx; | 920 const SadMxNFunc sad_16x16_mmx = vp8_sad16x16_mmx; |
| 494 const SadMxNFunc sad_8x16_mmx = vp8_sad8x16_mmx; | 921 const SadMxNFunc sad_8x16_mmx = vp8_sad8x16_mmx; |
| 495 const SadMxNFunc sad_16x8_mmx = vp8_sad16x8_mmx; | 922 const SadMxNFunc sad_16x8_mmx = vp8_sad16x8_mmx; |
| 496 const SadMxNFunc sad_8x8_mmx = vp8_sad8x8_mmx; | 923 const SadMxNFunc sad_8x8_mmx = vp8_sad8x8_mmx; |
| 497 const SadMxNFunc sad_4x4_mmx = vp8_sad4x4_mmx; | 924 const SadMxNFunc sad_4x4_mmx = vp8_sad4x4_mmx; |
| 498 const SadMxNParam mmx_tests[] = { | 925 const SadMxNParam mmx_tests[] = { |
| 499 make_tuple(16, 16, sad_16x16_mmx), | 926 make_tuple(16, 16, sad_16x16_mmx, -1), |
| 500 make_tuple(8, 16, sad_8x16_mmx), | 927 make_tuple(8, 16, sad_8x16_mmx, -1), |
| 501 make_tuple(16, 8, sad_16x8_mmx), | 928 make_tuple(16, 8, sad_16x8_mmx, -1), |
| 502 make_tuple(8, 8, sad_8x8_mmx), | 929 make_tuple(8, 8, sad_8x8_mmx, -1), |
| 503 make_tuple(4, 4, sad_4x4_mmx), | 930 make_tuple(4, 4, sad_4x4_mmx, -1), |
| 504 }; | 931 }; |
| 505 INSTANTIATE_TEST_CASE_P(MMX, SADTest, ::testing::ValuesIn(mmx_tests)); | 932 INSTANTIATE_TEST_CASE_P(MMX, SADTest, ::testing::ValuesIn(mmx_tests)); |
| 506 #endif // CONFIG_VP8_ENCODER | 933 #endif // CONFIG_VP8_ENCODER |
| 507 | 934 |
| 508 #endif // HAVE_MMX | 935 #endif // HAVE_MMX |
| 509 | 936 |
| 510 #if HAVE_SSE | 937 #if HAVE_SSE |
| 511 #if CONFIG_VP9_ENCODER | 938 #if CONFIG_VP9_ENCODER |
| 512 #if CONFIG_USE_X86INC | 939 #if CONFIG_USE_X86INC |
| 513 const SadMxNVp9Func sad_4x4_sse_vp9 = vp9_sad4x4_sse; | 940 const SadMxNVp9Func sad_4x4_sse_vp9 = vp9_sad4x4_sse; |
| 514 const SadMxNVp9Func sad_4x8_sse_vp9 = vp9_sad4x8_sse; | 941 const SadMxNVp9Func sad_4x8_sse_vp9 = vp9_sad4x8_sse; |
| 515 INSTANTIATE_TEST_CASE_P(SSE, SADVP9Test, ::testing::Values( | 942 INSTANTIATE_TEST_CASE_P(SSE, SADVP9Test, ::testing::Values( |
| 516 make_tuple(4, 4, sad_4x4_sse_vp9), | 943 make_tuple(4, 4, sad_4x4_sse_vp9, -1), |
| 517 make_tuple(4, 8, sad_4x8_sse_vp9))); | 944 make_tuple(4, 8, sad_4x8_sse_vp9, -1))); |
| 518 | 945 |
| 519 const SadMxNx4Func sad_4x8x4d_sse = vp9_sad4x8x4d_sse; | 946 const SadMxNx4Func sad_4x8x4d_sse = vp9_sad4x8x4d_sse; |
| 520 const SadMxNx4Func sad_4x4x4d_sse = vp9_sad4x4x4d_sse; | 947 const SadMxNx4Func sad_4x4x4d_sse = vp9_sad4x4x4d_sse; |
| 521 INSTANTIATE_TEST_CASE_P(SSE, SADx4Test, ::testing::Values( | 948 INSTANTIATE_TEST_CASE_P(SSE, SADx4Test, ::testing::Values( |
| 522 make_tuple(4, 8, sad_4x8x4d_sse), | 949 make_tuple(4, 8, sad_4x8x4d_sse, -1), |
| 523 make_tuple(4, 4, sad_4x4x4d_sse))); | 950 make_tuple(4, 4, sad_4x4x4d_sse, -1))); |
| 524 #endif // CONFIG_USE_X86INC | 951 #endif // CONFIG_USE_X86INC |
| 525 #endif // CONFIG_VP9_ENCODER | 952 #endif // CONFIG_VP9_ENCODER |
| 526 #endif // HAVE_SSE | 953 #endif // HAVE_SSE |
| 527 | 954 |
| 528 #if HAVE_SSE2 | 955 #if HAVE_SSE2 |
| 529 #if CONFIG_VP8_ENCODER | 956 #if CONFIG_VP8_ENCODER |
| 530 const SadMxNFunc sad_16x16_wmt = vp8_sad16x16_wmt; | 957 const SadMxNFunc sad_16x16_wmt = vp8_sad16x16_wmt; |
| 531 const SadMxNFunc sad_8x16_wmt = vp8_sad8x16_wmt; | 958 const SadMxNFunc sad_8x16_wmt = vp8_sad8x16_wmt; |
| 532 const SadMxNFunc sad_16x8_wmt = vp8_sad16x8_wmt; | 959 const SadMxNFunc sad_16x8_wmt = vp8_sad16x8_wmt; |
| 533 const SadMxNFunc sad_8x8_wmt = vp8_sad8x8_wmt; | 960 const SadMxNFunc sad_8x8_wmt = vp8_sad8x8_wmt; |
| 534 const SadMxNFunc sad_4x4_wmt = vp8_sad4x4_wmt; | 961 const SadMxNFunc sad_4x4_wmt = vp8_sad4x4_wmt; |
| 535 const SadMxNParam sse2_tests[] = { | 962 const SadMxNParam sse2_tests[] = { |
| 536 make_tuple(16, 16, sad_16x16_wmt), | 963 make_tuple(16, 16, sad_16x16_wmt, -1), |
| 537 make_tuple(8, 16, sad_8x16_wmt), | 964 make_tuple(8, 16, sad_8x16_wmt, -1), |
| 538 make_tuple(16, 8, sad_16x8_wmt), | 965 make_tuple(16, 8, sad_16x8_wmt, -1), |
| 539 make_tuple(8, 8, sad_8x8_wmt), | 966 make_tuple(8, 8, sad_8x8_wmt, -1), |
| 540 make_tuple(4, 4, sad_4x4_wmt), | 967 make_tuple(4, 4, sad_4x4_wmt, -1), |
| 541 }; | 968 }; |
| 542 INSTANTIATE_TEST_CASE_P(SSE2, SADTest, ::testing::ValuesIn(sse2_tests)); | 969 INSTANTIATE_TEST_CASE_P(SSE2, SADTest, ::testing::ValuesIn(sse2_tests)); |
| 543 #endif // CONFIG_VP8_ENCODER | 970 #endif // CONFIG_VP8_ENCODER |
| 544 | 971 |
| 545 #if CONFIG_VP9_ENCODER | 972 #if CONFIG_VP9_ENCODER |
| 546 #if CONFIG_USE_X86INC | 973 #if CONFIG_USE_X86INC |
| 547 const SadMxNVp9Func sad_64x64_sse2_vp9 = vp9_sad64x64_sse2; | 974 const SadMxNVp9Func sad_64x64_sse2_vp9 = vp9_sad64x64_sse2; |
| 548 const SadMxNVp9Func sad_64x32_sse2_vp9 = vp9_sad64x32_sse2; | 975 const SadMxNVp9Func sad_64x32_sse2_vp9 = vp9_sad64x32_sse2; |
| 549 const SadMxNVp9Func sad_32x64_sse2_vp9 = vp9_sad32x64_sse2; | 976 const SadMxNVp9Func sad_32x64_sse2_vp9 = vp9_sad32x64_sse2; |
| 550 const SadMxNVp9Func sad_32x32_sse2_vp9 = vp9_sad32x32_sse2; | 977 const SadMxNVp9Func sad_32x32_sse2_vp9 = vp9_sad32x32_sse2; |
| 551 const SadMxNVp9Func sad_32x16_sse2_vp9 = vp9_sad32x16_sse2; | 978 const SadMxNVp9Func sad_32x16_sse2_vp9 = vp9_sad32x16_sse2; |
| 552 const SadMxNVp9Func sad_16x32_sse2_vp9 = vp9_sad16x32_sse2; | 979 const SadMxNVp9Func sad_16x32_sse2_vp9 = vp9_sad16x32_sse2; |
| 553 const SadMxNVp9Func sad_16x16_sse2_vp9 = vp9_sad16x16_sse2; | 980 const SadMxNVp9Func sad_16x16_sse2_vp9 = vp9_sad16x16_sse2; |
| 554 const SadMxNVp9Func sad_16x8_sse2_vp9 = vp9_sad16x8_sse2; | 981 const SadMxNVp9Func sad_16x8_sse2_vp9 = vp9_sad16x8_sse2; |
| 555 const SadMxNVp9Func sad_8x16_sse2_vp9 = vp9_sad8x16_sse2; | 982 const SadMxNVp9Func sad_8x16_sse2_vp9 = vp9_sad8x16_sse2; |
| 556 const SadMxNVp9Func sad_8x8_sse2_vp9 = vp9_sad8x8_sse2; | 983 const SadMxNVp9Func sad_8x8_sse2_vp9 = vp9_sad8x8_sse2; |
| 557 const SadMxNVp9Func sad_8x4_sse2_vp9 = vp9_sad8x4_sse2; | 984 const SadMxNVp9Func sad_8x4_sse2_vp9 = vp9_sad8x4_sse2; |
| 558 const SadMxNVp9Param sse2_vp9_tests[] = { | |
| 559 make_tuple(64, 64, sad_64x64_sse2_vp9), | |
| 560 make_tuple(64, 32, sad_64x32_sse2_vp9), | |
| 561 make_tuple(32, 64, sad_32x64_sse2_vp9), | |
| 562 make_tuple(32, 32, sad_32x32_sse2_vp9), | |
| 563 make_tuple(32, 16, sad_32x16_sse2_vp9), | |
| 564 make_tuple(16, 32, sad_16x32_sse2_vp9), | |
| 565 make_tuple(16, 16, sad_16x16_sse2_vp9), | |
| 566 make_tuple(16, 8, sad_16x8_sse2_vp9), | |
| 567 make_tuple(8, 16, sad_8x16_sse2_vp9), | |
| 568 make_tuple(8, 8, sad_8x8_sse2_vp9), | |
| 569 make_tuple(8, 4, sad_8x4_sse2_vp9), | |
| 570 }; | |
| 571 INSTANTIATE_TEST_CASE_P(SSE2, SADVP9Test, ::testing::ValuesIn(sse2_vp9_tests)); | |
| 572 | 985 |
| 573 const SadMxNx4Func sad_64x64x4d_sse2 = vp9_sad64x64x4d_sse2; | 986 const SadMxNx4Func sad_64x64x4d_sse2 = vp9_sad64x64x4d_sse2; |
| 574 const SadMxNx4Func sad_64x32x4d_sse2 = vp9_sad64x32x4d_sse2; | 987 const SadMxNx4Func sad_64x32x4d_sse2 = vp9_sad64x32x4d_sse2; |
| 575 const SadMxNx4Func sad_32x64x4d_sse2 = vp9_sad32x64x4d_sse2; | 988 const SadMxNx4Func sad_32x64x4d_sse2 = vp9_sad32x64x4d_sse2; |
| 576 const SadMxNx4Func sad_32x32x4d_sse2 = vp9_sad32x32x4d_sse2; | 989 const SadMxNx4Func sad_32x32x4d_sse2 = vp9_sad32x32x4d_sse2; |
| 577 const SadMxNx4Func sad_32x16x4d_sse2 = vp9_sad32x16x4d_sse2; | 990 const SadMxNx4Func sad_32x16x4d_sse2 = vp9_sad32x16x4d_sse2; |
| 578 const SadMxNx4Func sad_16x32x4d_sse2 = vp9_sad16x32x4d_sse2; | 991 const SadMxNx4Func sad_16x32x4d_sse2 = vp9_sad16x32x4d_sse2; |
| 579 const SadMxNx4Func sad_16x16x4d_sse2 = vp9_sad16x16x4d_sse2; | 992 const SadMxNx4Func sad_16x16x4d_sse2 = vp9_sad16x16x4d_sse2; |
| 580 const SadMxNx4Func sad_16x8x4d_sse2 = vp9_sad16x8x4d_sse2; | 993 const SadMxNx4Func sad_16x8x4d_sse2 = vp9_sad16x8x4d_sse2; |
| 581 const SadMxNx4Func sad_8x16x4d_sse2 = vp9_sad8x16x4d_sse2; | 994 const SadMxNx4Func sad_8x16x4d_sse2 = vp9_sad8x16x4d_sse2; |
| 582 const SadMxNx4Func sad_8x8x4d_sse2 = vp9_sad8x8x4d_sse2; | 995 const SadMxNx4Func sad_8x8x4d_sse2 = vp9_sad8x8x4d_sse2; |
| 583 const SadMxNx4Func sad_8x4x4d_sse2 = vp9_sad8x4x4d_sse2; | 996 const SadMxNx4Func sad_8x4x4d_sse2 = vp9_sad8x4x4d_sse2; |
| 997 |
| 998 #if CONFIG_VP9_HIGHBITDEPTH |
| 999 const SadMxNVp9Func highbd_sad8x4_sse2_vp9 = vp9_highbd_sad8x4_sse2; |
| 1000 const SadMxNVp9Func highbd_sad8x8_sse2_vp9 = vp9_highbd_sad8x8_sse2; |
| 1001 const SadMxNVp9Func highbd_sad8x16_sse2_vp9 = vp9_highbd_sad8x16_sse2; |
| 1002 const SadMxNVp9Func highbd_sad16x8_sse2_vp9 = vp9_highbd_sad16x8_sse2; |
| 1003 const SadMxNVp9Func highbd_sad16x16_sse2_vp9 = vp9_highbd_sad16x16_sse2; |
| 1004 const SadMxNVp9Func highbd_sad16x32_sse2_vp9 = vp9_highbd_sad16x32_sse2; |
| 1005 const SadMxNVp9Func highbd_sad32x16_sse2_vp9 = vp9_highbd_sad32x16_sse2; |
| 1006 const SadMxNVp9Func highbd_sad32x32_sse2_vp9 = vp9_highbd_sad32x32_sse2; |
| 1007 const SadMxNVp9Func highbd_sad32x64_sse2_vp9 = vp9_highbd_sad32x64_sse2; |
| 1008 const SadMxNVp9Func highbd_sad64x32_sse2_vp9 = vp9_highbd_sad64x32_sse2; |
| 1009 const SadMxNVp9Func highbd_sad64x64_sse2_vp9 = vp9_highbd_sad64x64_sse2; |
| 1010 |
| 1011 INSTANTIATE_TEST_CASE_P(SSE2, SADVP9Test, ::testing::Values( |
| 1012 make_tuple(64, 64, sad_64x64_sse2_vp9, -1), |
| 1013 make_tuple(64, 32, sad_64x32_sse2_vp9, -1), |
| 1014 make_tuple(32, 64, sad_32x64_sse2_vp9, -1), |
| 1015 make_tuple(32, 32, sad_32x32_sse2_vp9, -1), |
| 1016 make_tuple(32, 16, sad_32x16_sse2_vp9, -1), |
| 1017 make_tuple(16, 32, sad_16x32_sse2_vp9, -1), |
| 1018 make_tuple(16, 16, sad_16x16_sse2_vp9, -1), |
| 1019 make_tuple(16, 8, sad_16x8_sse2_vp9, -1), |
| 1020 make_tuple(8, 16, sad_8x16_sse2_vp9, -1), |
| 1021 make_tuple(8, 8, sad_8x8_sse2_vp9, -1), |
| 1022 make_tuple(8, 4, sad_8x4_sse2_vp9, -1), |
| 1023 make_tuple(8, 4, highbd_sad8x4_sse2_vp9, 8), |
| 1024 make_tuple(8, 8, highbd_sad8x8_sse2_vp9, 8), |
| 1025 make_tuple(8, 16, highbd_sad8x16_sse2_vp9, 8), |
| 1026 make_tuple(16, 8, highbd_sad16x8_sse2_vp9, 8), |
| 1027 make_tuple(16, 16, highbd_sad16x16_sse2_vp9, 8), |
| 1028 make_tuple(16, 32, highbd_sad16x32_sse2_vp9, 8), |
| 1029 make_tuple(32, 16, highbd_sad32x16_sse2_vp9, 8), |
| 1030 make_tuple(32, 32, highbd_sad32x32_sse2_vp9, 8), |
| 1031 make_tuple(32, 64, highbd_sad32x64_sse2_vp9, 8), |
| 1032 make_tuple(64, 32, highbd_sad64x32_sse2_vp9, 8), |
| 1033 make_tuple(64, 64, highbd_sad64x64_sse2_vp9, 8), |
| 1034 make_tuple(8, 4, highbd_sad8x4_sse2_vp9, 10), |
| 1035 make_tuple(8, 8, highbd_sad8x8_sse2_vp9, 10), |
| 1036 make_tuple(8, 16, highbd_sad8x16_sse2_vp9, 10), |
| 1037 make_tuple(16, 8, highbd_sad16x8_sse2_vp9, 10), |
| 1038 make_tuple(16, 16, highbd_sad16x16_sse2_vp9, 10), |
| 1039 make_tuple(16, 32, highbd_sad16x32_sse2_vp9, 10), |
| 1040 make_tuple(32, 16, highbd_sad32x16_sse2_vp9, 10), |
| 1041 make_tuple(32, 32, highbd_sad32x32_sse2_vp9, 10), |
| 1042 make_tuple(32, 64, highbd_sad32x64_sse2_vp9, 10), |
| 1043 make_tuple(64, 32, highbd_sad64x32_sse2_vp9, 10), |
| 1044 make_tuple(64, 64, highbd_sad64x64_sse2_vp9, 10), |
| 1045 make_tuple(8, 4, highbd_sad8x4_sse2_vp9, 12), |
| 1046 make_tuple(8, 8, highbd_sad8x8_sse2_vp9, 12), |
| 1047 make_tuple(8, 16, highbd_sad8x16_sse2_vp9, 12), |
| 1048 make_tuple(16, 8, highbd_sad16x8_sse2_vp9, 12), |
| 1049 make_tuple(16, 16, highbd_sad16x16_sse2_vp9, 12), |
| 1050 make_tuple(16, 32, highbd_sad16x32_sse2_vp9, 12), |
| 1051 make_tuple(32, 16, highbd_sad32x16_sse2_vp9, 12), |
| 1052 make_tuple(32, 32, highbd_sad32x32_sse2_vp9, 12), |
| 1053 make_tuple(32, 64, highbd_sad32x64_sse2_vp9, 12), |
| 1054 make_tuple(64, 32, highbd_sad64x32_sse2_vp9, 12), |
| 1055 make_tuple(64, 64, highbd_sad64x64_sse2_vp9, 12))); |
| 1056 |
| 1057 const SadMxNAvgVp9Func highbd_sad8x4_avg_sse2_vp9 = vp9_highbd_sad8x4_avg_sse2; |
| 1058 const SadMxNAvgVp9Func highbd_sad8x8_avg_sse2_vp9 = vp9_highbd_sad8x8_avg_sse2; |
| 1059 const SadMxNAvgVp9Func highbd_sad8x16_avg_sse2_vp9 = |
| 1060 vp9_highbd_sad8x16_avg_sse2; |
| 1061 const SadMxNAvgVp9Func highbd_sad16x8_avg_sse2_vp9 = |
| 1062 vp9_highbd_sad16x8_avg_sse2; |
| 1063 const SadMxNAvgVp9Func highbd_sad16x16_avg_sse2_vp9 = |
| 1064 vp9_highbd_sad16x16_avg_sse2; |
| 1065 const SadMxNAvgVp9Func highbd_sad16x32_avg_sse2_vp9 = |
| 1066 vp9_highbd_sad16x32_avg_sse2; |
| 1067 const SadMxNAvgVp9Func highbd_sad32x16_avg_sse2_vp9 = |
| 1068 vp9_highbd_sad32x16_avg_sse2; |
| 1069 const SadMxNAvgVp9Func highbd_sad32x32_avg_sse2_vp9 = |
| 1070 vp9_highbd_sad32x32_avg_sse2; |
| 1071 const SadMxNAvgVp9Func highbd_sad32x64_avg_sse2_vp9 = |
| 1072 vp9_highbd_sad32x64_avg_sse2; |
| 1073 const SadMxNAvgVp9Func highbd_sad64x32_avg_sse2_vp9 = |
| 1074 vp9_highbd_sad64x32_avg_sse2; |
| 1075 const SadMxNAvgVp9Func highbd_sad64x64_avg_sse2_vp9 = |
| 1076 vp9_highbd_sad64x64_avg_sse2; |
| 1077 |
| 1078 INSTANTIATE_TEST_CASE_P(SSE2, SADavgVP9Test, ::testing::Values( |
| 1079 make_tuple(8, 4, highbd_sad8x4_avg_sse2_vp9, 8), |
| 1080 make_tuple(8, 8, highbd_sad8x8_avg_sse2_vp9, 8), |
| 1081 make_tuple(8, 16, highbd_sad8x16_avg_sse2_vp9, 8), |
| 1082 make_tuple(16, 8, highbd_sad16x8_avg_sse2_vp9, 8), |
| 1083 make_tuple(16, 16, highbd_sad16x16_avg_sse2_vp9, 8), |
| 1084 make_tuple(16, 32, highbd_sad16x32_avg_sse2_vp9, 8), |
| 1085 make_tuple(32, 16, highbd_sad32x16_avg_sse2_vp9, 8), |
| 1086 make_tuple(32, 32, highbd_sad32x32_avg_sse2_vp9, 8), |
| 1087 make_tuple(32, 64, highbd_sad32x64_avg_sse2_vp9, 8), |
| 1088 make_tuple(64, 32, highbd_sad64x32_avg_sse2_vp9, 8), |
| 1089 make_tuple(64, 64, highbd_sad64x64_avg_sse2_vp9, 8), |
| 1090 make_tuple(8, 4, highbd_sad8x4_avg_sse2_vp9, 10), |
| 1091 make_tuple(8, 8, highbd_sad8x8_avg_sse2_vp9, 10), |
| 1092 make_tuple(8, 16, highbd_sad8x16_avg_sse2_vp9, 10), |
| 1093 make_tuple(16, 8, highbd_sad16x8_avg_sse2_vp9, 10), |
| 1094 make_tuple(16, 16, highbd_sad16x16_avg_sse2_vp9, 10), |
| 1095 make_tuple(16, 32, highbd_sad16x32_avg_sse2_vp9, 10), |
| 1096 make_tuple(32, 16, highbd_sad32x16_avg_sse2_vp9, 10), |
| 1097 make_tuple(32, 32, highbd_sad32x32_avg_sse2_vp9, 10), |
| 1098 make_tuple(32, 64, highbd_sad32x64_avg_sse2_vp9, 10), |
| 1099 make_tuple(64, 32, highbd_sad64x32_avg_sse2_vp9, 10), |
| 1100 make_tuple(64, 64, highbd_sad64x64_avg_sse2_vp9, 10), |
| 1101 make_tuple(8, 4, highbd_sad8x4_avg_sse2_vp9, 12), |
| 1102 make_tuple(8, 8, highbd_sad8x8_avg_sse2_vp9, 12), |
| 1103 make_tuple(8, 16, highbd_sad8x16_avg_sse2_vp9, 12), |
| 1104 make_tuple(16, 8, highbd_sad16x8_avg_sse2_vp9, 12), |
| 1105 make_tuple(16, 16, highbd_sad16x16_avg_sse2_vp9, 12), |
| 1106 make_tuple(16, 32, highbd_sad16x32_avg_sse2_vp9, 12), |
| 1107 make_tuple(32, 16, highbd_sad32x16_avg_sse2_vp9, 12), |
| 1108 make_tuple(32, 32, highbd_sad32x32_avg_sse2_vp9, 12), |
| 1109 make_tuple(32, 64, highbd_sad32x64_avg_sse2_vp9, 12), |
| 1110 make_tuple(64, 32, highbd_sad64x32_avg_sse2_vp9, 12), |
| 1111 make_tuple(64, 64, highbd_sad64x64_avg_sse2_vp9, 12))); |
| 1112 |
| 1113 const SadMxNx4Func highbd_sad_64x64x4d_sse2 = vp9_highbd_sad64x64x4d_sse2; |
| 1114 const SadMxNx4Func highbd_sad_64x32x4d_sse2 = vp9_highbd_sad64x32x4d_sse2; |
| 1115 const SadMxNx4Func highbd_sad_32x64x4d_sse2 = vp9_highbd_sad32x64x4d_sse2; |
| 1116 const SadMxNx4Func highbd_sad_32x32x4d_sse2 = vp9_highbd_sad32x32x4d_sse2; |
| 1117 const SadMxNx4Func highbd_sad_32x16x4d_sse2 = vp9_highbd_sad32x16x4d_sse2; |
| 1118 const SadMxNx4Func highbd_sad_16x32x4d_sse2 = vp9_highbd_sad16x32x4d_sse2; |
| 1119 const SadMxNx4Func highbd_sad_16x16x4d_sse2 = vp9_highbd_sad16x16x4d_sse2; |
| 1120 const SadMxNx4Func highbd_sad_16x8x4d_sse2 = vp9_highbd_sad16x8x4d_sse2; |
| 1121 const SadMxNx4Func highbd_sad_8x16x4d_sse2 = vp9_highbd_sad8x16x4d_sse2; |
| 1122 const SadMxNx4Func highbd_sad_8x8x4d_sse2 = vp9_highbd_sad8x8x4d_sse2; |
| 1123 const SadMxNx4Func highbd_sad_8x4x4d_sse2 = vp9_highbd_sad8x4x4d_sse2; |
| 1124 const SadMxNx4Func highbd_sad_4x8x4d_sse2 = vp9_highbd_sad4x8x4d_sse2; |
| 1125 const SadMxNx4Func highbd_sad_4x4x4d_sse2 = vp9_highbd_sad4x4x4d_sse2; |
| 1126 |
| 584 INSTANTIATE_TEST_CASE_P(SSE2, SADx4Test, ::testing::Values( | 1127 INSTANTIATE_TEST_CASE_P(SSE2, SADx4Test, ::testing::Values( |
| 585 make_tuple(64, 64, sad_64x64x4d_sse2), | 1128 make_tuple(64, 64, sad_64x64x4d_sse2, -1), |
| 586 make_tuple(64, 32, sad_64x32x4d_sse2), | 1129 make_tuple(64, 32, sad_64x32x4d_sse2, -1), |
| 587 make_tuple(32, 64, sad_32x64x4d_sse2), | 1130 make_tuple(32, 64, sad_32x64x4d_sse2, -1), |
| 588 make_tuple(32, 32, sad_32x32x4d_sse2), | 1131 make_tuple(32, 32, sad_32x32x4d_sse2, -1), |
| 589 make_tuple(32, 16, sad_32x16x4d_sse2), | 1132 make_tuple(32, 16, sad_32x16x4d_sse2, -1), |
| 590 make_tuple(16, 32, sad_16x32x4d_sse2), | 1133 make_tuple(16, 32, sad_16x32x4d_sse2, -1), |
| 591 make_tuple(16, 16, sad_16x16x4d_sse2), | 1134 make_tuple(16, 16, sad_16x16x4d_sse2, -1), |
| 592 make_tuple(16, 8, sad_16x8x4d_sse2), | 1135 make_tuple(16, 8, sad_16x8x4d_sse2, -1), |
| 593 make_tuple(8, 16, sad_8x16x4d_sse2), | 1136 make_tuple(8, 16, sad_8x16x4d_sse2, -1), |
| 594 make_tuple(8, 8, sad_8x8x4d_sse2), | 1137 make_tuple(8, 8, sad_8x8x4d_sse2, -1), |
| 595 make_tuple(8, 4, sad_8x4x4d_sse2))); | 1138 make_tuple(8, 4, sad_8x4x4d_sse2, -1), |
| 1139 make_tuple(64, 64, highbd_sad_64x64x4d_sse2, 8), |
| 1140 make_tuple(64, 32, highbd_sad_64x32x4d_sse2, 8), |
| 1141 make_tuple(32, 64, highbd_sad_32x64x4d_sse2, 8), |
| 1142 make_tuple(32, 32, highbd_sad_32x32x4d_sse2, 8), |
| 1143 make_tuple(32, 16, highbd_sad_32x16x4d_sse2, 8), |
| 1144 make_tuple(16, 32, highbd_sad_16x32x4d_sse2, 8), |
| 1145 make_tuple(16, 16, highbd_sad_16x16x4d_sse2, 8), |
| 1146 make_tuple(16, 8, highbd_sad_16x8x4d_sse2, 8), |
| 1147 make_tuple(8, 16, highbd_sad_8x16x4d_sse2, 8), |
| 1148 make_tuple(8, 8, highbd_sad_8x8x4d_sse2, 8), |
| 1149 make_tuple(8, 4, highbd_sad_8x4x4d_sse2, 8), |
| 1150 make_tuple(4, 8, highbd_sad_4x8x4d_sse2, 8), |
| 1151 make_tuple(4, 4, highbd_sad_4x4x4d_sse2, 8), |
| 1152 make_tuple(64, 64, highbd_sad_64x64x4d_sse2, 10), |
| 1153 make_tuple(64, 32, highbd_sad_64x32x4d_sse2, 10), |
| 1154 make_tuple(32, 64, highbd_sad_32x64x4d_sse2, 10), |
| 1155 make_tuple(32, 32, highbd_sad_32x32x4d_sse2, 10), |
| 1156 make_tuple(32, 16, highbd_sad_32x16x4d_sse2, 10), |
| 1157 make_tuple(16, 32, highbd_sad_16x32x4d_sse2, 10), |
| 1158 make_tuple(16, 16, highbd_sad_16x16x4d_sse2, 10), |
| 1159 make_tuple(16, 8, highbd_sad_16x8x4d_sse2, 10), |
| 1160 make_tuple(8, 16, highbd_sad_8x16x4d_sse2, 10), |
| 1161 make_tuple(8, 8, highbd_sad_8x8x4d_sse2, 10), |
| 1162 make_tuple(8, 4, highbd_sad_8x4x4d_sse2, 10), |
| 1163 make_tuple(4, 8, highbd_sad_4x8x4d_sse2, 10), |
| 1164 make_tuple(4, 4, highbd_sad_4x4x4d_sse2, 10), |
| 1165 make_tuple(64, 64, highbd_sad_64x64x4d_sse2, 12), |
| 1166 make_tuple(64, 32, highbd_sad_64x32x4d_sse2, 12), |
| 1167 make_tuple(32, 64, highbd_sad_32x64x4d_sse2, 12), |
| 1168 make_tuple(32, 32, highbd_sad_32x32x4d_sse2, 12), |
| 1169 make_tuple(32, 16, highbd_sad_32x16x4d_sse2, 12), |
| 1170 make_tuple(16, 32, highbd_sad_16x32x4d_sse2, 12), |
| 1171 make_tuple(16, 16, highbd_sad_16x16x4d_sse2, 12), |
| 1172 make_tuple(16, 8, highbd_sad_16x8x4d_sse2, 12), |
| 1173 make_tuple(8, 16, highbd_sad_8x16x4d_sse2, 12), |
| 1174 make_tuple(8, 8, highbd_sad_8x8x4d_sse2, 12), |
| 1175 make_tuple(8, 4, highbd_sad_8x4x4d_sse2, 12), |
| 1176 make_tuple(4, 8, highbd_sad_4x8x4d_sse2, 12), |
| 1177 make_tuple(4, 4, highbd_sad_4x4x4d_sse2, 12))); |
| 1178 #else |
| 1179 INSTANTIATE_TEST_CASE_P(SSE2, SADVP9Test, ::testing::Values( |
| 1180 make_tuple(64, 64, sad_64x64_sse2_vp9, -1), |
| 1181 make_tuple(64, 32, sad_64x32_sse2_vp9, -1), |
| 1182 make_tuple(32, 64, sad_32x64_sse2_vp9, -1), |
| 1183 make_tuple(32, 32, sad_32x32_sse2_vp9, -1), |
| 1184 make_tuple(32, 16, sad_32x16_sse2_vp9, -1), |
| 1185 make_tuple(16, 32, sad_16x32_sse2_vp9, -1), |
| 1186 make_tuple(16, 16, sad_16x16_sse2_vp9, -1), |
| 1187 make_tuple(16, 8, sad_16x8_sse2_vp9, -1), |
| 1188 make_tuple(8, 16, sad_8x16_sse2_vp9, -1), |
| 1189 make_tuple(8, 8, sad_8x8_sse2_vp9, -1), |
| 1190 make_tuple(8, 4, sad_8x4_sse2_vp9, -1))); |
| 1191 |
| 1192 INSTANTIATE_TEST_CASE_P(SSE2, SADx4Test, ::testing::Values( |
| 1193 make_tuple(64, 64, sad_64x64x4d_sse2, -1), |
| 1194 make_tuple(64, 32, sad_64x32x4d_sse2, -1), |
| 1195 make_tuple(32, 64, sad_32x64x4d_sse2, -1), |
| 1196 make_tuple(32, 32, sad_32x32x4d_sse2, -1), |
| 1197 make_tuple(32, 16, sad_32x16x4d_sse2, -1), |
| 1198 make_tuple(16, 32, sad_16x32x4d_sse2, -1), |
| 1199 make_tuple(16, 16, sad_16x16x4d_sse2, -1), |
| 1200 make_tuple(16, 8, sad_16x8x4d_sse2, -1), |
| 1201 make_tuple(8, 16, sad_8x16x4d_sse2, -1), |
| 1202 make_tuple(8, 8, sad_8x8x4d_sse2, -1), |
| 1203 make_tuple(8, 4, sad_8x4x4d_sse2, -1))); |
| 1204 #endif // CONFIG_VP9_HIGHBITDEPTH |
| 596 #endif // CONFIG_USE_X86INC | 1205 #endif // CONFIG_USE_X86INC |
| 597 #endif // CONFIG_VP9_ENCODER | 1206 #endif // CONFIG_VP9_ENCODER |
| 598 #endif // HAVE_SSE2 | 1207 #endif // HAVE_SSE2 |
| 599 | 1208 |
| 600 #if HAVE_SSE3 | 1209 #if HAVE_SSE3 |
| 601 #if CONFIG_VP8_ENCODER | 1210 #if CONFIG_VP8_ENCODER |
| 602 const SadMxNx4Func sad_16x16x4d_sse3 = vp8_sad16x16x4d_sse3; | 1211 const SadMxNx4Func sad_16x16x4d_sse3 = vp8_sad16x16x4d_sse3; |
| 603 const SadMxNx4Func sad_16x8x4d_sse3 = vp8_sad16x8x4d_sse3; | 1212 const SadMxNx4Func sad_16x8x4d_sse3 = vp8_sad16x8x4d_sse3; |
| 604 const SadMxNx4Func sad_8x16x4d_sse3 = vp8_sad8x16x4d_sse3; | 1213 const SadMxNx4Func sad_8x16x4d_sse3 = vp8_sad8x16x4d_sse3; |
| 605 const SadMxNx4Func sad_8x8x4d_sse3 = vp8_sad8x8x4d_sse3; | 1214 const SadMxNx4Func sad_8x8x4d_sse3 = vp8_sad8x8x4d_sse3; |
| 606 const SadMxNx4Func sad_4x4x4d_sse3 = vp8_sad4x4x4d_sse3; | 1215 const SadMxNx4Func sad_4x4x4d_sse3 = vp8_sad4x4x4d_sse3; |
| 607 INSTANTIATE_TEST_CASE_P(SSE3, SADx4Test, ::testing::Values( | 1216 INSTANTIATE_TEST_CASE_P(SSE3, SADx4Test, ::testing::Values( |
| 608 make_tuple(16, 16, sad_16x16x4d_sse3), | 1217 make_tuple(16, 16, sad_16x16x4d_sse3, -1), |
| 609 make_tuple(16, 8, sad_16x8x4d_sse3), | 1218 make_tuple(16, 8, sad_16x8x4d_sse3, -1), |
| 610 make_tuple(8, 16, sad_8x16x4d_sse3), | 1219 make_tuple(8, 16, sad_8x16x4d_sse3, -1), |
| 611 make_tuple(8, 8, sad_8x8x4d_sse3), | 1220 make_tuple(8, 8, sad_8x8x4d_sse3, -1), |
| 612 make_tuple(4, 4, sad_4x4x4d_sse3))); | 1221 make_tuple(4, 4, sad_4x4x4d_sse3, -1))); |
| 613 #endif // CONFIG_VP8_ENCODER | 1222 #endif // CONFIG_VP8_ENCODER |
| 614 #endif // HAVE_SSE3 | 1223 #endif // HAVE_SSE3 |
| 615 | 1224 |
| 616 #if HAVE_SSSE3 | 1225 #if HAVE_SSSE3 |
| 617 #if CONFIG_USE_X86INC | 1226 #if CONFIG_USE_X86INC |
| 618 #if CONFIG_VP8_ENCODER | 1227 #if CONFIG_VP8_ENCODER |
| 619 const SadMxNFunc sad_16x16_sse3 = vp8_sad16x16_sse3; | 1228 const SadMxNFunc sad_16x16_sse3 = vp8_sad16x16_sse3; |
| 620 INSTANTIATE_TEST_CASE_P(SSE3, SADTest, ::testing::Values( | 1229 INSTANTIATE_TEST_CASE_P(SSE3, SADTest, ::testing::Values( |
| 621 make_tuple(16, 16, sad_16x16_sse3))); | 1230 make_tuple(16, 16, sad_16x16_sse3, -1))); |
| 622 #endif // CONFIG_VP8_ENCODER | 1231 #endif // CONFIG_VP8_ENCODER |
| 623 #endif // CONFIG_USE_X86INC | 1232 #endif // CONFIG_USE_X86INC |
| 624 #endif // HAVE_SSSE3 | 1233 #endif // HAVE_SSSE3 |
| 625 | 1234 |
| 626 #if HAVE_AVX2 | 1235 #if HAVE_AVX2 |
| 627 #if CONFIG_VP9_ENCODER | 1236 #if CONFIG_VP9_ENCODER |
| 628 const SadMxNVp9Func sad_64x64_avx2_vp9 = vp9_sad64x64_avx2; | |
| 629 const SadMxNVp9Func sad_64x32_avx2_vp9 = vp9_sad64x32_avx2; | |
| 630 const SadMxNVp9Func sad_32x64_avx2_vp9 = vp9_sad32x64_avx2; | |
| 631 const SadMxNVp9Func sad_32x32_avx2_vp9 = vp9_sad32x32_avx2; | |
| 632 const SadMxNVp9Func sad_32x16_avx2_vp9 = vp9_sad32x16_avx2; | |
| 633 const SadMxNVp9Param avx2_vp9_tests[] = { | |
| 634 make_tuple(64, 64, sad_64x64_avx2_vp9), | |
| 635 make_tuple(64, 32, sad_64x32_avx2_vp9), | |
| 636 make_tuple(32, 64, sad_32x64_avx2_vp9), | |
| 637 make_tuple(32, 32, sad_32x32_avx2_vp9), | |
| 638 make_tuple(32, 16, sad_32x16_avx2_vp9), | |
| 639 }; | |
| 640 INSTANTIATE_TEST_CASE_P(AVX2, SADVP9Test, ::testing::ValuesIn(avx2_vp9_tests)); | |
| 641 | |
| 642 const SadMxNx4Func sad_64x64x4d_avx2 = vp9_sad64x64x4d_avx2; | 1237 const SadMxNx4Func sad_64x64x4d_avx2 = vp9_sad64x64x4d_avx2; |
| 643 const SadMxNx4Func sad_32x32x4d_avx2 = vp9_sad32x32x4d_avx2; | 1238 const SadMxNx4Func sad_32x32x4d_avx2 = vp9_sad32x32x4d_avx2; |
| 644 INSTANTIATE_TEST_CASE_P(AVX2, SADx4Test, ::testing::Values( | 1239 INSTANTIATE_TEST_CASE_P(AVX2, SADx4Test, ::testing::Values( |
| 645 make_tuple(32, 32, sad_32x32x4d_avx2), | 1240 make_tuple(32, 32, sad_32x32x4d_avx2, -1), |
| 646 make_tuple(64, 64, sad_64x64x4d_avx2))); | 1241 make_tuple(64, 64, sad_64x64x4d_avx2, -1))); |
| 647 #endif // CONFIG_VP9_ENCODER | 1242 #endif // CONFIG_VP9_ENCODER |
| 648 #endif // HAVE_AVX2 | 1243 #endif // HAVE_AVX2 |
| 649 | 1244 |
| 650 } // namespace | 1245 } // namespace |
| OLD | NEW |