react-native-vision-camera-spoof-detector 1.0.0

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 (857) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/README.md +220 -0
  3. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/.cmake/api/v1/query/client-agp/cache-v2 +0 -0
  4. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/.cmake/api/v1/query/client-agp/cmakeFiles-v1 +0 -0
  5. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/.cmake/api/v1/query/client-agp/codemodel-v2 +0 -0
  6. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/.cmake/api/v1/reply/cache-v2-701700ba4bb2215c1ccd.json +1599 -0
  7. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/.cmake/api/v1/reply/cmakeFiles-v1-9189be15e8b04df8f258.json +857 -0
  8. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/.cmake/api/v1/reply/codemodel-v2-073369af1c5eb367d160.json +185 -0
  9. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/.cmake/api/v1/reply/directory-.-Debug-d0094a50bb2071803777.json +14 -0
  10. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/.cmake/api/v1/reply/directory-libyuv-Debug-68bb497e958fc902f93a.json +100 -0
  11. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/.cmake/api/v1/reply/index-2025-11-18T09-41-06-0926.json +92 -0
  12. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/.cmake/api/v1/reply/target-cpuid-Debug-5af24d55c9649a4c3a3f.json +136 -0
  13. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/.cmake/api/v1/reply/target-faceantispoof-Debug-aa45fddb87a8ac2074bb.json +181 -0
  14. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/.cmake/api/v1/reply/target-fastyuv-Debug-4dd5b049ce28a8e070d1.json +182 -0
  15. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/.cmake/api/v1/reply/target-yuv-Debug-b8d5ee3e10a1f31a29fe.json +433 -0
  16. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/.cmake/api/v1/reply/target-yuv_common_objects-Debug-ae517204d04beeb2df23.json +522 -0
  17. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/.cmake/api/v1/reply/target-yuv_neon64-Debug-2ab157e6b75bcb340b03.json +137 -0
  18. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/.cmake/api/v1/reply/target-yuv_shared-Debug-2aecda61b70017f775b5.json +455 -0
  19. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/.cmake/api/v1/reply/target-yuv_sme-Debug-73d1e6cc8ef043b4e243.json +126 -0
  20. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/.cmake/api/v1/reply/target-yuv_sve-Debug-9d95a17080a7480f85a6.json +104 -0
  21. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/.cmake/api/v1/reply/target-yuvconstants-Debug-31b06c1ed2b225cf2443.json +136 -0
  22. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/.cmake/api/v1/reply/target-yuvconvert-Debug-2231dac0a591237abb04.json +157 -0
  23. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/.ninja_deps +0 -0
  24. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/.ninja_log +63 -0
  25. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/CMakeCache.txt +465 -0
  26. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/CMakeFiles/3.22.1-g37088a8-dirty/CMakeCCompiler.cmake +72 -0
  27. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/CMakeFiles/3.22.1-g37088a8-dirty/CMakeCXXCompiler.cmake +83 -0
  28. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/CMakeFiles/3.22.1-g37088a8-dirty/CMakeDetermineCompilerABI_C.bin +0 -0
  29. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/CMakeFiles/3.22.1-g37088a8-dirty/CMakeDetermineCompilerABI_CXX.bin +0 -0
  30. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/CMakeFiles/3.22.1-g37088a8-dirty/CMakeSystem.cmake +15 -0
  31. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/CMakeFiles/3.22.1-g37088a8-dirty/CompilerIdC/CMakeCCompilerId.c +803 -0
  32. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/CMakeFiles/3.22.1-g37088a8-dirty/CompilerIdC/CMakeCCompilerId.o +0 -0
  33. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/CMakeFiles/3.22.1-g37088a8-dirty/CompilerIdCXX/CMakeCXXCompilerId.cpp +791 -0
  34. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/CMakeFiles/3.22.1-g37088a8-dirty/CompilerIdCXX/CMakeCXXCompilerId.o +0 -0
  35. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/CMakeFiles/CMakeOutput.log +276 -0
  36. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/CMakeFiles/TargetDirectories.txt +27 -0
  37. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/CMakeFiles/cmake.check_cache +1 -0
  38. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/CMakeFiles/faceantispoof.dir/48ddb531beec5c42d2f7a5f3aa0b5968/ReactCommon/jsi/jsi/jsi.cpp.o +0 -0
  39. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/CMakeFiles/faceantispoof.dir/FaceAntiSpoofJSI.cpp.o +0 -0
  40. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/CMakeFiles/fastyuv.dir/FastYuvJni.cpp.o +0 -0
  41. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/CMakeFiles/fastyuv.dir/fast_yuv.cpp.o +0 -0
  42. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/CMakeFiles/rules.ninja +198 -0
  43. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/CPackConfig.cmake +71 -0
  44. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/CPackSourceConfig.cmake +79 -0
  45. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/additional_project_files.txt +48 -0
  46. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/android_gradle_build.json +106 -0
  47. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/android_gradle_build_mini.json +87 -0
  48. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/build.ninja +1071 -0
  49. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/build_file_index.txt +3 -0
  50. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/cmake_install.cmake +59 -0
  51. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/compile_commands.json +277 -0
  52. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/compile_commands.json.bin +0 -0
  53. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/configure_fingerprint.bin +29 -0
  54. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/cpuid.dir/util/cpuid.c.o +0 -0
  55. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/yuv_common_objects.dir/source/compare.cc.o +0 -0
  56. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/yuv_common_objects.dir/source/compare_common.cc.o +0 -0
  57. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/yuv_common_objects.dir/source/compare_gcc.cc.o +0 -0
  58. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/yuv_common_objects.dir/source/compare_win.cc.o +0 -0
  59. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/yuv_common_objects.dir/source/convert.cc.o +0 -0
  60. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/yuv_common_objects.dir/source/convert_argb.cc.o +0 -0
  61. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/yuv_common_objects.dir/source/convert_from.cc.o +0 -0
  62. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/yuv_common_objects.dir/source/convert_from_argb.cc.o +0 -0
  63. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/yuv_common_objects.dir/source/convert_jpeg.cc.o +0 -0
  64. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/yuv_common_objects.dir/source/convert_to_argb.cc.o +0 -0
  65. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/yuv_common_objects.dir/source/convert_to_i420.cc.o +0 -0
  66. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/yuv_common_objects.dir/source/cpu_id.cc.o +0 -0
  67. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/yuv_common_objects.dir/source/mjpeg_decoder.cc.o +0 -0
  68. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/yuv_common_objects.dir/source/mjpeg_validate.cc.o +0 -0
  69. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/yuv_common_objects.dir/source/planar_functions.cc.o +0 -0
  70. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/yuv_common_objects.dir/source/rotate.cc.o +0 -0
  71. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/yuv_common_objects.dir/source/rotate_any.cc.o +0 -0
  72. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/yuv_common_objects.dir/source/rotate_argb.cc.o +0 -0
  73. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/yuv_common_objects.dir/source/rotate_common.cc.o +0 -0
  74. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/yuv_common_objects.dir/source/rotate_gcc.cc.o +0 -0
  75. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/yuv_common_objects.dir/source/rotate_lsx.cc.o +0 -0
  76. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/yuv_common_objects.dir/source/rotate_win.cc.o +0 -0
  77. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/yuv_common_objects.dir/source/row_any.cc.o +0 -0
  78. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/yuv_common_objects.dir/source/row_common.cc.o +0 -0
  79. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/yuv_common_objects.dir/source/row_gcc.cc.o +0 -0
  80. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/yuv_common_objects.dir/source/row_lasx.cc.o +0 -0
  81. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/yuv_common_objects.dir/source/row_lsx.cc.o +0 -0
  82. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/yuv_common_objects.dir/source/row_rvv.cc.o +0 -0
  83. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/yuv_common_objects.dir/source/row_win.cc.o +0 -0
  84. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/yuv_common_objects.dir/source/scale.cc.o +0 -0
  85. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/yuv_common_objects.dir/source/scale_any.cc.o +0 -0
  86. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/yuv_common_objects.dir/source/scale_argb.cc.o +0 -0
  87. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/yuv_common_objects.dir/source/scale_common.cc.o +0 -0
  88. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/yuv_common_objects.dir/source/scale_gcc.cc.o +0 -0
  89. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/yuv_common_objects.dir/source/scale_lsx.cc.o +0 -0
  90. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/yuv_common_objects.dir/source/scale_rgb.cc.o +0 -0
  91. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/yuv_common_objects.dir/source/scale_rvv.cc.o +0 -0
  92. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/yuv_common_objects.dir/source/scale_uv.cc.o +0 -0
  93. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/yuv_common_objects.dir/source/scale_win.cc.o +0 -0
  94. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/yuv_common_objects.dir/source/video_common.cc.o +0 -0
  95. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/yuv_neon64.dir/source/compare_neon64.cc.o +0 -0
  96. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/yuv_neon64.dir/source/rotate_neon64.cc.o +0 -0
  97. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/yuv_neon64.dir/source/row_neon64.cc.o +0 -0
  98. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/yuv_neon64.dir/source/scale_neon64.cc.o +0 -0
  99. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/yuv_sme.dir/source/rotate_sme.cc.o +0 -0
  100. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/yuv_sme.dir/source/row_sme.cc.o +0 -0
  101. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/yuv_sme.dir/source/scale_sme.cc.o +0 -0
  102. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/yuv_sve.dir/source/row_sve.cc.o +0 -0
  103. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/yuvconstants.dir/util/yuvconstants.c.o +0 -0
  104. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/CMakeFiles/yuvconvert.dir/util/yuvconvert.cc.o +0 -0
  105. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/cmake_install.cmake +87 -0
  106. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/libyuv/libyuv.a +0 -0
  107. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/metadata_generation_command.txt +19 -0
  108. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/prefab_config.json +4 -0
  109. package/android/.cxx/Debug/2a3w6u3n/arm64-v8a/symbol_folder_index.txt +1 -0
  110. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/.cmake/api/v1/query/client-agp/cache-v2 +0 -0
  111. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/.cmake/api/v1/query/client-agp/cmakeFiles-v1 +0 -0
  112. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/.cmake/api/v1/query/client-agp/codemodel-v2 +0 -0
  113. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/.cmake/api/v1/reply/cache-v2-3c91c5cee78e3e904960.json +1587 -0
  114. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/.cmake/api/v1/reply/cmakeFiles-v1-7cc7148edcc0267ae184.json +857 -0
  115. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/.cmake/api/v1/reply/codemodel-v2-3db6484795577cf354b3.json +167 -0
  116. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/.cmake/api/v1/reply/directory-.-Debug-d0094a50bb2071803777.json +14 -0
  117. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/.cmake/api/v1/reply/directory-libyuv-Debug-063ed54195fe25617bc7.json +100 -0
  118. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/.cmake/api/v1/reply/index-2025-11-18T09-41-44-0186.json +92 -0
  119. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/.cmake/api/v1/reply/target-cpuid-Debug-a3f2884614434f8f188a.json +150 -0
  120. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/.cmake/api/v1/reply/target-faceantispoof-Debug-c905db8d2a36c2f49235.json +181 -0
  121. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/.cmake/api/v1/reply/target-fastyuv-Debug-e08fb9fb89a090bfee1a.json +190 -0
  122. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/.cmake/api/v1/reply/target-yuv-Debug-4b1ffa979fbf6ac68418.json +406 -0
  123. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/.cmake/api/v1/reply/target-yuv_common_objects-Debug-245e248f528e11e2d34d.json +536 -0
  124. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/.cmake/api/v1/reply/target-yuv_neon-Debug-2ea21009709c7febf67d.json +151 -0
  125. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/.cmake/api/v1/reply/target-yuv_shared-Debug-e387ee44aace33b18140.json +428 -0
  126. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/.cmake/api/v1/reply/target-yuvconstants-Debug-14fbb0c58620d35bb155.json +150 -0
  127. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/.cmake/api/v1/reply/target-yuvconvert-Debug-c40ecea0358b0e737802.json +171 -0
  128. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/.ninja_deps +0 -0
  129. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/.ninja_log +59 -0
  130. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/CMakeCache.txt +463 -0
  131. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/CMakeFiles/3.22.1-g37088a8-dirty/CMakeCCompiler.cmake +72 -0
  132. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/CMakeFiles/3.22.1-g37088a8-dirty/CMakeCXXCompiler.cmake +83 -0
  133. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/CMakeFiles/3.22.1-g37088a8-dirty/CMakeDetermineCompilerABI_C.bin +0 -0
  134. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/CMakeFiles/3.22.1-g37088a8-dirty/CMakeDetermineCompilerABI_CXX.bin +0 -0
  135. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/CMakeFiles/3.22.1-g37088a8-dirty/CMakeSystem.cmake +15 -0
  136. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/CMakeFiles/3.22.1-g37088a8-dirty/CompilerIdC/CMakeCCompilerId.c +803 -0
  137. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/CMakeFiles/3.22.1-g37088a8-dirty/CompilerIdC/CMakeCCompilerId.o +0 -0
  138. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/CMakeFiles/3.22.1-g37088a8-dirty/CompilerIdCXX/CMakeCXXCompilerId.cpp +791 -0
  139. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/CMakeFiles/3.22.1-g37088a8-dirty/CompilerIdCXX/CMakeCXXCompilerId.o +0 -0
  140. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/CMakeFiles/CMakeOutput.log +268 -0
  141. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/CMakeFiles/TargetDirectories.txt +25 -0
  142. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/CMakeFiles/cmake.check_cache +1 -0
  143. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/CMakeFiles/faceantispoof.dir/48ddb531beec5c42d2f7a5f3aa0b5968/ReactCommon/jsi/jsi/jsi.cpp.o +0 -0
  144. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/CMakeFiles/faceantispoof.dir/FaceAntiSpoofJSI.cpp.o +0 -0
  145. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/CMakeFiles/fastyuv.dir/FastYuvJni.cpp.o +0 -0
  146. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/CMakeFiles/fastyuv.dir/fast_yuv.cpp.o +0 -0
  147. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/CMakeFiles/rules.ninja +178 -0
  148. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/CPackConfig.cmake +71 -0
  149. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/CPackSourceConfig.cmake +79 -0
  150. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/additional_project_files.txt +44 -0
  151. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/android_gradle_build.json +96 -0
  152. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/android_gradle_build_mini.json +77 -0
  153. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/build.ninja +1046 -0
  154. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/build_file_index.txt +3 -0
  155. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/cmake_install.cmake +59 -0
  156. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/compile_commands.json +257 -0
  157. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/compile_commands.json.bin +0 -0
  158. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/configure_fingerprint.bin +29 -0
  159. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/libyuv/CMakeFiles/cpuid.dir/util/cpuid.c.o +0 -0
  160. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/libyuv/CMakeFiles/yuv_common_objects.dir/source/compare.cc.o +0 -0
  161. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/libyuv/CMakeFiles/yuv_common_objects.dir/source/compare_common.cc.o +0 -0
  162. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/libyuv/CMakeFiles/yuv_common_objects.dir/source/compare_gcc.cc.o +0 -0
  163. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/libyuv/CMakeFiles/yuv_common_objects.dir/source/compare_win.cc.o +0 -0
  164. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/libyuv/CMakeFiles/yuv_common_objects.dir/source/convert.cc.o +0 -0
  165. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/libyuv/CMakeFiles/yuv_common_objects.dir/source/convert_argb.cc.o +0 -0
  166. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/libyuv/CMakeFiles/yuv_common_objects.dir/source/convert_from.cc.o +0 -0
  167. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/libyuv/CMakeFiles/yuv_common_objects.dir/source/convert_from_argb.cc.o +0 -0
  168. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/libyuv/CMakeFiles/yuv_common_objects.dir/source/convert_jpeg.cc.o +0 -0
  169. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/libyuv/CMakeFiles/yuv_common_objects.dir/source/convert_to_argb.cc.o +0 -0
  170. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/libyuv/CMakeFiles/yuv_common_objects.dir/source/convert_to_i420.cc.o +0 -0
  171. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/libyuv/CMakeFiles/yuv_common_objects.dir/source/cpu_id.cc.o +0 -0
  172. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/libyuv/CMakeFiles/yuv_common_objects.dir/source/mjpeg_decoder.cc.o +0 -0
  173. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/libyuv/CMakeFiles/yuv_common_objects.dir/source/mjpeg_validate.cc.o +0 -0
  174. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/libyuv/CMakeFiles/yuv_common_objects.dir/source/planar_functions.cc.o +0 -0
  175. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/libyuv/CMakeFiles/yuv_common_objects.dir/source/rotate.cc.o +0 -0
  176. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/libyuv/CMakeFiles/yuv_common_objects.dir/source/rotate_any.cc.o +0 -0
  177. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/libyuv/CMakeFiles/yuv_common_objects.dir/source/rotate_argb.cc.o +0 -0
  178. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/libyuv/CMakeFiles/yuv_common_objects.dir/source/rotate_common.cc.o +0 -0
  179. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/libyuv/CMakeFiles/yuv_common_objects.dir/source/rotate_gcc.cc.o +0 -0
  180. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/libyuv/CMakeFiles/yuv_common_objects.dir/source/rotate_lsx.cc.o +0 -0
  181. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/libyuv/CMakeFiles/yuv_common_objects.dir/source/rotate_win.cc.o +0 -0
  182. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/libyuv/CMakeFiles/yuv_common_objects.dir/source/row_any.cc.o +0 -0
  183. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/libyuv/CMakeFiles/yuv_common_objects.dir/source/row_common.cc.o +0 -0
  184. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/libyuv/CMakeFiles/yuv_common_objects.dir/source/row_gcc.cc.o +0 -0
  185. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/libyuv/CMakeFiles/yuv_common_objects.dir/source/row_lasx.cc.o +0 -0
  186. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/libyuv/CMakeFiles/yuv_common_objects.dir/source/row_lsx.cc.o +0 -0
  187. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/libyuv/CMakeFiles/yuv_common_objects.dir/source/row_rvv.cc.o +0 -0
  188. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/libyuv/CMakeFiles/yuv_common_objects.dir/source/row_win.cc.o +0 -0
  189. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/libyuv/CMakeFiles/yuv_common_objects.dir/source/scale.cc.o +0 -0
  190. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/libyuv/CMakeFiles/yuv_common_objects.dir/source/scale_any.cc.o +0 -0
  191. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/libyuv/CMakeFiles/yuv_common_objects.dir/source/scale_argb.cc.o +0 -0
  192. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/libyuv/CMakeFiles/yuv_common_objects.dir/source/scale_common.cc.o +0 -0
  193. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/libyuv/CMakeFiles/yuv_common_objects.dir/source/scale_gcc.cc.o +0 -0
  194. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/libyuv/CMakeFiles/yuv_common_objects.dir/source/scale_lsx.cc.o +0 -0
  195. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/libyuv/CMakeFiles/yuv_common_objects.dir/source/scale_rgb.cc.o +0 -0
  196. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/libyuv/CMakeFiles/yuv_common_objects.dir/source/scale_rvv.cc.o +0 -0
  197. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/libyuv/CMakeFiles/yuv_common_objects.dir/source/scale_uv.cc.o +0 -0
  198. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/libyuv/CMakeFiles/yuv_common_objects.dir/source/scale_win.cc.o +0 -0
  199. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/libyuv/CMakeFiles/yuv_common_objects.dir/source/video_common.cc.o +0 -0
  200. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/libyuv/CMakeFiles/yuv_neon.dir/source/compare_neon.cc.o +0 -0
  201. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/libyuv/CMakeFiles/yuv_neon.dir/source/rotate_neon.cc.o +0 -0
  202. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/libyuv/CMakeFiles/yuv_neon.dir/source/row_neon.cc.o +0 -0
  203. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/libyuv/CMakeFiles/yuv_neon.dir/source/scale_neon.cc.o +0 -0
  204. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/libyuv/CMakeFiles/yuvconstants.dir/util/yuvconstants.c.o +0 -0
  205. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/libyuv/CMakeFiles/yuvconvert.dir/util/yuvconvert.cc.o +0 -0
  206. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/libyuv/cmake_install.cmake +87 -0
  207. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/libyuv/libyuv.a +0 -0
  208. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/metadata_generation_command.txt +19 -0
  209. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/prefab_config.json +4 -0
  210. package/android/.cxx/Debug/2a3w6u3n/armeabi-v7a/symbol_folder_index.txt +1 -0
  211. package/android/.cxx/Debug/2a3w6u3n/hash_key.txt +26 -0
  212. package/android/.cxx/Debug/2a3w6u3n/x86/.cmake/api/v1/query/client-agp/cache-v2 +0 -0
  213. package/android/.cxx/Debug/2a3w6u3n/x86/.cmake/api/v1/query/client-agp/cmakeFiles-v1 +0 -0
  214. package/android/.cxx/Debug/2a3w6u3n/x86/.cmake/api/v1/query/client-agp/codemodel-v2 +0 -0
  215. package/android/.cxx/Debug/2a3w6u3n/x86/.cmake/api/v1/reply/cache-v2-2fe46b6519c8341b1982.json +1587 -0
  216. package/android/.cxx/Debug/2a3w6u3n/x86/.cmake/api/v1/reply/cmakeFiles-v1-a03e763d0c6effec9f6f.json +857 -0
  217. package/android/.cxx/Debug/2a3w6u3n/x86/.cmake/api/v1/reply/codemodel-v2-2412bbfc0c74a0dc613a.json +158 -0
  218. package/android/.cxx/Debug/2a3w6u3n/x86/.cmake/api/v1/reply/directory-.-Debug-d0094a50bb2071803777.json +14 -0
  219. package/android/.cxx/Debug/2a3w6u3n/x86/.cmake/api/v1/reply/directory-libyuv-Debug-7cf182a5e476bc9b5f34.json +100 -0
  220. package/android/.cxx/Debug/2a3w6u3n/x86/.cmake/api/v1/reply/index-2025-11-18T09-41-52-0585.json +92 -0
  221. package/android/.cxx/Debug/2a3w6u3n/x86/.cmake/api/v1/reply/target-cpuid-Debug-931d089bced0b77c5070.json +136 -0
  222. package/android/.cxx/Debug/2a3w6u3n/x86/.cmake/api/v1/reply/target-faceantispoof-Debug-7b58f88faeacc46f961d.json +181 -0
  223. package/android/.cxx/Debug/2a3w6u3n/x86/.cmake/api/v1/reply/target-fastyuv-Debug-9283b76b8a94ba273122.json +157 -0
  224. package/android/.cxx/Debug/2a3w6u3n/x86/.cmake/api/v1/reply/target-yuv-Debug-c270d4a92a15ef45f650.json +368 -0
  225. package/android/.cxx/Debug/2a3w6u3n/x86/.cmake/api/v1/reply/target-yuv_common_objects-Debug-ae517204d04beeb2df23.json +522 -0
  226. package/android/.cxx/Debug/2a3w6u3n/x86/.cmake/api/v1/reply/target-yuv_shared-Debug-42c6196dd1672984dcd7.json +390 -0
  227. package/android/.cxx/Debug/2a3w6u3n/x86/.cmake/api/v1/reply/target-yuvconstants-Debug-7e8432d4753ee3bd592d.json +136 -0
  228. package/android/.cxx/Debug/2a3w6u3n/x86/.cmake/api/v1/reply/target-yuvconvert-Debug-2cc934aa605d443ac9a1.json +157 -0
  229. package/android/.cxx/Debug/2a3w6u3n/x86/.ninja_deps +0 -0
  230. package/android/.cxx/Debug/2a3w6u3n/x86/.ninja_log +55 -0
  231. package/android/.cxx/Debug/2a3w6u3n/x86/CMakeCache.txt +463 -0
  232. package/android/.cxx/Debug/2a3w6u3n/x86/CMakeFiles/3.22.1-g37088a8-dirty/CMakeCCompiler.cmake +72 -0
  233. package/android/.cxx/Debug/2a3w6u3n/x86/CMakeFiles/3.22.1-g37088a8-dirty/CMakeCXXCompiler.cmake +83 -0
  234. package/android/.cxx/Debug/2a3w6u3n/x86/CMakeFiles/3.22.1-g37088a8-dirty/CMakeDetermineCompilerABI_C.bin +0 -0
  235. package/android/.cxx/Debug/2a3w6u3n/x86/CMakeFiles/3.22.1-g37088a8-dirty/CMakeDetermineCompilerABI_CXX.bin +0 -0
  236. package/android/.cxx/Debug/2a3w6u3n/x86/CMakeFiles/3.22.1-g37088a8-dirty/CMakeSystem.cmake +15 -0
  237. package/android/.cxx/Debug/2a3w6u3n/x86/CMakeFiles/3.22.1-g37088a8-dirty/CompilerIdC/CMakeCCompilerId.c +803 -0
  238. package/android/.cxx/Debug/2a3w6u3n/x86/CMakeFiles/3.22.1-g37088a8-dirty/CompilerIdC/CMakeCCompilerId.o +0 -0
  239. package/android/.cxx/Debug/2a3w6u3n/x86/CMakeFiles/3.22.1-g37088a8-dirty/CompilerIdCXX/CMakeCXXCompilerId.cpp +791 -0
  240. package/android/.cxx/Debug/2a3w6u3n/x86/CMakeFiles/3.22.1-g37088a8-dirty/CompilerIdCXX/CMakeCXXCompilerId.o +0 -0
  241. package/android/.cxx/Debug/2a3w6u3n/x86/CMakeFiles/CMakeOutput.log +258 -0
  242. package/android/.cxx/Debug/2a3w6u3n/x86/CMakeFiles/TargetDirectories.txt +24 -0
  243. package/android/.cxx/Debug/2a3w6u3n/x86/CMakeFiles/cmake.check_cache +1 -0
  244. package/android/.cxx/Debug/2a3w6u3n/x86/CMakeFiles/faceantispoof.dir/FaceAntiSpoofJSI.cpp.o +0 -0
  245. package/android/.cxx/Debug/2a3w6u3n/x86/CMakeFiles/faceantispoof.dir/c9fdc8b0d027394fa06b64ba7ac7706f/react-native/ReactCommon/jsi/jsi/jsi.cpp.o +0 -0
  246. package/android/.cxx/Debug/2a3w6u3n/x86/CMakeFiles/fastyuv.dir/FastYuvJni.cpp.o +0 -0
  247. package/android/.cxx/Debug/2a3w6u3n/x86/CMakeFiles/fastyuv.dir/fast_yuv.cpp.o +0 -0
  248. package/android/.cxx/Debug/2a3w6u3n/x86/CMakeFiles/rules.ninja +168 -0
  249. package/android/.cxx/Debug/2a3w6u3n/x86/CPackConfig.cmake +71 -0
  250. package/android/.cxx/Debug/2a3w6u3n/x86/CPackSourceConfig.cmake +79 -0
  251. package/android/.cxx/Debug/2a3w6u3n/x86/additional_project_files.txt +40 -0
  252. package/android/.cxx/Debug/2a3w6u3n/x86/android_gradle_build.json +91 -0
  253. package/android/.cxx/Debug/2a3w6u3n/x86/android_gradle_build_mini.json +72 -0
  254. package/android/.cxx/Debug/2a3w6u3n/x86/build.ninja +945 -0
  255. package/android/.cxx/Debug/2a3w6u3n/x86/build_file_index.txt +3 -0
  256. package/android/.cxx/Debug/2a3w6u3n/x86/cmake_install.cmake +59 -0
  257. package/android/.cxx/Debug/2a3w6u3n/x86/compile_commands.json +237 -0
  258. package/android/.cxx/Debug/2a3w6u3n/x86/compile_commands.json.bin +0 -0
  259. package/android/.cxx/Debug/2a3w6u3n/x86/configure_fingerprint.bin +29 -0
  260. package/android/.cxx/Debug/2a3w6u3n/x86/libyuv/CMakeFiles/cpuid.dir/util/cpuid.c.o +0 -0
  261. package/android/.cxx/Debug/2a3w6u3n/x86/libyuv/CMakeFiles/yuv_common_objects.dir/source/compare.cc.o +0 -0
  262. package/android/.cxx/Debug/2a3w6u3n/x86/libyuv/CMakeFiles/yuv_common_objects.dir/source/compare_common.cc.o +0 -0
  263. package/android/.cxx/Debug/2a3w6u3n/x86/libyuv/CMakeFiles/yuv_common_objects.dir/source/compare_gcc.cc.o +0 -0
  264. package/android/.cxx/Debug/2a3w6u3n/x86/libyuv/CMakeFiles/yuv_common_objects.dir/source/compare_win.cc.o +0 -0
  265. package/android/.cxx/Debug/2a3w6u3n/x86/libyuv/CMakeFiles/yuv_common_objects.dir/source/convert.cc.o +0 -0
  266. package/android/.cxx/Debug/2a3w6u3n/x86/libyuv/CMakeFiles/yuv_common_objects.dir/source/convert_argb.cc.o +0 -0
  267. package/android/.cxx/Debug/2a3w6u3n/x86/libyuv/CMakeFiles/yuv_common_objects.dir/source/convert_from.cc.o +0 -0
  268. package/android/.cxx/Debug/2a3w6u3n/x86/libyuv/CMakeFiles/yuv_common_objects.dir/source/convert_from_argb.cc.o +0 -0
  269. package/android/.cxx/Debug/2a3w6u3n/x86/libyuv/CMakeFiles/yuv_common_objects.dir/source/convert_jpeg.cc.o +0 -0
  270. package/android/.cxx/Debug/2a3w6u3n/x86/libyuv/CMakeFiles/yuv_common_objects.dir/source/convert_to_argb.cc.o +0 -0
  271. package/android/.cxx/Debug/2a3w6u3n/x86/libyuv/CMakeFiles/yuv_common_objects.dir/source/convert_to_i420.cc.o +0 -0
  272. package/android/.cxx/Debug/2a3w6u3n/x86/libyuv/CMakeFiles/yuv_common_objects.dir/source/cpu_id.cc.o +0 -0
  273. package/android/.cxx/Debug/2a3w6u3n/x86/libyuv/CMakeFiles/yuv_common_objects.dir/source/mjpeg_decoder.cc.o +0 -0
  274. package/android/.cxx/Debug/2a3w6u3n/x86/libyuv/CMakeFiles/yuv_common_objects.dir/source/mjpeg_validate.cc.o +0 -0
  275. package/android/.cxx/Debug/2a3w6u3n/x86/libyuv/CMakeFiles/yuv_common_objects.dir/source/planar_functions.cc.o +0 -0
  276. package/android/.cxx/Debug/2a3w6u3n/x86/libyuv/CMakeFiles/yuv_common_objects.dir/source/rotate.cc.o +0 -0
  277. package/android/.cxx/Debug/2a3w6u3n/x86/libyuv/CMakeFiles/yuv_common_objects.dir/source/rotate_any.cc.o +0 -0
  278. package/android/.cxx/Debug/2a3w6u3n/x86/libyuv/CMakeFiles/yuv_common_objects.dir/source/rotate_argb.cc.o +0 -0
  279. package/android/.cxx/Debug/2a3w6u3n/x86/libyuv/CMakeFiles/yuv_common_objects.dir/source/rotate_common.cc.o +0 -0
  280. package/android/.cxx/Debug/2a3w6u3n/x86/libyuv/CMakeFiles/yuv_common_objects.dir/source/rotate_gcc.cc.o +0 -0
  281. package/android/.cxx/Debug/2a3w6u3n/x86/libyuv/CMakeFiles/yuv_common_objects.dir/source/rotate_lsx.cc.o +0 -0
  282. package/android/.cxx/Debug/2a3w6u3n/x86/libyuv/CMakeFiles/yuv_common_objects.dir/source/rotate_win.cc.o +0 -0
  283. package/android/.cxx/Debug/2a3w6u3n/x86/libyuv/CMakeFiles/yuv_common_objects.dir/source/row_any.cc.o +0 -0
  284. package/android/.cxx/Debug/2a3w6u3n/x86/libyuv/CMakeFiles/yuv_common_objects.dir/source/row_common.cc.o +0 -0
  285. package/android/.cxx/Debug/2a3w6u3n/x86/libyuv/CMakeFiles/yuv_common_objects.dir/source/row_gcc.cc.o +0 -0
  286. package/android/.cxx/Debug/2a3w6u3n/x86/libyuv/CMakeFiles/yuv_common_objects.dir/source/row_lasx.cc.o +0 -0
  287. package/android/.cxx/Debug/2a3w6u3n/x86/libyuv/CMakeFiles/yuv_common_objects.dir/source/row_lsx.cc.o +0 -0
  288. package/android/.cxx/Debug/2a3w6u3n/x86/libyuv/CMakeFiles/yuv_common_objects.dir/source/row_rvv.cc.o +0 -0
  289. package/android/.cxx/Debug/2a3w6u3n/x86/libyuv/CMakeFiles/yuv_common_objects.dir/source/row_win.cc.o +0 -0
  290. package/android/.cxx/Debug/2a3w6u3n/x86/libyuv/CMakeFiles/yuv_common_objects.dir/source/scale.cc.o +0 -0
  291. package/android/.cxx/Debug/2a3w6u3n/x86/libyuv/CMakeFiles/yuv_common_objects.dir/source/scale_any.cc.o +0 -0
  292. package/android/.cxx/Debug/2a3w6u3n/x86/libyuv/CMakeFiles/yuv_common_objects.dir/source/scale_argb.cc.o +0 -0
  293. package/android/.cxx/Debug/2a3w6u3n/x86/libyuv/CMakeFiles/yuv_common_objects.dir/source/scale_common.cc.o +0 -0
  294. package/android/.cxx/Debug/2a3w6u3n/x86/libyuv/CMakeFiles/yuv_common_objects.dir/source/scale_gcc.cc.o +0 -0
  295. package/android/.cxx/Debug/2a3w6u3n/x86/libyuv/CMakeFiles/yuv_common_objects.dir/source/scale_lsx.cc.o +0 -0
  296. package/android/.cxx/Debug/2a3w6u3n/x86/libyuv/CMakeFiles/yuv_common_objects.dir/source/scale_rgb.cc.o +0 -0
  297. package/android/.cxx/Debug/2a3w6u3n/x86/libyuv/CMakeFiles/yuv_common_objects.dir/source/scale_rvv.cc.o +0 -0
  298. package/android/.cxx/Debug/2a3w6u3n/x86/libyuv/CMakeFiles/yuv_common_objects.dir/source/scale_uv.cc.o +0 -0
  299. package/android/.cxx/Debug/2a3w6u3n/x86/libyuv/CMakeFiles/yuv_common_objects.dir/source/scale_win.cc.o +0 -0
  300. package/android/.cxx/Debug/2a3w6u3n/x86/libyuv/CMakeFiles/yuv_common_objects.dir/source/video_common.cc.o +0 -0
  301. package/android/.cxx/Debug/2a3w6u3n/x86/libyuv/CMakeFiles/yuvconstants.dir/util/yuvconstants.c.o +0 -0
  302. package/android/.cxx/Debug/2a3w6u3n/x86/libyuv/CMakeFiles/yuvconvert.dir/util/yuvconvert.cc.o +0 -0
  303. package/android/.cxx/Debug/2a3w6u3n/x86/libyuv/cmake_install.cmake +87 -0
  304. package/android/.cxx/Debug/2a3w6u3n/x86/libyuv/libyuv.a +0 -0
  305. package/android/.cxx/Debug/2a3w6u3n/x86/metadata_generation_command.txt +19 -0
  306. package/android/.cxx/Debug/2a3w6u3n/x86/prefab_config.json +4 -0
  307. package/android/.cxx/Debug/2a3w6u3n/x86/symbol_folder_index.txt +1 -0
  308. package/android/.cxx/Debug/2a3w6u3n/x86_64/.cmake/api/v1/query/client-agp/cache-v2 +0 -0
  309. package/android/.cxx/Debug/2a3w6u3n/x86_64/.cmake/api/v1/query/client-agp/cmakeFiles-v1 +0 -0
  310. package/android/.cxx/Debug/2a3w6u3n/x86_64/.cmake/api/v1/query/client-agp/codemodel-v2 +0 -0
  311. package/android/.cxx/Debug/2a3w6u3n/x86_64/.cmake/api/v1/reply/cache-v2-5ca7fb88a80849964189.json +1587 -0
  312. package/android/.cxx/Debug/2a3w6u3n/x86_64/.cmake/api/v1/reply/cmakeFiles-v1-9871675aa6610f6180ca.json +857 -0
  313. package/android/.cxx/Debug/2a3w6u3n/x86_64/.cmake/api/v1/reply/codemodel-v2-deb41c72c38c1ff57431.json +158 -0
  314. package/android/.cxx/Debug/2a3w6u3n/x86_64/.cmake/api/v1/reply/directory-.-Debug-d0094a50bb2071803777.json +14 -0
  315. package/android/.cxx/Debug/2a3w6u3n/x86_64/.cmake/api/v1/reply/directory-libyuv-Debug-edf355e979425c71897d.json +100 -0
  316. package/android/.cxx/Debug/2a3w6u3n/x86_64/.cmake/api/v1/reply/index-2025-11-18T09-42-00-0374.json +92 -0
  317. package/android/.cxx/Debug/2a3w6u3n/x86_64/.cmake/api/v1/reply/target-cpuid-Debug-264b6f675c69e42e8113.json +136 -0
  318. package/android/.cxx/Debug/2a3w6u3n/x86_64/.cmake/api/v1/reply/target-faceantispoof-Debug-c95714fd9c4cd04d4222.json +181 -0
  319. package/android/.cxx/Debug/2a3w6u3n/x86_64/.cmake/api/v1/reply/target-fastyuv-Debug-80c6b1b5d8e35770dde3.json +157 -0
  320. package/android/.cxx/Debug/2a3w6u3n/x86_64/.cmake/api/v1/reply/target-yuv-Debug-6d3d5c5dcc6bffc18ce6.json +368 -0
  321. package/android/.cxx/Debug/2a3w6u3n/x86_64/.cmake/api/v1/reply/target-yuv_common_objects-Debug-ae517204d04beeb2df23.json +522 -0
  322. package/android/.cxx/Debug/2a3w6u3n/x86_64/.cmake/api/v1/reply/target-yuv_shared-Debug-6e364a075e5b9b47274e.json +390 -0
  323. package/android/.cxx/Debug/2a3w6u3n/x86_64/.cmake/api/v1/reply/target-yuvconstants-Debug-f6a29384c5629faf75f4.json +136 -0
  324. package/android/.cxx/Debug/2a3w6u3n/x86_64/.cmake/api/v1/reply/target-yuvconvert-Debug-dca5f1cf9af89281fc95.json +157 -0
  325. package/android/.cxx/Debug/2a3w6u3n/x86_64/.ninja_deps +0 -0
  326. package/android/.cxx/Debug/2a3w6u3n/x86_64/.ninja_log +55 -0
  327. package/android/.cxx/Debug/2a3w6u3n/x86_64/CMakeCache.txt +463 -0
  328. package/android/.cxx/Debug/2a3w6u3n/x86_64/CMakeFiles/3.22.1-g37088a8-dirty/CMakeCCompiler.cmake +72 -0
  329. package/android/.cxx/Debug/2a3w6u3n/x86_64/CMakeFiles/3.22.1-g37088a8-dirty/CMakeCXXCompiler.cmake +83 -0
  330. package/android/.cxx/Debug/2a3w6u3n/x86_64/CMakeFiles/3.22.1-g37088a8-dirty/CMakeDetermineCompilerABI_C.bin +0 -0
  331. package/android/.cxx/Debug/2a3w6u3n/x86_64/CMakeFiles/3.22.1-g37088a8-dirty/CMakeDetermineCompilerABI_CXX.bin +0 -0
  332. package/android/.cxx/Debug/2a3w6u3n/x86_64/CMakeFiles/3.22.1-g37088a8-dirty/CMakeSystem.cmake +15 -0
  333. package/android/.cxx/Debug/2a3w6u3n/x86_64/CMakeFiles/3.22.1-g37088a8-dirty/CompilerIdC/CMakeCCompilerId.c +803 -0
  334. package/android/.cxx/Debug/2a3w6u3n/x86_64/CMakeFiles/3.22.1-g37088a8-dirty/CompilerIdC/CMakeCCompilerId.o +0 -0
  335. package/android/.cxx/Debug/2a3w6u3n/x86_64/CMakeFiles/3.22.1-g37088a8-dirty/CompilerIdCXX/CMakeCXXCompilerId.cpp +791 -0
  336. package/android/.cxx/Debug/2a3w6u3n/x86_64/CMakeFiles/3.22.1-g37088a8-dirty/CompilerIdCXX/CMakeCXXCompilerId.o +0 -0
  337. package/android/.cxx/Debug/2a3w6u3n/x86_64/CMakeFiles/CMakeOutput.log +258 -0
  338. package/android/.cxx/Debug/2a3w6u3n/x86_64/CMakeFiles/TargetDirectories.txt +24 -0
  339. package/android/.cxx/Debug/2a3w6u3n/x86_64/CMakeFiles/cmake.check_cache +1 -0
  340. package/android/.cxx/Debug/2a3w6u3n/x86_64/CMakeFiles/faceantispoof.dir/FaceAntiSpoofJSI.cpp.o +0 -0
  341. package/android/.cxx/Debug/2a3w6u3n/x86_64/CMakeFiles/faceantispoof.dir/c9fdc8b0d027394fa06b64ba7ac7706f/react-native/ReactCommon/jsi/jsi/jsi.cpp.o +0 -0
  342. package/android/.cxx/Debug/2a3w6u3n/x86_64/CMakeFiles/fastyuv.dir/FastYuvJni.cpp.o +0 -0
  343. package/android/.cxx/Debug/2a3w6u3n/x86_64/CMakeFiles/fastyuv.dir/fast_yuv.cpp.o +0 -0
  344. package/android/.cxx/Debug/2a3w6u3n/x86_64/CMakeFiles/rules.ninja +168 -0
  345. package/android/.cxx/Debug/2a3w6u3n/x86_64/CPackConfig.cmake +71 -0
  346. package/android/.cxx/Debug/2a3w6u3n/x86_64/CPackSourceConfig.cmake +79 -0
  347. package/android/.cxx/Debug/2a3w6u3n/x86_64/additional_project_files.txt +40 -0
  348. package/android/.cxx/Debug/2a3w6u3n/x86_64/android_gradle_build.json +91 -0
  349. package/android/.cxx/Debug/2a3w6u3n/x86_64/android_gradle_build_mini.json +72 -0
  350. package/android/.cxx/Debug/2a3w6u3n/x86_64/build.ninja +945 -0
  351. package/android/.cxx/Debug/2a3w6u3n/x86_64/build_file_index.txt +3 -0
  352. package/android/.cxx/Debug/2a3w6u3n/x86_64/cmake_install.cmake +59 -0
  353. package/android/.cxx/Debug/2a3w6u3n/x86_64/compile_commands.json +237 -0
  354. package/android/.cxx/Debug/2a3w6u3n/x86_64/compile_commands.json.bin +0 -0
  355. package/android/.cxx/Debug/2a3w6u3n/x86_64/configure_fingerprint.bin +29 -0
  356. package/android/.cxx/Debug/2a3w6u3n/x86_64/libyuv/CMakeFiles/cpuid.dir/util/cpuid.c.o +0 -0
  357. package/android/.cxx/Debug/2a3w6u3n/x86_64/libyuv/CMakeFiles/yuv_common_objects.dir/source/compare.cc.o +0 -0
  358. package/android/.cxx/Debug/2a3w6u3n/x86_64/libyuv/CMakeFiles/yuv_common_objects.dir/source/compare_common.cc.o +0 -0
  359. package/android/.cxx/Debug/2a3w6u3n/x86_64/libyuv/CMakeFiles/yuv_common_objects.dir/source/compare_gcc.cc.o +0 -0
  360. package/android/.cxx/Debug/2a3w6u3n/x86_64/libyuv/CMakeFiles/yuv_common_objects.dir/source/compare_win.cc.o +0 -0
  361. package/android/.cxx/Debug/2a3w6u3n/x86_64/libyuv/CMakeFiles/yuv_common_objects.dir/source/convert.cc.o +0 -0
  362. package/android/.cxx/Debug/2a3w6u3n/x86_64/libyuv/CMakeFiles/yuv_common_objects.dir/source/convert_argb.cc.o +0 -0
  363. package/android/.cxx/Debug/2a3w6u3n/x86_64/libyuv/CMakeFiles/yuv_common_objects.dir/source/convert_from.cc.o +0 -0
  364. package/android/.cxx/Debug/2a3w6u3n/x86_64/libyuv/CMakeFiles/yuv_common_objects.dir/source/convert_from_argb.cc.o +0 -0
  365. package/android/.cxx/Debug/2a3w6u3n/x86_64/libyuv/CMakeFiles/yuv_common_objects.dir/source/convert_jpeg.cc.o +0 -0
  366. package/android/.cxx/Debug/2a3w6u3n/x86_64/libyuv/CMakeFiles/yuv_common_objects.dir/source/convert_to_argb.cc.o +0 -0
  367. package/android/.cxx/Debug/2a3w6u3n/x86_64/libyuv/CMakeFiles/yuv_common_objects.dir/source/convert_to_i420.cc.o +0 -0
  368. package/android/.cxx/Debug/2a3w6u3n/x86_64/libyuv/CMakeFiles/yuv_common_objects.dir/source/cpu_id.cc.o +0 -0
  369. package/android/.cxx/Debug/2a3w6u3n/x86_64/libyuv/CMakeFiles/yuv_common_objects.dir/source/mjpeg_decoder.cc.o +0 -0
  370. package/android/.cxx/Debug/2a3w6u3n/x86_64/libyuv/CMakeFiles/yuv_common_objects.dir/source/mjpeg_validate.cc.o +0 -0
  371. package/android/.cxx/Debug/2a3w6u3n/x86_64/libyuv/CMakeFiles/yuv_common_objects.dir/source/planar_functions.cc.o +0 -0
  372. package/android/.cxx/Debug/2a3w6u3n/x86_64/libyuv/CMakeFiles/yuv_common_objects.dir/source/rotate.cc.o +0 -0
  373. package/android/.cxx/Debug/2a3w6u3n/x86_64/libyuv/CMakeFiles/yuv_common_objects.dir/source/rotate_any.cc.o +0 -0
  374. package/android/.cxx/Debug/2a3w6u3n/x86_64/libyuv/CMakeFiles/yuv_common_objects.dir/source/rotate_argb.cc.o +0 -0
  375. package/android/.cxx/Debug/2a3w6u3n/x86_64/libyuv/CMakeFiles/yuv_common_objects.dir/source/rotate_common.cc.o +0 -0
  376. package/android/.cxx/Debug/2a3w6u3n/x86_64/libyuv/CMakeFiles/yuv_common_objects.dir/source/rotate_gcc.cc.o +0 -0
  377. package/android/.cxx/Debug/2a3w6u3n/x86_64/libyuv/CMakeFiles/yuv_common_objects.dir/source/rotate_lsx.cc.o +0 -0
  378. package/android/.cxx/Debug/2a3w6u3n/x86_64/libyuv/CMakeFiles/yuv_common_objects.dir/source/rotate_win.cc.o +0 -0
  379. package/android/.cxx/Debug/2a3w6u3n/x86_64/libyuv/CMakeFiles/yuv_common_objects.dir/source/row_any.cc.o +0 -0
  380. package/android/.cxx/Debug/2a3w6u3n/x86_64/libyuv/CMakeFiles/yuv_common_objects.dir/source/row_common.cc.o +0 -0
  381. package/android/.cxx/Debug/2a3w6u3n/x86_64/libyuv/CMakeFiles/yuv_common_objects.dir/source/row_gcc.cc.o +0 -0
  382. package/android/.cxx/Debug/2a3w6u3n/x86_64/libyuv/CMakeFiles/yuv_common_objects.dir/source/row_lasx.cc.o +0 -0
  383. package/android/.cxx/Debug/2a3w6u3n/x86_64/libyuv/CMakeFiles/yuv_common_objects.dir/source/row_lsx.cc.o +0 -0
  384. package/android/.cxx/Debug/2a3w6u3n/x86_64/libyuv/CMakeFiles/yuv_common_objects.dir/source/row_rvv.cc.o +0 -0
  385. package/android/.cxx/Debug/2a3w6u3n/x86_64/libyuv/CMakeFiles/yuv_common_objects.dir/source/row_win.cc.o +0 -0
  386. package/android/.cxx/Debug/2a3w6u3n/x86_64/libyuv/CMakeFiles/yuv_common_objects.dir/source/scale.cc.o +0 -0
  387. package/android/.cxx/Debug/2a3w6u3n/x86_64/libyuv/CMakeFiles/yuv_common_objects.dir/source/scale_any.cc.o +0 -0
  388. package/android/.cxx/Debug/2a3w6u3n/x86_64/libyuv/CMakeFiles/yuv_common_objects.dir/source/scale_argb.cc.o +0 -0
  389. package/android/.cxx/Debug/2a3w6u3n/x86_64/libyuv/CMakeFiles/yuv_common_objects.dir/source/scale_common.cc.o +0 -0
  390. package/android/.cxx/Debug/2a3w6u3n/x86_64/libyuv/CMakeFiles/yuv_common_objects.dir/source/scale_gcc.cc.o +0 -0
  391. package/android/.cxx/Debug/2a3w6u3n/x86_64/libyuv/CMakeFiles/yuv_common_objects.dir/source/scale_lsx.cc.o +0 -0
  392. package/android/.cxx/Debug/2a3w6u3n/x86_64/libyuv/CMakeFiles/yuv_common_objects.dir/source/scale_rgb.cc.o +0 -0
  393. package/android/.cxx/Debug/2a3w6u3n/x86_64/libyuv/CMakeFiles/yuv_common_objects.dir/source/scale_rvv.cc.o +0 -0
  394. package/android/.cxx/Debug/2a3w6u3n/x86_64/libyuv/CMakeFiles/yuv_common_objects.dir/source/scale_uv.cc.o +0 -0
  395. package/android/.cxx/Debug/2a3w6u3n/x86_64/libyuv/CMakeFiles/yuv_common_objects.dir/source/scale_win.cc.o +0 -0
  396. package/android/.cxx/Debug/2a3w6u3n/x86_64/libyuv/CMakeFiles/yuv_common_objects.dir/source/video_common.cc.o +0 -0
  397. package/android/.cxx/Debug/2a3w6u3n/x86_64/libyuv/CMakeFiles/yuvconstants.dir/util/yuvconstants.c.o +0 -0
  398. package/android/.cxx/Debug/2a3w6u3n/x86_64/libyuv/CMakeFiles/yuvconvert.dir/util/yuvconvert.cc.o +0 -0
  399. package/android/.cxx/Debug/2a3w6u3n/x86_64/libyuv/cmake_install.cmake +87 -0
  400. package/android/.cxx/Debug/2a3w6u3n/x86_64/libyuv/libyuv.a +0 -0
  401. package/android/.cxx/Debug/2a3w6u3n/x86_64/metadata_generation_command.txt +19 -0
  402. package/android/.cxx/Debug/2a3w6u3n/x86_64/prefab_config.json +4 -0
  403. package/android/.cxx/Debug/2a3w6u3n/x86_64/symbol_folder_index.txt +1 -0
  404. package/android/.cxx/tools/debug/arm64-v8a/compile_commands.json +277 -0
  405. package/android/.cxx/tools/debug/armeabi-v7a/compile_commands.json +257 -0
  406. package/android/.cxx/tools/debug/x86/compile_commands.json +237 -0
  407. package/android/.cxx/tools/debug/x86_64/compile_commands.json +237 -0
  408. package/android/build/.transforms/477a48f41cbd60a6044ae2b6659edb2d/results.bin +1 -0
  409. package/android/build/.transforms/477a48f41cbd60a6044ae2b6659edb2d/transformed/classes/classes_dex/classes.dex +0 -0
  410. package/android/build/.transforms/4b58c518b6e650677b3ff7c47c32914f/results.bin +1 -0
  411. package/android/build/.transforms/4b58c518b6e650677b3ff7c47c32914f/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/faceantispoof/AcceleratorConfig.dex +0 -0
  412. package/android/build/.transforms/4b58c518b6e650677b3ff7c47c32914f/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/faceantispoof/AntiSpoofingResult.dex +0 -0
  413. package/android/build/.transforms/4b58c518b6e650677b3ff7c47c32914f/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/faceantispoof/BuildConfig.dex +0 -0
  414. package/android/build/.transforms/4b58c518b6e650677b3ff7c47c32914f/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/faceantispoof/FaceAntiSpoofFrameProcessor.dex +0 -0
  415. package/android/build/.transforms/4b58c518b6e650677b3ff7c47c32914f/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/faceantispoof/FaceAntiSpoofModule$Companion.dex +0 -0
  416. package/android/build/.transforms/4b58c518b6e650677b3ff7c47c32914f/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/faceantispoof/FaceAntiSpoofModule.dex +0 -0
  417. package/android/build/.transforms/4b58c518b6e650677b3ff7c47c32914f/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/faceantispoof/FaceAntiSpoofPackage.dex +0 -0
  418. package/android/build/.transforms/4b58c518b6e650677b3ff7c47c32914f/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/faceantispoof/FaceAntiSpoofingAdvanced$Companion.dex +0 -0
  419. package/android/build/.transforms/4b58c518b6e650677b3ff7c47c32914f/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/faceantispoof/FaceAntiSpoofingAdvanced.dex +0 -0
  420. package/android/build/.transforms/4b58c518b6e650677b3ff7c47c32914f/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/faceantispoof/FastYuv.dex +0 -0
  421. package/android/build/.transforms/4b58c518b6e650677b3ff7c47c32914f/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/faceantispoof/YuvToFloatArrayConverter.dex +0 -0
  422. package/android/build/.transforms/4b58c518b6e650677b3ff7c47c32914f/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/faceantispoof/YuvToRgbConverter.dex +0 -0
  423. package/android/build/.transforms/4b58c518b6e650677b3ff7c47c32914f/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
  424. package/android/build/generated/source/buildConfig/debug/com/faceantispoof/BuildConfig.java +14 -0
  425. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +13 -0
  426. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +18 -0
  427. package/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +6 -0
  428. package/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +1 -0
  429. package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
  430. package/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
  431. package/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +1 -0
  432. package/android/build/intermediates/cxx/Debug/2a3w6u3n/logs/arm64-v8a/build_command_targets.bat +10 -0
  433. package/android/build/intermediates/cxx/Debug/2a3w6u3n/logs/arm64-v8a/build_model.json +199 -0
  434. package/android/build/intermediates/cxx/Debug/2a3w6u3n/logs/arm64-v8a/build_stderr_targets.txt +0 -0
  435. package/android/build/intermediates/cxx/Debug/2a3w6u3n/logs/arm64-v8a/build_stdout_targets.txt +63 -0
  436. package/android/build/intermediates/cxx/Debug/2a3w6u3n/logs/arm64-v8a/configure_command.bat +19 -0
  437. package/android/build/intermediates/cxx/Debug/2a3w6u3n/logs/arm64-v8a/configure_stderr.txt +0 -0
  438. package/android/build/intermediates/cxx/Debug/2a3w6u3n/logs/arm64-v8a/configure_stdout.txt +21 -0
  439. package/android/build/intermediates/cxx/Debug/2a3w6u3n/logs/arm64-v8a/generate_cxx_metadata_8656_timing.txt +9 -0
  440. package/android/build/intermediates/cxx/Debug/2a3w6u3n/logs/arm64-v8a/metadata_generation_record.json +158 -0
  441. package/android/build/intermediates/cxx/Debug/2a3w6u3n/logs/armeabi-v7a/build_command_targets.bat +10 -0
  442. package/android/build/intermediates/cxx/Debug/2a3w6u3n/logs/armeabi-v7a/build_model.json +199 -0
  443. package/android/build/intermediates/cxx/Debug/2a3w6u3n/logs/armeabi-v7a/build_stderr_targets.txt +0 -0
  444. package/android/build/intermediates/cxx/Debug/2a3w6u3n/logs/armeabi-v7a/build_stdout_targets.txt +59 -0
  445. package/android/build/intermediates/cxx/Debug/2a3w6u3n/logs/armeabi-v7a/configure_command.bat +19 -0
  446. package/android/build/intermediates/cxx/Debug/2a3w6u3n/logs/armeabi-v7a/configure_stderr.txt +1 -0
  447. package/android/build/intermediates/cxx/Debug/2a3w6u3n/logs/armeabi-v7a/configure_stdout.txt +19 -0
  448. package/android/build/intermediates/cxx/Debug/2a3w6u3n/logs/armeabi-v7a/generate_cxx_metadata_8659_timing.txt +9 -0
  449. package/android/build/intermediates/cxx/Debug/2a3w6u3n/logs/armeabi-v7a/metadata_generation_record.json +158 -0
  450. package/android/build/intermediates/cxx/Debug/2a3w6u3n/logs/x86/build_command_targets.bat +10 -0
  451. package/android/build/intermediates/cxx/Debug/2a3w6u3n/logs/x86/build_model.json +199 -0
  452. package/android/build/intermediates/cxx/Debug/2a3w6u3n/logs/x86/build_stderr_targets.txt +0 -0
  453. package/android/build/intermediates/cxx/Debug/2a3w6u3n/logs/x86/build_stdout_targets.txt +55 -0
  454. package/android/build/intermediates/cxx/Debug/2a3w6u3n/logs/x86/configure_command.bat +19 -0
  455. package/android/build/intermediates/cxx/Debug/2a3w6u3n/logs/x86/configure_stderr.txt +0 -0
  456. package/android/build/intermediates/cxx/Debug/2a3w6u3n/logs/x86/configure_stdout.txt +19 -0
  457. package/android/build/intermediates/cxx/Debug/2a3w6u3n/logs/x86/generate_cxx_metadata_8659_timing.txt +9 -0
  458. package/android/build/intermediates/cxx/Debug/2a3w6u3n/logs/x86/metadata_generation_record.json +158 -0
  459. package/android/build/intermediates/cxx/Debug/2a3w6u3n/logs/x86_64/build_command_targets.bat +10 -0
  460. package/android/build/intermediates/cxx/Debug/2a3w6u3n/logs/x86_64/build_model.json +199 -0
  461. package/android/build/intermediates/cxx/Debug/2a3w6u3n/logs/x86_64/build_stderr_targets.txt +0 -0
  462. package/android/build/intermediates/cxx/Debug/2a3w6u3n/logs/x86_64/build_stdout_targets.txt +55 -0
  463. package/android/build/intermediates/cxx/Debug/2a3w6u3n/logs/x86_64/configure_command.bat +19 -0
  464. package/android/build/intermediates/cxx/Debug/2a3w6u3n/logs/x86_64/configure_stderr.txt +0 -0
  465. package/android/build/intermediates/cxx/Debug/2a3w6u3n/logs/x86_64/configure_stdout.txt +19 -0
  466. package/android/build/intermediates/cxx/Debug/2a3w6u3n/logs/x86_64/generate_cxx_metadata_8659_timing.txt +9 -0
  467. package/android/build/intermediates/cxx/Debug/2a3w6u3n/logs/x86_64/metadata_generation_record.json +158 -0
  468. package/android/build/intermediates/cxx/Debug/2a3w6u3n/obj/arm64-v8a/cpuid +0 -0
  469. package/android/build/intermediates/cxx/Debug/2a3w6u3n/obj/arm64-v8a/libfaceantispoof.so +0 -0
  470. package/android/build/intermediates/cxx/Debug/2a3w6u3n/obj/arm64-v8a/libfastyuv.so +0 -0
  471. package/android/build/intermediates/cxx/Debug/2a3w6u3n/obj/arm64-v8a/libyuv.so +0 -0
  472. package/android/build/intermediates/cxx/Debug/2a3w6u3n/obj/arm64-v8a/yuvconstants +0 -0
  473. package/android/build/intermediates/cxx/Debug/2a3w6u3n/obj/arm64-v8a/yuvconvert +0 -0
  474. package/android/build/intermediates/cxx/Debug/2a3w6u3n/obj/armeabi-v7a/cpuid +0 -0
  475. package/android/build/intermediates/cxx/Debug/2a3w6u3n/obj/armeabi-v7a/libfaceantispoof.so +0 -0
  476. package/android/build/intermediates/cxx/Debug/2a3w6u3n/obj/armeabi-v7a/libfastyuv.so +0 -0
  477. package/android/build/intermediates/cxx/Debug/2a3w6u3n/obj/armeabi-v7a/libyuv.so +0 -0
  478. package/android/build/intermediates/cxx/Debug/2a3w6u3n/obj/armeabi-v7a/yuvconstants +0 -0
  479. package/android/build/intermediates/cxx/Debug/2a3w6u3n/obj/armeabi-v7a/yuvconvert +0 -0
  480. package/android/build/intermediates/cxx/Debug/2a3w6u3n/obj/x86/cpuid +0 -0
  481. package/android/build/intermediates/cxx/Debug/2a3w6u3n/obj/x86/libfaceantispoof.so +0 -0
  482. package/android/build/intermediates/cxx/Debug/2a3w6u3n/obj/x86/libfastyuv.so +0 -0
  483. package/android/build/intermediates/cxx/Debug/2a3w6u3n/obj/x86/libyuv.so +0 -0
  484. package/android/build/intermediates/cxx/Debug/2a3w6u3n/obj/x86/yuvconstants +0 -0
  485. package/android/build/intermediates/cxx/Debug/2a3w6u3n/obj/x86/yuvconvert +0 -0
  486. package/android/build/intermediates/cxx/Debug/2a3w6u3n/obj/x86_64/cpuid +0 -0
  487. package/android/build/intermediates/cxx/Debug/2a3w6u3n/obj/x86_64/libfaceantispoof.so +0 -0
  488. package/android/build/intermediates/cxx/Debug/2a3w6u3n/obj/x86_64/libfastyuv.so +0 -0
  489. package/android/build/intermediates/cxx/Debug/2a3w6u3n/obj/x86_64/libyuv.so +0 -0
  490. package/android/build/intermediates/cxx/Debug/2a3w6u3n/obj/x86_64/yuvconstants +0 -0
  491. package/android/build/intermediates/cxx/Debug/2a3w6u3n/obj/x86_64/yuvconvert +0 -0
  492. package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +1 -0
  493. package/android/build/intermediates/incremental/debug/packageDebugResources/merged.dir/values/values.xml +4 -0
  494. package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +2 -0
  495. package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +2 -0
  496. package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +2 -0
  497. package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +2 -0
  498. package/android/build/intermediates/java_res/debug/processDebugJavaRes/out/META-INF/react-native-vision-camera-face-antispoof-detector_debug.kotlin_module +0 -0
  499. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/faceantispoof/BuildConfig.class +0 -0
  500. package/android/build/intermediates/library_assets/debug/packageDebugAssets/out/FaceAntiSpoofing.tflite +0 -0
  501. package/android/build/intermediates/library_assets/debug/packageDebugAssets/out/spoof_model_scale_2_7.tflite +0 -0
  502. package/android/build/intermediates/library_assets/debug/packageDebugAssets/out/spoof_model_scale_4_0.tflite +0 -0
  503. package/android/build/intermediates/library_jni/debug/copyDebugJniLibsProjectOnly/jni/arm64-v8a/libfaceantispoof.so +0 -0
  504. package/android/build/intermediates/library_jni/debug/copyDebugJniLibsProjectOnly/jni/arm64-v8a/libfastyuv.so +0 -0
  505. package/android/build/intermediates/library_jni/debug/copyDebugJniLibsProjectOnly/jni/arm64-v8a/libyuv.so +0 -0
  506. package/android/build/intermediates/library_jni/debug/copyDebugJniLibsProjectOnly/jni/armeabi-v7a/libfaceantispoof.so +0 -0
  507. package/android/build/intermediates/library_jni/debug/copyDebugJniLibsProjectOnly/jni/armeabi-v7a/libfastyuv.so +0 -0
  508. package/android/build/intermediates/library_jni/debug/copyDebugJniLibsProjectOnly/jni/armeabi-v7a/libyuv.so +0 -0
  509. package/android/build/intermediates/library_jni/debug/copyDebugJniLibsProjectOnly/jni/x86/libfaceantispoof.so +0 -0
  510. package/android/build/intermediates/library_jni/debug/copyDebugJniLibsProjectOnly/jni/x86/libfastyuv.so +0 -0
  511. package/android/build/intermediates/library_jni/debug/copyDebugJniLibsProjectOnly/jni/x86/libyuv.so +0 -0
  512. package/android/build/intermediates/library_jni/debug/copyDebugJniLibsProjectOnly/jni/x86_64/libfaceantispoof.so +0 -0
  513. package/android/build/intermediates/library_jni/debug/copyDebugJniLibsProjectOnly/jni/x86_64/libfastyuv.so +0 -0
  514. package/android/build/intermediates/library_jni/debug/copyDebugJniLibsProjectOnly/jni/x86_64/libyuv.so +0 -0
  515. package/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +3 -0
  516. package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +17 -0
  517. package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +13 -0
  518. package/android/build/intermediates/merged_native_libs/debug/mergeDebugNativeLibs/out/lib/arm64-v8a/libfaceantispoof.so +0 -0
  519. package/android/build/intermediates/merged_native_libs/debug/mergeDebugNativeLibs/out/lib/arm64-v8a/libfastyuv.so +0 -0
  520. package/android/build/intermediates/merged_native_libs/debug/mergeDebugNativeLibs/out/lib/arm64-v8a/libyuv.so +0 -0
  521. package/android/build/intermediates/merged_native_libs/debug/mergeDebugNativeLibs/out/lib/armeabi-v7a/libfaceantispoof.so +0 -0
  522. package/android/build/intermediates/merged_native_libs/debug/mergeDebugNativeLibs/out/lib/armeabi-v7a/libfastyuv.so +0 -0
  523. package/android/build/intermediates/merged_native_libs/debug/mergeDebugNativeLibs/out/lib/armeabi-v7a/libyuv.so +0 -0
  524. package/android/build/intermediates/merged_native_libs/debug/mergeDebugNativeLibs/out/lib/x86/libfaceantispoof.so +0 -0
  525. package/android/build/intermediates/merged_native_libs/debug/mergeDebugNativeLibs/out/lib/x86/libfastyuv.so +0 -0
  526. package/android/build/intermediates/merged_native_libs/debug/mergeDebugNativeLibs/out/lib/x86/libyuv.so +0 -0
  527. package/android/build/intermediates/merged_native_libs/debug/mergeDebugNativeLibs/out/lib/x86_64/libfaceantispoof.so +0 -0
  528. package/android/build/intermediates/merged_native_libs/debug/mergeDebugNativeLibs/out/lib/x86_64/libfastyuv.so +0 -0
  529. package/android/build/intermediates/merged_native_libs/debug/mergeDebugNativeLibs/out/lib/x86_64/libyuv.so +0 -0
  530. package/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +1 -0
  531. package/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +1 -0
  532. package/android/build/intermediates/packaged_res/debug/packageDebugResources/values/values.xml +4 -0
  533. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/META-INF/react-native-vision-camera-face-antispoof-detector_debug.kotlin_module +0 -0
  534. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/faceantispoof/AcceleratorConfig.class +0 -0
  535. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/faceantispoof/AntiSpoofingResult.class +0 -0
  536. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/faceantispoof/BuildConfig.class +0 -0
  537. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/faceantispoof/FaceAntiSpoofFrameProcessor.class +0 -0
  538. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/faceantispoof/FaceAntiSpoofModule$Companion.class +0 -0
  539. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/faceantispoof/FaceAntiSpoofModule.class +0 -0
  540. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/faceantispoof/FaceAntiSpoofPackage.class +0 -0
  541. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/faceantispoof/FaceAntiSpoofingAdvanced$Companion.class +0 -0
  542. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/faceantispoof/FaceAntiSpoofingAdvanced.class +0 -0
  543. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/faceantispoof/FastYuv.class +0 -0
  544. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/faceantispoof/YuvToFloatArrayConverter.class +0 -0
  545. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/faceantispoof/YuvToRgbConverter.class +0 -0
  546. package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
  547. package/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +2 -0
  548. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
  549. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
  550. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
  551. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len +0 -0
  552. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
  553. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i +0 -0
  554. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
  555. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
  556. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
  557. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
  558. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
  559. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
  560. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
  561. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i.len +0 -0
  562. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
  563. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
  564. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
  565. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
  566. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
  567. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
  568. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
  569. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab +0 -0
  570. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream +0 -0
  571. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream.len +0 -0
  572. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.len +0 -0
  573. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.values.at +0 -0
  574. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i +0 -0
  575. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i.len +0 -0
  576. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
  577. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
  578. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
  579. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
  580. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
  581. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
  582. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
  583. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
  584. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
  585. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
  586. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
  587. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
  588. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
  589. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
  590. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
  591. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
  592. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
  593. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
  594. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
  595. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
  596. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
  597. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
  598. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
  599. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
  600. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
  601. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
  602. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
  603. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
  604. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
  605. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
  606. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
  607. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
  608. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
  609. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
  610. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
  611. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +2 -0
  612. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
  613. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
  614. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
  615. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len +0 -0
  616. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
  617. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i +0 -0
  618. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
  619. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
  620. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
  621. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
  622. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
  623. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
  624. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
  625. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
  626. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
  627. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
  628. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
  629. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
  630. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
  631. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
  632. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len +0 -0
  633. package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
  634. package/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin +0 -0
  635. package/android/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
  636. package/android/build/outputs/logs/manifest-merger-debug-report.txt +25 -0
  637. package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  638. package/android/build/tmp/kotlin-classes/debug/META-INF/react-native-vision-camera-face-antispoof-detector_debug.kotlin_module +0 -0
  639. package/android/build/tmp/kotlin-classes/debug/com/faceantispoof/AcceleratorConfig.class +0 -0
  640. package/android/build/tmp/kotlin-classes/debug/com/faceantispoof/AntiSpoofingResult.class +0 -0
  641. package/android/build/tmp/kotlin-classes/debug/com/faceantispoof/FaceAntiSpoofFrameProcessor.class +0 -0
  642. package/android/build/tmp/kotlin-classes/debug/com/faceantispoof/FaceAntiSpoofModule$Companion.class +0 -0
  643. package/android/build/tmp/kotlin-classes/debug/com/faceantispoof/FaceAntiSpoofModule.class +0 -0
  644. package/android/build/tmp/kotlin-classes/debug/com/faceantispoof/FaceAntiSpoofPackage.class +0 -0
  645. package/android/build/tmp/kotlin-classes/debug/com/faceantispoof/FaceAntiSpoofingAdvanced$Companion.class +0 -0
  646. package/android/build/tmp/kotlin-classes/debug/com/faceantispoof/FaceAntiSpoofingAdvanced.class +0 -0
  647. package/android/build/tmp/kotlin-classes/debug/com/faceantispoof/FastYuv.class +0 -0
  648. package/android/build/tmp/kotlin-classes/debug/com/faceantispoof/YuvToFloatArrayConverter.class +0 -0
  649. package/android/build/tmp/kotlin-classes/debug/com/faceantispoof/YuvToRgbConverter.class +0 -0
  650. package/android/build.gradle +128 -0
  651. package/android/src/main/AndroidManifest.xml +9 -0
  652. package/android/src/main/assets/FaceAntiSpoofing.tflite +0 -0
  653. package/android/src/main/assets/spoof_model_scale_2_7.tflite +0 -0
  654. package/android/src/main/assets/spoof_model_scale_4_0.tflite +0 -0
  655. package/android/src/main/cpp/CMakeLists.txt +94 -0
  656. package/android/src/main/cpp/FaceAntiSpoofJSI.cpp +68 -0
  657. package/android/src/main/cpp/FastYuvJni.cpp +111 -0
  658. package/android/src/main/cpp/fast_yuv.cpp +332 -0
  659. package/android/src/main/cpp/fast_yuv.h +23 -0
  660. package/android/src/main/cpp/libyuv/.clang-format +6 -0
  661. package/android/src/main/cpp/libyuv/.gn +40 -0
  662. package/android/src/main/cpp/libyuv/.vpython3 +410 -0
  663. package/android/src/main/cpp/libyuv/AUTHORS +7 -0
  664. package/android/src/main/cpp/libyuv/Android.bp +202 -0
  665. package/android/src/main/cpp/libyuv/Android.mk +106 -0
  666. package/android/src/main/cpp/libyuv/BUILD.gn +490 -0
  667. package/android/src/main/cpp/libyuv/CM_linux_packages.cmake +70 -0
  668. package/android/src/main/cpp/libyuv/CMakeLists.txt +252 -0
  669. package/android/src/main/cpp/libyuv/DEPS +935 -0
  670. package/android/src/main/cpp/libyuv/DIR_METADATA +3 -0
  671. package/android/src/main/cpp/libyuv/LICENSE +29 -0
  672. package/android/src/main/cpp/libyuv/OWNERS +11 -0
  673. package/android/src/main/cpp/libyuv/PATENTS +24 -0
  674. package/android/src/main/cpp/libyuv/PRESUBMIT.py +65 -0
  675. package/android/src/main/cpp/libyuv/README.chromium +11 -0
  676. package/android/src/main/cpp/libyuv/README.md +19 -0
  677. package/android/src/main/cpp/libyuv/build_overrides/build.gni +60 -0
  678. package/android/src/main/cpp/libyuv/build_overrides/gtest.gni +19 -0
  679. package/android/src/main/cpp/libyuv/build_overrides/partition_alloc.gni +17 -0
  680. package/android/src/main/cpp/libyuv/codereview.settings +5 -0
  681. package/android/src/main/cpp/libyuv/docs/deprecated_builds.md +409 -0
  682. package/android/src/main/cpp/libyuv/docs/environment_variables.md +64 -0
  683. package/android/src/main/cpp/libyuv/docs/feature_detection.md +108 -0
  684. package/android/src/main/cpp/libyuv/docs/filtering.md +196 -0
  685. package/android/src/main/cpp/libyuv/docs/formats.md +208 -0
  686. package/android/src/main/cpp/libyuv/docs/getting_started.md +296 -0
  687. package/android/src/main/cpp/libyuv/docs/rotation.md +107 -0
  688. package/android/src/main/cpp/libyuv/download_vs_toolchain.py +29 -0
  689. package/android/src/main/cpp/libyuv/include/libyuv/basic_types.h +68 -0
  690. package/android/src/main/cpp/libyuv/include/libyuv/compare.h +111 -0
  691. package/android/src/main/cpp/libyuv/include/libyuv/compare_row.h +112 -0
  692. package/android/src/main/cpp/libyuv/include/libyuv/convert.h +1117 -0
  693. package/android/src/main/cpp/libyuv/include/libyuv/convert_argb.h +2335 -0
  694. package/android/src/main/cpp/libyuv/include/libyuv/convert_from.h +203 -0
  695. package/android/src/main/cpp/libyuv/include/libyuv/convert_from_argb.h +394 -0
  696. package/android/src/main/cpp/libyuv/include/libyuv/cpu_id.h +147 -0
  697. package/android/src/main/cpp/libyuv/include/libyuv/cpu_support.h +99 -0
  698. package/android/src/main/cpp/libyuv/include/libyuv/loongson_intrinsics.h +1949 -0
  699. package/android/src/main/cpp/libyuv/include/libyuv/mjpeg_decoder.h +195 -0
  700. package/android/src/main/cpp/libyuv/include/libyuv/planar_functions.h +1131 -0
  701. package/android/src/main/cpp/libyuv/include/libyuv/rotate.h +296 -0
  702. package/android/src/main/cpp/libyuv/include/libyuv/rotate_argb.h +37 -0
  703. package/android/src/main/cpp/libyuv/include/libyuv/rotate_row.h +265 -0
  704. package/android/src/main/cpp/libyuv/include/libyuv/row.h +6738 -0
  705. package/android/src/main/cpp/libyuv/include/libyuv/row_sve.h +2154 -0
  706. package/android/src/main/cpp/libyuv/include/libyuv/scale.h +336 -0
  707. package/android/src/main/cpp/libyuv/include/libyuv/scale_argb.h +76 -0
  708. package/android/src/main/cpp/libyuv/include/libyuv/scale_rgb.h +42 -0
  709. package/android/src/main/cpp/libyuv/include/libyuv/scale_row.h +1726 -0
  710. package/android/src/main/cpp/libyuv/include/libyuv/scale_uv.h +51 -0
  711. package/android/src/main/cpp/libyuv/include/libyuv/version.h +16 -0
  712. package/android/src/main/cpp/libyuv/include/libyuv/video_common.h +222 -0
  713. package/android/src/main/cpp/libyuv/include/libyuv.h +33 -0
  714. package/android/src/main/cpp/libyuv/infra/config/OWNERS +3 -0
  715. package/android/src/main/cpp/libyuv/infra/config/PRESUBMIT.py +17 -0
  716. package/android/src/main/cpp/libyuv/infra/config/README.md +2 -0
  717. package/android/src/main/cpp/libyuv/infra/config/codereview.settings +6 -0
  718. package/android/src/main/cpp/libyuv/infra/config/commit-queue.cfg +144 -0
  719. package/android/src/main/cpp/libyuv/infra/config/cr-buildbucket.cfg +1185 -0
  720. package/android/src/main/cpp/libyuv/infra/config/luci-logdog.cfg +9 -0
  721. package/android/src/main/cpp/libyuv/infra/config/luci-milo.cfg +246 -0
  722. package/android/src/main/cpp/libyuv/infra/config/luci-scheduler.cfg +385 -0
  723. package/android/src/main/cpp/libyuv/infra/config/main.star +402 -0
  724. package/android/src/main/cpp/libyuv/infra/config/project.cfg +16 -0
  725. package/android/src/main/cpp/libyuv/infra/config/realms.cfg +111 -0
  726. package/android/src/main/cpp/libyuv/libyuv.gni +34 -0
  727. package/android/src/main/cpp/libyuv/libyuv.gyp +149 -0
  728. package/android/src/main/cpp/libyuv/libyuv.gypi +87 -0
  729. package/android/src/main/cpp/libyuv/linux.mk +96 -0
  730. package/android/src/main/cpp/libyuv/public.mk +13 -0
  731. package/android/src/main/cpp/libyuv/pylintrc +49 -0
  732. package/android/src/main/cpp/libyuv/riscv_script/prepare_toolchain_qemu.sh +74 -0
  733. package/android/src/main/cpp/libyuv/riscv_script/riscv-clang.cmake +56 -0
  734. package/android/src/main/cpp/libyuv/riscv_script/run_qemu.sh +15 -0
  735. package/android/src/main/cpp/libyuv/source/compare.cc +435 -0
  736. package/android/src/main/cpp/libyuv/source/compare_common.cc +74 -0
  737. package/android/src/main/cpp/libyuv/source/compare_gcc.cc +362 -0
  738. package/android/src/main/cpp/libyuv/source/compare_neon.cc +96 -0
  739. package/android/src/main/cpp/libyuv/source/compare_neon64.cc +223 -0
  740. package/android/src/main/cpp/libyuv/source/compare_win.cc +241 -0
  741. package/android/src/main/cpp/libyuv/source/convert.cc +4746 -0
  742. package/android/src/main/cpp/libyuv/source/convert_argb.cc +9179 -0
  743. package/android/src/main/cpp/libyuv/source/convert_from.cc +866 -0
  744. package/android/src/main/cpp/libyuv/source/convert_from_argb.cc +3671 -0
  745. package/android/src/main/cpp/libyuv/source/convert_jpeg.cc +602 -0
  746. package/android/src/main/cpp/libyuv/source/convert_to_argb.cc +391 -0
  747. package/android/src/main/cpp/libyuv/source/convert_to_i420.cc +288 -0
  748. package/android/src/main/cpp/libyuv/source/cpu_id.cc +496 -0
  749. package/android/src/main/cpp/libyuv/source/mjpeg_decoder.cc +580 -0
  750. package/android/src/main/cpp/libyuv/source/mjpeg_validate.cc +71 -0
  751. package/android/src/main/cpp/libyuv/source/planar_functions.cc +5663 -0
  752. package/android/src/main/cpp/libyuv/source/rotate.cc +1241 -0
  753. package/android/src/main/cpp/libyuv/source/rotate_any.cc +76 -0
  754. package/android/src/main/cpp/libyuv/source/rotate_argb.cc +259 -0
  755. package/android/src/main/cpp/libyuv/source/rotate_common.cc +208 -0
  756. package/android/src/main/cpp/libyuv/source/rotate_gcc.cc +505 -0
  757. package/android/src/main/cpp/libyuv/source/rotate_lsx.cc +233 -0
  758. package/android/src/main/cpp/libyuv/source/rotate_neon.cc +219 -0
  759. package/android/src/main/cpp/libyuv/source/rotate_neon64.cc +273 -0
  760. package/android/src/main/cpp/libyuv/source/rotate_sme.cc +174 -0
  761. package/android/src/main/cpp/libyuv/source/rotate_win.cc +253 -0
  762. package/android/src/main/cpp/libyuv/source/row_any.cc +2519 -0
  763. package/android/src/main/cpp/libyuv/source/row_common.cc +4461 -0
  764. package/android/src/main/cpp/libyuv/source/row_gcc.cc +9570 -0
  765. package/android/src/main/cpp/libyuv/source/row_lasx.cc +2343 -0
  766. package/android/src/main/cpp/libyuv/source/row_lsx.cc +3030 -0
  767. package/android/src/main/cpp/libyuv/source/row_neon.cc +4026 -0
  768. package/android/src/main/cpp/libyuv/source/row_neon64.cc +5617 -0
  769. package/android/src/main/cpp/libyuv/source/row_rvv.cc +2599 -0
  770. package/android/src/main/cpp/libyuv/source/row_sme.cc +1183 -0
  771. package/android/src/main/cpp/libyuv/source/row_sve.cc +1088 -0
  772. package/android/src/main/cpp/libyuv/source/row_win.cc +6453 -0
  773. package/android/src/main/cpp/libyuv/source/scale.cc +2710 -0
  774. package/android/src/main/cpp/libyuv/source/scale_any.cc +991 -0
  775. package/android/src/main/cpp/libyuv/source/scale_argb.cc +1158 -0
  776. package/android/src/main/cpp/libyuv/source/scale_common.cc +1977 -0
  777. package/android/src/main/cpp/libyuv/source/scale_gcc.cc +2947 -0
  778. package/android/src/main/cpp/libyuv/source/scale_lsx.cc +739 -0
  779. package/android/src/main/cpp/libyuv/source/scale_neon.cc +1449 -0
  780. package/android/src/main/cpp/libyuv/source/scale_neon64.cc +1552 -0
  781. package/android/src/main/cpp/libyuv/source/scale_rgb.cc +82 -0
  782. package/android/src/main/cpp/libyuv/source/scale_rvv.cc +1971 -0
  783. package/android/src/main/cpp/libyuv/source/scale_sme.cc +555 -0
  784. package/android/src/main/cpp/libyuv/source/scale_uv.cc +1159 -0
  785. package/android/src/main/cpp/libyuv/source/scale_win.cc +1392 -0
  786. package/android/src/main/cpp/libyuv/source/test.sh +35 -0
  787. package/android/src/main/cpp/libyuv/source/video_common.cc +62 -0
  788. package/android/src/main/cpp/libyuv/tools_libyuv/OWNERS +4 -0
  789. package/android/src/main/cpp/libyuv/tools_libyuv/autoroller/roll_deps.py +931 -0
  790. package/android/src/main/cpp/libyuv/tools_libyuv/autoroller/unittests/roll_deps_test.py +164 -0
  791. package/android/src/main/cpp/libyuv/tools_libyuv/autoroller/unittests/testdata/DEPS +21 -0
  792. package/android/src/main/cpp/libyuv/tools_libyuv/autoroller/unittests/testdata/DEPS.chromium.new +13 -0
  793. package/android/src/main/cpp/libyuv/tools_libyuv/autoroller/unittests/testdata/DEPS.chromium.old +13 -0
  794. package/android/src/main/cpp/libyuv/tools_libyuv/get_landmines.py +38 -0
  795. package/android/src/main/cpp/libyuv/tools_libyuv/msan/OWNERS +3 -0
  796. package/android/src/main/cpp/libyuv/tools_libyuv/msan/blacklist.txt +9 -0
  797. package/android/src/main/cpp/libyuv/tools_libyuv/ubsan/OWNERS +3 -0
  798. package/android/src/main/cpp/libyuv/tools_libyuv/ubsan/blacklist.txt +15 -0
  799. package/android/src/main/cpp/libyuv/tools_libyuv/ubsan/vptr_blacklist.txt +25 -0
  800. package/android/src/main/cpp/libyuv/unit_test/basictypes_test.cc +43 -0
  801. package/android/src/main/cpp/libyuv/unit_test/color_test.cc +848 -0
  802. package/android/src/main/cpp/libyuv/unit_test/compare_test.cc +739 -0
  803. package/android/src/main/cpp/libyuv/unit_test/convert_argb_test.cc +2867 -0
  804. package/android/src/main/cpp/libyuv/unit_test/convert_test.cc +2133 -0
  805. package/android/src/main/cpp/libyuv/unit_test/cpu_test.cc +427 -0
  806. package/android/src/main/cpp/libyuv/unit_test/cpu_thread_test.cc +63 -0
  807. package/android/src/main/cpp/libyuv/unit_test/math_test.cc +160 -0
  808. package/android/src/main/cpp/libyuv/unit_test/planar_test.cc +4731 -0
  809. package/android/src/main/cpp/libyuv/unit_test/rotate_argb_test.cc +334 -0
  810. package/android/src/main/cpp/libyuv/unit_test/rotate_test.cc +962 -0
  811. package/android/src/main/cpp/libyuv/unit_test/scale_argb_test.cc +590 -0
  812. package/android/src/main/cpp/libyuv/unit_test/scale_plane_test.cc +465 -0
  813. package/android/src/main/cpp/libyuv/unit_test/scale_rgb_test.cc +280 -0
  814. package/android/src/main/cpp/libyuv/unit_test/scale_test.cc +1135 -0
  815. package/android/src/main/cpp/libyuv/unit_test/scale_uv_test.cc +249 -0
  816. package/android/src/main/cpp/libyuv/unit_test/testdata/arm_v7.txt +12 -0
  817. package/android/src/main/cpp/libyuv/unit_test/testdata/mips.txt +7 -0
  818. package/android/src/main/cpp/libyuv/unit_test/testdata/mips_loongson2k.txt +5 -0
  819. package/android/src/main/cpp/libyuv/unit_test/testdata/mips_loongson3.txt +10 -0
  820. package/android/src/main/cpp/libyuv/unit_test/testdata/mips_loongson_mmi.txt +7 -0
  821. package/android/src/main/cpp/libyuv/unit_test/testdata/riscv64.txt +4 -0
  822. package/android/src/main/cpp/libyuv/unit_test/testdata/riscv64_rvv.txt +4 -0
  823. package/android/src/main/cpp/libyuv/unit_test/testdata/riscv64_rvv_zvfh.txt +4 -0
  824. package/android/src/main/cpp/libyuv/unit_test/testdata/tegra3.txt +23 -0
  825. package/android/src/main/cpp/libyuv/unit_test/testdata/test0.jpg +0 -0
  826. package/android/src/main/cpp/libyuv/unit_test/testdata/test1.jpg +0 -0
  827. package/android/src/main/cpp/libyuv/unit_test/testdata/test2.jpg +0 -0
  828. package/android/src/main/cpp/libyuv/unit_test/testdata/test3.jpg +0 -0
  829. package/android/src/main/cpp/libyuv/unit_test/testdata/test4.jpg +0 -0
  830. package/android/src/main/cpp/libyuv/unit_test/unit_test.cc +581 -0
  831. package/android/src/main/cpp/libyuv/unit_test/unit_test.h +232 -0
  832. package/android/src/main/cpp/libyuv/unit_test/video_common_test.cc +112 -0
  833. package/android/src/main/cpp/libyuv/util/Makefile +9 -0
  834. package/android/src/main/cpp/libyuv/util/color.cc +120 -0
  835. package/android/src/main/cpp/libyuv/util/compare.cc +67 -0
  836. package/android/src/main/cpp/libyuv/util/cpuid.c +211 -0
  837. package/android/src/main/cpp/libyuv/util/i444tonv12_eg.cc +28 -0
  838. package/android/src/main/cpp/libyuv/util/psnr.cc +291 -0
  839. package/android/src/main/cpp/libyuv/util/psnr.h +47 -0
  840. package/android/src/main/cpp/libyuv/util/psnr_main.cc +620 -0
  841. package/android/src/main/cpp/libyuv/util/ssim.cc +364 -0
  842. package/android/src/main/cpp/libyuv/util/ssim.h +38 -0
  843. package/android/src/main/cpp/libyuv/util/yuvconstants.c +114 -0
  844. package/android/src/main/cpp/libyuv/util/yuvconvert.cc +367 -0
  845. package/android/src/main/cpp/libyuv/winarm.mk +47 -0
  846. package/android/src/main/java/com/faceantispoof/AcceleratorConfig.kt +49 -0
  847. package/android/src/main/java/com/faceantispoof/FaceAntiSpoofFrameProcessor.kt +145 -0
  848. package/android/src/main/java/com/faceantispoof/FaceAntiSpoofModule.kt +170 -0
  849. package/android/src/main/java/com/faceantispoof/FaceAntiSpoofPackage.kt +38 -0
  850. package/android/src/main/java/com/faceantispoof/FaceAntiSpoofingAdvanced.kt +288 -0
  851. package/android/src/main/java/com/faceantispoof/FastYuv.kt +51 -0
  852. package/android/src/main/java/com/faceantispoof/YuvToFloatArrayConverter.kt +198 -0
  853. package/android/src/main/java/com/faceantispoof/YuvToRgbConverter.kt +73 -0
  854. package/android/src/main/res/values/strings.xml +3 -0
  855. package/index.d.ts +84 -0
  856. package/index.js +47 -0
  857. package/package.json +73 -0
@@ -0,0 +1,4746 @@
1
+ /*
2
+ * Copyright 2011 The LibYuv Project Authors. All rights reserved.
3
+ *
4
+ * Use of this source code is governed by a BSD-style license
5
+ * that can be found in the LICENSE file in the root of the source
6
+ * tree. An additional intellectual property rights grant can be found
7
+ * in the file PATENTS. All contributing project authors may
8
+ * be found in the AUTHORS file in the root of the source tree.
9
+ */
10
+
11
+ #include "libyuv/convert.h"
12
+
13
+ #include "libyuv/basic_types.h"
14
+ #include "libyuv/cpu_id.h"
15
+ #include "libyuv/planar_functions.h"
16
+ #include "libyuv/rotate.h"
17
+ #include "libyuv/row.h"
18
+ #include "libyuv/scale.h" // For ScalePlane()
19
+ #include "libyuv/scale_row.h" // For FixedDiv
20
+ #include "libyuv/scale_uv.h" // For UVScale()
21
+
22
+ #ifdef __cplusplus
23
+ namespace libyuv {
24
+ extern "C" {
25
+ #endif
26
+
27
+ // Subsample amount uses a shift.
28
+ // v is value
29
+ // a is amount to add to round up
30
+ // s is shift to subsample down
31
+ #define SUBSAMPLE(v, a, s) (v < 0) ? (-((-v + a) >> s)) : ((v + a) >> s)
32
+ static __inline int Abs(int v) {
33
+ return v >= 0 ? v : -v;
34
+ }
35
+
36
+ // Any I4xx To I420 format
37
+ static int I4xxToI420(const uint8_t* src_y,
38
+ int src_stride_y,
39
+ const uint8_t* src_u,
40
+ int src_stride_u,
41
+ const uint8_t* src_v,
42
+ int src_stride_v,
43
+ uint8_t* dst_y,
44
+ int dst_stride_y,
45
+ uint8_t* dst_u,
46
+ int dst_stride_u,
47
+ uint8_t* dst_v,
48
+ int dst_stride_v,
49
+ int src_y_width,
50
+ int src_y_height,
51
+ int src_uv_width,
52
+ int src_uv_height) {
53
+ const int dst_y_width = src_y_width;
54
+ const int dst_y_height = Abs(src_y_height);
55
+ const int dst_uv_width = SUBSAMPLE(dst_y_width, 1, 1);
56
+ const int dst_uv_height = SUBSAMPLE(dst_y_height, 1, 1);
57
+ int r;
58
+ if ((!src_y && dst_y) || !src_u || !src_v || !dst_u || !dst_v ||
59
+ src_y_width <= 0 || src_y_height == 0 || src_uv_width <= 0 ||
60
+ src_uv_height == 0) {
61
+ return -1;
62
+ }
63
+ if (dst_y) {
64
+ CopyPlane(src_y, src_stride_y, dst_y, dst_stride_y, src_y_width,
65
+ src_y_height);
66
+ }
67
+ r = ScalePlane(src_u, src_stride_u, src_uv_width, src_uv_height, dst_u,
68
+ dst_stride_u, dst_uv_width, dst_uv_height, kFilterBilinear);
69
+ if (r != 0) {
70
+ return r;
71
+ }
72
+ r = ScalePlane(src_v, src_stride_v, src_uv_width, src_uv_height, dst_v,
73
+ dst_stride_v, dst_uv_width, dst_uv_height, kFilterBilinear);
74
+ return r;
75
+ }
76
+
77
+ // Copy I420 with optional vertical flipping using negative height.
78
+ LIBYUV_API
79
+ int I420Copy(const uint8_t* src_y,
80
+ int src_stride_y,
81
+ const uint8_t* src_u,
82
+ int src_stride_u,
83
+ const uint8_t* src_v,
84
+ int src_stride_v,
85
+ uint8_t* dst_y,
86
+ int dst_stride_y,
87
+ uint8_t* dst_u,
88
+ int dst_stride_u,
89
+ uint8_t* dst_v,
90
+ int dst_stride_v,
91
+ int width,
92
+ int height) {
93
+ int halfwidth = (width + 1) >> 1;
94
+ int halfheight = (height + 1) >> 1;
95
+ if ((!src_y && dst_y) || !src_u || !src_v || !dst_u || !dst_v || width <= 0 ||
96
+ height == 0) {
97
+ return -1;
98
+ }
99
+ // Negative height means invert the image.
100
+ if (height < 0) {
101
+ height = -height;
102
+ halfheight = (height + 1) >> 1;
103
+ src_y = src_y + (height - 1) * src_stride_y;
104
+ src_u = src_u + (halfheight - 1) * src_stride_u;
105
+ src_v = src_v + (halfheight - 1) * src_stride_v;
106
+ src_stride_y = -src_stride_y;
107
+ src_stride_u = -src_stride_u;
108
+ src_stride_v = -src_stride_v;
109
+ }
110
+
111
+ if (dst_y) {
112
+ CopyPlane(src_y, src_stride_y, dst_y, dst_stride_y, width, height);
113
+ }
114
+ // Copy UV planes.
115
+ CopyPlane(src_u, src_stride_u, dst_u, dst_stride_u, halfwidth, halfheight);
116
+ CopyPlane(src_v, src_stride_v, dst_v, dst_stride_v, halfwidth, halfheight);
117
+ return 0;
118
+ }
119
+
120
+ // Copy I010 with optional flipping.
121
+ LIBYUV_API
122
+ int I010Copy(const uint16_t* src_y,
123
+ int src_stride_y,
124
+ const uint16_t* src_u,
125
+ int src_stride_u,
126
+ const uint16_t* src_v,
127
+ int src_stride_v,
128
+ uint16_t* dst_y,
129
+ int dst_stride_y,
130
+ uint16_t* dst_u,
131
+ int dst_stride_u,
132
+ uint16_t* dst_v,
133
+ int dst_stride_v,
134
+ int width,
135
+ int height) {
136
+ int halfwidth = (width + 1) >> 1;
137
+ int halfheight = (height + 1) >> 1;
138
+ if ((!src_y && dst_y) || !src_u || !src_v || !dst_u || !dst_v || width <= 0 ||
139
+ height == 0) {
140
+ return -1;
141
+ }
142
+ // Negative height means invert the image.
143
+ if (height < 0) {
144
+ height = -height;
145
+ halfheight = (height + 1) >> 1;
146
+ src_y = src_y + (height - 1) * src_stride_y;
147
+ src_u = src_u + (halfheight - 1) * src_stride_u;
148
+ src_v = src_v + (halfheight - 1) * src_stride_v;
149
+ src_stride_y = -src_stride_y;
150
+ src_stride_u = -src_stride_u;
151
+ src_stride_v = -src_stride_v;
152
+ }
153
+
154
+ if (dst_y) {
155
+ CopyPlane_16(src_y, src_stride_y, dst_y, dst_stride_y, width, height);
156
+ }
157
+ // Copy UV planes.
158
+ CopyPlane_16(src_u, src_stride_u, dst_u, dst_stride_u, halfwidth, halfheight);
159
+ CopyPlane_16(src_v, src_stride_v, dst_v, dst_stride_v, halfwidth, halfheight);
160
+ return 0;
161
+ }
162
+
163
+ static int Planar16bitTo8bit(const uint16_t* src_y,
164
+ int src_stride_y,
165
+ const uint16_t* src_u,
166
+ int src_stride_u,
167
+ const uint16_t* src_v,
168
+ int src_stride_v,
169
+ uint8_t* dst_y,
170
+ int dst_stride_y,
171
+ uint8_t* dst_u,
172
+ int dst_stride_u,
173
+ uint8_t* dst_v,
174
+ int dst_stride_v,
175
+ int width,
176
+ int height,
177
+ int subsample_x,
178
+ int subsample_y,
179
+ int depth) {
180
+ int uv_width = SUBSAMPLE(width, subsample_x, subsample_x);
181
+ int uv_height = SUBSAMPLE(height, subsample_y, subsample_y);
182
+ int scale = 1 << (24 - depth);
183
+ if ((!src_y && dst_y) || !src_u || !src_v || !dst_u || !dst_v || width <= 0 ||
184
+ height == 0) {
185
+ return -1;
186
+ }
187
+ // Negative height means invert the image.
188
+ if (height < 0) {
189
+ height = -height;
190
+ uv_height = -uv_height;
191
+ src_y = src_y + (height - 1) * src_stride_y;
192
+ src_u = src_u + (uv_height - 1) * src_stride_u;
193
+ src_v = src_v + (uv_height - 1) * src_stride_v;
194
+ src_stride_y = -src_stride_y;
195
+ src_stride_u = -src_stride_u;
196
+ src_stride_v = -src_stride_v;
197
+ }
198
+
199
+ // Convert Y plane.
200
+ if (dst_y) {
201
+ Convert16To8Plane(src_y, src_stride_y, dst_y, dst_stride_y, scale, width,
202
+ height);
203
+ }
204
+ // Convert UV planes.
205
+ Convert16To8Plane(src_u, src_stride_u, dst_u, dst_stride_u, scale, uv_width,
206
+ uv_height);
207
+ Convert16To8Plane(src_v, src_stride_v, dst_v, dst_stride_v, scale, uv_width,
208
+ uv_height);
209
+ return 0;
210
+ }
211
+
212
+ static int I41xToI420(const uint16_t* src_y,
213
+ int src_stride_y,
214
+ const uint16_t* src_u,
215
+ int src_stride_u,
216
+ const uint16_t* src_v,
217
+ int src_stride_v,
218
+ uint8_t* dst_y,
219
+ int dst_stride_y,
220
+ uint8_t* dst_u,
221
+ int dst_stride_u,
222
+ uint8_t* dst_v,
223
+ int dst_stride_v,
224
+ int width,
225
+ int height,
226
+ int depth) {
227
+ const int scale = 1 << (24 - depth);
228
+
229
+ if (width <= 0 || height == 0) {
230
+ return -1;
231
+ }
232
+ // Negative height means invert the image.
233
+ if (height < 0) {
234
+ height = -height;
235
+ src_y = src_y + (height - 1) * src_stride_y;
236
+ src_u = src_u + (height - 1) * src_stride_u;
237
+ src_v = src_v + (height - 1) * src_stride_v;
238
+ src_stride_y = -src_stride_y;
239
+ src_stride_u = -src_stride_u;
240
+ src_stride_v = -src_stride_v;
241
+ }
242
+
243
+ {
244
+ const int uv_width = SUBSAMPLE(width, 1, 1);
245
+ const int uv_height = SUBSAMPLE(height, 1, 1);
246
+
247
+ Convert16To8Plane(src_y, src_stride_y, dst_y, dst_stride_y, scale, width,
248
+ height);
249
+ ScalePlaneDown2_16To8(width, height, uv_width, uv_height, src_stride_u,
250
+ dst_stride_u, src_u, dst_u, scale, kFilterBilinear);
251
+ ScalePlaneDown2_16To8(width, height, uv_width, uv_height, src_stride_v,
252
+ dst_stride_v, src_v, dst_v, scale, kFilterBilinear);
253
+ }
254
+ return 0;
255
+ }
256
+
257
+ static int I21xToI420(const uint16_t* src_y,
258
+ int src_stride_y,
259
+ const uint16_t* src_u,
260
+ int src_stride_u,
261
+ const uint16_t* src_v,
262
+ int src_stride_v,
263
+ uint8_t* dst_y,
264
+ int dst_stride_y,
265
+ uint8_t* dst_u,
266
+ int dst_stride_u,
267
+ uint8_t* dst_v,
268
+ int dst_stride_v,
269
+ int width,
270
+ int height,
271
+ int depth) {
272
+ const int scale = 1 << (24 - depth);
273
+
274
+ if (width <= 0 || height == 0) {
275
+ return -1;
276
+ }
277
+ // Negative height means invert the image.
278
+ if (height < 0) {
279
+ height = -height;
280
+ src_y = src_y + (height - 1) * src_stride_y;
281
+ src_u = src_u + (height - 1) * src_stride_u;
282
+ src_v = src_v + (height - 1) * src_stride_v;
283
+ src_stride_y = -src_stride_y;
284
+ src_stride_u = -src_stride_u;
285
+ src_stride_v = -src_stride_v;
286
+ }
287
+
288
+ {
289
+ const int uv_width = SUBSAMPLE(width, 1, 1);
290
+ const int uv_height = SUBSAMPLE(height, 1, 1);
291
+ const int dy = FixedDiv(height, uv_height);
292
+
293
+ Convert16To8Plane(src_y, src_stride_y, dst_y, dst_stride_y, scale, width,
294
+ height);
295
+ ScalePlaneVertical_16To8(height, uv_width, uv_height, src_stride_u,
296
+ dst_stride_u, src_u, dst_u, 0, 32768, dy,
297
+ /*bpp=*/1, scale, kFilterBilinear);
298
+ ScalePlaneVertical_16To8(height, uv_width, uv_height, src_stride_v,
299
+ dst_stride_v, src_v, dst_v, 0, 32768, dy,
300
+ /*bpp=*/1, scale, kFilterBilinear);
301
+ }
302
+ return 0;
303
+ }
304
+
305
+ // Convert 10 bit YUV to 8 bit.
306
+ LIBYUV_API
307
+ int I010ToI420(const uint16_t* src_y,
308
+ int src_stride_y,
309
+ const uint16_t* src_u,
310
+ int src_stride_u,
311
+ const uint16_t* src_v,
312
+ int src_stride_v,
313
+ uint8_t* dst_y,
314
+ int dst_stride_y,
315
+ uint8_t* dst_u,
316
+ int dst_stride_u,
317
+ uint8_t* dst_v,
318
+ int dst_stride_v,
319
+ int width,
320
+ int height) {
321
+ return Planar16bitTo8bit(src_y, src_stride_y, src_u, src_stride_u, src_v,
322
+ src_stride_v, dst_y, dst_stride_y, dst_u,
323
+ dst_stride_u, dst_v, dst_stride_v, width, height, 1,
324
+ 1, 10);
325
+ }
326
+
327
+ LIBYUV_API
328
+ int I210ToI420(const uint16_t* src_y,
329
+ int src_stride_y,
330
+ const uint16_t* src_u,
331
+ int src_stride_u,
332
+ const uint16_t* src_v,
333
+ int src_stride_v,
334
+ uint8_t* dst_y,
335
+ int dst_stride_y,
336
+ uint8_t* dst_u,
337
+ int dst_stride_u,
338
+ uint8_t* dst_v,
339
+ int dst_stride_v,
340
+ int width,
341
+ int height) {
342
+ return I21xToI420(src_y, src_stride_y, src_u, src_stride_u, src_v,
343
+ src_stride_v, dst_y, dst_stride_y, dst_u, dst_stride_u,
344
+ dst_v, dst_stride_v, width, height, 10);
345
+ }
346
+
347
+ LIBYUV_API
348
+ int I210ToI422(const uint16_t* src_y,
349
+ int src_stride_y,
350
+ const uint16_t* src_u,
351
+ int src_stride_u,
352
+ const uint16_t* src_v,
353
+ int src_stride_v,
354
+ uint8_t* dst_y,
355
+ int dst_stride_y,
356
+ uint8_t* dst_u,
357
+ int dst_stride_u,
358
+ uint8_t* dst_v,
359
+ int dst_stride_v,
360
+ int width,
361
+ int height) {
362
+ return Planar16bitTo8bit(src_y, src_stride_y, src_u, src_stride_u, src_v,
363
+ src_stride_v, dst_y, dst_stride_y, dst_u,
364
+ dst_stride_u, dst_v, dst_stride_v, width, height, 1,
365
+ 0, 10);
366
+ }
367
+
368
+ LIBYUV_API
369
+ int I410ToI420(const uint16_t* src_y,
370
+ int src_stride_y,
371
+ const uint16_t* src_u,
372
+ int src_stride_u,
373
+ const uint16_t* src_v,
374
+ int src_stride_v,
375
+ uint8_t* dst_y,
376
+ int dst_stride_y,
377
+ uint8_t* dst_u,
378
+ int dst_stride_u,
379
+ uint8_t* dst_v,
380
+ int dst_stride_v,
381
+ int width,
382
+ int height) {
383
+ return I41xToI420(src_y, src_stride_y, src_u, src_stride_u, src_v,
384
+ src_stride_v, dst_y, dst_stride_y, dst_u, dst_stride_u,
385
+ dst_v, dst_stride_v, width, height, 10);
386
+ }
387
+
388
+ LIBYUV_API
389
+ int I410ToI444(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
+ return Planar16bitTo8bit(src_y, src_stride_y, src_u, src_stride_u, src_v,
404
+ src_stride_v, dst_y, dst_stride_y, dst_u,
405
+ dst_stride_u, dst_v, dst_stride_v, width, height, 0,
406
+ 0, 10);
407
+ }
408
+
409
+ LIBYUV_API
410
+ int I012ToI420(const uint16_t* src_y,
411
+ int src_stride_y,
412
+ const uint16_t* src_u,
413
+ int src_stride_u,
414
+ const uint16_t* src_v,
415
+ int src_stride_v,
416
+ uint8_t* dst_y,
417
+ int dst_stride_y,
418
+ uint8_t* dst_u,
419
+ int dst_stride_u,
420
+ uint8_t* dst_v,
421
+ int dst_stride_v,
422
+ int width,
423
+ int height) {
424
+ return Planar16bitTo8bit(src_y, src_stride_y, src_u, src_stride_u, src_v,
425
+ src_stride_v, dst_y, dst_stride_y, dst_u,
426
+ dst_stride_u, dst_v, dst_stride_v, width, height, 1,
427
+ 1, 12);
428
+ }
429
+
430
+ LIBYUV_API
431
+ int I212ToI422(const uint16_t* src_y,
432
+ int src_stride_y,
433
+ const uint16_t* src_u,
434
+ int src_stride_u,
435
+ const uint16_t* src_v,
436
+ int src_stride_v,
437
+ uint8_t* dst_y,
438
+ int dst_stride_y,
439
+ uint8_t* dst_u,
440
+ int dst_stride_u,
441
+ uint8_t* dst_v,
442
+ int dst_stride_v,
443
+ int width,
444
+ int height) {
445
+ return Planar16bitTo8bit(src_y, src_stride_y, src_u, src_stride_u, src_v,
446
+ src_stride_v, dst_y, dst_stride_y, dst_u,
447
+ dst_stride_u, dst_v, dst_stride_v, width, height, 1,
448
+ 0, 12);
449
+ }
450
+
451
+ LIBYUV_API
452
+ int I212ToI420(const uint16_t* src_y,
453
+ int src_stride_y,
454
+ const uint16_t* src_u,
455
+ int src_stride_u,
456
+ const uint16_t* src_v,
457
+ int src_stride_v,
458
+ uint8_t* dst_y,
459
+ int dst_stride_y,
460
+ uint8_t* dst_u,
461
+ int dst_stride_u,
462
+ uint8_t* dst_v,
463
+ int dst_stride_v,
464
+ int width,
465
+ int height) {
466
+ return I21xToI420(src_y, src_stride_y, src_u, src_stride_u, src_v,
467
+ src_stride_v, dst_y, dst_stride_y, dst_u, dst_stride_u,
468
+ dst_v, dst_stride_v, width, height, 12);
469
+ }
470
+
471
+ LIBYUV_API
472
+ int I412ToI444(const uint16_t* src_y,
473
+ int src_stride_y,
474
+ const uint16_t* src_u,
475
+ int src_stride_u,
476
+ const uint16_t* src_v,
477
+ int src_stride_v,
478
+ uint8_t* dst_y,
479
+ int dst_stride_y,
480
+ uint8_t* dst_u,
481
+ int dst_stride_u,
482
+ uint8_t* dst_v,
483
+ int dst_stride_v,
484
+ int width,
485
+ int height) {
486
+ return Planar16bitTo8bit(src_y, src_stride_y, src_u, src_stride_u, src_v,
487
+ src_stride_v, dst_y, dst_stride_y, dst_u,
488
+ dst_stride_u, dst_v, dst_stride_v, width, height, 0,
489
+ 0, 12);
490
+ }
491
+
492
+ LIBYUV_API
493
+ int I412ToI420(const uint16_t* src_y,
494
+ int src_stride_y,
495
+ const uint16_t* src_u,
496
+ int src_stride_u,
497
+ const uint16_t* src_v,
498
+ int src_stride_v,
499
+ uint8_t* dst_y,
500
+ int dst_stride_y,
501
+ uint8_t* dst_u,
502
+ int dst_stride_u,
503
+ uint8_t* dst_v,
504
+ int dst_stride_v,
505
+ int width,
506
+ int height) {
507
+ return I41xToI420(src_y, src_stride_y, src_u, src_stride_u, src_v,
508
+ src_stride_v, dst_y, dst_stride_y, dst_u, dst_stride_u,
509
+ dst_v, dst_stride_v, width, height, 12);
510
+ }
511
+
512
+ // Any Ix10 To I010 format
513
+ static int Ix10ToI010(const uint16_t* src_y,
514
+ int src_stride_y,
515
+ const uint16_t* src_u,
516
+ int src_stride_u,
517
+ const uint16_t* src_v,
518
+ int src_stride_v,
519
+ uint16_t* dst_y,
520
+ int dst_stride_y,
521
+ uint16_t* dst_u,
522
+ int dst_stride_u,
523
+ uint16_t* dst_v,
524
+ int dst_stride_v,
525
+ int width,
526
+ int height,
527
+ int subsample_x,
528
+ int subsample_y) {
529
+ const int dst_y_width = width;
530
+ const int dst_y_height = Abs(height);
531
+ const int src_uv_width = SUBSAMPLE(width, subsample_x, subsample_x);
532
+ const int src_uv_height = SUBSAMPLE(height, subsample_y, subsample_y);
533
+ const int dst_uv_width = SUBSAMPLE(dst_y_width, 1, 1);
534
+ const int dst_uv_height = SUBSAMPLE(dst_y_height, 1, 1);
535
+ int r;
536
+ if ((!src_y && dst_y) || !src_u || !src_v || !dst_u || !dst_v || width <= 0 ||
537
+ height == 0) {
538
+ return -1;
539
+ }
540
+ if (dst_y) {
541
+ CopyPlane_16(src_y, src_stride_y, dst_y, dst_stride_y, width, height);
542
+ }
543
+ r = ScalePlane_12(src_u, src_stride_u, src_uv_width, src_uv_height, dst_u,
544
+ dst_stride_u, dst_uv_width, dst_uv_height, kFilterBilinear);
545
+ if (r != 0) {
546
+ return r;
547
+ }
548
+ r = ScalePlane_12(src_v, src_stride_v, src_uv_width, src_uv_height, dst_v,
549
+ dst_stride_v, dst_uv_width, dst_uv_height, kFilterBilinear);
550
+ return r;
551
+ }
552
+
553
+ LIBYUV_API
554
+ int I410ToI010(const uint16_t* src_y,
555
+ int src_stride_y,
556
+ const uint16_t* src_u,
557
+ int src_stride_u,
558
+ const uint16_t* src_v,
559
+ int src_stride_v,
560
+ uint16_t* dst_y,
561
+ int dst_stride_y,
562
+ uint16_t* dst_u,
563
+ int dst_stride_u,
564
+ uint16_t* dst_v,
565
+ int dst_stride_v,
566
+ int width,
567
+ int height) {
568
+ return Ix10ToI010(src_y, src_stride_y, src_u, src_stride_u, src_v,
569
+ src_stride_v, dst_y, dst_stride_y, dst_u, dst_stride_u,
570
+ dst_v, dst_stride_v, width, height, 0, 0);
571
+ }
572
+
573
+ LIBYUV_API
574
+ int I210ToI010(const uint16_t* src_y,
575
+ int src_stride_y,
576
+ const uint16_t* src_u,
577
+ int src_stride_u,
578
+ const uint16_t* src_v,
579
+ int src_stride_v,
580
+ uint16_t* dst_y,
581
+ int dst_stride_y,
582
+ uint16_t* dst_u,
583
+ int dst_stride_u,
584
+ uint16_t* dst_v,
585
+ int dst_stride_v,
586
+ int width,
587
+ int height) {
588
+ return Ix10ToI010(src_y, src_stride_y, src_u, src_stride_u, src_v,
589
+ src_stride_v, dst_y, dst_stride_y, dst_u, dst_stride_u,
590
+ dst_v, dst_stride_v, width, height, 1, 0);
591
+ }
592
+
593
+ // Any I[420]1[02] to P[420]1[02] format
594
+ static int IxxxToPxxx(const uint16_t* src_y,
595
+ int src_stride_y,
596
+ const uint16_t* src_u,
597
+ int src_stride_u,
598
+ const uint16_t* src_v,
599
+ int src_stride_v,
600
+ uint16_t* dst_y,
601
+ int dst_stride_y,
602
+ uint16_t* dst_uv,
603
+ int dst_stride_uv,
604
+ int width,
605
+ int height,
606
+ int subsample_x,
607
+ int subsample_y,
608
+ int depth) {
609
+ const int uv_width = SUBSAMPLE(width, subsample_x, subsample_x);
610
+ const int uv_height = SUBSAMPLE(height, subsample_y, subsample_y);
611
+ if (width <= 0 || height == 0) {
612
+ return -1;
613
+ }
614
+
615
+ ConvertToMSBPlane_16(src_y, src_stride_y, dst_y, dst_stride_y, width, height,
616
+ depth);
617
+ MergeUVPlane_16(src_u, src_stride_u, src_v, src_stride_v, dst_uv,
618
+ dst_stride_uv, uv_width, uv_height, depth);
619
+ return 0;
620
+ }
621
+
622
+ LIBYUV_API
623
+ int I010ToP010(const uint16_t* src_y,
624
+ int src_stride_y,
625
+ const uint16_t* src_u,
626
+ int src_stride_u,
627
+ const uint16_t* src_v,
628
+ int src_stride_v,
629
+ uint16_t* dst_y,
630
+ int dst_stride_y,
631
+ uint16_t* dst_uv,
632
+ int dst_stride_uv,
633
+ int width,
634
+ int height) {
635
+ return IxxxToPxxx(src_y, src_stride_y, src_u, src_stride_u, src_v,
636
+ src_stride_v, dst_y, dst_stride_y, dst_uv, dst_stride_uv,
637
+ width, height, 1, 1, 10);
638
+ }
639
+
640
+ LIBYUV_API
641
+ int I010ToNV12(const uint16_t* src_y,
642
+ int src_stride_y,
643
+ const uint16_t* src_u,
644
+ int src_stride_u,
645
+ const uint16_t* src_v,
646
+ int src_stride_v,
647
+ uint8_t* dst_y,
648
+ int dst_stride_y,
649
+ uint8_t* dst_uv,
650
+ int dst_stride_uv,
651
+ int width,
652
+ int height) {
653
+ int y;
654
+ int halfwidth = (width + 1) >> 1;
655
+ int halfheight = (height + 1) >> 1;
656
+ const int scale = 16385; // 16384 for 10 bits
657
+ void (*Convert16To8Row)(const uint16_t* src_y, uint8_t* dst_y, int scale,
658
+ int width) = Convert16To8Row_C;
659
+ void (*MergeUVRow)(const uint8_t* src_u, const uint8_t* src_v,
660
+ uint8_t* dst_uv, int width) = MergeUVRow_C;
661
+ if ((!src_y && dst_y) || !src_u || !src_v || !dst_uv || width <= 0 ||
662
+ height == 0) {
663
+ return -1;
664
+ }
665
+ // Negative height means invert the image.
666
+ if (height < 0) {
667
+ height = -height;
668
+ halfheight = (height + 1) >> 1;
669
+ src_y = src_y + (height - 1) * src_stride_y;
670
+ src_u = src_u + (halfheight - 1) * src_stride_u;
671
+ src_v = src_v + (halfheight - 1) * src_stride_v;
672
+ src_stride_y = -src_stride_y;
673
+ src_stride_u = -src_stride_u;
674
+ src_stride_v = -src_stride_v;
675
+ }
676
+ #if defined(HAS_CONVERT16TO8ROW_NEON)
677
+ if (TestCpuFlag(kCpuHasNEON)) {
678
+ Convert16To8Row = Convert16To8Row_Any_NEON;
679
+ if (IS_ALIGNED(width, 16)) {
680
+ Convert16To8Row = Convert16To8Row_NEON;
681
+ }
682
+ }
683
+ #endif
684
+ #if defined(HAS_CONVERT16TO8ROW_SME)
685
+ if (TestCpuFlag(kCpuHasSME)) {
686
+ Convert16To8Row = Convert16To8Row_SME;
687
+ }
688
+ #endif
689
+ #if defined(HAS_CONVERT16TO8ROW_SSSE3)
690
+ if (TestCpuFlag(kCpuHasSSSE3)) {
691
+ Convert16To8Row = Convert16To8Row_Any_SSSE3;
692
+ if (IS_ALIGNED(width, 16)) {
693
+ Convert16To8Row = Convert16To8Row_SSSE3;
694
+ }
695
+ }
696
+ #endif
697
+ #if defined(HAS_CONVERT16TO8ROW_AVX2)
698
+ if (TestCpuFlag(kCpuHasAVX2)) {
699
+ Convert16To8Row = Convert16To8Row_Any_AVX2;
700
+ if (IS_ALIGNED(width, 32)) {
701
+ Convert16To8Row = Convert16To8Row_AVX2;
702
+ }
703
+ }
704
+ #endif
705
+ #if defined(HAS_CONVERT16TO8ROW_AVX512BW)
706
+ if (TestCpuFlag(kCpuHasAVX512BW)) {
707
+ Convert16To8Row = Convert16To8Row_Any_AVX512BW;
708
+ if (IS_ALIGNED(width, 64)) {
709
+ Convert16To8Row = Convert16To8Row_AVX512BW;
710
+ }
711
+ }
712
+ #endif
713
+
714
+ #if defined(HAS_MERGEUVROW_SSE2)
715
+ if (TestCpuFlag(kCpuHasSSE2)) {
716
+ MergeUVRow = MergeUVRow_Any_SSE2;
717
+ if (IS_ALIGNED(halfwidth, 16)) {
718
+ MergeUVRow = MergeUVRow_SSE2;
719
+ }
720
+ }
721
+ #endif
722
+ #if defined(HAS_MERGEUVROW_AVX2)
723
+ if (TestCpuFlag(kCpuHasAVX2)) {
724
+ MergeUVRow = MergeUVRow_Any_AVX2;
725
+ if (IS_ALIGNED(halfwidth, 16)) {
726
+ MergeUVRow = MergeUVRow_AVX2;
727
+ }
728
+ }
729
+ #endif
730
+ #if defined(HAS_MERGEUVROW_AVX512BW)
731
+ if (TestCpuFlag(kCpuHasAVX512BW)) {
732
+ MergeUVRow = MergeUVRow_Any_AVX512BW;
733
+ if (IS_ALIGNED(halfwidth, 32)) {
734
+ MergeUVRow = MergeUVRow_AVX512BW;
735
+ }
736
+ }
737
+ #endif
738
+ #if defined(HAS_MERGEUVROW_NEON)
739
+ if (TestCpuFlag(kCpuHasNEON)) {
740
+ MergeUVRow = MergeUVRow_Any_NEON;
741
+ if (IS_ALIGNED(halfwidth, 16)) {
742
+ MergeUVRow = MergeUVRow_NEON;
743
+ }
744
+ }
745
+ #endif
746
+ #if defined(HAS_MERGEUVROW_SME)
747
+ if (TestCpuFlag(kCpuHasSME)) {
748
+ MergeUVRow = MergeUVRow_SME;
749
+ }
750
+ #endif
751
+ #if defined(HAS_MERGEUVROW_LSX)
752
+ if (TestCpuFlag(kCpuHasLSX)) {
753
+ MergeUVRow = MergeUVRow_Any_LSX;
754
+ if (IS_ALIGNED(halfwidth, 16)) {
755
+ MergeUVRow = MergeUVRow_LSX;
756
+ }
757
+ }
758
+ #endif
759
+ #if defined(HAS_MERGEUVROW_RVV)
760
+ if (TestCpuFlag(kCpuHasRVV)) {
761
+ MergeUVRow = MergeUVRow_RVV;
762
+ }
763
+ #endif
764
+
765
+ // Convert Y plane.
766
+ if (dst_y) {
767
+ Convert16To8Plane(src_y, src_stride_y, dst_y, dst_stride_y, scale, width,
768
+ height);
769
+ }
770
+
771
+ {
772
+ // Allocate a row of uv.
773
+ align_buffer_64(row_u, ((halfwidth + 31) & ~31) * 2);
774
+ uint8_t* row_v = row_u + ((halfwidth + 31) & ~31);
775
+ if (!row_u)
776
+ return 1;
777
+
778
+ for (y = 0; y < halfheight; ++y) {
779
+ Convert16To8Row(src_u, row_u, scale, halfwidth);
780
+ Convert16To8Row(src_v, row_v, scale, halfwidth);
781
+ MergeUVRow(row_u, row_v, dst_uv, halfwidth);
782
+ src_u += src_stride_u;
783
+ src_v += src_stride_v;
784
+ dst_uv += dst_stride_uv;
785
+ }
786
+ free_aligned_buffer_64(row_u);
787
+ }
788
+ return 0;
789
+ }
790
+
791
+ LIBYUV_API
792
+ int I210ToP210(const uint16_t* src_y,
793
+ int src_stride_y,
794
+ const uint16_t* src_u,
795
+ int src_stride_u,
796
+ const uint16_t* src_v,
797
+ int src_stride_v,
798
+ uint16_t* dst_y,
799
+ int dst_stride_y,
800
+ uint16_t* dst_uv,
801
+ int dst_stride_uv,
802
+ int width,
803
+ int height) {
804
+ return IxxxToPxxx(src_y, src_stride_y, src_u, src_stride_u, src_v,
805
+ src_stride_v, dst_y, dst_stride_y, dst_uv, dst_stride_uv,
806
+ width, height, 1, 0, 10);
807
+ }
808
+
809
+ LIBYUV_API
810
+ int I012ToP012(const uint16_t* src_y,
811
+ int src_stride_y,
812
+ const uint16_t* src_u,
813
+ int src_stride_u,
814
+ const uint16_t* src_v,
815
+ int src_stride_v,
816
+ uint16_t* dst_y,
817
+ int dst_stride_y,
818
+ uint16_t* dst_uv,
819
+ int dst_stride_uv,
820
+ int width,
821
+ int height) {
822
+ return IxxxToPxxx(src_y, src_stride_y, src_u, src_stride_u, src_v,
823
+ src_stride_v, dst_y, dst_stride_y, dst_uv, dst_stride_uv,
824
+ width, height, 1, 1, 12);
825
+ }
826
+
827
+ LIBYUV_API
828
+ int I212ToP212(const uint16_t* src_y,
829
+ int src_stride_y,
830
+ const uint16_t* src_u,
831
+ int src_stride_u,
832
+ const uint16_t* src_v,
833
+ int src_stride_v,
834
+ uint16_t* dst_y,
835
+ int dst_stride_y,
836
+ uint16_t* dst_uv,
837
+ int dst_stride_uv,
838
+ int width,
839
+ int height) {
840
+ return IxxxToPxxx(src_y, src_stride_y, src_u, src_stride_u, src_v,
841
+ src_stride_v, dst_y, dst_stride_y, dst_uv, dst_stride_uv,
842
+ width, height, 1, 0, 12);
843
+ }
844
+
845
+ // 422 chroma is 1/2 width, 1x height
846
+ // 420 chroma is 1/2 width, 1/2 height
847
+ LIBYUV_API
848
+ int I422ToI420(const uint8_t* src_y,
849
+ int src_stride_y,
850
+ const uint8_t* src_u,
851
+ int src_stride_u,
852
+ const uint8_t* src_v,
853
+ int src_stride_v,
854
+ uint8_t* dst_y,
855
+ int dst_stride_y,
856
+ uint8_t* dst_u,
857
+ int dst_stride_u,
858
+ uint8_t* dst_v,
859
+ int dst_stride_v,
860
+ int width,
861
+ int height) {
862
+ const int src_uv_width = SUBSAMPLE(width, 1, 1);
863
+ return I4xxToI420(src_y, src_stride_y, src_u, src_stride_u, src_v,
864
+ src_stride_v, dst_y, dst_stride_y, dst_u, dst_stride_u,
865
+ dst_v, dst_stride_v, width, height, src_uv_width, height);
866
+ }
867
+
868
+ LIBYUV_API
869
+ int I422ToI210(const uint8_t* src_y,
870
+ int src_stride_y,
871
+ const uint8_t* src_u,
872
+ int src_stride_u,
873
+ const uint8_t* src_v,
874
+ int src_stride_v,
875
+ uint16_t* dst_y,
876
+ int dst_stride_y,
877
+ uint16_t* dst_u,
878
+ int dst_stride_u,
879
+ uint16_t* dst_v,
880
+ int dst_stride_v,
881
+ int width,
882
+ int height) {
883
+ int halfwidth = (width + 1) >> 1;
884
+ if ((!src_y && dst_y) || !src_u || !src_v || !dst_u || !dst_v || width <= 0 ||
885
+ height == 0) {
886
+ return -1;
887
+ }
888
+ // Negative height means invert the image.
889
+ if (height < 0) {
890
+ height = -height;
891
+ src_y = src_y + (height - 1) * src_stride_y;
892
+ src_u = src_u + (height - 1) * src_stride_u;
893
+ src_v = src_v + (height - 1) * src_stride_v;
894
+ src_stride_y = -src_stride_y;
895
+ src_stride_u = -src_stride_u;
896
+ src_stride_v = -src_stride_v;
897
+ }
898
+
899
+ // Convert Y plane.
900
+ Convert8To16Plane(src_y, src_stride_y, dst_y, dst_stride_y, 1024, width,
901
+ height);
902
+ // Convert UV planes.
903
+ Convert8To16Plane(src_u, src_stride_u, dst_u, dst_stride_u, 1024, halfwidth,
904
+ height);
905
+ Convert8To16Plane(src_v, src_stride_v, dst_v, dst_stride_v, 1024, halfwidth,
906
+ height);
907
+ return 0;
908
+ }
909
+
910
+ // TODO(fbarchard): Implement row conversion.
911
+ LIBYUV_API
912
+ int I422ToNV21(const uint8_t* src_y,
913
+ int src_stride_y,
914
+ const uint8_t* src_u,
915
+ int src_stride_u,
916
+ const uint8_t* src_v,
917
+ int src_stride_v,
918
+ uint8_t* dst_y,
919
+ int dst_stride_y,
920
+ uint8_t* dst_vu,
921
+ int dst_stride_vu,
922
+ int width,
923
+ int height) {
924
+ int halfwidth = (width + 1) >> 1;
925
+ int halfheight = (height + 1) >> 1;
926
+ // Negative height means invert the image.
927
+ if (height < 0) {
928
+ height = -height;
929
+ halfheight = (height + 1) >> 1;
930
+ src_y = src_y + (height - 1) * src_stride_y;
931
+ src_u = src_u + (height - 1) * src_stride_u;
932
+ src_v = src_v + (height - 1) * src_stride_v;
933
+ src_stride_y = -src_stride_y;
934
+ src_stride_u = -src_stride_u;
935
+ src_stride_v = -src_stride_v;
936
+ }
937
+
938
+ // Allocate u and v buffers
939
+ align_buffer_64(plane_u, halfwidth * halfheight * 2);
940
+ uint8_t* plane_v = plane_u + halfwidth * halfheight;
941
+ if (!plane_u)
942
+ return 1;
943
+
944
+ I422ToI420(src_y, src_stride_y, src_u, src_stride_u, src_v, src_stride_v,
945
+ dst_y, dst_stride_y, plane_u, halfwidth, plane_v, halfwidth, width,
946
+ height);
947
+ MergeUVPlane(plane_v, halfwidth, plane_u, halfwidth, dst_vu, dst_stride_vu,
948
+ halfwidth, halfheight);
949
+ free_aligned_buffer_64(plane_u);
950
+ return 0;
951
+ }
952
+
953
+ LIBYUV_API
954
+ int MM21ToNV12(const uint8_t* src_y,
955
+ int src_stride_y,
956
+ const uint8_t* src_uv,
957
+ int src_stride_uv,
958
+ uint8_t* dst_y,
959
+ int dst_stride_y,
960
+ uint8_t* dst_uv,
961
+ int dst_stride_uv,
962
+ int width,
963
+ int height) {
964
+ if (!src_uv || !dst_uv || width <= 0) {
965
+ return -1;
966
+ }
967
+
968
+ int sign = height < 0 ? -1 : 1;
969
+
970
+ if (dst_y) {
971
+ DetilePlane(src_y, src_stride_y, dst_y, dst_stride_y, width, height, 32);
972
+ }
973
+ DetilePlane(src_uv, src_stride_uv, dst_uv, dst_stride_uv, (width + 1) & ~1,
974
+ (height + sign) / 2, 16);
975
+
976
+ return 0;
977
+ }
978
+
979
+ LIBYUV_API
980
+ int MM21ToI420(const uint8_t* src_y,
981
+ int src_stride_y,
982
+ const uint8_t* src_uv,
983
+ int src_stride_uv,
984
+ uint8_t* dst_y,
985
+ int dst_stride_y,
986
+ uint8_t* dst_u,
987
+ int dst_stride_u,
988
+ uint8_t* dst_v,
989
+ int dst_stride_v,
990
+ int width,
991
+ int height) {
992
+ int sign = height < 0 ? -1 : 1;
993
+
994
+ if (!src_uv || !dst_u || !dst_v || width <= 0) {
995
+ return -1;
996
+ }
997
+
998
+ if (dst_y) {
999
+ DetilePlane(src_y, src_stride_y, dst_y, dst_stride_y, width, height, 32);
1000
+ }
1001
+ DetileSplitUVPlane(src_uv, src_stride_uv, dst_u, dst_stride_u, dst_v,
1002
+ dst_stride_v, (width + 1) & ~1, (height + sign) / 2, 16);
1003
+
1004
+ return 0;
1005
+ }
1006
+
1007
+ LIBYUV_API
1008
+ int MM21ToYUY2(const uint8_t* src_y,
1009
+ int src_stride_y,
1010
+ const uint8_t* src_uv,
1011
+ int src_stride_uv,
1012
+ uint8_t* dst_yuy2,
1013
+ int dst_stride_yuy2,
1014
+ int width,
1015
+ int height) {
1016
+ if (!src_y || !src_uv || !dst_yuy2 || width <= 0) {
1017
+ return -1;
1018
+ }
1019
+
1020
+ DetileToYUY2(src_y, src_stride_y, src_uv, src_stride_uv, dst_yuy2,
1021
+ dst_stride_yuy2, width, height, 32);
1022
+
1023
+ return 0;
1024
+ }
1025
+
1026
+ // Convert MT2T into P010. See tinyurl.com/mtk-10bit-video-format for format
1027
+ // documentation.
1028
+ // TODO(greenjustin): Add an MT2T to I420 conversion.
1029
+ LIBYUV_API
1030
+ int MT2TToP010(const uint8_t* src_y,
1031
+ int src_stride_y,
1032
+ const uint8_t* src_uv,
1033
+ int src_stride_uv,
1034
+ uint16_t* dst_y,
1035
+ int dst_stride_y,
1036
+ uint16_t* dst_uv,
1037
+ int dst_stride_uv,
1038
+ int width,
1039
+ int height) {
1040
+ if (width <= 0 || !height || !src_uv || !dst_uv) {
1041
+ return -1;
1042
+ }
1043
+
1044
+ {
1045
+ int uv_width = (width + 1) & ~1;
1046
+ int uv_height = (height + 1) / 2;
1047
+ int y = 0;
1048
+ const int tile_width = 16;
1049
+ const int y_tile_height = 32;
1050
+ const int uv_tile_height = 16;
1051
+ int padded_width = (width + tile_width - 1) & ~(tile_width - 1);
1052
+ int y_tile_row_size = padded_width * y_tile_height * 10 / 8;
1053
+ int uv_tile_row_size = padded_width * uv_tile_height * 10 / 8;
1054
+ size_t row_buf_size = padded_width * y_tile_height * sizeof(uint16_t);
1055
+ void (*UnpackMT2T)(const uint8_t* src, uint16_t* dst, size_t size) =
1056
+ UnpackMT2T_C;
1057
+ align_buffer_64(row_buf, row_buf_size);
1058
+ if (!row_buf)
1059
+ return 1;
1060
+
1061
+ #if defined(HAS_UNPACKMT2T_NEON)
1062
+ if (TestCpuFlag(kCpuHasNEON)) {
1063
+ UnpackMT2T = UnpackMT2T_NEON;
1064
+ }
1065
+ #endif
1066
+ // Negative height means invert the image.
1067
+ if (height < 0) {
1068
+ height = -height;
1069
+ uv_height = (height + 1) / 2;
1070
+ if (dst_y) {
1071
+ dst_y = dst_y + (height - 1) * dst_stride_y;
1072
+ dst_stride_y = -dst_stride_y;
1073
+ }
1074
+ dst_uv = dst_uv + (uv_height - 1) * dst_stride_uv;
1075
+ dst_stride_uv = -dst_stride_uv;
1076
+ }
1077
+
1078
+ // Unpack and detile Y in rows of tiles
1079
+ if (src_y && dst_y) {
1080
+ for (y = 0; y < (height & ~(y_tile_height - 1)); y += y_tile_height) {
1081
+ UnpackMT2T(src_y, (uint16_t*)row_buf, y_tile_row_size);
1082
+ DetilePlane_16((uint16_t*)row_buf, padded_width, dst_y, dst_stride_y,
1083
+ width, y_tile_height, y_tile_height);
1084
+ src_y += src_stride_y * y_tile_height;
1085
+ dst_y += dst_stride_y * y_tile_height;
1086
+ }
1087
+ if (height & (y_tile_height - 1)) {
1088
+ UnpackMT2T(src_y, (uint16_t*)row_buf, y_tile_row_size);
1089
+ DetilePlane_16((uint16_t*)row_buf, padded_width, dst_y, dst_stride_y,
1090
+ width, height & (y_tile_height - 1), y_tile_height);
1091
+ }
1092
+ }
1093
+
1094
+ // Unpack and detile UV plane
1095
+ for (y = 0; y < (uv_height & ~(uv_tile_height - 1)); y += uv_tile_height) {
1096
+ UnpackMT2T(src_uv, (uint16_t*)row_buf, uv_tile_row_size);
1097
+ DetilePlane_16((uint16_t*)row_buf, padded_width, dst_uv, dst_stride_uv,
1098
+ uv_width, uv_tile_height, uv_tile_height);
1099
+ src_uv += src_stride_uv * uv_tile_height;
1100
+ dst_uv += dst_stride_uv * uv_tile_height;
1101
+ }
1102
+ if (uv_height & (uv_tile_height - 1)) {
1103
+ UnpackMT2T(src_uv, (uint16_t*)row_buf, uv_tile_row_size);
1104
+ DetilePlane_16((uint16_t*)row_buf, padded_width, dst_uv, dst_stride_uv,
1105
+ uv_width, uv_height & (uv_tile_height - 1),
1106
+ uv_tile_height);
1107
+ }
1108
+ free_aligned_buffer_64(row_buf);
1109
+ }
1110
+ return 0;
1111
+ }
1112
+
1113
+ #ifdef I422TONV21_ROW_VERSION
1114
+ // Unittest fails for this version.
1115
+ // 422 chroma is 1/2 width, 1x height
1116
+ // 420 chroma is 1/2 width, 1/2 height
1117
+ // Swap src_u and src_v to implement I422ToNV12
1118
+ LIBYUV_API
1119
+ int I422ToNV21(const uint8_t* src_y,
1120
+ int src_stride_y,
1121
+ const uint8_t* src_u,
1122
+ int src_stride_u,
1123
+ const uint8_t* src_v,
1124
+ int src_stride_v,
1125
+ uint8_t* dst_y,
1126
+ int dst_stride_y,
1127
+ uint8_t* dst_vu,
1128
+ int dst_stride_vu,
1129
+ int width,
1130
+ int height) {
1131
+ int y;
1132
+ void (*MergeUVRow)(const uint8_t* src_u, const uint8_t* src_v,
1133
+ uint8_t* dst_uv, int width) = MergeUVRow_C;
1134
+ void (*InterpolateRow)(uint8_t* dst_ptr, const uint8_t* src_ptr,
1135
+ ptrdiff_t src_stride, int dst_width,
1136
+ int source_y_fraction) = InterpolateRow_C;
1137
+ int halfwidth = (width + 1) >> 1;
1138
+ int halfheight = (height + 1) >> 1;
1139
+ if ((!src_y && dst_y) || !src_u || !src_v || !dst_vu || width <= 0 ||
1140
+ height == 0) {
1141
+ return -1;
1142
+ }
1143
+ // Negative height means invert the image.
1144
+ if (height < 0) {
1145
+ height = -height;
1146
+ halfheight = (height + 1) >> 1;
1147
+ src_y = src_y + (height - 1) * src_stride_y;
1148
+ src_u = src_u + (halfheight - 1) * src_stride_u;
1149
+ src_v = src_v + (halfheight - 1) * src_stride_v;
1150
+ src_stride_y = -src_stride_y;
1151
+ src_stride_u = -src_stride_u;
1152
+ src_stride_v = -src_stride_v;
1153
+ }
1154
+ #if defined(HAS_MERGEUVROW_SSE2)
1155
+ if (TestCpuFlag(kCpuHasSSE2)) {
1156
+ MergeUVRow = MergeUVRow_Any_SSE2;
1157
+ if (IS_ALIGNED(halfwidth, 16)) {
1158
+ MergeUVRow = MergeUVRow_SSE2;
1159
+ }
1160
+ }
1161
+ #endif
1162
+ #if defined(HAS_MERGEUVROW_AVX2)
1163
+ if (TestCpuFlag(kCpuHasAVX2)) {
1164
+ MergeUVRow = MergeUVRow_Any_AVX2;
1165
+ if (IS_ALIGNED(halfwidth, 16)) {
1166
+ MergeUVRow = MergeUVRow_AVX2;
1167
+ }
1168
+ }
1169
+ #endif
1170
+ #if defined(HAS_MERGEUVROW_AVX512BW)
1171
+ if (TestCpuFlag(kCpuHasAVX512BW)) {
1172
+ MergeUVRow = MergeUVRow_Any_AVX512BW;
1173
+ if (IS_ALIGNED(halfwidth, 32)) {
1174
+ MergeUVRow = MergeUVRow_AVX512BW;
1175
+ }
1176
+ }
1177
+ #endif
1178
+ #if defined(HAS_MERGEUVROW_NEON)
1179
+ if (TestCpuFlag(kCpuHasNEON)) {
1180
+ MergeUVRow = MergeUVRow_Any_NEON;
1181
+ if (IS_ALIGNED(halfwidth, 16)) {
1182
+ MergeUVRow = MergeUVRow_NEON;
1183
+ }
1184
+ }
1185
+ #endif
1186
+ #if defined(HAS_MERGEUVROW_SME)
1187
+ if (TestCpuFlag(kCpuHasSME)) {
1188
+ MergeUVRow = MergeUVRow_SME;
1189
+ }
1190
+ #endif
1191
+ #if defined(HAS_MERGEUVROW_LSX)
1192
+ if (TestCpuFlag(kCpuHasLSX)) {
1193
+ MergeUVRow = MergeUVRow_Any_LSX;
1194
+ if (IS_ALIGNED(halfwidth, 16)) {
1195
+ MergeUVRow = MergeUVRow_LSX;
1196
+ }
1197
+ }
1198
+ #endif
1199
+ #if defined(HAS_MERGEUVROW_RVV)
1200
+ if (TestCpuFlag(kCpuHasRVV)) {
1201
+ MergeUVRow = MergeUVRow_RVV;
1202
+ }
1203
+ #endif
1204
+ #if defined(HAS_INTERPOLATEROW_SSSE3)
1205
+ if (TestCpuFlag(kCpuHasSSSE3)) {
1206
+ InterpolateRow = InterpolateRow_Any_SSSE3;
1207
+ if (IS_ALIGNED(width, 16)) {
1208
+ InterpolateRow = InterpolateRow_SSSE3;
1209
+ }
1210
+ }
1211
+ #endif
1212
+ #if defined(HAS_INTERPOLATEROW_AVX2)
1213
+ if (TestCpuFlag(kCpuHasAVX2)) {
1214
+ InterpolateRow = InterpolateRow_Any_AVX2;
1215
+ if (IS_ALIGNED(width, 32)) {
1216
+ InterpolateRow = InterpolateRow_AVX2;
1217
+ }
1218
+ }
1219
+ #endif
1220
+ #if defined(HAS_INTERPOLATEROW_NEON)
1221
+ if (TestCpuFlag(kCpuHasNEON)) {
1222
+ InterpolateRow = InterpolateRow_Any_NEON;
1223
+ if (IS_ALIGNED(width, 16)) {
1224
+ InterpolateRow = InterpolateRow_NEON;
1225
+ }
1226
+ }
1227
+ #endif
1228
+ #if defined(HAS_INTERPOLATEROW_SME)
1229
+ if (TestCpuFlag(kCpuHasSME)) {
1230
+ InterpolateRow = InterpolateRow_SME;
1231
+ }
1232
+ #endif
1233
+ #if defined(HAS_INTERPOLATEROW_LSX)
1234
+ if (TestCpuFlag(kCpuHasLSX)) {
1235
+ InterpolateRow = InterpolateRow_Any_LSX;
1236
+ if (IS_ALIGNED(width, 32)) {
1237
+ InterpolateRow = InterpolateRow_LSX;
1238
+ }
1239
+ }
1240
+ #endif
1241
+ #if defined(HAS_INTERPOLATEROW_RVV)
1242
+ if (TestCpuFlag(kCpuHasRVV)) {
1243
+ InterpolateRow = InterpolateRow_RVV;
1244
+ }
1245
+ #endif
1246
+
1247
+ if (dst_y) {
1248
+ CopyPlane(src_y, src_stride_y, dst_y, dst_stride_y, halfwidth, height);
1249
+ }
1250
+ {
1251
+ // Allocate 2 rows of vu.
1252
+ int awidth = halfwidth * 2;
1253
+ align_buffer_64(row_vu_0, awidth * 2);
1254
+ uint8_t* row_vu_1 = row_vu_0 + awidth;
1255
+ if (!row_vu_0)
1256
+ return 1;
1257
+
1258
+ for (y = 0; y < height - 1; y += 2) {
1259
+ MergeUVRow(src_v, src_u, row_vu_0, halfwidth);
1260
+ MergeUVRow(src_v + src_stride_v, src_u + src_stride_u, row_vu_1,
1261
+ halfwidth);
1262
+ InterpolateRow(dst_vu, row_vu_0, awidth, awidth, 128);
1263
+ src_u += src_stride_u * 2;
1264
+ src_v += src_stride_v * 2;
1265
+ dst_vu += dst_stride_vu;
1266
+ }
1267
+ if (height & 1) {
1268
+ MergeUVRow(src_v, src_u, dst_vu, halfwidth);
1269
+ }
1270
+ free_aligned_buffer_64(row_vu_0);
1271
+ }
1272
+ return 0;
1273
+ }
1274
+ #endif // I422TONV21_ROW_VERSION
1275
+
1276
+ // 444 chroma is 1x width, 1x height
1277
+ // 420 chroma is 1/2 width, 1/2 height
1278
+ LIBYUV_API
1279
+ int I444ToI420(const uint8_t* src_y,
1280
+ int src_stride_y,
1281
+ const uint8_t* src_u,
1282
+ int src_stride_u,
1283
+ const uint8_t* src_v,
1284
+ int src_stride_v,
1285
+ uint8_t* dst_y,
1286
+ int dst_stride_y,
1287
+ uint8_t* dst_u,
1288
+ int dst_stride_u,
1289
+ uint8_t* dst_v,
1290
+ int dst_stride_v,
1291
+ int width,
1292
+ int height) {
1293
+ return I4xxToI420(src_y, src_stride_y, src_u, src_stride_u, src_v,
1294
+ src_stride_v, dst_y, dst_stride_y, dst_u, dst_stride_u,
1295
+ dst_v, dst_stride_v, width, height, width, height);
1296
+ }
1297
+
1298
+ LIBYUV_API
1299
+ int I444ToNV12(const uint8_t* src_y,
1300
+ int src_stride_y,
1301
+ const uint8_t* src_u,
1302
+ int src_stride_u,
1303
+ const uint8_t* src_v,
1304
+ int src_stride_v,
1305
+ uint8_t* dst_y,
1306
+ int dst_stride_y,
1307
+ uint8_t* dst_uv,
1308
+ int dst_stride_uv,
1309
+ int width,
1310
+ int height) {
1311
+ if ((!src_y && dst_y) || !src_u || !src_v || !dst_uv || width <= 0 ||
1312
+ height == 0) {
1313
+ return -1;
1314
+ }
1315
+ // Negative height means invert the image.
1316
+ if (height < 0) {
1317
+ height = -height;
1318
+ src_y = src_y + (height - 1) * src_stride_y;
1319
+ src_u = src_u + (height - 1) * src_stride_u;
1320
+ src_v = src_v + (height - 1) * src_stride_v;
1321
+ src_stride_y = -src_stride_y;
1322
+ src_stride_u = -src_stride_u;
1323
+ src_stride_v = -src_stride_v;
1324
+ }
1325
+ if (dst_y) {
1326
+ CopyPlane(src_y, src_stride_y, dst_y, dst_stride_y, width, height);
1327
+ }
1328
+ HalfMergeUVPlane(src_u, src_stride_u, src_v, src_stride_v, dst_uv,
1329
+ dst_stride_uv, width, height);
1330
+ return 0;
1331
+ }
1332
+
1333
+ LIBYUV_API
1334
+ int I444ToNV21(const uint8_t* src_y,
1335
+ int src_stride_y,
1336
+ const uint8_t* src_u,
1337
+ int src_stride_u,
1338
+ const uint8_t* src_v,
1339
+ int src_stride_v,
1340
+ uint8_t* dst_y,
1341
+ int dst_stride_y,
1342
+ uint8_t* dst_vu,
1343
+ int dst_stride_vu,
1344
+ int width,
1345
+ int height) {
1346
+ return I444ToNV12(src_y, src_stride_y, src_v, src_stride_v, src_u,
1347
+ src_stride_u, dst_y, dst_stride_y, dst_vu, dst_stride_vu,
1348
+ width, height);
1349
+ }
1350
+
1351
+ // I400 is greyscale typically used in MJPG
1352
+ LIBYUV_API
1353
+ int I400ToI420(const uint8_t* src_y,
1354
+ int src_stride_y,
1355
+ uint8_t* dst_y,
1356
+ int dst_stride_y,
1357
+ uint8_t* dst_u,
1358
+ int dst_stride_u,
1359
+ uint8_t* dst_v,
1360
+ int dst_stride_v,
1361
+ int width,
1362
+ int height) {
1363
+ int halfwidth = (width + 1) >> 1;
1364
+ int halfheight = (height + 1) >> 1;
1365
+ if ((!src_y && dst_y) || !dst_u || !dst_v || width <= 0 || height == 0) {
1366
+ return -1;
1367
+ }
1368
+ // Negative height means invert the image.
1369
+ if (height < 0) {
1370
+ height = -height;
1371
+ halfheight = (height + 1) >> 1;
1372
+ src_y = src_y + (height - 1) * src_stride_y;
1373
+ src_stride_y = -src_stride_y;
1374
+ }
1375
+ if (dst_y) {
1376
+ CopyPlane(src_y, src_stride_y, dst_y, dst_stride_y, width, height);
1377
+ }
1378
+ SetPlane(dst_u, dst_stride_u, halfwidth, halfheight, 128);
1379
+ SetPlane(dst_v, dst_stride_v, halfwidth, halfheight, 128);
1380
+ return 0;
1381
+ }
1382
+
1383
+ // I400 is greyscale typically used in MJPG
1384
+ LIBYUV_API
1385
+ int I400ToNV21(const uint8_t* src_y,
1386
+ int src_stride_y,
1387
+ uint8_t* dst_y,
1388
+ int dst_stride_y,
1389
+ uint8_t* dst_vu,
1390
+ int dst_stride_vu,
1391
+ int width,
1392
+ int height) {
1393
+ int halfwidth = (width + 1) >> 1;
1394
+ int halfheight = (height + 1) >> 1;
1395
+ if ((!src_y && dst_y) || !dst_vu || width <= 0 || height == 0) {
1396
+ return -1;
1397
+ }
1398
+ // Negative height means invert the image.
1399
+ if (height < 0) {
1400
+ height = -height;
1401
+ halfheight = (height + 1) >> 1;
1402
+ src_y = src_y + (height - 1) * src_stride_y;
1403
+ src_stride_y = -src_stride_y;
1404
+ }
1405
+ if (dst_y) {
1406
+ CopyPlane(src_y, src_stride_y, dst_y, dst_stride_y, width, height);
1407
+ }
1408
+ SetPlane(dst_vu, dst_stride_vu, halfwidth * 2, halfheight, 128);
1409
+ return 0;
1410
+ }
1411
+
1412
+ // Convert NV12 to I420.
1413
+ // TODO(fbarchard): Consider inverting destination. Faster on ARM with prfm.
1414
+ LIBYUV_API
1415
+ int NV12ToI420(const uint8_t* src_y,
1416
+ int src_stride_y,
1417
+ const uint8_t* src_uv,
1418
+ int src_stride_uv,
1419
+ uint8_t* dst_y,
1420
+ int dst_stride_y,
1421
+ uint8_t* dst_u,
1422
+ int dst_stride_u,
1423
+ uint8_t* dst_v,
1424
+ int dst_stride_v,
1425
+ int width,
1426
+ int height) {
1427
+ int halfwidth = (width + 1) >> 1;
1428
+ int halfheight = (height + 1) >> 1;
1429
+ if ((!src_y && dst_y) || !src_uv || !dst_u || !dst_v || width <= 0 ||
1430
+ height == 0) {
1431
+ return -1;
1432
+ }
1433
+ // Negative height means invert the image.
1434
+ if (height < 0) {
1435
+ height = -height;
1436
+ halfheight = (height + 1) >> 1;
1437
+ src_y = src_y + (height - 1) * src_stride_y;
1438
+ src_uv = src_uv + (halfheight - 1) * src_stride_uv;
1439
+ src_stride_y = -src_stride_y;
1440
+ src_stride_uv = -src_stride_uv;
1441
+ }
1442
+ // Coalesce rows.
1443
+ if (src_stride_y == width && dst_stride_y == width) {
1444
+ width *= height;
1445
+ height = 1;
1446
+ src_stride_y = dst_stride_y = 0;
1447
+ }
1448
+ // Coalesce rows.
1449
+ if (src_stride_uv == halfwidth * 2 && dst_stride_u == halfwidth &&
1450
+ dst_stride_v == halfwidth) {
1451
+ halfwidth *= halfheight;
1452
+ halfheight = 1;
1453
+ src_stride_uv = dst_stride_u = dst_stride_v = 0;
1454
+ }
1455
+
1456
+ if (dst_y) {
1457
+ CopyPlane(src_y, src_stride_y, dst_y, dst_stride_y, width, height);
1458
+ }
1459
+
1460
+ // Split UV plane - NV12 / NV21
1461
+ SplitUVPlane(src_uv, src_stride_uv, dst_u, dst_stride_u, dst_v, dst_stride_v,
1462
+ halfwidth, halfheight);
1463
+
1464
+ return 0;
1465
+ }
1466
+
1467
+ // Convert NV21 to I420. Same as NV12 but u and v pointers swapped.
1468
+ LIBYUV_API
1469
+ int NV21ToI420(const uint8_t* src_y,
1470
+ int src_stride_y,
1471
+ const uint8_t* src_vu,
1472
+ int src_stride_vu,
1473
+ uint8_t* dst_y,
1474
+ int dst_stride_y,
1475
+ uint8_t* dst_u,
1476
+ int dst_stride_u,
1477
+ uint8_t* dst_v,
1478
+ int dst_stride_v,
1479
+ int width,
1480
+ int height) {
1481
+ return NV12ToI420(src_y, src_stride_y, src_vu, src_stride_vu, dst_y,
1482
+ dst_stride_y, dst_v, dst_stride_v, dst_u, dst_stride_u,
1483
+ width, height);
1484
+ }
1485
+
1486
+ LIBYUV_API
1487
+ int NV12ToNV24(const uint8_t* src_y,
1488
+ int src_stride_y,
1489
+ const uint8_t* src_uv,
1490
+ int src_stride_uv,
1491
+ uint8_t* dst_y,
1492
+ int dst_stride_y,
1493
+ uint8_t* dst_uv,
1494
+ int dst_stride_uv,
1495
+ int width,
1496
+ int height) {
1497
+ int r;
1498
+ if ((!src_y && dst_y) || !src_uv || !dst_uv || width <= 0 || height == 0) {
1499
+ return -1;
1500
+ }
1501
+
1502
+ if (dst_y) {
1503
+ CopyPlane(src_y, src_stride_y, dst_y, dst_stride_y, width, height);
1504
+ }
1505
+ r = UVScale(src_uv, src_stride_uv, SUBSAMPLE(width, 1, 1),
1506
+ SUBSAMPLE(height, 1, 1), dst_uv, dst_stride_uv, Abs(width),
1507
+ Abs(height), kFilterBilinear);
1508
+ return r;
1509
+ }
1510
+
1511
+ LIBYUV_API
1512
+ int NV16ToNV24(const uint8_t* src_y,
1513
+ int src_stride_y,
1514
+ const uint8_t* src_uv,
1515
+ int src_stride_uv,
1516
+ uint8_t* dst_y,
1517
+ int dst_stride_y,
1518
+ uint8_t* dst_uv,
1519
+ int dst_stride_uv,
1520
+ int width,
1521
+ int height) {
1522
+ int r;
1523
+ if ((!src_y && dst_y) || !src_uv || !dst_uv || width <= 0 || height == 0) {
1524
+ return -1;
1525
+ }
1526
+
1527
+ if (dst_y) {
1528
+ CopyPlane(src_y, src_stride_y, dst_y, dst_stride_y, width, height);
1529
+ }
1530
+ r = UVScale(src_uv, src_stride_uv, SUBSAMPLE(width, 1, 1), height, dst_uv,
1531
+ dst_stride_uv, Abs(width), Abs(height), kFilterBilinear);
1532
+ return r;
1533
+ }
1534
+
1535
+ // Any P[420]1[02] to I[420]1[02] format
1536
+ static int PxxxToIxxx(const uint16_t* src_y,
1537
+ int src_stride_y,
1538
+ const uint16_t* src_uv,
1539
+ int src_stride_uv,
1540
+ uint16_t* dst_y,
1541
+ int dst_stride_y,
1542
+ uint16_t* dst_u,
1543
+ int dst_stride_u,
1544
+ uint16_t* dst_v,
1545
+ int dst_stride_v,
1546
+ int width,
1547
+ int height,
1548
+ int subsample_x,
1549
+ int subsample_y,
1550
+ int depth) {
1551
+ const int uv_width = SUBSAMPLE(width, subsample_x, subsample_x);
1552
+ const int uv_height = SUBSAMPLE(height, subsample_y, subsample_y);
1553
+ if (!src_y || !dst_y || !src_uv || !dst_u || !dst_v || width <= 0 ||
1554
+ height == 0) {
1555
+ return -1;
1556
+ }
1557
+ ConvertToLSBPlane_16(src_y, src_stride_y, dst_y, dst_stride_y, width, height,
1558
+ depth);
1559
+ SplitUVPlane_16(src_uv, src_stride_uv, dst_u, dst_stride_u, dst_v,
1560
+ dst_stride_v, uv_width, uv_height, depth);
1561
+ return 0;
1562
+ }
1563
+
1564
+ LIBYUV_API
1565
+ int P010ToI010(const uint16_t* src_y,
1566
+ int src_stride_y,
1567
+ const uint16_t* src_uv,
1568
+ int src_stride_uv,
1569
+ uint16_t* dst_y,
1570
+ int dst_stride_y,
1571
+ uint16_t* dst_u,
1572
+ int dst_stride_u,
1573
+ uint16_t* dst_v,
1574
+ int dst_stride_v,
1575
+ int width,
1576
+ int height) {
1577
+ return PxxxToIxxx(src_y, src_stride_y, src_uv, src_stride_uv, dst_y,
1578
+ dst_stride_y, dst_u, dst_stride_u, dst_v, dst_stride_v,
1579
+ width, height, 1, 1, 10);
1580
+ }
1581
+
1582
+ LIBYUV_API
1583
+ int P012ToI012(const uint16_t* src_y,
1584
+ int src_stride_y,
1585
+ const uint16_t* src_uv,
1586
+ int src_stride_uv,
1587
+ uint16_t* dst_y,
1588
+ int dst_stride_y,
1589
+ uint16_t* dst_u,
1590
+ int dst_stride_u,
1591
+ uint16_t* dst_v,
1592
+ int dst_stride_v,
1593
+ int width,
1594
+ int height) {
1595
+ return PxxxToIxxx(src_y, src_stride_y, src_uv, src_stride_uv, dst_y,
1596
+ dst_stride_y, dst_u, dst_stride_u, dst_v, dst_stride_v,
1597
+ width, height, 1, 1, 12);
1598
+ }
1599
+
1600
+ LIBYUV_API
1601
+ int P010ToP410(const uint16_t* src_y,
1602
+ int src_stride_y,
1603
+ const uint16_t* src_uv,
1604
+ int src_stride_uv,
1605
+ uint16_t* dst_y,
1606
+ int dst_stride_y,
1607
+ uint16_t* dst_uv,
1608
+ int dst_stride_uv,
1609
+ int width,
1610
+ int height) {
1611
+ int r;
1612
+ if ((!src_y && dst_y) || !src_uv || !dst_uv || width <= 0 || height == 0) {
1613
+ return -1;
1614
+ }
1615
+
1616
+ if (dst_y) {
1617
+ CopyPlane_16(src_y, src_stride_y, dst_y, dst_stride_y, width, height);
1618
+ }
1619
+ r = UVScale_16(src_uv, src_stride_uv, SUBSAMPLE(width, 1, 1),
1620
+ SUBSAMPLE(height, 1, 1), dst_uv, dst_stride_uv, Abs(width),
1621
+ Abs(height), kFilterBilinear);
1622
+ return r;
1623
+ }
1624
+
1625
+ LIBYUV_API
1626
+ int P210ToP410(const uint16_t* src_y,
1627
+ int src_stride_y,
1628
+ const uint16_t* src_uv,
1629
+ int src_stride_uv,
1630
+ uint16_t* dst_y,
1631
+ int dst_stride_y,
1632
+ uint16_t* dst_uv,
1633
+ int dst_stride_uv,
1634
+ int width,
1635
+ int height) {
1636
+ int r;
1637
+ if ((!src_y && dst_y) || !src_uv || !dst_uv || width <= 0 || height == 0) {
1638
+ return -1;
1639
+ }
1640
+
1641
+ if (dst_y) {
1642
+ CopyPlane_16(src_y, src_stride_y, dst_y, dst_stride_y, width, height);
1643
+ }
1644
+ r = UVScale_16(src_uv, src_stride_uv, SUBSAMPLE(width, 1, 1), height, dst_uv,
1645
+ dst_stride_uv, Abs(width), Abs(height), kFilterBilinear);
1646
+ return r;
1647
+ }
1648
+
1649
+ // Convert YUY2 to I420.
1650
+ LIBYUV_API
1651
+ int YUY2ToI420(const uint8_t* src_yuy2,
1652
+ int src_stride_yuy2,
1653
+ uint8_t* dst_y,
1654
+ int dst_stride_y,
1655
+ uint8_t* dst_u,
1656
+ int dst_stride_u,
1657
+ uint8_t* dst_v,
1658
+ int dst_stride_v,
1659
+ int width,
1660
+ int height) {
1661
+ int y;
1662
+ void (*YUY2ToUVRow)(const uint8_t* src_yuy2, int src_stride_yuy2,
1663
+ uint8_t* dst_u, uint8_t* dst_v, int width) =
1664
+ YUY2ToUVRow_C;
1665
+ void (*YUY2ToYRow)(const uint8_t* src_yuy2, uint8_t* dst_y, int width) =
1666
+ YUY2ToYRow_C;
1667
+ // Negative height means invert the image.
1668
+ if (height < 0) {
1669
+ height = -height;
1670
+ src_yuy2 = src_yuy2 + (height - 1) * src_stride_yuy2;
1671
+ src_stride_yuy2 = -src_stride_yuy2;
1672
+ }
1673
+ #if defined(HAS_YUY2TOYROW_SSE2)
1674
+ if (TestCpuFlag(kCpuHasSSE2)) {
1675
+ YUY2ToUVRow = YUY2ToUVRow_Any_SSE2;
1676
+ YUY2ToYRow = YUY2ToYRow_Any_SSE2;
1677
+ if (IS_ALIGNED(width, 16)) {
1678
+ YUY2ToUVRow = YUY2ToUVRow_SSE2;
1679
+ YUY2ToYRow = YUY2ToYRow_SSE2;
1680
+ }
1681
+ }
1682
+ #endif
1683
+ #if defined(HAS_YUY2TOYROW_AVX2)
1684
+ if (TestCpuFlag(kCpuHasAVX2)) {
1685
+ YUY2ToUVRow = YUY2ToUVRow_Any_AVX2;
1686
+ YUY2ToYRow = YUY2ToYRow_Any_AVX2;
1687
+ if (IS_ALIGNED(width, 32)) {
1688
+ YUY2ToUVRow = YUY2ToUVRow_AVX2;
1689
+ YUY2ToYRow = YUY2ToYRow_AVX2;
1690
+ }
1691
+ }
1692
+ #endif
1693
+ #if defined(HAS_YUY2TOYROW_NEON)
1694
+ if (TestCpuFlag(kCpuHasNEON)) {
1695
+ YUY2ToYRow = YUY2ToYRow_Any_NEON;
1696
+ YUY2ToUVRow = YUY2ToUVRow_Any_NEON;
1697
+ if (IS_ALIGNED(width, 16)) {
1698
+ YUY2ToYRow = YUY2ToYRow_NEON;
1699
+ YUY2ToUVRow = YUY2ToUVRow_NEON;
1700
+ }
1701
+ }
1702
+ #endif
1703
+ #if defined(HAS_YUY2TOYROW_LSX) && defined(HAS_YUY2TOUVROW_LSX)
1704
+ if (TestCpuFlag(kCpuHasLSX)) {
1705
+ YUY2ToYRow = YUY2ToYRow_Any_LSX;
1706
+ YUY2ToUVRow = YUY2ToUVRow_Any_LSX;
1707
+ if (IS_ALIGNED(width, 16)) {
1708
+ YUY2ToYRow = YUY2ToYRow_LSX;
1709
+ YUY2ToUVRow = YUY2ToUVRow_LSX;
1710
+ }
1711
+ }
1712
+ #endif
1713
+ #if defined(HAS_YUY2TOYROW_LASX) && defined(HAS_YUY2TOUVROW_LASX)
1714
+ if (TestCpuFlag(kCpuHasLASX)) {
1715
+ YUY2ToYRow = YUY2ToYRow_Any_LASX;
1716
+ YUY2ToUVRow = YUY2ToUVRow_Any_LASX;
1717
+ if (IS_ALIGNED(width, 32)) {
1718
+ YUY2ToYRow = YUY2ToYRow_LASX;
1719
+ YUY2ToUVRow = YUY2ToUVRow_LASX;
1720
+ }
1721
+ }
1722
+ #endif
1723
+
1724
+ for (y = 0; y < height - 1; y += 2) {
1725
+ YUY2ToUVRow(src_yuy2, src_stride_yuy2, dst_u, dst_v, width);
1726
+ YUY2ToYRow(src_yuy2, dst_y, width);
1727
+ YUY2ToYRow(src_yuy2 + src_stride_yuy2, dst_y + dst_stride_y, width);
1728
+ src_yuy2 += src_stride_yuy2 * 2;
1729
+ dst_y += dst_stride_y * 2;
1730
+ dst_u += dst_stride_u;
1731
+ dst_v += dst_stride_v;
1732
+ }
1733
+ if (height & 1) {
1734
+ YUY2ToUVRow(src_yuy2, 0, dst_u, dst_v, width);
1735
+ YUY2ToYRow(src_yuy2, dst_y, width);
1736
+ }
1737
+ return 0;
1738
+ }
1739
+
1740
+ // Convert UYVY to I420.
1741
+ LIBYUV_API
1742
+ int UYVYToI420(const uint8_t* src_uyvy,
1743
+ int src_stride_uyvy,
1744
+ uint8_t* dst_y,
1745
+ int dst_stride_y,
1746
+ uint8_t* dst_u,
1747
+ int dst_stride_u,
1748
+ uint8_t* dst_v,
1749
+ int dst_stride_v,
1750
+ int width,
1751
+ int height) {
1752
+ int y;
1753
+ void (*UYVYToUVRow)(const uint8_t* src_uyvy, int src_stride_uyvy,
1754
+ uint8_t* dst_u, uint8_t* dst_v, int width) =
1755
+ UYVYToUVRow_C;
1756
+ void (*UYVYToYRow)(const uint8_t* src_uyvy, uint8_t* dst_y, int width) =
1757
+ UYVYToYRow_C;
1758
+ // Negative height means invert the image.
1759
+ if (height < 0) {
1760
+ height = -height;
1761
+ src_uyvy = src_uyvy + (height - 1) * src_stride_uyvy;
1762
+ src_stride_uyvy = -src_stride_uyvy;
1763
+ }
1764
+ #if defined(HAS_UYVYTOYROW_SSE2)
1765
+ if (TestCpuFlag(kCpuHasSSE2)) {
1766
+ UYVYToUVRow = UYVYToUVRow_Any_SSE2;
1767
+ UYVYToYRow = UYVYToYRow_Any_SSE2;
1768
+ if (IS_ALIGNED(width, 16)) {
1769
+ UYVYToUVRow = UYVYToUVRow_SSE2;
1770
+ UYVYToYRow = UYVYToYRow_SSE2;
1771
+ }
1772
+ }
1773
+ #endif
1774
+ #if defined(HAS_UYVYTOYROW_AVX2)
1775
+ if (TestCpuFlag(kCpuHasAVX2)) {
1776
+ UYVYToUVRow = UYVYToUVRow_Any_AVX2;
1777
+ UYVYToYRow = UYVYToYRow_Any_AVX2;
1778
+ if (IS_ALIGNED(width, 32)) {
1779
+ UYVYToUVRow = UYVYToUVRow_AVX2;
1780
+ UYVYToYRow = UYVYToYRow_AVX2;
1781
+ }
1782
+ }
1783
+ #endif
1784
+ #if defined(HAS_UYVYTOYROW_NEON)
1785
+ if (TestCpuFlag(kCpuHasNEON)) {
1786
+ UYVYToYRow = UYVYToYRow_Any_NEON;
1787
+ UYVYToUVRow = UYVYToUVRow_Any_NEON;
1788
+ if (IS_ALIGNED(width, 16)) {
1789
+ UYVYToYRow = UYVYToYRow_NEON;
1790
+ UYVYToUVRow = UYVYToUVRow_NEON;
1791
+ }
1792
+ }
1793
+ #endif
1794
+ #if defined(HAS_UYVYTOYROW_LSX)
1795
+ if (TestCpuFlag(kCpuHasLSX)) {
1796
+ UYVYToYRow = UYVYToYRow_Any_LSX;
1797
+ UYVYToUVRow = UYVYToUVRow_Any_LSX;
1798
+ if (IS_ALIGNED(width, 16)) {
1799
+ UYVYToYRow = UYVYToYRow_LSX;
1800
+ UYVYToUVRow = UYVYToUVRow_LSX;
1801
+ }
1802
+ }
1803
+ #endif
1804
+ #if defined(HAS_UYVYTOYROW_LSX)
1805
+ if (TestCpuFlag(kCpuHasLSX)) {
1806
+ UYVYToYRow = UYVYToYRow_Any_LSX;
1807
+ UYVYToUVRow = UYVYToUVRow_Any_LSX;
1808
+ if (IS_ALIGNED(width, 16)) {
1809
+ UYVYToYRow = UYVYToYRow_LSX;
1810
+ UYVYToUVRow = UYVYToUVRow_LSX;
1811
+ }
1812
+ }
1813
+ #endif
1814
+ #if defined(HAS_UYVYTOYROW_LASX)
1815
+ if (TestCpuFlag(kCpuHasLASX)) {
1816
+ UYVYToYRow = UYVYToYRow_Any_LASX;
1817
+ UYVYToUVRow = UYVYToUVRow_Any_LASX;
1818
+ if (IS_ALIGNED(width, 32)) {
1819
+ UYVYToYRow = UYVYToYRow_LASX;
1820
+ UYVYToUVRow = UYVYToUVRow_LASX;
1821
+ }
1822
+ }
1823
+ #endif
1824
+
1825
+ for (y = 0; y < height - 1; y += 2) {
1826
+ UYVYToUVRow(src_uyvy, src_stride_uyvy, dst_u, dst_v, width);
1827
+ UYVYToYRow(src_uyvy, dst_y, width);
1828
+ UYVYToYRow(src_uyvy + src_stride_uyvy, dst_y + dst_stride_y, width);
1829
+ src_uyvy += src_stride_uyvy * 2;
1830
+ dst_y += dst_stride_y * 2;
1831
+ dst_u += dst_stride_u;
1832
+ dst_v += dst_stride_v;
1833
+ }
1834
+ if (height & 1) {
1835
+ UYVYToUVRow(src_uyvy, 0, dst_u, dst_v, width);
1836
+ UYVYToYRow(src_uyvy, dst_y, width);
1837
+ }
1838
+ return 0;
1839
+ }
1840
+
1841
+ // Convert AYUV to NV12.
1842
+ LIBYUV_API
1843
+ int AYUVToNV12(const uint8_t* src_ayuv,
1844
+ int src_stride_ayuv,
1845
+ uint8_t* dst_y,
1846
+ int dst_stride_y,
1847
+ uint8_t* dst_uv,
1848
+ int dst_stride_uv,
1849
+ int width,
1850
+ int height) {
1851
+ int y;
1852
+ void (*AYUVToUVRow)(const uint8_t* src_ayuv, int src_stride_ayuv,
1853
+ uint8_t* dst_uv, int width) = AYUVToUVRow_C;
1854
+ void (*AYUVToYRow)(const uint8_t* src_ayuv, uint8_t* dst_y, int width) =
1855
+ AYUVToYRow_C;
1856
+ // Negative height means invert the image.
1857
+ if (height < 0) {
1858
+ height = -height;
1859
+ src_ayuv = src_ayuv + (height - 1) * src_stride_ayuv;
1860
+ src_stride_ayuv = -src_stride_ayuv;
1861
+ }
1862
+ // place holders for future intel code
1863
+ #if defined(HAS_AYUVTOYROW_SSE2)
1864
+ if (TestCpuFlag(kCpuHasSSE2)) {
1865
+ AYUVToUVRow = AYUVToUVRow_Any_SSE2;
1866
+ AYUVToYRow = AYUVToYRow_Any_SSE2;
1867
+ if (IS_ALIGNED(width, 16)) {
1868
+ AYUVToUVRow = AYUVToUVRow_SSE2;
1869
+ AYUVToYRow = AYUVToYRow_SSE2;
1870
+ }
1871
+ }
1872
+ #endif
1873
+ #if defined(HAS_AYUVTOYROW_AVX2)
1874
+ if (TestCpuFlag(kCpuHasAVX2)) {
1875
+ AYUVToUVRow = AYUVToUVRow_Any_AVX2;
1876
+ AYUVToYRow = AYUVToYRow_Any_AVX2;
1877
+ if (IS_ALIGNED(width, 32)) {
1878
+ AYUVToUVRow = AYUVToUVRow_AVX2;
1879
+ AYUVToYRow = AYUVToYRow_AVX2;
1880
+ }
1881
+ }
1882
+ #endif
1883
+
1884
+ #if defined(HAS_AYUVTOYROW_NEON)
1885
+ if (TestCpuFlag(kCpuHasNEON)) {
1886
+ AYUVToYRow = AYUVToYRow_Any_NEON;
1887
+ AYUVToUVRow = AYUVToUVRow_Any_NEON;
1888
+ if (IS_ALIGNED(width, 16)) {
1889
+ AYUVToYRow = AYUVToYRow_NEON;
1890
+ AYUVToUVRow = AYUVToUVRow_NEON;
1891
+ }
1892
+ }
1893
+ #endif
1894
+ #if defined(HAS_AYUVTOUVROW_SVE2)
1895
+ if (TestCpuFlag(kCpuHasSVE2)) {
1896
+ AYUVToUVRow = AYUVToUVRow_Any_SVE2;
1897
+ if (IS_ALIGNED(width, 2)) {
1898
+ AYUVToUVRow = AYUVToUVRow_SVE2;
1899
+ }
1900
+ }
1901
+ #endif
1902
+
1903
+ for (y = 0; y < height - 1; y += 2) {
1904
+ AYUVToUVRow(src_ayuv, src_stride_ayuv, dst_uv, width);
1905
+ AYUVToYRow(src_ayuv, dst_y, width);
1906
+ AYUVToYRow(src_ayuv + src_stride_ayuv, dst_y + dst_stride_y, width);
1907
+ src_ayuv += src_stride_ayuv * 2;
1908
+ dst_y += dst_stride_y * 2;
1909
+ dst_uv += dst_stride_uv;
1910
+ }
1911
+ if (height & 1) {
1912
+ AYUVToUVRow(src_ayuv, 0, dst_uv, width);
1913
+ AYUVToYRow(src_ayuv, dst_y, width);
1914
+ }
1915
+ return 0;
1916
+ }
1917
+
1918
+ // Convert AYUV to NV21.
1919
+ LIBYUV_API
1920
+ int AYUVToNV21(const uint8_t* src_ayuv,
1921
+ int src_stride_ayuv,
1922
+ uint8_t* dst_y,
1923
+ int dst_stride_y,
1924
+ uint8_t* dst_vu,
1925
+ int dst_stride_vu,
1926
+ int width,
1927
+ int height) {
1928
+ int y;
1929
+ void (*AYUVToVURow)(const uint8_t* src_ayuv, int src_stride_ayuv,
1930
+ uint8_t* dst_vu, int width) = AYUVToVURow_C;
1931
+ void (*AYUVToYRow)(const uint8_t* src_ayuv, uint8_t* dst_y, int width) =
1932
+ AYUVToYRow_C;
1933
+ // Negative height means invert the image.
1934
+ if (height < 0) {
1935
+ height = -height;
1936
+ src_ayuv = src_ayuv + (height - 1) * src_stride_ayuv;
1937
+ src_stride_ayuv = -src_stride_ayuv;
1938
+ }
1939
+ // place holders for future intel code
1940
+ #if defined(HAS_AYUVTOYROW_SSE2)
1941
+ if (TestCpuFlag(kCpuHasSSE2)) {
1942
+ AYUVToVURow = AYUVToVURow_Any_SSE2;
1943
+ AYUVToYRow = AYUVToYRow_Any_SSE2;
1944
+ if (IS_ALIGNED(width, 16)) {
1945
+ AYUVToVURow = AYUVToVURow_SSE2;
1946
+ AYUVToYRow = AYUVToYRow_SSE2;
1947
+ }
1948
+ }
1949
+ #endif
1950
+ #if defined(HAS_AYUVTOYROW_AVX2)
1951
+ if (TestCpuFlag(kCpuHasAVX2)) {
1952
+ AYUVToVURow = AYUVToVURow_Any_AVX2;
1953
+ AYUVToYRow = AYUVToYRow_Any_AVX2;
1954
+ if (IS_ALIGNED(width, 32)) {
1955
+ AYUVToVURow = AYUVToVURow_AVX2;
1956
+ AYUVToYRow = AYUVToYRow_AVX2;
1957
+ }
1958
+ }
1959
+ #endif
1960
+
1961
+ #if defined(HAS_AYUVTOYROW_NEON)
1962
+ if (TestCpuFlag(kCpuHasNEON)) {
1963
+ AYUVToYRow = AYUVToYRow_Any_NEON;
1964
+ AYUVToVURow = AYUVToVURow_Any_NEON;
1965
+ if (IS_ALIGNED(width, 16)) {
1966
+ AYUVToYRow = AYUVToYRow_NEON;
1967
+ AYUVToVURow = AYUVToVURow_NEON;
1968
+ }
1969
+ }
1970
+ #endif
1971
+ #if defined(HAS_AYUVTOVUROW_SVE2)
1972
+ if (TestCpuFlag(kCpuHasSVE2)) {
1973
+ AYUVToVURow = AYUVToVURow_Any_SVE2;
1974
+ if (IS_ALIGNED(width, 2)) {
1975
+ AYUVToVURow = AYUVToVURow_SVE2;
1976
+ }
1977
+ }
1978
+ #endif
1979
+
1980
+ for (y = 0; y < height - 1; y += 2) {
1981
+ AYUVToVURow(src_ayuv, src_stride_ayuv, dst_vu, width);
1982
+ AYUVToYRow(src_ayuv, dst_y, width);
1983
+ AYUVToYRow(src_ayuv + src_stride_ayuv, dst_y + dst_stride_y, width);
1984
+ src_ayuv += src_stride_ayuv * 2;
1985
+ dst_y += dst_stride_y * 2;
1986
+ dst_vu += dst_stride_vu;
1987
+ }
1988
+ if (height & 1) {
1989
+ AYUVToVURow(src_ayuv, 0, dst_vu, width);
1990
+ AYUVToYRow(src_ayuv, dst_y, width);
1991
+ }
1992
+ return 0;
1993
+ }
1994
+
1995
+ // Convert ARGB to I420.
1996
+ LIBYUV_API
1997
+ int ARGBToI420(const uint8_t* src_argb,
1998
+ int src_stride_argb,
1999
+ uint8_t* dst_y,
2000
+ int dst_stride_y,
2001
+ uint8_t* dst_u,
2002
+ int dst_stride_u,
2003
+ uint8_t* dst_v,
2004
+ int dst_stride_v,
2005
+ int width,
2006
+ int height) {
2007
+ int y;
2008
+ void (*ARGBToUVRow)(const uint8_t* src_argb0, int src_stride_argb,
2009
+ uint8_t* dst_u, uint8_t* dst_v, int width) =
2010
+ ARGBToUVRow_C;
2011
+ void (*ARGBToYRow)(const uint8_t* src_argb, uint8_t* dst_y, int width) =
2012
+ ARGBToYRow_C;
2013
+ if (!src_argb || !dst_y || !dst_u || !dst_v || width <= 0 || height == 0) {
2014
+ return -1;
2015
+ }
2016
+ // Negative height means invert the image.
2017
+ if (height < 0) {
2018
+ height = -height;
2019
+ src_argb = src_argb + (height - 1) * src_stride_argb;
2020
+ src_stride_argb = -src_stride_argb;
2021
+ }
2022
+ #if defined(HAS_ARGBTOYROW_NEON)
2023
+ if (TestCpuFlag(kCpuHasNEON)) {
2024
+ ARGBToYRow = ARGBToYRow_Any_NEON;
2025
+ if (IS_ALIGNED(width, 16)) {
2026
+ ARGBToYRow = ARGBToYRow_NEON;
2027
+ }
2028
+ }
2029
+ #endif
2030
+ #if defined(HAS_ARGBTOYROW_NEON_DOTPROD)
2031
+ if (TestCpuFlag(kCpuHasNeonDotProd)) {
2032
+ ARGBToYRow = ARGBToYRow_Any_NEON_DotProd;
2033
+ if (IS_ALIGNED(width, 16)) {
2034
+ ARGBToYRow = ARGBToYRow_NEON_DotProd;
2035
+ }
2036
+ }
2037
+ #endif
2038
+ #if defined(HAS_ARGBTOUVROW_NEON)
2039
+ if (TestCpuFlag(kCpuHasNEON)) {
2040
+ ARGBToUVRow = ARGBToUVRow_Any_NEON;
2041
+ if (IS_ALIGNED(width, 16)) {
2042
+ ARGBToUVRow = ARGBToUVRow_NEON;
2043
+ }
2044
+ }
2045
+ #endif
2046
+ #if defined(HAS_ARGBTOUVROW_NEON_I8MM)
2047
+ if (TestCpuFlag(kCpuHasNeonI8MM)) {
2048
+ ARGBToUVRow = ARGBToUVRow_Any_NEON_I8MM;
2049
+ if (IS_ALIGNED(width, 16)) {
2050
+ ARGBToUVRow = ARGBToUVRow_NEON_I8MM;
2051
+ }
2052
+ }
2053
+ #endif
2054
+ #if defined(HAS_ARGBTOUVROW_SVE2)
2055
+ if (TestCpuFlag(kCpuHasSVE2)) {
2056
+ ARGBToUVRow = ARGBToUVRow_Any_SVE2;
2057
+ if (IS_ALIGNED(width, 2)) {
2058
+ ARGBToUVRow = ARGBToUVRow_SVE2;
2059
+ }
2060
+ }
2061
+ #endif
2062
+ #if defined(HAS_ARGBTOUVROW_SME)
2063
+ if (TestCpuFlag(kCpuHasSME)) {
2064
+ ARGBToUVRow = ARGBToUVRow_Any_SME;
2065
+ if (IS_ALIGNED(width, 2)) {
2066
+ ARGBToUVRow = ARGBToUVRow_SME;
2067
+ }
2068
+ }
2069
+ #endif
2070
+ #if defined(HAS_ARGBTOYROW_SSSE3)
2071
+ if (TestCpuFlag(kCpuHasSSSE3)) {
2072
+ ARGBToYRow = ARGBToYRow_Any_SSSE3;
2073
+ if (IS_ALIGNED(width, 16)) {
2074
+ ARGBToYRow = ARGBToYRow_SSSE3;
2075
+ }
2076
+ }
2077
+ #endif
2078
+ #if defined(HAS_ARGBTOUVROW_SSSE3)
2079
+ if (TestCpuFlag(kCpuHasSSSE3)) {
2080
+ ARGBToUVRow = ARGBToUVRow_Any_SSSE3;
2081
+ if (IS_ALIGNED(width, 16)) {
2082
+ ARGBToUVRow = ARGBToUVRow_SSSE3;
2083
+ }
2084
+ }
2085
+ #endif
2086
+ #if defined(HAS_ARGBTOYROW_AVX2)
2087
+ if (TestCpuFlag(kCpuHasAVX2)) {
2088
+ ARGBToYRow = ARGBToYRow_Any_AVX2;
2089
+ if (IS_ALIGNED(width, 32)) {
2090
+ ARGBToYRow = ARGBToYRow_AVX2;
2091
+ }
2092
+ }
2093
+ #endif
2094
+ #if defined(HAS_ARGBTOUVROW_AVX2)
2095
+ if (TestCpuFlag(kCpuHasAVX2)) {
2096
+ ARGBToUVRow = ARGBToUVRow_Any_AVX2;
2097
+ if (IS_ALIGNED(width, 32)) {
2098
+ ARGBToUVRow = ARGBToUVRow_AVX2;
2099
+ }
2100
+ }
2101
+ #endif
2102
+ #if defined(HAS_ARGBTOYROW_LSX)
2103
+ if (TestCpuFlag(kCpuHasLSX)) {
2104
+ ARGBToYRow = ARGBToYRow_Any_LSX;
2105
+ if (IS_ALIGNED(width, 16)) {
2106
+ ARGBToYRow = ARGBToYRow_LSX;
2107
+ }
2108
+ }
2109
+ #endif
2110
+ #if defined(HAS_ARGBTOYROW_LSX) && defined(HAS_ARGBTOUVROW_LSX)
2111
+ if (TestCpuFlag(kCpuHasLSX)) {
2112
+ ARGBToYRow = ARGBToYRow_Any_LSX;
2113
+ ARGBToUVRow = ARGBToUVRow_Any_LSX;
2114
+ if (IS_ALIGNED(width, 16)) {
2115
+ ARGBToYRow = ARGBToYRow_LSX;
2116
+ ARGBToUVRow = ARGBToUVRow_LSX;
2117
+ }
2118
+ }
2119
+ #endif
2120
+ #if defined(HAS_ARGBTOYROW_LASX) && defined(HAS_ARGBTOUVROW_LASX)
2121
+ if (TestCpuFlag(kCpuHasLASX)) {
2122
+ ARGBToYRow = ARGBToYRow_Any_LASX;
2123
+ ARGBToUVRow = ARGBToUVRow_Any_LASX;
2124
+ if (IS_ALIGNED(width, 32)) {
2125
+ ARGBToYRow = ARGBToYRow_LASX;
2126
+ ARGBToUVRow = ARGBToUVRow_LASX;
2127
+ }
2128
+ }
2129
+ #endif
2130
+
2131
+ for (y = 0; y < height - 1; y += 2) {
2132
+ ARGBToUVRow(src_argb, src_stride_argb, dst_u, dst_v, width);
2133
+ ARGBToYRow(src_argb, dst_y, width);
2134
+ ARGBToYRow(src_argb + src_stride_argb, dst_y + dst_stride_y, width);
2135
+ src_argb += src_stride_argb * 2;
2136
+ dst_y += dst_stride_y * 2;
2137
+ dst_u += dst_stride_u;
2138
+ dst_v += dst_stride_v;
2139
+ }
2140
+ if (height & 1) {
2141
+ ARGBToUVRow(src_argb, 0, dst_u, dst_v, width);
2142
+ ARGBToYRow(src_argb, dst_y, width);
2143
+ }
2144
+ return 0;
2145
+ }
2146
+
2147
+ #ifdef USE_EXTRACTALPHA
2148
+ // Convert ARGB to I420 with Alpha
2149
+ // The following version calls ARGBExtractAlpha on the full image.
2150
+ LIBYUV_API
2151
+ int ARGBToI420Alpha(const uint8_t* src_argb,
2152
+ int src_stride_argb,
2153
+ uint8_t* dst_y,
2154
+ int dst_stride_y,
2155
+ uint8_t* dst_u,
2156
+ int dst_stride_u,
2157
+ uint8_t* dst_v,
2158
+ int dst_stride_v,
2159
+ uint8_t* dst_a,
2160
+ int dst_stride_a,
2161
+ int width,
2162
+ int height) {
2163
+ int r = ARGBToI420(src_argb, src_stride_argb, dst_y, dst_stride_y, dst_u,
2164
+ dst_stride_u, dst_v, dst_stride_v, width, height);
2165
+ if (r == 0) {
2166
+ r = ARGBExtractAlpha(src_argb, src_stride_argb, dst_a, dst_stride_a, width,
2167
+ height);
2168
+ }
2169
+ return r;
2170
+ }
2171
+ #else // USE_EXTRACTALPHA
2172
+ // Convert ARGB to I420 with Alpha
2173
+ LIBYUV_API
2174
+ int ARGBToI420Alpha(const uint8_t* src_argb,
2175
+ int src_stride_argb,
2176
+ uint8_t* dst_y,
2177
+ int dst_stride_y,
2178
+ uint8_t* dst_u,
2179
+ int dst_stride_u,
2180
+ uint8_t* dst_v,
2181
+ int dst_stride_v,
2182
+ uint8_t* dst_a,
2183
+ int dst_stride_a,
2184
+ int width,
2185
+ int height) {
2186
+ int y;
2187
+ void (*ARGBToUVRow)(const uint8_t* src_argb0, int src_stride_argb,
2188
+ uint8_t* dst_u, uint8_t* dst_v, int width) =
2189
+ ARGBToUVRow_C;
2190
+ void (*ARGBToYRow)(const uint8_t* src_argb, uint8_t* dst_y, int width) =
2191
+ ARGBToYRow_C;
2192
+ void (*ARGBExtractAlphaRow)(const uint8_t* src_argb, uint8_t* dst_a,
2193
+ int width) = ARGBExtractAlphaRow_C;
2194
+ if (!src_argb || !dst_y || !dst_u || !dst_v || !dst_a || width <= 0 ||
2195
+ height == 0) {
2196
+ return -1;
2197
+ }
2198
+ // Negative height means invert the image.
2199
+ if (height < 0) {
2200
+ height = -height;
2201
+ src_argb = src_argb + (height - 1) * src_stride_argb;
2202
+ src_stride_argb = -src_stride_argb;
2203
+ }
2204
+ #if defined(HAS_ARGBTOYROW_NEON)
2205
+ if (TestCpuFlag(kCpuHasNEON)) {
2206
+ ARGBToYRow = ARGBToYRow_Any_NEON;
2207
+ if (IS_ALIGNED(width, 16)) {
2208
+ ARGBToYRow = ARGBToYRow_NEON;
2209
+ }
2210
+ }
2211
+ #endif
2212
+ #if defined(HAS_ARGBTOYROW_NEON_DOTPROD)
2213
+ if (TestCpuFlag(kCpuHasNeonDotProd)) {
2214
+ ARGBToYRow = ARGBToYRow_Any_NEON_DotProd;
2215
+ if (IS_ALIGNED(width, 16)) {
2216
+ ARGBToYRow = ARGBToYRow_NEON_DotProd;
2217
+ }
2218
+ }
2219
+ #endif
2220
+ #if defined(HAS_ARGBTOUVROW_NEON)
2221
+ if (TestCpuFlag(kCpuHasNEON)) {
2222
+ ARGBToUVRow = ARGBToUVRow_Any_NEON;
2223
+ if (IS_ALIGNED(width, 16)) {
2224
+ ARGBToUVRow = ARGBToUVRow_NEON;
2225
+ }
2226
+ }
2227
+ #endif
2228
+ #if defined(HAS_ARGBTOUVROW_NEON_I8MM)
2229
+ if (TestCpuFlag(kCpuHasNeonI8MM)) {
2230
+ ARGBToUVRow = ARGBToUVRow_Any_NEON_I8MM;
2231
+ if (IS_ALIGNED(width, 16)) {
2232
+ ARGBToUVRow = ARGBToUVRow_NEON_I8MM;
2233
+ }
2234
+ }
2235
+ #endif
2236
+ #if defined(HAS_ARGBTOUVROW_SVE2)
2237
+ if (TestCpuFlag(kCpuHasSVE2)) {
2238
+ ARGBToUVRow = ARGBToUVRow_Any_SVE2;
2239
+ if (IS_ALIGNED(width, 2)) {
2240
+ ARGBToUVRow = ARGBToUVRow_SVE2;
2241
+ }
2242
+ }
2243
+ #endif
2244
+ #if defined(HAS_ARGBTOUVROW_SME)
2245
+ if (TestCpuFlag(kCpuHasSME)) {
2246
+ ARGBToUVRow = ARGBToUVRow_Any_SME;
2247
+ if (IS_ALIGNED(width, 2)) {
2248
+ ARGBToUVRow = ARGBToUVRow_SME;
2249
+ }
2250
+ }
2251
+ #endif
2252
+ #if defined(HAS_ARGBTOYROW_SSSE3)
2253
+ if (TestCpuFlag(kCpuHasSSSE3)) {
2254
+ ARGBToYRow = ARGBToYRow_Any_SSSE3;
2255
+ if (IS_ALIGNED(width, 16)) {
2256
+ ARGBToYRow = ARGBToYRow_SSSE3;
2257
+ }
2258
+ }
2259
+ #endif
2260
+ #if defined(HAS_ARGBTOUVROW_SSSE3)
2261
+ if (TestCpuFlag(kCpuHasSSSE3)) {
2262
+ ARGBToUVRow = ARGBToUVRow_Any_SSSE3;
2263
+ if (IS_ALIGNED(width, 16)) {
2264
+ ARGBToUVRow = ARGBToUVRow_SSSE3;
2265
+ }
2266
+ }
2267
+ #endif
2268
+ #if defined(HAS_ARGBTOYROW_AVX2)
2269
+ if (TestCpuFlag(kCpuHasAVX2)) {
2270
+ ARGBToYRow = ARGBToYRow_Any_AVX2;
2271
+ if (IS_ALIGNED(width, 32)) {
2272
+ ARGBToYRow = ARGBToYRow_AVX2;
2273
+ }
2274
+ }
2275
+ #endif
2276
+ #if defined(HAS_ARGBTOUVROW_AVX2)
2277
+ if (TestCpuFlag(kCpuHasAVX2)) {
2278
+ ARGBToUVRow = ARGBToUVRow_Any_AVX2;
2279
+ if (IS_ALIGNED(width, 32)) {
2280
+ ARGBToUVRow = ARGBToUVRow_AVX2;
2281
+ }
2282
+ }
2283
+ #endif
2284
+ #if defined(HAS_ARGBTOYROW_LSX)
2285
+ if (TestCpuFlag(kCpuHasLSX)) {
2286
+ ARGBToYRow = ARGBToYRow_Any_LSX;
2287
+ if (IS_ALIGNED(width, 16)) {
2288
+ ARGBToYRow = ARGBToYRow_LSX;
2289
+ }
2290
+ }
2291
+ #endif
2292
+ #if defined(HAS_ARGBTOYROW_LASX) && defined(HAS_ARGBTOUVROW_LASX)
2293
+ if (TestCpuFlag(kCpuHasLASX)) {
2294
+ ARGBToYRow = ARGBToYRow_Any_LASX;
2295
+ ARGBToUVRow = ARGBToUVRow_Any_LASX;
2296
+ if (IS_ALIGNED(width, 32)) {
2297
+ ARGBToYRow = ARGBToYRow_LASX;
2298
+ ARGBToUVRow = ARGBToUVRow_LASX;
2299
+ }
2300
+ }
2301
+ #endif
2302
+ #if defined(HAS_ARGBEXTRACTALPHAROW_SSE2)
2303
+ if (TestCpuFlag(kCpuHasSSE2)) {
2304
+ ARGBExtractAlphaRow = IS_ALIGNED(width, 8) ? ARGBExtractAlphaRow_SSE2
2305
+ : ARGBExtractAlphaRow_Any_SSE2;
2306
+ }
2307
+ #endif
2308
+ #if defined(HAS_ARGBEXTRACTALPHAROW_AVX2)
2309
+ if (TestCpuFlag(kCpuHasAVX2)) {
2310
+ ARGBExtractAlphaRow = IS_ALIGNED(width, 32) ? ARGBExtractAlphaRow_AVX2
2311
+ : ARGBExtractAlphaRow_Any_AVX2;
2312
+ }
2313
+ #endif
2314
+ #if defined(HAS_ARGBEXTRACTALPHAROW_NEON)
2315
+ if (TestCpuFlag(kCpuHasNEON)) {
2316
+ ARGBExtractAlphaRow = IS_ALIGNED(width, 16) ? ARGBExtractAlphaRow_NEON
2317
+ : ARGBExtractAlphaRow_Any_NEON;
2318
+ }
2319
+ #endif
2320
+ #if defined(HAS_ARGBEXTRACTALPHAROW_LSX)
2321
+ if (TestCpuFlag(kCpuHasLSX)) {
2322
+ ARGBExtractAlphaRow = IS_ALIGNED(width, 16) ? ARGBExtractAlphaRow_LSX
2323
+ : ARGBExtractAlphaRow_Any_LSX;
2324
+ }
2325
+ #endif
2326
+ #if defined(HAS_ARGBEXTRACTALPHAROW_RVV)
2327
+ if (TestCpuFlag(kCpuHasRVV)) {
2328
+ ARGBExtractAlphaRow = ARGBExtractAlphaRow_RVV;
2329
+ }
2330
+ #endif
2331
+
2332
+ for (y = 0; y < height - 1; y += 2) {
2333
+ ARGBToUVRow(src_argb, src_stride_argb, dst_u, dst_v, width);
2334
+ ARGBToYRow(src_argb, dst_y, width);
2335
+ ARGBToYRow(src_argb + src_stride_argb, dst_y + dst_stride_y, width);
2336
+ ARGBExtractAlphaRow(src_argb, dst_a, width);
2337
+ ARGBExtractAlphaRow(src_argb + src_stride_argb, dst_a + dst_stride_a,
2338
+ width);
2339
+ src_argb += src_stride_argb * 2;
2340
+ dst_y += dst_stride_y * 2;
2341
+ dst_u += dst_stride_u;
2342
+ dst_v += dst_stride_v;
2343
+ dst_a += dst_stride_a * 2;
2344
+ }
2345
+ if (height & 1) {
2346
+ ARGBToUVRow(src_argb, 0, dst_u, dst_v, width);
2347
+ ARGBToYRow(src_argb, dst_y, width);
2348
+ ARGBExtractAlphaRow(src_argb, dst_a, width);
2349
+ }
2350
+ return 0;
2351
+ }
2352
+ #endif // USE_EXTRACTALPHA
2353
+
2354
+ // Convert BGRA to I420.
2355
+ LIBYUV_API
2356
+ int BGRAToI420(const uint8_t* src_bgra,
2357
+ int src_stride_bgra,
2358
+ uint8_t* dst_y,
2359
+ int dst_stride_y,
2360
+ uint8_t* dst_u,
2361
+ int dst_stride_u,
2362
+ uint8_t* dst_v,
2363
+ int dst_stride_v,
2364
+ int width,
2365
+ int height) {
2366
+ int y;
2367
+ void (*BGRAToUVRow)(const uint8_t* src_bgra0, int src_stride_bgra,
2368
+ uint8_t* dst_u, uint8_t* dst_v, int width) =
2369
+ BGRAToUVRow_C;
2370
+ void (*BGRAToYRow)(const uint8_t* src_bgra, uint8_t* dst_y, int width) =
2371
+ BGRAToYRow_C;
2372
+ if (!src_bgra || !dst_y || !dst_u || !dst_v || width <= 0 || height == 0) {
2373
+ return -1;
2374
+ }
2375
+ // Negative height means invert the image.
2376
+ if (height < 0) {
2377
+ height = -height;
2378
+ src_bgra = src_bgra + (height - 1) * src_stride_bgra;
2379
+ src_stride_bgra = -src_stride_bgra;
2380
+ }
2381
+ #if defined(HAS_BGRATOYROW_NEON)
2382
+ if (TestCpuFlag(kCpuHasNEON)) {
2383
+ BGRAToYRow = BGRAToYRow_Any_NEON;
2384
+ if (IS_ALIGNED(width, 16)) {
2385
+ BGRAToYRow = BGRAToYRow_NEON;
2386
+ }
2387
+ }
2388
+ #endif
2389
+ #if defined(HAS_BGRATOYROW_NEON_DOTPROD)
2390
+ if (TestCpuFlag(kCpuHasNeonDotProd)) {
2391
+ BGRAToYRow = BGRAToYRow_Any_NEON_DotProd;
2392
+ if (IS_ALIGNED(width, 16)) {
2393
+ BGRAToYRow = BGRAToYRow_NEON_DotProd;
2394
+ }
2395
+ }
2396
+ #endif
2397
+ #if defined(HAS_BGRATOUVROW_NEON)
2398
+ if (TestCpuFlag(kCpuHasNEON)) {
2399
+ BGRAToUVRow = BGRAToUVRow_Any_NEON;
2400
+ if (IS_ALIGNED(width, 16)) {
2401
+ BGRAToUVRow = BGRAToUVRow_NEON;
2402
+ }
2403
+ }
2404
+ #endif
2405
+ #if defined(HAS_BGRATOUVROW_NEON_I8MM)
2406
+ if (TestCpuFlag(kCpuHasNeonI8MM)) {
2407
+ BGRAToUVRow = BGRAToUVRow_Any_NEON_I8MM;
2408
+ if (IS_ALIGNED(width, 16)) {
2409
+ BGRAToUVRow = BGRAToUVRow_NEON_I8MM;
2410
+ }
2411
+ }
2412
+ #endif
2413
+ #if defined(HAS_BGRATOUVROW_SVE2)
2414
+ if (TestCpuFlag(kCpuHasSVE2)) {
2415
+ BGRAToUVRow = BGRAToUVRow_Any_SVE2;
2416
+ if (IS_ALIGNED(width, 2)) {
2417
+ BGRAToUVRow = BGRAToUVRow_SVE2;
2418
+ }
2419
+ }
2420
+ #endif
2421
+ #if defined(HAS_BGRATOUVROW_SME)
2422
+ if (TestCpuFlag(kCpuHasSME)) {
2423
+ BGRAToUVRow = BGRAToUVRow_Any_SME;
2424
+ if (IS_ALIGNED(width, 2)) {
2425
+ BGRAToUVRow = BGRAToUVRow_SME;
2426
+ }
2427
+ }
2428
+ #endif
2429
+ #if defined(HAS_BGRATOYROW_SSSE3)
2430
+ if (TestCpuFlag(kCpuHasSSSE3)) {
2431
+ BGRAToYRow = BGRAToYRow_Any_SSSE3;
2432
+ if (IS_ALIGNED(width, 16)) {
2433
+ BGRAToYRow = BGRAToYRow_SSSE3;
2434
+ }
2435
+ }
2436
+ #endif
2437
+ #if defined(HAS_BGRATOUVROW_SSSE3)
2438
+ if (TestCpuFlag(kCpuHasSSSE3)) {
2439
+ BGRAToUVRow = BGRAToUVRow_Any_SSSE3;
2440
+ if (IS_ALIGNED(width, 16)) {
2441
+ BGRAToUVRow = BGRAToUVRow_SSSE3;
2442
+ }
2443
+ }
2444
+ #endif
2445
+ #if defined(HAS_BGRATOYROW_AVX2)
2446
+ if (TestCpuFlag(kCpuHasAVX2)) {
2447
+ BGRAToYRow = BGRAToYRow_Any_AVX2;
2448
+ if (IS_ALIGNED(width, 32)) {
2449
+ BGRAToYRow = BGRAToYRow_AVX2;
2450
+ }
2451
+ }
2452
+ #endif
2453
+ #if defined(HAS_BGRATOUVROW_AVX2)
2454
+ if (TestCpuFlag(kCpuHasAVX2)) {
2455
+ BGRAToUVRow = BGRAToUVRow_Any_AVX2;
2456
+ if (IS_ALIGNED(width, 32)) {
2457
+ BGRAToUVRow = BGRAToUVRow_AVX2;
2458
+ }
2459
+ }
2460
+ #endif
2461
+ #if defined(HAS_BGRATOYROW_LSX) && defined(HAS_BGRATOUVROW_LSX)
2462
+ if (TestCpuFlag(kCpuHasLSX)) {
2463
+ BGRAToYRow = BGRAToYRow_Any_LSX;
2464
+ BGRAToUVRow = BGRAToUVRow_Any_LSX;
2465
+ if (IS_ALIGNED(width, 16)) {
2466
+ BGRAToYRow = BGRAToYRow_LSX;
2467
+ BGRAToUVRow = BGRAToUVRow_LSX;
2468
+ }
2469
+ }
2470
+ #endif
2471
+ #if defined(HAS_BGRATOYROW_LASX)
2472
+ if (TestCpuFlag(kCpuHasLASX)) {
2473
+ BGRAToYRow = BGRAToYRow_Any_LASX;
2474
+ if (IS_ALIGNED(width, 32)) {
2475
+ BGRAToYRow = BGRAToYRow_LASX;
2476
+ }
2477
+ }
2478
+ #endif
2479
+ #if defined(HAS_BGRATOYROW_RVV)
2480
+ if (TestCpuFlag(kCpuHasRVV)) {
2481
+ BGRAToYRow = BGRAToYRow_RVV;
2482
+ }
2483
+ #endif
2484
+
2485
+ for (y = 0; y < height - 1; y += 2) {
2486
+ BGRAToUVRow(src_bgra, src_stride_bgra, dst_u, dst_v, width);
2487
+ BGRAToYRow(src_bgra, dst_y, width);
2488
+ BGRAToYRow(src_bgra + src_stride_bgra, dst_y + dst_stride_y, width);
2489
+ src_bgra += src_stride_bgra * 2;
2490
+ dst_y += dst_stride_y * 2;
2491
+ dst_u += dst_stride_u;
2492
+ dst_v += dst_stride_v;
2493
+ }
2494
+ if (height & 1) {
2495
+ BGRAToUVRow(src_bgra, 0, dst_u, dst_v, width);
2496
+ BGRAToYRow(src_bgra, dst_y, width);
2497
+ }
2498
+ return 0;
2499
+ }
2500
+
2501
+ // Convert ABGR to I420.
2502
+ LIBYUV_API
2503
+ int ABGRToI420(const uint8_t* src_abgr,
2504
+ int src_stride_abgr,
2505
+ uint8_t* dst_y,
2506
+ int dst_stride_y,
2507
+ uint8_t* dst_u,
2508
+ int dst_stride_u,
2509
+ uint8_t* dst_v,
2510
+ int dst_stride_v,
2511
+ int width,
2512
+ int height) {
2513
+ int y;
2514
+ void (*ABGRToUVRow)(const uint8_t* src_abgr0, int src_stride_abgr,
2515
+ uint8_t* dst_u, uint8_t* dst_v, int width) =
2516
+ ABGRToUVRow_C;
2517
+ void (*ABGRToYRow)(const uint8_t* src_abgr, uint8_t* dst_y, int width) =
2518
+ ABGRToYRow_C;
2519
+ if (!src_abgr || !dst_y || !dst_u || !dst_v || width <= 0 || height == 0) {
2520
+ return -1;
2521
+ }
2522
+ // Negative height means invert the image.
2523
+ if (height < 0) {
2524
+ height = -height;
2525
+ src_abgr = src_abgr + (height - 1) * src_stride_abgr;
2526
+ src_stride_abgr = -src_stride_abgr;
2527
+ }
2528
+ #if defined(HAS_ABGRTOYROW_SSSE3)
2529
+ if (TestCpuFlag(kCpuHasSSSE3)) {
2530
+ ABGRToYRow = ABGRToYRow_Any_SSSE3;
2531
+ if (IS_ALIGNED(width, 16)) {
2532
+ ABGRToYRow = ABGRToYRow_SSSE3;
2533
+ }
2534
+ }
2535
+ #endif
2536
+ #if defined(HAS_ABGRTOUVROW_SSSE3)
2537
+ if (TestCpuFlag(kCpuHasSSSE3)) {
2538
+ ABGRToUVRow = ABGRToUVRow_Any_SSSE3;
2539
+ if (IS_ALIGNED(width, 16)) {
2540
+ ABGRToUVRow = ABGRToUVRow_SSSE3;
2541
+ }
2542
+ }
2543
+ #endif
2544
+ #if defined(HAS_ABGRTOYROW_AVX2)
2545
+ if (TestCpuFlag(kCpuHasAVX2)) {
2546
+ ABGRToYRow = ABGRToYRow_Any_AVX2;
2547
+ if (IS_ALIGNED(width, 32)) {
2548
+ ABGRToYRow = ABGRToYRow_AVX2;
2549
+ }
2550
+ }
2551
+ #endif
2552
+ #if defined(HAS_ABGRTOUVROW_AVX2)
2553
+ if (TestCpuFlag(kCpuHasAVX2)) {
2554
+ ABGRToUVRow = ABGRToUVRow_Any_AVX2;
2555
+ if (IS_ALIGNED(width, 32)) {
2556
+ ABGRToUVRow = ABGRToUVRow_AVX2;
2557
+ }
2558
+ }
2559
+ #endif
2560
+ #if defined(HAS_ABGRTOYROW_NEON)
2561
+ if (TestCpuFlag(kCpuHasNEON)) {
2562
+ ABGRToYRow = ABGRToYRow_Any_NEON;
2563
+ if (IS_ALIGNED(width, 16)) {
2564
+ ABGRToYRow = ABGRToYRow_NEON;
2565
+ }
2566
+ }
2567
+ #endif
2568
+ #if defined(HAS_ABGRTOYROW_NEON_DOTPROD)
2569
+ if (TestCpuFlag(kCpuHasNeonDotProd)) {
2570
+ ABGRToYRow = ABGRToYRow_Any_NEON_DotProd;
2571
+ if (IS_ALIGNED(width, 16)) {
2572
+ ABGRToYRow = ABGRToYRow_NEON_DotProd;
2573
+ }
2574
+ }
2575
+ #endif
2576
+ #if defined(HAS_ABGRTOUVROW_NEON)
2577
+ if (TestCpuFlag(kCpuHasNEON)) {
2578
+ ABGRToUVRow = ABGRToUVRow_Any_NEON;
2579
+ if (IS_ALIGNED(width, 16)) {
2580
+ ABGRToUVRow = ABGRToUVRow_NEON;
2581
+ }
2582
+ }
2583
+ #endif
2584
+ #if defined(HAS_ABGRTOUVROW_NEON_I8MM)
2585
+ if (TestCpuFlag(kCpuHasNeonI8MM)) {
2586
+ ABGRToUVRow = ABGRToUVRow_Any_NEON_I8MM;
2587
+ if (IS_ALIGNED(width, 16)) {
2588
+ ABGRToUVRow = ABGRToUVRow_NEON_I8MM;
2589
+ }
2590
+ }
2591
+ #endif
2592
+ #if defined(HAS_ABGRTOUVROW_SVE2)
2593
+ if (TestCpuFlag(kCpuHasSVE2)) {
2594
+ ABGRToUVRow = ABGRToUVRow_Any_SVE2;
2595
+ if (IS_ALIGNED(width, 2)) {
2596
+ ABGRToUVRow = ABGRToUVRow_SVE2;
2597
+ }
2598
+ }
2599
+ #endif
2600
+ #if defined(HAS_ABGRTOUVROW_SME)
2601
+ if (TestCpuFlag(kCpuHasSME)) {
2602
+ ABGRToUVRow = ABGRToUVRow_Any_SME;
2603
+ if (IS_ALIGNED(width, 2)) {
2604
+ ABGRToUVRow = ABGRToUVRow_SME;
2605
+ }
2606
+ }
2607
+ #endif
2608
+ #if defined(HAS_ABGRTOYROW_LSX) && defined(HAS_ABGRTOUVROW_LSX)
2609
+ if (TestCpuFlag(kCpuHasLSX)) {
2610
+ ABGRToYRow = ABGRToYRow_Any_LSX;
2611
+ ABGRToUVRow = ABGRToUVRow_Any_LSX;
2612
+ if (IS_ALIGNED(width, 16)) {
2613
+ ABGRToYRow = ABGRToYRow_LSX;
2614
+ ABGRToUVRow = ABGRToUVRow_LSX;
2615
+ }
2616
+ }
2617
+ #endif
2618
+ #if defined(HAS_ABGRTOYROW_LASX)
2619
+ if (TestCpuFlag(kCpuHasLASX)) {
2620
+ ABGRToYRow = ABGRToYRow_Any_LASX;
2621
+ if (IS_ALIGNED(width, 32)) {
2622
+ ABGRToYRow = ABGRToYRow_LASX;
2623
+ }
2624
+ }
2625
+ #endif
2626
+ #if defined(HAS_ABGRTOYROW_RVV)
2627
+ if (TestCpuFlag(kCpuHasRVV)) {
2628
+ ABGRToYRow = ABGRToYRow_RVV;
2629
+ }
2630
+ #endif
2631
+
2632
+ for (y = 0; y < height - 1; y += 2) {
2633
+ ABGRToUVRow(src_abgr, src_stride_abgr, dst_u, dst_v, width);
2634
+ ABGRToYRow(src_abgr, dst_y, width);
2635
+ ABGRToYRow(src_abgr + src_stride_abgr, dst_y + dst_stride_y, width);
2636
+ src_abgr += src_stride_abgr * 2;
2637
+ dst_y += dst_stride_y * 2;
2638
+ dst_u += dst_stride_u;
2639
+ dst_v += dst_stride_v;
2640
+ }
2641
+ if (height & 1) {
2642
+ ABGRToUVRow(src_abgr, 0, dst_u, dst_v, width);
2643
+ ABGRToYRow(src_abgr, dst_y, width);
2644
+ }
2645
+ return 0;
2646
+ }
2647
+
2648
+ // Convert RGBA to I420.
2649
+ LIBYUV_API
2650
+ int RGBAToI420(const uint8_t* src_rgba,
2651
+ int src_stride_rgba,
2652
+ uint8_t* dst_y,
2653
+ int dst_stride_y,
2654
+ uint8_t* dst_u,
2655
+ int dst_stride_u,
2656
+ uint8_t* dst_v,
2657
+ int dst_stride_v,
2658
+ int width,
2659
+ int height) {
2660
+ int y;
2661
+ void (*RGBAToUVRow)(const uint8_t* src_rgba0, int src_stride_rgba,
2662
+ uint8_t* dst_u, uint8_t* dst_v, int width) =
2663
+ RGBAToUVRow_C;
2664
+ void (*RGBAToYRow)(const uint8_t* src_rgba, uint8_t* dst_y, int width) =
2665
+ RGBAToYRow_C;
2666
+ if (!src_rgba || !dst_y || !dst_u || !dst_v || width <= 0 || height == 0) {
2667
+ return -1;
2668
+ }
2669
+ // Negative height means invert the image.
2670
+ if (height < 0) {
2671
+ height = -height;
2672
+ src_rgba = src_rgba + (height - 1) * src_stride_rgba;
2673
+ src_stride_rgba = -src_stride_rgba;
2674
+ }
2675
+ #if defined(HAS_RGBATOYROW_SSSE3)
2676
+ if (TestCpuFlag(kCpuHasSSSE3)) {
2677
+ RGBAToYRow = RGBAToYRow_Any_SSSE3;
2678
+ if (IS_ALIGNED(width, 16)) {
2679
+ RGBAToYRow = RGBAToYRow_SSSE3;
2680
+ }
2681
+ }
2682
+ #endif
2683
+ #if defined(HAS_RGBATOUVROW_SSSE3)
2684
+ if (TestCpuFlag(kCpuHasSSSE3)) {
2685
+ RGBAToUVRow = RGBAToUVRow_Any_SSSE3;
2686
+ if (IS_ALIGNED(width, 16)) {
2687
+ RGBAToUVRow = RGBAToUVRow_SSSE3;
2688
+ }
2689
+ }
2690
+ #endif
2691
+ #if defined(HAS_RGBATOYROW_NEON)
2692
+ if (TestCpuFlag(kCpuHasNEON)) {
2693
+ RGBAToYRow = RGBAToYRow_Any_NEON;
2694
+ if (IS_ALIGNED(width, 16)) {
2695
+ RGBAToYRow = RGBAToYRow_NEON;
2696
+ }
2697
+ }
2698
+ #endif
2699
+ #if defined(HAS_RGBATOYROW_NEON_DOTPROD)
2700
+ if (TestCpuFlag(kCpuHasNeonDotProd)) {
2701
+ RGBAToYRow = RGBAToYRow_Any_NEON_DotProd;
2702
+ if (IS_ALIGNED(width, 16)) {
2703
+ RGBAToYRow = RGBAToYRow_NEON_DotProd;
2704
+ }
2705
+ }
2706
+ #endif
2707
+ #if defined(HAS_RGBATOUVROW_NEON)
2708
+ if (TestCpuFlag(kCpuHasNEON)) {
2709
+ RGBAToUVRow = RGBAToUVRow_Any_NEON;
2710
+ if (IS_ALIGNED(width, 16)) {
2711
+ RGBAToUVRow = RGBAToUVRow_NEON;
2712
+ }
2713
+ }
2714
+ #endif
2715
+ #if defined(HAS_RGBATOUVROW_NEON_I8MM)
2716
+ if (TestCpuFlag(kCpuHasNeonI8MM)) {
2717
+ RGBAToUVRow = RGBAToUVRow_Any_NEON_I8MM;
2718
+ if (IS_ALIGNED(width, 16)) {
2719
+ RGBAToUVRow = RGBAToUVRow_NEON_I8MM;
2720
+ }
2721
+ }
2722
+ #endif
2723
+ #if defined(HAS_RGBATOUVROW_SVE2)
2724
+ if (TestCpuFlag(kCpuHasSVE2)) {
2725
+ RGBAToUVRow = RGBAToUVRow_Any_SVE2;
2726
+ if (IS_ALIGNED(width, 2)) {
2727
+ RGBAToUVRow = RGBAToUVRow_SVE2;
2728
+ }
2729
+ }
2730
+ #endif
2731
+ #if defined(HAS_RGBATOUVROW_SME)
2732
+ if (TestCpuFlag(kCpuHasSME)) {
2733
+ RGBAToUVRow = RGBAToUVRow_Any_SME;
2734
+ if (IS_ALIGNED(width, 2)) {
2735
+ RGBAToUVRow = RGBAToUVRow_SME;
2736
+ }
2737
+ }
2738
+ #endif
2739
+ #if defined(HAS_RGBATOYROW_LSX) && defined(HAS_RGBATOUVROW_LSX)
2740
+ if (TestCpuFlag(kCpuHasLSX)) {
2741
+ RGBAToYRow = RGBAToYRow_Any_LSX;
2742
+ RGBAToUVRow = RGBAToUVRow_Any_LSX;
2743
+ if (IS_ALIGNED(width, 16)) {
2744
+ RGBAToYRow = RGBAToYRow_LSX;
2745
+ RGBAToUVRow = RGBAToUVRow_LSX;
2746
+ }
2747
+ }
2748
+ #endif
2749
+ #if defined(HAS_RGBATOYROW_LASX)
2750
+ if (TestCpuFlag(kCpuHasNEON)) {
2751
+ RGBAToYRow = RGBAToYRow_Any_LASX;
2752
+ if (IS_ALIGNED(width, 32)) {
2753
+ RGBAToYRow = RGBAToYRow_LASX;
2754
+ }
2755
+ }
2756
+ #endif
2757
+ #if defined(HAS_RGBATOYROW_RVV)
2758
+ if (TestCpuFlag(kCpuHasRVV)) {
2759
+ RGBAToYRow = RGBAToYRow_RVV;
2760
+ }
2761
+ #endif
2762
+
2763
+ for (y = 0; y < height - 1; y += 2) {
2764
+ RGBAToUVRow(src_rgba, src_stride_rgba, dst_u, dst_v, width);
2765
+ RGBAToYRow(src_rgba, dst_y, width);
2766
+ RGBAToYRow(src_rgba + src_stride_rgba, dst_y + dst_stride_y, width);
2767
+ src_rgba += src_stride_rgba * 2;
2768
+ dst_y += dst_stride_y * 2;
2769
+ dst_u += dst_stride_u;
2770
+ dst_v += dst_stride_v;
2771
+ }
2772
+ if (height & 1) {
2773
+ RGBAToUVRow(src_rgba, 0, dst_u, dst_v, width);
2774
+ RGBAToYRow(src_rgba, dst_y, width);
2775
+ }
2776
+ return 0;
2777
+ }
2778
+
2779
+ // Enabled if 1 pass is available
2780
+ #if (defined(HAS_RGB24TOYROW_NEON) || defined(HAS_RGB24TOYROW_LSX) || \
2781
+ defined(HAS_RGB24TOYROW_RVV))
2782
+ #define HAS_RGB24TOYROW
2783
+ #endif
2784
+
2785
+ // Convert RGB24 to I420.
2786
+ LIBYUV_API
2787
+ int RGB24ToI420(const uint8_t* src_rgb24,
2788
+ int src_stride_rgb24,
2789
+ uint8_t* dst_y,
2790
+ int dst_stride_y,
2791
+ uint8_t* dst_u,
2792
+ int dst_stride_u,
2793
+ uint8_t* dst_v,
2794
+ int dst_stride_v,
2795
+ int width,
2796
+ int height) {
2797
+ int y;
2798
+ #if defined(HAS_RGB24TOYROW)
2799
+ void (*RGB24ToUVRow)(const uint8_t* src_rgb24, int src_stride_rgb24,
2800
+ uint8_t* dst_u, uint8_t* dst_v, int width) =
2801
+ RGB24ToUVRow_C;
2802
+ void (*RGB24ToYRow)(const uint8_t* src_rgb24, uint8_t* dst_y, int width) =
2803
+ RGB24ToYRow_C;
2804
+ #else
2805
+ void (*RGB24ToARGBRow)(const uint8_t* src_rgb, uint8_t* dst_argb, int width) =
2806
+ RGB24ToARGBRow_C;
2807
+ void (*ARGBToUVRow)(const uint8_t* src_argb0, int src_stride_argb,
2808
+ uint8_t* dst_u, uint8_t* dst_v, int width) =
2809
+ ARGBToUVRow_C;
2810
+ void (*ARGBToYRow)(const uint8_t* src_argb, uint8_t* dst_y, int width) =
2811
+ ARGBToYRow_C;
2812
+ #endif
2813
+ if (!src_rgb24 || !dst_y || !dst_u || !dst_v || width <= 0 || height == 0) {
2814
+ return -1;
2815
+ }
2816
+ // Negative height means invert the image.
2817
+ if (height < 0) {
2818
+ height = -height;
2819
+ src_rgb24 = src_rgb24 + (height - 1) * src_stride_rgb24;
2820
+ src_stride_rgb24 = -src_stride_rgb24;
2821
+ }
2822
+
2823
+ #if defined(HAS_RGB24TOYROW)
2824
+
2825
+ // Neon version does direct RGB24 to YUV.
2826
+ #if defined(HAS_RGB24TOYROW_NEON) && defined(HAS_RGB24TOUVROW_NEON)
2827
+ if (TestCpuFlag(kCpuHasNEON)) {
2828
+ RGB24ToUVRow = RGB24ToUVRow_Any_NEON;
2829
+ RGB24ToYRow = RGB24ToYRow_Any_NEON;
2830
+ if (IS_ALIGNED(width, 16)) {
2831
+ RGB24ToYRow = RGB24ToYRow_NEON;
2832
+ RGB24ToUVRow = RGB24ToUVRow_NEON;
2833
+ }
2834
+ }
2835
+ #endif
2836
+ #if defined(HAS_RGB24TOYROW_LSX) && defined(HAS_RGB24TOUVROW_LSX)
2837
+ if (TestCpuFlag(kCpuHasLSX)) {
2838
+ RGB24ToUVRow = RGB24ToUVRow_Any_LSX;
2839
+ RGB24ToYRow = RGB24ToYRow_Any_LSX;
2840
+ if (IS_ALIGNED(width, 16)) {
2841
+ RGB24ToYRow = RGB24ToYRow_LSX;
2842
+ RGB24ToUVRow = RGB24ToUVRow_LSX;
2843
+ }
2844
+ }
2845
+ #endif
2846
+ #if defined(HAS_RGB24TOYROW_LASX) && defined(HAS_RGB24TOUVROW_LASX)
2847
+ if (TestCpuFlag(kCpuHasLASX)) {
2848
+ RGB24ToUVRow = RGB24ToUVRow_Any_LASX;
2849
+ RGB24ToYRow = RGB24ToYRow_Any_LASX;
2850
+ if (IS_ALIGNED(width, 32)) {
2851
+ RGB24ToYRow = RGB24ToYRow_LASX;
2852
+ RGB24ToUVRow = RGB24ToUVRow_LASX;
2853
+ }
2854
+ }
2855
+ #endif
2856
+ #if defined(HAS_RGB24TOYROW_RVV)
2857
+ if (TestCpuFlag(kCpuHasRVV)) {
2858
+ RGB24ToYRow = RGB24ToYRow_RVV;
2859
+ }
2860
+ #endif
2861
+
2862
+ // Other platforms do intermediate conversion from RGB24 to ARGB.
2863
+ #else // HAS_RGB24TOYROW
2864
+
2865
+ #if defined(HAS_RGB24TOARGBROW_SSSE3)
2866
+ if (TestCpuFlag(kCpuHasSSSE3)) {
2867
+ RGB24ToARGBRow = RGB24ToARGBRow_Any_SSSE3;
2868
+ if (IS_ALIGNED(width, 16)) {
2869
+ RGB24ToARGBRow = RGB24ToARGBRow_SSSE3;
2870
+ }
2871
+ }
2872
+ #endif
2873
+ #if defined(HAS_ARGBTOYROW_SSSE3)
2874
+ if (TestCpuFlag(kCpuHasSSSE3)) {
2875
+ ARGBToYRow = ARGBToYRow_Any_SSSE3;
2876
+ if (IS_ALIGNED(width, 16)) {
2877
+ ARGBToYRow = ARGBToYRow_SSSE3;
2878
+ }
2879
+ }
2880
+ #endif
2881
+ #if defined(HAS_ARGBTOYROW_AVX2)
2882
+ if (TestCpuFlag(kCpuHasAVX2)) {
2883
+ ARGBToYRow = ARGBToYRow_Any_AVX2;
2884
+ if (IS_ALIGNED(width, 32)) {
2885
+ ARGBToYRow = ARGBToYRow_AVX2;
2886
+ }
2887
+ }
2888
+ #endif
2889
+ #if defined(HAS_ARGBTOUVROW_SSSE3)
2890
+ if (TestCpuFlag(kCpuHasSSSE3)) {
2891
+ ARGBToUVRow = ARGBToUVRow_Any_SSSE3;
2892
+ if (IS_ALIGNED(width, 16)) {
2893
+ ARGBToUVRow = ARGBToUVRow_SSSE3;
2894
+ }
2895
+ }
2896
+ #endif
2897
+ #if defined(HAS_ARGBTOUVROW_AVX2)
2898
+ if (TestCpuFlag(kCpuHasAVX2)) {
2899
+ ARGBToUVRow = ARGBToUVRow_Any_AVX2;
2900
+ if (IS_ALIGNED(width, 32)) {
2901
+ ARGBToUVRow = ARGBToUVRow_AVX2;
2902
+ }
2903
+ }
2904
+ #endif
2905
+ #endif // HAS_RGB24TOYROW
2906
+
2907
+ {
2908
+ #if !defined(HAS_RGB24TOYROW)
2909
+ // Allocate 2 rows of ARGB.
2910
+ const int row_size = (width * 4 + 31) & ~31;
2911
+ align_buffer_64(row, row_size * 2);
2912
+ if (!row)
2913
+ return 1;
2914
+ #endif
2915
+
2916
+ for (y = 0; y < height - 1; y += 2) {
2917
+ #if defined(HAS_RGB24TOYROW)
2918
+ RGB24ToUVRow(src_rgb24, src_stride_rgb24, dst_u, dst_v, width);
2919
+ RGB24ToYRow(src_rgb24, dst_y, width);
2920
+ RGB24ToYRow(src_rgb24 + src_stride_rgb24, dst_y + dst_stride_y, width);
2921
+ #else
2922
+ RGB24ToARGBRow(src_rgb24, row, width);
2923
+ RGB24ToARGBRow(src_rgb24 + src_stride_rgb24, row + row_size, width);
2924
+ ARGBToUVRow(row, row_size, dst_u, dst_v, width);
2925
+ ARGBToYRow(row, dst_y, width);
2926
+ ARGBToYRow(row + row_size, dst_y + dst_stride_y, width);
2927
+ #endif
2928
+ src_rgb24 += src_stride_rgb24 * 2;
2929
+ dst_y += dst_stride_y * 2;
2930
+ dst_u += dst_stride_u;
2931
+ dst_v += dst_stride_v;
2932
+ }
2933
+ if (height & 1) {
2934
+ #if defined(HAS_RGB24TOYROW)
2935
+ RGB24ToUVRow(src_rgb24, 0, dst_u, dst_v, width);
2936
+ RGB24ToYRow(src_rgb24, dst_y, width);
2937
+ #else
2938
+ RGB24ToARGBRow(src_rgb24, row, width);
2939
+ ARGBToUVRow(row, 0, dst_u, dst_v, width);
2940
+ ARGBToYRow(row, dst_y, width);
2941
+ #endif
2942
+ }
2943
+ #if !defined(HAS_RGB24TOYROW)
2944
+ free_aligned_buffer_64(row);
2945
+ #endif
2946
+ }
2947
+ return 0;
2948
+ }
2949
+ #undef HAS_RGB24TOYROW
2950
+
2951
+ // Enabled if 1 pass is available
2952
+ #if defined(HAS_RGB24TOYJROW_NEON) || defined(HAS_RGB24TOYJROW_RVV)
2953
+ #define HAS_RGB24TOYJROW
2954
+ #endif
2955
+
2956
+ // Convert RGB24 to J420.
2957
+ LIBYUV_API
2958
+ int RGB24ToJ420(const uint8_t* src_rgb24,
2959
+ int src_stride_rgb24,
2960
+ uint8_t* dst_y,
2961
+ int dst_stride_y,
2962
+ uint8_t* dst_u,
2963
+ int dst_stride_u,
2964
+ uint8_t* dst_v,
2965
+ int dst_stride_v,
2966
+ int width,
2967
+ int height) {
2968
+ int y;
2969
+ #if defined(HAS_RGB24TOYJROW)
2970
+ void (*RGB24ToUVJRow)(const uint8_t* src_rgb24, int src_stride_rgb24,
2971
+ uint8_t* dst_u, uint8_t* dst_v, int width) =
2972
+ RGB24ToUVJRow_C;
2973
+ void (*RGB24ToYJRow)(const uint8_t* src_rgb24, uint8_t* dst_y, int width) =
2974
+ RGB24ToYJRow_C;
2975
+ #else
2976
+ void (*RGB24ToARGBRow)(const uint8_t* src_rgb, uint8_t* dst_argb, int width) =
2977
+ RGB24ToARGBRow_C;
2978
+ void (*ARGBToUVJRow)(const uint8_t* src_argb0, int src_stride_argb,
2979
+ uint8_t* dst_u, uint8_t* dst_v, int width) =
2980
+ ARGBToUVJRow_C;
2981
+ void (*ARGBToYJRow)(const uint8_t* src_argb, uint8_t* dst_y, int width) =
2982
+ ARGBToYJRow_C;
2983
+ #endif
2984
+ if (!src_rgb24 || !dst_y || !dst_u || !dst_v || width <= 0 || height == 0) {
2985
+ return -1;
2986
+ }
2987
+ // Negative height means invert the image.
2988
+ if (height < 0) {
2989
+ height = -height;
2990
+ src_rgb24 = src_rgb24 + (height - 1) * src_stride_rgb24;
2991
+ src_stride_rgb24 = -src_stride_rgb24;
2992
+ }
2993
+
2994
+ #if defined(HAS_RGB24TOYJROW)
2995
+
2996
+ // Neon version does direct RGB24 to YUV.
2997
+ #if defined(HAS_RGB24TOYJROW_NEON) && defined(HAS_RGB24TOUVJROW_NEON)
2998
+ if (TestCpuFlag(kCpuHasNEON)) {
2999
+ RGB24ToUVJRow = RGB24ToUVJRow_Any_NEON;
3000
+ RGB24ToYJRow = RGB24ToYJRow_Any_NEON;
3001
+ if (IS_ALIGNED(width, 16)) {
3002
+ RGB24ToYJRow = RGB24ToYJRow_NEON;
3003
+ RGB24ToUVJRow = RGB24ToUVJRow_NEON;
3004
+ }
3005
+ }
3006
+ #endif
3007
+ #if defined(HAS_RGB24TOYJROW_LSX)
3008
+ if (TestCpuFlag(kCpuHasLSX)) {
3009
+ RGB24ToYJRow = RGB24ToYJRow_Any_LSX;
3010
+ if (IS_ALIGNED(width, 16)) {
3011
+ RGB24ToYJRow = RGB24ToYJRow_LSX;
3012
+ }
3013
+ }
3014
+ #endif
3015
+ #if defined(HAS_RGB24TOYJROW_LASX)
3016
+ if (TestCpuFlag(kCpuHasLASX)) {
3017
+ RGB24ToYJRow = RGB24ToYJRow_Any_LASX;
3018
+ if (IS_ALIGNED(width, 32)) {
3019
+ RGB24ToYJRow = RGB24ToYJRow_LASX;
3020
+ }
3021
+ }
3022
+ #endif
3023
+ #if defined(HAS_RGB24TOYJROW_RVV)
3024
+ if (TestCpuFlag(kCpuHasRVV)) {
3025
+ RGB24ToYJRow = RGB24ToYJRow_RVV;
3026
+ }
3027
+ #endif
3028
+
3029
+ // Other platforms do intermediate conversion from RGB24 to ARGB.
3030
+ #else // HAS_RGB24TOYJROW
3031
+
3032
+ #if defined(HAS_RGB24TOARGBROW_SSSE3)
3033
+ if (TestCpuFlag(kCpuHasSSSE3)) {
3034
+ RGB24ToARGBRow = RGB24ToARGBRow_Any_SSSE3;
3035
+ if (IS_ALIGNED(width, 16)) {
3036
+ RGB24ToARGBRow = RGB24ToARGBRow_SSSE3;
3037
+ }
3038
+ }
3039
+ #endif
3040
+ #if defined(HAS_ARGBTOYJROW_SSSE3)
3041
+ if (TestCpuFlag(kCpuHasSSSE3)) {
3042
+ ARGBToYJRow = ARGBToYJRow_Any_SSSE3;
3043
+ if (IS_ALIGNED(width, 16)) {
3044
+ ARGBToYJRow = ARGBToYJRow_SSSE3;
3045
+ }
3046
+ }
3047
+ #endif
3048
+ #if defined(HAS_ARGBTOYJROW_AVX2)
3049
+ if (TestCpuFlag(kCpuHasAVX2)) {
3050
+ ARGBToYJRow = ARGBToYJRow_Any_AVX2;
3051
+ if (IS_ALIGNED(width, 32)) {
3052
+ ARGBToYJRow = ARGBToYJRow_AVX2;
3053
+ }
3054
+ }
3055
+ #endif
3056
+ #if defined(HAS_ARGBTOUVJROW_SSSE3)
3057
+ if (TestCpuFlag(kCpuHasSSSE3)) {
3058
+ ARGBToUVJRow = ARGBToUVJRow_Any_SSSE3;
3059
+ if (IS_ALIGNED(width, 16)) {
3060
+ ARGBToUVJRow = ARGBToUVJRow_SSSE3;
3061
+ }
3062
+ }
3063
+ #endif
3064
+ #if defined(HAS_ARGBTOUVJROW_AVX2)
3065
+ if (TestCpuFlag(kCpuHasAVX2)) {
3066
+ ARGBToUVJRow = ARGBToUVJRow_Any_AVX2;
3067
+ if (IS_ALIGNED(width, 32)) {
3068
+ ARGBToUVJRow = ARGBToUVJRow_AVX2;
3069
+ }
3070
+ }
3071
+ #endif
3072
+ #endif // HAS_RGB24TOYJROW
3073
+
3074
+ {
3075
+ #if !defined(HAS_RGB24TOYJROW)
3076
+ // Allocate 2 rows of ARGB.
3077
+ const int row_size = (width * 4 + 31) & ~31;
3078
+ align_buffer_64(row, row_size * 2);
3079
+ if (!row)
3080
+ return 1;
3081
+ #endif
3082
+
3083
+ for (y = 0; y < height - 1; y += 2) {
3084
+ #if defined(HAS_RGB24TOYJROW)
3085
+ RGB24ToUVJRow(src_rgb24, src_stride_rgb24, dst_u, dst_v, width);
3086
+ RGB24ToYJRow(src_rgb24, dst_y, width);
3087
+ RGB24ToYJRow(src_rgb24 + src_stride_rgb24, dst_y + dst_stride_y, width);
3088
+ #else
3089
+ RGB24ToARGBRow(src_rgb24, row, width);
3090
+ RGB24ToARGBRow(src_rgb24 + src_stride_rgb24, row + row_size, width);
3091
+ ARGBToUVJRow(row, row_size, dst_u, dst_v, width);
3092
+ ARGBToYJRow(row, dst_y, width);
3093
+ ARGBToYJRow(row + row_size, dst_y + dst_stride_y, width);
3094
+ #endif
3095
+ src_rgb24 += src_stride_rgb24 * 2;
3096
+ dst_y += dst_stride_y * 2;
3097
+ dst_u += dst_stride_u;
3098
+ dst_v += dst_stride_v;
3099
+ }
3100
+ if (height & 1) {
3101
+ #if defined(HAS_RGB24TOYJROW)
3102
+ RGB24ToUVJRow(src_rgb24, 0, dst_u, dst_v, width);
3103
+ RGB24ToYJRow(src_rgb24, dst_y, width);
3104
+ #else
3105
+ RGB24ToARGBRow(src_rgb24, row, width);
3106
+ ARGBToUVJRow(row, 0, dst_u, dst_v, width);
3107
+ ARGBToYJRow(row, dst_y, width);
3108
+ #endif
3109
+ }
3110
+ #if !defined(HAS_RGB24TOYJROW)
3111
+ free_aligned_buffer_64(row);
3112
+ #endif
3113
+ }
3114
+ return 0;
3115
+ }
3116
+ #undef HAS_RGB24TOYJROW
3117
+
3118
+ // Enabled if 1 pass is available
3119
+ #if (defined(HAS_RAWTOYROW_NEON) || defined(HAS_RAWTOYROW_LSX) || \
3120
+ defined(HAS_RAWTOYROW_RVV))
3121
+ #define HAS_RAWTOYROW
3122
+ #endif
3123
+
3124
+ // Convert RAW to I420.
3125
+ LIBYUV_API
3126
+ int RAWToI420(const uint8_t* src_raw,
3127
+ int src_stride_raw,
3128
+ uint8_t* dst_y,
3129
+ int dst_stride_y,
3130
+ uint8_t* dst_u,
3131
+ int dst_stride_u,
3132
+ uint8_t* dst_v,
3133
+ int dst_stride_v,
3134
+ int width,
3135
+ int height) {
3136
+ int y;
3137
+ #if defined(HAS_RAWTOYROW)
3138
+ void (*RAWToUVRow)(const uint8_t* src_raw, int src_stride_raw, uint8_t* dst_u,
3139
+ uint8_t* dst_v, int width) = RAWToUVRow_C;
3140
+ void (*RAWToYRow)(const uint8_t* src_raw, uint8_t* dst_y, int width) =
3141
+ RAWToYRow_C;
3142
+ #else
3143
+ void (*RAWToARGBRow)(const uint8_t* src_rgb, uint8_t* dst_argb, int width) =
3144
+ RAWToARGBRow_C;
3145
+ void (*ARGBToUVRow)(const uint8_t* src_argb0, int src_stride_argb,
3146
+ uint8_t* dst_u, uint8_t* dst_v, int width) =
3147
+ ARGBToUVRow_C;
3148
+ void (*ARGBToYRow)(const uint8_t* src_argb, uint8_t* dst_y, int width) =
3149
+ ARGBToYRow_C;
3150
+ #endif
3151
+ if (!src_raw || !dst_y || !dst_u || !dst_v || width <= 0 || height == 0) {
3152
+ return -1;
3153
+ }
3154
+ // Negative height means invert the image.
3155
+ if (height < 0) {
3156
+ height = -height;
3157
+ src_raw = src_raw + (height - 1) * src_stride_raw;
3158
+ src_stride_raw = -src_stride_raw;
3159
+ }
3160
+
3161
+ #if defined(HAS_RAWTOYROW)
3162
+
3163
+ // Neon version does direct RAW to YUV.
3164
+ #if defined(HAS_RAWTOYROW_NEON) && defined(HAS_RAWTOUVROW_NEON)
3165
+ if (TestCpuFlag(kCpuHasNEON)) {
3166
+ RAWToUVRow = RAWToUVRow_Any_NEON;
3167
+ RAWToYRow = RAWToYRow_Any_NEON;
3168
+ if (IS_ALIGNED(width, 16)) {
3169
+ RAWToYRow = RAWToYRow_NEON;
3170
+ RAWToUVRow = RAWToUVRow_NEON;
3171
+ }
3172
+ }
3173
+ #endif
3174
+ #if defined(HAS_RAWTOYROW_LSX) && defined(HAS_RAWTOUVROW_LSX)
3175
+ if (TestCpuFlag(kCpuHasLSX)) {
3176
+ RAWToUVRow = RAWToUVRow_Any_LSX;
3177
+ RAWToYRow = RAWToYRow_Any_LSX;
3178
+ if (IS_ALIGNED(width, 16)) {
3179
+ RAWToYRow = RAWToYRow_LSX;
3180
+ RAWToUVRow = RAWToUVRow_LSX;
3181
+ }
3182
+ }
3183
+ #endif
3184
+ #if defined(HAS_RAWTOYROW_LASX) && defined(HAS_RAWTOUVROW_LASX)
3185
+ if (TestCpuFlag(kCpuHasLASX)) {
3186
+ RAWToUVRow = RAWToUVRow_Any_LASX;
3187
+ RAWToYRow = RAWToYRow_Any_LASX;
3188
+ if (IS_ALIGNED(width, 32)) {
3189
+ RAWToYRow = RAWToYRow_LASX;
3190
+ RAWToUVRow = RAWToUVRow_LASX;
3191
+ }
3192
+ }
3193
+ #endif
3194
+ #if defined(HAS_RAWTOYROW_RVV)
3195
+ if (TestCpuFlag(kCpuHasRVV)) {
3196
+ RAWToYRow = RAWToYRow_RVV;
3197
+ }
3198
+ #endif
3199
+
3200
+ // Other platforms do intermediate conversion from RAW to ARGB.
3201
+ #else // HAS_RAWTOYROW
3202
+
3203
+ #if defined(HAS_RAWTOARGBROW_SSSE3)
3204
+ if (TestCpuFlag(kCpuHasSSSE3)) {
3205
+ RAWToARGBRow = RAWToARGBRow_Any_SSSE3;
3206
+ if (IS_ALIGNED(width, 16)) {
3207
+ RAWToARGBRow = RAWToARGBRow_SSSE3;
3208
+ }
3209
+ }
3210
+ #endif
3211
+ #if defined(HAS_RAWTOARGBROW_AVX2)
3212
+ if (TestCpuFlag(kCpuHasAVX2)) {
3213
+ RAWToARGBRow = RAWToARGBRow_Any_AVX2;
3214
+ if (IS_ALIGNED(width, 32)) {
3215
+ RAWToARGBRow = RAWToARGBRow_AVX2;
3216
+ }
3217
+ }
3218
+ #endif
3219
+ #if defined(HAS_ARGBTOYROW_SSSE3)
3220
+ if (TestCpuFlag(kCpuHasSSSE3)) {
3221
+ ARGBToYRow = ARGBToYRow_Any_SSSE3;
3222
+ if (IS_ALIGNED(width, 16)) {
3223
+ ARGBToYRow = ARGBToYRow_SSSE3;
3224
+ }
3225
+ }
3226
+ #endif
3227
+ #if defined(HAS_ARGBTOYROW_AVX2)
3228
+ if (TestCpuFlag(kCpuHasAVX2)) {
3229
+ ARGBToYRow = ARGBToYRow_Any_AVX2;
3230
+ if (IS_ALIGNED(width, 32)) {
3231
+ ARGBToYRow = ARGBToYRow_AVX2;
3232
+ }
3233
+ }
3234
+ #endif
3235
+ #if defined(HAS_ARGBTOUVROW_SSSE3)
3236
+ if (TestCpuFlag(kCpuHasSSSE3)) {
3237
+ ARGBToUVRow = ARGBToUVRow_Any_SSSE3;
3238
+ if (IS_ALIGNED(width, 16)) {
3239
+ ARGBToUVRow = ARGBToUVRow_SSSE3;
3240
+ }
3241
+ }
3242
+ #endif
3243
+ #if defined(HAS_ARGBTOUVROW_AVX2)
3244
+ if (TestCpuFlag(kCpuHasAVX2)) {
3245
+ ARGBToUVRow = ARGBToUVRow_Any_AVX2;
3246
+ if (IS_ALIGNED(width, 32)) {
3247
+ ARGBToUVRow = ARGBToUVRow_AVX2;
3248
+ }
3249
+ }
3250
+ #endif
3251
+ #endif // HAS_RAWTOYROW
3252
+
3253
+ {
3254
+ #if !defined(HAS_RAWTOYROW)
3255
+ // Allocate 2 rows of ARGB.
3256
+ const int row_size = (width * 4 + 31) & ~31;
3257
+ align_buffer_64(row, row_size * 2);
3258
+ if (!row)
3259
+ return 1;
3260
+ #endif
3261
+
3262
+ for (y = 0; y < height - 1; y += 2) {
3263
+ #if defined(HAS_RAWTOYROW)
3264
+ RAWToUVRow(src_raw, src_stride_raw, dst_u, dst_v, width);
3265
+ RAWToYRow(src_raw, dst_y, width);
3266
+ RAWToYRow(src_raw + src_stride_raw, dst_y + dst_stride_y, width);
3267
+ #else
3268
+ RAWToARGBRow(src_raw, row, width);
3269
+ RAWToARGBRow(src_raw + src_stride_raw, row + row_size, width);
3270
+ ARGBToUVRow(row, row_size, dst_u, dst_v, width);
3271
+ ARGBToYRow(row, dst_y, width);
3272
+ ARGBToYRow(row + row_size, dst_y + dst_stride_y, width);
3273
+ #endif
3274
+ src_raw += src_stride_raw * 2;
3275
+ dst_y += dst_stride_y * 2;
3276
+ dst_u += dst_stride_u;
3277
+ dst_v += dst_stride_v;
3278
+ }
3279
+ if (height & 1) {
3280
+ #if defined(HAS_RAWTOYROW)
3281
+ RAWToUVRow(src_raw, 0, dst_u, dst_v, width);
3282
+ RAWToYRow(src_raw, dst_y, width);
3283
+ #else
3284
+ RAWToARGBRow(src_raw, row, width);
3285
+ ARGBToUVRow(row, 0, dst_u, dst_v, width);
3286
+ ARGBToYRow(row, dst_y, width);
3287
+ #endif
3288
+ }
3289
+ #if !defined(HAS_RAWTOYROW)
3290
+ free_aligned_buffer_64(row);
3291
+ #endif
3292
+ }
3293
+ return 0;
3294
+ }
3295
+ #undef HAS_RAWTOYROW
3296
+
3297
+ // Enabled if 1 pass is available
3298
+ #if defined(HAS_RAWTOYJROW_NEON) || defined(HAS_RAWTOYJROW_RVV)
3299
+ #define HAS_RAWTOYJROW
3300
+ #endif
3301
+
3302
+ // Convert RAW to J420.
3303
+ LIBYUV_API
3304
+ int RAWToJ420(const uint8_t* src_raw,
3305
+ int src_stride_raw,
3306
+ uint8_t* dst_y,
3307
+ int dst_stride_y,
3308
+ uint8_t* dst_u,
3309
+ int dst_stride_u,
3310
+ uint8_t* dst_v,
3311
+ int dst_stride_v,
3312
+ int width,
3313
+ int height) {
3314
+ int y;
3315
+ #if defined(HAS_RAWTOYJROW)
3316
+ void (*RAWToUVJRow)(const uint8_t* src_raw, int src_stride_raw,
3317
+ uint8_t* dst_u, uint8_t* dst_v, int width) =
3318
+ RAWToUVJRow_C;
3319
+ void (*RAWToYJRow)(const uint8_t* src_raw, uint8_t* dst_y, int width) =
3320
+ RAWToYJRow_C;
3321
+ #else
3322
+ void (*RAWToARGBRow)(const uint8_t* src_rgb, uint8_t* dst_argb, int width) =
3323
+ RAWToARGBRow_C;
3324
+ void (*ARGBToUVJRow)(const uint8_t* src_argb0, int src_stride_argb,
3325
+ uint8_t* dst_u, uint8_t* dst_v, int width) =
3326
+ ARGBToUVJRow_C;
3327
+ void (*ARGBToYJRow)(const uint8_t* src_argb, uint8_t* dst_y, int width) =
3328
+ ARGBToYJRow_C;
3329
+ #endif
3330
+ if (!src_raw || !dst_y || !dst_u || !dst_v || width <= 0 || height == 0) {
3331
+ return -1;
3332
+ }
3333
+ // Negative height means invert the image.
3334
+ if (height < 0) {
3335
+ height = -height;
3336
+ src_raw = src_raw + (height - 1) * src_stride_raw;
3337
+ src_stride_raw = -src_stride_raw;
3338
+ }
3339
+
3340
+ #if defined(HAS_RAWTOYJROW)
3341
+
3342
+ // Neon version does direct RAW to YUV.
3343
+ #if defined(HAS_RAWTOYJROW_NEON) && defined(HAS_RAWTOUVJROW_NEON)
3344
+ if (TestCpuFlag(kCpuHasNEON)) {
3345
+ RAWToUVJRow = RAWToUVJRow_Any_NEON;
3346
+ RAWToYJRow = RAWToYJRow_Any_NEON;
3347
+ if (IS_ALIGNED(width, 16)) {
3348
+ RAWToYJRow = RAWToYJRow_NEON;
3349
+ RAWToUVJRow = RAWToUVJRow_NEON;
3350
+ }
3351
+ }
3352
+ #endif
3353
+ #if defined(HAS_RAWTOYJROW_LSX) && defined(HAS_RAWTOUVJROW_LSX)
3354
+ if (TestCpuFlag(kCpuHasLSX)) {
3355
+ RAWToUVJRow = RAWToUVJRow_Any_LSX;
3356
+ RAWToYJRow = RAWToYJRow_Any_LSX;
3357
+ if (IS_ALIGNED(width, 16)) {
3358
+ RAWToYJRow = RAWToYJRow_LSX;
3359
+ RAWToUVJRow = RAWToUVJRow_LSX;
3360
+ }
3361
+ }
3362
+ #endif
3363
+ #if defined(HAS_RAWTOYJROW_LASX) && defined(HAS_RAWTOUVJROW_LASX)
3364
+ if (TestCpuFlag(kCpuHasLASX)) {
3365
+ RAWToUVJRow = RAWToUVJRow_Any_LASX;
3366
+ RAWToYJRow = RAWToYJRow_Any_LASX;
3367
+ if (IS_ALIGNED(width, 32)) {
3368
+ RAWToYJRow = RAWToYJRow_LASX;
3369
+ RAWToUVJRow = RAWToUVJRow_LASX;
3370
+ }
3371
+ }
3372
+ #endif
3373
+ #if defined(HAS_RAWTOYJROW_RVV)
3374
+ if (TestCpuFlag(kCpuHasRVV)) {
3375
+ RAWToYJRow = RAWToYJRow_RVV;
3376
+ }
3377
+ #endif
3378
+
3379
+ // Other platforms do intermediate conversion from RAW to ARGB.
3380
+ #else // HAS_RAWTOYJROW
3381
+
3382
+ #if defined(HAS_RAWTOARGBROW_SSSE3)
3383
+ if (TestCpuFlag(kCpuHasSSSE3)) {
3384
+ RAWToARGBRow = RAWToARGBRow_Any_SSSE3;
3385
+ if (IS_ALIGNED(width, 16)) {
3386
+ RAWToARGBRow = RAWToARGBRow_SSSE3;
3387
+ }
3388
+ }
3389
+ #endif
3390
+ #if defined(HAS_RAWTOARGBROW_AVX2)
3391
+ if (TestCpuFlag(kCpuHasAVX2)) {
3392
+ RAWToARGBRow = RAWToARGBRow_Any_AVX2;
3393
+ if (IS_ALIGNED(width, 32)) {
3394
+ RAWToARGBRow = RAWToARGBRow_AVX2;
3395
+ }
3396
+ }
3397
+ #endif
3398
+ #if defined(HAS_ARGBTOYJROW_SSSE3)
3399
+ if (TestCpuFlag(kCpuHasSSSE3)) {
3400
+ ARGBToYJRow = ARGBToYJRow_Any_SSSE3;
3401
+ if (IS_ALIGNED(width, 16)) {
3402
+ ARGBToYJRow = ARGBToYJRow_SSSE3;
3403
+ }
3404
+ }
3405
+ #endif
3406
+ #if defined(HAS_ARGBTOYJROW_AVX2)
3407
+ if (TestCpuFlag(kCpuHasAVX2)) {
3408
+ ARGBToYJRow = ARGBToYJRow_Any_AVX2;
3409
+ if (IS_ALIGNED(width, 32)) {
3410
+ ARGBToYJRow = ARGBToYJRow_AVX2;
3411
+ }
3412
+ }
3413
+ #endif
3414
+ #if defined(HAS_ARGBTOUVJROW_SSSE3)
3415
+ if (TestCpuFlag(kCpuHasSSSE3)) {
3416
+ ARGBToUVJRow = ARGBToUVJRow_Any_SSSE3;
3417
+ if (IS_ALIGNED(width, 16)) {
3418
+ ARGBToUVJRow = ARGBToUVJRow_SSSE3;
3419
+ }
3420
+ }
3421
+ #endif
3422
+ #if defined(HAS_ARGBTOUVJROW_AVX2)
3423
+ if (TestCpuFlag(kCpuHasAVX2)) {
3424
+ ARGBToUVJRow = ARGBToUVJRow_Any_AVX2;
3425
+ if (IS_ALIGNED(width, 32)) {
3426
+ ARGBToUVJRow = ARGBToUVJRow_AVX2;
3427
+ }
3428
+ }
3429
+ #endif
3430
+ #endif // HAS_RAWTOYJROW
3431
+
3432
+ {
3433
+ #if !defined(HAS_RAWTOYJROW)
3434
+ // Allocate 2 rows of ARGB.
3435
+ const int row_size = (width * 4 + 31) & ~31;
3436
+ align_buffer_64(row, row_size * 2);
3437
+ if (!row)
3438
+ return 1;
3439
+ #endif
3440
+
3441
+ for (y = 0; y < height - 1; y += 2) {
3442
+ #if defined(HAS_RAWTOYJROW)
3443
+ RAWToUVJRow(src_raw, src_stride_raw, dst_u, dst_v, width);
3444
+ RAWToYJRow(src_raw, dst_y, width);
3445
+ RAWToYJRow(src_raw + src_stride_raw, dst_y + dst_stride_y, width);
3446
+ #else
3447
+ RAWToARGBRow(src_raw, row, width);
3448
+ RAWToARGBRow(src_raw + src_stride_raw, row + row_size, width);
3449
+ ARGBToUVJRow(row, row_size, dst_u, dst_v, width);
3450
+ ARGBToYJRow(row, dst_y, width);
3451
+ ARGBToYJRow(row + row_size, dst_y + dst_stride_y, width);
3452
+ #endif
3453
+ src_raw += src_stride_raw * 2;
3454
+ dst_y += dst_stride_y * 2;
3455
+ dst_u += dst_stride_u;
3456
+ dst_v += dst_stride_v;
3457
+ }
3458
+ if (height & 1) {
3459
+ #if defined(HAS_RAWTOYJROW)
3460
+ RAWToUVJRow(src_raw, 0, dst_u, dst_v, width);
3461
+ RAWToYJRow(src_raw, dst_y, width);
3462
+ #else
3463
+ RAWToARGBRow(src_raw, row, width);
3464
+ ARGBToUVJRow(row, 0, dst_u, dst_v, width);
3465
+ ARGBToYJRow(row, dst_y, width);
3466
+ #endif
3467
+ }
3468
+ #if !defined(HAS_RAWTOYJROW)
3469
+ free_aligned_buffer_64(row);
3470
+ #endif
3471
+ }
3472
+ return 0;
3473
+ }
3474
+ #undef HAS_RAWTOYJROW
3475
+
3476
+ // RAW big endian (rgb in memory) to I444
3477
+ // 2 step conversion of RAWToARGB then ARGBToY and ARGBToUV444
3478
+ LIBYUV_API
3479
+ int RAWToI444(const uint8_t* src_raw,
3480
+ int src_stride_raw,
3481
+ uint8_t* dst_y,
3482
+ int dst_stride_y,
3483
+ uint8_t* dst_u,
3484
+ int dst_stride_u,
3485
+ uint8_t* dst_v,
3486
+ int dst_stride_v,
3487
+ int width,
3488
+ int height) {
3489
+ int y;
3490
+ void (*RAWToARGBRow)(const uint8_t* src_rgb, uint8_t* dst_argb, int width) =
3491
+ RAWToARGBRow_C;
3492
+ void (*ARGBToYRow)(const uint8_t* src_raw, uint8_t* dst_y, int width) =
3493
+ ARGBToYRow_C;
3494
+ void (*ARGBToUV444Row)(const uint8_t* src_raw, uint8_t* dst_u, uint8_t* dst_v,
3495
+ int width) = ARGBToUV444Row_C;
3496
+ if (!src_raw || !dst_y || !dst_u || !dst_v || width <= 0 || height == 0) {
3497
+ return -1;
3498
+ }
3499
+ if (height < 0) {
3500
+ height = -height;
3501
+ src_raw = src_raw + (height - 1) * src_stride_raw;
3502
+ src_stride_raw = -src_stride_raw;
3503
+ }
3504
+ // TODO: add row coalesce when main loop handles large width in blocks
3505
+ // TODO: implement UV444 or trim the ifdef below
3506
+ #if defined(HAS_ARGBTOUV444ROW_SSSE3)
3507
+ if (TestCpuFlag(kCpuHasSSSE3)) {
3508
+ ARGBToUV444Row = ARGBToUV444Row_Any_SSSE3;
3509
+ if (IS_ALIGNED(width, 16)) {
3510
+ ARGBToUV444Row = ARGBToUV444Row_SSSE3;
3511
+ }
3512
+ }
3513
+ #endif
3514
+ #if defined(HAS_ARGBTOUV444ROW_AVX2)
3515
+ if (TestCpuFlag(kCpuHasAVX2)) {
3516
+ ARGBToUV444Row = ARGBToUV444Row_Any_AVX2;
3517
+ if (IS_ALIGNED(width, 32)) {
3518
+ ARGBToUV444Row = ARGBToUV444Row_AVX2;
3519
+ }
3520
+ }
3521
+ #endif
3522
+ #if defined(HAS_ARGBTOUV444ROW_NEON)
3523
+ if (TestCpuFlag(kCpuHasNEON)) {
3524
+ ARGBToUV444Row = ARGBToUV444Row_Any_NEON;
3525
+ if (IS_ALIGNED(width, 8)) {
3526
+ ARGBToUV444Row = ARGBToUV444Row_NEON;
3527
+ }
3528
+ }
3529
+ #endif
3530
+ #if defined(HAS_ARGBTOUV444ROW_NEON_I8MM)
3531
+ if (TestCpuFlag(kCpuHasNeonI8MM)) {
3532
+ ARGBToUV444Row = ARGBToUV444Row_Any_NEON_I8MM;
3533
+ if (IS_ALIGNED(width, 8)) {
3534
+ ARGBToUV444Row = ARGBToUV444Row_NEON_I8MM;
3535
+ }
3536
+ }
3537
+ #endif
3538
+ #if defined(HAS_ARGBTOUV444ROW_LSX)
3539
+ if (TestCpuFlag(kCpuHasLSX)) {
3540
+ ARGBToUV444Row = ARGBToUV444Row_Any_LSX;
3541
+ if (IS_ALIGNED(width, 16)) {
3542
+ ARGBToUV444Row = ARGBToUV444Row_LSX;
3543
+ }
3544
+ }
3545
+ #endif
3546
+ #if defined(HAS_ARGBTOUV444ROW_LASX)
3547
+ if (TestCpuFlag(kCpuHasLASX)) {
3548
+ ARGBToUV444Row = ARGBToUV444Row_Any_LASX;
3549
+ if (IS_ALIGNED(width, 32)) {
3550
+ ARGBToUV444Row = ARGBToUV444Row_LASX;
3551
+ }
3552
+ }
3553
+ #endif
3554
+ #if defined(HAS_ARGBTOYROW_SSSE3)
3555
+ if (TestCpuFlag(kCpuHasSSSE3)) {
3556
+ ARGBToYRow = ARGBToYRow_Any_SSSE3;
3557
+ if (IS_ALIGNED(width, 16)) {
3558
+ ARGBToYRow = ARGBToYRow_SSSE3;
3559
+ }
3560
+ }
3561
+ #endif
3562
+ #if defined(HAS_ARGBTOYROW_AVX2)
3563
+ if (TestCpuFlag(kCpuHasAVX2)) {
3564
+ ARGBToYRow = ARGBToYRow_Any_AVX2;
3565
+ if (IS_ALIGNED(width, 32)) {
3566
+ ARGBToYRow = ARGBToYRow_AVX2;
3567
+ }
3568
+ }
3569
+ #endif
3570
+ #if defined(HAS_ARGBTOYROW_NEON)
3571
+ if (TestCpuFlag(kCpuHasNEON)) {
3572
+ ARGBToYRow = ARGBToYRow_Any_NEON;
3573
+ if (IS_ALIGNED(width, 16)) {
3574
+ ARGBToYRow = ARGBToYRow_NEON;
3575
+ }
3576
+ }
3577
+ #endif
3578
+ #if defined(HAS_ARGBTOYROW_NEON_DOTPROD)
3579
+ if (TestCpuFlag(kCpuHasNeonDotProd)) {
3580
+ ARGBToYRow = ARGBToYRow_Any_NEON_DotProd;
3581
+ if (IS_ALIGNED(width, 16)) {
3582
+ ARGBToYRow = ARGBToYRow_NEON_DotProd;
3583
+ }
3584
+ }
3585
+ #endif
3586
+ #if defined(HAS_ARGBTOYROW_LSX)
3587
+ if (TestCpuFlag(kCpuHasLSX)) {
3588
+ ARGBToYRow = ARGBToYRow_Any_LSX;
3589
+ if (IS_ALIGNED(width, 16)) {
3590
+ ARGBToYRow = ARGBToYRow_LSX;
3591
+ }
3592
+ }
3593
+ #endif
3594
+ #if defined(HAS_ARGBTOYROW_LASX)
3595
+ if (TestCpuFlag(kCpuHasLASX)) {
3596
+ ARGBToYRow = ARGBToYRow_Any_LASX;
3597
+ if (IS_ALIGNED(width, 32)) {
3598
+ ARGBToYRow = ARGBToYRow_LASX;
3599
+ }
3600
+ }
3601
+ #endif
3602
+ #if defined(HAS_ARGBTOYROW_RVV)
3603
+ if (TestCpuFlag(kCpuHasRVV)) {
3604
+ ARGBToYRow = ARGBToYRow_RVV;
3605
+ }
3606
+ #endif
3607
+
3608
+ #if defined(HAS_RAWTOARGBROW_SSSE3)
3609
+ if (TestCpuFlag(kCpuHasSSSE3)) {
3610
+ RAWToARGBRow = RAWToARGBRow_Any_SSSE3;
3611
+ if (IS_ALIGNED(width, 16)) {
3612
+ RAWToARGBRow = RAWToARGBRow_SSSE3;
3613
+ }
3614
+ }
3615
+ #endif
3616
+ #if defined(HAS_RAWTOARGBROW_AVX2)
3617
+ if (TestCpuFlag(kCpuHasAVX2)) {
3618
+ RAWToARGBRow = RAWToARGBRow_Any_AVX2;
3619
+ if (IS_ALIGNED(width, 32)) {
3620
+ RAWToARGBRow = RAWToARGBRow_AVX2;
3621
+ }
3622
+ }
3623
+ #endif
3624
+ #if defined(HAS_RAWTOARGBROW_NEON)
3625
+ if (TestCpuFlag(kCpuHasNEON)) {
3626
+ RAWToARGBRow = RAWToARGBRow_Any_NEON;
3627
+ if (IS_ALIGNED(width, 8)) {
3628
+ RAWToARGBRow = RAWToARGBRow_NEON;
3629
+ }
3630
+ }
3631
+ #endif
3632
+ #if defined(HAS_RAWTOARGBROW_SVE2)
3633
+ if (TestCpuFlag(kCpuHasSVE2)) {
3634
+ RAWToARGBRow = RAWToARGBRow_SVE2;
3635
+ }
3636
+ #endif
3637
+ #if defined(HAS_RAWTOARGBROW_LSX)
3638
+ if (TestCpuFlag(kCpuHasLSX)) {
3639
+ RAWToARGBRow = RAWToARGBRow_Any_LSX;
3640
+ if (IS_ALIGNED(width, 16)) {
3641
+ RAWToARGBRow = RAWToARGBRow_LSX;
3642
+ }
3643
+ }
3644
+ #endif
3645
+ #if defined(HAS_RAWTOARGBROW_LASX)
3646
+ if (TestCpuFlag(kCpuHasLASX)) {
3647
+ RAWToARGBRow = RAWToARGBRow_Any_LASX;
3648
+ if (IS_ALIGNED(width, 32)) {
3649
+ RAWToARGBRow = RAWToARGBRow_LASX;
3650
+ }
3651
+ }
3652
+ #endif
3653
+ #if defined(HAS_RAWTOARGBROW_RVV)
3654
+ if (TestCpuFlag(kCpuHasRVV)) {
3655
+ RAWToARGBRow = RAWToARGBRow_RVV;
3656
+ }
3657
+ #endif
3658
+
3659
+ {
3660
+ // Allocate a row of ARGB.
3661
+ const int row_size = width * 4;
3662
+ align_buffer_64(row, row_size);
3663
+ if (!row)
3664
+ return 1;
3665
+
3666
+ for (y = 0; y < height; ++y) {
3667
+ RAWToARGBRow(src_raw, row, width);
3668
+ ARGBToUV444Row(row, dst_u, dst_v, width);
3669
+ ARGBToYRow(row, dst_y, width);
3670
+ src_raw += src_stride_raw;
3671
+ dst_y += dst_stride_y;
3672
+ dst_u += dst_stride_u;
3673
+ dst_v += dst_stride_v;
3674
+ }
3675
+ free_aligned_buffer_64(row);
3676
+ }
3677
+ return 0;
3678
+ }
3679
+
3680
+ // RAW big endian (rgb in memory) to J444
3681
+ // 2 step conversion of RAWToARGB then ARGBToYJ and ARGBToUVJ444
3682
+ LIBYUV_API
3683
+ int RAWToJ444(const uint8_t* src_raw,
3684
+ int src_stride_raw,
3685
+ uint8_t* dst_y,
3686
+ int dst_stride_y,
3687
+ uint8_t* dst_u,
3688
+ int dst_stride_u,
3689
+ uint8_t* dst_v,
3690
+ int dst_stride_v,
3691
+ int width,
3692
+ int height) {
3693
+ int y;
3694
+ void (*RAWToARGBRow)(const uint8_t* src_rgb, uint8_t* dst_argb, int width) =
3695
+ RAWToARGBRow_C;
3696
+ void (*ARGBToYJRow)(const uint8_t* src_raw, uint8_t* dst_y, int width) =
3697
+ ARGBToYJRow_C;
3698
+ void (*ARGBToUVJ444Row)(const uint8_t* src_raw, uint8_t* dst_u,
3699
+ uint8_t* dst_v, int width) = ARGBToUVJ444Row_C;
3700
+ if (!src_raw || !dst_y || !dst_u || !dst_v || width <= 0 || height == 0) {
3701
+ return -1;
3702
+ }
3703
+ if (height < 0) {
3704
+ height = -height;
3705
+ src_raw = src_raw + (height - 1) * src_stride_raw;
3706
+ src_stride_raw = -src_stride_raw;
3707
+ }
3708
+ // TODO: add row coalesce when main loop handles large width in blocks
3709
+ #if defined(HAS_ARGBTOUVJ444ROW_SSSE3)
3710
+ if (TestCpuFlag(kCpuHasSSSE3)) {
3711
+ ARGBToUVJ444Row = ARGBToUVJ444Row_Any_SSSE3;
3712
+ if (IS_ALIGNED(width, 16)) {
3713
+ ARGBToUVJ444Row = ARGBToUVJ444Row_SSSE3;
3714
+ }
3715
+ }
3716
+ #endif
3717
+ #if defined(HAS_ARGBTOUVJ444ROW_AVX2)
3718
+ if (TestCpuFlag(kCpuHasAVX2)) {
3719
+ ARGBToUVJ444Row = ARGBToUVJ444Row_Any_AVX2;
3720
+ if (IS_ALIGNED(width, 32)) {
3721
+ ARGBToUVJ444Row = ARGBToUVJ444Row_AVX2;
3722
+ }
3723
+ }
3724
+ #endif
3725
+ #if defined(HAS_ARGBTOUVJ444ROW_NEON)
3726
+ if (TestCpuFlag(kCpuHasNEON)) {
3727
+ ARGBToUVJ444Row = ARGBToUVJ444Row_Any_NEON;
3728
+ if (IS_ALIGNED(width, 8)) {
3729
+ ARGBToUVJ444Row = ARGBToUVJ444Row_NEON;
3730
+ }
3731
+ }
3732
+ #endif
3733
+ #if defined(HAS_ARGBTOUVJ444ROW_NEON_I8MM)
3734
+ if (TestCpuFlag(kCpuHasNeonI8MM)) {
3735
+ ARGBToUVJ444Row = ARGBToUVJ444Row_Any_NEON_I8MM;
3736
+ if (IS_ALIGNED(width, 8)) {
3737
+ ARGBToUVJ444Row = ARGBToUVJ444Row_NEON_I8MM;
3738
+ }
3739
+ }
3740
+ #endif
3741
+ #if defined(HAS_ARGBTOUVJ444ROW_LSX)
3742
+ if (TestCpuFlag(kCpuHasLSX)) {
3743
+ ARGBToUVJ444Row = ARGBToUVJ444Row_Any_LSX;
3744
+ if (IS_ALIGNED(width, 16)) {
3745
+ ARGBToUVJ444Row = ARGBToUVJ444Row_LSX;
3746
+ }
3747
+ }
3748
+ #endif
3749
+ #if defined(HAS_ARGBTOUVJ444ROW_LASX)
3750
+ if (TestCpuFlag(kCpuHasLASX)) {
3751
+ ARGBToUVJ444Row = ARGBToUVJ444Row_Any_LASX;
3752
+ if (IS_ALIGNED(width, 32)) {
3753
+ ARGBToUVJ444Row = ARGBToUVJ444Row_LASX;
3754
+ }
3755
+ }
3756
+ #endif
3757
+ #if defined(HAS_ARGBTOYJROW_SSSE3)
3758
+ if (TestCpuFlag(kCpuHasSSSE3)) {
3759
+ ARGBToYJRow = ARGBToYJRow_Any_SSSE3;
3760
+ if (IS_ALIGNED(width, 16)) {
3761
+ ARGBToYJRow = ARGBToYJRow_SSSE3;
3762
+ }
3763
+ }
3764
+ #endif
3765
+ #if defined(HAS_ARGBTOYJROW_AVX2)
3766
+ if (TestCpuFlag(kCpuHasAVX2)) {
3767
+ ARGBToYJRow = ARGBToYJRow_Any_AVX2;
3768
+ if (IS_ALIGNED(width, 32)) {
3769
+ ARGBToYJRow = ARGBToYJRow_AVX2;
3770
+ }
3771
+ }
3772
+ #endif
3773
+ #if defined(HAS_ARGBTOYJROW_NEON)
3774
+ if (TestCpuFlag(kCpuHasNEON)) {
3775
+ ARGBToYJRow = ARGBToYJRow_Any_NEON;
3776
+ if (IS_ALIGNED(width, 16)) {
3777
+ ARGBToYJRow = ARGBToYJRow_NEON;
3778
+ }
3779
+ }
3780
+ #endif
3781
+ #if defined(HAS_ARGBTOYJROW_NEON_DOTPROD)
3782
+ if (TestCpuFlag(kCpuHasNeonDotProd)) {
3783
+ ARGBToYJRow = ARGBToYJRow_Any_NEON_DotProd;
3784
+ if (IS_ALIGNED(width, 16)) {
3785
+ ARGBToYJRow = ARGBToYJRow_NEON_DotProd;
3786
+ }
3787
+ }
3788
+ #endif
3789
+ #if defined(HAS_ARGBTOYJROW_LSX)
3790
+ if (TestCpuFlag(kCpuHasLSX)) {
3791
+ ARGBToYJRow = ARGBToYJRow_Any_LSX;
3792
+ if (IS_ALIGNED(width, 16)) {
3793
+ ARGBToYJRow = ARGBToYJRow_LSX;
3794
+ }
3795
+ }
3796
+ #endif
3797
+ #if defined(HAS_ARGBTOYJROW_LASX)
3798
+ if (TestCpuFlag(kCpuHasLASX)) {
3799
+ ARGBToYJRow = ARGBToYJRow_Any_LASX;
3800
+ if (IS_ALIGNED(width, 32)) {
3801
+ ARGBToYJRow = ARGBToYJRow_LASX;
3802
+ }
3803
+ }
3804
+ #endif
3805
+ #if defined(HAS_ARGBTOYJROW_RVV)
3806
+ if (TestCpuFlag(kCpuHasRVV)) {
3807
+ ARGBToYJRow = ARGBToYJRow_RVV;
3808
+ }
3809
+ #endif
3810
+
3811
+ #if defined(HAS_RAWTOARGBROW_SSSE3)
3812
+ if (TestCpuFlag(kCpuHasSSSE3)) {
3813
+ RAWToARGBRow = RAWToARGBRow_Any_SSSE3;
3814
+ if (IS_ALIGNED(width, 16)) {
3815
+ RAWToARGBRow = RAWToARGBRow_SSSE3;
3816
+ }
3817
+ }
3818
+ #endif
3819
+ #if defined(HAS_RAWTOARGBROW_AVX2)
3820
+ if (TestCpuFlag(kCpuHasAVX2)) {
3821
+ RAWToARGBRow = RAWToARGBRow_Any_AVX2;
3822
+ if (IS_ALIGNED(width, 32)) {
3823
+ RAWToARGBRow = RAWToARGBRow_AVX2;
3824
+ }
3825
+ }
3826
+ #endif
3827
+ #if defined(HAS_RAWTOARGBROW_NEON)
3828
+ if (TestCpuFlag(kCpuHasNEON)) {
3829
+ RAWToARGBRow = RAWToARGBRow_Any_NEON;
3830
+ if (IS_ALIGNED(width, 8)) {
3831
+ RAWToARGBRow = RAWToARGBRow_NEON;
3832
+ }
3833
+ }
3834
+ #endif
3835
+ #if defined(HAS_RAWTOARGBROW_SVE2)
3836
+ if (TestCpuFlag(kCpuHasSVE2)) {
3837
+ RAWToARGBRow = RAWToARGBRow_SVE2;
3838
+ }
3839
+ #endif
3840
+ #if defined(HAS_RAWTOARGBROW_LSX)
3841
+ if (TestCpuFlag(kCpuHasLSX)) {
3842
+ RAWToARGBRow = RAWToARGBRow_Any_LSX;
3843
+ if (IS_ALIGNED(width, 16)) {
3844
+ RAWToARGBRow = RAWToARGBRow_LSX;
3845
+ }
3846
+ }
3847
+ #endif
3848
+ #if defined(HAS_RAWTOARGBROW_LASX)
3849
+ if (TestCpuFlag(kCpuHasLASX)) {
3850
+ RAWToARGBRow = RAWToARGBRow_Any_LASX;
3851
+ if (IS_ALIGNED(width, 32)) {
3852
+ RAWToARGBRow = RAWToARGBRow_LASX;
3853
+ }
3854
+ }
3855
+ #endif
3856
+ #if defined(HAS_RAWTOARGBROW_RVV)
3857
+ if (TestCpuFlag(kCpuHasRVV)) {
3858
+ RAWToARGBRow = RAWToARGBRow_RVV;
3859
+ }
3860
+ #endif
3861
+
3862
+ {
3863
+ // Allocate a row of ARGB.
3864
+ const int row_size = width * 4;
3865
+ align_buffer_64(row, row_size);
3866
+ if (!row)
3867
+ return 1;
3868
+
3869
+ for (y = 0; y < height; ++y) {
3870
+ RAWToARGBRow(src_raw, row, width);
3871
+ ARGBToUVJ444Row(row, dst_u, dst_v, width);
3872
+ ARGBToYJRow(row, dst_y, width);
3873
+ src_raw += src_stride_raw;
3874
+ dst_y += dst_stride_y;
3875
+ dst_u += dst_stride_u;
3876
+ dst_v += dst_stride_v;
3877
+ }
3878
+ free_aligned_buffer_64(row);
3879
+ }
3880
+ return 0;
3881
+ }
3882
+
3883
+ // Convert RGB565 to I420.
3884
+ LIBYUV_API
3885
+ int RGB565ToI420(const uint8_t* src_rgb565,
3886
+ int src_stride_rgb565,
3887
+ uint8_t* dst_y,
3888
+ int dst_stride_y,
3889
+ uint8_t* dst_u,
3890
+ int dst_stride_u,
3891
+ uint8_t* dst_v,
3892
+ int dst_stride_v,
3893
+ int width,
3894
+ int height) {
3895
+ int y;
3896
+ #if (defined(HAS_RGB565TOYROW_NEON) || defined(HAS_RGB565TOYROW_LSX) || \
3897
+ defined(HAS_RGB565TOYROW_LASX))
3898
+ void (*RGB565ToUVRow)(const uint8_t* src_rgb565, int src_stride_rgb565,
3899
+ uint8_t* dst_u, uint8_t* dst_v, int width) =
3900
+ RGB565ToUVRow_C;
3901
+ void (*RGB565ToYRow)(const uint8_t* src_rgb565, uint8_t* dst_y, int width) =
3902
+ RGB565ToYRow_C;
3903
+ #else
3904
+ void (*RGB565ToARGBRow)(const uint8_t* src_rgb, uint8_t* dst_argb,
3905
+ int width) = RGB565ToARGBRow_C;
3906
+ void (*ARGBToUVRow)(const uint8_t* src_argb0, int src_stride_argb,
3907
+ uint8_t* dst_u, uint8_t* dst_v, int width) =
3908
+ ARGBToUVRow_C;
3909
+ void (*ARGBToYRow)(const uint8_t* src_argb, uint8_t* dst_y, int width) =
3910
+ ARGBToYRow_C;
3911
+ #endif
3912
+ if (!src_rgb565 || !dst_y || !dst_u || !dst_v || width <= 0 || height == 0) {
3913
+ return -1;
3914
+ }
3915
+ // Negative height means invert the image.
3916
+ if (height < 0) {
3917
+ height = -height;
3918
+ src_rgb565 = src_rgb565 + (height - 1) * src_stride_rgb565;
3919
+ src_stride_rgb565 = -src_stride_rgb565;
3920
+ }
3921
+
3922
+ // Neon version does direct RGB565 to YUV.
3923
+ #if defined(HAS_RGB565TOYROW_NEON)
3924
+ if (TestCpuFlag(kCpuHasNEON)) {
3925
+ RGB565ToYRow = RGB565ToYRow_Any_NEON;
3926
+ if (IS_ALIGNED(width, 16)) {
3927
+ RGB565ToYRow = RGB565ToYRow_NEON;
3928
+ }
3929
+ }
3930
+ #endif
3931
+ // Neon version does direct RGB565 to YUV.
3932
+ #if defined(HAS_RGB565TOUVROW_NEON)
3933
+ if (TestCpuFlag(kCpuHasNEON)) {
3934
+ RGB565ToUVRow = RGB565ToUVRow_Any_NEON;
3935
+ if (IS_ALIGNED(width, 16)) {
3936
+ RGB565ToUVRow = RGB565ToUVRow_NEON;
3937
+ }
3938
+ }
3939
+ #endif
3940
+ // LSX version does direct RGB565 to YUV.
3941
+ #if defined(HAS_RGB565TOYROW_LSX) && defined(HAS_RGB565TOUVROW_LSX)
3942
+ if (TestCpuFlag(kCpuHasLSX)) {
3943
+ RGB565ToUVRow = RGB565ToUVRow_Any_LSX;
3944
+ RGB565ToYRow = RGB565ToYRow_Any_LSX;
3945
+ if (IS_ALIGNED(width, 16)) {
3946
+ RGB565ToYRow = RGB565ToYRow_LSX;
3947
+ RGB565ToUVRow = RGB565ToUVRow_LSX;
3948
+ }
3949
+ }
3950
+ #endif
3951
+ #if defined(HAS_RGB565TOYROW_LASX) && defined(HAS_RGB565TOUVROW_LASX)
3952
+ if (TestCpuFlag(kCpuHasLASX)) {
3953
+ RGB565ToUVRow = RGB565ToUVRow_Any_LASX;
3954
+ RGB565ToYRow = RGB565ToYRow_Any_LASX;
3955
+ if (IS_ALIGNED(width, 32)) {
3956
+ RGB565ToYRow = RGB565ToYRow_LASX;
3957
+ RGB565ToUVRow = RGB565ToUVRow_LASX;
3958
+ }
3959
+ }
3960
+ #endif
3961
+ // Other platforms do intermediate conversion from RGB565 to ARGB.
3962
+ #if defined(HAS_RGB565TOARGBROW_SSE2)
3963
+ if (TestCpuFlag(kCpuHasSSE2)) {
3964
+ RGB565ToARGBRow = RGB565ToARGBRow_Any_SSE2;
3965
+ if (IS_ALIGNED(width, 8)) {
3966
+ RGB565ToARGBRow = RGB565ToARGBRow_SSE2;
3967
+ }
3968
+ }
3969
+ #endif
3970
+ #if defined(HAS_RGB565TOARGBROW_AVX2)
3971
+ if (TestCpuFlag(kCpuHasAVX2)) {
3972
+ RGB565ToARGBRow = RGB565ToARGBRow_Any_AVX2;
3973
+ if (IS_ALIGNED(width, 16)) {
3974
+ RGB565ToARGBRow = RGB565ToARGBRow_AVX2;
3975
+ }
3976
+ }
3977
+ #endif
3978
+ #if defined(HAS_ARGBTOYROW_SSSE3)
3979
+ if (TestCpuFlag(kCpuHasSSSE3)) {
3980
+ ARGBToYRow = ARGBToYRow_Any_SSSE3;
3981
+ if (IS_ALIGNED(width, 16)) {
3982
+ ARGBToYRow = ARGBToYRow_SSSE3;
3983
+ }
3984
+ }
3985
+ #endif
3986
+ #if defined(HAS_ARGBTOYROW_AVX2)
3987
+ if (TestCpuFlag(kCpuHasAVX2)) {
3988
+ ARGBToYRow = ARGBToYRow_Any_AVX2;
3989
+ if (IS_ALIGNED(width, 32)) {
3990
+ ARGBToYRow = ARGBToYRow_AVX2;
3991
+ }
3992
+ }
3993
+ #endif
3994
+ #if defined(HAS_ARGBTOUVROW_SSSE3)
3995
+ if (TestCpuFlag(kCpuHasSSSE3)) {
3996
+ ARGBToUVRow = ARGBToUVRow_Any_SSSE3;
3997
+ if (IS_ALIGNED(width, 16)) {
3998
+ ARGBToUVRow = ARGBToUVRow_SSSE3;
3999
+ }
4000
+ }
4001
+ #endif
4002
+ #if defined(HAS_ARGBTOUVROW_AVX2)
4003
+ if (TestCpuFlag(kCpuHasAVX2)) {
4004
+ ARGBToUVRow = ARGBToUVRow_Any_AVX2;
4005
+ if (IS_ALIGNED(width, 32)) {
4006
+ ARGBToUVRow = ARGBToUVRow_AVX2;
4007
+ }
4008
+ }
4009
+ #endif
4010
+ {
4011
+ #if !(defined(HAS_RGB565TOYROW_NEON) || defined(HAS_RGB565TOYROW_LSX) || \
4012
+ defined(HAS_RGB565TOYROW_LASX))
4013
+ // Allocate 2 rows of ARGB.
4014
+ const int row_size = (width * 4 + 31) & ~31;
4015
+ align_buffer_64(row, row_size * 2);
4016
+ if (!row)
4017
+ return 1;
4018
+ #endif
4019
+ for (y = 0; y < height - 1; y += 2) {
4020
+ #if (defined(HAS_RGB565TOYROW_NEON) || defined(HAS_RGB565TOYROW_LSX) || \
4021
+ defined(HAS_RGB565TOYROW_LASX))
4022
+ RGB565ToUVRow(src_rgb565, src_stride_rgb565, dst_u, dst_v, width);
4023
+ RGB565ToYRow(src_rgb565, dst_y, width);
4024
+ RGB565ToYRow(src_rgb565 + src_stride_rgb565, dst_y + dst_stride_y, width);
4025
+ #else
4026
+ RGB565ToARGBRow(src_rgb565, row, width);
4027
+ RGB565ToARGBRow(src_rgb565 + src_stride_rgb565, row + row_size, width);
4028
+ ARGBToUVRow(row, row_size, dst_u, dst_v, width);
4029
+ ARGBToYRow(row, dst_y, width);
4030
+ ARGBToYRow(row + row_size, dst_y + dst_stride_y, width);
4031
+ #endif
4032
+ src_rgb565 += src_stride_rgb565 * 2;
4033
+ dst_y += dst_stride_y * 2;
4034
+ dst_u += dst_stride_u;
4035
+ dst_v += dst_stride_v;
4036
+ }
4037
+ if (height & 1) {
4038
+ #if (defined(HAS_RGB565TOYROW_NEON) || defined(HAS_RGB565TOYROW_LSX) || \
4039
+ defined(HAS_RGB565TOYROW_LASX))
4040
+ RGB565ToUVRow(src_rgb565, 0, dst_u, dst_v, width);
4041
+ RGB565ToYRow(src_rgb565, dst_y, width);
4042
+ #else
4043
+ RGB565ToARGBRow(src_rgb565, row, width);
4044
+ ARGBToUVRow(row, 0, dst_u, dst_v, width);
4045
+ ARGBToYRow(row, dst_y, width);
4046
+ #endif
4047
+ }
4048
+ #if !(defined(HAS_RGB565TOYROW_NEON) || defined(HAS_RGB565TOYROW_LSX) || \
4049
+ defined(HAS_RGB565TOYROW_LASX))
4050
+ free_aligned_buffer_64(row);
4051
+ #endif
4052
+ }
4053
+ return 0;
4054
+ }
4055
+
4056
+ // Convert ARGB1555 to I420.
4057
+ LIBYUV_API
4058
+ int ARGB1555ToI420(const uint8_t* src_argb1555,
4059
+ int src_stride_argb1555,
4060
+ uint8_t* dst_y,
4061
+ int dst_stride_y,
4062
+ uint8_t* dst_u,
4063
+ int dst_stride_u,
4064
+ uint8_t* dst_v,
4065
+ int dst_stride_v,
4066
+ int width,
4067
+ int height) {
4068
+ int y;
4069
+ #if (defined(HAS_ARGB1555TOYROW_NEON) || defined(HAS_ARGB1555TOYROW_LSX) || \
4070
+ defined(HAS_ARGB1555TOYROW_LASX))
4071
+ void (*ARGB1555ToUVRow)(const uint8_t* src_argb1555, int src_stride_argb1555,
4072
+ uint8_t* dst_u, uint8_t* dst_v, int width) =
4073
+ ARGB1555ToUVRow_C;
4074
+ void (*ARGB1555ToYRow)(const uint8_t* src_argb1555, uint8_t* dst_y,
4075
+ int width) = ARGB1555ToYRow_C;
4076
+ #else
4077
+ void (*ARGB1555ToARGBRow)(const uint8_t* src_rgb, uint8_t* dst_argb,
4078
+ int width) = ARGB1555ToARGBRow_C;
4079
+ void (*ARGBToUVRow)(const uint8_t* src_argb0, int src_stride_argb,
4080
+ uint8_t* dst_u, uint8_t* dst_v, int width) =
4081
+ ARGBToUVRow_C;
4082
+ void (*ARGBToYRow)(const uint8_t* src_argb, uint8_t* dst_y, int width) =
4083
+ ARGBToYRow_C;
4084
+ #endif
4085
+ if (!src_argb1555 || !dst_y || !dst_u || !dst_v || width <= 0 ||
4086
+ height == 0) {
4087
+ return -1;
4088
+ }
4089
+ // Negative height means invert the image.
4090
+ if (height < 0) {
4091
+ height = -height;
4092
+ src_argb1555 = src_argb1555 + (height - 1) * src_stride_argb1555;
4093
+ src_stride_argb1555 = -src_stride_argb1555;
4094
+ }
4095
+
4096
+ // Neon version does direct ARGB1555 to YUV.
4097
+ #if defined(HAS_ARGB1555TOYROW_NEON)
4098
+ if (TestCpuFlag(kCpuHasNEON)) {
4099
+ ARGB1555ToYRow = ARGB1555ToYRow_Any_NEON;
4100
+ if (IS_ALIGNED(width, 8)) {
4101
+ ARGB1555ToYRow = ARGB1555ToYRow_NEON;
4102
+ }
4103
+ }
4104
+ #endif
4105
+ #if defined(HAS_ARGB1555TOUVROW_NEON)
4106
+ if (TestCpuFlag(kCpuHasNEON)) {
4107
+ ARGB1555ToUVRow = ARGB1555ToUVRow_Any_NEON;
4108
+ if (IS_ALIGNED(width, 16)) {
4109
+ ARGB1555ToUVRow = ARGB1555ToUVRow_NEON;
4110
+ }
4111
+ }
4112
+ #endif
4113
+
4114
+ // LSX version does direct ARGB1555 to YUV.
4115
+ #if defined(HAS_ARGB1555TOYROW_LSX) && defined(HAS_ARGB1555TOUVROW_LSX)
4116
+ if (TestCpuFlag(kCpuHasLSX)) {
4117
+ ARGB1555ToUVRow = ARGB1555ToUVRow_Any_LSX;
4118
+ ARGB1555ToYRow = ARGB1555ToYRow_Any_LSX;
4119
+ if (IS_ALIGNED(width, 16)) {
4120
+ ARGB1555ToYRow = ARGB1555ToYRow_LSX;
4121
+ ARGB1555ToUVRow = ARGB1555ToUVRow_LSX;
4122
+ }
4123
+ }
4124
+ #endif
4125
+ #if defined(HAS_ARGB1555TOYROW_LASX) && defined(HAS_ARGB1555TOUVROW_LASX)
4126
+ if (TestCpuFlag(kCpuHasLASX)) {
4127
+ ARGB1555ToUVRow = ARGB1555ToUVRow_Any_LASX;
4128
+ ARGB1555ToYRow = ARGB1555ToYRow_Any_LASX;
4129
+ if (IS_ALIGNED(width, 32)) {
4130
+ ARGB1555ToYRow = ARGB1555ToYRow_LASX;
4131
+ ARGB1555ToUVRow = ARGB1555ToUVRow_LASX;
4132
+ }
4133
+ }
4134
+ #endif
4135
+
4136
+ // Other platforms do intermediate conversion from ARGB1555 to ARGB.
4137
+ #if defined(HAS_ARGB1555TOARGBROW_SSE2)
4138
+ if (TestCpuFlag(kCpuHasSSE2)) {
4139
+ ARGB1555ToARGBRow = ARGB1555ToARGBRow_Any_SSE2;
4140
+ if (IS_ALIGNED(width, 8)) {
4141
+ ARGB1555ToARGBRow = ARGB1555ToARGBRow_SSE2;
4142
+ }
4143
+ }
4144
+ #endif
4145
+ #if defined(HAS_ARGB1555TOARGBROW_AVX2)
4146
+ if (TestCpuFlag(kCpuHasAVX2)) {
4147
+ ARGB1555ToARGBRow = ARGB1555ToARGBRow_Any_AVX2;
4148
+ if (IS_ALIGNED(width, 16)) {
4149
+ ARGB1555ToARGBRow = ARGB1555ToARGBRow_AVX2;
4150
+ }
4151
+ }
4152
+ #endif
4153
+ #if defined(HAS_ARGBTOYROW_SSSE3)
4154
+ if (TestCpuFlag(kCpuHasSSSE3)) {
4155
+ ARGBToYRow = ARGBToYRow_Any_SSSE3;
4156
+ if (IS_ALIGNED(width, 16)) {
4157
+ ARGBToYRow = ARGBToYRow_SSSE3;
4158
+ }
4159
+ }
4160
+ #endif
4161
+ #if defined(HAS_ARGBTOUVROW_SSSE3)
4162
+ if (TestCpuFlag(kCpuHasSSSE3)) {
4163
+ ARGBToUVRow = ARGBToUVRow_Any_SSSE3;
4164
+ if (IS_ALIGNED(width, 16)) {
4165
+ ARGBToUVRow = ARGBToUVRow_SSSE3;
4166
+ }
4167
+ }
4168
+ #endif
4169
+ #if defined(HAS_ARGBTOYROW_AVX2)
4170
+ if (TestCpuFlag(kCpuHasAVX2)) {
4171
+ ARGBToYRow = ARGBToYRow_Any_AVX2;
4172
+ if (IS_ALIGNED(width, 32)) {
4173
+ ARGBToYRow = ARGBToYRow_AVX2;
4174
+ }
4175
+ }
4176
+ #endif
4177
+ #if defined(HAS_ARGBTOUVROW_AVX2)
4178
+ if (TestCpuFlag(kCpuHasAVX2)) {
4179
+ ARGBToUVRow = ARGBToUVRow_Any_AVX2;
4180
+ if (IS_ALIGNED(width, 32)) {
4181
+ ARGBToUVRow = ARGBToUVRow_AVX2;
4182
+ }
4183
+ }
4184
+ #endif
4185
+ {
4186
+ #if !(defined(HAS_ARGB1555TOYROW_NEON) || defined(HAS_ARGB1555TOYROW_LSX) || \
4187
+ defined(HAS_ARGB1555TOYROW_LASX))
4188
+ // Allocate 2 rows of ARGB.
4189
+ const int row_size = (width * 4 + 31) & ~31;
4190
+ align_buffer_64(row, row_size * 2);
4191
+ if (!row)
4192
+ return 1;
4193
+ #endif
4194
+
4195
+ for (y = 0; y < height - 1; y += 2) {
4196
+ #if (defined(HAS_ARGB1555TOYROW_NEON) || defined(HAS_ARGB1555TOYROW_LSX) || \
4197
+ defined(HAS_ARGB1555TOYROW_LASX))
4198
+ ARGB1555ToUVRow(src_argb1555, src_stride_argb1555, dst_u, dst_v, width);
4199
+ ARGB1555ToYRow(src_argb1555, dst_y, width);
4200
+ ARGB1555ToYRow(src_argb1555 + src_stride_argb1555, dst_y + dst_stride_y,
4201
+ width);
4202
+ #else
4203
+ ARGB1555ToARGBRow(src_argb1555, row, width);
4204
+ ARGB1555ToARGBRow(src_argb1555 + src_stride_argb1555, row + row_size,
4205
+ width);
4206
+ ARGBToUVRow(row, row_size, dst_u, dst_v, width);
4207
+ ARGBToYRow(row, dst_y, width);
4208
+ ARGBToYRow(row + row_size, dst_y + dst_stride_y, width);
4209
+ #endif
4210
+ src_argb1555 += src_stride_argb1555 * 2;
4211
+ dst_y += dst_stride_y * 2;
4212
+ dst_u += dst_stride_u;
4213
+ dst_v += dst_stride_v;
4214
+ }
4215
+ if (height & 1) {
4216
+ #if (defined(HAS_ARGB1555TOYROW_NEON) || defined(HAS_ARGB1555TOYROW_LSX) || \
4217
+ defined(HAS_ARGB1555TOYROW_LASX))
4218
+ ARGB1555ToUVRow(src_argb1555, 0, dst_u, dst_v, width);
4219
+ ARGB1555ToYRow(src_argb1555, dst_y, width);
4220
+ #else
4221
+ ARGB1555ToARGBRow(src_argb1555, row, width);
4222
+ ARGBToUVRow(row, 0, dst_u, dst_v, width);
4223
+ ARGBToYRow(row, dst_y, width);
4224
+ #endif
4225
+ }
4226
+ #if !(defined(HAS_ARGB1555TOYROW_NEON) || defined(HAS_ARGB1555TOYROW_LSX) || \
4227
+ defined(HAS_ARGB1555TOYROW_LASX))
4228
+ free_aligned_buffer_64(row);
4229
+ #endif
4230
+ }
4231
+ return 0;
4232
+ }
4233
+
4234
+ // Convert ARGB4444 to I420.
4235
+ LIBYUV_API
4236
+ int ARGB4444ToI420(const uint8_t* src_argb4444,
4237
+ int src_stride_argb4444,
4238
+ uint8_t* dst_y,
4239
+ int dst_stride_y,
4240
+ uint8_t* dst_u,
4241
+ int dst_stride_u,
4242
+ uint8_t* dst_v,
4243
+ int dst_stride_v,
4244
+ int width,
4245
+ int height) {
4246
+ int y;
4247
+ #if defined(HAS_ARGB4444TOYROW_NEON)
4248
+ void (*ARGB4444ToUVRow)(const uint8_t* src_argb4444, int src_stride_argb4444,
4249
+ uint8_t* dst_u, uint8_t* dst_v, int width) =
4250
+ ARGB4444ToUVRow_C;
4251
+ void (*ARGB4444ToYRow)(const uint8_t* src_argb4444, uint8_t* dst_y,
4252
+ int width) = ARGB4444ToYRow_C;
4253
+ #else
4254
+ void (*ARGB4444ToARGBRow)(const uint8_t* src_rgb, uint8_t* dst_argb,
4255
+ int width) = ARGB4444ToARGBRow_C;
4256
+ void (*ARGBToUVRow)(const uint8_t* src_argb0, int src_stride_argb,
4257
+ uint8_t* dst_u, uint8_t* dst_v, int width) =
4258
+ ARGBToUVRow_C;
4259
+ void (*ARGBToYRow)(const uint8_t* src_argb, uint8_t* dst_y, int width) =
4260
+ ARGBToYRow_C;
4261
+ #endif
4262
+ if (!src_argb4444 || !dst_y || !dst_u || !dst_v || width <= 0 ||
4263
+ height == 0) {
4264
+ return -1;
4265
+ }
4266
+ // Negative height means invert the image.
4267
+ if (height < 0) {
4268
+ height = -height;
4269
+ src_argb4444 = src_argb4444 + (height - 1) * src_stride_argb4444;
4270
+ src_stride_argb4444 = -src_stride_argb4444;
4271
+ }
4272
+
4273
+ // Neon version does direct ARGB4444 to YUV.
4274
+ #if defined(HAS_ARGB4444TOYROW_NEON)
4275
+ if (TestCpuFlag(kCpuHasNEON)) {
4276
+ ARGB4444ToYRow = ARGB4444ToYRow_Any_NEON;
4277
+ if (IS_ALIGNED(width, 8)) {
4278
+ ARGB4444ToYRow = ARGB4444ToYRow_NEON;
4279
+ }
4280
+ }
4281
+ #endif
4282
+ #if defined(HAS_ARGB4444TOUVROW_NEON)
4283
+ if (TestCpuFlag(kCpuHasNEON)) {
4284
+ ARGB4444ToUVRow = ARGB4444ToUVRow_Any_NEON;
4285
+ if (IS_ALIGNED(width, 16)) {
4286
+ ARGB4444ToUVRow = ARGB4444ToUVRow_NEON;
4287
+ }
4288
+ }
4289
+ #endif
4290
+ #if defined(HAS_ARGB4444TOARGBROW_SSE2)
4291
+ if (TestCpuFlag(kCpuHasSSE2)) {
4292
+ ARGB4444ToARGBRow = ARGB4444ToARGBRow_Any_SSE2;
4293
+ if (IS_ALIGNED(width, 8)) {
4294
+ ARGB4444ToARGBRow = ARGB4444ToARGBRow_SSE2;
4295
+ }
4296
+ }
4297
+ #endif
4298
+ #if defined(HAS_ARGB4444TOARGBROW_AVX2)
4299
+ if (TestCpuFlag(kCpuHasAVX2)) {
4300
+ ARGB4444ToARGBRow = ARGB4444ToARGBRow_Any_AVX2;
4301
+ if (IS_ALIGNED(width, 16)) {
4302
+ ARGB4444ToARGBRow = ARGB4444ToARGBRow_AVX2;
4303
+ }
4304
+ }
4305
+ #endif
4306
+ #if defined(HAS_ARGB4444TOARGBROW_LSX)
4307
+ if (TestCpuFlag(kCpuHasLSX)) {
4308
+ ARGB4444ToARGBRow = ARGB4444ToARGBRow_Any_LSX;
4309
+ if (IS_ALIGNED(width, 16)) {
4310
+ ARGB4444ToARGBRow = ARGB4444ToARGBRow_LSX;
4311
+ }
4312
+ }
4313
+ #endif
4314
+ #if defined(HAS_ARGB4444TOARGBROW_LASX)
4315
+ if (TestCpuFlag(kCpuHasLASX)) {
4316
+ ARGB4444ToARGBRow = ARGB4444ToARGBRow_Any_LASX;
4317
+ if (IS_ALIGNED(width, 32)) {
4318
+ ARGB4444ToARGBRow = ARGB4444ToARGBRow_LASX;
4319
+ }
4320
+ }
4321
+ #endif
4322
+ #if defined(HAS_ARGBTOYROW_SSSE3)
4323
+ if (TestCpuFlag(kCpuHasSSSE3)) {
4324
+ ARGBToYRow = ARGBToYRow_Any_SSSE3;
4325
+ if (IS_ALIGNED(width, 16)) {
4326
+ ARGBToYRow = ARGBToYRow_SSSE3;
4327
+ }
4328
+ }
4329
+ #endif
4330
+ #if defined(HAS_ARGBTOUVROW_SSSE3)
4331
+ if (TestCpuFlag(kCpuHasSSSE3)) {
4332
+ ARGBToUVRow = ARGBToUVRow_Any_SSSE3;
4333
+ if (IS_ALIGNED(width, 16)) {
4334
+ ARGBToUVRow = ARGBToUVRow_SSSE3;
4335
+ }
4336
+ }
4337
+ #endif
4338
+ #if defined(HAS_ARGBTOYROW_AVX2)
4339
+ if (TestCpuFlag(kCpuHasAVX2)) {
4340
+ ARGBToYRow = ARGBToYRow_Any_AVX2;
4341
+ if (IS_ALIGNED(width, 32)) {
4342
+ ARGBToYRow = ARGBToYRow_AVX2;
4343
+ }
4344
+ }
4345
+ #endif
4346
+ #if defined(HAS_ARGBTOUVROW_AVX2)
4347
+ if (TestCpuFlag(kCpuHasAVX2)) {
4348
+ ARGBToUVRow = ARGBToUVRow_Any_AVX2;
4349
+ if (IS_ALIGNED(width, 32)) {
4350
+ ARGBToUVRow = ARGBToUVRow_AVX2;
4351
+ }
4352
+ }
4353
+ #endif
4354
+ #if defined(HAS_ARGBTOYROW_LSX)
4355
+ if (TestCpuFlag(kCpuHasLSX)) {
4356
+ ARGBToYRow = ARGBToYRow_Any_LSX;
4357
+ if (IS_ALIGNED(width, 16)) {
4358
+ ARGBToYRow = ARGBToYRow_LSX;
4359
+ }
4360
+ }
4361
+ #endif
4362
+ #if defined(HAS_ARGBTOYROW_LSX) && defined(HAS_ARGBTOUVROW_LSX)
4363
+ if (TestCpuFlag(kCpuHasLSX)) {
4364
+ ARGBToYRow = ARGBToYRow_Any_LSX;
4365
+ ARGBToUVRow = ARGBToUVRow_Any_LSX;
4366
+ if (IS_ALIGNED(width, 16)) {
4367
+ ARGBToYRow = ARGBToYRow_LSX;
4368
+ ARGBToUVRow = ARGBToUVRow_LSX;
4369
+ }
4370
+ }
4371
+ #endif
4372
+ #if defined(HAS_ARGBTOYROW_LASX) && defined(HAS_ARGBTOUVROW_LASX)
4373
+ if (TestCpuFlag(kCpuHasLASX)) {
4374
+ ARGBToYRow = ARGBToYRow_Any_LASX;
4375
+ ARGBToUVRow = ARGBToUVRow_Any_LASX;
4376
+ if (IS_ALIGNED(width, 32)) {
4377
+ ARGBToYRow = ARGBToYRow_LASX;
4378
+ ARGBToUVRow = ARGBToUVRow_LASX;
4379
+ }
4380
+ }
4381
+ #endif
4382
+
4383
+ {
4384
+ #if !(defined(HAS_ARGB4444TOYROW_NEON))
4385
+ // Allocate 2 rows of ARGB.
4386
+ const int row_size = (width * 4 + 31) & ~31;
4387
+ align_buffer_64(row, row_size * 2);
4388
+ if (!row)
4389
+ return 1;
4390
+ #endif
4391
+
4392
+ for (y = 0; y < height - 1; y += 2) {
4393
+ #if defined(HAS_ARGB4444TOYROW_NEON)
4394
+ ARGB4444ToUVRow(src_argb4444, src_stride_argb4444, dst_u, dst_v, width);
4395
+ ARGB4444ToYRow(src_argb4444, dst_y, width);
4396
+ ARGB4444ToYRow(src_argb4444 + src_stride_argb4444, dst_y + dst_stride_y,
4397
+ width);
4398
+ #else
4399
+ ARGB4444ToARGBRow(src_argb4444, row, width);
4400
+ ARGB4444ToARGBRow(src_argb4444 + src_stride_argb4444, row + row_size,
4401
+ width);
4402
+ ARGBToUVRow(row, row_size, dst_u, dst_v, width);
4403
+ ARGBToYRow(row, dst_y, width);
4404
+ ARGBToYRow(row + row_size, dst_y + dst_stride_y, width);
4405
+ #endif
4406
+ src_argb4444 += src_stride_argb4444 * 2;
4407
+ dst_y += dst_stride_y * 2;
4408
+ dst_u += dst_stride_u;
4409
+ dst_v += dst_stride_v;
4410
+ }
4411
+ if (height & 1) {
4412
+ #if defined(HAS_ARGB4444TOYROW_NEON)
4413
+ ARGB4444ToUVRow(src_argb4444, 0, dst_u, dst_v, width);
4414
+ ARGB4444ToYRow(src_argb4444, dst_y, width);
4415
+ #else
4416
+ ARGB4444ToARGBRow(src_argb4444, row, width);
4417
+ ARGBToUVRow(row, 0, dst_u, dst_v, width);
4418
+ ARGBToYRow(row, dst_y, width);
4419
+ #endif
4420
+ }
4421
+ #if !(defined(HAS_ARGB4444TOYROW_NEON))
4422
+ free_aligned_buffer_64(row);
4423
+ #endif
4424
+ }
4425
+ return 0;
4426
+ }
4427
+
4428
+ // Convert RGB24 to J400.
4429
+ LIBYUV_API
4430
+ int RGB24ToJ400(const uint8_t* src_rgb24,
4431
+ int src_stride_rgb24,
4432
+ uint8_t* dst_yj,
4433
+ int dst_stride_yj,
4434
+ int width,
4435
+ int height) {
4436
+ int y;
4437
+ void (*RGB24ToYJRow)(const uint8_t* src_rgb24, uint8_t* dst_yj, int width) =
4438
+ RGB24ToYJRow_C;
4439
+ if (!src_rgb24 || !dst_yj || width <= 0 || height == 0) {
4440
+ return -1;
4441
+ }
4442
+ if (height < 0) {
4443
+ height = -height;
4444
+ src_rgb24 = src_rgb24 + (height - 1) * src_stride_rgb24;
4445
+ src_stride_rgb24 = -src_stride_rgb24;
4446
+ }
4447
+ // Coalesce rows.
4448
+ if (src_stride_rgb24 == width * 3 && dst_stride_yj == width) {
4449
+ width *= height;
4450
+ height = 1;
4451
+ src_stride_rgb24 = dst_stride_yj = 0;
4452
+ }
4453
+ #if defined(HAS_RGB24TOYJROW_SSSE3)
4454
+ if (TestCpuFlag(kCpuHasSSSE3)) {
4455
+ RGB24ToYJRow = RGB24ToYJRow_Any_SSSE3;
4456
+ if (IS_ALIGNED(width, 16)) {
4457
+ RGB24ToYJRow = RGB24ToYJRow_SSSE3;
4458
+ }
4459
+ }
4460
+ #endif
4461
+ #if defined(HAS_RGB24TOYJROW_AVX2)
4462
+ if (TestCpuFlag(kCpuHasAVX2)) {
4463
+ RGB24ToYJRow = RGB24ToYJRow_Any_AVX2;
4464
+ if (IS_ALIGNED(width, 32)) {
4465
+ RGB24ToYJRow = RGB24ToYJRow_AVX2;
4466
+ }
4467
+ }
4468
+ #endif
4469
+ #if defined(HAS_RGB24TOYJROW_NEON)
4470
+ if (TestCpuFlag(kCpuHasNEON)) {
4471
+ RGB24ToYJRow = RGB24ToYJRow_Any_NEON;
4472
+ if (IS_ALIGNED(width, 16)) {
4473
+ RGB24ToYJRow = RGB24ToYJRow_NEON;
4474
+ }
4475
+ }
4476
+ #endif
4477
+ #if defined(HAS_RGB24TOYJROW_LSX)
4478
+ if (TestCpuFlag(kCpuHasLSX)) {
4479
+ RGB24ToYJRow = RGB24ToYJRow_Any_LSX;
4480
+ if (IS_ALIGNED(width, 16)) {
4481
+ RGB24ToYJRow = RGB24ToYJRow_LSX;
4482
+ }
4483
+ }
4484
+ #endif
4485
+ #if defined(HAS_RGB24TOYJROW_LASX)
4486
+ if (TestCpuFlag(kCpuHasLASX)) {
4487
+ RGB24ToYJRow = RGB24ToYJRow_Any_LASX;
4488
+ if (IS_ALIGNED(width, 32)) {
4489
+ RGB24ToYJRow = RGB24ToYJRow_LASX;
4490
+ }
4491
+ }
4492
+ #endif
4493
+ #if defined(HAS_RGB24TOYJROW_RVV)
4494
+ if (TestCpuFlag(kCpuHasRVV)) {
4495
+ RGB24ToYJRow = RGB24ToYJRow_RVV;
4496
+ }
4497
+ #endif
4498
+
4499
+ for (y = 0; y < height; ++y) {
4500
+ RGB24ToYJRow(src_rgb24, dst_yj, width);
4501
+ src_rgb24 += src_stride_rgb24;
4502
+ dst_yj += dst_stride_yj;
4503
+ }
4504
+ return 0;
4505
+ }
4506
+
4507
+ // Convert RAW to J400.
4508
+ LIBYUV_API
4509
+ int RAWToJ400(const uint8_t* src_raw,
4510
+ int src_stride_raw,
4511
+ uint8_t* dst_yj,
4512
+ int dst_stride_yj,
4513
+ int width,
4514
+ int height) {
4515
+ int y;
4516
+ void (*RAWToYJRow)(const uint8_t* src_raw, uint8_t* dst_yj, int width) =
4517
+ RAWToYJRow_C;
4518
+ if (!src_raw || !dst_yj || width <= 0 || height == 0) {
4519
+ return -1;
4520
+ }
4521
+
4522
+ if (height < 0) {
4523
+ height = -height;
4524
+ src_raw = src_raw + (height - 1) * src_stride_raw;
4525
+ src_stride_raw = -src_stride_raw;
4526
+ }
4527
+ // Coalesce rows.
4528
+ if (src_stride_raw == width * 3 && dst_stride_yj == width) {
4529
+ width *= height;
4530
+ height = 1;
4531
+ src_stride_raw = dst_stride_yj = 0;
4532
+ }
4533
+
4534
+ #if defined(HAS_RAWTOYJROW_SSSE3)
4535
+ if (TestCpuFlag(kCpuHasSSSE3)) {
4536
+ RAWToYJRow = RAWToYJRow_Any_SSSE3;
4537
+ if (IS_ALIGNED(width, 16)) {
4538
+ RAWToYJRow = RAWToYJRow_SSSE3;
4539
+ }
4540
+ }
4541
+ #endif
4542
+ #if defined(HAS_RAWTOYJROW_AVX2)
4543
+ if (TestCpuFlag(kCpuHasAVX2)) {
4544
+ RAWToYJRow = RAWToYJRow_Any_AVX2;
4545
+ if (IS_ALIGNED(width, 32)) {
4546
+ RAWToYJRow = RAWToYJRow_AVX2;
4547
+ }
4548
+ }
4549
+ #endif
4550
+ #if defined(HAS_RAWTOYJROW_NEON)
4551
+ if (TestCpuFlag(kCpuHasNEON)) {
4552
+ RAWToYJRow = RAWToYJRow_Any_NEON;
4553
+ if (IS_ALIGNED(width, 16)) {
4554
+ RAWToYJRow = RAWToYJRow_NEON;
4555
+ }
4556
+ }
4557
+ #endif
4558
+ #if defined(HAS_RAWTOYJROW_LSX)
4559
+ if (TestCpuFlag(kCpuHasLSX)) {
4560
+ RAWToYJRow = RAWToYJRow_Any_LSX;
4561
+ if (IS_ALIGNED(width, 16)) {
4562
+ RAWToYJRow = RAWToYJRow_LSX;
4563
+ }
4564
+ }
4565
+ #endif
4566
+ #if defined(HAS_RAWTOYJROW_LASX)
4567
+ if (TestCpuFlag(kCpuHasLASX)) {
4568
+ RAWToYJRow = RAWToYJRow_Any_LASX;
4569
+ if (IS_ALIGNED(width, 32)) {
4570
+ RAWToYJRow = RAWToYJRow_LASX;
4571
+ }
4572
+ }
4573
+ #endif
4574
+ #if defined(HAS_RAWTOYJROW_RVV)
4575
+ if (TestCpuFlag(kCpuHasRVV)) {
4576
+ RAWToYJRow = RAWToYJRow_RVV;
4577
+ }
4578
+ #endif
4579
+
4580
+ for (y = 0; y < height; ++y) {
4581
+ RAWToYJRow(src_raw, dst_yj, width);
4582
+ src_raw += src_stride_raw;
4583
+ dst_yj += dst_stride_yj;
4584
+ }
4585
+ return 0;
4586
+ }
4587
+
4588
+ // Convert Android420 to I420.
4589
+ LIBYUV_API
4590
+ int Android420ToI420(const uint8_t* src_y,
4591
+ int src_stride_y,
4592
+ const uint8_t* src_u,
4593
+ int src_stride_u,
4594
+ const uint8_t* src_v,
4595
+ int src_stride_v,
4596
+ int src_pixel_stride_uv,
4597
+ uint8_t* dst_y,
4598
+ int dst_stride_y,
4599
+ uint8_t* dst_u,
4600
+ int dst_stride_u,
4601
+ uint8_t* dst_v,
4602
+ int dst_stride_v,
4603
+ int width,
4604
+ int height) {
4605
+ return Android420ToI420Rotate(src_y, src_stride_y, src_u, src_stride_u, src_v,
4606
+ src_stride_v, src_pixel_stride_uv, dst_y,
4607
+ dst_stride_y, dst_u, dst_stride_u, dst_v,
4608
+ dst_stride_v, width, height, kRotate0);
4609
+ }
4610
+
4611
+ // depth is source bits measured from lsb; For msb use 16
4612
+ static int Biplanar16bitTo8bit(const uint16_t* src_y,
4613
+ int src_stride_y,
4614
+ const uint16_t* src_uv,
4615
+ int src_stride_uv,
4616
+ uint8_t* dst_y,
4617
+ int dst_stride_y,
4618
+ uint8_t* dst_uv,
4619
+ int dst_stride_uv,
4620
+ int width,
4621
+ int height,
4622
+ int subsample_x,
4623
+ int subsample_y,
4624
+ int depth) {
4625
+ int uv_width = SUBSAMPLE(width, subsample_x, subsample_x);
4626
+ int uv_height = SUBSAMPLE(height, subsample_y, subsample_y);
4627
+ int scale = 1 << (24 - depth);
4628
+ if ((!src_y && dst_y) || !src_uv || !dst_uv || width <= 0 || height == 0) {
4629
+ return -1;
4630
+ }
4631
+ // Negative height means invert the image.
4632
+ if (height < 0) {
4633
+ height = -height;
4634
+ uv_height = -uv_height;
4635
+ src_y = src_y + (height - 1) * src_stride_y;
4636
+ src_uv = src_uv + (uv_height - 1) * src_stride_uv;
4637
+ src_stride_y = -src_stride_y;
4638
+ src_stride_uv = -src_stride_uv;
4639
+ }
4640
+
4641
+ // Convert Y plane.
4642
+ if (dst_y) {
4643
+ Convert16To8Plane(src_y, src_stride_y, dst_y, dst_stride_y, scale, width,
4644
+ height);
4645
+ }
4646
+ // Convert UV planes.
4647
+ Convert16To8Plane(src_uv, src_stride_uv, dst_uv, dst_stride_uv, scale,
4648
+ uv_width * 2, uv_height);
4649
+ return 0;
4650
+ }
4651
+
4652
+ // Convert 10 bit P010 to 8 bit NV12.
4653
+ // Depth set to 16 because P010 uses 10 msb and this function keeps the upper 8
4654
+ // bits of the specified number of bits.
4655
+ LIBYUV_API
4656
+ int P010ToNV12(const uint16_t* src_y,
4657
+ int src_stride_y,
4658
+ const uint16_t* src_uv,
4659
+ int src_stride_uv,
4660
+ uint8_t* dst_y,
4661
+ int dst_stride_y,
4662
+ uint8_t* dst_uv,
4663
+ int dst_stride_uv,
4664
+ int width,
4665
+ int height) {
4666
+ return Biplanar16bitTo8bit(src_y, src_stride_y, src_uv, src_stride_uv, dst_y,
4667
+ dst_stride_y, dst_uv, dst_stride_uv, width, height,
4668
+ 1, 1, 16);
4669
+ }
4670
+
4671
+ static int Planar8bitTo8bit(const uint8_t* src_y,
4672
+ int src_stride_y,
4673
+ const uint8_t* src_u,
4674
+ int src_stride_u,
4675
+ const uint8_t* src_v,
4676
+ int src_stride_v,
4677
+ uint8_t* dst_y,
4678
+ int dst_stride_y,
4679
+ uint8_t* dst_u,
4680
+ int dst_stride_u,
4681
+ uint8_t* dst_v,
4682
+ int dst_stride_v,
4683
+ int width,
4684
+ int height,
4685
+ int subsample_x,
4686
+ int subsample_y,
4687
+ int scale_y,
4688
+ int bias_y,
4689
+ int scale_uv,
4690
+ int bias_uv) {
4691
+ int uv_width = SUBSAMPLE(width, subsample_x, subsample_x);
4692
+ int uv_height = SUBSAMPLE(height, subsample_y, subsample_y);
4693
+ if ((!src_y && dst_y) || !src_u || !src_v || !dst_u || !dst_v || width <= 0 ||
4694
+ height == 0) {
4695
+ return -1;
4696
+ }
4697
+ // Negative height means invert the image.
4698
+ if (height < 0) {
4699
+ height = -height;
4700
+ uv_height = -uv_height;
4701
+ src_y = src_y + (height - 1) * src_stride_y;
4702
+ src_u = src_u + (uv_height - 1) * src_stride_u;
4703
+ src_v = src_v + (uv_height - 1) * src_stride_v;
4704
+ src_stride_y = -src_stride_y;
4705
+ src_stride_u = -src_stride_u;
4706
+ src_stride_v = -src_stride_v;
4707
+ }
4708
+
4709
+ // Convert Y plane.
4710
+ if (dst_y) {
4711
+ Convert8To8Plane(src_y, src_stride_y, dst_y, dst_stride_y, scale_y, bias_y,
4712
+ width, height);
4713
+ }
4714
+ // Convert UV planes.
4715
+ Convert8To8Plane(src_u, src_stride_u, dst_u, dst_stride_u, scale_uv, bias_uv,
4716
+ uv_width, uv_height);
4717
+ Convert8To8Plane(src_v, src_stride_v, dst_v, dst_stride_v, scale_uv, bias_uv,
4718
+ uv_width, uv_height);
4719
+ return 0;
4720
+ }
4721
+
4722
+ LIBYUV_API
4723
+ int J420ToI420(const uint8_t* src_y,
4724
+ int src_stride_y,
4725
+ const uint8_t* src_u,
4726
+ int src_stride_u,
4727
+ const uint8_t* src_v,
4728
+ int src_stride_v,
4729
+ uint8_t* dst_y,
4730
+ int dst_stride_y,
4731
+ uint8_t* dst_u,
4732
+ int dst_stride_u,
4733
+ uint8_t* dst_v,
4734
+ int dst_stride_v,
4735
+ int width,
4736
+ int height) {
4737
+ return Planar8bitTo8bit(src_y, src_stride_y, src_u, src_stride_u, src_v,
4738
+ src_stride_v, dst_y, dst_stride_y, dst_u,
4739
+ dst_stride_u, dst_v, dst_stride_v, width, height, 1,
4740
+ 1, 220, 16, 225, 16);
4741
+ }
4742
+
4743
+ #ifdef __cplusplus
4744
+ } // extern "C"
4745
+ } // namespace libyuv
4746
+ #endif