react-native-vision-camera-spoof-detector 1.1.23 → 1.1.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (200) hide show
  1. package/android/CMakeLists.txt +12 -0
  2. package/android/build.gradle +10 -9
  3. package/android/src/main/cpp/cpp-adapter.cpp +6 -3
  4. package/ios/HybridSpoofDetectorOutput.swift +112 -72
  5. package/package.json +1 -1
  6. package/android/src/main/cpp/CMakeLists.txt +0 -33
  7. package/android/src/main/cpp/FaceAntiSpoofJSI.cpp +0 -142
  8. package/android/src/main/cpp/FastYuvJni.cpp +0 -111
  9. package/android/src/main/cpp/fast_yuv.cpp +0 -342
  10. package/android/src/main/cpp/fast_yuv.h +0 -23
  11. package/android/src/main/cpp/libyuv/.clang-format +0 -6
  12. package/android/src/main/cpp/libyuv/.gn +0 -40
  13. package/android/src/main/cpp/libyuv/.vpython3 +0 -410
  14. package/android/src/main/cpp/libyuv/AUTHORS +0 -7
  15. package/android/src/main/cpp/libyuv/Android.bp +0 -202
  16. package/android/src/main/cpp/libyuv/Android.mk +0 -106
  17. package/android/src/main/cpp/libyuv/BUILD.gn +0 -490
  18. package/android/src/main/cpp/libyuv/CM_linux_packages.cmake +0 -70
  19. package/android/src/main/cpp/libyuv/CMakeLists.txt +0 -259
  20. package/android/src/main/cpp/libyuv/DEPS +0 -935
  21. package/android/src/main/cpp/libyuv/DIR_METADATA +0 -3
  22. package/android/src/main/cpp/libyuv/LICENSE +0 -29
  23. package/android/src/main/cpp/libyuv/OWNERS +0 -11
  24. package/android/src/main/cpp/libyuv/PATENTS +0 -24
  25. package/android/src/main/cpp/libyuv/PRESUBMIT.py +0 -65
  26. package/android/src/main/cpp/libyuv/README.chromium +0 -11
  27. package/android/src/main/cpp/libyuv/README.md +0 -19
  28. package/android/src/main/cpp/libyuv/build_overrides/build.gni +0 -60
  29. package/android/src/main/cpp/libyuv/build_overrides/gtest.gni +0 -19
  30. package/android/src/main/cpp/libyuv/build_overrides/partition_alloc.gni +0 -17
  31. package/android/src/main/cpp/libyuv/codereview.settings +0 -5
  32. package/android/src/main/cpp/libyuv/docs/deprecated_builds.md +0 -409
  33. package/android/src/main/cpp/libyuv/docs/environment_variables.md +0 -64
  34. package/android/src/main/cpp/libyuv/docs/feature_detection.md +0 -108
  35. package/android/src/main/cpp/libyuv/docs/filtering.md +0 -196
  36. package/android/src/main/cpp/libyuv/docs/formats.md +0 -208
  37. package/android/src/main/cpp/libyuv/docs/getting_started.md +0 -296
  38. package/android/src/main/cpp/libyuv/docs/rotation.md +0 -107
  39. package/android/src/main/cpp/libyuv/download_vs_toolchain.py +0 -29
  40. package/android/src/main/cpp/libyuv/include/libyuv/basic_types.h +0 -68
  41. package/android/src/main/cpp/libyuv/include/libyuv/compare.h +0 -111
  42. package/android/src/main/cpp/libyuv/include/libyuv/compare_row.h +0 -112
  43. package/android/src/main/cpp/libyuv/include/libyuv/convert.h +0 -1117
  44. package/android/src/main/cpp/libyuv/include/libyuv/convert_argb.h +0 -2335
  45. package/android/src/main/cpp/libyuv/include/libyuv/convert_from.h +0 -203
  46. package/android/src/main/cpp/libyuv/include/libyuv/convert_from_argb.h +0 -394
  47. package/android/src/main/cpp/libyuv/include/libyuv/cpu_id.h +0 -147
  48. package/android/src/main/cpp/libyuv/include/libyuv/cpu_support.h +0 -99
  49. package/android/src/main/cpp/libyuv/include/libyuv/loongson_intrinsics.h +0 -1949
  50. package/android/src/main/cpp/libyuv/include/libyuv/mjpeg_decoder.h +0 -195
  51. package/android/src/main/cpp/libyuv/include/libyuv/planar_functions.h +0 -1131
  52. package/android/src/main/cpp/libyuv/include/libyuv/rotate.h +0 -296
  53. package/android/src/main/cpp/libyuv/include/libyuv/rotate_argb.h +0 -37
  54. package/android/src/main/cpp/libyuv/include/libyuv/rotate_row.h +0 -265
  55. package/android/src/main/cpp/libyuv/include/libyuv/row.h +0 -6738
  56. package/android/src/main/cpp/libyuv/include/libyuv/row_sve.h +0 -2154
  57. package/android/src/main/cpp/libyuv/include/libyuv/scale.h +0 -336
  58. package/android/src/main/cpp/libyuv/include/libyuv/scale_argb.h +0 -76
  59. package/android/src/main/cpp/libyuv/include/libyuv/scale_rgb.h +0 -42
  60. package/android/src/main/cpp/libyuv/include/libyuv/scale_row.h +0 -1726
  61. package/android/src/main/cpp/libyuv/include/libyuv/scale_uv.h +0 -51
  62. package/android/src/main/cpp/libyuv/include/libyuv/version.h +0 -16
  63. package/android/src/main/cpp/libyuv/include/libyuv/video_common.h +0 -222
  64. package/android/src/main/cpp/libyuv/include/libyuv.h +0 -33
  65. package/android/src/main/cpp/libyuv/infra/config/OWNERS +0 -3
  66. package/android/src/main/cpp/libyuv/infra/config/PRESUBMIT.py +0 -17
  67. package/android/src/main/cpp/libyuv/infra/config/README.md +0 -2
  68. package/android/src/main/cpp/libyuv/infra/config/codereview.settings +0 -6
  69. package/android/src/main/cpp/libyuv/infra/config/commit-queue.cfg +0 -144
  70. package/android/src/main/cpp/libyuv/infra/config/cr-buildbucket.cfg +0 -1185
  71. package/android/src/main/cpp/libyuv/infra/config/luci-logdog.cfg +0 -9
  72. package/android/src/main/cpp/libyuv/infra/config/luci-milo.cfg +0 -246
  73. package/android/src/main/cpp/libyuv/infra/config/luci-scheduler.cfg +0 -385
  74. package/android/src/main/cpp/libyuv/infra/config/main.star +0 -402
  75. package/android/src/main/cpp/libyuv/infra/config/project.cfg +0 -16
  76. package/android/src/main/cpp/libyuv/infra/config/realms.cfg +0 -111
  77. package/android/src/main/cpp/libyuv/libyuv.gni +0 -34
  78. package/android/src/main/cpp/libyuv/libyuv.gyp +0 -149
  79. package/android/src/main/cpp/libyuv/libyuv.gypi +0 -87
  80. package/android/src/main/cpp/libyuv/linux.mk +0 -96
  81. package/android/src/main/cpp/libyuv/public.mk +0 -13
  82. package/android/src/main/cpp/libyuv/pylintrc +0 -49
  83. package/android/src/main/cpp/libyuv/riscv_script/prepare_toolchain_qemu.sh +0 -74
  84. package/android/src/main/cpp/libyuv/riscv_script/riscv-clang.cmake +0 -56
  85. package/android/src/main/cpp/libyuv/riscv_script/run_qemu.sh +0 -15
  86. package/android/src/main/cpp/libyuv/source/compare.cc +0 -435
  87. package/android/src/main/cpp/libyuv/source/compare_common.cc +0 -74
  88. package/android/src/main/cpp/libyuv/source/compare_gcc.cc +0 -362
  89. package/android/src/main/cpp/libyuv/source/compare_neon.cc +0 -96
  90. package/android/src/main/cpp/libyuv/source/compare_neon64.cc +0 -223
  91. package/android/src/main/cpp/libyuv/source/compare_win.cc +0 -241
  92. package/android/src/main/cpp/libyuv/source/convert.cc +0 -4746
  93. package/android/src/main/cpp/libyuv/source/convert_argb.cc +0 -9179
  94. package/android/src/main/cpp/libyuv/source/convert_from.cc +0 -866
  95. package/android/src/main/cpp/libyuv/source/convert_from_argb.cc +0 -3671
  96. package/android/src/main/cpp/libyuv/source/convert_jpeg.cc +0 -602
  97. package/android/src/main/cpp/libyuv/source/convert_to_argb.cc +0 -391
  98. package/android/src/main/cpp/libyuv/source/convert_to_i420.cc +0 -288
  99. package/android/src/main/cpp/libyuv/source/cpu_id.cc +0 -496
  100. package/android/src/main/cpp/libyuv/source/mjpeg_decoder.cc +0 -580
  101. package/android/src/main/cpp/libyuv/source/mjpeg_validate.cc +0 -71
  102. package/android/src/main/cpp/libyuv/source/planar_functions.cc +0 -5663
  103. package/android/src/main/cpp/libyuv/source/rotate.cc +0 -1241
  104. package/android/src/main/cpp/libyuv/source/rotate_any.cc +0 -76
  105. package/android/src/main/cpp/libyuv/source/rotate_argb.cc +0 -259
  106. package/android/src/main/cpp/libyuv/source/rotate_common.cc +0 -208
  107. package/android/src/main/cpp/libyuv/source/rotate_gcc.cc +0 -505
  108. package/android/src/main/cpp/libyuv/source/rotate_lsx.cc +0 -233
  109. package/android/src/main/cpp/libyuv/source/rotate_neon.cc +0 -219
  110. package/android/src/main/cpp/libyuv/source/rotate_neon64.cc +0 -273
  111. package/android/src/main/cpp/libyuv/source/rotate_sme.cc +0 -174
  112. package/android/src/main/cpp/libyuv/source/rotate_win.cc +0 -253
  113. package/android/src/main/cpp/libyuv/source/row_any.cc +0 -2519
  114. package/android/src/main/cpp/libyuv/source/row_common.cc +0 -4461
  115. package/android/src/main/cpp/libyuv/source/row_gcc.cc +0 -9570
  116. package/android/src/main/cpp/libyuv/source/row_lasx.cc +0 -2343
  117. package/android/src/main/cpp/libyuv/source/row_lsx.cc +0 -3030
  118. package/android/src/main/cpp/libyuv/source/row_neon.cc +0 -4026
  119. package/android/src/main/cpp/libyuv/source/row_neon64.cc +0 -5617
  120. package/android/src/main/cpp/libyuv/source/row_rvv.cc +0 -2599
  121. package/android/src/main/cpp/libyuv/source/row_sme.cc +0 -1183
  122. package/android/src/main/cpp/libyuv/source/row_sve.cc +0 -1088
  123. package/android/src/main/cpp/libyuv/source/row_win.cc +0 -6453
  124. package/android/src/main/cpp/libyuv/source/scale.cc +0 -2710
  125. package/android/src/main/cpp/libyuv/source/scale_any.cc +0 -991
  126. package/android/src/main/cpp/libyuv/source/scale_argb.cc +0 -1158
  127. package/android/src/main/cpp/libyuv/source/scale_common.cc +0 -1977
  128. package/android/src/main/cpp/libyuv/source/scale_gcc.cc +0 -2947
  129. package/android/src/main/cpp/libyuv/source/scale_lsx.cc +0 -739
  130. package/android/src/main/cpp/libyuv/source/scale_neon.cc +0 -1449
  131. package/android/src/main/cpp/libyuv/source/scale_neon64.cc +0 -1552
  132. package/android/src/main/cpp/libyuv/source/scale_rgb.cc +0 -82
  133. package/android/src/main/cpp/libyuv/source/scale_rvv.cc +0 -1971
  134. package/android/src/main/cpp/libyuv/source/scale_sme.cc +0 -555
  135. package/android/src/main/cpp/libyuv/source/scale_uv.cc +0 -1159
  136. package/android/src/main/cpp/libyuv/source/scale_win.cc +0 -1392
  137. package/android/src/main/cpp/libyuv/source/test.sh +0 -35
  138. package/android/src/main/cpp/libyuv/source/video_common.cc +0 -62
  139. package/android/src/main/cpp/libyuv/tools_libyuv/OWNERS +0 -4
  140. package/android/src/main/cpp/libyuv/tools_libyuv/autoroller/roll_deps.py +0 -931
  141. package/android/src/main/cpp/libyuv/tools_libyuv/autoroller/unittests/roll_deps_test.py +0 -164
  142. package/android/src/main/cpp/libyuv/tools_libyuv/autoroller/unittests/testdata/DEPS +0 -21
  143. package/android/src/main/cpp/libyuv/tools_libyuv/autoroller/unittests/testdata/DEPS.chromium.new +0 -13
  144. package/android/src/main/cpp/libyuv/tools_libyuv/autoroller/unittests/testdata/DEPS.chromium.old +0 -13
  145. package/android/src/main/cpp/libyuv/tools_libyuv/get_landmines.py +0 -38
  146. package/android/src/main/cpp/libyuv/tools_libyuv/msan/OWNERS +0 -3
  147. package/android/src/main/cpp/libyuv/tools_libyuv/msan/blacklist.txt +0 -9
  148. package/android/src/main/cpp/libyuv/tools_libyuv/ubsan/OWNERS +0 -3
  149. package/android/src/main/cpp/libyuv/tools_libyuv/ubsan/blacklist.txt +0 -15
  150. package/android/src/main/cpp/libyuv/tools_libyuv/ubsan/vptr_blacklist.txt +0 -25
  151. package/android/src/main/cpp/libyuv/unit_test/basictypes_test.cc +0 -43
  152. package/android/src/main/cpp/libyuv/unit_test/color_test.cc +0 -848
  153. package/android/src/main/cpp/libyuv/unit_test/compare_test.cc +0 -739
  154. package/android/src/main/cpp/libyuv/unit_test/convert_argb_test.cc +0 -2867
  155. package/android/src/main/cpp/libyuv/unit_test/convert_test.cc +0 -2133
  156. package/android/src/main/cpp/libyuv/unit_test/cpu_test.cc +0 -427
  157. package/android/src/main/cpp/libyuv/unit_test/cpu_thread_test.cc +0 -63
  158. package/android/src/main/cpp/libyuv/unit_test/math_test.cc +0 -160
  159. package/android/src/main/cpp/libyuv/unit_test/planar_test.cc +0 -4731
  160. package/android/src/main/cpp/libyuv/unit_test/rotate_argb_test.cc +0 -334
  161. package/android/src/main/cpp/libyuv/unit_test/rotate_test.cc +0 -962
  162. package/android/src/main/cpp/libyuv/unit_test/scale_argb_test.cc +0 -590
  163. package/android/src/main/cpp/libyuv/unit_test/scale_plane_test.cc +0 -465
  164. package/android/src/main/cpp/libyuv/unit_test/scale_rgb_test.cc +0 -280
  165. package/android/src/main/cpp/libyuv/unit_test/scale_test.cc +0 -1135
  166. package/android/src/main/cpp/libyuv/unit_test/scale_uv_test.cc +0 -249
  167. package/android/src/main/cpp/libyuv/unit_test/testdata/arm_v7.txt +0 -12
  168. package/android/src/main/cpp/libyuv/unit_test/testdata/mips.txt +0 -7
  169. package/android/src/main/cpp/libyuv/unit_test/testdata/mips_loongson2k.txt +0 -5
  170. package/android/src/main/cpp/libyuv/unit_test/testdata/mips_loongson3.txt +0 -10
  171. package/android/src/main/cpp/libyuv/unit_test/testdata/mips_loongson_mmi.txt +0 -7
  172. package/android/src/main/cpp/libyuv/unit_test/testdata/riscv64.txt +0 -4
  173. package/android/src/main/cpp/libyuv/unit_test/testdata/riscv64_rvv.txt +0 -4
  174. package/android/src/main/cpp/libyuv/unit_test/testdata/riscv64_rvv_zvfh.txt +0 -4
  175. package/android/src/main/cpp/libyuv/unit_test/testdata/tegra3.txt +0 -23
  176. package/android/src/main/cpp/libyuv/unit_test/testdata/test0.jpg +0 -0
  177. package/android/src/main/cpp/libyuv/unit_test/testdata/test1.jpg +0 -0
  178. package/android/src/main/cpp/libyuv/unit_test/testdata/test2.jpg +0 -0
  179. package/android/src/main/cpp/libyuv/unit_test/testdata/test3.jpg +0 -0
  180. package/android/src/main/cpp/libyuv/unit_test/testdata/test4.jpg +0 -0
  181. package/android/src/main/cpp/libyuv/unit_test/unit_test.cc +0 -581
  182. package/android/src/main/cpp/libyuv/unit_test/unit_test.h +0 -232
  183. package/android/src/main/cpp/libyuv/unit_test/video_common_test.cc +0 -112
  184. package/android/src/main/cpp/libyuv/util/Makefile +0 -9
  185. package/android/src/main/cpp/libyuv/util/color.cc +0 -120
  186. package/android/src/main/cpp/libyuv/util/compare.cc +0 -67
  187. package/android/src/main/cpp/libyuv/util/cpuid.c +0 -211
  188. package/android/src/main/cpp/libyuv/util/i444tonv12_eg.cc +0 -28
  189. package/android/src/main/cpp/libyuv/util/psnr.cc +0 -291
  190. package/android/src/main/cpp/libyuv/util/psnr.h +0 -47
  191. package/android/src/main/cpp/libyuv/util/psnr_main.cc +0 -620
  192. package/android/src/main/cpp/libyuv/util/ssim.cc +0 -364
  193. package/android/src/main/cpp/libyuv/util/ssim.h +0 -38
  194. package/android/src/main/cpp/libyuv/util/yuvconstants.c +0 -114
  195. package/android/src/main/cpp/libyuv/util/yuvconvert.cc +0 -367
  196. package/android/src/main/cpp/libyuv/winarm.mk +0 -47
  197. package/android/src/main/java/com/faceantispoof/ByteBufferPool.kt +0 -68
  198. package/android/src/main/java/com/faceantispoof/FastYuv.kt +0 -51
  199. package/android/src/main/java/com/faceantispoof/YuvToFloatArrayConverter.kt +0 -584
  200. package/android/src/main/java/com/faceantispoof/YuvToRgbConverter.kt +0 -73
