...
 
Commits (681)
......@@ -96,7 +96,7 @@ endif()
bb_enable_warnings( msvc warnings-as-errors "/wd4996" )
# enable sse4.1 build for all source files for gcc and clang
if( UNIX )
if( UNIX OR MINGW )
add_compile_options( "-msse4.1" )
endif()
......@@ -104,7 +104,6 @@ endif()
if( MSVC )
add_compile_options( "/MP" )
add_compile_options( "/EHsc" )
add_compile_options( "/MT" )
endif()
# set address sanitizer compiler arguments
......
......@@ -3,7 +3,7 @@ License, included below. This software may be subject to other third party
and contributor rights, including patent rights, and no such rights are
granted under this license.  
Copyright (c) 2010-2017, ITU/ISO/IEC
Copyright (c) 2010-2019, ITU/ISO/IEC
All rights reserved.
Redistribution and use in source and binary forms, with or without
......
......@@ -20,17 +20,31 @@ TARGETS := CommonLib DecoderAnalyserApp DecoderAnalyserLib DecoderApp DecoderLib
TARGETS += EncoderApp EncoderLib Utilities SEIRemovalApp
ifeq ($(OS),Windows_NT)
PY := $(wildcard c:/windows/py.*)
ifeq ($(PY),)
PYTHON_LAUNCHER := python
ifneq ($(MSYSTEM),)
# MSYS runtime environment
UNAME_S := $(shell uname -s)
PYTHON_LAUNCHER := python3
BUILD_CMD := $(PYTHON_LAUNCHER) $(BUILD_SCRIPT)
else
PYTHON_LAUNCHER := $(notdir $(PY))
UNAME_S := Windows
PY := $(wildcard c:/windows/py.*)
ifeq ($(PY),)
PYTHON_LAUNCHER := python
else
PYTHON_LAUNCHER := $(notdir $(PY))
endif
# If a plain cmake.py is used, the exit codes won't arrive in make; i.e. build failures are reported as success by make.
BUILD_CMD := $(PYTHON_LAUNCHER) $(BUILD_SCRIPT)
ifeq ($(toolset),gcc)
g := mgwmake
endif
endif
# If a plain cmake.py is used, the exit codes won't arrive in make; i.e. build failures are reported as success by make.
BUILD_SCRIPT := $(PYTHON_LAUNCHER) $(CURDIR)/cmake/CMakeBuild/bin/cmake.py
else
UNAME_S := $(shell uname -s)
BUILD_CMD := $(BUILD_SCRIPT)
ifeq ($(UNAME_S),Linux)
# for Jenkins: run trace build only on Linux
LINUXBUILD := TRUE
endif
ifeq ($(UNAME_S),Darwin)
# MAC
......@@ -48,7 +62,12 @@ CONFIG_OPTIONS += -g $(g)
endif
ifneq ($(toolset),)
CONFIG_OPTIONS += toolset=$(toolset)
# aarch64 and mingw are two shortcuts to simplify toolset specification.
ifeq ($(toolset),mingw)
CONFIG_OPTIONS += toolset=x86_64-w64-mingw32-gcc-posix
else
CONFIG_OPTIONS += toolset=$(toolset)
endif
endif
ifneq ($(address-model),)
......@@ -82,33 +101,39 @@ endif
BUILD_OPTIONS := $(CONFIG_OPTIONS) -b
debug:
$(BUILD_SCRIPT) $(BUILD_JOBS) $(BUILD_OPTIONS) $(CMAKE_OPTIONS) variant=debug
$(BUILD_CMD) $(BUILD_JOBS) $(BUILD_OPTIONS) $(CMAKE_OPTIONS) variant=debug
all:
$(BUILD_SCRIPT) $(BUILD_JOBS) $(BUILD_OPTIONS) $(CMAKE_OPTIONS) variant=debug,release,relwithdebinfo
$(BUILD_CMD) $(BUILD_JOBS) $(BUILD_OPTIONS) $(CMAKE_OPTIONS) variant=debug,release,relwithdebinfo
release:
$(BUILD_SCRIPT) $(BUILD_JOBS) $(BUILD_OPTIONS) $(CMAKE_OPTIONS) variant=release
$(BUILD_CMD) $(BUILD_JOBS) $(BUILD_OPTIONS) $(CMAKE_OPTIONS) variant=release
relwithdebinfo:
$(BUILD_SCRIPT) $(BUILD_JOBS) $(BUILD_OPTIONS) $(CMAKE_OPTIONS) variant=relwithdebinfo
$(BUILD_CMD) $(BUILD_JOBS) $(BUILD_OPTIONS) $(CMAKE_OPTIONS) variant=relwithdebinfo
clean:
# clean is equal to realclean to ensure that CMake options are reset
$(RM) -rf bin build lib
# $(BUILD_SCRIPT) $(BUILD_OPTIONS) $(CMAKE_OPTIONS) variant=debug,release,relwithdebinfo --target clean
# $(BUILD_CMD) $(BUILD_OPTIONS) $(CMAKE_OPTIONS) variant=debug,release,relwithdebinfo --target clean
clean-r:
$(BUILD_SCRIPT) $(BUILD_OPTIONS) $(CMAKE_OPTIONS) variant=release --target clean
$(BUILD_CMD) $(BUILD_OPTIONS) $(CMAKE_OPTIONS) variant=release --target clean
clean-d:
$(BUILD_SCRIPT) $(BUILD_OPTIONS) $(CMAKE_OPTIONS) variant=debug --target clean
$(BUILD_CMD) $(BUILD_OPTIONS) $(CMAKE_OPTIONS) variant=debug --target clean
clean-p:
$(BUILD_SCRIPT) $(BUILD_OPTIONS) $(CMAKE_OPTIONS) variant=relwithdebinfo --target clean
$(BUILD_CMD) $(BUILD_OPTIONS) $(CMAKE_OPTIONS) variant=relwithdebinfo --target clean
configure:
$(BUILD_SCRIPT) $(CONFIG_OPTIONS) $(CMAKE_OPTIONS) variant=debug,release,relwithdebinfo
$(BUILD_CMD) $(CONFIG_OPTIONS) $(CMAKE_OPTIONS) variant=debug,release,relwithdebinfo
linuxbuild:
ifeq ($(LINUXBUILD),TRUE)
# option for automated jenkins build
$(BUILD_CMD) $(BUILD_JOBS) $(BUILD_OPTIONS) $(CMAKE_OPTIONS) variant=debug
endif
#
# project specific targets
......@@ -126,28 +151,28 @@ TARGETS_DEBUG_CLEAN_FIRST := $(foreach t,$(TARGETS),$(t)-cd)
TARGETS_RELWITHDEBINFO_CLEAN_FIRST := $(foreach t,$(TARGETS),$(t)-cp)
$(TARGETS_ALL):
$(BUILD_SCRIPT) $(BUILD_JOBS) $(BUILD_OPTIONS) $(CMAKE_OPTIONS) variant=debug,release,relwithdebinfo --target $(patsubst %-a,%,$@)
$(BUILD_CMD) $(BUILD_JOBS) $(BUILD_OPTIONS) $(CMAKE_OPTIONS) variant=debug,release,relwithdebinfo --target $(patsubst %-a,%,$@)
$(TARGETS_ALL_CLEAN_FIRST):
$(BUILD_SCRIPT) $(BUILD_JOBS) $(BUILD_OPTIONS) $(CMAKE_OPTIONS) variant=debug,release,relwithdebinfo --clean-first --target $(patsubst %-ca,%,$@)
$(BUILD_CMD) $(BUILD_JOBS) $(BUILD_OPTIONS) $(CMAKE_OPTIONS) variant=debug,release,relwithdebinfo --clean-first --target $(patsubst %-ca,%,$@)
$(TARGETS_RELEASE):
$(BUILD_SCRIPT) $(BUILD_JOBS) $(BUILD_OPTIONS) $(CMAKE_OPTIONS) variant=release --target $(patsubst %-r,%,$@)
$(BUILD_CMD) $(BUILD_JOBS) $(BUILD_OPTIONS) $(CMAKE_OPTIONS) variant=release --target $(patsubst %-r,%,$@)
$(TARGETS_RELEASE_CLEAN_FIRST):
$(BUILD_SCRIPT) $(BUILD_JOBS) $(BUILD_OPTIONS) $(CMAKE_OPTIONS) variant=release --clean-first --target $(patsubst %-cr,%,$@)
$(BUILD_CMD) $(BUILD_JOBS) $(BUILD_OPTIONS) $(CMAKE_OPTIONS) variant=release --clean-first --target $(patsubst %-cr,%,$@)
$(TARGETS_DEBUG):
$(BUILD_SCRIPT) $(BUILD_JOBS) $(BUILD_OPTIONS) $(CMAKE_OPTIONS) variant=debug --target $(patsubst %-d,%,$@)
$(BUILD_CMD) $(BUILD_JOBS) $(BUILD_OPTIONS) $(CMAKE_OPTIONS) variant=debug --target $(patsubst %-d,%,$@)
$(TARGETS_DEBUG_CLEAN_FIRST):
$(BUILD_SCRIPT) $(BUILD_JOBS) $(BUILD_OPTIONS) $(CMAKE_OPTIONS) variant=debug --target $(patsubst %-cd,%,$@) --clean-first
$(BUILD_CMD) $(BUILD_JOBS) $(BUILD_OPTIONS) $(CMAKE_OPTIONS) variant=debug --target $(patsubst %-cd,%,$@) --clean-first
$(TARGETS_RELWITHDEBINFO):
$(BUILD_SCRIPT) $(BUILD_JOBS) $(BUILD_OPTIONS) $(CMAKE_OPTIONS) variant=relwithdebinfo --target $(patsubst %-p,%,$@)
$(BUILD_CMD) $(BUILD_JOBS) $(BUILD_OPTIONS) $(CMAKE_OPTIONS) variant=relwithdebinfo --target $(patsubst %-p,%,$@)
$(TARGETS_RELWITHDEBINFO_CLEAN_FIRST):
$(BUILD_SCRIPT) $(BUILD_JOBS) $(BUILD_OPTIONS) $(CMAKE_OPTIONS) variant=relwithdebinfo --target $(patsubst %-cp,%,$@) --clean-first
$(BUILD_CMD) $(BUILD_JOBS) $(BUILD_OPTIONS) $(CMAKE_OPTIONS) variant=relwithdebinfo --target $(patsubst %-cp,%,$@) --clean-first
realclean:
$(RM) -rf bin build lib
......
How to build VTM
================
The software uses CMake to create platform-specific build files.
Build instructions for plain CMake (suggested)
----------------------------------------------
**Note:** A working CMake installation is required for building the software.
CMake generates configuration files for the compiler environment/development environment on each platform.
The following is a list of examples for Windows (MS Visual Studio), macOS (Xcode) and Linux (make).
Open a command prompt on your system and change into the root directory of this project.
Create a build directory in the root directory:
```bash
mkdir build
```
Use one of the following CMake commands, based on your platform. Feel free to change the commands to satisfy
your needs.
**Windows Visual Studio 2015 64 Bit:**
```bash
cd build
cmake .. -G "Visual Studio 14 2015 Win64"
```
Then open the generated solution file in MS Visual Studio.
**macOS Xcode:**
```bash
cd build
cmake .. -G "Xcode"
```
Then open the generated work space in Xcode.
**Linux**
For generating Linux Release Makefile:
```bash
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
```
For generating Linux Debug Makefile:
```bash
cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug
```
Then type
```bash
make -j
```
For more details, refer to the CMake documentation: https://cmake.org/cmake/help/latest/
Build instructions for make
---------------------------
**Note:** The build instructions in this section require the make tool and Python to be installed, which are
part of usual Linux and macOS environments. See below for installation instruction for Python and GnuWin32
on Windows.
Open a command prompt on your system and change into the root directory of this project.
To use the default system compiler simply call:
```bash
make all
```
For MSYS2 and MinGW: Open an MSYS MinGW 64-Bit terminal and change into the root directory of this project.
Call:
```bash
make all toolset=gcc
```
Tool Installation on Windows
----------------------------
Download CMake: http://www.cmake.org/ and install it.
Python and GnuWin32 are not mandatory, but they simplify the build process for the user.
python: https://www.python.org/downloads/release/python-371/
gnuwin32: https://sourceforge.net/projects/getgnuwin32/files/getgnuwin32/0.6.30/GetGnuWin32-0.6.3.exe/download
To use MinGW, install MSYS2: http://repo.msys2.org/distrib/msys2-x86_64-latest.exe
Installation instructions: https://www.msys2.org/
Install the needed toolchains:
```bash
pacman -S --needed base-devel mingw-w64-i686-toolchain mingw-w64-x86_64-toolchain git subversion mingw-w64-i686-cmake mingw-w64-x86_64-cmake
```
NextSoftware build howto:
The software uses cmake to create the needed build files.
Download cmake: http://www.cmake.org/ and install it.
Usage:
Open a command prompt on your system and change into the root directory
of this project (location of README.txt).
Create a build directory in the root directory:
mkdir build
After that use one of the following cmake commands. Feel free to change the
commands to satisfy your needs.
Windows sample for Visual Studio 2015 64 Bit:
cd build
cmake .. -G "Visual Studio 14 2015 Win64"
Linux Release Makefile sample:
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
Linux Debug Makefile sample:
cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug
MACOSX Xcode sample:
cd build
cmake .. -G "Xcode"
......@@ -48,9 +48,9 @@ InternalBitDepth : 10 # codec operating bit-depth
#=========== Coding Tools =================
SAO : 1 # Sample adaptive offset (0: OFF, 1: ON)
AMP : 1 # Asymmetric motion partitions (0: OFF, 1: ON)
TransformSkip : 1 # Transform skipping (0: OFF, 1: ON)
TransformSkipFast : 1 # Fast Transform skipping (0: OFF, 1: ON)
TransformSkipLog2MaxSize : 5
SAOLcuBoundary : 0 # SAOLcuBoundary using non-deblocked pixels (0: OFF, 1: ON)
#============ Slices ================
......@@ -77,22 +77,20 @@ PCMFilterDisableFlag : 0 # 0: Enable loop filterin
TransquantBypassEnable : 0 # Value of PPS flag.
CUTransquantBypassFlagForce: 0 # Force transquant bypass mode, when transquant_bypass_enable_flag is enabled
#============ JEM settings ======================
#============ VTM settings ======================
LoopFilterTcOffset_div2 : 0
SEIDecodedPictureHash : 0
CbQpOffset : 0
CrQpOffset : 0
CbQpOffset : 1
CrQpOffset : 1
TemporalSubsampleRatio : 8
#============ NEXT ====================
# General
LargeCTU : 1 # Large CTU
CTUSize : 128
LCTUFast : 1
QuadtreeTULog2MaxSize : 6
QTBT : 1 # QTBT
DualITree : 1 # separate partitioning of luma and chroma channels for I-slices
MinQTLumaISlice : 8
MinQTChromaISlice : 4
......@@ -100,23 +98,31 @@ MinQTNonISlice : 8
MaxBTDepth : 3
MaxBTDepthISliceL : 3
MaxBTDepthISliceC : 3
MTT : 1
EMT : 1
EMTFast : 1
MTS : 1
MTSIntraMaxCand : 3
MTSInterMaxCand : 4
SBT : 1
Affine : 1
SubPuMvp : 1
MaxNumMergeCand : 6
LMChroma : 1 # use CCLM only
DepQuant : 1
IMV : 2
IMV : 1
ALF : 1
IBC : 0 # turned off in CTC
AllowDisFracMMVD : 1
AffineAmvr : 0
LumaReshapeEnable : 1 # luma reshaping. 0: disable 1:enable
# Fast tools
PBIntraFast : 1
FastMrg : 1
AMaxBT : 1
# Encoder optimization tools
AffineAmvrEncOpt : 0
### DO NOT ADD ANYTHING BELOW THIS LINE ###
### DO NOT DELETE THE EMPTY LINE BELOW ###
......
......@@ -56,9 +56,9 @@ InternalBitDepth : 10 # codec operating bit-depth
#=========== Coding Tools =================
SAO : 1 # Sample adaptive offset (0: OFF, 1: ON)
AMP : 1 # Asymmetric motion partitions (0: OFF, 1: ON)
TransformSkip : 1 # Transform skipping (0: OFF, 1: ON)
TransformSkipFast : 1 # Fast Transform skipping (0: OFF, 1: ON)
TransformSkipLog2MaxSize : 5
SAOLcuBoundary : 0 # SAOLcuBoundary using non-deblocked pixels (0: OFF, 1: ON)
#============ Slices ================
......@@ -94,21 +94,19 @@ RCLCUSeparateModel : 1 # Rate control: use LCU l
InitialQP : 0 # Rate control: initial QP
RCForceIntraQP : 0 # Rate control: force intra QP to be equal to initial QP
#============ JEM settings ======================
#============ VTM settings ======================
LoopFilterTcOffset_div2 : 0
SEIDecodedPictureHash : 0
CbQpOffset : 0
CrQpOffset : 0
CbQpOffset : 1
CrQpOffset : 1
#============ NEXT ====================
# General
LargeCTU : 1 # Large CTU
CTUSize : 128
LCTUFast : 1
QuadtreeTULog2MaxSize : 6
QTBT : 1 # QTBT
DualITree : 1 # separate partitioning of luma and chroma channels for I-slices
MinQTLumaISlice : 8
MinQTChromaISlice : 4
......@@ -116,23 +114,32 @@ MinQTNonISlice : 8
MaxBTDepth : 3
MaxBTDepthISliceL : 3
MaxBTDepthISliceC : 3
MTT : 1
EMT : 1
EMTFast : 1
MTS : 1
MTSIntraMaxCand : 3
MTSInterMaxCand : 4
SBT : 1
Affine : 1
SubPuMvp : 1
MaxNumMergeCand : 6
LMChroma : 1 # use CCLM only
DepQuant : 1
IMV : 2
IMV : 1
ALF : 1
MHIntra : 1
IBC : 0 # turned off in CTC
AllowDisFracMMVD : 1
AffineAmvr : 0
LumaReshapeEnable : 1 # luma reshaping. 0: disable 1:enable
# Fast tools
PBIntraFast : 1
FastMrg : 1
AMaxBT : 1
# Encoder optimization tools
AffineAmvrEncOpt : 0
### DO NOT ADD ANYTHING BELOW THIS LINE ###
### DO NOT DELETE THE EMPTY LINE BELOW ###
......
......@@ -56,9 +56,9 @@ InternalBitDepth : 10 # codec operating bit-depth
#=========== Coding Tools =================
SAO : 1 # Sample adaptive offset (0: OFF, 1: ON)
AMP : 1 # Asymmetric motion partitions (0: OFF, 1: ON)
TransformSkip : 1 # Transform skipping (0: OFF, 1: ON)
TransformSkipFast : 1 # Fast Transform skipping (0: OFF, 1: ON)
TransformSkipLog2MaxSize : 5
SAOLcuBoundary : 0 # SAOLcuBoundary using non-deblocked pixels (0: OFF, 1: ON)
#============ Slices ================
......@@ -94,21 +94,19 @@ RCLCUSeparateModel : 1 # Rate control: use LCU l
InitialQP : 0 # Rate control: initial QP
RCForceIntraQP : 0 # Rate control: force intra QP to be equal to initial QP
#============ JEM settings ======================
#============ VTM settings ======================
LoopFilterTcOffset_div2 : 0
SEIDecodedPictureHash : 0
CbQpOffset : 0
CrQpOffset : 0
CbQpOffset : 1
CrQpOffset : 1
#============ NEXT ====================
# General
LargeCTU : 1 # Large CTU
CTUSize : 128
LCTUFast : 1
QuadtreeTULog2MaxSize : 6
QTBT : 1 # QTBT
DualITree : 1 # separate partitioning of luma and chroma channels for I-slices
MinQTLumaISlice : 8
MinQTChromaISlice : 4
......@@ -116,25 +114,35 @@ MinQTNonISlice : 8
MaxBTDepth : 3
MaxBTDepthISliceL : 3
MaxBTDepthISliceC : 3
MTT : 1
EMT : 1
EMTFast : 1
MTS : 1
MTSIntraMaxCand : 3
MTSInterMaxCand : 4
SBT : 1
Affine : 1
SubPuMvp : 1
MaxNumMergeCand : 6
LMChroma : 1 # use CCLM only
DepQuant : 1
IMV : 2
IMV : 1
ALF : 1
GBi : 1
GBiFast : 1
MHIntra : 1
Triangle : 1
IBC : 0 # turned off in CTC
AllowDisFracMMVD : 1
AffineAmvr : 0
LumaReshapeEnable : 1 # luma reshaping. 0: disable 1:enable
# Fast tools
PBIntraFast : 1
FastMrg : 1
AMaxBT : 1
# Encoder optimization tools
AffineAmvrEncOpt : 0
### DO NOT ADD ANYTHING BELOW THIS LINE ###
### DO NOT DELETE THE EMPTY LINE BELOW ###
......
......@@ -70,9 +70,9 @@ InternalBitDepth : 10 # codec operating bit-depth
#=========== Coding Tools =================
SAO : 1 # Sample adaptive offset (0: OFF, 1: ON)
AMP : 1 # Asymmetric motion partitions (0: OFF, 1: ON)
TransformSkip : 1 # Transform skipping (0: OFF, 1: ON)
TransformSkipFast : 1 # Fast Transform skipping (0: OFF, 1: ON)
TransformSkipLog2MaxSize : 5
SAOLcuBoundary : 0 # SAOLcuBoundary using non-deblocked pixels (0: OFF, 1: ON)
#============ Slices ================
......@@ -108,21 +108,19 @@ RCLCUSeparateModel : 1 # Rate control: use LCU l
InitialQP : 0 # Rate control: initial QP
RCForceIntraQP : 0 # Rate control: force intra QP to be equal to initial QP
#============ JEM settings ======================
#============ VTM settings ======================
LoopFilterTcOffset_div2 : 0
SEIDecodedPictureHash : 0
CbQpOffset : 0
CrQpOffset : 0
CbQpOffset : 1
CrQpOffset : 1
#============ NEXT ====================
# General
LargeCTU : 1 # Large CTU
CTUSize : 128
LCTUFast : 1
QuadtreeTULog2MaxSize : 6
QTBT : 1 # QTBT
DualITree : 1 # separate partitioning of luma and chroma channels for I-slices
MinQTLumaISlice : 8
MinQTChromaISlice : 4
......@@ -130,25 +128,37 @@ MinQTNonISlice : 8
MaxBTDepth : 3
MaxBTDepthISliceL : 3
MaxBTDepthISliceC : 3
MTT : 1
EMT : 1
EMTFast : 1
MTS : 1
MTSIntraMaxCand : 3
MTSInterMaxCand : 4
SBT : 1
Affine : 1
SubPuMvp : 1
MaxNumMergeCand : 6
LMChroma : 1 # use CCLM only
DepQuant : 1
IMV : 2
IMV : 1
ALF : 1
GBi : 1
GBiFast : 1
GBiFast : 1
BIO : 1
MHIntra : 1
Triangle : 1
IBC : 0 # turned off in CTC
AllowDisFracMMVD : 1
AffineAmvr : 1
LumaReshapeEnable : 1 # luma reshaping. 0: disable 1:enable
DMVR : 1
# Fast tools
PBIntraFast : 1
FastMrg : 1
AMaxBT : 1
# Encoder optimization tools
AffineAmvrEncOpt : 1
### DO NOT ADD ANYTHING BELOW THIS LINE ###
### DO NOT DELETE THE EMPTY LINE BELOW ###
......
IBC : 1
HashME : 1
#======== File I/O ===============
InputFile : DayStreet_3840x2160_60p_10bit_420_hlg.yuv
InputBitDepth : 10 # Input bitdepth
InputChromaFormat : 420 # Ratio of luminance to chrominance samples
FrameRate : 60 # Frame Rate per second
FrameSkip : 0 # Number of frames to be skipped in input
SourceWidth : 3840 # Input frame width
SourceHeight : 2160 # Input frame height
FramesToBeEncoded : 600 # Number of frames to be coded
Level : 5.1
#======== Chroma QP scale =============
WCGPPSEnable : 0 # enable WCG Chroma scale
# ======== Luma adaptive QP ========
LumaLevelToDeltaQPMode : 0 # Change luma delta QP based on average luma
#======== File I/O ===============
InputFile : FlyingBirds_3840x2160p_60_10b_HLG_420.yuv
InputFile : FlyingBirds2_3840x2160p_60_10b_HLG_420.yuv
InputBitDepth : 10 # Input bitdepth
InputChromaFormat : 420 # Ratio of luminance to chrominance samples
FrameRate : 60 # Frame Rate per second
......
#======== File I/O ===============
InputFile : PeopleInShoppingCenter_3840x2160_60p_10bit_420_hlg.yuv
InputBitDepth : 10 # Input bitdepth
InputChromaFormat : 420 # Ratio of luminance to chrominance samples
FrameRate : 60 # Frame Rate per second
FrameSkip : 0 # Number of frames to be skipped in input
SourceWidth : 3840 # Input frame width
SourceHeight : 2160 # Input frame height
FramesToBeEncoded : 600 # Number of frames to be coded
Level : 5.1
#======== Chroma QP scale =============
WCGPPSEnable : 0 # enable WCG Chroma scale
# ======== Luma adaptive QP ========
LumaLevelToDeltaQPMode : 0 # Change luma delta QP based on average luma
#======== File I/O ===============
InputFile : SunsetBeach_3840x2160p_60_10b_HLG_420.yuv
InputFile : SunsetBeach2_3840x2160p_60_10b_HLG_420.yuv
InputBitDepth : 10 # Input bitdepth
InputChromaFormat : 420 # Ratio of luminance to chrominance samples
FrameRate : 60 # Frame Rate per second
......@@ -14,5 +14,4 @@ Level : 5.1
WCGPPSEnable : 0 # enable WCG Chroma scale
# ======== Luma adaptive QP ========
LumaLevelToDeltaQPMode : 0 # Change luma delta QP based on average luma
LumaLevelToDeltaQPMode : 0 # Change luma delta QP based on average luma
\ No newline at end of file
#======== File I/O ===============
InputFile : SunsetBeach2_3840x2160p_60_10b_HLG_420.yuv
InputBitDepth : 10 # Input bitdepth
InputChromaFormat : 420 # Ratio of luminance to chrominance samples
FrameRate : 60 # Frame Rate per second
FrameSkip : 0 # Number of frames to be skipped in input
SourceWidth : 3840 # Input frame width
SourceHeight : 2160 # Input frame height
FramesToBeEncoded : 600 # Number of frames to be coded
Level : 5.1
#======== Chroma QP scale =============
WCGPPSEnable : 0 # enable WCG Chroma scale
# ======== Luma adaptive QP ========
LumaLevelToDeltaQPMode : 0 # Change luma delta QP based on average luma
#!/usr/bin/env python
#!/usr/bin/python
#
# cmake.py
#
import pyhhi.build.common.util
import pyhhi.cmbuild.app.cmk
import pyhhi.build.app.cmk
app = pyhhi.cmbuild.app.cmk.CMakeLauncherApp()
app = pyhhi.build.app.cmk.CMakeLauncherApp()
pyhhi.build.common.util.exec_main_default_try(app)
#!/usr/bin/env python
#!/usr/bin/python
#
# boost_install.py
# cmake_docutil.py
#
import pyhhi.build.app.cmkdocapp
import pyhhi.build.common.util
import pyhhi.cmbuild.app.boost
app = pyhhi.cmbuild.app.boost.BoostInstallApp()
app = pyhhi.build.app.cmkdocapp.CMakeDocUtilApp()
pyhhi.build.common.util.exec_main_default_try(app)
#!/usr/bin/env python
#!/usr/bin/python
#
# create_ndk_toolchain.py
# cmakebuild_update.py
#
import pyhhi.build.app.cmbldup
import pyhhi.build.common.util
import pyhhi.cmbuild.app.androidapp
app = pyhhi.cmbuild.app.androidapp.CreateNdkToolchainApp()
app = pyhhi.build.app.cmbldup.CMakeBuildUpdateApp()
pyhhi.build.common.util.exec_main_default_try(app)
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
This diff is collapsed.
from __future__ import print_function
import argparse
......@@ -6,7 +7,9 @@ import os.path
import sys
import pyhhi.build.common.util as util
import pyhhi.cmbuild.cmkdoc as cmkdoc
import pyhhi.build.cmkdoc as cmkdoc
from pyhhi.build.common.error import InvalidCommandLineArgumentError, InvalidInputParameterError
class CMakeDocUtilApp(object):
......@@ -19,6 +22,10 @@ class CMakeDocUtilApp(object):
def main(self, argv):
params = self._parse_command_line(argv)
self.update_cmake_manual_docs(params)
def update_cmake_manual_docs(self, params):
self._check_params(params)
cmkdocutil = cmkdoc.CMakeManualRstUtil(dry_run=params.dry_run)
if params.update_action == 'add':
cmkdocutil.add_extension_modules(params.rst_module_filenm, params.extension_module_names,
......@@ -30,19 +37,28 @@ class CMakeDocUtilApp(object):
else:
assert False
def _check_params(self, params):
assert params.rst_module_filenm is not None
if not os.path.exists(params.rst_module_filenm):
raise InvalidInputParameterError("CMake doc module file {} does not exist.".format(params.rst_module_filenm))
def _parse_command_line(self, argv):
params = cmkdoc.CMakeRstUtilParams()
parser = argparse.ArgumentParser()
parser.add_argument("input", action="store", help="specifies the CMake RST module file to be updated.")
parser.add_argument("-m", action="append", dest="module_names",
help="specifies an extension module name, the option must be repeated for each extension module.")
parser.add_argument("-R", action="store_true", dest="remove_all", default=False,
help="remove all non-standard module sections.")
parser.add_argument("-r", action="store_true", dest="remove", default=False,
help="remove a single non-standard module section.")
parser.add_argument("-f", action="store", dest="rst_filenm", required=True,
help="specifies the CMake RST file to be updated.")
parser.add_argument("-o", action="store", dest="output_rst_filenm")
parser.add_argument("-s", action="store", dest="section_title", default="Extension Modules",
help="specifies the section to be updated [default: Extension Modules]")
parser.add_argument("-s", action="store", dest="section_title", default=params.extension_section_title,
help="specifies the section to be updated [default: %(default)s]")
parser.add_argument("--dry-run", action="store_true", dest="dry_run", default=False)
util.app_args_add_log_level(parser)
......@@ -52,9 +68,8 @@ class CMakeDocUtilApp(object):
# configure the python logger asap
util.app_configure_logging(args.log_level)
params = cmkdoc.CMakeRstUtilParams()
params.dry_run = args.dry_run
params.rst_module_filenm = os.path.abspath(args.rst_filenm)
params.rst_module_filenm = os.path.abspath(args.input)
if args.module_names:
params.update_action = 'add'
......@@ -64,8 +79,7 @@ class CMakeDocUtilApp(object):
elif args.remove:
params.update_action = 'remove'
else:
print("No update action specified, use -m, -R or -r.")
sys.exit(1)
raise InvalidCommandLineArgumentError("no update action specified, use -m, -R or -r.")
if args.section_title:
params.extension_section_title = args.section_title
if args.output_rst_filenm:
......
from __future__ import print_function
import logging
import os
import re
import subprocess
import pyhhi.build.common.util as util
import pyhhi.build.common.ver as ver
from pyhhi.build.common.system import SystemInfo
class CMakeFinder(object):
def __init__(self, sys_info=None):
self._logger = logging.getLogger(__name__)
if sys_info is None:
self._sys_info = SystemInfo()
else:
self._sys_info = sys_info
self._cmake_prog = None
self._cmake_version = None
self._cmake_search_path = self._sys_info.get_path()
if self._sys_info.is_windows():
cmake_dir_list = []
cmake_inst_dir = self._query_winreg_cmake_inst_dir()
if cmake_inst_dir is None:
# cmake 3.6.1 is 64 bit but earlier cmake versions are 32 bit only.
if self._sys_info.get_os_arch() == 'x86_64':
cmake_dir_list.append(os.path.join(self._sys_info.get_program_dir('x86_64'), 'CMake', 'bin'))
cmake_dir_list.append(os.path.join(self._sys_info.get_program_dir('x86'), 'CMake', 'bin'))
for cmake_dir in cmake_dir_list:
if os.path.exists(cmake_dir):
if cmake_dir not in self._cmake_search_path:
self._cmake_search_path.append(cmake_dir)
else:
# Append cmake install directory picked up from the registry (3.8.0 or higher).
self._cmake_search_path.append(cmake_inst_dir)
elif self._sys_info.is_macosx():
# The default installation path is /Applications/CMake.app/Contents/bin on MacOSX.
cmake_dir = os.path.join('/Applications', 'CMake.app', 'Contents', 'bin')
if os.path.exists(cmake_dir):
if cmake_dir not in self._cmake_search_path:
self._cmake_search_path.append(cmake_dir)
elif self._sys_info.is_linux():
pass
else:
assert False
def set_cmake_search_path(self, search_path):
if search_path:
self._cmake_search_path = search_path[:]
self._logger.debug("cmake search path changed to: %s", ';'.join(self._cmake_search_path))
def find_cmake(self):
"""Returns the absolute path of a cmake executable."""
if self._cmake_prog is None:
self._logger.debug("cmake search path: %s", ';'.join(self._cmake_search_path))
self._cmake_prog = util.find_tool_on_path('cmake', must_succeed=True, search_path=self._cmake_search_path)
self._cmake_version = self._query_cmake_version(self._cmake_prog)
return self._cmake_prog
def is_cmake_installed(self):
return self.find_cmake() is not None
def get_cmake_version(self):
assert self._cmake_version is not None
return self._cmake_version
def _query_cmake_version(self, cmake_cmd):
retv = subprocess.check_output([cmake_cmd, '--version'], universal_newlines=True)
return self._parse_cmake_version_retv(retv)
def _parse_cmake_version_retv(self, retv):
version_response = retv.rstrip()
lines = version_response.splitlines()
# Possible version information:
# cmake version 3.7.2
# cmake version 3.8.0-rc2
# cmake3 version 3.6.3 # redhat 7.x cmake3
re_version_match = re.match(r'cmake\d*\s+version\s+([0-9]+\.[0-9]+\.[0-9]+)', lines[0], re.IGNORECASE)
if not re_version_match:
raise Exception("cmake has returned an unsupported version string. Please contact technical support.")
self._logger.debug("cmake version: %s", re_version_match.group(1))
return ver.version_tuple_from_str(re_version_match.group(1))
def _query_winreg_cmake_inst_dir(self):
cmake_install_dir = None
if self._sys_info.is_python3():
import winreg
win_registry = winreg
else:
import _winreg
win_registry = _winreg
reg_section = "SOFTWARE\\Kitware\\CMake"
try:
# rkey must be initialized in case OpenKey() does not return but raises an exception.
rkey = None
rkey = win_registry.OpenKey(win_registry.HKEY_LOCAL_MACHINE, reg_section)
install_dir = win_registry.QueryValueEx(rkey, 'InstallDir')[0]
if os.path.exists(os.path.join(install_dir, 'bin', 'cmake.exe')):
cmake_install_dir = os.path.join(install_dir, 'bin')
except WindowsError:
if rkey is not None:
win_registry.CloseKey(rkey)
if cmake_install_dir:
self._logger.debug("cmake install dir (winreg): %s", cmake_install_dir)
else:
self._logger.debug("cmake install dir (winreg): %s", "not found")
return cmake_install_dir
File mode changed from 100644 to 100755
......@@ -134,7 +134,7 @@ class NdkFinder(object):
print("Launching: " + ' '.join(mk_toolchain_args))
# and launch the script to create the new toolchain
subprocess.check_call(mk_toolchain_args)
util.subproc_check_call_flushed(mk_toolchain_args)
if hash_bang_missing:
if os.path.exists(mk_toolchain_script):
......
......@@ -7,6 +7,7 @@ import platform
import re
import shutil
import subprocess
import sys
import tempfile
import textwrap
......@@ -15,36 +16,6 @@ import pyhhi.build.common.util as util
import pyhhi.build.common.ver as ver
class MsvcToolsetSpecDict(object):
def __init__(self):
# Mapping between CMake VC toolsets and Boost.Build VC toolsets if unique.
# VS 2017 updates cl to 19.11.x whereas Boost.Build detects 19.10.x and 19.11.x as msvc-14.1, hence
# no mapping anymore.
self._dict_cmake_msvc_bbuild_msvc = {'msvc-19.0': 'msvc-14.0',
'msvc-18.0': 'msvc-12.0',
'msvc-17.0': 'msvc-11.0',
'msvc-16.0': 'msvc-10.0'}
# Mapping between Boost.Build VC toolsets and CMake VC toolsets.
self._dict_bbuild_msvc_cmake_msvc = {'msvc-14.0': 'msvc-19.0',
'msvc-12.0': 'msvc-18.0',
'msvc-11.0': 'msvc-17.0',
'msvc-10.0': 'msvc-16.0'}
def transform_bbuild_to_cmake(self, toolset):
if toolset in self._dict_bbuild_msvc_cmake_msvc:
return self._dict_bbuild_msvc_cmake_msvc[toolset]
else:
return toolset
def transform_cmake_to_bbuild(self, toolset):
if toolset in self._dict_cmake_msvc_bbuild_msvc:
return self._dict_cmake_msvc_bbuild_msvc[toolset]
else:
return toolset
class MsvcRegistry(object):
class __MsvcRegistry(object):
......@@ -80,11 +51,6 @@ class MsvcRegistry(object):
self._do_inventory_vc141()
self._do_inventory()
def _get_devnull(self):
if not hasattr(self, '_devnull'):
self._devnull = os.open(os.devnull, os.O_RDWR)
return self._devnull
def get_compiler_command(self, version=None):
if version is None:
version = self.get_latest_version()
......@@ -196,14 +162,7 @@ class MsvcRegistry(object):
versionf.write(textwrap.dedent("""\
#pragma message(_MSC_FULL_VER _MSC_BUILD)
""".format()))
python_version = ver.get_python_version()
if ver.version_compare(python_version, (3,3)) >= 0:
# subprocess.DEVNULL since python 3.3
retv = subprocess.check_output([cl_cmd, '/EP', version_file], stderr=subprocess.DEVNULL, universal_newlines=True).lstrip()
else:
self._logger.debug("attribute subprocess.DEVNULL not available (python < 3.3), using os.devnull instead")
devnull = self._get_devnull()
retv = subprocess.check_output([cl_cmd, '/EP', version_file], stderr=devnull, universal_newlines=True).lstrip()
retv = subprocess.check_output([cl_cmd, '/EP', version_file], stderr=self._sys_info.get_subprocess_devnull(), universal_newlines=True).lstrip()
# print("_query_msvc_compiler_versionf(): retv=" + retv)
re_match = re.match(r'#pragma\s+message\(([0-9][0-9])([0-9][0-9])([0-9]+)\s+([0-9]+)\)', retv)
if re_match:
......@@ -1283,7 +1242,7 @@ class FatBinaryTool(object):
# and launch lipo to create the universal binary file.
cmd_line = ' '.join(lipo_argv)
print("Launching: " + cmd_line)
retv = subprocess.call(lipo_argv)
retv = util.subproc_call_flushed(lipo_argv)
if retv != 0:
raise Exception("Creating a universal file failed -> " + cmd_line)
else:
......@@ -1386,7 +1345,7 @@ class DyLibInstallNameInfoInspector(object):
argv.append(depends_dict[key])
argv.append(dylib)
#print("modify_depends(): ", argv)
subprocess.check_call(argv)
util.subproc_check_call_flushed(argv)
def change_rpaths(self, dylib, rpaths_dict):
argv = ['install_name_tool']
......@@ -1396,7 +1355,7 @@ class DyLibInstallNameInfoInspector(object):
argv.append(rpaths_dict[key])
argv.append(dylib)
#print("change_rpaths(): ", argv)
subprocess.check_call(argv)
util.subproc_check_call_flushed(argv)
def delete_rpaths(self, dylib, rpath_list):
argv = ['install_name_tool']
......@@ -1405,36 +1364,26 @@ class DyLibInstallNameInfoInspector(object):
argv.append(rpath)
argv.append(dylib)
#print("change_rpaths(): ", argv)
subprocess.check_call(argv)
util.subproc_check_call_flushed(argv)
def modify_install_name(self, dylib, install_name):
argv = ['install_name_tool', '-id', install_name, dylib]
subprocess.check_call(argv)
util.subproc_check_call_flushed(argv)
class BuildScriptInstaller(object):
def __init__(self, top_dir=None, verbose=False):
def __init__(self, verbose=False):
self._logger = logging.getLogger(__name__)
# print("BuildScriptInstaller.__init__(): __name__=" + __name__)
self._verbose = verbose
self._sys_info = system.SystemInfo()
if top_dir is None:
top_dir = os.getcwd()
else:
assert os.path.exists(top_dir)
self._top_dir = top_dir
def set_verbose(self, verbose):
self._verbose = verbose
def get_top_dir(self):
return self._top_dir
def install_script(self, inst_dir, script, modules, rename=None):
def install_script(self, inst_dir, script, modules):
assert inst_dir is not None
script = os.path.abspath(script)
src_dir = os.path.dirname(script)
module_flist = []
package_dir_set = set()
# python modules are specified in import syntax like "<package>.<name>".
......@@ -1460,16 +1409,27 @@ class BuildScriptInstaller(object):
# make sure all files exist before trying to copy anything.
if not os.path.exists(script):
raise Exception("file " + script + " does not exist.")
# key = module_file_path, value = file system path
# e.g. pyhhi/build/common/ver.py must be mapped to a directory listed by sys.path.
module_flist_src_dict = {}
for f in module_flist:
fpath = os.path.join(src_dir, f)
if not os.path.exists(fpath):
raise Exception("file " + fpath + " does not exist.")
for pth in sys.path:
fpath = os.path.join(pth, f)
if os.path.exists(fpath):
module_flist_src_dict[f] = fpath
break
else:
fpath = None
if fpath is None:
raise Exception("module file {0} not found.".format(fpath))
# create destination directory
if not os.path.exists(inst_dir):
os.makedirs(inst_dir)
for f in module_flist:
fpath_src = os.path.join(src_dir, f)
assert f in module_flist_src_dict
fpath_src = module_flist_src_dict[f]
dname = os.path.dirname(f)
dst_dir = os.path.join(inst_dir, dname)
#print("cp " + fpath_src + " -> " + os.path.join(dst_dir, dname))
......@@ -1481,12 +1441,7 @@ class BuildScriptInstaller(object):
shutil.copy(fpath_src, dst_dir)
# copy the script to <inst_dir>
if rename is None:
if self._verbose:
print("copying %-15s %s" % (os.path.basename(script), inst_dir))
shutil.copy(script, inst_dir)
else:
if self._verbose:
print("copying %-15s %s" % (os.path.basename(script), os.path.join(inst_dir, rename)))
shutil.copy2(script, os.path.join(inst_dir, rename))
if self._verbose:
print("copying %-15s %s" % (os.path.basename(script), inst_dir))
shutil.copy(script, inst_dir)
#-- WARNING --
# This file is automatically generated by CMake.
# Any manual changes here will be overridden by the next build.
#-------------
CMAKE_BUILD_VERSION_STR = "3.13.0.2"
class BaseError(Exception):
"""Base exception with a hint whether to list traceback information or not.
Attributes:
msg -- explanation of the error
list_traceback -- hint to an application level exception handler whether to list traceback information or not.
"""
def __init__(self, msg, list_traceback=True):
self.msg = msg
self.list_traceback = list_traceback
def __str__(self):
return self.msg
class InvalidInputParameterError(BaseError):
"""Exception raised for invalid input parameters."""
def __init__(self, msg, list_traceback=False):
BaseError.__init__(self, msg, list_traceback)
class InvalidCommandLineArgumentError(BaseError):
"""Exception raised for invalid command line arguments."""
def __init__(self, msg, list_traceback=False):
BaseError.__init__(self, msg, list_traceback)
#
# Copyright:
# 2016 Fraunhofer Institute for Telecommunications, Heinrich-Hertz-Institut (HHI)
# The copyright of this software source code is the property of HHI.
# This software may be used and/or copied only with the written permission
# of HHI and in accordance with the terms and conditions stipulated
# in the agreement/contract under which the software has been supplied.
# The software distributed under this license is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either expressed or implied.
#
from __future__ import print_function
import multiprocessing
import logging
import platform
import os
......@@ -41,6 +33,7 @@ class SystemInfo(object):
self._os_distro = platform.platform()
# self._os_distro_short = platform.platform()
self._win32api_installed = False
self._windows_msys = False
self._redhat_system = False
self._debian_system = False
self._suse_system = False
......@@ -50,7 +43,7 @@ class SystemInfo(object):
self._os_codename = 'unknown'
self._os_arch = 'x86_64'
self._os_version = (0, 0, 0)
self._num_processors = 1
self._num_processors = multiprocessing.cpu_count()
platform_system = platform.system().lower()
self._platform_system = platform_system
......@@ -71,13 +64,10 @@ class SystemInfo(object):
# there's no portable way in python to obtain the linux version.
self._query_linux_distro_info()
# there's no portable way in python to obtain the number of installed processors.
self._query_linux_num_cpus()
if self.is_debian():