react-native-vision-camera-spoof-detector 1.0.21 → 1.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitattributes +2 -0
- package/.gitignore +27 -0
- package/CHANGELOG.md +2 -2
- package/CONTRIBUTING.md +2 -2
- package/README.md +442 -443
- package/android/build.gradle +12 -4
- package/android/src/main/cpp/CMakeLists.txt +101 -94
- package/android/src/main/cpp/libyuv/.clang-format +6 -6
- package/android/src/main/cpp/libyuv/.gn +40 -40
- package/android/src/main/cpp/libyuv/.vpython3 +410 -410
- package/android/src/main/cpp/libyuv/AUTHORS +7 -7
- package/android/src/main/cpp/libyuv/Android.bp +202 -202
- package/android/src/main/cpp/libyuv/Android.mk +106 -106
- package/android/src/main/cpp/libyuv/BUILD.gn +490 -490
- package/android/src/main/cpp/libyuv/CM_linux_packages.cmake +70 -70
- package/android/src/main/cpp/libyuv/CMakeLists.txt +259 -252
- package/android/src/main/cpp/libyuv/DEPS +935 -935
- package/android/src/main/cpp/libyuv/DIR_METADATA +3 -3
- package/android/src/main/cpp/libyuv/LICENSE +29 -29
- package/android/src/main/cpp/libyuv/OWNERS +11 -11
- package/android/src/main/cpp/libyuv/PATENTS +23 -23
- package/android/src/main/cpp/libyuv/PRESUBMIT.py +65 -65
- package/android/src/main/cpp/libyuv/README.chromium +11 -11
- package/android/src/main/cpp/libyuv/README.md +19 -19
- package/android/src/main/cpp/libyuv/build_overrides/build.gni +60 -60
- package/android/src/main/cpp/libyuv/build_overrides/gtest.gni +19 -19
- package/android/src/main/cpp/libyuv/build_overrides/partition_alloc.gni +17 -17
- package/android/src/main/cpp/libyuv/codereview.settings +5 -5
- package/android/src/main/cpp/libyuv/docs/deprecated_builds.md +409 -409
- package/android/src/main/cpp/libyuv/docs/environment_variables.md +64 -64
- package/android/src/main/cpp/libyuv/docs/feature_detection.md +108 -108
- package/android/src/main/cpp/libyuv/docs/filtering.md +196 -196
- package/android/src/main/cpp/libyuv/docs/formats.md +208 -208
- package/android/src/main/cpp/libyuv/docs/getting_started.md +296 -296
- package/android/src/main/cpp/libyuv/docs/rotation.md +107 -107
- package/android/src/main/cpp/libyuv/download_vs_toolchain.py +29 -29
- package/android/src/main/cpp/libyuv/include/libyuv/basic_types.h +68 -68
- package/android/src/main/cpp/libyuv/include/libyuv/compare.h +111 -111
- package/android/src/main/cpp/libyuv/include/libyuv/compare_row.h +112 -112
- package/android/src/main/cpp/libyuv/include/libyuv/convert.h +1117 -1117
- package/android/src/main/cpp/libyuv/include/libyuv/convert_argb.h +2335 -2335
- package/android/src/main/cpp/libyuv/include/libyuv/convert_from.h +203 -203
- package/android/src/main/cpp/libyuv/include/libyuv/convert_from_argb.h +394 -394
- package/android/src/main/cpp/libyuv/include/libyuv/cpu_id.h +147 -147
- package/android/src/main/cpp/libyuv/include/libyuv/cpu_support.h +99 -99
- package/android/src/main/cpp/libyuv/include/libyuv/loongson_intrinsics.h +1949 -1949
- package/android/src/main/cpp/libyuv/include/libyuv/mjpeg_decoder.h +195 -195
- package/android/src/main/cpp/libyuv/include/libyuv/planar_functions.h +1131 -1131
- package/android/src/main/cpp/libyuv/include/libyuv/rotate.h +296 -296
- package/android/src/main/cpp/libyuv/include/libyuv/rotate_argb.h +37 -37
- package/android/src/main/cpp/libyuv/include/libyuv/rotate_row.h +265 -265
- package/android/src/main/cpp/libyuv/include/libyuv/row.h +6738 -6738
- package/android/src/main/cpp/libyuv/include/libyuv/row_sve.h +2154 -2154
- package/android/src/main/cpp/libyuv/include/libyuv/scale.h +336 -336
- package/android/src/main/cpp/libyuv/include/libyuv/scale_argb.h +76 -76
- package/android/src/main/cpp/libyuv/include/libyuv/scale_rgb.h +42 -42
- package/android/src/main/cpp/libyuv/include/libyuv/scale_row.h +1726 -1726
- package/android/src/main/cpp/libyuv/include/libyuv/scale_uv.h +51 -51
- package/android/src/main/cpp/libyuv/include/libyuv/version.h +16 -16
- package/android/src/main/cpp/libyuv/include/libyuv/video_common.h +222 -222
- package/android/src/main/cpp/libyuv/include/libyuv.h +33 -33
- package/android/src/main/cpp/libyuv/infra/config/OWNERS +3 -3
- package/android/src/main/cpp/libyuv/infra/config/PRESUBMIT.py +17 -17
- package/android/src/main/cpp/libyuv/infra/config/README.md +2 -2
- package/android/src/main/cpp/libyuv/infra/config/codereview.settings +6 -6
- package/android/src/main/cpp/libyuv/infra/config/commit-queue.cfg +144 -144
- package/android/src/main/cpp/libyuv/infra/config/cr-buildbucket.cfg +1185 -1185
- package/android/src/main/cpp/libyuv/infra/config/luci-logdog.cfg +9 -9
- package/android/src/main/cpp/libyuv/infra/config/luci-milo.cfg +246 -246
- package/android/src/main/cpp/libyuv/infra/config/luci-scheduler.cfg +385 -385
- package/android/src/main/cpp/libyuv/infra/config/main.star +402 -402
- package/android/src/main/cpp/libyuv/infra/config/project.cfg +16 -16
- package/android/src/main/cpp/libyuv/infra/config/realms.cfg +111 -111
- package/android/src/main/cpp/libyuv/libyuv.gni +34 -34
- package/android/src/main/cpp/libyuv/libyuv.gyp +149 -149
- package/android/src/main/cpp/libyuv/libyuv.gypi +87 -87
- package/android/src/main/cpp/libyuv/linux.mk +96 -96
- package/android/src/main/cpp/libyuv/public.mk +13 -13
- package/android/src/main/cpp/libyuv/pylintrc +49 -49
- package/android/src/main/cpp/libyuv/riscv_script/prepare_toolchain_qemu.sh +74 -74
- package/android/src/main/cpp/libyuv/riscv_script/riscv-clang.cmake +56 -56
- package/android/src/main/cpp/libyuv/riscv_script/run_qemu.sh +15 -15
- package/android/src/main/cpp/libyuv/source/compare.cc +435 -435
- package/android/src/main/cpp/libyuv/source/compare_common.cc +74 -74
- package/android/src/main/cpp/libyuv/source/compare_gcc.cc +362 -362
- package/android/src/main/cpp/libyuv/source/compare_neon.cc +96 -96
- package/android/src/main/cpp/libyuv/source/compare_neon64.cc +223 -223
- package/android/src/main/cpp/libyuv/source/compare_win.cc +241 -241
- package/android/src/main/cpp/libyuv/source/convert.cc +4746 -4746
- package/android/src/main/cpp/libyuv/source/convert_argb.cc +9179 -9179
- package/android/src/main/cpp/libyuv/source/convert_from.cc +866 -866
- package/android/src/main/cpp/libyuv/source/convert_from_argb.cc +3671 -3671
- package/android/src/main/cpp/libyuv/source/convert_jpeg.cc +602 -602
- package/android/src/main/cpp/libyuv/source/convert_to_argb.cc +391 -391
- package/android/src/main/cpp/libyuv/source/convert_to_i420.cc +288 -288
- package/android/src/main/cpp/libyuv/source/cpu_id.cc +496 -496
- package/android/src/main/cpp/libyuv/source/mjpeg_decoder.cc +580 -580
- package/android/src/main/cpp/libyuv/source/mjpeg_validate.cc +71 -71
- package/android/src/main/cpp/libyuv/source/planar_functions.cc +5663 -5663
- package/android/src/main/cpp/libyuv/source/rotate.cc +1241 -1241
- package/android/src/main/cpp/libyuv/source/rotate_any.cc +76 -76
- package/android/src/main/cpp/libyuv/source/rotate_argb.cc +259 -259
- package/android/src/main/cpp/libyuv/source/rotate_common.cc +208 -208
- package/android/src/main/cpp/libyuv/source/rotate_gcc.cc +505 -505
- package/android/src/main/cpp/libyuv/source/rotate_lsx.cc +233 -233
- package/android/src/main/cpp/libyuv/source/rotate_neon.cc +219 -219
- package/android/src/main/cpp/libyuv/source/rotate_neon64.cc +273 -273
- package/android/src/main/cpp/libyuv/source/rotate_sme.cc +174 -174
- package/android/src/main/cpp/libyuv/source/rotate_win.cc +253 -253
- package/android/src/main/cpp/libyuv/source/row_any.cc +2519 -2519
- package/android/src/main/cpp/libyuv/source/row_common.cc +4461 -4461
- package/android/src/main/cpp/libyuv/source/row_gcc.cc +9570 -9570
- package/android/src/main/cpp/libyuv/source/row_lasx.cc +2343 -2343
- package/android/src/main/cpp/libyuv/source/row_lsx.cc +3030 -3030
- package/android/src/main/cpp/libyuv/source/row_neon.cc +4026 -4026
- package/android/src/main/cpp/libyuv/source/row_neon64.cc +5617 -5617
- package/android/src/main/cpp/libyuv/source/row_rvv.cc +2599 -2599
- package/android/src/main/cpp/libyuv/source/row_sme.cc +1183 -1183
- package/android/src/main/cpp/libyuv/source/row_sve.cc +1088 -1088
- package/android/src/main/cpp/libyuv/source/row_win.cc +6453 -6453
- package/android/src/main/cpp/libyuv/source/scale.cc +2710 -2710
- package/android/src/main/cpp/libyuv/source/scale_any.cc +991 -991
- package/android/src/main/cpp/libyuv/source/scale_argb.cc +1158 -1158
- package/android/src/main/cpp/libyuv/source/scale_common.cc +1977 -1977
- package/android/src/main/cpp/libyuv/source/scale_gcc.cc +2947 -2947
- package/android/src/main/cpp/libyuv/source/scale_lsx.cc +739 -739
- package/android/src/main/cpp/libyuv/source/scale_neon.cc +1449 -1449
- package/android/src/main/cpp/libyuv/source/scale_neon64.cc +1552 -1552
- package/android/src/main/cpp/libyuv/source/scale_rgb.cc +82 -82
- package/android/src/main/cpp/libyuv/source/scale_rvv.cc +1971 -1971
- package/android/src/main/cpp/libyuv/source/scale_sme.cc +555 -555
- package/android/src/main/cpp/libyuv/source/scale_uv.cc +1159 -1159
- package/android/src/main/cpp/libyuv/source/scale_win.cc +1392 -1392
- package/android/src/main/cpp/libyuv/source/test.sh +35 -35
- package/android/src/main/cpp/libyuv/source/video_common.cc +62 -62
- package/android/src/main/cpp/libyuv/tools_libyuv/OWNERS +4 -4
- package/android/src/main/cpp/libyuv/tools_libyuv/autoroller/roll_deps.py +931 -931
- package/android/src/main/cpp/libyuv/tools_libyuv/autoroller/unittests/roll_deps_test.py +164 -164
- package/android/src/main/cpp/libyuv/tools_libyuv/autoroller/unittests/testdata/DEPS +21 -21
- package/android/src/main/cpp/libyuv/tools_libyuv/autoroller/unittests/testdata/DEPS.chromium.new +13 -13
- package/android/src/main/cpp/libyuv/tools_libyuv/autoroller/unittests/testdata/DEPS.chromium.old +13 -13
- package/android/src/main/cpp/libyuv/tools_libyuv/get_landmines.py +38 -38
- package/android/src/main/cpp/libyuv/tools_libyuv/msan/OWNERS +3 -3
- package/android/src/main/cpp/libyuv/tools_libyuv/msan/blacklist.txt +9 -9
- package/android/src/main/cpp/libyuv/tools_libyuv/ubsan/OWNERS +3 -3
- package/android/src/main/cpp/libyuv/tools_libyuv/ubsan/blacklist.txt +15 -15
- package/android/src/main/cpp/libyuv/tools_libyuv/ubsan/vptr_blacklist.txt +25 -25
- package/android/src/main/cpp/libyuv/unit_test/basictypes_test.cc +43 -43
- package/android/src/main/cpp/libyuv/unit_test/color_test.cc +848 -848
- package/android/src/main/cpp/libyuv/unit_test/compare_test.cc +739 -739
- package/android/src/main/cpp/libyuv/unit_test/convert_argb_test.cc +2867 -2867
- package/android/src/main/cpp/libyuv/unit_test/convert_test.cc +2133 -2133
- package/android/src/main/cpp/libyuv/unit_test/cpu_test.cc +427 -427
- package/android/src/main/cpp/libyuv/unit_test/cpu_thread_test.cc +63 -63
- package/android/src/main/cpp/libyuv/unit_test/math_test.cc +160 -160
- package/android/src/main/cpp/libyuv/unit_test/planar_test.cc +4731 -4731
- package/android/src/main/cpp/libyuv/unit_test/rotate_argb_test.cc +334 -334
- package/android/src/main/cpp/libyuv/unit_test/rotate_test.cc +962 -962
- package/android/src/main/cpp/libyuv/unit_test/scale_argb_test.cc +590 -590
- package/android/src/main/cpp/libyuv/unit_test/scale_plane_test.cc +465 -465
- package/android/src/main/cpp/libyuv/unit_test/scale_rgb_test.cc +280 -280
- package/android/src/main/cpp/libyuv/unit_test/scale_test.cc +1135 -1135
- package/android/src/main/cpp/libyuv/unit_test/scale_uv_test.cc +249 -249
- package/android/src/main/cpp/libyuv/unit_test/testdata/arm_v7.txt +12 -12
- package/android/src/main/cpp/libyuv/unit_test/testdata/mips.txt +7 -7
- package/android/src/main/cpp/libyuv/unit_test/testdata/mips_loongson2k.txt +5 -5
- package/android/src/main/cpp/libyuv/unit_test/testdata/mips_loongson3.txt +10 -10
- package/android/src/main/cpp/libyuv/unit_test/testdata/mips_loongson_mmi.txt +7 -7
- package/android/src/main/cpp/libyuv/unit_test/testdata/riscv64.txt +3 -3
- package/android/src/main/cpp/libyuv/unit_test/testdata/riscv64_rvv.txt +3 -3
- package/android/src/main/cpp/libyuv/unit_test/testdata/riscv64_rvv_zvfh.txt +3 -3
- package/android/src/main/cpp/libyuv/unit_test/testdata/tegra3.txt +23 -23
- package/android/src/main/cpp/libyuv/unit_test/unit_test.cc +581 -581
- package/android/src/main/cpp/libyuv/unit_test/unit_test.h +232 -232
- package/android/src/main/cpp/libyuv/unit_test/video_common_test.cc +112 -112
- package/android/src/main/cpp/libyuv/util/Makefile +9 -9
- package/android/src/main/cpp/libyuv/util/color.cc +120 -120
- package/android/src/main/cpp/libyuv/util/compare.cc +67 -67
- package/android/src/main/cpp/libyuv/util/cpuid.c +211 -211
- package/android/src/main/cpp/libyuv/util/i444tonv12_eg.cc +27 -27
- package/android/src/main/cpp/libyuv/util/psnr.cc +291 -291
- package/android/src/main/cpp/libyuv/util/psnr.h +47 -47
- package/android/src/main/cpp/libyuv/util/psnr_main.cc +620 -620
- package/android/src/main/cpp/libyuv/util/ssim.cc +364 -364
- package/android/src/main/cpp/libyuv/util/ssim.h +38 -38
- package/android/src/main/cpp/libyuv/util/yuvconstants.c +114 -114
- package/android/src/main/cpp/libyuv/util/yuvconvert.cc +367 -367
- package/android/src/main/cpp/libyuv/winarm.mk +47 -47
- package/package.json +86 -84
- package/android/.gradle/8.9/checksums/checksums.lock +0 -0
- package/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
- package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.9/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
- package/android/.gradle/vcs-1/gc.properties +0 -0
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
# determine the version number from the #define in libyuv/version.h
|
|
2
|
-
EXECUTE_PROCESS (
|
|
3
|
-
COMMAND grep -Eo "LIBYUV_VERSION\ [0-9]+" include/libyuv/version.h
|
|
4
|
-
COMMAND grep -Eo "[0-9]+"
|
|
5
|
-
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
|
6
|
-
OUTPUT_VARIABLE YUV_VERSION_NUMBER
|
|
7
|
-
OUTPUT_STRIP_TRAILING_WHITESPACE )
|
|
8
|
-
SET ( YUV_VER_MAJOR 0 )
|
|
9
|
-
SET ( YUV_VER_MINOR 0 )
|
|
10
|
-
SET ( YUV_VER_PATCH ${YUV_VERSION_NUMBER} )
|
|
11
|
-
SET ( YUV_VERSION ${YUV_VER_MAJOR}.${YUV_VER_MINOR}.${YUV_VER_PATCH} )
|
|
12
|
-
MESSAGE ( VERBOSE "Building ver.: ${YUV_VERSION}" )
|
|
13
|
-
|
|
14
|
-
# is this a 32-bit or 64-bit build?
|
|
15
|
-
IF ( CMAKE_SIZEOF_VOID_P EQUAL 8 )
|
|
16
|
-
SET ( YUV_BIT_SIZE 64 )
|
|
17
|
-
ELSEIF ( CMAKE_SIZEOF_VOID_P EQUAL 4 )
|
|
18
|
-
SET ( YUV_BIT_SIZE 32 )
|
|
19
|
-
ELSE ()
|
|
20
|
-
MESSAGE ( FATAL_ERROR "CMAKE_SIZEOF_VOID_P=${CMAKE_SIZEOF_VOID_P}" )
|
|
21
|
-
ENDIF ()
|
|
22
|
-
|
|
23
|
-
# detect if this is a ARM build
|
|
24
|
-
STRING (FIND "${CMAKE_CXX_COMPILER}" "arm-linux-gnueabihf-g++" pos)
|
|
25
|
-
IF ( ${pos} EQUAL -1 )
|
|
26
|
-
SET ( YUV_CROSS_COMPILE_FOR_ARM7 FALSE )
|
|
27
|
-
ELSE ()
|
|
28
|
-
MESSAGE ( "Cross compiling for ARM7" )
|
|
29
|
-
SET ( YUV_CROSS_COMPILE_FOR_ARM7 TRUE )
|
|
30
|
-
ENDIF ()
|
|
31
|
-
STRING (FIND "${CMAKE_SYSTEM_PROCESSOR}" "arm" pos)
|
|
32
|
-
IF ( ${pos} EQUAL -1 )
|
|
33
|
-
SET ( YUV_COMPILE_FOR_ARM7 FALSE )
|
|
34
|
-
ELSE ()
|
|
35
|
-
MESSAGE ( "Compiling for ARM" )
|
|
36
|
-
SET ( YUV_COMPILE_FOR_ARM7 TRUE )
|
|
37
|
-
ENDIF ()
|
|
38
|
-
|
|
39
|
-
# setup the sytem name, such as "x86-32", "amd-64", and "arm-32
|
|
40
|
-
IF ( ${YUV_CROSS_COMPILE_FOR_ARM7} OR ${YUV_COMPILE_FOR_ARM7} )
|
|
41
|
-
SET ( YUV_SYSTEM_NAME "armhf-${YUV_BIT_SIZE}" )
|
|
42
|
-
ELSE ()
|
|
43
|
-
IF ( YUV_BIT_SIZE EQUAL 32 )
|
|
44
|
-
SET ( YUV_SYSTEM_NAME "x86-${YUV_BIT_SIZE}" )
|
|
45
|
-
ELSE ()
|
|
46
|
-
SET ( YUV_SYSTEM_NAME "amd-${YUV_BIT_SIZE}" )
|
|
47
|
-
ENDIF ()
|
|
48
|
-
ENDIF ()
|
|
49
|
-
MESSAGE ( VERBOSE "Packaging for: ${YUV_SYSTEM_NAME}" )
|
|
50
|
-
|
|
51
|
-
# define all the variables needed by CPack to create .deb and .rpm packages
|
|
52
|
-
SET ( CPACK_PACKAGE_VENDOR "Frank Barchard" )
|
|
53
|
-
SET ( CPACK_PACKAGE_CONTACT "fbarchard@chromium.org" )
|
|
54
|
-
SET ( CPACK_PACKAGE_VERSION ${YUV_VERSION} )
|
|
55
|
-
SET ( CPACK_PACKAGE_VERSION_MAJOR ${YUV_VER_MAJOR} )
|
|
56
|
-
SET ( CPACK_PACKAGE_VERSION_MINOR ${YUV_VER_MINOR} )
|
|
57
|
-
SET ( CPACK_PACKAGE_VERSION_PATCH ${YUV_VER_PATCH} )
|
|
58
|
-
SET ( CPACK_RESOURCE_FILE_LICENSE ${PROJECT_SOURCE_DIR}/LICENSE )
|
|
59
|
-
SET ( CPACK_SYSTEM_NAME "linux-${YUV_SYSTEM_NAME}" )
|
|
60
|
-
SET ( CPACK_PACKAGE_NAME "libyuv" )
|
|
61
|
-
SET ( CPACK_PACKAGE_DESCRIPTION_SUMMARY "YUV library" )
|
|
62
|
-
SET ( CPACK_PACKAGE_DESCRIPTION "YUV library and YUV conversion tool" )
|
|
63
|
-
SET ( CPACK_DEBIAN_PACKAGE_SECTION "other" )
|
|
64
|
-
SET ( CPACK_DEBIAN_PACKAGE_PRIORITY "optional" )
|
|
65
|
-
SET ( CPACK_DEBIAN_PACKAGE_MAINTAINER "Frank Barchard <fbarchard@chromium.org>" )
|
|
66
|
-
SET ( CPACK_GENERATOR "DEB;RPM" )
|
|
67
|
-
|
|
68
|
-
# create the .deb and .rpm files (you'll need build-essential and rpm tools)
|
|
69
|
-
INCLUDE( CPack )
|
|
70
|
-
|
|
1
|
+
# determine the version number from the #define in libyuv/version.h
|
|
2
|
+
EXECUTE_PROCESS (
|
|
3
|
+
COMMAND grep -Eo "LIBYUV_VERSION\ [0-9]+" include/libyuv/version.h
|
|
4
|
+
COMMAND grep -Eo "[0-9]+"
|
|
5
|
+
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
|
6
|
+
OUTPUT_VARIABLE YUV_VERSION_NUMBER
|
|
7
|
+
OUTPUT_STRIP_TRAILING_WHITESPACE )
|
|
8
|
+
SET ( YUV_VER_MAJOR 0 )
|
|
9
|
+
SET ( YUV_VER_MINOR 0 )
|
|
10
|
+
SET ( YUV_VER_PATCH ${YUV_VERSION_NUMBER} )
|
|
11
|
+
SET ( YUV_VERSION ${YUV_VER_MAJOR}.${YUV_VER_MINOR}.${YUV_VER_PATCH} )
|
|
12
|
+
MESSAGE ( VERBOSE "Building ver.: ${YUV_VERSION}" )
|
|
13
|
+
|
|
14
|
+
# is this a 32-bit or 64-bit build?
|
|
15
|
+
IF ( CMAKE_SIZEOF_VOID_P EQUAL 8 )
|
|
16
|
+
SET ( YUV_BIT_SIZE 64 )
|
|
17
|
+
ELSEIF ( CMAKE_SIZEOF_VOID_P EQUAL 4 )
|
|
18
|
+
SET ( YUV_BIT_SIZE 32 )
|
|
19
|
+
ELSE ()
|
|
20
|
+
MESSAGE ( FATAL_ERROR "CMAKE_SIZEOF_VOID_P=${CMAKE_SIZEOF_VOID_P}" )
|
|
21
|
+
ENDIF ()
|
|
22
|
+
|
|
23
|
+
# detect if this is a ARM build
|
|
24
|
+
STRING (FIND "${CMAKE_CXX_COMPILER}" "arm-linux-gnueabihf-g++" pos)
|
|
25
|
+
IF ( ${pos} EQUAL -1 )
|
|
26
|
+
SET ( YUV_CROSS_COMPILE_FOR_ARM7 FALSE )
|
|
27
|
+
ELSE ()
|
|
28
|
+
MESSAGE ( "Cross compiling for ARM7" )
|
|
29
|
+
SET ( YUV_CROSS_COMPILE_FOR_ARM7 TRUE )
|
|
30
|
+
ENDIF ()
|
|
31
|
+
STRING (FIND "${CMAKE_SYSTEM_PROCESSOR}" "arm" pos)
|
|
32
|
+
IF ( ${pos} EQUAL -1 )
|
|
33
|
+
SET ( YUV_COMPILE_FOR_ARM7 FALSE )
|
|
34
|
+
ELSE ()
|
|
35
|
+
MESSAGE ( "Compiling for ARM" )
|
|
36
|
+
SET ( YUV_COMPILE_FOR_ARM7 TRUE )
|
|
37
|
+
ENDIF ()
|
|
38
|
+
|
|
39
|
+
# setup the sytem name, such as "x86-32", "amd-64", and "arm-32
|
|
40
|
+
IF ( ${YUV_CROSS_COMPILE_FOR_ARM7} OR ${YUV_COMPILE_FOR_ARM7} )
|
|
41
|
+
SET ( YUV_SYSTEM_NAME "armhf-${YUV_BIT_SIZE}" )
|
|
42
|
+
ELSE ()
|
|
43
|
+
IF ( YUV_BIT_SIZE EQUAL 32 )
|
|
44
|
+
SET ( YUV_SYSTEM_NAME "x86-${YUV_BIT_SIZE}" )
|
|
45
|
+
ELSE ()
|
|
46
|
+
SET ( YUV_SYSTEM_NAME "amd-${YUV_BIT_SIZE}" )
|
|
47
|
+
ENDIF ()
|
|
48
|
+
ENDIF ()
|
|
49
|
+
MESSAGE ( VERBOSE "Packaging for: ${YUV_SYSTEM_NAME}" )
|
|
50
|
+
|
|
51
|
+
# define all the variables needed by CPack to create .deb and .rpm packages
|
|
52
|
+
SET ( CPACK_PACKAGE_VENDOR "Frank Barchard" )
|
|
53
|
+
SET ( CPACK_PACKAGE_CONTACT "fbarchard@chromium.org" )
|
|
54
|
+
SET ( CPACK_PACKAGE_VERSION ${YUV_VERSION} )
|
|
55
|
+
SET ( CPACK_PACKAGE_VERSION_MAJOR ${YUV_VER_MAJOR} )
|
|
56
|
+
SET ( CPACK_PACKAGE_VERSION_MINOR ${YUV_VER_MINOR} )
|
|
57
|
+
SET ( CPACK_PACKAGE_VERSION_PATCH ${YUV_VER_PATCH} )
|
|
58
|
+
SET ( CPACK_RESOURCE_FILE_LICENSE ${PROJECT_SOURCE_DIR}/LICENSE )
|
|
59
|
+
SET ( CPACK_SYSTEM_NAME "linux-${YUV_SYSTEM_NAME}" )
|
|
60
|
+
SET ( CPACK_PACKAGE_NAME "libyuv" )
|
|
61
|
+
SET ( CPACK_PACKAGE_DESCRIPTION_SUMMARY "YUV library" )
|
|
62
|
+
SET ( CPACK_PACKAGE_DESCRIPTION "YUV library and YUV conversion tool" )
|
|
63
|
+
SET ( CPACK_DEBIAN_PACKAGE_SECTION "other" )
|
|
64
|
+
SET ( CPACK_DEBIAN_PACKAGE_PRIORITY "optional" )
|
|
65
|
+
SET ( CPACK_DEBIAN_PACKAGE_MAINTAINER "Frank Barchard <fbarchard@chromium.org>" )
|
|
66
|
+
SET ( CPACK_GENERATOR "DEB;RPM" )
|
|
67
|
+
|
|
68
|
+
# create the .deb and .rpm files (you'll need build-essential and rpm tools)
|
|
69
|
+
INCLUDE( CPack )
|
|
70
|
+
|
|
@@ -1,252 +1,259 @@
|
|
|
1
|
-
# CMakeLists for libyuv
|
|
2
|
-
# Originally created for "roxlu build system" to compile libyuv on windows
|
|
3
|
-
# Run with -DUNIT_TEST=ON to build unit tests
|
|
4
|
-
|
|
5
|
-
cmake_minimum_required( VERSION 3.16 )
|
|
6
|
-
project ( YUV C CXX ) # "C" is required even for C++ projects
|
|
7
|
-
option( UNIT_TEST "Built unit tests" OFF )
|
|
8
|
-
|
|
9
|
-
include(CheckCSourceCompiles)
|
|
10
|
-
|
|
11
|
-
set ( ly_base_dir ${PROJECT_SOURCE_DIR} )
|
|
12
|
-
set ( ly_src_dir ${ly_base_dir}/source )
|
|
13
|
-
set ( ly_inc_dir ${ly_base_dir}/include )
|
|
14
|
-
set ( ly_tst_dir ${ly_base_dir}/unit_test )
|
|
15
|
-
set ( ly_lib_name yuv )
|
|
16
|
-
set ( ly_lib_static ${ly_lib_name} )
|
|
17
|
-
set ( ly_lib_shared ${ly_lib_name}_shared )
|
|
18
|
-
|
|
19
|
-
# We cannot use GLOB here since we want to be able to separate out files that
|
|
20
|
-
# need particular flags to enable architecture extensions like AArch64's SVE.
|
|
21
|
-
# TODO: More of these files could be separated out for different architectures.
|
|
22
|
-
set ( ly_common_source_files
|
|
23
|
-
${ly_src_dir}/compare.cc
|
|
24
|
-
${ly_src_dir}/compare_common.cc
|
|
25
|
-
${ly_src_dir}/compare_gcc.cc
|
|
26
|
-
${ly_src_dir}/compare_win.cc
|
|
27
|
-
${ly_src_dir}/convert_argb.cc
|
|
28
|
-
${ly_src_dir}/convert.cc
|
|
29
|
-
${ly_src_dir}/convert_from_argb.cc
|
|
30
|
-
${ly_src_dir}/convert_from.cc
|
|
31
|
-
${ly_src_dir}/convert_jpeg.cc
|
|
32
|
-
${ly_src_dir}/convert_to_argb.cc
|
|
33
|
-
${ly_src_dir}/convert_to_i420.cc
|
|
34
|
-
${ly_src_dir}/cpu_id.cc
|
|
35
|
-
${ly_src_dir}/mjpeg_decoder.cc
|
|
36
|
-
${ly_src_dir}/mjpeg_validate.cc
|
|
37
|
-
${ly_src_dir}/planar_functions.cc
|
|
38
|
-
${ly_src_dir}/rotate_any.cc
|
|
39
|
-
${ly_src_dir}/rotate_argb.cc
|
|
40
|
-
${ly_src_dir}/rotate.cc
|
|
41
|
-
${ly_src_dir}/rotate_common.cc
|
|
42
|
-
${ly_src_dir}/rotate_gcc.cc
|
|
43
|
-
${ly_src_dir}/rotate_lsx.cc
|
|
44
|
-
${ly_src_dir}/rotate_win.cc
|
|
45
|
-
${ly_src_dir}/row_any.cc
|
|
46
|
-
${ly_src_dir}/row_common.cc
|
|
47
|
-
${ly_src_dir}/row_gcc.cc
|
|
48
|
-
${ly_src_dir}/row_lasx.cc
|
|
49
|
-
${ly_src_dir}/row_lsx.cc
|
|
50
|
-
${ly_src_dir}/row_rvv.cc
|
|
51
|
-
${ly_src_dir}/row_win.cc
|
|
52
|
-
${ly_src_dir}/scale_any.cc
|
|
53
|
-
${ly_src_dir}/scale_argb.cc
|
|
54
|
-
${ly_src_dir}/scale.cc
|
|
55
|
-
${ly_src_dir}/scale_common.cc
|
|
56
|
-
${ly_src_dir}/scale_gcc.cc
|
|
57
|
-
${ly_src_dir}/scale_lsx.cc
|
|
58
|
-
${ly_src_dir}/scale_rgb.cc
|
|
59
|
-
${ly_src_dir}/scale_rvv.cc
|
|
60
|
-
${ly_src_dir}/scale_uv.cc
|
|
61
|
-
${ly_src_dir}/scale_win.cc
|
|
62
|
-
${ly_src_dir}/video_common.cc)
|
|
63
|
-
|
|
64
|
-
file ( GLOB_RECURSE ly_unittest_sources ${ly_tst_dir}/*.cc )
|
|
65
|
-
list ( SORT ly_unittest_sources )
|
|
66
|
-
|
|
67
|
-
include_directories( BEFORE ${ly_inc_dir} )
|
|
68
|
-
|
|
69
|
-
if(MSVC)
|
|
70
|
-
add_definitions ( -D_CRT_SECURE_NO_WARNINGS )
|
|
71
|
-
endif()
|
|
72
|
-
|
|
73
|
-
# Need to set PIC to allow creating shared libraries from object file libraries.
|
|
74
|
-
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
|
75
|
-
|
|
76
|
-
# Build the set of objects that do not need to be compiled with flags to enable
|
|
77
|
-
# particular architecture features.
|
|
78
|
-
add_library( ${ly_lib_name}_common_objects OBJECT ${ly_common_source_files} )
|
|
79
|
-
set(ly_lib_parts $<TARGET_OBJECTS:${ly_lib_name}_common_objects>)
|
|
80
|
-
|
|
81
|
-
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" SYSPROC)
|
|
82
|
-
set(LOONGARCH64_ALIASES loongarch64)
|
|
83
|
-
list(FIND LOONGARCH64_ALIASES "${SYSPROC}" LOONGARCH64MATCH)
|
|
84
|
-
|
|
85
|
-
if(LOONGARCH64MATCH GREATER "-1")
|
|
86
|
-
set(LOONGARCH64 1)
|
|
87
|
-
endif()
|
|
88
|
-
|
|
89
|
-
if(NOT MSVC)
|
|
90
|
-
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" arch_lowercase)
|
|
91
|
-
|
|
92
|
-
if(arch_lowercase MATCHES "^arm" AND NOT arch_lowercase STREQUAL "arm64")
|
|
93
|
-
# Enable Arm Neon kernels.
|
|
94
|
-
add_definitions(-DLIBYUV_NEON=1)
|
|
95
|
-
add_library(${ly_lib_name}_neon OBJECT
|
|
96
|
-
${ly_src_dir}/compare_neon.cc
|
|
97
|
-
${ly_src_dir}/rotate_neon.cc
|
|
98
|
-
${ly_src_dir}/row_neon.cc
|
|
99
|
-
${ly_src_dir}/scale_neon.cc)
|
|
100
|
-
target_compile_options(${ly_lib_name}_neon PRIVATE -mfpu=neon)
|
|
101
|
-
list(APPEND ly_lib_parts $<TARGET_OBJECTS:${ly_lib_name}_neon>)
|
|
102
|
-
endif()
|
|
103
|
-
|
|
104
|
-
if(arch_lowercase STREQUAL "aarch64" OR arch_lowercase STREQUAL "arm64")
|
|
105
|
-
# Enable AArch64 Neon dot-product and i8mm kernels.
|
|
106
|
-
add_library(${ly_lib_name}_neon64 OBJECT
|
|
107
|
-
${ly_src_dir}/compare_neon64.cc
|
|
108
|
-
${ly_src_dir}/rotate_neon64.cc
|
|
109
|
-
${ly_src_dir}/row_neon64.cc
|
|
110
|
-
${ly_src_dir}/scale_neon64.cc)
|
|
111
|
-
target_compile_options(${ly_lib_name}_neon64 PRIVATE -march=armv8.2-a+dotprod+i8mm)
|
|
112
|
-
list(APPEND ly_lib_parts $<TARGET_OBJECTS:${ly_lib_name}_neon64>)
|
|
113
|
-
|
|
114
|
-
# Enable AArch64 SVE kernels.
|
|
115
|
-
add_library(${ly_lib_name}_sve OBJECT
|
|
116
|
-
${ly_src_dir}/row_sve.cc)
|
|
117
|
-
target_compile_options(${ly_lib_name}_sve PRIVATE -march=armv8.5-a+i8mm+sve2)
|
|
118
|
-
list(APPEND ly_lib_parts $<TARGET_OBJECTS:${ly_lib_name}_sve>)
|
|
119
|
-
|
|
120
|
-
set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
|
|
121
|
-
set(OLD_CMAKE_TRY_COMPILE_TARGET_TYPE ${CMAKE_TRY_COMPILE_TARGET_TYPE})
|
|
122
|
-
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -march=armv9-a+i8mm+sme")
|
|
123
|
-
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
|
|
124
|
-
# Check whether the compiler can compile SME functions; this fails
|
|
125
|
-
# with Clang for Windows.
|
|
126
|
-
check_c_source_compiles("
|
|
127
|
-
__arm_locally_streaming void func(void) { }
|
|
128
|
-
int main(void) { return 0; }
|
|
129
|
-
" CAN_COMPILE_SME)
|
|
130
|
-
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
|
|
131
|
-
set(CMAKE_TRY_COMPILE_TARGET_TYPE ${OLD_CMAKE_TRY_COMPILE_TARGET_TYPE})
|
|
132
|
-
|
|
133
|
-
if (CAN_COMPILE_SME)
|
|
134
|
-
# Enable AArch64 SME kernels.
|
|
135
|
-
add_library(${ly_lib_name}_sme OBJECT
|
|
136
|
-
${ly_src_dir}/rotate_sme.cc
|
|
137
|
-
${ly_src_dir}/row_sme.cc
|
|
138
|
-
${ly_src_dir}/scale_sme.cc)
|
|
139
|
-
target_compile_options(${ly_lib_name}_sme PRIVATE -march=armv9-a+i8mm+sme)
|
|
140
|
-
list(APPEND ly_lib_parts $<TARGET_OBJECTS:${ly_lib_name}_sme>)
|
|
141
|
-
else()
|
|
142
|
-
add_definitions(-DLIBYUV_DISABLE_SME)
|
|
143
|
-
endif()
|
|
144
|
-
endif()
|
|
145
|
-
endif()
|
|
146
|
-
|
|
147
|
-
if(LOONGARCH64)
|
|
148
|
-
include(CheckCXXSourceCompiles)
|
|
149
|
-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-narrowing")
|
|
150
|
-
check_cxx_source_compiles("
|
|
151
|
-
int main(int argc, char **argv) {
|
|
152
|
-
__asm__ volatile (
|
|
153
|
-
\"vadd.w $vr0, $vr1, $vr1\"
|
|
154
|
-
);
|
|
155
|
-
return 0; }" SUPPORTS_LSX)
|
|
156
|
-
|
|
157
|
-
check_cxx_source_compiles("
|
|
158
|
-
int main(int argc, char **argv) {
|
|
159
|
-
__asm__ volatile (
|
|
160
|
-
\"xvadd.w $xr0, $xr1, $xr1\"
|
|
161
|
-
);
|
|
162
|
-
return 0; }" SUPPORTS_LASX)
|
|
163
|
-
|
|
164
|
-
if(SUPPORTS_LSX)
|
|
165
|
-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mlsx")
|
|
166
|
-
endif()
|
|
167
|
-
if(SUPPORTS_LASX)
|
|
168
|
-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mlasx")
|
|
169
|
-
endif()
|
|
170
|
-
endif()
|
|
171
|
-
|
|
172
|
-
# this creates the static library (.a)
|
|
173
|
-
add_library( ${ly_lib_static} STATIC ${ly_lib_parts})
|
|
174
|
-
|
|
175
|
-
# this creates the shared library (.so)
|
|
176
|
-
add_library( ${ly_lib_shared} SHARED ${ly_lib_parts})
|
|
177
|
-
set_target_properties( ${ly_lib_shared} PROPERTIES OUTPUT_NAME "${ly_lib_name}" )
|
|
178
|
-
set_target_properties( ${ly_lib_shared} PROPERTIES PREFIX "lib" )
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
message(
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
endif()
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
if(
|
|
233
|
-
target_link_libraries(libyuv_unittest
|
|
234
|
-
endif()
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
endif()
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
1
|
+
# CMakeLists for libyuv
|
|
2
|
+
# Originally created for "roxlu build system" to compile libyuv on windows
|
|
3
|
+
# Run with -DUNIT_TEST=ON to build unit tests
|
|
4
|
+
|
|
5
|
+
cmake_minimum_required( VERSION 3.16 )
|
|
6
|
+
project ( YUV C CXX ) # "C" is required even for C++ projects
|
|
7
|
+
option( UNIT_TEST "Built unit tests" OFF )
|
|
8
|
+
|
|
9
|
+
include(CheckCSourceCompiles)
|
|
10
|
+
|
|
11
|
+
set ( ly_base_dir ${PROJECT_SOURCE_DIR} )
|
|
12
|
+
set ( ly_src_dir ${ly_base_dir}/source )
|
|
13
|
+
set ( ly_inc_dir ${ly_base_dir}/include )
|
|
14
|
+
set ( ly_tst_dir ${ly_base_dir}/unit_test )
|
|
15
|
+
set ( ly_lib_name yuv )
|
|
16
|
+
set ( ly_lib_static ${ly_lib_name} )
|
|
17
|
+
set ( ly_lib_shared ${ly_lib_name}_shared )
|
|
18
|
+
|
|
19
|
+
# We cannot use GLOB here since we want to be able to separate out files that
|
|
20
|
+
# need particular flags to enable architecture extensions like AArch64's SVE.
|
|
21
|
+
# TODO: More of these files could be separated out for different architectures.
|
|
22
|
+
set ( ly_common_source_files
|
|
23
|
+
${ly_src_dir}/compare.cc
|
|
24
|
+
${ly_src_dir}/compare_common.cc
|
|
25
|
+
${ly_src_dir}/compare_gcc.cc
|
|
26
|
+
${ly_src_dir}/compare_win.cc
|
|
27
|
+
${ly_src_dir}/convert_argb.cc
|
|
28
|
+
${ly_src_dir}/convert.cc
|
|
29
|
+
${ly_src_dir}/convert_from_argb.cc
|
|
30
|
+
${ly_src_dir}/convert_from.cc
|
|
31
|
+
${ly_src_dir}/convert_jpeg.cc
|
|
32
|
+
${ly_src_dir}/convert_to_argb.cc
|
|
33
|
+
${ly_src_dir}/convert_to_i420.cc
|
|
34
|
+
${ly_src_dir}/cpu_id.cc
|
|
35
|
+
${ly_src_dir}/mjpeg_decoder.cc
|
|
36
|
+
${ly_src_dir}/mjpeg_validate.cc
|
|
37
|
+
${ly_src_dir}/planar_functions.cc
|
|
38
|
+
${ly_src_dir}/rotate_any.cc
|
|
39
|
+
${ly_src_dir}/rotate_argb.cc
|
|
40
|
+
${ly_src_dir}/rotate.cc
|
|
41
|
+
${ly_src_dir}/rotate_common.cc
|
|
42
|
+
${ly_src_dir}/rotate_gcc.cc
|
|
43
|
+
${ly_src_dir}/rotate_lsx.cc
|
|
44
|
+
${ly_src_dir}/rotate_win.cc
|
|
45
|
+
${ly_src_dir}/row_any.cc
|
|
46
|
+
${ly_src_dir}/row_common.cc
|
|
47
|
+
${ly_src_dir}/row_gcc.cc
|
|
48
|
+
${ly_src_dir}/row_lasx.cc
|
|
49
|
+
${ly_src_dir}/row_lsx.cc
|
|
50
|
+
${ly_src_dir}/row_rvv.cc
|
|
51
|
+
${ly_src_dir}/row_win.cc
|
|
52
|
+
${ly_src_dir}/scale_any.cc
|
|
53
|
+
${ly_src_dir}/scale_argb.cc
|
|
54
|
+
${ly_src_dir}/scale.cc
|
|
55
|
+
${ly_src_dir}/scale_common.cc
|
|
56
|
+
${ly_src_dir}/scale_gcc.cc
|
|
57
|
+
${ly_src_dir}/scale_lsx.cc
|
|
58
|
+
${ly_src_dir}/scale_rgb.cc
|
|
59
|
+
${ly_src_dir}/scale_rvv.cc
|
|
60
|
+
${ly_src_dir}/scale_uv.cc
|
|
61
|
+
${ly_src_dir}/scale_win.cc
|
|
62
|
+
${ly_src_dir}/video_common.cc)
|
|
63
|
+
|
|
64
|
+
file ( GLOB_RECURSE ly_unittest_sources ${ly_tst_dir}/*.cc )
|
|
65
|
+
list ( SORT ly_unittest_sources )
|
|
66
|
+
|
|
67
|
+
include_directories( BEFORE ${ly_inc_dir} )
|
|
68
|
+
|
|
69
|
+
if(MSVC)
|
|
70
|
+
add_definitions ( -D_CRT_SECURE_NO_WARNINGS )
|
|
71
|
+
endif()
|
|
72
|
+
|
|
73
|
+
# Need to set PIC to allow creating shared libraries from object file libraries.
|
|
74
|
+
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
|
75
|
+
|
|
76
|
+
# Build the set of objects that do not need to be compiled with flags to enable
|
|
77
|
+
# particular architecture features.
|
|
78
|
+
add_library( ${ly_lib_name}_common_objects OBJECT ${ly_common_source_files} )
|
|
79
|
+
set(ly_lib_parts $<TARGET_OBJECTS:${ly_lib_name}_common_objects>)
|
|
80
|
+
|
|
81
|
+
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" SYSPROC)
|
|
82
|
+
set(LOONGARCH64_ALIASES loongarch64)
|
|
83
|
+
list(FIND LOONGARCH64_ALIASES "${SYSPROC}" LOONGARCH64MATCH)
|
|
84
|
+
|
|
85
|
+
if(LOONGARCH64MATCH GREATER "-1")
|
|
86
|
+
set(LOONGARCH64 1)
|
|
87
|
+
endif()
|
|
88
|
+
|
|
89
|
+
if(NOT MSVC)
|
|
90
|
+
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" arch_lowercase)
|
|
91
|
+
|
|
92
|
+
if(arch_lowercase MATCHES "^arm" AND NOT arch_lowercase STREQUAL "arm64")
|
|
93
|
+
# Enable Arm Neon kernels.
|
|
94
|
+
add_definitions(-DLIBYUV_NEON=1)
|
|
95
|
+
add_library(${ly_lib_name}_neon OBJECT
|
|
96
|
+
${ly_src_dir}/compare_neon.cc
|
|
97
|
+
${ly_src_dir}/rotate_neon.cc
|
|
98
|
+
${ly_src_dir}/row_neon.cc
|
|
99
|
+
${ly_src_dir}/scale_neon.cc)
|
|
100
|
+
target_compile_options(${ly_lib_name}_neon PRIVATE -mfpu=neon)
|
|
101
|
+
list(APPEND ly_lib_parts $<TARGET_OBJECTS:${ly_lib_name}_neon>)
|
|
102
|
+
endif()
|
|
103
|
+
|
|
104
|
+
if(arch_lowercase STREQUAL "aarch64" OR arch_lowercase STREQUAL "arm64")
|
|
105
|
+
# Enable AArch64 Neon dot-product and i8mm kernels.
|
|
106
|
+
add_library(${ly_lib_name}_neon64 OBJECT
|
|
107
|
+
${ly_src_dir}/compare_neon64.cc
|
|
108
|
+
${ly_src_dir}/rotate_neon64.cc
|
|
109
|
+
${ly_src_dir}/row_neon64.cc
|
|
110
|
+
${ly_src_dir}/scale_neon64.cc)
|
|
111
|
+
target_compile_options(${ly_lib_name}_neon64 PRIVATE -march=armv8.2-a+dotprod+i8mm)
|
|
112
|
+
list(APPEND ly_lib_parts $<TARGET_OBJECTS:${ly_lib_name}_neon64>)
|
|
113
|
+
|
|
114
|
+
# Enable AArch64 SVE kernels.
|
|
115
|
+
add_library(${ly_lib_name}_sve OBJECT
|
|
116
|
+
${ly_src_dir}/row_sve.cc)
|
|
117
|
+
target_compile_options(${ly_lib_name}_sve PRIVATE -march=armv8.5-a+i8mm+sve2)
|
|
118
|
+
list(APPEND ly_lib_parts $<TARGET_OBJECTS:${ly_lib_name}_sve>)
|
|
119
|
+
|
|
120
|
+
set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
|
|
121
|
+
set(OLD_CMAKE_TRY_COMPILE_TARGET_TYPE ${CMAKE_TRY_COMPILE_TARGET_TYPE})
|
|
122
|
+
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -march=armv9-a+i8mm+sme")
|
|
123
|
+
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
|
|
124
|
+
# Check whether the compiler can compile SME functions; this fails
|
|
125
|
+
# with Clang for Windows.
|
|
126
|
+
check_c_source_compiles("
|
|
127
|
+
__arm_locally_streaming void func(void) { }
|
|
128
|
+
int main(void) { return 0; }
|
|
129
|
+
" CAN_COMPILE_SME)
|
|
130
|
+
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
|
|
131
|
+
set(CMAKE_TRY_COMPILE_TARGET_TYPE ${OLD_CMAKE_TRY_COMPILE_TARGET_TYPE})
|
|
132
|
+
|
|
133
|
+
if (CAN_COMPILE_SME)
|
|
134
|
+
# Enable AArch64 SME kernels.
|
|
135
|
+
add_library(${ly_lib_name}_sme OBJECT
|
|
136
|
+
${ly_src_dir}/rotate_sme.cc
|
|
137
|
+
${ly_src_dir}/row_sme.cc
|
|
138
|
+
${ly_src_dir}/scale_sme.cc)
|
|
139
|
+
target_compile_options(${ly_lib_name}_sme PRIVATE -march=armv9-a+i8mm+sme)
|
|
140
|
+
list(APPEND ly_lib_parts $<TARGET_OBJECTS:${ly_lib_name}_sme>)
|
|
141
|
+
else()
|
|
142
|
+
add_definitions(-DLIBYUV_DISABLE_SME)
|
|
143
|
+
endif()
|
|
144
|
+
endif()
|
|
145
|
+
endif()
|
|
146
|
+
|
|
147
|
+
if(LOONGARCH64)
|
|
148
|
+
include(CheckCXXSourceCompiles)
|
|
149
|
+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-narrowing")
|
|
150
|
+
check_cxx_source_compiles("
|
|
151
|
+
int main(int argc, char **argv) {
|
|
152
|
+
__asm__ volatile (
|
|
153
|
+
\"vadd.w $vr0, $vr1, $vr1\"
|
|
154
|
+
);
|
|
155
|
+
return 0; }" SUPPORTS_LSX)
|
|
156
|
+
|
|
157
|
+
check_cxx_source_compiles("
|
|
158
|
+
int main(int argc, char **argv) {
|
|
159
|
+
__asm__ volatile (
|
|
160
|
+
\"xvadd.w $xr0, $xr1, $xr1\"
|
|
161
|
+
);
|
|
162
|
+
return 0; }" SUPPORTS_LASX)
|
|
163
|
+
|
|
164
|
+
if(SUPPORTS_LSX)
|
|
165
|
+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mlsx")
|
|
166
|
+
endif()
|
|
167
|
+
if(SUPPORTS_LASX)
|
|
168
|
+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mlasx")
|
|
169
|
+
endif()
|
|
170
|
+
endif()
|
|
171
|
+
|
|
172
|
+
# this creates the static library (.a)
|
|
173
|
+
add_library( ${ly_lib_static} STATIC ${ly_lib_parts})
|
|
174
|
+
|
|
175
|
+
# this creates the shared library (.so)
|
|
176
|
+
add_library( ${ly_lib_shared} SHARED ${ly_lib_parts})
|
|
177
|
+
set_target_properties( ${ly_lib_shared} PROPERTIES OUTPUT_NAME "${ly_lib_name}" )
|
|
178
|
+
set_target_properties( ${ly_lib_shared} PROPERTIES PREFIX "lib" )
|
|
179
|
+
|
|
180
|
+
# 支持 Android 15+ 的 16KB 页面大小
|
|
181
|
+
# https://developer.android.com/guide/practices/page-sizes
|
|
182
|
+
if(ANDROID)
|
|
183
|
+
target_link_options(${ly_lib_shared} PRIVATE "-Wl,-z,max-page-size=16384")
|
|
184
|
+
endif()
|
|
185
|
+
|
|
186
|
+
if(WIN32)
|
|
187
|
+
set_target_properties( ${ly_lib_shared} PROPERTIES IMPORT_PREFIX "lib" )
|
|
188
|
+
endif()
|
|
189
|
+
|
|
190
|
+
# this creates the cpuid tool
|
|
191
|
+
add_executable ( cpuid ${ly_base_dir}/util/cpuid.c )
|
|
192
|
+
target_link_libraries ( cpuid ${ly_lib_static} )
|
|
193
|
+
|
|
194
|
+
# this creates the conversion tool
|
|
195
|
+
add_executable ( yuvconvert ${ly_base_dir}/util/yuvconvert.cc )
|
|
196
|
+
target_link_libraries ( yuvconvert ${ly_lib_static} )
|
|
197
|
+
|
|
198
|
+
# this creates the yuvconstants tool
|
|
199
|
+
add_executable ( yuvconstants ${ly_base_dir}/util/yuvconstants.c )
|
|
200
|
+
target_link_libraries ( yuvconstants ${ly_lib_static} )
|
|
201
|
+
|
|
202
|
+
find_package ( JPEG )
|
|
203
|
+
if (JPEG_FOUND)
|
|
204
|
+
include_directories( ${JPEG_INCLUDE_DIR} )
|
|
205
|
+
target_link_libraries( ${ly_lib_shared} ${JPEG_LIBRARY} )
|
|
206
|
+
add_definitions( -DHAVE_JPEG )
|
|
207
|
+
endif()
|
|
208
|
+
|
|
209
|
+
if(UNIT_TEST)
|
|
210
|
+
find_library(GTEST_LIBRARY gtest)
|
|
211
|
+
if(GTEST_LIBRARY STREQUAL "GTEST_LIBRARY-NOTFOUND")
|
|
212
|
+
set(GTEST_SRC_DIR_DEFAULT /usr/src/gtest)
|
|
213
|
+
if (CMAKE_CROSSCOMPILING)
|
|
214
|
+
set(GTEST_SRC_DIR_DEFAULT ${CMAKE_SOURCE_DIR}/third_party/googletest/src/googletest)
|
|
215
|
+
endif()
|
|
216
|
+
set(GTEST_SRC_DIR ${GTEST_SRC_DIR_DEFAULT} CACHE STRING "Location of gtest sources")
|
|
217
|
+
if(EXISTS ${GTEST_SRC_DIR}/src/gtest-all.cc)
|
|
218
|
+
message(STATUS "building gtest from sources in ${GTEST_SRC_DIR}")
|
|
219
|
+
set(gtest_sources ${GTEST_SRC_DIR}/src/gtest-all.cc)
|
|
220
|
+
add_library(gtest STATIC ${gtest_sources})
|
|
221
|
+
include_directories(${GTEST_SRC_DIR})
|
|
222
|
+
include_directories(${GTEST_SRC_DIR}/include)
|
|
223
|
+
set(GTEST_LIBRARY gtest)
|
|
224
|
+
else()
|
|
225
|
+
message(FATAL_ERROR "UNIT_TEST is set but unable to find gtest library")
|
|
226
|
+
endif()
|
|
227
|
+
endif()
|
|
228
|
+
|
|
229
|
+
add_executable(libyuv_unittest ${ly_unittest_sources})
|
|
230
|
+
target_link_libraries(libyuv_unittest ${ly_lib_name} ${GTEST_LIBRARY})
|
|
231
|
+
find_library(PTHREAD_LIBRARY pthread)
|
|
232
|
+
if(NOT PTHREAD_LIBRARY STREQUAL "PTHREAD_LIBRARY-NOTFOUND")
|
|
233
|
+
target_link_libraries(libyuv_unittest pthread)
|
|
234
|
+
endif()
|
|
235
|
+
if (JPEG_FOUND)
|
|
236
|
+
target_link_libraries(libyuv_unittest ${JPEG_LIBRARY})
|
|
237
|
+
endif()
|
|
238
|
+
|
|
239
|
+
if(NACL AND NACL_LIBC STREQUAL "newlib")
|
|
240
|
+
target_link_libraries(libyuv_unittest glibc-compat)
|
|
241
|
+
endif()
|
|
242
|
+
|
|
243
|
+
find_library(GFLAGS_LIBRARY gflags)
|
|
244
|
+
if(NOT GFLAGS_LIBRARY STREQUAL "GFLAGS_LIBRARY-NOTFOUND")
|
|
245
|
+
target_link_libraries(libyuv_unittest gflags)
|
|
246
|
+
add_definitions(-DLIBYUV_USE_GFLAGS)
|
|
247
|
+
endif()
|
|
248
|
+
endif()
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
# install the conversion tool, .so, .a, and all the header files
|
|
252
|
+
install ( TARGETS yuvconvert DESTINATION bin )
|
|
253
|
+
install ( TARGETS ${ly_lib_static} DESTINATION lib )
|
|
254
|
+
install ( TARGETS ${ly_lib_shared} LIBRARY DESTINATION lib RUNTIME DESTINATION bin ARCHIVE DESTINATION lib )
|
|
255
|
+
install ( DIRECTORY ${PROJECT_SOURCE_DIR}/include/ DESTINATION include )
|
|
256
|
+
|
|
257
|
+
# create the .deb and .rpm packages using cpack
|
|
258
|
+
include ( CM_linux_packages.cmake )
|
|
259
|
+
|