variance_test.cc 74 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617
  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. */
  10. #include <cstdlib>
  11. #include <new>
  12. #include "third_party/googletest/src/include/gtest/gtest.h"
  13. #include "./vpx_config.h"
  14. #include "./vpx_dsp_rtcd.h"
  15. #include "test/acm_random.h"
  16. #include "test/clear_system_state.h"
  17. #include "test/register_state_check.h"
  18. #include "vpx/vpx_codec.h"
  19. #include "vpx/vpx_integer.h"
  20. #include "vpx_dsp/variance.h"
  21. #include "vpx_mem/vpx_mem.h"
  22. #include "vpx_ports/mem.h"
  23. #include "vpx_ports/vpx_timer.h"
  24. namespace {
  25. typedef unsigned int (*Get4x4SseFunc)(const uint8_t *a, int a_stride,
  26. const uint8_t *b, int b_stride);
  27. typedef unsigned int (*SumOfSquaresFunction)(const int16_t *src);
  28. using libvpx_test::ACMRandom;
  29. // Truncate high bit depth results by downshifting (with rounding) by:
  30. // 2 * (bit_depth - 8) for sse
  31. // (bit_depth - 8) for se
  32. static void RoundHighBitDepth(int bit_depth, int64_t *se, uint64_t *sse) {
  33. switch (bit_depth) {
  34. case VPX_BITS_12:
  35. *sse = (*sse + 128) >> 8;
  36. *se = (*se + 8) >> 4;
  37. break;
  38. case VPX_BITS_10:
  39. *sse = (*sse + 8) >> 4;
  40. *se = (*se + 2) >> 2;
  41. break;
  42. case VPX_BITS_8:
  43. default: break;
  44. }
  45. }
  46. static unsigned int mb_ss_ref(const int16_t *src) {
  47. unsigned int res = 0;
  48. for (int i = 0; i < 256; ++i) {
  49. res += src[i] * src[i];
  50. }
  51. return res;
  52. }
  53. /* Note:
  54. * Our codebase calculates the "diff" value in the variance algorithm by
  55. * (src - ref).
  56. */
  57. static uint32_t variance_ref(const uint8_t *src, const uint8_t *ref, int l2w,
  58. int l2h, int src_stride, int ref_stride,
  59. uint32_t *sse_ptr, bool use_high_bit_depth_,
  60. vpx_bit_depth_t bit_depth) {
  61. int64_t se = 0;
  62. uint64_t sse = 0;
  63. const int w = 1 << l2w;
  64. const int h = 1 << l2h;
  65. for (int y = 0; y < h; y++) {
  66. for (int x = 0; x < w; x++) {
  67. int diff;
  68. if (!use_high_bit_depth_) {
  69. diff = src[y * src_stride + x] - ref[y * ref_stride + x];
  70. se += diff;
  71. sse += diff * diff;
  72. #if CONFIG_VP9_HIGHBITDEPTH
  73. } else {
  74. diff = CONVERT_TO_SHORTPTR(src)[y * src_stride + x] -
  75. CONVERT_TO_SHORTPTR(ref)[y * ref_stride + x];
  76. se += diff;
  77. sse += diff * diff;
  78. #endif // CONFIG_VP9_HIGHBITDEPTH
  79. }
  80. }
  81. }
  82. RoundHighBitDepth(bit_depth, &se, &sse);
  83. *sse_ptr = static_cast<uint32_t>(sse);
  84. return static_cast<uint32_t>(
  85. sse - ((static_cast<int64_t>(se) * se) >> (l2w + l2h)));
  86. }
  87. /* The subpel reference functions differ from the codec version in one aspect:
  88. * they calculate the bilinear factors directly instead of using a lookup table
  89. * and therefore upshift xoff and yoff by 1. Only every other calculated value
  90. * is used so the codec version shrinks the table to save space and maintain
  91. * compatibility with vp8.
  92. */
  93. static uint32_t subpel_variance_ref(const uint8_t *ref, const uint8_t *src,
  94. int l2w, int l2h, int xoff, int yoff,
  95. uint32_t *sse_ptr, bool use_high_bit_depth_,
  96. vpx_bit_depth_t bit_depth) {
  97. int64_t se = 0;
  98. uint64_t sse = 0;
  99. const int w = 1 << l2w;
  100. const int h = 1 << l2h;
  101. xoff <<= 1;
  102. yoff <<= 1;
  103. for (int y = 0; y < h; y++) {
  104. for (int x = 0; x < w; x++) {
  105. // Bilinear interpolation at a 16th pel step.
  106. if (!use_high_bit_depth_) {
  107. const int a1 = ref[(w + 1) * (y + 0) + x + 0];
  108. const int a2 = ref[(w + 1) * (y + 0) + x + 1];
  109. const int b1 = ref[(w + 1) * (y + 1) + x + 0];
  110. const int b2 = ref[(w + 1) * (y + 1) + x + 1];
  111. const int a = a1 + (((a2 - a1) * xoff + 8) >> 4);
  112. const int b = b1 + (((b2 - b1) * xoff + 8) >> 4);
  113. const int r = a + (((b - a) * yoff + 8) >> 4);
  114. const int diff = r - src[w * y + x];
  115. se += diff;
  116. sse += diff * diff;
  117. #if CONFIG_VP9_HIGHBITDEPTH
  118. } else {
  119. uint16_t *ref16 = CONVERT_TO_SHORTPTR(ref);
  120. uint16_t *src16 = CONVERT_TO_SHORTPTR(src);
  121. const int a1 = ref16[(w + 1) * (y + 0) + x + 0];
  122. const int a2 = ref16[(w + 1) * (y + 0) + x + 1];
  123. const int b1 = ref16[(w + 1) * (y + 1) + x + 0];
  124. const int b2 = ref16[(w + 1) * (y + 1) + x + 1];
  125. const int a = a1 + (((a2 - a1) * xoff + 8) >> 4);
  126. const int b = b1 + (((b2 - b1) * xoff + 8) >> 4);
  127. const int r = a + (((b - a) * yoff + 8) >> 4);
  128. const int diff = r - src16[w * y + x];
  129. se += diff;
  130. sse += diff * diff;
  131. #endif // CONFIG_VP9_HIGHBITDEPTH
  132. }
  133. }
  134. }
  135. RoundHighBitDepth(bit_depth, &se, &sse);
  136. *sse_ptr = static_cast<uint32_t>(sse);
  137. return static_cast<uint32_t>(
  138. sse - ((static_cast<int64_t>(se) * se) >> (l2w + l2h)));
  139. }
  140. static uint32_t subpel_avg_variance_ref(const uint8_t *ref, const uint8_t *src,
  141. const uint8_t *second_pred, int l2w,
  142. int l2h, int xoff, int yoff,
  143. uint32_t *sse_ptr,
  144. bool use_high_bit_depth,
  145. vpx_bit_depth_t bit_depth) {
  146. int64_t se = 0;
  147. uint64_t sse = 0;
  148. const int w = 1 << l2w;
  149. const int h = 1 << l2h;
  150. xoff <<= 1;
  151. yoff <<= 1;
  152. for (int y = 0; y < h; y++) {
  153. for (int x = 0; x < w; x++) {
  154. // bilinear interpolation at a 16th pel step
  155. if (!use_high_bit_depth) {
  156. const int a1 = ref[(w + 1) * (y + 0) + x + 0];
  157. const int a2 = ref[(w + 1) * (y + 0) + x + 1];
  158. const int b1 = ref[(w + 1) * (y + 1) + x + 0];
  159. const int b2 = ref[(w + 1) * (y + 1) + x + 1];
  160. const int a = a1 + (((a2 - a1) * xoff + 8) >> 4);
  161. const int b = b1 + (((b2 - b1) * xoff + 8) >> 4);
  162. const int r = a + (((b - a) * yoff + 8) >> 4);
  163. const int diff =
  164. ((r + second_pred[w * y + x] + 1) >> 1) - src[w * y + x];
  165. se += diff;
  166. sse += diff * diff;
  167. #if CONFIG_VP9_HIGHBITDEPTH
  168. } else {
  169. const uint16_t *ref16 = CONVERT_TO_SHORTPTR(ref);
  170. const uint16_t *src16 = CONVERT_TO_SHORTPTR(src);
  171. const uint16_t *sec16 = CONVERT_TO_SHORTPTR(second_pred);
  172. const int a1 = ref16[(w + 1) * (y + 0) + x + 0];
  173. const int a2 = ref16[(w + 1) * (y + 0) + x + 1];
  174. const int b1 = ref16[(w + 1) * (y + 1) + x + 0];
  175. const int b2 = ref16[(w + 1) * (y + 1) + x + 1];
  176. const int a = a1 + (((a2 - a1) * xoff + 8) >> 4);
  177. const int b = b1 + (((b2 - b1) * xoff + 8) >> 4);
  178. const int r = a + (((b - a) * yoff + 8) >> 4);
  179. const int diff = ((r + sec16[w * y + x] + 1) >> 1) - src16[w * y + x];
  180. se += diff;
  181. sse += diff * diff;
  182. #endif // CONFIG_VP9_HIGHBITDEPTH
  183. }
  184. }
  185. }
  186. RoundHighBitDepth(bit_depth, &se, &sse);
  187. *sse_ptr = static_cast<uint32_t>(sse);
  188. return static_cast<uint32_t>(
  189. sse - ((static_cast<int64_t>(se) * se) >> (l2w + l2h)));
  190. }
  191. ////////////////////////////////////////////////////////////////////////////////
  192. class SumOfSquaresTest : public ::testing::TestWithParam<SumOfSquaresFunction> {
  193. public:
  194. SumOfSquaresTest() : func_(GetParam()) {}
  195. virtual ~SumOfSquaresTest() { libvpx_test::ClearSystemState(); }
  196. protected:
  197. void ConstTest();
  198. void RefTest();
  199. SumOfSquaresFunction func_;
  200. ACMRandom rnd_;
  201. };
  202. void SumOfSquaresTest::ConstTest() {
  203. int16_t mem[256];
  204. unsigned int res;
  205. for (int v = 0; v < 256; ++v) {
  206. for (int i = 0; i < 256; ++i) {
  207. mem[i] = v;
  208. }
  209. ASM_REGISTER_STATE_CHECK(res = func_(mem));
  210. EXPECT_EQ(256u * (v * v), res);
  211. }
  212. }
  213. void SumOfSquaresTest::RefTest() {
  214. int16_t mem[256];
  215. for (int i = 0; i < 100; ++i) {
  216. for (int j = 0; j < 256; ++j) {
  217. mem[j] = rnd_.Rand8() - rnd_.Rand8();
  218. }
  219. const unsigned int expected = mb_ss_ref(mem);
  220. unsigned int res;
  221. ASM_REGISTER_STATE_CHECK(res = func_(mem));
  222. EXPECT_EQ(expected, res);
  223. }
  224. }
  225. ////////////////////////////////////////////////////////////////////////////////
  226. // Encapsulating struct to store the function to test along with
  227. // some testing context.
  228. // Can be used for MSE, SSE, Variance, etc.
  229. template <typename Func>
  230. struct TestParams {
  231. TestParams(int log2w = 0, int log2h = 0, Func function = NULL,
  232. int bit_depth_value = 0)
  233. : log2width(log2w), log2height(log2h), func(function) {
  234. use_high_bit_depth = (bit_depth_value > 0);
  235. if (use_high_bit_depth) {
  236. bit_depth = static_cast<vpx_bit_depth_t>(bit_depth_value);
  237. } else {
  238. bit_depth = VPX_BITS_8;
  239. }
  240. width = 1 << log2width;
  241. height = 1 << log2height;
  242. block_size = width * height;
  243. mask = (1u << bit_depth) - 1;
  244. }
  245. int log2width, log2height;
  246. int width, height;
  247. int block_size;
  248. Func func;
  249. vpx_bit_depth_t bit_depth;
  250. bool use_high_bit_depth;
  251. uint32_t mask;
  252. };
  253. template <typename Func>
  254. std::ostream &operator<<(std::ostream &os, const TestParams<Func> &p) {
  255. return os << "log2width/height:" << p.log2width << "/" << p.log2height
  256. << " function:" << reinterpret_cast<const void *>(p.func)
  257. << " bit-depth:" << p.bit_depth;
  258. }
  259. // Main class for testing a function type
  260. template <typename FunctionType>
  261. class MainTestClass
  262. : public ::testing::TestWithParam<TestParams<FunctionType> > {
  263. public:
  264. virtual void SetUp() {
  265. params_ = this->GetParam();
  266. rnd_.Reset(ACMRandom::DeterministicSeed());
  267. const size_t unit =
  268. use_high_bit_depth() ? sizeof(uint16_t) : sizeof(uint8_t);
  269. src_ = reinterpret_cast<uint8_t *>(vpx_memalign(16, block_size() * unit));
  270. ref_ = new uint8_t[block_size() * unit];
  271. ASSERT_TRUE(src_ != NULL);
  272. ASSERT_TRUE(ref_ != NULL);
  273. #if CONFIG_VP9_HIGHBITDEPTH
  274. if (use_high_bit_depth()) {
  275. // TODO(skal): remove!
  276. src_ = CONVERT_TO_BYTEPTR(src_);
  277. ref_ = CONVERT_TO_BYTEPTR(ref_);
  278. }
  279. #endif
  280. }
  281. virtual void TearDown() {
  282. #if CONFIG_VP9_HIGHBITDEPTH
  283. if (use_high_bit_depth()) {
  284. // TODO(skal): remove!
  285. src_ = reinterpret_cast<uint8_t *>(CONVERT_TO_SHORTPTR(src_));
  286. ref_ = reinterpret_cast<uint8_t *>(CONVERT_TO_SHORTPTR(ref_));
  287. }
  288. #endif
  289. vpx_free(src_);
  290. delete[] ref_;
  291. src_ = NULL;
  292. ref_ = NULL;
  293. libvpx_test::ClearSystemState();
  294. }
  295. protected:
  296. // We could sub-class MainTestClass into dedicated class for Variance
  297. // and MSE/SSE, but it involves a lot of 'this->xxx' dereferencing
  298. // to access top class fields xxx. That's cumbersome, so for now we'll just
  299. // implement the testing methods here:
  300. // Variance tests
  301. void ZeroTest();
  302. void RefTest();
  303. void RefStrideTest();
  304. void OneQuarterTest();
  305. void SpeedTest();
  306. // MSE/SSE tests
  307. void RefTestMse();
  308. void RefTestSse();
  309. void MaxTestMse();
  310. void MaxTestSse();
  311. protected:
  312. ACMRandom rnd_;
  313. uint8_t *src_;
  314. uint8_t *ref_;
  315. TestParams<FunctionType> params_;
  316. // some relay helpers
  317. bool use_high_bit_depth() const { return params_.use_high_bit_depth; }
  318. int byte_shift() const { return params_.bit_depth - 8; }
  319. int block_size() const { return params_.block_size; }
  320. int width() const { return params_.width; }
  321. int height() const { return params_.height; }
  322. uint32_t mask() const { return params_.mask; }
  323. };
  324. ////////////////////////////////////////////////////////////////////////////////
  325. // Tests related to variance.
  326. template <typename VarianceFunctionType>
  327. void MainTestClass<VarianceFunctionType>::ZeroTest() {
  328. for (int i = 0; i <= 255; ++i) {
  329. if (!use_high_bit_depth()) {
  330. memset(src_, i, block_size());
  331. } else {
  332. uint16_t *const src16 = CONVERT_TO_SHORTPTR(src_);
  333. for (int k = 0; k < block_size(); ++k) src16[k] = i << byte_shift();
  334. }
  335. for (int j = 0; j <= 255; ++j) {
  336. if (!use_high_bit_depth()) {
  337. memset(ref_, j, block_size());
  338. } else {
  339. uint16_t *const ref16 = CONVERT_TO_SHORTPTR(ref_);
  340. for (int k = 0; k < block_size(); ++k) ref16[k] = j << byte_shift();
  341. }
  342. unsigned int sse, var;
  343. ASM_REGISTER_STATE_CHECK(
  344. var = params_.func(src_, width(), ref_, width(), &sse));
  345. EXPECT_EQ(0u, var) << "src values: " << i << " ref values: " << j;
  346. }
  347. }
  348. }
  349. template <typename VarianceFunctionType>
  350. void MainTestClass<VarianceFunctionType>::RefTest() {
  351. for (int i = 0; i < 10; ++i) {
  352. for (int j = 0; j < block_size(); j++) {
  353. if (!use_high_bit_depth()) {
  354. src_[j] = rnd_.Rand8();
  355. ref_[j] = rnd_.Rand8();
  356. #if CONFIG_VP9_HIGHBITDEPTH
  357. } else {
  358. CONVERT_TO_SHORTPTR(src_)[j] = rnd_.Rand16() & mask();
  359. CONVERT_TO_SHORTPTR(ref_)[j] = rnd_.Rand16() & mask();
  360. #endif // CONFIG_VP9_HIGHBITDEPTH
  361. }
  362. }
  363. unsigned int sse1, sse2, var1, var2;
  364. const int stride = width();
  365. ASM_REGISTER_STATE_CHECK(
  366. var1 = params_.func(src_, stride, ref_, stride, &sse1));
  367. var2 =
  368. variance_ref(src_, ref_, params_.log2width, params_.log2height, stride,
  369. stride, &sse2, use_high_bit_depth(), params_.bit_depth);
  370. EXPECT_EQ(sse1, sse2) << "Error at test index: " << i;
  371. EXPECT_EQ(var1, var2) << "Error at test index: " << i;
  372. }
  373. }
  374. template <typename VarianceFunctionType>
  375. void MainTestClass<VarianceFunctionType>::RefStrideTest() {
  376. for (int i = 0; i < 10; ++i) {
  377. const int ref_stride = (i & 1) * width();
  378. const int src_stride = ((i >> 1) & 1) * width();
  379. for (int j = 0; j < block_size(); j++) {
  380. const int ref_ind = (j / width()) * ref_stride + j % width();
  381. const int src_ind = (j / width()) * src_stride + j % width();
  382. if (!use_high_bit_depth()) {
  383. src_[src_ind] = rnd_.Rand8();
  384. ref_[ref_ind] = rnd_.Rand8();
  385. #if CONFIG_VP9_HIGHBITDEPTH
  386. } else {
  387. CONVERT_TO_SHORTPTR(src_)[src_ind] = rnd_.Rand16() & mask();
  388. CONVERT_TO_SHORTPTR(ref_)[ref_ind] = rnd_.Rand16() & mask();
  389. #endif // CONFIG_VP9_HIGHBITDEPTH
  390. }
  391. }
  392. unsigned int sse1, sse2;
  393. unsigned int var1, var2;
  394. ASM_REGISTER_STATE_CHECK(
  395. var1 = params_.func(src_, src_stride, ref_, ref_stride, &sse1));
  396. var2 = variance_ref(src_, ref_, params_.log2width, params_.log2height,
  397. src_stride, ref_stride, &sse2, use_high_bit_depth(),
  398. params_.bit_depth);
  399. EXPECT_EQ(sse1, sse2) << "Error at test index: " << i;
  400. EXPECT_EQ(var1, var2) << "Error at test index: " << i;
  401. }
  402. }
  403. template <typename VarianceFunctionType>
  404. void MainTestClass<VarianceFunctionType>::OneQuarterTest() {
  405. const int half = block_size() / 2;
  406. if (!use_high_bit_depth()) {
  407. memset(src_, 255, block_size());
  408. memset(ref_, 255, half);
  409. memset(ref_ + half, 0, half);
  410. #if CONFIG_VP9_HIGHBITDEPTH
  411. } else {
  412. vpx_memset16(CONVERT_TO_SHORTPTR(src_), 255 << byte_shift(), block_size());
  413. vpx_memset16(CONVERT_TO_SHORTPTR(ref_), 255 << byte_shift(), half);
  414. vpx_memset16(CONVERT_TO_SHORTPTR(ref_) + half, 0, half);
  415. #endif // CONFIG_VP9_HIGHBITDEPTH
  416. }
  417. unsigned int sse, var, expected;
  418. ASM_REGISTER_STATE_CHECK(
  419. var = params_.func(src_, width(), ref_, width(), &sse));
  420. expected = block_size() * 255 * 255 / 4;
  421. EXPECT_EQ(expected, var);
  422. }
  423. template <typename VarianceFunctionType>
  424. void MainTestClass<VarianceFunctionType>::SpeedTest() {
  425. const int half = block_size() / 2;
  426. if (!use_high_bit_depth()) {
  427. memset(src_, 255, block_size());
  428. memset(ref_, 255, half);
  429. memset(ref_ + half, 0, half);
  430. #if CONFIG_VP9_HIGHBITDEPTH
  431. } else {
  432. vpx_memset16(CONVERT_TO_SHORTPTR(src_), 255 << byte_shift(), block_size());
  433. vpx_memset16(CONVERT_TO_SHORTPTR(ref_), 255 << byte_shift(), half);
  434. vpx_memset16(CONVERT_TO_SHORTPTR(ref_) + half, 0, half);
  435. #endif // CONFIG_VP9_HIGHBITDEPTH
  436. }
  437. unsigned int sse;
  438. vpx_usec_timer timer;
  439. vpx_usec_timer_start(&timer);
  440. for (int i = 0; i < (1 << 30) / block_size(); ++i) {
  441. const uint32_t variance = params_.func(src_, width(), ref_, width(), &sse);
  442. // Ignore return value.
  443. (void)variance;
  444. }
  445. vpx_usec_timer_mark(&timer);
  446. const int elapsed_time = static_cast<int>(vpx_usec_timer_elapsed(&timer));
  447. printf("Variance %dx%d time: %5d ms\n", width(), height(),
  448. elapsed_time / 1000);
  449. }
  450. ////////////////////////////////////////////////////////////////////////////////
  451. // Tests related to MSE / SSE.
  452. template <typename FunctionType>
  453. void MainTestClass<FunctionType>::RefTestMse() {
  454. for (int i = 0; i < 10; ++i) {
  455. for (int j = 0; j < block_size(); ++j) {
  456. src_[j] = rnd_.Rand8();
  457. ref_[j] = rnd_.Rand8();
  458. }
  459. unsigned int sse1, sse2;
  460. const int stride = width();
  461. ASM_REGISTER_STATE_CHECK(params_.func(src_, stride, ref_, stride, &sse1));
  462. variance_ref(src_, ref_, params_.log2width, params_.log2height, stride,
  463. stride, &sse2, false, VPX_BITS_8);
  464. EXPECT_EQ(sse1, sse2);
  465. }
  466. }
  467. template <typename FunctionType>
  468. void MainTestClass<FunctionType>::RefTestSse() {
  469. for (int i = 0; i < 10; ++i) {
  470. for (int j = 0; j < block_size(); ++j) {
  471. src_[j] = rnd_.Rand8();
  472. ref_[j] = rnd_.Rand8();
  473. }
  474. unsigned int sse2;
  475. unsigned int var1;
  476. const int stride = width();
  477. ASM_REGISTER_STATE_CHECK(var1 = params_.func(src_, stride, ref_, stride));
  478. variance_ref(src_, ref_, params_.log2width, params_.log2height, stride,
  479. stride, &sse2, false, VPX_BITS_8);
  480. EXPECT_EQ(var1, sse2);
  481. }
  482. }
  483. template <typename FunctionType>
  484. void MainTestClass<FunctionType>::MaxTestMse() {
  485. memset(src_, 255, block_size());
  486. memset(ref_, 0, block_size());
  487. unsigned int sse;
  488. ASM_REGISTER_STATE_CHECK(params_.func(src_, width(), ref_, width(), &sse));
  489. const unsigned int expected = block_size() * 255 * 255;
  490. EXPECT_EQ(expected, sse);
  491. }
  492. template <typename FunctionType>
  493. void MainTestClass<FunctionType>::MaxTestSse() {
  494. memset(src_, 255, block_size());
  495. memset(ref_, 0, block_size());
  496. unsigned int var;
  497. ASM_REGISTER_STATE_CHECK(var = params_.func(src_, width(), ref_, width()));
  498. const unsigned int expected = block_size() * 255 * 255;
  499. EXPECT_EQ(expected, var);
  500. }
  501. ////////////////////////////////////////////////////////////////////////////////
  502. template <typename FunctionType>
  503. class SubpelVarianceTest
  504. : public ::testing::TestWithParam<TestParams<FunctionType> > {
  505. public:
  506. virtual void SetUp() {
  507. params_ = this->GetParam();
  508. rnd_.Reset(ACMRandom::DeterministicSeed());
  509. if (!use_high_bit_depth()) {
  510. src_ = reinterpret_cast<uint8_t *>(vpx_memalign(16, block_size()));
  511. sec_ = reinterpret_cast<uint8_t *>(vpx_memalign(16, block_size()));
  512. ref_ = reinterpret_cast<uint8_t *>(
  513. vpx_malloc(block_size() + width() + height() + 1));
  514. #if CONFIG_VP9_HIGHBITDEPTH
  515. } else {
  516. src_ = CONVERT_TO_BYTEPTR(reinterpret_cast<uint16_t *>(
  517. vpx_memalign(16, block_size() * sizeof(uint16_t))));
  518. sec_ = CONVERT_TO_BYTEPTR(reinterpret_cast<uint16_t *>(
  519. vpx_memalign(16, block_size() * sizeof(uint16_t))));
  520. ref_ = CONVERT_TO_BYTEPTR(reinterpret_cast<uint16_t *>(vpx_malloc(
  521. (block_size() + width() + height() + 1) * sizeof(uint16_t))));
  522. #endif // CONFIG_VP9_HIGHBITDEPTH
  523. }
  524. ASSERT_TRUE(src_ != NULL);
  525. ASSERT_TRUE(sec_ != NULL);
  526. ASSERT_TRUE(ref_ != NULL);
  527. }
  528. virtual void TearDown() {
  529. if (!use_high_bit_depth()) {
  530. vpx_free(src_);
  531. vpx_free(sec_);
  532. vpx_free(ref_);
  533. #if CONFIG_VP9_HIGHBITDEPTH
  534. } else {
  535. vpx_free(CONVERT_TO_SHORTPTR(src_));
  536. vpx_free(CONVERT_TO_SHORTPTR(ref_));
  537. vpx_free(CONVERT_TO_SHORTPTR(sec_));
  538. #endif // CONFIG_VP9_HIGHBITDEPTH
  539. }
  540. libvpx_test::ClearSystemState();
  541. }
  542. protected:
  543. void RefTest();
  544. void ExtremeRefTest();
  545. ACMRandom rnd_;
  546. uint8_t *src_;
  547. uint8_t *ref_;
  548. uint8_t *sec_;
  549. TestParams<FunctionType> params_;
  550. // some relay helpers
  551. bool use_high_bit_depth() const { return params_.use_high_bit_depth; }
  552. int byte_shift() const { return params_.bit_depth - 8; }
  553. int block_size() const { return params_.block_size; }
  554. int width() const { return params_.width; }
  555. int height() const { return params_.height; }
  556. uint32_t mask() const { return params_.mask; }
  557. };
  558. template <typename SubpelVarianceFunctionType>
  559. void SubpelVarianceTest<SubpelVarianceFunctionType>::RefTest() {
  560. for (int x = 0; x < 8; ++x) {
  561. for (int y = 0; y < 8; ++y) {
  562. if (!use_high_bit_depth()) {
  563. for (int j = 0; j < block_size(); j++) {
  564. src_[j] = rnd_.Rand8();
  565. }
  566. for (int j = 0; j < block_size() + width() + height() + 1; j++) {
  567. ref_[j] = rnd_.Rand8();
  568. }
  569. #if CONFIG_VP9_HIGHBITDEPTH
  570. } else {
  571. for (int j = 0; j < block_size(); j++) {
  572. CONVERT_TO_SHORTPTR(src_)[j] = rnd_.Rand16() & mask();
  573. }
  574. for (int j = 0; j < block_size() + width() + height() + 1; j++) {
  575. CONVERT_TO_SHORTPTR(ref_)[j] = rnd_.Rand16() & mask();
  576. }
  577. #endif // CONFIG_VP9_HIGHBITDEPTH
  578. }
  579. unsigned int sse1, sse2;
  580. unsigned int var1;
  581. ASM_REGISTER_STATE_CHECK(
  582. var1 = params_.func(ref_, width() + 1, x, y, src_, width(), &sse1));
  583. const unsigned int var2 = subpel_variance_ref(
  584. ref_, src_, params_.log2width, params_.log2height, x, y, &sse2,
  585. use_high_bit_depth(), params_.bit_depth);
  586. EXPECT_EQ(sse1, sse2) << "at position " << x << ", " << y;
  587. EXPECT_EQ(var1, var2) << "at position " << x << ", " << y;
  588. }
  589. }
  590. }
  591. template <typename SubpelVarianceFunctionType>
  592. void SubpelVarianceTest<SubpelVarianceFunctionType>::ExtremeRefTest() {
  593. // Compare against reference.
  594. // Src: Set the first half of values to 0, the second half to the maximum.
  595. // Ref: Set the first half of values to the maximum, the second half to 0.
  596. for (int x = 0; x < 8; ++x) {
  597. for (int y = 0; y < 8; ++y) {
  598. const int half = block_size() / 2;
  599. if (!use_high_bit_depth()) {
  600. memset(src_, 0, half);
  601. memset(src_ + half, 255, half);
  602. memset(ref_, 255, half);
  603. memset(ref_ + half, 0, half + width() + height() + 1);
  604. #if CONFIG_VP9_HIGHBITDEPTH
  605. } else {
  606. vpx_memset16(CONVERT_TO_SHORTPTR(src_), mask(), half);
  607. vpx_memset16(CONVERT_TO_SHORTPTR(src_) + half, 0, half);
  608. vpx_memset16(CONVERT_TO_SHORTPTR(ref_), 0, half);
  609. vpx_memset16(CONVERT_TO_SHORTPTR(ref_) + half, mask(),
  610. half + width() + height() + 1);
  611. #endif // CONFIG_VP9_HIGHBITDEPTH
  612. }
  613. unsigned int sse1, sse2;
  614. unsigned int var1;
  615. ASM_REGISTER_STATE_CHECK(
  616. var1 = params_.func(ref_, width() + 1, x, y, src_, width(), &sse1));
  617. const unsigned int var2 = subpel_variance_ref(
  618. ref_, src_, params_.log2width, params_.log2height, x, y, &sse2,
  619. use_high_bit_depth(), params_.bit_depth);
  620. EXPECT_EQ(sse1, sse2) << "for xoffset " << x << " and yoffset " << y;
  621. EXPECT_EQ(var1, var2) << "for xoffset " << x << " and yoffset " << y;
  622. }
  623. }
  624. }
  625. template <>
  626. void SubpelVarianceTest<vpx_subp_avg_variance_fn_t>::RefTest() {
  627. for (int x = 0; x < 8; ++x) {
  628. for (int y = 0; y < 8; ++y) {
  629. if (!use_high_bit_depth()) {
  630. for (int j = 0; j < block_size(); j++) {
  631. src_[j] = rnd_.Rand8();
  632. sec_[j] = rnd_.Rand8();
  633. }
  634. for (int j = 0; j < block_size() + width() + height() + 1; j++) {
  635. ref_[j] = rnd_.Rand8();
  636. }
  637. #if CONFIG_VP9_HIGHBITDEPTH
  638. } else {
  639. for (int j = 0; j < block_size(); j++) {
  640. CONVERT_TO_SHORTPTR(src_)[j] = rnd_.Rand16() & mask();
  641. CONVERT_TO_SHORTPTR(sec_)[j] = rnd_.Rand16() & mask();
  642. }
  643. for (int j = 0; j < block_size() + width() + height() + 1; j++) {
  644. CONVERT_TO_SHORTPTR(ref_)[j] = rnd_.Rand16() & mask();
  645. }
  646. #endif // CONFIG_VP9_HIGHBITDEPTH
  647. }
  648. uint32_t sse1, sse2;
  649. uint32_t var1, var2;
  650. ASM_REGISTER_STATE_CHECK(var1 = params_.func(ref_, width() + 1, x, y,
  651. src_, width(), &sse1, sec_));
  652. var2 = subpel_avg_variance_ref(ref_, src_, sec_, params_.log2width,
  653. params_.log2height, x, y, &sse2,
  654. use_high_bit_depth(), params_.bit_depth);
  655. EXPECT_EQ(sse1, sse2) << "at position " << x << ", " << y;
  656. EXPECT_EQ(var1, var2) << "at position " << x << ", " << y;
  657. }
  658. }
  659. }
  660. typedef MainTestClass<Get4x4SseFunc> VpxSseTest;
  661. typedef MainTestClass<vpx_variance_fn_t> VpxMseTest;
  662. typedef MainTestClass<vpx_variance_fn_t> VpxVarianceTest;
  663. typedef SubpelVarianceTest<vpx_subpixvariance_fn_t> VpxSubpelVarianceTest;
  664. typedef SubpelVarianceTest<vpx_subp_avg_variance_fn_t> VpxSubpelAvgVarianceTest;
  665. TEST_P(VpxSseTest, RefSse) { RefTestSse(); }
  666. TEST_P(VpxSseTest, MaxSse) { MaxTestSse(); }
  667. TEST_P(VpxMseTest, RefMse) { RefTestMse(); }
  668. TEST_P(VpxMseTest, MaxMse) { MaxTestMse(); }
  669. TEST_P(VpxVarianceTest, Zero) { ZeroTest(); }
  670. TEST_P(VpxVarianceTest, Ref) { RefTest(); }
  671. TEST_P(VpxVarianceTest, RefStride) { RefStrideTest(); }
  672. TEST_P(VpxVarianceTest, OneQuarter) { OneQuarterTest(); }
  673. TEST_P(VpxVarianceTest, DISABLED_Speed) { SpeedTest(); }
  674. TEST_P(SumOfSquaresTest, Const) { ConstTest(); }
  675. TEST_P(SumOfSquaresTest, Ref) { RefTest(); }
  676. TEST_P(VpxSubpelVarianceTest, Ref) { RefTest(); }
  677. TEST_P(VpxSubpelVarianceTest, ExtremeRef) { ExtremeRefTest(); }
  678. TEST_P(VpxSubpelAvgVarianceTest, Ref) { RefTest(); }
  679. INSTANTIATE_TEST_CASE_P(C, SumOfSquaresTest,
  680. ::testing::Values(vpx_get_mb_ss_c));
  681. typedef TestParams<Get4x4SseFunc> SseParams;
  682. INSTANTIATE_TEST_CASE_P(C, VpxSseTest,
  683. ::testing::Values(SseParams(2, 2,
  684. &vpx_get4x4sse_cs_c)));
  685. typedef TestParams<vpx_variance_fn_t> MseParams;
  686. INSTANTIATE_TEST_CASE_P(C, VpxMseTest,
  687. ::testing::Values(MseParams(4, 4, &vpx_mse16x16_c),
  688. MseParams(4, 3, &vpx_mse16x8_c),
  689. MseParams(3, 4, &vpx_mse8x16_c),
  690. MseParams(3, 3, &vpx_mse8x8_c)));
  691. typedef TestParams<vpx_variance_fn_t> VarianceParams;
  692. INSTANTIATE_TEST_CASE_P(
  693. C, VpxVarianceTest,
  694. ::testing::Values(VarianceParams(6, 6, &vpx_variance64x64_c),
  695. VarianceParams(6, 5, &vpx_variance64x32_c),
  696. VarianceParams(5, 6, &vpx_variance32x64_c),
  697. VarianceParams(5, 5, &vpx_variance32x32_c),
  698. VarianceParams(5, 4, &vpx_variance32x16_c),
  699. VarianceParams(4, 5, &vpx_variance16x32_c),
  700. VarianceParams(4, 4, &vpx_variance16x16_c),
  701. VarianceParams(4, 3, &vpx_variance16x8_c),
  702. VarianceParams(3, 4, &vpx_variance8x16_c),
  703. VarianceParams(3, 3, &vpx_variance8x8_c),
  704. VarianceParams(3, 2, &vpx_variance8x4_c),
  705. VarianceParams(2, 3, &vpx_variance4x8_c),
  706. VarianceParams(2, 2, &vpx_variance4x4_c)));
  707. typedef TestParams<vpx_subpixvariance_fn_t> SubpelVarianceParams;
  708. INSTANTIATE_TEST_CASE_P(
  709. C, VpxSubpelVarianceTest,
  710. ::testing::Values(
  711. SubpelVarianceParams(6, 6, &vpx_sub_pixel_variance64x64_c, 0),
  712. SubpelVarianceParams(6, 5, &vpx_sub_pixel_variance64x32_c, 0),
  713. SubpelVarianceParams(5, 6, &vpx_sub_pixel_variance32x64_c, 0),
  714. SubpelVarianceParams(5, 5, &vpx_sub_pixel_variance32x32_c, 0),
  715. SubpelVarianceParams(5, 4, &vpx_sub_pixel_variance32x16_c, 0),
  716. SubpelVarianceParams(4, 5, &vpx_sub_pixel_variance16x32_c, 0),
  717. SubpelVarianceParams(4, 4, &vpx_sub_pixel_variance16x16_c, 0),
  718. SubpelVarianceParams(4, 3, &vpx_sub_pixel_variance16x8_c, 0),
  719. SubpelVarianceParams(3, 4, &vpx_sub_pixel_variance8x16_c, 0),
  720. SubpelVarianceParams(3, 3, &vpx_sub_pixel_variance8x8_c, 0),
  721. SubpelVarianceParams(3, 2, &vpx_sub_pixel_variance8x4_c, 0),
  722. SubpelVarianceParams(2, 3, &vpx_sub_pixel_variance4x8_c, 0),
  723. SubpelVarianceParams(2, 2, &vpx_sub_pixel_variance4x4_c, 0)));
  724. typedef TestParams<vpx_subp_avg_variance_fn_t> SubpelAvgVarianceParams;
  725. INSTANTIATE_TEST_CASE_P(
  726. C, VpxSubpelAvgVarianceTest,
  727. ::testing::Values(
  728. SubpelAvgVarianceParams(6, 6, &vpx_sub_pixel_avg_variance64x64_c, 0),
  729. SubpelAvgVarianceParams(6, 5, &vpx_sub_pixel_avg_variance64x32_c, 0),
  730. SubpelAvgVarianceParams(5, 6, &vpx_sub_pixel_avg_variance32x64_c, 0),
  731. SubpelAvgVarianceParams(5, 5, &vpx_sub_pixel_avg_variance32x32_c, 0),
  732. SubpelAvgVarianceParams(5, 4, &vpx_sub_pixel_avg_variance32x16_c, 0),
  733. SubpelAvgVarianceParams(4, 5, &vpx_sub_pixel_avg_variance16x32_c, 0),
  734. SubpelAvgVarianceParams(4, 4, &vpx_sub_pixel_avg_variance16x16_c, 0),
  735. SubpelAvgVarianceParams(4, 3, &vpx_sub_pixel_avg_variance16x8_c, 0),
  736. SubpelAvgVarianceParams(3, 4, &vpx_sub_pixel_avg_variance8x16_c, 0),
  737. SubpelAvgVarianceParams(3, 3, &vpx_sub_pixel_avg_variance8x8_c, 0),
  738. SubpelAvgVarianceParams(3, 2, &vpx_sub_pixel_avg_variance8x4_c, 0),
  739. SubpelAvgVarianceParams(2, 3, &vpx_sub_pixel_avg_variance4x8_c, 0),
  740. SubpelAvgVarianceParams(2, 2, &vpx_sub_pixel_avg_variance4x4_c, 0)));
  741. #if CONFIG_VP9_HIGHBITDEPTH
  742. typedef MainTestClass<vpx_variance_fn_t> VpxHBDMseTest;
  743. typedef MainTestClass<vpx_variance_fn_t> VpxHBDVarianceTest;
  744. typedef SubpelVarianceTest<vpx_subpixvariance_fn_t> VpxHBDSubpelVarianceTest;
  745. typedef SubpelVarianceTest<vpx_subp_avg_variance_fn_t>
  746. VpxHBDSubpelAvgVarianceTest;
  747. TEST_P(VpxHBDMseTest, RefMse) { RefTestMse(); }
  748. TEST_P(VpxHBDMseTest, MaxMse) { MaxTestMse(); }
  749. TEST_P(VpxHBDVarianceTest, Zero) { ZeroTest(); }
  750. TEST_P(VpxHBDVarianceTest, Ref) { RefTest(); }
  751. TEST_P(VpxHBDVarianceTest, RefStride) { RefStrideTest(); }
  752. TEST_P(VpxHBDVarianceTest, OneQuarter) { OneQuarterTest(); }
  753. TEST_P(VpxHBDVarianceTest, DISABLED_Speed) { SpeedTest(); }
  754. TEST_P(VpxHBDSubpelVarianceTest, Ref) { RefTest(); }
  755. TEST_P(VpxHBDSubpelVarianceTest, ExtremeRef) { ExtremeRefTest(); }
  756. TEST_P(VpxHBDSubpelAvgVarianceTest, Ref) { RefTest(); }
  757. /* TODO(debargha): This test does not support the highbd version
  758. INSTANTIATE_TEST_CASE_P(
  759. C, VpxHBDMseTest,
  760. ::testing::Values(MseParams(4, 4, &vpx_highbd_12_mse16x16_c),
  761. MseParams(4, 4, &vpx_highbd_12_mse16x8_c),
  762. MseParams(4, 4, &vpx_highbd_12_mse8x16_c),
  763. MseParams(4, 4, &vpx_highbd_12_mse8x8_c),
  764. MseParams(4, 4, &vpx_highbd_10_mse16x16_c),
  765. MseParams(4, 4, &vpx_highbd_10_mse16x8_c),
  766. MseParams(4, 4, &vpx_highbd_10_mse8x16_c),
  767. MseParams(4, 4, &vpx_highbd_10_mse8x8_c),
  768. MseParams(4, 4, &vpx_highbd_8_mse16x16_c),
  769. MseParams(4, 4, &vpx_highbd_8_mse16x8_c),
  770. MseParams(4, 4, &vpx_highbd_8_mse8x16_c),
  771. MseParams(4, 4, &vpx_highbd_8_mse8x8_c)));
  772. */
  773. INSTANTIATE_TEST_CASE_P(
  774. C, VpxHBDVarianceTest,
  775. ::testing::Values(VarianceParams(6, 6, &vpx_highbd_12_variance64x64_c, 12),
  776. VarianceParams(6, 5, &vpx_highbd_12_variance64x32_c, 12),
  777. VarianceParams(5, 6, &vpx_highbd_12_variance32x64_c, 12),
  778. VarianceParams(5, 5, &vpx_highbd_12_variance32x32_c, 12),
  779. VarianceParams(5, 4, &vpx_highbd_12_variance32x16_c, 12),
  780. VarianceParams(4, 5, &vpx_highbd_12_variance16x32_c, 12),
  781. VarianceParams(4, 4, &vpx_highbd_12_variance16x16_c, 12),
  782. VarianceParams(4, 3, &vpx_highbd_12_variance16x8_c, 12),
  783. VarianceParams(3, 4, &vpx_highbd_12_variance8x16_c, 12),
  784. VarianceParams(3, 3, &vpx_highbd_12_variance8x8_c, 12),
  785. VarianceParams(3, 2, &vpx_highbd_12_variance8x4_c, 12),
  786. VarianceParams(2, 3, &vpx_highbd_12_variance4x8_c, 12),
  787. VarianceParams(2, 2, &vpx_highbd_12_variance4x4_c, 12),
  788. VarianceParams(6, 6, &vpx_highbd_10_variance64x64_c, 10),
  789. VarianceParams(6, 5, &vpx_highbd_10_variance64x32_c, 10),
  790. VarianceParams(5, 6, &vpx_highbd_10_variance32x64_c, 10),
  791. VarianceParams(5, 5, &vpx_highbd_10_variance32x32_c, 10),
  792. VarianceParams(5, 4, &vpx_highbd_10_variance32x16_c, 10),
  793. VarianceParams(4, 5, &vpx_highbd_10_variance16x32_c, 10),
  794. VarianceParams(4, 4, &vpx_highbd_10_variance16x16_c, 10),
  795. VarianceParams(4, 3, &vpx_highbd_10_variance16x8_c, 10),
  796. VarianceParams(3, 4, &vpx_highbd_10_variance8x16_c, 10),
  797. VarianceParams(3, 3, &vpx_highbd_10_variance8x8_c, 10),
  798. VarianceParams(3, 2, &vpx_highbd_10_variance8x4_c, 10),
  799. VarianceParams(2, 3, &vpx_highbd_10_variance4x8_c, 10),
  800. VarianceParams(2, 2, &vpx_highbd_10_variance4x4_c, 10),
  801. VarianceParams(6, 6, &vpx_highbd_8_variance64x64_c, 8),
  802. VarianceParams(6, 5, &vpx_highbd_8_variance64x32_c, 8),
  803. VarianceParams(5, 6, &vpx_highbd_8_variance32x64_c, 8),
  804. VarianceParams(5, 5, &vpx_highbd_8_variance32x32_c, 8),
  805. VarianceParams(5, 4, &vpx_highbd_8_variance32x16_c, 8),
  806. VarianceParams(4, 5, &vpx_highbd_8_variance16x32_c, 8),
  807. VarianceParams(4, 4, &vpx_highbd_8_variance16x16_c, 8),
  808. VarianceParams(4, 3, &vpx_highbd_8_variance16x8_c, 8),
  809. VarianceParams(3, 4, &vpx_highbd_8_variance8x16_c, 8),
  810. VarianceParams(3, 3, &vpx_highbd_8_variance8x8_c, 8),
  811. VarianceParams(3, 2, &vpx_highbd_8_variance8x4_c, 8),
  812. VarianceParams(2, 3, &vpx_highbd_8_variance4x8_c, 8),
  813. VarianceParams(2, 2, &vpx_highbd_8_variance4x4_c, 8)));
  814. INSTANTIATE_TEST_CASE_P(
  815. C, VpxHBDSubpelVarianceTest,
  816. ::testing::Values(
  817. SubpelVarianceParams(6, 6, &vpx_highbd_8_sub_pixel_variance64x64_c, 8),
  818. SubpelVarianceParams(6, 5, &vpx_highbd_8_sub_pixel_variance64x32_c, 8),
  819. SubpelVarianceParams(5, 6, &vpx_highbd_8_sub_pixel_variance32x64_c, 8),
  820. SubpelVarianceParams(5, 5, &vpx_highbd_8_sub_pixel_variance32x32_c, 8),
  821. SubpelVarianceParams(5, 4, &vpx_highbd_8_sub_pixel_variance32x16_c, 8),
  822. SubpelVarianceParams(4, 5, &vpx_highbd_8_sub_pixel_variance16x32_c, 8),
  823. SubpelVarianceParams(4, 4, &vpx_highbd_8_sub_pixel_variance16x16_c, 8),
  824. SubpelVarianceParams(4, 3, &vpx_highbd_8_sub_pixel_variance16x8_c, 8),
  825. SubpelVarianceParams(3, 4, &vpx_highbd_8_sub_pixel_variance8x16_c, 8),
  826. SubpelVarianceParams(3, 3, &vpx_highbd_8_sub_pixel_variance8x8_c, 8),
  827. SubpelVarianceParams(3, 2, &vpx_highbd_8_sub_pixel_variance8x4_c, 8),
  828. SubpelVarianceParams(2, 3, &vpx_highbd_8_sub_pixel_variance4x8_c, 8),
  829. SubpelVarianceParams(2, 2, &vpx_highbd_8_sub_pixel_variance4x4_c, 8),
  830. SubpelVarianceParams(6, 6, &vpx_highbd_10_sub_pixel_variance64x64_c,
  831. 10),
  832. SubpelVarianceParams(6, 5, &vpx_highbd_10_sub_pixel_variance64x32_c,
  833. 10),
  834. SubpelVarianceParams(5, 6, &vpx_highbd_10_sub_pixel_variance32x64_c,
  835. 10),
  836. SubpelVarianceParams(5, 5, &vpx_highbd_10_sub_pixel_variance32x32_c,
  837. 10),
  838. SubpelVarianceParams(5, 4, &vpx_highbd_10_sub_pixel_variance32x16_c,
  839. 10),
  840. SubpelVarianceParams(4, 5, &vpx_highbd_10_sub_pixel_variance16x32_c,
  841. 10),
  842. SubpelVarianceParams(4, 4, &vpx_highbd_10_sub_pixel_variance16x16_c,
  843. 10),
  844. SubpelVarianceParams(4, 3, &vpx_highbd_10_sub_pixel_variance16x8_c, 10),
  845. SubpelVarianceParams(3, 4, &vpx_highbd_10_sub_pixel_variance8x16_c, 10),
  846. SubpelVarianceParams(3, 3, &vpx_highbd_10_sub_pixel_variance8x8_c, 10),
  847. SubpelVarianceParams(3, 2, &vpx_highbd_10_sub_pixel_variance8x4_c, 10),
  848. SubpelVarianceParams(2, 3, &vpx_highbd_10_sub_pixel_variance4x8_c, 10),
  849. SubpelVarianceParams(2, 2, &vpx_highbd_10_sub_pixel_variance4x4_c, 10),
  850. SubpelVarianceParams(6, 6, &vpx_highbd_12_sub_pixel_variance64x64_c,
  851. 12),
  852. SubpelVarianceParams(6, 5, &vpx_highbd_12_sub_pixel_variance64x32_c,
  853. 12),
  854. SubpelVarianceParams(5, 6, &vpx_highbd_12_sub_pixel_variance32x64_c,
  855. 12),
  856. SubpelVarianceParams(5, 5, &vpx_highbd_12_sub_pixel_variance32x32_c,
  857. 12),
  858. SubpelVarianceParams(5, 4, &vpx_highbd_12_sub_pixel_variance32x16_c,
  859. 12),
  860. SubpelVarianceParams(4, 5, &vpx_highbd_12_sub_pixel_variance16x32_c,
  861. 12),
  862. SubpelVarianceParams(4, 4, &vpx_highbd_12_sub_pixel_variance16x16_c,
  863. 12),
  864. SubpelVarianceParams(4, 3, &vpx_highbd_12_sub_pixel_variance16x8_c, 12),
  865. SubpelVarianceParams(3, 4, &vpx_highbd_12_sub_pixel_variance8x16_c, 12),
  866. SubpelVarianceParams(3, 3, &vpx_highbd_12_sub_pixel_variance8x8_c, 12),
  867. SubpelVarianceParams(3, 2, &vpx_highbd_12_sub_pixel_variance8x4_c, 12),
  868. SubpelVarianceParams(2, 3, &vpx_highbd_12_sub_pixel_variance4x8_c, 12),
  869. SubpelVarianceParams(2, 2, &vpx_highbd_12_sub_pixel_variance4x4_c,
  870. 12)));
  871. INSTANTIATE_TEST_CASE_P(
  872. C, VpxHBDSubpelAvgVarianceTest,
  873. ::testing::Values(
  874. SubpelAvgVarianceParams(6, 6,
  875. &vpx_highbd_8_sub_pixel_avg_variance64x64_c, 8),
  876. SubpelAvgVarianceParams(6, 5,
  877. &vpx_highbd_8_sub_pixel_avg_variance64x32_c, 8),
  878. SubpelAvgVarianceParams(5, 6,
  879. &vpx_highbd_8_sub_pixel_avg_variance32x64_c, 8),
  880. SubpelAvgVarianceParams(5, 5,
  881. &vpx_highbd_8_sub_pixel_avg_variance32x32_c, 8),
  882. SubpelAvgVarianceParams(5, 4,
  883. &vpx_highbd_8_sub_pixel_avg_variance32x16_c, 8),
  884. SubpelAvgVarianceParams(4, 5,
  885. &vpx_highbd_8_sub_pixel_avg_variance16x32_c, 8),
  886. SubpelAvgVarianceParams(4, 4,
  887. &vpx_highbd_8_sub_pixel_avg_variance16x16_c, 8),
  888. SubpelAvgVarianceParams(4, 3,
  889. &vpx_highbd_8_sub_pixel_avg_variance16x8_c, 8),
  890. SubpelAvgVarianceParams(3, 4,
  891. &vpx_highbd_8_sub_pixel_avg_variance8x16_c, 8),
  892. SubpelAvgVarianceParams(3, 3, &vpx_highbd_8_sub_pixel_avg_variance8x8_c,
  893. 8),
  894. SubpelAvgVarianceParams(3, 2, &vpx_highbd_8_sub_pixel_avg_variance8x4_c,
  895. 8),
  896. SubpelAvgVarianceParams(2, 3, &vpx_highbd_8_sub_pixel_avg_variance4x8_c,
  897. 8),
  898. SubpelAvgVarianceParams(2, 2, &vpx_highbd_8_sub_pixel_avg_variance4x4_c,
  899. 8),
  900. SubpelAvgVarianceParams(6, 6,
  901. &vpx_highbd_10_sub_pixel_avg_variance64x64_c,
  902. 10),
  903. SubpelAvgVarianceParams(6, 5,
  904. &vpx_highbd_10_sub_pixel_avg_variance64x32_c,
  905. 10),
  906. SubpelAvgVarianceParams(5, 6,
  907. &vpx_highbd_10_sub_pixel_avg_variance32x64_c,
  908. 10),
  909. SubpelAvgVarianceParams(5, 5,
  910. &vpx_highbd_10_sub_pixel_avg_variance32x32_c,
  911. 10),
  912. SubpelAvgVarianceParams(5, 4,
  913. &vpx_highbd_10_sub_pixel_avg_variance32x16_c,
  914. 10),
  915. SubpelAvgVarianceParams(4, 5,
  916. &vpx_highbd_10_sub_pixel_avg_variance16x32_c,
  917. 10),
  918. SubpelAvgVarianceParams(4, 4,
  919. &vpx_highbd_10_sub_pixel_avg_variance16x16_c,
  920. 10),
  921. SubpelAvgVarianceParams(4, 3,
  922. &vpx_highbd_10_sub_pixel_avg_variance16x8_c,
  923. 10),
  924. SubpelAvgVarianceParams(3, 4,
  925. &vpx_highbd_10_sub_pixel_avg_variance8x16_c,
  926. 10),
  927. SubpelAvgVarianceParams(3, 3,
  928. &vpx_highbd_10_sub_pixel_avg_variance8x8_c, 10),
  929. SubpelAvgVarianceParams(3, 2,
  930. &vpx_highbd_10_sub_pixel_avg_variance8x4_c, 10),
  931. SubpelAvgVarianceParams(2, 3,
  932. &vpx_highbd_10_sub_pixel_avg_variance4x8_c, 10),
  933. SubpelAvgVarianceParams(2, 2,
  934. &vpx_highbd_10_sub_pixel_avg_variance4x4_c, 10),
  935. SubpelAvgVarianceParams(6, 6,
  936. &vpx_highbd_12_sub_pixel_avg_variance64x64_c,
  937. 12),
  938. SubpelAvgVarianceParams(6, 5,
  939. &vpx_highbd_12_sub_pixel_avg_variance64x32_c,
  940. 12),
  941. SubpelAvgVarianceParams(5, 6,
  942. &vpx_highbd_12_sub_pixel_avg_variance32x64_c,
  943. 12),
  944. SubpelAvgVarianceParams(5, 5,
  945. &vpx_highbd_12_sub_pixel_avg_variance32x32_c,
  946. 12),
  947. SubpelAvgVarianceParams(5, 4,
  948. &vpx_highbd_12_sub_pixel_avg_variance32x16_c,
  949. 12),
  950. SubpelAvgVarianceParams(4, 5,
  951. &vpx_highbd_12_sub_pixel_avg_variance16x32_c,
  952. 12),
  953. SubpelAvgVarianceParams(4, 4,
  954. &vpx_highbd_12_sub_pixel_avg_variance16x16_c,
  955. 12),
  956. SubpelAvgVarianceParams(4, 3,
  957. &vpx_highbd_12_sub_pixel_avg_variance16x8_c,
  958. 12),
  959. SubpelAvgVarianceParams(3, 4,
  960. &vpx_highbd_12_sub_pixel_avg_variance8x16_c,
  961. 12),
  962. SubpelAvgVarianceParams(3, 3,
  963. &vpx_highbd_12_sub_pixel_avg_variance8x8_c, 12),
  964. SubpelAvgVarianceParams(3, 2,
  965. &vpx_highbd_12_sub_pixel_avg_variance8x4_c, 12),
  966. SubpelAvgVarianceParams(2, 3,
  967. &vpx_highbd_12_sub_pixel_avg_variance4x8_c, 12),
  968. SubpelAvgVarianceParams(2, 2,
  969. &vpx_highbd_12_sub_pixel_avg_variance4x4_c,
  970. 12)));
  971. #endif // CONFIG_VP9_HIGHBITDEPTH
  972. #if HAVE_SSE2
  973. INSTANTIATE_TEST_CASE_P(SSE2, SumOfSquaresTest,
  974. ::testing::Values(vpx_get_mb_ss_sse2));
  975. INSTANTIATE_TEST_CASE_P(SSE2, VpxMseTest,
  976. ::testing::Values(MseParams(4, 4, &vpx_mse16x16_sse2),
  977. MseParams(4, 3, &vpx_mse16x8_sse2),
  978. MseParams(3, 4, &vpx_mse8x16_sse2),
  979. MseParams(3, 3, &vpx_mse8x8_sse2)));
  980. INSTANTIATE_TEST_CASE_P(
  981. SSE2, VpxVarianceTest,
  982. ::testing::Values(VarianceParams(6, 6, &vpx_variance64x64_sse2),
  983. VarianceParams(6, 5, &vpx_variance64x32_sse2),
  984. VarianceParams(5, 6, &vpx_variance32x64_sse2),
  985. VarianceParams(5, 5, &vpx_variance32x32_sse2),
  986. VarianceParams(5, 4, &vpx_variance32x16_sse2),
  987. VarianceParams(4, 5, &vpx_variance16x32_sse2),
  988. VarianceParams(4, 4, &vpx_variance16x16_sse2),
  989. VarianceParams(4, 3, &vpx_variance16x8_sse2),
  990. VarianceParams(3, 4, &vpx_variance8x16_sse2),
  991. VarianceParams(3, 3, &vpx_variance8x8_sse2),
  992. VarianceParams(3, 2, &vpx_variance8x4_sse2),
  993. VarianceParams(2, 3, &vpx_variance4x8_sse2),
  994. VarianceParams(2, 2, &vpx_variance4x4_sse2)));
  995. INSTANTIATE_TEST_CASE_P(
  996. SSE2, VpxSubpelVarianceTest,
  997. ::testing::Values(
  998. SubpelVarianceParams(6, 6, &vpx_sub_pixel_variance64x64_sse2, 0),
  999. SubpelVarianceParams(6, 5, &vpx_sub_pixel_variance64x32_sse2, 0),
  1000. SubpelVarianceParams(5, 6, &vpx_sub_pixel_variance32x64_sse2, 0),
  1001. SubpelVarianceParams(5, 5, &vpx_sub_pixel_variance32x32_sse2, 0),
  1002. SubpelVarianceParams(5, 4, &vpx_sub_pixel_variance32x16_sse2, 0),
  1003. SubpelVarianceParams(4, 5, &vpx_sub_pixel_variance16x32_sse2, 0),
  1004. SubpelVarianceParams(4, 4, &vpx_sub_pixel_variance16x16_sse2, 0),
  1005. SubpelVarianceParams(4, 3, &vpx_sub_pixel_variance16x8_sse2, 0),
  1006. SubpelVarianceParams(3, 4, &vpx_sub_pixel_variance8x16_sse2, 0),
  1007. SubpelVarianceParams(3, 3, &vpx_sub_pixel_variance8x8_sse2, 0),
  1008. SubpelVarianceParams(3, 2, &vpx_sub_pixel_variance8x4_sse2, 0),
  1009. SubpelVarianceParams(2, 3, &vpx_sub_pixel_variance4x8_sse2, 0),
  1010. SubpelVarianceParams(2, 2, &vpx_sub_pixel_variance4x4_sse2, 0)));
  1011. INSTANTIATE_TEST_CASE_P(
  1012. SSE2, VpxSubpelAvgVarianceTest,
  1013. ::testing::Values(
  1014. SubpelAvgVarianceParams(6, 6, &vpx_sub_pixel_avg_variance64x64_sse2, 0),
  1015. SubpelAvgVarianceParams(6, 5, &vpx_sub_pixel_avg_variance64x32_sse2, 0),
  1016. SubpelAvgVarianceParams(5, 6, &vpx_sub_pixel_avg_variance32x64_sse2, 0),
  1017. SubpelAvgVarianceParams(5, 5, &vpx_sub_pixel_avg_variance32x32_sse2, 0),
  1018. SubpelAvgVarianceParams(5, 4, &vpx_sub_pixel_avg_variance32x16_sse2, 0),
  1019. SubpelAvgVarianceParams(4, 5, &vpx_sub_pixel_avg_variance16x32_sse2, 0),
  1020. SubpelAvgVarianceParams(4, 4, &vpx_sub_pixel_avg_variance16x16_sse2, 0),
  1021. SubpelAvgVarianceParams(4, 3, &vpx_sub_pixel_avg_variance16x8_sse2, 0),
  1022. SubpelAvgVarianceParams(3, 4, &vpx_sub_pixel_avg_variance8x16_sse2, 0),
  1023. SubpelAvgVarianceParams(3, 3, &vpx_sub_pixel_avg_variance8x8_sse2, 0),
  1024. SubpelAvgVarianceParams(3, 2, &vpx_sub_pixel_avg_variance8x4_sse2, 0),
  1025. SubpelAvgVarianceParams(2, 3, &vpx_sub_pixel_avg_variance4x8_sse2, 0),
  1026. SubpelAvgVarianceParams(2, 2, &vpx_sub_pixel_avg_variance4x4_sse2, 0)));
  1027. #if CONFIG_VP9_HIGHBITDEPTH
  1028. /* TODO(debargha): This test does not support the highbd version
  1029. INSTANTIATE_TEST_CASE_P(
  1030. SSE2, VpxHBDMseTest,
  1031. ::testing::Values(MseParams(4, 4, &vpx_highbd_12_mse16x16_sse2),
  1032. MseParams(4, 3, &vpx_highbd_12_mse16x8_sse2),
  1033. MseParams(3, 4, &vpx_highbd_12_mse8x16_sse2),
  1034. MseParams(3, 3, &vpx_highbd_12_mse8x8_sse2),
  1035. MseParams(4, 4, &vpx_highbd_10_mse16x16_sse2),
  1036. MseParams(4, 3, &vpx_highbd_10_mse16x8_sse2),
  1037. MseParams(3, 4, &vpx_highbd_10_mse8x16_sse2),
  1038. MseParams(3, 3, &vpx_highbd_10_mse8x8_sse2),
  1039. MseParams(4, 4, &vpx_highbd_8_mse16x16_sse2),
  1040. MseParams(4, 3, &vpx_highbd_8_mse16x8_sse2),
  1041. MseParams(3, 4, &vpx_highbd_8_mse8x16_sse2),
  1042. MseParams(3, 3, &vpx_highbd_8_mse8x8_sse2)));
  1043. */
  1044. INSTANTIATE_TEST_CASE_P(
  1045. SSE2, VpxHBDVarianceTest,
  1046. ::testing::Values(
  1047. VarianceParams(6, 6, &vpx_highbd_12_variance64x64_sse2, 12),
  1048. VarianceParams(6, 5, &vpx_highbd_12_variance64x32_sse2, 12),
  1049. VarianceParams(5, 6, &vpx_highbd_12_variance32x64_sse2, 12),
  1050. VarianceParams(5, 5, &vpx_highbd_12_variance32x32_sse2, 12),
  1051. VarianceParams(5, 4, &vpx_highbd_12_variance32x16_sse2, 12),
  1052. VarianceParams(4, 5, &vpx_highbd_12_variance16x32_sse2, 12),
  1053. VarianceParams(4, 4, &vpx_highbd_12_variance16x16_sse2, 12),
  1054. VarianceParams(4, 3, &vpx_highbd_12_variance16x8_sse2, 12),
  1055. VarianceParams(3, 4, &vpx_highbd_12_variance8x16_sse2, 12),
  1056. VarianceParams(3, 3, &vpx_highbd_12_variance8x8_sse2, 12),
  1057. VarianceParams(6, 6, &vpx_highbd_10_variance64x64_sse2, 10),
  1058. VarianceParams(6, 5, &vpx_highbd_10_variance64x32_sse2, 10),
  1059. VarianceParams(5, 6, &vpx_highbd_10_variance32x64_sse2, 10),
  1060. VarianceParams(5, 5, &vpx_highbd_10_variance32x32_sse2, 10),
  1061. VarianceParams(5, 4, &vpx_highbd_10_variance32x16_sse2, 10),
  1062. VarianceParams(4, 5, &vpx_highbd_10_variance16x32_sse2, 10),
  1063. VarianceParams(4, 4, &vpx_highbd_10_variance16x16_sse2, 10),
  1064. VarianceParams(4, 3, &vpx_highbd_10_variance16x8_sse2, 10),
  1065. VarianceParams(3, 4, &vpx_highbd_10_variance8x16_sse2, 10),
  1066. VarianceParams(3, 3, &vpx_highbd_10_variance8x8_sse2, 10),
  1067. VarianceParams(6, 6, &vpx_highbd_8_variance64x64_sse2, 8),
  1068. VarianceParams(6, 5, &vpx_highbd_8_variance64x32_sse2, 8),
  1069. VarianceParams(5, 6, &vpx_highbd_8_variance32x64_sse2, 8),
  1070. VarianceParams(5, 5, &vpx_highbd_8_variance32x32_sse2, 8),
  1071. VarianceParams(5, 4, &vpx_highbd_8_variance32x16_sse2, 8),
  1072. VarianceParams(4, 5, &vpx_highbd_8_variance16x32_sse2, 8),
  1073. VarianceParams(4, 4, &vpx_highbd_8_variance16x16_sse2, 8),
  1074. VarianceParams(4, 3, &vpx_highbd_8_variance16x8_sse2, 8),
  1075. VarianceParams(3, 4, &vpx_highbd_8_variance8x16_sse2, 8),
  1076. VarianceParams(3, 3, &vpx_highbd_8_variance8x8_sse2, 8)));
  1077. INSTANTIATE_TEST_CASE_P(
  1078. SSE2, VpxHBDSubpelVarianceTest,
  1079. ::testing::Values(
  1080. SubpelVarianceParams(6, 6, &vpx_highbd_12_sub_pixel_variance64x64_sse2,
  1081. 12),
  1082. SubpelVarianceParams(6, 5, &vpx_highbd_12_sub_pixel_variance64x32_sse2,
  1083. 12),
  1084. SubpelVarianceParams(5, 6, &vpx_highbd_12_sub_pixel_variance32x64_sse2,
  1085. 12),
  1086. SubpelVarianceParams(5, 5, &vpx_highbd_12_sub_pixel_variance32x32_sse2,
  1087. 12),
  1088. SubpelVarianceParams(5, 4, &vpx_highbd_12_sub_pixel_variance32x16_sse2,
  1089. 12),
  1090. SubpelVarianceParams(4, 5, &vpx_highbd_12_sub_pixel_variance16x32_sse2,
  1091. 12),
  1092. SubpelVarianceParams(4, 4, &vpx_highbd_12_sub_pixel_variance16x16_sse2,
  1093. 12),
  1094. SubpelVarianceParams(4, 3, &vpx_highbd_12_sub_pixel_variance16x8_sse2,
  1095. 12),
  1096. SubpelVarianceParams(3, 4, &vpx_highbd_12_sub_pixel_variance8x16_sse2,
  1097. 12),
  1098. SubpelVarianceParams(3, 3, &vpx_highbd_12_sub_pixel_variance8x8_sse2,
  1099. 12),
  1100. SubpelVarianceParams(3, 2, &vpx_highbd_12_sub_pixel_variance8x4_sse2,
  1101. 12),
  1102. SubpelVarianceParams(6, 6, &vpx_highbd_10_sub_pixel_variance64x64_sse2,
  1103. 10),
  1104. SubpelVarianceParams(6, 5, &vpx_highbd_10_sub_pixel_variance64x32_sse2,
  1105. 10),
  1106. SubpelVarianceParams(5, 6, &vpx_highbd_10_sub_pixel_variance32x64_sse2,
  1107. 10),
  1108. SubpelVarianceParams(5, 5, &vpx_highbd_10_sub_pixel_variance32x32_sse2,
  1109. 10),
  1110. SubpelVarianceParams(5, 4, &vpx_highbd_10_sub_pixel_variance32x16_sse2,
  1111. 10),
  1112. SubpelVarianceParams(4, 5, &vpx_highbd_10_sub_pixel_variance16x32_sse2,
  1113. 10),
  1114. SubpelVarianceParams(4, 4, &vpx_highbd_10_sub_pixel_variance16x16_sse2,
  1115. 10),
  1116. SubpelVarianceParams(4, 3, &vpx_highbd_10_sub_pixel_variance16x8_sse2,
  1117. 10),
  1118. SubpelVarianceParams(3, 4, &vpx_highbd_10_sub_pixel_variance8x16_sse2,
  1119. 10),
  1120. SubpelVarianceParams(3, 3, &vpx_highbd_10_sub_pixel_variance8x8_sse2,
  1121. 10),
  1122. SubpelVarianceParams(3, 2, &vpx_highbd_10_sub_pixel_variance8x4_sse2,
  1123. 10),
  1124. SubpelVarianceParams(6, 6, &vpx_highbd_8_sub_pixel_variance64x64_sse2,
  1125. 8),
  1126. SubpelVarianceParams(6, 5, &vpx_highbd_8_sub_pixel_variance64x32_sse2,
  1127. 8),
  1128. SubpelVarianceParams(5, 6, &vpx_highbd_8_sub_pixel_variance32x64_sse2,
  1129. 8),
  1130. SubpelVarianceParams(5, 5, &vpx_highbd_8_sub_pixel_variance32x32_sse2,
  1131. 8),
  1132. SubpelVarianceParams(5, 4, &vpx_highbd_8_sub_pixel_variance32x16_sse2,
  1133. 8),
  1134. SubpelVarianceParams(4, 5, &vpx_highbd_8_sub_pixel_variance16x32_sse2,
  1135. 8),
  1136. SubpelVarianceParams(4, 4, &vpx_highbd_8_sub_pixel_variance16x16_sse2,
  1137. 8),
  1138. SubpelVarianceParams(4, 3, &vpx_highbd_8_sub_pixel_variance16x8_sse2,
  1139. 8),
  1140. SubpelVarianceParams(3, 4, &vpx_highbd_8_sub_pixel_variance8x16_sse2,
  1141. 8),
  1142. SubpelVarianceParams(3, 3, &vpx_highbd_8_sub_pixel_variance8x8_sse2, 8),
  1143. SubpelVarianceParams(3, 2, &vpx_highbd_8_sub_pixel_variance8x4_sse2,
  1144. 8)));
  1145. INSTANTIATE_TEST_CASE_P(
  1146. SSE2, VpxHBDSubpelAvgVarianceTest,
  1147. ::testing::Values(
  1148. SubpelAvgVarianceParams(6, 6,
  1149. &vpx_highbd_12_sub_pixel_avg_variance64x64_sse2,
  1150. 12),
  1151. SubpelAvgVarianceParams(6, 5,
  1152. &vpx_highbd_12_sub_pixel_avg_variance64x32_sse2,
  1153. 12),
  1154. SubpelAvgVarianceParams(5, 6,
  1155. &vpx_highbd_12_sub_pixel_avg_variance32x64_sse2,
  1156. 12),
  1157. SubpelAvgVarianceParams(5, 5,
  1158. &vpx_highbd_12_sub_pixel_avg_variance32x32_sse2,
  1159. 12),
  1160. SubpelAvgVarianceParams(5, 4,
  1161. &vpx_highbd_12_sub_pixel_avg_variance32x16_sse2,
  1162. 12),
  1163. SubpelAvgVarianceParams(4, 5,
  1164. &vpx_highbd_12_sub_pixel_avg_variance16x32_sse2,
  1165. 12),
  1166. SubpelAvgVarianceParams(4, 4,
  1167. &vpx_highbd_12_sub_pixel_avg_variance16x16_sse2,
  1168. 12),
  1169. SubpelAvgVarianceParams(4, 3,
  1170. &vpx_highbd_12_sub_pixel_avg_variance16x8_sse2,
  1171. 12),
  1172. SubpelAvgVarianceParams(3, 4,
  1173. &vpx_highbd_12_sub_pixel_avg_variance8x16_sse2,
  1174. 12),
  1175. SubpelAvgVarianceParams(3, 3,
  1176. &vpx_highbd_12_sub_pixel_avg_variance8x8_sse2,
  1177. 12),
  1178. SubpelAvgVarianceParams(3, 2,
  1179. &vpx_highbd_12_sub_pixel_avg_variance8x4_sse2,
  1180. 12),
  1181. SubpelAvgVarianceParams(6, 6,
  1182. &vpx_highbd_10_sub_pixel_avg_variance64x64_sse2,
  1183. 10),
  1184. SubpelAvgVarianceParams(6, 5,
  1185. &vpx_highbd_10_sub_pixel_avg_variance64x32_sse2,
  1186. 10),
  1187. SubpelAvgVarianceParams(5, 6,
  1188. &vpx_highbd_10_sub_pixel_avg_variance32x64_sse2,
  1189. 10),
  1190. SubpelAvgVarianceParams(5, 5,
  1191. &vpx_highbd_10_sub_pixel_avg_variance32x32_sse2,
  1192. 10),
  1193. SubpelAvgVarianceParams(5, 4,
  1194. &vpx_highbd_10_sub_pixel_avg_variance32x16_sse2,
  1195. 10),
  1196. SubpelAvgVarianceParams(4, 5,
  1197. &vpx_highbd_10_sub_pixel_avg_variance16x32_sse2,
  1198. 10),
  1199. SubpelAvgVarianceParams(4, 4,
  1200. &vpx_highbd_10_sub_pixel_avg_variance16x16_sse2,
  1201. 10),
  1202. SubpelAvgVarianceParams(4, 3,
  1203. &vpx_highbd_10_sub_pixel_avg_variance16x8_sse2,
  1204. 10),
  1205. SubpelAvgVarianceParams(3, 4,
  1206. &vpx_highbd_10_sub_pixel_avg_variance8x16_sse2,
  1207. 10),
  1208. SubpelAvgVarianceParams(3, 3,
  1209. &vpx_highbd_10_sub_pixel_avg_variance8x8_sse2,
  1210. 10),
  1211. SubpelAvgVarianceParams(3, 2,
  1212. &vpx_highbd_10_sub_pixel_avg_variance8x4_sse2,
  1213. 10),
  1214. SubpelAvgVarianceParams(6, 6,
  1215. &vpx_highbd_8_sub_pixel_avg_variance64x64_sse2,
  1216. 8),
  1217. SubpelAvgVarianceParams(6, 5,
  1218. &vpx_highbd_8_sub_pixel_avg_variance64x32_sse2,
  1219. 8),
  1220. SubpelAvgVarianceParams(5, 6,
  1221. &vpx_highbd_8_sub_pixel_avg_variance32x64_sse2,
  1222. 8),
  1223. SubpelAvgVarianceParams(5, 5,
  1224. &vpx_highbd_8_sub_pixel_avg_variance32x32_sse2,
  1225. 8),
  1226. SubpelAvgVarianceParams(5, 4,
  1227. &vpx_highbd_8_sub_pixel_avg_variance32x16_sse2,
  1228. 8),
  1229. SubpelAvgVarianceParams(4, 5,
  1230. &vpx_highbd_8_sub_pixel_avg_variance16x32_sse2,
  1231. 8),
  1232. SubpelAvgVarianceParams(4, 4,
  1233. &vpx_highbd_8_sub_pixel_avg_variance16x16_sse2,
  1234. 8),
  1235. SubpelAvgVarianceParams(4, 3,
  1236. &vpx_highbd_8_sub_pixel_avg_variance16x8_sse2,
  1237. 8),
  1238. SubpelAvgVarianceParams(3, 4,
  1239. &vpx_highbd_8_sub_pixel_avg_variance8x16_sse2,
  1240. 8),
  1241. SubpelAvgVarianceParams(3, 3,
  1242. &vpx_highbd_8_sub_pixel_avg_variance8x8_sse2,
  1243. 8),
  1244. SubpelAvgVarianceParams(3, 2,
  1245. &vpx_highbd_8_sub_pixel_avg_variance8x4_sse2,
  1246. 8)));
  1247. #endif // CONFIG_VP9_HIGHBITDEPTH
  1248. #endif // HAVE_SSE2
  1249. #if HAVE_SSSE3
  1250. INSTANTIATE_TEST_CASE_P(
  1251. SSSE3, VpxSubpelVarianceTest,
  1252. ::testing::Values(
  1253. SubpelVarianceParams(6, 6, &vpx_sub_pixel_variance64x64_ssse3, 0),
  1254. SubpelVarianceParams(6, 5, &vpx_sub_pixel_variance64x32_ssse3, 0),
  1255. SubpelVarianceParams(5, 6, &vpx_sub_pixel_variance32x64_ssse3, 0),
  1256. SubpelVarianceParams(5, 5, &vpx_sub_pixel_variance32x32_ssse3, 0),
  1257. SubpelVarianceParams(5, 4, &vpx_sub_pixel_variance32x16_ssse3, 0),
  1258. SubpelVarianceParams(4, 5, &vpx_sub_pixel_variance16x32_ssse3, 0),
  1259. SubpelVarianceParams(4, 4, &vpx_sub_pixel_variance16x16_ssse3, 0),
  1260. SubpelVarianceParams(4, 3, &vpx_sub_pixel_variance16x8_ssse3, 0),
  1261. SubpelVarianceParams(3, 4, &vpx_sub_pixel_variance8x16_ssse3, 0),
  1262. SubpelVarianceParams(3, 3, &vpx_sub_pixel_variance8x8_ssse3, 0),
  1263. SubpelVarianceParams(3, 2, &vpx_sub_pixel_variance8x4_ssse3, 0),
  1264. SubpelVarianceParams(2, 3, &vpx_sub_pixel_variance4x8_ssse3, 0),
  1265. SubpelVarianceParams(2, 2, &vpx_sub_pixel_variance4x4_ssse3, 0)));
  1266. INSTANTIATE_TEST_CASE_P(
  1267. SSSE3, VpxSubpelAvgVarianceTest,
  1268. ::testing::Values(
  1269. SubpelAvgVarianceParams(6, 6, &vpx_sub_pixel_avg_variance64x64_ssse3,
  1270. 0),
  1271. SubpelAvgVarianceParams(6, 5, &vpx_sub_pixel_avg_variance64x32_ssse3,
  1272. 0),
  1273. SubpelAvgVarianceParams(5, 6, &vpx_sub_pixel_avg_variance32x64_ssse3,
  1274. 0),
  1275. SubpelAvgVarianceParams(5, 5, &vpx_sub_pixel_avg_variance32x32_ssse3,
  1276. 0),
  1277. SubpelAvgVarianceParams(5, 4, &vpx_sub_pixel_avg_variance32x16_ssse3,
  1278. 0),
  1279. SubpelAvgVarianceParams(4, 5, &vpx_sub_pixel_avg_variance16x32_ssse3,
  1280. 0),
  1281. SubpelAvgVarianceParams(4, 4, &vpx_sub_pixel_avg_variance16x16_ssse3,
  1282. 0),
  1283. SubpelAvgVarianceParams(4, 3, &vpx_sub_pixel_avg_variance16x8_ssse3, 0),
  1284. SubpelAvgVarianceParams(3, 4, &vpx_sub_pixel_avg_variance8x16_ssse3, 0),
  1285. SubpelAvgVarianceParams(3, 3, &vpx_sub_pixel_avg_variance8x8_ssse3, 0),
  1286. SubpelAvgVarianceParams(3, 2, &vpx_sub_pixel_avg_variance8x4_ssse3, 0),
  1287. SubpelAvgVarianceParams(2, 3, &vpx_sub_pixel_avg_variance4x8_ssse3, 0),
  1288. SubpelAvgVarianceParams(2, 2, &vpx_sub_pixel_avg_variance4x4_ssse3,
  1289. 0)));
  1290. #endif // HAVE_SSSE3
  1291. #if HAVE_AVX2
  1292. INSTANTIATE_TEST_CASE_P(AVX2, VpxMseTest,
  1293. ::testing::Values(MseParams(4, 4, &vpx_mse16x16_avx2),
  1294. MseParams(4, 3, &vpx_mse16x8_avx2)));
  1295. INSTANTIATE_TEST_CASE_P(
  1296. AVX2, VpxVarianceTest,
  1297. ::testing::Values(VarianceParams(6, 6, &vpx_variance64x64_avx2),
  1298. VarianceParams(6, 5, &vpx_variance64x32_avx2),
  1299. VarianceParams(5, 6, &vpx_variance32x64_avx2),
  1300. VarianceParams(5, 5, &vpx_variance32x32_avx2),
  1301. VarianceParams(5, 4, &vpx_variance32x16_avx2),
  1302. VarianceParams(4, 5, &vpx_variance16x32_avx2),
  1303. VarianceParams(4, 4, &vpx_variance16x16_avx2),
  1304. VarianceParams(4, 3, &vpx_variance16x8_avx2)));
  1305. INSTANTIATE_TEST_CASE_P(
  1306. AVX2, VpxSubpelVarianceTest,
  1307. ::testing::Values(
  1308. SubpelVarianceParams(6, 6, &vpx_sub_pixel_variance64x64_avx2, 0),
  1309. SubpelVarianceParams(5, 5, &vpx_sub_pixel_variance32x32_avx2, 0)));
  1310. INSTANTIATE_TEST_CASE_P(
  1311. AVX2, VpxSubpelAvgVarianceTest,
  1312. ::testing::Values(
  1313. SubpelAvgVarianceParams(6, 6, &vpx_sub_pixel_avg_variance64x64_avx2, 0),
  1314. SubpelAvgVarianceParams(5, 5, &vpx_sub_pixel_avg_variance32x32_avx2,
  1315. 0)));
  1316. #endif // HAVE_AVX2
  1317. #if HAVE_NEON
  1318. INSTANTIATE_TEST_CASE_P(NEON, VpxSseTest,
  1319. ::testing::Values(SseParams(2, 2,
  1320. &vpx_get4x4sse_cs_neon)));
  1321. INSTANTIATE_TEST_CASE_P(NEON, VpxMseTest,
  1322. ::testing::Values(MseParams(4, 4, &vpx_mse16x16_neon)));
  1323. INSTANTIATE_TEST_CASE_P(
  1324. NEON, VpxVarianceTest,
  1325. ::testing::Values(VarianceParams(6, 6, &vpx_variance64x64_neon),
  1326. VarianceParams(6, 5, &vpx_variance64x32_neon),
  1327. VarianceParams(5, 6, &vpx_variance32x64_neon),
  1328. VarianceParams(5, 5, &vpx_variance32x32_neon),
  1329. VarianceParams(5, 4, &vpx_variance32x16_neon),
  1330. VarianceParams(4, 5, &vpx_variance16x32_neon),
  1331. VarianceParams(4, 4, &vpx_variance16x16_neon),
  1332. VarianceParams(4, 3, &vpx_variance16x8_neon),
  1333. VarianceParams(3, 4, &vpx_variance8x16_neon),
  1334. VarianceParams(3, 3, &vpx_variance8x8_neon),
  1335. VarianceParams(3, 2, &vpx_variance8x4_neon),
  1336. VarianceParams(2, 3, &vpx_variance4x8_neon),
  1337. VarianceParams(2, 2, &vpx_variance4x4_neon)));
  1338. INSTANTIATE_TEST_CASE_P(
  1339. NEON, VpxSubpelVarianceTest,
  1340. ::testing::Values(
  1341. SubpelVarianceParams(6, 6, &vpx_sub_pixel_variance64x64_neon, 0),
  1342. SubpelVarianceParams(6, 5, &vpx_sub_pixel_variance64x32_neon, 0),
  1343. SubpelVarianceParams(5, 6, &vpx_sub_pixel_variance32x64_neon, 0),
  1344. SubpelVarianceParams(5, 5, &vpx_sub_pixel_variance32x32_neon, 0),
  1345. SubpelVarianceParams(5, 4, &vpx_sub_pixel_variance32x16_neon, 0),
  1346. SubpelVarianceParams(4, 5, &vpx_sub_pixel_variance16x32_neon, 0),
  1347. SubpelVarianceParams(4, 4, &vpx_sub_pixel_variance16x16_neon, 0),
  1348. SubpelVarianceParams(4, 3, &vpx_sub_pixel_variance16x8_neon, 0),
  1349. SubpelVarianceParams(3, 4, &vpx_sub_pixel_variance8x16_neon, 0),
  1350. SubpelVarianceParams(3, 3, &vpx_sub_pixel_variance8x8_neon, 0),
  1351. SubpelVarianceParams(3, 2, &vpx_sub_pixel_variance8x4_neon, 0),
  1352. SubpelVarianceParams(2, 3, &vpx_sub_pixel_variance4x8_neon, 0),
  1353. SubpelVarianceParams(2, 2, &vpx_sub_pixel_variance4x4_neon, 0)));
  1354. INSTANTIATE_TEST_CASE_P(
  1355. NEON, VpxSubpelAvgVarianceTest,
  1356. ::testing::Values(
  1357. SubpelAvgVarianceParams(6, 6, &vpx_sub_pixel_avg_variance64x64_neon, 0),
  1358. SubpelAvgVarianceParams(6, 5, &vpx_sub_pixel_avg_variance64x32_neon, 0),
  1359. SubpelAvgVarianceParams(5, 6, &vpx_sub_pixel_avg_variance32x64_neon, 0),
  1360. SubpelAvgVarianceParams(5, 5, &vpx_sub_pixel_avg_variance32x32_neon, 0),
  1361. SubpelAvgVarianceParams(5, 4, &vpx_sub_pixel_avg_variance32x16_neon, 0),
  1362. SubpelAvgVarianceParams(4, 5, &vpx_sub_pixel_avg_variance16x32_neon, 0),
  1363. SubpelAvgVarianceParams(4, 4, &vpx_sub_pixel_avg_variance16x16_neon, 0),
  1364. SubpelAvgVarianceParams(4, 3, &vpx_sub_pixel_avg_variance16x8_neon, 0),
  1365. SubpelAvgVarianceParams(3, 4, &vpx_sub_pixel_avg_variance8x16_neon, 0),
  1366. SubpelAvgVarianceParams(3, 3, &vpx_sub_pixel_avg_variance8x8_neon, 0),
  1367. SubpelAvgVarianceParams(3, 2, &vpx_sub_pixel_avg_variance8x4_neon, 0),
  1368. SubpelAvgVarianceParams(2, 3, &vpx_sub_pixel_avg_variance4x8_neon, 0),
  1369. SubpelAvgVarianceParams(2, 2, &vpx_sub_pixel_avg_variance4x4_neon, 0)));
  1370. #endif // HAVE_NEON
  1371. #if HAVE_MSA
  1372. INSTANTIATE_TEST_CASE_P(MSA, SumOfSquaresTest,
  1373. ::testing::Values(vpx_get_mb_ss_msa));
  1374. INSTANTIATE_TEST_CASE_P(MSA, VpxSseTest,
  1375. ::testing::Values(SseParams(2, 2,
  1376. &vpx_get4x4sse_cs_msa)));
  1377. INSTANTIATE_TEST_CASE_P(MSA, VpxMseTest,
  1378. ::testing::Values(MseParams(4, 4, &vpx_mse16x16_msa),
  1379. MseParams(4, 3, &vpx_mse16x8_msa),
  1380. MseParams(3, 4, &vpx_mse8x16_msa),
  1381. MseParams(3, 3, &vpx_mse8x8_msa)));
  1382. INSTANTIATE_TEST_CASE_P(
  1383. MSA, VpxVarianceTest,
  1384. ::testing::Values(VarianceParams(6, 6, &vpx_variance64x64_msa),
  1385. VarianceParams(6, 5, &vpx_variance64x32_msa),
  1386. VarianceParams(5, 6, &vpx_variance32x64_msa),
  1387. VarianceParams(5, 5, &vpx_variance32x32_msa),
  1388. VarianceParams(5, 4, &vpx_variance32x16_msa),
  1389. VarianceParams(4, 5, &vpx_variance16x32_msa),
  1390. VarianceParams(4, 4, &vpx_variance16x16_msa),
  1391. VarianceParams(4, 3, &vpx_variance16x8_msa),
  1392. VarianceParams(3, 4, &vpx_variance8x16_msa),
  1393. VarianceParams(3, 3, &vpx_variance8x8_msa),
  1394. VarianceParams(3, 2, &vpx_variance8x4_msa),
  1395. VarianceParams(2, 3, &vpx_variance4x8_msa),
  1396. VarianceParams(2, 2, &vpx_variance4x4_msa)));
  1397. INSTANTIATE_TEST_CASE_P(
  1398. MSA, VpxSubpelVarianceTest,
  1399. ::testing::Values(
  1400. SubpelVarianceParams(2, 2, &vpx_sub_pixel_variance4x4_msa, 0),
  1401. SubpelVarianceParams(2, 3, &vpx_sub_pixel_variance4x8_msa, 0),
  1402. SubpelVarianceParams(3, 2, &vpx_sub_pixel_variance8x4_msa, 0),
  1403. SubpelVarianceParams(3, 3, &vpx_sub_pixel_variance8x8_msa, 0),
  1404. SubpelVarianceParams(3, 4, &vpx_sub_pixel_variance8x16_msa, 0),
  1405. SubpelVarianceParams(4, 3, &vpx_sub_pixel_variance16x8_msa, 0),
  1406. SubpelVarianceParams(4, 4, &vpx_sub_pixel_variance16x16_msa, 0),
  1407. SubpelVarianceParams(4, 5, &vpx_sub_pixel_variance16x32_msa, 0),
  1408. SubpelVarianceParams(5, 4, &vpx_sub_pixel_variance32x16_msa, 0),
  1409. SubpelVarianceParams(5, 5, &vpx_sub_pixel_variance32x32_msa, 0),
  1410. SubpelVarianceParams(5, 6, &vpx_sub_pixel_variance32x64_msa, 0),
  1411. SubpelVarianceParams(6, 5, &vpx_sub_pixel_variance64x32_msa, 0),
  1412. SubpelVarianceParams(6, 6, &vpx_sub_pixel_variance64x64_msa, 0)));
  1413. INSTANTIATE_TEST_CASE_P(
  1414. MSA, VpxSubpelAvgVarianceTest,
  1415. ::testing::Values(
  1416. SubpelAvgVarianceParams(6, 6, &vpx_sub_pixel_avg_variance64x64_msa, 0),
  1417. SubpelAvgVarianceParams(6, 5, &vpx_sub_pixel_avg_variance64x32_msa, 0),
  1418. SubpelAvgVarianceParams(5, 6, &vpx_sub_pixel_avg_variance32x64_msa, 0),
  1419. SubpelAvgVarianceParams(5, 5, &vpx_sub_pixel_avg_variance32x32_msa, 0),
  1420. SubpelAvgVarianceParams(5, 4, &vpx_sub_pixel_avg_variance32x16_msa, 0),
  1421. SubpelAvgVarianceParams(4, 5, &vpx_sub_pixel_avg_variance16x32_msa, 0),
  1422. SubpelAvgVarianceParams(4, 4, &vpx_sub_pixel_avg_variance16x16_msa, 0),
  1423. SubpelAvgVarianceParams(4, 3, &vpx_sub_pixel_avg_variance16x8_msa, 0),
  1424. SubpelAvgVarianceParams(3, 4, &vpx_sub_pixel_avg_variance8x16_msa, 0),
  1425. SubpelAvgVarianceParams(3, 3, &vpx_sub_pixel_avg_variance8x8_msa, 0),
  1426. SubpelAvgVarianceParams(3, 2, &vpx_sub_pixel_avg_variance8x4_msa, 0),
  1427. SubpelAvgVarianceParams(2, 3, &vpx_sub_pixel_avg_variance4x8_msa, 0),
  1428. SubpelAvgVarianceParams(2, 2, &vpx_sub_pixel_avg_variance4x4_msa, 0)));
  1429. #endif // HAVE_MSA
  1430. #if HAVE_VSX
  1431. INSTANTIATE_TEST_CASE_P(VSX, SumOfSquaresTest,
  1432. ::testing::Values(vpx_get_mb_ss_vsx));
  1433. INSTANTIATE_TEST_CASE_P(VSX, VpxSseTest,
  1434. ::testing::Values(SseParams(2, 2,
  1435. &vpx_get4x4sse_cs_vsx)));
  1436. INSTANTIATE_TEST_CASE_P(VSX, VpxMseTest,
  1437. ::testing::Values(MseParams(4, 4, &vpx_mse16x16_vsx),
  1438. MseParams(4, 3, &vpx_mse16x8_vsx),
  1439. MseParams(3, 4, &vpx_mse8x16_vsx),
  1440. MseParams(3, 3, &vpx_mse8x8_vsx)));
  1441. INSTANTIATE_TEST_CASE_P(
  1442. VSX, VpxVarianceTest,
  1443. ::testing::Values(VarianceParams(6, 6, &vpx_variance64x64_vsx),
  1444. VarianceParams(6, 5, &vpx_variance64x32_vsx),
  1445. VarianceParams(5, 6, &vpx_variance32x64_vsx),
  1446. VarianceParams(5, 5, &vpx_variance32x32_vsx),
  1447. VarianceParams(5, 4, &vpx_variance32x16_vsx),
  1448. VarianceParams(4, 5, &vpx_variance16x32_vsx),
  1449. VarianceParams(4, 4, &vpx_variance16x16_vsx),
  1450. VarianceParams(4, 3, &vpx_variance16x8_vsx),
  1451. VarianceParams(3, 4, &vpx_variance8x16_vsx),
  1452. VarianceParams(3, 3, &vpx_variance8x8_vsx),
  1453. VarianceParams(3, 2, &vpx_variance8x4_vsx),
  1454. VarianceParams(2, 3, &vpx_variance4x8_vsx),
  1455. VarianceParams(2, 2, &vpx_variance4x4_vsx)));
  1456. #endif // HAVE_VSX
  1457. #if HAVE_MMI
  1458. INSTANTIATE_TEST_CASE_P(MMI, VpxMseTest,
  1459. ::testing::Values(MseParams(4, 4, &vpx_mse16x16_mmi),
  1460. MseParams(4, 3, &vpx_mse16x8_mmi),
  1461. MseParams(3, 4, &vpx_mse8x16_mmi),
  1462. MseParams(3, 3, &vpx_mse8x8_mmi)));
  1463. INSTANTIATE_TEST_CASE_P(
  1464. MMI, VpxVarianceTest,
  1465. ::testing::Values(VarianceParams(6, 6, &vpx_variance64x64_mmi),
  1466. VarianceParams(6, 5, &vpx_variance64x32_mmi),
  1467. VarianceParams(5, 6, &vpx_variance32x64_mmi),
  1468. VarianceParams(5, 5, &vpx_variance32x32_mmi),
  1469. VarianceParams(5, 4, &vpx_variance32x16_mmi),
  1470. VarianceParams(4, 5, &vpx_variance16x32_mmi),
  1471. VarianceParams(4, 4, &vpx_variance16x16_mmi),
  1472. VarianceParams(4, 3, &vpx_variance16x8_mmi),
  1473. VarianceParams(3, 4, &vpx_variance8x16_mmi),
  1474. VarianceParams(3, 3, &vpx_variance8x8_mmi),
  1475. VarianceParams(3, 2, &vpx_variance8x4_mmi),
  1476. VarianceParams(2, 3, &vpx_variance4x8_mmi),
  1477. VarianceParams(2, 2, &vpx_variance4x4_mmi)));
  1478. INSTANTIATE_TEST_CASE_P(
  1479. MMI, VpxSubpelVarianceTest,
  1480. ::testing::Values(
  1481. SubpelVarianceParams(6, 6, &vpx_sub_pixel_variance64x64_mmi, 0),
  1482. SubpelVarianceParams(6, 5, &vpx_sub_pixel_variance64x32_mmi, 0),
  1483. SubpelVarianceParams(5, 6, &vpx_sub_pixel_variance32x64_mmi, 0),
  1484. SubpelVarianceParams(5, 5, &vpx_sub_pixel_variance32x32_mmi, 0),
  1485. SubpelVarianceParams(5, 4, &vpx_sub_pixel_variance32x16_mmi, 0),
  1486. SubpelVarianceParams(4, 5, &vpx_sub_pixel_variance16x32_mmi, 0),
  1487. SubpelVarianceParams(4, 4, &vpx_sub_pixel_variance16x16_mmi, 0),
  1488. SubpelVarianceParams(4, 3, &vpx_sub_pixel_variance16x8_mmi, 0),
  1489. SubpelVarianceParams(3, 4, &vpx_sub_pixel_variance8x16_mmi, 0),
  1490. SubpelVarianceParams(3, 3, &vpx_sub_pixel_variance8x8_mmi, 0),
  1491. SubpelVarianceParams(3, 2, &vpx_sub_pixel_variance8x4_mmi, 0),
  1492. SubpelVarianceParams(2, 3, &vpx_sub_pixel_variance4x8_mmi, 0),
  1493. SubpelVarianceParams(2, 2, &vpx_sub_pixel_variance4x4_mmi, 0)));
  1494. INSTANTIATE_TEST_CASE_P(
  1495. MMI, VpxSubpelAvgVarianceTest,
  1496. ::testing::Values(
  1497. SubpelAvgVarianceParams(6, 6, &vpx_sub_pixel_avg_variance64x64_mmi, 0),
  1498. SubpelAvgVarianceParams(6, 5, &vpx_sub_pixel_avg_variance64x32_mmi, 0),
  1499. SubpelAvgVarianceParams(5, 6, &vpx_sub_pixel_avg_variance32x64_mmi, 0),
  1500. SubpelAvgVarianceParams(5, 5, &vpx_sub_pixel_avg_variance32x32_mmi, 0),
  1501. SubpelAvgVarianceParams(5, 4, &vpx_sub_pixel_avg_variance32x16_mmi, 0),
  1502. SubpelAvgVarianceParams(4, 5, &vpx_sub_pixel_avg_variance16x32_mmi, 0),
  1503. SubpelAvgVarianceParams(4, 4, &vpx_sub_pixel_avg_variance16x16_mmi, 0),
  1504. SubpelAvgVarianceParams(4, 3, &vpx_sub_pixel_avg_variance16x8_mmi, 0),
  1505. SubpelAvgVarianceParams(3, 4, &vpx_sub_pixel_avg_variance8x16_mmi, 0),
  1506. SubpelAvgVarianceParams(3, 3, &vpx_sub_pixel_avg_variance8x8_mmi, 0),
  1507. SubpelAvgVarianceParams(3, 2, &vpx_sub_pixel_avg_variance8x4_mmi, 0),
  1508. SubpelAvgVarianceParams(2, 3, &vpx_sub_pixel_avg_variance4x8_mmi, 0),
  1509. SubpelAvgVarianceParams(2, 2, &vpx_sub_pixel_avg_variance4x4_mmi, 0)));
  1510. #endif // HAVE_MMI
  1511. } // namespace