Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync update to Version 3.5? #14

Open
wants to merge 1 commit into
base: Release_3.5
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .hgtags
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
99fab2ef92be051cd3b3b2d817064cead282b42c 0.1
b3471d9009f5cd487b23c8c61a6bfff8980e54f2 0.2
3767fbfa970ff4b2dc2e8647db0274168727147e 0.3
2ba6ec553f218d2b06ad803b87d6ec751fd639f7 0.4
93707bc4fccdaa89a1f2da11db8808ca912a691c 0.4.1
69acb3cb777f977f5edde908069ac565915dd366 0.5
b970ffbdd696e3ce45c93b315902eb6366ff085e 0.6
d24e2a8c4326b0cd01bfa6c414c5378481af9018 0.7
527d03c56d6860dc979ddea1196f7e94d13d3e82 0.8
82bbd2bf3b49ba086be0f0922f91fe0084896351 0.9
cea97c4d79456842e00ade6be6fd5ec34610e5f8 1.0
ae9609aeebdc3271114168ece003679e9b1dca1b 1.1
d6257335c5370ee54317a0426a12c1f0724b18b9 1.2
c1e4fc0162c14fdb84f5c3bd404fb28cfe10a17f 1.3
5e604833c5aa605d0b6efbe5234492b5e7d8ac61 1.4
9f0324125f53a12f766f6ed6f98f16e2f42337f4 1.5
cbeb7d8a4880e4020c4545dd8e498432c3c6cad3 1.6
8425278def1edf0931dc33fc518e1950063e76b0 1.7
e27327f5da35c5feb660360336fdc94bd0afe719 1.8
1d3b6e448e01ec40b392ef78b7e55a86249fbe68 1.9
960c9991d0dcf46559c32e070418d3cbb7e8aa2f 2.0
981e3bfef16a997bce6f46ce1b15631a0e234747 2.1
be14a7e9755e54f0fd34911c72bdfa66981220bc 2.2
3037c1448549ca920967831482c653e5892fa8ed 2.3
e7a4dd48293b7956d4a20df257d23904cc78e376 2.4
64b2d0bf45a52511e57a6b7299160b961ca3d51c 2.5
0e9ea76945c89962cd46cee6537586e2054b2935 2.6
e41a9bf2bac4a7af2bec2bbadf91e63752d320ef 2.7
a158a3a029663133455268e2a63ae6b0af2df720 2.8
f9681d731f2e56c2ca185cec10daece5939bee07 2.9
bad4e598cac7cdd3df4623c68c91299c620471bd 3.0-rc
bad4e598cac7cdd3df4623c68c91299c620471bd 3.0-rc
0000000000000000000000000000000000000000 3.0-rc
1307fd7b2b9984f45179db01432305a416713049 3.0_RC
72188bd2f03447e71e789a5fd2f10364bb232c2c 3.0
113518629fa54ffb491dd479e15c1f00dd39d376 3.1_RC1
b4e38ce16d7c4b37a6482dc7ae61fd31071b6ff1 3.1_RC2
20c9994e8bfbeb9443851b2b3a050cd98c8b147b 3.2_RC1
353572437201d551381002aebf20d244bd49ef17 3.2
5ee3593ebd82b4d8957909bbc1b68b99b59ba773 3.3_RC1
96a10df63c0b778b480330bdf3be8da7db8a5fb1 3.3_RC2
057215961bc4b51b6260a584ff3d506e6d65cfd6 3.3
ee92f36782800f145970131e01c79955a3ed5c10 3.4_RC1
15 changes: 15 additions & 0 deletions build/aarch64-darwin/crosscompile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# CMake toolchain file for cross compiling x265 for aarch64
# This feature is only supported as experimental. Use with caution.
# Please report bugs on bitbucket
# Run cmake with: cmake -DCMAKE_TOOLCHAIN_FILE=crosscompile.cmake -G "Unix Makefiles" ../../source && ccmake ../../source

set(CROSS_COMPILE_ARM64 1)
set(CMAKE_SYSTEM_NAME Darwin)
set(CMAKE_SYSTEM_PROCESSOR aarch64)

# specify the cross compiler
set(CMAKE_C_COMPILER gcc-12)
set(CMAKE_CXX_COMPILER g++-12)

# specify the target environment
SET(CMAKE_FIND_ROOT_PATH /opt/homebrew/bin/)
4 changes: 4 additions & 0 deletions build/aarch64-darwin/make-Makefiles.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
# Run this from within a bash shell

cmake -DCMAKE_TOOLCHAIN_FILE="crosscompile.cmake" -G "Unix Makefiles" ../../source && ccmake ../../source
2 changes: 1 addition & 1 deletion build/aarch64-linux/crosscompile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Please report bugs on bitbucket
# Run cmake with: cmake -DCMAKE_TOOLCHAIN_FILE=crosscompile.cmake -G "Unix Makefiles" ../../source && ccmake ../../source

