Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(129)

Side by Side Diff: source/libvpx/test/variance_test.cc

Issue 1162573005: libvpx: Pull from upstream (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/libvpx.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « source/libvpx/test/test_vectors.cc ('k') | source/libvpx/test/vp9_error_block_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include <cstdlib> 11 #include <cstdlib>
12 #include <new> 12 #include <new>
13 13
14 #include "test/acm_random.h" 14 #include "test/acm_random.h"
15 #include "test/clear_system_state.h" 15 #include "test/clear_system_state.h"
16 #include "test/register_state_check.h" 16 #include "test/register_state_check.h"
17 #include "third_party/googletest/src/include/gtest/gtest.h" 17 #include "third_party/googletest/src/include/gtest/gtest.h"
18 18
19 #include "./vpx_config.h" 19 #include "./vpx_config.h"
20 #include "vpx/vpx_codec.h" 20 #include "vpx/vpx_codec.h"
21 #include "vpx/vpx_integer.h" 21 #include "vpx/vpx_integer.h"
22 #include "vpx_mem/vpx_mem.h" 22 #include "vpx_mem/vpx_mem.h"
23 #if CONFIG_VP8_ENCODER 23 #include "vpx_ports/mem.h"
24 # include "./vp8_rtcd.h"
25 # include "vp8/common/variance.h"
26 #endif
27 #if CONFIG_VP9_ENCODER 24 #if CONFIG_VP9_ENCODER
28 # include "./vp9_rtcd.h" 25 # include "./vp9_rtcd.h"
29 # include "vp9/encoder/vp9_variance.h" 26 # include "vp9/encoder/vp9_variance.h"
30 #endif 27 #endif // CONFIG_VP9_ENCODER
28 #include "./vpx_dsp_rtcd.h"
31 29
32 namespace { 30 namespace {
33 31
32 typedef unsigned int (*VarianceMxNFunc)(const uint8_t *a, int a_stride,
33 const uint8_t *b, int b_stride,
34 unsigned int *sse);
35 typedef unsigned int (*Get4x4SseFunc)(const uint8_t *a, int a_stride,
36 const uint8_t *b, int b_stride);
37
38
34 using ::std::tr1::get; 39 using ::std::tr1::get;
35 using ::std::tr1::make_tuple; 40 using ::std::tr1::make_tuple;
36 using ::std::tr1::tuple; 41 using ::std::tr1::tuple;
37 using libvpx_test::ACMRandom; 42 using libvpx_test::ACMRandom;
38 43
44 // Truncate high bit depth results by downshifting (with rounding) by:
45 // 2 * (bit_depth - 8) for sse
46 // (bit_depth - 8) for se
47 static void RoundHighBitDepth(int bit_depth, int64_t *se, uint64_t *sse) {
48 switch (bit_depth) {
49 case VPX_BITS_12:
50 *sse = (*sse + 128) >> 8;
51 *se = (*se + 8) >> 4;
52 break;
53 case VPX_BITS_10:
54 *sse = (*sse + 8) >> 4;
55 *se = (*se + 2) >> 2;
56 break;
57 case VPX_BITS_8:
58 default:
59 break;
60 }
61 }
62
39 static unsigned int mb_ss_ref(const int16_t *src) { 63 static unsigned int mb_ss_ref(const int16_t *src) {
40 unsigned int res = 0; 64 unsigned int res = 0;
41 for (int i = 0; i < 256; ++i) { 65 for (int i = 0; i < 256; ++i) {
42 res += src[i] * src[i]; 66 res += src[i] * src[i];
43 } 67 }
44 return res; 68 return res;
45 } 69 }
46 70
47 static unsigned int variance_ref(const uint8_t *src, const uint8_t *ref, 71 static unsigned int variance_ref(const uint8_t *src, const uint8_t *ref,
48 int l2w, int l2h, int src_stride_coeff, 72 int l2w, int l2h, int src_stride_coeff,
49 int ref_stride_coeff, uint32_t *sse_ptr, 73 int ref_stride_coeff, uint32_t *sse_ptr,
50 bool use_high_bit_depth_, 74 bool use_high_bit_depth_,
51 vpx_bit_depth_t bit_depth) { 75 vpx_bit_depth_t bit_depth) {
52 #if CONFIG_VP9_HIGHBITDEPTH
53 int64_t se = 0; 76 int64_t se = 0;
54 uint64_t sse = 0; 77 uint64_t sse = 0;
55 const int w = 1 << l2w; 78 const int w = 1 << l2w;
56 const int h = 1 << l2h; 79 const int h = 1 << l2h;
57 for (int y = 0; y < h; y++) { 80 for (int y = 0; y < h; y++) {
58 for (int x = 0; x < w; x++) { 81 for (int x = 0; x < w; x++) {
59 int diff; 82 int diff;
60 if (!use_high_bit_depth_) { 83 if (!use_high_bit_depth_) {
61 diff = ref[w * y * ref_stride_coeff + x] - 84 diff = ref[w * y * ref_stride_coeff + x] -
62 src[w * y * src_stride_coeff + x]; 85 src[w * y * src_stride_coeff + x];
63 se += diff; 86 se += diff;
64 sse += diff * diff; 87 sse += diff * diff;
88 #if CONFIG_VP9_HIGHBITDEPTH
65 } else { 89 } else {
66 diff = CONVERT_TO_SHORTPTR(ref)[w * y * ref_stride_coeff + x] - 90 diff = CONVERT_TO_SHORTPTR(ref)[w * y * ref_stride_coeff + x] -
67 CONVERT_TO_SHORTPTR(src)[w * y * src_stride_coeff + x]; 91 CONVERT_TO_SHORTPTR(src)[w * y * src_stride_coeff + x];
68 se += diff; 92 se += diff;
69 sse += diff * diff; 93 sse += diff * diff;
94 #endif // CONFIG_VP9_HIGHBITDEPTH
70 } 95 }
71 } 96 }
72 } 97 }
73 if (bit_depth > VPX_BITS_8) { 98 RoundHighBitDepth(bit_depth, &se, &sse);
74 sse = ROUND_POWER_OF_TWO(sse, 2 * (bit_depth - 8)); 99 *sse_ptr = (uint32_t) sse;
75 se = ROUND_POWER_OF_TWO(se, bit_depth - 8); 100 return (unsigned int) (sse - (((int64_t) se * se) >> (l2w + l2h)));
76 }
77 #else
78 int se = 0;
79 unsigned int sse = 0;
80 const int w = 1 << l2w;
81 const int h = 1 << l2h;
82 for (int y = 0; y < h; y++) {
83 for (int x = 0; x < w; x++) {
84 int diff = ref[w * y * ref_stride_coeff + x] -
85 src[w * y * src_stride_coeff + x];
86 se += diff;
87 sse += diff * diff;
88 }
89 }
90 #endif // CONFIG_VP9_HIGHBITDEPTH
91 *sse_ptr = sse;
92 return sse - (((int64_t) se * se) >> (l2w + l2h));
93 } 101 }
94 102
95 static unsigned int subpel_variance_ref(const uint8_t *ref, const uint8_t *src, 103 static unsigned int subpel_variance_ref(const uint8_t *ref, const uint8_t *src,
96 int l2w, int l2h, int xoff, int yoff, 104 int l2w, int l2h, int xoff, int yoff,
97 unsigned int *sse_ptr, 105 unsigned int *sse_ptr,
98 bool use_high_bit_depth_, 106 bool use_high_bit_depth_,
99 vpx_bit_depth_t bit_depth) { 107 vpx_bit_depth_t bit_depth) {
100 #if CONFIG_VP9_HIGHBITDEPTH
101 int64_t se = 0; 108 int64_t se = 0;
102 uint64_t sse = 0; 109 uint64_t sse = 0;
103 const int w = 1 << l2w; 110 const int w = 1 << l2w;
104 const int h = 1 << l2h; 111 const int h = 1 << l2h;
105 for (int y = 0; y < h; y++) { 112 for (int y = 0; y < h; y++) {
106 for (int x = 0; x < w; x++) { 113 for (int x = 0; x < w; x++) {
107 // Bilinear interpolation at a 16th pel step. 114 // Bilinear interpolation at a 16th pel step.
108 if (!use_high_bit_depth_) { 115 if (!use_high_bit_depth_) {
109 const int a1 = ref[(w + 1) * (y + 0) + x + 0]; 116 const int a1 = ref[(w + 1) * (y + 0) + x + 0];
110 const int a2 = ref[(w + 1) * (y + 0) + x + 1]; 117 const int a2 = ref[(w + 1) * (y + 0) + x + 1];
111 const int b1 = ref[(w + 1) * (y + 1) + x + 0]; 118 const int b1 = ref[(w + 1) * (y + 1) + x + 0];
112 const int b2 = ref[(w + 1) * (y + 1) + x + 1]; 119 const int b2 = ref[(w + 1) * (y + 1) + x + 1];
113 const int a = a1 + (((a2 - a1) * xoff + 8) >> 4); 120 const int a = a1 + (((a2 - a1) * xoff + 8) >> 4);
114 const int b = b1 + (((b2 - b1) * xoff + 8) >> 4); 121 const int b = b1 + (((b2 - b1) * xoff + 8) >> 4);
115 const int r = a + (((b - a) * yoff + 8) >> 4); 122 const int r = a + (((b - a) * yoff + 8) >> 4);
116 const int diff = r - src[w * y + x]; 123 const int diff = r - src[w * y + x];
117 se += diff; 124 se += diff;
118 sse += diff * diff; 125 sse += diff * diff;
126 #if CONFIG_VP9_HIGHBITDEPTH
119 } else { 127 } else {
120 uint16_t *ref16 = CONVERT_TO_SHORTPTR(ref); 128 uint16_t *ref16 = CONVERT_TO_SHORTPTR(ref);
121 uint16_t *src16 = CONVERT_TO_SHORTPTR(src); 129 uint16_t *src16 = CONVERT_TO_SHORTPTR(src);
122 const int a1 = ref16[(w + 1) * (y + 0) + x + 0]; 130 const int a1 = ref16[(w + 1) * (y + 0) + x + 0];
123 const int a2 = ref16[(w + 1) * (y + 0) + x + 1]; 131 const int a2 = ref16[(w + 1) * (y + 0) + x + 1];
124 const int b1 = ref16[(w + 1) * (y + 1) + x + 0]; 132 const int b1 = ref16[(w + 1) * (y + 1) + x + 0];
125 const int b2 = ref16[(w + 1) * (y + 1) + x + 1]; 133 const int b2 = ref16[(w + 1) * (y + 1) + x + 1];
126 const int a = a1 + (((a2 - a1) * xoff + 8) >> 4); 134 const int a = a1 + (((a2 - a1) * xoff + 8) >> 4);
127 const int b = b1 + (((b2 - b1) * xoff + 8) >> 4); 135 const int b = b1 + (((b2 - b1) * xoff + 8) >> 4);
128 const int r = a + (((b - a) * yoff + 8) >> 4); 136 const int r = a + (((b - a) * yoff + 8) >> 4);
129 const int diff = r - src16[w * y + x]; 137 const int diff = r - src16[w * y + x];
130 se += diff; 138 se += diff;
131 sse += diff * diff; 139 sse += diff * diff;
140 #endif // CONFIG_VP9_HIGHBITDEPTH
132 } 141 }
133 } 142 }
134 } 143 }
135 if (bit_depth > VPX_BITS_8) { 144 RoundHighBitDepth(bit_depth, &se, &sse);
136 sse = ROUND_POWER_OF_TWO(sse, 2 * (bit_depth - 8)); 145 *sse_ptr = (unsigned int) sse;
137 se = ROUND_POWER_OF_TWO(se, bit_depth - 8); 146 return (unsigned int) (sse - (((int64_t) se * se) >> (l2w + l2h)));
138 }
139 #else
140 int se = 0;
141 unsigned int sse = 0;
142 const int w = 1 << l2w;
143 const int h = 1 << l2h;
144 for (int y = 0; y < h; y++) {
145 for (int x = 0; x < w; x++) {
146 // Bilinear interpolation at a 16th pel step.
147 const int a1 = ref[(w + 1) * (y + 0) + x + 0];
148 const int a2 = ref[(w + 1) * (y + 0) + x + 1];
149 const int b1 = ref[(w + 1) * (y + 1) + x + 0];
150 const int b2 = ref[(w + 1) * (y + 1) + x + 1];
151 const int a = a1 + (((a2 - a1) * xoff + 8) >> 4);
152 const int b = b1 + (((b2 - b1) * xoff + 8) >> 4);
153 const int r = a + (((b - a) * yoff + 8) >> 4);
154 const int diff = r - src[w * y + x];
155 se += diff;
156 sse += diff * diff;
157 }
158 }
159 #endif // CONFIG_VP9_HIGHBITDEPTH
160 *sse_ptr = sse;
161 return sse - (((int64_t) se * se) >> (l2w + l2h));
162 } 147 }
163 148
164 typedef unsigned int (*SumOfSquaresFunction)(const int16_t *src); 149 typedef unsigned int (*SumOfSquaresFunction)(const int16_t *src);
165 150
166 class SumOfSquaresTest : public ::testing::TestWithParam<SumOfSquaresFunction> { 151 class SumOfSquaresTest : public ::testing::TestWithParam<SumOfSquaresFunction> {
167 public: 152 public:
168 SumOfSquaresTest() : func_(GetParam()) {} 153 SumOfSquaresTest() : func_(GetParam()) {}
169 154
170 virtual ~SumOfSquaresTest() { 155 virtual ~SumOfSquaresTest() {
171 libvpx_test::ClearSystemState(); 156 libvpx_test::ClearSystemState();
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 bit_depth_ = static_cast<vpx_bit_depth_t>(get<3>(params)); 206 bit_depth_ = static_cast<vpx_bit_depth_t>(get<3>(params));
222 use_high_bit_depth_ = true; 207 use_high_bit_depth_ = true;
223 } else { 208 } else {
224 bit_depth_ = VPX_BITS_8; 209 bit_depth_ = VPX_BITS_8;
225 use_high_bit_depth_ = false; 210 use_high_bit_depth_ = false;
226 } 211 }
227 mask_ = (1 << bit_depth_) - 1; 212 mask_ = (1 << bit_depth_) - 1;
228 213
229 rnd_.Reset(ACMRandom::DeterministicSeed()); 214 rnd_.Reset(ACMRandom::DeterministicSeed());
230 block_size_ = width_ * height_; 215 block_size_ = width_ * height_;
231 #if CONFIG_VP9_HIGHBITDEPTH
232 if (!use_high_bit_depth_) { 216 if (!use_high_bit_depth_) {
233 src_ = reinterpret_cast<uint8_t *>(vpx_memalign(16, block_size_ * 2)); 217 src_ = reinterpret_cast<uint8_t *>(vpx_memalign(16, block_size_ * 2));
234 ref_ = new uint8_t[block_size_ * 2]; 218 ref_ = new uint8_t[block_size_ * 2];
219 #if CONFIG_VP9_HIGHBITDEPTH
235 } else { 220 } else {
236 src_ = CONVERT_TO_BYTEPTR(reinterpret_cast<uint16_t *>( 221 src_ = CONVERT_TO_BYTEPTR(reinterpret_cast<uint16_t *>(
237 vpx_memalign(16, block_size_ * 2 * sizeof(uint16_t)))); 222 vpx_memalign(16, block_size_ * 2 * sizeof(uint16_t))));
238 ref_ = CONVERT_TO_BYTEPTR(new uint16_t[block_size_ * 2]); 223 ref_ = CONVERT_TO_BYTEPTR(new uint16_t[block_size_ * 2]);
224 #endif // CONFIG_VP9_HIGHBITDEPTH
239 } 225 }
240 #else
241 src_ = reinterpret_cast<uint8_t *>(vpx_memalign(16, block_size_ * 2));
242 ref_ = new uint8_t[block_size_ * 2];
243 #endif
244 ASSERT_TRUE(src_ != NULL); 226 ASSERT_TRUE(src_ != NULL);
245 ASSERT_TRUE(ref_ != NULL); 227 ASSERT_TRUE(ref_ != NULL);
246 } 228 }
247 229
248 virtual void TearDown() { 230 virtual void TearDown() {
249 #if CONFIG_VP9_HIGHBITDEPTH
250 if (!use_high_bit_depth_) { 231 if (!use_high_bit_depth_) {
251 vpx_free(src_); 232 vpx_free(src_);
252 delete[] ref_; 233 delete[] ref_;
234 #if CONFIG_VP9_HIGHBITDEPTH
253 } else { 235 } else {
254 vpx_free(CONVERT_TO_SHORTPTR(src_)); 236 vpx_free(CONVERT_TO_SHORTPTR(src_));
255 delete[] CONVERT_TO_SHORTPTR(ref_); 237 delete[] CONVERT_TO_SHORTPTR(ref_);
238 #endif // CONFIG_VP9_HIGHBITDEPTH
256 } 239 }
257 #else
258 vpx_free(src_);
259 delete[] ref_;
260 #endif
261 libvpx_test::ClearSystemState(); 240 libvpx_test::ClearSystemState();
262 } 241 }
263 242
264 protected: 243 protected:
265 void ZeroTest(); 244 void ZeroTest();
266 void RefTest(); 245 void RefTest();
267 void RefStrideTest(); 246 void RefStrideTest();
268 void OneQuarterTest(); 247 void OneQuarterTest();
269 248
270 ACMRandom rnd_; 249 ACMRandom rnd_;
271 uint8_t *src_; 250 uint8_t *src_;
272 uint8_t *ref_; 251 uint8_t *ref_;
273 int width_, log2width_; 252 int width_, log2width_;
274 int height_, log2height_; 253 int height_, log2height_;
275 vpx_bit_depth_t bit_depth_; 254 vpx_bit_depth_t bit_depth_;
276 int mask_; 255 int mask_;
277 bool use_high_bit_depth_; 256 bool use_high_bit_depth_;
278 int block_size_; 257 int block_size_;
279 VarianceFunctionType variance_; 258 VarianceFunctionType variance_;
280 }; 259 };
281 260
282 template<typename VarianceFunctionType> 261 template<typename VarianceFunctionType>
283 void VarianceTest<VarianceFunctionType>::ZeroTest() { 262 void VarianceTest<VarianceFunctionType>::ZeroTest() {
284 for (int i = 0; i <= 255; ++i) { 263 for (int i = 0; i <= 255; ++i) {
285 #if CONFIG_VP9_HIGHBITDEPTH
286 if (!use_high_bit_depth_) { 264 if (!use_high_bit_depth_) {
287 memset(src_, i, block_size_); 265 memset(src_, i, block_size_);
266 #if CONFIG_VP9_HIGHBITDEPTH
288 } else { 267 } else {
289 vpx_memset16(CONVERT_TO_SHORTPTR(src_), i << (bit_depth_ - 8), 268 vpx_memset16(CONVERT_TO_SHORTPTR(src_), i << (bit_depth_ - 8),
290 block_size_); 269 block_size_);
270 #endif // CONFIG_VP9_HIGHBITDEPTH
291 } 271 }
292 #else
293 memset(src_, i, block_size_);
294 #endif
295 for (int j = 0; j <= 255; ++j) { 272 for (int j = 0; j <= 255; ++j) {
296 #if CONFIG_VP9_HIGHBITDEPTH
297 if (!use_high_bit_depth_) { 273 if (!use_high_bit_depth_) {
298 memset(ref_, j, block_size_); 274 memset(ref_, j, block_size_);
275 #if CONFIG_VP9_HIGHBITDEPTH
299 } else { 276 } else {
300 vpx_memset16(CONVERT_TO_SHORTPTR(ref_), j << (bit_depth_ - 8), 277 vpx_memset16(CONVERT_TO_SHORTPTR(ref_), j << (bit_depth_ - 8),
301 block_size_); 278 block_size_);
279 #endif // CONFIG_VP9_HIGHBITDEPTH
302 } 280 }
303 #else
304 memset(ref_, j, block_size_);
305 #endif
306 unsigned int sse; 281 unsigned int sse;
307 unsigned int var; 282 unsigned int var;
308 ASM_REGISTER_STATE_CHECK( 283 ASM_REGISTER_STATE_CHECK(
309 var = variance_(src_, width_, ref_, width_, &sse)); 284 var = variance_(src_, width_, ref_, width_, &sse));
310 EXPECT_EQ(0u, var) << "src values: " << i << " ref values: " << j; 285 EXPECT_EQ(0u, var) << "src values: " << i << " ref values: " << j;
311 } 286 }
312 } 287 }
313 } 288 }
314 289
315 template<typename VarianceFunctionType> 290 template<typename VarianceFunctionType>
316 void VarianceTest<VarianceFunctionType>::RefTest() { 291 void VarianceTest<VarianceFunctionType>::RefTest() {
317 for (int i = 0; i < 10; ++i) { 292 for (int i = 0; i < 10; ++i) {
318 for (int j = 0; j < block_size_; j++) { 293 for (int j = 0; j < block_size_; j++) {
319 #if CONFIG_VP9_HIGHBITDEPTH
320 if (!use_high_bit_depth_) { 294 if (!use_high_bit_depth_) {
321 src_[j] = rnd_.Rand8(); 295 src_[j] = rnd_.Rand8();
322 ref_[j] = rnd_.Rand8(); 296 ref_[j] = rnd_.Rand8();
297 #if CONFIG_VP9_HIGHBITDEPTH
323 } else { 298 } else {
324 CONVERT_TO_SHORTPTR(src_)[j] = rnd_.Rand16() && mask_; 299 CONVERT_TO_SHORTPTR(src_)[j] = rnd_.Rand16() && mask_;
325 CONVERT_TO_SHORTPTR(ref_)[j] = rnd_.Rand16() && mask_; 300 CONVERT_TO_SHORTPTR(ref_)[j] = rnd_.Rand16() && mask_;
301 #endif // CONFIG_VP9_HIGHBITDEPTH
326 } 302 }
327 #else
328 src_[j] = rnd_.Rand8();
329 ref_[j] = rnd_.Rand8();
330 #endif
331 } 303 }
332 unsigned int sse1, sse2; 304 unsigned int sse1, sse2;
333 unsigned int var1; 305 unsigned int var1;
334 const int stride_coeff = 1; 306 const int stride_coeff = 1;
335 ASM_REGISTER_STATE_CHECK( 307 ASM_REGISTER_STATE_CHECK(
336 var1 = variance_(src_, width_, ref_, width_, &sse1)); 308 var1 = variance_(src_, width_, ref_, width_, &sse1));
337 const unsigned int var2 = variance_ref(src_, ref_, log2width_, 309 const unsigned int var2 = variance_ref(src_, ref_, log2width_,
338 log2height_, stride_coeff, 310 log2height_, stride_coeff,
339 stride_coeff, &sse2, 311 stride_coeff, &sse2,
340 use_high_bit_depth_, bit_depth_); 312 use_high_bit_depth_, bit_depth_);
341 EXPECT_EQ(sse1, sse2); 313 EXPECT_EQ(sse1, sse2);
342 EXPECT_EQ(var1, var2); 314 EXPECT_EQ(var1, var2);
343 } 315 }
344 } 316 }
345 317
346 template<typename VarianceFunctionType> 318 template<typename VarianceFunctionType>
347 void VarianceTest<VarianceFunctionType>::RefStrideTest() { 319 void VarianceTest<VarianceFunctionType>::RefStrideTest() {
348 for (int i = 0; i < 10; ++i) { 320 for (int i = 0; i < 10; ++i) {
349 int ref_stride_coeff = i % 2; 321 int ref_stride_coeff = i % 2;
350 int src_stride_coeff = (i >> 1) % 2; 322 int src_stride_coeff = (i >> 1) % 2;
351 for (int j = 0; j < block_size_; j++) { 323 for (int j = 0; j < block_size_; j++) {
352 int ref_ind = (j / width_) * ref_stride_coeff * width_ + j % width_; 324 int ref_ind = (j / width_) * ref_stride_coeff * width_ + j % width_;
353 int src_ind = (j / width_) * src_stride_coeff * width_ + j % width_; 325 int src_ind = (j / width_) * src_stride_coeff * width_ + j % width_;
354 #if CONFIG_VP9_HIGHBITDEPTH
355 if (!use_high_bit_depth_) { 326 if (!use_high_bit_depth_) {
356 src_[src_ind] = rnd_.Rand8(); 327 src_[src_ind] = rnd_.Rand8();
357 ref_[ref_ind] = rnd_.Rand8(); 328 ref_[ref_ind] = rnd_.Rand8();
329 #if CONFIG_VP9_HIGHBITDEPTH
358 } else { 330 } else {
359 CONVERT_TO_SHORTPTR(src_)[src_ind] = rnd_.Rand16() && mask_; 331 CONVERT_TO_SHORTPTR(src_)[src_ind] = rnd_.Rand16() && mask_;
360 CONVERT_TO_SHORTPTR(ref_)[ref_ind] = rnd_.Rand16() && mask_; 332 CONVERT_TO_SHORTPTR(ref_)[ref_ind] = rnd_.Rand16() && mask_;
333 #endif // CONFIG_VP9_HIGHBITDEPTH
361 } 334 }
362 #else
363 src_[src_ind] = rnd_.Rand8();
364 ref_[ref_ind] = rnd_.Rand8();
365 #endif
366 } 335 }
367 unsigned int sse1, sse2; 336 unsigned int sse1, sse2;
368 unsigned int var1; 337 unsigned int var1;
369 338
370 ASM_REGISTER_STATE_CHECK( 339 ASM_REGISTER_STATE_CHECK(
371 var1 = variance_(src_, width_ * src_stride_coeff, 340 var1 = variance_(src_, width_ * src_stride_coeff,
372 ref_, width_ * ref_stride_coeff, &sse1)); 341 ref_, width_ * ref_stride_coeff, &sse1));
373 const unsigned int var2 = variance_ref(src_, ref_, log2width_, 342 const unsigned int var2 = variance_ref(src_, ref_, log2width_,
374 log2height_, src_stride_coeff, 343 log2height_, src_stride_coeff,
375 ref_stride_coeff, &sse2, 344 ref_stride_coeff, &sse2,
376 use_high_bit_depth_, bit_depth_); 345 use_high_bit_depth_, bit_depth_);
377 EXPECT_EQ(sse1, sse2); 346 EXPECT_EQ(sse1, sse2);
378 EXPECT_EQ(var1, var2); 347 EXPECT_EQ(var1, var2);
379 } 348 }
380 } 349 }
381 350
382 template<typename VarianceFunctionType> 351 template<typename VarianceFunctionType>
383 void VarianceTest<VarianceFunctionType>::OneQuarterTest() { 352 void VarianceTest<VarianceFunctionType>::OneQuarterTest() {
384 const int half = block_size_ / 2; 353 const int half = block_size_ / 2;
385 #if CONFIG_VP9_HIGHBITDEPTH
386 if (!use_high_bit_depth_) { 354 if (!use_high_bit_depth_) {
387 memset(src_, 255, block_size_); 355 memset(src_, 255, block_size_);
388 memset(ref_, 255, half); 356 memset(ref_, 255, half);
389 memset(ref_ + half, 0, half); 357 memset(ref_ + half, 0, half);
358 #if CONFIG_VP9_HIGHBITDEPTH
390 } else { 359 } else {
391 vpx_memset16(CONVERT_TO_SHORTPTR(src_), 255 << (bit_depth_ - 8), 360 vpx_memset16(CONVERT_TO_SHORTPTR(src_), 255 << (bit_depth_ - 8),
392 block_size_); 361 block_size_);
393 vpx_memset16(CONVERT_TO_SHORTPTR(ref_), 255 << (bit_depth_ - 8), half); 362 vpx_memset16(CONVERT_TO_SHORTPTR(ref_), 255 << (bit_depth_ - 8), half);
394 vpx_memset16(CONVERT_TO_SHORTPTR(ref_) + half, 0, half); 363 vpx_memset16(CONVERT_TO_SHORTPTR(ref_) + half, 0, half);
364 #endif // CONFIG_VP9_HIGHBITDEPTH
395 } 365 }
396 #else
397 memset(src_, 255, block_size_);
398 memset(ref_, 255, half);
399 memset(ref_ + half, 0, half);
400 #endif
401 unsigned int sse; 366 unsigned int sse;
402 unsigned int var; 367 unsigned int var;
403 ASM_REGISTER_STATE_CHECK(var = variance_(src_, width_, ref_, width_, &sse)); 368 ASM_REGISTER_STATE_CHECK(var = variance_(src_, width_, ref_, width_, &sse));
404 const unsigned int expected = block_size_ * 255 * 255 / 4; 369 const unsigned int expected = block_size_ * 255 * 255 / 4;
405 EXPECT_EQ(expected, var); 370 EXPECT_EQ(expected, var);
406 } 371 }
407 372
408 #if CONFIG_VP8_ENCODER
409 template<typename MseFunctionType> 373 template<typename MseFunctionType>
410 class MseTest 374 class MseTest
411 : public ::testing::TestWithParam<tuple<int, int, MseFunctionType> > { 375 : public ::testing::TestWithParam<tuple<int, int, MseFunctionType> > {
412 public: 376 public:
413 virtual void SetUp() { 377 virtual void SetUp() {
414 const tuple<int, int, MseFunctionType>& params = this->GetParam(); 378 const tuple<int, int, MseFunctionType>& params = this->GetParam();
415 log2width_ = get<0>(params); 379 log2width_ = get<0>(params);
416 width_ = 1 << log2width_; 380 width_ = 1 << log2width_;
417 log2height_ = get<1>(params); 381 log2height_ = get<1>(params);
418 height_ = 1 << log2height_; 382 height_ = 1 << log2height_;
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 456
493 template<typename MseFunctionType> 457 template<typename MseFunctionType>
494 void MseTest<MseFunctionType>::MaxTest_sse() { 458 void MseTest<MseFunctionType>::MaxTest_sse() {
495 memset(src_, 255, block_size_); 459 memset(src_, 255, block_size_);
496 memset(ref_, 0, block_size_); 460 memset(ref_, 0, block_size_);
497 unsigned int var; 461 unsigned int var;
498 ASM_REGISTER_STATE_CHECK(var = mse_(src_, width_, ref_, width_)); 462 ASM_REGISTER_STATE_CHECK(var = mse_(src_, width_, ref_, width_));
499 const unsigned int expected = block_size_ * 255 * 255; 463 const unsigned int expected = block_size_ * 255 * 255;
500 EXPECT_EQ(expected, var); 464 EXPECT_EQ(expected, var);
501 } 465 }
502 #endif
503 466
504 #if CONFIG_VP9_ENCODER
505 unsigned int subpel_avg_variance_ref(const uint8_t *ref, 467 unsigned int subpel_avg_variance_ref(const uint8_t *ref,
506 const uint8_t *src, 468 const uint8_t *src,
507 const uint8_t *second_pred, 469 const uint8_t *second_pred,
508 int l2w, int l2h, 470 int l2w, int l2h,
509 int xoff, int yoff, 471 int xoff, int yoff,
510 unsigned int *sse_ptr, 472 unsigned int *sse_ptr,
511 bool use_high_bit_depth, 473 bool use_high_bit_depth,
512 vpx_bit_depth_t bit_depth) { 474 vpx_bit_depth_t bit_depth) {
513 #if CONFIG_VP9_HIGHBITDEPTH
514 int64_t se = 0; 475 int64_t se = 0;
515 uint64_t sse = 0; 476 uint64_t sse = 0;
516 const int w = 1 << l2w; 477 const int w = 1 << l2w;
517 const int h = 1 << l2h; 478 const int h = 1 << l2h;
518 for (int y = 0; y < h; y++) { 479 for (int y = 0; y < h; y++) {
519 for (int x = 0; x < w; x++) { 480 for (int x = 0; x < w; x++) {
520 // bilinear interpolation at a 16th pel step 481 // bilinear interpolation at a 16th pel step
521 if (!use_high_bit_depth) { 482 if (!use_high_bit_depth) {
522 const int a1 = ref[(w + 1) * (y + 0) + x + 0]; 483 const int a1 = ref[(w + 1) * (y + 0) + x + 0];
523 const int a2 = ref[(w + 1) * (y + 0) + x + 1]; 484 const int a2 = ref[(w + 1) * (y + 0) + x + 1];
524 const int b1 = ref[(w + 1) * (y + 1) + x + 0]; 485 const int b1 = ref[(w + 1) * (y + 1) + x + 0];
525 const int b2 = ref[(w + 1) * (y + 1) + x + 1]; 486 const int b2 = ref[(w + 1) * (y + 1) + x + 1];
526 const int a = a1 + (((a2 - a1) * xoff + 8) >> 4); 487 const int a = a1 + (((a2 - a1) * xoff + 8) >> 4);
527 const int b = b1 + (((b2 - b1) * xoff + 8) >> 4); 488 const int b = b1 + (((b2 - b1) * xoff + 8) >> 4);
528 const int r = a + (((b - a) * yoff + 8) >> 4); 489 const int r = a + (((b - a) * yoff + 8) >> 4);
529 const int diff = ((r + second_pred[w * y + x] + 1) >> 1) - src[w * y + x ]; 490 const int diff = ((r + second_pred[w * y + x] + 1) >> 1) - src[w * y + x ];
530 se += diff; 491 se += diff;
531 sse += diff * diff; 492 sse += diff * diff;
493 #if CONFIG_VP9_HIGHBITDEPTH
532 } else { 494 } else {
533 uint16_t *ref16 = CONVERT_TO_SHORTPTR(ref); 495 uint16_t *ref16 = CONVERT_TO_SHORTPTR(ref);
534 uint16_t *src16 = CONVERT_TO_SHORTPTR(src); 496 uint16_t *src16 = CONVERT_TO_SHORTPTR(src);
535 uint16_t *sec16 = CONVERT_TO_SHORTPTR(second_pred); 497 uint16_t *sec16 = CONVERT_TO_SHORTPTR(second_pred);
536 const int a1 = ref16[(w + 1) * (y + 0) + x + 0]; 498 const int a1 = ref16[(w + 1) * (y + 0) + x + 0];
537 const int a2 = ref16[(w + 1) * (y + 0) + x + 1]; 499 const int a2 = ref16[(w + 1) * (y + 0) + x + 1];
538 const int b1 = ref16[(w + 1) * (y + 1) + x + 0]; 500 const int b1 = ref16[(w + 1) * (y + 1) + x + 0];
539 const int b2 = ref16[(w + 1) * (y + 1) + x + 1]; 501 const int b2 = ref16[(w + 1) * (y + 1) + x + 1];
540 const int a = a1 + (((a2 - a1) * xoff + 8) >> 4); 502 const int a = a1 + (((a2 - a1) * xoff + 8) >> 4);
541 const int b = b1 + (((b2 - b1) * xoff + 8) >> 4); 503 const int b = b1 + (((b2 - b1) * xoff + 8) >> 4);
542 const int r = a + (((b - a) * yoff + 8) >> 4); 504 const int r = a + (((b - a) * yoff + 8) >> 4);
543 const int diff = ((r + sec16[w * y + x] + 1) >> 1) - src16[w * y + x]; 505 const int diff = ((r + sec16[w * y + x] + 1) >> 1) - src16[w * y + x];
544 se += diff; 506 se += diff;
545 sse += diff * diff; 507 sse += diff * diff;
508 #endif // CONFIG_VP9_HIGHBITDEPTH
546 } 509 }
547 } 510 }
548 } 511 }
549 if (bit_depth > 8) { 512 RoundHighBitDepth(bit_depth, &se, &sse);
550 sse = ROUND_POWER_OF_TWO(sse, 2*(bit_depth-8)); 513 *sse_ptr = (unsigned int) sse;
551 se = ROUND_POWER_OF_TWO(se, bit_depth-8); 514 return (unsigned int) (sse - (((int64_t) se * se) >> (l2w + l2h)));
552 }
553 #else
554 int se = 0;
555 unsigned int sse = 0;
556 const int w = 1 << l2w;
557 const int h = 1 << l2h;
558 for (int y = 0; y < h; y++) {
559 for (int x = 0; x < w; x++) {
560 // bilinear interpolation at a 16th pel step
561 const int a1 = ref[(w + 1) * (y + 0) + x + 0];
562 const int a2 = ref[(w + 1) * (y + 0) + x + 1];
563 const int b1 = ref[(w + 1) * (y + 1) + x + 0];
564 const int b2 = ref[(w + 1) * (y + 1) + x + 1];
565 const int a = a1 + (((a2 - a1) * xoff + 8) >> 4);
566 const int b = b1 + (((b2 - b1) * xoff + 8) >> 4);
567 const int r = a + (((b - a) * yoff + 8) >> 4);
568 const int diff = ((r + second_pred[w * y + x] + 1) >> 1) - src[w * y + x];
569 se += diff;
570 sse += diff * diff;
571 }
572 }
573 #endif // CONFIG_VP9_HIGHBITDEPTH
574 *sse_ptr = sse;
575 return sse - (((int64_t) se * se) >> (l2w + l2h));
576 } 515 }
577 516
578 template<typename SubpelVarianceFunctionType> 517 template<typename SubpelVarianceFunctionType>
579 class SubpelVarianceTest 518 class SubpelVarianceTest
580 : public ::testing::TestWithParam<tuple<int, int, 519 : public ::testing::TestWithParam<tuple<int, int,
581 SubpelVarianceFunctionType, int> > { 520 SubpelVarianceFunctionType, int> > {
582 public: 521 public:
583 virtual void SetUp() { 522 virtual void SetUp() {
584 const tuple<int, int, SubpelVarianceFunctionType, int>& params = 523 const tuple<int, int, SubpelVarianceFunctionType, int>& params =
585 this->GetParam(); 524 this->GetParam();
586 log2width_ = get<0>(params); 525 log2width_ = get<0>(params);
587 width_ = 1 << log2width_; 526 width_ = 1 << log2width_;
588 log2height_ = get<1>(params); 527 log2height_ = get<1>(params);
589 height_ = 1 << log2height_; 528 height_ = 1 << log2height_;
590 subpel_variance_ = get<2>(params); 529 subpel_variance_ = get<2>(params);
591 if (get<3>(params)) { 530 if (get<3>(params)) {
592 bit_depth_ = (vpx_bit_depth_t) get<3>(params); 531 bit_depth_ = (vpx_bit_depth_t) get<3>(params);
593 use_high_bit_depth_ = true; 532 use_high_bit_depth_ = true;
594 } else { 533 } else {
595 bit_depth_ = VPX_BITS_8; 534 bit_depth_ = VPX_BITS_8;
596 use_high_bit_depth_ = false; 535 use_high_bit_depth_ = false;
597 } 536 }
598 mask_ = (1 << bit_depth_)-1; 537 mask_ = (1 << bit_depth_)-1;
599 538
600 rnd_.Reset(ACMRandom::DeterministicSeed()); 539 rnd_.Reset(ACMRandom::DeterministicSeed());
601 block_size_ = width_ * height_; 540 block_size_ = width_ * height_;
602 #if CONFIG_VP9_HIGHBITDEPTH
603 if (!use_high_bit_depth_) { 541 if (!use_high_bit_depth_) {
604 src_ = reinterpret_cast<uint8_t *>(vpx_memalign(16, block_size_)); 542 src_ = reinterpret_cast<uint8_t *>(vpx_memalign(16, block_size_));
605 sec_ = reinterpret_cast<uint8_t *>(vpx_memalign(16, block_size_)); 543 sec_ = reinterpret_cast<uint8_t *>(vpx_memalign(16, block_size_));
606 ref_ = new uint8_t[block_size_ + width_ + height_ + 1]; 544 ref_ = new uint8_t[block_size_ + width_ + height_ + 1];
545 #if CONFIG_VP9_HIGHBITDEPTH
607 } else { 546 } else {
608 src_ = CONVERT_TO_BYTEPTR( 547 src_ = CONVERT_TO_BYTEPTR(
609 reinterpret_cast<uint16_t *>( 548 reinterpret_cast<uint16_t *>(
610 vpx_memalign(16, block_size_*sizeof(uint16_t)))); 549 vpx_memalign(16, block_size_*sizeof(uint16_t))));
611 sec_ = CONVERT_TO_BYTEPTR( 550 sec_ = CONVERT_TO_BYTEPTR(
612 reinterpret_cast<uint16_t *>( 551 reinterpret_cast<uint16_t *>(
613 vpx_memalign(16, block_size_*sizeof(uint16_t)))); 552 vpx_memalign(16, block_size_*sizeof(uint16_t))));
614 ref_ = CONVERT_TO_BYTEPTR( 553 ref_ = CONVERT_TO_BYTEPTR(
615 new uint16_t[block_size_ + width_ + height_ + 1]); 554 new uint16_t[block_size_ + width_ + height_ + 1]);
555 #endif // CONFIG_VP9_HIGHBITDEPTH
616 } 556 }
617 #else
618 src_ = reinterpret_cast<uint8_t *>(vpx_memalign(16, block_size_));
619 sec_ = reinterpret_cast<uint8_t *>(vpx_memalign(16, block_size_));
620 ref_ = new uint8_t[block_size_ + width_ + height_ + 1];
621 #endif // CONFIG_VP9_HIGHBITDEPTH
622 ASSERT_TRUE(src_ != NULL); 557 ASSERT_TRUE(src_ != NULL);
623 ASSERT_TRUE(sec_ != NULL); 558 ASSERT_TRUE(sec_ != NULL);
624 ASSERT_TRUE(ref_ != NULL); 559 ASSERT_TRUE(ref_ != NULL);
625 } 560 }
626 561
627 virtual void TearDown() { 562 virtual void TearDown() {
628 #if CONFIG_VP9_HIGHBITDEPTH
629 if (!use_high_bit_depth_) { 563 if (!use_high_bit_depth_) {
630 vpx_free(src_); 564 vpx_free(src_);
631 delete[] ref_; 565 delete[] ref_;
632 vpx_free(sec_); 566 vpx_free(sec_);
567 #if CONFIG_VP9_HIGHBITDEPTH
633 } else { 568 } else {
634 vpx_free(CONVERT_TO_SHORTPTR(src_)); 569 vpx_free(CONVERT_TO_SHORTPTR(src_));
635 delete[] CONVERT_TO_SHORTPTR(ref_); 570 delete[] CONVERT_TO_SHORTPTR(ref_);
636 vpx_free(CONVERT_TO_SHORTPTR(sec_)); 571 vpx_free(CONVERT_TO_SHORTPTR(sec_));
572 #endif // CONFIG_VP9_HIGHBITDEPTH
637 } 573 }
638 #else
639 vpx_free(src_);
640 delete[] ref_;
641 vpx_free(sec_);
642 #endif
643 libvpx_test::ClearSystemState(); 574 libvpx_test::ClearSystemState();
644 } 575 }
645 576
646 protected: 577 protected:
647 void RefTest(); 578 void RefTest();
648 void ExtremeRefTest(); 579 void ExtremeRefTest();
649 580
650 ACMRandom rnd_; 581 ACMRandom rnd_;
651 uint8_t *src_; 582 uint8_t *src_;
652 uint8_t *ref_; 583 uint8_t *ref_;
653 uint8_t *sec_; 584 uint8_t *sec_;
654 bool use_high_bit_depth_; 585 bool use_high_bit_depth_;
655 vpx_bit_depth_t bit_depth_; 586 vpx_bit_depth_t bit_depth_;
656 int width_, log2width_; 587 int width_, log2width_;
657 int height_, log2height_; 588 int height_, log2height_;
658 int block_size_, mask_; 589 int block_size_, mask_;
659 SubpelVarianceFunctionType subpel_variance_; 590 SubpelVarianceFunctionType subpel_variance_;
660 }; 591 };
661 592
662 template<typename SubpelVarianceFunctionType> 593 template<typename SubpelVarianceFunctionType>
663 void SubpelVarianceTest<SubpelVarianceFunctionType>::RefTest() { 594 void SubpelVarianceTest<SubpelVarianceFunctionType>::RefTest() {
664 for (int x = 0; x < 16; ++x) { 595 for (int x = 0; x < 16; ++x) {
665 for (int y = 0; y < 16; ++y) { 596 for (int y = 0; y < 16; ++y) {
666 #if CONFIG_VP9_HIGHBITDEPTH
667 if (!use_high_bit_depth_) { 597 if (!use_high_bit_depth_) {
668 for (int j = 0; j < block_size_; j++) { 598 for (int j = 0; j < block_size_; j++) {
669 src_[j] = rnd_.Rand8(); 599 src_[j] = rnd_.Rand8();
670 } 600 }
671 for (int j = 0; j < block_size_ + width_ + height_ + 1; j++) { 601 for (int j = 0; j < block_size_ + width_ + height_ + 1; j++) {
672 ref_[j] = rnd_.Rand8(); 602 ref_[j] = rnd_.Rand8();
673 } 603 }
604 #if CONFIG_VP9_HIGHBITDEPTH
674 } else { 605 } else {
675 for (int j = 0; j < block_size_; j++) { 606 for (int j = 0; j < block_size_; j++) {
676 CONVERT_TO_SHORTPTR(src_)[j] = rnd_.Rand16() & mask_; 607 CONVERT_TO_SHORTPTR(src_)[j] = rnd_.Rand16() & mask_;
677 } 608 }
678 for (int j = 0; j < block_size_ + width_ + height_ + 1; j++) { 609 for (int j = 0; j < block_size_ + width_ + height_ + 1; j++) {
679 CONVERT_TO_SHORTPTR(ref_)[j] = rnd_.Rand16() & mask_; 610 CONVERT_TO_SHORTPTR(ref_)[j] = rnd_.Rand16() & mask_;
680 } 611 }
612 #endif // CONFIG_VP9_HIGHBITDEPTH
681 } 613 }
682 #else
683 for (int j = 0; j < block_size_; j++) {
684 src_[j] = rnd_.Rand8();
685 }
686 for (int j = 0; j < block_size_ + width_ + height_ + 1; j++) {
687 ref_[j] = rnd_.Rand8();
688 }
689 #endif // CONFIG_VP9_HIGHBITDEPTH
690 unsigned int sse1, sse2; 614 unsigned int sse1, sse2;
691 unsigned int var1; 615 unsigned int var1;
692 ASM_REGISTER_STATE_CHECK(var1 = subpel_variance_(ref_, width_ + 1, x, y, 616 ASM_REGISTER_STATE_CHECK(var1 = subpel_variance_(ref_, width_ + 1, x, y,
693 src_, width_, &sse1)); 617 src_, width_, &sse1));
694 const unsigned int var2 = subpel_variance_ref(ref_, src_, log2width_, 618 const unsigned int var2 = subpel_variance_ref(ref_, src_, log2width_,
695 log2height_, x, y, &sse2, 619 log2height_, x, y, &sse2,
696 use_high_bit_depth_, 620 use_high_bit_depth_,
697 bit_depth_); 621 bit_depth_);
698 EXPECT_EQ(sse1, sse2) << "at position " << x << ", " << y; 622 EXPECT_EQ(sse1, sse2) << "at position " << x << ", " << y;
699 EXPECT_EQ(var1, var2) << "at position " << x << ", " << y; 623 EXPECT_EQ(var1, var2) << "at position " << x << ", " << y;
700 } 624 }
701 } 625 }
702 } 626 }
703 627
704 template<typename SubpelVarianceFunctionType> 628 template<typename SubpelVarianceFunctionType>
705 void SubpelVarianceTest<SubpelVarianceFunctionType>::ExtremeRefTest() { 629 void SubpelVarianceTest<SubpelVarianceFunctionType>::ExtremeRefTest() {
706 // Compare against reference. 630 // Compare against reference.
707 // Src: Set the first half of values to 0, the second half to the maximum. 631 // Src: Set the first half of values to 0, the second half to the maximum.
708 // Ref: Set the first half of values to the maximum, the second half to 0. 632 // Ref: Set the first half of values to the maximum, the second half to 0.
709 for (int x = 0; x < 16; ++x) { 633 for (int x = 0; x < 16; ++x) {
710 for (int y = 0; y < 16; ++y) { 634 for (int y = 0; y < 16; ++y) {
711 const int half = block_size_ / 2; 635 const int half = block_size_ / 2;
712 #if CONFIG_VP9_HIGHBITDEPTH
713 if (!use_high_bit_depth_) { 636 if (!use_high_bit_depth_) {
714 memset(src_, 0, half); 637 memset(src_, 0, half);
715 memset(src_ + half, 255, half); 638 memset(src_ + half, 255, half);
716 memset(ref_, 255, half); 639 memset(ref_, 255, half);
717 memset(ref_ + half, 0, half + width_ + height_ + 1); 640 memset(ref_ + half, 0, half + width_ + height_ + 1);
641 #if CONFIG_VP9_HIGHBITDEPTH
718 } else { 642 } else {
719 vpx_memset16(CONVERT_TO_SHORTPTR(src_), mask_, half); 643 vpx_memset16(CONVERT_TO_SHORTPTR(src_), mask_, half);
720 vpx_memset16(CONVERT_TO_SHORTPTR(src_) + half, 0, half); 644 vpx_memset16(CONVERT_TO_SHORTPTR(src_) + half, 0, half);
721 vpx_memset16(CONVERT_TO_SHORTPTR(ref_), 0, half); 645 vpx_memset16(CONVERT_TO_SHORTPTR(ref_), 0, half);
722 vpx_memset16(CONVERT_TO_SHORTPTR(ref_) + half, mask_, 646 vpx_memset16(CONVERT_TO_SHORTPTR(ref_) + half, mask_,
723 half + width_ + height_ + 1); 647 half + width_ + height_ + 1);
648 #endif // CONFIG_VP9_HIGHBITDEPTH
724 } 649 }
725 #else
726 memset(src_, 0, half);
727 memset(src_ + half, 255, half);
728 memset(ref_, 255, half);
729 memset(ref_ + half, 0, half + width_ + height_ + 1);
730 #endif // CONFIG_VP9_HIGHBITDEPTH
731 unsigned int sse1, sse2; 650 unsigned int sse1, sse2;
732 unsigned int var1; 651 unsigned int var1;
733 ASM_REGISTER_STATE_CHECK( 652 ASM_REGISTER_STATE_CHECK(
734 var1 = subpel_variance_(ref_, width_ + 1, x, y, src_, width_, &sse1)); 653 var1 = subpel_variance_(ref_, width_ + 1, x, y, src_, width_, &sse1));
735 const unsigned int var2 = 654 const unsigned int var2 =
736 subpel_variance_ref(ref_, src_, log2width_, log2height_, x, y, &sse2, 655 subpel_variance_ref(ref_, src_, log2width_, log2height_, x, y, &sse2,
737 use_high_bit_depth_, bit_depth_); 656 use_high_bit_depth_, bit_depth_);
738 EXPECT_EQ(sse1, sse2) << "at position " << x << ", " << y; 657 EXPECT_EQ(sse1, sse2) << "at position " << x << ", " << y;
739 EXPECT_EQ(var1, var2) << "at position " << x << ", " << y; 658 EXPECT_EQ(var1, var2) << "at position " << x << ", " << y;
740 } 659 }
741 } 660 }
742 } 661 }
743 662
663 #if CONFIG_VP9_ENCODER
744 template<> 664 template<>
745 void SubpelVarianceTest<vp9_subp_avg_variance_fn_t>::RefTest() { 665 void SubpelVarianceTest<vp9_subp_avg_variance_fn_t>::RefTest() {
746 for (int x = 0; x < 16; ++x) { 666 for (int x = 0; x < 16; ++x) {
747 for (int y = 0; y < 16; ++y) { 667 for (int y = 0; y < 16; ++y) {
748 #if CONFIG_VP9_HIGHBITDEPTH
749 if (!use_high_bit_depth_) { 668 if (!use_high_bit_depth_) {
750 for (int j = 0; j < block_size_; j++) { 669 for (int j = 0; j < block_size_; j++) {
751 src_[j] = rnd_.Rand8(); 670 src_[j] = rnd_.Rand8();
752 sec_[j] = rnd_.Rand8(); 671 sec_[j] = rnd_.Rand8();
753 } 672 }
754 for (int j = 0; j < block_size_ + width_ + height_ + 1; j++) { 673 for (int j = 0; j < block_size_ + width_ + height_ + 1; j++) {
755 ref_[j] = rnd_.Rand8(); 674 ref_[j] = rnd_.Rand8();
756 } 675 }
676 #if CONFIG_VP9_HIGHBITDEPTH
757 } else { 677 } else {
758 for (int j = 0; j < block_size_; j++) { 678 for (int j = 0; j < block_size_; j++) {
759 CONVERT_TO_SHORTPTR(src_)[j] = rnd_.Rand16() & mask_; 679 CONVERT_TO_SHORTPTR(src_)[j] = rnd_.Rand16() & mask_;
760 CONVERT_TO_SHORTPTR(sec_)[j] = rnd_.Rand16() & mask_; 680 CONVERT_TO_SHORTPTR(sec_)[j] = rnd_.Rand16() & mask_;
761 } 681 }
762 for (int j = 0; j < block_size_ + width_ + height_ + 1; j++) { 682 for (int j = 0; j < block_size_ + width_ + height_ + 1; j++) {
763 CONVERT_TO_SHORTPTR(ref_)[j] = rnd_.Rand16() & mask_; 683 CONVERT_TO_SHORTPTR(ref_)[j] = rnd_.Rand16() & mask_;
764 } 684 }
685 #endif // CONFIG_VP9_HIGHBITDEPTH
765 } 686 }
766 #else
767 for (int j = 0; j < block_size_; j++) {
768 src_[j] = rnd_.Rand8();
769 sec_[j] = rnd_.Rand8();
770 }
771 for (int j = 0; j < block_size_ + width_ + height_ + 1; j++) {
772 ref_[j] = rnd_.Rand8();
773 }
774 #endif
775 unsigned int sse1, sse2; 687 unsigned int sse1, sse2;
776 unsigned int var1; 688 unsigned int var1;
777 ASM_REGISTER_STATE_CHECK( 689 ASM_REGISTER_STATE_CHECK(
778 var1 = subpel_variance_(ref_, width_ + 1, x, y, 690 var1 = subpel_variance_(ref_, width_ + 1, x, y,
779 src_, width_, &sse1, sec_)); 691 src_, width_, &sse1, sec_));
780 const unsigned int var2 = subpel_avg_variance_ref(ref_, src_, sec_, 692 const unsigned int var2 = subpel_avg_variance_ref(ref_, src_, sec_,
781 log2width_, log2height_, 693 log2width_, log2height_,
782 x, y, &sse2, 694 x, y, &sse2,
783 use_high_bit_depth_, 695 use_high_bit_depth_,
784 bit_depth_); 696 bit_depth_);
785 EXPECT_EQ(sse1, sse2) << "at position " << x << ", " << y; 697 EXPECT_EQ(sse1, sse2) << "at position " << x << ", " << y;
786 EXPECT_EQ(var1, var2) << "at position " << x << ", " << y; 698 EXPECT_EQ(var1, var2) << "at position " << x << ", " << y;
787 } 699 }
788 } 700 }
789 } 701 }
790
791 #endif // CONFIG_VP9_ENCODER 702 #endif // CONFIG_VP9_ENCODER
792 703
793 // ----------------------------------------------------------------------------- 704 typedef MseTest<Get4x4SseFunc> VpxSseTest;
794 // VP8 test cases. 705 typedef MseTest<VarianceMxNFunc> VpxMseTest;
795 706 typedef VarianceTest<VarianceMxNFunc> VpxVarianceTest;
796 namespace vp8 { 707
797 708 TEST_P(VpxSseTest, Ref_sse) { RefTest_sse(); }
798 #if CONFIG_VP8_ENCODER 709 TEST_P(VpxSseTest, Max_sse) { MaxTest_sse(); }
799 typedef unsigned int (*vp8_sse_fn_t)(const unsigned char *src_ptr, 710 TEST_P(VpxMseTest, Ref_mse) { RefTest_mse(); }
800 int source_stride, const unsigned char *ref_ptr, int ref_stride); 711 TEST_P(VpxMseTest, Max_mse) { MaxTest_mse(); }
801 712 TEST_P(VpxVarianceTest, Zero) { ZeroTest(); }
802 typedef MseTest<vp8_sse_fn_t> VP8SseTest; 713 TEST_P(VpxVarianceTest, Ref) { RefTest(); }
803 typedef MseTest<vp8_variance_fn_t> VP8MseTest; 714 TEST_P(VpxVarianceTest, RefStride) { RefStrideTest(); }
804 typedef VarianceTest<vp8_variance_fn_t> VP8VarianceTest; 715 TEST_P(VpxVarianceTest, OneQuarter) { OneQuarterTest(); }
805
806 TEST_P(VP8SseTest, Ref_sse) { RefTest_sse(); }
807 TEST_P(VP8SseTest, Max_sse) { MaxTest_sse(); }
808 TEST_P(VP8MseTest, Ref_mse) { RefTest_mse(); }
809 TEST_P(VP8MseTest, Max_mse) { MaxTest_mse(); }
810 TEST_P(VP8VarianceTest, Zero) { ZeroTest(); }
811 TEST_P(VP8VarianceTest, Ref) { RefTest(); }
812 TEST_P(VP8VarianceTest, OneQuarter) { OneQuarterTest(); }
813
814 const vp8_sse_fn_t get4x4sse_cs_c = vp8_get4x4sse_cs_c;
815 INSTANTIATE_TEST_CASE_P(
816 C, VP8SseTest,
817 ::testing::Values(make_tuple(2, 2, get4x4sse_cs_c)));
818
819 const vp8_variance_fn_t mse16x16_c = vp8_mse16x16_c;
820 INSTANTIATE_TEST_CASE_P(
821 C, VP8MseTest,
822 ::testing::Values(make_tuple(4, 4, mse16x16_c)));
823
824 const vp8_variance_fn_t variance4x4_c = vp8_variance4x4_c;
825 const vp8_variance_fn_t variance8x8_c = vp8_variance8x8_c;
826 const vp8_variance_fn_t variance8x16_c = vp8_variance8x16_c;
827 const vp8_variance_fn_t variance16x8_c = vp8_variance16x8_c;
828 const vp8_variance_fn_t variance16x16_c = vp8_variance16x16_c;
829 INSTANTIATE_TEST_CASE_P(
830 C, VP8VarianceTest,
831 ::testing::Values(make_tuple(2, 2, variance4x4_c, 0),
832 make_tuple(3, 3, variance8x8_c, 0),
833 make_tuple(3, 4, variance8x16_c, 0),
834 make_tuple(4, 3, variance16x8_c, 0),
835 make_tuple(4, 4, variance16x16_c, 0)));
836
837 #if HAVE_NEON
838 const vp8_sse_fn_t get4x4sse_cs_neon = vp8_get4x4sse_cs_neon;
839 INSTANTIATE_TEST_CASE_P(
840 NEON, VP8SseTest,
841 ::testing::Values(make_tuple(2, 2, get4x4sse_cs_neon)));
842
843 const vp8_variance_fn_t mse16x16_neon = vp8_mse16x16_neon;
844 INSTANTIATE_TEST_CASE_P(
845 NEON, VP8MseTest,
846 ::testing::Values(make_tuple(4, 4, mse16x16_neon)));
847
848 const vp8_variance_fn_t variance8x8_neon = vp8_variance8x8_neon;
849 const vp8_variance_fn_t variance8x16_neon = vp8_variance8x16_neon;
850 const vp8_variance_fn_t variance16x8_neon = vp8_variance16x8_neon;
851 const vp8_variance_fn_t variance16x16_neon = vp8_variance16x16_neon;
852 INSTANTIATE_TEST_CASE_P(
853 NEON, VP8VarianceTest,
854 ::testing::Values(make_tuple(3, 3, variance8x8_neon, 0),
855 make_tuple(3, 4, variance8x16_neon, 0),
856 make_tuple(4, 3, variance16x8_neon, 0),
857 make_tuple(4, 4, variance16x16_neon, 0)));
858 #endif
859
860 #if HAVE_MMX
861 const vp8_variance_fn_t variance4x4_mmx = vp8_variance4x4_mmx;
862 const vp8_variance_fn_t variance8x8_mmx = vp8_variance8x8_mmx;
863 const vp8_variance_fn_t variance8x16_mmx = vp8_variance8x16_mmx;
864 const vp8_variance_fn_t variance16x8_mmx = vp8_variance16x8_mmx;
865 const vp8_variance_fn_t variance16x16_mmx = vp8_variance16x16_mmx;
866 INSTANTIATE_TEST_CASE_P(
867 MMX, VP8VarianceTest,
868 ::testing::Values(make_tuple(2, 2, variance4x4_mmx, 0),
869 make_tuple(3, 3, variance8x8_mmx, 0),
870 make_tuple(3, 4, variance8x16_mmx, 0),
871 make_tuple(4, 3, variance16x8_mmx, 0),
872 make_tuple(4, 4, variance16x16_mmx, 0)));
873 #endif
874
875 #if HAVE_SSE2
876 const vp8_variance_fn_t variance4x4_wmt = vp8_variance4x4_wmt;
877 const vp8_variance_fn_t variance8x8_wmt = vp8_variance8x8_wmt;
878 const vp8_variance_fn_t variance8x16_wmt = vp8_variance8x16_wmt;
879 const vp8_variance_fn_t variance16x8_wmt = vp8_variance16x8_wmt;
880 const vp8_variance_fn_t variance16x16_wmt = vp8_variance16x16_wmt;
881 INSTANTIATE_TEST_CASE_P(
882 SSE2, VP8VarianceTest,
883 ::testing::Values(make_tuple(2, 2, variance4x4_wmt, 0),
884 make_tuple(3, 3, variance8x8_wmt, 0),
885 make_tuple(3, 4, variance8x16_wmt, 0),
886 make_tuple(4, 3, variance16x8_wmt, 0),
887 make_tuple(4, 4, variance16x16_wmt, 0)));
888 #endif
889 #endif // CONFIG_VP8_ENCODER
890
891 } // namespace vp8
892
893 // -----------------------------------------------------------------------------
894 // VP9 test cases.
895
896 namespace vp9 {
897
898 #if CONFIG_VP9_ENCODER
899 TEST_P(SumOfSquaresTest, Const) { ConstTest(); } 716 TEST_P(SumOfSquaresTest, Const) { ConstTest(); }
900 TEST_P(SumOfSquaresTest, Ref) { RefTest(); } 717 TEST_P(SumOfSquaresTest, Ref) { RefTest(); }
901 718
902 INSTANTIATE_TEST_CASE_P(C, SumOfSquaresTest, 719 INSTANTIATE_TEST_CASE_P(C, SumOfSquaresTest,
903 ::testing::Values(vp9_get_mb_ss_c)); 720 ::testing::Values(vpx_get_mb_ss_c));
904 721
905 typedef VarianceTest<vp9_variance_fn_t> VP9VarianceTest; 722 const Get4x4SseFunc get4x4sse_cs_c = vpx_get4x4sse_cs_c;
723 INSTANTIATE_TEST_CASE_P(C, VpxSseTest,
724 ::testing::Values(make_tuple(2, 2, get4x4sse_cs_c)));
725
726 const VarianceMxNFunc mse16x16_c = vpx_mse16x16_c;
727 const VarianceMxNFunc mse16x8_c = vpx_mse16x8_c;
728 const VarianceMxNFunc mse8x16_c = vpx_mse8x16_c;
729 const VarianceMxNFunc mse8x8_c = vpx_mse8x8_c;
730 INSTANTIATE_TEST_CASE_P(C, VpxMseTest,
731 ::testing::Values(make_tuple(4, 4, mse16x16_c),
732 make_tuple(4, 3, mse16x8_c),
733 make_tuple(3, 4, mse8x16_c),
734 make_tuple(3, 3, mse8x8_c)));
735
736 const VarianceMxNFunc variance64x64_c = vpx_variance64x64_c;
737 const VarianceMxNFunc variance64x32_c = vpx_variance64x32_c;
738 const VarianceMxNFunc variance32x64_c = vpx_variance32x64_c;
739 const VarianceMxNFunc variance32x32_c = vpx_variance32x32_c;
740 const VarianceMxNFunc variance32x16_c = vpx_variance32x16_c;
741 const VarianceMxNFunc variance16x32_c = vpx_variance16x32_c;
742 const VarianceMxNFunc variance16x16_c = vpx_variance16x16_c;
743 const VarianceMxNFunc variance16x8_c = vpx_variance16x8_c;
744 const VarianceMxNFunc variance8x16_c = vpx_variance8x16_c;
745 const VarianceMxNFunc variance8x8_c = vpx_variance8x8_c;
746 const VarianceMxNFunc variance8x4_c = vpx_variance8x4_c;
747 const VarianceMxNFunc variance4x8_c = vpx_variance4x8_c;
748 const VarianceMxNFunc variance4x4_c = vpx_variance4x4_c;
749
750 INSTANTIATE_TEST_CASE_P(
751 C, VpxVarianceTest,
752 ::testing::Values(make_tuple(6, 6, variance64x64_c, 0),
753 make_tuple(6, 5, variance64x32_c, 0),
754 make_tuple(5, 6, variance32x64_c, 0),
755 make_tuple(5, 5, variance32x32_c, 0),
756 make_tuple(5, 4, variance32x16_c, 0),
757 make_tuple(4, 5, variance16x32_c, 0),
758 make_tuple(4, 4, variance16x16_c, 0),
759 make_tuple(4, 3, variance16x8_c, 0),
760 make_tuple(3, 4, variance8x16_c, 0),
761 make_tuple(3, 3, variance8x8_c, 0),
762 make_tuple(3, 2, variance8x4_c, 0),
763 make_tuple(2, 3, variance4x8_c, 0),
764 make_tuple(2, 2, variance4x4_c, 0)));
765
766 #if CONFIG_VP9_HIGHBITDEPTH
767 typedef MseTest<VarianceMxNFunc> VpxHBDMseTest;
768 typedef VarianceTest<VarianceMxNFunc> VpxHBDVarianceTest;
769
770 TEST_P(VpxHBDMseTest, Ref_mse) { RefTest_mse(); }
771 TEST_P(VpxHBDMseTest, Max_mse) { MaxTest_mse(); }
772 TEST_P(VpxHBDVarianceTest, Zero) { ZeroTest(); }
773 TEST_P(VpxHBDVarianceTest, Ref) { RefTest(); }
774 TEST_P(VpxHBDVarianceTest, RefStride) { RefStrideTest(); }
775 TEST_P(VpxHBDVarianceTest, OneQuarter) { OneQuarterTest(); }
776
777 /* TODO(debargha): This test does not support the highbd version
778 const VarianceMxNFunc highbd_12_mse16x16_c = vpx_highbd_12_mse16x16_c;
779 const VarianceMxNFunc highbd_12_mse16x8_c = vpx_highbd_12_mse16x8_c;
780 const VarianceMxNFunc highbd_12_mse8x16_c = vpx_highbd_12_mse8x16_c;
781 const VarianceMxNFunc highbd_12_mse8x8_c = vpx_highbd_12_mse8x8_c;
782
783 const VarianceMxNFunc highbd_10_mse16x16_c = vpx_highbd_10_mse16x16_c;
784 const VarianceMxNFunc highbd_10_mse16x8_c = vpx_highbd_10_mse16x8_c;
785 const VarianceMxNFunc highbd_10_mse8x16_c = vpx_highbd_10_mse8x16_c;
786 const VarianceMxNFunc highbd_10_mse8x8_c = vpx_highbd_10_mse8x8_c;
787
788 const VarianceMxNFunc highbd_8_mse16x16_c = vpx_highbd_8_mse16x16_c;
789 const VarianceMxNFunc highbd_8_mse16x8_c = vpx_highbd_8_mse16x8_c;
790 const VarianceMxNFunc highbd_8_mse8x16_c = vpx_highbd_8_mse8x16_c;
791 const VarianceMxNFunc highbd_8_mse8x8_c = vpx_highbd_8_mse8x8_c;
792
793 INSTANTIATE_TEST_CASE_P(
794 C, VpxHBDMseTest, ::testing::Values(make_tuple(4, 4, highbd_12_mse16x16_c),
795 make_tuple(4, 4, highbd_12_mse16x8_c),
796 make_tuple(4, 4, highbd_12_mse8x16_c),
797 make_tuple(4, 4, highbd_12_mse8x8_c),
798 make_tuple(4, 4, highbd_10_mse16x16_c),
799 make_tuple(4, 4, highbd_10_mse16x8_c),
800 make_tuple(4, 4, highbd_10_mse8x16_c),
801 make_tuple(4, 4, highbd_10_mse8x8_c),
802 make_tuple(4, 4, highbd_8_mse16x16_c),
803 make_tuple(4, 4, highbd_8_mse16x8_c),
804 make_tuple(4, 4, highbd_8_mse8x16_c),
805 make_tuple(4, 4, highbd_8_mse8x8_c)));
806 */
807
808
809 const VarianceMxNFunc highbd_12_variance64x64_c = vpx_highbd_12_variance64x64_c;
810 const VarianceMxNFunc highbd_12_variance64x32_c = vpx_highbd_12_variance64x32_c;
811 const VarianceMxNFunc highbd_12_variance32x64_c = vpx_highbd_12_variance32x64_c;
812 const VarianceMxNFunc highbd_12_variance32x32_c = vpx_highbd_12_variance32x32_c;
813 const VarianceMxNFunc highbd_12_variance32x16_c = vpx_highbd_12_variance32x16_c;
814 const VarianceMxNFunc highbd_12_variance16x32_c = vpx_highbd_12_variance16x32_c;
815 const VarianceMxNFunc highbd_12_variance16x16_c = vpx_highbd_12_variance16x16_c;
816 const VarianceMxNFunc highbd_12_variance16x8_c = vpx_highbd_12_variance16x8_c;
817 const VarianceMxNFunc highbd_12_variance8x16_c = vpx_highbd_12_variance8x16_c;
818 const VarianceMxNFunc highbd_12_variance8x8_c = vpx_highbd_12_variance8x8_c;
819 const VarianceMxNFunc highbd_12_variance8x4_c = vpx_highbd_12_variance8x4_c;
820 const VarianceMxNFunc highbd_12_variance4x8_c = vpx_highbd_12_variance4x8_c;
821 const VarianceMxNFunc highbd_12_variance4x4_c = vpx_highbd_12_variance4x4_c;
822
823 const VarianceMxNFunc highbd_10_variance64x64_c = vpx_highbd_10_variance64x64_c;
824 const VarianceMxNFunc highbd_10_variance64x32_c = vpx_highbd_10_variance64x32_c;
825 const VarianceMxNFunc highbd_10_variance32x64_c = vpx_highbd_10_variance32x64_c;
826 const VarianceMxNFunc highbd_10_variance32x32_c = vpx_highbd_10_variance32x32_c;
827 const VarianceMxNFunc highbd_10_variance32x16_c = vpx_highbd_10_variance32x16_c;
828 const VarianceMxNFunc highbd_10_variance16x32_c = vpx_highbd_10_variance16x32_c;
829 const VarianceMxNFunc highbd_10_variance16x16_c = vpx_highbd_10_variance16x16_c;
830 const VarianceMxNFunc highbd_10_variance16x8_c = vpx_highbd_10_variance16x8_c;
831 const VarianceMxNFunc highbd_10_variance8x16_c = vpx_highbd_10_variance8x16_c;
832 const VarianceMxNFunc highbd_10_variance8x8_c = vpx_highbd_10_variance8x8_c;
833 const VarianceMxNFunc highbd_10_variance8x4_c = vpx_highbd_10_variance8x4_c;
834 const VarianceMxNFunc highbd_10_variance4x8_c = vpx_highbd_10_variance4x8_c;
835 const VarianceMxNFunc highbd_10_variance4x4_c = vpx_highbd_10_variance4x4_c;
836
837 const VarianceMxNFunc highbd_8_variance64x64_c = vpx_highbd_8_variance64x64_c;
838 const VarianceMxNFunc highbd_8_variance64x32_c = vpx_highbd_8_variance64x32_c;
839 const VarianceMxNFunc highbd_8_variance32x64_c = vpx_highbd_8_variance32x64_c;
840 const VarianceMxNFunc highbd_8_variance32x32_c = vpx_highbd_8_variance32x32_c;
841 const VarianceMxNFunc highbd_8_variance32x16_c = vpx_highbd_8_variance32x16_c;
842 const VarianceMxNFunc highbd_8_variance16x32_c = vpx_highbd_8_variance16x32_c;
843 const VarianceMxNFunc highbd_8_variance16x16_c = vpx_highbd_8_variance16x16_c;
844 const VarianceMxNFunc highbd_8_variance16x8_c = vpx_highbd_8_variance16x8_c;
845 const VarianceMxNFunc highbd_8_variance8x16_c = vpx_highbd_8_variance8x16_c;
846 const VarianceMxNFunc highbd_8_variance8x8_c = vpx_highbd_8_variance8x8_c;
847 const VarianceMxNFunc highbd_8_variance8x4_c = vpx_highbd_8_variance8x4_c;
848 const VarianceMxNFunc highbd_8_variance4x8_c = vpx_highbd_8_variance4x8_c;
849 const VarianceMxNFunc highbd_8_variance4x4_c = vpx_highbd_8_variance4x4_c;
850 INSTANTIATE_TEST_CASE_P(
851 C, VpxHBDVarianceTest,
852 ::testing::Values(make_tuple(6, 6, highbd_12_variance64x64_c, 12),
853 make_tuple(6, 5, highbd_12_variance64x32_c, 12),
854 make_tuple(5, 6, highbd_12_variance32x64_c, 12),
855 make_tuple(5, 5, highbd_12_variance32x32_c, 12),
856 make_tuple(5, 4, highbd_12_variance32x16_c, 12),
857 make_tuple(4, 5, highbd_12_variance16x32_c, 12),
858 make_tuple(4, 4, highbd_12_variance16x16_c, 12),
859 make_tuple(4, 3, highbd_12_variance16x8_c, 12),
860 make_tuple(3, 4, highbd_12_variance8x16_c, 12),
861 make_tuple(3, 3, highbd_12_variance8x8_c, 12),
862 make_tuple(3, 2, highbd_12_variance8x4_c, 12),
863 make_tuple(2, 3, highbd_12_variance4x8_c, 12),
864 make_tuple(2, 2, highbd_12_variance4x4_c, 12),
865 make_tuple(6, 6, highbd_10_variance64x64_c, 10),
866 make_tuple(6, 5, highbd_10_variance64x32_c, 10),
867 make_tuple(5, 6, highbd_10_variance32x64_c, 10),
868 make_tuple(5, 5, highbd_10_variance32x32_c, 10),
869 make_tuple(5, 4, highbd_10_variance32x16_c, 10),
870 make_tuple(4, 5, highbd_10_variance16x32_c, 10),
871 make_tuple(4, 4, highbd_10_variance16x16_c, 10),
872 make_tuple(4, 3, highbd_10_variance16x8_c, 10),
873 make_tuple(3, 4, highbd_10_variance8x16_c, 10),
874 make_tuple(3, 3, highbd_10_variance8x8_c, 10),
875 make_tuple(3, 2, highbd_10_variance8x4_c, 10),
876 make_tuple(2, 3, highbd_10_variance4x8_c, 10),
877 make_tuple(2, 2, highbd_10_variance4x4_c, 10),
878 make_tuple(6, 6, highbd_8_variance64x64_c, 8),
879 make_tuple(6, 5, highbd_8_variance64x32_c, 8),
880 make_tuple(5, 6, highbd_8_variance32x64_c, 8),
881 make_tuple(5, 5, highbd_8_variance32x32_c, 8),
882 make_tuple(5, 4, highbd_8_variance32x16_c, 8),
883 make_tuple(4, 5, highbd_8_variance16x32_c, 8),
884 make_tuple(4, 4, highbd_8_variance16x16_c, 8),
885 make_tuple(4, 3, highbd_8_variance16x8_c, 8),
886 make_tuple(3, 4, highbd_8_variance8x16_c, 8),
887 make_tuple(3, 3, highbd_8_variance8x8_c, 8),
888 make_tuple(3, 2, highbd_8_variance8x4_c, 8),
889 make_tuple(2, 3, highbd_8_variance4x8_c, 8),
890 make_tuple(2, 2, highbd_8_variance4x4_c, 8)));
891 #endif // CONFIG_VP9_HIGHBITDEPTH
892
893 #if HAVE_MMX
894 const VarianceMxNFunc mse16x16_mmx = vpx_mse16x16_mmx;
895 INSTANTIATE_TEST_CASE_P(MMX, VpxMseTest,
896 ::testing::Values(make_tuple(4, 4, mse16x16_mmx)));
897
898 INSTANTIATE_TEST_CASE_P(MMX, SumOfSquaresTest,
899 ::testing::Values(vpx_get_mb_ss_mmx));
900
901 const VarianceMxNFunc variance16x16_mmx = vpx_variance16x16_mmx;
902 const VarianceMxNFunc variance16x8_mmx = vpx_variance16x8_mmx;
903 const VarianceMxNFunc variance8x16_mmx = vpx_variance8x16_mmx;
904 const VarianceMxNFunc variance8x8_mmx = vpx_variance8x8_mmx;
905 const VarianceMxNFunc variance4x4_mmx = vpx_variance4x4_mmx;
906 INSTANTIATE_TEST_CASE_P(
907 MMX, VpxVarianceTest,
908 ::testing::Values(make_tuple(4, 4, variance16x16_mmx, 0),
909 make_tuple(4, 3, variance16x8_mmx, 0),
910 make_tuple(3, 4, variance8x16_mmx, 0),
911 make_tuple(3, 3, variance8x8_mmx, 0),
912 make_tuple(2, 2, variance4x4_mmx, 0)));
913 #endif // HAVE_MMX
914
915 #if HAVE_SSE2
916 INSTANTIATE_TEST_CASE_P(SSE2, SumOfSquaresTest,
917 ::testing::Values(vpx_get_mb_ss_sse2));
918
919 const VarianceMxNFunc mse16x16_sse2 = vpx_mse16x16_sse2;
920 const VarianceMxNFunc mse16x8_sse2 = vpx_mse16x8_sse2;
921 const VarianceMxNFunc mse8x16_sse2 = vpx_mse8x16_sse2;
922 const VarianceMxNFunc mse8x8_sse2 = vpx_mse8x8_sse2;
923 INSTANTIATE_TEST_CASE_P(SSE2, VpxMseTest,
924 ::testing::Values(make_tuple(4, 4, mse16x16_sse2),
925 make_tuple(4, 3, mse16x8_sse2),
926 make_tuple(3, 4, mse8x16_sse2),
927 make_tuple(3, 3, mse8x8_sse2)));
928
929 const VarianceMxNFunc variance64x64_sse2 = vpx_variance64x64_sse2;
930 const VarianceMxNFunc variance64x32_sse2 = vpx_variance64x32_sse2;
931 const VarianceMxNFunc variance32x64_sse2 = vpx_variance32x64_sse2;
932 const VarianceMxNFunc variance32x32_sse2 = vpx_variance32x32_sse2;
933 const VarianceMxNFunc variance32x16_sse2 = vpx_variance32x16_sse2;
934 const VarianceMxNFunc variance16x32_sse2 = vpx_variance16x32_sse2;
935 const VarianceMxNFunc variance16x16_sse2 = vpx_variance16x16_sse2;
936 const VarianceMxNFunc variance16x8_sse2 = vpx_variance16x8_sse2;
937 const VarianceMxNFunc variance8x16_sse2 = vpx_variance8x16_sse2;
938 const VarianceMxNFunc variance8x8_sse2 = vpx_variance8x8_sse2;
939 const VarianceMxNFunc variance8x4_sse2 = vpx_variance8x4_sse2;
940 const VarianceMxNFunc variance4x8_sse2 = vpx_variance4x8_sse2;
941 const VarianceMxNFunc variance4x4_sse2 = vpx_variance4x4_sse2;
942 INSTANTIATE_TEST_CASE_P(
943 SSE2, VpxVarianceTest,
944 ::testing::Values(make_tuple(6, 6, variance64x64_sse2, 0),
945 make_tuple(6, 5, variance64x32_sse2, 0),
946 make_tuple(5, 6, variance32x64_sse2, 0),
947 make_tuple(5, 5, variance32x32_sse2, 0),
948 make_tuple(5, 4, variance32x16_sse2, 0),
949 make_tuple(4, 5, variance16x32_sse2, 0),
950 make_tuple(4, 4, variance16x16_sse2, 0),
951 make_tuple(4, 3, variance16x8_sse2, 0),
952 make_tuple(3, 4, variance8x16_sse2, 0),
953 make_tuple(3, 3, variance8x8_sse2, 0),
954 make_tuple(3, 2, variance8x4_sse2, 0),
955 make_tuple(2, 3, variance4x8_sse2, 0),
956 make_tuple(2, 2, variance4x4_sse2, 0)));
957 #if CONFIG_VP9_HIGHBITDEPTH
958 /* TODO(debargha): This test does not support the highbd version
959 const VarianceMxNFunc highbd_12_mse16x16_sse2 = vpx_highbd_12_mse16x16_sse2;
960 const VarianceMxNFunc highbd_12_mse16x8_sse2 = vpx_highbd_12_mse16x8_sse2;
961 const VarianceMxNFunc highbd_12_mse8x16_sse2 = vpx_highbd_12_mse8x16_sse2;
962 const VarianceMxNFunc highbd_12_mse8x8_sse2 = vpx_highbd_12_mse8x8_sse2;
963
964 const VarianceMxNFunc highbd_10_mse16x16_sse2 = vpx_highbd_10_mse16x16_sse2;
965 const VarianceMxNFunc highbd_10_mse16x8_sse2 = vpx_highbd_10_mse16x8_sse2;
966 const VarianceMxNFunc highbd_10_mse8x16_sse2 = vpx_highbd_10_mse8x16_sse2;
967 const VarianceMxNFunc highbd_10_mse8x8_sse2 = vpx_highbd_10_mse8x8_sse2;
968
969 const VarianceMxNFunc highbd_8_mse16x16_sse2 = vpx_highbd_8_mse16x16_sse2;
970 const VarianceMxNFunc highbd_8_mse16x8_sse2 = vpx_highbd_8_mse16x8_sse2;
971 const VarianceMxNFunc highbd_8_mse8x16_sse2 = vpx_highbd_8_mse8x16_sse2;
972 const VarianceMxNFunc highbd_8_mse8x8_sse2 = vpx_highbd_8_mse8x8_sse2;
973
974 INSTANTIATE_TEST_CASE_P(
975 SSE2, VpxHBDMseTest, ::testing::Values(make_tuple(4, 4, highbd_12_mse16x16_s se2),
976 make_tuple(4, 3, highbd_12_mse16x8_ss e2),
977 make_tuple(3, 4, highbd_12_mse8x16_ss e2),
978 make_tuple(3, 3, highbd_12_mse8x8_sse 2),
979 make_tuple(4, 4, highbd_10_mse16x16_s se2),
980 make_tuple(4, 3, highbd_10_mse16x8_ss e2),
981 make_tuple(3, 4, highbd_10_mse8x16_ss e2),
982 make_tuple(3, 3, highbd_10_mse8x8_sse 2),
983 make_tuple(4, 4, highbd_8_mse16x16_ss e2),
984 make_tuple(4, 3, highbd_8_mse16x8_sse 2),
985 make_tuple(3, 4, highbd_8_mse8x16_sse 2),
986 make_tuple(3, 3, highbd_8_mse8x8_sse2 )));
987 */
988
989 const VarianceMxNFunc highbd_12_variance64x64_sse2 =
990 vpx_highbd_12_variance64x64_sse2;
991 const VarianceMxNFunc highbd_12_variance64x32_sse2 =
992 vpx_highbd_12_variance64x32_sse2;
993 const VarianceMxNFunc highbd_12_variance32x64_sse2 =
994 vpx_highbd_12_variance32x64_sse2;
995 const VarianceMxNFunc highbd_12_variance32x32_sse2 =
996 vpx_highbd_12_variance32x32_sse2;
997 const VarianceMxNFunc highbd_12_variance32x16_sse2 =
998 vpx_highbd_12_variance32x16_sse2;
999 const VarianceMxNFunc highbd_12_variance16x32_sse2 =
1000 vpx_highbd_12_variance16x32_sse2;
1001 const VarianceMxNFunc highbd_12_variance16x16_sse2 =
1002 vpx_highbd_12_variance16x16_sse2;
1003 const VarianceMxNFunc highbd_12_variance16x8_sse2 =
1004 vpx_highbd_12_variance16x8_sse2;
1005 const VarianceMxNFunc highbd_12_variance8x16_sse2 =
1006 vpx_highbd_12_variance8x16_sse2;
1007 const VarianceMxNFunc highbd_12_variance8x8_sse2 =
1008 vpx_highbd_12_variance8x8_sse2;
1009 const VarianceMxNFunc highbd_10_variance64x64_sse2 =
1010 vpx_highbd_10_variance64x64_sse2;
1011 const VarianceMxNFunc highbd_10_variance64x32_sse2 =
1012 vpx_highbd_10_variance64x32_sse2;
1013 const VarianceMxNFunc highbd_10_variance32x64_sse2 =
1014 vpx_highbd_10_variance32x64_sse2;
1015 const VarianceMxNFunc highbd_10_variance32x32_sse2 =
1016 vpx_highbd_10_variance32x32_sse2;
1017 const VarianceMxNFunc highbd_10_variance32x16_sse2 =
1018 vpx_highbd_10_variance32x16_sse2;
1019 const VarianceMxNFunc highbd_10_variance16x32_sse2 =
1020 vpx_highbd_10_variance16x32_sse2;
1021 const VarianceMxNFunc highbd_10_variance16x16_sse2 =
1022 vpx_highbd_10_variance16x16_sse2;
1023 const VarianceMxNFunc highbd_10_variance16x8_sse2 =
1024 vpx_highbd_10_variance16x8_sse2;
1025 const VarianceMxNFunc highbd_10_variance8x16_sse2 =
1026 vpx_highbd_10_variance8x16_sse2;
1027 const VarianceMxNFunc highbd_10_variance8x8_sse2 =
1028 vpx_highbd_10_variance8x8_sse2;
1029 const VarianceMxNFunc highbd_8_variance64x64_sse2 =
1030 vpx_highbd_8_variance64x64_sse2;
1031 const VarianceMxNFunc highbd_8_variance64x32_sse2 =
1032 vpx_highbd_8_variance64x32_sse2;
1033 const VarianceMxNFunc highbd_8_variance32x64_sse2 =
1034 vpx_highbd_8_variance32x64_sse2;
1035 const VarianceMxNFunc highbd_8_variance32x32_sse2 =
1036 vpx_highbd_8_variance32x32_sse2;
1037 const VarianceMxNFunc highbd_8_variance32x16_sse2 =
1038 vpx_highbd_8_variance32x16_sse2;
1039 const VarianceMxNFunc highbd_8_variance16x32_sse2 =
1040 vpx_highbd_8_variance16x32_sse2;
1041 const VarianceMxNFunc highbd_8_variance16x16_sse2 =
1042 vpx_highbd_8_variance16x16_sse2;
1043 const VarianceMxNFunc highbd_8_variance16x8_sse2 =
1044 vpx_highbd_8_variance16x8_sse2;
1045 const VarianceMxNFunc highbd_8_variance8x16_sse2 =
1046 vpx_highbd_8_variance8x16_sse2;
1047 const VarianceMxNFunc highbd_8_variance8x8_sse2 =
1048 vpx_highbd_8_variance8x8_sse2;
1049
1050 INSTANTIATE_TEST_CASE_P(
1051 SSE2, VpxHBDVarianceTest,
1052 ::testing::Values(make_tuple(6, 6, highbd_12_variance64x64_sse2, 12),
1053 make_tuple(6, 5, highbd_12_variance64x32_sse2, 12),
1054 make_tuple(5, 6, highbd_12_variance32x64_sse2, 12),
1055 make_tuple(5, 5, highbd_12_variance32x32_sse2, 12),
1056 make_tuple(5, 4, highbd_12_variance32x16_sse2, 12),
1057 make_tuple(4, 5, highbd_12_variance16x32_sse2, 12),
1058 make_tuple(4, 4, highbd_12_variance16x16_sse2, 12),
1059 make_tuple(4, 3, highbd_12_variance16x8_sse2, 12),
1060 make_tuple(3, 4, highbd_12_variance8x16_sse2, 12),
1061 make_tuple(3, 3, highbd_12_variance8x8_sse2, 12),
1062 make_tuple(6, 6, highbd_10_variance64x64_sse2, 10),
1063 make_tuple(6, 5, highbd_10_variance64x32_sse2, 10),
1064 make_tuple(5, 6, highbd_10_variance32x64_sse2, 10),
1065 make_tuple(5, 5, highbd_10_variance32x32_sse2, 10),
1066 make_tuple(5, 4, highbd_10_variance32x16_sse2, 10),
1067 make_tuple(4, 5, highbd_10_variance16x32_sse2, 10),
1068 make_tuple(4, 4, highbd_10_variance16x16_sse2, 10),
1069 make_tuple(4, 3, highbd_10_variance16x8_sse2, 10),
1070 make_tuple(3, 4, highbd_10_variance8x16_sse2, 10),
1071 make_tuple(3, 3, highbd_10_variance8x8_sse2, 10),
1072 make_tuple(6, 6, highbd_8_variance64x64_sse2, 8),
1073 make_tuple(6, 5, highbd_8_variance64x32_sse2, 8),
1074 make_tuple(5, 6, highbd_8_variance32x64_sse2, 8),
1075 make_tuple(5, 5, highbd_8_variance32x32_sse2, 8),
1076 make_tuple(5, 4, highbd_8_variance32x16_sse2, 8),
1077 make_tuple(4, 5, highbd_8_variance16x32_sse2, 8),
1078 make_tuple(4, 4, highbd_8_variance16x16_sse2, 8),
1079 make_tuple(4, 3, highbd_8_variance16x8_sse2, 8),
1080 make_tuple(3, 4, highbd_8_variance8x16_sse2, 8),
1081 make_tuple(3, 3, highbd_8_variance8x8_sse2, 8)));
1082 #endif // CONFIG_VP9_HIGHBITDEPTH
1083 #endif // HAVE_SSE2
1084
1085 #if CONFIG_VP9_ENCODER
906 typedef SubpelVarianceTest<vp9_subpixvariance_fn_t> VP9SubpelVarianceTest; 1086 typedef SubpelVarianceTest<vp9_subpixvariance_fn_t> VP9SubpelVarianceTest;
907 typedef SubpelVarianceTest<vp9_subp_avg_variance_fn_t> VP9SubpelAvgVarianceTest; 1087 typedef SubpelVarianceTest<vp9_subp_avg_variance_fn_t> VP9SubpelAvgVarianceTest;
908 1088
909 TEST_P(VP9VarianceTest, Zero) { ZeroTest(); }
910 TEST_P(VP9VarianceTest, Ref) { RefTest(); }
911 TEST_P(VP9VarianceTest, RefStride) { RefStrideTest(); }
912 TEST_P(VP9SubpelVarianceTest, Ref) { RefTest(); } 1089 TEST_P(VP9SubpelVarianceTest, Ref) { RefTest(); }
913 TEST_P(VP9SubpelVarianceTest, ExtremeRef) { ExtremeRefTest(); } 1090 TEST_P(VP9SubpelVarianceTest, ExtremeRef) { ExtremeRefTest(); }
914 TEST_P(VP9SubpelAvgVarianceTest, Ref) { RefTest(); } 1091 TEST_P(VP9SubpelAvgVarianceTest, Ref) { RefTest(); }
915 TEST_P(VP9VarianceTest, OneQuarter) { OneQuarterTest(); }
916 1092
917 #if CONFIG_VP9_HIGHBITDEPTH 1093 #if CONFIG_VP9_HIGHBITDEPTH
918 typedef VarianceTest<vp9_variance_fn_t> VP9VarianceHighTest;
919 typedef SubpelVarianceTest<vp9_subpixvariance_fn_t> VP9SubpelVarianceHighTest; 1094 typedef SubpelVarianceTest<vp9_subpixvariance_fn_t> VP9SubpelVarianceHighTest;
920 typedef SubpelVarianceTest<vp9_subp_avg_variance_fn_t> 1095 typedef SubpelVarianceTest<vp9_subp_avg_variance_fn_t>
921 VP9SubpelAvgVarianceHighTest; 1096 VP9SubpelAvgVarianceHighTest;
922 1097
923 TEST_P(VP9VarianceHighTest, Zero) { ZeroTest(); }
924 TEST_P(VP9VarianceHighTest, Ref) { RefTest(); }
925 TEST_P(VP9VarianceHighTest, RefStride) { RefStrideTest(); }
926 TEST_P(VP9SubpelVarianceHighTest, Ref) { RefTest(); } 1098 TEST_P(VP9SubpelVarianceHighTest, Ref) { RefTest(); }
927 TEST_P(VP9SubpelVarianceHighTest, ExtremeRef) { ExtremeRefTest(); } 1099 TEST_P(VP9SubpelVarianceHighTest, ExtremeRef) { ExtremeRefTest(); }
928 TEST_P(VP9SubpelAvgVarianceHighTest, Ref) { RefTest(); } 1100 TEST_P(VP9SubpelAvgVarianceHighTest, Ref) { RefTest(); }
929 TEST_P(VP9VarianceHighTest, OneQuarter) { OneQuarterTest(); }
930 #endif // CONFIG_VP9_HIGHBITDEPTH 1101 #endif // CONFIG_VP9_HIGHBITDEPTH
931 1102
932 const vp9_variance_fn_t variance4x4_c = vp9_variance4x4_c;
933 const vp9_variance_fn_t variance4x8_c = vp9_variance4x8_c;
934 const vp9_variance_fn_t variance8x4_c = vp9_variance8x4_c;
935 const vp9_variance_fn_t variance8x8_c = vp9_variance8x8_c;
936 const vp9_variance_fn_t variance8x16_c = vp9_variance8x16_c;
937 const vp9_variance_fn_t variance16x8_c = vp9_variance16x8_c;
938 const vp9_variance_fn_t variance16x16_c = vp9_variance16x16_c;
939 const vp9_variance_fn_t variance16x32_c = vp9_variance16x32_c;
940 const vp9_variance_fn_t variance32x16_c = vp9_variance32x16_c;
941 const vp9_variance_fn_t variance32x32_c = vp9_variance32x32_c;
942 const vp9_variance_fn_t variance32x64_c = vp9_variance32x64_c;
943 const vp9_variance_fn_t variance64x32_c = vp9_variance64x32_c;
944 const vp9_variance_fn_t variance64x64_c = vp9_variance64x64_c;
945 INSTANTIATE_TEST_CASE_P(
946 C, VP9VarianceTest,
947 ::testing::Values(make_tuple(2, 2, variance4x4_c, 0),
948 make_tuple(2, 3, variance4x8_c, 0),
949 make_tuple(3, 2, variance8x4_c, 0),
950 make_tuple(3, 3, variance8x8_c, 0),
951 make_tuple(3, 4, variance8x16_c, 0),
952 make_tuple(4, 3, variance16x8_c, 0),
953 make_tuple(4, 4, variance16x16_c, 0),
954 make_tuple(4, 5, variance16x32_c, 0),
955 make_tuple(5, 4, variance32x16_c, 0),
956 make_tuple(5, 5, variance32x32_c, 0),
957 make_tuple(5, 6, variance32x64_c, 0),
958 make_tuple(6, 5, variance64x32_c, 0),
959 make_tuple(6, 6, variance64x64_c, 0)));
960 #if CONFIG_VP9_HIGHBITDEPTH
961 const vp9_variance_fn_t highbd_10_variance4x4_c = vp9_highbd_10_variance4x4_c;
962 const vp9_variance_fn_t highbd_10_variance4x8_c = vp9_highbd_10_variance4x8_c;
963 const vp9_variance_fn_t highbd_10_variance8x4_c = vp9_highbd_10_variance8x4_c;
964 const vp9_variance_fn_t highbd_10_variance8x8_c = vp9_highbd_10_variance8x8_c;
965 const vp9_variance_fn_t highbd_10_variance8x16_c = vp9_highbd_10_variance8x16_c;
966 const vp9_variance_fn_t highbd_10_variance16x8_c = vp9_highbd_10_variance16x8_c;
967 const vp9_variance_fn_t highbd_10_variance16x16_c =
968 vp9_highbd_10_variance16x16_c;
969 const vp9_variance_fn_t highbd_10_variance16x32_c =
970 vp9_highbd_10_variance16x32_c;
971 const vp9_variance_fn_t highbd_10_variance32x16_c =
972 vp9_highbd_10_variance32x16_c;
973 const vp9_variance_fn_t highbd_10_variance32x32_c =
974 vp9_highbd_10_variance32x32_c;
975 const vp9_variance_fn_t highbd_10_variance32x64_c =
976 vp9_highbd_10_variance32x64_c;
977 const vp9_variance_fn_t highbd_10_variance64x32_c =
978 vp9_highbd_10_variance64x32_c;
979 const vp9_variance_fn_t highbd_10_variance64x64_c =
980 vp9_highbd_10_variance64x64_c;
981 const vp9_variance_fn_t highbd_12_variance4x4_c = vp9_highbd_12_variance4x4_c;
982 const vp9_variance_fn_t highbd_12_variance4x8_c = vp9_highbd_12_variance4x8_c;
983 const vp9_variance_fn_t highbd_12_variance8x4_c = vp9_highbd_12_variance8x4_c;
984 const vp9_variance_fn_t highbd_12_variance8x8_c = vp9_highbd_12_variance8x8_c;
985 const vp9_variance_fn_t highbd_12_variance8x16_c = vp9_highbd_12_variance8x16_c;
986 const vp9_variance_fn_t highbd_12_variance16x8_c = vp9_highbd_12_variance16x8_c;
987 const vp9_variance_fn_t highbd_12_variance16x16_c =
988 vp9_highbd_12_variance16x16_c;
989 const vp9_variance_fn_t highbd_12_variance16x32_c =
990 vp9_highbd_12_variance16x32_c;
991 const vp9_variance_fn_t highbd_12_variance32x16_c =
992 vp9_highbd_12_variance32x16_c;
993 const vp9_variance_fn_t highbd_12_variance32x32_c =
994 vp9_highbd_12_variance32x32_c;
995 const vp9_variance_fn_t highbd_12_variance32x64_c =
996 vp9_highbd_12_variance32x64_c;
997 const vp9_variance_fn_t highbd_12_variance64x32_c =
998 vp9_highbd_12_variance64x32_c;
999 const vp9_variance_fn_t highbd_12_variance64x64_c =
1000 vp9_highbd_12_variance64x64_c;
1001 const vp9_variance_fn_t highbd_variance4x4_c = vp9_highbd_variance4x4_c;
1002 const vp9_variance_fn_t highbd_variance4x8_c = vp9_highbd_variance4x8_c;
1003 const vp9_variance_fn_t highbd_variance8x4_c = vp9_highbd_variance8x4_c;
1004 const vp9_variance_fn_t highbd_variance8x8_c = vp9_highbd_variance8x8_c;
1005 const vp9_variance_fn_t highbd_variance8x16_c = vp9_highbd_variance8x16_c;
1006 const vp9_variance_fn_t highbd_variance16x8_c = vp9_highbd_variance16x8_c;
1007 const vp9_variance_fn_t highbd_variance16x16_c = vp9_highbd_variance16x16_c;
1008 const vp9_variance_fn_t highbd_variance16x32_c = vp9_highbd_variance16x32_c;
1009 const vp9_variance_fn_t highbd_variance32x16_c = vp9_highbd_variance32x16_c;
1010 const vp9_variance_fn_t highbd_variance32x32_c = vp9_highbd_variance32x32_c;
1011 const vp9_variance_fn_t highbd_variance32x64_c = vp9_highbd_variance32x64_c;
1012 const vp9_variance_fn_t highbd_variance64x32_c = vp9_highbd_variance64x32_c;
1013 const vp9_variance_fn_t highbd_variance64x64_c = vp9_highbd_variance64x64_c;
1014 INSTANTIATE_TEST_CASE_P(
1015 C, VP9VarianceHighTest,
1016 ::testing::Values(make_tuple(2, 2, highbd_10_variance4x4_c, 10),
1017 make_tuple(2, 3, highbd_10_variance4x8_c, 10),
1018 make_tuple(3, 2, highbd_10_variance8x4_c, 10),
1019 make_tuple(3, 3, highbd_10_variance8x8_c, 10),
1020 make_tuple(3, 4, highbd_10_variance8x16_c, 10),
1021 make_tuple(4, 3, highbd_10_variance16x8_c, 10),
1022 make_tuple(4, 4, highbd_10_variance16x16_c, 10),
1023 make_tuple(4, 5, highbd_10_variance16x32_c, 10),
1024 make_tuple(5, 4, highbd_10_variance32x16_c, 10),
1025 make_tuple(5, 5, highbd_10_variance32x32_c, 10),
1026 make_tuple(5, 6, highbd_10_variance32x64_c, 10),
1027 make_tuple(6, 5, highbd_10_variance64x32_c, 10),
1028 make_tuple(6, 6, highbd_10_variance64x64_c, 10),
1029 make_tuple(2, 2, highbd_12_variance4x4_c, 12),
1030 make_tuple(2, 3, highbd_12_variance4x8_c, 12),
1031 make_tuple(3, 2, highbd_12_variance8x4_c, 12),
1032 make_tuple(3, 3, highbd_12_variance8x8_c, 12),
1033 make_tuple(3, 4, highbd_12_variance8x16_c, 12),
1034 make_tuple(4, 3, highbd_12_variance16x8_c, 12),
1035 make_tuple(4, 4, highbd_12_variance16x16_c, 12),
1036 make_tuple(4, 5, highbd_12_variance16x32_c, 12),
1037 make_tuple(5, 4, highbd_12_variance32x16_c, 12),
1038 make_tuple(5, 5, highbd_12_variance32x32_c, 12),
1039 make_tuple(5, 6, highbd_12_variance32x64_c, 12),
1040 make_tuple(6, 5, highbd_12_variance64x32_c, 12),
1041 make_tuple(6, 6, highbd_12_variance64x64_c, 12),
1042 make_tuple(2, 2, highbd_variance4x4_c, 8),
1043 make_tuple(2, 3, highbd_variance4x8_c, 8),
1044 make_tuple(3, 2, highbd_variance8x4_c, 8),
1045 make_tuple(3, 3, highbd_variance8x8_c, 8),
1046 make_tuple(3, 4, highbd_variance8x16_c, 8),
1047 make_tuple(4, 3, highbd_variance16x8_c, 8),
1048 make_tuple(4, 4, highbd_variance16x16_c, 8),
1049 make_tuple(4, 5, highbd_variance16x32_c, 8),
1050 make_tuple(5, 4, highbd_variance32x16_c, 8),
1051 make_tuple(5, 5, highbd_variance32x32_c, 8),
1052 make_tuple(5, 6, highbd_variance32x64_c, 8),
1053 make_tuple(6, 5, highbd_variance64x32_c, 8),
1054 make_tuple(6, 6, highbd_variance64x64_c, 8)));
1055 #endif // CONFIG_VP9_HIGHBITDEPTH
1056 const vp9_subpixvariance_fn_t subpel_variance4x4_c = 1103 const vp9_subpixvariance_fn_t subpel_variance4x4_c =
1057 vp9_sub_pixel_variance4x4_c; 1104 vp9_sub_pixel_variance4x4_c;
1058 const vp9_subpixvariance_fn_t subpel_variance4x8_c = 1105 const vp9_subpixvariance_fn_t subpel_variance4x8_c =
1059 vp9_sub_pixel_variance4x8_c; 1106 vp9_sub_pixel_variance4x8_c;
1060 const vp9_subpixvariance_fn_t subpel_variance8x4_c = 1107 const vp9_subpixvariance_fn_t subpel_variance8x4_c =
1061 vp9_sub_pixel_variance8x4_c; 1108 vp9_sub_pixel_variance8x4_c;
1062 const vp9_subpixvariance_fn_t subpel_variance8x8_c = 1109 const vp9_subpixvariance_fn_t subpel_variance8x8_c =
1063 vp9_sub_pixel_variance8x8_c; 1110 vp9_sub_pixel_variance8x8_c;
1064 const vp9_subpixvariance_fn_t subpel_variance8x16_c = 1111 const vp9_subpixvariance_fn_t subpel_variance8x16_c =
1065 vp9_sub_pixel_variance8x16_c; 1112 vp9_sub_pixel_variance8x16_c;
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
1369 make_tuple(3, 4, highbd_subpel_avg_variance8x16_c, 8), 1416 make_tuple(3, 4, highbd_subpel_avg_variance8x16_c, 8),
1370 make_tuple(4, 3, highbd_subpel_avg_variance16x8_c, 8), 1417 make_tuple(4, 3, highbd_subpel_avg_variance16x8_c, 8),
1371 make_tuple(4, 4, highbd_subpel_avg_variance16x16_c, 8), 1418 make_tuple(4, 4, highbd_subpel_avg_variance16x16_c, 8),
1372 make_tuple(4, 5, highbd_subpel_avg_variance16x32_c, 8), 1419 make_tuple(4, 5, highbd_subpel_avg_variance16x32_c, 8),
1373 make_tuple(5, 4, highbd_subpel_avg_variance32x16_c, 8), 1420 make_tuple(5, 4, highbd_subpel_avg_variance32x16_c, 8),
1374 make_tuple(5, 5, highbd_subpel_avg_variance32x32_c, 8), 1421 make_tuple(5, 5, highbd_subpel_avg_variance32x32_c, 8),
1375 make_tuple(5, 6, highbd_subpel_avg_variance32x64_c, 8), 1422 make_tuple(5, 6, highbd_subpel_avg_variance32x64_c, 8),
1376 make_tuple(6, 5, highbd_subpel_avg_variance64x32_c, 8), 1423 make_tuple(6, 5, highbd_subpel_avg_variance64x32_c, 8),
1377 make_tuple(6, 6, highbd_subpel_avg_variance64x64_c, 8))); 1424 make_tuple(6, 6, highbd_subpel_avg_variance64x64_c, 8)));
1378 #endif // CONFIG_VP9_HIGHBITDEPTH 1425 #endif // CONFIG_VP9_HIGHBITDEPTH
1426 #endif // CONFIG_VP9_ENCODER
1379 1427
1428 #if CONFIG_VP9_ENCODER
1380 #if HAVE_SSE2 1429 #if HAVE_SSE2
1381 #if CONFIG_USE_X86INC 1430 #if CONFIG_USE_X86INC
1382 INSTANTIATE_TEST_CASE_P(SSE2, SumOfSquaresTest,
1383 ::testing::Values(vp9_get_mb_ss_sse2));
1384
1385 const vp9_variance_fn_t variance4x4_sse2 = vp9_variance4x4_sse2;
1386 const vp9_variance_fn_t variance4x8_sse2 = vp9_variance4x8_sse2;
1387 const vp9_variance_fn_t variance8x4_sse2 = vp9_variance8x4_sse2;
1388 const vp9_variance_fn_t variance8x8_sse2 = vp9_variance8x8_sse2;
1389 const vp9_variance_fn_t variance8x16_sse2 = vp9_variance8x16_sse2;
1390 const vp9_variance_fn_t variance16x8_sse2 = vp9_variance16x8_sse2;
1391 const vp9_variance_fn_t variance16x16_sse2 = vp9_variance16x16_sse2;
1392 const vp9_variance_fn_t variance16x32_sse2 = vp9_variance16x32_sse2;
1393 const vp9_variance_fn_t variance32x16_sse2 = vp9_variance32x16_sse2;
1394 const vp9_variance_fn_t variance32x32_sse2 = vp9_variance32x32_sse2;
1395 const vp9_variance_fn_t variance32x64_sse2 = vp9_variance32x64_sse2;
1396 const vp9_variance_fn_t variance64x32_sse2 = vp9_variance64x32_sse2;
1397 const vp9_variance_fn_t variance64x64_sse2 = vp9_variance64x64_sse2;
1398 INSTANTIATE_TEST_CASE_P(
1399 SSE2, VP9VarianceTest,
1400 ::testing::Values(make_tuple(2, 2, variance4x4_sse2, 0),
1401 make_tuple(2, 3, variance4x8_sse2, 0),
1402 make_tuple(3, 2, variance8x4_sse2, 0),
1403 make_tuple(3, 3, variance8x8_sse2, 0),
1404 make_tuple(3, 4, variance8x16_sse2, 0),
1405 make_tuple(4, 3, variance16x8_sse2, 0),
1406 make_tuple(4, 4, variance16x16_sse2, 0),
1407 make_tuple(4, 5, variance16x32_sse2, 0),
1408 make_tuple(5, 4, variance32x16_sse2, 0),
1409 make_tuple(5, 5, variance32x32_sse2, 0),
1410 make_tuple(5, 6, variance32x64_sse2, 0),
1411 make_tuple(6, 5, variance64x32_sse2, 0),
1412 make_tuple(6, 6, variance64x64_sse2, 0)));
1413 const vp9_subpixvariance_fn_t subpel_variance4x4_sse = 1431 const vp9_subpixvariance_fn_t subpel_variance4x4_sse =
1414 vp9_sub_pixel_variance4x4_sse; 1432 vp9_sub_pixel_variance4x4_sse;
1415 const vp9_subpixvariance_fn_t subpel_variance4x8_sse = 1433 const vp9_subpixvariance_fn_t subpel_variance4x8_sse =
1416 vp9_sub_pixel_variance4x8_sse; 1434 vp9_sub_pixel_variance4x8_sse;
1417 const vp9_subpixvariance_fn_t subpel_variance8x4_sse2 = 1435 const vp9_subpixvariance_fn_t subpel_variance8x4_sse2 =
1418 vp9_sub_pixel_variance8x4_sse2; 1436 vp9_sub_pixel_variance8x4_sse2;
1419 const vp9_subpixvariance_fn_t subpel_variance8x8_sse2 = 1437 const vp9_subpixvariance_fn_t subpel_variance8x8_sse2 =
1420 vp9_sub_pixel_variance8x8_sse2; 1438 vp9_sub_pixel_variance8x8_sse2;
1421 const vp9_subpixvariance_fn_t subpel_variance8x16_sse2 = 1439 const vp9_subpixvariance_fn_t subpel_variance8x16_sse2 =
1422 vp9_sub_pixel_variance8x16_sse2; 1440 vp9_sub_pixel_variance8x16_sse2;
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
1486 make_tuple(3, 4, subpel_avg_variance8x16_sse2, 0), 1504 make_tuple(3, 4, subpel_avg_variance8x16_sse2, 0),
1487 make_tuple(4, 3, subpel_avg_variance16x8_sse2, 0), 1505 make_tuple(4, 3, subpel_avg_variance16x8_sse2, 0),
1488 make_tuple(4, 4, subpel_avg_variance16x16_sse2, 0), 1506 make_tuple(4, 4, subpel_avg_variance16x16_sse2, 0),
1489 make_tuple(4, 5, subpel_avg_variance16x32_sse2, 0), 1507 make_tuple(4, 5, subpel_avg_variance16x32_sse2, 0),
1490 make_tuple(5, 4, subpel_avg_variance32x16_sse2, 0), 1508 make_tuple(5, 4, subpel_avg_variance32x16_sse2, 0),
1491 make_tuple(5, 5, subpel_avg_variance32x32_sse2, 0), 1509 make_tuple(5, 5, subpel_avg_variance32x32_sse2, 0),
1492 make_tuple(5, 6, subpel_avg_variance32x64_sse2, 0), 1510 make_tuple(5, 6, subpel_avg_variance32x64_sse2, 0),
1493 make_tuple(6, 5, subpel_avg_variance64x32_sse2, 0), 1511 make_tuple(6, 5, subpel_avg_variance64x32_sse2, 0),
1494 make_tuple(6, 6, subpel_avg_variance64x64_sse2, 0))); 1512 make_tuple(6, 6, subpel_avg_variance64x64_sse2, 0)));
1495 #if CONFIG_VP9_HIGHBITDEPTH 1513 #if CONFIG_VP9_HIGHBITDEPTH
1496 const vp9_variance_fn_t highbd_variance8x8_sse2 = vp9_highbd_variance8x8_sse2;
1497 const vp9_variance_fn_t highbd_10_variance8x8_sse2 =
1498 vp9_highbd_10_variance8x8_sse2;
1499 const vp9_variance_fn_t highbd_12_variance8x8_sse2 =
1500 vp9_highbd_12_variance8x8_sse2;
1501 const vp9_variance_fn_t highbd_variance8x16_sse2 = vp9_highbd_variance8x16_sse2;
1502 const vp9_variance_fn_t highbd_10_variance8x16_sse2 =
1503 vp9_highbd_10_variance8x16_sse2;
1504 const vp9_variance_fn_t highbd_12_variance8x16_sse2 =
1505 vp9_highbd_12_variance8x16_sse2;
1506 const vp9_variance_fn_t highbd_variance16x8_sse2 =
1507 vp9_highbd_variance16x8_sse2;
1508 const vp9_variance_fn_t highbd_10_variance16x8_sse2 =
1509 vp9_highbd_10_variance16x8_sse2;
1510 const vp9_variance_fn_t highbd_12_variance16x8_sse2 =
1511 vp9_highbd_12_variance16x8_sse2;
1512 const vp9_variance_fn_t highbd_variance16x16_sse2 =
1513 vp9_highbd_variance16x16_sse2;
1514 const vp9_variance_fn_t highbd_10_variance16x16_sse2 =
1515 vp9_highbd_10_variance16x16_sse2;
1516 const vp9_variance_fn_t highbd_12_variance16x16_sse2 =
1517 vp9_highbd_12_variance16x16_sse2;
1518 const vp9_variance_fn_t highbd_variance16x32_sse2 =
1519 vp9_highbd_variance16x32_sse2;
1520 const vp9_variance_fn_t highbd_10_variance16x32_sse2 =
1521 vp9_highbd_10_variance16x32_sse2;
1522 const vp9_variance_fn_t highbd_12_variance16x32_sse2 =
1523 vp9_highbd_12_variance16x32_sse2;
1524 const vp9_variance_fn_t highbd_variance32x16_sse2 =
1525 vp9_highbd_variance32x16_sse2;
1526 const vp9_variance_fn_t highbd_10_variance32x16_sse2 =
1527 vp9_highbd_10_variance32x16_sse2;
1528 const vp9_variance_fn_t highbd_12_variance32x16_sse2 =
1529 vp9_highbd_12_variance32x16_sse2;
1530 const vp9_variance_fn_t highbd_variance32x32_sse2 =
1531 vp9_highbd_variance32x32_sse2;
1532 const vp9_variance_fn_t highbd_10_variance32x32_sse2 =
1533 vp9_highbd_10_variance32x32_sse2;
1534 const vp9_variance_fn_t highbd_12_variance32x32_sse2 =
1535 vp9_highbd_12_variance32x32_sse2;
1536 const vp9_variance_fn_t highbd_variance32x64_sse2 =
1537 vp9_highbd_variance32x64_sse2;
1538 const vp9_variance_fn_t highbd_10_variance32x64_sse2 =
1539 vp9_highbd_10_variance32x64_sse2;
1540 const vp9_variance_fn_t highbd_12_variance32x64_sse2 =
1541 vp9_highbd_12_variance32x64_sse2;
1542 const vp9_variance_fn_t highbd_variance64x32_sse2 =
1543 vp9_highbd_variance64x32_sse2;
1544 const vp9_variance_fn_t highbd_10_variance64x32_sse2 =
1545 vp9_highbd_10_variance64x32_sse2;
1546 const vp9_variance_fn_t highbd_12_variance64x32_sse2 =
1547 vp9_highbd_12_variance64x32_sse2;
1548 const vp9_variance_fn_t highbd_variance64x64_sse2 =
1549 vp9_highbd_variance64x64_sse2;
1550 const vp9_variance_fn_t highbd_10_variance64x64_sse2 =
1551 vp9_highbd_10_variance64x64_sse2;
1552 const vp9_variance_fn_t highbd_12_variance64x64_sse2 =
1553 vp9_highbd_12_variance64x64_sse2;
1554 INSTANTIATE_TEST_CASE_P(
1555 SSE2, VP9VarianceHighTest,
1556 ::testing::Values(make_tuple(3, 3, highbd_10_variance8x8_sse2, 10),
1557 make_tuple(3, 4, highbd_10_variance8x16_sse2, 10),
1558 make_tuple(4, 3, highbd_10_variance16x8_sse2, 10),
1559 make_tuple(4, 4, highbd_10_variance16x16_sse2, 10),
1560 make_tuple(4, 5, highbd_10_variance16x32_sse2, 10),
1561 make_tuple(5, 4, highbd_10_variance32x16_sse2, 10),
1562 make_tuple(5, 5, highbd_10_variance32x32_sse2, 10),
1563 make_tuple(5, 6, highbd_10_variance32x64_sse2, 10),
1564 make_tuple(6, 5, highbd_10_variance64x32_sse2, 10),
1565 make_tuple(6, 6, highbd_10_variance64x64_sse2, 10),
1566 make_tuple(3, 3, highbd_12_variance8x8_sse2, 12),
1567 make_tuple(3, 4, highbd_12_variance8x16_sse2, 12),
1568 make_tuple(4, 3, highbd_12_variance16x8_sse2, 12),
1569 make_tuple(4, 4, highbd_12_variance16x16_sse2, 12),
1570 make_tuple(4, 5, highbd_12_variance16x32_sse2, 12),
1571 make_tuple(5, 4, highbd_12_variance32x16_sse2, 12),
1572 make_tuple(5, 5, highbd_12_variance32x32_sse2, 12),
1573 make_tuple(5, 6, highbd_12_variance32x64_sse2, 12),
1574 make_tuple(6, 5, highbd_12_variance64x32_sse2, 12),
1575 make_tuple(6, 6, highbd_12_variance64x64_sse2, 12),
1576 make_tuple(3, 3, highbd_variance8x8_sse2, 8),
1577 make_tuple(3, 4, highbd_variance8x16_sse2, 8),
1578 make_tuple(4, 3, highbd_variance16x8_sse2, 8),
1579 make_tuple(4, 4, highbd_variance16x16_sse2, 8),
1580 make_tuple(4, 5, highbd_variance16x32_sse2, 8),
1581 make_tuple(5, 4, highbd_variance32x16_sse2, 8),
1582 make_tuple(5, 5, highbd_variance32x32_sse2, 8),
1583 make_tuple(5, 6, highbd_variance32x64_sse2, 8),
1584 make_tuple(6, 5, highbd_variance64x32_sse2, 8),
1585 make_tuple(6, 6, highbd_variance64x64_sse2, 8)));
1586 const vp9_subpixvariance_fn_t highbd_subpel_variance8x4_sse2 = 1514 const vp9_subpixvariance_fn_t highbd_subpel_variance8x4_sse2 =
1587 vp9_highbd_sub_pixel_variance8x4_sse2; 1515 vp9_highbd_sub_pixel_variance8x4_sse2;
1588 const vp9_subpixvariance_fn_t highbd_subpel_variance8x8_sse2 = 1516 const vp9_subpixvariance_fn_t highbd_subpel_variance8x8_sse2 =
1589 vp9_highbd_sub_pixel_variance8x8_sse2; 1517 vp9_highbd_sub_pixel_variance8x8_sse2;
1590 const vp9_subpixvariance_fn_t highbd_subpel_variance8x16_sse2 = 1518 const vp9_subpixvariance_fn_t highbd_subpel_variance8x16_sse2 =
1591 vp9_highbd_sub_pixel_variance8x16_sse2; 1519 vp9_highbd_sub_pixel_variance8x16_sse2;
1592 const vp9_subpixvariance_fn_t highbd_subpel_variance16x8_sse2 = 1520 const vp9_subpixvariance_fn_t highbd_subpel_variance16x8_sse2 =
1593 vp9_highbd_sub_pixel_variance16x8_sse2; 1521 vp9_highbd_sub_pixel_variance16x8_sse2;
1594 const vp9_subpixvariance_fn_t highbd_subpel_variance16x16_sse2 = 1522 const vp9_subpixvariance_fn_t highbd_subpel_variance16x16_sse2 =
1595 vp9_highbd_sub_pixel_variance16x16_sse2; 1523 vp9_highbd_sub_pixel_variance16x16_sse2;
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
1782 make_tuple(4, 4, highbd_subpel_avg_variance16x16_sse2, 8), 1710 make_tuple(4, 4, highbd_subpel_avg_variance16x16_sse2, 8),
1783 make_tuple(4, 5, highbd_subpel_avg_variance16x32_sse2, 8), 1711 make_tuple(4, 5, highbd_subpel_avg_variance16x32_sse2, 8),
1784 make_tuple(5, 4, highbd_subpel_avg_variance32x16_sse2, 8), 1712 make_tuple(5, 4, highbd_subpel_avg_variance32x16_sse2, 8),
1785 make_tuple(5, 5, highbd_subpel_avg_variance32x32_sse2, 8), 1713 make_tuple(5, 5, highbd_subpel_avg_variance32x32_sse2, 8),
1786 make_tuple(5, 6, highbd_subpel_avg_variance32x64_sse2, 8), 1714 make_tuple(5, 6, highbd_subpel_avg_variance32x64_sse2, 8),
1787 make_tuple(6, 5, highbd_subpel_avg_variance64x32_sse2, 8), 1715 make_tuple(6, 5, highbd_subpel_avg_variance64x32_sse2, 8),
1788 make_tuple(6, 6, highbd_subpel_avg_variance64x64_sse2, 8))); 1716 make_tuple(6, 6, highbd_subpel_avg_variance64x64_sse2, 8)));
1789 #endif // CONFIG_VP9_HIGHBITDEPTH 1717 #endif // CONFIG_VP9_HIGHBITDEPTH
1790 #endif // CONFIG_USE_X86INC 1718 #endif // CONFIG_USE_X86INC
1791 #endif // HAVE_SSE2 1719 #endif // HAVE_SSE2
1720 #endif // CONFIG_VP9_ENCODER
1721
1722 #if CONFIG_VP9_ENCODER
1792 #if HAVE_SSSE3 1723 #if HAVE_SSSE3
1793 #if CONFIG_USE_X86INC 1724 #if CONFIG_USE_X86INC
1794 1725
1795 const vp9_subpixvariance_fn_t subpel_variance4x4_ssse3 = 1726 const vp9_subpixvariance_fn_t subpel_variance4x4_ssse3 =
1796 vp9_sub_pixel_variance4x4_ssse3; 1727 vp9_sub_pixel_variance4x4_ssse3;
1797 const vp9_subpixvariance_fn_t subpel_variance4x8_ssse3 = 1728 const vp9_subpixvariance_fn_t subpel_variance4x8_ssse3 =
1798 vp9_sub_pixel_variance4x8_ssse3; 1729 vp9_sub_pixel_variance4x8_ssse3;
1799 const vp9_subpixvariance_fn_t subpel_variance8x4_ssse3 = 1730 const vp9_subpixvariance_fn_t subpel_variance8x4_ssse3 =
1800 vp9_sub_pixel_variance8x4_ssse3; 1731 vp9_sub_pixel_variance8x4_ssse3;
1801 const vp9_subpixvariance_fn_t subpel_variance8x8_ssse3 = 1732 const vp9_subpixvariance_fn_t subpel_variance8x8_ssse3 =
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
1869 make_tuple(4, 3, subpel_avg_variance16x8_ssse3, 0), 1800 make_tuple(4, 3, subpel_avg_variance16x8_ssse3, 0),
1870 make_tuple(4, 4, subpel_avg_variance16x16_ssse3, 0), 1801 make_tuple(4, 4, subpel_avg_variance16x16_ssse3, 0),
1871 make_tuple(4, 5, subpel_avg_variance16x32_ssse3, 0), 1802 make_tuple(4, 5, subpel_avg_variance16x32_ssse3, 0),
1872 make_tuple(5, 4, subpel_avg_variance32x16_ssse3, 0), 1803 make_tuple(5, 4, subpel_avg_variance32x16_ssse3, 0),
1873 make_tuple(5, 5, subpel_avg_variance32x32_ssse3, 0), 1804 make_tuple(5, 5, subpel_avg_variance32x32_ssse3, 0),
1874 make_tuple(5, 6, subpel_avg_variance32x64_ssse3, 0), 1805 make_tuple(5, 6, subpel_avg_variance32x64_ssse3, 0),
1875 make_tuple(6, 5, subpel_avg_variance64x32_ssse3, 0), 1806 make_tuple(6, 5, subpel_avg_variance64x32_ssse3, 0),
1876 make_tuple(6, 6, subpel_avg_variance64x64_ssse3, 0))); 1807 make_tuple(6, 6, subpel_avg_variance64x64_ssse3, 0)));
1877 #endif // CONFIG_USE_X86INC 1808 #endif // CONFIG_USE_X86INC
1878 #endif // HAVE_SSSE3 1809 #endif // HAVE_SSSE3
1810 #endif // CONFIG_VP9_ENCODER
1879 1811
1880 #if HAVE_AVX2 1812 #if HAVE_AVX2
1813 const VarianceMxNFunc mse16x16_avx2 = vpx_mse16x16_avx2;
1814 INSTANTIATE_TEST_CASE_P(AVX2, VpxMseTest,
1815 ::testing::Values(make_tuple(4, 4, mse16x16_avx2)));
1881 1816
1882 const vp9_variance_fn_t variance16x16_avx2 = vp9_variance16x16_avx2; 1817 const VarianceMxNFunc variance64x64_avx2 = vpx_variance64x64_avx2;
1883 const vp9_variance_fn_t variance32x16_avx2 = vp9_variance32x16_avx2; 1818 const VarianceMxNFunc variance64x32_avx2 = vpx_variance64x32_avx2;
1884 const vp9_variance_fn_t variance32x32_avx2 = vp9_variance32x32_avx2; 1819 const VarianceMxNFunc variance32x32_avx2 = vpx_variance32x32_avx2;
1885 const vp9_variance_fn_t variance64x32_avx2 = vp9_variance64x32_avx2; 1820 const VarianceMxNFunc variance32x16_avx2 = vpx_variance32x16_avx2;
1886 const vp9_variance_fn_t variance64x64_avx2 = vp9_variance64x64_avx2; 1821 const VarianceMxNFunc variance16x16_avx2 = vpx_variance16x16_avx2;
1887 INSTANTIATE_TEST_CASE_P( 1822 INSTANTIATE_TEST_CASE_P(
1888 AVX2, VP9VarianceTest, 1823 AVX2, VpxVarianceTest,
1889 ::testing::Values(make_tuple(4, 4, variance16x16_avx2, 0), 1824 ::testing::Values(make_tuple(6, 6, variance64x64_avx2, 0),
1825 make_tuple(6, 5, variance64x32_avx2, 0),
1826 make_tuple(5, 5, variance32x32_avx2, 0),
1890 make_tuple(5, 4, variance32x16_avx2, 0), 1827 make_tuple(5, 4, variance32x16_avx2, 0),
1891 make_tuple(5, 5, variance32x32_avx2, 0), 1828 make_tuple(4, 4, variance16x16_avx2, 0)));
1892 make_tuple(6, 5, variance64x32_avx2, 0),
1893 make_tuple(6, 6, variance64x64_avx2, 0)));
1894 1829
1830 #if CONFIG_VP9_ENCODER
1895 const vp9_subpixvariance_fn_t subpel_variance32x32_avx2 = 1831 const vp9_subpixvariance_fn_t subpel_variance32x32_avx2 =
1896 vp9_sub_pixel_variance32x32_avx2; 1832 vp9_sub_pixel_variance32x32_avx2;
1897 const vp9_subpixvariance_fn_t subpel_variance64x64_avx2 = 1833 const vp9_subpixvariance_fn_t subpel_variance64x64_avx2 =
1898 vp9_sub_pixel_variance64x64_avx2; 1834 vp9_sub_pixel_variance64x64_avx2;
1899 INSTANTIATE_TEST_CASE_P( 1835 INSTANTIATE_TEST_CASE_P(
1900 AVX2, VP9SubpelVarianceTest, 1836 AVX2, VP9SubpelVarianceTest,
1901 ::testing::Values(make_tuple(5, 5, subpel_variance32x32_avx2, 0), 1837 ::testing::Values(make_tuple(5, 5, subpel_variance32x32_avx2, 0),
1902 make_tuple(6, 6, subpel_variance64x64_avx2, 0))); 1838 make_tuple(6, 6, subpel_variance64x64_avx2, 0)));
1903 1839
1904 const vp9_subp_avg_variance_fn_t subpel_avg_variance32x32_avx2 = 1840 const vp9_subp_avg_variance_fn_t subpel_avg_variance32x32_avx2 =
1905 vp9_sub_pixel_avg_variance32x32_avx2; 1841 vp9_sub_pixel_avg_variance32x32_avx2;
1906 const vp9_subp_avg_variance_fn_t subpel_avg_variance64x64_avx2 = 1842 const vp9_subp_avg_variance_fn_t subpel_avg_variance64x64_avx2 =
1907 vp9_sub_pixel_avg_variance64x64_avx2; 1843 vp9_sub_pixel_avg_variance64x64_avx2;
1908 INSTANTIATE_TEST_CASE_P( 1844 INSTANTIATE_TEST_CASE_P(
1909 AVX2, VP9SubpelAvgVarianceTest, 1845 AVX2, VP9SubpelAvgVarianceTest,
1910 ::testing::Values(make_tuple(5, 5, subpel_avg_variance32x32_avx2, 0), 1846 ::testing::Values(make_tuple(5, 5, subpel_avg_variance32x32_avx2, 0),
1911 make_tuple(6, 6, subpel_avg_variance64x64_avx2, 0))); 1847 make_tuple(6, 6, subpel_avg_variance64x64_avx2, 0)));
1848 #endif // CONFIG_VP9_ENCODER
1912 #endif // HAVE_AVX2 1849 #endif // HAVE_AVX2
1850
1913 #if HAVE_NEON 1851 #if HAVE_NEON
1914 const vp9_variance_fn_t variance8x8_neon = vp9_variance8x8_neon; 1852 const Get4x4SseFunc get4x4sse_cs_neon = vpx_get4x4sse_cs_neon;
1915 const vp9_variance_fn_t variance16x16_neon = vp9_variance16x16_neon; 1853 INSTANTIATE_TEST_CASE_P(NEON, VpxSseTest,
1916 const vp9_variance_fn_t variance32x32_neon = vp9_variance32x32_neon; 1854 ::testing::Values(make_tuple(2, 2, get4x4sse_cs_neon)));
1917 const vp9_variance_fn_t variance32x64_neon = vp9_variance32x64_neon; 1855
1918 const vp9_variance_fn_t variance64x32_neon = vp9_variance64x32_neon; 1856 const VarianceMxNFunc mse16x16_neon = vpx_mse16x16_neon;
1919 const vp9_variance_fn_t variance64x64_neon = vp9_variance64x64_neon; 1857 INSTANTIATE_TEST_CASE_P(NEON, VpxMseTest,
1858 ::testing::Values(make_tuple(4, 4, mse16x16_neon)));
1859
1860 const VarianceMxNFunc variance64x64_neon = vpx_variance64x64_neon;
1861 const VarianceMxNFunc variance64x32_neon = vpx_variance64x32_neon;
1862 const VarianceMxNFunc variance32x64_neon = vpx_variance32x64_neon;
1863 const VarianceMxNFunc variance32x32_neon = vpx_variance32x32_neon;
1864 const VarianceMxNFunc variance16x16_neon = vpx_variance16x16_neon;
1865 const VarianceMxNFunc variance16x8_neon = vpx_variance16x8_neon;
1866 const VarianceMxNFunc variance8x16_neon = vpx_variance8x16_neon;
1867 const VarianceMxNFunc variance8x8_neon = vpx_variance8x8_neon;
1920 INSTANTIATE_TEST_CASE_P( 1868 INSTANTIATE_TEST_CASE_P(
1921 NEON, VP9VarianceTest, 1869 NEON, VpxVarianceTest,
1922 ::testing::Values(make_tuple(3, 3, variance8x8_neon, 0), 1870 ::testing::Values(make_tuple(6, 6, variance64x64_neon, 0),
1871 make_tuple(6, 5, variance64x32_neon, 0),
1872 make_tuple(5, 6, variance32x64_neon, 0),
1873 make_tuple(5, 5, variance32x32_neon, 0),
1923 make_tuple(4, 4, variance16x16_neon, 0), 1874 make_tuple(4, 4, variance16x16_neon, 0),
1924 make_tuple(5, 5, variance32x32_neon, 0), 1875 make_tuple(4, 3, variance16x8_neon, 0),
1925 make_tuple(5, 6, variance32x64_neon, 0), 1876 make_tuple(3, 4, variance8x16_neon, 0),
1926 make_tuple(6, 5, variance64x32_neon, 0), 1877 make_tuple(3, 3, variance8x8_neon, 0)));
1927 make_tuple(6, 6, variance64x64_neon, 0)));
1928 1878
1879 #if CONFIG_VP9_ENCODER
1929 const vp9_subpixvariance_fn_t subpel_variance8x8_neon = 1880 const vp9_subpixvariance_fn_t subpel_variance8x8_neon =
1930 vp9_sub_pixel_variance8x8_neon; 1881 vp9_sub_pixel_variance8x8_neon;
1931 const vp9_subpixvariance_fn_t subpel_variance16x16_neon = 1882 const vp9_subpixvariance_fn_t subpel_variance16x16_neon =
1932 vp9_sub_pixel_variance16x16_neon; 1883 vp9_sub_pixel_variance16x16_neon;
1933 const vp9_subpixvariance_fn_t subpel_variance32x32_neon = 1884 const vp9_subpixvariance_fn_t subpel_variance32x32_neon =
1934 vp9_sub_pixel_variance32x32_neon; 1885 vp9_sub_pixel_variance32x32_neon;
1935 const vp9_subpixvariance_fn_t subpel_variance64x64_neon = 1886 const vp9_subpixvariance_fn_t subpel_variance64x64_neon =
1936 vp9_sub_pixel_variance64x64_neon; 1887 vp9_sub_pixel_variance64x64_neon;
1937 INSTANTIATE_TEST_CASE_P( 1888 INSTANTIATE_TEST_CASE_P(
1938 NEON, VP9SubpelVarianceTest, 1889 NEON, VP9SubpelVarianceTest,
1939 ::testing::Values(make_tuple(3, 3, subpel_variance8x8_neon, 0), 1890 ::testing::Values(make_tuple(3, 3, subpel_variance8x8_neon, 0),
1940 make_tuple(4, 4, subpel_variance16x16_neon, 0), 1891 make_tuple(4, 4, subpel_variance16x16_neon, 0),
1941 make_tuple(5, 5, subpel_variance32x32_neon, 0), 1892 make_tuple(5, 5, subpel_variance32x32_neon, 0),
1942 make_tuple(6, 6, subpel_variance64x64_neon, 0))); 1893 make_tuple(6, 6, subpel_variance64x64_neon, 0)));
1894 #endif // CONFIG_VP9_ENCODER
1943 #endif // HAVE_NEON 1895 #endif // HAVE_NEON
1944 #endif // CONFIG_VP9_ENCODER
1945 1896
1946 } // namespace vp9 1897 #if HAVE_MEDIA
1898 const VarianceMxNFunc mse16x16_media = vpx_mse16x16_media;
1899 INSTANTIATE_TEST_CASE_P(MEDIA, VpxMseTest,
1900 ::testing::Values(make_tuple(4, 4, mse16x16_media)));
1901
1902 const VarianceMxNFunc variance16x16_media = vpx_variance16x16_media;
1903 const VarianceMxNFunc variance8x8_media = vpx_variance8x8_media;
1904 INSTANTIATE_TEST_CASE_P(
1905 MEDIA, VpxVarianceTest,
1906 ::testing::Values(make_tuple(4, 4, variance16x16_media, 0),
1907 make_tuple(3, 3, variance8x8_media, 0)));
1908 #endif // HAVE_MEDIA
1947 } // namespace 1909 } // namespace
OLDNEW
« no previous file with comments | « source/libvpx/test/test_vectors.cc ('k') | source/libvpx/test/vp9_error_block_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698