James Zern | 9847344 | 2012-11-06 16:58:11 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2012 The WebM project authors. All Rights Reserved. |
| 3 | * |
| 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 |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 10 | |
| 11 | #include <cstdlib> |
James Zern | 9847344 | 2012-11-06 16:58:11 -0800 | [diff] [blame] | 12 | #include <new> |
| 13 | |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 14 | #include "test/acm_random.h" |
James Zern | 5b75674 | 2013-06-17 22:58:40 -0700 | [diff] [blame] | 15 | #include "test/clear_system_state.h" |
James Zern | cc774c8 | 2013-06-18 19:15:56 -0700 | [diff] [blame] | 16 | #include "test/register_state_check.h" |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 17 | #include "third_party/googletest/src/include/gtest/gtest.h" |
James Zern | 5b75674 | 2013-06-17 22:58:40 -0700 | [diff] [blame] | 18 | |
Yaowu Xu | afffa3d | 2013-09-05 08:45:56 -0700 | [diff] [blame] | 19 | #include "./vpx_config.h" |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 20 | #include "vpx/vpx_codec.h" |
| 21 | #include "vpx/vpx_integer.h" |
Ronald S. Bultje | ac6ea2a | 2013-06-21 17:03:57 -0700 | [diff] [blame] | 22 | #include "vpx_mem/vpx_mem.h" |
James Zern | 1711cf2 | 2013-02-22 16:23:36 -0800 | [diff] [blame] | 23 | #if CONFIG_VP8_ENCODER |
Yaowu Xu | afffa3d | 2013-09-05 08:45:56 -0700 | [diff] [blame] | 24 | # include "./vp8_rtcd.h" |
James Zern | 002ad40 | 2014-01-18 13:03:31 -0800 | [diff] [blame] | 25 | # include "vp8/common/variance.h" |
James Zern | 1711cf2 | 2013-02-22 16:23:36 -0800 | [diff] [blame] | 26 | #endif |
| 27 | #if CONFIG_VP9_ENCODER |
Yaowu Xu | afffa3d | 2013-09-05 08:45:56 -0700 | [diff] [blame] | 28 | # include "./vp9_rtcd.h" |
James Zern | 002ad40 | 2014-01-18 13:03:31 -0800 | [diff] [blame] | 29 | # include "vp9/encoder/vp9_variance.h" |
James Zern | 1711cf2 | 2013-02-22 16:23:36 -0800 | [diff] [blame] | 30 | #endif |
James Zern | 9847344 | 2012-11-06 16:58:11 -0800 | [diff] [blame] | 31 | |
| 32 | namespace { |
| 33 | |
| 34 | using ::std::tr1::get; |
| 35 | using ::std::tr1::make_tuple; |
| 36 | using ::std::tr1::tuple; |
Ronald S. Bultje | 8fb6c58 | 2013-06-20 09:34:25 -0700 | [diff] [blame] | 37 | using libvpx_test::ACMRandom; |
| 38 | |
Dmitry Kovalev | 1f19ebb | 2014-09-06 00:10:25 -0700 | [diff] [blame] | 39 | static unsigned int mb_ss_ref(const int16_t *src) { |
| 40 | unsigned int res = 0; |
| 41 | for (int i = 0; i < 256; ++i) { |
| 42 | res += src[i] * src[i]; |
| 43 | } |
| 44 | return res; |
| 45 | } |
| 46 | |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 47 | static unsigned int variance_ref(const uint8_t *src, const uint8_t *ref, |
| 48 | int l2w, int l2h, int src_stride_coeff, |
| 49 | int ref_stride_coeff, uint32_t *sse_ptr, |
| 50 | bool use_high_bit_depth_, |
| 51 | vpx_bit_depth_t bit_depth) { |
| 52 | #if CONFIG_VP9_HIGHBITDEPTH |
| 53 | int64_t se = 0; |
| 54 | uint64_t sse = 0; |
| 55 | const int w = 1 << l2w; |
| 56 | const int h = 1 << l2h; |
Ronald S. Bultje | 8fb6c58 | 2013-06-20 09:34:25 -0700 | [diff] [blame] | 57 | for (int y = 0; y < h; y++) { |
| 58 | for (int x = 0; x < w; x++) { |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 59 | int diff; |
| 60 | if (!use_high_bit_depth_) { |
| 61 | diff = ref[w * y * ref_stride_coeff + x] - |
| 62 | src[w * y * src_stride_coeff + x]; |
| 63 | se += diff; |
| 64 | sse += diff * diff; |
| 65 | } else { |
| 66 | diff = CONVERT_TO_SHORTPTR(ref)[w * y * ref_stride_coeff + x] - |
| 67 | CONVERT_TO_SHORTPTR(src)[w * y * src_stride_coeff + x]; |
| 68 | se += diff; |
| 69 | sse += diff * diff; |
| 70 | } |
| 71 | } |
| 72 | } |
| 73 | if (bit_depth > VPX_BITS_8) { |
| 74 | sse = ROUND_POWER_OF_TWO(sse, 2 * (bit_depth - 8)); |
| 75 | se = ROUND_POWER_OF_TWO(se, bit_depth - 8); |
| 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]; |
Ronald S. Bultje | 8fb6c58 | 2013-06-20 09:34:25 -0700 | [diff] [blame] | 86 | se += diff; |
| 87 | sse += diff * diff; |
| 88 | } |
| 89 | } |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 90 | #endif // CONFIG_VP9_HIGHBITDEPTH |
Ronald S. Bultje | 8fb6c58 | 2013-06-20 09:34:25 -0700 | [diff] [blame] | 91 | *sse_ptr = sse; |
| 92 | return sse - (((int64_t) se * se) >> (l2w + l2h)); |
| 93 | } |
| 94 | |
| 95 | static unsigned int subpel_variance_ref(const uint8_t *ref, const uint8_t *src, |
| 96 | int l2w, int l2h, int xoff, int yoff, |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 97 | unsigned int *sse_ptr, |
| 98 | bool use_high_bit_depth_, |
| 99 | vpx_bit_depth_t bit_depth) { |
| 100 | #if CONFIG_VP9_HIGHBITDEPTH |
| 101 | int64_t se = 0; |
| 102 | uint64_t sse = 0; |
| 103 | const int w = 1 << l2w; |
| 104 | const int h = 1 << l2h; |
Ronald S. Bultje | 8fb6c58 | 2013-06-20 09:34:25 -0700 | [diff] [blame] | 105 | for (int y = 0; y < h; y++) { |
| 106 | for (int x = 0; x < w; x++) { |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 107 | // Bilinear interpolation at a 16th pel step. |
| 108 | if (!use_high_bit_depth_) { |
| 109 | const int a1 = ref[(w + 1) * (y + 0) + x + 0]; |
| 110 | const int a2 = ref[(w + 1) * (y + 0) + x + 1]; |
| 111 | const int b1 = ref[(w + 1) * (y + 1) + x + 0]; |
| 112 | const int b2 = ref[(w + 1) * (y + 1) + x + 1]; |
| 113 | const int a = a1 + (((a2 - a1) * xoff + 8) >> 4); |
| 114 | const int b = b1 + (((b2 - b1) * xoff + 8) >> 4); |
| 115 | const int r = a + (((b - a) * yoff + 8) >> 4); |
| 116 | const int diff = r - src[w * y + x]; |
| 117 | se += diff; |
| 118 | sse += diff * diff; |
| 119 | } else { |
| 120 | uint16_t *ref16 = CONVERT_TO_SHORTPTR(ref); |
| 121 | uint16_t *src16 = CONVERT_TO_SHORTPTR(src); |
| 122 | const int a1 = ref16[(w + 1) * (y + 0) + x + 0]; |
| 123 | const int a2 = ref16[(w + 1) * (y + 0) + x + 1]; |
| 124 | const int b1 = ref16[(w + 1) * (y + 1) + x + 0]; |
| 125 | const int b2 = ref16[(w + 1) * (y + 1) + x + 1]; |
| 126 | const int a = a1 + (((a2 - a1) * xoff + 8) >> 4); |
| 127 | const int b = b1 + (((b2 - b1) * xoff + 8) >> 4); |
| 128 | const int r = a + (((b - a) * yoff + 8) >> 4); |
| 129 | const int diff = r - src16[w * y + x]; |
| 130 | se += diff; |
| 131 | sse += diff * diff; |
| 132 | } |
| 133 | } |
| 134 | } |
| 135 | if (bit_depth > VPX_BITS_8) { |
| 136 | sse = ROUND_POWER_OF_TWO(sse, 2 * (bit_depth - 8)); |
| 137 | se = ROUND_POWER_OF_TWO(se, bit_depth - 8); |
| 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. |
Ronald S. Bultje | 8fb6c58 | 2013-06-20 09:34:25 -0700 | [diff] [blame] | 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); |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 154 | const int diff = r - src[w * y + x]; |
Ronald S. Bultje | 8fb6c58 | 2013-06-20 09:34:25 -0700 | [diff] [blame] | 155 | se += diff; |
| 156 | sse += diff * diff; |
| 157 | } |
| 158 | } |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 159 | #endif // CONFIG_VP9_HIGHBITDEPTH |
Ronald S. Bultje | 8fb6c58 | 2013-06-20 09:34:25 -0700 | [diff] [blame] | 160 | *sse_ptr = sse; |
| 161 | return sse - (((int64_t) se * se) >> (l2w + l2h)); |
| 162 | } |
James Zern | 9847344 | 2012-11-06 16:58:11 -0800 | [diff] [blame] | 163 | |
Dmitry Kovalev | 1f19ebb | 2014-09-06 00:10:25 -0700 | [diff] [blame] | 164 | typedef unsigned int (*SumOfSquaresFunction)(const int16_t *src); |
| 165 | |
| 166 | class SumOfSquaresTest : public ::testing::TestWithParam<SumOfSquaresFunction> { |
| 167 | public: |
| 168 | SumOfSquaresTest() : func_(GetParam()) {} |
| 169 | |
| 170 | virtual ~SumOfSquaresTest() { |
| 171 | libvpx_test::ClearSystemState(); |
| 172 | } |
| 173 | |
| 174 | protected: |
| 175 | void ConstTest(); |
| 176 | void RefTest(); |
| 177 | |
| 178 | SumOfSquaresFunction func_; |
| 179 | ACMRandom rnd_; |
| 180 | }; |
| 181 | |
| 182 | void SumOfSquaresTest::ConstTest() { |
| 183 | int16_t mem[256]; |
| 184 | unsigned int res; |
| 185 | for (int v = 0; v < 256; ++v) { |
| 186 | for (int i = 0; i < 256; ++i) { |
| 187 | mem[i] = v; |
| 188 | } |
| 189 | ASM_REGISTER_STATE_CHECK(res = func_(mem)); |
| 190 | EXPECT_EQ(256u * (v * v), res); |
| 191 | } |
| 192 | } |
| 193 | |
| 194 | void SumOfSquaresTest::RefTest() { |
| 195 | int16_t mem[256]; |
| 196 | for (int i = 0; i < 100; ++i) { |
| 197 | for (int j = 0; j < 256; ++j) { |
| 198 | mem[j] = rnd_.Rand8() - rnd_.Rand8(); |
| 199 | } |
| 200 | |
| 201 | const unsigned int expected = mb_ss_ref(mem); |
| 202 | unsigned int res; |
| 203 | ASM_REGISTER_STATE_CHECK(res = func_(mem)); |
| 204 | EXPECT_EQ(expected, res); |
| 205 | } |
| 206 | } |
| 207 | |
James Zern | 1711cf2 | 2013-02-22 16:23:36 -0800 | [diff] [blame] | 208 | template<typename VarianceFunctionType> |
Yaowu Xu | afffa3d | 2013-09-05 08:45:56 -0700 | [diff] [blame] | 209 | class VarianceTest |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 210 | : public ::testing::TestWithParam<tuple<int, int, |
| 211 | VarianceFunctionType, int> > { |
James Zern | 9847344 | 2012-11-06 16:58:11 -0800 | [diff] [blame] | 212 | public: |
| 213 | virtual void SetUp() { |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 214 | const tuple<int, int, VarianceFunctionType, int>& params = this->GetParam(); |
Ronald S. Bultje | 8fb6c58 | 2013-06-20 09:34:25 -0700 | [diff] [blame] | 215 | log2width_ = get<0>(params); |
| 216 | width_ = 1 << log2width_; |
| 217 | log2height_ = get<1>(params); |
| 218 | height_ = 1 << log2height_; |
James Zern | 9847344 | 2012-11-06 16:58:11 -0800 | [diff] [blame] | 219 | variance_ = get<2>(params); |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 220 | if (get<3>(params)) { |
| 221 | bit_depth_ = static_cast<vpx_bit_depth_t>(get<3>(params)); |
| 222 | use_high_bit_depth_ = true; |
| 223 | } else { |
| 224 | bit_depth_ = VPX_BITS_8; |
| 225 | use_high_bit_depth_ = false; |
| 226 | } |
| 227 | mask_ = (1 << bit_depth_) - 1; |
James Zern | 9847344 | 2012-11-06 16:58:11 -0800 | [diff] [blame] | 228 | |
Dmitry Kovalev | 202edb3 | 2014-09-04 12:24:52 -0700 | [diff] [blame] | 229 | rnd_.Reset(ACMRandom::DeterministicSeed()); |
James Zern | 9847344 | 2012-11-06 16:58:11 -0800 | [diff] [blame] | 230 | block_size_ = width_ * height_; |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 231 | #if CONFIG_VP9_HIGHBITDEPTH |
| 232 | if (!use_high_bit_depth_) { |
| 233 | src_ = reinterpret_cast<uint8_t *>(vpx_memalign(16, block_size_ * 2)); |
| 234 | ref_ = new uint8_t[block_size_ * 2]; |
| 235 | } else { |
| 236 | src_ = CONVERT_TO_BYTEPTR(reinterpret_cast<uint16_t *>( |
| 237 | vpx_memalign(16, block_size_ * 2 * sizeof(uint16_t)))); |
| 238 | ref_ = CONVERT_TO_BYTEPTR(new uint16_t[block_size_ * 2]); |
| 239 | } |
| 240 | #else |
| 241 | src_ = reinterpret_cast<uint8_t *>(vpx_memalign(16, block_size_ * 2)); |
| 242 | ref_ = new uint8_t[block_size_ * 2]; |
| 243 | #endif |
James Zern | 9847344 | 2012-11-06 16:58:11 -0800 | [diff] [blame] | 244 | ASSERT_TRUE(src_ != NULL); |
| 245 | ASSERT_TRUE(ref_ != NULL); |
| 246 | } |
| 247 | |
| 248 | virtual void TearDown() { |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 249 | #if CONFIG_VP9_HIGHBITDEPTH |
| 250 | if (!use_high_bit_depth_) { |
| 251 | vpx_free(src_); |
| 252 | delete[] ref_; |
| 253 | } else { |
| 254 | vpx_free(CONVERT_TO_SHORTPTR(src_)); |
| 255 | delete[] CONVERT_TO_SHORTPTR(ref_); |
| 256 | } |
| 257 | #else |
Yunqing Wang | 5c93e62 | 2014-07-24 17:11:58 -0700 | [diff] [blame] | 258 | vpx_free(src_); |
James Zern | 9847344 | 2012-11-06 16:58:11 -0800 | [diff] [blame] | 259 | delete[] ref_; |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 260 | #endif |
James Zern | 5b75674 | 2013-06-17 22:58:40 -0700 | [diff] [blame] | 261 | libvpx_test::ClearSystemState(); |
James Zern | 9847344 | 2012-11-06 16:58:11 -0800 | [diff] [blame] | 262 | } |
| 263 | |
| 264 | protected: |
James Zern | 1711cf2 | 2013-02-22 16:23:36 -0800 | [diff] [blame] | 265 | void ZeroTest(); |
Ronald S. Bultje | 8fb6c58 | 2013-06-20 09:34:25 -0700 | [diff] [blame] | 266 | void RefTest(); |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 267 | void RefStrideTest(); |
James Zern | 1711cf2 | 2013-02-22 16:23:36 -0800 | [diff] [blame] | 268 | void OneQuarterTest(); |
| 269 | |
Dmitry Kovalev | 202edb3 | 2014-09-04 12:24:52 -0700 | [diff] [blame] | 270 | ACMRandom rnd_; |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 271 | uint8_t *src_; |
| 272 | uint8_t *ref_; |
Ronald S. Bultje | 8fb6c58 | 2013-06-20 09:34:25 -0700 | [diff] [blame] | 273 | int width_, log2width_; |
| 274 | int height_, log2height_; |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 275 | vpx_bit_depth_t bit_depth_; |
| 276 | int mask_; |
| 277 | bool use_high_bit_depth_; |
James Zern | 9847344 | 2012-11-06 16:58:11 -0800 | [diff] [blame] | 278 | int block_size_; |
James Zern | 1711cf2 | 2013-02-22 16:23:36 -0800 | [diff] [blame] | 279 | VarianceFunctionType variance_; |
James Zern | 9847344 | 2012-11-06 16:58:11 -0800 | [diff] [blame] | 280 | }; |
| 281 | |
James Zern | 1711cf2 | 2013-02-22 16:23:36 -0800 | [diff] [blame] | 282 | template<typename VarianceFunctionType> |
| 283 | void VarianceTest<VarianceFunctionType>::ZeroTest() { |
James Zern | 9847344 | 2012-11-06 16:58:11 -0800 | [diff] [blame] | 284 | for (int i = 0; i <= 255; ++i) { |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 285 | #if CONFIG_VP9_HIGHBITDEPTH |
| 286 | if (!use_high_bit_depth_) { |
| 287 | memset(src_, i, block_size_); |
| 288 | } else { |
| 289 | vpx_memset16(CONVERT_TO_SHORTPTR(src_), i << (bit_depth_ - 8), |
| 290 | block_size_); |
| 291 | } |
| 292 | #else |
James Zern | 9847344 | 2012-11-06 16:58:11 -0800 | [diff] [blame] | 293 | memset(src_, i, block_size_); |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 294 | #endif |
James Zern | 9847344 | 2012-11-06 16:58:11 -0800 | [diff] [blame] | 295 | for (int j = 0; j <= 255; ++j) { |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 296 | #if CONFIG_VP9_HIGHBITDEPTH |
| 297 | if (!use_high_bit_depth_) { |
| 298 | memset(ref_, j, block_size_); |
| 299 | } else { |
| 300 | vpx_memset16(CONVERT_TO_SHORTPTR(ref_), j << (bit_depth_ - 8), |
| 301 | block_size_); |
| 302 | } |
| 303 | #else |
James Zern | 9847344 | 2012-11-06 16:58:11 -0800 | [diff] [blame] | 304 | memset(ref_, j, block_size_); |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 305 | #endif |
James Zern | 9847344 | 2012-11-06 16:58:11 -0800 | [diff] [blame] | 306 | unsigned int sse; |
James Zern | cc774c8 | 2013-06-18 19:15:56 -0700 | [diff] [blame] | 307 | unsigned int var; |
James Zern | 29e1b1a | 2014-07-09 21:02:02 -0700 | [diff] [blame] | 308 | ASM_REGISTER_STATE_CHECK( |
| 309 | var = variance_(src_, width_, ref_, width_, &sse)); |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 310 | EXPECT_EQ(0u, var) << "src values: " << i << " ref values: " << j; |
James Zern | 9847344 | 2012-11-06 16:58:11 -0800 | [diff] [blame] | 311 | } |
| 312 | } |
| 313 | } |
| 314 | |
James Zern | 1711cf2 | 2013-02-22 16:23:36 -0800 | [diff] [blame] | 315 | template<typename VarianceFunctionType> |
Ronald S. Bultje | 8fb6c58 | 2013-06-20 09:34:25 -0700 | [diff] [blame] | 316 | void VarianceTest<VarianceFunctionType>::RefTest() { |
| 317 | for (int i = 0; i < 10; ++i) { |
| 318 | for (int j = 0; j < block_size_; j++) { |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 319 | #if CONFIG_VP9_HIGHBITDEPTH |
| 320 | if (!use_high_bit_depth_) { |
Dmitry Kovalev | 202edb3 | 2014-09-04 12:24:52 -0700 | [diff] [blame] | 321 | src_[j] = rnd_.Rand8(); |
| 322 | ref_[j] = rnd_.Rand8(); |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 323 | } else { |
| 324 | CONVERT_TO_SHORTPTR(src_)[j] = rnd_.Rand16() && mask_; |
| 325 | CONVERT_TO_SHORTPTR(ref_)[j] = rnd_.Rand16() && mask_; |
| 326 | } |
| 327 | #else |
| 328 | src_[j] = rnd_.Rand8(); |
| 329 | ref_[j] = rnd_.Rand8(); |
| 330 | #endif |
Ronald S. Bultje | 8fb6c58 | 2013-06-20 09:34:25 -0700 | [diff] [blame] | 331 | } |
| 332 | unsigned int sse1, sse2; |
James Zern | cc774c8 | 2013-06-18 19:15:56 -0700 | [diff] [blame] | 333 | unsigned int var1; |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 334 | const int stride_coeff = 1; |
James Zern | 29e1b1a | 2014-07-09 21:02:02 -0700 | [diff] [blame] | 335 | ASM_REGISTER_STATE_CHECK( |
| 336 | var1 = variance_(src_, width_, ref_, width_, &sse1)); |
Ronald S. Bultje | 8fb6c58 | 2013-06-20 09:34:25 -0700 | [diff] [blame] | 337 | const unsigned int var2 = variance_ref(src_, ref_, log2width_, |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 338 | log2height_, stride_coeff, |
| 339 | stride_coeff, &sse2, |
| 340 | use_high_bit_depth_, bit_depth_); |
| 341 | EXPECT_EQ(sse1, sse2); |
| 342 | EXPECT_EQ(var1, var2); |
| 343 | } |
| 344 | } |
| 345 | |
| 346 | template<typename VarianceFunctionType> |
| 347 | void VarianceTest<VarianceFunctionType>::RefStrideTest() { |
| 348 | for (int i = 0; i < 10; ++i) { |
| 349 | int ref_stride_coeff = i % 2; |
| 350 | int src_stride_coeff = (i >> 1) % 2; |
| 351 | for (int j = 0; j < block_size_; j++) { |
| 352 | int ref_ind = (j / width_) * ref_stride_coeff * width_ + j % width_; |
| 353 | int src_ind = (j / width_) * src_stride_coeff * width_ + j % width_; |
| 354 | #if CONFIG_VP9_HIGHBITDEPTH |
| 355 | if (!use_high_bit_depth_) { |
| 356 | src_[src_ind] = rnd_.Rand8(); |
| 357 | ref_[ref_ind] = rnd_.Rand8(); |
| 358 | } else { |
| 359 | CONVERT_TO_SHORTPTR(src_)[src_ind] = rnd_.Rand16() && mask_; |
| 360 | CONVERT_TO_SHORTPTR(ref_)[ref_ind] = rnd_.Rand16() && mask_; |
| 361 | } |
| 362 | #else |
| 363 | src_[src_ind] = rnd_.Rand8(); |
| 364 | ref_[ref_ind] = rnd_.Rand8(); |
| 365 | #endif |
| 366 | } |
| 367 | unsigned int sse1, sse2; |
| 368 | unsigned int var1; |
| 369 | |
| 370 | ASM_REGISTER_STATE_CHECK( |
| 371 | var1 = variance_(src_, width_ * src_stride_coeff, |
| 372 | ref_, width_ * ref_stride_coeff, &sse1)); |
| 373 | const unsigned int var2 = variance_ref(src_, ref_, log2width_, |
| 374 | log2height_, src_stride_coeff, |
| 375 | ref_stride_coeff, &sse2, |
| 376 | use_high_bit_depth_, bit_depth_); |
Ronald S. Bultje | 8fb6c58 | 2013-06-20 09:34:25 -0700 | [diff] [blame] | 377 | EXPECT_EQ(sse1, sse2); |
| 378 | EXPECT_EQ(var1, var2); |
| 379 | } |
| 380 | } |
| 381 | |
| 382 | template<typename VarianceFunctionType> |
James Zern | 1711cf2 | 2013-02-22 16:23:36 -0800 | [diff] [blame] | 383 | void VarianceTest<VarianceFunctionType>::OneQuarterTest() { |
James Zern | 9847344 | 2012-11-06 16:58:11 -0800 | [diff] [blame] | 384 | const int half = block_size_ / 2; |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 385 | #if CONFIG_VP9_HIGHBITDEPTH |
| 386 | if (!use_high_bit_depth_) { |
| 387 | memset(src_, 255, block_size_); |
| 388 | memset(ref_, 255, half); |
| 389 | memset(ref_ + half, 0, half); |
| 390 | } else { |
| 391 | vpx_memset16(CONVERT_TO_SHORTPTR(src_), 255 << (bit_depth_ - 8), |
| 392 | block_size_); |
| 393 | vpx_memset16(CONVERT_TO_SHORTPTR(ref_), 255 << (bit_depth_ - 8), half); |
| 394 | vpx_memset16(CONVERT_TO_SHORTPTR(ref_) + half, 0, half); |
| 395 | } |
| 396 | #else |
| 397 | memset(src_, 255, block_size_); |
James Zern | 9847344 | 2012-11-06 16:58:11 -0800 | [diff] [blame] | 398 | memset(ref_, 255, half); |
| 399 | memset(ref_ + half, 0, half); |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 400 | #endif |
James Zern | 9847344 | 2012-11-06 16:58:11 -0800 | [diff] [blame] | 401 | unsigned int sse; |
James Zern | cc774c8 | 2013-06-18 19:15:56 -0700 | [diff] [blame] | 402 | unsigned int var; |
James Zern | 29e1b1a | 2014-07-09 21:02:02 -0700 | [diff] [blame] | 403 | ASM_REGISTER_STATE_CHECK(var = variance_(src_, width_, ref_, width_, &sse)); |
James Zern | 9847344 | 2012-11-06 16:58:11 -0800 | [diff] [blame] | 404 | const unsigned int expected = block_size_ * 255 * 255 / 4; |
| 405 | EXPECT_EQ(expected, var); |
| 406 | } |
| 407 | |
Scott LaVarnway | fe2cc87 | 2014-08-20 07:56:19 -0700 | [diff] [blame] | 408 | #if CONFIG_VP8_ENCODER |
| 409 | template<typename MseFunctionType> |
| 410 | class MseTest |
| 411 | : public ::testing::TestWithParam<tuple<int, int, MseFunctionType> > { |
| 412 | public: |
| 413 | virtual void SetUp() { |
| 414 | const tuple<int, int, MseFunctionType>& params = this->GetParam(); |
| 415 | log2width_ = get<0>(params); |
| 416 | width_ = 1 << log2width_; |
| 417 | log2height_ = get<1>(params); |
| 418 | height_ = 1 << log2height_; |
| 419 | mse_ = get<2>(params); |
| 420 | |
| 421 | rnd(ACMRandom::DeterministicSeed()); |
| 422 | block_size_ = width_ * height_; |
| 423 | src_ = reinterpret_cast<uint8_t *>(vpx_memalign(16, block_size_)); |
| 424 | ref_ = new uint8_t[block_size_]; |
| 425 | ASSERT_TRUE(src_ != NULL); |
| 426 | ASSERT_TRUE(ref_ != NULL); |
| 427 | } |
| 428 | |
| 429 | virtual void TearDown() { |
| 430 | vpx_free(src_); |
| 431 | delete[] ref_; |
| 432 | libvpx_test::ClearSystemState(); |
| 433 | } |
| 434 | |
| 435 | protected: |
| 436 | void RefTest_mse(); |
| 437 | void RefTest_sse(); |
| 438 | void MaxTest_mse(); |
| 439 | void MaxTest_sse(); |
| 440 | |
| 441 | ACMRandom rnd; |
| 442 | uint8_t* src_; |
| 443 | uint8_t* ref_; |
| 444 | int width_, log2width_; |
| 445 | int height_, log2height_; |
| 446 | int block_size_; |
| 447 | MseFunctionType mse_; |
| 448 | }; |
| 449 | |
| 450 | template<typename MseFunctionType> |
| 451 | void MseTest<MseFunctionType>::RefTest_mse() { |
| 452 | for (int i = 0; i < 10; ++i) { |
| 453 | for (int j = 0; j < block_size_; j++) { |
| 454 | src_[j] = rnd.Rand8(); |
| 455 | ref_[j] = rnd.Rand8(); |
| 456 | } |
| 457 | unsigned int sse1, sse2; |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 458 | const int stride_coeff = 1; |
Scott LaVarnway | fe2cc87 | 2014-08-20 07:56:19 -0700 | [diff] [blame] | 459 | ASM_REGISTER_STATE_CHECK(mse_(src_, width_, ref_, width_, &sse1)); |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 460 | variance_ref(src_, ref_, log2width_, log2height_, stride_coeff, |
| 461 | stride_coeff, &sse2, false, VPX_BITS_8); |
Scott LaVarnway | fe2cc87 | 2014-08-20 07:56:19 -0700 | [diff] [blame] | 462 | EXPECT_EQ(sse1, sse2); |
| 463 | } |
| 464 | } |
| 465 | |
| 466 | template<typename MseFunctionType> |
| 467 | void MseTest<MseFunctionType>::RefTest_sse() { |
| 468 | for (int i = 0; i < 10; ++i) { |
| 469 | for (int j = 0; j < block_size_; j++) { |
| 470 | src_[j] = rnd.Rand8(); |
| 471 | ref_[j] = rnd.Rand8(); |
| 472 | } |
| 473 | unsigned int sse2; |
| 474 | unsigned int var1; |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 475 | const int stride_coeff = 1; |
| 476 | ASM_REGISTER_STATE_CHECK(var1 = mse_(src_, width_, ref_, width_)); |
| 477 | variance_ref(src_, ref_, log2width_, log2height_, stride_coeff, |
| 478 | stride_coeff, &sse2, false, VPX_BITS_8); |
Scott LaVarnway | fe2cc87 | 2014-08-20 07:56:19 -0700 | [diff] [blame] | 479 | EXPECT_EQ(var1, sse2); |
| 480 | } |
| 481 | } |
| 482 | |
| 483 | template<typename MseFunctionType> |
| 484 | void MseTest<MseFunctionType>::MaxTest_mse() { |
| 485 | memset(src_, 255, block_size_); |
| 486 | memset(ref_, 0, block_size_); |
| 487 | unsigned int sse; |
| 488 | ASM_REGISTER_STATE_CHECK(mse_(src_, width_, ref_, width_, &sse)); |
| 489 | const unsigned int expected = block_size_ * 255 * 255; |
| 490 | EXPECT_EQ(expected, sse); |
| 491 | } |
| 492 | |
| 493 | template<typename MseFunctionType> |
| 494 | void MseTest<MseFunctionType>::MaxTest_sse() { |
| 495 | memset(src_, 255, block_size_); |
| 496 | memset(ref_, 0, block_size_); |
| 497 | unsigned int var; |
| 498 | ASM_REGISTER_STATE_CHECK(var = mse_(src_, width_, ref_, width_)); |
| 499 | const unsigned int expected = block_size_ * 255 * 255; |
| 500 | EXPECT_EQ(expected, var); |
| 501 | } |
| 502 | #endif |
| 503 | |
James Zern | a0fcbcf | 2013-09-17 18:47:25 -0700 | [diff] [blame] | 504 | #if CONFIG_VP9_ENCODER |
James Zern | a0fcbcf | 2013-09-17 18:47:25 -0700 | [diff] [blame] | 505 | unsigned int subpel_avg_variance_ref(const uint8_t *ref, |
| 506 | const uint8_t *src, |
| 507 | const uint8_t *second_pred, |
| 508 | int l2w, int l2h, |
| 509 | int xoff, int yoff, |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 510 | unsigned int *sse_ptr, |
| 511 | bool use_high_bit_depth, |
| 512 | vpx_bit_depth_t bit_depth) { |
| 513 | #if CONFIG_VP9_HIGHBITDEPTH |
| 514 | int64_t se = 0; |
| 515 | uint64_t sse = 0; |
| 516 | const int w = 1 << l2w; |
| 517 | const int h = 1 << l2h; |
| 518 | for (int y = 0; y < h; y++) { |
| 519 | for (int x = 0; x < w; x++) { |
| 520 | // bilinear interpolation at a 16th pel step |
| 521 | if (!use_high_bit_depth) { |
| 522 | const int a1 = ref[(w + 1) * (y + 0) + x + 0]; |
| 523 | const int a2 = ref[(w + 1) * (y + 0) + x + 1]; |
| 524 | const int b1 = ref[(w + 1) * (y + 1) + x + 0]; |
| 525 | const int b2 = ref[(w + 1) * (y + 1) + x + 1]; |
| 526 | const int a = a1 + (((a2 - a1) * xoff + 8) >> 4); |
| 527 | const int b = b1 + (((b2 - b1) * xoff + 8) >> 4); |
| 528 | 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]; |
| 530 | se += diff; |
| 531 | sse += diff * diff; |
| 532 | } else { |
| 533 | uint16_t *ref16 = CONVERT_TO_SHORTPTR(ref); |
| 534 | uint16_t *src16 = CONVERT_TO_SHORTPTR(src); |
| 535 | uint16_t *sec16 = CONVERT_TO_SHORTPTR(second_pred); |
| 536 | const int a1 = ref16[(w + 1) * (y + 0) + x + 0]; |
| 537 | const int a2 = ref16[(w + 1) * (y + 0) + x + 1]; |
| 538 | const int b1 = ref16[(w + 1) * (y + 1) + x + 0]; |
| 539 | const int b2 = ref16[(w + 1) * (y + 1) + x + 1]; |
| 540 | const int a = a1 + (((a2 - a1) * xoff + 8) >> 4); |
| 541 | const int b = b1 + (((b2 - b1) * xoff + 8) >> 4); |
| 542 | const int r = a + (((b - a) * yoff + 8) >> 4); |
| 543 | const int diff = ((r + sec16[w * y + x] + 1) >> 1) - src16[w * y + x]; |
| 544 | se += diff; |
| 545 | sse += diff * diff; |
| 546 | } |
| 547 | } |
| 548 | } |
| 549 | if (bit_depth > 8) { |
| 550 | sse = ROUND_POWER_OF_TWO(sse, 2*(bit_depth-8)); |
| 551 | se = ROUND_POWER_OF_TWO(se, bit_depth-8); |
| 552 | } |
| 553 | #else |
James Zern | a0fcbcf | 2013-09-17 18:47:25 -0700 | [diff] [blame] | 554 | int se = 0; |
| 555 | unsigned int sse = 0; |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 556 | const int w = 1 << l2w; |
| 557 | const int h = 1 << l2h; |
James Zern | a0fcbcf | 2013-09-17 18:47:25 -0700 | [diff] [blame] | 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); |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 568 | const int diff = ((r + second_pred[w * y + x] + 1) >> 1) - src[w * y + x]; |
James Zern | a0fcbcf | 2013-09-17 18:47:25 -0700 | [diff] [blame] | 569 | se += diff; |
| 570 | sse += diff * diff; |
| 571 | } |
| 572 | } |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 573 | #endif // CONFIG_VP9_HIGHBITDEPTH |
James Zern | a0fcbcf | 2013-09-17 18:47:25 -0700 | [diff] [blame] | 574 | *sse_ptr = sse; |
| 575 | return sse - (((int64_t) se * se) >> (l2w + l2h)); |
| 576 | } |
| 577 | |
Ronald S. Bultje | 8fb6c58 | 2013-06-20 09:34:25 -0700 | [diff] [blame] | 578 | template<typename SubpelVarianceFunctionType> |
Yaowu Xu | afffa3d | 2013-09-05 08:45:56 -0700 | [diff] [blame] | 579 | class SubpelVarianceTest |
| 580 | : public ::testing::TestWithParam<tuple<int, int, |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 581 | SubpelVarianceFunctionType, int> > { |
Ronald S. Bultje | 8fb6c58 | 2013-06-20 09:34:25 -0700 | [diff] [blame] | 582 | public: |
| 583 | virtual void SetUp() { |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 584 | const tuple<int, int, SubpelVarianceFunctionType, int>& params = |
Ronald S. Bultje | 8fb6c58 | 2013-06-20 09:34:25 -0700 | [diff] [blame] | 585 | this->GetParam(); |
| 586 | log2width_ = get<0>(params); |
| 587 | width_ = 1 << log2width_; |
| 588 | log2height_ = get<1>(params); |
| 589 | height_ = 1 << log2height_; |
| 590 | subpel_variance_ = get<2>(params); |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 591 | if (get<3>(params)) { |
| 592 | bit_depth_ = (vpx_bit_depth_t) get<3>(params); |
| 593 | use_high_bit_depth_ = true; |
| 594 | } else { |
| 595 | bit_depth_ = VPX_BITS_8; |
| 596 | use_high_bit_depth_ = false; |
| 597 | } |
| 598 | mask_ = (1 << bit_depth_)-1; |
Ronald S. Bultje | 8fb6c58 | 2013-06-20 09:34:25 -0700 | [diff] [blame] | 599 | |
Dmitry Kovalev | 202edb3 | 2014-09-04 12:24:52 -0700 | [diff] [blame] | 600 | rnd_.Reset(ACMRandom::DeterministicSeed()); |
Ronald S. Bultje | 8fb6c58 | 2013-06-20 09:34:25 -0700 | [diff] [blame] | 601 | block_size_ = width_ * height_; |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 602 | #if CONFIG_VP9_HIGHBITDEPTH |
| 603 | if (!use_high_bit_depth_) { |
| 604 | src_ = reinterpret_cast<uint8_t *>(vpx_memalign(16, block_size_)); |
| 605 | sec_ = reinterpret_cast<uint8_t *>(vpx_memalign(16, block_size_)); |
| 606 | ref_ = new uint8_t[block_size_ + width_ + height_ + 1]; |
| 607 | } else { |
| 608 | src_ = CONVERT_TO_BYTEPTR( |
| 609 | reinterpret_cast<uint16_t *>( |
| 610 | vpx_memalign(16, block_size_*sizeof(uint16_t)))); |
| 611 | sec_ = CONVERT_TO_BYTEPTR( |
| 612 | reinterpret_cast<uint16_t *>( |
| 613 | vpx_memalign(16, block_size_*sizeof(uint16_t)))); |
| 614 | ref_ = CONVERT_TO_BYTEPTR( |
| 615 | new uint16_t[block_size_ + width_ + height_ + 1]); |
| 616 | } |
| 617 | #else |
Ronald S. Bultje | ac6ea2a | 2013-06-21 17:03:57 -0700 | [diff] [blame] | 618 | src_ = reinterpret_cast<uint8_t *>(vpx_memalign(16, block_size_)); |
| 619 | sec_ = reinterpret_cast<uint8_t *>(vpx_memalign(16, block_size_)); |
Ronald S. Bultje | 8fb6c58 | 2013-06-20 09:34:25 -0700 | [diff] [blame] | 620 | ref_ = new uint8_t[block_size_ + width_ + height_ + 1]; |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 621 | #endif // CONFIG_VP9_HIGHBITDEPTH |
Ronald S. Bultje | 8fb6c58 | 2013-06-20 09:34:25 -0700 | [diff] [blame] | 622 | ASSERT_TRUE(src_ != NULL); |
Ronald S. Bultje | ac6ea2a | 2013-06-21 17:03:57 -0700 | [diff] [blame] | 623 | ASSERT_TRUE(sec_ != NULL); |
Ronald S. Bultje | 8fb6c58 | 2013-06-20 09:34:25 -0700 | [diff] [blame] | 624 | ASSERT_TRUE(ref_ != NULL); |
| 625 | } |
| 626 | |
| 627 | virtual void TearDown() { |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 628 | #if CONFIG_VP9_HIGHBITDEPTH |
| 629 | if (!use_high_bit_depth_) { |
| 630 | vpx_free(src_); |
| 631 | delete[] ref_; |
| 632 | vpx_free(sec_); |
| 633 | } else { |
| 634 | vpx_free(CONVERT_TO_SHORTPTR(src_)); |
| 635 | delete[] CONVERT_TO_SHORTPTR(ref_); |
| 636 | vpx_free(CONVERT_TO_SHORTPTR(sec_)); |
| 637 | } |
| 638 | #else |
Ronald S. Bultje | ac6ea2a | 2013-06-21 17:03:57 -0700 | [diff] [blame] | 639 | vpx_free(src_); |
Ronald S. Bultje | 8fb6c58 | 2013-06-20 09:34:25 -0700 | [diff] [blame] | 640 | delete[] ref_; |
Ronald S. Bultje | ac6ea2a | 2013-06-21 17:03:57 -0700 | [diff] [blame] | 641 | vpx_free(sec_); |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 642 | #endif |
James Zern | e247ab0 | 2013-06-26 18:32:21 -0700 | [diff] [blame] | 643 | libvpx_test::ClearSystemState(); |
Ronald S. Bultje | 8fb6c58 | 2013-06-20 09:34:25 -0700 | [diff] [blame] | 644 | } |
| 645 | |
| 646 | protected: |
| 647 | void RefTest(); |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 648 | void ExtremeRefTest(); |
Ronald S. Bultje | 8fb6c58 | 2013-06-20 09:34:25 -0700 | [diff] [blame] | 649 | |
Dmitry Kovalev | 202edb3 | 2014-09-04 12:24:52 -0700 | [diff] [blame] | 650 | ACMRandom rnd_; |
Ronald S. Bultje | 1e6a32f | 2013-06-20 15:59:48 -0700 | [diff] [blame] | 651 | uint8_t *src_; |
| 652 | uint8_t *ref_; |
| 653 | uint8_t *sec_; |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 654 | bool use_high_bit_depth_; |
| 655 | vpx_bit_depth_t bit_depth_; |
Ronald S. Bultje | 8fb6c58 | 2013-06-20 09:34:25 -0700 | [diff] [blame] | 656 | int width_, log2width_; |
| 657 | int height_, log2height_; |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 658 | int block_size_, mask_; |
Ronald S. Bultje | 8fb6c58 | 2013-06-20 09:34:25 -0700 | [diff] [blame] | 659 | SubpelVarianceFunctionType subpel_variance_; |
| 660 | }; |
| 661 | |
| 662 | template<typename SubpelVarianceFunctionType> |
| 663 | void SubpelVarianceTest<SubpelVarianceFunctionType>::RefTest() { |
| 664 | for (int x = 0; x < 16; ++x) { |
| 665 | for (int y = 0; y < 16; ++y) { |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 666 | #if CONFIG_VP9_HIGHBITDEPTH |
| 667 | if (!use_high_bit_depth_) { |
| 668 | for (int j = 0; j < block_size_; j++) { |
| 669 | src_[j] = rnd_.Rand8(); |
| 670 | } |
| 671 | for (int j = 0; j < block_size_ + width_ + height_ + 1; j++) { |
| 672 | ref_[j] = rnd_.Rand8(); |
| 673 | } |
| 674 | } else { |
| 675 | for (int j = 0; j < block_size_; j++) { |
| 676 | CONVERT_TO_SHORTPTR(src_)[j] = rnd_.Rand16() & mask_; |
| 677 | } |
| 678 | for (int j = 0; j < block_size_ + width_ + height_ + 1; j++) { |
| 679 | CONVERT_TO_SHORTPTR(ref_)[j] = rnd_.Rand16() & mask_; |
| 680 | } |
| 681 | } |
| 682 | #else |
Ronald S. Bultje | 8fb6c58 | 2013-06-20 09:34:25 -0700 | [diff] [blame] | 683 | for (int j = 0; j < block_size_; j++) { |
Dmitry Kovalev | 202edb3 | 2014-09-04 12:24:52 -0700 | [diff] [blame] | 684 | src_[j] = rnd_.Rand8(); |
Ronald S. Bultje | 8fb6c58 | 2013-06-20 09:34:25 -0700 | [diff] [blame] | 685 | } |
| 686 | for (int j = 0; j < block_size_ + width_ + height_ + 1; j++) { |
Dmitry Kovalev | 202edb3 | 2014-09-04 12:24:52 -0700 | [diff] [blame] | 687 | ref_[j] = rnd_.Rand8(); |
Ronald S. Bultje | 8fb6c58 | 2013-06-20 09:34:25 -0700 | [diff] [blame] | 688 | } |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 689 | #endif // CONFIG_VP9_HIGHBITDEPTH |
Ronald S. Bultje | 8fb6c58 | 2013-06-20 09:34:25 -0700 | [diff] [blame] | 690 | unsigned int sse1, sse2; |
James Zern | cc774c8 | 2013-06-18 19:15:56 -0700 | [diff] [blame] | 691 | unsigned int var1; |
James Zern | 29e1b1a | 2014-07-09 21:02:02 -0700 | [diff] [blame] | 692 | ASM_REGISTER_STATE_CHECK(var1 = subpel_variance_(ref_, width_ + 1, x, y, |
| 693 | src_, width_, &sse1)); |
Ronald S. Bultje | 8fb6c58 | 2013-06-20 09:34:25 -0700 | [diff] [blame] | 694 | const unsigned int var2 = subpel_variance_ref(ref_, src_, log2width_, |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 695 | log2height_, x, y, &sse2, |
| 696 | use_high_bit_depth_, |
| 697 | bit_depth_); |
| 698 | EXPECT_EQ(sse1, sse2) << "at position " << x << ", " << y; |
| 699 | EXPECT_EQ(var1, var2) << "at position " << x << ", " << y; |
| 700 | } |
| 701 | } |
| 702 | } |
| 703 | |
| 704 | template<typename SubpelVarianceFunctionType> |
| 705 | void SubpelVarianceTest<SubpelVarianceFunctionType>::ExtremeRefTest() { |
| 706 | // Compare against reference. |
| 707 | // 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. |
| 709 | for (int x = 0; x < 16; ++x) { |
| 710 | for (int y = 0; y < 16; ++y) { |
| 711 | const int half = block_size_ / 2; |
| 712 | #if CONFIG_VP9_HIGHBITDEPTH |
| 713 | if (!use_high_bit_depth_) { |
| 714 | memset(src_, 0, half); |
| 715 | memset(src_ + half, 255, half); |
| 716 | memset(ref_, 255, half); |
| 717 | memset(ref_ + half, 0, half + width_ + height_ + 1); |
| 718 | } else { |
| 719 | vpx_memset16(CONVERT_TO_SHORTPTR(src_), mask_, half); |
| 720 | vpx_memset16(CONVERT_TO_SHORTPTR(src_) + half, 0, half); |
| 721 | vpx_memset16(CONVERT_TO_SHORTPTR(ref_), 0, half); |
| 722 | vpx_memset16(CONVERT_TO_SHORTPTR(ref_) + half, mask_, |
| 723 | half + width_ + height_ + 1); |
| 724 | } |
| 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; |
| 732 | unsigned int var1; |
| 733 | ASM_REGISTER_STATE_CHECK( |
| 734 | var1 = subpel_variance_(ref_, width_ + 1, x, y, src_, width_, &sse1)); |
| 735 | const unsigned int var2 = |
| 736 | subpel_variance_ref(ref_, src_, log2width_, log2height_, x, y, &sse2, |
| 737 | use_high_bit_depth_, bit_depth_); |
Ronald S. Bultje | 8fb6c58 | 2013-06-20 09:34:25 -0700 | [diff] [blame] | 738 | EXPECT_EQ(sse1, sse2) << "at position " << x << ", " << y; |
| 739 | EXPECT_EQ(var1, var2) << "at position " << x << ", " << y; |
| 740 | } |
| 741 | } |
| 742 | } |
| 743 | |
Ronald S. Bultje | 1e6a32f | 2013-06-20 15:59:48 -0700 | [diff] [blame] | 744 | template<> |
| 745 | void SubpelVarianceTest<vp9_subp_avg_variance_fn_t>::RefTest() { |
| 746 | for (int x = 0; x < 16; ++x) { |
| 747 | for (int y = 0; y < 16; ++y) { |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 748 | #if CONFIG_VP9_HIGHBITDEPTH |
| 749 | if (!use_high_bit_depth_) { |
| 750 | for (int j = 0; j < block_size_; j++) { |
| 751 | src_[j] = rnd_.Rand8(); |
| 752 | sec_[j] = rnd_.Rand8(); |
| 753 | } |
| 754 | for (int j = 0; j < block_size_ + width_ + height_ + 1; j++) { |
| 755 | ref_[j] = rnd_.Rand8(); |
| 756 | } |
| 757 | } else { |
| 758 | for (int j = 0; j < block_size_; j++) { |
| 759 | CONVERT_TO_SHORTPTR(src_)[j] = rnd_.Rand16() & mask_; |
| 760 | CONVERT_TO_SHORTPTR(sec_)[j] = rnd_.Rand16() & mask_; |
| 761 | } |
| 762 | for (int j = 0; j < block_size_ + width_ + height_ + 1; j++) { |
| 763 | CONVERT_TO_SHORTPTR(ref_)[j] = rnd_.Rand16() & mask_; |
| 764 | } |
| 765 | } |
| 766 | #else |
Ronald S. Bultje | 1e6a32f | 2013-06-20 15:59:48 -0700 | [diff] [blame] | 767 | for (int j = 0; j < block_size_; j++) { |
Dmitry Kovalev | 202edb3 | 2014-09-04 12:24:52 -0700 | [diff] [blame] | 768 | src_[j] = rnd_.Rand8(); |
| 769 | sec_[j] = rnd_.Rand8(); |
Ronald S. Bultje | 1e6a32f | 2013-06-20 15:59:48 -0700 | [diff] [blame] | 770 | } |
| 771 | for (int j = 0; j < block_size_ + width_ + height_ + 1; j++) { |
Dmitry Kovalev | 202edb3 | 2014-09-04 12:24:52 -0700 | [diff] [blame] | 772 | ref_[j] = rnd_.Rand8(); |
Ronald S. Bultje | 1e6a32f | 2013-06-20 15:59:48 -0700 | [diff] [blame] | 773 | } |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 774 | #endif |
Ronald S. Bultje | 1e6a32f | 2013-06-20 15:59:48 -0700 | [diff] [blame] | 775 | unsigned int sse1, sse2; |
James Zern | cc774c8 | 2013-06-18 19:15:56 -0700 | [diff] [blame] | 776 | unsigned int var1; |
James Zern | 29e1b1a | 2014-07-09 21:02:02 -0700 | [diff] [blame] | 777 | ASM_REGISTER_STATE_CHECK( |
| 778 | var1 = subpel_variance_(ref_, width_ + 1, x, y, |
| 779 | src_, width_, &sse1, sec_)); |
Ronald S. Bultje | 1e6a32f | 2013-06-20 15:59:48 -0700 | [diff] [blame] | 780 | const unsigned int var2 = subpel_avg_variance_ref(ref_, src_, sec_, |
| 781 | log2width_, log2height_, |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 782 | x, y, &sse2, |
| 783 | use_high_bit_depth_, |
| 784 | bit_depth_); |
Ronald S. Bultje | 1e6a32f | 2013-06-20 15:59:48 -0700 | [diff] [blame] | 785 | EXPECT_EQ(sse1, sse2) << "at position " << x << ", " << y; |
| 786 | EXPECT_EQ(var1, var2) << "at position " << x << ", " << y; |
| 787 | } |
| 788 | } |
| 789 | } |
| 790 | |
James Zern | a0fcbcf | 2013-09-17 18:47:25 -0700 | [diff] [blame] | 791 | #endif // CONFIG_VP9_ENCODER |
| 792 | |
James Zern | 1711cf2 | 2013-02-22 16:23:36 -0800 | [diff] [blame] | 793 | // ----------------------------------------------------------------------------- |
| 794 | // VP8 test cases. |
| 795 | |
| 796 | namespace vp8 { |
| 797 | |
| 798 | #if CONFIG_VP8_ENCODER |
Scott LaVarnway | fe2cc87 | 2014-08-20 07:56:19 -0700 | [diff] [blame] | 799 | typedef unsigned int (*vp8_sse_fn_t)(const unsigned char *src_ptr, |
| 800 | int source_stride, const unsigned char *ref_ptr, int ref_stride); |
| 801 | |
| 802 | typedef MseTest<vp8_sse_fn_t> VP8SseTest; |
| 803 | typedef MseTest<vp8_variance_fn_t> VP8MseTest; |
James Zern | 1711cf2 | 2013-02-22 16:23:36 -0800 | [diff] [blame] | 804 | typedef VarianceTest<vp8_variance_fn_t> VP8VarianceTest; |
| 805 | |
Scott LaVarnway | fe2cc87 | 2014-08-20 07:56:19 -0700 | [diff] [blame] | 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(); } |
James Zern | 1711cf2 | 2013-02-22 16:23:36 -0800 | [diff] [blame] | 810 | TEST_P(VP8VarianceTest, Zero) { ZeroTest(); } |
Ronald S. Bultje | 8fb6c58 | 2013-06-20 09:34:25 -0700 | [diff] [blame] | 811 | TEST_P(VP8VarianceTest, Ref) { RefTest(); } |
James Zern | 1711cf2 | 2013-02-22 16:23:36 -0800 | [diff] [blame] | 812 | TEST_P(VP8VarianceTest, OneQuarter) { OneQuarterTest(); } |
| 813 | |
Scott LaVarnway | fe2cc87 | 2014-08-20 07:56:19 -0700 | [diff] [blame] | 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 | |
James Zern | 6e5e75f | 2014-05-08 14:32:32 -0700 | [diff] [blame] | 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; |
James Zern | 1711cf2 | 2013-02-22 16:23:36 -0800 | [diff] [blame] | 829 | INSTANTIATE_TEST_CASE_P( |
| 830 | C, VP8VarianceTest, |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 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))); |
James Zern | 1711cf2 | 2013-02-22 16:23:36 -0800 | [diff] [blame] | 836 | |
James Zern | d5e07a8 | 2014-02-25 23:11:49 -0800 | [diff] [blame] | 837 | #if HAVE_NEON |
Scott LaVarnway | fe2cc87 | 2014-08-20 07:56:19 -0700 | [diff] [blame] | 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 | |
James Zern | 6e5e75f | 2014-05-08 14:32:32 -0700 | [diff] [blame] | 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; |
James Zern | d5e07a8 | 2014-02-25 23:11:49 -0800 | [diff] [blame] | 852 | INSTANTIATE_TEST_CASE_P( |
| 853 | NEON, VP8VarianceTest, |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 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))); |
James Zern | d5e07a8 | 2014-02-25 23:11:49 -0800 | [diff] [blame] | 858 | #endif |
| 859 | |
James Zern | 1711cf2 | 2013-02-22 16:23:36 -0800 | [diff] [blame] | 860 | #if HAVE_MMX |
James Zern | 6e5e75f | 2014-05-08 14:32:32 -0700 | [diff] [blame] | 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; |
James Zern | 1711cf2 | 2013-02-22 16:23:36 -0800 | [diff] [blame] | 866 | INSTANTIATE_TEST_CASE_P( |
| 867 | MMX, VP8VarianceTest, |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 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))); |
James Zern | 1711cf2 | 2013-02-22 16:23:36 -0800 | [diff] [blame] | 873 | #endif |
| 874 | |
| 875 | #if HAVE_SSE2 |
James Zern | 6e5e75f | 2014-05-08 14:32:32 -0700 | [diff] [blame] | 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; |
James Zern | 1711cf2 | 2013-02-22 16:23:36 -0800 | [diff] [blame] | 881 | INSTANTIATE_TEST_CASE_P( |
| 882 | SSE2, VP8VarianceTest, |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 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))); |
James Zern | 1711cf2 | 2013-02-22 16:23:36 -0800 | [diff] [blame] | 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 |
Dmitry Kovalev | 1f19ebb | 2014-09-06 00:10:25 -0700 | [diff] [blame] | 899 | TEST_P(SumOfSquaresTest, Const) { ConstTest(); } |
| 900 | TEST_P(SumOfSquaresTest, Ref) { RefTest(); } |
| 901 | |
| 902 | INSTANTIATE_TEST_CASE_P(C, SumOfSquaresTest, |
| 903 | ::testing::Values(vp9_get_mb_ss_c)); |
| 904 | |
James Zern | 1711cf2 | 2013-02-22 16:23:36 -0800 | [diff] [blame] | 905 | typedef VarianceTest<vp9_variance_fn_t> VP9VarianceTest; |
Ronald S. Bultje | 8fb6c58 | 2013-06-20 09:34:25 -0700 | [diff] [blame] | 906 | typedef SubpelVarianceTest<vp9_subpixvariance_fn_t> VP9SubpelVarianceTest; |
Ronald S. Bultje | 1e6a32f | 2013-06-20 15:59:48 -0700 | [diff] [blame] | 907 | typedef SubpelVarianceTest<vp9_subp_avg_variance_fn_t> VP9SubpelAvgVarianceTest; |
James Zern | 1711cf2 | 2013-02-22 16:23:36 -0800 | [diff] [blame] | 908 | |
| 909 | TEST_P(VP9VarianceTest, Zero) { ZeroTest(); } |
Ronald S. Bultje | 8fb6c58 | 2013-06-20 09:34:25 -0700 | [diff] [blame] | 910 | TEST_P(VP9VarianceTest, Ref) { RefTest(); } |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 911 | TEST_P(VP9VarianceTest, RefStride) { RefStrideTest(); } |
Ronald S. Bultje | 8fb6c58 | 2013-06-20 09:34:25 -0700 | [diff] [blame] | 912 | TEST_P(VP9SubpelVarianceTest, Ref) { RefTest(); } |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 913 | TEST_P(VP9SubpelVarianceTest, ExtremeRef) { ExtremeRefTest(); } |
Ronald S. Bultje | 1e6a32f | 2013-06-20 15:59:48 -0700 | [diff] [blame] | 914 | TEST_P(VP9SubpelAvgVarianceTest, Ref) { RefTest(); } |
James Zern | 1711cf2 | 2013-02-22 16:23:36 -0800 | [diff] [blame] | 915 | TEST_P(VP9VarianceTest, OneQuarter) { OneQuarterTest(); } |
| 916 | |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 917 | #if CONFIG_VP9_HIGHBITDEPTH |
| 918 | typedef VarianceTest<vp9_variance_fn_t> VP9VarianceHighTest; |
| 919 | typedef SubpelVarianceTest<vp9_subpixvariance_fn_t> VP9SubpelVarianceHighTest; |
| 920 | typedef SubpelVarianceTest<vp9_subp_avg_variance_fn_t> |
| 921 | VP9SubpelAvgVarianceHighTest; |
| 922 | |
| 923 | TEST_P(VP9VarianceHighTest, Zero) { ZeroTest(); } |
| 924 | TEST_P(VP9VarianceHighTest, Ref) { RefTest(); } |
| 925 | TEST_P(VP9VarianceHighTest, RefStride) { RefStrideTest(); } |
| 926 | TEST_P(VP9SubpelVarianceHighTest, Ref) { RefTest(); } |
| 927 | TEST_P(VP9SubpelVarianceHighTest, ExtremeRef) { ExtremeRefTest(); } |
| 928 | TEST_P(VP9SubpelAvgVarianceHighTest, Ref) { RefTest(); } |
| 929 | TEST_P(VP9VarianceHighTest, OneQuarter) { OneQuarterTest(); } |
| 930 | #endif // CONFIG_VP9_HIGHBITDEPTH |
| 931 | |
James Zern | 6e5e75f | 2014-05-08 14:32:32 -0700 | [diff] [blame] | 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; |
James Zern | 9847344 | 2012-11-06 16:58:11 -0800 | [diff] [blame] | 945 | INSTANTIATE_TEST_CASE_P( |
| 946 | C, VP9VarianceTest, |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 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 |
James Zern | 6e5e75f | 2014-05-08 14:32:32 -0700 | [diff] [blame] | 1056 | const vp9_subpixvariance_fn_t subpel_variance4x4_c = |
| 1057 | vp9_sub_pixel_variance4x4_c; |
| 1058 | const vp9_subpixvariance_fn_t subpel_variance4x8_c = |
| 1059 | vp9_sub_pixel_variance4x8_c; |
| 1060 | const vp9_subpixvariance_fn_t subpel_variance8x4_c = |
| 1061 | vp9_sub_pixel_variance8x4_c; |
| 1062 | const vp9_subpixvariance_fn_t subpel_variance8x8_c = |
| 1063 | vp9_sub_pixel_variance8x8_c; |
| 1064 | const vp9_subpixvariance_fn_t subpel_variance8x16_c = |
| 1065 | vp9_sub_pixel_variance8x16_c; |
| 1066 | const vp9_subpixvariance_fn_t subpel_variance16x8_c = |
| 1067 | vp9_sub_pixel_variance16x8_c; |
| 1068 | const vp9_subpixvariance_fn_t subpel_variance16x16_c = |
| 1069 | vp9_sub_pixel_variance16x16_c; |
| 1070 | const vp9_subpixvariance_fn_t subpel_variance16x32_c = |
| 1071 | vp9_sub_pixel_variance16x32_c; |
| 1072 | const vp9_subpixvariance_fn_t subpel_variance32x16_c = |
| 1073 | vp9_sub_pixel_variance32x16_c; |
| 1074 | const vp9_subpixvariance_fn_t subpel_variance32x32_c = |
| 1075 | vp9_sub_pixel_variance32x32_c; |
| 1076 | const vp9_subpixvariance_fn_t subpel_variance32x64_c = |
| 1077 | vp9_sub_pixel_variance32x64_c; |
| 1078 | const vp9_subpixvariance_fn_t subpel_variance64x32_c = |
| 1079 | vp9_sub_pixel_variance64x32_c; |
| 1080 | const vp9_subpixvariance_fn_t subpel_variance64x64_c = |
| 1081 | vp9_sub_pixel_variance64x64_c; |
Ronald S. Bultje | 8fb6c58 | 2013-06-20 09:34:25 -0700 | [diff] [blame] | 1082 | INSTANTIATE_TEST_CASE_P( |
| 1083 | C, VP9SubpelVarianceTest, |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 1084 | ::testing::Values(make_tuple(2, 2, subpel_variance4x4_c, 0), |
| 1085 | make_tuple(2, 3, subpel_variance4x8_c, 0), |
| 1086 | make_tuple(3, 2, subpel_variance8x4_c, 0), |
| 1087 | make_tuple(3, 3, subpel_variance8x8_c, 0), |
| 1088 | make_tuple(3, 4, subpel_variance8x16_c, 0), |
| 1089 | make_tuple(4, 3, subpel_variance16x8_c, 0), |
| 1090 | make_tuple(4, 4, subpel_variance16x16_c, 0), |
| 1091 | make_tuple(4, 5, subpel_variance16x32_c, 0), |
| 1092 | make_tuple(5, 4, subpel_variance32x16_c, 0), |
| 1093 | make_tuple(5, 5, subpel_variance32x32_c, 0), |
| 1094 | make_tuple(5, 6, subpel_variance32x64_c, 0), |
| 1095 | make_tuple(6, 5, subpel_variance64x32_c, 0), |
| 1096 | make_tuple(6, 6, subpel_variance64x64_c, 0))); |
James Zern | 6e5e75f | 2014-05-08 14:32:32 -0700 | [diff] [blame] | 1097 | const vp9_subp_avg_variance_fn_t subpel_avg_variance4x4_c = |
| 1098 | vp9_sub_pixel_avg_variance4x4_c; |
| 1099 | const vp9_subp_avg_variance_fn_t subpel_avg_variance4x8_c = |
| 1100 | vp9_sub_pixel_avg_variance4x8_c; |
| 1101 | const vp9_subp_avg_variance_fn_t subpel_avg_variance8x4_c = |
| 1102 | vp9_sub_pixel_avg_variance8x4_c; |
| 1103 | const vp9_subp_avg_variance_fn_t subpel_avg_variance8x8_c = |
| 1104 | vp9_sub_pixel_avg_variance8x8_c; |
| 1105 | const vp9_subp_avg_variance_fn_t subpel_avg_variance8x16_c = |
| 1106 | vp9_sub_pixel_avg_variance8x16_c; |
| 1107 | const vp9_subp_avg_variance_fn_t subpel_avg_variance16x8_c = |
| 1108 | vp9_sub_pixel_avg_variance16x8_c; |
| 1109 | const vp9_subp_avg_variance_fn_t subpel_avg_variance16x16_c = |
| 1110 | vp9_sub_pixel_avg_variance16x16_c; |
| 1111 | const vp9_subp_avg_variance_fn_t subpel_avg_variance16x32_c = |
| 1112 | vp9_sub_pixel_avg_variance16x32_c; |
| 1113 | const vp9_subp_avg_variance_fn_t subpel_avg_variance32x16_c = |
| 1114 | vp9_sub_pixel_avg_variance32x16_c; |
| 1115 | const vp9_subp_avg_variance_fn_t subpel_avg_variance32x32_c = |
| 1116 | vp9_sub_pixel_avg_variance32x32_c; |
| 1117 | const vp9_subp_avg_variance_fn_t subpel_avg_variance32x64_c = |
| 1118 | vp9_sub_pixel_avg_variance32x64_c; |
| 1119 | const vp9_subp_avg_variance_fn_t subpel_avg_variance64x32_c = |
| 1120 | vp9_sub_pixel_avg_variance64x32_c; |
| 1121 | const vp9_subp_avg_variance_fn_t subpel_avg_variance64x64_c = |
| 1122 | vp9_sub_pixel_avg_variance64x64_c; |
Ronald S. Bultje | 1e6a32f | 2013-06-20 15:59:48 -0700 | [diff] [blame] | 1123 | INSTANTIATE_TEST_CASE_P( |
| 1124 | C, VP9SubpelAvgVarianceTest, |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 1125 | ::testing::Values(make_tuple(2, 2, subpel_avg_variance4x4_c, 0), |
| 1126 | make_tuple(2, 3, subpel_avg_variance4x8_c, 0), |
| 1127 | make_tuple(3, 2, subpel_avg_variance8x4_c, 0), |
| 1128 | make_tuple(3, 3, subpel_avg_variance8x8_c, 0), |
| 1129 | make_tuple(3, 4, subpel_avg_variance8x16_c, 0), |
| 1130 | make_tuple(4, 3, subpel_avg_variance16x8_c, 0), |
| 1131 | make_tuple(4, 4, subpel_avg_variance16x16_c, 0), |
| 1132 | make_tuple(4, 5, subpel_avg_variance16x32_c, 0), |
| 1133 | make_tuple(5, 4, subpel_avg_variance32x16_c, 0), |
| 1134 | make_tuple(5, 5, subpel_avg_variance32x32_c, 0), |
| 1135 | make_tuple(5, 6, subpel_avg_variance32x64_c, 0), |
| 1136 | make_tuple(6, 5, subpel_avg_variance64x32_c, 0), |
| 1137 | make_tuple(6, 6, subpel_avg_variance64x64_c, 0))); |
| 1138 | #if CONFIG_VP9_HIGHBITDEPTH |
| 1139 | const vp9_subpixvariance_fn_t highbd_10_subpel_variance4x4_c = |
| 1140 | vp9_highbd_10_sub_pixel_variance4x4_c; |
| 1141 | const vp9_subpixvariance_fn_t highbd_10_subpel_variance4x8_c = |
| 1142 | vp9_highbd_10_sub_pixel_variance4x8_c; |
| 1143 | const vp9_subpixvariance_fn_t highbd_10_subpel_variance8x4_c = |
| 1144 | vp9_highbd_10_sub_pixel_variance8x4_c; |
| 1145 | const vp9_subpixvariance_fn_t highbd_10_subpel_variance8x8_c = |
| 1146 | vp9_highbd_10_sub_pixel_variance8x8_c; |
| 1147 | const vp9_subpixvariance_fn_t highbd_10_subpel_variance8x16_c = |
| 1148 | vp9_highbd_10_sub_pixel_variance8x16_c; |
| 1149 | const vp9_subpixvariance_fn_t highbd_10_subpel_variance16x8_c = |
| 1150 | vp9_highbd_10_sub_pixel_variance16x8_c; |
| 1151 | const vp9_subpixvariance_fn_t highbd_10_subpel_variance16x16_c = |
| 1152 | vp9_highbd_10_sub_pixel_variance16x16_c; |
| 1153 | const vp9_subpixvariance_fn_t highbd_10_subpel_variance16x32_c = |
| 1154 | vp9_highbd_10_sub_pixel_variance16x32_c; |
| 1155 | const vp9_subpixvariance_fn_t highbd_10_subpel_variance32x16_c = |
| 1156 | vp9_highbd_10_sub_pixel_variance32x16_c; |
| 1157 | const vp9_subpixvariance_fn_t highbd_10_subpel_variance32x32_c = |
| 1158 | vp9_highbd_10_sub_pixel_variance32x32_c; |
| 1159 | const vp9_subpixvariance_fn_t highbd_10_subpel_variance32x64_c = |
| 1160 | vp9_highbd_10_sub_pixel_variance32x64_c; |
| 1161 | const vp9_subpixvariance_fn_t highbd_10_subpel_variance64x32_c = |
| 1162 | vp9_highbd_10_sub_pixel_variance64x32_c; |
| 1163 | const vp9_subpixvariance_fn_t highbd_10_subpel_variance64x64_c = |
| 1164 | vp9_highbd_10_sub_pixel_variance64x64_c; |
| 1165 | const vp9_subpixvariance_fn_t highbd_12_subpel_variance4x4_c = |
| 1166 | vp9_highbd_12_sub_pixel_variance4x4_c; |
| 1167 | const vp9_subpixvariance_fn_t highbd_12_subpel_variance4x8_c = |
| 1168 | vp9_highbd_12_sub_pixel_variance4x8_c; |
| 1169 | const vp9_subpixvariance_fn_t highbd_12_subpel_variance8x4_c = |
| 1170 | vp9_highbd_12_sub_pixel_variance8x4_c; |
| 1171 | const vp9_subpixvariance_fn_t highbd_12_subpel_variance8x8_c = |
| 1172 | vp9_highbd_12_sub_pixel_variance8x8_c; |
| 1173 | const vp9_subpixvariance_fn_t highbd_12_subpel_variance8x16_c = |
| 1174 | vp9_highbd_12_sub_pixel_variance8x16_c; |
| 1175 | const vp9_subpixvariance_fn_t highbd_12_subpel_variance16x8_c = |
| 1176 | vp9_highbd_12_sub_pixel_variance16x8_c; |
| 1177 | const vp9_subpixvariance_fn_t highbd_12_subpel_variance16x16_c = |
| 1178 | vp9_highbd_12_sub_pixel_variance16x16_c; |
| 1179 | const vp9_subpixvariance_fn_t highbd_12_subpel_variance16x32_c = |
| 1180 | vp9_highbd_12_sub_pixel_variance16x32_c; |
| 1181 | const vp9_subpixvariance_fn_t highbd_12_subpel_variance32x16_c = |
| 1182 | vp9_highbd_12_sub_pixel_variance32x16_c; |
| 1183 | const vp9_subpixvariance_fn_t highbd_12_subpel_variance32x32_c = |
| 1184 | vp9_highbd_12_sub_pixel_variance32x32_c; |
| 1185 | const vp9_subpixvariance_fn_t highbd_12_subpel_variance32x64_c = |
| 1186 | vp9_highbd_12_sub_pixel_variance32x64_c; |
| 1187 | const vp9_subpixvariance_fn_t highbd_12_subpel_variance64x32_c = |
| 1188 | vp9_highbd_12_sub_pixel_variance64x32_c; |
| 1189 | const vp9_subpixvariance_fn_t highbd_12_subpel_variance64x64_c = |
| 1190 | vp9_highbd_12_sub_pixel_variance64x64_c; |
| 1191 | const vp9_subpixvariance_fn_t highbd_subpel_variance4x4_c = |
| 1192 | vp9_highbd_sub_pixel_variance4x4_c; |
| 1193 | const vp9_subpixvariance_fn_t highbd_subpel_variance4x8_c = |
| 1194 | vp9_highbd_sub_pixel_variance4x8_c; |
| 1195 | const vp9_subpixvariance_fn_t highbd_subpel_variance8x4_c = |
| 1196 | vp9_highbd_sub_pixel_variance8x4_c; |
| 1197 | const vp9_subpixvariance_fn_t highbd_subpel_variance8x8_c = |
| 1198 | vp9_highbd_sub_pixel_variance8x8_c; |
| 1199 | const vp9_subpixvariance_fn_t highbd_subpel_variance8x16_c = |
| 1200 | vp9_highbd_sub_pixel_variance8x16_c; |
| 1201 | const vp9_subpixvariance_fn_t highbd_subpel_variance16x8_c = |
| 1202 | vp9_highbd_sub_pixel_variance16x8_c; |
| 1203 | const vp9_subpixvariance_fn_t highbd_subpel_variance16x16_c = |
| 1204 | vp9_highbd_sub_pixel_variance16x16_c; |
| 1205 | const vp9_subpixvariance_fn_t highbd_subpel_variance16x32_c = |
| 1206 | vp9_highbd_sub_pixel_variance16x32_c; |
| 1207 | const vp9_subpixvariance_fn_t highbd_subpel_variance32x16_c = |
| 1208 | vp9_highbd_sub_pixel_variance32x16_c; |
| 1209 | const vp9_subpixvariance_fn_t highbd_subpel_variance32x32_c = |
| 1210 | vp9_highbd_sub_pixel_variance32x32_c; |
| 1211 | const vp9_subpixvariance_fn_t highbd_subpel_variance32x64_c = |
| 1212 | vp9_highbd_sub_pixel_variance32x64_c; |
| 1213 | const vp9_subpixvariance_fn_t highbd_subpel_variance64x32_c = |
| 1214 | vp9_highbd_sub_pixel_variance64x32_c; |
| 1215 | const vp9_subpixvariance_fn_t highbd_subpel_variance64x64_c = |
| 1216 | vp9_highbd_sub_pixel_variance64x64_c; |
| 1217 | INSTANTIATE_TEST_CASE_P( |
| 1218 | C, VP9SubpelVarianceHighTest, |
| 1219 | ::testing::Values(make_tuple(2, 2, highbd_10_subpel_variance4x4_c, 10), |
| 1220 | make_tuple(2, 3, highbd_10_subpel_variance4x8_c, 10), |
| 1221 | make_tuple(3, 2, highbd_10_subpel_variance8x4_c, 10), |
| 1222 | make_tuple(3, 3, highbd_10_subpel_variance8x8_c, 10), |
| 1223 | make_tuple(3, 4, highbd_10_subpel_variance8x16_c, 10), |
| 1224 | make_tuple(4, 3, highbd_10_subpel_variance16x8_c, 10), |
| 1225 | make_tuple(4, 4, highbd_10_subpel_variance16x16_c, 10), |
| 1226 | make_tuple(4, 5, highbd_10_subpel_variance16x32_c, 10), |
| 1227 | make_tuple(5, 4, highbd_10_subpel_variance32x16_c, 10), |
| 1228 | make_tuple(5, 5, highbd_10_subpel_variance32x32_c, 10), |
| 1229 | make_tuple(5, 6, highbd_10_subpel_variance32x64_c, 10), |
| 1230 | make_tuple(6, 5, highbd_10_subpel_variance64x32_c, 10), |
| 1231 | make_tuple(6, 6, highbd_10_subpel_variance64x64_c, 10), |
| 1232 | make_tuple(2, 2, highbd_12_subpel_variance4x4_c, 12), |
| 1233 | make_tuple(2, 3, highbd_12_subpel_variance4x8_c, 12), |
| 1234 | make_tuple(3, 2, highbd_12_subpel_variance8x4_c, 12), |
| 1235 | make_tuple(3, 3, highbd_12_subpel_variance8x8_c, 12), |
| 1236 | make_tuple(3, 4, highbd_12_subpel_variance8x16_c, 12), |
| 1237 | make_tuple(4, 3, highbd_12_subpel_variance16x8_c, 12), |
| 1238 | make_tuple(4, 4, highbd_12_subpel_variance16x16_c, 12), |
| 1239 | make_tuple(4, 5, highbd_12_subpel_variance16x32_c, 12), |
| 1240 | make_tuple(5, 4, highbd_12_subpel_variance32x16_c, 12), |
| 1241 | make_tuple(5, 5, highbd_12_subpel_variance32x32_c, 12), |
| 1242 | make_tuple(5, 6, highbd_12_subpel_variance32x64_c, 12), |
| 1243 | make_tuple(6, 5, highbd_12_subpel_variance64x32_c, 12), |
| 1244 | make_tuple(6, 6, highbd_12_subpel_variance64x64_c, 12), |
| 1245 | make_tuple(2, 2, highbd_subpel_variance4x4_c, 8), |
| 1246 | make_tuple(2, 3, highbd_subpel_variance4x8_c, 8), |
| 1247 | make_tuple(3, 2, highbd_subpel_variance8x4_c, 8), |
| 1248 | make_tuple(3, 3, highbd_subpel_variance8x8_c, 8), |
| 1249 | make_tuple(3, 4, highbd_subpel_variance8x16_c, 8), |
| 1250 | make_tuple(4, 3, highbd_subpel_variance16x8_c, 8), |
| 1251 | make_tuple(4, 4, highbd_subpel_variance16x16_c, 8), |
| 1252 | make_tuple(4, 5, highbd_subpel_variance16x32_c, 8), |
| 1253 | make_tuple(5, 4, highbd_subpel_variance32x16_c, 8), |
| 1254 | make_tuple(5, 5, highbd_subpel_variance32x32_c, 8), |
| 1255 | make_tuple(5, 6, highbd_subpel_variance32x64_c, 8), |
| 1256 | make_tuple(6, 5, highbd_subpel_variance64x32_c, 8), |
| 1257 | make_tuple(6, 6, highbd_subpel_variance64x64_c, 8))); |
| 1258 | const vp9_subp_avg_variance_fn_t highbd_10_subpel_avg_variance4x4_c = |
| 1259 | vp9_highbd_10_sub_pixel_avg_variance4x4_c; |
| 1260 | const vp9_subp_avg_variance_fn_t highbd_10_subpel_avg_variance4x8_c = |
| 1261 | vp9_highbd_10_sub_pixel_avg_variance4x8_c; |
| 1262 | const vp9_subp_avg_variance_fn_t highbd_10_subpel_avg_variance8x4_c = |
| 1263 | vp9_highbd_10_sub_pixel_avg_variance8x4_c; |
| 1264 | const vp9_subp_avg_variance_fn_t highbd_10_subpel_avg_variance8x8_c = |
| 1265 | vp9_highbd_10_sub_pixel_avg_variance8x8_c; |
| 1266 | const vp9_subp_avg_variance_fn_t highbd_10_subpel_avg_variance8x16_c = |
| 1267 | vp9_highbd_10_sub_pixel_avg_variance8x16_c; |
| 1268 | const vp9_subp_avg_variance_fn_t highbd_10_subpel_avg_variance16x8_c = |
| 1269 | vp9_highbd_10_sub_pixel_avg_variance16x8_c; |
| 1270 | const vp9_subp_avg_variance_fn_t highbd_10_subpel_avg_variance16x16_c = |
| 1271 | vp9_highbd_10_sub_pixel_avg_variance16x16_c; |
| 1272 | const vp9_subp_avg_variance_fn_t highbd_10_subpel_avg_variance16x32_c = |
| 1273 | vp9_highbd_10_sub_pixel_avg_variance16x32_c; |
| 1274 | const vp9_subp_avg_variance_fn_t highbd_10_subpel_avg_variance32x16_c = |
| 1275 | vp9_highbd_10_sub_pixel_avg_variance32x16_c; |
| 1276 | const vp9_subp_avg_variance_fn_t highbd_10_subpel_avg_variance32x32_c = |
| 1277 | vp9_highbd_10_sub_pixel_avg_variance32x32_c; |
| 1278 | const vp9_subp_avg_variance_fn_t highbd_10_subpel_avg_variance32x64_c = |
| 1279 | vp9_highbd_10_sub_pixel_avg_variance32x64_c; |
| 1280 | const vp9_subp_avg_variance_fn_t highbd_10_subpel_avg_variance64x32_c = |
| 1281 | vp9_highbd_10_sub_pixel_avg_variance64x32_c; |
| 1282 | const vp9_subp_avg_variance_fn_t highbd_10_subpel_avg_variance64x64_c = |
| 1283 | vp9_highbd_10_sub_pixel_avg_variance64x64_c; |
| 1284 | const vp9_subp_avg_variance_fn_t highbd_12_subpel_avg_variance4x4_c = |
| 1285 | vp9_highbd_12_sub_pixel_avg_variance4x4_c; |
| 1286 | const vp9_subp_avg_variance_fn_t highbd_12_subpel_avg_variance4x8_c = |
| 1287 | vp9_highbd_12_sub_pixel_avg_variance4x8_c; |
| 1288 | const vp9_subp_avg_variance_fn_t highbd_12_subpel_avg_variance8x4_c = |
| 1289 | vp9_highbd_12_sub_pixel_avg_variance8x4_c; |
| 1290 | const vp9_subp_avg_variance_fn_t highbd_12_subpel_avg_variance8x8_c = |
| 1291 | vp9_highbd_12_sub_pixel_avg_variance8x8_c; |
| 1292 | const vp9_subp_avg_variance_fn_t highbd_12_subpel_avg_variance8x16_c = |
| 1293 | vp9_highbd_12_sub_pixel_avg_variance8x16_c; |
| 1294 | const vp9_subp_avg_variance_fn_t highbd_12_subpel_avg_variance16x8_c = |
| 1295 | vp9_highbd_12_sub_pixel_avg_variance16x8_c; |
| 1296 | const vp9_subp_avg_variance_fn_t highbd_12_subpel_avg_variance16x16_c = |
| 1297 | vp9_highbd_12_sub_pixel_avg_variance16x16_c; |
| 1298 | const vp9_subp_avg_variance_fn_t highbd_12_subpel_avg_variance16x32_c = |
| 1299 | vp9_highbd_12_sub_pixel_avg_variance16x32_c; |
| 1300 | const vp9_subp_avg_variance_fn_t highbd_12_subpel_avg_variance32x16_c = |
| 1301 | vp9_highbd_12_sub_pixel_avg_variance32x16_c; |
| 1302 | const vp9_subp_avg_variance_fn_t highbd_12_subpel_avg_variance32x32_c = |
| 1303 | vp9_highbd_12_sub_pixel_avg_variance32x32_c; |
| 1304 | const vp9_subp_avg_variance_fn_t highbd_12_subpel_avg_variance32x64_c = |
| 1305 | vp9_highbd_12_sub_pixel_avg_variance32x64_c; |
| 1306 | const vp9_subp_avg_variance_fn_t highbd_12_subpel_avg_variance64x32_c = |
| 1307 | vp9_highbd_12_sub_pixel_avg_variance64x32_c; |
| 1308 | const vp9_subp_avg_variance_fn_t highbd_12_subpel_avg_variance64x64_c = |
| 1309 | vp9_highbd_12_sub_pixel_avg_variance64x64_c; |
| 1310 | const vp9_subp_avg_variance_fn_t highbd_subpel_avg_variance4x4_c = |
| 1311 | vp9_highbd_sub_pixel_avg_variance4x4_c; |
| 1312 | const vp9_subp_avg_variance_fn_t highbd_subpel_avg_variance4x8_c = |
| 1313 | vp9_highbd_sub_pixel_avg_variance4x8_c; |
| 1314 | const vp9_subp_avg_variance_fn_t highbd_subpel_avg_variance8x4_c = |
| 1315 | vp9_highbd_sub_pixel_avg_variance8x4_c; |
| 1316 | const vp9_subp_avg_variance_fn_t highbd_subpel_avg_variance8x8_c = |
| 1317 | vp9_highbd_sub_pixel_avg_variance8x8_c; |
| 1318 | const vp9_subp_avg_variance_fn_t highbd_subpel_avg_variance8x16_c = |
| 1319 | vp9_highbd_sub_pixel_avg_variance8x16_c; |
| 1320 | const vp9_subp_avg_variance_fn_t highbd_subpel_avg_variance16x8_c = |
| 1321 | vp9_highbd_sub_pixel_avg_variance16x8_c; |
| 1322 | const vp9_subp_avg_variance_fn_t highbd_subpel_avg_variance16x16_c = |
| 1323 | vp9_highbd_sub_pixel_avg_variance16x16_c; |
| 1324 | const vp9_subp_avg_variance_fn_t highbd_subpel_avg_variance16x32_c = |
| 1325 | vp9_highbd_sub_pixel_avg_variance16x32_c; |
| 1326 | const vp9_subp_avg_variance_fn_t highbd_subpel_avg_variance32x16_c = |
| 1327 | vp9_highbd_sub_pixel_avg_variance32x16_c; |
| 1328 | const vp9_subp_avg_variance_fn_t highbd_subpel_avg_variance32x32_c = |
| 1329 | vp9_highbd_sub_pixel_avg_variance32x32_c; |
| 1330 | const vp9_subp_avg_variance_fn_t highbd_subpel_avg_variance32x64_c = |
| 1331 | vp9_highbd_sub_pixel_avg_variance32x64_c; |
| 1332 | const vp9_subp_avg_variance_fn_t highbd_subpel_avg_variance64x32_c = |
| 1333 | vp9_highbd_sub_pixel_avg_variance64x32_c; |
| 1334 | const vp9_subp_avg_variance_fn_t highbd_subpel_avg_variance64x64_c = |
| 1335 | vp9_highbd_sub_pixel_avg_variance64x64_c; |
| 1336 | INSTANTIATE_TEST_CASE_P( |
| 1337 | C, VP9SubpelAvgVarianceHighTest, |
| 1338 | ::testing::Values( |
| 1339 | make_tuple(2, 2, highbd_10_subpel_avg_variance4x4_c, 10), |
| 1340 | make_tuple(2, 3, highbd_10_subpel_avg_variance4x8_c, 10), |
| 1341 | make_tuple(3, 2, highbd_10_subpel_avg_variance8x4_c, 10), |
| 1342 | make_tuple(3, 3, highbd_10_subpel_avg_variance8x8_c, 10), |
| 1343 | make_tuple(3, 4, highbd_10_subpel_avg_variance8x16_c, 10), |
| 1344 | make_tuple(4, 3, highbd_10_subpel_avg_variance16x8_c, 10), |
| 1345 | make_tuple(4, 4, highbd_10_subpel_avg_variance16x16_c, 10), |
| 1346 | make_tuple(4, 5, highbd_10_subpel_avg_variance16x32_c, 10), |
| 1347 | make_tuple(5, 4, highbd_10_subpel_avg_variance32x16_c, 10), |
| 1348 | make_tuple(5, 5, highbd_10_subpel_avg_variance32x32_c, 10), |
| 1349 | make_tuple(5, 6, highbd_10_subpel_avg_variance32x64_c, 10), |
| 1350 | make_tuple(6, 5, highbd_10_subpel_avg_variance64x32_c, 10), |
| 1351 | make_tuple(6, 6, highbd_10_subpel_avg_variance64x64_c, 10), |
| 1352 | make_tuple(2, 2, highbd_12_subpel_avg_variance4x4_c, 12), |
| 1353 | make_tuple(2, 3, highbd_12_subpel_avg_variance4x8_c, 12), |
| 1354 | make_tuple(3, 2, highbd_12_subpel_avg_variance8x4_c, 12), |
| 1355 | make_tuple(3, 3, highbd_12_subpel_avg_variance8x8_c, 12), |
| 1356 | make_tuple(3, 4, highbd_12_subpel_avg_variance8x16_c, 12), |
| 1357 | make_tuple(4, 3, highbd_12_subpel_avg_variance16x8_c, 12), |
| 1358 | make_tuple(4, 4, highbd_12_subpel_avg_variance16x16_c, 12), |
| 1359 | make_tuple(4, 5, highbd_12_subpel_avg_variance16x32_c, 12), |
| 1360 | make_tuple(5, 4, highbd_12_subpel_avg_variance32x16_c, 12), |
| 1361 | make_tuple(5, 5, highbd_12_subpel_avg_variance32x32_c, 12), |
| 1362 | make_tuple(5, 6, highbd_12_subpel_avg_variance32x64_c, 12), |
| 1363 | make_tuple(6, 5, highbd_12_subpel_avg_variance64x32_c, 12), |
| 1364 | make_tuple(6, 6, highbd_12_subpel_avg_variance64x64_c, 12), |
| 1365 | make_tuple(2, 2, highbd_subpel_avg_variance4x4_c, 8), |
| 1366 | make_tuple(2, 3, highbd_subpel_avg_variance4x8_c, 8), |
| 1367 | make_tuple(3, 2, highbd_subpel_avg_variance8x4_c, 8), |
| 1368 | make_tuple(3, 3, highbd_subpel_avg_variance8x8_c, 8), |
| 1369 | make_tuple(3, 4, highbd_subpel_avg_variance8x16_c, 8), |
| 1370 | make_tuple(4, 3, highbd_subpel_avg_variance16x8_c, 8), |
| 1371 | make_tuple(4, 4, highbd_subpel_avg_variance16x16_c, 8), |
| 1372 | make_tuple(4, 5, highbd_subpel_avg_variance16x32_c, 8), |
| 1373 | make_tuple(5, 4, highbd_subpel_avg_variance32x16_c, 8), |
| 1374 | make_tuple(5, 5, highbd_subpel_avg_variance32x32_c, 8), |
| 1375 | make_tuple(5, 6, highbd_subpel_avg_variance32x64_c, 8), |
| 1376 | make_tuple(6, 5, highbd_subpel_avg_variance64x32_c, 8), |
| 1377 | make_tuple(6, 6, highbd_subpel_avg_variance64x64_c, 8))); |
| 1378 | #endif // CONFIG_VP9_HIGHBITDEPTH |
Ronald S. Bultje | 1e6a32f | 2013-06-20 15:59:48 -0700 | [diff] [blame] | 1379 | |
James Zern | 9847344 | 2012-11-06 16:58:11 -0800 | [diff] [blame] | 1380 | #if HAVE_SSE2 |
Jim Bankoski | 5b30788 | 2013-08-06 08:25:10 -0700 | [diff] [blame] | 1381 | #if CONFIG_USE_X86INC |
Dmitry Kovalev | 1f19ebb | 2014-09-06 00:10:25 -0700 | [diff] [blame] | 1382 | INSTANTIATE_TEST_CASE_P(SSE2, SumOfSquaresTest, |
| 1383 | ::testing::Values(vp9_get_mb_ss_sse2)); |
| 1384 | |
James Zern | 6e5e75f | 2014-05-08 14:32:32 -0700 | [diff] [blame] | 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; |
James Zern | 9847344 | 2012-11-06 16:58:11 -0800 | [diff] [blame] | 1398 | INSTANTIATE_TEST_CASE_P( |
| 1399 | SSE2, VP9VarianceTest, |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 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))); |
James Zern | 6e5e75f | 2014-05-08 14:32:32 -0700 | [diff] [blame] | 1413 | const vp9_subpixvariance_fn_t subpel_variance4x4_sse = |
| 1414 | vp9_sub_pixel_variance4x4_sse; |
| 1415 | const vp9_subpixvariance_fn_t subpel_variance4x8_sse = |
| 1416 | vp9_sub_pixel_variance4x8_sse; |
| 1417 | const vp9_subpixvariance_fn_t subpel_variance8x4_sse2 = |
| 1418 | vp9_sub_pixel_variance8x4_sse2; |
| 1419 | const vp9_subpixvariance_fn_t subpel_variance8x8_sse2 = |
| 1420 | vp9_sub_pixel_variance8x8_sse2; |
| 1421 | const vp9_subpixvariance_fn_t subpel_variance8x16_sse2 = |
| 1422 | vp9_sub_pixel_variance8x16_sse2; |
| 1423 | const vp9_subpixvariance_fn_t subpel_variance16x8_sse2 = |
| 1424 | vp9_sub_pixel_variance16x8_sse2; |
| 1425 | const vp9_subpixvariance_fn_t subpel_variance16x16_sse2 = |
| 1426 | vp9_sub_pixel_variance16x16_sse2; |
| 1427 | const vp9_subpixvariance_fn_t subpel_variance16x32_sse2 = |
| 1428 | vp9_sub_pixel_variance16x32_sse2; |
| 1429 | const vp9_subpixvariance_fn_t subpel_variance32x16_sse2 = |
| 1430 | vp9_sub_pixel_variance32x16_sse2; |
| 1431 | const vp9_subpixvariance_fn_t subpel_variance32x32_sse2 = |
| 1432 | vp9_sub_pixel_variance32x32_sse2; |
| 1433 | const vp9_subpixvariance_fn_t subpel_variance32x64_sse2 = |
| 1434 | vp9_sub_pixel_variance32x64_sse2; |
| 1435 | const vp9_subpixvariance_fn_t subpel_variance64x32_sse2 = |
| 1436 | vp9_sub_pixel_variance64x32_sse2; |
| 1437 | const vp9_subpixvariance_fn_t subpel_variance64x64_sse2 = |
| 1438 | vp9_sub_pixel_variance64x64_sse2; |
Ronald S. Bultje | 8fb6c58 | 2013-06-20 09:34:25 -0700 | [diff] [blame] | 1439 | INSTANTIATE_TEST_CASE_P( |
| 1440 | SSE2, VP9SubpelVarianceTest, |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 1441 | ::testing::Values(make_tuple(2, 2, subpel_variance4x4_sse, 0), |
| 1442 | make_tuple(2, 3, subpel_variance4x8_sse, 0), |
| 1443 | make_tuple(3, 2, subpel_variance8x4_sse2, 0), |
| 1444 | make_tuple(3, 3, subpel_variance8x8_sse2, 0), |
| 1445 | make_tuple(3, 4, subpel_variance8x16_sse2, 0), |
| 1446 | make_tuple(4, 3, subpel_variance16x8_sse2, 0), |
| 1447 | make_tuple(4, 4, subpel_variance16x16_sse2, 0), |
| 1448 | make_tuple(4, 5, subpel_variance16x32_sse2, 0), |
| 1449 | make_tuple(5, 4, subpel_variance32x16_sse2, 0), |
| 1450 | make_tuple(5, 5, subpel_variance32x32_sse2, 0), |
| 1451 | make_tuple(5, 6, subpel_variance32x64_sse2, 0), |
| 1452 | make_tuple(6, 5, subpel_variance64x32_sse2, 0), |
| 1453 | make_tuple(6, 6, subpel_variance64x64_sse2, 0))); |
James Zern | 6e5e75f | 2014-05-08 14:32:32 -0700 | [diff] [blame] | 1454 | const vp9_subp_avg_variance_fn_t subpel_avg_variance4x4_sse = |
| 1455 | vp9_sub_pixel_avg_variance4x4_sse; |
| 1456 | const vp9_subp_avg_variance_fn_t subpel_avg_variance4x8_sse = |
| 1457 | vp9_sub_pixel_avg_variance4x8_sse; |
| 1458 | const vp9_subp_avg_variance_fn_t subpel_avg_variance8x4_sse2 = |
| 1459 | vp9_sub_pixel_avg_variance8x4_sse2; |
| 1460 | const vp9_subp_avg_variance_fn_t subpel_avg_variance8x8_sse2 = |
| 1461 | vp9_sub_pixel_avg_variance8x8_sse2; |
| 1462 | const vp9_subp_avg_variance_fn_t subpel_avg_variance8x16_sse2 = |
| 1463 | vp9_sub_pixel_avg_variance8x16_sse2; |
| 1464 | const vp9_subp_avg_variance_fn_t subpel_avg_variance16x8_sse2 = |
| 1465 | vp9_sub_pixel_avg_variance16x8_sse2; |
| 1466 | const vp9_subp_avg_variance_fn_t subpel_avg_variance16x16_sse2 = |
| 1467 | vp9_sub_pixel_avg_variance16x16_sse2; |
| 1468 | const vp9_subp_avg_variance_fn_t subpel_avg_variance16x32_sse2 = |
| 1469 | vp9_sub_pixel_avg_variance16x32_sse2; |
| 1470 | const vp9_subp_avg_variance_fn_t subpel_avg_variance32x16_sse2 = |
| 1471 | vp9_sub_pixel_avg_variance32x16_sse2; |
| 1472 | const vp9_subp_avg_variance_fn_t subpel_avg_variance32x32_sse2 = |
| 1473 | vp9_sub_pixel_avg_variance32x32_sse2; |
| 1474 | const vp9_subp_avg_variance_fn_t subpel_avg_variance32x64_sse2 = |
| 1475 | vp9_sub_pixel_avg_variance32x64_sse2; |
| 1476 | const vp9_subp_avg_variance_fn_t subpel_avg_variance64x32_sse2 = |
| 1477 | vp9_sub_pixel_avg_variance64x32_sse2; |
| 1478 | const vp9_subp_avg_variance_fn_t subpel_avg_variance64x64_sse2 = |
| 1479 | vp9_sub_pixel_avg_variance64x64_sse2; |
Ronald S. Bultje | 1e6a32f | 2013-06-20 15:59:48 -0700 | [diff] [blame] | 1480 | INSTANTIATE_TEST_CASE_P( |
| 1481 | SSE2, VP9SubpelAvgVarianceTest, |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 1482 | ::testing::Values(make_tuple(2, 2, subpel_avg_variance4x4_sse, 0), |
| 1483 | make_tuple(2, 3, subpel_avg_variance4x8_sse, 0), |
| 1484 | make_tuple(3, 2, subpel_avg_variance8x4_sse2, 0), |
| 1485 | make_tuple(3, 3, subpel_avg_variance8x8_sse2, 0), |
| 1486 | make_tuple(3, 4, subpel_avg_variance8x16_sse2, 0), |
| 1487 | make_tuple(4, 3, subpel_avg_variance16x8_sse2, 0), |
| 1488 | make_tuple(4, 4, subpel_avg_variance16x16_sse2, 0), |
| 1489 | make_tuple(4, 5, subpel_avg_variance16x32_sse2, 0), |
| 1490 | make_tuple(5, 4, subpel_avg_variance32x16_sse2, 0), |
| 1491 | make_tuple(5, 5, subpel_avg_variance32x32_sse2, 0), |
| 1492 | make_tuple(5, 6, subpel_avg_variance32x64_sse2, 0), |
| 1493 | make_tuple(6, 5, subpel_avg_variance64x32_sse2, 0), |
| 1494 | make_tuple(6, 6, subpel_avg_variance64x64_sse2, 0))); |
| 1495 | #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 = |
| 1587 | vp9_highbd_sub_pixel_variance8x4_sse2; |
| 1588 | const vp9_subpixvariance_fn_t highbd_subpel_variance8x8_sse2 = |
| 1589 | vp9_highbd_sub_pixel_variance8x8_sse2; |
| 1590 | const vp9_subpixvariance_fn_t highbd_subpel_variance8x16_sse2 = |
| 1591 | vp9_highbd_sub_pixel_variance8x16_sse2; |
| 1592 | const vp9_subpixvariance_fn_t highbd_subpel_variance16x8_sse2 = |
| 1593 | vp9_highbd_sub_pixel_variance16x8_sse2; |
| 1594 | const vp9_subpixvariance_fn_t highbd_subpel_variance16x16_sse2 = |
| 1595 | vp9_highbd_sub_pixel_variance16x16_sse2; |
| 1596 | const vp9_subpixvariance_fn_t highbd_subpel_variance16x32_sse2 = |
| 1597 | vp9_highbd_sub_pixel_variance16x32_sse2; |
| 1598 | const vp9_subpixvariance_fn_t highbd_subpel_variance32x16_sse2 = |
| 1599 | vp9_highbd_sub_pixel_variance32x16_sse2; |
| 1600 | const vp9_subpixvariance_fn_t highbd_subpel_variance32x32_sse2 = |
| 1601 | vp9_highbd_sub_pixel_variance32x32_sse2; |
| 1602 | const vp9_subpixvariance_fn_t highbd_subpel_variance32x64_sse2 = |
| 1603 | vp9_highbd_sub_pixel_variance32x64_sse2; |
| 1604 | const vp9_subpixvariance_fn_t highbd_subpel_variance64x32_sse2 = |
| 1605 | vp9_highbd_sub_pixel_variance64x32_sse2; |
| 1606 | const vp9_subpixvariance_fn_t highbd_subpel_variance64x64_sse2 = |
| 1607 | vp9_highbd_sub_pixel_variance64x64_sse2; |
| 1608 | const vp9_subpixvariance_fn_t highbd_10_subpel_variance8x4_sse2 = |
| 1609 | vp9_highbd_10_sub_pixel_variance8x4_sse2; |
| 1610 | const vp9_subpixvariance_fn_t highbd_10_subpel_variance8x8_sse2 = |
| 1611 | vp9_highbd_10_sub_pixel_variance8x8_sse2; |
| 1612 | const vp9_subpixvariance_fn_t highbd_10_subpel_variance8x16_sse2 = |
| 1613 | vp9_highbd_10_sub_pixel_variance8x16_sse2; |
| 1614 | const vp9_subpixvariance_fn_t highbd_10_subpel_variance16x8_sse2 = |
| 1615 | vp9_highbd_10_sub_pixel_variance16x8_sse2; |
| 1616 | const vp9_subpixvariance_fn_t highbd_10_subpel_variance16x16_sse2 = |
| 1617 | vp9_highbd_10_sub_pixel_variance16x16_sse2; |
| 1618 | const vp9_subpixvariance_fn_t highbd_10_subpel_variance16x32_sse2 = |
| 1619 | vp9_highbd_10_sub_pixel_variance16x32_sse2; |
| 1620 | const vp9_subpixvariance_fn_t highbd_10_subpel_variance32x16_sse2 = |
| 1621 | vp9_highbd_10_sub_pixel_variance32x16_sse2; |
| 1622 | const vp9_subpixvariance_fn_t highbd_10_subpel_variance32x32_sse2 = |
| 1623 | vp9_highbd_10_sub_pixel_variance32x32_sse2; |
| 1624 | const vp9_subpixvariance_fn_t highbd_10_subpel_variance32x64_sse2 = |
| 1625 | vp9_highbd_10_sub_pixel_variance32x64_sse2; |
| 1626 | const vp9_subpixvariance_fn_t highbd_10_subpel_variance64x32_sse2 = |
| 1627 | vp9_highbd_10_sub_pixel_variance64x32_sse2; |
| 1628 | const vp9_subpixvariance_fn_t highbd_10_subpel_variance64x64_sse2 = |
| 1629 | vp9_highbd_10_sub_pixel_variance64x64_sse2; |
| 1630 | const vp9_subpixvariance_fn_t highbd_12_subpel_variance8x4_sse2 = |
| 1631 | vp9_highbd_12_sub_pixel_variance8x4_sse2; |
| 1632 | const vp9_subpixvariance_fn_t highbd_12_subpel_variance8x8_sse2 = |
| 1633 | vp9_highbd_12_sub_pixel_variance8x8_sse2; |
| 1634 | const vp9_subpixvariance_fn_t highbd_12_subpel_variance8x16_sse2 = |
| 1635 | vp9_highbd_12_sub_pixel_variance8x16_sse2; |
| 1636 | const vp9_subpixvariance_fn_t highbd_12_subpel_variance16x8_sse2 = |
| 1637 | vp9_highbd_12_sub_pixel_variance16x8_sse2; |
| 1638 | const vp9_subpixvariance_fn_t highbd_12_subpel_variance16x16_sse2 = |
| 1639 | vp9_highbd_12_sub_pixel_variance16x16_sse2; |
| 1640 | const vp9_subpixvariance_fn_t highbd_12_subpel_variance16x32_sse2 = |
| 1641 | vp9_highbd_12_sub_pixel_variance16x32_sse2; |
| 1642 | const vp9_subpixvariance_fn_t highbd_12_subpel_variance32x16_sse2 = |
| 1643 | vp9_highbd_12_sub_pixel_variance32x16_sse2; |
| 1644 | const vp9_subpixvariance_fn_t highbd_12_subpel_variance32x32_sse2 = |
| 1645 | vp9_highbd_12_sub_pixel_variance32x32_sse2; |
| 1646 | const vp9_subpixvariance_fn_t highbd_12_subpel_variance32x64_sse2 = |
| 1647 | vp9_highbd_12_sub_pixel_variance32x64_sse2; |
| 1648 | const vp9_subpixvariance_fn_t highbd_12_subpel_variance64x32_sse2 = |
| 1649 | vp9_highbd_12_sub_pixel_variance64x32_sse2; |
| 1650 | const vp9_subpixvariance_fn_t highbd_12_subpel_variance64x64_sse2 = |
| 1651 | vp9_highbd_12_sub_pixel_variance64x64_sse2; |
| 1652 | INSTANTIATE_TEST_CASE_P( |
| 1653 | SSE2, VP9SubpelVarianceHighTest, |
| 1654 | ::testing::Values(make_tuple(3, 2, highbd_10_subpel_variance8x4_sse2, 10), |
| 1655 | make_tuple(3, 3, highbd_10_subpel_variance8x8_sse2, 10), |
| 1656 | make_tuple(3, 4, highbd_10_subpel_variance8x16_sse2, 10), |
| 1657 | make_tuple(4, 3, highbd_10_subpel_variance16x8_sse2, 10), |
| 1658 | make_tuple(4, 4, highbd_10_subpel_variance16x16_sse2, 10), |
| 1659 | make_tuple(4, 5, highbd_10_subpel_variance16x32_sse2, 10), |
| 1660 | make_tuple(5, 4, highbd_10_subpel_variance32x16_sse2, 10), |
| 1661 | make_tuple(5, 5, highbd_10_subpel_variance32x32_sse2, 10), |
| 1662 | make_tuple(5, 6, highbd_10_subpel_variance32x64_sse2, 10), |
| 1663 | make_tuple(6, 5, highbd_10_subpel_variance64x32_sse2, 10), |
| 1664 | make_tuple(6, 6, highbd_10_subpel_variance64x64_sse2, 10), |
| 1665 | make_tuple(3, 2, highbd_12_subpel_variance8x4_sse2, 12), |
| 1666 | make_tuple(3, 3, highbd_12_subpel_variance8x8_sse2, 12), |
| 1667 | make_tuple(3, 4, highbd_12_subpel_variance8x16_sse2, 12), |
| 1668 | make_tuple(4, 3, highbd_12_subpel_variance16x8_sse2, 12), |
| 1669 | make_tuple(4, 4, highbd_12_subpel_variance16x16_sse2, 12), |
| 1670 | make_tuple(4, 5, highbd_12_subpel_variance16x32_sse2, 12), |
| 1671 | make_tuple(5, 4, highbd_12_subpel_variance32x16_sse2, 12), |
| 1672 | make_tuple(5, 5, highbd_12_subpel_variance32x32_sse2, 12), |
| 1673 | make_tuple(5, 6, highbd_12_subpel_variance32x64_sse2, 12), |
| 1674 | make_tuple(6, 5, highbd_12_subpel_variance64x32_sse2, 12), |
| 1675 | make_tuple(6, 6, highbd_12_subpel_variance64x64_sse2, 12), |
| 1676 | make_tuple(3, 2, highbd_subpel_variance8x4_sse2, 8), |
| 1677 | make_tuple(3, 3, highbd_subpel_variance8x8_sse2, 8), |
| 1678 | make_tuple(3, 4, highbd_subpel_variance8x16_sse2, 8), |
| 1679 | make_tuple(4, 3, highbd_subpel_variance16x8_sse2, 8), |
| 1680 | make_tuple(4, 4, highbd_subpel_variance16x16_sse2, 8), |
| 1681 | make_tuple(4, 5, highbd_subpel_variance16x32_sse2, 8), |
| 1682 | make_tuple(5, 4, highbd_subpel_variance32x16_sse2, 8), |
| 1683 | make_tuple(5, 5, highbd_subpel_variance32x32_sse2, 8), |
| 1684 | make_tuple(5, 6, highbd_subpel_variance32x64_sse2, 8), |
| 1685 | make_tuple(6, 5, highbd_subpel_variance64x32_sse2, 8), |
| 1686 | make_tuple(6, 6, highbd_subpel_variance64x64_sse2, 8))); |
| 1687 | const vp9_subp_avg_variance_fn_t highbd_subpel_avg_variance8x4_sse2 = |
| 1688 | vp9_highbd_sub_pixel_avg_variance8x4_sse2; |
| 1689 | const vp9_subp_avg_variance_fn_t highbd_subpel_avg_variance8x8_sse2 = |
| 1690 | vp9_highbd_sub_pixel_avg_variance8x8_sse2; |
| 1691 | const vp9_subp_avg_variance_fn_t highbd_subpel_avg_variance8x16_sse2 = |
| 1692 | vp9_highbd_sub_pixel_avg_variance8x16_sse2; |
| 1693 | const vp9_subp_avg_variance_fn_t highbd_subpel_avg_variance16x8_sse2 = |
| 1694 | vp9_highbd_sub_pixel_avg_variance16x8_sse2; |
| 1695 | const vp9_subp_avg_variance_fn_t highbd_subpel_avg_variance16x16_sse2 = |
| 1696 | vp9_highbd_sub_pixel_avg_variance16x16_sse2; |
| 1697 | const vp9_subp_avg_variance_fn_t highbd_subpel_avg_variance16x32_sse2 = |
| 1698 | vp9_highbd_sub_pixel_avg_variance16x32_sse2; |
| 1699 | const vp9_subp_avg_variance_fn_t highbd_subpel_avg_variance32x16_sse2 = |
| 1700 | vp9_highbd_sub_pixel_avg_variance32x16_sse2; |
| 1701 | const vp9_subp_avg_variance_fn_t highbd_subpel_avg_variance32x32_sse2 = |
| 1702 | vp9_highbd_sub_pixel_avg_variance32x32_sse2; |
| 1703 | const vp9_subp_avg_variance_fn_t highbd_subpel_avg_variance32x64_sse2 = |
| 1704 | vp9_highbd_sub_pixel_avg_variance32x64_sse2; |
| 1705 | const vp9_subp_avg_variance_fn_t highbd_subpel_avg_variance64x32_sse2 = |
| 1706 | vp9_highbd_sub_pixel_avg_variance64x32_sse2; |
| 1707 | const vp9_subp_avg_variance_fn_t highbd_subpel_avg_variance64x64_sse2 = |
| 1708 | vp9_highbd_sub_pixel_avg_variance64x64_sse2; |
| 1709 | const vp9_subp_avg_variance_fn_t highbd_10_subpel_avg_variance8x4_sse2 = |
| 1710 | vp9_highbd_10_sub_pixel_avg_variance8x4_sse2; |
| 1711 | const vp9_subp_avg_variance_fn_t highbd_10_subpel_avg_variance8x8_sse2 = |
| 1712 | vp9_highbd_10_sub_pixel_avg_variance8x8_sse2; |
| 1713 | const vp9_subp_avg_variance_fn_t highbd_10_subpel_avg_variance8x16_sse2 = |
| 1714 | vp9_highbd_10_sub_pixel_avg_variance8x16_sse2; |
| 1715 | const vp9_subp_avg_variance_fn_t highbd_10_subpel_avg_variance16x8_sse2 = |
| 1716 | vp9_highbd_10_sub_pixel_avg_variance16x8_sse2; |
| 1717 | const vp9_subp_avg_variance_fn_t highbd_10_subpel_avg_variance16x16_sse2 = |
| 1718 | vp9_highbd_10_sub_pixel_avg_variance16x16_sse2; |
| 1719 | const vp9_subp_avg_variance_fn_t highbd_10_subpel_avg_variance16x32_sse2 = |
| 1720 | vp9_highbd_10_sub_pixel_avg_variance16x32_sse2; |
| 1721 | const vp9_subp_avg_variance_fn_t highbd_10_subpel_avg_variance32x16_sse2 = |
| 1722 | vp9_highbd_10_sub_pixel_avg_variance32x16_sse2; |
| 1723 | const vp9_subp_avg_variance_fn_t highbd_10_subpel_avg_variance32x32_sse2 = |
| 1724 | vp9_highbd_10_sub_pixel_avg_variance32x32_sse2; |
| 1725 | const vp9_subp_avg_variance_fn_t highbd_10_subpel_avg_variance32x64_sse2 = |
| 1726 | vp9_highbd_10_sub_pixel_avg_variance32x64_sse2; |
| 1727 | const vp9_subp_avg_variance_fn_t highbd_10_subpel_avg_variance64x32_sse2 = |
| 1728 | vp9_highbd_10_sub_pixel_avg_variance64x32_sse2; |
| 1729 | const vp9_subp_avg_variance_fn_t highbd_10_subpel_avg_variance64x64_sse2 = |
| 1730 | vp9_highbd_10_sub_pixel_avg_variance64x64_sse2; |
| 1731 | const vp9_subp_avg_variance_fn_t highbd_12_subpel_avg_variance8x4_sse2 = |
| 1732 | vp9_highbd_12_sub_pixel_avg_variance8x4_sse2; |
| 1733 | const vp9_subp_avg_variance_fn_t highbd_12_subpel_avg_variance8x8_sse2 = |
| 1734 | vp9_highbd_12_sub_pixel_avg_variance8x8_sse2; |
| 1735 | const vp9_subp_avg_variance_fn_t highbd_12_subpel_avg_variance8x16_sse2 = |
| 1736 | vp9_highbd_12_sub_pixel_avg_variance8x16_sse2; |
| 1737 | const vp9_subp_avg_variance_fn_t highbd_12_subpel_avg_variance16x8_sse2 = |
| 1738 | vp9_highbd_12_sub_pixel_avg_variance16x8_sse2; |
| 1739 | const vp9_subp_avg_variance_fn_t highbd_12_subpel_avg_variance16x16_sse2 = |
| 1740 | vp9_highbd_12_sub_pixel_avg_variance16x16_sse2; |
| 1741 | const vp9_subp_avg_variance_fn_t highbd_12_subpel_avg_variance16x32_sse2 = |
| 1742 | vp9_highbd_12_sub_pixel_avg_variance16x32_sse2; |
| 1743 | const vp9_subp_avg_variance_fn_t highbd_12_subpel_avg_variance32x16_sse2 = |
| 1744 | vp9_highbd_12_sub_pixel_avg_variance32x16_sse2; |
| 1745 | const vp9_subp_avg_variance_fn_t highbd_12_subpel_avg_variance32x32_sse2 = |
| 1746 | vp9_highbd_12_sub_pixel_avg_variance32x32_sse2; |
| 1747 | const vp9_subp_avg_variance_fn_t highbd_12_subpel_avg_variance32x64_sse2 = |
| 1748 | vp9_highbd_12_sub_pixel_avg_variance32x64_sse2; |
| 1749 | const vp9_subp_avg_variance_fn_t highbd_12_subpel_avg_variance64x32_sse2 = |
| 1750 | vp9_highbd_12_sub_pixel_avg_variance64x32_sse2; |
| 1751 | const vp9_subp_avg_variance_fn_t highbd_12_subpel_avg_variance64x64_sse2 = |
| 1752 | vp9_highbd_12_sub_pixel_avg_variance64x64_sse2; |
| 1753 | INSTANTIATE_TEST_CASE_P( |
| 1754 | SSE2, VP9SubpelAvgVarianceHighTest, |
| 1755 | ::testing::Values( |
| 1756 | make_tuple(3, 2, highbd_10_subpel_avg_variance8x4_sse2, 10), |
| 1757 | make_tuple(3, 3, highbd_10_subpel_avg_variance8x8_sse2, 10), |
| 1758 | make_tuple(3, 4, highbd_10_subpel_avg_variance8x16_sse2, 10), |
| 1759 | make_tuple(4, 3, highbd_10_subpel_avg_variance16x8_sse2, 10), |
| 1760 | make_tuple(4, 4, highbd_10_subpel_avg_variance16x16_sse2, 10), |
| 1761 | make_tuple(4, 5, highbd_10_subpel_avg_variance16x32_sse2, 10), |
| 1762 | make_tuple(5, 4, highbd_10_subpel_avg_variance32x16_sse2, 10), |
| 1763 | make_tuple(5, 5, highbd_10_subpel_avg_variance32x32_sse2, 10), |
| 1764 | make_tuple(5, 6, highbd_10_subpel_avg_variance32x64_sse2, 10), |
| 1765 | make_tuple(6, 5, highbd_10_subpel_avg_variance64x32_sse2, 10), |
| 1766 | make_tuple(6, 6, highbd_10_subpel_avg_variance64x64_sse2, 10), |
| 1767 | make_tuple(3, 2, highbd_12_subpel_avg_variance8x4_sse2, 12), |
| 1768 | make_tuple(3, 3, highbd_12_subpel_avg_variance8x8_sse2, 12), |
| 1769 | make_tuple(3, 4, highbd_12_subpel_avg_variance8x16_sse2, 12), |
| 1770 | make_tuple(4, 3, highbd_12_subpel_avg_variance16x8_sse2, 12), |
| 1771 | make_tuple(4, 4, highbd_12_subpel_avg_variance16x16_sse2, 12), |
| 1772 | make_tuple(4, 5, highbd_12_subpel_avg_variance16x32_sse2, 12), |
| 1773 | make_tuple(5, 4, highbd_12_subpel_avg_variance32x16_sse2, 12), |
| 1774 | make_tuple(5, 5, highbd_12_subpel_avg_variance32x32_sse2, 12), |
| 1775 | make_tuple(5, 6, highbd_12_subpel_avg_variance32x64_sse2, 12), |
| 1776 | make_tuple(6, 5, highbd_12_subpel_avg_variance64x32_sse2, 12), |
| 1777 | make_tuple(6, 6, highbd_12_subpel_avg_variance64x64_sse2, 12), |
| 1778 | make_tuple(3, 2, highbd_subpel_avg_variance8x4_sse2, 8), |
| 1779 | make_tuple(3, 3, highbd_subpel_avg_variance8x8_sse2, 8), |
| 1780 | make_tuple(3, 4, highbd_subpel_avg_variance8x16_sse2, 8), |
| 1781 | make_tuple(4, 3, highbd_subpel_avg_variance16x8_sse2, 8), |
| 1782 | make_tuple(4, 4, highbd_subpel_avg_variance16x16_sse2, 8), |
| 1783 | make_tuple(4, 5, highbd_subpel_avg_variance16x32_sse2, 8), |
| 1784 | make_tuple(5, 4, highbd_subpel_avg_variance32x16_sse2, 8), |
| 1785 | make_tuple(5, 5, highbd_subpel_avg_variance32x32_sse2, 8), |
| 1786 | make_tuple(5, 6, highbd_subpel_avg_variance32x64_sse2, 8), |
| 1787 | make_tuple(6, 5, highbd_subpel_avg_variance64x32_sse2, 8), |
| 1788 | make_tuple(6, 6, highbd_subpel_avg_variance64x64_sse2, 8))); |
| 1789 | #endif // CONFIG_VP9_HIGHBITDEPTH |
| 1790 | #endif // CONFIG_USE_X86INC |
| 1791 | #endif // HAVE_SSE2 |
Ronald S. Bultje | 8fb6c58 | 2013-06-20 09:34:25 -0700 | [diff] [blame] | 1792 | #if HAVE_SSSE3 |
Jim Bankoski | 5b30788 | 2013-08-06 08:25:10 -0700 | [diff] [blame] | 1793 | #if CONFIG_USE_X86INC |
| 1794 | |
James Zern | 6e5e75f | 2014-05-08 14:32:32 -0700 | [diff] [blame] | 1795 | const vp9_subpixvariance_fn_t subpel_variance4x4_ssse3 = |
| 1796 | vp9_sub_pixel_variance4x4_ssse3; |
| 1797 | const vp9_subpixvariance_fn_t subpel_variance4x8_ssse3 = |
| 1798 | vp9_sub_pixel_variance4x8_ssse3; |
| 1799 | const vp9_subpixvariance_fn_t subpel_variance8x4_ssse3 = |
| 1800 | vp9_sub_pixel_variance8x4_ssse3; |
| 1801 | const vp9_subpixvariance_fn_t subpel_variance8x8_ssse3 = |
| 1802 | vp9_sub_pixel_variance8x8_ssse3; |
| 1803 | const vp9_subpixvariance_fn_t subpel_variance8x16_ssse3 = |
| 1804 | vp9_sub_pixel_variance8x16_ssse3; |
| 1805 | const vp9_subpixvariance_fn_t subpel_variance16x8_ssse3 = |
| 1806 | vp9_sub_pixel_variance16x8_ssse3; |
| 1807 | const vp9_subpixvariance_fn_t subpel_variance16x16_ssse3 = |
| 1808 | vp9_sub_pixel_variance16x16_ssse3; |
| 1809 | const vp9_subpixvariance_fn_t subpel_variance16x32_ssse3 = |
| 1810 | vp9_sub_pixel_variance16x32_ssse3; |
| 1811 | const vp9_subpixvariance_fn_t subpel_variance32x16_ssse3 = |
| 1812 | vp9_sub_pixel_variance32x16_ssse3; |
| 1813 | const vp9_subpixvariance_fn_t subpel_variance32x32_ssse3 = |
| 1814 | vp9_sub_pixel_variance32x32_ssse3; |
| 1815 | const vp9_subpixvariance_fn_t subpel_variance32x64_ssse3 = |
| 1816 | vp9_sub_pixel_variance32x64_ssse3; |
| 1817 | const vp9_subpixvariance_fn_t subpel_variance64x32_ssse3 = |
| 1818 | vp9_sub_pixel_variance64x32_ssse3; |
| 1819 | const vp9_subpixvariance_fn_t subpel_variance64x64_ssse3 = |
| 1820 | vp9_sub_pixel_variance64x64_ssse3; |
Ronald S. Bultje | 8fb6c58 | 2013-06-20 09:34:25 -0700 | [diff] [blame] | 1821 | INSTANTIATE_TEST_CASE_P( |
| 1822 | SSSE3, VP9SubpelVarianceTest, |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 1823 | ::testing::Values(make_tuple(2, 2, subpel_variance4x4_ssse3, 0), |
| 1824 | make_tuple(2, 3, subpel_variance4x8_ssse3, 0), |
| 1825 | make_tuple(3, 2, subpel_variance8x4_ssse3, 0), |
| 1826 | make_tuple(3, 3, subpel_variance8x8_ssse3, 0), |
| 1827 | make_tuple(3, 4, subpel_variance8x16_ssse3, 0), |
| 1828 | make_tuple(4, 3, subpel_variance16x8_ssse3, 0), |
| 1829 | make_tuple(4, 4, subpel_variance16x16_ssse3, 0), |
| 1830 | make_tuple(4, 5, subpel_variance16x32_ssse3, 0), |
| 1831 | make_tuple(5, 4, subpel_variance32x16_ssse3, 0), |
| 1832 | make_tuple(5, 5, subpel_variance32x32_ssse3, 0), |
| 1833 | make_tuple(5, 6, subpel_variance32x64_ssse3, 0), |
| 1834 | make_tuple(6, 5, subpel_variance64x32_ssse3, 0), |
| 1835 | make_tuple(6, 6, subpel_variance64x64_ssse3, 0))); |
James Zern | 6e5e75f | 2014-05-08 14:32:32 -0700 | [diff] [blame] | 1836 | const vp9_subp_avg_variance_fn_t subpel_avg_variance4x4_ssse3 = |
| 1837 | vp9_sub_pixel_avg_variance4x4_ssse3; |
| 1838 | const vp9_subp_avg_variance_fn_t subpel_avg_variance4x8_ssse3 = |
| 1839 | vp9_sub_pixel_avg_variance4x8_ssse3; |
| 1840 | const vp9_subp_avg_variance_fn_t subpel_avg_variance8x4_ssse3 = |
| 1841 | vp9_sub_pixel_avg_variance8x4_ssse3; |
| 1842 | const vp9_subp_avg_variance_fn_t subpel_avg_variance8x8_ssse3 = |
| 1843 | vp9_sub_pixel_avg_variance8x8_ssse3; |
| 1844 | const vp9_subp_avg_variance_fn_t subpel_avg_variance8x16_ssse3 = |
| 1845 | vp9_sub_pixel_avg_variance8x16_ssse3; |
| 1846 | const vp9_subp_avg_variance_fn_t subpel_avg_variance16x8_ssse3 = |
| 1847 | vp9_sub_pixel_avg_variance16x8_ssse3; |
| 1848 | const vp9_subp_avg_variance_fn_t subpel_avg_variance16x16_ssse3 = |
| 1849 | vp9_sub_pixel_avg_variance16x16_ssse3; |
| 1850 | const vp9_subp_avg_variance_fn_t subpel_avg_variance16x32_ssse3 = |
| 1851 | vp9_sub_pixel_avg_variance16x32_ssse3; |
| 1852 | const vp9_subp_avg_variance_fn_t subpel_avg_variance32x16_ssse3 = |
| 1853 | vp9_sub_pixel_avg_variance32x16_ssse3; |
| 1854 | const vp9_subp_avg_variance_fn_t subpel_avg_variance32x32_ssse3 = |
| 1855 | vp9_sub_pixel_avg_variance32x32_ssse3; |
| 1856 | const vp9_subp_avg_variance_fn_t subpel_avg_variance32x64_ssse3 = |
| 1857 | vp9_sub_pixel_avg_variance32x64_ssse3; |
| 1858 | const vp9_subp_avg_variance_fn_t subpel_avg_variance64x32_ssse3 = |
| 1859 | vp9_sub_pixel_avg_variance64x32_ssse3; |
| 1860 | const vp9_subp_avg_variance_fn_t subpel_avg_variance64x64_ssse3 = |
| 1861 | vp9_sub_pixel_avg_variance64x64_ssse3; |
Ronald S. Bultje | 1e6a32f | 2013-06-20 15:59:48 -0700 | [diff] [blame] | 1862 | INSTANTIATE_TEST_CASE_P( |
| 1863 | SSSE3, VP9SubpelAvgVarianceTest, |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 1864 | ::testing::Values(make_tuple(2, 2, subpel_avg_variance4x4_ssse3, 0), |
| 1865 | make_tuple(2, 3, subpel_avg_variance4x8_ssse3, 0), |
| 1866 | make_tuple(3, 2, subpel_avg_variance8x4_ssse3, 0), |
| 1867 | make_tuple(3, 3, subpel_avg_variance8x8_ssse3, 0), |
| 1868 | make_tuple(3, 4, subpel_avg_variance8x16_ssse3, 0), |
| 1869 | make_tuple(4, 3, subpel_avg_variance16x8_ssse3, 0), |
| 1870 | make_tuple(4, 4, subpel_avg_variance16x16_ssse3, 0), |
| 1871 | make_tuple(4, 5, subpel_avg_variance16x32_ssse3, 0), |
| 1872 | make_tuple(5, 4, subpel_avg_variance32x16_ssse3, 0), |
| 1873 | make_tuple(5, 5, subpel_avg_variance32x32_ssse3, 0), |
| 1874 | make_tuple(5, 6, subpel_avg_variance32x64_ssse3, 0), |
| 1875 | make_tuple(6, 5, subpel_avg_variance64x32_ssse3, 0), |
| 1876 | make_tuple(6, 6, subpel_avg_variance64x64_ssse3, 0))); |
| 1877 | #endif // CONFIG_USE_X86INC |
| 1878 | #endif // HAVE_SSSE3 |
James Zern | 520cb3f | 2014-06-08 18:25:37 -0700 | [diff] [blame] | 1879 | |
| 1880 | #if HAVE_AVX2 |
levytamar82 | 69a5f5e | 2014-07-24 00:20:19 -0700 | [diff] [blame] | 1881 | |
James Zern | 520cb3f | 2014-06-08 18:25:37 -0700 | [diff] [blame] | 1882 | const vp9_variance_fn_t variance16x16_avx2 = vp9_variance16x16_avx2; |
| 1883 | const vp9_variance_fn_t variance32x16_avx2 = vp9_variance32x16_avx2; |
| 1884 | const vp9_variance_fn_t variance32x32_avx2 = vp9_variance32x32_avx2; |
| 1885 | const vp9_variance_fn_t variance64x32_avx2 = vp9_variance64x32_avx2; |
| 1886 | const vp9_variance_fn_t variance64x64_avx2 = vp9_variance64x64_avx2; |
| 1887 | INSTANTIATE_TEST_CASE_P( |
| 1888 | AVX2, VP9VarianceTest, |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 1889 | ::testing::Values(make_tuple(4, 4, variance16x16_avx2, 0), |
| 1890 | make_tuple(5, 4, variance32x16_avx2, 0), |
| 1891 | make_tuple(5, 5, variance32x32_avx2, 0), |
| 1892 | make_tuple(6, 5, variance64x32_avx2, 0), |
| 1893 | make_tuple(6, 6, variance64x64_avx2, 0))); |
James Zern | 520cb3f | 2014-06-08 18:25:37 -0700 | [diff] [blame] | 1894 | |
| 1895 | const vp9_subpixvariance_fn_t subpel_variance32x32_avx2 = |
| 1896 | vp9_sub_pixel_variance32x32_avx2; |
| 1897 | const vp9_subpixvariance_fn_t subpel_variance64x64_avx2 = |
| 1898 | vp9_sub_pixel_variance64x64_avx2; |
| 1899 | INSTANTIATE_TEST_CASE_P( |
levytamar82 | 69a5f5e | 2014-07-24 00:20:19 -0700 | [diff] [blame] | 1900 | AVX2, VP9SubpelVarianceTest, |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 1901 | ::testing::Values(make_tuple(5, 5, subpel_variance32x32_avx2, 0), |
| 1902 | make_tuple(6, 6, subpel_variance64x64_avx2, 0))); |
James Zern | 520cb3f | 2014-06-08 18:25:37 -0700 | [diff] [blame] | 1903 | |
| 1904 | const vp9_subp_avg_variance_fn_t subpel_avg_variance32x32_avx2 = |
| 1905 | vp9_sub_pixel_avg_variance32x32_avx2; |
| 1906 | const vp9_subp_avg_variance_fn_t subpel_avg_variance64x64_avx2 = |
| 1907 | vp9_sub_pixel_avg_variance64x64_avx2; |
| 1908 | INSTANTIATE_TEST_CASE_P( |
levytamar82 | 69a5f5e | 2014-07-24 00:20:19 -0700 | [diff] [blame] | 1909 | AVX2, VP9SubpelAvgVarianceTest, |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 1910 | ::testing::Values(make_tuple(5, 5, subpel_avg_variance32x32_avx2, 0), |
| 1911 | make_tuple(6, 6, subpel_avg_variance64x64_avx2, 0))); |
James Zern | 520cb3f | 2014-06-08 18:25:37 -0700 | [diff] [blame] | 1912 | #endif // HAVE_AVX2 |
Scott LaVarnway | 521cf7e | 2014-07-29 16:47:34 -0700 | [diff] [blame] | 1913 | #if HAVE_NEON |
Scott LaVarnway | 98165ec | 2014-08-01 11:35:55 -0700 | [diff] [blame] | 1914 | const vp9_variance_fn_t variance8x8_neon = vp9_variance8x8_neon; |
Scott LaVarnway | 521cf7e | 2014-07-29 16:47:34 -0700 | [diff] [blame] | 1915 | const vp9_variance_fn_t variance16x16_neon = vp9_variance16x16_neon; |
Scott LaVarnway | d39448e | 2014-07-31 08:00:36 -0700 | [diff] [blame] | 1916 | const vp9_variance_fn_t variance32x32_neon = vp9_variance32x32_neon; |
Frank Galligan | 74d40cd | 2015-01-13 11:15:24 -0800 | [diff] [blame] | 1917 | const vp9_variance_fn_t variance32x64_neon = vp9_variance32x64_neon; |
| 1918 | const vp9_variance_fn_t variance64x32_neon = vp9_variance64x32_neon; |
| 1919 | const vp9_variance_fn_t variance64x64_neon = vp9_variance64x64_neon; |
Scott LaVarnway | 521cf7e | 2014-07-29 16:47:34 -0700 | [diff] [blame] | 1920 | INSTANTIATE_TEST_CASE_P( |
| 1921 | NEON, VP9VarianceTest, |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 1922 | ::testing::Values(make_tuple(3, 3, variance8x8_neon, 0), |
| 1923 | make_tuple(4, 4, variance16x16_neon, 0), |
Frank Galligan | 74d40cd | 2015-01-13 11:15:24 -0800 | [diff] [blame] | 1924 | make_tuple(5, 5, variance32x32_neon, 0), |
| 1925 | make_tuple(5, 6, variance32x64_neon, 0), |
| 1926 | make_tuple(6, 5, variance64x32_neon, 0), |
| 1927 | make_tuple(6, 6, variance64x64_neon, 0))); |
Scott LaVarnway | 521cf7e | 2014-07-29 16:47:34 -0700 | [diff] [blame] | 1928 | |
Scott LaVarnway | 98165ec | 2014-08-01 11:35:55 -0700 | [diff] [blame] | 1929 | const vp9_subpixvariance_fn_t subpel_variance8x8_neon = |
| 1930 | vp9_sub_pixel_variance8x8_neon; |
Scott LaVarnway | 521cf7e | 2014-07-29 16:47:34 -0700 | [diff] [blame] | 1931 | const vp9_subpixvariance_fn_t subpel_variance16x16_neon = |
| 1932 | vp9_sub_pixel_variance16x16_neon; |
Scott LaVarnway | d39448e | 2014-07-31 08:00:36 -0700 | [diff] [blame] | 1933 | const vp9_subpixvariance_fn_t subpel_variance32x32_neon = |
| 1934 | vp9_sub_pixel_variance32x32_neon; |
Frank Galligan | ec1d838 | 2015-01-13 23:01:06 -0800 | [diff] [blame] | 1935 | const vp9_subpixvariance_fn_t subpel_variance64x64_neon = |
| 1936 | vp9_sub_pixel_variance64x64_neon; |
Scott LaVarnway | 521cf7e | 2014-07-29 16:47:34 -0700 | [diff] [blame] | 1937 | INSTANTIATE_TEST_CASE_P( |
| 1938 | NEON, VP9SubpelVarianceTest, |
Peter de Rivaz | 48032bf | 2014-10-16 14:00:54 +0100 | [diff] [blame] | 1939 | ::testing::Values(make_tuple(3, 3, subpel_variance8x8_neon, 0), |
| 1940 | make_tuple(4, 4, subpel_variance16x16_neon, 0), |
Frank Galligan | ec1d838 | 2015-01-13 23:01:06 -0800 | [diff] [blame] | 1941 | make_tuple(5, 5, subpel_variance32x32_neon, 0), |
| 1942 | make_tuple(6, 6, subpel_variance64x64_neon, 0))); |
Scott LaVarnway | 521cf7e | 2014-07-29 16:47:34 -0700 | [diff] [blame] | 1943 | #endif // HAVE_NEON |
James Zern | 1711cf2 | 2013-02-22 16:23:36 -0800 | [diff] [blame] | 1944 | #endif // CONFIG_VP9_ENCODER |
| 1945 | |
| 1946 | } // namespace vp9 |
James Zern | 9847344 | 2012-11-06 16:58:11 -0800 | [diff] [blame] | 1947 | } // namespace |