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,76 +0,0 @@
1
- /*
2
- * Copyright 2015 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 "libyuv/rotate.h"
12
- #include "libyuv/rotate_row.h"
13
-
14
- #include "libyuv/basic_types.h"
15
-
16
- #ifdef __cplusplus
17
- namespace libyuv {
18
- extern "C" {
19
- #endif
20
-
21
- #define TANY(NAMEANY, TPOS_SIMD, TPOS_C, MASK) \
22
- void NAMEANY(const uint8_t* src, int src_stride, uint8_t* dst, \
23
- int dst_stride, int width) { \
24
- int r = width & MASK; \
25
- int n = width - r; \
26
- if (n > 0) { \
27
- TPOS_SIMD(src, src_stride, dst, dst_stride, n); \
28
- } \
29
- TPOS_C(src + n, src_stride, dst + n * dst_stride, dst_stride, r); \
30
- }
31
-
32
- #ifdef HAS_TRANSPOSEWX8_NEON
33
- TANY(TransposeWx8_Any_NEON, TransposeWx8_NEON, TransposeWx8_C, 7)
34
- #endif
35
- #ifdef HAS_TRANSPOSEWX16_NEON
36
- TANY(TransposeWx16_Any_NEON, TransposeWx16_NEON, TransposeWx16_C, 15)
37
- #endif
38
- #ifdef HAS_TRANSPOSEWX8_SSSE3
39
- TANY(TransposeWx8_Any_SSSE3, TransposeWx8_SSSE3, TransposeWx8_C, 7)
40
- #endif
41
- #ifdef HAS_TRANSPOSEWX8_FAST_SSSE3
42
- TANY(TransposeWx8_Fast_Any_SSSE3, TransposeWx8_Fast_SSSE3, TransposeWx8_C, 15)
43
- #endif
44
- #ifdef HAS_TRANSPOSEWX16_LSX
45
- TANY(TransposeWx16_Any_LSX, TransposeWx16_LSX, TransposeWx16_C, 15)
46
- #endif
47
- #undef TANY
48
-
49
- #define TUVANY(NAMEANY, TPOS_SIMD, MASK) \
50
- void NAMEANY(const uint8_t* src, int src_stride, uint8_t* dst_a, \
51
- int dst_stride_a, uint8_t* dst_b, int dst_stride_b, \
52
- int width) { \
53
- int r = width & MASK; \
54
- int n = width - r; \
55
- if (n > 0) { \
56
- TPOS_SIMD(src, src_stride, dst_a, dst_stride_a, dst_b, dst_stride_b, n); \
57
- } \
58
- TransposeUVWx8_C(src + n * 2, src_stride, dst_a + n * dst_stride_a, \
59
- dst_stride_a, dst_b + n * dst_stride_b, dst_stride_b, r); \
60
- }
61
-
62
- #ifdef HAS_TRANSPOSEUVWX8_NEON
63
- TUVANY(TransposeUVWx8_Any_NEON, TransposeUVWx8_NEON, 7)
64
- #endif
65
- #ifdef HAS_TRANSPOSEUVWX8_SSE2
66
- TUVANY(TransposeUVWx8_Any_SSE2, TransposeUVWx8_SSE2, 7)
67
- #endif
68
- #ifdef HAS_TRANSPOSEUVWX16_LSX
69
- TUVANY(TransposeUVWx16_Any_LSX, TransposeUVWx16_LSX, 7)
70
- #endif
71
- #undef TUVANY
72
-
73
- #ifdef __cplusplus
74
- } // extern "C"
75
- } // namespace libyuv
76
- #endif
@@ -1,259 +0,0 @@
1
- /*
2
- * Copyright 2012 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 "libyuv/rotate_argb.h"
12
-
13
- #include "libyuv/convert.h"
14
- #include "libyuv/cpu_id.h"
15
- #include "libyuv/planar_functions.h"
16
- #include "libyuv/rotate.h"
17
- #include "libyuv/row.h"
18
- #include "libyuv/scale_row.h" /* for ScaleARGBRowDownEven_ */
19
-
20
- #ifdef __cplusplus
21
- namespace libyuv {
22
- extern "C" {
23
- #endif
24
-
25
- static int ARGBTranspose(const uint8_t* src_argb,
26
- int src_stride_argb,
27
- uint8_t* dst_argb,
28
- int dst_stride_argb,
29
- int width,
30
- int height) {
31
- int i;
32
- int src_pixel_step = src_stride_argb >> 2;
33
- void (*ScaleARGBRowDownEven)(
34
- const uint8_t* src_argb, ptrdiff_t src_stride_argb, int src_step,
35
- uint8_t* dst_argb, int dst_width) = ScaleARGBRowDownEven_C;
36
- // Check stride is a multiple of 4.
37
- if (src_stride_argb & 3) {
38
- return -1;
39
- }
40
- #if defined(HAS_SCALEARGBROWDOWNEVEN_SSE2)
41
- if (TestCpuFlag(kCpuHasSSE2)) {
42
- ScaleARGBRowDownEven = ScaleARGBRowDownEven_Any_SSE2;
43
- if (IS_ALIGNED(height, 4)) { // Width of dest.
44
- ScaleARGBRowDownEven = ScaleARGBRowDownEven_SSE2;
45
- }
46
- }
47
- #endif
48
- #if defined(HAS_SCALEARGBROWDOWNEVEN_NEON)
49
- if (TestCpuFlag(kCpuHasNEON)) {
50
- ScaleARGBRowDownEven = ScaleARGBRowDownEven_Any_NEON;
51
- if (IS_ALIGNED(height, 4)) { // Width of dest.
52
- ScaleARGBRowDownEven = ScaleARGBRowDownEven_NEON;
53
- }
54
- }
55
- #endif
56
- #if defined(HAS_SCALEARGBROWDOWNEVEN_LSX)
57
- if (TestCpuFlag(kCpuHasLSX)) {
58
- ScaleARGBRowDownEven = ScaleARGBRowDownEven_Any_LSX;
59
- if (IS_ALIGNED(height, 4)) { // Width of dest.
60
- ScaleARGBRowDownEven = ScaleARGBRowDownEven_LSX;
61
- }
62
- }
63
- #endif
64
- #if defined(HAS_SCALEARGBROWDOWNEVEN_RVV)
65
- if (TestCpuFlag(kCpuHasRVV)) {
66
- ScaleARGBRowDownEven = ScaleARGBRowDownEven_RVV;
67
- }
68
- #endif
69
-
70
- for (i = 0; i < width; ++i) { // column of source to row of dest.
71
- ScaleARGBRowDownEven(src_argb, 0, src_pixel_step, dst_argb, height);
72
- dst_argb += dst_stride_argb;
73
- src_argb += 4;
74
- }
75
- return 0;
76
- }
77
-
78
- static int ARGBRotate90(const uint8_t* src_argb,
79
- int src_stride_argb,
80
- uint8_t* dst_argb,
81
- int dst_stride_argb,
82
- int width,
83
- int height) {
84
- // Rotate by 90 is a ARGBTranspose with the source read
85
- // from bottom to top. So set the source pointer to the end
86
- // of the buffer and flip the sign of the source stride.
87
- src_argb += src_stride_argb * (height - 1);
88
- src_stride_argb = -src_stride_argb;
89
- return ARGBTranspose(src_argb, src_stride_argb, dst_argb, dst_stride_argb,
90
- width, height);
91
- }
92
-
93
- static int ARGBRotate270(const uint8_t* src_argb,
94
- int src_stride_argb,
95
- uint8_t* dst_argb,
96
- int dst_stride_argb,
97
- int width,
98
- int height) {
99
- // Rotate by 270 is a ARGBTranspose with the destination written
100
- // from bottom to top. So set the destination pointer to the end
101
- // of the buffer and flip the sign of the destination stride.
102
- dst_argb += dst_stride_argb * (width - 1);
103
- dst_stride_argb = -dst_stride_argb;
104
- return ARGBTranspose(src_argb, src_stride_argb, dst_argb, dst_stride_argb,
105
- width, height);
106
- }
107
-
108
- static int ARGBRotate180(const uint8_t* src_argb,
109
- int src_stride_argb,
110
- uint8_t* dst_argb,
111
- int dst_stride_argb,
112
- int width,
113
- int height) {
114
- // Swap first and last row and mirror the content. Uses a temporary row.
115
- const uint8_t* src_bot = src_argb + src_stride_argb * (height - 1);
116
- uint8_t* dst_bot = dst_argb + dst_stride_argb * (height - 1);
117
- int half_height = (height + 1) >> 1;
118
- int y;
119
- void (*ARGBMirrorRow)(const uint8_t* src_argb, uint8_t* dst_argb, int width) =
120
- ARGBMirrorRow_C;
121
- void (*CopyRow)(const uint8_t* src_argb, uint8_t* dst_argb, int width) =
122
- CopyRow_C;
123
- align_buffer_64(row, width * 4);
124
- if (!row)
125
- return 1;
126
- #if defined(HAS_ARGBMIRRORROW_NEON)
127
- if (TestCpuFlag(kCpuHasNEON)) {
128
- ARGBMirrorRow = ARGBMirrorRow_Any_NEON;
129
- if (IS_ALIGNED(width, 8)) {
130
- ARGBMirrorRow = ARGBMirrorRow_NEON;
131
- }
132
- }
133
- #endif
134
- #if defined(HAS_ARGBMIRRORROW_SSE2)
135
- if (TestCpuFlag(kCpuHasSSE2)) {
136
- ARGBMirrorRow = ARGBMirrorRow_Any_SSE2;
137
- if (IS_ALIGNED(width, 4)) {
138
- ARGBMirrorRow = ARGBMirrorRow_SSE2;
139
- }
140
- }
141
- #endif
142
- #if defined(HAS_ARGBMIRRORROW_AVX2)
143
- if (TestCpuFlag(kCpuHasAVX2)) {
144
- ARGBMirrorRow = ARGBMirrorRow_Any_AVX2;
145
- if (IS_ALIGNED(width, 8)) {
146
- ARGBMirrorRow = ARGBMirrorRow_AVX2;
147
- }
148
- }
149
- #endif
150
- #if defined(HAS_ARGBMIRRORROW_LSX)
151
- if (TestCpuFlag(kCpuHasLSX)) {
152
- ARGBMirrorRow = ARGBMirrorRow_Any_LSX;
153
- if (IS_ALIGNED(width, 8)) {
154
- ARGBMirrorRow = ARGBMirrorRow_LSX;
155
- }
156
- }
157
- #endif
158
- #if defined(HAS_ARGBMIRRORROW_LASX)
159
- if (TestCpuFlag(kCpuHasLASX)) {
160
- ARGBMirrorRow = ARGBMirrorRow_Any_LASX;
161
- if (IS_ALIGNED(width, 16)) {
162
- ARGBMirrorRow = ARGBMirrorRow_LASX;
163
- }
164
- }
165
- #endif
166
- #if defined(HAS_COPYROW_SSE2)
167
- if (TestCpuFlag(kCpuHasSSE2)) {
168
- CopyRow = IS_ALIGNED(width * 4, 32) ? CopyRow_SSE2 : CopyRow_Any_SSE2;
169
- }
170
- #endif
171
- #if defined(HAS_COPYROW_AVX)
172
- if (TestCpuFlag(kCpuHasAVX)) {
173
- CopyRow = IS_ALIGNED(width * 4, 64) ? CopyRow_AVX : CopyRow_Any_AVX;
174
- }
175
- #endif
176
- #if defined(HAS_COPYROW_AVX512BW)
177
- if (TestCpuFlag(kCpuHasAVX512BW)) {
178
- CopyRow =
179
- IS_ALIGNED(width * 4, 128) ? CopyRow_AVX512BW : CopyRow_Any_AVX512BW;
180
- }
181
- #endif
182
- #if defined(HAS_COPYROW_ERMS)
183
- if (TestCpuFlag(kCpuHasERMS)) {
184
- CopyRow = CopyRow_ERMS;
185
- }
186
- #endif
187
- #if defined(HAS_COPYROW_NEON)
188
- if (TestCpuFlag(kCpuHasNEON)) {
189
- CopyRow = IS_ALIGNED(width * 4, 32) ? CopyRow_NEON : CopyRow_Any_NEON;
190
- }
191
- #endif
192
- #if defined(HAS_COPYROW_SME)
193
- if (TestCpuFlag(kCpuHasSME)) {
194
- CopyRow = CopyRow_SME;
195
- }
196
- #endif
197
- #if defined(HAS_COPYROW_RVV)
198
- if (TestCpuFlag(kCpuHasRVV)) {
199
- CopyRow = CopyRow_RVV;
200
- }
201
- #endif
202
-
203
- // Odd height will harmlessly mirror the middle row twice.
204
- for (y = 0; y < half_height; ++y) {
205
- ARGBMirrorRow(src_argb, row, width); // Mirror first row into a buffer
206
- ARGBMirrorRow(src_bot, dst_argb, width); // Mirror last row into first row
207
- CopyRow(row, dst_bot, width * 4); // Copy first mirrored row into last
208
- src_argb += src_stride_argb;
209
- dst_argb += dst_stride_argb;
210
- src_bot -= src_stride_argb;
211
- dst_bot -= dst_stride_argb;
212
- }
213
- free_aligned_buffer_64(row);
214
- return 0;
215
- }
216
-
217
- LIBYUV_API
218
- int ARGBRotate(const uint8_t* src_argb,
219
- int src_stride_argb,
220
- uint8_t* dst_argb,
221
- int dst_stride_argb,
222
- int width,
223
- int height,
224
- enum RotationMode mode) {
225
- if (!src_argb || width <= 0 || height == 0 || !dst_argb) {
226
- return -1;
227
- }
228
-
229
- // Negative height means invert the image.
230
- if (height < 0) {
231
- height = -height;
232
- src_argb = src_argb + (height - 1) * src_stride_argb;
233
- src_stride_argb = -src_stride_argb;
234
- }
235
-
236
- switch (mode) {
237
- case kRotate0:
238
- // copy frame
239
- return ARGBCopy(src_argb, src_stride_argb, dst_argb, dst_stride_argb,
240
- width, height);
241
- case kRotate90:
242
- return ARGBRotate90(src_argb, src_stride_argb, dst_argb, dst_stride_argb,
243
- width, height);
244
- case kRotate270:
245
- return ARGBRotate270(src_argb, src_stride_argb, dst_argb, dst_stride_argb,
246
- width, height);
247
- case kRotate180:
248
- return ARGBRotate180(src_argb, src_stride_argb, dst_argb, dst_stride_argb,
249
- width, height);
250
- default:
251
- break;
252
- }
253
- return -1;
254
- }
255
-
256
- #ifdef __cplusplus
257
- } // extern "C"
258
- } // namespace libyuv
259
- #endif
@@ -1,208 +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 "libyuv/rotate_row.h"
12
- #include "libyuv/row.h"
13
-
14
- #ifdef __cplusplus
15
- namespace libyuv {
16
- extern "C" {
17
- #endif
18
-
19
- void TransposeWx8_C(const uint8_t* src,
20
- int src_stride,
21
- uint8_t* dst,
22
- int dst_stride,
23
- int width) {
24
- int i;
25
- for (i = 0; i < width; ++i) {
26
- dst[0] = src[0 * src_stride];
27
- dst[1] = src[1 * src_stride];
28
- dst[2] = src[2 * src_stride];
29
- dst[3] = src[3 * src_stride];
30
- dst[4] = src[4 * src_stride];
31
- dst[5] = src[5 * src_stride];
32
- dst[6] = src[6 * src_stride];
33
- dst[7] = src[7 * src_stride];
34
- ++src;
35
- dst += dst_stride;
36
- }
37
- }
38
-
39
- void TransposeWx16_C(const uint8_t* src,
40
- int src_stride,
41
- uint8_t* dst,
42
- int dst_stride,
43
- int width) {
44
- TransposeWx8_C(src, src_stride, dst, dst_stride, width);
45
- TransposeWx8_C((src + 8 * src_stride), src_stride, (dst + 8), dst_stride,
46
- width);
47
- }
48
-
49
- void TransposeUVWx8_C(const uint8_t* src,
50
- int src_stride,
51
- uint8_t* dst_a,
52
- int dst_stride_a,
53
- uint8_t* dst_b,
54
- int dst_stride_b,
55
- int width) {
56
- int i;
57
- for (i = 0; i < width; ++i) {
58
- dst_a[0] = src[0 * src_stride + 0];
59
- dst_b[0] = src[0 * src_stride + 1];
60
- dst_a[1] = src[1 * src_stride + 0];
61
- dst_b[1] = src[1 * src_stride + 1];
62
- dst_a[2] = src[2 * src_stride + 0];
63
- dst_b[2] = src[2 * src_stride + 1];
64
- dst_a[3] = src[3 * src_stride + 0];
65
- dst_b[3] = src[3 * src_stride + 1];
66
- dst_a[4] = src[4 * src_stride + 0];
67
- dst_b[4] = src[4 * src_stride + 1];
68
- dst_a[5] = src[5 * src_stride + 0];
69
- dst_b[5] = src[5 * src_stride + 1];
70
- dst_a[6] = src[6 * src_stride + 0];
71
- dst_b[6] = src[6 * src_stride + 1];
72
- dst_a[7] = src[7 * src_stride + 0];
73
- dst_b[7] = src[7 * src_stride + 1];
74
- src += 2;
75
- dst_a += dst_stride_a;
76
- dst_b += dst_stride_b;
77
- }
78
- }
79
-
80
- void TransposeWxH_C(const uint8_t* src,
81
- int src_stride,
82
- uint8_t* dst,
83
- int dst_stride,
84
- int width,
85
- int height) {
86
- int i;
87
- for (i = 0; i < width; ++i) {
88
- int j;
89
- for (j = 0; j < height; ++j) {
90
- dst[i * dst_stride + j] = src[j * src_stride + i];
91
- }
92
- }
93
- }
94
-
95
- void TransposeUVWxH_C(const uint8_t* src,
96
- int src_stride,
97
- uint8_t* dst_a,
98
- int dst_stride_a,
99
- uint8_t* dst_b,
100
- int dst_stride_b,
101
- int width,
102
- int height) {
103
- int i;
104
- for (i = 0; i < width * 2; i += 2) {
105
- int j;
106
- for (j = 0; j < height; ++j) {
107
- dst_a[((i >> 1) * dst_stride_a) + j] = src[i + (j * src_stride)];
108
- dst_b[((i >> 1) * dst_stride_b) + j] = src[i + (j * src_stride) + 1];
109
- }
110
- }
111
- }
112
-
113
- void TransposeWx8_16_C(const uint16_t* src,
114
- int src_stride,
115
- uint16_t* dst,
116
- int dst_stride,
117
- int width) {
118
- int i;
119
- for (i = 0; i < width; ++i) {
120
- dst[0] = src[0 * src_stride];
121
- dst[1] = src[1 * src_stride];
122
- dst[2] = src[2 * src_stride];
123
- dst[3] = src[3 * src_stride];
124
- dst[4] = src[4 * src_stride];
125
- dst[5] = src[5 * src_stride];
126
- dst[6] = src[6 * src_stride];
127
- dst[7] = src[7 * src_stride];
128
- ++src;
129
- dst += dst_stride;
130
- }
131
- }
132
-
133
- void TransposeWxH_16_C(const uint16_t* src,
134
- int src_stride,
135
- uint16_t* dst,
136
- int dst_stride,
137
- int width,
138
- int height) {
139
- int i;
140
- for (i = 0; i < width; ++i) {
141
- int j;
142
- for (j = 0; j < height; ++j) {
143
- dst[i * dst_stride + j] = src[j * src_stride + i];
144
- }
145
- }
146
- }
147
-
148
- // Transpose 32 bit values (ARGB)
149
- void Transpose4x4_32_C(const uint8_t* src,
150
- int src_stride,
151
- uint8_t* dst,
152
- int dst_stride,
153
- int width) {
154
- const uint8_t* src1 = src + src_stride;
155
- const uint8_t* src2 = src1 + src_stride;
156
- const uint8_t* src3 = src2 + src_stride;
157
- uint8_t* dst1 = dst + dst_stride;
158
- uint8_t* dst2 = dst1 + dst_stride;
159
- uint8_t* dst3 = dst2 + dst_stride;
160
- int i;
161
- for (i = 0; i < width; i += 4) {
162
- uint32_t p00 = ((uint32_t*)(src))[0];
163
- uint32_t p10 = ((uint32_t*)(src))[1];
164
- uint32_t p20 = ((uint32_t*)(src))[2];
165
- uint32_t p30 = ((uint32_t*)(src))[3];
166
- uint32_t p01 = ((uint32_t*)(src1))[0];
167
- uint32_t p11 = ((uint32_t*)(src1))[1];
168
- uint32_t p21 = ((uint32_t*)(src1))[2];
169
- uint32_t p31 = ((uint32_t*)(src1))[3];
170
- uint32_t p02 = ((uint32_t*)(src2))[0];
171
- uint32_t p12 = ((uint32_t*)(src2))[1];
172
- uint32_t p22 = ((uint32_t*)(src2))[2];
173
- uint32_t p32 = ((uint32_t*)(src2))[3];
174
- uint32_t p03 = ((uint32_t*)(src3))[0];
175
- uint32_t p13 = ((uint32_t*)(src3))[1];
176
- uint32_t p23 = ((uint32_t*)(src3))[2];
177
- uint32_t p33 = ((uint32_t*)(src3))[3];
178
- ((uint32_t*)(dst))[0] = p00;
179
- ((uint32_t*)(dst))[1] = p01;
180
- ((uint32_t*)(dst))[2] = p02;
181
- ((uint32_t*)(dst))[3] = p03;
182
- ((uint32_t*)(dst1))[0] = p10;
183
- ((uint32_t*)(dst1))[1] = p11;
184
- ((uint32_t*)(dst1))[2] = p12;
185
- ((uint32_t*)(dst1))[3] = p13;
186
- ((uint32_t*)(dst2))[0] = p20;
187
- ((uint32_t*)(dst2))[1] = p21;
188
- ((uint32_t*)(dst2))[2] = p22;
189
- ((uint32_t*)(dst2))[3] = p23;
190
- ((uint32_t*)(dst3))[0] = p30;
191
- ((uint32_t*)(dst3))[1] = p31;
192
- ((uint32_t*)(dst3))[2] = p32;
193
- ((uint32_t*)(dst3))[3] = p33;
194
- src += src_stride * 4; // advance 4 rows
195
- src1 += src_stride * 4;
196
- src2 += src_stride * 4;
197
- src3 += src_stride * 4;
198
- dst += 4 * 4; // advance 4 columns
199
- dst1 += 4 * 4;
200
- dst2 += 4 * 4;
201
- dst3 += 4 * 4;
202
- }
203
- }
204
-
205
- #ifdef __cplusplus
206
- } // extern "C"
207
- } // namespace libyuv
208
- #endif