react-native-vision-camera-spoof-detector 1.0.22 → 1.0.23

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 (193) hide show
  1. package/README.md +442 -442
  2. package/android/build.gradle +12 -4
  3. package/android/src/main/cpp/CMakeLists.txt +101 -94
  4. package/android/src/main/cpp/libyuv/.clang-format +6 -6
  5. package/android/src/main/cpp/libyuv/.gn +40 -40
  6. package/android/src/main/cpp/libyuv/.vpython3 +410 -410
  7. package/android/src/main/cpp/libyuv/AUTHORS +7 -7
  8. package/android/src/main/cpp/libyuv/Android.bp +202 -202
  9. package/android/src/main/cpp/libyuv/Android.mk +106 -106
  10. package/android/src/main/cpp/libyuv/BUILD.gn +490 -490
  11. package/android/src/main/cpp/libyuv/CM_linux_packages.cmake +70 -70
  12. package/android/src/main/cpp/libyuv/CMakeLists.txt +259 -252
  13. package/android/src/main/cpp/libyuv/DEPS +935 -935
  14. package/android/src/main/cpp/libyuv/DIR_METADATA +3 -3
  15. package/android/src/main/cpp/libyuv/LICENSE +29 -29
  16. package/android/src/main/cpp/libyuv/OWNERS +11 -11
  17. package/android/src/main/cpp/libyuv/PATENTS +23 -23
  18. package/android/src/main/cpp/libyuv/PRESUBMIT.py +65 -65
  19. package/android/src/main/cpp/libyuv/README.chromium +11 -11
  20. package/android/src/main/cpp/libyuv/README.md +19 -19
  21. package/android/src/main/cpp/libyuv/build_overrides/build.gni +60 -60
  22. package/android/src/main/cpp/libyuv/build_overrides/gtest.gni +19 -19
  23. package/android/src/main/cpp/libyuv/build_overrides/partition_alloc.gni +17 -17
  24. package/android/src/main/cpp/libyuv/codereview.settings +5 -5
  25. package/android/src/main/cpp/libyuv/docs/deprecated_builds.md +409 -409
  26. package/android/src/main/cpp/libyuv/docs/environment_variables.md +64 -64
  27. package/android/src/main/cpp/libyuv/docs/feature_detection.md +108 -108
  28. package/android/src/main/cpp/libyuv/docs/filtering.md +196 -196
  29. package/android/src/main/cpp/libyuv/docs/formats.md +208 -208
  30. package/android/src/main/cpp/libyuv/docs/getting_started.md +296 -296
  31. package/android/src/main/cpp/libyuv/docs/rotation.md +107 -107
  32. package/android/src/main/cpp/libyuv/download_vs_toolchain.py +29 -29
  33. package/android/src/main/cpp/libyuv/include/libyuv/basic_types.h +68 -68
  34. package/android/src/main/cpp/libyuv/include/libyuv/compare.h +111 -111
  35. package/android/src/main/cpp/libyuv/include/libyuv/compare_row.h +112 -112
  36. package/android/src/main/cpp/libyuv/include/libyuv/convert.h +1117 -1117
  37. package/android/src/main/cpp/libyuv/include/libyuv/convert_argb.h +2335 -2335
  38. package/android/src/main/cpp/libyuv/include/libyuv/convert_from.h +203 -203
  39. package/android/src/main/cpp/libyuv/include/libyuv/convert_from_argb.h +394 -394
  40. package/android/src/main/cpp/libyuv/include/libyuv/cpu_id.h +147 -147
  41. package/android/src/main/cpp/libyuv/include/libyuv/cpu_support.h +99 -99
  42. package/android/src/main/cpp/libyuv/include/libyuv/loongson_intrinsics.h +1949 -1949
  43. package/android/src/main/cpp/libyuv/include/libyuv/mjpeg_decoder.h +195 -195
  44. package/android/src/main/cpp/libyuv/include/libyuv/planar_functions.h +1131 -1131
  45. package/android/src/main/cpp/libyuv/include/libyuv/rotate.h +296 -296
  46. package/android/src/main/cpp/libyuv/include/libyuv/rotate_argb.h +37 -37
  47. package/android/src/main/cpp/libyuv/include/libyuv/rotate_row.h +265 -265
  48. package/android/src/main/cpp/libyuv/include/libyuv/row.h +6738 -6738
  49. package/android/src/main/cpp/libyuv/include/libyuv/row_sve.h +2154 -2154
  50. package/android/src/main/cpp/libyuv/include/libyuv/scale.h +336 -336
  51. package/android/src/main/cpp/libyuv/include/libyuv/scale_argb.h +76 -76
  52. package/android/src/main/cpp/libyuv/include/libyuv/scale_rgb.h +42 -42
  53. package/android/src/main/cpp/libyuv/include/libyuv/scale_row.h +1726 -1726
  54. package/android/src/main/cpp/libyuv/include/libyuv/scale_uv.h +51 -51
  55. package/android/src/main/cpp/libyuv/include/libyuv/version.h +16 -16
  56. package/android/src/main/cpp/libyuv/include/libyuv/video_common.h +222 -222
  57. package/android/src/main/cpp/libyuv/include/libyuv.h +33 -33
  58. package/android/src/main/cpp/libyuv/infra/config/OWNERS +3 -3
  59. package/android/src/main/cpp/libyuv/infra/config/PRESUBMIT.py +17 -17
  60. package/android/src/main/cpp/libyuv/infra/config/README.md +2 -2
  61. package/android/src/main/cpp/libyuv/infra/config/codereview.settings +6 -6
  62. package/android/src/main/cpp/libyuv/infra/config/commit-queue.cfg +144 -144
  63. package/android/src/main/cpp/libyuv/infra/config/cr-buildbucket.cfg +1185 -1185
  64. package/android/src/main/cpp/libyuv/infra/config/luci-logdog.cfg +9 -9
  65. package/android/src/main/cpp/libyuv/infra/config/luci-milo.cfg +246 -246
  66. package/android/src/main/cpp/libyuv/infra/config/luci-scheduler.cfg +385 -385
  67. package/android/src/main/cpp/libyuv/infra/config/main.star +402 -402
  68. package/android/src/main/cpp/libyuv/infra/config/project.cfg +16 -16
  69. package/android/src/main/cpp/libyuv/infra/config/realms.cfg +111 -111
  70. package/android/src/main/cpp/libyuv/libyuv.gni +34 -34
  71. package/android/src/main/cpp/libyuv/libyuv.gyp +149 -149
  72. package/android/src/main/cpp/libyuv/libyuv.gypi +87 -87
  73. package/android/src/main/cpp/libyuv/linux.mk +96 -96
  74. package/android/src/main/cpp/libyuv/public.mk +13 -13
  75. package/android/src/main/cpp/libyuv/pylintrc +49 -49
  76. package/android/src/main/cpp/libyuv/riscv_script/prepare_toolchain_qemu.sh +74 -74
  77. package/android/src/main/cpp/libyuv/riscv_script/riscv-clang.cmake +56 -56
  78. package/android/src/main/cpp/libyuv/riscv_script/run_qemu.sh +15 -15
  79. package/android/src/main/cpp/libyuv/source/compare.cc +435 -435
  80. package/android/src/main/cpp/libyuv/source/compare_common.cc +74 -74
  81. package/android/src/main/cpp/libyuv/source/compare_gcc.cc +362 -362
  82. package/android/src/main/cpp/libyuv/source/compare_neon.cc +96 -96
  83. package/android/src/main/cpp/libyuv/source/compare_neon64.cc +223 -223
  84. package/android/src/main/cpp/libyuv/source/compare_win.cc +241 -241
  85. package/android/src/main/cpp/libyuv/source/convert.cc +4746 -4746
  86. package/android/src/main/cpp/libyuv/source/convert_argb.cc +9179 -9179
  87. package/android/src/main/cpp/libyuv/source/convert_from.cc +866 -866
  88. package/android/src/main/cpp/libyuv/source/convert_from_argb.cc +3671 -3671
  89. package/android/src/main/cpp/libyuv/source/convert_jpeg.cc +602 -602
  90. package/android/src/main/cpp/libyuv/source/convert_to_argb.cc +391 -391
  91. package/android/src/main/cpp/libyuv/source/convert_to_i420.cc +288 -288
  92. package/android/src/main/cpp/libyuv/source/cpu_id.cc +496 -496
  93. package/android/src/main/cpp/libyuv/source/mjpeg_decoder.cc +580 -580
  94. package/android/src/main/cpp/libyuv/source/mjpeg_validate.cc +71 -71
  95. package/android/src/main/cpp/libyuv/source/planar_functions.cc +5663 -5663
  96. package/android/src/main/cpp/libyuv/source/rotate.cc +1241 -1241
  97. package/android/src/main/cpp/libyuv/source/rotate_any.cc +76 -76
  98. package/android/src/main/cpp/libyuv/source/rotate_argb.cc +259 -259
  99. package/android/src/main/cpp/libyuv/source/rotate_common.cc +208 -208
  100. package/android/src/main/cpp/libyuv/source/rotate_gcc.cc +505 -505
  101. package/android/src/main/cpp/libyuv/source/rotate_lsx.cc +233 -233
  102. package/android/src/main/cpp/libyuv/source/rotate_neon.cc +219 -219
  103. package/android/src/main/cpp/libyuv/source/rotate_neon64.cc +273 -273
  104. package/android/src/main/cpp/libyuv/source/rotate_sme.cc +174 -174
  105. package/android/src/main/cpp/libyuv/source/rotate_win.cc +253 -253
  106. package/android/src/main/cpp/libyuv/source/row_any.cc +2519 -2519
  107. package/android/src/main/cpp/libyuv/source/row_common.cc +4461 -4461
  108. package/android/src/main/cpp/libyuv/source/row_gcc.cc +9570 -9570
  109. package/android/src/main/cpp/libyuv/source/row_lasx.cc +2343 -2343
  110. package/android/src/main/cpp/libyuv/source/row_lsx.cc +3030 -3030
  111. package/android/src/main/cpp/libyuv/source/row_neon.cc +4026 -4026
  112. package/android/src/main/cpp/libyuv/source/row_neon64.cc +5617 -5617
  113. package/android/src/main/cpp/libyuv/source/row_rvv.cc +2599 -2599
  114. package/android/src/main/cpp/libyuv/source/row_sme.cc +1183 -1183
  115. package/android/src/main/cpp/libyuv/source/row_sve.cc +1088 -1088
  116. package/android/src/main/cpp/libyuv/source/row_win.cc +6453 -6453
  117. package/android/src/main/cpp/libyuv/source/scale.cc +2710 -2710
  118. package/android/src/main/cpp/libyuv/source/scale_any.cc +991 -991
  119. package/android/src/main/cpp/libyuv/source/scale_argb.cc +1158 -1158
  120. package/android/src/main/cpp/libyuv/source/scale_common.cc +1977 -1977
  121. package/android/src/main/cpp/libyuv/source/scale_gcc.cc +2947 -2947
  122. package/android/src/main/cpp/libyuv/source/scale_lsx.cc +739 -739
  123. package/android/src/main/cpp/libyuv/source/scale_neon.cc +1449 -1449
  124. package/android/src/main/cpp/libyuv/source/scale_neon64.cc +1552 -1552
  125. package/android/src/main/cpp/libyuv/source/scale_rgb.cc +82 -82
  126. package/android/src/main/cpp/libyuv/source/scale_rvv.cc +1971 -1971
  127. package/android/src/main/cpp/libyuv/source/scale_sme.cc +555 -555
  128. package/android/src/main/cpp/libyuv/source/scale_uv.cc +1159 -1159
  129. package/android/src/main/cpp/libyuv/source/scale_win.cc +1392 -1392
  130. package/android/src/main/cpp/libyuv/source/test.sh +35 -35
  131. package/android/src/main/cpp/libyuv/source/video_common.cc +62 -62
  132. package/android/src/main/cpp/libyuv/tools_libyuv/OWNERS +4 -4
  133. package/android/src/main/cpp/libyuv/tools_libyuv/autoroller/roll_deps.py +931 -931
  134. package/android/src/main/cpp/libyuv/tools_libyuv/autoroller/unittests/roll_deps_test.py +164 -164
  135. package/android/src/main/cpp/libyuv/tools_libyuv/autoroller/unittests/testdata/DEPS +21 -21
  136. package/android/src/main/cpp/libyuv/tools_libyuv/autoroller/unittests/testdata/DEPS.chromium.new +13 -13
  137. package/android/src/main/cpp/libyuv/tools_libyuv/autoroller/unittests/testdata/DEPS.chromium.old +13 -13
  138. package/android/src/main/cpp/libyuv/tools_libyuv/get_landmines.py +38 -38
  139. package/android/src/main/cpp/libyuv/tools_libyuv/msan/OWNERS +3 -3
  140. package/android/src/main/cpp/libyuv/tools_libyuv/msan/blacklist.txt +9 -9
  141. package/android/src/main/cpp/libyuv/tools_libyuv/ubsan/OWNERS +3 -3
  142. package/android/src/main/cpp/libyuv/tools_libyuv/ubsan/blacklist.txt +15 -15
  143. package/android/src/main/cpp/libyuv/tools_libyuv/ubsan/vptr_blacklist.txt +25 -25
  144. package/android/src/main/cpp/libyuv/unit_test/basictypes_test.cc +43 -43
  145. package/android/src/main/cpp/libyuv/unit_test/color_test.cc +848 -848
  146. package/android/src/main/cpp/libyuv/unit_test/compare_test.cc +739 -739
  147. package/android/src/main/cpp/libyuv/unit_test/convert_argb_test.cc +2867 -2867
  148. package/android/src/main/cpp/libyuv/unit_test/convert_test.cc +2133 -2133
  149. package/android/src/main/cpp/libyuv/unit_test/cpu_test.cc +427 -427
  150. package/android/src/main/cpp/libyuv/unit_test/cpu_thread_test.cc +63 -63
  151. package/android/src/main/cpp/libyuv/unit_test/math_test.cc +160 -160
  152. package/android/src/main/cpp/libyuv/unit_test/planar_test.cc +4731 -4731
  153. package/android/src/main/cpp/libyuv/unit_test/rotate_argb_test.cc +334 -334
  154. package/android/src/main/cpp/libyuv/unit_test/rotate_test.cc +962 -962
  155. package/android/src/main/cpp/libyuv/unit_test/scale_argb_test.cc +590 -590
  156. package/android/src/main/cpp/libyuv/unit_test/scale_plane_test.cc +465 -465
  157. package/android/src/main/cpp/libyuv/unit_test/scale_rgb_test.cc +280 -280
  158. package/android/src/main/cpp/libyuv/unit_test/scale_test.cc +1135 -1135
  159. package/android/src/main/cpp/libyuv/unit_test/scale_uv_test.cc +249 -249
  160. package/android/src/main/cpp/libyuv/unit_test/testdata/arm_v7.txt +12 -12
  161. package/android/src/main/cpp/libyuv/unit_test/testdata/mips.txt +7 -7
  162. package/android/src/main/cpp/libyuv/unit_test/testdata/mips_loongson2k.txt +5 -5
  163. package/android/src/main/cpp/libyuv/unit_test/testdata/mips_loongson3.txt +10 -10
  164. package/android/src/main/cpp/libyuv/unit_test/testdata/mips_loongson_mmi.txt +7 -7
  165. package/android/src/main/cpp/libyuv/unit_test/testdata/riscv64.txt +3 -3
  166. package/android/src/main/cpp/libyuv/unit_test/testdata/riscv64_rvv.txt +3 -3
  167. package/android/src/main/cpp/libyuv/unit_test/testdata/riscv64_rvv_zvfh.txt +3 -3
  168. package/android/src/main/cpp/libyuv/unit_test/testdata/tegra3.txt +23 -23
  169. package/android/src/main/cpp/libyuv/unit_test/unit_test.cc +581 -581
  170. package/android/src/main/cpp/libyuv/unit_test/unit_test.h +232 -232
  171. package/android/src/main/cpp/libyuv/unit_test/video_common_test.cc +112 -112
  172. package/android/src/main/cpp/libyuv/util/Makefile +9 -9
  173. package/android/src/main/cpp/libyuv/util/color.cc +120 -120
  174. package/android/src/main/cpp/libyuv/util/compare.cc +67 -67
  175. package/android/src/main/cpp/libyuv/util/cpuid.c +211 -211
  176. package/android/src/main/cpp/libyuv/util/i444tonv12_eg.cc +27 -27
  177. package/android/src/main/cpp/libyuv/util/psnr.cc +291 -291
  178. package/android/src/main/cpp/libyuv/util/psnr.h +47 -47
  179. package/android/src/main/cpp/libyuv/util/psnr_main.cc +620 -620
  180. package/android/src/main/cpp/libyuv/util/ssim.cc +364 -364
  181. package/android/src/main/cpp/libyuv/util/ssim.h +38 -38
  182. package/android/src/main/cpp/libyuv/util/yuvconstants.c +114 -114
  183. package/android/src/main/cpp/libyuv/util/yuvconvert.cc +367 -367
  184. package/android/src/main/cpp/libyuv/winarm.mk +47 -47
  185. package/package.json +86 -86
  186. package/android/.gradle/8.9/checksums/checksums.lock +0 -0
  187. package/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
  188. package/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
  189. package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
  190. package/android/.gradle/8.9/gc.properties +0 -0
  191. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  192. package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
  193. package/android/.gradle/vcs-1/gc.properties +0 -0