set(CROSS_COMPILE_ARM 1)
set(CROSS_COMPILE_ARM64 1)
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR aarch64)

Expand Down
2 changes: 1 addition & 1 deletion build/arm-linux/make-Makefiles.bash
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
# Run this from within a bash shell

cmake -G "Unix Makefiles" ../../source && ccmake ../../source
cmake -DCMAKE_TOOLCHAIN_FILE="crosscompile.cmake" -G "Unix Makefiles" ../../source && ccmake ../../source
248 changes: 199 additions & 49 deletions doc/reST/cli.rst

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion doc/reST/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,6 @@ software applications created from the x265 source code. A good place
to start is with the `Motion Picture Experts Group - Licensing Authority
- HEVC Licensing Program <http://www.mpegla.com/main/PID/HEVC/default.aspx>`_.

x265 is a registered trademark of MulticoreWare, Inc. The x265 logo is
x265 is a registered trademark of MulticoreWare, Inc. The X265 logo is
a trademark of MulticoreWare, and may only be used with explicit written
permission. All rights reserved.
27 changes: 27 additions & 0 deletions doc/reST/releasenotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,33 @@
Release Notes
*************

Version 3.5
===========

Release date - 16th March, 2021.

New feature
-----------
1. Real-time VBV for ABR (Average BitRate) encodes in –pass 2 using :option:`--vbv-live-multi-pass`: Improves VBV compliance with no significant impact on coding efficiency.

Enhancements to existing features
---------------------------------
1. Improved hist-based scene cut algorithm: Reduces false positives by leveraging motion and scene transition info.
2. Support for RADL pictures at IDR scene cuts: Improves coding efficiency with no significant impact on performance.
3. Bidirectional scene cut aware Frame Quantizer Selection: Saves bits than forward masking with no noticeable perceptual quality difference.

API changes
-----------
1. Additions to x265_param structure to support the newly added features and encoder enhancements.
2. New x265_param options :option:`--min-vbv-fullness` and :option:`--max-vbv-fullness` to control min and max VBV fullness.

Bug fixes
---------
1. Incorrect VBV lookahead in :option:`--analysis-load` + :option:`--scale-factor`.
2. Encoder hang when VBV is used with slices.
3. QP spikes in the row-level VBV rate-control when WPP enabled.
4. Encoder crash in :option:`--abr-ladder`.

Version 3.4
===========

Expand Down
2 changes: 1 addition & 1 deletion readme.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
x265 HEVC Encoder
=================

| **Read:** | Online `documentation <http://x265.readthedocs.org/en/default/>`_ | Developer `wiki <http://bitbucket.org/multicoreware/x265/wiki/>`_
| **Read:** | Online `documentation <http://x265.readthedocs.org/en/master/>`_ | Developer `wiki <http://bitbucket.org/multicoreware/x265_git/wiki/>`_
| **Download:** | `releases <http://ftp.videolan.org/pub/videolan/x265/>`_
| **Interact:** | #x265 on freenode.irc.net | `[email protected] <http://mailman.videolan.org/listinfo/x265-devel>`_ | `Report an issue <https://bitbucket.org/multicoreware/x265/issues?status=new&status=open>`_

