1*09537850SAkhilesh Sanikop // Copyright 2021 The libgav1 Authors
2*09537850SAkhilesh Sanikop //
3*09537850SAkhilesh Sanikop // Licensed under the Apache License, Version 2.0 (the "License");
4*09537850SAkhilesh Sanikop // you may not use this file except in compliance with the License.
5*09537850SAkhilesh Sanikop // You may obtain a copy of the License at
6*09537850SAkhilesh Sanikop //
7*09537850SAkhilesh Sanikop // http://www.apache.org/licenses/LICENSE-2.0
8*09537850SAkhilesh Sanikop //
9*09537850SAkhilesh Sanikop // Unless required by applicable law or agreed to in writing, software
10*09537850SAkhilesh Sanikop // distributed under the License is distributed on an "AS IS" BASIS,
11*09537850SAkhilesh Sanikop // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12*09537850SAkhilesh Sanikop // See the License for the specific language governing permissions and
13*09537850SAkhilesh Sanikop // limitations under the License.
14*09537850SAkhilesh Sanikop
15*09537850SAkhilesh Sanikop #include "src/dsp/convolve.h"
16*09537850SAkhilesh Sanikop
17*09537850SAkhilesh Sanikop #include <algorithm>
18*09537850SAkhilesh Sanikop #include <cassert>
19*09537850SAkhilesh Sanikop #include <cstddef>
20*09537850SAkhilesh Sanikop #include <cstdint>
21*09537850SAkhilesh Sanikop #include <cstdio>
22*09537850SAkhilesh Sanikop #include <cstring>
23*09537850SAkhilesh Sanikop #include <ostream>
24*09537850SAkhilesh Sanikop #include <string>
25*09537850SAkhilesh Sanikop #include <tuple>
26*09537850SAkhilesh Sanikop
27*09537850SAkhilesh Sanikop #include "absl/strings/match.h"
28*09537850SAkhilesh Sanikop #include "absl/strings/str_format.h"
29*09537850SAkhilesh Sanikop #include "absl/strings/string_view.h"
30*09537850SAkhilesh Sanikop #include "absl/time/clock.h"
31*09537850SAkhilesh Sanikop #include "absl/time/time.h"
32*09537850SAkhilesh Sanikop #include "gtest/gtest.h"
33*09537850SAkhilesh Sanikop #include "src/dsp/constants.h"
34*09537850SAkhilesh Sanikop #include "src/dsp/dsp.h"
35*09537850SAkhilesh Sanikop #include "src/utils/common.h"
36*09537850SAkhilesh Sanikop #include "src/utils/compiler_attributes.h"
37*09537850SAkhilesh Sanikop #include "src/utils/constants.h"
38*09537850SAkhilesh Sanikop #include "src/utils/cpu.h"
39*09537850SAkhilesh Sanikop #include "src/utils/memory.h"
40*09537850SAkhilesh Sanikop #include "tests/block_utils.h"
41*09537850SAkhilesh Sanikop #include "tests/third_party/libvpx/acm_random.h"
42*09537850SAkhilesh Sanikop #include "tests/third_party/libvpx/md5_helper.h"
43*09537850SAkhilesh Sanikop #include "tests/utils.h"
44*09537850SAkhilesh Sanikop
45*09537850SAkhilesh Sanikop namespace libgav1 {
46*09537850SAkhilesh Sanikop namespace dsp {
47*09537850SAkhilesh Sanikop namespace {
48*09537850SAkhilesh Sanikop
49*09537850SAkhilesh Sanikop // The convolve function will access at most (block_height + 7) rows/columns
50*09537850SAkhilesh Sanikop // from the beginning.
51*09537850SAkhilesh Sanikop constexpr int kMaxBlockWidth = kMaxSuperBlockSizeInPixels + kSubPixelTaps;
52*09537850SAkhilesh Sanikop constexpr int kMaxBlockHeight = kMaxSuperBlockSizeInPixels + kSubPixelTaps;
53*09537850SAkhilesh Sanikop
54*09537850SAkhilesh Sanikop // Test all the filters in |kSubPixelFilters|. There are 6 different filters but
55*09537850SAkhilesh Sanikop // filters [4] and [5] are only reached through GetFilterIndex().
56*09537850SAkhilesh Sanikop constexpr int kMinimumViableRuns = 4 * 16;
57*09537850SAkhilesh Sanikop
58*09537850SAkhilesh Sanikop struct ConvolveTestParam {
59*09537850SAkhilesh Sanikop enum BlockSize {
60*09537850SAkhilesh Sanikop kBlockSize2x2,
61*09537850SAkhilesh Sanikop kBlockSize2x4,
62*09537850SAkhilesh Sanikop kBlockSize4x2,
63*09537850SAkhilesh Sanikop kBlockSize4x4,
64*09537850SAkhilesh Sanikop kBlockSize4x8,
65*09537850SAkhilesh Sanikop kBlockSize8x2,
66*09537850SAkhilesh Sanikop kBlockSize8x4,
67*09537850SAkhilesh Sanikop kBlockSize8x8,
68*09537850SAkhilesh Sanikop kBlockSize8x16,
69*09537850SAkhilesh Sanikop kBlockSize16x8,
70*09537850SAkhilesh Sanikop kBlockSize16x16,
71*09537850SAkhilesh Sanikop kBlockSize16x32,
72*09537850SAkhilesh Sanikop kBlockSize32x16,
73*09537850SAkhilesh Sanikop kBlockSize32x32,
74*09537850SAkhilesh Sanikop kBlockSize32x64,
75*09537850SAkhilesh Sanikop kBlockSize64x32,
76*09537850SAkhilesh Sanikop kBlockSize64x64,
77*09537850SAkhilesh Sanikop kBlockSize64x128,
78*09537850SAkhilesh Sanikop kBlockSize128x64,
79*09537850SAkhilesh Sanikop kBlockSize128x128,
80*09537850SAkhilesh Sanikop kNumBlockSizes
81*09537850SAkhilesh Sanikop };
82*09537850SAkhilesh Sanikop
83*09537850SAkhilesh Sanikop static constexpr int kBlockWidth[kNumBlockSizes] = {
84*09537850SAkhilesh Sanikop 2, 2, 4, 4, 4, 8, 8, 8, 8, 16, 16, 16, 32, 32, 32, 64, 64, 64, 128, 128};
85*09537850SAkhilesh Sanikop static constexpr int kBlockHeight[kNumBlockSizes] = {
86*09537850SAkhilesh Sanikop 2, 4, 2, 4, 8, 2, 4, 8, 16, 8, 16, 32, 16, 32, 64, 32, 64, 128, 64, 128};
87*09537850SAkhilesh Sanikop
ConvolveTestParamlibgav1::dsp::__anon4b3d96e80111::ConvolveTestParam88*09537850SAkhilesh Sanikop explicit ConvolveTestParam(BlockSize block_size)
89*09537850SAkhilesh Sanikop : block_size(block_size),
90*09537850SAkhilesh Sanikop width(kBlockWidth[block_size]),
91*09537850SAkhilesh Sanikop height(kBlockHeight[block_size]) {}
92*09537850SAkhilesh Sanikop
93*09537850SAkhilesh Sanikop BlockSize block_size;
94*09537850SAkhilesh Sanikop int width;
95*09537850SAkhilesh Sanikop int height;
96*09537850SAkhilesh Sanikop };
97*09537850SAkhilesh Sanikop
98*09537850SAkhilesh Sanikop #if !LIBGAV1_CXX17
99*09537850SAkhilesh Sanikop constexpr int ConvolveTestParam::kBlockWidth[kNumBlockSizes]; // static.
100*09537850SAkhilesh Sanikop constexpr int ConvolveTestParam::kBlockHeight[kNumBlockSizes]; // static.
101*09537850SAkhilesh Sanikop #endif
102*09537850SAkhilesh Sanikop
GetConvolveDigest8bpp(int id)103*09537850SAkhilesh Sanikop const char* GetConvolveDigest8bpp(int id) {
104*09537850SAkhilesh Sanikop // Entries containing 'XXXXX...' are skipped. See the test for details.
105*09537850SAkhilesh Sanikop static const char* const kDigest[ConvolveTestParam::kNumBlockSizes * 16] = {
106*09537850SAkhilesh Sanikop "ae5977a4ceffbac0cde72a04a43a9d57", "6cf5f791fe0d8dcd3526be3c6b814035",
107*09537850SAkhilesh Sanikop "d905dfcad930aded7718587c05b48aaf", "6baf153feff04cc5b7e87c0bb60a905d",
108*09537850SAkhilesh Sanikop "871ed5a69ca31e6444faa720895949bf", "c9cf1deba08dac5972b3b0a43eff8f98",
109*09537850SAkhilesh Sanikop "68e2f90eaa0ab5da7e6f5776993f7eea", "f1f8282fb33c30eb68c0c315b7a4bc01",
110*09537850SAkhilesh Sanikop "9412064b0eebf8123f23d74147d04dff", "cc08936effe309ab9a4fa1bf7e28e24e",
111*09537850SAkhilesh Sanikop "36cbef36fa21b98df03536c918bf752a", "9d0da6321cf5311ea0bdd41271763030",
112*09537850SAkhilesh Sanikop "55a10165ee8a660d7dddacf7de558cdd", "ac7fc9f9ea7213743fae5a023faaaf08",
113*09537850SAkhilesh Sanikop "077e1b7b355c7ab3ca40230ee8efd8ea", "7a3e8de2a1caae206cf3e51a86dfd15a",
114*09537850SAkhilesh Sanikop "1ddf9020f18fa7883355cf8c0881186a", "2377dd167ef2707978bed6f10ffd4e76",
115*09537850SAkhilesh Sanikop "f918e0e4422967c6a7e47298135c7ae9", "b2264e129636368b5496760b39e64b7a",
116*09537850SAkhilesh Sanikop "1168251e6261e2ff1fa69a93226dbd76", "4821befdf63f8c6da6440afeb57f320f",
117*09537850SAkhilesh Sanikop "c30fc44d83821141e84cc4793e127301", "a8293b933d9f2e5d7f922ea40111d643",
118*09537850SAkhilesh Sanikop "354a54861a94e8b027afd9931e61f997", "b384e9e3d81f9f4f9024028fbe451d8b",
119*09537850SAkhilesh Sanikop "eeeb8589c1b31cbb565154736ca939ec", "f49dab626ddd977ed171f79295c24935",
120*09537850SAkhilesh Sanikop "78d2f27e0d4708cb16856d7d40dc16fb", "9d2393ea156a1c2083f5b4207793064b",
121*09537850SAkhilesh Sanikop "a9c62745b95c66fa497a524886af57e2", "2c614ec4463386ec075a0f1dbb587933",
122*09537850SAkhilesh Sanikop "7a8856480d752153370240b066b90f6a", "beaef1dbffadc701fccb7c18a03e3a41",
123*09537850SAkhilesh Sanikop "72b1e700c949d06eaf62d664dafdb5b6", "684f5c3a25a080edaf79add6e9137a8e",
124*09537850SAkhilesh Sanikop "3be970f49e4288988818b087201d54da", "d2b9dba2968894a414756bb510ac389a",
125*09537850SAkhilesh Sanikop "9a3215eb97aedbbddd76c7440837d040", "4e317feac6da46addf0e8b9d8d54304b",
126*09537850SAkhilesh Sanikop "d2f5ca2b7958c332a3fb771f66da01f0", "7aec92c3b65e456b64ae285c12b03b0d",
127*09537850SAkhilesh Sanikop "f72a99ad63f6a88c23724e898b705d21", "07a1f07f114c4a38ba08d2f44e1e1132",
128*09537850SAkhilesh Sanikop "26b9de95edb45b31ac5aa19825831c7a", "4e4677a0623d44237eb8d6a622cdc526",
129*09537850SAkhilesh Sanikop "c1b836a6ce023663b90db0e320389414", "5befcf222152ebc8d779fcc10b95320a",
130*09537850SAkhilesh Sanikop "62adf407fc27d8682ced4dd7b55af14e", "35be0786a072bf2f1286989261bf6580",
131*09537850SAkhilesh Sanikop "90562fc42dc5d879ae74c4909c1dec30", "a1427352f9e413975a0949e2b300c657",
132*09537850SAkhilesh Sanikop "bcbc418bc2beb243e463851cd95335a9", "cb8fedcbecee3947358dc61f95e56530",
133*09537850SAkhilesh Sanikop "0d0154a7d573685285a83a4cf201ac57", "b14bd8068f108905682b83cc15778065",
134*09537850SAkhilesh Sanikop "c96c867d998473197dde9b587be14e3a", "f596c63c7b14cada0174e17124c83942",
135*09537850SAkhilesh Sanikop "eb2822ad8204ed4ecbf0f30fcb210498", "538ce869ffd23b6963e61badfab7712b",
136*09537850SAkhilesh Sanikop "6bbcc075f8b768a02cdc9149f150326d", "4ae70d9db2ec36885394db7d59bdd4f7",
137*09537850SAkhilesh Sanikop "5fee162fe52c11c823db4d5ede370654", "9365186c59ef66d9def40f437022ad93",
138*09537850SAkhilesh Sanikop "0f95fb0276c9c7910937fbdf75f2811d", "356d4003477283e157c8d2b5a79d913c",
139*09537850SAkhilesh Sanikop "b355dab2dbb6f5869018563eece22862", "cf6ff8c43d8059cea6090a23ab66a0ef",
140*09537850SAkhilesh Sanikop "a336f8b7bcf188840ca65c0d0e66518a", "de953f03895923359c6a719e6a537b89",
141*09537850SAkhilesh Sanikop "8463ade9347ed602663e2cec5c4c3fe6", "392de11ffcd5c2ecf3db3480ee135340",
142*09537850SAkhilesh Sanikop "bddd31e3e852712e6244b616622af83d", "30a36245c40d978fc8976b442a8600c3",
143*09537850SAkhilesh Sanikop "93aa662b988b8502e5ea95659eafde59", "70440ba9ee7f9d16d297dbb49e54a56e",
144*09537850SAkhilesh Sanikop "1eb2be4c05b50e427e29c72fa566bff5", "52c0980bae63e8459e82eee7d8af2334",
145*09537850SAkhilesh Sanikop "75e57104d6058cd2bce1d3d8142d273d", "b4c735269ade44419169adbd852d5ddc",
146*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
147*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "a7305087fae23de53d21a6909009ff69",
148*09537850SAkhilesh Sanikop "8dcce009395264379c1a51239f4bb22c", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
149*09537850SAkhilesh Sanikop "8dcce009395264379c1a51239f4bb22c", "d90a69e7bae8aa46ed0e1e5f911d7a07",
150*09537850SAkhilesh Sanikop "6ab4dc87be03be1dcc5d956ca819d938", "6ab4dc87be03be1dcc5d956ca819d938",
151*09537850SAkhilesh Sanikop "8f2afdb2f03cd04ffacd421b958caaa0", "710ccecc103033088d898a2b924551fb",
152*09537850SAkhilesh Sanikop "710ccecc103033088d898a2b924551fb", "a4093e3e5902dd659407ce6471635a4e",
153*09537850SAkhilesh Sanikop "375d7f5358d7a088a498b8b3aaecc0d5", "375d7f5358d7a088a498b8b3aaecc0d5",
154*09537850SAkhilesh Sanikop "08867ea5cc38c705ec52af821bc4736a", "2afb540e8063f58d1b03896486c5e89b",
155*09537850SAkhilesh Sanikop "2afb540e8063f58d1b03896486c5e89b", "6ce47b11d2e60c5d183c84ce9f2e46cc",
156*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
157*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "a5a1ac658d7ce4a846a32b9fcfaa3475",
158*09537850SAkhilesh Sanikop "2370f4e4a83edf91b7f504bbe4b00e90", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
159*09537850SAkhilesh Sanikop "ae5464066a049622a7a264cdf9394b55", "45368b6db3d1fee739a64b0bc823ea9c",
160*09537850SAkhilesh Sanikop "8dff0f28192d9f8c0bf7fb5405719dd8", "632738ef3ff3021cff45045c41978849",
161*09537850SAkhilesh Sanikop "f7ec43384037e8d6c618e0df826ec029", "a6bc648197781a2dc99c487e66464320",
162*09537850SAkhilesh Sanikop "1112ebd509007154c72c5a485b220b62", "9714c4ce636b6fb0ad05cba246d48c76",
163*09537850SAkhilesh Sanikop "2c93dde8884f09fb5bb5ad6d95cde86d", "a49e6160b5d1b56bc2046963101cd606",
164*09537850SAkhilesh Sanikop "7f084953976111e9f65b57876e7552b1", "0846ec82555b66197c5c45b08240fbcc",
165*09537850SAkhilesh Sanikop "ca7471c126ccd22189e874f0a6e41960", "0802b6318fbd0969a33de8fdfcd07f10",
166*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
167*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "3b1ceebf0579fcbbfd6136938c595b91",
168*09537850SAkhilesh Sanikop "ecafabcad1045f15d31ce2f3b13132f2", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
169*09537850SAkhilesh Sanikop "5f211eba020e256a5781b203c5aa1d2e", "3b04497634364dd2cd3f2482b5d4b32f",
170*09537850SAkhilesh Sanikop "a8ac7b5dc65ffb758b0643508a0e744e", "561ed8be43c221a561f8885a0d74c7ef",
171*09537850SAkhilesh Sanikop "8159619fc234598c8c75154d80021fd4", "8f43645dce92cf7594aa4822aa53b17d",
172*09537850SAkhilesh Sanikop "b6ccddb7dfa4eddc87b4eff08b5a3195", "b4e605327b28db573d88844a1a09db8d",
173*09537850SAkhilesh Sanikop "15b00a15d1cc6cc96ca85d00b167e4dd", "7bf911888c11a9fefd604b8b9c82e9a1",
174*09537850SAkhilesh Sanikop "bfb69b4d7d4aed73cfa75a0f55b66440", "034d1d62581bd0d840c4cf1e28227931",
175*09537850SAkhilesh Sanikop "8cba849640e9e2859d509bc81ca94acd", "bc79acf2a0fe419194cdb4529bc7dcc8",
176*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
177*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "3bfad931bce82335219e0e29c15f2b21",
178*09537850SAkhilesh Sanikop "68a701313d2247d2b32636ebc1f2a008", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
179*09537850SAkhilesh Sanikop "05afe1f40d37a45a97a5e0aadd5066fb", "9e1f0e0bddb58d15d0925eeaede9b84c",
180*09537850SAkhilesh Sanikop "03313cdaa593a1a7b4869010dcc7b241", "88a50d2b4107ee5b5074b2520183f8ac",
181*09537850SAkhilesh Sanikop "ac50ea9f7306da95a5092709442989cf", "739b17591437edffd36799237b962658",
182*09537850SAkhilesh Sanikop "b8a7eb7dd9c216e240517edfc6489397", "75b755f199dbf4a0e5ebbb86c2bd871d",
183*09537850SAkhilesh Sanikop "31b0017ba1110e3d70b020901bc15564", "0a1aa8f5ecfd11ddba080af0051c576a",
184*09537850SAkhilesh Sanikop "536181ee90de883cc383787aec089221", "29f82b0f3e4113944bd28aacd9b8489a",
185*09537850SAkhilesh Sanikop "ee3e76371240d1f1ff811cea6a7d4f63", "17a20dbbf09feae557d40aa5818fbe76",
186*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
187*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "6baf153feff04cc5b7e87c0bb60a905d",
188*09537850SAkhilesh Sanikop "871ed5a69ca31e6444faa720895949bf", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
189*09537850SAkhilesh Sanikop "68e2f90eaa0ab5da7e6f5776993f7eea", "f1f8282fb33c30eb68c0c315b7a4bc01",
190*09537850SAkhilesh Sanikop "9412064b0eebf8123f23d74147d04dff", "cc08936effe309ab9a4fa1bf7e28e24e",
191*09537850SAkhilesh Sanikop "36cbef36fa21b98df03536c918bf752a", "9d0da6321cf5311ea0bdd41271763030",
192*09537850SAkhilesh Sanikop "55a10165ee8a660d7dddacf7de558cdd", "ac7fc9f9ea7213743fae5a023faaaf08",
193*09537850SAkhilesh Sanikop "077e1b7b355c7ab3ca40230ee8efd8ea", "7a3e8de2a1caae206cf3e51a86dfd15a",
194*09537850SAkhilesh Sanikop "1ddf9020f18fa7883355cf8c0881186a", "2377dd167ef2707978bed6f10ffd4e76",
195*09537850SAkhilesh Sanikop "f918e0e4422967c6a7e47298135c7ae9", "b2264e129636368b5496760b39e64b7a",
196*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
197*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "4cfad2c437084a93ea76913e21c2dd89",
198*09537850SAkhilesh Sanikop "d372f0c17bce98855d6d59fbee814c3d", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
199*09537850SAkhilesh Sanikop "d99ffd2579eb781c30bc0df7b76ad61e", "4e139e57cbb049a0f4ef816adc48d026",
200*09537850SAkhilesh Sanikop "be53b2507048e7ff50226d15c0b28865", "b73f3c1a10405de89d1f9e812ff73b5a",
201*09537850SAkhilesh Sanikop "c7d51b1f2df49ab83962257e8a5934e5", "159e443d79cc59b11ca4a80aa7aa09be",
202*09537850SAkhilesh Sanikop "6ef14b14882e1465b0482b0e0b16d8ce", "22a8d287b425c870f40c64a50f91ce54",
203*09537850SAkhilesh Sanikop "f1d96db5a2e0a2160df38bd96d28d19b", "637d1e5221422dfe9a6dbcfd7f62ebdd",
204*09537850SAkhilesh Sanikop "f275af4f1f350ffaaf650310cb5dddec", "f81c4d6b001a14584528880fa6988a87",
205*09537850SAkhilesh Sanikop "a5a2f9c2e7759d8a3dec1bc4b56be587", "2317c57ab69a36eb3bf278cf8a8795a3",
206*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
207*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "1a0bdfc96a3b9fd904e658f238ab1076",
208*09537850SAkhilesh Sanikop "56d16e54afe205e97527902770e71c71", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
209*09537850SAkhilesh Sanikop "1f7b5b8282ff3cf4d8e8c52d80ef5b4d", "79e9e260a2028c5fe320005c272064b9",
210*09537850SAkhilesh Sanikop "2418ebcdf85551b9ae6e3725f04aae6d", "98bdf907ebacacb734c9eef1ee727c6e",
211*09537850SAkhilesh Sanikop "4dd5672d53c8f359e8f80badaa843dfc", "a1bef519bbf07138e2eec5a91694de46",
212*09537850SAkhilesh Sanikop "df1cb51fe1a937cd7834e973dc5cb814", "317fe65abf81ef3ea07976ef8667baeb",
213*09537850SAkhilesh Sanikop "2da29da97806ae0ee300c5e69c35a4aa", "555475f5d1685638169ab904447e4f13",
214*09537850SAkhilesh Sanikop "b3e3a6234e8045e6182cf90a09f767b2", "849dfeca59074525dea59681a7f88ab4",
215*09537850SAkhilesh Sanikop "39a68af80be11e1682b6f3c4ede33530", "b22d765af176d87e7d3048b4b89b86ad",
216*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
217*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "b8a710baa6a9fc784909671d450ecd99",
218*09537850SAkhilesh Sanikop "f9e6a56382d8d12da676d6631bb6ef75", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
219*09537850SAkhilesh Sanikop "3bf8e11e18527b16f0d7c0361d74a52d", "b9ff54c6f1e3b41fc7fc0f3fa0e75cf2",
220*09537850SAkhilesh Sanikop "06ef1504f31af5f173d3317866ca57cb", "635e8ee11cf04d73598549234ad732a0",
221*09537850SAkhilesh Sanikop "fab693410d59ee88aa2895527efc31ac", "3041eb26c23a63a587fbec623919e2d2",
222*09537850SAkhilesh Sanikop "c61d99d5daf575664fb7ad64976f4b03", "822f6c4eb5db760468d822b21f48d94d",
223*09537850SAkhilesh Sanikop "3f6fcb9fae3666e085b9e29002a802fc", "d9b9fecd195736a6049c528d4cb886b5",
224*09537850SAkhilesh Sanikop "fed17fc391e6c3db4aa14ea1d6596c87", "d0d3482d981989e117cbb32fc4550267",
225*09537850SAkhilesh Sanikop "39561688bf6680054edbfae6035316ce", "087c5992ca6f829e1ba4ba5332d67947",
226*09537850SAkhilesh Sanikop };
227*09537850SAkhilesh Sanikop assert(id >= 0);
228*09537850SAkhilesh Sanikop assert(id < sizeof(kDigest) / sizeof(kDigest[0]));
229*09537850SAkhilesh Sanikop return kDigest[id];
230*09537850SAkhilesh Sanikop }
231*09537850SAkhilesh Sanikop
GetConvolveScaleDigest8bpp(int id)232*09537850SAkhilesh Sanikop const char* GetConvolveScaleDigest8bpp(int id) {
233*09537850SAkhilesh Sanikop // Entries containing 'XXXXX...' are skipped. See the test for details.
234*09537850SAkhilesh Sanikop static const char* const kDigest[ConvolveTestParam::kNumBlockSizes * 2] = {
235*09537850SAkhilesh Sanikop "0291a23f2ac4c40b5d8e957e63769904", "1d48447857472d6455af10d5526f6827",
236*09537850SAkhilesh Sanikop "409b2278d6d372248f1891ca0dd12760", "9e416606a3f82fe5bb3f7182e4f42c2d",
237*09537850SAkhilesh Sanikop "e126563f859ddd5c5ffde6f641168fad", "9bad4f1b7e1865f814b6fd5620816ebd",
238*09537850SAkhilesh Sanikop "50e5e5a57185477cb2af83490c33b47c", "3d2fb301c61d7fbd0e21ac263f7ac552",
239*09537850SAkhilesh Sanikop "5920032c6432c80c6e5e61b684018d13", "07ada64d24339488cdce492e6e0c6b0d",
240*09537850SAkhilesh Sanikop "aaf1589aff6d062a87c627ab9ba20e3e", "91adf91bb24d2c4ea3f882bdf7396e33",
241*09537850SAkhilesh Sanikop "1d17a932a68bb1f199f709e7725fe44b", "07716c63afda034cb386511ea25a63b5",
242*09537850SAkhilesh Sanikop "cca17ef3324c41d189e674a059ef1255", "37d17e70619823a606c0b5f74bf2e33b",
243*09537850SAkhilesh Sanikop "ba8ed5474c187c8e8d7f82a6a29ee860", "27663f037973ebe82ec10252a4d91299",
244*09537850SAkhilesh Sanikop "24c27e187e8d5a2bbfa0fef9046d3eb0", "9854fdc91a48e3bd4639edcc940e5c09",
245*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
246*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "a71907c60a9f1f81972a2859ae54a805",
247*09537850SAkhilesh Sanikop "817bc3bf0c77abc4186eac39f2320184", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
248*09537850SAkhilesh Sanikop "4e7182a8b226982e2678abcf5f83325d", "50cef7c6e57544135f102226bb95bed9",
249*09537850SAkhilesh Sanikop "225e054dbcfff05b1c8b0792c731449e", "16eb63f03839159f3af0e08be857170f",
250*09537850SAkhilesh Sanikop "c8e5d111a2e3f4487330a8bd893cb894", "4fd99eaf9c160442aab35b9bdc5d275b",
251*09537850SAkhilesh Sanikop "8b0f61bfb30747d4c9215618ac42557c", "1df78022da202cefb9a8100b114152d9",
252*09537850SAkhilesh Sanikop "378466e1eda63dbc03565b78af8e723f", "28ea721411fbf5fc805035be9a384140",
253*09537850SAkhilesh Sanikop "4fed5d4163a3bfcc6726a42f20410b0a", "55abfca0c820771bd926e4b94f66a499",
254*09537850SAkhilesh Sanikop "6c8b8ef0a78859c768e629e1decc0019", "d0ead286b5ba3841d24dd114efbfef0a",
255*09537850SAkhilesh Sanikop };
256*09537850SAkhilesh Sanikop assert(id >= 0);
257*09537850SAkhilesh Sanikop assert(id < sizeof(kDigest) / sizeof(kDigest[0]));
258*09537850SAkhilesh Sanikop return kDigest[id];
259*09537850SAkhilesh Sanikop }
260*09537850SAkhilesh Sanikop
261*09537850SAkhilesh Sanikop #if LIBGAV1_MAX_BITDEPTH >= 10
GetConvolveDigest10bpp(int id)262*09537850SAkhilesh Sanikop const char* GetConvolveDigest10bpp(int id) {
263*09537850SAkhilesh Sanikop // Entries containing 'XXXXX...' are skipped. See the test for details.
264*09537850SAkhilesh Sanikop static const char* const kDigest[ConvolveTestParam::kNumBlockSizes * 16] = {
265*09537850SAkhilesh Sanikop "b1b6903d60501c7bc11e5285beb26a52", "a7855ed75772d7fa815978a202bbcd9f",
266*09537850SAkhilesh Sanikop "bde291a4e8087c085fe8b3632f4d7351", "238980eebc9e63ae3eea2771c7a70f12",
267*09537850SAkhilesh Sanikop "0eac13431bd7d8a573318408a72246d5", "d05a237ed7a9ca877256b71555b1b8e4",
268*09537850SAkhilesh Sanikop "73438155feb62595e3e406921102d748", "5871e0e88a776840d619670fbf107858",
269*09537850SAkhilesh Sanikop "1c6376ce55c9ee9e35d432edb1ffb3b7", "d675e0195c9feca956e637f3f1959f40",
270*09537850SAkhilesh Sanikop "b5681673903ade13d69e295f82fdd009", "3c43020105ae93a301404b4cd6238654",
271*09537850SAkhilesh Sanikop "dd2c5880a94ed3758bfea0b0e8c78286", "4ebb1a7b25a39d8b9868ec8a1243103f",
272*09537850SAkhilesh Sanikop "d34ec07845cd8523651e5f5112984a14", "2ce55308d873f4cd244f16da2b06e06e",
273*09537850SAkhilesh Sanikop "a4bb5d5ff4b25f391265b5231049a09a", "c9106e0c820b03bcdde3aa94efc11a3e",
274*09537850SAkhilesh Sanikop "7ec2eae9e118506da8b33440b399511a", "78de867c8ee947ed6d29055747f26949",
275*09537850SAkhilesh Sanikop "a693b4bd0334a3b98d45e67d3985bb63", "156de3172d9acf3c7f251cd7a18ad461",
276*09537850SAkhilesh Sanikop "e545b8a3ff958f8363c7968cbae96732", "7842b2047356c1417d9d88219707f1a1",
277*09537850SAkhilesh Sanikop "1a487c658d684314d91bb6d961a94672", "94b3e5bcd6b849b66a4571ec3d23f9be",
278*09537850SAkhilesh Sanikop "0635a296be01b7e641de98ee27c33cd2", "82dc120bf8c2043bc5eee81007309ebf",
279*09537850SAkhilesh Sanikop "58c826cad3c14cdf26a649265758c58b", "f166254037c0dfb140f54cd7b08bddfe",
280*09537850SAkhilesh Sanikop "74ab206f14ac5f62653cd3dd71a7916d", "5621caef7cc1d6522903290ccc5c2cb8",
281*09537850SAkhilesh Sanikop "78ec6cf42cce4b1feb65e076c78ca241", "42188e2dbb4e02cd353552ea147ad03f",
282*09537850SAkhilesh Sanikop "f9813870fc27941a7c00a0443d7c2fe7", "20b14a6b5af7aa356963bcaaf23d230d",
283*09537850SAkhilesh Sanikop "9c9c41435697f75fa118b6d6464ee7cb", "38816245ed832ba313fefafcbed1e5c8",
284*09537850SAkhilesh Sanikop "5d34137cc8ddba75347b0fa1d0a91791", "465dcb046a0449b9dfb3e0b297aa3863",
285*09537850SAkhilesh Sanikop "3e787534dff83c22b3033750e448865a", "4c91f676a054d582bcae1ca9adb87a31",
286*09537850SAkhilesh Sanikop "eab5894046a99ad0a1a12c91b0f37bd7", "765b4cfbfc1a4988878c412d53bcb597",
287*09537850SAkhilesh Sanikop "bc63b29ec78c1efec5543885a45bb822", "91d6bdbc62d4bb80c9b371d9704e3c9e",
288*09537850SAkhilesh Sanikop "cecd57396a0033456408f3f3554c6912", "5b37f94ef136c1eb9a6181c19491459c",
289*09537850SAkhilesh Sanikop "716ba3a25b454e44b46caa42622c128c", "9076f58c4ab20f2f06d701a6b53b1c4f",
290*09537850SAkhilesh Sanikop "d3212ab3922f147c3cf126c3b1aa17f6", "b55fea77f0e14a8bf8b6562b766fe91f",
291*09537850SAkhilesh Sanikop "59b578268ff26a1e21c5b4273f73f852", "16761e7c8ba2645718153bed83ae78f6",
292*09537850SAkhilesh Sanikop "a9e9805769fe1baf5c7933793ccca0d8", "553a2c24939dff18ec5833c77f556cfb",
293*09537850SAkhilesh Sanikop "5c1ec75a160c444fa90abf106fa1140e", "2266840f11ac4c066d941ec473b1a54f",
294*09537850SAkhilesh Sanikop "9e194755b2a37b615a517d5f8746dfbb", "bbf86f8174334f0b8d869fd8d58bf92d",
295*09537850SAkhilesh Sanikop "fd1da8d197cb385f7917cd296d67afb9", "a984202c527b757337c605443f376915",
296*09537850SAkhilesh Sanikop "c347f4a58fd784c5e88c1a23e4ff15d2", "29cbaadbff9adf4a3d49bd9900a9dd0b",
297*09537850SAkhilesh Sanikop "c5997b802a6ba1cf5ba1057ddc5baa7e", "4f750f6375524311d260306deb233861",
298*09537850SAkhilesh Sanikop "59f33727e5beeb783a057770bec7b4cd", "0654d72f22306b28d9ae42515845240c",
299*09537850SAkhilesh Sanikop "6c9d7d9e6ef81d76e775a85c53abe209", "a35f435ccc67717a49251a07e62ae204",
300*09537850SAkhilesh Sanikop "c5325015cb0b7c42839ac4aa21803fa0", "f81f31f1585c0f70438c09e829416f20",
301*09537850SAkhilesh Sanikop "ab10b22fb8dd8199040745565b28595d", "0d928d6111f86c60ccefc6c6604d5659",
302*09537850SAkhilesh Sanikop "4ed1a6200912995d4f571bdb7822aa83", "92e31a45513582f386dc9c22a57bbbbd",
303*09537850SAkhilesh Sanikop "6dbf310a9c8d85f76306d6a35545f8af", "80fce29dc82d5857c1ed5ef2aea16835",
304*09537850SAkhilesh Sanikop "14f2c5b9d2cd621c178a39f1ec0c38eb", "da54cfb4530841bda29966cfa05f4879",
305*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
306*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "7e3fa9c03bc3dfbdeb67f24c5d9a49cd",
307*09537850SAkhilesh Sanikop "f3454ca93cbb0c8c09b0695d90a0df3d", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
308*09537850SAkhilesh Sanikop "f3454ca93cbb0c8c09b0695d90a0df3d", "1a77d2af4d2b6cf8737cfbcacacdc4e4",
309*09537850SAkhilesh Sanikop "89bec831efea2f88129dedcad06bb3fa", "89bec831efea2f88129dedcad06bb3fa",
310*09537850SAkhilesh Sanikop "dead0fe4030085c22e92d16bb110de9d", "306a2f5dfd675df4ed9af44fd5cac8c0",
311*09537850SAkhilesh Sanikop "306a2f5dfd675df4ed9af44fd5cac8c0", "9d01c946a12f5ef9d9cebd9816e06014",
312*09537850SAkhilesh Sanikop "768f63912e43148c13688d7f23281531", "768f63912e43148c13688d7f23281531",
313*09537850SAkhilesh Sanikop "2e7927158e7b8e40e7269fc909fb584b", "123028e18c2bfb334e34adb5a4f67de4",
314*09537850SAkhilesh Sanikop "123028e18c2bfb334e34adb5a4f67de4", "2c979c2bddef79a760e72a802f83cc76",
315*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
316*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "da1a6ff2be03ec8acde4cb1cd519a6f0",
317*09537850SAkhilesh Sanikop "a4ca37cb869a0dbd1c4a2dcc449a8f31", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
318*09537850SAkhilesh Sanikop "1b5d1d4c7be8d5ec00a42a49eecf918f", "98b77e88b0784baaea64c98c8707fe46",
319*09537850SAkhilesh Sanikop "8148788044522edc3c497e1017efe2ce", "acf60abeda98bbea161139b915317423",
320*09537850SAkhilesh Sanikop "262c96b1f2c4f85c86c0e9c77fedff1e", "f35a3d13516440f9168076d9b07c9e98",
321*09537850SAkhilesh Sanikop "13782526fc2726100cb3cf375b3150ed", "13c07441b47b0c1ed80f015ac302d220",
322*09537850SAkhilesh Sanikop "02880fde51ac991ad18d8986f4e5145c", "aa25073115bad49432953254e7dce0bc",
323*09537850SAkhilesh Sanikop "69e3361b7199e10e75685b90fb0df623", "2f8ab35f6e7030e82ca922a68b29af4a",
324*09537850SAkhilesh Sanikop "452f91b01833c57db4e909575a029ff6", "1fabf0655bedb671e4d7287fec8119ba",
325*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
326*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "d54206c34785cc3d8a06c2ceac46378c",
327*09537850SAkhilesh Sanikop "85a11892ed884e3e74968435f6b16e64", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
328*09537850SAkhilesh Sanikop "16434230d24b9522ae2680e8c37e1b95", "963dea92f3efbb99137d1de9c56728d3",
329*09537850SAkhilesh Sanikop "b72fb6a9a073c2fe65013af1842dc9b0", "86fa0c299737eb499cbcdce94abe2d33",
330*09537850SAkhilesh Sanikop "6b80af04470b83673d98f46925e678a5", "65baca6167fe5249f7a839ce5b2fd591",
331*09537850SAkhilesh Sanikop "e47ded6c0eec1d5baadd02aff172f2b1", "c0950e609f278efb7050d319a9756bb3",
332*09537850SAkhilesh Sanikop "9051290279237f9fb1389989b142d2dd", "34cdc1be291c95981c98812c5c343a15",
333*09537850SAkhilesh Sanikop "5b64a6911cb7c3d60bb8f961ed9782a2", "7133de9d03a4b07716a12226b5e493e8",
334*09537850SAkhilesh Sanikop "3594eff52d5ed875bd9655ddbf106fae", "90d7e13aa2f9a064493ff2b3b5b12109",
335*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
336*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "b1f26ee13df2e14a757416ba8a682278",
337*09537850SAkhilesh Sanikop "996b6c166f9ed25bd07ea6acdf7597ff", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
338*09537850SAkhilesh Sanikop "34895d4c69a6c3303693e6f431bcd5d8", "c9497b00cb1bc3363dd126ffdddadc8e",
339*09537850SAkhilesh Sanikop "1e461869bb2ee9b6069c5e52cf817291", "8d7f1d7ea6a0dcc922ad5d2e77bc74dd",
340*09537850SAkhilesh Sanikop "138855d9bf0ccd0c62ac14c7bff4fd37", "64035142864914d05a48ef8e013631d0",
341*09537850SAkhilesh Sanikop "205904fa3c644433b46e01c11dd2fe40", "291425aaf8206b20e88db8ebf3cf7e7f",
342*09537850SAkhilesh Sanikop "cb6238b8eb6b72980958e6fcceb2f2eb", "626321a6dfac542d0fc70321fac13ff3",
343*09537850SAkhilesh Sanikop "1c6fda7501e0f8bdad972f7857cd9354", "4fd485dadcb570e5a0a5addaf9ba84da",
344*09537850SAkhilesh Sanikop "d3f140aea9e8eabf4e1e5190e0148288", "e4938219593bbed5ae638a93f2f4a580",
345*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
346*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "238980eebc9e63ae3eea2771c7a70f12",
347*09537850SAkhilesh Sanikop "0eac13431bd7d8a573318408a72246d5", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
348*09537850SAkhilesh Sanikop "73438155feb62595e3e406921102d748", "5871e0e88a776840d619670fbf107858",
349*09537850SAkhilesh Sanikop "1c6376ce55c9ee9e35d432edb1ffb3b7", "d675e0195c9feca956e637f3f1959f40",
350*09537850SAkhilesh Sanikop "b5681673903ade13d69e295f82fdd009", "3c43020105ae93a301404b4cd6238654",
351*09537850SAkhilesh Sanikop "dd2c5880a94ed3758bfea0b0e8c78286", "4ebb1a7b25a39d8b9868ec8a1243103f",
352*09537850SAkhilesh Sanikop "d34ec07845cd8523651e5f5112984a14", "2ce55308d873f4cd244f16da2b06e06e",
353*09537850SAkhilesh Sanikop "a4bb5d5ff4b25f391265b5231049a09a", "c9106e0c820b03bcdde3aa94efc11a3e",
354*09537850SAkhilesh Sanikop "7ec2eae9e118506da8b33440b399511a", "78de867c8ee947ed6d29055747f26949",
355*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
356*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "e552466a4e7ff187251b8914b084d404",
357*09537850SAkhilesh Sanikop "981b7c44b6f7b7ac2acf0cc4096e6bf4", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
358*09537850SAkhilesh Sanikop "a4c75372af36162831cb872e24e1088c", "497271227a70a72f9ad25b415d41563f",
359*09537850SAkhilesh Sanikop "c48bd7e11ec44ba7b2bc8b6a04592439", "0960a9af91250e9faa1eaac32227bf6f",
360*09537850SAkhilesh Sanikop "746c2e0f96ae2246d534d67102be068c", "d6f6db079da9b8909a153c07cc9d0e63",
361*09537850SAkhilesh Sanikop "7c8928a0d769f4264d195f39cb68a772", "db645c96fc8be04015e0eb538afec9ae",
362*09537850SAkhilesh Sanikop "946af3a8f5362def5f4e27cb0fd4e754", "7ad78dfe7bbedf696dd58d9ad01bcfba",
363*09537850SAkhilesh Sanikop "f0fd9c09d454e4ce918faa97e9ac10be", "af6ae5c0eb28417bd251184baf2eaba7",
364*09537850SAkhilesh Sanikop "866f8df540dd3b58ab1339314d139cbd", "72803589b453a29501540aeddc23e6f4",
365*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
366*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "aba5d5ef5e96fe418e65d20e506ea834",
367*09537850SAkhilesh Sanikop "d70bf16e2a31e90b7b3cdeaef1494cf9", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
368*09537850SAkhilesh Sanikop "6df80bb7f264f4f285d09a4d61533fae", "c8831118d1004a7cca015a4fca140018",
369*09537850SAkhilesh Sanikop "b7f82c140369067c105c7967c75b6f9e", "130f47aae365aabfec4360fa5b5ff554",
370*09537850SAkhilesh Sanikop "92483ed631de21b685ffe6ccadbbec8f", "cbb6ab31547df6b91cfb48630fdffb48",
371*09537850SAkhilesh Sanikop "1eea5e8a24d6aa11778eb3e5e5e9c9f2", "9e193b6b28ce798c44c744efde19eee9",
372*09537850SAkhilesh Sanikop "885c384d90aaa34acd8303958033c252", "8110ed10e7234851dff3c7e4a51108a2",
373*09537850SAkhilesh Sanikop "6fb9383302eb7e7a13387464d2634e03", "864d51fcc737bc73a3f588b67515039a",
374*09537850SAkhilesh Sanikop "2ecb7890f00234bcb28c1d969f489012", "c4793d431dbf2d88826bb440bf027512",
375*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
376*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "972aeba65e8a6d20dd0f95279be2aa75",
377*09537850SAkhilesh Sanikop "34165457282e2af2e9b3f5840e4dec5d", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
378*09537850SAkhilesh Sanikop "b8c5582b9bbb789c45471f93be83b41f", "257bf5467db570974d7cf2356bacf116",
379*09537850SAkhilesh Sanikop "5255dded79f56b0078543b5a1814a668", "ef745100f5f34c8ff841b2b0b57eb33f",
380*09537850SAkhilesh Sanikop "edae8ed67286ca6a31573a541b3deb6f", "01adcd8bf15fbf70df47fbf3a953aa14",
381*09537850SAkhilesh Sanikop "ba539808a8501609ce052a1562a62b25", "ac8e6391200cec2abdebb00744a2ba82",
382*09537850SAkhilesh Sanikop "54b17120f7d71ddb4d70590ecd231cc1", "f6e36446a97611a4db4425df926974b2",
383*09537850SAkhilesh Sanikop "a82f4080699300b659bbe1b5c4463147", "ecedb178f7cad3dc1b921eca67f9efb6",
384*09537850SAkhilesh Sanikop "0609ca0ff3ca90069e8b48829b4b0891", "839e86c681e97359f7819c766000dd1c",
385*09537850SAkhilesh Sanikop };
386*09537850SAkhilesh Sanikop assert(id >= 0);
387*09537850SAkhilesh Sanikop assert(id < sizeof(kDigest) / sizeof(kDigest[0]));
388*09537850SAkhilesh Sanikop return kDigest[id];
389*09537850SAkhilesh Sanikop }
390*09537850SAkhilesh Sanikop
GetConvolveScaleDigest10bpp(int id)391*09537850SAkhilesh Sanikop const char* GetConvolveScaleDigest10bpp(int id) {
392*09537850SAkhilesh Sanikop // Entries containing 'XXXXX...' are skipped. See the test for details.
393*09537850SAkhilesh Sanikop static const char* const kDigest[ConvolveTestParam::kNumBlockSizes * 2] = {
394*09537850SAkhilesh Sanikop "27e21eb31687f9fbd0a66865fa8d7c8a", "9bff726c8e1d0998451a3b9cf2b3d8c8",
395*09537850SAkhilesh Sanikop "661d74cfef36f12ed8d9b4c3ccb7fe0d", "5fc365fd1fcc9599dd97a885ba0c2eec",
396*09537850SAkhilesh Sanikop "acdba2c82a6268e3c0ae8fc32be1b41f", "a5db60bbeaf56ab030ed21c42d553cf3",
397*09537850SAkhilesh Sanikop "1228bb633f9fd63fdb998b775ca79e98", "07812c97f9f43a2a8ae07329dc488699",
398*09537850SAkhilesh Sanikop "903525fb782119c4dfaf61b98a310c9f", "f38b51cef38b929e317861ccbc73ecd8",
399*09537850SAkhilesh Sanikop "b78b05138e1d5fbf089144c42ce03058", "f2e227664cbf2d821b242a34fcbc9835",
400*09537850SAkhilesh Sanikop "cb992dac70591e7d3663588ae13b9adc", "f2292d33657d939fa85ea5bacdfe39a3",
401*09537850SAkhilesh Sanikop "7049dc742d6d8ad6f5d4309968ff281c", "e4beebde1ac335a4d92e4af94653a2ce",
402*09537850SAkhilesh Sanikop "cc77875f98f54b9b26b5f7d9fcbc828d", "fb623f7b9e1ffcf2ae361599728a5589",
403*09537850SAkhilesh Sanikop "c33847e47a7eda214734084640818df9", "ab3e1aec3d720c0c89c46a8d5b161b44",
404*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
405*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "efe4de861dcf0f7458b6208cae7e3584",
406*09537850SAkhilesh Sanikop "814751c55fa84f0fed94ff15fc30fc24", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
407*09537850SAkhilesh Sanikop "31a63fe47297102937acbe7a328588b7", "b804a0a24633243f7da48d7a5f51c0bf",
408*09537850SAkhilesh Sanikop "cb492672b005fc378cccc8c03003cd4a", "1d18732bcf2ea487e84579489cc59a22",
409*09537850SAkhilesh Sanikop "457c4b3ec38a8d6c210584ade1a9fae2", "a3afdd468e6a5238a3dbd2cc21c11c9e",
410*09537850SAkhilesh Sanikop "6ff8a16f21d6e8a9741dacf0734ae563", "3ffa29ef7e54e51f6849c9a3d3c79d03",
411*09537850SAkhilesh Sanikop "af89899b083cf269ac1bd988aeb15b15", "3365d8411c11081fb228436238b9a671",
412*09537850SAkhilesh Sanikop "3ba56d30f5f81d7098f356635a58b9af", "b3013776900c6520bd30f868e8c963b6",
413*09537850SAkhilesh Sanikop "81febaa7342692483040f500ba2e5e2b", "4a51ff1d9a4a68687d590b41aa7835a3",
414*09537850SAkhilesh Sanikop };
415*09537850SAkhilesh Sanikop assert(id >= 0);
416*09537850SAkhilesh Sanikop assert(id < sizeof(kDigest) / sizeof(kDigest[0]));
417*09537850SAkhilesh Sanikop return kDigest[id];
418*09537850SAkhilesh Sanikop }
419*09537850SAkhilesh Sanikop #endif // LIBGAV1_MAX_BITDEPTH >= 10
420*09537850SAkhilesh Sanikop
421*09537850SAkhilesh Sanikop #if LIBGAV1_MAX_BITDEPTH == 12
GetConvolveDigest12bpp(int id)422*09537850SAkhilesh Sanikop const char* GetConvolveDigest12bpp(int id) {
423*09537850SAkhilesh Sanikop // Entries containing 'XXXXX...' are skipped. See the test for details.
424*09537850SAkhilesh Sanikop static const char* const kDigest[ConvolveTestParam::kNumBlockSizes * 16] = {
425*09537850SAkhilesh Sanikop "e25031afae184cc4d186cde7e3d51e33", "6fb55dec2506dae6c229469cdf2e7d83",
426*09537850SAkhilesh Sanikop "9df34d27f5bd040d1ed1455b151cd1ff", "7f6829458f00edb88f78851dd1a08739",
427*09537850SAkhilesh Sanikop "a8bbe9b6b9eaf6f681d91c981b994949", "21f74980b36cb246426f4bc3fe7c08c3",
428*09537850SAkhilesh Sanikop "403c2ccced3b5b141a4c7559c0cd841b", "1c3c4c6cd8a3e79cd95d6038531b47e5",
429*09537850SAkhilesh Sanikop "f18d6950d36619086ac0055bab528cb1", "37d9c5babddf24fe8cb061297297b769",
430*09537850SAkhilesh Sanikop "c111000d4021381f3d18ea0e24a1b5f5", "4e1e4f0a592ff028e35f8187627d6e68",
431*09537850SAkhilesh Sanikop "0ca9ad4614d32da05746f8712a46d861", "8a122ab194e2fdb7089b29be50af8c86",
432*09537850SAkhilesh Sanikop "3c21326e22a80982d1b0ffc09be4beae", "f6c8d1fe2c1fb19604c49c6a49bd26a8",
433*09537850SAkhilesh Sanikop "d3eda9d7aa80e4ea1f18bf565b143e57", "fe21bd1cb8e90466dc727f2223ea7aed",
434*09537850SAkhilesh Sanikop "01efe3df83c715325aaddd4d4ce130ad", "ecaa751360121d3746b72932415fb998",
435*09537850SAkhilesh Sanikop "291e67095399651dc5c8a033390f255f", "66b26828e434faf37ddc57d3e0abb6db",
436*09537850SAkhilesh Sanikop "e9cd69e9ba70864e3d0b175ac0a177d6", "64e4db895a843cb05384f5997b1ba978",
437*09537850SAkhilesh Sanikop "f305161c82de999d2c93eac65f609cfe", "4762b2bd27983ad916ec0a930c0eca6b",
438*09537850SAkhilesh Sanikop "1631495ffae43a927267ebd476015ef1", "b0f22de7b10057e07af71f9bce4615ce",
439*09537850SAkhilesh Sanikop "6fa29dc4be1a46d246a41d66a3d35cb4", "734601c2185bdf30ba9ded8b07003a05",
440*09537850SAkhilesh Sanikop "524e4553d92c69e7e4ed934f7b806c6b", "3709c8950bc5fcc4a2b3ec68fc78bf7e",
441*09537850SAkhilesh Sanikop "69c274d9f8e0fd6790495e9695251f1f", "ee30cc1232c27494ef53edd383568f25",
442*09537850SAkhilesh Sanikop "e525dbeb0b4341952a92270dcfc51730", "b3685c9e783d3402497bbd49d28c7dd7",
443*09537850SAkhilesh Sanikop "d1c9f02dc818e6b974794dfb7749aac8", "bdb9e4961f9aa8c25568d3394e968518",
444*09537850SAkhilesh Sanikop "f5f74555adcad85f3ebd3cb85dc7b770", "737e2a0be806dbd701014f2078be7898",
445*09537850SAkhilesh Sanikop "20a18294e3a9422193aa0a219fd80ede", "7106648ecb9ae24a54d1dbabf2a9e318",
446*09537850SAkhilesh Sanikop "20f39cbd6b5ed87a6ae4f818932325c0", "a99666e3157e32a07c87b01e52091a76",
447*09537850SAkhilesh Sanikop "123e4d533d478c3089c975323c85396b", "d2a8021f7683a0cdf2658418fa90a6fc",
448*09537850SAkhilesh Sanikop "1437e192a3349db8702d5b90eb88dbc1", "fe097fc4aeed7cda0b0f405124efb19d",
449*09537850SAkhilesh Sanikop "1988227c51fa589db1307fd890bb5972", "537e25a6c30b240dc1e3bddd1c3a0a03",
450*09537850SAkhilesh Sanikop "aebe5cffaae448db5a08987a3375a428", "7127ae9bdc63df4459590dc02ca95403",
451*09537850SAkhilesh Sanikop "7ad281903a210f2b1f39f7c40c8df272", "d4b97ba21f7b400ba9f9cd8bb1a576df",
452*09537850SAkhilesh Sanikop "0884a824203aaf72c78f73fdaf2b23a2", "63d60388605c92daee55d517de622a9e",
453*09537850SAkhilesh Sanikop "171ec49a779de1efa69510eefbd09bba", "541cf051579c5a10b9debd3bfdcb7f32",
454*09537850SAkhilesh Sanikop "91c14451ad93ed88e96b5d639ce408de", "3b0313ec0e043d19744bf88c90e875a1",
455*09537850SAkhilesh Sanikop "6adcb3cee91fe3a83b36deb11c5ad6dd", "c6d4bfad24616a88222681992a99d782",
456*09537850SAkhilesh Sanikop "515dc0f2a41730d5c434e4f3c81b02c3", "1c69abdee3b9608a6094034badc2bec0",
457*09537850SAkhilesh Sanikop "1785a0f321d7dd90aa8846961737a767", "dd12c5b8c341f2423d0d5db4f285d199",
458*09537850SAkhilesh Sanikop "5741fb69aae1ca8a0fbe4f1478df88ef", "a4390ceb4e4e9f5cf6a47a9b11a97015",
459*09537850SAkhilesh Sanikop "6778eb25df902092b440c3402e7f0f80", "5ad9d6b36f8898bb55e901c1c0c523da",
460*09537850SAkhilesh Sanikop "73969b6c03bb5a7345a8b968b542668e", "f48192947e66d70f116193a4186d0186",
461*09537850SAkhilesh Sanikop "53f60d0e89d7d994ec6d6131fb7e75ae", "c75f6f8813839ae3cf192baa29039265",
462*09537850SAkhilesh Sanikop "9ff0852ebbad56663250f86ac3a3bf9b", "668938580a770ea7ace8bbf7d349e89f",
463*09537850SAkhilesh Sanikop "5b06bb0a15ac465a250d9b209f05289f", "a2128f5c8692fed7e7c1c7af22ce9f72",
464*09537850SAkhilesh Sanikop "f80f1d7a58869ec794258c0f7df14620", "ed1e03a35924c92ed2fc9808dc3f06f3",
465*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
466*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "35ef89c35d2e8e46feb856c554c21c9f",
467*09537850SAkhilesh Sanikop "b98ce33a1bf4fab840b7ef261b30dbc4", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
468*09537850SAkhilesh Sanikop "b98ce33a1bf4fab840b7ef261b30dbc4", "42263fb359c4fdf1c7cdb4980b3e97f2",
469*09537850SAkhilesh Sanikop "1e7071b7db3144188bdcf5d199fe5355", "1e7071b7db3144188bdcf5d199fe5355",
470*09537850SAkhilesh Sanikop "30d367304a87bd25f0ad2ff8e4b5eb41", "4abe6dbb3198219015838dbedf07297a",
471*09537850SAkhilesh Sanikop "4abe6dbb3198219015838dbedf07297a", "acec349a95b5bba98bb830372fa15e73",
472*09537850SAkhilesh Sanikop "a73ad8661256ce2fdf5110425eb260b2", "a73ad8661256ce2fdf5110425eb260b2",
473*09537850SAkhilesh Sanikop "8ff2f049d3f972867f14775188fe589b", "87f5f9a07aea75c325e6d7ff6c96c7c2",
474*09537850SAkhilesh Sanikop "87f5f9a07aea75c325e6d7ff6c96c7c2", "325fcde7d415d7aa4929a3ea013fb9cc",
475*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
476*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "05aa29814d5ce35389dbcf20368850da",
477*09537850SAkhilesh Sanikop "fbb89f907a040e70953e3364dbe1feda", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
478*09537850SAkhilesh Sanikop "44ac511baf45032078cc0b45e41dba79", "efb98974adc58d88e122293436bb9184",
479*09537850SAkhilesh Sanikop "7eee18c1a16bcb4e7ef7b27f68ba884f", "b0904c9b118dd9a1f9f034c0ff82d1c1",
480*09537850SAkhilesh Sanikop "54436deb5183dd9669dd4f5feadb3850", "4db1c310b7d9a8bd3e2b5d20fa820e3b",
481*09537850SAkhilesh Sanikop "c40abc6b2d67527f48a287cd7e157428", "48ec3fcf509805f484c8e0948c3469be",
482*09537850SAkhilesh Sanikop "cb7d4a76fa7de52ed2fe889785327b38", "f57983346815fa41e969c195c1c03774",
483*09537850SAkhilesh Sanikop "7dba59b0de2c877666ded6bdaefdcc30", "4837f8ba2f67f17f28a38c5e2a434c73",
484*09537850SAkhilesh Sanikop "09e06fe9dc7ef7818f2a96895235afd4", "002976970ec62b360f956b9c091782d4",
485*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
486*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "78673b1084367e97b8dd83990adc5219",
487*09537850SAkhilesh Sanikop "06b5d4a30b9efb6c1d95ef7957f49e76", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
488*09537850SAkhilesh Sanikop "ce460146922cd53970b510d460aa4062", "6fd051938b8efcec9ece042f1edc177a",
489*09537850SAkhilesh Sanikop "f5ff0dcfe3c1a56e3856549d8ded416b", "b69bc2cfc17c6b4313264db96831f0d1",
490*09537850SAkhilesh Sanikop "38a5e65bd71934becfb376eb3b9bc513", "32c1163aa4ca6b6c69d950aba7b06d48",
491*09537850SAkhilesh Sanikop "0c22a6c014c6347983de4ca863f3b53f", "a80c5ee9eb2dfb9a0d56e92eb3f85d91",
492*09537850SAkhilesh Sanikop "a9719722a150a81175427bc161b95d7a", "8237befd456131a488cc5b8b63f4aca5",
493*09537850SAkhilesh Sanikop "51616abcd0beea53a78ffce106b974fc", "6c47b22270f01d27b404da07e1be1202",
494*09537850SAkhilesh Sanikop "356268298d3887edaabd0169a912c94e", "d2b00216e106cb8c5450e2eff1f8481a",
495*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
496*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "c2de3a582c79aee811076211c497d2bc",
497*09537850SAkhilesh Sanikop "d1b6d9c73da41def26dd4f85fbd1bde8", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
498*09537850SAkhilesh Sanikop "d8374eb7825081b89f74b05c66bccd63", "d5f7d68c10b5eaf0fba6f93ee26266e6",
499*09537850SAkhilesh Sanikop "94d19cb65f29db65e6656b588f431ade", "5126e95f0249024a6f6d426714bd5b20",
500*09537850SAkhilesh Sanikop "d7d3654b9c2dabe13239875984770acd", "6491afd5d651aab80aa179b579b74341",
501*09537850SAkhilesh Sanikop "037a5de0de89983808f8e8f6dc39110f", "5980073b7685c5c9b2ec027e06be2cbc",
502*09537850SAkhilesh Sanikop "0abb9d035aca426b62ca0f3fab063bab", "fe002a902bb4ec24dfe3ea0fe381a472",
503*09537850SAkhilesh Sanikop "1ac15726df1aa2cd8855162a91893379", "0758c3ac16467605d73c725a697c3dc1",
504*09537850SAkhilesh Sanikop "97d894d85f6ccfa4ff81e0e8fdf03da1", "c3c7b362f063a18244ea542a42d2873c",
505*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
506*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "7f6829458f00edb88f78851dd1a08739",
507*09537850SAkhilesh Sanikop "a8bbe9b6b9eaf6f681d91c981b994949", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
508*09537850SAkhilesh Sanikop "403c2ccced3b5b141a4c7559c0cd841b", "1c3c4c6cd8a3e79cd95d6038531b47e5",
509*09537850SAkhilesh Sanikop "f18d6950d36619086ac0055bab528cb1", "37d9c5babddf24fe8cb061297297b769",
510*09537850SAkhilesh Sanikop "c111000d4021381f3d18ea0e24a1b5f5", "4e1e4f0a592ff028e35f8187627d6e68",
511*09537850SAkhilesh Sanikop "0ca9ad4614d32da05746f8712a46d861", "8a122ab194e2fdb7089b29be50af8c86",
512*09537850SAkhilesh Sanikop "3c21326e22a80982d1b0ffc09be4beae", "f6c8d1fe2c1fb19604c49c6a49bd26a8",
513*09537850SAkhilesh Sanikop "d3eda9d7aa80e4ea1f18bf565b143e57", "fe21bd1cb8e90466dc727f2223ea7aed",
514*09537850SAkhilesh Sanikop "01efe3df83c715325aaddd4d4ce130ad", "ecaa751360121d3746b72932415fb998",
515*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
516*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "67b2ea94cc4d0b32db3ae3c29eee4d46",
517*09537850SAkhilesh Sanikop "bcfec99ad75988fa1efc1733204f17f2", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
518*09537850SAkhilesh Sanikop "79c222c5796e50119f1921e7bc534a25", "ae3f7c189458f044e9c52399d37a55e2",
519*09537850SAkhilesh Sanikop "fd6dde45bd2937331428de9ef4f8e869", "b384d065423f3d271b85781d76a73218",
520*09537850SAkhilesh Sanikop "466ea0680c06f59e8b3bb293608731fb", "360541ba94f42d115fe687a97a457ffb",
521*09537850SAkhilesh Sanikop "e5a0794d37af40c40a4d2c6d3f7d2aa2", "4eed285651a75614bd60adebbe2e185c",
522*09537850SAkhilesh Sanikop "bbdbf93942282d7b9c4f07591a1764a6", "1288a9ec3e6f79213b6745e6e7568c44",
523*09537850SAkhilesh Sanikop "4ff1310bfd656d69ed5c108a91a9b01a", "3380806b5f67eb3ebce42f8e7c05b256",
524*09537850SAkhilesh Sanikop "09c4bdf0f30aca6812fb55a5ac06b1bd", "722c86ba6bf21f40742ee33b4edc17c4",
525*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
526*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "f5303c96d1630f9840eaaba058cd818b",
527*09537850SAkhilesh Sanikop "c20cd45782b2f52c05e4189912047570", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
528*09537850SAkhilesh Sanikop "d6360f96fe15a3ee1e903b0a53dcaaeb", "4b18995cdf2f5d18410d3a732c5932b1",
529*09537850SAkhilesh Sanikop "6f62bf7395c3dfccc1565ba8424f20e8", "c9987ed30491cd28bbc711dd57228247",
530*09537850SAkhilesh Sanikop "8e277ec837cbecf529ae2eb0578fddc1", "c0c132386f23c5f0fba055a12fb79547",
531*09537850SAkhilesh Sanikop "6b5617ab78dd0916690dfa358298b7b3", "394abedca37f60d1a5148a4c975305ed",
532*09537850SAkhilesh Sanikop "bb88881e0e4cf2d88c2d2b38b5833f20", "bef10806be8d58ea8e97870a813b075e",
533*09537850SAkhilesh Sanikop "b4b017d1f792bea69d3b773db7c80c7c", "0660bc63041213a8a4d74724a3bc4291",
534*09537850SAkhilesh Sanikop "5050c8c5388a561691fd414b00c041df", "9ed40c68de6a8008a902d7224f8b620f",
535*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
536*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "ec10ce4a674424478a401847f744251d",
537*09537850SAkhilesh Sanikop "bdd897eafc8ef2651a7bba5e523a6ac2", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
538*09537850SAkhilesh Sanikop "2745de4a6b29abb85ee513e22ad362c3", "8aaad384b7cd349b4b968e657ec15523",
539*09537850SAkhilesh Sanikop "fb6c0723432bcd2246d51a90f5fb5826", "f8104ed5921ebd48c6eed16150ffe028",
540*09537850SAkhilesh Sanikop "85c2e236b3e32bf731601237cf0594cd", "8bd6eefff9640766cdf64ab082cb1485",
541*09537850SAkhilesh Sanikop "78b5cd9dde6c6a5900f3040c57172091", "aaa980506bd7bb1d75924a8025698d1a",
542*09537850SAkhilesh Sanikop "90050a411d501f7166f6741832b0c342", "d6ec88b2c38e32511f3359e1d5f9d85b",
543*09537850SAkhilesh Sanikop "96506b8b39274c8fe687ea39761997f1", "3322ea83995c2762fb60db993b401658",
544*09537850SAkhilesh Sanikop "151b6e4ce60392639982fca5a73ac3d3", "d52a1038e135bef233674a843f8c7cb6",
545*09537850SAkhilesh Sanikop };
546*09537850SAkhilesh Sanikop assert(id >= 0);
547*09537850SAkhilesh Sanikop assert(id < sizeof(kDigest) / sizeof(kDigest[0]));
548*09537850SAkhilesh Sanikop return kDigest[id];
549*09537850SAkhilesh Sanikop }
550*09537850SAkhilesh Sanikop
GetConvolveScaleDigest12bpp(int id)551*09537850SAkhilesh Sanikop const char* GetConvolveScaleDigest12bpp(int id) {
552*09537850SAkhilesh Sanikop // Entries containing 'XXXXX...' are skipped. See the test for details.
553*09537850SAkhilesh Sanikop static const char* const kDigest[ConvolveTestParam::kNumBlockSizes * 2] = {
554*09537850SAkhilesh Sanikop "aea59b7a638f27acad2b90fd2b8c9fee", "be87ba981a0af25611a7d5f0970be9b3",
555*09537850SAkhilesh Sanikop "7c81f1486cd607376d776bf2c6e81dec", "f683ba2a9b353bea35f26c1ed730f3c5",
556*09537850SAkhilesh Sanikop "11e2d70daff1726093cb4fcae33ce0d6", "567575eac0dea2f379019b2d4bafe444",
557*09537850SAkhilesh Sanikop "216479ed580d6e0d7c1d523015394814", "dcabbe5f5709a4b6634d77cc514e863a",
558*09537850SAkhilesh Sanikop "4e888207fe917faeea2b44383ac16caf", "d617c5608fae3b01c507c7e88040fee3",
559*09537850SAkhilesh Sanikop "eeac5d9b3dc005e76f13dfc7483eae48", "8ff0a82811f77303c4516bb8c761336f",
560*09537850SAkhilesh Sanikop "95a7c315aaa208097b6ab006f1d07654", "da63527ee80e6772435cff8321a29a95",
561*09537850SAkhilesh Sanikop "404457f72e7113d1f3797a39319fd3fe", "43cbccfe2663ec11c157319acfe629a5",
562*09537850SAkhilesh Sanikop "1dc5b8dee4542f3d7fcf6b0fa325dfde", "16d4506674f2fcedfcd1e006eb097141",
563*09537850SAkhilesh Sanikop "4fcf329ddb405cd6bbb0a6fb87e29eb3", "de77a781957653ea1750f79995605cdc",
564*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
565*09537850SAkhilesh Sanikop "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "436f6fdc008d94a94bc6f516f98f402f",
566*09537850SAkhilesh Sanikop "b436bd9036f08ba7e50cfc536911dbbd", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
567*09537850SAkhilesh Sanikop "720a01018856bd83f4d89a9024b14728", "b7e01a3f161007712ce342f59b2c51f2",
568*09537850SAkhilesh Sanikop "922420ebe5dec4f19c259ebdf8a3259a", "979aaba579556207a7bbcc939123c1b2",
569*09537850SAkhilesh Sanikop "89a30898cbaa4d64f9072173e8365864", "0586ff961f2e4228f4e38299fb25ae07",
570*09537850SAkhilesh Sanikop "adb27a03f8b1b50fe2a52b5ca8d4fc28", "4f91cd92aab2e09f4b123251a8d2f219",
571*09537850SAkhilesh Sanikop "620fba0fff163d96a1cd663d1af4a4c5", "bf7a0fa65b1a90ba34c834558fa2c86e",
572*09537850SAkhilesh Sanikop "c21f7d7d16d047a27b871a7bf8476e2d", "a94b17c81f3ce2b47081bd8dd762a2e5",
573*09537850SAkhilesh Sanikop "9078d20f59bc24862af3856acb8c0357", "ee510ce6b3d22de9e4bd7920a26fd69a",
574*09537850SAkhilesh Sanikop };
575*09537850SAkhilesh Sanikop assert(id >= 0);
576*09537850SAkhilesh Sanikop assert(id < sizeof(kDigest) / sizeof(kDigest[0]));
577*09537850SAkhilesh Sanikop return kDigest[id];
578*09537850SAkhilesh Sanikop }
579*09537850SAkhilesh Sanikop #endif // LIBGAV1_MAX_BITDEPTH == 12
580*09537850SAkhilesh Sanikop
581*09537850SAkhilesh Sanikop struct ConvolveTypeParam {
ConvolveTypeParamlibgav1::dsp::__anon4b3d96e80111::ConvolveTypeParam582*09537850SAkhilesh Sanikop ConvolveTypeParam(bool is_intra_block_copy, bool is_compound,
583*09537850SAkhilesh Sanikop bool has_vertical_filter, bool has_horizontal_filter)
584*09537850SAkhilesh Sanikop : is_intra_block_copy(is_intra_block_copy),
585*09537850SAkhilesh Sanikop is_compound(is_compound),
586*09537850SAkhilesh Sanikop has_vertical_filter(has_vertical_filter),
587*09537850SAkhilesh Sanikop has_horizontal_filter(has_horizontal_filter) {}
588*09537850SAkhilesh Sanikop bool is_intra_block_copy;
589*09537850SAkhilesh Sanikop bool is_compound;
590*09537850SAkhilesh Sanikop bool has_vertical_filter;
591*09537850SAkhilesh Sanikop bool has_horizontal_filter;
592*09537850SAkhilesh Sanikop };
593*09537850SAkhilesh Sanikop
operator <<(std::ostream & os,const ConvolveTestParam & param)594*09537850SAkhilesh Sanikop std::ostream& operator<<(std::ostream& os, const ConvolveTestParam& param) {
595*09537850SAkhilesh Sanikop return os << "BlockSize" << param.width << "x" << param.height;
596*09537850SAkhilesh Sanikop }
597*09537850SAkhilesh Sanikop
operator <<(std::ostream & os,const ConvolveTypeParam & param)598*09537850SAkhilesh Sanikop std::ostream& operator<<(std::ostream& os, const ConvolveTypeParam& param) {
599*09537850SAkhilesh Sanikop return os << "is_intra_block_copy: " << param.is_intra_block_copy
600*09537850SAkhilesh Sanikop << ", is_compound: " << param.is_compound
601*09537850SAkhilesh Sanikop << ", has_(vertical/horizontal)_filter: "
602*09537850SAkhilesh Sanikop << param.has_vertical_filter << "/" << param.has_horizontal_filter;
603*09537850SAkhilesh Sanikop }
604*09537850SAkhilesh Sanikop
605*09537850SAkhilesh Sanikop //------------------------------------------------------------------------------
606*09537850SAkhilesh Sanikop template <int bitdepth, typename Pixel>
607*09537850SAkhilesh Sanikop class ConvolveTest : public testing::TestWithParam<
608*09537850SAkhilesh Sanikop std::tuple<ConvolveTypeParam, ConvolveTestParam>> {
609*09537850SAkhilesh Sanikop public:
610*09537850SAkhilesh Sanikop static_assert(bitdepth >= kBitdepth8 && bitdepth <= LIBGAV1_MAX_BITDEPTH, "");
611*09537850SAkhilesh Sanikop ConvolveTest() = default;
612*09537850SAkhilesh Sanikop ~ConvolveTest() override = default;
613*09537850SAkhilesh Sanikop
SetUp()614*09537850SAkhilesh Sanikop void SetUp() override {
615*09537850SAkhilesh Sanikop ConvolveInit_C();
616*09537850SAkhilesh Sanikop
617*09537850SAkhilesh Sanikop const Dsp* const dsp = GetDspTable(bitdepth);
618*09537850SAkhilesh Sanikop ASSERT_NE(dsp, nullptr);
619*09537850SAkhilesh Sanikop GetConvolveFunc(dsp, &base_convolve_func_);
620*09537850SAkhilesh Sanikop
621*09537850SAkhilesh Sanikop const testing::TestInfo* const test_info =
622*09537850SAkhilesh Sanikop testing::UnitTest::GetInstance()->current_test_info();
623*09537850SAkhilesh Sanikop const absl::string_view test_case = test_info->test_suite_name();
624*09537850SAkhilesh Sanikop if (absl::StartsWith(test_case, "C/")) {
625*09537850SAkhilesh Sanikop base_convolve_func_ = nullptr;
626*09537850SAkhilesh Sanikop } else if (absl::StartsWith(test_case, "SSE41/")) {
627*09537850SAkhilesh Sanikop if ((GetCpuInfo() & kSSE4_1) == 0) GTEST_SKIP() << "No SSE4.1 support!";
628*09537850SAkhilesh Sanikop ConvolveInit_SSE4_1();
629*09537850SAkhilesh Sanikop } else if (absl::StartsWith(test_case, "AVX2/")) {
630*09537850SAkhilesh Sanikop if ((GetCpuInfo() & kAVX2) == 0) GTEST_SKIP() << "No AVX2 support!";
631*09537850SAkhilesh Sanikop ConvolveInit_AVX2();
632*09537850SAkhilesh Sanikop } else if (absl::StartsWith(test_case, "NEON/")) {
633*09537850SAkhilesh Sanikop ConvolveInit_NEON();
634*09537850SAkhilesh Sanikop #if LIBGAV1_MAX_BITDEPTH >= 10
635*09537850SAkhilesh Sanikop ConvolveInit10bpp_NEON();
636*09537850SAkhilesh Sanikop #endif
637*09537850SAkhilesh Sanikop } else {
638*09537850SAkhilesh Sanikop FAIL() << "Unrecognized architecture prefix in test case name: "
639*09537850SAkhilesh Sanikop << test_case;
640*09537850SAkhilesh Sanikop }
641*09537850SAkhilesh Sanikop
642*09537850SAkhilesh Sanikop GetConvolveFunc(dsp, &cur_convolve_func_);
643*09537850SAkhilesh Sanikop
644*09537850SAkhilesh Sanikop // Skip functions that have not been specialized for this particular
645*09537850SAkhilesh Sanikop // architecture.
646*09537850SAkhilesh Sanikop if (cur_convolve_func_ == base_convolve_func_) {
647*09537850SAkhilesh Sanikop cur_convolve_func_ = nullptr;
648*09537850SAkhilesh Sanikop }
649*09537850SAkhilesh Sanikop }
650*09537850SAkhilesh Sanikop
651*09537850SAkhilesh Sanikop protected:
GetDigestId() const652*09537850SAkhilesh Sanikop int GetDigestId() const {
653*09537850SAkhilesh Sanikop int id = param_.block_size;
654*09537850SAkhilesh Sanikop id += param_.kNumBlockSizes *
655*09537850SAkhilesh Sanikop static_cast<int>(type_param_.has_horizontal_filter);
656*09537850SAkhilesh Sanikop id += 2 * param_.kNumBlockSizes *
657*09537850SAkhilesh Sanikop static_cast<int>(type_param_.has_vertical_filter);
658*09537850SAkhilesh Sanikop id += 4 * param_.kNumBlockSizes * static_cast<int>(type_param_.is_compound);
659*09537850SAkhilesh Sanikop id += 8 * param_.kNumBlockSizes *
660*09537850SAkhilesh Sanikop static_cast<int>(type_param_.is_intra_block_copy);
661*09537850SAkhilesh Sanikop return id;
662*09537850SAkhilesh Sanikop }
663*09537850SAkhilesh Sanikop
664*09537850SAkhilesh Sanikop void GetConvolveFunc(const Dsp* dsp, ConvolveFunc* func);
665*09537850SAkhilesh Sanikop void SetInputData(bool use_fixed_values, int value);
666*09537850SAkhilesh Sanikop void Check(bool use_fixed_values, const Pixel* src, const Pixel* dest,
667*09537850SAkhilesh Sanikop libvpx_test::MD5* md5_digest);
668*09537850SAkhilesh Sanikop void Check16Bit(bool use_fixed_values, const uint16_t* src,
669*09537850SAkhilesh Sanikop const uint16_t* dest, libvpx_test::MD5* md5_digest);
670*09537850SAkhilesh Sanikop // |num_runs| covers the categories of filters (6) and the number of filters
671*09537850SAkhilesh Sanikop // under each category (16).
672*09537850SAkhilesh Sanikop void Test(bool use_fixed_values, int value,
673*09537850SAkhilesh Sanikop int num_runs = kMinimumViableRuns);
674*09537850SAkhilesh Sanikop
675*09537850SAkhilesh Sanikop const ConvolveTypeParam type_param_ = std::get<0>(GetParam());
676*09537850SAkhilesh Sanikop const ConvolveTestParam param_ = std::get<1>(GetParam());
677*09537850SAkhilesh Sanikop
678*09537850SAkhilesh Sanikop private:
679*09537850SAkhilesh Sanikop ConvolveFunc base_convolve_func_;
680*09537850SAkhilesh Sanikop ConvolveFunc cur_convolve_func_;
681*09537850SAkhilesh Sanikop // Convolve filters are 7-tap, which need 3 pixels
682*09537850SAkhilesh Sanikop // (kRestorationHorizontalBorder) padding.
683*09537850SAkhilesh Sanikop Pixel source_[kMaxBlockHeight * kMaxBlockWidth] = {};
684*09537850SAkhilesh Sanikop uint16_t source_16bit_[kMaxBlockHeight * kMaxBlockWidth] = {};
685*09537850SAkhilesh Sanikop uint16_t dest_16bit_[kMaxBlockHeight * kMaxBlockWidth] = {};
686*09537850SAkhilesh Sanikop Pixel dest_clipped_[kMaxBlockHeight * kMaxBlockWidth] = {};
687*09537850SAkhilesh Sanikop
688*09537850SAkhilesh Sanikop const int source_stride_ = kMaxBlockWidth;
689*09537850SAkhilesh Sanikop const int source_height_ = kMaxBlockHeight;
690*09537850SAkhilesh Sanikop };
691*09537850SAkhilesh Sanikop
692*09537850SAkhilesh Sanikop template <int bitdepth, typename Pixel>
GetConvolveFunc(const Dsp * const dsp,ConvolveFunc * func)693*09537850SAkhilesh Sanikop void ConvolveTest<bitdepth, Pixel>::GetConvolveFunc(const Dsp* const dsp,
694*09537850SAkhilesh Sanikop ConvolveFunc* func) {
695*09537850SAkhilesh Sanikop *func =
696*09537850SAkhilesh Sanikop dsp->convolve[type_param_.is_intra_block_copy][type_param_.is_compound]
697*09537850SAkhilesh Sanikop [type_param_.has_vertical_filter]
698*09537850SAkhilesh Sanikop [type_param_.has_horizontal_filter];
699*09537850SAkhilesh Sanikop }
700*09537850SAkhilesh Sanikop
701*09537850SAkhilesh Sanikop template <int bitdepth, typename Pixel>
SetInputData(bool use_fixed_values,int value)702*09537850SAkhilesh Sanikop void ConvolveTest<bitdepth, Pixel>::SetInputData(bool use_fixed_values,
703*09537850SAkhilesh Sanikop int value) {
704*09537850SAkhilesh Sanikop if (use_fixed_values) {
705*09537850SAkhilesh Sanikop std::fill(source_, source_ + source_height_ * source_stride_, value);
706*09537850SAkhilesh Sanikop } else {
707*09537850SAkhilesh Sanikop const int offset =
708*09537850SAkhilesh Sanikop kConvolveBorderLeftTop * source_stride_ + kConvolveBorderLeftTop;
709*09537850SAkhilesh Sanikop const int mask = (1 << bitdepth) - 1;
710*09537850SAkhilesh Sanikop libvpx_test::ACMRandom rnd(libvpx_test::ACMRandom::DeterministicSeed());
711*09537850SAkhilesh Sanikop const int height = param_.height;
712*09537850SAkhilesh Sanikop const int width = param_.width;
713*09537850SAkhilesh Sanikop for (int y = 0; y < height; ++y) {
714*09537850SAkhilesh Sanikop for (int x = 0; x < width; ++x) {
715*09537850SAkhilesh Sanikop source_[y * source_stride_ + x + offset] = rnd.Rand16() & mask;
716*09537850SAkhilesh Sanikop }
717*09537850SAkhilesh Sanikop }
718*09537850SAkhilesh Sanikop // Copy border pixels to the left and right borders.
719*09537850SAkhilesh Sanikop for (int y = 0; y < height; ++y) {
720*09537850SAkhilesh Sanikop Memset(&source_[(y + kConvolveBorderLeftTop) * source_stride_],
721*09537850SAkhilesh Sanikop source_[y * source_stride_ + offset], kConvolveBorderLeftTop);
722*09537850SAkhilesh Sanikop Memset(&source_[y * source_stride_ + offset + width],
723*09537850SAkhilesh Sanikop source_[y * source_stride_ + offset + width - 1],
724*09537850SAkhilesh Sanikop kConvolveBorderLeftTop);
725*09537850SAkhilesh Sanikop }
726*09537850SAkhilesh Sanikop // Copy border pixels to the top and bottom borders.
727*09537850SAkhilesh Sanikop for (int y = 0; y < kConvolveBorderLeftTop; ++y) {
728*09537850SAkhilesh Sanikop memcpy(&source_[y * source_stride_],
729*09537850SAkhilesh Sanikop &source_[kConvolveBorderLeftTop * source_stride_],
730*09537850SAkhilesh Sanikop source_stride_ * sizeof(Pixel));
731*09537850SAkhilesh Sanikop memcpy(&source_[(y + kConvolveBorderLeftTop + height) * source_stride_],
732*09537850SAkhilesh Sanikop &source_[(kConvolveBorderLeftTop + height - 1) * source_stride_],
733*09537850SAkhilesh Sanikop source_stride_ * sizeof(Pixel));
734*09537850SAkhilesh Sanikop }
735*09537850SAkhilesh Sanikop }
736*09537850SAkhilesh Sanikop }
737*09537850SAkhilesh Sanikop
738*09537850SAkhilesh Sanikop template <int bitdepth, typename Pixel>
Check(bool use_fixed_values,const Pixel * src,const Pixel * dest,libvpx_test::MD5 * md5_digest)739*09537850SAkhilesh Sanikop void ConvolveTest<bitdepth, Pixel>::Check(bool use_fixed_values,
740*09537850SAkhilesh Sanikop const Pixel* src, const Pixel* dest,
741*09537850SAkhilesh Sanikop libvpx_test::MD5* md5_digest) {
742*09537850SAkhilesh Sanikop if (use_fixed_values) {
743*09537850SAkhilesh Sanikop // For fixed values, input and output are identical.
744*09537850SAkhilesh Sanikop const bool success =
745*09537850SAkhilesh Sanikop test_utils::CompareBlocks(src, dest, param_.width, param_.height,
746*09537850SAkhilesh Sanikop kMaxBlockWidth, kMaxBlockWidth, false, false);
747*09537850SAkhilesh Sanikop EXPECT_TRUE(success);
748*09537850SAkhilesh Sanikop } else {
749*09537850SAkhilesh Sanikop // For random input, compare md5.
750*09537850SAkhilesh Sanikop const int offset =
751*09537850SAkhilesh Sanikop kConvolveBorderLeftTop * kMaxBlockWidth + kConvolveBorderLeftTop;
752*09537850SAkhilesh Sanikop const size_t size = sizeof(dest_clipped_) - offset * sizeof(Pixel);
753*09537850SAkhilesh Sanikop md5_digest->Add(reinterpret_cast<const uint8_t*>(dest), size);
754*09537850SAkhilesh Sanikop }
755*09537850SAkhilesh Sanikop }
756*09537850SAkhilesh Sanikop
757*09537850SAkhilesh Sanikop template <int bitdepth, typename Pixel>
Check16Bit(bool use_fixed_values,const uint16_t * src,const uint16_t * dest,libvpx_test::MD5 * md5_digest)758*09537850SAkhilesh Sanikop void ConvolveTest<bitdepth, Pixel>::Check16Bit(bool use_fixed_values,
759*09537850SAkhilesh Sanikop const uint16_t* src,
760*09537850SAkhilesh Sanikop const uint16_t* dest,
761*09537850SAkhilesh Sanikop libvpx_test::MD5* md5_digest) {
762*09537850SAkhilesh Sanikop if (use_fixed_values) {
763*09537850SAkhilesh Sanikop // For fixed values, input and output are identical.
764*09537850SAkhilesh Sanikop const bool success =
765*09537850SAkhilesh Sanikop test_utils::CompareBlocks(src, dest, param_.width, param_.height,
766*09537850SAkhilesh Sanikop kMaxBlockWidth, kMaxBlockWidth, false);
767*09537850SAkhilesh Sanikop EXPECT_TRUE(success);
768*09537850SAkhilesh Sanikop } else {
769*09537850SAkhilesh Sanikop // For random input, compare md5.
770*09537850SAkhilesh Sanikop const int offset =
771*09537850SAkhilesh Sanikop kConvolveBorderLeftTop * kMaxBlockWidth + kConvolveBorderLeftTop;
772*09537850SAkhilesh Sanikop const size_t size = sizeof(dest_16bit_) - offset * sizeof(uint16_t);
773*09537850SAkhilesh Sanikop md5_digest->Add(reinterpret_cast<const uint8_t*>(dest), size);
774*09537850SAkhilesh Sanikop }
775*09537850SAkhilesh Sanikop }
776*09537850SAkhilesh Sanikop
777*09537850SAkhilesh Sanikop template <int bitdepth, typename Pixel>
Test(bool use_fixed_values,int value,int num_runs)778*09537850SAkhilesh Sanikop void ConvolveTest<bitdepth, Pixel>::Test(
779*09537850SAkhilesh Sanikop bool use_fixed_values, int value, int num_runs /*= kMinimumViableRuns*/) {
780*09537850SAkhilesh Sanikop // There's no meaning testing fixed input in compound convolve.
781*09537850SAkhilesh Sanikop if (type_param_.is_compound && use_fixed_values) return;
782*09537850SAkhilesh Sanikop
783*09537850SAkhilesh Sanikop // There should not be any function set for this combination.
784*09537850SAkhilesh Sanikop if (type_param_.is_intra_block_copy && type_param_.is_compound) {
785*09537850SAkhilesh Sanikop ASSERT_EQ(cur_convolve_func_, nullptr);
786*09537850SAkhilesh Sanikop return;
787*09537850SAkhilesh Sanikop }
788*09537850SAkhilesh Sanikop
789*09537850SAkhilesh Sanikop // Compound and intra block copy functions are only used for blocks 4x4 or
790*09537850SAkhilesh Sanikop // greater.
791*09537850SAkhilesh Sanikop if (type_param_.is_compound || type_param_.is_intra_block_copy) {
792*09537850SAkhilesh Sanikop if (param_.width < 4 || param_.height < 4) {
793*09537850SAkhilesh Sanikop GTEST_SKIP();
794*09537850SAkhilesh Sanikop }
795*09537850SAkhilesh Sanikop }
796*09537850SAkhilesh Sanikop
797*09537850SAkhilesh Sanikop // Skip unspecialized functions.
798*09537850SAkhilesh Sanikop if (cur_convolve_func_ == nullptr) {
799*09537850SAkhilesh Sanikop GTEST_SKIP();
800*09537850SAkhilesh Sanikop }
801*09537850SAkhilesh Sanikop
802*09537850SAkhilesh Sanikop SetInputData(use_fixed_values, value);
803*09537850SAkhilesh Sanikop int subpixel_x = 0;
804*09537850SAkhilesh Sanikop int subpixel_y = 0;
805*09537850SAkhilesh Sanikop int vertical_index = 0;
806*09537850SAkhilesh Sanikop int horizontal_index = 0;
807*09537850SAkhilesh Sanikop const int offset =
808*09537850SAkhilesh Sanikop kConvolveBorderLeftTop * kMaxBlockWidth + kConvolveBorderLeftTop;
809*09537850SAkhilesh Sanikop const Pixel* const src = source_ + offset;
810*09537850SAkhilesh Sanikop const ptrdiff_t src_stride = source_stride_ * sizeof(Pixel);
811*09537850SAkhilesh Sanikop const ptrdiff_t src_stride_16 = source_stride_;
812*09537850SAkhilesh Sanikop const ptrdiff_t dst_stride = kMaxBlockWidth * sizeof(Pixel);
813*09537850SAkhilesh Sanikop // Pack Compound output since we control the predictor buffer.
814*09537850SAkhilesh Sanikop const ptrdiff_t dst_stride_compound = param_.width;
815*09537850SAkhilesh Sanikop
816*09537850SAkhilesh Sanikop // Output is always 16 bits regardless of |bitdepth|.
817*09537850SAkhilesh Sanikop uint16_t* dst_16 = dest_16bit_ + offset;
818*09537850SAkhilesh Sanikop // Output depends on |bitdepth|.
819*09537850SAkhilesh Sanikop Pixel* dst_pixel = dest_clipped_ + offset;
820*09537850SAkhilesh Sanikop
821*09537850SAkhilesh Sanikop // Collect the first |kMinimumViableRuns| into one md5 buffer.
822*09537850SAkhilesh Sanikop libvpx_test::MD5 md5_digest;
823*09537850SAkhilesh Sanikop
824*09537850SAkhilesh Sanikop absl::Duration elapsed_time;
825*09537850SAkhilesh Sanikop for (int i = 0; i < num_runs; ++i) {
826*09537850SAkhilesh Sanikop // Test every filter.
827*09537850SAkhilesh Sanikop // Because of masking |subpixel_{x,y}| values roll over every 16 iterations.
828*09537850SAkhilesh Sanikop subpixel_x += 1 << 6;
829*09537850SAkhilesh Sanikop subpixel_y += 1 << 6;
830*09537850SAkhilesh Sanikop
831*09537850SAkhilesh Sanikop const int horizontal_filter_id = (subpixel_x >> 6) & 0xF;
832*09537850SAkhilesh Sanikop const int vertical_filter_id = (subpixel_y >> 6) & 0xF;
833*09537850SAkhilesh Sanikop
834*09537850SAkhilesh Sanikop // |filter_id| == 0 (copy) must be handled by the appropriate 1D or copy
835*09537850SAkhilesh Sanikop // function.
836*09537850SAkhilesh Sanikop if (horizontal_filter_id == 0 || vertical_filter_id == 0) {
837*09537850SAkhilesh Sanikop continue;
838*09537850SAkhilesh Sanikop }
839*09537850SAkhilesh Sanikop
840*09537850SAkhilesh Sanikop // For focused speed testing these can be set to the desired filter. Want
841*09537850SAkhilesh Sanikop // only 8 tap filters? Set |{vertical,horizontal}_index| to 2.
842*09537850SAkhilesh Sanikop vertical_index += static_cast<int>(i % 16 == 0);
843*09537850SAkhilesh Sanikop vertical_index %= 4;
844*09537850SAkhilesh Sanikop horizontal_index += static_cast<int>(i % 16 == 0);
845*09537850SAkhilesh Sanikop horizontal_index %= 4;
846*09537850SAkhilesh Sanikop
847*09537850SAkhilesh Sanikop if (type_param_.is_compound) {
848*09537850SAkhilesh Sanikop // Output type is uint16_t.
849*09537850SAkhilesh Sanikop const absl::Time start = absl::Now();
850*09537850SAkhilesh Sanikop cur_convolve_func_(src, src_stride, horizontal_index, vertical_index,
851*09537850SAkhilesh Sanikop horizontal_filter_id, vertical_filter_id, param_.width,
852*09537850SAkhilesh Sanikop param_.height, dst_16, dst_stride_compound);
853*09537850SAkhilesh Sanikop elapsed_time += absl::Now() - start;
854*09537850SAkhilesh Sanikop } else {
855*09537850SAkhilesh Sanikop // Output type is Pixel.
856*09537850SAkhilesh Sanikop const absl::Time start = absl::Now();
857*09537850SAkhilesh Sanikop cur_convolve_func_(src, src_stride, horizontal_index, vertical_index,
858*09537850SAkhilesh Sanikop horizontal_filter_id, vertical_filter_id, param_.width,
859*09537850SAkhilesh Sanikop param_.height, dst_pixel, dst_stride);
860*09537850SAkhilesh Sanikop elapsed_time += absl::Now() - start;
861*09537850SAkhilesh Sanikop }
862*09537850SAkhilesh Sanikop
863*09537850SAkhilesh Sanikop // Only check the output for the first set. After that it's just repeated
864*09537850SAkhilesh Sanikop // runs for speed timing.
865*09537850SAkhilesh Sanikop if (i >= kMinimumViableRuns) continue;
866*09537850SAkhilesh Sanikop
867*09537850SAkhilesh Sanikop if (type_param_.is_compound) {
868*09537850SAkhilesh Sanikop // Need to copy source to a uint16_t buffer for comparison.
869*09537850SAkhilesh Sanikop Pixel* src_ptr = source_;
870*09537850SAkhilesh Sanikop uint16_t* src_ptr_16 = source_16bit_;
871*09537850SAkhilesh Sanikop for (int y = 0; y < kMaxBlockHeight; ++y) {
872*09537850SAkhilesh Sanikop for (int x = 0; x < kMaxBlockWidth; ++x) {
873*09537850SAkhilesh Sanikop src_ptr_16[x] = src_ptr[x];
874*09537850SAkhilesh Sanikop }
875*09537850SAkhilesh Sanikop src_ptr += src_stride_16;
876*09537850SAkhilesh Sanikop src_ptr_16 += src_stride_16;
877*09537850SAkhilesh Sanikop }
878*09537850SAkhilesh Sanikop
879*09537850SAkhilesh Sanikop Check16Bit(use_fixed_values, source_16bit_ + offset, dst_16, &md5_digest);
880*09537850SAkhilesh Sanikop } else {
881*09537850SAkhilesh Sanikop Check(use_fixed_values, src, dst_pixel, &md5_digest);
882*09537850SAkhilesh Sanikop }
883*09537850SAkhilesh Sanikop }
884*09537850SAkhilesh Sanikop
885*09537850SAkhilesh Sanikop if (!use_fixed_values) {
886*09537850SAkhilesh Sanikop // md5 sums are only calculated for random input.
887*09537850SAkhilesh Sanikop const char* ref_digest = nullptr;
888*09537850SAkhilesh Sanikop switch (bitdepth) {
889*09537850SAkhilesh Sanikop case 8:
890*09537850SAkhilesh Sanikop ref_digest = GetConvolveDigest8bpp(GetDigestId());
891*09537850SAkhilesh Sanikop break;
892*09537850SAkhilesh Sanikop #if LIBGAV1_MAX_BITDEPTH >= 10
893*09537850SAkhilesh Sanikop case 10:
894*09537850SAkhilesh Sanikop ref_digest = GetConvolveDigest10bpp(GetDigestId());
895*09537850SAkhilesh Sanikop break;
896*09537850SAkhilesh Sanikop #endif
897*09537850SAkhilesh Sanikop #if LIBGAV1_MAX_BITDEPTH == 12
898*09537850SAkhilesh Sanikop case 12:
899*09537850SAkhilesh Sanikop ref_digest = GetConvolveDigest12bpp(GetDigestId());
900*09537850SAkhilesh Sanikop break;
901*09537850SAkhilesh Sanikop #endif
902*09537850SAkhilesh Sanikop }
903*09537850SAkhilesh Sanikop ASSERT_NE(ref_digest, nullptr);
904*09537850SAkhilesh Sanikop
905*09537850SAkhilesh Sanikop const char* direction;
906*09537850SAkhilesh Sanikop if (type_param_.has_vertical_filter && type_param_.has_horizontal_filter) {
907*09537850SAkhilesh Sanikop direction = "2D";
908*09537850SAkhilesh Sanikop } else if (type_param_.has_vertical_filter) {
909*09537850SAkhilesh Sanikop direction = "Vertical";
910*09537850SAkhilesh Sanikop } else if (type_param_.has_horizontal_filter) {
911*09537850SAkhilesh Sanikop direction = "Horizontal";
912*09537850SAkhilesh Sanikop } else {
913*09537850SAkhilesh Sanikop direction = "Copy";
914*09537850SAkhilesh Sanikop }
915*09537850SAkhilesh Sanikop const auto elapsed_time_us =
916*09537850SAkhilesh Sanikop static_cast<int>(absl::ToInt64Microseconds(elapsed_time));
917*09537850SAkhilesh Sanikop printf("Mode Convolve%s%s%s[%25s]: %5d us MD5: %s\n",
918*09537850SAkhilesh Sanikop type_param_.is_compound ? "Compound" : "",
919*09537850SAkhilesh Sanikop type_param_.is_intra_block_copy ? "IntraBlockCopy" : "", direction,
920*09537850SAkhilesh Sanikop absl::StrFormat("%dx%d", param_.width, param_.height).c_str(),
921*09537850SAkhilesh Sanikop elapsed_time_us, md5_digest.Get());
922*09537850SAkhilesh Sanikop EXPECT_STREQ(ref_digest, md5_digest.Get());
923*09537850SAkhilesh Sanikop }
924*09537850SAkhilesh Sanikop }
925*09537850SAkhilesh Sanikop
ApplyFilterToSignedInput(const int min_input,const int max_input,const int8_t filter[kSubPixelTaps],int * min_output,int * max_output)926*09537850SAkhilesh Sanikop void ApplyFilterToSignedInput(const int min_input, const int max_input,
927*09537850SAkhilesh Sanikop const int8_t filter[kSubPixelTaps],
928*09537850SAkhilesh Sanikop int* min_output, int* max_output) {
929*09537850SAkhilesh Sanikop int min = 0, max = 0;
930*09537850SAkhilesh Sanikop for (int i = 0; i < kSubPixelTaps; ++i) {
931*09537850SAkhilesh Sanikop const int tap = filter[i];
932*09537850SAkhilesh Sanikop if (tap > 0) {
933*09537850SAkhilesh Sanikop max += max_input * tap;
934*09537850SAkhilesh Sanikop min += min_input * tap;
935*09537850SAkhilesh Sanikop } else {
936*09537850SAkhilesh Sanikop min += max_input * tap;
937*09537850SAkhilesh Sanikop max += min_input * tap;
938*09537850SAkhilesh Sanikop }
939*09537850SAkhilesh Sanikop }
940*09537850SAkhilesh Sanikop *min_output = min;
941*09537850SAkhilesh Sanikop *max_output = max;
942*09537850SAkhilesh Sanikop }
943*09537850SAkhilesh Sanikop
ApplyFilterToUnsignedInput(const int max_input,const int8_t filter[kSubPixelTaps],int * min_output,int * max_output)944*09537850SAkhilesh Sanikop void ApplyFilterToUnsignedInput(const int max_input,
945*09537850SAkhilesh Sanikop const int8_t filter[kSubPixelTaps],
946*09537850SAkhilesh Sanikop int* min_output, int* max_output) {
947*09537850SAkhilesh Sanikop ApplyFilterToSignedInput(0, max_input, filter, min_output, max_output);
948*09537850SAkhilesh Sanikop }
949*09537850SAkhilesh Sanikop
950*09537850SAkhilesh Sanikop // Validate the maximum ranges for different parts of the Convolve process.
951*09537850SAkhilesh Sanikop template <int bitdepth>
ShowRange()952*09537850SAkhilesh Sanikop void ShowRange() {
953*09537850SAkhilesh Sanikop // Subtract one from the shift bits because the filter is pre-shifted by 1.
954*09537850SAkhilesh Sanikop constexpr int horizontal_bits = (bitdepth == kBitdepth12)
955*09537850SAkhilesh Sanikop ? kInterRoundBitsHorizontal12bpp - 1
956*09537850SAkhilesh Sanikop : kInterRoundBitsHorizontal - 1;
957*09537850SAkhilesh Sanikop constexpr int vertical_bits = (bitdepth == kBitdepth12)
958*09537850SAkhilesh Sanikop ? kInterRoundBitsVertical12bpp - 1
959*09537850SAkhilesh Sanikop : kInterRoundBitsVertical - 1;
960*09537850SAkhilesh Sanikop constexpr int compound_vertical_bits = kInterRoundBitsCompoundVertical - 1;
961*09537850SAkhilesh Sanikop
962*09537850SAkhilesh Sanikop constexpr int compound_offset = (bitdepth == 8) ? 0 : kCompoundOffset;
963*09537850SAkhilesh Sanikop
964*09537850SAkhilesh Sanikop constexpr int max_input = (1 << bitdepth) - 1;
965*09537850SAkhilesh Sanikop
966*09537850SAkhilesh Sanikop const int8_t* worst_convolve_filter = kHalfSubPixelFilters[2][8];
967*09537850SAkhilesh Sanikop
968*09537850SAkhilesh Sanikop // First pass.
969*09537850SAkhilesh Sanikop printf("Bitdepth: %2d Input range: [%8d, %8d]\n", bitdepth, 0,
970*09537850SAkhilesh Sanikop max_input);
971*09537850SAkhilesh Sanikop
972*09537850SAkhilesh Sanikop int min, max;
973*09537850SAkhilesh Sanikop ApplyFilterToUnsignedInput(max_input, worst_convolve_filter, &min, &max);
974*09537850SAkhilesh Sanikop
975*09537850SAkhilesh Sanikop if (bitdepth == 8) {
976*09537850SAkhilesh Sanikop // 8bpp can use int16_t for sums.
977*09537850SAkhilesh Sanikop assert(min > INT16_MIN);
978*09537850SAkhilesh Sanikop assert(max < INT16_MAX);
979*09537850SAkhilesh Sanikop } else {
980*09537850SAkhilesh Sanikop // 10bpp and 12bpp require int32_t.
981*09537850SAkhilesh Sanikop assert(min > INT32_MIN);
982*09537850SAkhilesh Sanikop assert(max > INT16_MAX && max < INT32_MAX);
983*09537850SAkhilesh Sanikop }
984*09537850SAkhilesh Sanikop
985*09537850SAkhilesh Sanikop printf(" Horizontal upscaled range: [%8d, %8d]\n", min, max);
986*09537850SAkhilesh Sanikop
987*09537850SAkhilesh Sanikop const int first_pass_min = RightShiftWithRounding(min, horizontal_bits);
988*09537850SAkhilesh Sanikop const int first_pass_max = RightShiftWithRounding(max, horizontal_bits);
989*09537850SAkhilesh Sanikop
990*09537850SAkhilesh Sanikop // All bitdepths can use int16_t for first pass output.
991*09537850SAkhilesh Sanikop assert(first_pass_min > INT16_MIN);
992*09537850SAkhilesh Sanikop assert(first_pass_max < INT16_MAX);
993*09537850SAkhilesh Sanikop
994*09537850SAkhilesh Sanikop printf(" Horizontal downscaled range: [%8d, %8d]\n", first_pass_min,
995*09537850SAkhilesh Sanikop first_pass_max);
996*09537850SAkhilesh Sanikop
997*09537850SAkhilesh Sanikop // Second pass.
998*09537850SAkhilesh Sanikop ApplyFilterToSignedInput(first_pass_min, first_pass_max,
999*09537850SAkhilesh Sanikop worst_convolve_filter, &min, &max);
1000*09537850SAkhilesh Sanikop
1001*09537850SAkhilesh Sanikop // All bitdepths require int32_t for second pass sums.
1002*09537850SAkhilesh Sanikop assert(min < INT16_MIN && min > INT32_MIN);
1003*09537850SAkhilesh Sanikop assert(max > INT16_MAX && max < INT32_MAX);
1004*09537850SAkhilesh Sanikop
1005*09537850SAkhilesh Sanikop printf(" Vertical upscaled range: [%8d, %8d]\n", min, max);
1006*09537850SAkhilesh Sanikop
1007*09537850SAkhilesh Sanikop // Second pass non-compound output is clipped to Pixel values.
1008*09537850SAkhilesh Sanikop const int second_pass_min =
1009*09537850SAkhilesh Sanikop Clip3(RightShiftWithRounding(min, vertical_bits), 0, max_input);
1010*09537850SAkhilesh Sanikop const int second_pass_max =
1011*09537850SAkhilesh Sanikop Clip3(RightShiftWithRounding(max, vertical_bits), 0, max_input);
1012*09537850SAkhilesh Sanikop printf(" Pixel output range: [%8d, %8d]\n", second_pass_min,
1013*09537850SAkhilesh Sanikop second_pass_max);
1014*09537850SAkhilesh Sanikop
1015*09537850SAkhilesh Sanikop // Output is Pixel so matches Pixel values.
1016*09537850SAkhilesh Sanikop assert(second_pass_min == 0);
1017*09537850SAkhilesh Sanikop assert(second_pass_max == max_input);
1018*09537850SAkhilesh Sanikop
1019*09537850SAkhilesh Sanikop const int compound_second_pass_min =
1020*09537850SAkhilesh Sanikop RightShiftWithRounding(min, compound_vertical_bits) + compound_offset;
1021*09537850SAkhilesh Sanikop const int compound_second_pass_max =
1022*09537850SAkhilesh Sanikop RightShiftWithRounding(max, compound_vertical_bits) + compound_offset;
1023*09537850SAkhilesh Sanikop
1024*09537850SAkhilesh Sanikop printf(" Compound output range: [%8d, %8d]\n",
1025*09537850SAkhilesh Sanikop compound_second_pass_min, compound_second_pass_max);
1026*09537850SAkhilesh Sanikop
1027*09537850SAkhilesh Sanikop if (bitdepth == 8) {
1028*09537850SAkhilesh Sanikop // 8bpp output is int16_t without an offset.
1029*09537850SAkhilesh Sanikop assert(compound_second_pass_min > INT16_MIN);
1030*09537850SAkhilesh Sanikop assert(compound_second_pass_max < INT16_MAX);
1031*09537850SAkhilesh Sanikop } else {
1032*09537850SAkhilesh Sanikop // 10bpp and 12bpp use the offset to fit inside uint16_t.
1033*09537850SAkhilesh Sanikop assert(compound_second_pass_min > 0);
1034*09537850SAkhilesh Sanikop assert(compound_second_pass_max < UINT16_MAX);
1035*09537850SAkhilesh Sanikop }
1036*09537850SAkhilesh Sanikop
1037*09537850SAkhilesh Sanikop printf("\n");
1038*09537850SAkhilesh Sanikop }
1039*09537850SAkhilesh Sanikop
TEST(ConvolveTest,ShowRange)1040*09537850SAkhilesh Sanikop TEST(ConvolveTest, ShowRange) {
1041*09537850SAkhilesh Sanikop ShowRange<kBitdepth8>();
1042*09537850SAkhilesh Sanikop ShowRange<kBitdepth10>();
1043*09537850SAkhilesh Sanikop ShowRange<kBitdepth12>();
1044*09537850SAkhilesh Sanikop }
1045*09537850SAkhilesh Sanikop
1046*09537850SAkhilesh Sanikop using ConvolveTest8bpp = ConvolveTest<8, uint8_t>;
1047*09537850SAkhilesh Sanikop
TEST_P(ConvolveTest8bpp,FixedValues)1048*09537850SAkhilesh Sanikop TEST_P(ConvolveTest8bpp, FixedValues) {
1049*09537850SAkhilesh Sanikop Test(true, 0);
1050*09537850SAkhilesh Sanikop Test(true, 1);
1051*09537850SAkhilesh Sanikop Test(true, 128);
1052*09537850SAkhilesh Sanikop Test(true, 255);
1053*09537850SAkhilesh Sanikop }
1054*09537850SAkhilesh Sanikop
TEST_P(ConvolveTest8bpp,RandomValues)1055*09537850SAkhilesh Sanikop TEST_P(ConvolveTest8bpp, RandomValues) { Test(false, 0); }
1056*09537850SAkhilesh Sanikop
TEST_P(ConvolveTest8bpp,DISABLED_Speed)1057*09537850SAkhilesh Sanikop TEST_P(ConvolveTest8bpp, DISABLED_Speed) {
1058*09537850SAkhilesh Sanikop const int num_runs = static_cast<int>(1.0e7 / (param_.width * param_.height));
1059*09537850SAkhilesh Sanikop Test(false, 0, num_runs);
1060*09537850SAkhilesh Sanikop }
1061*09537850SAkhilesh Sanikop
1062*09537850SAkhilesh Sanikop //------------------------------------------------------------------------------
1063*09537850SAkhilesh Sanikop template <int bitdepth, typename Pixel>
1064*09537850SAkhilesh Sanikop class ConvolveScaleTest
1065*09537850SAkhilesh Sanikop : public testing::TestWithParam<
1066*09537850SAkhilesh Sanikop std::tuple<bool /*is_compound*/, ConvolveTestParam>> {
1067*09537850SAkhilesh Sanikop public:
1068*09537850SAkhilesh Sanikop static_assert(bitdepth >= kBitdepth8 && bitdepth <= LIBGAV1_MAX_BITDEPTH, "");
1069*09537850SAkhilesh Sanikop ConvolveScaleTest() = default;
1070*09537850SAkhilesh Sanikop ~ConvolveScaleTest() override = default;
1071*09537850SAkhilesh Sanikop
SetUp()1072*09537850SAkhilesh Sanikop void SetUp() override {
1073*09537850SAkhilesh Sanikop ConvolveInit_C();
1074*09537850SAkhilesh Sanikop
1075*09537850SAkhilesh Sanikop const Dsp* const dsp = GetDspTable(bitdepth);
1076*09537850SAkhilesh Sanikop ASSERT_NE(dsp, nullptr);
1077*09537850SAkhilesh Sanikop base_convolve_scale_func_ = dsp->convolve_scale[is_compound_];
1078*09537850SAkhilesh Sanikop
1079*09537850SAkhilesh Sanikop const testing::TestInfo* const test_info =
1080*09537850SAkhilesh Sanikop testing::UnitTest::GetInstance()->current_test_info();
1081*09537850SAkhilesh Sanikop const absl::string_view test_case = test_info->test_suite_name();
1082*09537850SAkhilesh Sanikop if (absl::StartsWith(test_case, "C/")) {
1083*09537850SAkhilesh Sanikop base_convolve_scale_func_ = nullptr;
1084*09537850SAkhilesh Sanikop } else if (absl::StartsWith(test_case, "SSE41/")) {
1085*09537850SAkhilesh Sanikop if ((GetCpuInfo() & kSSE4_1) == 0) GTEST_SKIP() << "No SSE4.1 support!";
1086*09537850SAkhilesh Sanikop ConvolveInit_SSE4_1();
1087*09537850SAkhilesh Sanikop } else if (absl::StartsWith(test_case, "AVX2/")) {
1088*09537850SAkhilesh Sanikop if ((GetCpuInfo() & kAVX2) == 0) GTEST_SKIP() << "No AVX2 support!";
1089*09537850SAkhilesh Sanikop ConvolveInit_AVX2();
1090*09537850SAkhilesh Sanikop } else if (absl::StartsWith(test_case, "NEON/")) {
1091*09537850SAkhilesh Sanikop ConvolveInit_NEON();
1092*09537850SAkhilesh Sanikop #if LIBGAV1_MAX_BITDEPTH >= 10
1093*09537850SAkhilesh Sanikop ConvolveInit10bpp_NEON();
1094*09537850SAkhilesh Sanikop #endif
1095*09537850SAkhilesh Sanikop } else {
1096*09537850SAkhilesh Sanikop FAIL() << "Unrecognized architecture prefix in test case name: "
1097*09537850SAkhilesh Sanikop << test_case;
1098*09537850SAkhilesh Sanikop }
1099*09537850SAkhilesh Sanikop
1100*09537850SAkhilesh Sanikop cur_convolve_scale_func_ = dsp->convolve_scale[is_compound_];
1101*09537850SAkhilesh Sanikop
1102*09537850SAkhilesh Sanikop // Skip functions that have not been specialized for this particular
1103*09537850SAkhilesh Sanikop // architecture.
1104*09537850SAkhilesh Sanikop if (cur_convolve_scale_func_ == base_convolve_scale_func_) {
1105*09537850SAkhilesh Sanikop cur_convolve_scale_func_ = nullptr;
1106*09537850SAkhilesh Sanikop }
1107*09537850SAkhilesh Sanikop }
1108*09537850SAkhilesh Sanikop
1109*09537850SAkhilesh Sanikop protected:
GetDigestId() const1110*09537850SAkhilesh Sanikop int GetDigestId() const {
1111*09537850SAkhilesh Sanikop return param_.block_size +
1112*09537850SAkhilesh Sanikop param_.kNumBlockSizes * static_cast<int>(is_compound_);
1113*09537850SAkhilesh Sanikop }
1114*09537850SAkhilesh Sanikop
1115*09537850SAkhilesh Sanikop void SetInputData(bool use_fixed_values, int value);
1116*09537850SAkhilesh Sanikop void Check(bool use_fixed_values, const Pixel* src, const Pixel* dest,
1117*09537850SAkhilesh Sanikop libvpx_test::MD5* md5_digest);
1118*09537850SAkhilesh Sanikop void Check16Bit(bool use_fixed_values, const uint16_t* src,
1119*09537850SAkhilesh Sanikop const uint16_t* dest, libvpx_test::MD5* md5_digest);
1120*09537850SAkhilesh Sanikop // |num_runs| covers the categories of filters (6) and the number of filters
1121*09537850SAkhilesh Sanikop // under each category (16).
1122*09537850SAkhilesh Sanikop void Test(bool use_fixed_values, int value,
1123*09537850SAkhilesh Sanikop int num_runs = kMinimumViableRuns);
1124*09537850SAkhilesh Sanikop
1125*09537850SAkhilesh Sanikop const bool is_compound_ = std::get<0>(GetParam());
1126*09537850SAkhilesh Sanikop const ConvolveTestParam param_ = std::get<1>(GetParam());
1127*09537850SAkhilesh Sanikop
1128*09537850SAkhilesh Sanikop private:
1129*09537850SAkhilesh Sanikop ConvolveScaleFunc base_convolve_scale_func_;
1130*09537850SAkhilesh Sanikop ConvolveScaleFunc cur_convolve_scale_func_;
1131*09537850SAkhilesh Sanikop // Convolve filters are 7-tap, which need 3 pixels
1132*09537850SAkhilesh Sanikop // (kRestorationHorizontalBorder) padding.
1133*09537850SAkhilesh Sanikop // The source can be at most 2 times of max width/height.
1134*09537850SAkhilesh Sanikop Pixel source_[kMaxBlockHeight * kMaxBlockWidth * 4] = {};
1135*09537850SAkhilesh Sanikop uint16_t source_16bit_[kMaxBlockHeight * kMaxBlockWidth * 4] = {};
1136*09537850SAkhilesh Sanikop uint16_t dest_16bit_[kMaxBlockHeight * kMaxBlockWidth] = {};
1137*09537850SAkhilesh Sanikop Pixel dest_clipped_[kMaxBlockHeight * kMaxBlockWidth] = {};
1138*09537850SAkhilesh Sanikop
1139*09537850SAkhilesh Sanikop const int source_stride_ = kMaxBlockWidth * 2;
1140*09537850SAkhilesh Sanikop const int source_height_ = kMaxBlockHeight * 2;
1141*09537850SAkhilesh Sanikop };
1142*09537850SAkhilesh Sanikop
1143*09537850SAkhilesh Sanikop template <int bitdepth, typename Pixel>
SetInputData(bool use_fixed_values,int value)1144*09537850SAkhilesh Sanikop void ConvolveScaleTest<bitdepth, Pixel>::SetInputData(bool use_fixed_values,
1145*09537850SAkhilesh Sanikop int value) {
1146*09537850SAkhilesh Sanikop if (use_fixed_values) {
1147*09537850SAkhilesh Sanikop std::fill(source_, source_ + source_height_ * source_stride_, value);
1148*09537850SAkhilesh Sanikop } else {
1149*09537850SAkhilesh Sanikop const int offset =
1150*09537850SAkhilesh Sanikop kConvolveBorderLeftTop * source_stride_ + kConvolveBorderLeftTop;
1151*09537850SAkhilesh Sanikop const int mask = (1 << bitdepth) - 1;
1152*09537850SAkhilesh Sanikop libvpx_test::ACMRandom rnd(libvpx_test::ACMRandom::DeterministicSeed());
1153*09537850SAkhilesh Sanikop const int height = param_.height * 2;
1154*09537850SAkhilesh Sanikop const int width = param_.width * 2;
1155*09537850SAkhilesh Sanikop for (int y = 0; y < height; ++y) {
1156*09537850SAkhilesh Sanikop for (int x = 0; x < width; ++x) {
1157*09537850SAkhilesh Sanikop source_[y * source_stride_ + x + offset] = rnd.Rand16() & mask;
1158*09537850SAkhilesh Sanikop }
1159*09537850SAkhilesh Sanikop }
1160*09537850SAkhilesh Sanikop // Copy border pixels to the left and right borders.
1161*09537850SAkhilesh Sanikop for (int y = 0; y < height; ++y) {
1162*09537850SAkhilesh Sanikop Memset(&source_[(y + kConvolveBorderLeftTop) * source_stride_],
1163*09537850SAkhilesh Sanikop source_[y * source_stride_ + offset], kConvolveBorderLeftTop);
1164*09537850SAkhilesh Sanikop Memset(&source_[y * source_stride_ + offset + width],
1165*09537850SAkhilesh Sanikop source_[y * source_stride_ + offset + width - 1],
1166*09537850SAkhilesh Sanikop kConvolveBorderLeftTop);
1167*09537850SAkhilesh Sanikop }
1168*09537850SAkhilesh Sanikop // Copy border pixels to the top and bottom borders.
1169*09537850SAkhilesh Sanikop for (int y = 0; y < kConvolveBorderLeftTop; ++y) {
1170*09537850SAkhilesh Sanikop memcpy(&source_[y * source_stride_],
1171*09537850SAkhilesh Sanikop &source_[kConvolveBorderLeftTop * source_stride_],
1172*09537850SAkhilesh Sanikop source_stride_ * sizeof(Pixel));
1173*09537850SAkhilesh Sanikop memcpy(&source_[(y + kConvolveBorderLeftTop + height) * source_stride_],
1174*09537850SAkhilesh Sanikop &source_[(kConvolveBorderLeftTop + height - 1) * source_stride_],
1175*09537850SAkhilesh Sanikop source_stride_ * sizeof(Pixel));
1176*09537850SAkhilesh Sanikop }
1177*09537850SAkhilesh Sanikop }
1178*09537850SAkhilesh Sanikop }
1179*09537850SAkhilesh Sanikop
1180*09537850SAkhilesh Sanikop template <int bitdepth, typename Pixel>
Check(bool use_fixed_values,const Pixel * src,const Pixel * dest,libvpx_test::MD5 * md5_digest)1181*09537850SAkhilesh Sanikop void ConvolveScaleTest<bitdepth, Pixel>::Check(bool use_fixed_values,
1182*09537850SAkhilesh Sanikop const Pixel* src,
1183*09537850SAkhilesh Sanikop const Pixel* dest,
1184*09537850SAkhilesh Sanikop libvpx_test::MD5* md5_digest) {
1185*09537850SAkhilesh Sanikop if (use_fixed_values) {
1186*09537850SAkhilesh Sanikop // For fixed values, input and output are identical.
1187*09537850SAkhilesh Sanikop const bool success =
1188*09537850SAkhilesh Sanikop test_utils::CompareBlocks(src, dest, param_.width, param_.height,
1189*09537850SAkhilesh Sanikop kMaxBlockWidth, kMaxBlockWidth, false, false);
1190*09537850SAkhilesh Sanikop EXPECT_TRUE(success);
1191*09537850SAkhilesh Sanikop } else {
1192*09537850SAkhilesh Sanikop // For random input, compare md5.
1193*09537850SAkhilesh Sanikop const int offset =
1194*09537850SAkhilesh Sanikop kConvolveBorderLeftTop * kMaxBlockWidth + kConvolveBorderLeftTop;
1195*09537850SAkhilesh Sanikop const size_t size = sizeof(dest_clipped_) - offset * sizeof(Pixel);
1196*09537850SAkhilesh Sanikop md5_digest->Add(reinterpret_cast<const uint8_t*>(dest), size);
1197*09537850SAkhilesh Sanikop }
1198*09537850SAkhilesh Sanikop }
1199*09537850SAkhilesh Sanikop
1200*09537850SAkhilesh Sanikop template <int bitdepth, typename Pixel>
Check16Bit(bool use_fixed_values,const uint16_t * src,const uint16_t * dest,libvpx_test::MD5 * md5_digest)1201*09537850SAkhilesh Sanikop void ConvolveScaleTest<bitdepth, Pixel>::Check16Bit(
1202*09537850SAkhilesh Sanikop bool use_fixed_values, const uint16_t* src, const uint16_t* dest,
1203*09537850SAkhilesh Sanikop libvpx_test::MD5* md5_digest) {
1204*09537850SAkhilesh Sanikop if (use_fixed_values) {
1205*09537850SAkhilesh Sanikop // For fixed values, input and output are identical.
1206*09537850SAkhilesh Sanikop const bool success =
1207*09537850SAkhilesh Sanikop test_utils::CompareBlocks(src, dest, param_.width, param_.height,
1208*09537850SAkhilesh Sanikop kMaxBlockWidth, kMaxBlockWidth, false);
1209*09537850SAkhilesh Sanikop EXPECT_TRUE(success);
1210*09537850SAkhilesh Sanikop } else {
1211*09537850SAkhilesh Sanikop // For random input, compare md5.
1212*09537850SAkhilesh Sanikop const int offset =
1213*09537850SAkhilesh Sanikop kConvolveBorderLeftTop * kMaxBlockWidth + kConvolveBorderLeftTop;
1214*09537850SAkhilesh Sanikop const size_t size = sizeof(dest_16bit_) - offset * sizeof(uint16_t);
1215*09537850SAkhilesh Sanikop md5_digest->Add(reinterpret_cast<const uint8_t*>(dest), size);
1216*09537850SAkhilesh Sanikop }
1217*09537850SAkhilesh Sanikop }
1218*09537850SAkhilesh Sanikop
1219*09537850SAkhilesh Sanikop template <int bitdepth, typename Pixel>
Test(bool use_fixed_values,int value,int num_runs)1220*09537850SAkhilesh Sanikop void ConvolveScaleTest<bitdepth, Pixel>::Test(
1221*09537850SAkhilesh Sanikop bool use_fixed_values, int value, int num_runs /*= kMinimumViableRuns*/) {
1222*09537850SAkhilesh Sanikop // There's no meaning testing fixed input in compound convolve.
1223*09537850SAkhilesh Sanikop if (is_compound_ && use_fixed_values) return;
1224*09537850SAkhilesh Sanikop
1225*09537850SAkhilesh Sanikop // The compound function is only used for blocks 4x4 or greater.
1226*09537850SAkhilesh Sanikop if (is_compound_) {
1227*09537850SAkhilesh Sanikop if (param_.width < 4 || param_.height < 4) {
1228*09537850SAkhilesh Sanikop GTEST_SKIP();
1229*09537850SAkhilesh Sanikop }
1230*09537850SAkhilesh Sanikop }
1231*09537850SAkhilesh Sanikop
1232*09537850SAkhilesh Sanikop // Skip unspecialized functions.
1233*09537850SAkhilesh Sanikop if (cur_convolve_scale_func_ == nullptr) {
1234*09537850SAkhilesh Sanikop GTEST_SKIP();
1235*09537850SAkhilesh Sanikop }
1236*09537850SAkhilesh Sanikop
1237*09537850SAkhilesh Sanikop SetInputData(use_fixed_values, value);
1238*09537850SAkhilesh Sanikop libvpx_test::ACMRandom rnd(libvpx_test::ACMRandom::DeterministicSeed() +
1239*09537850SAkhilesh Sanikop GetDigestId());
1240*09537850SAkhilesh Sanikop // [1,2048] for |step_[xy]|. This covers a scaling range of 1/1024 to 2x.
1241*09537850SAkhilesh Sanikop const int step_x = (rnd.Rand16() & ((1 << 11) - 1)) + 1;
1242*09537850SAkhilesh Sanikop const int step_y = (rnd.Rand16() & ((1 << 11) - 1)) + 1;
1243*09537850SAkhilesh Sanikop int subpixel_x = 0;
1244*09537850SAkhilesh Sanikop int subpixel_y = 0;
1245*09537850SAkhilesh Sanikop int vertical_index = 0;
1246*09537850SAkhilesh Sanikop int horizontal_index = 0;
1247*09537850SAkhilesh Sanikop const int offset =
1248*09537850SAkhilesh Sanikop kConvolveBorderLeftTop * kMaxBlockWidth + kConvolveBorderLeftTop;
1249*09537850SAkhilesh Sanikop const int offset_scale =
1250*09537850SAkhilesh Sanikop kConvolveBorderLeftTop * source_stride_ + kConvolveBorderLeftTop;
1251*09537850SAkhilesh Sanikop const Pixel* const src_scale = source_ + offset_scale;
1252*09537850SAkhilesh Sanikop const ptrdiff_t src_stride = source_stride_ * sizeof(Pixel);
1253*09537850SAkhilesh Sanikop const ptrdiff_t dst_stride = kMaxBlockWidth * sizeof(Pixel);
1254*09537850SAkhilesh Sanikop // Pack Compound output since we control the predictor buffer.
1255*09537850SAkhilesh Sanikop const ptrdiff_t dst_stride_compound = param_.width;
1256*09537850SAkhilesh Sanikop
1257*09537850SAkhilesh Sanikop // Output is always 16 bits regardless of |bitdepth|.
1258*09537850SAkhilesh Sanikop uint16_t* dst_16 = dest_16bit_ + offset;
1259*09537850SAkhilesh Sanikop // Output depends on |bitdepth|.
1260*09537850SAkhilesh Sanikop Pixel* dst_pixel = dest_clipped_ + offset;
1261*09537850SAkhilesh Sanikop
1262*09537850SAkhilesh Sanikop // Collect the first |kMinimumViableRuns| into one md5 buffer.
1263*09537850SAkhilesh Sanikop libvpx_test::MD5 md5_digest;
1264*09537850SAkhilesh Sanikop
1265*09537850SAkhilesh Sanikop absl::Duration elapsed_time;
1266*09537850SAkhilesh Sanikop for (int i = 0; i < num_runs; ++i) {
1267*09537850SAkhilesh Sanikop // Test every filter.
1268*09537850SAkhilesh Sanikop // Because of masking |subpixel_{x,y}| values roll over every 16 iterations.
1269*09537850SAkhilesh Sanikop subpixel_x += 1 << 6;
1270*09537850SAkhilesh Sanikop subpixel_y += 1 << 6;
1271*09537850SAkhilesh Sanikop
1272*09537850SAkhilesh Sanikop const int horizontal_filter_id = (subpixel_x >> 6) & 0xF;
1273*09537850SAkhilesh Sanikop const int vertical_filter_id = (subpixel_y >> 6) & 0xF;
1274*09537850SAkhilesh Sanikop
1275*09537850SAkhilesh Sanikop // |filter_id| == 0 (copy) must be handled by the appropriate 1D or copy
1276*09537850SAkhilesh Sanikop // function.
1277*09537850SAkhilesh Sanikop if (horizontal_filter_id == 0 || vertical_filter_id == 0) {
1278*09537850SAkhilesh Sanikop continue;
1279*09537850SAkhilesh Sanikop }
1280*09537850SAkhilesh Sanikop
1281*09537850SAkhilesh Sanikop // For focused speed testing these can be set to the desired filter. Want
1282*09537850SAkhilesh Sanikop // only 8 tap filters? Set |{vertical,horizontal}_index| to 2.
1283*09537850SAkhilesh Sanikop vertical_index += static_cast<int>(i % 16 == 0);
1284*09537850SAkhilesh Sanikop vertical_index %= 4;
1285*09537850SAkhilesh Sanikop horizontal_index += static_cast<int>(i % 16 == 0);
1286*09537850SAkhilesh Sanikop horizontal_index %= 4;
1287*09537850SAkhilesh Sanikop
1288*09537850SAkhilesh Sanikop // Output type is uint16_t.
1289*09537850SAkhilesh Sanikop const absl::Time start = absl::Now();
1290*09537850SAkhilesh Sanikop if (is_compound_) {
1291*09537850SAkhilesh Sanikop cur_convolve_scale_func_(
1292*09537850SAkhilesh Sanikop source_, src_stride, horizontal_index, vertical_index, 0, 0, step_x,
1293*09537850SAkhilesh Sanikop step_y, param_.width, param_.height, dst_16, dst_stride_compound);
1294*09537850SAkhilesh Sanikop } else {
1295*09537850SAkhilesh Sanikop cur_convolve_scale_func_(
1296*09537850SAkhilesh Sanikop source_, src_stride, horizontal_index, vertical_index, 0, 0, step_x,
1297*09537850SAkhilesh Sanikop step_y, param_.width, param_.height, dst_pixel, dst_stride);
1298*09537850SAkhilesh Sanikop }
1299*09537850SAkhilesh Sanikop elapsed_time += absl::Now() - start;
1300*09537850SAkhilesh Sanikop
1301*09537850SAkhilesh Sanikop // Only check the output for the first set. After that it's just repeated
1302*09537850SAkhilesh Sanikop // runs for speed timing.
1303*09537850SAkhilesh Sanikop if (i >= kMinimumViableRuns) continue;
1304*09537850SAkhilesh Sanikop
1305*09537850SAkhilesh Sanikop // Convolve function does not clip the output. The clipping is applied
1306*09537850SAkhilesh Sanikop // later, but libaom clips the output. So we apply clipping to match
1307*09537850SAkhilesh Sanikop // libaom in tests.
1308*09537850SAkhilesh Sanikop if (is_compound_) {
1309*09537850SAkhilesh Sanikop const int single_round_offset = (1 << bitdepth) + (1 << (bitdepth - 1));
1310*09537850SAkhilesh Sanikop Pixel* dest_row = dest_clipped_;
1311*09537850SAkhilesh Sanikop for (int y = 0; y < kMaxBlockHeight; ++y) {
1312*09537850SAkhilesh Sanikop for (int x = 0; x < kMaxBlockWidth; ++x) {
1313*09537850SAkhilesh Sanikop dest_row[x] = static_cast<Pixel>(Clip3(
1314*09537850SAkhilesh Sanikop dest_16bit_[y * dst_stride_compound + x] - single_round_offset, 0,
1315*09537850SAkhilesh Sanikop (1 << bitdepth) - 1));
1316*09537850SAkhilesh Sanikop }
1317*09537850SAkhilesh Sanikop dest_row += kMaxBlockWidth;
1318*09537850SAkhilesh Sanikop }
1319*09537850SAkhilesh Sanikop }
1320*09537850SAkhilesh Sanikop
1321*09537850SAkhilesh Sanikop if (is_compound_) {
1322*09537850SAkhilesh Sanikop Check16Bit(use_fixed_values, source_16bit_ + offset_scale, dst_16,
1323*09537850SAkhilesh Sanikop &md5_digest);
1324*09537850SAkhilesh Sanikop } else {
1325*09537850SAkhilesh Sanikop Check(use_fixed_values, src_scale, dst_pixel, &md5_digest);
1326*09537850SAkhilesh Sanikop }
1327*09537850SAkhilesh Sanikop }
1328*09537850SAkhilesh Sanikop
1329*09537850SAkhilesh Sanikop if (!use_fixed_values) {
1330*09537850SAkhilesh Sanikop // md5 sums are only calculated for random input.
1331*09537850SAkhilesh Sanikop const char* ref_digest = nullptr;
1332*09537850SAkhilesh Sanikop switch (bitdepth) {
1333*09537850SAkhilesh Sanikop case 8:
1334*09537850SAkhilesh Sanikop ref_digest = GetConvolveScaleDigest8bpp(GetDigestId());
1335*09537850SAkhilesh Sanikop break;
1336*09537850SAkhilesh Sanikop #if LIBGAV1_MAX_BITDEPTH >= 10
1337*09537850SAkhilesh Sanikop case 10:
1338*09537850SAkhilesh Sanikop ref_digest = GetConvolveScaleDigest10bpp(GetDigestId());
1339*09537850SAkhilesh Sanikop break;
1340*09537850SAkhilesh Sanikop #endif
1341*09537850SAkhilesh Sanikop #if LIBGAV1_MAX_BITDEPTH == 12
1342*09537850SAkhilesh Sanikop case 12:
1343*09537850SAkhilesh Sanikop ref_digest = GetConvolveScaleDigest12bpp(GetDigestId());
1344*09537850SAkhilesh Sanikop break;
1345*09537850SAkhilesh Sanikop #endif
1346*09537850SAkhilesh Sanikop }
1347*09537850SAkhilesh Sanikop ASSERT_NE(ref_digest, nullptr);
1348*09537850SAkhilesh Sanikop
1349*09537850SAkhilesh Sanikop const auto elapsed_time_us =
1350*09537850SAkhilesh Sanikop static_cast<int>(absl::ToInt64Microseconds(elapsed_time));
1351*09537850SAkhilesh Sanikop printf("Mode Convolve%sScale2D[%25s]: %5d us MD5: %s\n",
1352*09537850SAkhilesh Sanikop is_compound_ ? "Compound" : "",
1353*09537850SAkhilesh Sanikop absl::StrFormat("%dx%d", param_.width, param_.height).c_str(),
1354*09537850SAkhilesh Sanikop elapsed_time_us, md5_digest.Get());
1355*09537850SAkhilesh Sanikop EXPECT_STREQ(ref_digest, md5_digest.Get());
1356*09537850SAkhilesh Sanikop }
1357*09537850SAkhilesh Sanikop }
1358*09537850SAkhilesh Sanikop
1359*09537850SAkhilesh Sanikop using ConvolveScaleTest8bpp = ConvolveScaleTest<8, uint8_t>;
1360*09537850SAkhilesh Sanikop
TEST_P(ConvolveScaleTest8bpp,FixedValues)1361*09537850SAkhilesh Sanikop TEST_P(ConvolveScaleTest8bpp, FixedValues) {
1362*09537850SAkhilesh Sanikop Test(true, 0);
1363*09537850SAkhilesh Sanikop Test(true, 1);
1364*09537850SAkhilesh Sanikop Test(true, 128);
1365*09537850SAkhilesh Sanikop Test(true, 255);
1366*09537850SAkhilesh Sanikop }
1367*09537850SAkhilesh Sanikop
TEST_P(ConvolveScaleTest8bpp,RandomValues)1368*09537850SAkhilesh Sanikop TEST_P(ConvolveScaleTest8bpp, RandomValues) { Test(false, 0); }
1369*09537850SAkhilesh Sanikop
TEST_P(ConvolveScaleTest8bpp,DISABLED_Speed)1370*09537850SAkhilesh Sanikop TEST_P(ConvolveScaleTest8bpp, DISABLED_Speed) {
1371*09537850SAkhilesh Sanikop const int num_runs = static_cast<int>(1.0e7 / (param_.width * param_.height));
1372*09537850SAkhilesh Sanikop Test(false, 0, num_runs);
1373*09537850SAkhilesh Sanikop }
1374*09537850SAkhilesh Sanikop
1375*09537850SAkhilesh Sanikop //------------------------------------------------------------------------------
1376*09537850SAkhilesh Sanikop const ConvolveTestParam kConvolveParam[] = {
1377*09537850SAkhilesh Sanikop ConvolveTestParam(ConvolveTestParam::kBlockSize2x2),
1378*09537850SAkhilesh Sanikop ConvolveTestParam(ConvolveTestParam::kBlockSize2x4),
1379*09537850SAkhilesh Sanikop ConvolveTestParam(ConvolveTestParam::kBlockSize4x2),
1380*09537850SAkhilesh Sanikop ConvolveTestParam(ConvolveTestParam::kBlockSize4x4),
1381*09537850SAkhilesh Sanikop ConvolveTestParam(ConvolveTestParam::kBlockSize4x8),
1382*09537850SAkhilesh Sanikop ConvolveTestParam(ConvolveTestParam::kBlockSize8x2),
1383*09537850SAkhilesh Sanikop ConvolveTestParam(ConvolveTestParam::kBlockSize8x4),
1384*09537850SAkhilesh Sanikop ConvolveTestParam(ConvolveTestParam::kBlockSize8x8),
1385*09537850SAkhilesh Sanikop ConvolveTestParam(ConvolveTestParam::kBlockSize8x16),
1386*09537850SAkhilesh Sanikop ConvolveTestParam(ConvolveTestParam::kBlockSize16x8),
1387*09537850SAkhilesh Sanikop ConvolveTestParam(ConvolveTestParam::kBlockSize16x16),
1388*09537850SAkhilesh Sanikop ConvolveTestParam(ConvolveTestParam::kBlockSize16x32),
1389*09537850SAkhilesh Sanikop ConvolveTestParam(ConvolveTestParam::kBlockSize32x16),
1390*09537850SAkhilesh Sanikop ConvolveTestParam(ConvolveTestParam::kBlockSize32x32),
1391*09537850SAkhilesh Sanikop ConvolveTestParam(ConvolveTestParam::kBlockSize32x64),
1392*09537850SAkhilesh Sanikop ConvolveTestParam(ConvolveTestParam::kBlockSize64x32),
1393*09537850SAkhilesh Sanikop ConvolveTestParam(ConvolveTestParam::kBlockSize64x64),
1394*09537850SAkhilesh Sanikop ConvolveTestParam(ConvolveTestParam::kBlockSize64x128),
1395*09537850SAkhilesh Sanikop ConvolveTestParam(ConvolveTestParam::kBlockSize128x64),
1396*09537850SAkhilesh Sanikop ConvolveTestParam(ConvolveTestParam::kBlockSize128x128),
1397*09537850SAkhilesh Sanikop };
1398*09537850SAkhilesh Sanikop
1399*09537850SAkhilesh Sanikop const ConvolveTypeParam kConvolveTypeParam[] = {
1400*09537850SAkhilesh Sanikop ConvolveTypeParam(false, false, false, false),
1401*09537850SAkhilesh Sanikop ConvolveTypeParam(false, false, false, true),
1402*09537850SAkhilesh Sanikop ConvolveTypeParam(false, false, true, false),
1403*09537850SAkhilesh Sanikop ConvolveTypeParam(false, false, true, true),
1404*09537850SAkhilesh Sanikop ConvolveTypeParam(false, true, false, false),
1405*09537850SAkhilesh Sanikop ConvolveTypeParam(false, true, false, true),
1406*09537850SAkhilesh Sanikop ConvolveTypeParam(false, true, true, false),
1407*09537850SAkhilesh Sanikop ConvolveTypeParam(false, true, true, true),
1408*09537850SAkhilesh Sanikop ConvolveTypeParam(true, false, false, false),
1409*09537850SAkhilesh Sanikop ConvolveTypeParam(true, false, false, true),
1410*09537850SAkhilesh Sanikop ConvolveTypeParam(true, false, true, false),
1411*09537850SAkhilesh Sanikop ConvolveTypeParam(true, false, true, true),
1412*09537850SAkhilesh Sanikop // This is left to ensure no function exists for |intra_block_copy| when
1413*09537850SAkhilesh Sanikop // |is_compound| is true; all combinations aren't necessary.
1414*09537850SAkhilesh Sanikop ConvolveTypeParam(true, true, false, false),
1415*09537850SAkhilesh Sanikop };
1416*09537850SAkhilesh Sanikop
1417*09537850SAkhilesh Sanikop INSTANTIATE_TEST_SUITE_P(C, ConvolveTest8bpp,
1418*09537850SAkhilesh Sanikop testing::Combine(testing::ValuesIn(kConvolveTypeParam),
1419*09537850SAkhilesh Sanikop testing::ValuesIn(kConvolveParam)));
1420*09537850SAkhilesh Sanikop INSTANTIATE_TEST_SUITE_P(C, ConvolveScaleTest8bpp,
1421*09537850SAkhilesh Sanikop testing::Combine(testing::Bool(),
1422*09537850SAkhilesh Sanikop testing::ValuesIn(kConvolveParam)));
1423*09537850SAkhilesh Sanikop
1424*09537850SAkhilesh Sanikop #if LIBGAV1_ENABLE_NEON
1425*09537850SAkhilesh Sanikop INSTANTIATE_TEST_SUITE_P(NEON, ConvolveTest8bpp,
1426*09537850SAkhilesh Sanikop testing::Combine(testing::ValuesIn(kConvolveTypeParam),
1427*09537850SAkhilesh Sanikop testing::ValuesIn(kConvolveParam)));
1428*09537850SAkhilesh Sanikop INSTANTIATE_TEST_SUITE_P(NEON, ConvolveScaleTest8bpp,
1429*09537850SAkhilesh Sanikop testing::Combine(testing::Bool(),
1430*09537850SAkhilesh Sanikop testing::ValuesIn(kConvolveParam)));
1431*09537850SAkhilesh Sanikop #endif // LIBGAV1_ENABLE_NEON
1432*09537850SAkhilesh Sanikop
1433*09537850SAkhilesh Sanikop #if LIBGAV1_ENABLE_SSE4_1
1434*09537850SAkhilesh Sanikop INSTANTIATE_TEST_SUITE_P(SSE41, ConvolveTest8bpp,
1435*09537850SAkhilesh Sanikop testing::Combine(testing::ValuesIn(kConvolveTypeParam),
1436*09537850SAkhilesh Sanikop testing::ValuesIn(kConvolveParam)));
1437*09537850SAkhilesh Sanikop INSTANTIATE_TEST_SUITE_P(SSE41, ConvolveScaleTest8bpp,
1438*09537850SAkhilesh Sanikop testing::Combine(testing::Bool(),
1439*09537850SAkhilesh Sanikop testing::ValuesIn(kConvolveParam)));
1440*09537850SAkhilesh Sanikop #endif // LIBGAV1_ENABLE_SSE4_1
1441*09537850SAkhilesh Sanikop
1442*09537850SAkhilesh Sanikop #if LIBGAV1_ENABLE_AVX2
1443*09537850SAkhilesh Sanikop INSTANTIATE_TEST_SUITE_P(AVX2, ConvolveTest8bpp,
1444*09537850SAkhilesh Sanikop testing::Combine(testing::ValuesIn(kConvolveTypeParam),
1445*09537850SAkhilesh Sanikop testing::ValuesIn(kConvolveParam)));
1446*09537850SAkhilesh Sanikop INSTANTIATE_TEST_SUITE_P(AVX2, ConvolveScaleTest8bpp,
1447*09537850SAkhilesh Sanikop testing::Combine(testing::Bool(),
1448*09537850SAkhilesh Sanikop testing::ValuesIn(kConvolveParam)));
1449*09537850SAkhilesh Sanikop #endif // LIBGAV1_ENABLE_AVX2
1450*09537850SAkhilesh Sanikop
1451*09537850SAkhilesh Sanikop #if LIBGAV1_MAX_BITDEPTH >= 10
1452*09537850SAkhilesh Sanikop using ConvolveTest10bpp = ConvolveTest<10, uint16_t>;
1453*09537850SAkhilesh Sanikop
TEST_P(ConvolveTest10bpp,FixedValues)1454*09537850SAkhilesh Sanikop TEST_P(ConvolveTest10bpp, FixedValues) {
1455*09537850SAkhilesh Sanikop Test(true, 0);
1456*09537850SAkhilesh Sanikop Test(true, 1);
1457*09537850SAkhilesh Sanikop Test(true, 128);
1458*09537850SAkhilesh Sanikop Test(true, (1 << 10) - 1);
1459*09537850SAkhilesh Sanikop }
1460*09537850SAkhilesh Sanikop
TEST_P(ConvolveTest10bpp,RandomValues)1461*09537850SAkhilesh Sanikop TEST_P(ConvolveTest10bpp, RandomValues) { Test(false, 0); }
1462*09537850SAkhilesh Sanikop
TEST_P(ConvolveTest10bpp,DISABLED_Speed)1463*09537850SAkhilesh Sanikop TEST_P(ConvolveTest10bpp, DISABLED_Speed) {
1464*09537850SAkhilesh Sanikop const int num_runs = static_cast<int>(1.0e7 / (param_.width * param_.height));
1465*09537850SAkhilesh Sanikop Test(false, 0, num_runs);
1466*09537850SAkhilesh Sanikop }
1467*09537850SAkhilesh Sanikop
1468*09537850SAkhilesh Sanikop using ConvolveScaleTest10bpp = ConvolveScaleTest<10, uint16_t>;
1469*09537850SAkhilesh Sanikop
TEST_P(ConvolveScaleTest10bpp,FixedValues)1470*09537850SAkhilesh Sanikop TEST_P(ConvolveScaleTest10bpp, FixedValues) {
1471*09537850SAkhilesh Sanikop Test(true, 0);
1472*09537850SAkhilesh Sanikop Test(true, 1);
1473*09537850SAkhilesh Sanikop Test(true, 128);
1474*09537850SAkhilesh Sanikop Test(true, (1 << 10) - 1);
1475*09537850SAkhilesh Sanikop }
1476*09537850SAkhilesh Sanikop
TEST_P(ConvolveScaleTest10bpp,RandomValues)1477*09537850SAkhilesh Sanikop TEST_P(ConvolveScaleTest10bpp, RandomValues) { Test(false, 0); }
1478*09537850SAkhilesh Sanikop
TEST_P(ConvolveScaleTest10bpp,DISABLED_Speed)1479*09537850SAkhilesh Sanikop TEST_P(ConvolveScaleTest10bpp, DISABLED_Speed) {
1480*09537850SAkhilesh Sanikop const int num_runs = static_cast<int>(1.0e7 / (param_.width * param_.height));
1481*09537850SAkhilesh Sanikop Test(false, 0, num_runs);
1482*09537850SAkhilesh Sanikop }
1483*09537850SAkhilesh Sanikop
1484*09537850SAkhilesh Sanikop INSTANTIATE_TEST_SUITE_P(C, ConvolveTest10bpp,
1485*09537850SAkhilesh Sanikop testing::Combine(testing::ValuesIn(kConvolveTypeParam),
1486*09537850SAkhilesh Sanikop testing::ValuesIn(kConvolveParam)));
1487*09537850SAkhilesh Sanikop INSTANTIATE_TEST_SUITE_P(C, ConvolveScaleTest10bpp,
1488*09537850SAkhilesh Sanikop testing::Combine(testing::Bool(),
1489*09537850SAkhilesh Sanikop testing::ValuesIn(kConvolveParam)));
1490*09537850SAkhilesh Sanikop
1491*09537850SAkhilesh Sanikop #if LIBGAV1_ENABLE_NEON
1492*09537850SAkhilesh Sanikop INSTANTIATE_TEST_SUITE_P(NEON, ConvolveTest10bpp,
1493*09537850SAkhilesh Sanikop testing::Combine(testing::ValuesIn(kConvolveTypeParam),
1494*09537850SAkhilesh Sanikop testing::ValuesIn(kConvolveParam)));
1495*09537850SAkhilesh Sanikop INSTANTIATE_TEST_SUITE_P(NEON, ConvolveScaleTest10bpp,
1496*09537850SAkhilesh Sanikop testing::Combine(testing::Bool(),
1497*09537850SAkhilesh Sanikop testing::ValuesIn(kConvolveParam)));
1498*09537850SAkhilesh Sanikop #endif // LIBGAV1_ENABLE_NEON
1499*09537850SAkhilesh Sanikop
1500*09537850SAkhilesh Sanikop #endif // LIBGAV1_MAX_BITDEPTH >= 10
1501*09537850SAkhilesh Sanikop
1502*09537850SAkhilesh Sanikop #if LIBGAV1_MAX_BITDEPTH == 12
1503*09537850SAkhilesh Sanikop using ConvolveTest12bpp = ConvolveTest<12, uint16_t>;
1504*09537850SAkhilesh Sanikop
TEST_P(ConvolveTest12bpp,FixedValues)1505*09537850SAkhilesh Sanikop TEST_P(ConvolveTest12bpp, FixedValues) {
1506*09537850SAkhilesh Sanikop Test(true, 0);
1507*09537850SAkhilesh Sanikop Test(true, 1);
1508*09537850SAkhilesh Sanikop Test(true, 128);
1509*09537850SAkhilesh Sanikop Test(true, (1 << 12) - 1);
1510*09537850SAkhilesh Sanikop }
1511*09537850SAkhilesh Sanikop
TEST_P(ConvolveTest12bpp,RandomValues)1512*09537850SAkhilesh Sanikop TEST_P(ConvolveTest12bpp, RandomValues) { Test(false, 0); }
1513*09537850SAkhilesh Sanikop
TEST_P(ConvolveTest12bpp,DISABLED_Speed)1514*09537850SAkhilesh Sanikop TEST_P(ConvolveTest12bpp, DISABLED_Speed) {
1515*09537850SAkhilesh Sanikop const int num_runs = static_cast<int>(1.0e7 / (param_.width * param_.height));
1516*09537850SAkhilesh Sanikop Test(false, 0, num_runs);
1517*09537850SAkhilesh Sanikop }
1518*09537850SAkhilesh Sanikop
1519*09537850SAkhilesh Sanikop using ConvolveScaleTest12bpp = ConvolveScaleTest<12, uint16_t>;
1520*09537850SAkhilesh Sanikop
TEST_P(ConvolveScaleTest12bpp,FixedValues)1521*09537850SAkhilesh Sanikop TEST_P(ConvolveScaleTest12bpp, FixedValues) {
1522*09537850SAkhilesh Sanikop Test(true, 0);
1523*09537850SAkhilesh Sanikop Test(true, 1);
1524*09537850SAkhilesh Sanikop Test(true, 128);
1525*09537850SAkhilesh Sanikop Test(true, (1 << 12) - 1);
1526*09537850SAkhilesh Sanikop }
1527*09537850SAkhilesh Sanikop
TEST_P(ConvolveScaleTest12bpp,RandomValues)1528*09537850SAkhilesh Sanikop TEST_P(ConvolveScaleTest12bpp, RandomValues) { Test(false, 0); }
1529*09537850SAkhilesh Sanikop
TEST_P(ConvolveScaleTest12bpp,DISABLED_Speed)1530*09537850SAkhilesh Sanikop TEST_P(ConvolveScaleTest12bpp, DISABLED_Speed) {
1531*09537850SAkhilesh Sanikop const int num_runs = static_cast<int>(1.0e7 / (param_.width * param_.height));
1532*09537850SAkhilesh Sanikop Test(false, 0, num_runs);
1533*09537850SAkhilesh Sanikop }
1534*09537850SAkhilesh Sanikop
1535*09537850SAkhilesh Sanikop INSTANTIATE_TEST_SUITE_P(C, ConvolveTest12bpp,
1536*09537850SAkhilesh Sanikop testing::Combine(testing::ValuesIn(kConvolveTypeParam),
1537*09537850SAkhilesh Sanikop testing::ValuesIn(kConvolveParam)));
1538*09537850SAkhilesh Sanikop INSTANTIATE_TEST_SUITE_P(C, ConvolveScaleTest12bpp,
1539*09537850SAkhilesh Sanikop testing::Combine(testing::Bool(),
1540*09537850SAkhilesh Sanikop testing::ValuesIn(kConvolveParam)));
1541*09537850SAkhilesh Sanikop #endif // LIBGAV1_MAX_BITDEPTH == 12
1542*09537850SAkhilesh Sanikop
1543*09537850SAkhilesh Sanikop } // namespace
1544*09537850SAkhilesh Sanikop } // namespace dsp
1545*09537850SAkhilesh Sanikop } // namespace libgav1
1546