Skip to content

Commit

Permalink
Merge pull request #21 from adamjw24/develop_v0.3
Browse files Browse the repository at this point in the history
Merged changes for v0.3
  • Loading branch information
adamjw24 authored Mar 1, 2021
2 parents 77af893 + ce4a11c commit 0f0f08f
Show file tree
Hide file tree
Showing 272 changed files with 8,916 additions and 7,644 deletions.
132 changes: 115 additions & 17 deletions .gitlab-ci-internal.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,135 @@
stages:
- build

.build_template:
.build_only_template:
stage: build
interruptible: true
script:
- make all
- make test
only:
- web
- schedules
- merge_requests
- make disable-lto=1 all
rules:
- if: '$CI_PIPELINE_SOURCE == "web"'
- if: '$CI_PIPELINE_SOURCE == "schedule"'
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'

build_ubuntu1804:
extends: .build_template
.build_only_template_full:
extends: .build_only_template
rules:
- if: '$FULL_BUILD == "1"'

.build_test_template:
stage: build
interruptible: true
variables:
CTEST_OUTPUT_ON_FAILURE: 1
script:
- make disable-lto=1 all
- make disable-lto=1 test
rules:
- if: '$CI_PIPELINE_SOURCE == "web"'
- if: '$CI_PIPELINE_SOURCE == "schedule"'
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'

build_gcc5_ubuntu1804:
extends: .build_only_template_full
variables:
CC: gcc-5
CXX: g++-5
tags:
- ubuntu1804

build_gcc6_ubuntu1804:
extends: .build_only_template_full
variables:
CC: gcc-6
CXX: g++-6
tags:
- ubuntu1804

build_gcc7_ubuntu2004:
extends: .build_only_template_full
variables:
CC: gcc-7
CXX: g++-7
tags:
- ubuntu2004

build_gcc8_ubuntu2004:
extends: .build_only_template_full
variables:
CC: gcc-8
CXX: g++-8
tags:
- ubuntu2004

build_gcc9_ubuntu2004:
extends: .build_only_template_full
variables:
CC: gcc-9
CXX: g++-9
tags:
- ubuntu2004

build_gcc10_ubuntu2004:
extends: .build_only_template
variables:
CC: gcc-10
CXX: g++-10
tags:
- ubuntu2004

build_clang7_ubuntu2004:
extends: .build_only_template_full
variables:
CC: clang-7
CXX: clang++-7
tags:
- ubuntu2004

build_clang8_ubuntu2004:
extends: .build_only_template_full
variables:
CC: clang-8
CXX: clang++-8
tags:
- ubuntu2004

build_clang9_ubuntu2004:
extends: .build_only_template_full
variables:
CC: clang-9
CXX: clang++-9
tags:
- ubuntu2004

build_clang10_ubuntu2004:
extends: .build_only_template_full
variables:
CC: clang-10
CXX: clang++-10
tags:
- ubuntu2004

test_ubuntu1804:
extends: .build_test_template
tags:
- ubuntu1804

build_ubuntu2004:
extends: .build_template
test_ubuntu2004:
extends: .build_test_template
tags:
- ubuntu2004

build_vc191x:
extends: .build_template
test_vc191x:
extends: .build_test_template
tags:
- vc191x

build_vc192x:
extends: .build_template
test_vc192x:
extends: .build_test_template
tags:
- vc192x

build_macos:
extends: .build_template
test_macos:
extends: .build_test_template
tags:
- macos
80 changes: 68 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if( NOT CMAKE_VERSION VERSION_LESS 3.12.0 )
endif()

# project name
project( vvenc VERSION 0.2.1.0 )
project( vvenc VERSION 0.3.0.0 )

if( NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
# enable sse4.1 build for all source files for gcc and clang
Expand All @@ -35,10 +35,23 @@ if( NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
endif()

# enable install target
set( VVENC_ENABLE_INSTALL ON CACHE BOOL "Enable or disable install target" )
set( VVENC_ENABLE_INSTALL ON CACHE BOOL "Enable or disable install target" )

# enable postfix
set( VVENC_ENABLE_BUILD_TYPE_POSTFIX OFF CACHE BOOL "Enable or disable build type postfix for apps and libs" )

set( VVENC_ENABLE_LINK_TIME_OPT ON CACHE BOOL "Enable link time optimization for release and profile builds" )

if( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR
CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )

# enable address sanitizer
set( VVENC_USE_ADDRESS_SANITIZER OFF CACHE BOOL "Enable or disable address sanitizer" )

# add -march=native
set( VVENC_OPT_TARGET_ARCH "" CACHE STRING "Enable or disable building with architecture specific optimization" )
endif()

# enable postfix
set( VVENC_ENABLE_BUILD_TYPE_POSTFIX OFF CACHE BOOL "Enable or disable build type postfix for apps and libs" )

if( VVENC_ENABLE_BUILD_TYPE_POSTFIX )
if( BUILD_SHARED_LIBS )
Expand Down Expand Up @@ -82,17 +95,18 @@ set( CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_SOURCE_DIR}/bin/relw
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL "${CMAKE_SOURCE_DIR}/bin/minsizerel-${VVENC_OUTPUT_DIR_POSTFIX}" )


# enable or disable Intel Vtune ITT Tracing
if( CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo" )
set( VVCEncoderLib_ENABLE_ITT ON CACHE BOOL "Enable Intel Runtime Support for Profiling" )
else()
set( VVCEncoderLib_ENABLE_ITT OFF CACHE BOOL "Enable Intel Runtime Support for Profiling" )
endif()

# set default CMAKE_BUILD_TYPE to Release if not set
if( NOT CMAKE_BUILD_TYPE )
set( CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE )
endif()

# address sanitizer
if( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR
CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )
set( VVENC_USE_ADDRESS_SANITIZER OFF CACHE BOOL "Compiles with -sanitize=address and links to libasan" )
endif()

#set( ENABLE_LINK_TIME_OPT ON CACHE BOOL "Enable link time optimization for release and profile builds" )
#set( OPT_TARGET_ARCH "native" CACHE STRING "Create code and optimize for this architecture (default native)" )

Expand Down Expand Up @@ -137,6 +151,47 @@ if( VVENC_ENABLE_TRACING )
add_definitions( -DENABLE_TRACING=1 )
endif()

if( ( UNIX OR MINGW ) AND NOT VVENC_OPT_TARGET_ARCH STREQUAL "" )
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=${VVENC_OPT_TARGET_ARCH} -mtune=${VVENC_OPT_TARGET_ARCH}" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=${VVENC_OPT_TARGET_ARCH} -mtune=${VVENC_OPT_TARGET_ARCH}" )
endif()

if( VVENC_ENABLE_LINK_TIME_OPT )
set( CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE ON )
set( CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO ON )
set( CMAKE_INTERPROCEDURAL_OPTIMIZATION_MINSIZEREL ON )
endif()

if( VVCEncoderLib_ENABLE_ITT )
if( MSVC )
set( ITT_PATH "c:/Program Files (x86)/IntelSWTools/VTune Amplifier/" CACHE STRING "Path to the installation directory of Intel VTunes" )
elseif( APPLE )
message( WARNING "Not yet supported on Mac OS X" )
elseif( UNIX OR MINGW )
set( ITT_PATH "/opt/intel/vtune_amplifier" CACHE STRING "Path to the installation directory of Intel VTunes" )
endif()

if( EXISTS ${ITT_PATH} )
set( LIB_NAME INTEL_ITT )
add_library( ${LIB_NAME} STATIC IMPORTED GLOBAL )
if( MSVC )
set_target_properties( ${LIB_NAME} PROPERTIES IMPORTED_LOCATION ${ITT_PATH}/lib64/libittnotify.lib )
elseif( APPLE )
# not supported
elseif( UNIX OR MINGW )
set_target_properties( ${LIB_NAME} PROPERTIES IMPORTED_LOCATION ${ITT_PATH}/lib64/libittnotify.a )
set_target_properties( ${LIB_NAME} PROPERTIES INTERFACE_LINK_LIBRARIES dl )
endif()

# set include directory. relative paths do not work.
set_target_properties( ${LIB_NAME} PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${ITT_PATH}/include )
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTRACE_ENABLE_ITT" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTRACE_ENABLE_ITT" )
else()
message( WARNING "ITT_PATH ${ITT_PATH} not found, ignoring option VVCEncoderLib_ENABLE_ITT" )
endif()
endif()

# set address sanitizer compiler arguments
if( VVENC_USE_ADDRESS_SANITIZER )
# add compile options
Expand Down Expand Up @@ -184,6 +239,7 @@ endif()


