Skip to content

Commit

Permalink
[vvenc] new port (#29619)
Browse files Browse the repository at this point in the history
* [simde] suppress min/max macro definitions

* [vvenc] new port
  • Loading branch information
quyykk authored Feb 24, 2023
1 parent 2a95acc commit b5f40dc
Show file tree
Hide file tree
Showing 11 changed files with 279 additions and 2 deletions.
12 changes: 12 additions & 0 deletions ports/simde/fix-windows-minmax.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/simde/x86/sse.h b/simde/x86/sse.h
index 00119d3..a9dd705 100644
--- a/simde/x86/sse.h
+++ b/simde/x86/sse.h
@@ -33,6 +33,7 @@
#include "mmx.h"

#if defined(_WIN32)
+ #define NOMINMAX
#include <windows.h>
#endif

2 changes: 2 additions & 0 deletions ports/simde/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ vcpkg_from_github(
REF v0.7.2
SHA512 E4EE5A4A7E8453F116F1325D147F91D358A300F41EA5566EA30FC19649BABABF3B87E3DC838D5608B578BD152207DF4156200FFC7FB98141BC7C0BB60C75F1F5
HEAD_REF master
PATCHES
fix-windows-minmax.patch
)

file(COPY "${SOURCE_PATH}/simde" DESTINATION "${CURRENT_PACKAGES_DIR}/include")
Expand Down
4 changes: 3 additions & 1 deletion ports/simde/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"name": "simde",
"version": "0.7.2",
"port-version": 1,
"description": "Implementations of SIMD instruction sets for systems which don't natively support them",
"homepage": "https://github.com/simd-everywhere/simde"
"homepage": "https://github.com/simd-everywhere/simde",
"license": "MIT"
}
51 changes: 51 additions & 0 deletions ports/vvenc/fix-cmakelists.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 551ec4b..ae36bc8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -288,8 +288,11 @@ endif()


add_subdirectory( "source/Lib/vvenc" )
+if(BUILD_TOOLS)
add_subdirectory( "source/App/vvencapp" )
add_subdirectory( "source/App/vvencFFapp" )
+endif()
+if(BUILD_TESTING)
add_subdirectory( "test/vvenclibtest" )
add_subdirectory( "test/vvencinterfacetest" )

@@ -378,6 +381,7 @@ add_vvenc_test( compare_output-medium_rc2p_statsFile_easy 30 NO_OUTPUT "${OUT_VV

add_test( NAME Cleanup_remove_temp_files COMMAND ${CMAKE_COMMAND} -E remove -f ${CLEANUP_TEST_FILES} rec.yuv stats_exp.json stats_easy.json )
set_tests_properties( Cleanup_remove_temp_files PROPERTIES FIXTURES_CLEANUP cleanup )
+endif()

if( VVENC_ENABLE_INSTALL )
# include installer
diff --git a/cmake/modules/vvencInstall.cmake b/cmake/modules/vvencInstall.cmake
index 4945f1d..7006bf6 100644
--- a/cmake/modules/vvencInstall.cmake
+++ b/cmake/modules/vvencInstall.cmake
@@ -16,9 +16,11 @@ macro( install_targets config_ )
RUNTIME DESTINATION ${RUNTIME_DEST}
LIBRARY DESTINATION ${LIBRARY_DEST}
ARCHIVE DESTINATION ${ARCHIVE_DEST} )
+ if(BUILD_TOOLS)
install( TARGETS vvencapp vvencFFapp
CONFIGURATIONS ${config_}
RUNTIME DESTINATION ${RUNTIME_DEST} )
+ endif()
endmacro( install_targets )

# install pdb file for static and shared libraries
@@ -61,8 +63,10 @@ install_targets( RelWithDebInfo )

# install pdb files
install_lib_pdb( vvenc )
+if(BUILD_TOOLS)
install_exe_pdb( vvencapp )
install_exe_pdb( vvencFFapp )
+endif()

# configure version file
configure_file( cmake/install/vvencConfigVersion.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/vvencConfigVersion.cmake @ONLY )
77 changes: 77 additions & 0 deletions ports/vvenc/fix-dependencies.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 551ec4b..8405ad0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -161,6 +161,8 @@ set_property( GLOBAL PROPERTY USE_FOLDERS ON )
# Enable multithreading
find_package( Threads REQUIRED )

