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

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 (206) hide show
  1. package/README.md +442 -442
  2. package/android/.gradle/9.2.0/checksums/checksums.lock +0 -0
  3. package/android/.gradle/9.2.0/fileHashes/fileHashes.bin +0 -0
  4. package/android/.gradle/9.2.0/fileHashes/fileHashes.lock +0 -0
  5. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  6. package/android/.gradle/buildOutputCleanup/cache.properties +2 -2
  7. package/android/build/reports/problems/problems-report.html +659 -0
  8. package/android/build.gradle +12 -4
  9. package/android/src/main/cpp/CMakeLists.txt +101 -94
  10. package/android/src/main/cpp/libyuv/.clang-format +6 -6
  11. package/android/src/main/cpp/libyuv/.gn +40 -40
  12. package/android/src/main/cpp/libyuv/.vpython3 +410 -410
  13. package/android/src/main/cpp/libyuv/AUTHORS +7 -7
  14. package/android/src/main/cpp/libyuv/Android.bp +202 -202
  15. package/android/src/main/cpp/libyuv/Android.mk +106 -106
  16. package/android/src/main/cpp/libyuv/BUILD.gn +490 -490
  17. package/android/src/main/cpp/libyuv/CM_linux_packages.cmake +70 -70
  18. package/android/src/main/cpp/libyuv/CMakeLists.txt +259 -252
  19. package/android/src/main/cpp/libyuv/DEPS +935 -935
  20. package/android/src/main/cpp/libyuv/DIR_METADATA +3 -3
  21. package/android/src/main/cpp/libyuv/LICENSE +29 -29
  22. package/android/src/main/cpp/libyuv/OWNERS +11 -11
  23. package/android/src/main/cpp/libyuv/PATENTS +23 -23
  24. package/android/src/main/cpp/libyuv/PRESUBMIT.py +65 -65
  25. package/android/src/main/cpp/libyuv/README.chromium +11 -11
  26. package/android/src/main/cpp/libyuv/README.md +19 -19
  27. package/android/src/main/cpp/libyuv/build_overrides/build.gni +60 -60
  28. package/android/src/main/cpp/libyuv/build_overrides/gtest.gni +19 -19
  29. package/android/src/main/cpp/libyuv/build_overrides/partition_alloc.gni +17 -17
  30. package/android/src/main/cpp/libyuv/codereview.settings +5 -5
  31. package/android/src/main/cpp/libyuv/docs/deprecated_builds.md +409 -409
  32. package/android/src/main/cpp/libyuv/docs/environment_variables.md +64 -64
  33. package/android/src/main/cpp/libyuv/docs/feature_detection.md +108 -108
  34. package/android/src/main/cpp/libyuv/docs/filtering.md +196 -196
  35. package/android/src/main/cpp/libyuv/docs/formats.md +208 -208
  36. package/android/src/main/cpp/libyuv/docs/getting_started.md +296 -296
  37. package/android/src/main/cpp/libyuv/docs/rotation.md +107 -107
  38. package/android/src/main/cpp/libyuv/download_vs_toolchain.py +29 -29
  39. package/android/src/main/cpp/libyuv/include/libyuv/basic_types.h +68 -68
  40. package/android/src/main/cpp/libyuv/include/libyuv/compare.h +111 -111
  41. package/android/src/main/cpp/libyuv/include/libyuv/compare_row.h +112 -112
  42. package/android/src/main/cpp/libyuv/include/libyuv/convert.h +1117 -1117
  43. package/android/src/main/cpp/libyuv/include/libyuv/convert_argb.h +2335 -2335
  44. package/android/src/main/cpp/libyuv/include/libyuv/convert_from.h +203 -203
  45. package/android/src/main/cpp/libyuv/include/libyuv/convert_from_argb.h +394 -394
  46. package/android/src/main/cpp/libyuv/include/libyuv/cpu_id.h +147 -147
  47. package/android/src/main/cpp/libyuv/include/libyuv/cpu_support.h +99 -99
  48. package/android/src/main/cpp/libyuv/include/libyuv/loongson_intrinsics.h +1949 -1949
  49. package/android/src/main/cpp/libyuv/include/libyuv/mjpeg_decoder.h +195 -195
  50. package/android/src/main/cpp/libyuv/include/libyuv/planar_functions.h +1131 -1131
  51. package/android/src/main/cpp/libyuv/include/libyuv/rotate.h +296 -296
  52. package/android/src/main/cpp/libyuv/include/libyuv/rotate_argb.h +37 -37
  53. package/android/src/main/cpp/libyuv/include/libyuv/rotate_row.h +265 -265
  54. package/android/src/main/cpp/libyuv/include/libyuv/row.h +6738 -6738
  55. package/android/src/main/cpp/libyuv/include/libyuv/row_sve.h +2154 -2154
  56. package/android/src/main/cpp/libyuv/include/libyuv/scale.h +336 -336
  57. package/android/src/main/cpp/libyuv/include/libyuv/scale_argb.h +76 -76
  58. package/android/src/main/cpp/libyuv/include/libyuv/scale_rgb.h +42 -42
  59. package/android/src/main/cpp/libyuv/include/libyuv/scale_row.h +1726 -1726
  60. package/android/src/main/cpp/libyuv/include/libyuv/scale_uv.h +51 -51
  61. package/android/src/main/cpp/libyuv/include/libyuv/version.h +16 -16
  62. package/android/src/main/cpp/libyuv/include/libyuv/video_common.h +222 -222
  63. package/android/src/main/cpp/libyuv/include/libyuv.h +33 -33
  64. package/android/src/main/cpp/libyuv/infra/config/OWNERS +3 -3
  65. package/android/src/main/cpp/libyuv/infra/config/PRESUBMIT.py +17 -17
  66. package/android/src/main/cpp/libyuv/infra/config/README.md +2 -2
  67. package/android/src/main/cpp/libyuv/infra/config/codereview.settings +6 -6
  68. package/android/src/main/cpp/libyuv/infra/config/commit-queue.cfg +144 -144
  69. package/android/src/main/cpp/libyuv/infra/config/cr-buildbucket.cfg +1185 -1185
  70. package/android/src/main/cpp/libyuv/infra/config/luci-logdog.cfg +9 -9
  71. package/android/src/main/cpp/libyuv/infra/config/luci-milo.cfg +246 -246
  72. package/android/src/main/cpp/libyuv/infra/config/luci-scheduler.cfg +385 -385
  73. package/android/src/main/cpp/libyuv/infra/config/main.star +402 -402
  74. package/android/src/main/cpp/libyuv/infra/config/project.cfg +16 -16
  75. package/android/src/main/cpp/libyuv/infra/config/realms.cfg +111 -111
  76. package/android/src/main/cpp/libyuv/libyuv.gni +34 -34
  77. package/android/src/main/cpp/libyuv/libyuv.gyp +149 -149
  78. package/android/src/main/cpp/libyuv/libyuv.gypi +87 -87
  79. package/android/src/main/cpp/libyuv/linux.mk +96 -96
  80. package/android/src/main/cpp/libyuv/public.mk +13 -13
  81. package/android/src/main/cpp/libyuv/pylintrc +49 -49
  82. package/android/src/main/cpp/libyuv/riscv_script/prepare_toolchain_qemu.sh +74 -74
  83. package/android/src/main/cpp/libyuv/riscv_script/riscv-clang.cmake +56 -56
  84. package/android/src/main/cpp/libyuv/riscv_script/run_qemu.sh +15 -15
  85. package/android/src/main/cpp/libyuv/source/compare.cc +435 -435
  86. package/android/src/main/cpp/libyuv/source/compare_common.cc +74 -74
  87. package/android/src/main/cpp/libyuv/source/compare_gcc.cc +362 -362
  88. package/android/src/main/cpp/libyuv/source/compare_neon.cc +96 -96
  89. package/android/src/main/cpp/libyuv/source/compare_neon64.cc +223 -223
  90. package/android/src/main/cpp/libyuv/source/compare_win.cc +241 -241
  91. package/android/src/main/cpp/libyuv/source/convert.cc +4746 -4746
  92. package/android/src/main/cpp/libyuv/source/convert_argb.cc +9179 -9179
  93. package/android/src/main/cpp/libyuv/source/convert_from.cc +866 -866
  94. package/android/src/main/cpp/libyuv/source/convert_from_argb.cc +3671 -3671
  95. package/android/src/main/cpp/libyuv/source/convert_jpeg.cc +602 -602
  96. package/android/src/main/cpp/libyuv/source/convert_to_argb.cc +391 -391
  97. package/android/src/main/cpp/libyuv/source/convert_to_i420.cc +288 -288
  98. package/android/src/main/cpp/libyuv/source/cpu_id.cc +496 -496
  99. package/android/src/main/cpp/libyuv/source/mjpeg_decoder.cc +580 -580
  100. package/android/src/main/cpp/libyuv/source/mjpeg_validate.cc +71 -71
  101. package/android/src/main/cpp/libyuv/source/planar_functions.cc +5663 -5663
  102. package/android/src/main/cpp/libyuv/source/rotate.cc +1241 -1241
  103. package/android/src/main/cpp/libyuv/source/rotate_any.cc +76 -76
  104. package/android/src/main/cpp/libyuv/source/rotate_argb.cc +259 -259
  105. package/android/src/main/cpp/libyuv/source/rotate_common.cc +208 -208
  106. package/android/src/main/cpp/libyuv/source/rotate_gcc.cc +505 -505
  107. package/android/src/main/cpp/libyuv/source/rotate_lsx.cc +233 -233
  108. package/android/src/main/cpp/libyuv/source/rotate_neon.cc +219 -219
  109. package/android/src/main/cpp/libyuv/source/rotate_neon64.cc +273 -273
  110. package/android/src/main/cpp/libyuv/source/rotate_sme.cc +174 -174
  111. package/android/src/main/cpp/libyuv/source/rotate_win.cc +253 -253
  112. package/android/src/main/cpp/libyuv/source/row_any.cc +2519 -2519
  113. package/android/src/main/cpp/libyuv/source/row_common.cc +4461 -4461
  114. package/android/src/main/cpp/libyuv/source/row_gcc.cc +9570 -9570
  115. package/android/src/main/cpp/libyuv/source/row_lasx.cc +2343 -2343
  116. package/android/src/main/cpp/libyuv/source/row_lsx.cc +3030 -3030
  117. package/android/src/main/cpp/libyuv/source/row_neon.cc +4026 -4026
  118. package/android/src/main/cpp/libyuv/source/row_neon64.cc +5617 -5617
  119. package/android/src/main/cpp/libyuv/source/row_rvv.cc +2599 -2599
  120. package/android/src/main/cpp/libyuv/source/row_sme.cc +1183 -1183
  121. package/android/src/main/cpp/libyuv/source/row_sve.cc +1088 -1088
  122. package/android/src/main/cpp/libyuv/source/row_win.cc +6453 -6453
  123. package/android/src/main/cpp/libyuv/source/scale.cc +2710 -2710
  124. package/android/src/main/cpp/libyuv/source/scale_any.cc +991 -991
  125. package/android/src/main/cpp/libyuv/source/scale_argb.cc +1158 -1158
  126. package/android/src/main/cpp/libyuv/source/scale_common.cc +1977 -1977
  127. package/android/src/main/cpp/libyuv/source/scale_gcc.cc +2947 -2947
  128. package/android/src/main/cpp/libyuv/source/scale_lsx.cc +739 -739
  129. package/android/src/main/cpp/libyuv/source/scale_neon.cc +1449 -1449
  130. package/android/src/main/cpp/libyuv/source/scale_neon64.cc +1552 -1552
  131. package/android/src/main/cpp/libyuv/source/scale_rgb.cc +82 -82
  132. package/android/src/main/cpp/libyuv/source/scale_rvv.cc +1971 -1971
  133. package/android/src/main/cpp/libyuv/source/scale_sme.cc +555 -555
  134. package/android/src/main/cpp/libyuv/source/scale_uv.cc +1159 -1159
  135. package/android/src/main/cpp/libyuv/source/scale_win.cc +1392 -1392
  136. package/android/src/main/cpp/libyuv/source/test.sh +35 -35
  137. package/android/src/main/cpp/libyuv/source/video_common.cc +62 -62
  138. package/android/src/main/cpp/libyuv/tools_libyuv/OWNERS +4 -4
  139. package/android/src/main/cpp/libyuv/tools_libyuv/autoroller/roll_deps.py +931 -931
  140. package/android/src/main/cpp/libyuv/tools_libyuv/autoroller/unittests/roll_deps_test.py +164 -164
  141. package/android/src/main/cpp/libyuv/tools_libyuv/autoroller/unittests/testdata/DEPS +21 -21
  142. package/android/src/main/cpp/libyuv/tools_libyuv/autoroller/unittests/testdata/DEPS.chromium.new +13 -13
  143. package/android/src/main/cpp/libyuv/tools_libyuv/autoroller/unittests/testdata/DEPS.chromium.old +13 -13
  144. package/android/src/main/cpp/libyuv/tools_libyuv/get_landmines.py +38 -38
  145. package/android/src/main/cpp/libyuv/tools_libyuv/msan/OWNERS +3 -3
  146. package/android/src/main/cpp/libyuv/tools_libyuv/msan/blacklist.txt +9 -9
  147. package/android/src/main/cpp/libyuv/tools_libyuv/ubsan/OWNERS +3 -3
  148. package/android/src/main/cpp/libyuv/tools_libyuv/ubsan/blacklist.txt +15 -15
  149. package/android/src/main/cpp/libyuv/tools_libyuv/ubsan/vptr_blacklist.txt +25 -25
  150. package/android/src/main/cpp/libyuv/unit_test/basictypes_test.cc +43 -43
  151. package/android/src/main/cpp/libyuv/unit_test/color_test.cc +848 -848
  152. package/android/src/main/cpp/libyuv/unit_test/compare_test.cc +739 -739
  153. package/android/src/main/cpp/libyuv/unit_test/convert_argb_test.cc +2867 -2867
  154. package/android/src/main/cpp/libyuv/unit_test/convert_test.cc +2133 -2133
  155. package/android/src/main/cpp/libyuv/unit_test/cpu_test.cc +427 -427
  156. package/android/src/main/cpp/libyuv/unit_test/cpu_thread_test.cc +63 -63
  157. package/android/src/main/cpp/libyuv/unit_test/math_test.cc +160 -160
  158. package/android/src/main/cpp/libyuv/unit_test/planar_test.cc +4731 -4731
  159. package/android/src/main/cpp/libyuv/unit_test/rotate_argb_test.cc +334 -334
  160. package/android/src/main/cpp/libyuv/unit_test/rotate_test.cc +962 -962
  161. package/android/src/main/cpp/libyuv/unit_test/scale_argb_test.cc +590 -590
  162. package/android/src/main/cpp/libyuv/unit_test/scale_plane_test.cc +465 -465
  163. package/android/src/main/cpp/libyuv/unit_test/scale_rgb_test.cc +280 -280
  164. package/android/src/main/cpp/libyuv/unit_test/scale_test.cc +1135 -1135
  165. package/android/src/main/cpp/libyuv/unit_test/scale_uv_test.cc +249 -249
  166. package/android/src/main/cpp/libyuv/unit_test/testdata/arm_v7.txt +12 -12
  167. package/android/src/main/cpp/libyuv/unit_test/testdata/mips.txt +7 -7
  168. package/android/src/main/cpp/libyuv/unit_test/testdata/mips_loongson2k.txt +5 -5
  169. package/android/src/main/cpp/libyuv/unit_test/testdata/mips_loongson3.txt +10 -10
  170. package/android/src/main/cpp/libyuv/unit_test/testdata/mips_loongson_mmi.txt +7 -7
  171. package/android/src/main/cpp/libyuv/unit_test/testdata/riscv64.txt +3 -3
  172. package/android/src/main/cpp/libyuv/unit_test/testdata/riscv64_rvv.txt +3 -3
  173. package/android/src/main/cpp/libyuv/unit_test/testdata/riscv64_rvv_zvfh.txt +3 -3
  174. package/android/src/main/cpp/libyuv/unit_test/testdata/tegra3.txt +23 -23
  175. package/android/src/main/cpp/libyuv/unit_test/unit_test.cc +581 -581
  176. package/android/src/main/cpp/libyuv/unit_test/unit_test.h +232 -232
  177. package/android/src/main/cpp/libyuv/unit_test/video_common_test.cc +112 -112
  178. package/android/src/main/cpp/libyuv/util/Makefile +9 -9
  179. package/android/src/main/cpp/libyuv/util/color.cc +120 -120
  180. package/android/src/main/cpp/libyuv/util/compare.cc +67 -67
  181. package/android/src/main/cpp/libyuv/util/cpuid.c +211 -211
  182. package/android/src/main/cpp/libyuv/util/i444tonv12_eg.cc +27 -27
  183. package/android/src/main/cpp/libyuv/util/psnr.cc +291 -291
  184. package/android/src/main/cpp/libyuv/util/psnr.h +47 -47
  185. package/android/src/main/cpp/libyuv/util/psnr_main.cc +620 -620
  186. package/android/src/main/cpp/libyuv/util/ssim.cc +364 -364
  187. package/android/src/main/cpp/libyuv/util/ssim.h +38 -38
  188. package/android/src/main/cpp/libyuv/util/yuvconstants.c +114 -114
  189. package/android/src/main/cpp/libyuv/util/yuvconvert.cc +367 -367
  190. package/android/src/main/cpp/libyuv/winarm.mk +47 -47
  191. package/index.js +17 -1
  192. package/ios/FaceAntiSpoofFrameProcessor.swift +283 -0
  193. package/ios/FaceAntiSpoofJSI.h +12 -0
  194. package/ios/FaceAntiSpoofJSI.mm +92 -0
  195. package/ios/FaceAntiSpoofManager.swift +63 -0
  196. package/ios/FaceAntiSpoofModule.m +191 -0
  197. package/ios/FaceAntiSpoofPluginRegister.m +42 -0
  198. package/ios/models/FaceAntiSpoofing.tflite +0 -0
  199. package/ios/models/model_spec.json +16 -0
  200. package/package.json +87 -86
  201. package/.gitignore +0 -27
  202. package/android/.gradle/8.9/checksums/checksums.lock +0 -0
  203. package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
  204. package/android/.gradle/8.9/gc.properties +0 -0
  205. /package/android/.gradle/{8.9 → 9.2.0}/fileChanges/last-build.bin +0 -0
  206. /package/android/.gradle/{8.9/dependencies-accessors → 9.2.0}/gc.properties +0 -0
