Skip to content

Commit

Permalink
Merge pull request #138 from shiguredo/feature/SVT-AV1-lyra-oneVPL-HI…
Browse files Browse the repository at this point in the history
…SUI_LYRA_MODEL_COEFFS_PATH

HISUI_LYRA_MODEL_COEFFS_PATH 環境変数に対応 / 依存ライブラリの更新 / レポート機能に追加したライブラリの情報を追加
  • Loading branch information
haruyama authored Sep 8, 2023
2 parents ba86498 + dd2eb1d commit 22031ba
Show file tree
Hide file tree
Showing 103 changed files with 4,945 additions and 105 deletions.
20 changes: 19 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
shell: bash
run: |
sudo apt update
sudo apt install -yq yasm ccache libstdc++-10-dev-arm64-cross libc6-dev-arm64-cross binutils-aarch64-linux-gnu
sudo apt install -yq yasm ccache libstdc++-10-dev-arm64-cross libc6-dev-arm64-cross binutils-aarch64-linux-gnu libva-dev libdrm-dev
sudo rm -rf /var/lib/apt/lists/*
env:
DEBIAN_FRONTEND: noninteractive
Expand All @@ -49,6 +49,7 @@ jobs:
run: |
source VERSION
echo "libvpx_version=${LIBVPX_VERSION}" >> "$GITHUB_OUTPUT"
echo "svt_av1_version=${SVT_AV1_VERSION}" >> "$GITHUB_OUTPUT"
- name: Cache libvpx ${{ steps.versions.outputs.libvpx_version }}
id: cache-libvpx
uses: actions/cache@v3
Expand All @@ -59,6 +60,16 @@ jobs:
- name: Clear libvpx
if: steps.cache-libvpx.outputs.cache-hit != 'true'
run: rm -rf third_party/libvpx
- name: Cache SVT-AV1 ${{ steps.versions.outputs.svt_av1_version }}
id: cache-svt-av1
uses: actions/cache@v3
with:
path: third_party/SVT-AV1
key: ${{ matrix.os }}-third_party-svt-av1-${{ hashFiles('third_party/SVT-AV1/Bin/Release/libSvtAv1Dec.a', 'third_party/SVT-AV1/Bin/Release/libSvtAv1Enc.a') }}
restore-keys: ${{ matrix.os }}-third_party-svt-av1-
- name: Clear SVT-AV1
if: steps.cache-svt-av1.outputs.cache-hit != 'true'
run: rm -rf third_party/SVT-AV1
- name: Cache release directory
id: cache-release
uses: actions/cache@v3
Expand All @@ -82,6 +93,13 @@ jobs:
restore-keys: ${{ matrix.os }}-ccache-dir-
- name: Ccache stat
run: ccache -s
- name: Cache ~/.cache/bazel directory
uses: actions/cache@v3
with:
path: "~/.cache/bazel"
key: ${{ matrix.os }}-cache-bazel-dir
- name: Install numpy
run: pip install numpy
- name: Build hisui
run: ./build.bash ${{ matrix.os }} --package --use-ccache ${{ contains(matrix.os, '_x86_64') && '--with-test' || '' }}
timeout-minutes: 120
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/third_party/libvpx
/third_party/lyra/bazel-*
/third_party/lyra/lyra
/third_party/SVT-AV1
/test/integration/input/caminandes3.webm
/test/integration/input/lilac_blossom_bloom_spring.jpg
/test/integration/input/Big_Buck_Bunny_360_10s_1MB.webm
Expand Down
10 changes: 10 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@

## develop

- [UPDATE] 依存ライブラリの更新をする
- `boost``1.83.0` にあげる
- `cpp-mp4``2023.2.1` にあげる
- `opus``1.4` にあげる
- [CHANGE] one VPL での H.264 エンコードに対応する
- @haruyama
- [CHANGE] Lyra の デコードに対応する
- @haruyama
- [CHANGE] SVT-AV1 での AV1 デコード/エンコードに対応する
- @haruyama
- [CHANGE] OpenH264 での エンコードに対応する
- `--out-video-codec` オプションに H.264 の指定を追加する
- 画面共有合成機能では H.264 はサポートされない
Expand Down
92 changes: 82 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,22 @@ cmake_policy(SET CMP0091 NEW)

include(cmake/env.cmake)

set_cache_string_from_env(BOOST_VERSION 1.81.0 "Boost のバージョン")
if(DEFINED CMAKE_BUILD_TYPE)
if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
set(SVT_AV1_BUILD_TYPE "Debug")
else()
set(SVT_AV1_BUILD_TYPE "Release")
endif()
else()
set(SVT_AV1_BUILD_TYPE "Release")
endif()

set_cache_string_from_env(BOOST_VERSION 1.83.0 "Boost のバージョン")
set_cache_string_from_env(CLI11_VERSION 2.3.2 "CLI11 のバージョン")
set_cache_string_from_env(CPP_MP4_VERSION 7158ce0c19c1a7e9c8fcc34339e381766235abb5 "cpp-mp4 のバージョン")
set_cache_string_from_env(CPP_MP4_VERSION 2023.2.1 "cpp-mp4 のバージョン")
set_cache_string_from_env(FMT_VERSION 9.1.0 "fmt のバージョン")
set_cache_string_from_env(OPUS_VERSION 1.3.1 "Opus のバージョン")
set_cache_string_from_env(ONEVPL_VERSION 2023.3.1 "oneVPL のバージョン")
set_cache_string_from_env(OPUS_VERSION 1.4 "Opus のバージョン")
set_cache_string_from_env(SPDLOG_VERSION 1.11.0 "spdlog のバージョン")
set_cache_string_from_env(STB_VERSION 5736b15f7ea0ffb08dd38af21067c314d6a3aae9 "stb のバージョン")

Expand Down Expand Up @@ -43,6 +54,7 @@ set(CMAKE_C_FLAGS_PROFILE "-pg -O3 -DNDEBUG -march=native -mtune=native")

include(cmake/tools.cmake)


CPMAddPackage(
NAME boost_align
GITHUB_REPOSITORY boostorg/align
Expand Down Expand Up @@ -71,6 +83,13 @@ CPMAddPackage(
DOWNLOAD_ONLY YES
)

CPMAddPackage(
NAME boost_container_hash
GITHUB_REPOSITORY boostorg/container_hash
GIT_TAG boost-${BOOST_VERSION}
DOWNLOAD_ONLY YES
)

CPMAddPackage(
NAME boost_core
GITHUB_REPOSITORY boostorg/core
Expand Down Expand Up @@ -255,11 +274,53 @@ if(USE_FDK_AAC)
)
endif()

option(USE_ONEVPL "Use oneVPL" OFF)

if(USE_ONEVPL)
target_compile_definitions(hisui
PRIVATE
USE_ONEVPL
)

CPMAddPackage(
NAME vpl
GITHUB_REPOSITORY oneapi-src/oneVPL
VERSION ${ONEVPL_VERSION}
OPTIONS "BUILD_SHARED_LIBS Off" "BUILD_TOOLS Off" "BUILD_EXAMPLES Off" "BUILD_PREVIEW Off" "BUILD_TOOLS_ONEVPL_EXPERIMENTAL Off"
)

target_sources(hisui
PRIVATE
src/layout/vpl_video_producer.cpp
src/muxer/vpl_video_producer.cpp
src/video/vaapi_utils.cpp
src/video/vaapi_utils_drm.cpp
src/video/vpl.cpp
src/video/vpl_encoder.cpp
src/video/vpl_session.cpp
)

target_include_directories(hisui
PRIVATE
${VPL_SOURCE_DIR}/api
)

target_link_libraries(hisui
PRIVATE
drm
va
va-drm
VPL
)
endif()

target_sources(hisui
PRIVATE
src/archive_item.cpp
src/audio/basic_sequencer.cpp
src/audio/buffer_opus_encoder.cpp
src/audio/lyra_decoder.cpp
src/audio/lyra_handler.cpp
src/audio/mixer.cpp
src/audio/opus.cpp
src/audio/opus_decoder.cpp
Expand All @@ -268,6 +329,7 @@ target_sources(hisui
src/datetime.cpp
src/hisui.cpp
src/layout/archive.cpp
src/layout/av1_video_producer.cpp
src/layout/cell.cpp
src/layout/cell_util.cpp
src/layout/compose.cpp
Expand All @@ -284,6 +346,7 @@ target_sources(hisui
src/metadata.cpp
src/muxer/async_webm_muxer.cpp
src/muxer/audio_producer.cpp
src/muxer/av1_video_producer.cpp
src/muxer/faststart_mp4_muxer.cpp
src/muxer/mp4_muxer.cpp
src/muxer/multi_channel_vpx_video_producer.cpp
Expand All @@ -300,11 +363,15 @@ target_sources(hisui
src/util/json.cpp
src/util/wildcard.cpp
src/version/version.cpp
src/video/av1_decoder.cpp
src/video/basic_sequencer.cpp
src/video/buffer_av1_encoder.cpp
src/video/buffer_openh264_encoder.cpp
src/video/buffer_vpx_encoder.cpp
src/video/codec_engine.cpp
src/video/composer.cpp
src/video/decoder.cpp
src/video/decoder_factory.cpp
src/video/grid_composer.cpp
src/video/image_source.cpp
src/video/multi_channel_sequencer.cpp
Expand Down Expand Up @@ -342,6 +409,9 @@ target_sources(hisui
third_party/libvpx/third_party/libyuv/source/scale_neon64.cc
third_party/libvpx/third_party/libyuv/source/scale_win.cc
third_party/libvpx/third_party/libyuv/source/convert.cc
third_party/libvpx/third_party/libyuv/source/convert_argb.cc
third_party/libvpx/third_party/libyuv/source/convert_from.cc
third_party/libvpx/third_party/libyuv/source/video_common.cc
third_party/libvpx/third_party/libwebm/mkvparser/mkvparser.cc
third_party/libvpx/third_party/libwebm/mkvparser/mkvreader.cc
third_party/libvpx/third_party/libwebm/mkvmuxer/mkvmuxer.cc
Expand All @@ -352,10 +422,12 @@ target_sources(hisui
target_include_directories(hisui
PRIVATE
src
${abseil_cpp_SOURCE_DIR}/include
${boost_align_SOURCE_DIR}/include
${boost_assert_SOURCE_DIR}/include
${boost_config_SOURCE_DIR}/include
${boost_container_SOURCE_DIR}/include
${boost_container_hash_SOURCE_DIR}/include
${boost_core_SOURCE_DIR}/include
${boost_describe_SOURCE_DIR}/include
${boost_exception_SOURCE_DIR}/include
Expand All @@ -376,6 +448,8 @@ target_include_directories(hisui
${cli11_SOURCE_DIR}/include
${cpp-mp4_SOURCE_DIR}/include
${fmt_SOURCE_DIR}/include
${google_glog_SOURCE_DIR}/src
${gulrak_filesystem_SOURCE_DIR}
${opus_SOURCE_DIR}/include
${spdlog_SOURCE_DIR}/include
${stb_SOURCE_DIR}
Expand All @@ -384,6 +458,8 @@ target_include_directories(hisui
third_party/libvpx/third_party/libyuv/include
third_party/libvpx/third_party/libwebm
third_party/libvpx
third_party/SVT-AV1/Source/API
third_party/lyra
)

set_target_properties(hisui PROPERTIES CXX_STANDARD 20 C_STANDARD 11)
Expand All @@ -397,6 +473,9 @@ target_link_libraries(hisui
shiguredo-mp4
spdlog
${CMAKE_SOURCE_DIR}/third_party/libvpx/${HISUI_PACKAGE}/libvpx.a
${CMAKE_SOURCE_DIR}/third_party/SVT-AV1/Bin/${SVT_AV1_BUILD_TYPE}/libSvtAv1Dec.a
${CMAKE_SOURCE_DIR}/third_party/SVT-AV1/Bin/${SVT_AV1_BUILD_TYPE}/libSvtAv1Enc.a
${CMAKE_SOURCE_DIR}/third_party/lyra/bazel-bin/liblyra.a
)

if(WITH_TEST)
Expand All @@ -416,13 +495,6 @@ if(WITH_TEST)
DOWNLOAD_ONLY YES
)

CPMAddPackage(
NAME boost_container_hash
GITHUB_REPOSITORY boostorg/container_hash
GIT_TAG boost-${BOOST_VERSION}
DOWNLOAD_ONLY YES
)

CPMAddPackage(
NAME boost_detail
GITHUB_REPOSITORY boostorg/detail
Expand Down
Loading

0 comments on commit 22031ba

Please sign in to comment.