Expand Down
95 changes: 63 additions & 32 deletions source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ option(NATIVE_BUILD "Target the build CPU" OFF)
option(STATIC_LINK_CRT "Statically link C runtime for release builds" OFF)
mark_as_advanced(FPROFILE_USE FPROFILE_GENERATE NATIVE_BUILD)
# X265_BUILD must be incremented each time the public API is changed
set(X265_BUILD 199)
set(X265_BUILD 208)
configure_file("${PROJECT_SOURCE_DIR}/x265.def.in"
"${PROJECT_BINARY_DIR}/x265.def")
configure_file("${PROJECT_SOURCE_DIR}/x265_config.h.in"
Expand All @@ -38,14 +38,20 @@ configure_file("${PROJECT_SOURCE_DIR}/x265_config.h.in"
SET(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" "${CMAKE_MODULE_PATH}")

# System architecture detection
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" SYSPROC)
if (APPLE AND CMAKE_OSX_ARCHITECTURES)
string(TOLOWER "${CMAKE_OSX_ARCHITECTURES}" SYSPROC)
else()
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" SYSPROC)
endif()
set(X86_ALIASES x86 i386 i686 x86_64 amd64)
set(ARM_ALIASES armv6l armv7l aarch64)
set(ARM_ALIASES armv6l armv7l)
set(ARM64_ALIASES arm64 arm64e aarch64)
list(FIND X86_ALIASES "${SYSPROC}" X86MATCH)
list(FIND ARM_ALIASES "${SYSPROC}" ARMMATCH)
list(FIND ARM64_ALIASES "${SYSPROC}" ARM64MATCH)
set(POWER_ALIASES ppc64 ppc64le)
list(FIND POWER_ALIASES "${SYSPROC}" POWERMATCH)
if("${SYSPROC}" STREQUAL "" OR X86MATCH GREATER "-1")
if(X86MATCH GREATER "-1")
set(X86 1)
add_definitions(-DX265_ARCH_X86=1)
if(CMAKE_CXX_FLAGS STREQUAL "-m32")
Expand All @@ -70,15 +76,18 @@ elseif(ARMMATCH GREATER "-1")
else()
set(CROSS_COMPILE_ARM 0)
endif()
message(STATUS "Detected ARM target processor")
set(ARM 1)
if("${CMAKE_SIZEOF_VOID_P}" MATCHES 8)
message(STATUS "Detected ARM64 target processor")
set(ARM64 1)
add_definitions(-DX265_ARCH_ARM=1 -DX265_ARCH_ARM64=1 -DHAVE_ARMV6=0)
else()
message(STATUS "Detected ARM target processor")
add_definitions(-DX265_ARCH_ARM=1 -DX265_ARCH_ARM64=0 -DHAVE_ARMV6=1)
endif()
add_definitions(-DX265_ARCH_ARM=1 -DHAVE_ARMV6=1)
elseif(ARM64MATCH GREATER "-1")
#if(CROSS_COMPILE_ARM64)
#message(STATUS "Cross compiling for ARM64 arch")
#else()
#set(CROSS_COMPILE_ARM64 0)
#endif()
message(STATUS "Detected ARM64 target processor")
set(ARM64 1)
add_definitions(-DX265_ARCH_ARM64=1 -DHAVE_NEON)
else()
message(STATUS "CMAKE_SYSTEM_PROCESSOR value `${CMAKE_SYSTEM_PROCESSOR}` is unknown")
message(STATUS "Please add this value near ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE}")
Expand Down Expand Up @@ -239,26 +248,27 @@ if(GCC)
endif()
endif()
if(ARM AND CROSS_COMPILE_ARM)
if(ARM64)
set(ARM_ARGS -fPIC)
else()
set(ARM_ARGS -march=armv6 -mfloat-abi=soft -mfpu=vfp -marm -fPIC)
endif()
message(STATUS "cross compile arm")
set(ARM_ARGS -march=armv6 -mfloat-abi=soft -mfpu=vfp -marm -fPIC)
elseif(ARM)
if(ARM64)
set(ARM_ARGS -fPIC)
find_package(Neon)
if(CPU_HAS_NEON)
set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=neon -marm -fPIC)
add_definitions(-DHAVE_NEON)
else()
find_package(Neon)
if(CPU_HAS_NEON)
set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=neon -marm -fPIC)
add_definitions(-DHAVE_NEON)
else()
set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=vfp -marm)
endif()
set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=vfp -marm)
endif()
endif()
if(ARM64 OR CROSS_COMPILE_ARM64)
set(ARM_ARGS -fPIC -flax-vector-conversions)
find_package(Neon)
if(CPU_HAS_NEON)
add_definitions(-DHAVE_NEON)
endif()
endif()
if(ENABLE_PIC)
list(APPEND ARM_ARGS -DPIC)
endif()
add_definitions(${ARM_ARGS})
if(FPROFILE_GENERATE)
if(INTEL_CXX)
Expand Down Expand Up @@ -350,7 +360,7 @@ if(GCC)
endif(GCC)

find_package(Nasm)
if(ARM OR CROSS_COMPILE_ARM)
if(ARM OR CROSS_COMPILE_ARM OR ARM64 OR CROSS_COMPILE_ARM64)
option(ENABLE_ASSEMBLY "Enable use of assembly coded primitives" ON)
elseif(NASM_FOUND AND X86)
if (NASM_VERSION_STRING VERSION_LESS "2.13.0")
Expand Down Expand Up @@ -440,6 +450,18 @@ else()
endif()
add_definitions(-DX265_NS=${X265_NS})

if(ARM64)
if(HIGH_BIT_DEPTH)
if(MAIN12)
list(APPEND ASM_FLAGS -DHIGH_BIT_DEPTH=1 -DBIT_DEPTH=12 -DX265_NS=${X265_NS})
else()
list(APPEND ASM_FLAGS -DHIGH_BIT_DEPTH=1 -DBIT_DEPTH=10 -DX265_NS=${X265_NS})
endif()
else()
list(APPEND ASM_FLAGS -DHIGH_BIT_DEPTH=0 -DBIT_DEPTH=8 -DX265_NS=${X265_NS})
endif()
endif(ARM64)