@@ -1,1117 +1,1117 @@
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_CONVERT_H_
12
- #define INCLUDE_LIBYUV_CONVERT_H_
13
-
14
- #include "libyuv/basic_types.h"
15
-
16
- #include "libyuv/rotate.h" // For enum RotationMode.
17
-
18
- // TODO(fbarchard): fix WebRTC source to include following libyuv headers:
19
- #include "libyuv/convert_argb.h" // For WebRTC I420ToARGB. b/620
20
- #include "libyuv/convert_from.h" // For WebRTC ConvertFromI420. b/620
21
- #include "libyuv/planar_functions.h" // For WebRTC I420Rect, CopyPlane. b/618
22
-
23
- #ifdef __cplusplus
24
- namespace libyuv {
25
- extern "C" {
26
- #endif
27
-
28
- // Convert I444 to I420.
29
- LIBYUV_API
30
- int I444ToI420(const uint8_t* src_y,
31
- int src_stride_y,
32
- const uint8_t* src_u,
33
- int src_stride_u,
34
- const uint8_t* src_v,
35
- int src_stride_v,
36
- uint8_t* dst_y,
37
- int dst_stride_y,
38
- uint8_t* dst_u,
39
- int dst_stride_u,
40
- uint8_t* dst_v,
41
- int dst_stride_v,
42
- int width,
43
- int height);
44
-
45
- // Convert I444 to NV12.
46
- LIBYUV_API
47
- int I444ToNV12(const uint8_t* src_y,
48
- int src_stride_y,
49
- const uint8_t* src_u,
50
- int src_stride_u,
51
- const uint8_t* src_v,
52
- int src_stride_v,
53
- uint8_t* dst_y,
54
- int dst_stride_y,
55
- uint8_t* dst_uv,
56
- int dst_stride_uv,
57
- int width,
58
- int height);
59
-
60
- // Convert I444 to NV21.
61
- LIBYUV_API
62
- int I444ToNV21(const uint8_t* src_y,
63
- int src_stride_y,
64
- const uint8_t* src_u,
65
- int src_stride_u,
66
- const uint8_t* src_v,
67
- int src_stride_v,
68
- uint8_t* dst_y,
69
- int dst_stride_y,
70
- uint8_t* dst_vu,
71
- int dst_stride_vu,
72
- int width,
73
- int height);
74
-
75
- // Convert I422 to I420.
76
- LIBYUV_API
77
- int I422ToI420(const uint8_t* src_y,
78
- int src_stride_y,
79
- const uint8_t* src_u,
80
- int src_stride_u,
81
- const uint8_t* src_v,
82
- int src_stride_v,
83
- uint8_t* dst_y,
84
- int dst_stride_y,
85
- uint8_t* dst_u,
86
- int dst_stride_u,
87
- uint8_t* dst_v,
88
- int dst_stride_v,
89
- int width,
90
- int height);
91
-
92
- // Convert I422 to I444.
93
- LIBYUV_API
94
- int I422ToI444(const uint8_t* src_y,
95
- int src_stride_y,
96
- const uint8_t* src_u,
97
- int src_stride_u,
98
- const uint8_t* src_v,
99
- int src_stride_v,
100
- uint8_t* dst_y,
101
- int dst_stride_y,
102
- uint8_t* dst_u,
103
- int dst_stride_u,
104
- uint8_t* dst_v,
105
- int dst_stride_v,
106
- int width,
107
- int height);
108
-
109
- // Convert I422 to I210.
110
- LIBYUV_API
111
- int I422ToI210(const uint8_t* src_y,
112
- int src_stride_y,
113
- const uint8_t* src_u,
114
- int src_stride_u,
115
- const uint8_t* src_v,
116
- int src_stride_v,
117
- uint16_t* dst_y,
118
- int dst_stride_y,
119
- uint16_t* dst_u,
120
- int dst_stride_u,
121
- uint16_t* dst_v,
122
- int dst_stride_v,
123
- int width,
124
- int height);
125
-
126
- // Convert MM21 to NV12.
127
- LIBYUV_API
128
- int MM21ToNV12(const uint8_t* src_y,
129
- int src_stride_y,
130
- const uint8_t* src_uv,
131
- int src_stride_uv,
132
- uint8_t* dst_y,
133
- int dst_stride_y,
134
- uint8_t* dst_uv,
135
- int dst_stride_uv,
136
- int width,
137
- int height);
138
-
139
- // Convert MM21 to I420.
140
- LIBYUV_API
141
- int MM21ToI420(const uint8_t* src_y,
142
- int src_stride_y,
143
- const uint8_t* src_uv,
144
- int src_stride_uv,
145
- uint8_t* dst_y,
146
- int dst_stride_y,
147
- uint8_t* dst_u,
148
- int dst_stride_u,
149
- uint8_t* dst_v,
150
- int dst_stride_v,
151
- int width,
152
- int height);
153
-
154
- // Convert MM21 to YUY2
155
- LIBYUV_API
156
- int MM21ToYUY2(const uint8_t* src_y,
157
- int src_stride_y,
158
- const uint8_t* src_uv,
159
- int src_stride_uv,
160
- uint8_t* dst_yuy2,
161
- int dst_stride_yuy2,
162
- int width,
163
- int height);
164
-
165
- // Convert MT2T to P010
166
- // Note that src_y and src_uv point to packed 10-bit values, so the Y plane will
167
- // be 10 / 8 times the dimensions of the image. Also for this reason,
168
- // src_stride_y and src_stride_uv are given in bytes.
169
- LIBYUV_API
170
- int MT2TToP010(const uint8_t* src_y,
171
- int src_stride_y,
172
- const uint8_t* src_uv,
173
- int src_stride_uv,
174
- uint16_t* dst_y,
175
- int dst_stride_y,
176
- uint16_t* dst_uv,
177
- int dst_stride_uv,
178
- int width,
179
- int height);
180
-
181
- // Convert I422 to NV21.
182
- LIBYUV_API
183
- int I422ToNV21(const uint8_t* src_y,
184
- int src_stride_y,
185
- const uint8_t* src_u,
186
- int src_stride_u,
187
- const uint8_t* src_v,
188
- int src_stride_v,
189
- uint8_t* dst_y,
190
- int dst_stride_y,
191
- uint8_t* dst_vu,
192
- int dst_stride_vu,
193
- int width,
194
- int height);
195
-
196
- // Copy I420 to I420.
197
- #define I420ToI420 I420Copy
198
- LIBYUV_API
199
- int I420Copy(const uint8_t* src_y,
200
- int src_stride_y,
201
- const uint8_t* src_u,
202
- int src_stride_u,
203
- const uint8_t* src_v,
204
- int src_stride_v,
205
- uint8_t* dst_y,
206
- int dst_stride_y,
207
- uint8_t* dst_u,
208
- int dst_stride_u,
209
- uint8_t* dst_v,
210
- int dst_stride_v,
211
- int width,
212
- int height);
213
-
214
- // Convert I420 to I444.
215
- LIBYUV_API
216
- int I420ToI444(const uint8_t* src_y,
217
- int src_stride_y,
218
- const uint8_t* src_u,
219
- int src_stride_u,
220
- const uint8_t* src_v,
221
- int src_stride_v,
222
- uint8_t* dst_y,
223
- int dst_stride_y,
224
- uint8_t* dst_u,
225
- int dst_stride_u,
226
- uint8_t* dst_v,
227
- int dst_stride_v,
228
- int width,
229
- int height);
230
-
231
- // Copy I010 to I010
232
- #define I010ToI010 I010Copy
233
- #define H010ToH010 I010Copy
234
- LIBYUV_API
235
- int I010Copy(const uint16_t* src_y,
236
- int src_stride_y,
237
- const uint16_t* src_u,
238
- int src_stride_u,
239
- const uint16_t* src_v,
240
- int src_stride_v,
241
- uint16_t* dst_y,
242
- int dst_stride_y,
243
- uint16_t* dst_u,
244
- int dst_stride_u,
245
- uint16_t* dst_v,
246
- int dst_stride_v,
247
- int width,
248
- int height);
249
-
250
- // Convert 10 bit YUV to 8 bit
251
- #define H010ToH420 I010ToI420
252
- LIBYUV_API
253
- int I010ToI420(const uint16_t* src_y,
254
- int src_stride_y,
255
- const uint16_t* src_u,
256
- int src_stride_u,
257
- const uint16_t* src_v,
258
- int src_stride_v,
259
- uint8_t* dst_y,
260
- int dst_stride_y,
261
- uint8_t* dst_u,
262
- int dst_stride_u,
263
- uint8_t* dst_v,
264
- int dst_stride_v,
265
- int width,
266
- int height);
267
-
268
- #define H210ToH420 I210ToI420
269
- LIBYUV_API
270
- int I210ToI420(const uint16_t* src_y,
271
- int src_stride_y,
272
- const uint16_t* src_u,
273
- int src_stride_u,
274
- const uint16_t* src_v,
275
- int src_stride_v,
276
- uint8_t* dst_y,
277
- int dst_stride_y,
278
- uint8_t* dst_u,
279
- int dst_stride_u,
280
- uint8_t* dst_v,
281
- int dst_stride_v,
282
- int width,
283
- int height);
284
-
285
- #define H210ToH422 I210ToI422
286
- LIBYUV_API
287
- int I210ToI422(const uint16_t* src_y,
288
- int src_stride_y,
289
- const uint16_t* src_u,
290
- int src_stride_u,
291
- const uint16_t* src_v,
292
- int src_stride_v,
293
- uint8_t* dst_y,
294
- int dst_stride_y,
295
- uint8_t* dst_u,
296
- int dst_stride_u,
297
- uint8_t* dst_v,
298
- int dst_stride_v,
299
- int width,
300
- int height);
301
-
302
- #define H410ToH420 I410ToI420
303
- LIBYUV_API
304
- int I410ToI420(const uint16_t* src_y,
305
- int src_stride_y,
306
- const uint16_t* src_u,
307
- int src_stride_u,
308
- const uint16_t* src_v,
309
- int src_stride_v,
310
- uint8_t* dst_y,
311
- int dst_stride_y,
312
- uint8_t* dst_u,
313
- int dst_stride_u,
314
- uint8_t* dst_v,
315
- int dst_stride_v,
316
- int width,
317
- int height);
318
-
319
- #define H410ToH444 I410ToI444
320
- LIBYUV_API
321
- int I410ToI444(const uint16_t* src_y,
322
- int src_stride_y,
323
- const uint16_t* src_u,
324
- int src_stride_u,
325
- const uint16_t* src_v,
326
- int src_stride_v,
327
- uint8_t* dst_y,
328
- int dst_stride_y,
329
- uint8_t* dst_u,
330
- int dst_stride_u,
331
- uint8_t* dst_v,
332
- int dst_stride_v,
333
- int width,
334
- int height);
335
-
336
- #define H012ToH420 I012ToI420
337
- LIBYUV_API
338
- int I012ToI420(const uint16_t* src_y,
339
- int src_stride_y,
340
- const uint16_t* src_u,
341
- int src_stride_u,
342
- const uint16_t* src_v,
343
- int src_stride_v,
344
- uint8_t* dst_y,
345
- int dst_stride_y,
346
- uint8_t* dst_u,
347
- int dst_stride_u,
348
- uint8_t* dst_v,
349
- int dst_stride_v,
350
- int width,
351
- int height);
352
-
353
- #define H212ToH422 I212ToI422
354
- LIBYUV_API
355
- int I212ToI422(const uint16_t* src_y,
356
- int src_stride_y,
357
- const uint16_t* src_u,
358
- int src_stride_u,
359
- const uint16_t* src_v,
360
- int src_stride_v,
361
- uint8_t* dst_y,
362
- int dst_stride_y,
363
- uint8_t* dst_u,
364
- int dst_stride_u,
365
- uint8_t* dst_v,
366
- int dst_stride_v,
367
- int width,
368
- int height);
369
-
370
- #define H212ToH420 I212ToI420
371
- LIBYUV_API
372
- int I212ToI420(const uint16_t* src_y,
373
- int src_stride_y,
374
- const uint16_t* src_u,
375
- int src_stride_u,
376
- const uint16_t* src_v,
377
- int src_stride_v,
378
- uint8_t* dst_y,
379
- int dst_stride_y,
380
- uint8_t* dst_u,
381
- int dst_stride_u,
382
- uint8_t* dst_v,
383
- int dst_stride_v,
384
- int width,
385
- int height);
386
-
387
- #define H412ToH444 I412ToI444
388
- LIBYUV_API
389
- int I412ToI444(const uint16_t* src_y,
390
- int src_stride_y,
391
- const uint16_t* src_u,
392
- int src_stride_u,
393
- const uint16_t* src_v,
394
- int src_stride_v,
395
- uint8_t* dst_y,
396
- int dst_stride_y,
397
- uint8_t* dst_u,
398
- int dst_stride_u,
399
- uint8_t* dst_v,
400
- int dst_stride_v,
401
- int width,
402
- int height);
403
-
404
- #define H412ToH420 I412ToI420
405
- LIBYUV_API
406
- int I412ToI420(const uint16_t* src_y,
407
- int src_stride_y,
408
- const uint16_t* src_u,
409
- int src_stride_u,
410
- const uint16_t* src_v,
411
- int src_stride_v,
412
- uint8_t* dst_y,
413
- int dst_stride_y,
414
- uint8_t* dst_u,
415
- int dst_stride_u,
416
- uint8_t* dst_v,
417
- int dst_stride_v,
418
- int width,
419
- int height);
420
-
421
- // Convert 10 bit P010 to 8 bit NV12.
422
- // dst_y can be NULL
423
- LIBYUV_API
424
- int P010ToNV12(const uint16_t* src_y,
425
- int src_stride_y,
426
- const uint16_t* src_uv,
427
- int src_stride_uv,
428
- uint8_t* dst_y,
429
- int dst_stride_y,
430
- uint8_t* dst_uv,
431
- int dst_stride_uv,
432
- int width,
433
- int height);
434
-
435
- #define I412ToI012 I410ToI010
436
- #define H410ToH010 I410ToI010
437
- #define H412ToH012 I410ToI010
438
- LIBYUV_API
439
- int I410ToI010(const uint16_t* src_y,
440
- int src_stride_y,
441
- const uint16_t* src_u,
442
- int src_stride_u,
443
- const uint16_t* src_v,
444
- int src_stride_v,
445
- uint16_t* dst_y,
446
- int dst_stride_y,
447
- uint16_t* dst_u,
448
- int dst_stride_u,
449
- uint16_t* dst_v,
450
- int dst_stride_v,
451
- int width,
452
- int height);
453
-
454
- #define I212ToI012 I210ToI010
455
- #define H210ToH010 I210ToI010
456
- #define H212ToH012 I210ToI010
457
- LIBYUV_API
458
- int I210ToI010(const uint16_t* src_y,
459
- int src_stride_y,
460
- const uint16_t* src_u,
461
- int src_stride_u,
462
- const uint16_t* src_v,
463
- int src_stride_v,
464
- uint16_t* dst_y,
465
- int dst_stride_y,
466
- uint16_t* dst_u,
467
- int dst_stride_u,
468
- uint16_t* dst_v,
469
- int dst_stride_v,
470
- int width,
471
- int height);
472
-
473
- // Convert I010 to I410
474
- LIBYUV_API
475
- int I010ToI410(const uint16_t* src_y,
476
- int src_stride_y,
477
- const uint16_t* src_u,
478
- int src_stride_u,
479
- const uint16_t* src_v,
480
- int src_stride_v,
481
- uint16_t* dst_y,
482
- int dst_stride_y,
483
- uint16_t* dst_u,
484
- int dst_stride_u,
485
- uint16_t* dst_v,
486
- int dst_stride_v,
487
- int width,
488
- int height);
489
-
490
- // Convert I012 to I412
491
- #define I012ToI412 I010ToI410
492
-
493
- // Convert I210 to I410
494
- LIBYUV_API
495
- int I210ToI410(const uint16_t* src_y,
496
- int src_stride_y,
497
- const uint16_t* src_u,
498
- int src_stride_u,
499
- const uint16_t* src_v,
500
- int src_stride_v,
501
- uint16_t* dst_y,
502
- int dst_stride_y,
503
- uint16_t* dst_u,
504
- int dst_stride_u,
505
- uint16_t* dst_v,
506
- int dst_stride_v,
507
- int width,
508
- int height);
509
-
510
- // Convert I212 to I412
511
- #define I212ToI412 I210ToI410
512
-
513
- // Convert I010 to P010
514
- LIBYUV_API
515
- int I010ToP010(const uint16_t* src_y,
516
- int src_stride_y,
517
- const uint16_t* src_u,
518
- int src_stride_u,
519
- const uint16_t* src_v,
520
- int src_stride_v,
521
- uint16_t* dst_y,
522
- int dst_stride_y,
523
- uint16_t* dst_uv,
524
- int dst_stride_uv,
525
- int width,
526
- int height);
527
-
528
- // Convert 10 bit YUV I010 to NV12
529
- LIBYUV_API
530
- int I010ToNV12(const uint16_t* src_y,
531
- int src_stride_y,
532
- const uint16_t* src_u,
533
- int src_stride_u,
534
- const uint16_t* src_v,
535
- int src_stride_v,
536
- uint8_t* dst_y,
537
- int dst_stride_y,
538
- uint8_t* dst_uv,
539
- int dst_stride_uv,
540
- int width,
541
- int height);
542
-
543
- // Convert I210 to P210
544
- LIBYUV_API
545
- int I210ToP210(const uint16_t* src_y,
546
- int src_stride_y,
547
- const uint16_t* src_u,
548
- int src_stride_u,
549
- const uint16_t* src_v,
550
- int src_stride_v,
551
- uint16_t* dst_y,
552
- int dst_stride_y,
553
- uint16_t* dst_uv,
554
- int dst_stride_uv,
555
- int width,
556
- int height);
557
-
558
- // Convert I012 to P012
559
- LIBYUV_API
560
- int I012ToP012(const uint16_t* src_y,
561
- int src_stride_y,
562
- const uint16_t* src_u,
563
- int src_stride_u,
564
- const uint16_t* src_v,
565
- int src_stride_v,
566
- uint16_t* dst_y,
567
- int dst_stride_y,
568
- uint16_t* dst_uv,
569
- int dst_stride_uv,
570
- int width,
571
- int height);
572
-
573
- // Convert I212 to P212
574
- LIBYUV_API
575
- int I212ToP212(const uint16_t* src_y,
576
- int src_stride_y,
577
- const uint16_t* src_u,
578
- int src_stride_u,
579
- const uint16_t* src_v,
580
- int src_stride_v,
581
- uint16_t* dst_y,
582
- int dst_stride_y,
583
- uint16_t* dst_uv,
584
- int dst_stride_uv,
585
- int width,
586
- int height);
587
-
588
- // Convert I400 (grey) to I420.
589
- LIBYUV_API
590
- int I400ToI420(const uint8_t* src_y,
591
- int src_stride_y,
592
- uint8_t* dst_y,
593
- int dst_stride_y,
594
- uint8_t* dst_u,
595
- int dst_stride_u,
596
- uint8_t* dst_v,
597
- int dst_stride_v,
598
- int width,
599
- int height);
600
-
601
- // Convert J420 to I420.
602
- LIBYUV_API
603
- int J420ToI420(const uint8_t* src_y,
604
- int src_stride_y,
605
- const uint8_t* src_u,
606
- int src_stride_u,
607
- const uint8_t* src_v,
608
- int src_stride_v,
609
- uint8_t* dst_y,
610
- int dst_stride_y,
611
- uint8_t* dst_u,
612
- int dst_stride_u,
613
- uint8_t* dst_v,
614
- int dst_stride_v,
615
- int width,
616
- int height);
617
-
618
- // Convert I400 (grey) to NV21.
619
- LIBYUV_API
620
- int I400ToNV21(const uint8_t* src_y,
621
- int src_stride_y,
622
- uint8_t* dst_y,
623
- int dst_stride_y,
624
- uint8_t* dst_vu,
625
- int dst_stride_vu,
626
- int width,
627
- int height);
628
-
629
- #define J400ToJ420 I400ToI420
630
-
631
- // Convert NV12 to I420.
632
- LIBYUV_API
633
- int NV12ToI420(const uint8_t* src_y,
634
- int src_stride_y,
635
- const uint8_t* src_uv,
636
- int src_stride_uv,
637
- uint8_t* dst_y,
638
- int dst_stride_y,
639
- uint8_t* dst_u,
640
- int dst_stride_u,
641
- uint8_t* dst_v,
642
- int dst_stride_v,
643
- int width,
644
- int height);
645
-
646
- // Convert NV21 to I420.
647
- LIBYUV_API
648
- int NV21ToI420(const uint8_t* src_y,
649
- int src_stride_y,
650
- const uint8_t* src_vu,
651
- int src_stride_vu,
652
- uint8_t* dst_y,
653
- int dst_stride_y,
654
- uint8_t* dst_u,
655
- int dst_stride_u,
656
- uint8_t* dst_v,
657
- int dst_stride_v,
658
- int width,
659
- int height);
660
-
661
- // Convert NV12 to NV24.
662
- LIBYUV_API
663
- int NV12ToNV24(const uint8_t* src_y,
664
- int src_stride_y,
665
- const uint8_t* src_uv,
666
- int src_stride_uv,
667
- uint8_t* dst_y,
668
- int dst_stride_y,
669
- uint8_t* dst_uv,
670
- int dst_stride_uv,
671
- int width,
672
- int height);
673
-
674
- // Convert NV16 to NV24.
675
- LIBYUV_API
676
- int NV16ToNV24(const uint8_t* src_y,
677
- int src_stride_y,
678
- const uint8_t* src_uv,
679
- int src_stride_uv,
680
- uint8_t* dst_y,
681
- int dst_stride_y,
682
- uint8_t* dst_uv,
683
- int dst_stride_uv,
684
- int width,
685
- int height);
686
-
687
- // Convert P010 to I010.
688
- LIBYUV_API
689
- int P010ToI010(const uint16_t* src_y,
690
- int src_stride_y,
691
- const uint16_t* src_uv,
692
- int src_stride_uv,
693
- uint16_t* dst_y,
694
- int dst_stride_y,
695
- uint16_t* dst_u,
696
- int dst_stride_u,
697
- uint16_t* dst_v,
698
- int dst_stride_v,
699
- int width,
700
- int height);
701
-
702
- // Convert P012 to I012.
703
- LIBYUV_API
704
- int P012ToI012(const uint16_t* src_y,
705
- int src_stride_y,
706
- const uint16_t* src_uv,
707
- int src_stride_uv,
708
- uint16_t* dst_y,
709
- int dst_stride_y,
710
- uint16_t* dst_u,
711
- int dst_stride_u,
712
- uint16_t* dst_v,
713
- int dst_stride_v,
714
- int width,
715
- int height);
716
-
717
- // Convert P010 to P410.
718
- LIBYUV_API
719
- int P010ToP410(const uint16_t* src_y,
720
- int src_stride_y,
721
- const uint16_t* src_uv,
722
- int src_stride_uv,
723
- uint16_t* dst_y,
724
- int dst_stride_y,
725
- uint16_t* dst_uv,
726
- int dst_stride_uv,
727
- int width,
728
- int height);
729
-
730
- // Convert P012 to P412.
731
- #define P012ToP412 P010ToP410
732
-
733
- // Convert P016 to P416.
734
- #define P016ToP416 P010ToP410
735
-
736
- // Convert P210 to P410.
737
- LIBYUV_API
738
- int P210ToP410(const uint16_t* src_y,
739
- int src_stride_y,
740
- const uint16_t* src_uv,
741
- int src_stride_uv,
742
- uint16_t* dst_y,
743
- int dst_stride_y,
744
- uint16_t* dst_uv,
745
- int dst_stride_uv,
746
- int width,
747
- int height);
748
-
749
- // Convert P212 to P412.
750
- #define P212ToP412 P210ToP410
751
-
752
- // Convert P216 to P416.
753
- #define P216ToP416 P210ToP410
754
-
755
- // Convert YUY2 to I420.
756
- LIBYUV_API
757
- int YUY2ToI420(const uint8_t* src_yuy2,
758
- int src_stride_yuy2,
759
- uint8_t* dst_y,
760
- int dst_stride_y,
761
- uint8_t* dst_u,
762
- int dst_stride_u,
763
- uint8_t* dst_v,
764
- int dst_stride_v,
765
- int width,
766
- int height);
767
-
768
- // Convert UYVY to I420.
769
- LIBYUV_API
770
- int UYVYToI420(const uint8_t* src_uyvy,
771
- int src_stride_uyvy,
772
- uint8_t* dst_y,
773
- int dst_stride_y,
774
- uint8_t* dst_u,
775
- int dst_stride_u,
776
- uint8_t* dst_v,
777
- int dst_stride_v,
778
- int width,
779
- int height);
780
-
781
- // Convert AYUV to NV12.
782
- LIBYUV_API
783
- int AYUVToNV12(const uint8_t* src_ayuv,
784
- int src_stride_ayuv,
785
- uint8_t* dst_y,
786
- int dst_stride_y,
787
- uint8_t* dst_uv,
788
- int dst_stride_uv,
789
- int width,
790
- int height);
791
-
792
- // Convert AYUV to NV21.
793
- LIBYUV_API
794
- int AYUVToNV21(const uint8_t* src_ayuv,
795
- int src_stride_ayuv,
796
- uint8_t* dst_y,
797
- int dst_stride_y,
798
- uint8_t* dst_vu,
799
- int dst_stride_vu,
800
- int width,
801
- int height);
802
-
803
- // Convert Android420 to I420.
804
- LIBYUV_API
805
- int Android420ToI420(const uint8_t* src_y,
806
- int src_stride_y,
807
- const uint8_t* src_u,
808
- int src_stride_u,
809
- const uint8_t* src_v,
810
- int src_stride_v,
811
- int src_pixel_stride_uv,
812
- uint8_t* dst_y,
813
- int dst_stride_y,
814
- uint8_t* dst_u,
815
- int dst_stride_u,
816
- uint8_t* dst_v,
817
- int dst_stride_v,
818
- int width,
819
- int height);
820
-
821
- // ARGB little endian (bgra in memory) to I420.
822
- LIBYUV_API
823
- int ARGBToI420(const uint8_t* src_argb,
824
- int src_stride_argb,
825
- uint8_t* dst_y,
826
- int dst_stride_y,
827
- uint8_t* dst_u,
828
- int dst_stride_u,
829
- uint8_t* dst_v,
830
- int dst_stride_v,
831
- int width,
832
- int height);
833
-
834
- // Convert ARGB to I420 with Alpha
835
- LIBYUV_API
836
- int ARGBToI420Alpha(const uint8_t* src_argb,
837
- int src_stride_argb,
838
- uint8_t* dst_y,
839
- int dst_stride_y,
840
- uint8_t* dst_u,
841
- int dst_stride_u,
842
- uint8_t* dst_v,
843
- int dst_stride_v,
844
- uint8_t* dst_a,
845
- int dst_stride_a,
846
- int width,
847
- int height);
848
-
849
- // BGRA little endian (argb in memory) to I420.
850
- LIBYUV_API
851
- int BGRAToI420(const uint8_t* src_bgra,
852
- int src_stride_bgra,
853
- uint8_t* dst_y,
854
- int dst_stride_y,
855
- uint8_t* dst_u,
856
- int dst_stride_u,
857
- uint8_t* dst_v,
858
- int dst_stride_v,
859
- int width,
860
- int height);
861
-
862
- // ABGR little endian (rgba in memory) to I420.
863
- LIBYUV_API
864
- int ABGRToI420(const uint8_t* src_abgr,
865
- int src_stride_abgr,
866
- uint8_t* dst_y,
867
- int dst_stride_y,
868
- uint8_t* dst_u,
869
- int dst_stride_u,
870
- uint8_t* dst_v,
871
- int dst_stride_v,
872
- int width,
873
- int height);
874
-
875
- // RGBA little endian (abgr in memory) to I420.
876
- LIBYUV_API
877
- int RGBAToI420(const uint8_t* src_rgba,
878
- int src_stride_rgba,
879
- uint8_t* dst_y,
880
- int dst_stride_y,
881
- uint8_t* dst_u,
882
- int dst_stride_u,
883
- uint8_t* dst_v,
884
- int dst_stride_v,
885
- int width,
886
- int height);
887
-
888
- // RGB little endian (bgr in memory) to I420.
889
- LIBYUV_API
890
- int RGB24ToI420(const uint8_t* src_rgb24,
891
- int src_stride_rgb24,
892
- uint8_t* dst_y,
893
- int dst_stride_y,
894
- uint8_t* dst_u,
895
- int dst_stride_u,
896
- uint8_t* dst_v,
897
- int dst_stride_v,
898
- int width,
899
- int height);
900
-
901
- // RGB little endian (bgr in memory) to J420.
902
- LIBYUV_API
903
- int RGB24ToJ420(const uint8_t* src_rgb24,
904
- int src_stride_rgb24,
905
- uint8_t* dst_y,
906
- int dst_stride_y,
907
- uint8_t* dst_u,
908
- int dst_stride_u,
909
- uint8_t* dst_v,
910
- int dst_stride_v,
911
- int width,
912
- int height);
913
-
914
- // RGB big endian (rgb in memory) to I420.
915
- LIBYUV_API
916
- int RAWToI420(const uint8_t* src_raw,
917
- int src_stride_raw,
918
- uint8_t* dst_y,
919
- int dst_stride_y,
920
- uint8_t* dst_u,
921
- int dst_stride_u,
922
- uint8_t* dst_v,
923
- int dst_stride_v,
924
- int width,
925
- int height);
926
-
927
- // RGB big endian (rgb in memory) to I444.
928
- LIBYUV_API
929
- int RAWToI444(const uint8_t* src_raw,
930
- int src_stride_raw,
931
- uint8_t* dst_y,
932
- int dst_stride_y,
933
- uint8_t* dst_u,
934
- int dst_stride_u,
935
- uint8_t* dst_v,
936
- int dst_stride_v,
937
- int width,
938
- int height);
939
-
940
- // RGB big endian (rgb in memory) to J420.
941
- LIBYUV_API
942
- int RAWToJ420(const uint8_t* src_raw,
943
- int src_stride_raw,
944
- uint8_t* dst_y,
945
- int dst_stride_y,
946
- uint8_t* dst_u,
947
- int dst_stride_u,
948
- uint8_t* dst_v,
949
- int dst_stride_v,
950
- int width,
951
- int height);
952
-
953
- // RGB big endian (rgb in memory) to J444.
954
- LIBYUV_API
955
- int RAWToJ444(const uint8_t* src_raw,
956
- int src_stride_raw,
957
- uint8_t* dst_y,
958
- int dst_stride_y,
959
- uint8_t* dst_u,
960
- int dst_stride_u,
961
- uint8_t* dst_v,
962
- int dst_stride_v,
963
- int width,
964
- int height);
965
-
966
- // RGB16 (RGBP fourcc) little endian to I420.
967
- LIBYUV_API
968
- int RGB565ToI420(const uint8_t* src_rgb565,
969
- int src_stride_rgb565,
970
- uint8_t* dst_y,
971
- int dst_stride_y,
972
- uint8_t* dst_u,
973
- int dst_stride_u,
974
- uint8_t* dst_v,
975
- int dst_stride_v,
976
- int width,
977
- int height);
978
-
979
- // RGB15 (RGBO fourcc) little endian to I420.
980
- LIBYUV_API
981
- int ARGB1555ToI420(const uint8_t* src_argb1555,
982
- int src_stride_argb1555,
983
- uint8_t* dst_y,
984
- int dst_stride_y,
985
- uint8_t* dst_u,
986
- int dst_stride_u,
987
- uint8_t* dst_v,
988
- int dst_stride_v,
989
- int width,
990
- int height);
991
-
992
- // RGB12 (R444 fourcc) little endian to I420.
993
- LIBYUV_API
994
- int ARGB4444ToI420(const uint8_t* src_argb4444,
995
- int src_stride_argb4444,
996
- uint8_t* dst_y,
997
- int dst_stride_y,
998
- uint8_t* dst_u,
999
- int dst_stride_u,
1000
- uint8_t* dst_v,
1001
- int dst_stride_v,
1002
- int width,
1003
- int height);
1004
-
1005
- // RGB little endian (bgr in memory) to J400.
1006
- LIBYUV_API
1007
- int RGB24ToJ400(const uint8_t* src_rgb24,
1008
- int src_stride_rgb24,
1009
- uint8_t* dst_yj,
1010
- int dst_stride_yj,
1011
- int width,
1012
- int height);
1013
-
1014
- // RGB big endian (rgb in memory) to J400.
1015
- LIBYUV_API
1016
- int RAWToJ400(const uint8_t* src_raw,
1017
- int src_stride_raw,
1018
- uint8_t* dst_yj,
1019
- int dst_stride_yj,
1020
- int width,
1021
- int height);
1022
-
1023
- // src_width/height provided by capture.
1024
- // dst_width/height for clipping determine final size.
1025
- LIBYUV_API
1026
- int MJPGToI420(const uint8_t* sample,
1027
- size_t sample_size,
1028
- uint8_t* dst_y,
1029
- int dst_stride_y,
1030
- uint8_t* dst_u,
1031
- int dst_stride_u,
1032
- uint8_t* dst_v,
1033
- int dst_stride_v,
1034
- int src_width,
1035
- int src_height,
1036
- int dst_width,
1037
- int dst_height);
1038
-
1039
- // JPEG to NV21
1040
- LIBYUV_API
1041
- int MJPGToNV21(const uint8_t* sample,
1042
- size_t sample_size,
1043
- uint8_t* dst_y,
1044
- int dst_stride_y,
1045
- uint8_t* dst_vu,
1046
- int dst_stride_vu,
1047
- int src_width,
1048
- int src_height,
1049
- int dst_width,
1050
- int dst_height);
1051
-
1052
- // JPEG to NV12
1053
- LIBYUV_API
1054
- int MJPGToNV12(const uint8_t* sample,
1055
- size_t sample_size,
1056
- uint8_t* dst_y,
1057
- int dst_stride_y,
1058
- uint8_t* dst_uv,
1059
- int dst_stride_uv,
1060
- int src_width,
1061
- int src_height,
1062
- int dst_width,
1063
- int dst_height);
1064
-
1065
- // Query size of MJPG in pixels.
1066
- LIBYUV_API
1067
- int MJPGSize(const uint8_t* sample,
1068
- size_t sample_size,
1069
- int* width,
1070
- int* height);
1071
-
1072
- // Convert camera sample to I420 with cropping, rotation and vertical flip.
1073
- // "src_size" is needed to parse MJPG.
1074
- // "dst_stride_y" number of bytes in a row of the dst_y plane.
1075
- // Normally this would be the same as dst_width, with recommended alignment
1076
- // to 16 bytes for better efficiency.
1077
- // If rotation of 90 or 270 is used, stride is affected. The caller should
1078
- // allocate the I420 buffer according to rotation.
1079
- // "dst_stride_u" number of bytes in a row of the dst_u plane.
1080
- // Normally this would be the same as (dst_width + 1) / 2, with
1081
- // recommended alignment to 16 bytes for better efficiency.
1082
- // If rotation of 90 or 270 is used, stride is affected.
1083
- // "crop_x" and "crop_y" are starting position for cropping.
1084
- // To center, crop_x = (src_width - dst_width) / 2
1085
- // crop_y = (src_height - dst_height) / 2
1086
- // "src_width" / "src_height" is size of src_frame in pixels.
1087
- // "src_height" can be negative indicating a vertically flipped image source.
1088
- // "crop_width" / "crop_height" is the size to crop the src to.
1089
- // Must be less than or equal to src_width/src_height
1090
- // Cropping parameters are pre-rotation.
1091
- // "rotation" can be 0, 90, 180 or 270.
1092
- // "fourcc" is a fourcc. ie 'I420', 'YUY2'
1093
- // Returns 0 for successful; -1 for invalid parameter. Non-zero for failure.
1094
- LIBYUV_API
1095
- int ConvertToI420(const uint8_t* sample,
1096
- size_t sample_size,
1097
- uint8_t* dst_y,
1098
- int dst_stride_y,
1099
- uint8_t* dst_u,
1100
- int dst_stride_u,
1101
- uint8_t* dst_v,
1102
- int dst_stride_v,
1103
- int crop_x,
1104
- int crop_y,
1105
- int src_width,
1106
- int src_height,
1107
- int crop_width,
1108
- int crop_height,
1109
- enum RotationMode rotation,
1110
- uint32_t fourcc);
1111
-
1112
- #ifdef __cplusplus
1113
- } // extern "C"
1114
- } // namespace libyuv
1115
- #endif
1116
-
1117
- #endif // INCLUDE_LIBYUV_CONVERT_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_CONVERT_H_
12
+ #define INCLUDE_LIBYUV_CONVERT_H_
13
+
14
+ #include "libyuv/basic_types.h"
15
+
16
+ #include "libyuv/rotate.h" // For enum RotationMode.
17
+
18
+ // TODO(fbarchard): fix WebRTC source to include following libyuv headers:
19
+ #include "libyuv/convert_argb.h" // For WebRTC I420ToARGB. b/620
20
+ #include "libyuv/convert_from.h" // For WebRTC ConvertFromI420. b/620
21
+ #include "libyuv/planar_functions.h" // For WebRTC I420Rect, CopyPlane. b/618
22
+
23
+ #ifdef __cplusplus
24
+ namespace libyuv {
25
+ extern "C" {
26
+ #endif
27
+
28
+ // Convert I444 to I420.
29
+ LIBYUV_API
30
+ int I444ToI420(const uint8_t* src_y,
31
+ int src_stride_y,
32
+ const uint8_t* src_u,
33
+ int src_stride_u,
34
+ const uint8_t* src_v,
35
+ int src_stride_v,
36
+ uint8_t* dst_y,
37
+ int dst_stride_y,
38
+ uint8_t* dst_u,
39
+ int dst_stride_u,
40
+ uint8_t* dst_v,
41
+ int dst_stride_v,
42
+ int width,
43
+ int height);
44
+
45
+ // Convert I444 to NV12.
46
+ LIBYUV_API
47
+ int I444ToNV12(const uint8_t* src_y,
48
+ int src_stride_y,
49
+ const uint8_t* src_u,
50
+ int src_stride_u,
51
+ const uint8_t* src_v,
52
+ int src_stride_v,
53
+ uint8_t* dst_y,
54
+ int dst_stride_y,
55
+ uint8_t* dst_uv,
56
+ int dst_stride_uv,
57
+ int width,
58
+ int height);
59
+
60
+ // Convert I444 to NV21.
61
+ LIBYUV_API
62
+ int I444ToNV21(const uint8_t* src_y,
63
+ int src_stride_y,
64
+ const uint8_t* src_u,
65
+ int src_stride_u,
66
+ const uint8_t* src_v,
67
+ int src_stride_v,
68
+ uint8_t* dst_y,
69
+ int dst_stride_y,
70
+ uint8_t* dst_vu,
71
+ int dst_stride_vu,
72
+ int width,
73
+ int height);
74
+
75
+ // Convert I422 to I420.
76
+ LIBYUV_API
77
+ int I422ToI420(const uint8_t* src_y,
78
+ int src_stride_y,
79
+ const uint8_t* src_u,
80
+ int src_stride_u,
81
+ const uint8_t* src_v,
82
+ int src_stride_v,
83
+ uint8_t* dst_y,
84
+ int dst_stride_y,
85
+ uint8_t* dst_u,
86
+ int dst_stride_u,
87
+ uint8_t* dst_v,
88
+ int dst_stride_v,
89
+ int width,
90
+ int height);
91
+
92
+ // Convert I422 to I444.
93
+ LIBYUV_API
94
+ int I422ToI444(const uint8_t* src_y,
95
+ int src_stride_y,
96
+ const uint8_t* src_u,
97
+ int src_stride_u,
98
+ const uint8_t* src_v,
99
+ int src_stride_v,
100
+ uint8_t* dst_y,
101
+ int dst_stride_y,
102
+ uint8_t* dst_u,
103
+ int dst_stride_u,
104
+ uint8_t* dst_v,
105
+ int dst_stride_v,
106
+ int width,
107
+ int height);
108
+
109
+ // Convert I422 to I210.
110
+ LIBYUV_API
111
+ int I422ToI210(const uint8_t* src_y,
112
+ int src_stride_y,
113
+ const uint8_t* src_u,
114
+ int src_stride_u,
115
+ const uint8_t* src_v,
116
+ int src_stride_v,
117
+ uint16_t* dst_y,
118
+ int dst_stride_y,
119
+ uint16_t* dst_u,
120
+ int dst_stride_u,
121
+ uint16_t* dst_v,
122
+ int dst_stride_v,
123
+ int width,
124
+ int height);
125
+
126
+ // Convert MM21 to NV12.
127
+ LIBYUV_API
128
+ int MM21ToNV12(const uint8_t* src_y,
129
+ int src_stride_y,
130
+ const uint8_t* src_uv,
131
+ int src_stride_uv,
132
+ uint8_t* dst_y,
133
+ int dst_stride_y,
134
+ uint8_t* dst_uv,
135
+ int dst_stride_uv,
136
+ int width,
137
+ int height);
138
+
139
+ // Convert MM21 to I420.
140
+ LIBYUV_API
141
+ int MM21ToI420(const uint8_t* src_y,
142
+ int src_stride_y,
143
+ const uint8_t* src_uv,
144
+ int src_stride_uv,
145
+ uint8_t* dst_y,
146
+ int dst_stride_y,
147
+ uint8_t* dst_u,
148
+ int dst_stride_u,
149
+ uint8_t* dst_v,
150
+ int dst_stride_v,
151
+ int width,
152
+ int height);
153
+
154
+ // Convert MM21 to YUY2
155
+ LIBYUV_API
156
+ int MM21ToYUY2(const uint8_t* src_y,
157
+ int src_stride_y,
158
+ const uint8_t* src_uv,
159
+ int src_stride_uv,
160
+ uint8_t* dst_yuy2,
161
+ int dst_stride_yuy2,
162
+ int width,
163
+ int height);
164
+
165
+ // Convert MT2T to P010
166
+ // Note that src_y and src_uv point to packed 10-bit values, so the Y plane will
167
+ // be 10 / 8 times the dimensions of the image. Also for this reason,
168
+ // src_stride_y and src_stride_uv are given in bytes.
169
+ LIBYUV_API
170
+ int MT2TToP010(const uint8_t* src_y,
171
+ int src_stride_y,
172
+ const uint8_t* src_uv,
173
+ int src_stride_uv,
174
+ uint16_t* dst_y,
175
+ int dst_stride_y,
176
+ uint16_t* dst_uv,
177
+ int dst_stride_uv,
178
+ int width,
179
+ int height);
180
+
181
+ // Convert I422 to NV21.
182
+ LIBYUV_API
183
+ int I422ToNV21(const uint8_t* src_y,
184
+ int src_stride_y,
185
+ const uint8_t* src_u,
186
+ int src_stride_u,
187
+ const uint8_t* src_v,
188
+ int src_stride_v,
189
+ uint8_t* dst_y,
190
+ int dst_stride_y,
191
+ uint8_t* dst_vu,
192
+ int dst_stride_vu,
193
+ int width,
194
+ int height);
195
+
196
+ // Copy I420 to I420.
197
+ #define I420ToI420 I420Copy
198
+ LIBYUV_API
199
+ int I420Copy(const uint8_t* src_y,
200
+ int src_stride_y,
201
+ const uint8_t* src_u,
202
+ int src_stride_u,
203
+ const uint8_t* src_v,
204
+ int src_stride_v,
205
+ uint8_t* dst_y,
206
+ int dst_stride_y,
207
+ uint8_t* dst_u,
208
+ int dst_stride_u,
209
+ uint8_t* dst_v,
210
+ int dst_stride_v,
211
+ int width,
212
+ int height);
213
+
214
+ // Convert I420 to I444.
215
+ LIBYUV_API
216
+ int I420ToI444(const uint8_t* src_y,
217
+ int src_stride_y,
218
+ const uint8_t* src_u,
219
+ int src_stride_u,
220
+ const uint8_t* src_v,
221
+ int src_stride_v,
222
+ uint8_t* dst_y,
223
+ int dst_stride_y,
224
+ uint8_t* dst_u,
225
+ int dst_stride_u,
226
+ uint8_t* dst_v,
227
+ int dst_stride_v,
228
+ int width,
229
+ int height);
230
+
231
+ // Copy I010 to I010
232
+ #define I010ToI010 I010Copy
233
+ #define H010ToH010 I010Copy
234
+ LIBYUV_API
235
+ int I010Copy(const uint16_t* src_y,
236
+ int src_stride_y,
237
+ const uint16_t* src_u,
238
+ int src_stride_u,
239
+ const uint16_t* src_v,
240
+ int src_stride_v,
241
+ uint16_t* dst_y,
242
+ int dst_stride_y,
243
+ uint16_t* dst_u,
244
+ int dst_stride_u,
245
+ uint16_t* dst_v,
246
+ int dst_stride_v,
247
+ int width,
248
+ int height);
249
+
250
+ // Convert 10 bit YUV to 8 bit
251
+ #define H010ToH420 I010ToI420
252
+ LIBYUV_API
253
+ int I010ToI420(const uint16_t* src_y,
254
+ int src_stride_y,
255
+ const uint16_t* src_u,
256
+ int src_stride_u,
257
+ const uint16_t* src_v,
258
+ int src_stride_v,
259
+ uint8_t* dst_y,
260
+ int dst_stride_y,
261
+ uint8_t* dst_u,
262
+ int dst_stride_u,
263
+ uint8_t* dst_v,
264
+ int dst_stride_v,
265
+ int width,
266
+ int height);
267
+
268
+ #define H210ToH420 I210ToI420
269
+ LIBYUV_API
270
+ int I210ToI420(const uint16_t* src_y,
271
+ int src_stride_y,
272
+ const uint16_t* src_u,
273
+ int src_stride_u,
274
+ const uint16_t* src_v,
275
+ int src_stride_v,
276
+ uint8_t* dst_y,
277
+ int dst_stride_y,
278
+ uint8_t* dst_u,
279
+ int dst_stride_u,
280
+ uint8_t* dst_v,
281
+ int dst_stride_v,
282
+ int width,
283
+ int height);
284
+
285
+ #define H210ToH422 I210ToI422
286
+ LIBYUV_API
287
+ int I210ToI422(const uint16_t* src_y,
288
+ int src_stride_y,
289
+ const uint16_t* src_u,
290
+ int src_stride_u,
291
+ const uint16_t* src_v,
292
+ int src_stride_v,
293
+ uint8_t* dst_y,
294
+ int dst_stride_y,
295
+ uint8_t* dst_u,
296
+ int dst_stride_u,
297
+ uint8_t* dst_v,
298
+ int dst_stride_v,
299
+ int width,
300
+ int height);
301
+
302
+ #define H410ToH420 I410ToI420
303
+ LIBYUV_API
304
+ int I410ToI420(const uint16_t* src_y,
305
+ int src_stride_y,
306
+ const uint16_t* src_u,
307
+ int src_stride_u,
308
+ const uint16_t* src_v,
309
+ int src_stride_v,
310
+ uint8_t* dst_y,
311
+ int dst_stride_y,
312
+ uint8_t* dst_u,
313
+ int dst_stride_u,
314
+ uint8_t* dst_v,
315
+ int dst_stride_v,
316
+ int width,
317
+ int height);
318
+
319
+ #define H410ToH444 I410ToI444
320
+ LIBYUV_API
321
+ int I410ToI444(const uint16_t* src_y,
322
+ int src_stride_y,
323
+ const uint16_t* src_u,
324
+ int src_stride_u,
325
+ const uint16_t* src_v,
326
+ int src_stride_v,
327
+ uint8_t* dst_y,
328
+ int dst_stride_y,
329
+ uint8_t* dst_u,
330
+ int dst_stride_u,
331
+ uint8_t* dst_v,
332
+ int dst_stride_v,
333
+ int width,
334
+ int height);
335
+
336
+ #define H012ToH420 I012ToI420
337
+ LIBYUV_API
338
+ int I012ToI420(const uint16_t* src_y,
339
+ int src_stride_y,
340
+ const uint16_t* src_u,
341
+ int src_stride_u,
342
+ const uint16_t* src_v,
343
+ int src_stride_v,
344
+ uint8_t* dst_y,
345
+ int dst_stride_y,
346
+ uint8_t* dst_u,
347
+ int dst_stride_u,
348
+ uint8_t* dst_v,
349
+ int dst_stride_v,
350
+ int width,
351
+ int height);
352
+
353
+ #define H212ToH422 I212ToI422
354
+ LIBYUV_API
355
+ int I212ToI422(const uint16_t* src_y,
356
+ int src_stride_y,
357
+ const uint16_t* src_u,
358
+ int src_stride_u,
359
+ const uint16_t* src_v,
360
+ int src_stride_v,
361
+ uint8_t* dst_y,
362
+ int dst_stride_y,
363
+ uint8_t* dst_u,
364
+ int dst_stride_u,
365
+ uint8_t* dst_v,
366
+ int dst_stride_v,
367
+ int width,
368
+ int height);
369
+
370
+ #define H212ToH420 I212ToI420
371
+ LIBYUV_API
372
+ int I212ToI420(const uint16_t* src_y,
373
+ int src_stride_y,
374
+ const uint16_t* src_u,
375
+ int src_stride_u,
376
+ const uint16_t* src_v,
377
+ int src_stride_v,
378
+ uint8_t* dst_y,
379
+ int dst_stride_y,
380
+ uint8_t* dst_u,
381
+ int dst_stride_u,
382
+ uint8_t* dst_v,
383
+ int dst_stride_v,
384
+ int width,
385
+ int height);
386
+
387
+ #define H412ToH444 I412ToI444
388
+ LIBYUV_API
389
+ int I412ToI444(const uint16_t* src_y,
390
+ int src_stride_y,
391
+ const uint16_t* src_u,
392
+ int src_stride_u,
393
+ const uint16_t* src_v,
394
+ int src_stride_v,
395
+ uint8_t* dst_y,
396
+ int dst_stride_y,
397
+ uint8_t* dst_u,
398
+ int dst_stride_u,
399
+ uint8_t* dst_v,
400
+ int dst_stride_v,
401
+ int width,
402
+ int height);
403
+
404
+ #define H412ToH420 I412ToI420
405
+ LIBYUV_API
406
+ int I412ToI420(const uint16_t* src_y,
407
+ int src_stride_y,
408
+ const uint16_t* src_u,
409
+ int src_stride_u,
410
+ const uint16_t* src_v,
411
+ int src_stride_v,
412
+ uint8_t* dst_y,
413
+ int dst_stride_y,
414
+ uint8_t* dst_u,
415
+ int dst_stride_u,
416
+ uint8_t* dst_v,
417
+ int dst_stride_v,
418
+ int width,
419
+ int height);
420
+
421
+ // Convert 10 bit P010 to 8 bit NV12.
422
+ // dst_y can be NULL
423
+ LIBYUV_API
424
+ int P010ToNV12(const uint16_t* src_y,
425
+ int src_stride_y,
426
+ const uint16_t* src_uv,
427
+ int src_stride_uv,
428
+ uint8_t* dst_y,
429
+ int dst_stride_y,
430
+ uint8_t* dst_uv,
431
+ int dst_stride_uv,
432
+ int width,
433
+ int height);
434
+
435
+ #define I412ToI012 I410ToI010
436
+ #define H410ToH010 I410ToI010
437
+ #define H412ToH012 I410ToI010
438
+ LIBYUV_API
439
+ int I410ToI010(const uint16_t* src_y,
440
+ int src_stride_y,
441
+ const uint16_t* src_u,
442
+ int src_stride_u,
443
+ const uint16_t* src_v,
444
+ int src_stride_v,
445
+ uint16_t* dst_y,
446
+ int dst_stride_y,
447
+ uint16_t* dst_u,
448
+ int dst_stride_u,
449
+ uint16_t* dst_v,
450
+ int dst_stride_v,
451
+ int width,
452
+ int height);
453
+
454
+ #define I212ToI012 I210ToI010
455
+ #define H210ToH010 I210ToI010
456
+ #define H212ToH012 I210ToI010
457
+ LIBYUV_API
458
+ int I210ToI010(const uint16_t* src_y,
459
+ int src_stride_y,
460
+ const uint16_t* src_u,
461
+ int src_stride_u,
462
+ const uint16_t* src_v,
463
+ int src_stride_v,
464
+ uint16_t* dst_y,
465
+ int dst_stride_y,
466
+ uint16_t* dst_u,
467
+ int dst_stride_u,
468
+ uint16_t* dst_v,
469
+ int dst_stride_v,
470
+ int width,
471
+ int height);
472
+
473
+ // Convert I010 to I410
474
+ LIBYUV_API
475
+ int I010ToI410(const uint16_t* src_y,
476
+ int src_stride_y,
477
+ const uint16_t* src_u,
478
+ int src_stride_u,
479
+ const uint16_t* src_v,
480
+ int src_stride_v,
481
+ uint16_t* dst_y,
482
+ int dst_stride_y,
483
+ uint16_t* dst_u,
484
+ int dst_stride_u,
485
+ uint16_t* dst_v,
486
+ int dst_stride_v,
487
+ int width,
488
+ int height);
489
+
490
+ // Convert I012 to I412
491
+ #define I012ToI412 I010ToI410
492
+
493
+ // Convert I210 to I410
494
+ LIBYUV_API
495
+ int I210ToI410(const uint16_t* src_y,
496
+ int src_stride_y,
497
+ const uint16_t* src_u,
498
+ int src_stride_u,
499
+ const uint16_t* src_v,
500
+ int src_stride_v,
501
+ uint16_t* dst_y,
502
+ int dst_stride_y,
503
+ uint16_t* dst_u,
504
+ int dst_stride_u,
505
+ uint16_t* dst_v,
506
+ int dst_stride_v,
507
+ int width,
508
+ int height);
509
+
510
+ // Convert I212 to I412
511
+ #define I212ToI412 I210ToI410
512
+
513
+ // Convert I010 to P010
514
+ LIBYUV_API
515
+ int I010ToP010(const uint16_t* src_y,
516
+ int src_stride_y,
517
+ const uint16_t* src_u,
518
+ int src_stride_u,
519
+ const uint16_t* src_v,
520
+ int src_stride_v,
521
+ uint16_t* dst_y,
522
+ int dst_stride_y,
523
+ uint16_t* dst_uv,
524
+ int dst_stride_uv,
525
+ int width,
526
+ int height);
527
+
528
+ // Convert 10 bit YUV I010 to NV12
529
+ LIBYUV_API
530
+ int I010ToNV12(const uint16_t* src_y,
531
+ int src_stride_y,
532
+ const uint16_t* src_u,
533
+ int src_stride_u,
534
+ const uint16_t* src_v,
535
+ int src_stride_v,
536
+ uint8_t* dst_y,
537
+ int dst_stride_y,
538
+ uint8_t* dst_uv,
539
+ int dst_stride_uv,
540
+ int width,
541
+ int height);
542
+
543
+ // Convert I210 to P210
544
+ LIBYUV_API
545
+ int I210ToP210(const uint16_t* src_y,
546
+ int src_stride_y,
547
+ const uint16_t* src_u,
548
+ int src_stride_u,
549
+ const uint16_t* src_v,
550
+ int src_stride_v,
551
+ uint16_t* dst_y,
552
+ int dst_stride_y,
553
+ uint16_t* dst_uv,
554
+ int dst_stride_uv,
555
+ int width,
556
+ int height);
557
+
558
+ // Convert I012 to P012
559
+ LIBYUV_API
560
+ int I012ToP012(const uint16_t* src_y,
561
+ int src_stride_y,
562
+ const uint16_t* src_u,
563
+ int src_stride_u,
564
+ const uint16_t* src_v,
565
+ int src_stride_v,
566
+ uint16_t* dst_y,
567
+ int dst_stride_y,
568
+ uint16_t* dst_uv,
569
+ int dst_stride_uv,
570
+ int width,
571
+ int height);
572
+
573
+ // Convert I212 to P212
574
+ LIBYUV_API
575
+ int I212ToP212(const uint16_t* src_y,
576
+ int src_stride_y,
577
+ const uint16_t* src_u,
578
+ int src_stride_u,
579
+ const uint16_t* src_v,
580
+ int src_stride_v,
581
+ uint16_t* dst_y,
582
+ int dst_stride_y,
583
+ uint16_t* dst_uv,
584
+ int dst_stride_uv,
585
+ int width,
586
+ int height);
587
+
588
+ // Convert I400 (grey) to I420.
589
+ LIBYUV_API
590
+ int I400ToI420(const uint8_t* src_y,
591
+ int src_stride_y,
592
+ uint8_t* dst_y,
593
+ int dst_stride_y,
594
+ uint8_t* dst_u,
595
+ int dst_stride_u,
596
+ uint8_t* dst_v,
597
+ int dst_stride_v,
598
+ int width,
599
+ int height);
600
+
601
+ // Convert J420 to I420.
602
+ LIBYUV_API
603
+ int J420ToI420(const uint8_t* src_y,
604
+ int src_stride_y,
605
+ const uint8_t* src_u,
606
+ int src_stride_u,
607
+ const uint8_t* src_v,
608
+ int src_stride_v,
609
+ uint8_t* dst_y,
610
+ int dst_stride_y,
611
+ uint8_t* dst_u,
612
+ int dst_stride_u,
613
+ uint8_t* dst_v,
614
+ int dst_stride_v,
615
+ int width,
616
+ int height);
617
+
618
+ // Convert I400 (grey) to NV21.
619
+ LIBYUV_API
620
+ int I400ToNV21(const uint8_t* src_y,
621
+ int src_stride_y,
622
+ uint8_t* dst_y,
623
+ int dst_stride_y,
624
+ uint8_t* dst_vu,
625
+ int dst_stride_vu,
626
+ int width,
627
+ int height);
628
+
629
+ #define J400ToJ420 I400ToI420
630
+
631
+ // Convert NV12 to I420.
632
+ LIBYUV_API
633
+ int NV12ToI420(const uint8_t* src_y,
634
+ int src_stride_y,
635
+ const uint8_t* src_uv,
636
+ int src_stride_uv,
637
+ uint8_t* dst_y,
638
+ int dst_stride_y,
639
+ uint8_t* dst_u,
640
+ int dst_stride_u,
641
+ uint8_t* dst_v,
642
+ int dst_stride_v,
643
+ int width,
644
+ int height);
645
+
646
+ // Convert NV21 to I420.
647
+ LIBYUV_API
648
+ int NV21ToI420(const uint8_t* src_y,
649
+ int src_stride_y,
650
+ const uint8_t* src_vu,
651
+ int src_stride_vu,
652
+ uint8_t* dst_y,
653
+ int dst_stride_y,
654
+ uint8_t* dst_u,
655
+ int dst_stride_u,
656
+ uint8_t* dst_v,
657
+ int dst_stride_v,
658
+ int width,
659
+ int height);
660
+
661
+ // Convert NV12 to NV24.
662
+ LIBYUV_API
663
+ int NV12ToNV24(const uint8_t* src_y,
664
+ int src_stride_y,
665
+ const uint8_t* src_uv,
666
+ int src_stride_uv,
667
+ uint8_t* dst_y,
668
+ int dst_stride_y,
669
+ uint8_t* dst_uv,
670
+ int dst_stride_uv,
671
+ int width,
672
+ int height);
673
+
674
+ // Convert NV16 to NV24.
675
+ LIBYUV_API
676
+ int NV16ToNV24(const uint8_t* src_y,
677
+ int src_stride_y,
678
+ const uint8_t* src_uv,
679
+ int src_stride_uv,
680
+ uint8_t* dst_y,
681
+ int dst_stride_y,
682
+ uint8_t* dst_uv,
683
+ int dst_stride_uv,
684
+ int width,
685
+ int height);
686
+
687
+ // Convert P010 to I010.
688
+ LIBYUV_API
689
+ int P010ToI010(const uint16_t* src_y,
690
+ int src_stride_y,
691
+ const uint16_t* src_uv,
692
+ int src_stride_uv,
693
+ uint16_t* dst_y,
694
+ int dst_stride_y,
695
+ uint16_t* dst_u,
696
+ int dst_stride_u,
697
+ uint16_t* dst_v,
698
+ int dst_stride_v,
699
+ int width,
700
+ int height);
701
+
702
+ // Convert P012 to I012.
703
+ LIBYUV_API
704
+ int P012ToI012(const uint16_t* src_y,
705
+ int src_stride_y,
706
+ const uint16_t* src_uv,
707
+ int src_stride_uv,
708
+ uint16_t* dst_y,
709
+ int dst_stride_y,
710
+ uint16_t* dst_u,
711
+ int dst_stride_u,
712
+ uint16_t* dst_v,
713
+ int dst_stride_v,
714
+ int width,
715
+ int height);
716
+
717
+ // Convert P010 to P410.
718
+ LIBYUV_API
719
+ int P010ToP410(const uint16_t* src_y,
720
+ int src_stride_y,
721
+ const uint16_t* src_uv,
722
+ int src_stride_uv,
723
+ uint16_t* dst_y,
724
+ int dst_stride_y,
725
+ uint16_t* dst_uv,
726
+ int dst_stride_uv,
727
+ int width,
728
+ int height);
729
+
730
+ // Convert P012 to P412.
731
+ #define P012ToP412 P010ToP410
732
+
733
+ // Convert P016 to P416.
734
+ #define P016ToP416 P010ToP410
735
+
736
+ // Convert P210 to P410.
737
+ LIBYUV_API
738
+ int P210ToP410(const uint16_t* src_y,
739
+ int src_stride_y,
740
+ const uint16_t* src_uv,
741
+ int src_stride_uv,
742
+ uint16_t* dst_y,
743
+ int dst_stride_y,
744
+ uint16_t* dst_uv,
745
+ int dst_stride_uv,
746
+ int width,
747
+ int height);
748
+
749
+ // Convert P212 to P412.
750
+ #define P212ToP412 P210ToP410
751
+
752
+ // Convert P216 to P416.
753
+ #define P216ToP416 P210ToP410
754
+
755
+ // Convert YUY2 to I420.
756
+ LIBYUV_API
757
+ int YUY2ToI420(const uint8_t* src_yuy2,
758
+ int src_stride_yuy2,
759
+ uint8_t* dst_y,
760
+ int dst_stride_y,
761
+ uint8_t* dst_u,
762
+ int dst_stride_u,
763
+ uint8_t* dst_v,
764
+ int dst_stride_v,
765
+ int width,
766
+ int height);
767
+
768
+ // Convert UYVY to I420.
769
+ LIBYUV_API
770
+ int UYVYToI420(const uint8_t* src_uyvy,
771
+ int src_stride_uyvy,
772
+ uint8_t* dst_y,
773
+ int dst_stride_y,
774
+ uint8_t* dst_u,
775
+ int dst_stride_u,
776
+ uint8_t* dst_v,
777
+ int dst_stride_v,
778
+ int width,
779
+ int height);
780
+
781
+ // Convert AYUV to NV12.
782
+ LIBYUV_API
783
+ int AYUVToNV12(const uint8_t* src_ayuv,
784
+ int src_stride_ayuv,
785
+ uint8_t* dst_y,
786
+ int dst_stride_y,
787
+ uint8_t* dst_uv,
788
+ int dst_stride_uv,
789
+ int width,
790
+ int height);
791
+
792
+ // Convert AYUV to NV21.
793
+ LIBYUV_API
794
+ int AYUVToNV21(const uint8_t* src_ayuv,
795
+ int src_stride_ayuv,
796
+ uint8_t* dst_y,
797
+ int dst_stride_y,
798
+ uint8_t* dst_vu,
799
+ int dst_stride_vu,
800
+ int width,
801
+ int height);
802
+
803
+ // Convert Android420 to I420.
804
+ LIBYUV_API
805
+ int Android420ToI420(const uint8_t* src_y,
806
+ int src_stride_y,
807
+ const uint8_t* src_u,
808
+ int src_stride_u,
809
+ const uint8_t* src_v,
810
+ int src_stride_v,
811
+ int src_pixel_stride_uv,
812
+ uint8_t* dst_y,
813
+ int dst_stride_y,
814
+ uint8_t* dst_u,
815
+ int dst_stride_u,
816
+ uint8_t* dst_v,
817
+ int dst_stride_v,
818
+ int width,
819
+ int height);
820
+
821
+ // ARGB little endian (bgra in memory) to I420.
822
+ LIBYUV_API
823
+ int ARGBToI420(const uint8_t* src_argb,
824
+ int src_stride_argb,
825
+ uint8_t* dst_y,
826
+ int dst_stride_y,
827
+ uint8_t* dst_u,
828
+ int dst_stride_u,
829
+ uint8_t* dst_v,
830
+ int dst_stride_v,
831
+ int width,
832
+ int height);
833
+
834
+ // Convert ARGB to I420 with Alpha
835
+ LIBYUV_API
836
+ int ARGBToI420Alpha(const uint8_t* src_argb,
837
+ int src_stride_argb,
838
+ uint8_t* dst_y,
839
+ int dst_stride_y,
840
+ uint8_t* dst_u,
841
+ int dst_stride_u,
842
+ uint8_t* dst_v,
843
+ int dst_stride_v,
844
+ uint8_t* dst_a,
845
+ int dst_stride_a,
846
+ int width,
847
+ int height);
848
+
849
+ // BGRA little endian (argb in memory) to I420.
850
+ LIBYUV_API
851
+ int BGRAToI420(const uint8_t* src_bgra,
852
+ int src_stride_bgra,
853
+ uint8_t* dst_y,
854
+ int dst_stride_y,
855
+ uint8_t* dst_u,
856
+ int dst_stride_u,
857
+ uint8_t* dst_v,
858
+ int dst_stride_v,
859
+ int width,
860
+ int height);
861
+
862
+ // ABGR little endian (rgba in memory) to I420.
863
+ LIBYUV_API
864
+ int ABGRToI420(const uint8_t* src_abgr,
865
+ int src_stride_abgr,
866
+ uint8_t* dst_y,
867
+ int dst_stride_y,
868
+ uint8_t* dst_u,
869
+ int dst_stride_u,
870
+ uint8_t* dst_v,
871
+ int dst_stride_v,
872
+ int width,
873
+ int height);
874
+
875
+ // RGBA little endian (abgr in memory) to I420.
876
+ LIBYUV_API
877
+ int RGBAToI420(const uint8_t* src_rgba,
878
+ int src_stride_rgba,
879
+ uint8_t* dst_y,
880
+ int dst_stride_y,
881
+ uint8_t* dst_u,
882
+ int dst_stride_u,
883
+ uint8_t* dst_v,
884
+ int dst_stride_v,
885
+ int width,
886
+ int height);
887
+
888
+ // RGB little endian (bgr in memory) to I420.
889
+ LIBYUV_API
890
+ int RGB24ToI420(const uint8_t* src_rgb24,
891
+ int src_stride_rgb24,
892
+ uint8_t* dst_y,
893
+ int dst_stride_y,
894
+ uint8_t* dst_u,
895
+ int dst_stride_u,
896
+ uint8_t* dst_v,
897
+ int dst_stride_v,
898
+ int width,
899
+ int height);
900
+
901
+ // RGB little endian (bgr in memory) to J420.
902
+ LIBYUV_API
903
+ int RGB24ToJ420(const uint8_t* src_rgb24,
904
+ int src_stride_rgb24,
905
+ uint8_t* dst_y,
906
+ int dst_stride_y,
907
+ uint8_t* dst_u,
908
+ int dst_stride_u,
909
+ uint8_t* dst_v,
910
+ int dst_stride_v,
911
+ int width,
912
+ int height);
913
+
914
+ // RGB big endian (rgb in memory) to I420.
915
+ LIBYUV_API
916
+ int RAWToI420(const uint8_t* src_raw,
917
+ int src_stride_raw,
918
+ uint8_t* dst_y,
919
+ int dst_stride_y,
920
+ uint8_t* dst_u,
921
+ int dst_stride_u,
922
+ uint8_t* dst_v,
923
+ int dst_stride_v,
924
+ int width,
925
+ int height);
926
+
927
+ // RGB big endian (rgb in memory) to I444.
928
+ LIBYUV_API
929
+ int RAWToI444(const uint8_t* src_raw,
930
+ int src_stride_raw,
931
+ uint8_t* dst_y,
932
+ int dst_stride_y,
933
+ uint8_t* dst_u,
934
+ int dst_stride_u,
935
+ uint8_t* dst_v,
936
+ int dst_stride_v,
937
+ int width,
938
+ int height);
939
+
940
+ // RGB big endian (rgb in memory) to J420.
941
+ LIBYUV_API
942
+ int RAWToJ420(const uint8_t* src_raw,
943
+ int src_stride_raw,
944
+ uint8_t* dst_y,
945
+ int dst_stride_y,
946
+ uint8_t* dst_u,
947
+ int dst_stride_u,
948
+ uint8_t* dst_v,
949
+ int dst_stride_v,
950
+ int width,
951
+ int height);
952
+
953
+ // RGB big endian (rgb in memory) to J444.
954
+ LIBYUV_API
955
+ int RAWToJ444(const uint8_t* src_raw,
956
+ int src_stride_raw,
957
+ uint8_t* dst_y,
958
+ int dst_stride_y,
959
+ uint8_t* dst_u,
960
+ int dst_stride_u,
961
+ uint8_t* dst_v,
962
+ int dst_stride_v,
963
+ int width,
964
+ int height);
965
+
966
+ // RGB16 (RGBP fourcc) little endian to I420.
967
+ LIBYUV_API
968
+ int RGB565ToI420(const uint8_t* src_rgb565,
969
+ int src_stride_rgb565,
970
+ uint8_t* dst_y,
971
+ int dst_stride_y,
972
+ uint8_t* dst_u,
973
+ int dst_stride_u,
974
+ uint8_t* dst_v,
975
+ int dst_stride_v,
976
+ int width,
977
+ int height);
978
+
979
+ // RGB15 (RGBO fourcc) little endian to I420.
980
+ LIBYUV_API
981
+ int ARGB1555ToI420(const uint8_t* src_argb1555,
982
+ int src_stride_argb1555,
983
+ uint8_t* dst_y,
984
+ int dst_stride_y,
985
+ uint8_t* dst_u,
986
+ int dst_stride_u,
987
+ uint8_t* dst_v,
988
+ int dst_stride_v,
989
+ int width,
990
+ int height);
991
+
992
+ // RGB12 (R444 fourcc) little endian to I420.
993
+ LIBYUV_API
994
+ int ARGB4444ToI420(const uint8_t* src_argb4444,
995
+ int src_stride_argb4444,
996
+ uint8_t* dst_y,
997
+ int dst_stride_y,
998
+ uint8_t* dst_u,
999
+ int dst_stride_u,
1000
+ uint8_t* dst_v,
1001
+ int dst_stride_v,
1002
+ int width,
1003
+ int height);
1004
+
1005
+ // RGB little endian (bgr in memory) to J400.
1006
+ LIBYUV_API
1007
+ int RGB24ToJ400(const uint8_t* src_rgb24,
1008
+ int src_stride_rgb24,
1009
+ uint8_t* dst_yj,
1010
+ int dst_stride_yj,
1011
+ int width,
1012
+ int height);
1013
+
1014
+ // RGB big endian (rgb in memory) to J400.
1015
+ LIBYUV_API
1016
+ int RAWToJ400(const uint8_t* src_raw,
1017
+ int src_stride_raw,
1018
+ uint8_t* dst_yj,
1019
+ int dst_stride_yj,
1020
+ int width,
1021
+ int height);
1022
+
1023
+ // src_width/height provided by capture.
1024
+ // dst_width/height for clipping determine final size.
1025
+ LIBYUV_API
1026
+ int MJPGToI420(const uint8_t* sample,
1027
+ size_t sample_size,
1028
+ uint8_t* dst_y,
1029
+ int dst_stride_y,
1030
+ uint8_t* dst_u,
1031
+ int dst_stride_u,
1032
+ uint8_t* dst_v,
1033
+ int dst_stride_v,
1034
+ int src_width,
1035
+ int src_height,
1036
+ int dst_width,
1037
+ int dst_height);
1038
+
1039
+ // JPEG to NV21
1040
+ LIBYUV_API
1041
+ int MJPGToNV21(const uint8_t* sample,
1042
+ size_t sample_size,
1043
+ uint8_t* dst_y,
1044
+ int dst_stride_y,
1045
+ uint8_t* dst_vu,
1046
+ int dst_stride_vu,
1047
+ int src_width,
1048
+ int src_height,
1049
+ int dst_width,
1050
+ int dst_height);
1051
+
1052
+ // JPEG to NV12
1053
+ LIBYUV_API
1054
+ int MJPGToNV12(const uint8_t* sample,
1055
+ size_t sample_size,
1056
+ uint8_t* dst_y,
1057
+ int dst_stride_y,
1058
+ uint8_t* dst_uv,
1059
+ int dst_stride_uv,
1060
+ int src_width,
1061
+ int src_height,
1062
+ int dst_width,
1063
+ int dst_height);
1064
+
1065
+ // Query size of MJPG in pixels.
1066
+ LIBYUV_API
1067
+ int MJPGSize(const uint8_t* sample,
1068
+ size_t sample_size,
1069
+ int* width,
1070
+ int* height);
1071
+
1072
+ // Convert camera sample to I420 with cropping, rotation and vertical flip.
1073
+ // "src_size" is needed to parse MJPG.
1074
+ // "dst_stride_y" number of bytes in a row of the dst_y plane.
1075
+ // Normally this would be the same as dst_width, with recommended alignment
1076
+ // to 16 bytes for better efficiency.
1077
+ // If rotation of 90 or 270 is used, stride is affected. The caller should
1078
+ // allocate the I420 buffer according to rotation.
1079
+ // "dst_stride_u" number of bytes in a row of the dst_u plane.
1080
+ // Normally this would be the same as (dst_width + 1) / 2, with
1081
+ // recommended alignment to 16 bytes for better efficiency.
1082
+ // If rotation of 90 or 270 is used, stride is affected.
1083
+ // "crop_x" and "crop_y" are starting position for cropping.
1084
+ // To center, crop_x = (src_width - dst_width) / 2
1085
+ // crop_y = (src_height - dst_height) / 2
1086
+ // "src_width" / "src_height" is size of src_frame in pixels.
1087
+ // "src_height" can be negative indicating a vertically flipped image source.
1088
+ // "crop_width" / "crop_height" is the size to crop the src to.
1089
+ // Must be less than or equal to src_width/src_height
1090
+ // Cropping parameters are pre-rotation.
1091
+ // "rotation" can be 0, 90, 180 or 270.
1092
+ // "fourcc" is a fourcc. ie 'I420', 'YUY2'
1093
+ // Returns 0 for successful; -1 for invalid parameter. Non-zero for failure.
1094
+ LIBYUV_API
1095
+ int ConvertToI420(const uint8_t* sample,
1096
+ size_t sample_size,
1097
+ uint8_t* dst_y,
1098
+ int dst_stride_y,
1099
+ uint8_t* dst_u,
1100
+ int dst_stride_u,
1101
+ uint8_t* dst_v,
1102
+ int dst_stride_v,
1103
+ int crop_x,
1104
+ int crop_y,
1105
+ int src_width,
1106
+ int src_height,
1107
+ int crop_width,
1108
+ int crop_height,
1109
+ enum RotationMode rotation,
1110
+ uint32_t fourcc);
1111
+
1112
+ #ifdef __cplusplus
1113
+ } // extern "C"
1114
+ } // namespace libyuv
1115
+ #endif
1116
+
1117
+ #endif // INCLUDE_LIBYUV_CONVERT_H_