aboutsummaryrefslogtreecommitdiff
path: root/src/dsp/obmc_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/dsp/obmc_test.cc')
-rw-r--r--src/dsp/obmc_test.cc64
1 files changed, 29 insertions, 35 deletions
diff --git a/src/dsp/obmc_test.cc b/src/dsp/obmc_test.cc
index 60b10c6..3672e12 100644
--- a/src/dsp/obmc_test.cc
+++ b/src/dsp/obmc_test.cc
@@ -42,18 +42,16 @@ namespace {
#include "src/dsp/obmc.inc"
constexpr int kMaxBlendingBlockSize = 64;
-constexpr int kNumSpeedTests = 1000000;
+constexpr int kNumSpeedTests = 2e8;
const char* GetDigest8bpp(int id) {
static const char* const kDigest[] = {
- "76906f87892c30c7059a5c97e4838c42", "0b8670d937217c66425f2662b51eebbe",
"c8659acd1e8ecdab06be73f0954fa1ae", "e785f31f2723a193fefd534bd6f6c18f",
"751fcd8a345fef1c38a25293c9b528c0", "69af412dfa5e96ad43b79c178cb1c58b",
"2766a64622e183bb4614f2018f14fa85", "8d98589a5cef6e68ee8fadf19d420e3c",
"19eccf31dd8cf1abcee9414128fe4141", "35019f98e30bcbc6ab624682a0628519",
"199c551164e73c100045d7ab033ffdcc", "ad5a5eb2906265690c22741b0715f37b",
- "e2152dea159249149ff4151111b73ed6", "6b44c0052789ce2fa4df882f35618e7d",
- "1edd570bec7e63780d83588f6aacda25", "b04b81c9e52c58885907dc7f1ef2c11c",
+ "e2152dea159249149ff4151111b73ed6", "1edd570bec7e63780d83588f6aacda25",
"b24ad192e151b1e0f74d1493004cb1b6", "6c1ce7ed3463cc60870e336f990d4f14",
"2e6b7a06da21512dfdd9a517d2988655", "971ba1c41ab13bb341c04f936760f546",
"55b803239d9f12888c666c5320450937", "3d0838963f8c95dafbfb8e5e25c865d2",
@@ -65,14 +63,12 @@ const char* GetDigest8bpp(int id) {
const char* GetDigestSpeed8bpp(int id) {
static const char* const kDigest[] = {
- "c5b532f5960477bdd50684ab25fae0f4", "bf76ed404bc5674e0a4ff238efceb62b",
"5ea519b616cd2998fbb9b25b4c2660cb", "f23d18197a96de48901738d130a147d9",
"07b4140c693947a63865f835089766c4", "62547d29bc4dfb2e201e9d907c09e345",
"c3988da521be50aeb9944564001b282b", "d5a8ff9ca1bd49f4260bb497c489b06c",
"b3e94f1e33c316759ebf47620327168c", "c5e64a34ca7e55f4daed19cbe4c27049",
"3b234eb729e8e79db8692c4cbe1b6667", "f9f3060a44c3a575470f9700b3c3a75b",
- "e3a1960b0a7238db1184a3f9d8e9a4b2", "721c7e8ec3aa0608b64f10f7ff5427db",
- "ba9938553703d520bc0ade427c397140", "8b6e15e8ecd234363f70f51c64b0aea1",
+ "e3a1960b0a7238db1184a3f9d8e9a4b2", "ba9938553703d520bc0ade427c397140",
"31bf64a6ed1e8002d488c0b9dcffb80a", "9ab1f3ae2e7f70cd27452f30cecfd18e",
"eaf25ac79ad70fc17ca96d8fcdf0f939", "9aaa88cb5e6b8757e37c3430bd664e70",
"8293874b2794df8fd22f5a35c3de7bee", "e9d6ee9106227c2c67ea9e6a4652e4ad",
@@ -85,14 +81,12 @@ const char* GetDigestSpeed8bpp(int id) {
#if LIBGAV1_MAX_BITDEPTH >= 10
const char* GetDigest10bpp(int id) {
static const char* const kDigest[] = {
- "6ab8f28e8fb3c4b10b23efee38d4154e", "d4374005d34e43e06c1b0c906289dadd",
"6f922e4142b644ca3f1eb0f363a1c34e", "84e7c098a9335b36082fec0bc7203075",
"40f00ea6884fea23a3b7fae59e3b02c3", "70cb92d08b4fdb6dd9c7d418cb1455d3",
"ed550798b56e70439a93cb48c359e873", "55e0d927b984e78cd51a1961e58a431d",
"482a6856b87265a82e4ea3fdadb2d95b", "0be46226ff87d74ff2ce68a83eaf9cca",
"bb4461f0131a1693a0a76f21d92a480b", "ea24f78d74c7864fb247c9a98c9b97b6",
- "d2e70b81882aeb3d9fccef89e7552a9d", "4a692ddf91905727bc524d91735cf93c",
- "f5d882ee6d9ae6f7dfa467ca99301424", "58821b87e7d9d4388d6003ffcb3723d1",
+ "d2e70b81882aeb3d9fccef89e7552a9d", "f5d882ee6d9ae6f7dfa467ca99301424",
"824ddb98eb4129b3d254c0bc7a64cd73", "5eaaafa8ef9b7ba5e2856a947e5b33df",
"071de1494e0f1b2f99266b90bdc43ddd", "c33227a96dad506adc32dacfb371ab78",
"e8a632f9fff240c439d4ae6e86795046", "26b90d74f18f9df4427b6180d48db1fc",
@@ -104,14 +98,12 @@ const char* GetDigest10bpp(int id) {
const char* GetDigestSpeed10bpp(int id) {
static const char* const kDigest[] = {
- "df59e5fd6e0237a56381f3a516806eb8", "f478bdf43e0b91b8dc9b2661eb207e49",
"80557576299708005111029cef04da53", "24f84f07f53f61cd46bdcfe1e05ff9b5",
"4dd6bc62145baa5357a4cbf6d7a6ef15", "0b7aa27cee43b8ae0c02d07887eaa225",
"9e28cdae73ca97433499c31ca79e1d07", "1cacd6466a143f88e736fffaf21e2246",
"9c7699626660d8965e06a54282a408f3", "eef893efef62b2eb4aaad06fc462819c",
"4965d0a3ff750813df85c0082b21bd4b", "ec10fd79fbf552abc595def392e9a863",
- "a148bbafdc4466fbb700b31acccca8ac", "ff0566921ff2d5145f79fbf409508fb2",
- "5da9d960988549f53b817003b93e4d01", "fa9028b2ed049ad71b5fd15f2daacbe5",
+ "a148bbafdc4466fbb700b31acccca8ac", "5da9d960988549f53b817003b93e4d01",
"b4c4f88d1fb54869ce7ff452ca7786a6", "d607f785fce62bad85102054539e7089",
"b441761ea2817e4618c594aaa11d670a", "1cc5e08e6d5f9315dbc0369b97af941d",
"568cc1a3a67ba4e6e77f54602d0ed3e3", "522f14c068f788bc284a7d1e47d623ed",
@@ -165,16 +157,19 @@ class ObmcBlendTest : public testing::TestWithParam<ObmcTestParam> {
protected:
int GetDigestId() const {
- // blending_direction_ == 0:
+ // blending_direction_ == kObmcDirectionVertical:
// (width, height):
- // (2, 2), id = 0. (2, 4), id = 1. (4, 2), id = 2.
- // (4, 4), id = 3. (4, 8), id = 4. (8, 4), id = 5.
+ // (4, 2), id = 0. (4, 4), id = 1. (4, 8), id = 2. (8, 4), id = 3.
// ...
- // blending_direction_ == 1: id starts from 13.
- const int id = (blending_direction_ == kObmcDirectionVertical) ? 0 : 13;
- if (width_ == height_) return id + 3 * (FloorLog2(width_) - 1);
- if (width_ < height_) return id + 1 + 3 * (FloorLog2(width_) - 1);
- return id + 2 + 3 * (FloorLog2(height_) - 1);
+ // blending_direction_ == kObmcDirectionHorizontal: id starts from 11.
+ // Vertical skips (2, 4) while horizontal skips (4, 2) creating a gap after
+ // (2, 4).
+ const int id = (blending_direction_ == kObmcDirectionVertical) ? 0
+ : (width_ == 2) ? 12
+ : 11;
+ if (width_ == height_) return id + 3 * (FloorLog2(width_) - 1) - 2;
+ if (width_ < height_) return id + 3 * (FloorLog2(width_) - 1) - 1;
+ return id + 3 * (FloorLog2(height_) - 1);
}
// Note |digest| is only used when |use_fixed_values| is false.
@@ -184,7 +179,7 @@ class ObmcBlendTest : public testing::TestWithParam<ObmcTestParam> {
private:
const int width_ = GetParam().width;
const int height_ = GetParam().height;
- const int blending_direction_ = GetParam().blending_direction;
+ const ObmcDirection blending_direction_ = GetParam().blending_direction;
Pixel source1_[kMaxBlendingBlockSize * kMaxBlendingBlockSize] = {};
Pixel source2_[kMaxBlendingBlockSize * kMaxBlendingBlockSize] = {};
dsp::ObmcBlendFunc func_;
@@ -223,8 +218,9 @@ void ObmcBlendTest<bitdepth, Pixel>::Test(const char* const digest,
EXPECT_TRUE(success);
} else {
test_utils::CheckMd5Digest(
- "Obmc", absl::StrFormat("%dx%d", width_, height_).c_str(), digest,
- source1_, sizeof(source1_), absl::Duration());
+ ToString(blending_direction_),
+ absl::StrFormat("%dx%d", width_, height_).c_str(), digest, source1_,
+ sizeof(source1_), absl::Duration());
}
}
@@ -256,14 +252,12 @@ void ObmcBlendTest<bitdepth, Pixel>::TestSpeed(const char* const digest,
}
memcpy(source1_, dest,
sizeof(Pixel) * kMaxBlendingBlockSize * kMaxBlendingBlockSize);
- test_utils::CheckMd5Digest("Obmc",
+ test_utils::CheckMd5Digest(ToString(blending_direction_),
absl::StrFormat("%dx%d", width_, height_).c_str(),
digest, source1_, sizeof(source1_), elapsed_time);
}
const ObmcTestParam kObmcTestParam[] = {
- ObmcTestParam(2, 2, kObmcDirectionVertical),
- ObmcTestParam(2, 4, kObmcDirectionVertical),
ObmcTestParam(4, 2, kObmcDirectionVertical),
ObmcTestParam(4, 4, kObmcDirectionVertical),
ObmcTestParam(4, 8, kObmcDirectionVertical),
@@ -275,9 +269,7 @@ const ObmcTestParam kObmcTestParam[] = {
ObmcTestParam(16, 32, kObmcDirectionVertical),
ObmcTestParam(32, 16, kObmcDirectionVertical),
ObmcTestParam(32, 32, kObmcDirectionVertical),
- ObmcTestParam(2, 2, kObmcDirectionHorizontal),
ObmcTestParam(2, 4, kObmcDirectionHorizontal),
- ObmcTestParam(4, 2, kObmcDirectionHorizontal),
ObmcTestParam(4, 4, kObmcDirectionHorizontal),
ObmcTestParam(4, 8, kObmcDirectionHorizontal),
ObmcTestParam(8, 4, kObmcDirectionHorizontal),
@@ -301,9 +293,8 @@ TEST_P(ObmcBlendTest8bpp, Blending) {
}
TEST_P(ObmcBlendTest8bpp, DISABLED_Speed) {
- TestSpeed(
- GetDigestSpeed8bpp(GetDigestId()),
- (kNumSpeedTests * 32 * 32) / (GetParam().height * GetParam().width));
+ TestSpeed(GetDigestSpeed8bpp(GetDigestId()),
+ kNumSpeedTests / (GetParam().height * GetParam().width));
}
INSTANTIATE_TEST_SUITE_P(C, ObmcBlendTest8bpp,
@@ -331,9 +322,8 @@ TEST_P(ObmcBlendTest10bpp, Blending) {
}
TEST_P(ObmcBlendTest10bpp, DISABLED_Speed) {
- TestSpeed(
- GetDigestSpeed10bpp(GetDigestId()),
- (kNumSpeedTests * 32 * 32) / (GetParam().height * GetParam().width));
+ TestSpeed(GetDigestSpeed10bpp(GetDigestId()),
+ kNumSpeedTests / (GetParam().height * GetParam().width));
}
INSTANTIATE_TEST_SUITE_P(C, ObmcBlendTest10bpp,
@@ -342,6 +332,10 @@ INSTANTIATE_TEST_SUITE_P(C, ObmcBlendTest10bpp,
INSTANTIATE_TEST_SUITE_P(SSE41, ObmcBlendTest10bpp,
testing::ValuesIn(kObmcTestParam));
#endif
+#if LIBGAV1_ENABLE_NEON
+INSTANTIATE_TEST_SUITE_P(NEON, ObmcBlendTest10bpp,
+ testing::ValuesIn(kObmcTestParam));
+#endif
#endif // LIBGAV1_MAX_BITDEPTH >= 10
} // namespace