123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617 |
- /*
- * Copyright (c) 2012 The WebM project authors. All Rights Reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
- #include <cstdlib>
- #include <new>
- #include "third_party/googletest/src/include/gtest/gtest.h"
- #include "./vpx_config.h"
- #include "./vpx_dsp_rtcd.h"
- #include "test/acm_random.h"
- #include "test/clear_system_state.h"
- #include "test/register_state_check.h"
- #include "vpx/vpx_codec.h"
- #include "vpx/vpx_integer.h"
- #include "vpx_dsp/variance.h"
- #include "vpx_mem/vpx_mem.h"
- #include "vpx_ports/mem.h"
- #include "vpx_ports/vpx_timer.h"
- namespace {
- typedef unsigned int (*Get4x4SseFunc)(const uint8_t *a, int a_stride,
- const uint8_t *b, int b_stride);
- typedef unsigned int (*SumOfSquaresFunction)(const int16_t *src);
- using libvpx_test::ACMRandom;
- // Truncate high bit depth results by downshifting (with rounding) by:
- // 2 * (bit_depth - 8) for sse
- // (bit_depth - 8) for se
- static void RoundHighBitDepth(int bit_depth, int64_t *se, uint64_t *sse) {
- switch (bit_depth) {
- case VPX_BITS_12:
- *sse = (*sse + 128) >> 8;
- *se = (*se + 8) >> 4;
- break;
- case VPX_BITS_10:
- *sse = (*sse + 8) >> 4;
- *se = (*se + 2) >> 2;
- break;
- case VPX_BITS_8:
- default: break;
- }
- }
- static unsigned int mb_ss_ref(const int16_t *src) {
- unsigned int res = 0;
- for (int i = 0; i < 256; ++i) {
- res += src[i] * src[i];
- }
- return res;
- }
- /* Note:
- * Our codebase calculates the "diff" value in the variance algorithm by
- * (src - ref).
- */
- static uint32_t variance_ref(const uint8_t *src, const uint8_t *ref, int l2w,
- int l2h, int src_stride, int ref_stride,
- uint32_t *sse_ptr, bool use_high_bit_depth_,
- vpx_bit_depth_t bit_depth) {
- int64_t se = 0;
- uint64_t sse = 0;
- const int w = 1 << l2w;
- const int h = 1 << l2h;
- for (int y = 0; y < h; y++) {
- for (int x = 0; x < w; x++) {
- int diff;
- if (!use_high_bit_depth_) {
- diff = src[y * src_stride + x] - ref[y * ref_stride + x];
- se += diff;
- sse += diff * diff;
- #if CONFIG_VP9_HIGHBITDEPTH
- } else {
- diff = CONVERT_TO_SHORTPTR(src)[y * src_stride + x] -
- CONVERT_TO_SHORTPTR(ref)[y * ref_stride + x];
- se += diff;
- sse += diff * diff;
- #endif // CONFIG_VP9_HIGHBITDEPTH
- }
- }
- }
- RoundHighBitDepth(bit_depth, &se, &sse);
- *sse_ptr = static_cast<uint32_t>(sse);
- return static_cast<uint32_t>(
- sse - ((static_cast<int64_t>(se) * se) >> (l2w + l2h)));
- }
- /* The subpel reference functions differ from the codec version in one aspect:
- * they calculate the bilinear factors directly instead of using a lookup table
- * and therefore upshift xoff and yoff by 1. Only every other calculated value
- * is used so the codec version shrinks the table to save space and maintain
- * compatibility with vp8.
- */
- static uint32_t subpel_variance_ref(const uint8_t *ref, const uint8_t *src,
- int l2w, int l2h, int xoff, int yoff,
- uint32_t *sse_ptr, bool use_high_bit_depth_,
- vpx_bit_depth_t bit_depth) {
- int64_t se = 0;
- uint64_t sse = 0;
- const int w = 1 << l2w;
- const int h = 1 << l2h;
- xoff <<= 1;
- yoff <<= 1;
- for (int y = 0; y < h; y++) {
- for (int x = 0; x < w; x++) {
- // Bilinear interpolation at a 16th pel step.
- if (!use_high_bit_depth_) {
- const int a1 = ref[(w + 1) * (y + 0) + x + 0];
- const int a2 = ref[(w + 1) * (y + 0) + x + 1];
- const int b1 = ref[(w + 1) * (y + 1) + x + 0];
- const int b2 = ref[(w + 1) * (y + 1) + x + 1];
- const int a = a1 + (((a2 - a1) * xoff + 8) >> 4);
- const int b = b1 + (((b2 - b1) * xoff + 8) >> 4);
- const int r = a + (((b - a) * yoff + 8) >> 4);
- const int diff = r - src[w * y + x];
- se += diff;
- sse += diff * diff;
- #if CONFIG_VP9_HIGHBITDEPTH
- } else {
- uint16_t *ref16 = CONVERT_TO_SHORTPTR(ref);
- uint16_t *src16 = CONVERT_TO_SHORTPTR(src);
- const int a1 = ref16[(w + 1) * (y + 0) + x + 0];
- const int a2 = ref16[(w + 1) * (y + 0) + x + 1];
- const int b1 = ref16[(w + 1) * (y + 1) + x + 0];
- const int b2 = ref16[(w + 1) * (y + 1) + x + 1];
- const int a = a1 + (((a2 - a1) * xoff + 8) >> 4);
- const int b = b1 + (((b2 - b1) * xoff + 8) >> 4);
- const int r = a + (((b - a) * yoff + 8) >> 4);
- const int diff = r - src16[w * y + x];
- se += diff;
- sse += diff * diff;
- #endif // CONFIG_VP9_HIGHBITDEPTH
- }
- }
- }
- RoundHighBitDepth(bit_depth, &se, &sse);
- *sse_ptr = static_cast<uint32_t>(sse);
- return static_cast<uint32_t>(
- sse - ((static_cast<int64_t>(se) * se) >> (l2w + l2h)));
- }
- static uint32_t subpel_avg_variance_ref(const uint8_t *ref, const uint8_t *src,
- const uint8_t *second_pred, int l2w,
- int l2h, int xoff, int yoff,
- uint32_t *sse_ptr,
- bool use_high_bit_depth,
- vpx_bit_depth_t bit_depth) {
- int64_t se = 0;
- uint64_t sse = 0;
- const int w = 1 << l2w;
- const int h = 1 << l2h;
- xoff <<= 1;
- yoff <<= 1;
- for (int y = 0; y < h; y++) {
- for (int x = 0; x < w; x++) {
- // bilinear interpolation at a 16th pel step
- if (!use_high_bit_depth) {
- const int a1 = ref[(w + 1) * (y + 0) + x + 0];
- const int a2 = ref[(w + 1) * (y + 0) + x + 1];
- const int b1 = ref[(w + 1) * (y + 1) + x + 0];
- const int b2 = ref[(w + 1) * (y + 1) + x + 1];
- const int a = a1 + (((a2 - a1) * xoff + 8) >> 4);
- const int b = b1 + (((b2 - b1) * xoff + 8) >> 4);
- const int r = a + (((b - a) * yoff + 8) >> 4);
- const int diff =
- ((r + second_pred[w * y + x] + 1) >> 1) - src[w * y + x];
- se += diff;
- sse += diff * diff;
- #if CONFIG_VP9_HIGHBITDEPTH
- } else {
- const uint16_t *ref16 = CONVERT_TO_SHORTPTR(ref);
- const uint16_t *src16 = CONVERT_TO_SHORTPTR(src);
- const uint16_t *sec16 = CONVERT_TO_SHORTPTR(second_pred);
- const int a1 = ref16[(w + 1) * (y + 0) + x + 0];
- const int a2 = ref16[(w + 1) * (y + 0) + x + 1];
- const int b1 = ref16[(w + 1) * (y + 1) + x + 0];
- const int b2 = ref16[(w + 1) * (y + 1) + x + 1];
- const int a = a1 + (((a2 - a1) * xoff + 8) >> 4);
- const int b = b1 + (((b2 - b1) * xoff + 8) >> 4);
- const int r = a + (((b - a) * yoff + 8) >> 4);
- const int diff = ((r + sec16[w * y + x] + 1) >> 1) - src16[w * y + x];
- se += diff;
- sse += diff * diff;
- #endif // CONFIG_VP9_HIGHBITDEPTH
- }
- }
- }
- RoundHighBitDepth(bit_depth, &se, &sse);
- *sse_ptr = static_cast<uint32_t>(sse);
- return static_cast<uint32_t>(
- sse - ((static_cast<int64_t>(se) * se) >> (l2w + l2h)));
- }
- ////////////////////////////////////////////////////////////////////////////////
- class SumOfSquaresTest : public ::testing::TestWithParam<SumOfSquaresFunction> {
- public:
- SumOfSquaresTest() : func_(GetParam()) {}
- virtual ~SumOfSquaresTest() { libvpx_test::ClearSystemState(); }
- protected:
- void ConstTest();
- void RefTest();
- SumOfSquaresFunction func_;
- ACMRandom rnd_;
- };
- void SumOfSquaresTest::ConstTest() {
- int16_t mem[256];
- unsigned int res;
- for (int v = 0; v < 256; ++v) {
- for (int i = 0; i < 256; ++i) {
- mem[i] = v;
- }
- ASM_REGISTER_STATE_CHECK(res = func_(mem));
- EXPECT_EQ(256u * (v * v), res);
- }
- }
- void SumOfSquaresTest::RefTest() {
- int16_t mem[256];
- for (int i = 0; i < 100; ++i) {
- for (int j = 0; j < 256; ++j) {
- mem[j] = rnd_.Rand8() - rnd_.Rand8();
- }
- const unsigned int expected = mb_ss_ref(mem);
- unsigned int res;
- ASM_REGISTER_STATE_CHECK(res = func_(mem));
- EXPECT_EQ(expected, res);
- }
- }
- ////////////////////////////////////////////////////////////////////////////////
- // Encapsulating struct to store the function to test along with
- // some testing context.
- // Can be used for MSE, SSE, Variance, etc.
- template <typename Func>
- struct TestParams {
- TestParams(int log2w = 0, int log2h = 0, Func function = NULL,
- int bit_depth_value = 0)
- : log2width(log2w), log2height(log2h), func(function) {
- use_high_bit_depth = (bit_depth_value > 0);
- if (use_high_bit_depth) {
- bit_depth = static_cast<vpx_bit_depth_t>(bit_depth_value);
- } else {
- bit_depth = VPX_BITS_8;
- }
- width = 1 << log2width;
- height = 1 << log2height;
- block_size = width * height;
- mask = (1u << bit_depth) - 1;
- }
- int log2width, log2height;
- int width, height;
- int block_size;
- Func func;
- vpx_bit_depth_t bit_depth;
- bool use_high_bit_depth;
- uint32_t mask;
- };
- template <typename Func>
- std::ostream &operator<<(std::ostream &os, const TestParams<Func> &p) {
- return os << "log2width/height:" << p.log2width << "/" << p.log2height
- << " function:" << reinterpret_cast<const void *>(p.func)
- << " bit-depth:" << p.bit_depth;
- }
- // Main class for testing a function type
- template <typename FunctionType>
- class MainTestClass
- : public ::testing::TestWithParam<TestParams<FunctionType> > {
- public:
- virtual void SetUp() {
- params_ = this->GetParam();
- rnd_.Reset(ACMRandom::DeterministicSeed());
- const size_t unit =
- use_high_bit_depth() ? sizeof(uint16_t) : sizeof(uint8_t);
- src_ = reinterpret_cast<uint8_t *>(vpx_memalign(16, block_size() * unit));
- ref_ = new uint8_t[block_size() * unit];
- ASSERT_TRUE(src_ != NULL);
- ASSERT_TRUE(ref_ != NULL);
- #if CONFIG_VP9_HIGHBITDEPTH
- if (use_high_bit_depth()) {
- // TODO(skal): remove!
- src_ = CONVERT_TO_BYTEPTR(src_);
- ref_ = CONVERT_TO_BYTEPTR(ref_);
- }
- #endif
- }
- virtual void TearDown() {
- #if CONFIG_VP9_HIGHBITDEPTH
- if (use_high_bit_depth()) {
- // TODO(skal): remove!
- src_ = reinterpret_cast<uint8_t *>(CONVERT_TO_SHORTPTR(src_));
- ref_ = reinterpret_cast<uint8_t *>(CONVERT_TO_SHORTPTR(ref_));
- }
- #endif
- vpx_free(src_);
- delete[] ref_;
- src_ = NULL;
- ref_ = NULL;
- libvpx_test::ClearSystemState();
- }
- protected:
- // We could sub-class MainTestClass into dedicated class for Variance
- // and MSE/SSE, but it involves a lot of 'this->xxx' dereferencing
- // to access top class fields xxx. That's cumbersome, so for now we'll just
- // implement the testing methods here:
- // Variance tests
- void ZeroTest();
- void RefTest();
- void RefStrideTest();
- void OneQuarterTest();
- void SpeedTest();
- // MSE/SSE tests
- void RefTestMse();
- void RefTestSse();
- void MaxTestMse();
- void MaxTestSse();
- protected:
- ACMRandom rnd_;
- uint8_t *src_;
- uint8_t *ref_;
- TestParams<FunctionType> params_;
- // some relay helpers
- bool use_high_bit_depth() const { return params_.use_high_bit_depth; }
- int byte_shift() const { return params_.bit_depth - 8; }
- int block_size() const { return params_.block_size; }
- int width() const { return params_.width; }
- int height() const { return params_.height; }
- uint32_t mask() const { return params_.mask; }
- };
- ////////////////////////////////////////////////////////////////////////////////
- // Tests related to variance.
- template <typename VarianceFunctionType>
- void MainTestClass<VarianceFunctionType>::ZeroTest() {
- for (int i = 0; i <= 255; ++i) {
- if (!use_high_bit_depth()) {
- memset(src_, i, block_size());
- } else {
- uint16_t *const src16 = CONVERT_TO_SHORTPTR(src_);
- for (int k = 0; k < block_size(); ++k) src16[k] = i << byte_shift();
- }
- for (int j = 0; j <= 255; ++j) {
- if (!use_high_bit_depth()) {
- memset(ref_, j, block_size());
- } else {
- uint16_t *const ref16 = CONVERT_TO_SHORTPTR(ref_);
- for (int k = 0; k < block_size(); ++k) ref16[k] = j << byte_shift();
- }
- unsigned int sse, var;
- ASM_REGISTER_STATE_CHECK(
- var = params_.func(src_, width(), ref_, width(), &sse));
- EXPECT_EQ(0u, var) << "src values: " << i << " ref values: " << j;
- }
- }
- }
- template <typename VarianceFunctionType>
- void MainTestClass<VarianceFunctionType>::RefTest() {
- for (int i = 0; i < 10; ++i) {
- for (int j = 0; j < block_size(); j++) {
- if (!use_high_bit_depth()) {
- src_[j] = rnd_.Rand8();
- ref_[j] = rnd_.Rand8();
- #if CONFIG_VP9_HIGHBITDEPTH
- } else {
- CONVERT_TO_SHORTPTR(src_)[j] = rnd_.Rand16() & mask();
- CONVERT_TO_SHORTPTR(ref_)[j] = rnd_.Rand16() & mask();
- #endif // CONFIG_VP9_HIGHBITDEPTH
- }
- }
- unsigned int sse1, sse2, var1, var2;
- const int stride = width();
- ASM_REGISTER_STATE_CHECK(
- var1 = params_.func(src_, stride, ref_, stride, &sse1));
- var2 =
- variance_ref(src_, ref_, params_.log2width, params_.log2height, stride,
- stride, &sse2, use_high_bit_depth(), params_.bit_depth);
- EXPECT_EQ(sse1, sse2) << "Error at test index: " << i;
- EXPECT_EQ(var1, var2) << "Error at test index: " << i;
- }
- }
- template <typename VarianceFunctionType>
- void MainTestClass<VarianceFunctionType>::RefStrideTest() {
- for (int i = 0; i < 10; ++i) {
- const int ref_stride = (i & 1) * width();
- const int src_stride = ((i >> 1) & 1) * width();
- for (int j = 0; j < block_size(); j++) {
- const int ref_ind = (j / width()) * ref_stride + j % width();
- const int src_ind = (j / width()) * src_stride + j % width();
- if (!use_high_bit_depth()) {
- src_[src_ind] = rnd_.Rand8();
- ref_[ref_ind] = rnd_.Rand8();
- #if CONFIG_VP9_HIGHBITDEPTH
- } else {
- CONVERT_TO_SHORTPTR(src_)[src_ind] = rnd_.Rand16() & mask();
- CONVERT_TO_SHORTPTR(ref_)[ref_ind] = rnd_.Rand16() & mask();
- #endif // CONFIG_VP9_HIGHBITDEPTH
- }
- }
- unsigned int sse1, sse2;
- unsigned int var1, var2;
- ASM_REGISTER_STATE_CHECK(
- var1 = params_.func(src_, src_stride, ref_, ref_stride, &sse1));
- var2 = variance_ref(src_, ref_, params_.log2width, params_.log2height,
- src_stride, ref_stride, &sse2, use_high_bit_depth(),
- params_.bit_depth);
- EXPECT_EQ(sse1, sse2) << "Error at test index: " << i;
- EXPECT_EQ(var1, var2) << "Error at test index: " << i;
- }
- }
- template <typename VarianceFunctionType>
- void MainTestClass<VarianceFunctionType>::OneQuarterTest() {
- const int half = block_size() / 2;
- if (!use_high_bit_depth()) {
- memset(src_, 255, block_size());
- memset(ref_, 255, half);
- memset(ref_ + half, 0, half);
- #if CONFIG_VP9_HIGHBITDEPTH
- } else {
- vpx_memset16(CONVERT_TO_SHORTPTR(src_), 255 << byte_shift(), block_size());
- vpx_memset16(CONVERT_TO_SHORTPTR(ref_), 255 << byte_shift(), half);
- vpx_memset16(CONVERT_TO_SHORTPTR(ref_) + half, 0, half);
- #endif // CONFIG_VP9_HIGHBITDEPTH
- }
- unsigned int sse, var, expected;
- ASM_REGISTER_STATE_CHECK(
- var = params_.func(src_, width(), ref_, width(), &sse));
- expected = block_size() * 255 * 255 / 4;
- EXPECT_EQ(expected, var);
- }
- template <typename VarianceFunctionType>
- void MainTestClass<VarianceFunctionType>::SpeedTest() {
- const int half = block_size() / 2;
- if (!use_high_bit_depth()) {
- memset(src_, 255, block_size());
- memset(ref_, 255, half);
- memset(ref_ + half, 0, half);
- #if CONFIG_VP9_HIGHBITDEPTH
- } else {
- vpx_memset16(CONVERT_TO_SHORTPTR(src_), 255 << byte_shift(), block_size());
- vpx_memset16(CONVERT_TO_SHORTPTR(ref_), 255 << byte_shift(), half);
- vpx_memset16(CONVERT_TO_SHORTPTR(ref_) + half, 0, half);
- #endif // CONFIG_VP9_HIGHBITDEPTH
- }
- unsigned int sse;
- vpx_usec_timer timer;
- vpx_usec_timer_start(&timer);
- for (int i = 0; i < (1 << 30) / block_size(); ++i) {
- const uint32_t variance = params_.func(src_, width(), ref_, width(), &sse);
- // Ignore return value.
- (void)variance;
- }
- vpx_usec_timer_mark(&timer);
- const int elapsed_time = static_cast<int>(vpx_usec_timer_elapsed(&timer));
- printf("Variance %dx%d time: %5d ms\n", width(), height(),
- elapsed_time / 1000);
- }
- ////////////////////////////////////////////////////////////////////////////////
- // Tests related to MSE / SSE.
- template <typename FunctionType>
- void MainTestClass<FunctionType>::RefTestMse() {
- for (int i = 0; i < 10; ++i) {
- for (int j = 0; j < block_size(); ++j) {
- src_[j] = rnd_.Rand8();
- ref_[j] = rnd_.Rand8();
- }
- unsigned int sse1, sse2;
- const int stride = width();
- ASM_REGISTER_STATE_CHECK(params_.func(src_, stride, ref_, stride, &sse1));
- variance_ref(src_, ref_, params_.log2width, params_.log2height, stride,
- stride, &sse2, false, VPX_BITS_8);
- EXPECT_EQ(sse1, sse2);
- }
- }
- template <typename FunctionType>
- void MainTestClass<FunctionType>::RefTestSse() {
- for (int i = 0; i < 10; ++i) {
- for (int j = 0; j < block_size(); ++j) {
- src_[j] = rnd_.Rand8();
- ref_[j] = rnd_.Rand8();
- }
- unsigned int sse2;
- unsigned int var1;
- const int stride = width();
- ASM_REGISTER_STATE_CHECK(var1 = params_.func(src_, stride, ref_, stride));
- variance_ref(src_, ref_, params_.log2width, params_.log2height, stride,
- stride, &sse2, false, VPX_BITS_8);
- EXPECT_EQ(var1, sse2);
- }
- }
- template <typename FunctionType>
- void MainTestClass<FunctionType>::MaxTestMse() {
- memset(src_, 255, block_size());
- memset(ref_, 0, block_size());
- unsigned int sse;
- ASM_REGISTER_STATE_CHECK(params_.func(src_, width(), ref_, width(), &sse));
- const unsigned int expected = block_size() * 255 * 255;
- EXPECT_EQ(expected, sse);
- }
- template <typename FunctionType>
- void MainTestClass<FunctionType>::MaxTestSse() {
- memset(src_, 255, block_size());
- memset(ref_, 0, block_size());
- unsigned int var;
- ASM_REGISTER_STATE_CHECK(var = params_.func(src_, width(), ref_, width()));
- const unsigned int expected = block_size() * 255 * 255;
- EXPECT_EQ(expected, var);
- }
- ////////////////////////////////////////////////////////////////////////////////
- template <typename FunctionType>
- class SubpelVarianceTest
- : public ::testing::TestWithParam<TestParams<FunctionType> > {
- public:
- virtual void SetUp() {
- params_ = this->GetParam();
- rnd_.Reset(ACMRandom::DeterministicSeed());
- if (!use_high_bit_depth()) {
- src_ = reinterpret_cast<uint8_t *>(vpx_memalign(16, block_size()));
- sec_ = reinterpret_cast<uint8_t *>(vpx_memalign(16, block_size()));
- ref_ = reinterpret_cast<uint8_t *>(
- vpx_malloc(block_size() + width() + height() + 1));
- #if CONFIG_VP9_HIGHBITDEPTH
- } else {
- src_ = CONVERT_TO_BYTEPTR(reinterpret_cast<uint16_t *>(
- vpx_memalign(16, block_size() * sizeof(uint16_t))));
- sec_ = CONVERT_TO_BYTEPTR(reinterpret_cast<uint16_t *>(
- vpx_memalign(16, block_size() * sizeof(uint16_t))));
- ref_ = CONVERT_TO_BYTEPTR(reinterpret_cast<uint16_t *>(vpx_malloc(
- (block_size() + width() + height() + 1) * sizeof(uint16_t))));
- #endif // CONFIG_VP9_HIGHBITDEPTH
- }
- ASSERT_TRUE(src_ != NULL);
- ASSERT_TRUE(sec_ != NULL);
- ASSERT_TRUE(ref_ != NULL);
- }
- virtual void TearDown() {
- if (!use_high_bit_depth()) {
- vpx_free(src_);
- vpx_free(sec_);
- vpx_free(ref_);
- #if CONFIG_VP9_HIGHBITDEPTH
- } else {
- vpx_free(CONVERT_TO_SHORTPTR(src_));
- vpx_free(CONVERT_TO_SHORTPTR(ref_));
- vpx_free(CONVERT_TO_SHORTPTR(sec_));
- #endif // CONFIG_VP9_HIGHBITDEPTH
- }
- libvpx_test::ClearSystemState();
- }
- protected:
- void RefTest();
- void ExtremeRefTest();
- ACMRandom rnd_;
- uint8_t *src_;
- uint8_t *ref_;
- uint8_t *sec_;
- TestParams<FunctionType> params_;
- // some relay helpers
- bool use_high_bit_depth() const { return params_.use_high_bit_depth; }
- int byte_shift() const { return params_.bit_depth - 8; }
- int block_size() const { return params_.block_size; }
- int width() const { return params_.width; }
- int height() const { return params_.height; }
- uint32_t mask() const { return params_.mask; }
- };
- template <typename SubpelVarianceFunctionType>
- void SubpelVarianceTest<SubpelVarianceFunctionType>::RefTest() {
- for (int x = 0; x < 8; ++x) {
- for (int y = 0; y < 8; ++y) {
- if (!use_high_bit_depth()) {
- for (int j = 0; j < block_size(); j++) {
- src_[j] = rnd_.Rand8();
- }
- for (int j = 0; j < block_size() + width() + height() + 1; j++) {
- ref_[j] = rnd_.Rand8();
- }
- #if CONFIG_VP9_HIGHBITDEPTH
- } else {
- for (int j = 0; j < block_size(); j++) {
- CONVERT_TO_SHORTPTR(src_)[j] = rnd_.Rand16() & mask();
- }
- for (int j = 0; j < block_size() + width() + height() + 1; j++) {
- CONVERT_TO_SHORTPTR(ref_)[j] = rnd_.Rand16() & mask();
- }
- #endif // CONFIG_VP9_HIGHBITDEPTH
- }
- unsigned int sse1, sse2;
- unsigned int var1;
- ASM_REGISTER_STATE_CHECK(
- var1 = params_.func(ref_, width() + 1, x, y, src_, width(), &sse1));
- const unsigned int var2 = subpel_variance_ref(
- ref_, src_, params_.log2width, params_.log2height, x, y, &sse2,
- use_high_bit_depth(), params_.bit_depth);
- EXPECT_EQ(sse1, sse2) << "at position " << x << ", " << y;
- EXPECT_EQ(var1, var2) << "at position " << x << ", " << y;
- }
- }
- }
- template <typename SubpelVarianceFunctionType>
- void SubpelVarianceTest<SubpelVarianceFunctionType>::ExtremeRefTest() {
- // Compare against reference.
- // Src: Set the first half of values to 0, the second half to the maximum.
- // Ref: Set the first half of values to the maximum, the second half to 0.
- for (int x = 0; x < 8; ++x) {
- for (int y = 0; y < 8; ++y) {
- const int half = block_size() / 2;
- if (!use_high_bit_depth()) {
- memset(src_, 0, half);
- memset(src_ + half, 255, half);
- memset(ref_, 255, half);
- memset(ref_ + half, 0, half + width() + height() + 1);
- #if CONFIG_VP9_HIGHBITDEPTH
- } else {
- vpx_memset16(CONVERT_TO_SHORTPTR(src_), mask(), half);
- vpx_memset16(CONVERT_TO_SHORTPTR(src_) + half, 0, half);
- vpx_memset16(CONVERT_TO_SHORTPTR(ref_), 0, half);
- vpx_memset16(CONVERT_TO_SHORTPTR(ref_) + half, mask(),
- half + width() + height() + 1);
- #endif // CONFIG_VP9_HIGHBITDEPTH
- }
- unsigned int sse1, sse2;
- unsigned int var1;
- ASM_REGISTER_STATE_CHECK(
- var1 = params_.func(ref_, width() + 1, x, y, src_, width(), &sse1));
- const unsigned int var2 = subpel_variance_ref(
- ref_, src_, params_.log2width, params_.log2height, x, y, &sse2,
- use_high_bit_depth(), params_.bit_depth);
- EXPECT_EQ(sse1, sse2) << "for xoffset " << x << " and yoffset " << y;
- EXPECT_EQ(var1, var2) << "for xoffset " << x << " and yoffset " << y;
- }
- }
- }
- template <>
- void SubpelVarianceTest<vpx_subp_avg_variance_fn_t>::RefTest() {
- for (int x = 0; x < 8; ++x) {
- for (int y = 0; y < 8; ++y) {
- if (!use_high_bit_depth()) {
- for (int j = 0; j < block_size(); j++) {
- src_[j] = rnd_.Rand8();
- sec_[j] = rnd_.Rand8();
- }
- for (int j = 0; j < block_size() + width() + height() + 1; j++) {
- ref_[j] = rnd_.Rand8();
- }
- #if CONFIG_VP9_HIGHBITDEPTH
- } else {
- for (int j = 0; j < block_size(); j++) {
- CONVERT_TO_SHORTPTR(src_)[j] = rnd_.Rand16() & mask();
- CONVERT_TO_SHORTPTR(sec_)[j] = rnd_.Rand16() & mask();
- }
- for (int j = 0; j < block_size() + width() + height() + 1; j++) {
- CONVERT_TO_SHORTPTR(ref_)[j] = rnd_.Rand16() & mask();
- }
- #endif // CONFIG_VP9_HIGHBITDEPTH
- }
- uint32_t sse1, sse2;
- uint32_t var1, var2;
- ASM_REGISTER_STATE_CHECK(var1 = params_.func(ref_, width() + 1, x, y,
- src_, width(), &sse1, sec_));
- var2 = subpel_avg_variance_ref(ref_, src_, sec_, params_.log2width,
- params_.log2height, x, y, &sse2,
- use_high_bit_depth(), params_.bit_depth);
- EXPECT_EQ(sse1, sse2) << "at position " << x << ", " << y;
- EXPECT_EQ(var1, var2) << "at position " << x << ", " << y;
- }
- }
- }
- typedef MainTestClass<Get4x4SseFunc> VpxSseTest;
- typedef MainTestClass<vpx_variance_fn_t> VpxMseTest;
- typedef MainTestClass<vpx_variance_fn_t> VpxVarianceTest;
- typedef SubpelVarianceTest<vpx_subpixvariance_fn_t> VpxSubpelVarianceTest;
- typedef SubpelVarianceTest<vpx_subp_avg_variance_fn_t> VpxSubpelAvgVarianceTest;
- TEST_P(VpxSseTest, RefSse) { RefTestSse(); }
- TEST_P(VpxSseTest, MaxSse) { MaxTestSse(); }
- TEST_P(VpxMseTest, RefMse) { RefTestMse(); }
- TEST_P(VpxMseTest, MaxMse) { MaxTestMse(); }
- TEST_P(VpxVarianceTest, Zero) { ZeroTest(); }
- TEST_P(VpxVarianceTest, Ref) { RefTest(); }
- TEST_P(VpxVarianceTest, RefStride) { RefStrideTest(); }
- TEST_P(VpxVarianceTest, OneQuarter) { OneQuarterTest(); }
- TEST_P(VpxVarianceTest, DISABLED_Speed) { SpeedTest(); }
- TEST_P(SumOfSquaresTest, Const) { ConstTest(); }
- TEST_P(SumOfSquaresTest, Ref) { RefTest(); }
- TEST_P(VpxSubpelVarianceTest, Ref) { RefTest(); }
- TEST_P(VpxSubpelVarianceTest, ExtremeRef) { ExtremeRefTest(); }
- TEST_P(VpxSubpelAvgVarianceTest, Ref) { RefTest(); }
- INSTANTIATE_TEST_CASE_P(C, SumOfSquaresTest,
- ::testing::Values(vpx_get_mb_ss_c));
- typedef TestParams<Get4x4SseFunc> SseParams;
- INSTANTIATE_TEST_CASE_P(C, VpxSseTest,
- ::testing::Values(SseParams(2, 2,
- &vpx_get4x4sse_cs_c)));
- typedef TestParams<vpx_variance_fn_t> MseParams;
- INSTANTIATE_TEST_CASE_P(C, VpxMseTest,
- ::testing::Values(MseParams(4, 4, &vpx_mse16x16_c),
- MseParams(4, 3, &vpx_mse16x8_c),
- MseParams(3, 4, &vpx_mse8x16_c),
- MseParams(3, 3, &vpx_mse8x8_c)));
- typedef TestParams<vpx_variance_fn_t> VarianceParams;
- INSTANTIATE_TEST_CASE_P(
- C, VpxVarianceTest,
- ::testing::Values(VarianceParams(6, 6, &vpx_variance64x64_c),
- VarianceParams(6, 5, &vpx_variance64x32_c),
- VarianceParams(5, 6, &vpx_variance32x64_c),
- VarianceParams(5, 5, &vpx_variance32x32_c),
- VarianceParams(5, 4, &vpx_variance32x16_c),
- VarianceParams(4, 5, &vpx_variance16x32_c),
- VarianceParams(4, 4, &vpx_variance16x16_c),
- VarianceParams(4, 3, &vpx_variance16x8_c),
- VarianceParams(3, 4, &vpx_variance8x16_c),
- VarianceParams(3, 3, &vpx_variance8x8_c),
- VarianceParams(3, 2, &vpx_variance8x4_c),
- VarianceParams(2, 3, &vpx_variance4x8_c),
- VarianceParams(2, 2, &vpx_variance4x4_c)));
- typedef TestParams<vpx_subpixvariance_fn_t> SubpelVarianceParams;
- INSTANTIATE_TEST_CASE_P(
- C, VpxSubpelVarianceTest,
- ::testing::Values(
- SubpelVarianceParams(6, 6, &vpx_sub_pixel_variance64x64_c, 0),
- SubpelVarianceParams(6, 5, &vpx_sub_pixel_variance64x32_c, 0),
- SubpelVarianceParams(5, 6, &vpx_sub_pixel_variance32x64_c, 0),
- SubpelVarianceParams(5, 5, &vpx_sub_pixel_variance32x32_c, 0),
- SubpelVarianceParams(5, 4, &vpx_sub_pixel_variance32x16_c, 0),
- SubpelVarianceParams(4, 5, &vpx_sub_pixel_variance16x32_c, 0),
- SubpelVarianceParams(4, 4, &vpx_sub_pixel_variance16x16_c, 0),
- SubpelVarianceParams(4, 3, &vpx_sub_pixel_variance16x8_c, 0),
- SubpelVarianceParams(3, 4, &vpx_sub_pixel_variance8x16_c, 0),
- SubpelVarianceParams(3, 3, &vpx_sub_pixel_variance8x8_c, 0),
- SubpelVarianceParams(3, 2, &vpx_sub_pixel_variance8x4_c, 0),
- SubpelVarianceParams(2, 3, &vpx_sub_pixel_variance4x8_c, 0),
- SubpelVarianceParams(2, 2, &vpx_sub_pixel_variance4x4_c, 0)));
- typedef TestParams<vpx_subp_avg_variance_fn_t> SubpelAvgVarianceParams;
- INSTANTIATE_TEST_CASE_P(
- C, VpxSubpelAvgVarianceTest,
- ::testing::Values(
- SubpelAvgVarianceParams(6, 6, &vpx_sub_pixel_avg_variance64x64_c, 0),
- SubpelAvgVarianceParams(6, 5, &vpx_sub_pixel_avg_variance64x32_c, 0),
- SubpelAvgVarianceParams(5, 6, &vpx_sub_pixel_avg_variance32x64_c, 0),
- SubpelAvgVarianceParams(5, 5, &vpx_sub_pixel_avg_variance32x32_c, 0),
- SubpelAvgVarianceParams(5, 4, &vpx_sub_pixel_avg_variance32x16_c, 0),
- SubpelAvgVarianceParams(4, 5, &vpx_sub_pixel_avg_variance16x32_c, 0),
- SubpelAvgVarianceParams(4, 4, &vpx_sub_pixel_avg_variance16x16_c, 0),
- SubpelAvgVarianceParams(4, 3, &vpx_sub_pixel_avg_variance16x8_c, 0),
- SubpelAvgVarianceParams(3, 4, &vpx_sub_pixel_avg_variance8x16_c, 0),
- SubpelAvgVarianceParams(3, 3, &vpx_sub_pixel_avg_variance8x8_c, 0),
- SubpelAvgVarianceParams(3, 2, &vpx_sub_pixel_avg_variance8x4_c, 0),
- SubpelAvgVarianceParams(2, 3, &vpx_sub_pixel_avg_variance4x8_c, 0),
- SubpelAvgVarianceParams(2, 2, &vpx_sub_pixel_avg_variance4x4_c, 0)));
- #if CONFIG_VP9_HIGHBITDEPTH
- typedef MainTestClass<vpx_variance_fn_t> VpxHBDMseTest;
- typedef MainTestClass<vpx_variance_fn_t> VpxHBDVarianceTest;
- typedef SubpelVarianceTest<vpx_subpixvariance_fn_t> VpxHBDSubpelVarianceTest;
- typedef SubpelVarianceTest<vpx_subp_avg_variance_fn_t>
- VpxHBDSubpelAvgVarianceTest;
- TEST_P(VpxHBDMseTest, RefMse) { RefTestMse(); }
- TEST_P(VpxHBDMseTest, MaxMse) { MaxTestMse(); }
- TEST_P(VpxHBDVarianceTest, Zero) { ZeroTest(); }
- TEST_P(VpxHBDVarianceTest, Ref) { RefTest(); }
- TEST_P(VpxHBDVarianceTest, RefStride) { RefStrideTest(); }
- TEST_P(VpxHBDVarianceTest, OneQuarter) { OneQuarterTest(); }
- TEST_P(VpxHBDVarianceTest, DISABLED_Speed) { SpeedTest(); }
- TEST_P(VpxHBDSubpelVarianceTest, Ref) { RefTest(); }
- TEST_P(VpxHBDSubpelVarianceTest, ExtremeRef) { ExtremeRefTest(); }
- TEST_P(VpxHBDSubpelAvgVarianceTest, Ref) { RefTest(); }
- /* TODO(debargha): This test does not support the highbd version
- INSTANTIATE_TEST_CASE_P(
- C, VpxHBDMseTest,
- ::testing::Values(MseParams(4, 4, &vpx_highbd_12_mse16x16_c),
- MseParams(4, 4, &vpx_highbd_12_mse16x8_c),
- MseParams(4, 4, &vpx_highbd_12_mse8x16_c),
- MseParams(4, 4, &vpx_highbd_12_mse8x8_c),
- MseParams(4, 4, &vpx_highbd_10_mse16x16_c),
- MseParams(4, 4, &vpx_highbd_10_mse16x8_c),
- MseParams(4, 4, &vpx_highbd_10_mse8x16_c),
- MseParams(4, 4, &vpx_highbd_10_mse8x8_c),
- MseParams(4, 4, &vpx_highbd_8_mse16x16_c),
- MseParams(4, 4, &vpx_highbd_8_mse16x8_c),
- MseParams(4, 4, &vpx_highbd_8_mse8x16_c),
- MseParams(4, 4, &vpx_highbd_8_mse8x8_c)));
- */
- INSTANTIATE_TEST_CASE_P(
- C, VpxHBDVarianceTest,
- ::testing::Values(VarianceParams(6, 6, &vpx_highbd_12_variance64x64_c, 12),
- VarianceParams(6, 5, &vpx_highbd_12_variance64x32_c, 12),
- VarianceParams(5, 6, &vpx_highbd_12_variance32x64_c, 12),
- VarianceParams(5, 5, &vpx_highbd_12_variance32x32_c, 12),
- VarianceParams(5, 4, &vpx_highbd_12_variance32x16_c, 12),
- VarianceParams(4, 5, &vpx_highbd_12_variance16x32_c, 12),
- VarianceParams(4, 4, &vpx_highbd_12_variance16x16_c, 12),
- VarianceParams(4, 3, &vpx_highbd_12_variance16x8_c, 12),
- VarianceParams(3, 4, &vpx_highbd_12_variance8x16_c, 12),
- VarianceParams(3, 3, &vpx_highbd_12_variance8x8_c, 12),
- VarianceParams(3, 2, &vpx_highbd_12_variance8x4_c, 12),
- VarianceParams(2, 3, &vpx_highbd_12_variance4x8_c, 12),
- VarianceParams(2, 2, &vpx_highbd_12_variance4x4_c, 12),
- VarianceParams(6, 6, &vpx_highbd_10_variance64x64_c, 10),
- VarianceParams(6, 5, &vpx_highbd_10_variance64x32_c, 10),
- VarianceParams(5, 6, &vpx_highbd_10_variance32x64_c, 10),
- VarianceParams(5, 5, &vpx_highbd_10_variance32x32_c, 10),
- VarianceParams(5, 4, &vpx_highbd_10_variance32x16_c, 10),
- VarianceParams(4, 5, &vpx_highbd_10_variance16x32_c, 10),
- VarianceParams(4, 4, &vpx_highbd_10_variance16x16_c, 10),
- VarianceParams(4, 3, &vpx_highbd_10_variance16x8_c, 10),
- VarianceParams(3, 4, &vpx_highbd_10_variance8x16_c, 10),
- VarianceParams(3, 3, &vpx_highbd_10_variance8x8_c, 10),
- VarianceParams(3, 2, &vpx_highbd_10_variance8x4_c, 10),
- VarianceParams(2, 3, &vpx_highbd_10_variance4x8_c, 10),
- VarianceParams(2, 2, &vpx_highbd_10_variance4x4_c, 10),
- VarianceParams(6, 6, &vpx_highbd_8_variance64x64_c, 8),
- VarianceParams(6, 5, &vpx_highbd_8_variance64x32_c, 8),
- VarianceParams(5, 6, &vpx_highbd_8_variance32x64_c, 8),
- VarianceParams(5, 5, &vpx_highbd_8_variance32x32_c, 8),
- VarianceParams(5, 4, &vpx_highbd_8_variance32x16_c, 8),
- VarianceParams(4, 5, &vpx_highbd_8_variance16x32_c, 8),
- VarianceParams(4, 4, &vpx_highbd_8_variance16x16_c, 8),
- VarianceParams(4, 3, &vpx_highbd_8_variance16x8_c, 8),
- VarianceParams(3, 4, &vpx_highbd_8_variance8x16_c, 8),
- VarianceParams(3, 3, &vpx_highbd_8_variance8x8_c, 8),
- VarianceParams(3, 2, &vpx_highbd_8_variance8x4_c, 8),
- VarianceParams(2, 3, &vpx_highbd_8_variance4x8_c, 8),
- VarianceParams(2, 2, &vpx_highbd_8_variance4x4_c, 8)));
- INSTANTIATE_TEST_CASE_P(
- C, VpxHBDSubpelVarianceTest,
- ::testing::Values(
- SubpelVarianceParams(6, 6, &vpx_highbd_8_sub_pixel_variance64x64_c, 8),
- SubpelVarianceParams(6, 5, &vpx_highbd_8_sub_pixel_variance64x32_c, 8),
- SubpelVarianceParams(5, 6, &vpx_highbd_8_sub_pixel_variance32x64_c, 8),
- SubpelVarianceParams(5, 5, &vpx_highbd_8_sub_pixel_variance32x32_c, 8),
- SubpelVarianceParams(5, 4, &vpx_highbd_8_sub_pixel_variance32x16_c, 8),
- SubpelVarianceParams(4, 5, &vpx_highbd_8_sub_pixel_variance16x32_c, 8),
- SubpelVarianceParams(4, 4, &vpx_highbd_8_sub_pixel_variance16x16_c, 8),
- SubpelVarianceParams(4, 3, &vpx_highbd_8_sub_pixel_variance16x8_c, 8),
- SubpelVarianceParams(3, 4, &vpx_highbd_8_sub_pixel_variance8x16_c, 8),
- SubpelVarianceParams(3, 3, &vpx_highbd_8_sub_pixel_variance8x8_c, 8),
- SubpelVarianceParams(3, 2, &vpx_highbd_8_sub_pixel_variance8x4_c, 8),
- SubpelVarianceParams(2, 3, &vpx_highbd_8_sub_pixel_variance4x8_c, 8),
- SubpelVarianceParams(2, 2, &vpx_highbd_8_sub_pixel_variance4x4_c, 8),
- SubpelVarianceParams(6, 6, &vpx_highbd_10_sub_pixel_variance64x64_c,
- 10),
- SubpelVarianceParams(6, 5, &vpx_highbd_10_sub_pixel_variance64x32_c,
- 10),
- SubpelVarianceParams(5, 6, &vpx_highbd_10_sub_pixel_variance32x64_c,
- 10),
- SubpelVarianceParams(5, 5, &vpx_highbd_10_sub_pixel_variance32x32_c,
- 10),
- SubpelVarianceParams(5, 4, &vpx_highbd_10_sub_pixel_variance32x16_c,
- 10),
- SubpelVarianceParams(4, 5, &vpx_highbd_10_sub_pixel_variance16x32_c,
- 10),
- SubpelVarianceParams(4, 4, &vpx_highbd_10_sub_pixel_variance16x16_c,
- 10),
- SubpelVarianceParams(4, 3, &vpx_highbd_10_sub_pixel_variance16x8_c, 10),
- SubpelVarianceParams(3, 4, &vpx_highbd_10_sub_pixel_variance8x16_c, 10),
- SubpelVarianceParams(3, 3, &vpx_highbd_10_sub_pixel_variance8x8_c, 10),
- SubpelVarianceParams(3, 2, &vpx_highbd_10_sub_pixel_variance8x4_c, 10),
- SubpelVarianceParams(2, 3, &vpx_highbd_10_sub_pixel_variance4x8_c, 10),
- SubpelVarianceParams(2, 2, &vpx_highbd_10_sub_pixel_variance4x4_c, 10),
- SubpelVarianceParams(6, 6, &vpx_highbd_12_sub_pixel_variance64x64_c,
- 12),
- SubpelVarianceParams(6, 5, &vpx_highbd_12_sub_pixel_variance64x32_c,
- 12),
- SubpelVarianceParams(5, 6, &vpx_highbd_12_sub_pixel_variance32x64_c,
- 12),
- SubpelVarianceParams(5, 5, &vpx_highbd_12_sub_pixel_variance32x32_c,
- 12),
- SubpelVarianceParams(5, 4, &vpx_highbd_12_sub_pixel_variance32x16_c,
- 12),
- SubpelVarianceParams(4, 5, &vpx_highbd_12_sub_pixel_variance16x32_c,
- 12),
- SubpelVarianceParams(4, 4, &vpx_highbd_12_sub_pixel_variance16x16_c,
- 12),
- SubpelVarianceParams(4, 3, &vpx_highbd_12_sub_pixel_variance16x8_c, 12),
- SubpelVarianceParams(3, 4, &vpx_highbd_12_sub_pixel_variance8x16_c, 12),
- SubpelVarianceParams(3, 3, &vpx_highbd_12_sub_pixel_variance8x8_c, 12),
- SubpelVarianceParams(3, 2, &vpx_highbd_12_sub_pixel_variance8x4_c, 12),
- SubpelVarianceParams(2, 3, &vpx_highbd_12_sub_pixel_variance4x8_c, 12),
- SubpelVarianceParams(2, 2, &vpx_highbd_12_sub_pixel_variance4x4_c,
- 12)));
- INSTANTIATE_TEST_CASE_P(
- C, VpxHBDSubpelAvgVarianceTest,
- ::testing::Values(
- SubpelAvgVarianceParams(6, 6,
- &vpx_highbd_8_sub_pixel_avg_variance64x64_c, 8),
- SubpelAvgVarianceParams(6, 5,
- &vpx_highbd_8_sub_pixel_avg_variance64x32_c, 8),
- SubpelAvgVarianceParams(5, 6,
- &vpx_highbd_8_sub_pixel_avg_variance32x64_c, 8),
- SubpelAvgVarianceParams(5, 5,
- &vpx_highbd_8_sub_pixel_avg_variance32x32_c, 8),
- SubpelAvgVarianceParams(5, 4,
- &vpx_highbd_8_sub_pixel_avg_variance32x16_c, 8),
- SubpelAvgVarianceParams(4, 5,
- &vpx_highbd_8_sub_pixel_avg_variance16x32_c, 8),
- SubpelAvgVarianceParams(4, 4,
- &vpx_highbd_8_sub_pixel_avg_variance16x16_c, 8),
- SubpelAvgVarianceParams(4, 3,
- &vpx_highbd_8_sub_pixel_avg_variance16x8_c, 8),
- SubpelAvgVarianceParams(3, 4,
- &vpx_highbd_8_sub_pixel_avg_variance8x16_c, 8),
- SubpelAvgVarianceParams(3, 3, &vpx_highbd_8_sub_pixel_avg_variance8x8_c,
- 8),
- SubpelAvgVarianceParams(3, 2, &vpx_highbd_8_sub_pixel_avg_variance8x4_c,
- 8),
- SubpelAvgVarianceParams(2, 3, &vpx_highbd_8_sub_pixel_avg_variance4x8_c,
- 8),
- SubpelAvgVarianceParams(2, 2, &vpx_highbd_8_sub_pixel_avg_variance4x4_c,
- 8),
- SubpelAvgVarianceParams(6, 6,
- &vpx_highbd_10_sub_pixel_avg_variance64x64_c,
- 10),
- SubpelAvgVarianceParams(6, 5,
- &vpx_highbd_10_sub_pixel_avg_variance64x32_c,
- 10),
- SubpelAvgVarianceParams(5, 6,
- &vpx_highbd_10_sub_pixel_avg_variance32x64_c,
- 10),
- SubpelAvgVarianceParams(5, 5,
- &vpx_highbd_10_sub_pixel_avg_variance32x32_c,
- 10),
- SubpelAvgVarianceParams(5, 4,
- &vpx_highbd_10_sub_pixel_avg_variance32x16_c,
- 10),
- SubpelAvgVarianceParams(4, 5,
- &vpx_highbd_10_sub_pixel_avg_variance16x32_c,
- 10),
- SubpelAvgVarianceParams(4, 4,
- &vpx_highbd_10_sub_pixel_avg_variance16x16_c,
- 10),
- SubpelAvgVarianceParams(4, 3,
- &vpx_highbd_10_sub_pixel_avg_variance16x8_c,
- 10),
- SubpelAvgVarianceParams(3, 4,
- &vpx_highbd_10_sub_pixel_avg_variance8x16_c,
- 10),
- SubpelAvgVarianceParams(3, 3,
- &vpx_highbd_10_sub_pixel_avg_variance8x8_c, 10),
- SubpelAvgVarianceParams(3, 2,
- &vpx_highbd_10_sub_pixel_avg_variance8x4_c, 10),
- SubpelAvgVarianceParams(2, 3,
- &vpx_highbd_10_sub_pixel_avg_variance4x8_c, 10),
- SubpelAvgVarianceParams(2, 2,
- &vpx_highbd_10_sub_pixel_avg_variance4x4_c, 10),
- SubpelAvgVarianceParams(6, 6,
- &vpx_highbd_12_sub_pixel_avg_variance64x64_c,
- 12),
- SubpelAvgVarianceParams(6, 5,
- &vpx_highbd_12_sub_pixel_avg_variance64x32_c,
- 12),
- SubpelAvgVarianceParams(5, 6,
- &vpx_highbd_12_sub_pixel_avg_variance32x64_c,
- 12),
- SubpelAvgVarianceParams(5, 5,
- &vpx_highbd_12_sub_pixel_avg_variance32x32_c,
- 12),
- SubpelAvgVarianceParams(5, 4,
- &vpx_highbd_12_sub_pixel_avg_variance32x16_c,
- 12),
- SubpelAvgVarianceParams(4, 5,
- &vpx_highbd_12_sub_pixel_avg_variance16x32_c,
- 12),
- SubpelAvgVarianceParams(4, 4,
- &vpx_highbd_12_sub_pixel_avg_variance16x16_c,
- 12),
- SubpelAvgVarianceParams(4, 3,
- &vpx_highbd_12_sub_pixel_avg_variance16x8_c,
- 12),
- SubpelAvgVarianceParams(3, 4,
- &vpx_highbd_12_sub_pixel_avg_variance8x16_c,
- 12),
- SubpelAvgVarianceParams(3, 3,
- &vpx_highbd_12_sub_pixel_avg_variance8x8_c, 12),
- SubpelAvgVarianceParams(3, 2,
- &vpx_highbd_12_sub_pixel_avg_variance8x4_c, 12),
- SubpelAvgVarianceParams(2, 3,
- &vpx_highbd_12_sub_pixel_avg_variance4x8_c, 12),
- SubpelAvgVarianceParams(2, 2,
- &vpx_highbd_12_sub_pixel_avg_variance4x4_c,
- 12)));
- #endif // CONFIG_VP9_HIGHBITDEPTH
- #if HAVE_SSE2
- INSTANTIATE_TEST_CASE_P(SSE2, SumOfSquaresTest,
- ::testing::Values(vpx_get_mb_ss_sse2));
- INSTANTIATE_TEST_CASE_P(SSE2, VpxMseTest,
- ::testing::Values(MseParams(4, 4, &vpx_mse16x16_sse2),
- MseParams(4, 3, &vpx_mse16x8_sse2),
- MseParams(3, 4, &vpx_mse8x16_sse2),
- MseParams(3, 3, &vpx_mse8x8_sse2)));
- INSTANTIATE_TEST_CASE_P(
- SSE2, VpxVarianceTest,
- ::testing::Values(VarianceParams(6, 6, &vpx_variance64x64_sse2),
- VarianceParams(6, 5, &vpx_variance64x32_sse2),
- VarianceParams(5, 6, &vpx_variance32x64_sse2),
- VarianceParams(5, 5, &vpx_variance32x32_sse2),
- VarianceParams(5, 4, &vpx_variance32x16_sse2),
- VarianceParams(4, 5, &vpx_variance16x32_sse2),
- VarianceParams(4, 4, &vpx_variance16x16_sse2),
- VarianceParams(4, 3, &vpx_variance16x8_sse2),
- VarianceParams(3, 4, &vpx_variance8x16_sse2),
- VarianceParams(3, 3, &vpx_variance8x8_sse2),
- VarianceParams(3, 2, &vpx_variance8x4_sse2),
- VarianceParams(2, 3, &vpx_variance4x8_sse2),
- VarianceParams(2, 2, &vpx_variance4x4_sse2)));
- INSTANTIATE_TEST_CASE_P(
- SSE2, VpxSubpelVarianceTest,
- ::testing::Values(
- SubpelVarianceParams(6, 6, &vpx_sub_pixel_variance64x64_sse2, 0),
- SubpelVarianceParams(6, 5, &vpx_sub_pixel_variance64x32_sse2, 0),
- SubpelVarianceParams(5, 6, &vpx_sub_pixel_variance32x64_sse2, 0),
- SubpelVarianceParams(5, 5, &vpx_sub_pixel_variance32x32_sse2, 0),
- SubpelVarianceParams(5, 4, &vpx_sub_pixel_variance32x16_sse2, 0),
- SubpelVarianceParams(4, 5, &vpx_sub_pixel_variance16x32_sse2, 0),
- SubpelVarianceParams(4, 4, &vpx_sub_pixel_variance16x16_sse2, 0),
- SubpelVarianceParams(4, 3, &vpx_sub_pixel_variance16x8_sse2, 0),
- SubpelVarianceParams(3, 4, &vpx_sub_pixel_variance8x16_sse2, 0),
- SubpelVarianceParams(3, 3, &vpx_sub_pixel_variance8x8_sse2, 0),
- SubpelVarianceParams(3, 2, &vpx_sub_pixel_variance8x4_sse2, 0),
- SubpelVarianceParams(2, 3, &vpx_sub_pixel_variance4x8_sse2, 0),
- SubpelVarianceParams(2, 2, &vpx_sub_pixel_variance4x4_sse2, 0)));
- INSTANTIATE_TEST_CASE_P(
- SSE2, VpxSubpelAvgVarianceTest,
- ::testing::Values(
- SubpelAvgVarianceParams(6, 6, &vpx_sub_pixel_avg_variance64x64_sse2, 0),
- SubpelAvgVarianceParams(6, 5, &vpx_sub_pixel_avg_variance64x32_sse2, 0),
- SubpelAvgVarianceParams(5, 6, &vpx_sub_pixel_avg_variance32x64_sse2, 0),
- SubpelAvgVarianceParams(5, 5, &vpx_sub_pixel_avg_variance32x32_sse2, 0),
- SubpelAvgVarianceParams(5, 4, &vpx_sub_pixel_avg_variance32x16_sse2, 0),
- SubpelAvgVarianceParams(4, 5, &vpx_sub_pixel_avg_variance16x32_sse2, 0),
- SubpelAvgVarianceParams(4, 4, &vpx_sub_pixel_avg_variance16x16_sse2, 0),
- SubpelAvgVarianceParams(4, 3, &vpx_sub_pixel_avg_variance16x8_sse2, 0),
- SubpelAvgVarianceParams(3, 4, &vpx_sub_pixel_avg_variance8x16_sse2, 0),
- SubpelAvgVarianceParams(3, 3, &vpx_sub_pixel_avg_variance8x8_sse2, 0),
- SubpelAvgVarianceParams(3, 2, &vpx_sub_pixel_avg_variance8x4_sse2, 0),
- SubpelAvgVarianceParams(2, 3, &vpx_sub_pixel_avg_variance4x8_sse2, 0),
- SubpelAvgVarianceParams(2, 2, &vpx_sub_pixel_avg_variance4x4_sse2, 0)));
- #if CONFIG_VP9_HIGHBITDEPTH
- /* TODO(debargha): This test does not support the highbd version
- INSTANTIATE_TEST_CASE_P(
- SSE2, VpxHBDMseTest,
- ::testing::Values(MseParams(4, 4, &vpx_highbd_12_mse16x16_sse2),
- MseParams(4, 3, &vpx_highbd_12_mse16x8_sse2),
- MseParams(3, 4, &vpx_highbd_12_mse8x16_sse2),
- MseParams(3, 3, &vpx_highbd_12_mse8x8_sse2),
- MseParams(4, 4, &vpx_highbd_10_mse16x16_sse2),
- MseParams(4, 3, &vpx_highbd_10_mse16x8_sse2),
- MseParams(3, 4, &vpx_highbd_10_mse8x16_sse2),
- MseParams(3, 3, &vpx_highbd_10_mse8x8_sse2),
- MseParams(4, 4, &vpx_highbd_8_mse16x16_sse2),
- MseParams(4, 3, &vpx_highbd_8_mse16x8_sse2),
- MseParams(3, 4, &vpx_highbd_8_mse8x16_sse2),
- MseParams(3, 3, &vpx_highbd_8_mse8x8_sse2)));
- */
- INSTANTIATE_TEST_CASE_P(
- SSE2, VpxHBDVarianceTest,
- ::testing::Values(
- VarianceParams(6, 6, &vpx_highbd_12_variance64x64_sse2, 12),
- VarianceParams(6, 5, &vpx_highbd_12_variance64x32_sse2, 12),
- VarianceParams(5, 6, &vpx_highbd_12_variance32x64_sse2, 12),
- VarianceParams(5, 5, &vpx_highbd_12_variance32x32_sse2, 12),
- VarianceParams(5, 4, &vpx_highbd_12_variance32x16_sse2, 12),
- VarianceParams(4, 5, &vpx_highbd_12_variance16x32_sse2, 12),
- VarianceParams(4, 4, &vpx_highbd_12_variance16x16_sse2, 12),
- VarianceParams(4, 3, &vpx_highbd_12_variance16x8_sse2, 12),
- VarianceParams(3, 4, &vpx_highbd_12_variance8x16_sse2, 12),
- VarianceParams(3, 3, &vpx_highbd_12_variance8x8_sse2, 12),
- VarianceParams(6, 6, &vpx_highbd_10_variance64x64_sse2, 10),
- VarianceParams(6, 5, &vpx_highbd_10_variance64x32_sse2, 10),
- VarianceParams(5, 6, &vpx_highbd_10_variance32x64_sse2, 10),
- VarianceParams(5, 5, &vpx_highbd_10_variance32x32_sse2, 10),
- VarianceParams(5, 4, &vpx_highbd_10_variance32x16_sse2, 10),
- VarianceParams(4, 5, &vpx_highbd_10_variance16x32_sse2, 10),
- VarianceParams(4, 4, &vpx_highbd_10_variance16x16_sse2, 10),
- VarianceParams(4, 3, &vpx_highbd_10_variance16x8_sse2, 10),
- VarianceParams(3, 4, &vpx_highbd_10_variance8x16_sse2, 10),
- VarianceParams(3, 3, &vpx_highbd_10_variance8x8_sse2, 10),
- VarianceParams(6, 6, &vpx_highbd_8_variance64x64_sse2, 8),
- VarianceParams(6, 5, &vpx_highbd_8_variance64x32_sse2, 8),
- VarianceParams(5, 6, &vpx_highbd_8_variance32x64_sse2, 8),
- VarianceParams(5, 5, &vpx_highbd_8_variance32x32_sse2, 8),
- VarianceParams(5, 4, &vpx_highbd_8_variance32x16_sse2, 8),
- VarianceParams(4, 5, &vpx_highbd_8_variance16x32_sse2, 8),
- VarianceParams(4, 4, &vpx_highbd_8_variance16x16_sse2, 8),
- VarianceParams(4, 3, &vpx_highbd_8_variance16x8_sse2, 8),
- VarianceParams(3, 4, &vpx_highbd_8_variance8x16_sse2, 8),
- VarianceParams(3, 3, &vpx_highbd_8_variance8x8_sse2, 8)));
- INSTANTIATE_TEST_CASE_P(
- SSE2, VpxHBDSubpelVarianceTest,
- ::testing::Values(
- SubpelVarianceParams(6, 6, &vpx_highbd_12_sub_pixel_variance64x64_sse2,
- 12),
- SubpelVarianceParams(6, 5, &vpx_highbd_12_sub_pixel_variance64x32_sse2,
- 12),
- SubpelVarianceParams(5, 6, &vpx_highbd_12_sub_pixel_variance32x64_sse2,
- 12),
- SubpelVarianceParams(5, 5, &vpx_highbd_12_sub_pixel_variance32x32_sse2,
- 12),
- SubpelVarianceParams(5, 4, &vpx_highbd_12_sub_pixel_variance32x16_sse2,
- 12),
- SubpelVarianceParams(4, 5, &vpx_highbd_12_sub_pixel_variance16x32_sse2,
- 12),
- SubpelVarianceParams(4, 4, &vpx_highbd_12_sub_pixel_variance16x16_sse2,
- 12),
- SubpelVarianceParams(4, 3, &vpx_highbd_12_sub_pixel_variance16x8_sse2,
- 12),
- SubpelVarianceParams(3, 4, &vpx_highbd_12_sub_pixel_variance8x16_sse2,
- 12),
- SubpelVarianceParams(3, 3, &vpx_highbd_12_sub_pixel_variance8x8_sse2,
- 12),
- SubpelVarianceParams(3, 2, &vpx_highbd_12_sub_pixel_variance8x4_sse2,
- 12),
- SubpelVarianceParams(6, 6, &vpx_highbd_10_sub_pixel_variance64x64_sse2,
- 10),
- SubpelVarianceParams(6, 5, &vpx_highbd_10_sub_pixel_variance64x32_sse2,
- 10),
- SubpelVarianceParams(5, 6, &vpx_highbd_10_sub_pixel_variance32x64_sse2,
- 10),
- SubpelVarianceParams(5, 5, &vpx_highbd_10_sub_pixel_variance32x32_sse2,
- 10),
- SubpelVarianceParams(5, 4, &vpx_highbd_10_sub_pixel_variance32x16_sse2,
- 10),
- SubpelVarianceParams(4, 5, &vpx_highbd_10_sub_pixel_variance16x32_sse2,
- 10),
- SubpelVarianceParams(4, 4, &vpx_highbd_10_sub_pixel_variance16x16_sse2,
- 10),
- SubpelVarianceParams(4, 3, &vpx_highbd_10_sub_pixel_variance16x8_sse2,
- 10),
- SubpelVarianceParams(3, 4, &vpx_highbd_10_sub_pixel_variance8x16_sse2,
- 10),
- SubpelVarianceParams(3, 3, &vpx_highbd_10_sub_pixel_variance8x8_sse2,
- 10),
- SubpelVarianceParams(3, 2, &vpx_highbd_10_sub_pixel_variance8x4_sse2,
- 10),
- SubpelVarianceParams(6, 6, &vpx_highbd_8_sub_pixel_variance64x64_sse2,
- 8),
- SubpelVarianceParams(6, 5, &vpx_highbd_8_sub_pixel_variance64x32_sse2,
- 8),
- SubpelVarianceParams(5, 6, &vpx_highbd_8_sub_pixel_variance32x64_sse2,
- 8),
- SubpelVarianceParams(5, 5, &vpx_highbd_8_sub_pixel_variance32x32_sse2,
- 8),
- SubpelVarianceParams(5, 4, &vpx_highbd_8_sub_pixel_variance32x16_sse2,
- 8),
- SubpelVarianceParams(4, 5, &vpx_highbd_8_sub_pixel_variance16x32_sse2,
- 8),
- SubpelVarianceParams(4, 4, &vpx_highbd_8_sub_pixel_variance16x16_sse2,
- 8),
- SubpelVarianceParams(4, 3, &vpx_highbd_8_sub_pixel_variance16x8_sse2,
- 8),
- SubpelVarianceParams(3, 4, &vpx_highbd_8_sub_pixel_variance8x16_sse2,
- 8),
- SubpelVarianceParams(3, 3, &vpx_highbd_8_sub_pixel_variance8x8_sse2, 8),
- SubpelVarianceParams(3, 2, &vpx_highbd_8_sub_pixel_variance8x4_sse2,
- 8)));
- INSTANTIATE_TEST_CASE_P(
- SSE2, VpxHBDSubpelAvgVarianceTest,
- ::testing::Values(
- SubpelAvgVarianceParams(6, 6,
- &vpx_highbd_12_sub_pixel_avg_variance64x64_sse2,
- 12),
- SubpelAvgVarianceParams(6, 5,
- &vpx_highbd_12_sub_pixel_avg_variance64x32_sse2,
- 12),
- SubpelAvgVarianceParams(5, 6,
- &vpx_highbd_12_sub_pixel_avg_variance32x64_sse2,
- 12),
- SubpelAvgVarianceParams(5, 5,
- &vpx_highbd_12_sub_pixel_avg_variance32x32_sse2,
- 12),
- SubpelAvgVarianceParams(5, 4,
- &vpx_highbd_12_sub_pixel_avg_variance32x16_sse2,
- 12),
- SubpelAvgVarianceParams(4, 5,
- &vpx_highbd_12_sub_pixel_avg_variance16x32_sse2,
- 12),
- SubpelAvgVarianceParams(4, 4,
- &vpx_highbd_12_sub_pixel_avg_variance16x16_sse2,
- 12),
- SubpelAvgVarianceParams(4, 3,
- &vpx_highbd_12_sub_pixel_avg_variance16x8_sse2,
- 12),
- SubpelAvgVarianceParams(3, 4,
- &vpx_highbd_12_sub_pixel_avg_variance8x16_sse2,
- 12),
- SubpelAvgVarianceParams(3, 3,
- &vpx_highbd_12_sub_pixel_avg_variance8x8_sse2,
- 12),
- SubpelAvgVarianceParams(3, 2,
- &vpx_highbd_12_sub_pixel_avg_variance8x4_sse2,
- 12),
- SubpelAvgVarianceParams(6, 6,
- &vpx_highbd_10_sub_pixel_avg_variance64x64_sse2,
- 10),
- SubpelAvgVarianceParams(6, 5,
- &vpx_highbd_10_sub_pixel_avg_variance64x32_sse2,
- 10),
- SubpelAvgVarianceParams(5, 6,
- &vpx_highbd_10_sub_pixel_avg_variance32x64_sse2,
- 10),
- SubpelAvgVarianceParams(5, 5,
- &vpx_highbd_10_sub_pixel_avg_variance32x32_sse2,
- 10),
- SubpelAvgVarianceParams(5, 4,
- &vpx_highbd_10_sub_pixel_avg_variance32x16_sse2,
- 10),
- SubpelAvgVarianceParams(4, 5,
- &vpx_highbd_10_sub_pixel_avg_variance16x32_sse2,
- 10),
- SubpelAvgVarianceParams(4, 4,
- &vpx_highbd_10_sub_pixel_avg_variance16x16_sse2,
- 10),
- SubpelAvgVarianceParams(4, 3,
- &vpx_highbd_10_sub_pixel_avg_variance16x8_sse2,
- 10),
- SubpelAvgVarianceParams(3, 4,
- &vpx_highbd_10_sub_pixel_avg_variance8x16_sse2,
- 10),
- SubpelAvgVarianceParams(3, 3,
- &vpx_highbd_10_sub_pixel_avg_variance8x8_sse2,
- 10),
- SubpelAvgVarianceParams(3, 2,
- &vpx_highbd_10_sub_pixel_avg_variance8x4_sse2,
- 10),
- SubpelAvgVarianceParams(6, 6,
- &vpx_highbd_8_sub_pixel_avg_variance64x64_sse2,
- 8),
- SubpelAvgVarianceParams(6, 5,
- &vpx_highbd_8_sub_pixel_avg_variance64x32_sse2,
- 8),
- SubpelAvgVarianceParams(5, 6,
- &vpx_highbd_8_sub_pixel_avg_variance32x64_sse2,
- 8),
- SubpelAvgVarianceParams(5, 5,
- &vpx_highbd_8_sub_pixel_avg_variance32x32_sse2,
- 8),
- SubpelAvgVarianceParams(5, 4,
- &vpx_highbd_8_sub_pixel_avg_variance32x16_sse2,
- 8),
- SubpelAvgVarianceParams(4, 5,
- &vpx_highbd_8_sub_pixel_avg_variance16x32_sse2,
- 8),
- SubpelAvgVarianceParams(4, 4,
- &vpx_highbd_8_sub_pixel_avg_variance16x16_sse2,
- 8),
- SubpelAvgVarianceParams(4, 3,
- &vpx_highbd_8_sub_pixel_avg_variance16x8_sse2,
- 8),
- SubpelAvgVarianceParams(3, 4,
- &vpx_highbd_8_sub_pixel_avg_variance8x16_sse2,
- 8),
- SubpelAvgVarianceParams(3, 3,
- &vpx_highbd_8_sub_pixel_avg_variance8x8_sse2,
- 8),
- SubpelAvgVarianceParams(3, 2,
- &vpx_highbd_8_sub_pixel_avg_variance8x4_sse2,
- 8)));
- #endif // CONFIG_VP9_HIGHBITDEPTH
- #endif // HAVE_SSE2
- #if HAVE_SSSE3
- INSTANTIATE_TEST_CASE_P(
- SSSE3, VpxSubpelVarianceTest,
- ::testing::Values(
- SubpelVarianceParams(6, 6, &vpx_sub_pixel_variance64x64_ssse3, 0),
- SubpelVarianceParams(6, 5, &vpx_sub_pixel_variance64x32_ssse3, 0),
- SubpelVarianceParams(5, 6, &vpx_sub_pixel_variance32x64_ssse3, 0),
- SubpelVarianceParams(5, 5, &vpx_sub_pixel_variance32x32_ssse3, 0),
- SubpelVarianceParams(5, 4, &vpx_sub_pixel_variance32x16_ssse3, 0),
- SubpelVarianceParams(4, 5, &vpx_sub_pixel_variance16x32_ssse3, 0),
- SubpelVarianceParams(4, 4, &vpx_sub_pixel_variance16x16_ssse3, 0),
- SubpelVarianceParams(4, 3, &vpx_sub_pixel_variance16x8_ssse3, 0),
- SubpelVarianceParams(3, 4, &vpx_sub_pixel_variance8x16_ssse3, 0),
- SubpelVarianceParams(3, 3, &vpx_sub_pixel_variance8x8_ssse3, 0),
- SubpelVarianceParams(3, 2, &vpx_sub_pixel_variance8x4_ssse3, 0),
- SubpelVarianceParams(2, 3, &vpx_sub_pixel_variance4x8_ssse3, 0),
- SubpelVarianceParams(2, 2, &vpx_sub_pixel_variance4x4_ssse3, 0)));
- INSTANTIATE_TEST_CASE_P(
- SSSE3, VpxSubpelAvgVarianceTest,
- ::testing::Values(
- SubpelAvgVarianceParams(6, 6, &vpx_sub_pixel_avg_variance64x64_ssse3,
- 0),
- SubpelAvgVarianceParams(6, 5, &vpx_sub_pixel_avg_variance64x32_ssse3,
- 0),
- SubpelAvgVarianceParams(5, 6, &vpx_sub_pixel_avg_variance32x64_ssse3,
- 0),
- SubpelAvgVarianceParams(5, 5, &vpx_sub_pixel_avg_variance32x32_ssse3,
- 0),
- SubpelAvgVarianceParams(5, 4, &vpx_sub_pixel_avg_variance32x16_ssse3,
- 0),
- SubpelAvgVarianceParams(4, 5, &vpx_sub_pixel_avg_variance16x32_ssse3,
- 0),
- SubpelAvgVarianceParams(4, 4, &vpx_sub_pixel_avg_variance16x16_ssse3,
- 0),
- SubpelAvgVarianceParams(4, 3, &vpx_sub_pixel_avg_variance16x8_ssse3, 0),
- SubpelAvgVarianceParams(3, 4, &vpx_sub_pixel_avg_variance8x16_ssse3, 0),
- SubpelAvgVarianceParams(3, 3, &vpx_sub_pixel_avg_variance8x8_ssse3, 0),
- SubpelAvgVarianceParams(3, 2, &vpx_sub_pixel_avg_variance8x4_ssse3, 0),
- SubpelAvgVarianceParams(2, 3, &vpx_sub_pixel_avg_variance4x8_ssse3, 0),
- SubpelAvgVarianceParams(2, 2, &vpx_sub_pixel_avg_variance4x4_ssse3,
- 0)));
- #endif // HAVE_SSSE3
- #if HAVE_AVX2
- INSTANTIATE_TEST_CASE_P(AVX2, VpxMseTest,
- ::testing::Values(MseParams(4, 4, &vpx_mse16x16_avx2),
- MseParams(4, 3, &vpx_mse16x8_avx2)));
- INSTANTIATE_TEST_CASE_P(
- AVX2, VpxVarianceTest,
- ::testing::Values(VarianceParams(6, 6, &vpx_variance64x64_avx2),
- VarianceParams(6, 5, &vpx_variance64x32_avx2),
- VarianceParams(5, 6, &vpx_variance32x64_avx2),
- VarianceParams(5, 5, &vpx_variance32x32_avx2),
- VarianceParams(5, 4, &vpx_variance32x16_avx2),
- VarianceParams(4, 5, &vpx_variance16x32_avx2),
- VarianceParams(4, 4, &vpx_variance16x16_avx2),
- VarianceParams(4, 3, &vpx_variance16x8_avx2)));
- INSTANTIATE_TEST_CASE_P(
- AVX2, VpxSubpelVarianceTest,
- ::testing::Values(
- SubpelVarianceParams(6, 6, &vpx_sub_pixel_variance64x64_avx2, 0),
- SubpelVarianceParams(5, 5, &vpx_sub_pixel_variance32x32_avx2, 0)));
- INSTANTIATE_TEST_CASE_P(
- AVX2, VpxSubpelAvgVarianceTest,
- ::testing::Values(
- SubpelAvgVarianceParams(6, 6, &vpx_sub_pixel_avg_variance64x64_avx2, 0),
- SubpelAvgVarianceParams(5, 5, &vpx_sub_pixel_avg_variance32x32_avx2,
- 0)));
- #endif // HAVE_AVX2
- #if HAVE_NEON
- INSTANTIATE_TEST_CASE_P(NEON, VpxSseTest,
- ::testing::Values(SseParams(2, 2,
- &vpx_get4x4sse_cs_neon)));
- INSTANTIATE_TEST_CASE_P(NEON, VpxMseTest,
- ::testing::Values(MseParams(4, 4, &vpx_mse16x16_neon)));
- INSTANTIATE_TEST_CASE_P(
- NEON, VpxVarianceTest,
- ::testing::Values(VarianceParams(6, 6, &vpx_variance64x64_neon),
- VarianceParams(6, 5, &vpx_variance64x32_neon),
- VarianceParams(5, 6, &vpx_variance32x64_neon),
- VarianceParams(5, 5, &vpx_variance32x32_neon),
- VarianceParams(5, 4, &vpx_variance32x16_neon),
- VarianceParams(4, 5, &vpx_variance16x32_neon),
- VarianceParams(4, 4, &vpx_variance16x16_neon),
- VarianceParams(4, 3, &vpx_variance16x8_neon),
- VarianceParams(3, 4, &vpx_variance8x16_neon),
- VarianceParams(3, 3, &vpx_variance8x8_neon),
- VarianceParams(3, 2, &vpx_variance8x4_neon),
- VarianceParams(2, 3, &vpx_variance4x8_neon),
- VarianceParams(2, 2, &vpx_variance4x4_neon)));
- INSTANTIATE_TEST_CASE_P(
- NEON, VpxSubpelVarianceTest,
- ::testing::Values(
- SubpelVarianceParams(6, 6, &vpx_sub_pixel_variance64x64_neon, 0),
- SubpelVarianceParams(6, 5, &vpx_sub_pixel_variance64x32_neon, 0),
- SubpelVarianceParams(5, 6, &vpx_sub_pixel_variance32x64_neon, 0),
- SubpelVarianceParams(5, 5, &vpx_sub_pixel_variance32x32_neon, 0),
- SubpelVarianceParams(5, 4, &vpx_sub_pixel_variance32x16_neon, 0),
- SubpelVarianceParams(4, 5, &vpx_sub_pixel_variance16x32_neon, 0),
- SubpelVarianceParams(4, 4, &vpx_sub_pixel_variance16x16_neon, 0),
- SubpelVarianceParams(4, 3, &vpx_sub_pixel_variance16x8_neon, 0),
- SubpelVarianceParams(3, 4, &vpx_sub_pixel_variance8x16_neon, 0),
- SubpelVarianceParams(3, 3, &vpx_sub_pixel_variance8x8_neon, 0),
- SubpelVarianceParams(3, 2, &vpx_sub_pixel_variance8x4_neon, 0),
- SubpelVarianceParams(2, 3, &vpx_sub_pixel_variance4x8_neon, 0),
- SubpelVarianceParams(2, 2, &vpx_sub_pixel_variance4x4_neon, 0)));
- INSTANTIATE_TEST_CASE_P(
- NEON, VpxSubpelAvgVarianceTest,
- ::testing::Values(
- SubpelAvgVarianceParams(6, 6, &vpx_sub_pixel_avg_variance64x64_neon, 0),
- SubpelAvgVarianceParams(6, 5, &vpx_sub_pixel_avg_variance64x32_neon, 0),
- SubpelAvgVarianceParams(5, 6, &vpx_sub_pixel_avg_variance32x64_neon, 0),
- SubpelAvgVarianceParams(5, 5, &vpx_sub_pixel_avg_variance32x32_neon, 0),
- SubpelAvgVarianceParams(5, 4, &vpx_sub_pixel_avg_variance32x16_neon, 0),
- SubpelAvgVarianceParams(4, 5, &vpx_sub_pixel_avg_variance16x32_neon, 0),
- SubpelAvgVarianceParams(4, 4, &vpx_sub_pixel_avg_variance16x16_neon, 0),
- SubpelAvgVarianceParams(4, 3, &vpx_sub_pixel_avg_variance16x8_neon, 0),
- SubpelAvgVarianceParams(3, 4, &vpx_sub_pixel_avg_variance8x16_neon, 0),
- SubpelAvgVarianceParams(3, 3, &vpx_sub_pixel_avg_variance8x8_neon, 0),
- SubpelAvgVarianceParams(3, 2, &vpx_sub_pixel_avg_variance8x4_neon, 0),
- SubpelAvgVarianceParams(2, 3, &vpx_sub_pixel_avg_variance4x8_neon, 0),
- SubpelAvgVarianceParams(2, 2, &vpx_sub_pixel_avg_variance4x4_neon, 0)));
- #endif // HAVE_NEON
- #if HAVE_MSA
- INSTANTIATE_TEST_CASE_P(MSA, SumOfSquaresTest,
- ::testing::Values(vpx_get_mb_ss_msa));
- INSTANTIATE_TEST_CASE_P(MSA, VpxSseTest,
- ::testing::Values(SseParams(2, 2,
- &vpx_get4x4sse_cs_msa)));
- INSTANTIATE_TEST_CASE_P(MSA, VpxMseTest,
- ::testing::Values(MseParams(4, 4, &vpx_mse16x16_msa),
- MseParams(4, 3, &vpx_mse16x8_msa),
- MseParams(3, 4, &vpx_mse8x16_msa),
- MseParams(3, 3, &vpx_mse8x8_msa)));
- INSTANTIATE_TEST_CASE_P(
- MSA, VpxVarianceTest,
- ::testing::Values(VarianceParams(6, 6, &vpx_variance64x64_msa),
- VarianceParams(6, 5, &vpx_variance64x32_msa),
- VarianceParams(5, 6, &vpx_variance32x64_msa),
- VarianceParams(5, 5, &vpx_variance32x32_msa),
- VarianceParams(5, 4, &vpx_variance32x16_msa),
- VarianceParams(4, 5, &vpx_variance16x32_msa),
- VarianceParams(4, 4, &vpx_variance16x16_msa),
- VarianceParams(4, 3, &vpx_variance16x8_msa),
- VarianceParams(3, 4, &vpx_variance8x16_msa),
- VarianceParams(3, 3, &vpx_variance8x8_msa),
- VarianceParams(3, 2, &vpx_variance8x4_msa),
- VarianceParams(2, 3, &vpx_variance4x8_msa),
- VarianceParams(2, 2, &vpx_variance4x4_msa)));
- INSTANTIATE_TEST_CASE_P(
- MSA, VpxSubpelVarianceTest,
- ::testing::Values(
- SubpelVarianceParams(2, 2, &vpx_sub_pixel_variance4x4_msa, 0),
- SubpelVarianceParams(2, 3, &vpx_sub_pixel_variance4x8_msa, 0),
- SubpelVarianceParams(3, 2, &vpx_sub_pixel_variance8x4_msa, 0),
- SubpelVarianceParams(3, 3, &vpx_sub_pixel_variance8x8_msa, 0),
- SubpelVarianceParams(3, 4, &vpx_sub_pixel_variance8x16_msa, 0),
- SubpelVarianceParams(4, 3, &vpx_sub_pixel_variance16x8_msa, 0),
- SubpelVarianceParams(4, 4, &vpx_sub_pixel_variance16x16_msa, 0),
- SubpelVarianceParams(4, 5, &vpx_sub_pixel_variance16x32_msa, 0),
- SubpelVarianceParams(5, 4, &vpx_sub_pixel_variance32x16_msa, 0),
- SubpelVarianceParams(5, 5, &vpx_sub_pixel_variance32x32_msa, 0),
- SubpelVarianceParams(5, 6, &vpx_sub_pixel_variance32x64_msa, 0),
- SubpelVarianceParams(6, 5, &vpx_sub_pixel_variance64x32_msa, 0),
- SubpelVarianceParams(6, 6, &vpx_sub_pixel_variance64x64_msa, 0)));
- INSTANTIATE_TEST_CASE_P(
- MSA, VpxSubpelAvgVarianceTest,
- ::testing::Values(
- SubpelAvgVarianceParams(6, 6, &vpx_sub_pixel_avg_variance64x64_msa, 0),
- SubpelAvgVarianceParams(6, 5, &vpx_sub_pixel_avg_variance64x32_msa, 0),
- SubpelAvgVarianceParams(5, 6, &vpx_sub_pixel_avg_variance32x64_msa, 0),
- SubpelAvgVarianceParams(5, 5, &vpx_sub_pixel_avg_variance32x32_msa, 0),
- SubpelAvgVarianceParams(5, 4, &vpx_sub_pixel_avg_variance32x16_msa, 0),
- SubpelAvgVarianceParams(4, 5, &vpx_sub_pixel_avg_variance16x32_msa, 0),
- SubpelAvgVarianceParams(4, 4, &vpx_sub_pixel_avg_variance16x16_msa, 0),
- SubpelAvgVarianceParams(4, 3, &vpx_sub_pixel_avg_variance16x8_msa, 0),
- SubpelAvgVarianceParams(3, 4, &vpx_sub_pixel_avg_variance8x16_msa, 0),
- SubpelAvgVarianceParams(3, 3, &vpx_sub_pixel_avg_variance8x8_msa, 0),
- SubpelAvgVarianceParams(3, 2, &vpx_sub_pixel_avg_variance8x4_msa, 0),
- SubpelAvgVarianceParams(2, 3, &vpx_sub_pixel_avg_variance4x8_msa, 0),
- SubpelAvgVarianceParams(2, 2, &vpx_sub_pixel_avg_variance4x4_msa, 0)));
- #endif // HAVE_MSA
- #if HAVE_VSX
- INSTANTIATE_TEST_CASE_P(VSX, SumOfSquaresTest,
- ::testing::Values(vpx_get_mb_ss_vsx));
- INSTANTIATE_TEST_CASE_P(VSX, VpxSseTest,
- ::testing::Values(SseParams(2, 2,
- &vpx_get4x4sse_cs_vsx)));
- INSTANTIATE_TEST_CASE_P(VSX, VpxMseTest,
- ::testing::Values(MseParams(4, 4, &vpx_mse16x16_vsx),
- MseParams(4, 3, &vpx_mse16x8_vsx),
- MseParams(3, 4, &vpx_mse8x16_vsx),
- MseParams(3, 3, &vpx_mse8x8_vsx)));
- INSTANTIATE_TEST_CASE_P(
- VSX, VpxVarianceTest,
- ::testing::Values(VarianceParams(6, 6, &vpx_variance64x64_vsx),
- VarianceParams(6, 5, &vpx_variance64x32_vsx),
- VarianceParams(5, 6, &vpx_variance32x64_vsx),
- VarianceParams(5, 5, &vpx_variance32x32_vsx),
- VarianceParams(5, 4, &vpx_variance32x16_vsx),
- VarianceParams(4, 5, &vpx_variance16x32_vsx),
- VarianceParams(4, 4, &vpx_variance16x16_vsx),
- VarianceParams(4, 3, &vpx_variance16x8_vsx),
- VarianceParams(3, 4, &vpx_variance8x16_vsx),
- VarianceParams(3, 3, &vpx_variance8x8_vsx),
- VarianceParams(3, 2, &vpx_variance8x4_vsx),
- VarianceParams(2, 3, &vpx_variance4x8_vsx),
- VarianceParams(2, 2, &vpx_variance4x4_vsx)));
- #endif // HAVE_VSX
- #if HAVE_MMI
- INSTANTIATE_TEST_CASE_P(MMI, VpxMseTest,
- ::testing::Values(MseParams(4, 4, &vpx_mse16x16_mmi),
- MseParams(4, 3, &vpx_mse16x8_mmi),
- MseParams(3, 4, &vpx_mse8x16_mmi),
- MseParams(3, 3, &vpx_mse8x8_mmi)));
- INSTANTIATE_TEST_CASE_P(
- MMI, VpxVarianceTest,
- ::testing::Values(VarianceParams(6, 6, &vpx_variance64x64_mmi),
- VarianceParams(6, 5, &vpx_variance64x32_mmi),
- VarianceParams(5, 6, &vpx_variance32x64_mmi),
- VarianceParams(5, 5, &vpx_variance32x32_mmi),
- VarianceParams(5, 4, &vpx_variance32x16_mmi),
- VarianceParams(4, 5, &vpx_variance16x32_mmi),
- VarianceParams(4, 4, &vpx_variance16x16_mmi),
- VarianceParams(4, 3, &vpx_variance16x8_mmi),
- VarianceParams(3, 4, &vpx_variance8x16_mmi),
- VarianceParams(3, 3, &vpx_variance8x8_mmi),
- VarianceParams(3, 2, &vpx_variance8x4_mmi),
- VarianceParams(2, 3, &vpx_variance4x8_mmi),
- VarianceParams(2, 2, &vpx_variance4x4_mmi)));
- INSTANTIATE_TEST_CASE_P(
- MMI, VpxSubpelVarianceTest,
- ::testing::Values(
- SubpelVarianceParams(6, 6, &vpx_sub_pixel_variance64x64_mmi, 0),
- SubpelVarianceParams(6, 5, &vpx_sub_pixel_variance64x32_mmi, 0),
- SubpelVarianceParams(5, 6, &vpx_sub_pixel_variance32x64_mmi, 0),
- SubpelVarianceParams(5, 5, &vpx_sub_pixel_variance32x32_mmi, 0),
- SubpelVarianceParams(5, 4, &vpx_sub_pixel_variance32x16_mmi, 0),
- SubpelVarianceParams(4, 5, &vpx_sub_pixel_variance16x32_mmi, 0),
- SubpelVarianceParams(4, 4, &vpx_sub_pixel_variance16x16_mmi, 0),
- SubpelVarianceParams(4, 3, &vpx_sub_pixel_variance16x8_mmi, 0),
- SubpelVarianceParams(3, 4, &vpx_sub_pixel_variance8x16_mmi, 0),
- SubpelVarianceParams(3, 3, &vpx_sub_pixel_variance8x8_mmi, 0),
- SubpelVarianceParams(3, 2, &vpx_sub_pixel_variance8x4_mmi, 0),
- SubpelVarianceParams(2, 3, &vpx_sub_pixel_variance4x8_mmi, 0),
- SubpelVarianceParams(2, 2, &vpx_sub_pixel_variance4x4_mmi, 0)));
- INSTANTIATE_TEST_CASE_P(
- MMI, VpxSubpelAvgVarianceTest,
- ::testing::Values(
- SubpelAvgVarianceParams(6, 6, &vpx_sub_pixel_avg_variance64x64_mmi, 0),
- SubpelAvgVarianceParams(6, 5, &vpx_sub_pixel_avg_variance64x32_mmi, 0),
- SubpelAvgVarianceParams(5, 6, &vpx_sub_pixel_avg_variance32x64_mmi, 0),
- SubpelAvgVarianceParams(5, 5, &vpx_sub_pixel_avg_variance32x32_mmi, 0),
- SubpelAvgVarianceParams(5, 4, &vpx_sub_pixel_avg_variance32x16_mmi, 0),
- SubpelAvgVarianceParams(4, 5, &vpx_sub_pixel_avg_variance16x32_mmi, 0),
- SubpelAvgVarianceParams(4, 4, &vpx_sub_pixel_avg_variance16x16_mmi, 0),
- SubpelAvgVarianceParams(4, 3, &vpx_sub_pixel_avg_variance16x8_mmi, 0),
- SubpelAvgVarianceParams(3, 4, &vpx_sub_pixel_avg_variance8x16_mmi, 0),
- SubpelAvgVarianceParams(3, 3, &vpx_sub_pixel_avg_variance8x8_mmi, 0),
- SubpelAvgVarianceParams(3, 2, &vpx_sub_pixel_avg_variance8x4_mmi, 0),
- SubpelAvgVarianceParams(2, 3, &vpx_sub_pixel_avg_variance4x8_mmi, 0),
- SubpelAvgVarianceParams(2, 2, &vpx_sub_pixel_avg_variance4x4_mmi, 0)));
- #endif // HAVE_MMI
- } // namespace
|