@@ -1,581 +0,0 @@
1
- /*
2
- * Copyright 2011 The LibYuv Project Authors. All rights reserved.
3
- *
4
- * Use of this source code is governed by a BSD-style license
5
- * that can be found in the LICENSE file in the root of the source
6
- * tree. An additional intellectual property rights grant can be found
7
- * in the file PATENTS. All contributing project authors may
8
- * be found in the AUTHORS file in the root of the source tree.
9
- */
10
-
11
- #include "../unit_test/unit_test.h"
12
-
13
- #include <stdlib.h> // For getenv()
14
-
15
- #include <cstring>
16
-
17
- #ifdef LIBYUV_USE_ABSL_FLAGS
18
- #include "absl/flags/flag.h"
19
- #include "absl/flags/parse.h"
20
- #endif
21
- #include "libyuv/cpu_id.h"
22
-
23
- unsigned int fastrand_seed = 0xfb;
24
-
25
- #ifdef LIBYUV_USE_ABSL_FLAGS
26
- ABSL_FLAG(int32_t, libyuv_width, 0, "width of test image.");
27
- ABSL_FLAG(int32_t, libyuv_height, 0, "height of test image.");
28
- ABSL_FLAG(int32_t, libyuv_repeat, 0, "number of times to repeat test.");
29
- ABSL_FLAG(int32_t,
30
- libyuv_flags,
31
- 0,
32
- "cpu flags for reference code. 1 = C, -1 = SIMD");
33
- ABSL_FLAG(int32_t,
34
- libyuv_cpu_info,
35
- 0,
36
- "cpu flags for benchmark code. 1 = C, -1 = SIMD");
37
- #else
38
- // Disable command line parameters if absl/flags disabled.
39
- static const int32_t FLAGS_libyuv_width = 0;
40
- static const int32_t FLAGS_libyuv_height = 0;
41
- static const int32_t FLAGS_libyuv_repeat = 0;
42
- static const int32_t FLAGS_libyuv_flags = 0;
43
- static const int32_t FLAGS_libyuv_cpu_info = 0;
44
- #endif
45
-
46
- #ifdef LIBYUV_USE_ABSL_FLAGS
47
- #define LIBYUV_GET_FLAG(f) absl::GetFlag(f)
48
- #else
49
- #define LIBYUV_GET_FLAG(f) f
50
- #endif
51
-
52
- // Test environment variable for disabling CPU features. Any non-zero value
53
- // to disable. Zero ignored to make it easy to set the variable on/off.
54
- #if !defined(__native_client__) && !defined(_M_ARM)
55
- static LIBYUV_BOOL TestEnv(const char* name) {
56
- const char* var = getenv(name);
57
- if (var) {
58
- if (var[0] != '0') {
59
- return LIBYUV_TRUE;
60
- }
61
- }
62
- return LIBYUV_FALSE;
63
- }
64
- #else // nacl does not support getenv().
65
- static LIBYUV_BOOL TestEnv(const char*) {
66
- return LIBYUV_FALSE;
67
- }
68
- #endif
69
-
70
- static int TestCpuEnv(int cpu_info) {
71
- #if defined(__arm__) || defined(__aarch64__)
72
- if (TestEnv("LIBYUV_DISABLE_NEON")) {
73
- cpu_info &= ~libyuv::kCpuHasNEON;
74
- }
75
- #endif
76
- #if defined(__aarch64__)
77
- if (TestEnv("LIBYUV_DISABLE_NEON_DOTPROD")) {
78
- cpu_info &= ~libyuv::kCpuHasNeonDotProd;
79
- }
80
- if (TestEnv("LIBYUV_DISABLE_NEON_I8MM")) {
81
- cpu_info &= ~libyuv::kCpuHasNeonI8MM;
82
- }
83
- if (TestEnv("LIBYUV_DISABLE_SVE")) {
84
- cpu_info &= ~libyuv::kCpuHasSVE;
85
- }
86
- if (TestEnv("LIBYUV_DISABLE_SVE2")) {
87
- cpu_info &= ~libyuv::kCpuHasSVE2;
88
- }
89
- if (TestEnv("LIBYUV_DISABLE_SME")) {
90
- cpu_info &= ~libyuv::kCpuHasSME;
91
- }
92
- #endif
93
- #if defined(__longarch__) && defined(__linux__)
94
- if (TestEnv("LIBYUV_DISABLE_LSX")) {
95
- cpu_info &= ~libyuv::kCpuHasLSX;
96
- }
97
- if (TestEnv("LIBYUV_DISABLE_LASX")) {
98
- cpu_info &= ~libyuv::kCpuHasLASX;
99
- }
100
- #endif
101
- #if defined(__riscv) && defined(__linux__)
102
- if (TestEnv("LIBYUV_DISABLE_RVV")) {
103
- cpu_info &= ~libyuv::kCpuHasRVV;
104
- }
105
- #endif
106
- #if !defined(__pnacl__) && !defined(__CLR_VER) && \
107
- (defined(__x86_64__) || defined(_M_X64) || defined(__i386__) || \
108
- defined(_M_IX86))
109
- if (TestEnv("LIBYUV_DISABLE_X86")) {
110
- cpu_info &= ~libyuv::kCpuHasX86;
111
- }
112
- if (TestEnv("LIBYUV_DISABLE_SSE2")) {
113
- cpu_info &= ~libyuv::kCpuHasSSE2;
114
- }
115
- if (TestEnv("LIBYUV_DISABLE_SSSE3")) {
116
- cpu_info &= ~libyuv::kCpuHasSSSE3;
117
- }
118
- if (TestEnv("LIBYUV_DISABLE_SSE41")) {
119
- cpu_info &= ~libyuv::kCpuHasSSE41;
120
- }
121
- if (TestEnv("LIBYUV_DISABLE_SSE42")) {
122
- cpu_info &= ~libyuv::kCpuHasSSE42;
123
- }
124
- if (TestEnv("LIBYUV_DISABLE_AVX")) {
125
- cpu_info &= ~libyuv::kCpuHasAVX;
126
- }
127
- if (TestEnv("LIBYUV_DISABLE_AVX2")) {
128
- cpu_info &= ~libyuv::kCpuHasAVX2;
129
- }
130
- if (TestEnv("LIBYUV_DISABLE_ERMS")) {
131
- cpu_info &= ~libyuv::kCpuHasERMS;
132
- }
133
- if (TestEnv("LIBYUV_DISABLE_FMA3")) {
134
- cpu_info &= ~libyuv::kCpuHasFMA3;
135
- }
136
- if (TestEnv("LIBYUV_DISABLE_F16C")) {
137
- cpu_info &= ~libyuv::kCpuHasF16C;
138
- }
139
- if (TestEnv("LIBYUV_DISABLE_AVX512BW")) {
140
- cpu_info &= ~libyuv::kCpuHasAVX512BW;
141
- }
142
- if (TestEnv("LIBYUV_DISABLE_AVX512VL")) {
143
- cpu_info &= ~libyuv::kCpuHasAVX512VL;
144
- }
145
- if (TestEnv("LIBYUV_DISABLE_AVX512VNNI")) {
146
- cpu_info &= ~libyuv::kCpuHasAVX512VNNI;
147
- }
148
- if (TestEnv("LIBYUV_DISABLE_AVX512VBMI")) {
149
- cpu_info &= ~libyuv::kCpuHasAVX512VBMI;
150
- }
151
- if (TestEnv("LIBYUV_DISABLE_AVX512VBMI2")) {
152
- cpu_info &= ~libyuv::kCpuHasAVX512VBMI2;
153
- }
154
- if (TestEnv("LIBYUV_DISABLE_AVX512VBITALG")) {
155
- cpu_info &= ~libyuv::kCpuHasAVX512VBITALG;
156
- }
157
- if (TestEnv("LIBYUV_DISABLE_AVX10")) {
158
- cpu_info &= ~libyuv::kCpuHasAVX10;
159
- }
160
- if (TestEnv("LIBYUV_DISABLE_AVX10_2")) {
161
- cpu_info &= ~libyuv::kCpuHasAVX10_2;
162
- }
163
- if (TestEnv("LIBYUV_DISABLE_AVXVNNI")) {
164
- cpu_info &= ~libyuv::kCpuHasAVXVNNI;
165
- }
166
- if (TestEnv("LIBYUV_DISABLE_AVXVNNIINT8")) {
167
- cpu_info &= ~libyuv::kCpuHasAVXVNNIINT8;
168
- }
169
- if (TestEnv("LIBYUV_DISABLE_AMXINT8")) {
170
- cpu_info &= ~libyuv::kCpuHasAMXINT8;
171
- }
172
- #endif
173
- if (TestEnv("LIBYUV_DISABLE_ASM")) {
174
- cpu_info = libyuv::kCpuInitialized;
175
- }
176
- return cpu_info;
177
- }
178
-
179
- // For quicker unittests, default is 128 x 72. But when benchmarking,
180
- // default to 720p. Allow size to specify.
181
- // Set flags to -1 for benchmarking to avoid slower C code.
182
-
183
- LibYUVConvertTest::LibYUVConvertTest()
184
- : benchmark_iterations_(1),
185
- benchmark_width_(128),
186
- benchmark_height_(72),
187
- disable_cpu_flags_(1),
188
- benchmark_cpu_info_(-1) {
189
- const char* repeat = getenv("LIBYUV_REPEAT");
190
- if (repeat) {
191
- benchmark_iterations_ = atoi(repeat); // NOLINT
192
- }
193
- if (LIBYUV_GET_FLAG(FLAGS_libyuv_repeat)) {
194
- benchmark_iterations_ = LIBYUV_GET_FLAG(FLAGS_libyuv_repeat);
195
- }
196
- if (benchmark_iterations_ > 1) {
197
- benchmark_width_ = 1280;
198
- benchmark_height_ = 720;
199
- }
200
- const char* width = getenv("LIBYUV_WIDTH");
201
- if (width) {
202
- benchmark_width_ = atoi(width); // NOLINT
203
- }
204
- if (LIBYUV_GET_FLAG(FLAGS_libyuv_width)) {
205
- benchmark_width_ = LIBYUV_GET_FLAG(FLAGS_libyuv_width);
206
- }
207
- const char* height = getenv("LIBYUV_HEIGHT");
208
- if (height) {
209
- benchmark_height_ = atoi(height); // NOLINT
210
- }
211
- if (LIBYUV_GET_FLAG(FLAGS_libyuv_height)) {
212
- benchmark_height_ = LIBYUV_GET_FLAG(FLAGS_libyuv_height);
213
- }
214
- const char* cpu_flags = getenv("LIBYUV_FLAGS");
215
- if (cpu_flags) {
216
- disable_cpu_flags_ = atoi(cpu_flags); // NOLINT
217
- }
218
- if (LIBYUV_GET_FLAG(FLAGS_libyuv_flags)) {
219
- disable_cpu_flags_ = LIBYUV_GET_FLAG(FLAGS_libyuv_flags);
220
- }
221
- const char* cpu_info = getenv("LIBYUV_CPU_INFO");
222
- if (cpu_info) {
223
- benchmark_cpu_info_ = atoi(cpu_info); // NOLINT
224
- }
225
- if (LIBYUV_GET_FLAG(FLAGS_libyuv_cpu_info)) {
226
- benchmark_cpu_info_ = LIBYUV_GET_FLAG(FLAGS_libyuv_cpu_info);
227
- }
228
- disable_cpu_flags_ = TestCpuEnv(disable_cpu_flags_);
229
- benchmark_cpu_info_ = TestCpuEnv(benchmark_cpu_info_);
230
- libyuv::MaskCpuFlags(benchmark_cpu_info_);
231
- benchmark_pixels_div1280_ =
232
- static_cast<int>((static_cast<double>(Abs(benchmark_width_)) *
233
- static_cast<double>(Abs(benchmark_height_)) *
234
- static_cast<double>(benchmark_iterations_) +
235
- 1279.0) /
236
- 1280.0);
237
- }
238
-
239
- LibYUVColorTest::LibYUVColorTest()
240
- : benchmark_iterations_(1),
241
- benchmark_width_(128),
242
- benchmark_height_(72),
243
- disable_cpu_flags_(1),
244
- benchmark_cpu_info_(-1) {
245
- const char* repeat = getenv("LIBYUV_REPEAT");
246
- if (repeat) {
247
- benchmark_iterations_ = atoi(repeat); // NOLINT
248
- }
249
- if (LIBYUV_GET_FLAG(FLAGS_libyuv_repeat)) {
250
- benchmark_iterations_ = LIBYUV_GET_FLAG(FLAGS_libyuv_repeat);
251
- }
252
- if (benchmark_iterations_ > 1) {
253
- benchmark_width_ = 1280;
254
- benchmark_height_ = 720;
255
- }
256
- const char* width = getenv("LIBYUV_WIDTH");
257
- if (width) {
258
- benchmark_width_ = atoi(width); // NOLINT
259
- }
260
- if (LIBYUV_GET_FLAG(FLAGS_libyuv_width)) {
261
- benchmark_width_ = LIBYUV_GET_FLAG(FLAGS_libyuv_width);
262
- }
263
- const char* height = getenv("LIBYUV_HEIGHT");
264
- if (height) {
265
- benchmark_height_ = atoi(height); // NOLINT
266
- }
267
- if (LIBYUV_GET_FLAG(FLAGS_libyuv_height)) {
268
- benchmark_height_ = LIBYUV_GET_FLAG(FLAGS_libyuv_height);
269
- }
270
- const char* cpu_flags = getenv("LIBYUV_FLAGS");
271
- if (cpu_flags) {
272
- disable_cpu_flags_ = atoi(cpu_flags); // NOLINT
273
- }
274
- if (LIBYUV_GET_FLAG(FLAGS_libyuv_flags)) {
275
- disable_cpu_flags_ = LIBYUV_GET_FLAG(FLAGS_libyuv_flags);
276
- }
277
- const char* cpu_info = getenv("LIBYUV_CPU_INFO");
278
- if (cpu_info) {
279
- benchmark_cpu_info_ = atoi(cpu_info); // NOLINT
280
- }
281
- if (LIBYUV_GET_FLAG(FLAGS_libyuv_cpu_info)) {
282
- benchmark_cpu_info_ = LIBYUV_GET_FLAG(FLAGS_libyuv_cpu_info);
283
- }
284
- disable_cpu_flags_ = TestCpuEnv(disable_cpu_flags_);
285
- benchmark_cpu_info_ = TestCpuEnv(benchmark_cpu_info_);
286
- libyuv::MaskCpuFlags(benchmark_cpu_info_);
287
- benchmark_pixels_div1280_ =
288
- static_cast<int>((static_cast<double>(Abs(benchmark_width_)) *
289
- static_cast<double>(Abs(benchmark_height_)) *
290
- static_cast<double>(benchmark_iterations_) +
291
- 1279.0) /
292
- 1280.0);
293
- }
294
-
295
- LibYUVScaleTest::LibYUVScaleTest()
296
- : benchmark_iterations_(1),
297
- benchmark_width_(128),
298
- benchmark_height_(72),
299
- disable_cpu_flags_(1),
300
- benchmark_cpu_info_(-1) {
301
- const char* repeat = getenv("LIBYUV_REPEAT");
302
- if (repeat) {
303
- benchmark_iterations_ = atoi(repeat); // NOLINT
304
- }
305
- if (LIBYUV_GET_FLAG(FLAGS_libyuv_repeat)) {
306
- benchmark_iterations_ = LIBYUV_GET_FLAG(FLAGS_libyuv_repeat);
307
- }
308
- if (benchmark_iterations_ > 1) {
309
- benchmark_width_ = 1280;
310
- benchmark_height_ = 720;
311
- }
312
- const char* width = getenv("LIBYUV_WIDTH");
313
- if (width) {
314
- benchmark_width_ = atoi(width); // NOLINT
315
- }
316
- if (LIBYUV_GET_FLAG(FLAGS_libyuv_width)) {
317
- benchmark_width_ = LIBYUV_GET_FLAG(FLAGS_libyuv_width);
318
- }
319
- const char* height = getenv("LIBYUV_HEIGHT");
320
- if (height) {
321
- benchmark_height_ = atoi(height); // NOLINT
322
- }
323
- if (LIBYUV_GET_FLAG(FLAGS_libyuv_height)) {
324
- benchmark_height_ = LIBYUV_GET_FLAG(FLAGS_libyuv_height);
325
- }
326
- const char* cpu_flags = getenv("LIBYUV_FLAGS");
327
- if (cpu_flags) {
328
- disable_cpu_flags_ = atoi(cpu_flags); // NOLINT
329
- }
330
- if (LIBYUV_GET_FLAG(FLAGS_libyuv_flags)) {
331
- disable_cpu_flags_ = LIBYUV_GET_FLAG(FLAGS_libyuv_flags);
332
- }
333
- const char* cpu_info = getenv("LIBYUV_CPU_INFO");
334
- if (cpu_info) {
335
- benchmark_cpu_info_ = atoi(cpu_info); // NOLINT
336
- }
337
- if (LIBYUV_GET_FLAG(FLAGS_libyuv_cpu_info)) {
338
- benchmark_cpu_info_ = LIBYUV_GET_FLAG(FLAGS_libyuv_cpu_info);
339
- }
340
- disable_cpu_flags_ = TestCpuEnv(disable_cpu_flags_);
341
- benchmark_cpu_info_ = TestCpuEnv(benchmark_cpu_info_);
342
- libyuv::MaskCpuFlags(benchmark_cpu_info_);
343
- benchmark_pixels_div1280_ =
344
- static_cast<int>((static_cast<double>(Abs(benchmark_width_)) *
345
- static_cast<double>(Abs(benchmark_height_)) *
346
- static_cast<double>(benchmark_iterations_) +
347
- 1279.0) /
348
- 1280.0);
349
- }
350
-
351
- LibYUVRotateTest::LibYUVRotateTest()
352
- : benchmark_iterations_(1),
353
- benchmark_width_(128),
354
- benchmark_height_(72),
355
- disable_cpu_flags_(1),
356
- benchmark_cpu_info_(-1) {
357
- const char* repeat = getenv("LIBYUV_REPEAT");
358
- if (repeat) {
359
- benchmark_iterations_ = atoi(repeat); // NOLINT
360
- }
361
- if (LIBYUV_GET_FLAG(FLAGS_libyuv_repeat)) {
362
- benchmark_iterations_ = LIBYUV_GET_FLAG(FLAGS_libyuv_repeat);
363
- }
364
- if (benchmark_iterations_ > 1) {
365
- benchmark_width_ = 1280;
366
- benchmark_height_ = 720;
367
- }
368
- const char* width = getenv("LIBYUV_WIDTH");
369
- if (width) {
370
- benchmark_width_ = atoi(width); // NOLINT
371
- }
372
- if (LIBYUV_GET_FLAG(FLAGS_libyuv_width)) {
373
- benchmark_width_ = LIBYUV_GET_FLAG(FLAGS_libyuv_width);
374
- }
375
- const char* height = getenv("LIBYUV_HEIGHT");
376
- if (height) {
377
- benchmark_height_ = atoi(height); // NOLINT
378
- }
379
- if (LIBYUV_GET_FLAG(FLAGS_libyuv_height)) {
380
- benchmark_height_ = LIBYUV_GET_FLAG(FLAGS_libyuv_height);
381
- }
382
- const char* cpu_flags = getenv("LIBYUV_FLAGS");
383
- if (cpu_flags) {
384
- disable_cpu_flags_ = atoi(cpu_flags); // NOLINT
385
- }
386
- if (LIBYUV_GET_FLAG(FLAGS_libyuv_flags)) {
387
- disable_cpu_flags_ = LIBYUV_GET_FLAG(FLAGS_libyuv_flags);
388
- }
389
- const char* cpu_info = getenv("LIBYUV_CPU_INFO");
390
- if (cpu_info) {
391
- benchmark_cpu_info_ = atoi(cpu_info); // NOLINT
392
- }
393
- if (LIBYUV_GET_FLAG(FLAGS_libyuv_cpu_info)) {
394
- benchmark_cpu_info_ = LIBYUV_GET_FLAG(FLAGS_libyuv_cpu_info);
395
- }
396
- disable_cpu_flags_ = TestCpuEnv(disable_cpu_flags_);
397
- benchmark_cpu_info_ = TestCpuEnv(benchmark_cpu_info_);
398
- libyuv::MaskCpuFlags(benchmark_cpu_info_);
399
- benchmark_pixels_div1280_ =
400
- static_cast<int>((static_cast<double>(Abs(benchmark_width_)) *
401
- static_cast<double>(Abs(benchmark_height_)) *
402
- static_cast<double>(benchmark_iterations_) +
403
- 1279.0) /
404
- 1280.0);
405
- }
406
-
407
- LibYUVPlanarTest::LibYUVPlanarTest()
408
- : benchmark_iterations_(1),
409
- benchmark_width_(128),
410
- benchmark_height_(72),
411
- disable_cpu_flags_(1),
412
- benchmark_cpu_info_(-1) {
413
- const char* repeat = getenv("LIBYUV_REPEAT");
414
- if (repeat) {
415
- benchmark_iterations_ = atoi(repeat); // NOLINT
416
- }
417
- if (LIBYUV_GET_FLAG(FLAGS_libyuv_repeat)) {
418
- benchmark_iterations_ = LIBYUV_GET_FLAG(FLAGS_libyuv_repeat);
419
- }
420
- if (benchmark_iterations_ > 1) {
421
- benchmark_width_ = 1280;
422
- benchmark_height_ = 720;
423
- }
424
- const char* width = getenv("LIBYUV_WIDTH");
425
- if (width) {
426
- benchmark_width_ = atoi(width); // NOLINT
427
- }
428
- if (LIBYUV_GET_FLAG(FLAGS_libyuv_width)) {
429
- benchmark_width_ = LIBYUV_GET_FLAG(FLAGS_libyuv_width);
430
- }
431
- const char* height = getenv("LIBYUV_HEIGHT");
432
- if (height) {
433
- benchmark_height_ = atoi(height); // NOLINT
434
- }
435
- if (LIBYUV_GET_FLAG(FLAGS_libyuv_height)) {
436
- benchmark_height_ = LIBYUV_GET_FLAG(FLAGS_libyuv_height);
437
- }
438
- const char* cpu_flags = getenv("LIBYUV_FLAGS");
439
- if (cpu_flags) {
440
- disable_cpu_flags_ = atoi(cpu_flags); // NOLINT
441
- }
442
- if (LIBYUV_GET_FLAG(FLAGS_libyuv_flags)) {
443
- disable_cpu_flags_ = LIBYUV_GET_FLAG(FLAGS_libyuv_flags);
444
- }
445
- const char* cpu_info = getenv("LIBYUV_CPU_INFO");
446
- if (cpu_info) {
447
- benchmark_cpu_info_ = atoi(cpu_info); // NOLINT
448
- }
449
- if (LIBYUV_GET_FLAG(FLAGS_libyuv_cpu_info)) {
450
- benchmark_cpu_info_ = LIBYUV_GET_FLAG(FLAGS_libyuv_cpu_info);
451
- }
452
- disable_cpu_flags_ = TestCpuEnv(disable_cpu_flags_);
453
- benchmark_cpu_info_ = TestCpuEnv(benchmark_cpu_info_);
454
- libyuv::MaskCpuFlags(benchmark_cpu_info_);
455
- benchmark_pixels_div1280_ =
456
- static_cast<int>((static_cast<double>(Abs(benchmark_width_)) *
457
- static_cast<double>(Abs(benchmark_height_)) *
458
- static_cast<double>(benchmark_iterations_) +
459
- 1279.0) /
460
- 1280.0);
461
- }
462
-
463
- LibYUVBaseTest::LibYUVBaseTest()
464
- : benchmark_iterations_(1),
465
- benchmark_width_(128),
466
- benchmark_height_(72),
467
- disable_cpu_flags_(1),
468
- benchmark_cpu_info_(-1) {
469
- const char* repeat = getenv("LIBYUV_REPEAT");
470
- if (repeat) {
471
- benchmark_iterations_ = atoi(repeat); // NOLINT
472
- }
473
- if (LIBYUV_GET_FLAG(FLAGS_libyuv_repeat)) {
474
- benchmark_iterations_ = LIBYUV_GET_FLAG(FLAGS_libyuv_repeat);
475
- }
476
- if (benchmark_iterations_ > 1) {
477
- benchmark_width_ = 1280;
478
- benchmark_height_ = 720;
479
- }
480
- const char* width = getenv("LIBYUV_WIDTH");
481
- if (width) {
482
- benchmark_width_ = atoi(width); // NOLINT
483
- }
484
- if (LIBYUV_GET_FLAG(FLAGS_libyuv_width)) {
485
- benchmark_width_ = LIBYUV_GET_FLAG(FLAGS_libyuv_width);
486
- }
487
- const char* height = getenv("LIBYUV_HEIGHT");
488
- if (height) {
489
- benchmark_height_ = atoi(height); // NOLINT
490
- }
491
- if (LIBYUV_GET_FLAG(FLAGS_libyuv_height)) {
492
- benchmark_height_ = LIBYUV_GET_FLAG(FLAGS_libyuv_height);
493
- }
494
- const char* cpu_flags = getenv("LIBYUV_FLAGS");
495
- if (cpu_flags) {
496
- disable_cpu_flags_ = atoi(cpu_flags); // NOLINT
497
- }
498
- if (LIBYUV_GET_FLAG(FLAGS_libyuv_flags)) {
499
- disable_cpu_flags_ = LIBYUV_GET_FLAG(FLAGS_libyuv_flags);
500
- }
501
- const char* cpu_info = getenv("LIBYUV_CPU_INFO");
502
- if (cpu_info) {
503
- benchmark_cpu_info_ = atoi(cpu_info); // NOLINT
504
- }
505
- if (LIBYUV_GET_FLAG(FLAGS_libyuv_cpu_info)) {
506
- benchmark_cpu_info_ = LIBYUV_GET_FLAG(FLAGS_libyuv_cpu_info);
507
- }
508
- disable_cpu_flags_ = TestCpuEnv(disable_cpu_flags_);
509
- benchmark_cpu_info_ = TestCpuEnv(benchmark_cpu_info_);
510
- libyuv::MaskCpuFlags(benchmark_cpu_info_);
511
- benchmark_pixels_div1280_ =
512
- static_cast<int>((static_cast<double>(Abs(benchmark_width_)) *
513
- static_cast<double>(Abs(benchmark_height_)) *
514
- static_cast<double>(benchmark_iterations_) +
515
- 1279.0) /
516
- 1280.0);
517
- }
518
-
519
- LibYUVCompareTest::LibYUVCompareTest()
520
- : benchmark_iterations_(1),
521
- benchmark_width_(128),
522
- benchmark_height_(72),
523
- disable_cpu_flags_(1),
524
- benchmark_cpu_info_(-1) {
525
- const char* repeat = getenv("LIBYUV_REPEAT");
526
- if (repeat) {
527
- benchmark_iterations_ = atoi(repeat); // NOLINT
528
- }
529
- if (LIBYUV_GET_FLAG(FLAGS_libyuv_repeat)) {
530
- benchmark_iterations_ = LIBYUV_GET_FLAG(FLAGS_libyuv_repeat);
531
- }
532
- if (benchmark_iterations_ > 1) {
533
- benchmark_width_ = 1280;
534
- benchmark_height_ = 720;
535
- }
536
- const char* width = getenv("LIBYUV_WIDTH");
537
- if (width) {
538
- benchmark_width_ = atoi(width); // NOLINT
539
- }
540
- if (LIBYUV_GET_FLAG(FLAGS_libyuv_width)) {
541
- benchmark_width_ = LIBYUV_GET_FLAG(FLAGS_libyuv_width);
542
- }
543
- const char* height = getenv("LIBYUV_HEIGHT");
544
- if (height) {
545
- benchmark_height_ = atoi(height); // NOLINT
546
- }
547
- if (LIBYUV_GET_FLAG(FLAGS_libyuv_height)) {
548
- benchmark_height_ = LIBYUV_GET_FLAG(FLAGS_libyuv_height);
549
- }
550
- const char* cpu_flags = getenv("LIBYUV_FLAGS");
551
- if (cpu_flags) {
552
- disable_cpu_flags_ = atoi(cpu_flags); // NOLINT
553
- }
554
- if (LIBYUV_GET_FLAG(FLAGS_libyuv_flags)) {
555
- disable_cpu_flags_ = LIBYUV_GET_FLAG(FLAGS_libyuv_flags);
556
- }
557
- const char* cpu_info = getenv("LIBYUV_CPU_INFO");
558
- if (cpu_info) {
559
- benchmark_cpu_info_ = atoi(cpu_info); // NOLINT
560
- }
561
- if (LIBYUV_GET_FLAG(FLAGS_libyuv_cpu_info)) {
562
- benchmark_cpu_info_ = LIBYUV_GET_FLAG(FLAGS_libyuv_cpu_info);
563
- }
564
- disable_cpu_flags_ = TestCpuEnv(disable_cpu_flags_);
565
- benchmark_cpu_info_ = TestCpuEnv(benchmark_cpu_info_);
566
- libyuv::MaskCpuFlags(benchmark_cpu_info_);
567
- benchmark_pixels_div1280_ =
568
- static_cast<int>((static_cast<double>(Abs(benchmark_width_)) *
569
- static_cast<double>(Abs(benchmark_height_)) *
570
- static_cast<double>(benchmark_iterations_) +
571
- 1279.0) /
572
- 1280.0);
573
- }
574
-
575
- int main(int argc, char** argv) {
576
- ::testing::InitGoogleTest(&argc, argv);
577
- #ifdef LIBYUV_USE_ABSL_FLAGS
578
- absl::ParseCommandLine(argc, argv);
579
- #endif
580
- return RUN_ALL_TESTS();
581
- }