-
Notifications
You must be signed in to change notification settings - Fork 453
Expand file tree
/
Copy pathTestBackground.cpp
More file actions
698 lines (543 loc) · 30.2 KB
/
Copy pathTestBackground.cpp
File metadata and controls
698 lines (543 loc) · 30.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
/*
* Tests for Simd Library (http://ermig1979.github.io/Simd).
*
* Copyright (c) 2011-2026 Yermalayeu Ihar.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#include "Test/TestCompare.h"
#include "Test/TestPerformance.h"
#include "Test/TestRandom.h"
#include "Test/TestOptions.h"
namespace Test
{
namespace
{
struct Func1
{
typedef void(*FuncPtr)(const uint8_t * value, size_t valueStride, size_t width, size_t height,
uint8_t * lo, size_t loStride, uint8_t * hi, size_t hiStride);
FuncPtr func;
String description;
Func1(const FuncPtr & f, const String & d) : func(f), description(d) {}
void Call(const View & value, const View & loSrc, const View & hiSrc, View & loDst, View & hiDst) const
{
Simd::Copy(loSrc, loDst);
Simd::Copy(hiSrc, hiDst);
TEST_PERFORMANCE_TEST(description);
func(value.data, value.stride, value.width, value.height, loDst.data, loDst.stride, hiDst.data, hiDst.stride);
}
};
}
#define FUNC1(function) Func1(function, std::string(#function))
bool BackgroundChangeRangeAutoTest(int width, int height, const Func1 & f1, const Func1 & f2)
{
bool result = true;
TEST_LOG_SS(Info, "Test " << f1.description << " & " << f2.description << " [" << width << ", " << height << "].");
View value(width, height, View::Gray8, NULL, TEST_ALIGN(width));
FillRandom(value);
View loSrc(width, height, View::Gray8, NULL, TEST_ALIGN(width));
FillRandom(loSrc);
View hiSrc(width, height, View::Gray8, NULL, TEST_ALIGN(width));
FillRandom(hiSrc);
View loDst1(width, height, View::Gray8, NULL, TEST_ALIGN(width));
View hiDst1(width, height, View::Gray8, NULL, TEST_ALIGN(width));
View loDst2(width, height, View::Gray8, NULL, TEST_ALIGN(width));
View hiDst2(width, height, View::Gray8, NULL, TEST_ALIGN(width));
TEST_EXECUTE_AT_LEAST_MIN_TIME(f1.Call(value, loSrc, hiSrc, loDst1, hiDst1));
TEST_EXECUTE_AT_LEAST_MIN_TIME(f2.Call(value, loSrc, hiSrc, loDst2, hiDst2));
result = result && Compare(loDst1, loDst2, 0, true, 32, 0, "lo");
result = result && Compare(hiDst1, hiDst2, 0, true, 32, 0, "hi");
return result;
}
bool BackgroundChangeRangeAutoTest(const Func1 & f1, const Func1 & f2)
{
bool result = true;
result = result && BackgroundChangeRangeAutoTest(W, H, f1, f2);
result = result && BackgroundChangeRangeAutoTest(W + O, H - O, f1, f2);
return result;
}
namespace
{
struct Func2
{
typedef void(*FuncPtr)(const uint8_t * value, size_t valueStride, size_t width, size_t height,
const uint8_t * loValue, size_t loValueStride, const uint8_t * hiValue, size_t hiValueStride,
uint8_t * loCount, size_t loCountStride, uint8_t * hiCount, size_t hiCountStride);
FuncPtr func;
String description;
Func2(const FuncPtr & f, const String & d) : func(f), description(d) {}
void Call(const View & value, const View & loValue, const View & hiValue,
const View & loCountSrc, const View & hiCountSrc, View & loCountDst, View & hiCountDst) const
{
Simd::Copy(loCountSrc, loCountDst);
Simd::Copy(hiCountSrc, hiCountDst);
TEST_PERFORMANCE_TEST(description);
func(value.data, value.stride, value.width, value.height,
loValue.data, loValue.stride, hiValue.data, hiValue.stride,
loCountDst.data, loCountDst.stride, hiCountDst.data, hiCountDst.stride);
}
};
}
#define FUNC2(function) Func2(function, std::string(#function))
bool BackgroundIncrementCountAutoTest(int width, int height, const Func2 & f1, const Func2 & f2)
{
bool result = true;
TEST_LOG_SS(Info, "Test " << f1.description << " & " << f2.description << " [" << width << ", " << height << "].");
View value(width, height, View::Gray8, NULL, TEST_ALIGN(width));
FillRandom(value);
View loValue(width, height, View::Gray8, NULL, TEST_ALIGN(width));
FillRandom(loValue);
View hiValue(width, height, View::Gray8, NULL, TEST_ALIGN(width));
FillRandom(hiValue);
View loCountSrc(width, height, View::Gray8, NULL, TEST_ALIGN(width));
FillRandom(loCountSrc);
View hiCountSrc(width, height, View::Gray8, NULL, TEST_ALIGN(width));
FillRandom(hiCountSrc);
View loCountDst1(width, height, View::Gray8, NULL, TEST_ALIGN(width));
View hiCountDst1(width, height, View::Gray8, NULL, TEST_ALIGN(width));
View loCountDst2(width, height, View::Gray8, NULL, TEST_ALIGN(width));
View hiCountDst2(width, height, View::Gray8, NULL, TEST_ALIGN(width));
TEST_EXECUTE_AT_LEAST_MIN_TIME(f1.Call(value, loValue, hiValue, loCountSrc, hiCountSrc, loCountDst1, hiCountDst1));
TEST_EXECUTE_AT_LEAST_MIN_TIME(f2.Call(value, loValue, hiValue, loCountSrc, hiCountSrc, loCountDst2, hiCountDst2));
result = result && Compare(loCountDst1, loCountDst2, 0, true, 32, 0, "lo");
result = result && Compare(hiCountDst1, hiCountDst2, 0, true, 32, 0, "hi");
return result;
}
bool BackgroundIncrementCountAutoTest(const Func2 & f1, const Func2 & f2)
{
bool result = true;
result = result && BackgroundIncrementCountAutoTest(W, H, f1, f2);
result = result && BackgroundIncrementCountAutoTest(W + O, H - O, f1, f2);
return result;
}
namespace
{
struct Func3
{
typedef void(*FuncPtr)(uint8_t * loCount, size_t loCountStride, size_t width, size_t height,
uint8_t * loValue, size_t loValueStride, uint8_t * hiCount, size_t hiCountStride,
uint8_t * hiValue, size_t hiValueStride, uint8_t threshold);
FuncPtr func;
String description;
Func3(const FuncPtr & f, const String & d) : func(f), description(d) {}
void Call(const View & loCountSrc, const View & loValueSrc, const View & hiCountSrc, const View & hiValueSrc,
View & loCountDst, View & loValueDst, View & hiCountDst, View & hiValueDst, uint8_t threshold) const
{
Simd::Copy(loCountSrc, loCountDst);
Simd::Copy(loValueSrc, loValueDst);
Simd::Copy(hiCountSrc, hiCountDst);
Simd::Copy(hiValueSrc, hiValueDst);
TEST_PERFORMANCE_TEST(description);
func(loCountDst.data, loCountDst.stride, loValueDst.width, loValueDst.height, loValueDst.data, loValueDst.stride,
hiCountDst.data, hiCountDst.stride, hiValueDst.data, hiValueDst.stride, threshold);
}
};
}
#define FUNC3(function) Func3(function, std::string(#function))
bool BackgroundAdjustRangeAutoTest(int width, int height, const Func3 & f1, const Func3 & f2)
{
bool result = true;
TEST_LOG_SS(Info, "Test " << f1.description << " & " << f2.description << " [" << width << ", " << height << "].");
View loCountSrc(width, height, View::Gray8, NULL, TEST_ALIGN(width));
FillRandom(loCountSrc);
View loValueSrc(width, height, View::Gray8, NULL, TEST_ALIGN(width));
FillRandom(loValueSrc);
View hiCountSrc(width, height, View::Gray8, NULL, TEST_ALIGN(width));
FillRandom(hiCountSrc);
View hiValueSrc(width, height, View::Gray8, NULL, TEST_ALIGN(width));
FillRandom(hiValueSrc);
View loCountDst1(width, height, View::Gray8, NULL, TEST_ALIGN(width));
View loValueDst1(width, height, View::Gray8, NULL, TEST_ALIGN(width));
View hiCountDst1(width, height, View::Gray8, NULL, TEST_ALIGN(width));
View hiValueDst1(width, height, View::Gray8, NULL, TEST_ALIGN(width));
View loCountDst2(width, height, View::Gray8, NULL, TEST_ALIGN(width));
View loValueDst2(width, height, View::Gray8, NULL, TEST_ALIGN(width));
View hiCountDst2(width, height, View::Gray8, NULL, TEST_ALIGN(width));
View hiValueDst2(width, height, View::Gray8, NULL, TEST_ALIGN(width));
TEST_EXECUTE_AT_LEAST_MIN_TIME(f1.Call(loCountSrc, loValueSrc, hiCountSrc, hiValueSrc,
loCountDst1, loValueDst1, hiCountDst1, hiValueDst1, 0x80));
TEST_EXECUTE_AT_LEAST_MIN_TIME(f2.Call(loCountSrc, loValueSrc, hiCountSrc, hiValueSrc,
loCountDst2, loValueDst2, hiCountDst2, hiValueDst2, 0x80));
result = result && Compare(loCountDst1, loCountDst2, 0, true, 32, 0, "loCount");
result = result && Compare(loValueDst1, loValueDst2, 0, true, 32, 0, "loValue");
result = result && Compare(hiCountDst1, hiCountDst2, 0, true, 32, 0, "hiCount");
result = result && Compare(hiValueDst1, hiValueDst2, 0, true, 32, 0, "hiValue");
return result;
}
bool BackgroundAdjustRangeAutoTest(const Func3 & f1, const Func3 & f2)
{
bool result = true;
result = result && BackgroundAdjustRangeAutoTest(W, H, f1, f2);
result = result && BackgroundAdjustRangeAutoTest(W + O, H - O, f1, f2);
return result;
}
namespace
{
struct Func4
{
typedef void(*FuncPtr)(uint8_t * loCount, size_t loCountStride, size_t width, size_t height,
uint8_t * loValue, size_t loValueStride, uint8_t * hiCount, size_t hiCountStride,
uint8_t * hiValue, size_t hiValueStride, uint8_t threshold, const uint8_t * mask, size_t maskStride);
FuncPtr func;
String description;
Func4(const FuncPtr & f, const String & d) : func(f), description(d) {}
void Call(const View & loCountSrc, const View & loValueSrc, const View & hiCountSrc, const View & hiValueSrc,
View & loCountDst, View & loValueDst, View & hiCountDst, View & hiValueDst, uint8_t threshold, const View & mask) const
{
Simd::Copy(loCountSrc, loCountDst);
Simd::Copy(loValueSrc, loValueDst);
Simd::Copy(hiCountSrc, hiCountDst);
Simd::Copy(hiValueSrc, hiValueDst);
TEST_PERFORMANCE_TEST(description);
func(loCountDst.data, loCountDst.stride, loValueDst.width, loValueDst.height, loValueDst.data, loValueDst.stride,
hiCountDst.data, hiCountDst.stride, hiValueDst.data, hiValueDst.stride, threshold, mask.data, mask.stride);
}
};
}
#define FUNC4(function) Func4(function, std::string(#function))
bool BackgroundAdjustRangeMaskedAutoTest(int width, int height, const Func4 & f1, const Func4 & f2)
{
bool result = true;
TEST_LOG_SS(Info, "Test " << f1.description << " & " << f2.description << " [" << width << ", " << height << "].");
View loCountSrc(width, height, View::Gray8, NULL, TEST_ALIGN(width));
FillRandom(loCountSrc);
View loValueSrc(width, height, View::Gray8, NULL, TEST_ALIGN(width));
FillRandom(loValueSrc);
View hiCountSrc(width, height, View::Gray8, NULL, TEST_ALIGN(width));
FillRandom(hiCountSrc);
View hiValueSrc(width, height, View::Gray8, NULL, TEST_ALIGN(width));
FillRandom(hiValueSrc);
View mask(width, height, View::Gray8, NULL, TEST_ALIGN(width));
FillRandomMask(mask, 0xFF);
View loCountDst1(width, height, View::Gray8, NULL, TEST_ALIGN(width));
View loValueDst1(width, height, View::Gray8, NULL, TEST_ALIGN(width));
View hiCountDst1(width, height, View::Gray8, NULL, TEST_ALIGN(width));
View hiValueDst1(width, height, View::Gray8, NULL, TEST_ALIGN(width));
View loCountDst2(width, height, View::Gray8, NULL, TEST_ALIGN(width));
View loValueDst2(width, height, View::Gray8, NULL, TEST_ALIGN(width));
View hiCountDst2(width, height, View::Gray8, NULL, TEST_ALIGN(width));
View hiValueDst2(width, height, View::Gray8, NULL, TEST_ALIGN(width));
TEST_EXECUTE_AT_LEAST_MIN_TIME(f1.Call(loCountSrc, loValueSrc, hiCountSrc, hiValueSrc,
loCountDst1, loValueDst1, hiCountDst1, hiValueDst1, 0x80, mask));
TEST_EXECUTE_AT_LEAST_MIN_TIME(f2.Call(loCountSrc, loValueSrc, hiCountSrc, hiValueSrc,
loCountDst2, loValueDst2, hiCountDst2, hiValueDst2, 0x80, mask));
result = result && Compare(loCountDst1, loCountDst2, 0, true, 32, 0, "loCount");
result = result && Compare(loValueDst1, loValueDst2, 0, true, 32, 0, "loValue");
result = result && Compare(hiCountDst1, hiCountDst2, 0, true, 32, 0, "hiCount");
result = result && Compare(hiValueDst1, hiValueDst2, 0, true, 32, 0, "hiValue");
return result;
}
bool BackgroundAdjustRangeMaskedAutoTest(const Func4 & f1, const Func4 & f2)
{
bool result = true;
result = result && BackgroundAdjustRangeMaskedAutoTest(W, H, f1, f2);
result = result && BackgroundAdjustRangeMaskedAutoTest(W + O, H - O, f1, f2);
return result;
}
namespace
{
struct Func5
{
typedef void(*FuncPtr)(const uint8_t * value, size_t valueStride, size_t width, size_t height,
uint8_t * lo, size_t loStride, uint8_t * hi, size_t hiStride, const uint8_t * mask, size_t maskStride);
FuncPtr func;
String description;
Func5(const FuncPtr & f, const String & d) : func(f), description(d) {}
void Call(const View & value, const View & loSrc, const View & hiSrc, View & loDst, View & hiDst, const View & mask) const
{
Simd::Copy(loSrc, loDst);
Simd::Copy(hiSrc, hiDst);
TEST_PERFORMANCE_TEST(description);
func(value.data, value.stride, value.width, value.height, loDst.data, loDst.stride, hiDst.data, hiDst.stride,
mask.data, mask.stride);
}
};
}
#define FUNC5(function) Func5(function, std::string(#function))
bool BackgroundShiftRangeMaskedAutoTest(int width, int height, const Func5 & f1, const Func5 & f2)
{
bool result = true;
TEST_LOG_SS(Info, "Test " << f1.description << " & " << f2.description << " [" << width << ", " << height << "].");
View value(width, height, View::Gray8, NULL, TEST_ALIGN(width));
FillRandom(value);
View loSrc(width, height, View::Gray8, NULL, TEST_ALIGN(width));
FillRandom(loSrc);
View hiSrc(width, height, View::Gray8, NULL, TEST_ALIGN(width));
FillRandom(hiSrc);
View mask(width, height, View::Gray8, NULL, TEST_ALIGN(width));
FillRandomMask(mask, 0xFF);
View loDst1(width, height, View::Gray8, NULL, TEST_ALIGN(width));
View hiDst1(width, height, View::Gray8, NULL, TEST_ALIGN(width));
View loDst2(width, height, View::Gray8, NULL, TEST_ALIGN(width));
View hiDst2(width, height, View::Gray8, NULL, TEST_ALIGN(width));
TEST_EXECUTE_AT_LEAST_MIN_TIME(f1.Call(value, loSrc, hiSrc, loDst1, hiDst1, mask));
TEST_EXECUTE_AT_LEAST_MIN_TIME(f2.Call(value, loSrc, hiSrc, loDst2, hiDst2, mask));
result = result && Compare(loDst1, loDst2, 0, true, 32, 0, "lo");
result = result && Compare(hiDst1, hiDst2, 0, true, 32, 0, "hi");
return result;
}
bool BackgroundShiftRangeMaskedAutoTest(const Func5 & f1, const Func5 & f2)
{
bool result = true;
result = result && BackgroundShiftRangeMaskedAutoTest(W, H, f1, f2);
result = result && BackgroundShiftRangeMaskedAutoTest(W + O, H - O, f1, f2);
return result;
}
namespace
{
struct Func6
{
typedef void(*FuncPtr)(const uint8_t * src, size_t srcStride, size_t width, size_t height,
uint8_t index, uint8_t value, uint8_t * dst, size_t dstStride);
FuncPtr func;
String description;
Func6(const FuncPtr & f, const String & d) : func(f), description(d) {}
void Call(const View & src, uint8_t index, uint8_t value, View & dst) const
{
TEST_PERFORMANCE_TEST(description);
func(src.data, src.stride, src.width, src.height, index, value, dst.data, dst.stride);
}
};
}
#define FUNC6(function) Func6(function, std::string(#function))
bool BackgroundInitMaskAutoTest(int width, int height, const Func6 & f1, const Func6 & f2)
{
bool result = true;
TEST_LOG_SS(Info, "Test " << f1.description << " & " << f2.description << " [" << width << ", " << height << "].");
uint8_t index = 1 + Random(255);
View src(width, height, View::Gray8, NULL, TEST_ALIGN(width));
FillRandomMask(src, index);
View dst1(width, height, View::Gray8, NULL, TEST_ALIGN(width));
memset(dst1.data, 0, dst1.stride*height);
View dst2(width, height, View::Gray8, NULL, TEST_ALIGN(width));
memset(dst2.data, 0, dst2.stride*height);
TEST_EXECUTE_AT_LEAST_MIN_TIME(f1.Call(src, index, 0xFF, dst1));
TEST_EXECUTE_AT_LEAST_MIN_TIME(f2.Call(src, index, 0xFF, dst2));
result = result && Compare(dst1, dst2, 0, true, 32);
return result;
}
bool BackgroundInitMaskAutoTest(const Func6 & f1, const Func6 & f2)
{
bool result = true;
result = result && BackgroundInitMaskAutoTest(W, H, f1, f2);
result = result && BackgroundInitMaskAutoTest(W + O, H - O, f1, f2);
return result;
}
bool BackgroundGrowRangeSlowAutoTest(const Options & options)
{
bool result = true;
if (TestBase(options))
result = result && BackgroundChangeRangeAutoTest(FUNC1(Simd::Base::BackgroundGrowRangeSlow), FUNC1(SimdBackgroundGrowRangeSlow));
#ifdef SIMD_SSE41_ENABLE
if (Simd::Sse41::Enable && TestSse41(options) && W >= Simd::Sse41::A)
result = result && BackgroundChangeRangeAutoTest(FUNC1(Simd::Sse41::BackgroundGrowRangeSlow), FUNC1(SimdBackgroundGrowRangeSlow));
#endif
#ifdef SIMD_AVX2_ENABLE
if (Simd::Avx2::Enable && TestAvx2(options) && W >= Simd::Avx2::A)
result = result && BackgroundChangeRangeAutoTest(FUNC1(Simd::Avx2::BackgroundGrowRangeSlow), FUNC1(SimdBackgroundGrowRangeSlow));
#endif
#ifdef SIMD_AVX512BW_ENABLE
if (Simd::Avx512bw::Enable && TestAvx512bw(options))
result = result && BackgroundChangeRangeAutoTest(FUNC1(Simd::Avx512bw::BackgroundGrowRangeSlow), FUNC1(SimdBackgroundGrowRangeSlow));
#endif
#ifdef SIMD_NEON_ENABLE
if (Simd::Neon::Enable && TestNeon(options) && W >= Simd::Neon::A)
result = result && BackgroundChangeRangeAutoTest(FUNC1(Simd::Neon::BackgroundGrowRangeSlow), FUNC1(SimdBackgroundGrowRangeSlow));
#endif
#ifdef SIMD_SVE_ENABLE
if (Simd::Sve::Enable && TestSve(options))
result = result && BackgroundChangeRangeAutoTest(FUNC1(Simd::Sve::BackgroundGrowRangeSlow), FUNC1(SimdBackgroundGrowRangeSlow));
#endif
return result;
}
bool BackgroundGrowRangeFastAutoTest(const Options & options)
{
bool result = true;
if (TestBase(options))
result = result && BackgroundChangeRangeAutoTest(FUNC1(Simd::Base::BackgroundGrowRangeFast), FUNC1(SimdBackgroundGrowRangeFast));
#ifdef SIMD_SSE41_ENABLE
if (Simd::Sse41::Enable && TestSse41(options) && W >= Simd::Sse41::A)
result = result && BackgroundChangeRangeAutoTest(FUNC1(Simd::Sse41::BackgroundGrowRangeFast), FUNC1(SimdBackgroundGrowRangeFast));
#endif
#ifdef SIMD_AVX2_ENABLE
if (Simd::Avx2::Enable && TestAvx2(options) && W >= Simd::Avx2::A)
result = result && BackgroundChangeRangeAutoTest(FUNC1(Simd::Avx2::BackgroundGrowRangeFast), FUNC1(SimdBackgroundGrowRangeFast));
#endif
#ifdef SIMD_AVX512BW_ENABLE
if (Simd::Avx512bw::Enable && TestAvx512bw(options))
result = result && BackgroundChangeRangeAutoTest(FUNC1(Simd::Avx512bw::BackgroundGrowRangeFast), FUNC1(SimdBackgroundGrowRangeFast));
#endif
#ifdef SIMD_NEON_ENABLE
if (Simd::Neon::Enable && TestNeon(options) && W >= Simd::Neon::A)
result = result && BackgroundChangeRangeAutoTest(FUNC1(Simd::Neon::BackgroundGrowRangeFast), FUNC1(SimdBackgroundGrowRangeFast));
#endif
#ifdef SIMD_SVE_ENABLE
if (Simd::Sve::Enable && TestSve(options))
result = result && BackgroundChangeRangeAutoTest(FUNC1(Simd::Sve::BackgroundGrowRangeFast), FUNC1(SimdBackgroundGrowRangeFast));
#endif
return result;
}
bool BackgroundIncrementCountAutoTest(const Options & options)
{
bool result = true;
if (TestBase(options))
result = result && BackgroundIncrementCountAutoTest(FUNC2(Simd::Base::BackgroundIncrementCount), FUNC2(SimdBackgroundIncrementCount));
#ifdef SIMD_SSE41_ENABLE
if (Simd::Sse41::Enable && TestSse41(options) && W >= Simd::Sse41::A)
result = result && BackgroundIncrementCountAutoTest(FUNC2(Simd::Sse41::BackgroundIncrementCount), FUNC2(SimdBackgroundIncrementCount));
#endif
#ifdef SIMD_AVX2_ENABLE
if (Simd::Avx2::Enable && TestAvx2(options) && W >= Simd::Avx2::A)
result = result && BackgroundIncrementCountAutoTest(FUNC2(Simd::Avx2::BackgroundIncrementCount), FUNC2(SimdBackgroundIncrementCount));
#endif
#ifdef SIMD_AVX512BW_ENABLE
if (Simd::Avx512bw::Enable && TestAvx512bw(options))
result = result && BackgroundIncrementCountAutoTest(FUNC2(Simd::Avx512bw::BackgroundIncrementCount), FUNC2(SimdBackgroundIncrementCount));
#endif
#ifdef SIMD_NEON_ENABLE
if (Simd::Neon::Enable && TestNeon(options) && W >= Simd::Neon::A)
result = result && BackgroundIncrementCountAutoTest(FUNC2(Simd::Neon::BackgroundIncrementCount), FUNC2(SimdBackgroundIncrementCount));
#endif
#ifdef SIMD_SVE2_ENABLE
if (Simd::Sve2::Enable && TestSve2(options))
result = result && BackgroundIncrementCountAutoTest(FUNC2(Simd::Sve2::BackgroundIncrementCount), FUNC2(SimdBackgroundIncrementCount));
#endif
return result;
}
bool BackgroundAdjustRangeAutoTest(const Options & options)
{
bool result = true;
if (TestBase(options))
result = result && BackgroundAdjustRangeAutoTest(FUNC3(Simd::Base::BackgroundAdjustRange), FUNC3(SimdBackgroundAdjustRange));
#ifdef SIMD_SSE41_ENABLE
if (Simd::Sse41::Enable && TestSse41(options) && W >= Simd::Sse41::A)
result = result && BackgroundAdjustRangeAutoTest(FUNC3(Simd::Sse41::BackgroundAdjustRange), FUNC3(SimdBackgroundAdjustRange));
#endif
#ifdef SIMD_AVX2_ENABLE
if (Simd::Avx2::Enable && TestAvx2(options) && W >= Simd::Avx2::A)
result = result && BackgroundAdjustRangeAutoTest(FUNC3(Simd::Avx2::BackgroundAdjustRange), FUNC3(SimdBackgroundAdjustRange));
#endif
#ifdef SIMD_AVX512BW_ENABLE
if (Simd::Avx512bw::Enable && TestAvx512bw(options))
result = result && BackgroundAdjustRangeAutoTest(FUNC3(Simd::Avx512bw::BackgroundAdjustRange), FUNC3(SimdBackgroundAdjustRange));
#endif
#ifdef SIMD_NEON_ENABLE
if (Simd::Neon::Enable && TestNeon(options) && W >= Simd::Neon::A)
result = result && BackgroundAdjustRangeAutoTest(FUNC3(Simd::Neon::BackgroundAdjustRange), FUNC3(SimdBackgroundAdjustRange));
#endif
#ifdef SIMD_SVE2_ENABLE
if (Simd::Sve2::Enable && TestSve2(options))
result = result && BackgroundAdjustRangeAutoTest(FUNC3(Simd::Sve2::BackgroundAdjustRange), FUNC3(SimdBackgroundAdjustRange));
#endif
return result;
}
bool BackgroundAdjustRangeMaskedAutoTest(const Options & options)
{
bool result = true;
if (TestBase(options))
result = result && BackgroundAdjustRangeMaskedAutoTest(FUNC4(Simd::Base::BackgroundAdjustRangeMasked), FUNC4(SimdBackgroundAdjustRangeMasked));
#ifdef SIMD_SSE41_ENABLE
if (Simd::Sse41::Enable && TestSse41(options) && W >= Simd::Sse41::A)
result = result && BackgroundAdjustRangeMaskedAutoTest(FUNC4(Simd::Sse41::BackgroundAdjustRangeMasked), FUNC4(SimdBackgroundAdjustRangeMasked));
#endif
#ifdef SIMD_AVX2_ENABLE
if (Simd::Avx2::Enable && TestAvx2(options) && W >= Simd::Avx2::A)
result = result && BackgroundAdjustRangeMaskedAutoTest(FUNC4(Simd::Avx2::BackgroundAdjustRangeMasked), FUNC4(SimdBackgroundAdjustRangeMasked));
#endif
#ifdef SIMD_AVX512BW_ENABLE
if (Simd::Avx512bw::Enable && TestAvx512bw(options))
result = result && BackgroundAdjustRangeMaskedAutoTest(FUNC4(Simd::Avx512bw::BackgroundAdjustRangeMasked), FUNC4(SimdBackgroundAdjustRangeMasked));
#endif
#ifdef SIMD_NEON_ENABLE
if (Simd::Neon::Enable && TestNeon(options) && W >= Simd::Neon::A)
result = result && BackgroundAdjustRangeMaskedAutoTest(FUNC4(Simd::Neon::BackgroundAdjustRangeMasked), FUNC4(SimdBackgroundAdjustRangeMasked));
#endif
return result;
}
bool BackgroundShiftRangeAutoTest(const Options & options)
{
bool result = true;
if (TestBase(options))
result = result && BackgroundChangeRangeAutoTest(FUNC1(Simd::Base::BackgroundShiftRange), FUNC1(SimdBackgroundShiftRange));
#ifdef SIMD_SSE41_ENABLE
if (Simd::Sse41::Enable && TestSse41(options) && W >= Simd::Sse41::A)
result = result && BackgroundChangeRangeAutoTest(FUNC1(Simd::Sse41::BackgroundShiftRange), FUNC1(SimdBackgroundShiftRange));
#endif
#ifdef SIMD_AVX2_ENABLE
if (Simd::Avx2::Enable && TestAvx2(options) && W >= Simd::Avx2::A)
result = result && BackgroundChangeRangeAutoTest(FUNC1(Simd::Avx2::BackgroundShiftRange), FUNC1(SimdBackgroundShiftRange));
#endif
#ifdef SIMD_AVX512BW_ENABLE
if (Simd::Avx512bw::Enable && TestAvx512bw(options))
result = result && BackgroundChangeRangeAutoTest(FUNC1(Simd::Avx512bw::BackgroundShiftRange), FUNC1(SimdBackgroundShiftRange));
#endif
#ifdef SIMD_NEON_ENABLE
if (Simd::Neon::Enable && TestNeon(options) && W >= Simd::Neon::A)
result = result && BackgroundChangeRangeAutoTest(FUNC1(Simd::Neon::BackgroundShiftRange), FUNC1(SimdBackgroundShiftRange));
#endif
return result;
}
bool BackgroundShiftRangeMaskedAutoTest(const Options & options)
{
bool result = true;
if (TestBase(options))
result = result && BackgroundShiftRangeMaskedAutoTest(FUNC5(Simd::Base::BackgroundShiftRangeMasked), FUNC5(SimdBackgroundShiftRangeMasked));
#ifdef SIMD_SSE41_ENABLE
if (Simd::Sse41::Enable && TestSse41(options) && W >= Simd::Sse41::A)
result = result && BackgroundShiftRangeMaskedAutoTest(FUNC5(Simd::Sse41::BackgroundShiftRangeMasked), FUNC5(SimdBackgroundShiftRangeMasked));
#endif
#ifdef SIMD_AVX2_ENABLE
if (Simd::Avx2::Enable && TestAvx2(options) && W >= Simd::Avx2::A)
result = result && BackgroundShiftRangeMaskedAutoTest(FUNC5(Simd::Avx2::BackgroundShiftRangeMasked), FUNC5(SimdBackgroundShiftRangeMasked));
#endif
#ifdef SIMD_AVX512BW_ENABLE
if (Simd::Avx512bw::Enable && TestAvx512bw(options))
result = result && BackgroundShiftRangeMaskedAutoTest(FUNC5(Simd::Avx512bw::BackgroundShiftRangeMasked), FUNC5(SimdBackgroundShiftRangeMasked));
#endif
#ifdef SIMD_NEON_ENABLE
if (Simd::Neon::Enable && TestNeon(options) && W >= Simd::Neon::A)
result = result && BackgroundShiftRangeMaskedAutoTest(FUNC5(Simd::Neon::BackgroundShiftRangeMasked), FUNC5(SimdBackgroundShiftRangeMasked));
#endif
return result;
}
bool BackgroundInitMaskAutoTest(const Options & options)
{
bool result = true;
if (TestBase(options))
result = result && BackgroundInitMaskAutoTest(FUNC6(Simd::Base::BackgroundInitMask), FUNC6(SimdBackgroundInitMask));
#ifdef SIMD_SSE41_ENABLE
if (Simd::Sse41::Enable && TestSse41(options) && W >= Simd::Sse41::A)
result = result && BackgroundInitMaskAutoTest(FUNC6(Simd::Sse41::BackgroundInitMask), FUNC6(SimdBackgroundInitMask));
#endif
#ifdef SIMD_AVX2_ENABLE
if (Simd::Avx2::Enable && TestAvx2(options) && W >= Simd::Avx2::A)
result = result && BackgroundInitMaskAutoTest(FUNC6(Simd::Avx2::BackgroundInitMask), FUNC6(SimdBackgroundInitMask));
#endif
#ifdef SIMD_AVX512BW_ENABLE
if (Simd::Avx512bw::Enable && TestAvx512bw(options))
result = result && BackgroundInitMaskAutoTest(FUNC6(Simd::Avx512bw::BackgroundInitMask), FUNC6(SimdBackgroundInitMask));
#endif
#ifdef SIMD_NEON_ENABLE
if (Simd::Neon::Enable && TestNeon(options) && W >= Simd::Neon::A)
result = result && BackgroundInitMaskAutoTest(FUNC6(Simd::Neon::BackgroundInitMask), FUNC6(SimdBackgroundInitMask));
#endif
return result;
}
}