add_subdirectory( "source/Lib/vvenc" )
add_subdirectory( "source/Lib/apputils" )
add_subdirectory( "source/App/vvencapp" )
add_subdirectory( "source/App/vvencFFapp" )
add_subdirectory( "test/vvenclibtest" )
Expand Down Expand Up @@ -239,9 +295,9 @@ add_test( NAME Test_vvencFFapp-slow COMMAND vvencFFapp -c ../../cfg/randomaccess
set_tests_properties( Test_vvencFFapp-slow PROPERTIES TIMEOUT 90 )
add_test( NAME Test_compare_output-slow COMMAND ${CMAKE_COMMAND} -E compare_files out.vvc outf.vvc )

add_test( NAME Test_vvencapp-medium_noqpa_0thr COMMAND vvencapp --preset medium --qpa 0 -threads 0 -s 80x44 -r 15 -i ../../test/data/RTn23_80x44p15_f15.yuv -f 5 -o out.vvc )
add_test( NAME Test_vvencapp-medium_noqpa_0thr COMMAND vvencapp --preset medium --qpa 0 --threads 0 -s 80x44 -r 15 -i ../../test/data/RTn23_80x44p15_f15.yuv -f 5 -o out.vvc )
set_tests_properties( Test_vvencapp-medium_noqpa_0thr PROPERTIES TIMEOUT 30 )
add_test( NAME Test_vvencFFapp-medium_noqpa_0thr COMMAND vvencFFapp -c ../../cfg/randomaccess_medium.cfg -c ../../test/data/RTn23.cfg -qpa 0 --WppBitEqual=0 --NumWppThreads=0 -f 5 -b outf.vvc )
add_test( NAME Test_vvencFFapp-medium_noqpa_0thr COMMAND vvencFFapp -c ../../cfg/randomaccess_medium.cfg -c ../../test/data/RTn23.cfg -qpa 0 --WppBitEqual=0 --Threads=0 -f 5 -b outf.vvc )
set_tests_properties( Test_vvencFFapp-medium_noqpa_0thr PROPERTIES TIMEOUT 30 )
add_test( NAME Test_compare_output-medium_noqpa_0thr COMMAND ${CMAKE_COMMAND} -E compare_files out.vvc outf.vvc )

Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Einsteinufer 37
www.hhi.fraunhofer.de/vvc
vvc@hhi.fraunhofer.de

Copyright (c) 2019-2020, Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V.
Copyright (c) 2019-2021, Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V.
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ ifneq ($(address-sanitizer),)
CONFIG_OPTIONS += -DVVENC_USE_ADDRESS_SANITIZER=$(address-sanitizer)
endif

ifneq ($(enable-arch),)
CONFIG_OPTIONS += -DVVENC_OPT_TARGET_ARCH=$(enable-arch)
endif

ifneq ($(disable-lto),)
CONFIG_OPTIONS += -DVVENC_ENABLE_LINK_TIME_OPT=OFF
endif

ifneq ($(enable-build-type-postfix),)
CONFIG_OPTIONS += -DVVENC_ENABLE_BUILD_TYPE_POSTFIX=ON
endif
Expand Down
29 changes: 15 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Fraunhofer Versatile Video Encoder (VVenC)

Versatile Video Coding (VVC) is the most recent international video coding standard, developed by the Joint Video Experts Team (JVET) of the ITU-T Video Coding Experts Group (VCEG) and the ISO/IEC Moving Picture Experts Group (MPEG). VVC is the successor of the High Efficiency Video Coding (HEVC) standard and will be released by ITU-T as H.266 and by ISO/IEC as MPEG-I Part 3 (ISO/IEC 23090-3). The new standard targets a 50% bit-rate reduction over HEVC at the same visual quality. In addition, VVC proves to be truly versatile by including tools for efficient coding of video content in emerging applications, e.g. high dynamic range (HDR), adaptive streaming, computer generated content as well as immersive applications like 360-degree video and augmented reality (AR).
Versatile Video Coding (VVC) is the most recent international video coding standard, developed by the Joint Video Experts Team (JVET) of the ITU-T Video Coding Experts Group (VCEG) and the ISO/IEC Moving Picture Experts Group (MPEG). VVC is the successor of the High Efficiency Video Coding (HEVC) standard and is published by ITU-T as H.266 and by ISO/IEC as MPEG-I Part 3 (ISO/IEC 23090-3). The new standard targets a 50% bit-rate reduction over HEVC at the same visual quality. In addition, VVC proves to be truly versatile by including tools for efficient coding of video content in emerging applications, e.g. high dynamic range (HDR), adaptive streaming, computer generated content as well as immersive applications like 360-degree video and augmented reality (AR).

The Fraunhofer Versatile Video Encoder (VVenC) is a fast and efficient "real-world" VVC encoder implementation with the following main features:
- Easy to use encoder implementation with four predefined quality/speed presets;
- Perceptual optimization to improve subjective video quality;
- Frame-level rate control supporting variable bit-rate (VBR) encoding;
- Easy to use encoder implementation with five predefined quality/speed presets;
- Perceptual optimization to improve subjective video quality, based on the XPSNR visual model;
- Frame-level single-pass and two-pass rate control supporting variable bit-rate (VBR) encoding;
- Expert mode encoder interface available, allowing fine-grained control of the encoding process.


# How to build VVenC?

The software uses CMake to create platform-specific build files.
The software uses CMake to create platform specific build files.
A working CMake installation is required for building the software.
Download CMake from http://www.cmake.org/ and install it. The following targets are supported: Windows (Visual Studio), Linux (gcc) and MacOS (clang).

Expand All @@ -35,23 +35,24 @@ This will create the statically linked release version of the encoder applicatio
The encoder project includes two encoder executables, a standard encoder (vvencapp) and a full featured expert encoder (vvencFFapp).

## How to use the standard encoder?
The standard encoder (**vvencapp**) can be used in one of four predefined presets. Each preset represents a different tradeoff between encoder runtime and video quality. In the slowest preset, the encoder reaches the highest compression gain, whilst in the fastest preset the runtime is significantly decreased. A list of the main encoder command line parameters is shown in the following table.
The standard encoder (**vvencapp**) can be used in one of five predefined presets. Each preset represents a different tradeoff between encoder runtime and video quality. In the slowest preset, the encoder reaches the highest compression gain, whilst in the fastest preset the runtime is significantly decreased. A list of the main encoder command line parameters is shown in the following table.

| OPTION | DEFAULT | DESCRIPTION |
|------------------------|----------------------------------|------------------------------------------------------------------------------------------------------|
| --help,-h | - | Show basic help |
| --input,-i <str> | - | Raw yuv input file |
| --size,-s <wxh> | 1920x1080 | Input file resolution (width x height) |
| --framerate,-r <int> | 60 | Temporal rate of input file. Required for VBR encoding and calculation of output bit-rate. Also recommended for perceptual QP adaptation modes 2 and 4 (see `--qpa` option below). |
| --framerate,-r <int> | 60 | Temporal rate of input file. Required for VBR encoding and calculation of output bit-rate. <br> Also recommended with perceptual QP adaptation (see `--qpa` option below). |
| --format,-c <str> | yuv420 | Set input format to YUV 4:2:0 8bit (yuv420) or YUV 4:2:0 10bit (yuv420_10) |
| --output,-o <str> | not set | Bit-stream output file |
| --preset <str> | medium | Select preset for specific encoding setting (faster, fast, medium, slow, slower) |
| --qp,-q <int> | 32 | Quantization parameter (0..51) |
| --bitrate <int> | 0 | Bitrate for rate control (0 constant QP encoding rate control off, otherwise bits per second). Rate control requires correct framerate. |
| --passes,-p <int> | 1 | Set number of rate control passes (1: one-pass rate control, 2: two-pass rate control). |
| --qpa <int> | 2 | Perceptual QP adaptation (0: off, on for 1: SDR(WPSNR), 2: SDR(XPSNR), 3: HDR(WPSNR), 4: HDR(XPSNR)) |
| --preset <str> | medium | Preset for specific encoding setting (faster, fast, medium, slow, slower) |
| --qp,-q <int> | 32 | Quantization parameter (0..63) |
| --bitrate <int> | 0 | Bitrate for rate control (0: constant-QP encoding without rate control, otherwise bits per second). <br> Rate control requires correct `--framerate` (see option above). |
| --passes,-p <int> | 2 | Number of rate control passes (1: single-pass rate control, 2: two-pass rate control) |
| --qpa <int> | 1 | Perceptual QP adaptation (QPA) to improve subjective video quality (0: off, 1: on) |
| --refreshsec,-rs <int> | 1 | Intra period/refresh in seconds |
| --threads ,-t <int> | size<=HD: 4 <br> else : 6 | Number of threads (1-N) |
| --threads,-t <int> | size > 832x480: <br> 8, else: 4 | Number of threads (1-N) |
| --hdr <str> | off | HDR mode (+ SEI messages) + BT.709 or BT.2020 color space (off, pq, pq_2020, hlg, hlg_2020) |

**Example usage:** Given a YUV 4:2:0 input file with a bit-depth of 8bit and a resolution of 176x144 pixels, the following call will encode the input file with the medium speedup preset:

Expand Down Expand Up @@ -86,6 +87,6 @@ Please see [LICENSE.txt](./LICENSE.txt) file for the terms of use of the content

For more information, please contact: vvc@hhi.fraunhofer.de

**Copyright (c) 2019-2020 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V.**
**Copyright (c) 2019-2021 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V.**

**All rights reserved.**
Loading

0 comments on commit 0f0f08f

Please sign in to comment.