@@ -1,107 +1,107 @@
1
- # Introduction
2
-
3
- Rotation by multiplies of 90 degrees allows mobile devices to rotate webcams from landscape to portrait. The higher level functions ConvertToI420 and ConvertToARGB allow rotation of any format. Optimized functionality is supported for I420, ARGB, NV12 and NV21.
4
-
5
- # ConvertToI420
6
-
7
- int ConvertToI420(const uint8* src_frame, size_t src_size,
8
- uint8* dst_y, int dst_stride_y,
9
- uint8* dst_u, int dst_stride_u,
10
- uint8* dst_v, int dst_stride_v,
11
- int crop_x, int crop_y,
12
- int src_width, int src_height,
13
- int crop_width, int crop_height,
14
- enum RotationMode rotation,
15
- uint32 format);
16
-
17
- This function crops, converts, and rotates. You should think of it in that order.
18
- * Crops the original image, which is src_width x src_height, to crop_width x crop_height. At this point the image is still not rotated.
19
- * Converts the cropped region to I420. Supports inverted source for src_height negative.
20
- * Rotates by 90, 180 or 270 degrees.
21
- The buffer the caller provides should account for rotation. Be especially important to get stride of the destination correct.
22
-
23
- e.g.
24
- 640 x 480 NV12 captured<br>
25
- Crop to 640 x 360<br>
26
- Rotate by 90 degrees to 360 x 640.<br>
27
- Caller passes stride of 360 for Y and 360 / 2 for U and V.<br>
28
- Caller passes crop_width of 640, crop_height of 360.<br>
29
-
30
- # ConvertToARGB
31
-
32
- int ConvertToARGB(const uint8* src_frame, size_t src_size,
33
- uint8* dst_argb, int dst_stride_argb,
34
- int crop_x, int crop_y,
35
- int src_width, int src_height,
36
- int crop_width, int crop_height,
37
- enum RotationMode rotation,
38
- uint32 format);
39
-
40
- Same as I420, but implementation is less optimized - reads columns and writes rows, 16 bytes at a time.
41
-
42
- # I420Rotate
43
-
44
- int I420Rotate(const uint8* src_y, int src_stride_y,
45
- const uint8* src_u, int src_stride_u,
46
- const uint8* src_v, int src_stride_v,
47
- uint8* dst_y, int dst_stride_y,
48
- uint8* dst_u, int dst_stride_u,
49
- uint8* dst_v, int dst_stride_v,
50
- int src_width, int src_height, enum RotationMode mode);
51
-
52
- Destination is rotated, so pass dst_stride_y etc that consider rotation.<br>
53
- Rotate by 180 can be done in place, but 90 and 270 can not.
54
-
55
- Implementation (Neon/SSE2) uses 8 x 8 block transpose, so best efficiency is with sizes and pointers that are aligned to 8.
56
-
57
- Cropping can be achieved by adjusting the src_y/u/v pointers and src_width, src_height.
58
-
59
- Lower level plane functions are provided, allowing other planar formats to be rotated. (e.g. I444)
60
-
61
- For other planar YUV formats (I444, I422, I411, I400, NV16, NV24), the planar functions are exposed and can be called directly
62
-
63
-
64
- // Rotate a plane by 0, 90, 180, or 270.
65
- int RotatePlane(const uint8* src, int src_stride,
66
- uint8* dst, int dst_stride,
67
- int src_width, int src_height, enum RotationMode mode);
68
-
69
- # ARGBRotate
70
-
71
- LIBYUV_API
72
- int ARGBRotate(const uint8* src_argb, int src_stride_argb,
73
- uint8* dst_argb, int dst_stride_argb,
74
- int src_width, int src_height, enum RotationMode mode);
75
-
76
- Same as I420, but implementation is less optimized - reads columns and writes rows.
77
-
78
- Rotate by 90, or any angle, can be achieved using ARGBAffine.
79
-
80
- # Mirror - Horizontal Flip
81
-
82
- Mirror functions for horizontally flipping an image, which can be useful for 'self view' of a webcam.
83
-
84
- int I420Mirror(const uint8* src_y, int src_stride_y,
85
- const uint8* src_u, int src_stride_u,
86
- const uint8* src_v, int src_stride_v,
87
- uint8* dst_y, int dst_stride_y,
88
- uint8* dst_u, int dst_stride_u,
89
- uint8* dst_v, int dst_stride_v,
90
- int width, int height);
91
- int ARGBMirror(const uint8* src_argb, int src_stride_argb,
92
- uint8* dst_argb, int dst_stride_argb,
93
- int width, int height);
94
-
95
- Mirror functionality can also be achieved with the I420Scale and ARGBScale functions by passing negative width and/or height.
96
-
97
- # Invert - Vertical Flip
98
-
99
- Inverting can be achieved with almost any libyuv function by passing a negative source height.
100
-
101
- I420Mirror and ARGBMirror can also be used to rotate by 180 degrees by passing a negative height.
102
-
103
- # Cropping - Vertical Flip
104
-
105
- When cropping from a subsampled format like NV21, the method of setting the start pointers wont work for odd crop start y on the UV plane.
106
- If the height after cropping will be odd, invert the source - point to the last row, negate the strides, and pass negative height, which
107
- will re-invert the image as the conversion outputs.
1
+ # Introduction
2
+
3
+ Rotation by multiplies of 90 degrees allows mobile devices to rotate webcams from landscape to portrait. The higher level functions ConvertToI420 and ConvertToARGB allow rotation of any format. Optimized functionality is supported for I420, ARGB, NV12 and NV21.
4
+
5
+ # ConvertToI420
6
+
7
+ int ConvertToI420(const uint8* src_frame, size_t src_size,
8
+ uint8* dst_y, int dst_stride_y,
9
+ uint8* dst_u, int dst_stride_u,
10
+ uint8* dst_v, int dst_stride_v,
11
+ int crop_x, int crop_y,
12
+ int src_width, int src_height,
13
+ int crop_width, int crop_height,
14
+ enum RotationMode rotation,
15
+ uint32 format);
16
+
17
+ This function crops, converts, and rotates. You should think of it in that order.
18
+ * Crops the original image, which is src_width x src_height, to crop_width x crop_height. At this point the image is still not rotated.
19
+ * Converts the cropped region to I420. Supports inverted source for src_height negative.
20
+ * Rotates by 90, 180 or 270 degrees.
21
+ The buffer the caller provides should account for rotation. Be especially important to get stride of the destination correct.
22
+
23
+ e.g.
24
+ 640 x 480 NV12 captured<br>
25
+ Crop to 640 x 360<br>
26
+ Rotate by 90 degrees to 360 x 640.<br>
27
+ Caller passes stride of 360 for Y and 360 / 2 for U and V.<br>
28
+ Caller passes crop_width of 640, crop_height of 360.<br>
29
+
30
+ # ConvertToARGB
31
+
32
+ int ConvertToARGB(const uint8* src_frame, size_t src_size,
33
+ uint8* dst_argb, int dst_stride_argb,
34
+ int crop_x, int crop_y,
35
+ int src_width, int src_height,
36
+ int crop_width, int crop_height,
37
+ enum RotationMode rotation,
38
+ uint32 format);
39
+
40
+ Same as I420, but implementation is less optimized - reads columns and writes rows, 16 bytes at a time.
41
+
42
+ # I420Rotate
43
+
44
+ int I420Rotate(const uint8* src_y, int src_stride_y,
45
+ const uint8* src_u, int src_stride_u,
46
+ const uint8* src_v, int src_stride_v,
47
+ uint8* dst_y, int dst_stride_y,
48
+ uint8* dst_u, int dst_stride_u,
49
+ uint8* dst_v, int dst_stride_v,
50
+ int src_width, int src_height, enum RotationMode mode);
51
+
52
+ Destination is rotated, so pass dst_stride_y etc that consider rotation.<br>
53
+ Rotate by 180 can be done in place, but 90 and 270 can not.
54
+
55
+ Implementation (Neon/SSE2) uses 8 x 8 block transpose, so best efficiency is with sizes and pointers that are aligned to 8.
56
+
57
+ Cropping can be achieved by adjusting the src_y/u/v pointers and src_width, src_height.
58
+
59
+ Lower level plane functions are provided, allowing other planar formats to be rotated. (e.g. I444)
60
+
61
+ For other planar YUV formats (I444, I422, I411, I400, NV16, NV24), the planar functions are exposed and can be called directly
62
+
63
+
64
+ // Rotate a plane by 0, 90, 180, or 270.
65
+ int RotatePlane(const uint8* src, int src_stride,
66
+ uint8* dst, int dst_stride,
67
+ int src_width, int src_height, enum RotationMode mode);
68
+
69
+ # ARGBRotate
70
+
71
+ LIBYUV_API
72
+ int ARGBRotate(const uint8* src_argb, int src_stride_argb,
73
+ uint8* dst_argb, int dst_stride_argb,
74
+ int src_width, int src_height, enum RotationMode mode);
75
+
76
+ Same as I420, but implementation is less optimized - reads columns and writes rows.
77
+
78
+ Rotate by 90, or any angle, can be achieved using ARGBAffine.
79
+
80
+ # Mirror - Horizontal Flip
81
+
82
+ Mirror functions for horizontally flipping an image, which can be useful for 'self view' of a webcam.
83
+
84
+ int I420Mirror(const uint8* src_y, int src_stride_y,
85
+ const uint8* src_u, int src_stride_u,
86
+ const uint8* src_v, int src_stride_v,
87
+ uint8* dst_y, int dst_stride_y,
88
+ uint8* dst_u, int dst_stride_u,
89
+ uint8* dst_v, int dst_stride_v,
90
+ int width, int height);
91
+ int ARGBMirror(const uint8* src_argb, int src_stride_argb,
92
+ uint8* dst_argb, int dst_stride_argb,
93
+ int width, int height);
94
+
95
+ Mirror functionality can also be achieved with the I420Scale and ARGBScale functions by passing negative width and/or height.
96
+
97
+ # Invert - Vertical Flip
98
+
99
+ Inverting can be achieved with almost any libyuv function by passing a negative source height.
100
+
101
+ I420Mirror and ARGBMirror can also be used to rotate by 180 degrees by passing a negative height.
102
+
103
+ # Cropping - Vertical Flip
104
+
105
+ When cropping from a subsampled format like NV21, the method of setting the start pointers wont work for odd crop start y on the UV plane.
106
+ If the height after cropping will be odd, invert the source - point to the last row, negate the strides, and pass negative height, which
107
+ will re-invert the image as the conversion outputs.
@@ -1,29 +1,29 @@
1
- #!/usr/bin/env vpython3
2
-
3
- # Copyright 2014 The LibYuv Project Authors. All rights reserved.
4
- #
5
- # Use of this source code is governed by a BSD-style license
6
- # that can be found in the LICENSE file in the root of the source
7
- # tree. An additional intellectual property rights grant can be found
8
- # in the file PATENTS. All contributing project authors may
9
- # be found in the AUTHORS file in the root of the source tree.
10
-
11
- # This script is used to run the vs_toolchain.py script to download the
12
- # Visual Studio toolchain. It's just a temporary measure while waiting for the
13
- # Chrome team to move find_depot_tools into src/build to get rid of these
14
- # workarounds (similar one in gyp_libyuv).
15
-
16
- import os
17
- import sys
18
-
19
-
20
- checkout_root = os.path.dirname(os.path.realpath(__file__))
21
- sys.path.insert(0, os.path.join(checkout_root, 'build'))
22
- sys.path.insert(0, os.path.join(checkout_root, 'tools', 'find_depot_tools'))
23
-
24
-
25
- import vs_toolchain # pylint: disable=wrong-import-position
26
-
27
-
28
- if __name__ == '__main__':
29
- sys.exit(vs_toolchain.main())
1
+ #!/usr/bin/env vpython3
2
+
3
+ # Copyright 2014 The LibYuv Project Authors. All rights reserved.
4
+ #
5
+ # Use of this source code is governed by a BSD-style license
6
+ # that can be found in the LICENSE file in the root of the source
7
+ # tree. An additional intellectual property rights grant can be found
8
+ # in the file PATENTS. All contributing project authors may
9
+ # be found in the AUTHORS file in the root of the source tree.
10
+
11
+ # This script is used to run the vs_toolchain.py script to download the
12
+ # Visual Studio toolchain. It's just a temporary measure while waiting for the
13
+ # Chrome team to move find_depot_tools into src/build to get rid of these
14
+ # workarounds (similar one in gyp_libyuv).
15
+
16
+ import os
17
+ import sys
18
+
19
+
20
+ checkout_root = os.path.dirname(os.path.realpath(__file__))
21
+ sys.path.insert(0, os.path.join(checkout_root, 'build'))
22
+ sys.path.insert(0, os.path.join(checkout_root, 'tools', 'find_depot_tools'))
23
+
24
+
25
+ import vs_toolchain # pylint: disable=wrong-import-position
26
+
27
+
28
+ if __name__ == '__main__':
29
+ sys.exit(vs_toolchain.main())
@@ -1,68 +1,68 @@
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
- #ifndef INCLUDE_LIBYUV_BASIC_TYPES_H_
12
- #define INCLUDE_LIBYUV_BASIC_TYPES_H_
13
-
14
- #include <stddef.h> // For size_t and NULL
15
-
16
- #if !defined(INT_TYPES_DEFINED) && !defined(GG_LONGLONG)
17
- #define INT_TYPES_DEFINED
18
-
19
- #if defined(_MSC_VER) && (_MSC_VER < 1600)
20
- #include <sys/types.h> // for uintptr_t on x86
21
- typedef unsigned __int64 uint64_t;
22
- typedef __int64 int64_t;
23
- typedef unsigned int uint32_t;
24
- typedef int int32_t;
25
- typedef unsigned short uint16_t;
26
- typedef short int16_t;
27
- typedef unsigned char uint8_t;
28
- typedef signed char int8_t;
29
- #else
30
- #include <stdint.h> // for uintptr_t and C99 types
31
- #endif // defined(_MSC_VER) && (_MSC_VER < 1600)
32
- // Types are deprecated. Enable this macro for legacy types.
33
- #ifdef LIBYUV_LEGACY_TYPES
34
- typedef uint64_t uint64;
35
- typedef int64_t int64;
36
- typedef uint32_t uint32;
37
- typedef int32_t int32;
38
- typedef uint16_t uint16;
39
- typedef int16_t int16;
40
- typedef uint8_t uint8;
41
- typedef int8_t int8;
42
- #endif // LIBYUV_LEGACY_TYPES
43
- #endif // INT_TYPES_DEFINED
44
-
45
- #if !defined(LIBYUV_API)
46
- #if defined(_WIN32) || defined(__CYGWIN__)
47
- #if defined(LIBYUV_BUILDING_SHARED_LIBRARY)
48
- #define LIBYUV_API __declspec(dllexport)
49
- #elif defined(LIBYUV_USING_SHARED_LIBRARY)
50
- #define LIBYUV_API __declspec(dllimport)
51
- #else
52
- #define LIBYUV_API
53
- #endif // LIBYUV_BUILDING_SHARED_LIBRARY
54
- #elif defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__APPLE__) && \
55
- (defined(LIBYUV_BUILDING_SHARED_LIBRARY) || \
56
- defined(LIBYUV_USING_SHARED_LIBRARY))
57
- #define LIBYUV_API __attribute__((visibility("default")))
58
- #else
59
- #define LIBYUV_API
60
- #endif // __GNUC__
61
- #endif // LIBYUV_API
62
-
63
- // TODO(fbarchard): Remove bool macros.
64
- #define LIBYUV_BOOL int
65
- #define LIBYUV_FALSE 0
66
- #define LIBYUV_TRUE 1
67
-
68
- #endif // INCLUDE_LIBYUV_BASIC_TYPES_H_
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
+ #ifndef INCLUDE_LIBYUV_BASIC_TYPES_H_
12
+ #define INCLUDE_LIBYUV_BASIC_TYPES_H_
13
+
14
+ #include <stddef.h> // For size_t and NULL
15
+
16
+ #if !defined(INT_TYPES_DEFINED) && !defined(GG_LONGLONG)
17
+ #define INT_TYPES_DEFINED
18
+
19
+ #if defined(_MSC_VER) && (_MSC_VER < 1600)
20
+ #include <sys/types.h> // for uintptr_t on x86
21
+ typedef unsigned __int64 uint64_t;
22
+ typedef __int64 int64_t;
23
+ typedef unsigned int uint32_t;
24
+ typedef int int32_t;
25
+ typedef unsigned short uint16_t;
26
+ typedef short int16_t;
27
+ typedef unsigned char uint8_t;
28
+ typedef signed char int8_t;
29
+ #else
30
+ #include <stdint.h> // for uintptr_t and C99 types
31
+ #endif // defined(_MSC_VER) && (_MSC_VER < 1600)
32
+ // Types are deprecated. Enable this macro for legacy types.
33
+ #ifdef LIBYUV_LEGACY_TYPES
34
+ typedef uint64_t uint64;
35
+ typedef int64_t int64;
36
+ typedef uint32_t uint32;
37
+ typedef int32_t int32;
38
+ typedef uint16_t uint16;
39
+ typedef int16_t int16;
40
+ typedef uint8_t uint8;
41
+ typedef int8_t int8;
42
+ #endif // LIBYUV_LEGACY_TYPES
43
+ #endif // INT_TYPES_DEFINED
44
+
45
+ #if !defined(LIBYUV_API)
46
+ #if defined(_WIN32) || defined(__CYGWIN__)
47
+ #if defined(LIBYUV_BUILDING_SHARED_LIBRARY)
48
+ #define LIBYUV_API __declspec(dllexport)
49
+ #elif defined(LIBYUV_USING_SHARED_LIBRARY)
50
+ #define LIBYUV_API __declspec(dllimport)
51
+ #else
52
+ #define LIBYUV_API
53
+ #endif // LIBYUV_BUILDING_SHARED_LIBRARY
54
+ #elif defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__APPLE__) && \
55
+ (defined(LIBYUV_BUILDING_SHARED_LIBRARY) || \
56
+ defined(LIBYUV_USING_SHARED_LIBRARY))
57
+ #define LIBYUV_API __attribute__((visibility("default")))
58
+ #else
59
+ #define LIBYUV_API
60
+ #endif // __GNUC__
61
+ #endif // LIBYUV_API
62
+
63
+ // TODO(fbarchard): Remove bool macros.
64
+ #define LIBYUV_BOOL int
65
+ #define LIBYUV_FALSE 0
66
+ #define LIBYUV_TRUE 1
67
+
68
+ #endif // INCLUDE_LIBYUV_BASIC_TYPES_H_
@@ -1,111 +1,111 @@
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
- #ifndef INCLUDE_LIBYUV_COMPARE_H_
12
- #define INCLUDE_LIBYUV_COMPARE_H_
13
-
14
- #include "libyuv/basic_types.h"
15
-
16
- #ifdef __cplusplus
17
- namespace libyuv {
18
- extern "C" {
19
- #endif
20
-
21
- // Compute a hash for specified memory. Seed of 5381 recommended.
22
- LIBYUV_API
23
- uint32_t HashDjb2(const uint8_t* src, uint64_t count, uint32_t seed);
24
-
25
- // Hamming Distance
26
- LIBYUV_API
27
- uint64_t ComputeHammingDistance(const uint8_t* src_a,
28
- const uint8_t* src_b,
29
- int count);
30
-
31
- // Scan an opaque argb image and return fourcc based on alpha offset.
32
- // Returns FOURCC_ARGB, FOURCC_BGRA, or 0 if unknown.
33
- LIBYUV_API
34
- uint32_t ARGBDetect(const uint8_t* argb,
35
- int stride_argb,
36
- int width,
37
- int height);
38
-
39
- // Sum Square Error - used to compute Mean Square Error or PSNR.
40
- LIBYUV_API
41
- uint64_t ComputeSumSquareError(const uint8_t* src_a,
42
- const uint8_t* src_b,
43
- int count);
44
-
45
- LIBYUV_API
46
- uint64_t ComputeSumSquareErrorPlane(const uint8_t* src_a,
47
- int stride_a,
48
- const uint8_t* src_b,
49
- int stride_b,
50
- int width,
51
- int height);
52
-
53
- static const int kMaxPsnr = 128;
54
-
55
- LIBYUV_API
56
- double SumSquareErrorToPsnr(uint64_t sse, uint64_t count);
57
-
58
- LIBYUV_API
59
- double CalcFramePsnr(const uint8_t* src_a,
60
- int stride_a,
61
- const uint8_t* src_b,
62
- int stride_b,
63
- int width,
64
- int height);
65
-
66
- LIBYUV_API
67
- double I420Psnr(const uint8_t* src_y_a,
68
- int stride_y_a,
69
- const uint8_t* src_u_a,
70
- int stride_u_a,
71
- const uint8_t* src_v_a,
72
- int stride_v_a,
73
- const uint8_t* src_y_b,
74
- int stride_y_b,
75
- const uint8_t* src_u_b,
76
- int stride_u_b,
77
- const uint8_t* src_v_b,
78
- int stride_v_b,
79
- int width,
80
- int height);
81
-
82
- LIBYUV_API
83
- double CalcFrameSsim(const uint8_t* src_a,
84
- int stride_a,
85
- const uint8_t* src_b,
86
- int stride_b,
87
- int width,
88
- int height);
89
-
90
- LIBYUV_API
91
- double I420Ssim(const uint8_t* src_y_a,
92
- int stride_y_a,
93
- const uint8_t* src_u_a,
94
- int stride_u_a,
95
- const uint8_t* src_v_a,
96
- int stride_v_a,
97
- const uint8_t* src_y_b,
98
- int stride_y_b,
99
- const uint8_t* src_u_b,
100
- int stride_u_b,
101
- const uint8_t* src_v_b,
102
- int stride_v_b,
103
- int width,
104
- int height);
105
-
106
- #ifdef __cplusplus
107
- } // extern "C"
108
- } // namespace libyuv
109
- #endif
110
-
111
- #endif // INCLUDE_LIBYUV_COMPARE_H_
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
+ #ifndef INCLUDE_LIBYUV_COMPARE_H_
12
+ #define INCLUDE_LIBYUV_COMPARE_H_
13
+
14
+ #include "libyuv/basic_types.h"
15
+
16
+ #ifdef __cplusplus
17
+ namespace libyuv {
18
+ extern "C" {
19
+ #endif
20
+
21
+ // Compute a hash for specified memory. Seed of 5381 recommended.
22
+ LIBYUV_API
23
+ uint32_t HashDjb2(const uint8_t* src, uint64_t count, uint32_t seed);
24
+
25
+ // Hamming Distance
26
+ LIBYUV_API
27
+ uint64_t ComputeHammingDistance(const uint8_t* src_a,
28
+ const uint8_t* src_b,
29
+ int count);
30
+
31
+ // Scan an opaque argb image and return fourcc based on alpha offset.
32
+ // Returns FOURCC_ARGB, FOURCC_BGRA, or 0 if unknown.
33
+ LIBYUV_API
34
+ uint32_t ARGBDetect(const uint8_t* argb,
35
+ int stride_argb,
36
+ int width,
37
+ int height);
38
+
39
+ // Sum Square Error - used to compute Mean Square Error or PSNR.
40
+ LIBYUV_API
41
+ uint64_t ComputeSumSquareError(const uint8_t* src_a,
42
+ const uint8_t* src_b,
43
+ int count);
44
+
45
+ LIBYUV_API
46
+ uint64_t ComputeSumSquareErrorPlane(const uint8_t* src_a,
47
+ int stride_a,
48
+ const uint8_t* src_b,
49
+ int stride_b,
50
+ int width,
51
+ int height);
52
+
53
+ static const int kMaxPsnr = 128;
54
+
55
+ LIBYUV_API
56
+ double SumSquareErrorToPsnr(uint64_t sse, uint64_t count);
57
+
58
+ LIBYUV_API
59
+ double CalcFramePsnr(const uint8_t* src_a,
60
+ int stride_a,
61
+ const uint8_t* src_b,
62
+ int stride_b,
63
+ int width,
64
+ int height);
65
+
66
+ LIBYUV_API
67
+ double I420Psnr(const uint8_t* src_y_a,
68
+ int stride_y_a,
69
+ const uint8_t* src_u_a,
70
+ int stride_u_a,
71
+ const uint8_t* src_v_a,
72
+ int stride_v_a,
73
+ const uint8_t* src_y_b,
74
+ int stride_y_b,
75
+ const uint8_t* src_u_b,
76
+ int stride_u_b,
77
+ const uint8_t* src_v_b,
78
+ int stride_v_b,
79
+ int width,
80
+ int height);
81
+
82
+ LIBYUV_API
83
+ double CalcFrameSsim(const uint8_t* src_a,
84
+ int stride_a,
85
+ const uint8_t* src_b,
86
+ int stride_b,
87
+ int width,
88
+ int height);
89
+
90
+ LIBYUV_API
91
+ double I420Ssim(const uint8_t* src_y_a,
92
+ int stride_y_a,
93
+ const uint8_t* src_u_a,
94
+ int stride_u_a,
95
+ const uint8_t* src_v_a,
96
+ int stride_v_a,
97
+ const uint8_t* src_y_b,
98
+ int stride_y_b,
99
+ const uint8_t* src_u_b,
100
+ int stride_u_b,
101
+ const uint8_t* src_v_b,
102
+ int stride_v_b,
103
+ int width,
104
+ int height);
105
+
106
+ #ifdef __cplusplus
107
+ } // extern "C"
108
+ } // namespace libyuv
109
+ #endif
110
+
111
+ #endif // INCLUDE_LIBYUV_COMPARE_H_