+find_package(nlohmann_json CONFIG REQUIRED)
+
# set _WIN32_WINNT
if( WIN32 )
# set _WIN32_WINT version global

diff --git a/source/App/vvencFFapp/CMakeLists.txt b/source/App/vvencFFapp/CMakeLists.txt
index 869b6ac..452301c 100644
--- a/source/App/vvencFFapp/CMakeLists.txt
+++ b/source/App/vvencFFapp/CMakeLists.txt
@@ -34,7 +34,7 @@ target_compile_options( ${EXE_NAME} PRIVATE $<$<OR:$<CXX_COMPILER_ID:Clang>,$<CX
$<$<CXX_COMPILER_ID:MSVC>:/W4 /WX /wd4100 /wd4244 /wd4251 /wd4459 /wd4996>)

target_include_directories( ${EXE_NAME} PRIVATE ../../Lib )
-target_link_libraries( ${EXE_NAME} Threads::Threads vvenc )
+target_link_libraries( ${EXE_NAME} Threads::Threads vvenc nlohmann_json::nlohmann_json )

# example: place header files in different folders
source_group( "Header Files" FILES ${INC_FILES} )

diff --git a/source/App/vvencapp/CMakeLists.txt b/source/App/vvencapp/CMakeLists.txt
index a0e764b..98e5bb4 100644
--- a/source/App/vvencapp/CMakeLists.txt
+++ b/source/App/vvencapp/CMakeLists.txt
@@ -31,7 +31,7 @@ target_compile_options( ${EXE_NAME} PRIVATE $<$<OR:$<CXX_COMPILER_ID:Clang>,$<CX
$<$<CXX_COMPILER_ID:MSVC>:/W4 /WX /wd4244 /wd4251 /wd4996>)

target_include_directories( ${EXE_NAME} PRIVATE ../../Lib )
-target_link_libraries( ${EXE_NAME} Threads::Threads vvenc )
+target_link_libraries( ${EXE_NAME} Threads::Threads vvenc nlohmann_json::nlohmann_json )

# example: place header files in different folders
source_group( "Header Files" FILES ${INC_FILES} )
diff --git a/source/Lib/apputils/LogoRenderer.h b/source/Lib/apputils/LogoRenderer.h
index 6f990e6..bbf40d7 100644
--- a/source/Lib/apputils/LogoRenderer.h
+++ b/source/Lib/apputils/LogoRenderer.h
@@ -58,7 +58,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include "FileIOHelper.h"

#ifdef VVENC_ENABLE_THIRDPARTY_JSON
-#include "../../../thirdparty/nlohmann_json/single_include/nlohmann/json.hpp"
+#include "nlohmann/json.hpp"
using nlohmann::json;
#endif

diff --git a/source/Lib/vvenc/CMakeLists.txt b/source/Lib/vvenc/CMakeLists.txt
index 5ee3740..827cf41 100644
--- a/source/Lib/vvenc/CMakeLists.txt
+++ b/source/Lib/vvenc/CMakeLists.txt
@@ -70,7 +70,8 @@ add_compile_definitions( ${LIB_NAME_UC}_SOURCE )
# set PRIVATE include directories for all targets in this directory
include_directories( $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../../../include> $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}> )
include_directories( . .. ../DecoderLib ../EncoderLib ../CommonLib ../CommonLib/x86 ../apputils )
-include_directories( SYSTEM ../../../thirdparty )
+find_path(SIMDE_INCLUDE_DIRS "simde/arm/neon.h")
+include_directories(SYSTEM ${SIMDE_INCLUDE_DIRS})

# set common warning flags
add_compile_options( "$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:-Wall;-Werror;-Wno-deprecated-register;-Wno-unused-const-variable;-Wno-unknown-attributes>" )
@@ -140,7 +141,7 @@ endif()
if( VVENC_ENABLE_THIRDPARTY_JSON )
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DVVENC_ENABLE_THIRDPARTY_JSON" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DVVENC_ENABLE_THIRDPARTY_JSON" )
- target_include_directories( ${LIB_NAME} PRIVATE ../../../thirdparty/nlohmann_json/single_include )
+ target_link_libraries( ${LIB_NAME} PRIVATE nlohmann_json::nlohmann_json )
endif()