option(WARNINGS_AS_ERRORS "Stop compiles on first warning" OFF)
if(WARNINGS_AS_ERRORS)
if(GCC)
Expand Down Expand Up @@ -536,11 +558,7 @@ if((MSVC_IDE OR XCODE OR GCC) AND ENABLE_ASSEMBLY)
# compile ARM arch asm files here
enable_language(ASM)
foreach(ASM ${ARM_ASMS})
if(ARM64)
set(ASM_SRC ${CMAKE_CURRENT_SOURCE_DIR}/common/aarch64/${ASM})
else()
set(ASM_SRC ${CMAKE_CURRENT_SOURCE_DIR}/common/arm/${ASM})
endif()
set(ASM_SRC ${CMAKE_CURRENT_SOURCE_DIR}/common/arm/${ASM})
list(APPEND ASM_SRCS ${ASM_SRC})
list(APPEND ASM_OBJS ${ASM}.${SUFFIX})
add_custom_command(
Expand All @@ -549,6 +567,19 @@ if((MSVC_IDE OR XCODE OR GCC) AND ENABLE_ASSEMBLY)
ARGS ${ARM_ARGS} -c ${ASM_SRC} -o ${ASM}.${SUFFIX}
DEPENDS ${ASM_SRC})
endforeach()
elseif(ARM64 OR CROSS_COMPILE_ARM64)
# compile ARM64 arch asm files here
enable_language(ASM)
foreach(ASM ${ARM_ASMS})
set(ASM_SRC ${CMAKE_CURRENT_SOURCE_DIR}/common/aarch64/${ASM})
list(APPEND ASM_SRCS ${ASM_SRC})
list(APPEND ASM_OBJS ${ASM}.${SUFFIX})
add_custom_command(
OUTPUT ${ASM}.${SUFFIX}
COMMAND ${CMAKE_CXX_COMPILER}
ARGS ${ARM_ARGS} ${ASM_FLAGS} -c ${ASM_SRC} -o ${ASM}.${SUFFIX}
DEPENDS ${ASM_SRC})
endforeach()
elseif(X86)
# compile X86 arch asm files here
foreach(ASM ${MSVC_ASMS})
Expand Down
28 changes: 14 additions & 14 deletions source/abrEncApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,16 @@ namespace X265_NS {
}
}

if (m_cliopt.zoneFile)
{
if (!m_cliopt.parseZoneFile())
{
x265_log(NULL, X265_LOG_ERROR, "Unable to parse zonefile in %s\n");
fclose(m_cliopt.zoneFile);
m_cliopt.zoneFile = NULL;
}
}

/* note: we could try to acquire a different libx265 API here based on
* the profile found during option parsing, but it must be done before
* opening an encoder */
Expand Down Expand Up @@ -499,10 +509,10 @@ namespace X265_NS {

void PassEncoder::threadMain()
{
THREAD_NAME("PassEncoder", m_id);

while (m_threadActive)
{
THREAD_NAME("PassEncoder", m_id);
while (m_threadActive)
{

#if ENABLE_LIBVMAF
x265_vmaf_data* vmafdata = m_cliopt.vmafData;
Expand All @@ -515,16 +525,6 @@ namespace X265_NS {
reconPlay = new ReconPlay(m_cliopt.reconPlayCmd, *m_param);
char* profileName = m_cliopt.encName ? m_cliopt.encName : (char *)"x265";

if (m_cliopt.zoneFile)
{
if (!m_cliopt.parseZoneFile())
{
x265_log(NULL, X265_LOG_ERROR, "Unable to parse zonefile in %s\n", profileName);
fclose(m_cliopt.zoneFile);
m_cliopt.zoneFile = NULL;
}
}

if (signal(SIGINT, sigint_handler) == SIG_ERR)
x265_log(m_param, X265_LOG_ERROR, "Unable to register CTRL+C handler: %s in %s\n",
strerror(errno), profileName);
Expand Down
1 change: 1 addition & 0 deletions source/abrEncApp.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ namespace X265_NS {
FILE* m_qpfile;
FILE* m_zoneFile;
FILE* m_dolbyVisionRpu;/* File containing Dolby Vision BL RPU metadata */
FILE* m_scenecutAwareQpConfig;

int m_ret;

Expand Down
17 changes: 13 additions & 4 deletions source/cmake/FindNeon.cmake
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
include(FindPackageHandleStandardArgs)

# Check the version of neon supported by the ARM CPU
execute_process(COMMAND cat /proc/cpuinfo | grep Features | grep neon
OUTPUT_VARIABLE neon_version
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(APPLE)
execute_process(COMMAND sysctl -a
COMMAND grep "hw.optional.neon: 1"
OUTPUT_VARIABLE neon_version
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
else()
execute_process(COMMAND cat /proc/cpuinfo | grep Features | grep neon
OUTPUT_VARIABLE neon_version
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()

if(neon_version)
set(CPU_HAS_NEON 1)
endif()
Loading