mirror of https://github.com/microsoft/vcpkg.git
[svt-av1] Add new port (#47186)
This commit is contained in:
parent
7213cf8135
commit
25d20d679f
|
|
@ -0,0 +1,13 @@
|
|||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 57100575..65b5b775 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -200,7 +200,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_OUTPUT_DIRECTORY})
|
||||
set(REQUIRES_PRIVATE "")
|
||||
|
||||
#Clang support, required to build static with LTO
|
||||
-if(CMAKE_C_COMPILER_ID MATCHES "Clang" AND UNIX AND NOT APPLE)
|
||||
+if(FALSE)
|
||||
find_program(LLVM_LD_EXE llvm-ld)
|
||||
find_program(LLVM_AR_EXE llvm-ar)
|
||||
find_program(LLVM_RANLIB_EXE llvm-ranlib)
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 57100575..d1dbd6f5 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -528,7 +528,7 @@ set_property(DIRECTORY .
|
||||
$<$<BOOL:${HAVE_STRNCPY_S}>:HAVE_STRNCPY_S=1>
|
||||
$<$<BOOL:${HAVE_STRCPY_S}>:HAVE_STRCPY_S=1>
|
||||
$<$<BOOL:${WIN32}>:_WIN32_WINNT=0x0601>)
|
||||
-if(NOT HAVE_STRCPY_S OR NOT HAVE_STRNCPY_S OR NOT HAVE_STRNLEN_S)
|
||||
+if(FALSE)
|
||||
add_library(safestringlib OBJECT
|
||||
third_party/safestringlib/safeclib_private.h
|
||||
third_party/safestringlib/safe_lib.h
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
vcpkg_from_gitlab(
|
||||
GITLAB_URL https://gitlab.com
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO AOMediaCodec/SVT-AV1
|
||||
REF "v${VERSION}"
|
||||
SHA512 4301e923965e3bff30a0fd2f74ae023d19260f91c2361d48ea7bc1718f501dcca73fa17cb8795b23392ca1bfbe1f4d55edcbb5ce06a2fa9e41da36c5166f527d
|
||||
PATCHES
|
||||
no-force-llvm.diff
|
||||
no-safestringlib.diff
|
||||
unvendor-fastfeat.diff
|
||||
)
|
||||
|
||||
file(REMOVE_RECURSE "${SOURCE_PATH}/third_party/aom/inc/")
|
||||
file(REMOVE_RECURSE "${SOURCE_PATH}/third_party/aom_dsp/")
|
||||
file(REMOVE_RECURSE "${SOURCE_PATH}/third_party/fastfeat/")
|
||||
file(REMOVE_RECURSE "${SOURCE_PATH}/third_party/googletest/")
|
||||
file(REMOVE_RECURSE "${SOURCE_PATH}/third_party/safestringlib/")
|
||||
|
||||
if (VCPKG_TARGET_ARCHITECTURE MATCHES "^(x86|x64)")
|
||||
vcpkg_find_acquire_program(NASM)
|
||||
set(SIMD_OPTIONS -DCOMPILE_C_ONLY=OFF "-DCMAKE_ASM_NASM_COMPILER=${NASM}")
|
||||
else()
|
||||
if(VCPKG_TARGET_ARCHITECTURE MATCHES "^(arm64|arm64ec)$" AND NOT VCPKG_TARGET_IS_WINDOWS)
|
||||
set(SIMD_OPTIONS -DCOMPILE_C_ONLY=OFF)
|
||||
else()
|
||||
set(SIMD_OPTIONS -DCOMPILE_C_ONLY=ON)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS
|
||||
${SIMD_OPTIONS}
|
||||
-DBUILD_APPS=OFF
|
||||
-DREPRODUCIBLE_BUILDS=ON
|
||||
-DEXCLUDE_HASH=OFF
|
||||
-DBUILD_TESTING=OFF
|
||||
-DSVT_AV1_LTO=OFF
|
||||
"-DFASTFEAT_INCLUDE_DIR=${CURRENT_INSTALLED_DIR}/include/"
|
||||
OPTIONS_RELEASE
|
||||
"-DFASTFEAT_LIB_DIR=${CURRENT_INSTALLED_DIR}/lib/"
|
||||
"-DCMAKE_OUTPUT_DIRECTORY=${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/Bin/Release"
|
||||
OPTIONS_DEBUG
|
||||
"-DFASTFEAT_LIB_DIR=${CURRENT_INSTALLED_DIR}/debug/lib/"
|
||||
"-DCMAKE_OUTPUT_DIRECTORY=${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/Bin/Debug"
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
vcpkg_copy_pdbs()
|
||||
vcpkg_fixup_pkgconfig()
|
||||
|
||||
if("tool" IN_LIST FEATURES)
|
||||
vcpkg_copy_tools(TOOL_NAMES SvtAv1EncApp AUTO_CLEAN)
|
||||
endif()
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||
|
||||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.md")
|
||||
|
|
@ -0,0 +1,107 @@
|
|||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 57100575..47a9e709 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -721,6 +721,5 @@ if(BUILD_TESTING)
|
||||
add_subdirectory(third_party/googletest)
|
||||
endif()
|
||||
|
||||
-add_subdirectory(third_party/fastfeat)
|
||||
|
||||
install(DIRECTORY ${PROJECT_SOURCE_DIR}/Source/API/ DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}/svt-av1" FILES_MATCHING PATTERN "*.h")
|
||||
diff --git a/Source/Lib/CMakeLists.txt b/Source/Lib/CMakeLists.txt
|
||||
index 03ffe4e2..43325e91 100644
|
||||
--- a/Source/Lib/CMakeLists.txt
|
||||
+++ b/Source/Lib/CMakeLists.txt
|
||||
@@ -47,7 +47,7 @@ endif()
|
||||
include_directories(${PROJECT_SOURCE_DIR}/Source/API/
|
||||
${PROJECT_SOURCE_DIR}/Source/Lib/Codec/
|
||||
${PROJECT_SOURCE_DIR}/Source/Lib/C_DEFAULT/
|
||||
- ${PROJECT_SOURCE_DIR}/third_party/fastfeat/)
|
||||
+)
|
||||
|
||||
add_library(SvtAv1Enc)
|
||||
# Required for cmake to be able to tell Xcode how to link all of the object files
|
||||
@@ -98,7 +98,6 @@ endif()
|
||||
|
||||
# Encoder Lib Source Files
|
||||
target_sources(SvtAv1Enc PRIVATE
|
||||
- $<TARGET_OBJECTS:FASTFEAT>
|
||||
$<TARGET_OBJECTS:GLOBALS>
|
||||
$<TARGET_OBJECTS:CODEC>
|
||||
$<TARGET_OBJECTS:C_DEFAULT>)
|
||||
@@ -133,6 +132,14 @@ if(common_lib_source)
|
||||
target_sources(SvtAv1Enc PRIVATE ${common_lib_source})
|
||||
endif()
|
||||
|
||||
+find_library(FASTFEAT REQUIRED
|
||||
+ NAMES fastfeat
|
||||
+ PATHS "${FASTFEAT_LIB_DIR}"
|
||||
+ NO_DEFAULT_PATH
|
||||
+)
|
||||
+list(APPEND PLATFORM_LIBS ${FASTFEAT})
|
||||
+set(LIBS_PRIVATE "${LIBS_PRIVATE} -lfastfeat")
|
||||
+
|
||||
set_target_properties(SvtAv1Enc PROPERTIES VERSION ${ENC_VERSION})
|
||||
set_target_properties(SvtAv1Enc PROPERTIES SOVERSION ${ENC_VERSION_MAJOR})
|
||||
set_target_properties(SvtAv1Enc PROPERTIES C_VISIBILITY_PRESET hidden)
|
||||
diff --git a/Source/Lib/Codec/CMakeLists.txt b/Source/Lib/Codec/CMakeLists.txt
|
||||
index d3e95e4f..63b32eda 100644
|
||||
--- a/Source/Lib/Codec/CMakeLists.txt
|
||||
+++ b/Source/Lib/Codec/CMakeLists.txt
|
||||
@@ -39,7 +39,7 @@ include_directories(${PROJECT_SOURCE_DIR}/Source/API/
|
||||
${PROJECT_SOURCE_DIR}/Source/Lib/ASM_SSE4_1/
|
||||
${PROJECT_SOURCE_DIR}/Source/Lib/ASM_AVX2/
|
||||
${PROJECT_SOURCE_DIR}/Source/Lib/ASM_AVX512/
|
||||
- ${PROJECT_SOURCE_DIR}/third_party/fastfeat/)
|
||||
+)
|
||||
elseif(NOT COMPILE_C_ONLY AND HAVE_ARM_PLATFORM)
|
||||
include_directories(${PROJECT_SOURCE_DIR}/Source/API/
|
||||
${PROJECT_SOURCE_DIR}/Source/Lib/Globals/
|
||||
@@ -50,14 +50,14 @@ include_directories(${PROJECT_SOURCE_DIR}/Source/API/
|
||||
${PROJECT_SOURCE_DIR}/Source/Lib/ASM_NEON_I8MM/
|
||||
${PROJECT_SOURCE_DIR}/Source/Lib/ASM_SVE/
|
||||
${PROJECT_SOURCE_DIR}/Source/Lib/ASM_SVE2/
|
||||
- ${PROJECT_SOURCE_DIR}/third_party/fastfeat/)
|
||||
+)
|
||||
else ()
|
||||
# Include Encoder Subdirectories
|
||||
include_directories(${PROJECT_SOURCE_DIR}/Source/API/
|
||||
${PROJECT_SOURCE_DIR}/Source/Lib/Globals/
|
||||
${PROJECT_SOURCE_DIR}/Source/Lib/Codec/
|
||||
${PROJECT_SOURCE_DIR}/Source/Lib/C_DEFAULT/
|
||||
- ${PROJECT_SOURCE_DIR}/third_party/fastfeat/)
|
||||
+)
|
||||
endif ()
|
||||
|
||||
set(all_files
|
||||
@@ -292,3 +292,4 @@ set(all_files
|
||||
)
|
||||
|
||||
add_library(CODEC OBJECT ${all_files})
|
||||
+target_include_directories(CODEC PRIVATE "${FASTFEAT_INCLUDE_DIR}")
|
||||
diff --git a/Source/Lib/Codec/corner_detect.c b/Source/Lib/Codec/corner_detect.c
|
||||
index 793919be..ca7e8537 100644
|
||||
--- a/Source/Lib/Codec/corner_detect.c
|
||||
+++ b/Source/Lib/Codec/corner_detect.c
|
||||
@@ -18,7 +18,7 @@
|
||||
#define FAST_BARRIER 18
|
||||
int svt_av1_fast_corner_detect(unsigned char *buf, int width, int height, int stride, int *points, int max_points) {
|
||||
int num_points;
|
||||
- xy *const frm_corners_xy = svt_aom_fast9_detect_nonmax(buf, width, height, stride, FAST_BARRIER, &num_points);
|
||||
+ xy *const frm_corners_xy = fast9_detect_nonmax(buf, width, height, stride, FAST_BARRIER, &num_points);
|
||||
num_points = (num_points <= max_points ? num_points : max_points);
|
||||
if (num_points > 0 && frm_corners_xy) {
|
||||
svt_memcpy(points, frm_corners_xy, sizeof(*frm_corners_xy) * num_points);
|
||||
diff --git a/Source/Lib/Globals/CMakeLists.txt b/Source/Lib/Globals/CMakeLists.txt
|
||||
index 47e20736..0d8e99e1 100644
|
||||
--- a/Source/Lib/Globals/CMakeLists.txt
|
||||
+++ b/Source/Lib/Globals/CMakeLists.txt
|
||||
@@ -15,7 +15,6 @@
|
||||
include_directories(../../../API
|
||||
${PROJECT_BINARY_DIR}/Source/Lib/Codec/
|
||||
${PROJECT_SOURCE_DIR}/Source/Lib/C_DEFAULT/
|
||||
- ${PROJECT_SOURCE_DIR}/third_party/fastfeat/
|
||||
)
|
||||
|
||||
if(NOT COMPILE_C_ONLY AND HAVE_X86_PLATFORM)
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"name": "svt-av1",
|
||||
"version-semver": "3.1.2",
|
||||
"description": "AV1 software video encoder library",
|
||||
"homepage": "https://gitlab.com/AOMediaCodec/SVT-AV1",
|
||||
"license": "BSD-3-Clause",
|
||||
"supports": "!x86 & !arm32 & !uwp",
|
||||
"dependencies": [
|
||||
"fastfeat",
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -9396,6 +9396,10 @@
|
|||
"baseline": "7.0.0",
|
||||
"port-version": 0
|
||||
},
|
||||
"svt-av1": {
|
||||
"baseline": "3.1.2",
|
||||
"port-version": 0
|
||||
},
|
||||
"swenson-sort": {
|
||||
"baseline": "2021-05-22",
|
||||
"port-version": 0
|
||||
|
|
|
|||
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "dfc35e8860de9551f35b4cb0eb5c10898c2edfdb",
|
||||
"version-semver": "3.1.2",
|
||||
"port-version": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
Loading…
Reference in New Issue