if( TARGET INTEL_ITT)
51 changes: 51 additions & 0 deletions ports/vvenc/no-werror.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
diff --git a/source/App/vvencFFapp/CMakeLists.txt b/source/App/vvencFFapp/CMakeLists.txt
index 452301c..947da3d 100644
--- a/source/App/vvencFFapp/CMakeLists.txt
+++ b/source/App/vvencFFapp/CMakeLists.txt
@@ -29,9 +29,9 @@ set_target_properties( ${EXE_NAME} PROPERTIES DEBUG_POSTFIX "${CMAKE_DE
set_target_properties( ${EXE_NAME} PROPERTIES RELWITHDEBINFO_POSTFIX "${CMAKE_RELWITHDEBINFO_POSTFIX}" )
set_target_properties( ${EXE_NAME} PROPERTIES MINSIZEREL_POSTFIX "${CMAKE_MINSIZEREL_POSTFIX}" )

-target_compile_options( ${EXE_NAME} PRIVATE $<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:-Wall -Werror>
- $<$<CXX_COMPILER_ID:GNU>:-Wall -Werror -fdiagnostics-show-option>
- $<$<CXX_COMPILER_ID:MSVC>:/W4 /WX /wd4100 /wd4244 /wd4251 /wd4459 /wd4996>)
+target_compile_options( ${EXE_NAME} PRIVATE $<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:-Wall>
+ $<$<CXX_COMPILER_ID:GNU>:-Wall -fdiagnostics-show-option>
+ $<$<CXX_COMPILER_ID:MSVC>:/wd4100 /wd4244 /wd4251 /wd4459 /wd4996>)

target_include_directories( ${EXE_NAME} PRIVATE ../../Lib )
target_link_libraries( ${EXE_NAME} Threads::Threads vvenc nlohmann_json::nlohmann_json )
diff --git a/source/App/vvencapp/CMakeLists.txt b/source/App/vvencapp/CMakeLists.txt
index 98e5bb4..f5ae8f1 100644
--- a/source/App/vvencapp/CMakeLists.txt
+++ b/source/App/vvencapp/CMakeLists.txt
@@ -26,9 +26,9 @@ set_target_properties( ${EXE_NAME} PROPERTIES DEBUG_POSTFIX "${CMAKE_DE
set_target_properties( ${EXE_NAME} PROPERTIES RELWITHDEBINFO_POSTFIX "${CMAKE_RELWITHDEBINFO_POSTFIX}" )
set_target_properties( ${EXE_NAME} PROPERTIES MINSIZEREL_POSTFIX "${CMAKE_MINSIZEREL_POSTFIX}" )

-target_compile_options( ${EXE_NAME} PRIVATE $<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:-Wall -Werror>
- $<$<CXX_COMPILER_ID:GNU>:-Wall -Werror -fdiagnostics-show-option>
- $<$<CXX_COMPILER_ID:MSVC>:/W4 /WX /wd4244 /wd4251 /wd4996>)
+target_compile_options( ${EXE_NAME} PRIVATE $<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:-Wall>
+ $<$<CXX_COMPILER_ID:GNU>:-Wall -fdiagnostics-show-option>
+ $<$<CXX_COMPILER_ID:MSVC>:/wd4244 /wd4251 /wd4996>)

target_include_directories( ${EXE_NAME} PRIVATE ../../Lib )
target_link_libraries( ${EXE_NAME} Threads::Threads vvenc nlohmann_json::nlohmann_json )
diff --git a/source/Lib/vvenc/CMakeLists.txt b/source/Lib/vvenc/CMakeLists.txt
index 827cf41..93bcfc0 100644
--- a/source/Lib/vvenc/CMakeLists.txt
+++ b/source/Lib/vvenc/CMakeLists.txt
@@ -74,9 +74,9 @@ find_path(SIMDE_INCLUDE_DIRS "simde/arm/neon.h")
include_directories(SYSTEM ${SIMDE_INCLUDE_DIRS})

# set common warning flags
-add_compile_options( "$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:-Wall;-Werror;-Wno-deprecated-register;-Wno-unused-const-variable;-Wno-unknown-attributes>" )
-add_compile_options( "$<$<CXX_COMPILER_ID:GNU>:-Wall;-Werror;-Wno-unused-function;;-Wno-unused-variable;;-Wno-sign-compare;;-fdiagnostics-show-option;-Wno-ignored-attributes>" )
-add_compile_options( "$<$<CXX_COMPILER_ID:MSVC>:/W4;/WX;/wd4100;/wd4127;/wd4244;/wd4245;/wd4251;/wd4310;/wd4389;/wd4456;/wd4457;/wd4458;/wd4459;/wd4505;/wd4701;/wd4702;/wd4703;/wd4996>" )
+add_compile_options( "$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:-Wall;-Wno-deprecated-register;-Wno-unused-const-variable;-Wno-unknown-attributes>" )
+add_compile_options( "$<$<CXX_COMPILER_ID:GNU>:-Wall;-Wno-unused-function;;-Wno-unused-variable;;-Wno-sign-compare;;-fdiagnostics-show-option;-Wno-ignored-attributes>" )
+add_compile_options( "$<$<CXX_COMPILER_ID:MSVC>:/wd4100;/wd4127;/wd4244;/wd4245;/wd4251;/wd4310;/wd4389;/wd4456;/wd4457;/wd4458;/wd4459;/wd4505;/wd4701;/wd4702;/wd4703;/wd4996>" )

# don't export all symbols from shared libraries by default (gcc: -fvisibility=hidden), only those marked as VVENC_DECL
# behavior similar to __declspec(dllexport) on windows
39 changes: 39 additions & 0 deletions ports/vvenc/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO fraunhoferhhi/vvenc
REF v${VERSION}
SHA512 bf2ac5fc3859cb3303ef4fa4fcdbe00a6db617e3c2e76c6d658071a7650e5966fa1522ccb2feca8c770cea3ea25d2b573dbd0c72f4c0d71be61ba7dd1ab9440b
HEAD_REF master
PATCHES
fix-cmakelists.patch
fix-dependencies.patch
no-werror.patch
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
tools BUILD_TOOLS
)

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS ${FEATURE_OPTIONS}
-DBUILD_TESTING=OFF
-DCCACHE_FOUND=OFF
)


vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/vvenc)

vcpkg_copy_pdbs()
vcpkg_fixup_pkgconfig()

if(BUILD_TOOLS)
vcpkg_copy_tools(TOOL_NAMES vvencFFapp vvencapp AUTO_CLEAN)
endif()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt")
25 changes: 25 additions & 0 deletions ports/vvenc/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "vvenc",
"version": "1.7.0",
"description": "VVenC is a fast and efficient H.266/VVC encoder implementation.",
"homepage": "https://github.com/fraunhoferhhi/vvenc",
"license": "BSD-3-Clause-Clear",
"supports": "!x86 & !arm",
"dependencies": [
"nlohmann-json",
"simde",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
],
"features": {
"tools": {
"description": "Build user tools: vvencFFapp and vvencapp"
}
}
}
6 changes: 5 additions & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -7210,7 +7210,7 @@
},
"simde": {
"baseline": "0.7.2",
"port-version": 0
"port-version": 1
},
"simdjson": {
"baseline": "3.1.2",
Expand Down Expand Up @@ -8208,6 +8208,10 @@
"baseline": "3.0.1",
"port-version": 0
},
"vvenc": {
"baseline": "1.7.0",
"port-version": 0
},
"vxl": {
"baseline": "2.0.2",
"port-version": 4
Expand Down
5 changes: 5 additions & 0 deletions versions/s-/simde.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "b9f97efd430bad429766d57361f329bb1e1597f4",
"version": "0.7.2",
"port-version": 1
},
{
"git-tree": "7cf62acaf3648a8f0c2d866263788dc413f2beba",
"version": "0.7.2",
Expand Down
9 changes: 9 additions & 0 deletions versions/v-/vvenc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "35b2b999edf804e918aa499cbc108886dc7d528f",
"version": "1.7.0",
"port-version": 0
}
]
}

0 comments on commit b5f40dc

Please sign in to comment.