From: Luc Trudeau Date: Wed, 13 Jun 2018 17:36:17 +0000 (-0400) Subject: Add Speed Tests for the SADTest test suite. X-Git-Tag: v1.8.0~618 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f950248b9b357b21e974e3ace94359d7ee8c7b29;p=libvpx Add Speed Tests for the SADTest test suite. Speed tests are added for the SADTest test suite. These test use the AbstractBench and print the median run time of SAD operations. Speed tests are disabled by default. Change-Id: I5d0957248f9b5b307ae2d757d5f8d4761a1dd712 --- diff --git a/test/sad_test.cc b/test/sad_test.cc index 620cd3a2f..0d6870d50 100644 --- a/test/sad_test.cc +++ b/test/sad_test.cc @@ -17,6 +17,7 @@ #include "./vpx_config.h" #include "./vpx_dsp_rtcd.h" #include "test/acm_random.h" +#include "test/bench.h" #include "test/clear_system_state.h" #include "test/register_state_check.h" #include "test/util.h" @@ -265,7 +266,7 @@ class SADx4Test : public SADTestBase { } }; -class SADTest : public SADTestBase { +class SADTest : public AbstractBench, public SADTestBase { public: SADTest() : SADTestBase(GetParam()) {} @@ -285,6 +286,11 @@ class SADTest : public SADTestBase { ASSERT_EQ(reference_sad, exp_sad); } + + void Run() { + params_.func(source_data_, source_stride_, reference_data_, + reference_stride_); + } }; class SADavgTest : public SADTestBase { @@ -351,6 +357,17 @@ TEST_P(SADTest, ShortSrc) { source_stride_ = tmp_stride; } +TEST_P(SADTest, DISABLED_Speed) { + const int kCountSpeedTestBlock = 50000000 / (params_.width * params_.height); + FillRandom(source_data_, source_stride_); + + RunNTimes(kCountSpeedTestBlock); + + char title[16]; + snprintf(title, sizeof(title), "%dx%d", params_.width, params_.height); + PrintMedian(title); +} + TEST_P(SADavgTest, MaxRef) { FillConstant(source_data_, source_stride_, 0); FillConstant(reference_data_, reference_stride_, mask_);