Projects
Essentials
x265
Sign Up
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 28
View file
x265.changes
Changed
@@ -1,4 +1,36 @@ ------------------------------------------------------------------- +Thu Mar 1 23:14:47 UTC 2018 - zaitor@opensuse.org + +- Update to version 2.7: + * New features: + - option:`--gop-lookahead` can be used to extend the gop + boundary(set by `--keyint`). The GOP will be extended, if a + scene-cut frame is found within this many number of frames. + - Support for RADL pictures added in x265. + - option:`--radl` can be used to decide number of RADL pictures + preceding the IDR picture. + * Encoder enhancements: + - Moved from YASM to NASM assembler. Supports NASM assembler + version 2.13 and greater. + - Enable analysis save and load in a single run. Introduces two + new cli options `--analysis-save <filename>` and + `--analysis-load <filename>`. + - Comply to HDR10+ LLC specification. + - Reduced x265 build time by more than 50% by re-factoring + ipfilter.asm. + * Bug fixes: + - Fixed inconsistent output issue in deblock filter and + --const-vbv. + - Fixed Mac OS build warnings. + - Fixed inconsistency in pass-2 when weightp and cutree are + enabled. + - Fixed deadlock issue due to dropping of BREF frames, while + forcing slice types through qp file. +- Bump soname to 151, also in baselibs.conf following upstream + changes. +- Replace yasm with nasm BuildRequires following upstreams changes. + +------------------------------------------------------------------- Fri Dec 01 16:40:13 UTC 2017 - joerg.lorenzen@ki.tng.de - Update to version 2.6
View file
x265.spec
Changed
@@ -1,10 +1,10 @@ # based on the spec file from https://build.opensuse.org/package/view_file/home:Simmphonie/libx265/ Name: x265 -%define soname 146 +%define soname 151 %define libname lib%{name} %define libsoname %{libname}-%{soname} -Version: 2.6 +Version: 2.7 Release: 0 License: GPL-2.0+ Summary: A free h265/HEVC encoder - encoder binary @@ -13,16 +13,19 @@ Source0: https://bitbucket.org/multicoreware/x265/downloads/%{name}_%{version}.tar.gz Patch0: arm.patch Patch1: x265.pkgconfig.patch -BuildRequires: gcc gcc-c++ +BuildRequires: gcc +BuildRequires: gcc-c++ BuildRequires: cmake >= 2.8.8 BuildRequires: pkg-config -BuildRequires: yasm >= 1.2.0 -BuildRoot: %{_tmppath}/%{name}-%{version}-build +%if 0%{?suse_version} >=1500 +BuildRequires: nasm >= 2.13 +%endif %if 0%{?suse_version} > 1310 %ifarch x86_64 BuildRequires: libnuma-devel >= 2.0.9 %endif %endif +BuildRoot: %{_tmppath}/%{name}-%{version}-build %description x265 is a free library for encoding next-generation H265/HEVC video @@ -49,7 +52,7 @@ streams. %prep -%setup -q -n %{name}_v%{version} +%setup -q -n %{name}_%{version} %patch0 -p1 %patch1 -p1
View file
baselibs.conf
Changed
@@ -1,1 +1,1 @@ -libx265-130 +libx265-151
View file
x265_2.6.tar.gz/source/cmake/CMakeASM_YASMInformation.cmake
Deleted
@@ -1,68 +0,0 @@ -set(ASM_DIALECT "_YASM") -set(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS asm) - -if(X64) - list(APPEND ASM_FLAGS -DARCH_X86_64=1) - if(ENABLE_PIC) - list(APPEND ASM_FLAGS -DPIC) - endif() - if(APPLE) - set(ARGS -f macho64 -m amd64 -DPREFIX) - elseif(UNIX AND NOT CYGWIN) - set(ARGS -f elf64 -m amd64) - else() - set(ARGS -f win64 -m amd64) - endif() -else() - list(APPEND ASM_FLAGS -DARCH_X86_64=0) - if(APPLE) - set(ARGS -f macho -DPREFIX) - elseif(UNIX AND NOT CYGWIN) - set(ARGS -f elf32) - else() - set(ARGS -f win32 -DPREFIX) - endif() -endif() - -if(GCC) - list(APPEND ASM_FLAGS -DHAVE_ALIGNED_STACK=1) -else() - list(APPEND ASM_FLAGS -DHAVE_ALIGNED_STACK=0) -endif() - -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() - -list(APPEND ASM_FLAGS "${CMAKE_ASM_YASM_FLAGS}") - -if(CMAKE_BUILD_TYPE MATCHES Release) - list(APPEND ASM_FLAGS "${CMAKE_ASM_YASM_FLAGS_RELEASE}") -elseif(CMAKE_BUILD_TYPE MATCHES Debug) - list(APPEND ASM_FLAGS "${CMAKE_ASM_YASM_FLAGS_DEBUG}") -elseif(CMAKE_BUILD_TYPE MATCHES MinSizeRel) - list(APPEND ASM_FLAGS "${CMAKE_ASM_YASM_FLAGS_MINSIZEREL}") -elseif(CMAKE_BUILD_TYPE MATCHES RelWithDebInfo) - list(APPEND ASM_FLAGS "${CMAKE_ASM_YASM_FLAGS_RELWITHDEBINFO}") -endif() - -set(YASM_FLAGS ${ARGS} ${ASM_FLAGS} PARENT_SCOPE) -string(REPLACE ";" " " CMAKE_ASM_YASM_COMPILER_ARG1 "${ARGS}") - -# This section exists to override the one in CMakeASMInformation.cmake -# (the default Information file). This removes the <FLAGS> -# thing so that your C compiler flags that have been set via -# set_target_properties don't get passed to yasm and confuse it. -if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT) - string(REPLACE ";" " " STR_ASM_FLAGS "${ASM_FLAGS}") - set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> ${STR_ASM_FLAGS} -o <OBJECT> <SOURCE>") -endif() - -include(CMakeASMInformation) -set(ASM_DIALECT)
View file
x265_2.6.tar.gz/source/cmake/CMakeDetermineASM_YASMCompiler.cmake
Deleted
@@ -1,5 +0,0 @@ -set(ASM_DIALECT "_YASM") -set(CMAKE_ASM${ASM_DIALECT}_COMPILER ${YASM_EXECUTABLE}) -set(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT ${_CMAKE_TOOLCHAIN_PREFIX}yasm) -include(CMakeDetermineASMCompiler) -set(ASM_DIALECT)
View file
x265_2.6.tar.gz/source/cmake/CMakeTestASM_YASMCompiler.cmake
Deleted
@@ -1,3 +0,0 @@ -set(ASM_DIALECT "_YASM") -include(CMakeTestASMCompiler) -set(ASM_DIALECT)
View file
x265_2.6.tar.gz/source/cmake/FindYasm.cmake
Deleted
@@ -1,25 +0,0 @@ -include(FindPackageHandleStandardArgs) - -# Simple path search with YASM_ROOT environment variable override -find_program(YASM_EXECUTABLE - NAMES yasm yasm-1.2.0-win32 yasm-1.2.0-win64 yasm yasm-1.3.0-win32 yasm-1.3.0-win64 - HINTS $ENV{YASM_ROOT} ${YASM_ROOT} - PATH_SUFFIXES bin -) - -if(YASM_EXECUTABLE) - execute_process(COMMAND ${YASM_EXECUTABLE} --version - OUTPUT_VARIABLE yasm_version - ERROR_QUIET - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - if(yasm_version MATCHES "^yasm ([0-9\\.]*)") - set(YASM_VERSION_STRING "${CMAKE_MATCH_1}") - endif() - unset(yasm_version) -endif() - -# Provide standardized success/failure messages -find_package_handle_standard_args(yasm - REQUIRED_VARS YASM_EXECUTABLE - VERSION_VAR YASM_VERSION_STRING)
View file
x265_2.6.tar.gz/.hg_archival.txt -> x265_2.7.tar.gz/.hg_archival.txt
Changed
@@ -1,4 +1,4 @@ repo: 09fe40627f03a0f9c3e6ac78b22ac93da23f9fdf -node: 0e9ea76945c89962cd46cee6537586e2054b2935 +node: e41a9bf2bac4a7af2bec2bbadf91e63752d320ef branch: stable -tag: 2.6 +tag: 2.7
View file
x265_2.6.tar.gz/.hgtags -> x265_2.7.tar.gz/.hgtags
Changed
@@ -24,3 +24,4 @@ 3037c1448549ca920967831482c653e5892fa8ed 2.3 e7a4dd48293b7956d4a20df257d23904cc78e376 2.4 64b2d0bf45a52511e57a6b7299160b961ca3d51c 2.5 +0e9ea76945c89962cd46cee6537586e2054b2935 2.6
View file
x265_2.6.tar.gz/build/README.txt -> x265_2.7.tar.gz/build/README.txt
Changed
@@ -9,7 +9,8 @@ = Optional Prerequisites = -1. Yasm 1.2.0 or later, to compile assembly primitives (performance) +1. To compile assembly primitives (performance) + a) If you are using release 2.6 or older, download and install Yasm 1.2.0 or later, For Windows, download the latest yasm executable http://yasm.tortall.net/Download.html and copy the EXE into @@ -33,6 +34,24 @@ If cpu capabilities line says 'none!', then the encoder was built without yasm. + b) If you are building from the default branch after release 2.6, download and install nasm 2.13 or newer + + For windows and linux, you can download the nasm installer from http://www.nasm.us/pub/nasm/releasebuilds/?C=M;O=D. + Make sure that it is in your PATH environment variable (%PATH% in windows, and $PATH in linux) so that cmake + can find it. + + Once NASM is properly installed, run cmake to regenerate projects. If you + do not see the below line in the cmake output, NASM is not in the PATH. + + -- Found Nasm 2.13 to build assembly primitives + + Now build the encoder and run x265 -V: + + x265 [info]: using cpu capabilities: MMX, SSE2, ... + + If cpu capabilities line says 'none!', then the encoder was built + without nasm and will be considerably slower for performance. + 2. VisualLeakDetector (Windows Only) Download from https://vld.codeplex.com/releases and install. May need
View file
x265_2.6.tar.gz/doc/reST/api.rst -> x265_2.7.tar.gz/doc/reST/api.rst
Changed
@@ -206,7 +206,7 @@ /* x265_get_ref_frame_list: * returns negative on error, 0 when access unit were output. * This API must be called after(poc >= lookaheadDepth + bframes + 2) condition check */ - int x265_get_ref_frame_list(x265_encoder *encoder, x265_picyuv**, x265_picyuv**, int, int); + int x265_get_ref_frame_list(x265_encoder *encoder, x265_picyuv**, x265_picyuv**, int, int, int*, int*); **x265_encoder_ctu_info** may be used to provide additional CTU-specific information to the encoder::
View file
x265_2.6.tar.gz/doc/reST/cli.rst -> x265_2.7.tar.gz/doc/reST/cli.rst
Changed
@@ -863,21 +863,22 @@ sequence multiple times (presumably at varying bitrates). The encoder will not reuse analysis if slice type parameters do not match. -.. option:: --analysis-reuse-mode <string|int> +.. option:: --analysis-save <filename> - This option allows reuse of analysis information from first pass to second pass. - :option:`--analysis-reuse-mode save` specifies that encoder outputs analysis information of each frame. - :option:`--analysis-reuse-mode load` specifies that encoder reuses analysis information from first pass. - There is no benefit using load mode without running encoder in save mode. Analysis data from save mode is - written to a file specified by :option:`--analysis-reuse-file`. The amount of analysis data stored/reused - is determined by :option:`--analysis-reuse-level`. By reading the analysis data writen by an earlier encode - of the same sequence, substantial redundant work may be avoided. Requires cutree, pmode to be off. Default 0. + Encoder outputs analysis information of each frame. Analysis data from save mode is + written to the file specified. Requires cutree, pmode to be off. Default disabled. + +.. option:: --analysis-load <filename> + + Encoder reuses analysis information from the file specified. By reading the analysis data writen by + an earlier encode of the same sequence, substantial redundant work may be avoided. Requires cutree, pmode + to be off. Default disabled. - **Values:** off(0), save(1): dump analysis data, load(2): read analysis data + The amount of analysis data stored/reused is determined by :option:`--analysis-reuse-level`. .. option:: --analysis-reuse-file <filename> - Specify a filename for analysis data (see :option:`--analysis-reuse-mode`) + Specify a filename for `multi-pass-opt-analysis` and `multi-pass-opt-distortion`. If no filename is specified, x265_analysis.dat is used. .. option:: --analysis-reuse-level <1..10> @@ -1028,7 +1029,13 @@ Level 4 - uses the depth of the neighbouring/ co-located CUs TU depth to limit the 1st subTU depth. The 1st subTU depth is taken as the limiting depth for the other subTUs. - + + Enabling levels 3 or 4 may cause a mismatch in the output bitstreams + between option:`--analysis-save` and option:`--analysis-load` + as all neighbouring CUs TU depth may not be available in the + option:`--analysis-load` run as only the best mode's information is + available to it. + Default: 0 .. option:: --nr-intra <integer>, --nr-inter <integer> @@ -1344,7 +1351,14 @@ This value represents the percentage difference between the inter cost and intra cost of a frame used in scenecut detection. For example, a value of 5 indicates, if the inter cost of a frame is greater than or equal to 95 percent of the intra cost of the frame, - then detect this frame as scenecut. Values between 5 and 15 are recommended. Default 5. + then detect this frame as scenecut. Values between 5 and 15 are recommended. Default 5. + +.. option:: --radl <integer> + + Number of RADL pictures allowed infront of IDR. Requires fixed keyframe interval. + Recommended value is 2-3. Default 0 (disabled). + + **Range of values: Between 0 and `--bframes` .. option:: --ctu-info <0, 1, 2, 4, 6> @@ -1373,6 +1387,16 @@ Default 20 **Range of values:** Between the maximum consecutive bframe count (:option:`--bframes`) and 250 +.. option:: --gop-lookahead <integer> + + Number of frames for GOP boundary decision lookahead. If a scenecut frame is found + within this from the gop boundary set by `--keyint`, the GOP will be extented until such a point, + otherwise the GOP will be terminated as set by `--keyint`. Default 0. + + **Range of values:** Between 0 and (`--rc-lookahead` - mini-GOP length) + + It is recommended to have `--gop-lookahaed` less than `--min-keyint` as scenecuts beyond + `--min-keyint` are already being coded as keyframes. .. option:: --lookahead-slices <0..16> @@ -2040,7 +2064,7 @@ Example for MaxCLL=1000 candela per square meter, MaxFALL=400 candela per square meter: - --max-cll 1000,400 + --max-cll "1000,400" Note that this string value will need to be escaped or quoted to protect against shell expansion on many platforms. No default.
View file
x265_2.6.tar.gz/doc/reST/releasenotes.rst -> x265_2.7.tar.gz/doc/reST/releasenotes.rst
Changed
@@ -2,6 +2,32 @@ Release Notes ************* +Version 2.7 +=========== + +Release date - 21st Feb, 2018. + +New features +------------ +1. :option:`--gop-lookahead` can be used to extend the gop boundary(set by `--keyint`). The GOP will be extended, if a scene-cut frame is found within this many number of frames. +2. Support for RADL pictures added in x265. + :option:`--radl` can be used to decide number of RADL pictures preceding the IDR picture. + +Encoder enhancements +-------------------- +1. Moved from YASM to NASM assembler. Supports NASM assembler version 2.13 and greater. +2. Enable analysis save and load in a single run. Introduces two new cli options `--analysis-save <filename>` and `--analysis-load <filename>`. +3. Comply to HDR10+ LLC specification. +4. Reduced x265 build time by more than 50% by re-factoring ipfilter.asm. + +Bug fixes +--------- +1. Fixed inconsistent output issue in deblock filter and --const-vbv. +2. Fixed Mac OS build warnings. +3. Fixed inconsistency in pass-2 when weightp and cutree are enabled. +4. Fixed deadlock issue due to dropping of BREF frames, while forcing slice types through qp file. + + Version 2.6 ===========
View file
x265_2.6.tar.gz/source/CMakeLists.txt -> x265_2.7.tar.gz/source/CMakeLists.txt
Changed
@@ -29,7 +29,7 @@ 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 146) +set(X265_BUILD 151) configure_file("${PROJECT_SOURCE_DIR}/x265.def.in" "${PROJECT_BINARY_DIR}/x265.def") configure_file("${PROJECT_SOURCE_DIR}/x265_config.h.in" @@ -323,15 +323,15 @@ execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE CC_VERSION) endif(GCC) -find_package(Yasm) +find_package(Nasm) if(ARM OR CROSS_COMPILE_ARM) option(ENABLE_ASSEMBLY "Enable use of assembly coded primitives" ON) -elseif(YASM_FOUND AND X86) - if (YASM_VERSION_STRING VERSION_LESS "1.2.0") - message(STATUS "Yasm version ${YASM_VERSION_STRING} is too old. 1.2.0 or later required") +elseif(NASM_FOUND AND X86) + if (NASM_VERSION_STRING VERSION_LESS "2.13.0") + message(STATUS "Nasm version ${NASM_VERSION_STRING} is too old. 2.13.0 or later required") option(ENABLE_ASSEMBLY "Enable use of assembly coded primitives" OFF) else() - message(STATUS "Found Yasm ${YASM_VERSION_STRING} to build assembly primitives") + message(STATUS "Found Nasm ${NASM_VERSION_STRING} to build assembly primitives") option(ENABLE_ASSEMBLY "Enable use of assembly coded primitives" ON) endif() else() @@ -517,18 +517,18 @@ list(APPEND ASM_OBJS ${ASM}.${SUFFIX}) add_custom_command( OUTPUT ${ASM}.${SUFFIX} - COMMAND ${YASM_EXECUTABLE} ARGS ${YASM_FLAGS} ${ASM_SRC} -o ${ASM}.${SUFFIX} + COMMAND ${NASM_EXECUTABLE} ARGS ${NASM_FLAGS} ${ASM_SRC} -o ${ASM}.${SUFFIX} DEPENDS ${ASM_SRC}) endforeach() endif() endif() source_group(ASM FILES ${ASM_SRCS}) if(ENABLE_HDR10_PLUS) - add_library(x265-static STATIC $<TARGET_OBJECTS:encoder> $<TARGET_OBJECTS:common> $<TARGET_OBJECTS:dynamicHDR10> ${ASM_OBJS} ${ASM_SRCS}) + add_library(x265-static STATIC $<TARGET_OBJECTS:encoder> $<TARGET_OBJECTS:common> $<TARGET_OBJECTS:dynamicHDR10> ${ASM_OBJS}) add_library(hdr10plus-static STATIC $<TARGET_OBJECTS:dynamicHDR10>) set_target_properties(hdr10plus-static PROPERTIES OUTPUT_NAME hdr10plus) else() - add_library(x265-static STATIC $<TARGET_OBJECTS:encoder> $<TARGET_OBJECTS:common> ${ASM_OBJS} ${ASM_SRCS}) + add_library(x265-static STATIC $<TARGET_OBJECTS:encoder> $<TARGET_OBJECTS:common> ${ASM_OBJS}) endif() if(NOT MSVC) set_target_properties(x265-static PROPERTIES OUTPUT_NAME x265) @@ -546,14 +546,19 @@ ARCHIVE DESTINATION ${LIB_INSTALL_DIR}) endif() install(FILES x265.h "${PROJECT_BINARY_DIR}/x265_config.h" DESTINATION include) - if(WIN32) - install(FILES "${PROJECT_BINARY_DIR}/Debug/x265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS Debug) - install(FILES "${PROJECT_BINARY_DIR}/RelWithDebInfo/x265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS RelWithDebInfo) - install(FILES "${PROJECT_BINARY_DIR}/Debug/libx265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS Debug OPTIONAL NAMELINK_ONLY) - install(FILES "${PROJECT_BINARY_DIR}/RelWithDebInfo/libx265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS RelWithDebInfo OPTIONAL NAMELINK_ONLY) + if(MSVC_IDE) + install(FILES "${PROJECT_BINARY_DIR}/Debug/x265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS Debug) + install(FILES "${PROJECT_BINARY_DIR}/RelWithDebInfo/x265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS RelWithDebInfo) + install(FILES "${PROJECT_BINARY_DIR}/Debug/libx265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS Debug OPTIONAL NAMELINK_ONLY) + install(FILES "${PROJECT_BINARY_DIR}/RelWithDebInfo/libx265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS RelWithDebInfo OPTIONAL NAMELINK_ONLY) + else() + install(FILES "${PROJECT_BINARY_DIR}/x265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS Debug) + install(FILES "${PROJECT_BINARY_DIR}/x265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS RelWithDebInfo) + install(FILES "${PROJECT_BINARY_DIR}/libx265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS Debug OPTIONAL NAMELINK_ONLY) + install(FILES "${PROJECT_BINARY_DIR}/libx265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS RelWithDebInfo OPTIONAL NAMELINK_ONLY) + endif() endif() - if(CMAKE_RC_COMPILER) # The resource compiler does not need CFLAGS or macro defines. It # often breaks them @@ -642,7 +647,9 @@ endforeach() if(PLIBLIST) # blacklist of libraries that should not be in Libs.private - list(REMOVE_ITEM PLIBLIST "-lc" "-lpthread") + list(REMOVE_ITEM PLIBLIST "-lc" "-lpthread" "-lmingwex" "-lmingwthrd" + "-lmingw32" "-lmoldname" "-lmsvcrt" "-ladvapi32" "-lshell32" + "-luser32" "-lkernel32") string(REPLACE ";" " " PRIVATE_LIBS "${PLIBLIST}") else() set(PRIVATE_LIBS "") @@ -686,11 +693,11 @@ if(ENABLE_HDR10_PLUS) add_executable(cli ../COPYING ${InputFiles} ${OutputFiles} ${GETOPT} x265.cpp x265.h x265cli.h - $<TARGET_OBJECTS:encoder> $<TARGET_OBJECTS:common> $<TARGET_OBJECTS:dynamicHDR10> ${ASM_OBJS} ${ASM_SRCS}) + $<TARGET_OBJECTS:encoder> $<TARGET_OBJECTS:common> $<TARGET_OBJECTS:dynamicHDR10> ${ASM_OBJS}) else() add_executable(cli ../COPYING ${InputFiles} ${OutputFiles} ${GETOPT} x265.cpp x265.h x265cli.h - $<TARGET_OBJECTS:encoder> $<TARGET_OBJECTS:common> ${ASM_OBJS} ${ASM_SRCS}) + $<TARGET_OBJECTS:encoder> $<TARGET_OBJECTS:common> ${ASM_OBJS}) endif() else() add_executable(cli ../COPYING ${InputFiles} ${OutputFiles} ${GETOPT} ${X265_RC_FILE}
View file
x265_2.7.tar.gz/source/cmake/CMakeASM_NASMInformation.cmake
Added
@@ -0,0 +1,68 @@ +set(ASM_DIALECT "_NASM") +set(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS asm) + +if(X64) + list(APPEND ASM_FLAGS -DARCH_X86_64=1 -I ${CMAKE_CURRENT_SOURCE_DIR}/../common/x86/) + if(ENABLE_PIC) + list(APPEND ASM_FLAGS -DPIC) + endif() + if(APPLE) + set(ARGS -f macho64 -DPREFIX) + elseif(UNIX AND NOT CYGWIN) + set(ARGS -f elf64) + else() + set(ARGS -f win64) + endif() +else() + list(APPEND ASM_FLAGS -DARCH_X86_64=0 -I ${CMAKE_CURRENT_SOURCE_DIR}/../common/x86/) + if(APPLE) + set(ARGS -f macho32 -DPREFIX) + elseif(UNIX AND NOT CYGWIN) + set(ARGS -f elf32) + else() + set(ARGS -f win32 -DPREFIX) + endif() +endif() + +if(GCC) + list(APPEND ASM_FLAGS -DHAVE_ALIGNED_STACK=1) +else() + list(APPEND ASM_FLAGS -DHAVE_ALIGNED_STACK=0) +endif() + +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() + +list(APPEND ASM_FLAGS "${CMAKE_ASM_NASM_FLAGS}") + +if(CMAKE_BUILD_TYPE MATCHES Release) + list(APPEND ASM_FLAGS "${CMAKE_ASM_NASM_FLAGS_RELEASE}") +elseif(CMAKE_BUILD_TYPE MATCHES Debug) + list(APPEND ASM_FLAGS "${CMAKE_ASM_NASM_FLAGS_DEBUG}") +elseif(CMAKE_BUILD_TYPE MATCHES MinSizeRel) + list(APPEND ASM_FLAGS "${CMAKE_ASM_NASM_FLAGS_MINSIZEREL}") +elseif(CMAKE_BUILD_TYPE MATCHES RelWithDebInfo) + list(APPEND ASM_FLAGS "${CMAKE_ASM_NASM_FLAGS_RELWITHDEBINFO}") +endif() + +set(NASM_FLAGS ${ARGS} ${ASM_FLAGS} PARENT_SCOPE) +string(REPLACE ";" " " CMAKE_ASM_NASM_COMPILER_ARG1 "${ARGS}") + +# This section exists to override the one in CMakeASMInformation.cmake +# (the default Information file). This removes the <FLAGS> +# thing so that your C compiler flags that have been set via +# set_target_properties don't get passed to nasm and confuse it. +if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT) + string(REPLACE ";" " " STR_ASM_FLAGS "${ASM_FLAGS}") + set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> ${STR_ASM_FLAGS} -o <OBJECT> <SOURCE>") +endif() + +include(CMakeASMInformation) +set(ASM_DIALECT)
View file
x265_2.7.tar.gz/source/cmake/CMakeDetermineASM_NASMCompiler.cmake
Added
@@ -0,0 +1,5 @@ +set(ASM_DIALECT "_NASM") +set(CMAKE_ASM${ASM_DIALECT}_COMPILER ${NASM_EXECUTABLE}) +set(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT ${_CMAKE_TOOLCHAIN_PREFIX}nasm) +include(CMakeDetermineASMCompiler) +set(ASM_DIALECT)
View file
x265_2.7.tar.gz/source/cmake/CMakeTestASM_NASMCompiler.cmake
Added
@@ -0,0 +1,3 @@ +set(ASM_DIALECT "_NASM") +include(CMakeTestASMCompiler) +set(ASM_DIALECT)
View file
x265_2.7.tar.gz/source/cmake/FindNasm.cmake
Added
@@ -0,0 +1,25 @@ +include(FindPackageHandleStandardArgs) + +# Simple path search with YASM_ROOT environment variable override +find_program(NASM_EXECUTABLE + NAMES nasm nasm-2.13.0-win32 nasm-2.13.0-win64 nasm nasm-2.13.0-win32 nasm-2.13.0-win64 + HINTS $ENV{NASM_ROOT} ${NASM_ROOT} + PATH_SUFFIXES bin +) + +if(NASM_EXECUTABLE) + execute_process(COMMAND ${NASM_EXECUTABLE} -version + OUTPUT_VARIABLE nasm_version + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + if(nasm_version MATCHES "^NASM version ([0-9\\.]*)") + set(NASM_VERSION_STRING "${CMAKE_MATCH_1}") + endif() + unset(nasm_version) +endif() + +# Provide standardized success/failure messages +find_package_handle_standard_args(nasm + REQUIRED_VARS NASM_EXECUTABLE + VERSION_VAR NASM_VERSION_STRING)
View file
x265_2.6.tar.gz/source/cmake/version.cmake -> x265_2.7.tar.gz/source/cmake/version.cmake
Changed
@@ -22,12 +22,11 @@ set(hg_${key} ${value}) endforeach() if(DEFINED hg_tag) - set(X265_VERSION ${hg_tag}) set(X265_LATEST_TAG ${hg_tag}) - set(X265_TAG_DISTANCE "0") elseif(DEFINED hg_node) - string(SUBSTRING "${hg_node}" 0 16 hg_id) - set(X265_VERSION "${hg_latesttag}+${hg_latesttagdistance}-${hg_id}") + set(X265_LATEST_TAG ${hg_latesttag}) + set(X265_TAG_DISTANCE ${hg_latesttagdistance}) + string(SUBSTRING "${hg_node}" 0 12 X265_REVISION_ID) endif() elseif(HG_EXECUTABLE AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../.hg) if(EXISTS "${HG_EXECUTABLE}.bat")
View file
x265_2.6.tar.gz/source/common/CMakeLists.txt -> x265_2.7.tar.gz/source/common/CMakeLists.txt
Changed
@@ -56,28 +56,26 @@ endif() set(VEC_PRIMITIVES vec/vec-primitives.cpp ${PRIMITIVES}) source_group(Intrinsics FILES ${VEC_PRIMITIVES}) - set(C_SRCS asm-primitives.cpp pixel.h mc.h ipfilter8.h blockcopy8.h dct8.h loopfilter.h seaintegral.h) set(A_SRCS pixel-a.asm const-a.asm cpu-a.asm ssd-a.asm mc-a.asm mc-a2.asm pixel-util8.asm blockcopy8.asm pixeladd8.asm dct8.asm seaintegral.asm) if(HIGH_BIT_DEPTH) - set(A_SRCS ${A_SRCS} sad16-a.asm intrapred16.asm ipfilter16.asm loopfilter.asm) + set(A_SRCS ${A_SRCS} sad16-a.asm intrapred16.asm v4-ipfilter16.asm h4-ipfilter16.asm h-ipfilter16.asm ipfilter16.asm loopfilter.asm) else() - set(A_SRCS ${A_SRCS} sad-a.asm intrapred8.asm intrapred8_allangs.asm ipfilter8.asm loopfilter.asm) + set(A_SRCS ${A_SRCS} sad-a.asm intrapred8.asm intrapred8_allangs.asm v4-ipfilter8.asm h-ipfilter8.asm ipfilter8.asm loopfilter.asm) endif() - if(NOT X64) set(A_SRCS ${A_SRCS} pixel-32.asm) endif() if(MSVC_IDE OR XCODE) - # MSVC requires custom build rules in the main cmake script for yasm - set(MSVC_ASMS "${A_SRCS}" CACHE INTERNAL "yasm sources") + # MSVC requires custom build rules in the main cmake script for nasm + set(MSVC_ASMS "${A_SRCS}" CACHE INTERNAL "nasm sources") set(A_SRCS) endif() - enable_language(ASM_YASM) + enable_language(ASM_NASM) foreach(SRC ${A_SRCS} ${C_SRCS}) set(ASM_PRIMITIVES ${ASM_PRIMITIVES} x86/${SRC})
View file
x265_2.6.tar.gz/source/common/common.h -> x265_2.7.tar.gz/source/common/common.h
Changed
@@ -75,11 +75,10 @@ #define ALIGN_VAR_8(T, var) T var __attribute__((aligned(8))) #define ALIGN_VAR_16(T, var) T var __attribute__((aligned(16))) #define ALIGN_VAR_32(T, var) T var __attribute__((aligned(32))) - #if defined(__MINGW32__) #define fseeko fseeko64 +#define ftello ftello64 #endif - #elif defined(_MSC_VER) #define ALIGN_VAR_4(T, var) __declspec(align(4)) T var @@ -87,9 +86,8 @@ #define ALIGN_VAR_16(T, var) __declspec(align(16)) T var #define ALIGN_VAR_32(T, var) __declspec(align(32)) T var #define fseeko _fseeki64 - +#define ftello _ftelli64 #endif // if defined(__GNUC__) - #if HAVE_INT_TYPES_H #define __STDC_FORMAT_MACROS #include <inttypes.h>
View file
x265_2.6.tar.gz/source/common/cudata.cpp -> x265_2.7.tar.gz/source/common/cudata.cpp
Changed
@@ -1626,7 +1626,7 @@ dir |= (1 << list); candMvField[count][list].mv = colmv; candMvField[count][list].refIdx = refIdx; - if (m_encData->m_param->scaleFactor && m_encData->m_param->analysisReuseMode == X265_ANALYSIS_SAVE && m_log2CUSize[0] < 4) + if (m_encData->m_param->scaleFactor && m_encData->m_param->analysisSave && m_log2CUSize[0] < 4) { MV dist(MAX_MV, MAX_MV); candMvField[count][list].mv = dist; @@ -1791,7 +1791,7 @@ int curRefPOC = m_slice->m_refPOCList[picList][refIdx]; int curPOC = m_slice->m_poc; - if (m_encData->m_param->scaleFactor && m_encData->m_param->analysisReuseMode == X265_ANALYSIS_SAVE && (m_log2CUSize[0] < 4)) + if (m_encData->m_param->scaleFactor && m_encData->m_param->analysisSave && (m_log2CUSize[0] < 4)) { MV dist(MAX_MV, MAX_MV); pmv[numMvc++] = amvpCand[num++] = dist;
View file
x265_2.6.tar.gz/source/common/deblock.cpp -> x265_2.7.tar.gz/source/common/deblock.cpp
Changed
@@ -207,21 +207,18 @@ static const MV zeroMv(0, 0); const Slice* const sliceQ = cuQ->m_slice; const Slice* const sliceP = cuP->m_slice; - - const Frame* refP0 = sliceP->m_refFrameList[0][cuP->m_refIdx[0][partP]]; - const Frame* refQ0 = sliceQ->m_refFrameList[0][cuQ->m_refIdx[0][partQ]]; + const Frame* refP0 = (cuP->m_refIdx[0][partP] >= 0) ? sliceP->m_refFrameList[0][cuP->m_refIdx[0][partP]] : NULL; + const Frame* refQ0 = (cuQ->m_refIdx[0][partQ] >= 0) ? sliceQ->m_refFrameList[0][cuQ->m_refIdx[0][partQ]] : NULL; const MV& mvP0 = refP0 ? cuP->m_mv[0][partP] : zeroMv; const MV& mvQ0 = refQ0 ? cuQ->m_mv[0][partQ] : zeroMv; - if (sliceQ->isInterP() && sliceP->isInterP()) { return ((refP0 != refQ0) || (abs(mvQ0.x - mvP0.x) >= 4) || (abs(mvQ0.y - mvP0.y) >= 4)) ? 1 : 0; } - // (sliceQ->isInterB() || sliceP->isInterB()) - const Frame* refP1 = sliceP->m_refFrameList[1][cuP->m_refIdx[1][partP]]; - const Frame* refQ1 = sliceQ->m_refFrameList[1][cuQ->m_refIdx[1][partQ]]; + const Frame* refP1 = (cuP->m_refIdx[1][partP] >= 0) ? sliceP->m_refFrameList[1][cuP->m_refIdx[1][partP]] : NULL; + const Frame* refQ1 = (cuQ->m_refIdx[1][partQ] >= 0) ? sliceQ->m_refFrameList[1][cuQ->m_refIdx[1][partQ]] : NULL; const MV& mvP1 = refP1 ? cuP->m_mv[1][partP] : zeroMv; const MV& mvQ1 = refQ1 ? cuQ->m_mv[1][partQ] : zeroMv;
View file
x265_2.6.tar.gz/source/common/frame.h -> x265_2.7.tar.gz/source/common/frame.h
Changed
@@ -98,7 +98,6 @@ float* m_quantOffsets; // points to quantOffsets in x265_picture x265_sei m_userSEI; - Event m_reconEncoded; /* Frame Parallelism - notification between FrameEncoders of available motion reference rows */ ThreadSafeInteger* m_reconRowFlag; // flag of CTU rows completely reconstructed and extended for motion reference
View file
x265_2.6.tar.gz/source/common/framedata.cpp -> x265_2.7.tar.gz/source/common/framedata.cpp
Changed
@@ -40,11 +40,12 @@ m_spsrpsIdx = -1; if (param.rc.bStatWrite) m_spsrps = const_cast<RPS*>(sps.spsrps); - - m_cuMemPool.create(0, param.internalCsp, sps.numCUsInFrame, param); - for (uint32_t ctuAddr = 0; ctuAddr < sps.numCUsInFrame; ctuAddr++) - m_picCTU[ctuAddr].initialize(m_cuMemPool, 0, param, ctuAddr); - + bool isallocated = m_cuMemPool.create(0, param.internalCsp, sps.numCUsInFrame, param); + if (isallocated) + for (uint32_t ctuAddr = 0; ctuAddr < sps.numCUsInFrame; ctuAddr++) + m_picCTU[ctuAddr].initialize(m_cuMemPool, 0, param, ctuAddr); + else + return false; CHECKED_MALLOC_ZERO(m_cuStat, RCStatCU, sps.numCUsInFrame); CHECKED_MALLOC(m_rowStat, RCStatRow, sps.numCuInHeight); reinit(sps); @@ -76,16 +77,12 @@ X265_FREE(m_cuStat); X265_FREE(m_rowStat); - - if (m_meBuffer) + for (int i = 0; i < INTEGRAL_PLANE_NUM; i++) { - for (int i = 0; i < INTEGRAL_PLANE_NUM; i++) + if (m_meBuffer[i] != NULL) { - if (m_meBuffer[i] != NULL) - { - X265_FREE(m_meBuffer[i]); - m_meBuffer[i] = NULL; - } + X265_FREE(m_meBuffer[i]); + m_meBuffer[i] = NULL; } } }
View file
x265_2.6.tar.gz/source/common/lowres.cpp -> x265_2.7.tar.gz/source/common/lowres.cpp
Changed
@@ -89,7 +89,7 @@ } } - for (int i = 0; i < bframes + 1; i++) + for (int i = 0; i < bframes + 2; i++) { CHECKED_MALLOC(lowresMvs[0][i], MV, cuCount); CHECKED_MALLOC(lowresMvs[1][i], MV, cuCount); @@ -118,7 +118,7 @@ } } - for (int i = 0; i < bframes + 1; i++) + for (int i = 0; i < bframes + 2; i++) { X265_FREE(lowresMvs[0][i]); X265_FREE(lowresMvs[1][i]); @@ -152,7 +152,7 @@ for (int x = 0; x < bframes + 2; x++) rowSatds[y][x][0] = -1; - for (int i = 0; i < bframes + 1; i++) + for (int i = 0; i < bframes + 2; i++) { lowresMvs[0][i][0].x = 0x7FFF; lowresMvs[1][i][0].x = 0x7FFF;
View file
x265_2.6.tar.gz/source/common/lowres.h -> x265_2.7.tar.gz/source/common/lowres.h
Changed
@@ -129,9 +129,9 @@ uint8_t* intraMode; int64_t satdCost; uint16_t* lowresCostForRc; - uint16_t(*lowresCosts[X265_BFRAME_MAX + 2][X265_BFRAME_MAX + 2]); - int32_t* lowresMvCosts[2][X265_BFRAME_MAX + 1]; - MV* lowresMvs[2][X265_BFRAME_MAX + 1]; + uint16_t* lowresCosts[X265_BFRAME_MAX + 2][X265_BFRAME_MAX + 2]; + int32_t* lowresMvCosts[2][X265_BFRAME_MAX + 2]; + MV* lowresMvs[2][X265_BFRAME_MAX + 2]; uint32_t maxBlocksInRow; uint32_t maxBlocksInCol; uint32_t maxBlocksInRowFullRes;
View file
x265_2.6.tar.gz/source/common/param.cpp -> x265_2.7.tar.gz/source/common/param.cpp
Changed
@@ -144,6 +144,7 @@ /* Coding Structure */ param->keyframeMin = 0; param->keyframeMax = 250; + param->gopLookahead = 0; param->bOpenGOP = 1; param->bframes = 4; param->lookaheadDepth = 20; @@ -153,6 +154,7 @@ param->lookaheadSlices = 8; param->lookaheadThreads = 0; param->scenecutBias = 5.0; + param->radl = 0; /* Intra Coding Tools */ param->bEnableConstrainedIntra = 0; param->bEnableStrongIntraSmoothing = 1; @@ -196,10 +198,12 @@ param->rdPenalty = 0; param->psyRd = 2.0; param->psyRdoq = 0.0; - param->analysisReuseMode = 0; + param->analysisReuseMode = 0; /*DEPRECATED*/ param->analysisMultiPassRefine = 0; param->analysisMultiPassDistortion = 0; param->analysisReuseFileName = NULL; + param->analysisSave = NULL; + param->analysisLoad = NULL; param->bIntraInBFrames = 0; param->bLossless = 0; param->bCULossless = 0; @@ -849,7 +853,7 @@ p->rc.bStrictCbr = atobool(value); p->rc.pbFactor = 1.0; } - OPT("analysis-reuse-mode") p->analysisReuseMode = parseName(value, x265_analysis_names, bError); + OPT("analysis-reuse-mode") p->analysisReuseMode = parseName(value, x265_analysis_names, bError); /*DEPRECATED*/ OPT("sar") { p->vui.aspectRatioIdc = parseName(value, x265_sar_names, bError); @@ -1004,6 +1008,10 @@ bError = true; } } + OPT("gop-lookahead") p->gopLookahead = atoi(value); + OPT("analysis-save") p->analysisSave = strdup(value); + OPT("analysis-load") p->analysisLoad = strdup(value); + OPT("radl") p->radl = atoi(value); else return X265_PARAM_BAD_NAME; } @@ -1310,10 +1318,14 @@ "scenecutThreshold must be greater than 0"); CHECK(param->scenecutBias < 0 || 100 < param->scenecutBias, "scenecut-bias must be between 0 and 100"); + CHECK(param->radl < 0 || param->radl > param->bframes, + "radl must be between 0 and bframes"); CHECK(param->rdPenalty < 0 || param->rdPenalty > 2, "Valid penalty for 32x32 intra TU in non-I slices. 0:disabled 1:RD-penalty 2:maximum"); CHECK(param->keyframeMax < -1, "Invalid max IDR period in frames. value should be greater than -1"); + CHECK(param->gopLookahead < -1, + "GOP lookahead must be greater than -1"); CHECK(param->decodedPictureHashSEI < 0 || param->decodedPictureHashSEI > 3, "Invalid hash option. Decoded Picture Hash SEI 0: disabled, 1: MD5, 2: CRC, 3: Checksum"); CHECK(param->rc.vbvBufferSize < 0, @@ -1340,9 +1352,7 @@ "Constant QP is incompatible with 2pass"); CHECK(param->rc.bStrictCbr && (param->rc.bitrate <= 0 || param->rc.vbvBufferSize <=0), "Strict-cbr cannot be applied without specifying target bitrate or vbv bufsize"); - CHECK(param->analysisReuseMode && (param->analysisReuseMode < X265_ANALYSIS_OFF || param->analysisReuseMode > X265_ANALYSIS_LOAD), - "Invalid analysis mode. Analysis mode 0: OFF 1: SAVE : 2 LOAD"); - CHECK(param->analysisReuseMode && (param->analysisReuseLevel < 1 || param->analysisReuseLevel > 10), + CHECK((param->analysisSave || param->analysisLoad) && (param->analysisReuseLevel < 1 || param->analysisReuseLevel > 10), "Invalid analysis refine level. Value must be between 1 and 10 (inclusive)"); CHECK(param->scaleFactor > 2, "Invalid scale-factor. Supports factor <= 2"); CHECK(param->rc.qpMax < QP_MIN || param->rc.qpMax > QP_MAX_MAX, @@ -1520,11 +1530,15 @@ char *x265_param2string(x265_param* p, int padx, int pady) { char *buf, *s; + size_t bufSize = 4000 + p->rc.zoneCount * 64; + if (p->numaPools) + bufSize += strlen(p->numaPools); + if (p->masteringDisplayColorVolume) + bufSize += strlen(p->masteringDisplayColorVolume); - buf = s = X265_MALLOC(char, MAXPARAMSIZE); + buf = s = X265_MALLOC(char, bufSize); if (!buf) return NULL; - #define BOOL(param, cliopt) \ s += sprintf(s, " %s", (param) ? cliopt : "no-" cliopt); @@ -1539,7 +1553,7 @@ BOOL(p->bEnableSsim, "ssim"); s += sprintf(s, " log-level=%d", p->logLevel); if (p->csvfn) - s += sprintf(s, " csvfn=%s csv-log-level=%d", p->csvfn, p->csvLogLevel); + s += sprintf(s, " csv csv-log-level=%d", p->csvLogLevel); s += sprintf(s, " bitdepth=%d", p->internalBitDepth); s += sprintf(s, " input-csp=%d", p->internalCsp); s += sprintf(s, " fps=%u/%u", p->fpsNum, p->fpsDenom); @@ -1561,6 +1575,7 @@ BOOL(p->bOpenGOP, "open-gop"); s += sprintf(s, " min-keyint=%d", p->keyframeMin); s += sprintf(s, " keyint=%d", p->keyframeMax); + s += sprintf(s, " gop-lookahead=%d", p->gopLookahead); s += sprintf(s, " bframes=%d", p->bframes); s += sprintf(s, " b-adapt=%d", p->bFrameAdaptive); BOOL(p->bBPyramid, "b-pyramid"); @@ -1568,6 +1583,7 @@ s += sprintf(s, " rc-lookahead=%d", p->lookaheadDepth); s += sprintf(s, " lookahead-slices=%d", p->lookaheadSlices); s += sprintf(s, " scenecut=%d", p->scenecutThreshold); + s += sprintf(s, " radl=%d", p->radl); BOOL(p->bIntraRefresh, "intra-refresh"); s += sprintf(s, " ctu=%d", p->maxCUSize); s += sprintf(s, " min-cu-size=%d", p->minCUSize); @@ -1613,7 +1629,6 @@ s += sprintf(s, " psy-rd=%.2f", p->psyRd); s += sprintf(s, " psy-rdoq=%.2f", p->psyRdoq); BOOL(p->bEnableRdRefine, "rd-refine"); - s += sprintf(s, " analysis-reuse-mode=%d", p->analysisReuseMode); BOOL(p->bLossless, "lossless"); s += sprintf(s, " cbqpoffs=%d", p->cbQpOffset); s += sprintf(s, " crqpoffs=%d", p->crQpOffset); @@ -1711,6 +1726,10 @@ BOOL(p->bEmitHDRSEI, "hdr"); BOOL(p->bHDROpt, "hdr-opt"); BOOL(p->bDhdr10opt, "dhdr10-opt"); + if (p->analysisSave) + s += sprintf(s, " analysis-save"); + if (p->analysisLoad) + s += sprintf(s, " analysis-load"); s += sprintf(s, " analysis-reuse-level=%d", p->analysisReuseLevel); s += sprintf(s, " scale-factor=%d", p->scaleFactor); s += sprintf(s, " refine-intra=%d", p->intraRefine);
View file
x265_2.6.tar.gz/source/common/param.h -> x265_2.7.tar.gz/source/common/param.h
Changed
@@ -53,8 +53,5 @@ int x265_param_parse(x265_param *p, const char *name, const char *value); #define PARAM_NS X265_NS #endif - -#define MAXPARAMSIZE 2000 } - #endif // ifndef X265_PARAM_H
View file
x265_2.6.tar.gz/source/common/picyuv.cpp -> x265_2.7.tar.gz/source/common/picyuv.cpp
Changed
@@ -358,18 +358,20 @@ pixel *uPic = m_picOrg[1]; pixel *vPic = m_picOrg[2]; - for (int r = 0; r < height; r++) + if (param.csvLogLevel >= 2 || param.maxCLL || param.maxFALL) { - for (int c = 0; c < width; c++) + for (int r = 0; r < height; r++) { - m_maxLumaLevel = X265_MAX(yPic[c], m_maxLumaLevel); - m_minLumaLevel = X265_MIN(yPic[c], m_minLumaLevel); - lumaSum += yPic[c]; + for (int c = 0; c < width; c++) + { + m_maxLumaLevel = X265_MAX(yPic[c], m_maxLumaLevel); + m_minLumaLevel = X265_MIN(yPic[c], m_minLumaLevel); + lumaSum += yPic[c]; + } + yPic += m_stride; } - yPic += m_stride; + m_avgLumaLevel = (double)lumaSum / (m_picHeight * m_picWidth); } - m_avgLumaLevel = (double)lumaSum / (m_picHeight * m_picWidth); - if (param.csvLogLevel >= 2) { if (param.internalCsp != X265_CSP_I400)
View file
x265_2.6.tar.gz/source/common/x86/asm-primitives.cpp -> x265_2.7.tar.gz/source/common/x86/asm-primitives.cpp
Changed
@@ -116,7 +116,6 @@ #include "dct8.h" #include "seaintegral.h" } - #define ALL_LUMA_CU_TYPED(prim, fncdef, fname, cpu) \ p.cu[BLOCK_8x8].prim = fncdef PFX(fname ## _8x8_ ## cpu); \ p.cu[BLOCK_16x16].prim = fncdef PFX(fname ## _16x16_ ## cpu); \
View file
x265_2.6.tar.gz/source/common/x86/blockcopy8.asm -> x265_2.7.tar.gz/source/common/x86/blockcopy8.asm
Changed
@@ -3850,7 +3850,7 @@ mov r4d, %2/4 add r1, r1 add r3, r3 -.loop +.loop: movu m0, [r2] movu m1, [r2 + 16] movu m2, [r2 + 32] @@ -3905,7 +3905,7 @@ lea r5, [3 * r3] lea r6, [3 * r1] -.loop +.loop: movu m0, [r2] movu xm1, [r2 + 32] movu [r0], m0 @@ -5085,7 +5085,7 @@ pxor m4, m4 pxor m5, m5 -.loop +.loop: ; row 0 movu m0, [r1] movu m1, [r1 + 16] @@ -5196,7 +5196,7 @@ pxor m4, m4 pxor m5, m5 -.loop +.loop: ; row 0 movu m0, [r1] movu m1, [r1 + 16]
View file
x265_2.7.tar.gz/source/common/x86/h-ipfilter16.asm
Added
@@ -0,0 +1,2537 @@ +;***************************************************************************** +;* Copyright (C) 2013-2017 MulticoreWare, Inc +;* +;* Authors: Nabajit Deka <nabajit@multicorewareinc.com> +;* Murugan Vairavel <murugan@multicorewareinc.com> +;* Min Chen <chenm003@163.com> +;* +;* This program is free software; you can redistribute it and/or modify +;* it under the terms of the GNU General Public License as published by +;* the Free Software Foundation; either version 2 of the License, or +;* (at your option) any later version. +;* +;* This program is distributed in the hope that it will be useful, +;* but WITHOUT ANY WARRANTY; without even the implied warranty of +;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;* GNU General Public License for more details. +;* +;* You should have received a copy of the GNU General Public License +;* along with this program; if not, write to the Free Software +;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA. +;* +;* This program is also available under a commercial proprietary license. +;* For more information, contact us at license @ x265.com. +;*****************************************************************************/ +%include "x86inc.asm" +%include "x86util.asm" + + +%define INTERP_OFFSET_PP pd_32 +%define INTERP_SHIFT_PP 6 + +%if BIT_DEPTH == 10 + %define INTERP_SHIFT_PS 2 + %define INTERP_OFFSET_PS pd_n32768 + %define INTERP_SHIFT_SP 10 + %define INTERP_OFFSET_SP h_pd_524800 +%elif BIT_DEPTH == 12 + %define INTERP_SHIFT_PS 4 + %define INTERP_OFFSET_PS pd_n131072 + %define INTERP_SHIFT_SP 8 + %define INTERP_OFFSET_SP pd_524416 +%else + %error Unsupport bit depth! +%endif + +SECTION_RODATA 32 + +h_pd_524800: times 8 dd 524800 + +tab_LumaCoeff: dw 0, 0, 0, 64, 0, 0, 0, 0 + dw -1, 4, -10, 58, 17, -5, 1, 0 + dw -1, 4, -11, 40, 40, -11, 4, -1 + dw 0, 1, -5, 17, 58, -10, 4, -1 + +ALIGN 32 +h_tab_LumaCoeffV: times 4 dw 0, 0 + times 4 dw 0, 64 + times 4 dw 0, 0 + times 4 dw 0, 0 + + times 4 dw -1, 4 + times 4 dw -10, 58 + times 4 dw 17, -5 + times 4 dw 1, 0 + + times 4 dw -1, 4 + times 4 dw -11, 40 + times 4 dw 40, -11 + times 4 dw 4, -1 + + times 4 dw 0, 1 + times 4 dw -5, 17 + times 4 dw 58, -10 + times 4 dw 4, -1 + +const interp8_hps_shuf, dd 0, 4, 1, 5, 2, 6, 3, 7 + +const interp8_hpp_shuf, db 0, 1, 2, 3, 4, 5, 6, 7, 2, 3, 4, 5, 6, 7, 8, 9 + db 4, 5, 6, 7, 8, 9, 10, 11, 6, 7, 8, 9, 10, 11, 12, 13 + +const interp8_hpp_shuf_new, db 0, 1, 2, 3, 2, 3, 4, 5, 4, 5, 6, 7, 6, 7, 8, 9 + db 4, 5, 6, 7, 6, 7, 8, 9, 8, 9, 10, 11, 10, 11, 12, 13 + +SECTION .text +cextern pd_8 +cextern pd_32 +cextern pw_pixel_max +cextern pd_524416 +cextern pd_n32768 +cextern pd_n131072 +cextern pw_2000 +cextern idct8_shuf2 + +%macro FILTER_LUMA_HOR_4_sse2 1 + movu m4, [r0 + %1] ; m4 = src[0-7] + movu m5, [r0 + %1 + 2] ; m5 = src[1-8] + pmaddwd m4, m0 + pmaddwd m5, m0 + pshufd m2, m4, q2301 + paddd m4, m2 + pshufd m2, m5, q2301 + paddd m5, m2 + pshufd m4, m4, q3120 + pshufd m5, m5, q3120 + punpcklqdq m4, m5 + + movu m5, [r0 + %1 + 4] ; m5 = src[2-9] + movu m3, [r0 + %1 + 6] ; m3 = src[3-10] + pmaddwd m5, m0 + pmaddwd m3, m0 + pshufd m2, m5, q2301 + paddd m5, m2 + pshufd m2, m3, q2301 + paddd m3, m2 + pshufd m5, m5, q3120 + pshufd m3, m3, q3120 + punpcklqdq m5, m3 + + pshufd m2, m4, q2301 + paddd m4, m2 + pshufd m2, m5, q2301 + paddd m5, m2 + pshufd m4, m4, q3120 + pshufd m5, m5, q3120 + punpcklqdq m4, m5 + paddd m4, m1 +%endmacro + +%macro FILTER_LUMA_HOR_8_sse2 1 + movu m4, [r0 + %1] ; m4 = src[0-7] + movu m5, [r0 + %1 + 2] ; m5 = src[1-8] + pmaddwd m4, m0 + pmaddwd m5, m0 + pshufd m2, m4, q2301 + paddd m4, m2 + pshufd m2, m5, q2301 + paddd m5, m2 + pshufd m4, m4, q3120 + pshufd m5, m5, q3120 + punpcklqdq m4, m5 + + movu m5, [r0 + %1 + 4] ; m5 = src[2-9] + movu m3, [r0 + %1 + 6] ; m3 = src[3-10] + pmaddwd m5, m0 + pmaddwd m3, m0 + pshufd m2, m5, q2301 + paddd m5, m2 + pshufd m2, m3, q2301 + paddd m3, m2 + pshufd m5, m5, q3120 + pshufd m3, m3, q3120 + punpcklqdq m5, m3 + + pshufd m2, m4, q2301 + paddd m4, m2 + pshufd m2, m5, q2301 + paddd m5, m2 + pshufd m4, m4, q3120 + pshufd m5, m5, q3120 + punpcklqdq m4, m5 + paddd m4, m1 + + movu m5, [r0 + %1 + 8] ; m5 = src[4-11] + movu m6, [r0 + %1 + 10] ; m6 = src[5-12] + pmaddwd m5, m0 + pmaddwd m6, m0 + pshufd m2, m5, q2301 + paddd m5, m2 + pshufd m2, m6, q2301 + paddd m6, m2 + pshufd m5, m5, q3120 + pshufd m6, m6, q3120 + punpcklqdq m5, m6 + + movu m6, [r0 + %1 + 12] ; m6 = src[6-13] + movu m3, [r0 + %1 + 14] ; m3 = src[7-14] + pmaddwd m6, m0 + pmaddwd m3, m0 + pshufd m2, m6, q2301 + paddd m6, m2 + pshufd m2, m3, q2301 + paddd m3, m2 + pshufd m6, m6, q3120 + pshufd m3, m3, q3120 + punpcklqdq m6, m3 + + pshufd m2, m5, q2301 + paddd m5, m2 + pshufd m2, m6, q2301 + paddd m6, m2 + pshufd m5, m5, q3120 + pshufd m6, m6, q3120 + punpcklqdq m5, m6 + paddd m5, m1 +%endmacro + +;------------------------------------------------------------------------------------------------------------ +; void interp_8tap_horiz_p%3_%1x%2(pixel *src, intptr_t srcStride, pixel *dst, intptr_t dstStride, int coeffIdx) +;------------------------------------------------------------------------------------------------------------
View file
x265_2.7.tar.gz/source/common/x86/h-ipfilter8.asm
Added
@@ -0,0 +1,6736 @@ +;***************************************************************************** +;* Copyright (C) 2013-2017 MulticoreWare, Inc +;* +;* Authors: Min Chen <chenm003@163.com> +;* Nabajit Deka <nabajit@multicorewareinc.com> +;* Praveen Kumar Tiwari <praveen@multicorewareinc.com> +;* +;* This program is free software; you can redistribute it and/or modify +;* it under the terms of the GNU General Public License as published by +;* the Free Software Foundation; either version 2 of the License, or +;* (at your option) any later version. +;* +;* This program is distributed in the hope that it will be useful, +;* but WITHOUT ANY WARRANTY; without even the implied warranty of +;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;* GNU General Public License for more details. +;* +;* You should have received a copy of the GNU General Public License +;* along with this program; if not, write to the Free Software +;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA. +;* +;* This program is also available under a commercial proprietary license. +;* For more information, contact us at license @ x265.com. +;*****************************************************************************/ + +%include "x86inc.asm" +%include "x86util.asm" + +SECTION_RODATA 32 + +const h_tabw_LumaCoeff, dw 0, 0, 0, 64, 0, 0, 0, 0 + dw -1, 4, -10, 58, 17, -5, 1, 0 + dw -1, 4, -11, 40, 40, -11, 4, -1 + dw 0, 1, -5, 17, 58, -10, 4, -1 + +const h_tabw_ChromaCoeff, dw 0, 64, 0, 0 + dw -2, 58, 10, -2 + dw -4, 54, 16, -2 + dw -6, 46, 28, -4 + dw -4, 36, 36, -4 + dw -4, 28, 46, -6 + dw -2, 16, 54, -4 + dw -2, 10, 58, -2 + +const h_tab_ChromaCoeff, db 0, 64, 0, 0 + db -2, 58, 10, -2 + db -4, 54, 16, -2 + db -6, 46, 28, -4 + db -4, 36, 36, -4 + db -4, 28, 46, -6 + db -2, 16, 54, -4 + db -2, 10, 58, -2 + +const h_tab_LumaCoeff, db 0, 0, 0, 64, 0, 0, 0, 0 + db -1, 4, -10, 58, 17, -5, 1, 0 + db -1, 4, -11, 40, 40, -11, 4, -1 + db 0, 1, -5, 17, 58, -10, 4, -1 + +const h_tab_Tm, db 0, 1, 2, 3, 1, 2, 3, 4, 2, 3, 4, 5, 3, 4, 5, 6 + db 4, 5, 6, 7, 5, 6, 7, 8, 6, 7, 8, 9, 7, 8, 9, 10 + db 8, 9,10,11, 9,10,11,12,10,11,12,13,11,12,13, 14 + + +const h_tab_Lm, db 0, 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, 8 + db 2, 3, 4, 5, 6, 7, 8, 9, 3, 4, 5, 6, 7, 8, 9, 10 + db 4, 5, 6, 7, 8, 9, 10, 11, 5, 6, 7, 8, 9, 10, 11, 12 + db 6, 7, 8, 9, 10, 11, 12, 13, 7, 8, 9, 10, 11, 12, 13, 14 + +const interp4_shuf, times 2 db 0, 1, 8, 9, 4, 5, 12, 13, 2, 3, 10, 11, 6, 7, 14, 15 + +const h_interp8_hps_shuf, dd 0, 4, 1, 5, 2, 6, 3, 7 + +const interp4_hpp_shuf, times 2 db 0, 1, 2, 3, 1, 2, 3, 4, 8, 9, 10, 11, 9, 10, 11, 12 + +const interp4_horiz_shuf1, db 0, 1, 2, 3, 1, 2, 3, 4, 2, 3, 4, 5, 3, 4, 5, 6 + db 8, 9, 10, 11, 9, 10, 11, 12, 10, 11, 12, 13, 11, 12, 13, 14 + +const h_pd_526336, times 8 dd 8192*64+2048 + +const pb_LumaCoeffVer, times 16 db 0, 0 + times 16 db 0, 64 + times 16 db 0, 0 + times 16 db 0, 0 + + times 16 db -1, 4 + times 16 db -10, 58 + times 16 db 17, -5 + times 16 db 1, 0 + + times 16 db -1, 4 + times 16 db -11, 40 + times 16 db 40, -11 + times 16 db 4, -1 + + times 16 db 0, 1 + times 16 db -5, 17 + times 16 db 58, -10 + times 16 db 4, -1 + +const h_pw_LumaCoeffVer, times 8 dw 0, 0 + times 8 dw 0, 64 + times 8 dw 0, 0 + times 8 dw 0, 0 + + times 8 dw -1, 4 + times 8 dw -10, 58 + times 8 dw 17, -5 + times 8 dw 1, 0 + + times 8 dw -1, 4 + times 8 dw -11, 40 + times 8 dw 40, -11 + times 8 dw 4, -1 + + times 8 dw 0, 1 + times 8 dw -5, 17 + times 8 dw 58, -10 + times 8 dw 4, -1 + +const pb_8tap_hps_0, times 2 db 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 + times 2 db 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9,10 + times 2 db 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9,10,10,11,11,12 + times 2 db 6, 7, 7, 8, 8, 9, 9,10,10,11,11,12,12,13,13,14 + +ALIGN 32 +interp4_hps_shuf: times 2 db 0, 1, 2, 3, 1, 2, 3, 4, 8, 9, 10, 11, 9, 10, 11, 12 + +SECTION .text + +cextern pw_1 +cextern pw_32 +cextern pw_2000 +cextern pw_512 + +%macro PROCESS_LUMA_AVX2_W8_16R 1 + movu xm0, [r0] ; m0 = row 0 + movu xm1, [r0 + r1] ; m1 = row 1 + punpckhwd xm2, xm0, xm1 + punpcklwd xm0, xm1 + vinserti128 m0, m0, xm2, 1 + pmaddwd m0, [r5] + movu xm2, [r0 + r1 * 2] ; m2 = row 2 + punpckhwd xm3, xm1, xm2 + punpcklwd xm1, xm2 + vinserti128 m1, m1, xm3, 1 + pmaddwd m1, [r5] + movu xm3, [r0 + r4] ; m3 = row 3 + punpckhwd xm4, xm2, xm3 + punpcklwd xm2, xm3 + vinserti128 m2, m2, xm4, 1 + pmaddwd m4, m2, [r5 + 1 * mmsize] + paddd m0, m4 + pmaddwd m2, [r5] + lea r7, [r0 + r1 * 4] + movu xm4, [r7] ; m4 = row 4 + punpckhwd xm5, xm3, xm4 + punpcklwd xm3, xm4 + vinserti128 m3, m3, xm5, 1 + pmaddwd m5, m3, [r5 + 1 * mmsize] + paddd m1, m5 + pmaddwd m3, [r5] + movu xm5, [r7 + r1] ; m5 = row 5 + punpckhwd xm6, xm4, xm5 + punpcklwd xm4, xm5 + vinserti128 m4, m4, xm6, 1 + pmaddwd m6, m4, [r5 + 2 * mmsize] + paddd m0, m6 + pmaddwd m6, m4, [r5 + 1 * mmsize] + paddd m2, m6 + pmaddwd m4, [r5] + movu xm6, [r7 + r1 * 2] ; m6 = row 6 + punpckhwd xm7, xm5, xm6 + punpcklwd xm5, xm6 + vinserti128 m5, m5, xm7, 1 + pmaddwd m7, m5, [r5 + 2 * mmsize] + paddd m1, m7 + pmaddwd m7, m5, [r5 + 1 * mmsize] + paddd m3, m7 + pmaddwd m5, [r5] + movu xm7, [r7 + r4] ; m7 = row 7 + punpckhwd xm8, xm6, xm7 + punpcklwd xm6, xm7 + vinserti128 m6, m6, xm8, 1 + pmaddwd m8, m6, [r5 + 3 * mmsize] + paddd m0, m8 + pmaddwd m8, m6, [r5 + 2 * mmsize] + paddd m2, m8 + pmaddwd m8, m6, [r5 + 1 * mmsize] + paddd m4, m8 + pmaddwd m6, [r5] + lea r7, [r7 + r1 * 4] + movu xm8, [r7] ; m8 = row 8 + punpckhwd xm9, xm7, xm8 + punpcklwd xm7, xm8 + vinserti128 m7, m7, xm9, 1 + pmaddwd m9, m7, [r5 + 3 * mmsize] + paddd m1, m9 + pmaddwd m9, m7, [r5 + 2 * mmsize] + paddd m3, m9
View file
x265_2.7.tar.gz/source/common/x86/h4-ipfilter16.asm
Added
@@ -0,0 +1,2632 @@ +;***************************************************************************** +;* Copyright (C) 2013-2017 MulticoreWare, Inc +;* +;* Authors: Nabajit Deka <nabajit@multicorewareinc.com> +;* Murugan Vairavel <murugan@multicorewareinc.com> +;* Min Chen <chenm003@163.com> +;* +;* This program is free software; you can redistribute it and/or modify +;* it under the terms of the GNU General Public License as published by +;* the Free Software Foundation; either version 2 of the License, or +;* (at your option) any later version. +;* +;* This program is distributed in the hope that it will be useful, +;* but WITHOUT ANY WARRANTY; without even the implied warranty of +;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;* GNU General Public License for more details. +;* +;* You should have received a copy of the GNU General Public License +;* along with this program; if not, write to the Free Software +;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA. +;* +;* This program is also available under a commercial proprietary license. +;* For more information, contact us at license @ x265.com. +;*****************************************************************************/ + +%include "x86inc.asm" +%include "x86util.asm" + + +%define INTERP_OFFSET_PP pd_32 +%define INTERP_SHIFT_PP 6 + +%if BIT_DEPTH == 10 + %define INTERP_SHIFT_PS 2 + %define INTERP_OFFSET_PS pd_n32768 + %define INTERP_SHIFT_SP 10 + %define INTERP_OFFSET_SP h4_pd_524800 +%elif BIT_DEPTH == 12 + %define INTERP_SHIFT_PS 4 + %define INTERP_OFFSET_PS pd_n131072 + %define INTERP_SHIFT_SP 8 + %define INTERP_OFFSET_SP pd_524416 +%else + %error Unsupport bit depth! +%endif + + +SECTION_RODATA 32 + +tab_c_32: times 8 dd 32 +h4_pd_524800: times 8 dd 524800 + +tab_Tm16: db 0, 1, 2, 3, 4, 5, 6, 7, 2, 3, 4, 5, 6, 7, 8, 9 + +tab_ChromaCoeff: dw 0, 64, 0, 0 + dw -2, 58, 10, -2 + dw -4, 54, 16, -2 + dw -6, 46, 28, -4 + dw -4, 36, 36, -4 + dw -4, 28, 46, -6 + dw -2, 16, 54, -4 + dw -2, 10, 58, -2 + +const h4_interp8_hpp_shuf, db 0, 1, 2, 3, 4, 5, 6, 7, 2, 3, 4, 5, 6, 7, 8, 9 + db 4, 5, 6, 7, 8, 9, 10, 11, 6, 7, 8, 9, 10, 11, 12, 13 + +SECTION .text +cextern pd_8 +cextern pd_32 +cextern pw_pixel_max +cextern pd_524416 +cextern pd_n32768 +cextern pd_n131072 +cextern pw_2000 +cextern idct8_shuf2 + +%macro FILTERH_W2_4_sse3 2 + movh m3, [r0 + %1] + movhps m3, [r0 + %1 + 2] + pmaddwd m3, m0 + movh m4, [r0 + r1 + %1] + movhps m4, [r0 + r1 + %1 + 2] + pmaddwd m4, m0 + pshufd m2, m3, q2301 + paddd m3, m2 + pshufd m2, m4, q2301 + paddd m4, m2 + pshufd m3, m3, q3120 + pshufd m4, m4, q3120 + punpcklqdq m3, m4 + paddd m3, m1 + movh m5, [r0 + 2 * r1 + %1] + movhps m5, [r0 + 2 * r1 + %1 + 2] + pmaddwd m5, m0 + movh m4, [r0 + r4 + %1] + movhps m4, [r0 + r4 + %1 + 2] + pmaddwd m4, m0 + pshufd m2, m5, q2301 + paddd m5, m2 + pshufd m2, m4, q2301 + paddd m4, m2 + pshufd m5, m5, q3120 + pshufd m4, m4, q3120 + punpcklqdq m5, m4 + paddd m5, m1 +%ifidn %2, pp + psrad m3, 6 + psrad m5, 6 + packssdw m3, m5 + CLIPW m3, m7, m6 +%else + psrad m3, INTERP_SHIFT_PS + psrad m5, INTERP_SHIFT_PS + packssdw m3, m5 +%endif + movd [r2 + %1], m3 + psrldq m3, 4 + movd [r2 + r3 + %1], m3 + psrldq m3, 4 + movd [r2 + r3 * 2 + %1], m3 + psrldq m3, 4 + movd [r2 + r5 + %1], m3 +%endmacro + +%macro FILTERH_W2_3_sse3 1 + movh m3, [r0 + %1] + movhps m3, [r0 + %1 + 2] + pmaddwd m3, m0 + movh m4, [r0 + r1 + %1] + movhps m4, [r0 + r1 + %1 + 2] + pmaddwd m4, m0 + pshufd m2, m3, q2301 + paddd m3, m2 + pshufd m2, m4, q2301 + paddd m4, m2 + pshufd m3, m3, q3120 + pshufd m4, m4, q3120 + punpcklqdq m3, m4 + paddd m3, m1 + + movh m5, [r0 + 2 * r1 + %1] + movhps m5, [r0 + 2 * r1 + %1 + 2] + pmaddwd m5, m0 + + pshufd m2, m5, q2301 + paddd m5, m2 + pshufd m5, m5, q3120 + paddd m5, m1 + + psrad m3, INTERP_SHIFT_PS + psrad m5, INTERP_SHIFT_PS + packssdw m3, m5 + + movd [r2 + %1], m3 + psrldq m3, 4 + movd [r2 + r3 + %1], m3 + psrldq m3, 4 + movd [r2 + r3 * 2 + %1], m3 +%endmacro + +%macro FILTERH_W4_2_sse3 2 + movh m3, [r0 + %1] + movhps m3, [r0 + %1 + 2] + pmaddwd m3, m0 + movh m4, [r0 + %1 + 4] + movhps m4, [r0 + %1 + 6] + pmaddwd m4, m0 + pshufd m2, m3, q2301 + paddd m3, m2 + pshufd m2, m4, q2301 + paddd m4, m2 + pshufd m3, m3, q3120 + pshufd m4, m4, q3120 + punpcklqdq m3, m4 + paddd m3, m1 + + movh m5, [r0 + r1 + %1] + movhps m5, [r0 + r1 + %1 + 2] + pmaddwd m5, m0 + movh m4, [r0 + r1 + %1 + 4] + movhps m4, [r0 + r1 + %1 + 6] + pmaddwd m4, m0 + pshufd m2, m5, q2301 + paddd m5, m2 + pshufd m2, m4, q2301 + paddd m4, m2 + pshufd m5, m5, q3120 + pshufd m4, m4, q3120 + punpcklqdq m5, m4 + paddd m5, m1 +%ifidn %2, pp + psrad m3, 6 + psrad m5, 6 + packssdw m3, m5 + CLIPW m3, m7, m6 +%else + psrad m3, INTERP_SHIFT_PS + psrad m5, INTERP_SHIFT_PS + packssdw m3, m5
View file
x265_2.6.tar.gz/source/common/x86/intrapred8.asm -> x265_2.7.tar.gz/source/common/x86/intrapred8.asm
Changed
@@ -2148,7 +2148,7 @@ paddw m0, m1 packuswb m0, m0 - movd r2, m0 + movd r2d, m0 mov [r0], r2b shr r2, 8 mov [r0 + r1], r2b
View file
x265_2.6.tar.gz/source/common/x86/ipfilter16.asm -> x265_2.7.tar.gz/source/common/x86/ipfilter16.asm
Changed
@@ -47,75 +47,10 @@ SECTION_RODATA 32 -tab_c_32: times 8 dd 32 tab_c_524800: times 4 dd 524800 tab_c_n8192: times 8 dw -8192 pd_524800: times 8 dd 524800 -tab_Tm16: db 0, 1, 2, 3, 4, 5, 6, 7, 2, 3, 4, 5, 6, 7, 8, 9 - -tab_ChromaCoeff: dw 0, 64, 0, 0 - dw -2, 58, 10, -2 - dw -4, 54, 16, -2 - dw -6, 46, 28, -4 - dw -4, 36, 36, -4 - dw -4, 28, 46, -6 - dw -2, 16, 54, -4 - dw -2, 10, 58, -2 - -const tab_ChromaCoeffV, times 8 dw 0, 64 - times 8 dw 0, 0 - - times 8 dw -2, 58 - times 8 dw 10, -2 - - times 8 dw -4, 54 - times 8 dw 16, -2 - - times 8 dw -6, 46 - times 8 dw 28, -4 - - times 8 dw -4, 36 - times 8 dw 36, -4 - - times 8 dw -4, 28 - times 8 dw 46, -6 - - times 8 dw -2, 16 - times 8 dw 54, -4 - - times 8 dw -2, 10 - times 8 dw 58, -2 - -tab_ChromaCoeffVer: times 8 dw 0, 64 - times 8 dw 0, 0 - - times 8 dw -2, 58 - times 8 dw 10, -2 - - times 8 dw -4, 54 - times 8 dw 16, -2 - - times 8 dw -6, 46 - times 8 dw 28, -4 - - times 8 dw -4, 36 - times 8 dw 36, -4 - - times 8 dw -4, 28 - times 8 dw 46, -6 - - times 8 dw -2, 16 - times 8 dw 54, -4 - - times 8 dw -2, 10 - times 8 dw 58, -2 - -tab_LumaCoeff: dw 0, 0, 0, 64, 0, 0, 0, 0 - dw -1, 4, -10, 58, 17, -5, 1, 0 - dw -1, 4, -11, 40, 40, -11, 4, -1 - dw 0, 1, -5, 17, 58, -10, 4, -1 - ALIGN 32 tab_LumaCoeffV: times 4 dw 0, 0 times 4 dw 0, 64 @@ -157,14 +92,6 @@ times 8 dw 58, -10 times 8 dw 4, -1 -const interp8_hps_shuf, dd 0, 4, 1, 5, 2, 6, 3, 7 - -const interp8_hpp_shuf, db 0, 1, 2, 3, 4, 5, 6, 7, 2, 3, 4, 5, 6, 7, 8, 9 - db 4, 5, 6, 7, 8, 9, 10, 11, 6, 7, 8, 9, 10, 11, 12, 13 - -const interp8_hpp_shuf_new, db 0, 1, 2, 3, 2, 3, 4, 5, 4, 5, 6, 7, 6, 7, 8, 9 - db 4, 5, 6, 7, 6, 7, 8, 9, 8, 9, 10, 11, 10, 11, 12, 13 - SECTION .text cextern pd_8 cextern pd_32 @@ -175,255 +102,6 @@ cextern pw_2000 cextern idct8_shuf2 -%macro FILTER_LUMA_HOR_4_sse2 1 - movu m4, [r0 + %1] ; m4 = src[0-7] - movu m5, [r0 + %1 + 2] ; m5 = src[1-8] - pmaddwd m4, m0 - pmaddwd m5, m0 - pshufd m2, m4, q2301 - paddd m4, m2 - pshufd m2, m5, q2301 - paddd m5, m2 - pshufd m4, m4, q3120 - pshufd m5, m5, q3120 - punpcklqdq m4, m5 - - movu m5, [r0 + %1 + 4] ; m5 = src[2-9] - movu m3, [r0 + %1 + 6] ; m3 = src[3-10] - pmaddwd m5, m0 - pmaddwd m3, m0 - pshufd m2, m5, q2301 - paddd m5, m2 - pshufd m2, m3, q2301 - paddd m3, m2 - pshufd m5, m5, q3120 - pshufd m3, m3, q3120 - punpcklqdq m5, m3 - - pshufd m2, m4, q2301 - paddd m4, m2 - pshufd m2, m5, q2301 - paddd m5, m2 - pshufd m4, m4, q3120 - pshufd m5, m5, q3120 - punpcklqdq m4, m5 - paddd m4, m1 -%endmacro - -%macro FILTER_LUMA_HOR_8_sse2 1 - movu m4, [r0 + %1] ; m4 = src[0-7] - movu m5, [r0 + %1 + 2] ; m5 = src[1-8] - pmaddwd m4, m0 - pmaddwd m5, m0 - pshufd m2, m4, q2301 - paddd m4, m2 - pshufd m2, m5, q2301 - paddd m5, m2 - pshufd m4, m4, q3120 - pshufd m5, m5, q3120 - punpcklqdq m4, m5 - - movu m5, [r0 + %1 + 4] ; m5 = src[2-9] - movu m3, [r0 + %1 + 6] ; m3 = src[3-10] - pmaddwd m5, m0 - pmaddwd m3, m0 - pshufd m2, m5, q2301 - paddd m5, m2 - pshufd m2, m3, q2301 - paddd m3, m2 - pshufd m5, m5, q3120 - pshufd m3, m3, q3120 - punpcklqdq m5, m3 - - pshufd m2, m4, q2301 - paddd m4, m2 - pshufd m2, m5, q2301 - paddd m5, m2 - pshufd m4, m4, q3120 - pshufd m5, m5, q3120 - punpcklqdq m4, m5 - paddd m4, m1 - - movu m5, [r0 + %1 + 8] ; m5 = src[4-11] - movu m6, [r0 + %1 + 10] ; m6 = src[5-12] - pmaddwd m5, m0 - pmaddwd m6, m0 - pshufd m2, m5, q2301 - paddd m5, m2 - pshufd m2, m6, q2301 - paddd m6, m2 - pshufd m5, m5, q3120 - pshufd m6, m6, q3120 - punpcklqdq m5, m6 - - movu m6, [r0 + %1 + 12] ; m6 = src[6-13] - movu m3, [r0 + %1 + 14] ; m3 = src[7-14] - pmaddwd m6, m0 - pmaddwd m3, m0 - pshufd m2, m6, q2301 - paddd m6, m2 - pshufd m2, m3, q2301 - paddd m3, m2 - pshufd m6, m6, q3120 - pshufd m3, m3, q3120 - punpcklqdq m6, m3 - - pshufd m2, m5, q2301 - paddd m5, m2 - pshufd m2, m6, q2301 - paddd m6, m2 - pshufd m5, m5, q3120 - pshufd m6, m6, q3120 - punpcklqdq m5, m6 - paddd m5, m1 -%endmacro - -;------------------------------------------------------------------------------------------------------------ -; void interp_8tap_horiz_p%3_%1x%2(pixel *src, intptr_t srcStride, pixel *dst, intptr_t dstStride, int coeffIdx)
View file
x265_2.6.tar.gz/source/common/x86/ipfilter8.asm -> x265_2.7.tar.gz/source/common/x86/ipfilter8.asm
Changed
@@ -33,119 +33,16 @@ const interp4_vpp_shuf, times 2 db 0, 4, 1, 5, 2, 6, 3, 7, 8, 12, 9, 13, 10, 14, 11, 15 -const interp_vert_shuf, times 2 db 0, 2, 1, 3, 2, 4, 3, 5, 4, 6, 5, 7, 6, 8, 7, 9 - times 2 db 4, 6, 5, 7, 6, 8, 7, 9, 8, 10, 9, 11, 10, 12, 11, 13 - const interp4_vpp_shuf1, dd 0, 1, 1, 2, 2, 3, 3, 4 dd 2, 3, 3, 4, 4, 5, 5, 6 -const pb_8tap_hps_0, times 2 db 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 - times 2 db 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9,10 - times 2 db 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9,10,10,11,11,12 - times 2 db 6, 7, 7, 8, 8, 9, 9,10,10,11,11,12,12,13,13,14 - const tab_Lm, db 0, 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, 8 db 2, 3, 4, 5, 6, 7, 8, 9, 3, 4, 5, 6, 7, 8, 9, 10 db 4, 5, 6, 7, 8, 9, 10, 11, 5, 6, 7, 8, 9, 10, 11, 12 db 6, 7, 8, 9, 10, 11, 12, 13, 7, 8, 9, 10, 11, 12, 13, 14 -const tab_Vm, db 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1 - db 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3 - -const tab_Cm, db 0, 2, 1, 3, 0, 2, 1, 3, 0, 2, 1, 3, 0, 2, 1, 3 - const pd_526336, times 8 dd 8192*64+2048 -const tab_ChromaCoeff, db 0, 64, 0, 0 - db -2, 58, 10, -2 - db -4, 54, 16, -2 - db -6, 46, 28, -4 - db -4, 36, 36, -4 - db -4, 28, 46, -6 - db -2, 16, 54, -4 - db -2, 10, 58, -2 - -const tabw_ChromaCoeff, dw 0, 64, 0, 0 - dw -2, 58, 10, -2 - dw -4, 54, 16, -2 - dw -6, 46, 28, -4 - dw -4, 36, 36, -4 - dw -4, 28, 46, -6 - dw -2, 16, 54, -4 - dw -2, 10, 58, -2 - -const tab_ChromaCoeff_V, times 8 db 0, 64 - times 8 db 0, 0 - - times 8 db -2, 58 - times 8 db 10, -2 - - times 8 db -4, 54 - times 8 db 16, -2 - - times 8 db -6, 46 - times 8 db 28, -4 - - times 8 db -4, 36 - times 8 db 36, -4 - - times 8 db -4, 28 - times 8 db 46, -6 - - times 8 db -2, 16 - times 8 db 54, -4 - - times 8 db -2, 10 - times 8 db 58, -2 - -const tab_ChromaCoeffV, times 4 dw 0, 64 - times 4 dw 0, 0 - - times 4 dw -2, 58 - times 4 dw 10, -2 - - times 4 dw -4, 54 - times 4 dw 16, -2 - - times 4 dw -6, 46 - times 4 dw 28, -4 - - times 4 dw -4, 36 - times 4 dw 36, -4 - - times 4 dw -4, 28 - times 4 dw 46, -6 - - times 4 dw -2, 16 - times 4 dw 54, -4 - - times 4 dw -2, 10 - times 4 dw 58, -2 - -const pw_ChromaCoeffV, times 8 dw 0, 64 - times 8 dw 0, 0 - - times 8 dw -2, 58 - times 8 dw 10, -2 - - times 8 dw -4, 54 - times 8 dw 16, -2 - - times 8 dw -6, 46 - times 8 dw 28, -4 - - times 8 dw -4, 36 - times 8 dw 36, -4 - - times 8 dw -4, 28 - times 8 dw 46, -6 - - times 8 dw -2, 16 - times 8 dw 54, -4 - - times 8 dw -2, 10 - times 8 dw 58, -2 - const tab_LumaCoeff, db 0, 0, 0, 64, 0, 0, 0, 0 db -1, 4, -10, 58, 17, -5, 1, 0 db -1, 4, -11, 40, 40, -11, 4, -1 @@ -196,26 +93,6 @@ times 8 dw 58, -10 times 8 dw 4, -1 -const pb_LumaCoeffVer, times 16 db 0, 0 - times 16 db 0, 64 - times 16 db 0, 0 - times 16 db 0, 0 - - times 16 db -1, 4 - times 16 db -10, 58 - times 16 db 17, -5 - times 16 db 1, 0 - - times 16 db -1, 4 - times 16 db -11, 40 - times 16 db 40, -11 - times 16 db 4, -1 - - times 16 db 0, 1 - times 16 db -5, 17 - times 16 db 58, -10 - times 16 db 4, -1 - const tab_LumaCoeffVer, times 8 db 0, 0 times 8 db 0, 64 times 8 db 0, 0 @@ -256,44 +133,10 @@ times 16 db 58, -10 times 16 db 4, -1 -const tab_ChromaCoeffVer_32, times 16 db 0, 64 - times 16 db 0, 0 - - times 16 db -2, 58 - times 16 db 10, -2 - - times 16 db -4, 54 - times 16 db 16, -2 - - times 16 db -6, 46 - times 16 db 28, -4 - - times 16 db -4, 36 - times 16 db 36, -4 - - times 16 db -4, 28 - times 16 db 46, -6 - - times 16 db -2, 16 - times 16 db 54, -4 - - times 16 db -2, 10 - times 16 db 58, -2 - const tab_c_64_n64, times 8 db 64, -64 -const interp4_shuf, times 2 db 0, 1, 8, 9, 4, 5, 12, 13, 2, 3, 10, 11, 6, 7, 14, 15 - -const interp4_horiz_shuf1, db 0, 1, 2, 3, 1, 2, 3, 4, 2, 3, 4, 5, 3, 4, 5, 6 - db 8, 9, 10, 11, 9, 10, 11, 12, 10, 11, 12, 13, 11, 12, 13, 14 - -const interp4_hpp_shuf, times 2 db 0, 1, 2, 3, 1, 2, 3, 4, 8, 9, 10, 11, 9, 10, 11, 12 - const interp8_hps_shuf, dd 0, 4, 1, 5, 2, 6, 3, 7 -ALIGN 32 -interp4_hps_shuf: times 2 db 0, 1, 2, 3, 1, 2, 3, 4, 8, 9, 10, 11, 9, 10, 11, 12 - SECTION .text cextern pb_128 @@ -303,462 +146,6 @@ cextern pw_2000 cextern pw_8192 -%macro FILTER_H4_w2_2_sse2 0 - pxor m3, m3 - movd m0, [srcq - 1] - movd m2, [srcq]
View file
x265_2.6.tar.gz/source/common/x86/loopfilter.asm -> x265_2.7.tar.gz/source/common/x86/loopfilter.asm
Changed
@@ -374,7 +374,7 @@ pxor m0, m0 ; m0 = 0 mova m6, [pb_2] ; m6 = [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2] shr r4d, 4 -.loop +.loop: movu m7, [r0] movu m5, [r0 + 16] movu m3, [r0 + r3] @@ -430,7 +430,7 @@ mova m6, [pb_2] ; m6 = [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2] mova m7, [pb_128] shr r4d, 4 -.loop +.loop: movu m1, [r0] ; m1 = pRec[x] movu m2, [r0 + r3] ; m2 = pRec[x + iStride] @@ -478,7 +478,7 @@ mova m4, [pb_2] shr r4d, 4 mova m0, [pw_pixel_max] -.loop +.loop: movu m5, [r0] movu m3, [r0 + r3] @@ -523,7 +523,7 @@ mova xm6, [pb_2] ; xm6 = [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2] mova xm7, [pb_128] shr r4d, 4 -.loop +.loop: movu xm1, [r0] ; xm1 = pRec[x] movu xm2, [r0 + r3] ; xm2 = pRec[x + iStride] @@ -572,7 +572,7 @@ mov r5d, r4d shr r4d, 4 mov r6, r0 -.loop +.loop: movu m7, [r0] movu m5, [r0 + 16] movu m3, [r0 + r3] @@ -674,7 +674,7 @@ pxor m0, m0 ; m0 = 0 mova m7, [pb_128] shr r4d, 4 -.loop +.loop: movu m1, [r0] ; m1 = pRec[x] movu m2, [r0 + r3] ; m2 = pRec[x + iStride] @@ -748,7 +748,7 @@ mova m4, [pw_pixel_max] vbroadcasti128 m6, [r2] ; m6 = m_iOffsetEo shr r4d, 4 -.loop +.loop: movu m7, [r0] movu m5, [r0 + r3] movu m1, [r0 + r3 * 2] @@ -804,7 +804,7 @@ vbroadcasti128 m5, [pb_128] vbroadcasti128 m6, [r2] ; m6 = m_iOffsetEo shr r4d, 4 -.loop +.loop: movu xm1, [r0] ; m1 = pRec[x] movu xm2, [r0 + r3] ; m2 = pRec[x + iStride] vinserti128 m1, m1, xm2, 1 @@ -859,7 +859,7 @@ movh m6, [r0 + r4 * 2] movhps m6, [r1 + r4] -.loop +.loop: movu m7, [r0] movu m5, [r0 + 16] movu m3, [r0 + r5 + 2] @@ -918,7 +918,7 @@ movh m5, [r0 + r4] movhps m5, [r1 + r4] -.loop +.loop: movu m1, [r0] ; m1 = rec[x] movu m2, [r0 + r5 + 1] ; m2 = rec[x + stride + 1] pxor m3, m1, m7 @@ -970,7 +970,7 @@ movhps xm4, [r1 + r4] vbroadcasti128 m5, [r3] mova m6, [pw_pixel_max] -.loop +.loop: movu m1, [r0] movu m3, [r0 + r5 + 2] @@ -1061,7 +1061,7 @@ movhps xm4, [r1 + r4] vbroadcasti128 m5, [r3] -.loop +.loop: movu m1, [r0] movu m7, [r0 + 32] movu m3, [r0 + r5 + 2] @@ -1567,11 +1567,11 @@ movu m4, [r1 + 16] ; offset[16-31] pxor m7, m7 -.loopH +.loopH: mov r5d, r2d xor r6, r6 -.loopW +.loopW: movu m2, [r0 + r6] movu m5, [r0 + r6 + 16] psrlw m0, m2, (BIT_DEPTH - 5) @@ -1617,11 +1617,11 @@ movu m3, [r1 + 0] ; offset[0-15] movu m4, [r1 + 16] ; offset[16-31] pxor m7, m7 ; m7 =[0] -.loopH +.loopH: mov r5d, r2d xor r6, r6 -.loopW +.loopW: movu m2, [r0 + r6] ; m0 = [rec] psrlw m1, m2, 3 pand m1, [pb_31] ; m1 = [index] @@ -1670,9 +1670,9 @@ mov r6d, r3d shr r3d, 1 -.loopH +.loopH: mov r5d, r2d -.loopW +.loopW: movu m2, [r0] movu m5, [r0 + r4] psrlw m0, m2, (BIT_DEPTH - 5) @@ -1751,9 +1751,9 @@ shr r2d, 4 mov r1d, r3d shr r3d, 1 -.loopH +.loopH: mov r5d, r2d -.loopW +.loopW: movu xm2, [r0] ; m2 = [rec] vinserti128 m2, m2, [r0 + r4], 1 psrlw m1, m2, 3 @@ -1789,7 +1789,7 @@ test r1b, 1 jz .end mov r5d, r2d -.loopW1 +.loopW1: movu xm2, [r0] ; m2 = [rec] psrlw xm1, xm2, 3 pand xm1, xm7 ; m1 = [index] @@ -1811,7 +1811,7 @@ add r0, 16 dec r5d jnz .loopW1 -.end +.end: RET %endif @@ -1827,7 +1827,7 @@ add r3d, 1 mov r5, r0 movu m4, [r0 + r4] -.loop +.loop: movu m1, [r1] ; m2 = pRec[x] movu m2, [r2] ; m3 = pTmpU[x] @@ -1921,7 +1921,7 @@ mov r5, r0 movu m4, [r0 + r4] -.loop +.loop: movu m1, [r1] ; m2 = pRec[x] movu m2, [r2] ; m3 = pTmpU[x]
View file
x265_2.6.tar.gz/source/common/x86/mc-a.asm -> x265_2.7.tar.gz/source/common/x86/mc-a.asm
Changed
@@ -4115,7 +4115,7 @@ lea r7, [r5 * 3] lea r8, [r1 * 3] mov r9d, 4 -.loop +.loop: pixel_avg_W8 dec r9d jnz .loop @@ -4129,7 +4129,7 @@ lea r7, [r5 * 3] lea r8, [r1 * 3] mov r9d, 8 -.loop +.loop: pixel_avg_W8 dec r9d jnz .loop @@ -4697,7 +4697,7 @@ lea r8, [r1 * 3] mov r9d, 4 -.loop +.loop: movu m0, [r2] movu m1, [r4] pavgw m0, m1 @@ -4834,7 +4834,7 @@ lea r7, [r5 * 3] lea r8, [r1 * 3] mov r9d, 4 -.loop +.loop: pixel_avg_H16 dec r9d jnz .loop @@ -4848,7 +4848,7 @@ lea r7, [r5 * 3] lea r8, [r1 * 3] mov r9d, 4 -.loop +.loop: pixel_avg_H16 pixel_avg_H16 dec r9d @@ -4863,7 +4863,7 @@ lea r7, [r5 * 3] lea r8, [r1 * 3] mov r9d, 4 -.loop +.loop: pixel_avg_H16 pixel_avg_H16 pixel_avg_H16 @@ -4887,7 +4887,7 @@ lea r8, [r1 * 3] mov r9d, 8 -.loop +.loop: movu m0, [r2] movu m1, [r4] pavgw m0, m1 @@ -4987,7 +4987,7 @@ lea r7, [r5 * 3] lea r8, [r1 * 3] mov r9d, 2 -.loop +.loop: pixel_avg_W32 dec r9d jnz .loop @@ -5001,7 +5001,7 @@ lea r7, [r5 * 3] lea r8, [r1 * 3] mov r9d, 4 -.loop +.loop: pixel_avg_W32 dec r9d jnz .loop @@ -5015,7 +5015,7 @@ lea r7, [r5 * 3] lea r8, [r1 * 3] mov r9d, 6 -.loop +.loop: pixel_avg_W32 dec r9d jnz .loop @@ -5029,7 +5029,7 @@ lea r7, [r5 * 3] lea r8, [r1 * 3] mov r9d, 8 -.loop +.loop: pixel_avg_W32 dec r9d jnz .loop @@ -5043,7 +5043,7 @@ lea r7, [r5 * 3] lea r8, [r1 * 3] mov r9d, 16 -.loop +.loop: pixel_avg_W32 dec r9d jnz .loop @@ -5141,7 +5141,7 @@ lea r7, [r5 * 3] lea r8, [r1 * 3] mov r9d, 4 -.loop +.loop: pixel_avg_W64 dec r9d jnz .loop @@ -5155,7 +5155,7 @@ lea r7, [r5 * 3] lea r8, [r1 * 3] mov r9d, 8 -.loop +.loop: pixel_avg_W64 dec r9d jnz .loop @@ -5169,7 +5169,7 @@ lea r7, [r5 * 3] lea r8, [r1 * 3] mov r9d, 12 -.loop +.loop: pixel_avg_W64 dec r9d jnz .loop @@ -5183,7 +5183,7 @@ lea r7, [r5 * 3] lea r8, [r1 * 3] mov r9d, 16 -.loop +.loop: pixel_avg_W64 dec r9d jnz .loop @@ -5204,7 +5204,7 @@ lea r8, [r1 * 3] mov r9d, 16 -.loop +.loop: movu m0, [r2] movu m1, [r4] pavgw m0, m1
View file
x265_2.6.tar.gz/source/common/x86/pixel-util8.asm -> x265_2.7.tar.gz/source/common/x86/pixel-util8.asm
Changed
@@ -1785,7 +1785,7 @@ movu [r1], xm7 je .nextH -.width6 +.width6: cmp r6d, 6 jl .width4 movq [r1], xm7 @@ -4937,7 +4937,7 @@ lea r9, [r4 * 3] lea r8, [r5 * 3] -.loop +.loop: pmovzxbw m0, [r2] pmovzxbw m1, [r3] pmovzxbw m2, [r2 + r4] @@ -5150,7 +5150,7 @@ lea r7, [r4 * 3] lea r8, [r5 * 3] -.loop +.loop: movu m0, [r2] movu m1, [r2 + 32] movu m2, [r3] @@ -5557,7 +5557,7 @@ lea r7, [r4 * 3] lea r8, [r5 * 3] -.loop +.loop: movu m0, [r2] movu m1, [r2 + 32] movu m2, [r2 + 64]
View file
x265_2.6.tar.gz/source/common/x86/sad-a.asm -> x265_2.7.tar.gz/source/common/x86/sad-a.asm
Changed
@@ -5631,7 +5631,7 @@ xorps m5, m5 mov r4d, 4 -.loop +.loop: movu m1, [r0] ; row 0 of pix0 movu m2, [r2] ; row 0 of pix1 movu m3, [r0 + r1] ; row 1 of pix0 @@ -5676,7 +5676,7 @@ mov r4d, 6 lea r5, [r1 * 3] lea r6, [r3 * 3] -.loop +.loop: movu m1, [r0] ; row 0 of pix0 movu m2, [r2] ; row 0 of pix1 movu m3, [r0 + r1] ; row 1 of pix0 @@ -5718,7 +5718,7 @@ lea r5, [r1 * 3] lea r6, [r3 * 3] -.loop +.loop: movu m1, [r0] ; row 0 of pix0 movu m2, [r2] ; row 0 of pix1 movu m3, [r0 + r1] ; row 1 of pix0 @@ -5759,7 +5759,7 @@ lea r5, [r1 * 3] lea r6, [r3 * 3] -.loop +.loop: movu m1, [r0] ; row 0 of pix0 movu m2, [r2] ; row 0 of pix1 movu m3, [r0 + r1] ; row 1 of pix0 @@ -5822,7 +5822,7 @@ mov r4d, 64/4 lea r5, [r1 * 3] lea r6, [r3 * 3] -.loop +.loop: movu m1, [r0] ; row 0 of pix0 movu m2, [r2] ; row 0 of pix1 movu m3, [r0 + r1] ; row 1 of pix0 @@ -5873,7 +5873,7 @@ xorps m0, m0 xorps m5, m5 mov r4d, 4 -.loop +.loop: movu m1, [r0] ; first 32 of row 0 of pix0 movu m2, [r2] ; first 32 of row 0 of pix1 movu m3, [r0 + 32] ; second 32 of row 0 of pix0 @@ -5936,7 +5936,7 @@ xorps m0, m0 xorps m5, m5 mov r4d, 16 -.loop +.loop: movu m1, [r0] ; first 32 of row 0 of pix0 movu m2, [r2] ; first 32 of row 0 of pix1 movu m3, [r0 + 32] ; second 32 of row 0 of pix0 @@ -5978,7 +5978,7 @@ mov r4d, 12 lea r5, [r1 * 3] lea r6, [r3 * 3] -.loop +.loop: movu m1, [r0] ; first 32 of row 0 of pix0 movu m2, [r2] ; first 32 of row 0 of pix1 movu m3, [r0 + 32] ; second 32 of row 0 of pix0 @@ -6040,7 +6040,7 @@ mov r4d, 8 lea r5, [r1 * 3] lea r6, [r3 * 3] -.loop +.loop: movu m1, [r0] ; first 32 of row 0 of pix0 movu m2, [r2] ; first 32 of row 0 of pix1 movu m3, [r0 + 32] ; second 32 of row 0 of pix0
View file
x265_2.6.tar.gz/source/common/x86/seaintegral.asm -> x265_2.7.tar.gz/source/common/x86/seaintegral.asm
Changed
@@ -36,7 +36,7 @@ mov r2, r1 shl r2, 4 -.loop +.loop: movu m0, [r0] movu m1, [r0 + r2] psubd m1, m0 @@ -54,7 +54,7 @@ mov r2, r1 shl r2, 5 -.loop +.loop: movu m0, [r0] movu m1, [r0 + r2] psubd m1, m0 @@ -75,7 +75,7 @@ shl r3, 4 add r2, r3 -.loop +.loop: movu m0, [r0] movu m1, [r0 + r2] psubd m1, m0 @@ -93,7 +93,7 @@ mov r2, r1 shl r2, 6 -.loop +.loop: movu m0, [r0] movu m1, [r0 + r2] psubd m1, m0 @@ -114,7 +114,7 @@ shl r3, 5 add r2, r3 -.loop +.loop: movu m0, [r0] movu m1, [r0 + r2] psubd m1, m0 @@ -132,7 +132,7 @@ mov r2, r1 shl r2, 7 -.loop +.loop: movu m0, [r0] movu m1, [r0 + r2] psubd m1, m0 @@ -264,7 +264,7 @@ movu [r0 + r3], xm0 jmp .end -.end +.end: RET %endif @@ -379,7 +379,7 @@ movu [r0 + r3], m0 jmp .end -.end +.end: RET %endif @@ -577,7 +577,7 @@ movu [r0 + r3], xm0 jmp .end -.end +.end: RET %endif @@ -740,7 +740,7 @@ movu [r0 + r3], m0 jmp .end -.end +.end: RET %endif @@ -883,7 +883,7 @@ movu [r0 + r3], m0 jmp .end -.end +.end: RET %macro INTEGRAL_THIRTYTWO_HORIZONTAL_16 0 @@ -1058,5 +1058,5 @@ movu [r0 + r3], m0 jmp .end -.end +.end: RET
View file
x265_2.7.tar.gz/source/common/x86/v4-ipfilter16.asm
Added
@@ -0,0 +1,3529 @@ +;***************************************************************************** +;* Copyright (C) 2013-2017 MulticoreWare, Inc +;* +;* Authors: Nabajit Deka <nabajit@multicorewareinc.com> +;* Murugan Vairavel <murugan@multicorewareinc.com> +;* Min Chen <chenm003@163.com> +;* +;* This program is free software; you can redistribute it and/or modify +;* it under the terms of the GNU General Public License as published by +;* the Free Software Foundation; either version 2 of the License, or +;* (at your option) any later version. +;* +;* This program is distributed in the hope that it will be useful, +;* but WITHOUT ANY WARRANTY; without even the implied warranty of +;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;* GNU General Public License for more details. +;* +;* You should have received a copy of the GNU General Public License +;* along with this program; if not, write to the Free Software +;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA. +;* +;* This program is also available under a commercial proprietary license. +;* For more information, contact us at license @ x265.com. +;*****************************************************************************/ + +%include "x86inc.asm" +%include "x86util.asm" + + +%define INTERP_OFFSET_PP pd_32 +%define INTERP_SHIFT_PP 6 + +%if BIT_DEPTH == 10 + %define INTERP_SHIFT_PS 2 + %define INTERP_OFFSET_PS pd_n32768 + %define INTERP_SHIFT_SP 10 + %define INTERP_OFFSET_SP v4_pd_524800 +%elif BIT_DEPTH == 12 + %define INTERP_SHIFT_PS 4 + %define INTERP_OFFSET_PS pd_n131072 + %define INTERP_SHIFT_SP 8 + %define INTERP_OFFSET_SP pd_524416 +%else + %error Unsupport bit depth! +%endif + + +SECTION_RODATA 32 + +v4_pd_524800: times 8 dd 524800 +tab_c_n8192: times 8 dw -8192 + +const tab_ChromaCoeffV, times 8 dw 0, 64 + times 8 dw 0, 0 + + times 8 dw -2, 58 + times 8 dw 10, -2 + + times 8 dw -4, 54 + times 8 dw 16, -2 + + times 8 dw -6, 46 + times 8 dw 28, -4 + + times 8 dw -4, 36 + times 8 dw 36, -4 + + times 8 dw -4, 28 + times 8 dw 46, -6 + + times 8 dw -2, 16 + times 8 dw 54, -4 + + times 8 dw -2, 10 + times 8 dw 58, -2 + +tab_ChromaCoeffVer: times 8 dw 0, 64 + times 8 dw 0, 0 + + times 8 dw -2, 58 + times 8 dw 10, -2 + + times 8 dw -4, 54 + times 8 dw 16, -2 + + times 8 dw -6, 46 + times 8 dw 28, -4 + + times 8 dw -4, 36 + times 8 dw 36, -4 + + times 8 dw -4, 28 + times 8 dw 46, -6 + + times 8 dw -2, 16 + times 8 dw 54, -4 + + times 8 dw -2, 10 + times 8 dw 58, -2 + +SECTION .text +cextern pd_8 +cextern pd_32 +cextern pw_pixel_max +cextern pd_524416 +cextern pd_n32768 +cextern pd_n131072 +cextern pw_2000 +cextern idct8_shuf2 + +%macro PROCESS_CHROMA_SP_W4_4R 0 + movq m0, [r0] + movq m1, [r0 + r1] + punpcklwd m0, m1 ;m0=[0 1] + pmaddwd m0, [r6 + 0 *32] ;m0=[0+1] Row1 + + lea r0, [r0 + 2 * r1] + movq m4, [r0] + punpcklwd m1, m4 ;m1=[1 2] + pmaddwd m1, [r6 + 0 *32] ;m1=[1+2] Row2 + + movq m5, [r0 + r1] + punpcklwd m4, m5 ;m4=[2 3] + pmaddwd m2, m4, [r6 + 0 *32] ;m2=[2+3] Row3 + pmaddwd m4, [r6 + 1 * 32] + paddd m0, m4 ;m0=[0+1+2+3] Row1 done + + lea r0, [r0 + 2 * r1] + movq m4, [r0] + punpcklwd m5, m4 ;m5=[3 4] + pmaddwd m3, m5, [r6 + 0 *32] ;m3=[3+4] Row4 + pmaddwd m5, [r6 + 1 * 32] + paddd m1, m5 ;m1 = [1+2+3+4] Row2 + + movq m5, [r0 + r1] + punpcklwd m4, m5 ;m4=[4 5] + pmaddwd m4, [r6 + 1 * 32] + paddd m2, m4 ;m2=[2+3+4+5] Row3 + + movq m4, [r0 + 2 * r1] + punpcklwd m5, m4 ;m5=[5 6] + pmaddwd m5, [r6 + 1 * 32] + paddd m3, m5 ;m3=[3+4+5+6] Row4 +%endmacro + +;----------------------------------------------------------------------------------------------------------------- +; void interp_4tap_vert_%3_%1x%2(int16_t *src, intptr_t srcStride, int16_t *dst, intptr_t dstStride, int coeffIdx) +;----------------------------------------------------------------------------------------------------------------- +%macro FILTER_VER_CHROMA_SS 4 +INIT_XMM sse2 +cglobal interp_4tap_vert_%3_%1x%2, 5, 7, %4 ,0-gprsize + + add r1d, r1d + add r3d, r3d + sub r0, r1 + shl r4d, 6 + +%ifdef PIC + lea r5, [tab_ChromaCoeffV] + lea r6, [r5 + r4] +%else + lea r6, [tab_ChromaCoeffV + r4] +%endif + + mov dword [rsp], %2/4 + +%ifnidn %3, ss + %ifnidn %3, ps + mova m7, [pw_pixel_max] + %ifidn %3, pp + mova m6, [INTERP_OFFSET_PP] + %else + mova m6, [INTERP_OFFSET_SP] + %endif + %else + mova m6, [INTERP_OFFSET_PS] + %endif +%endif + +.loopH: + mov r4d, (%1/4) +.loopW: + PROCESS_CHROMA_SP_W4_4R + +%ifidn %3, ss + psrad m0, 6 + psrad m1, 6 + psrad m2, 6 + psrad m3, 6 + + packssdw m0, m1 + packssdw m2, m3 +%elifidn %3, ps + paddd m0, m6 + paddd m1, m6 + paddd m2, m6 + paddd m3, m6 + psrad m0, INTERP_SHIFT_PS + psrad m1, INTERP_SHIFT_PS
View file
x265_2.7.tar.gz/source/common/x86/v4-ipfilter8.asm
Added
@@ -0,0 +1,12799 @@ +;***************************************************************************** +;* Copyright (C) 2013-2017 MulticoreWare, Inc +;* +;* Authors: Min Chen <chenm003@163.com> +;* Nabajit Deka <nabajit@multicorewareinc.com> +;* Praveen Kumar Tiwari <praveen@multicorewareinc.com> +;* +;* This program is free software; you can redistribute it and/or modify +;* it under the terms of the GNU General Public License as published by +;* the Free Software Foundation; either version 2 of the License, or +;* (at your option) any later version. +;* +;* This program is distributed in the hope that it will be useful, +;* but WITHOUT ANY WARRANTY; without even the implied warranty of +;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;* GNU General Public License for more details. +;* +;* You should have received a copy of the GNU General Public License +;* along with this program; if not, write to the Free Software +;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA. +;* +;* This program is also available under a commercial proprietary license. +;* For more information, contact us at license @ x265.com. +;*****************************************************************************/ + +%include "x86inc.asm" +%include "x86util.asm" + +SECTION_RODATA 32 + +const v4_pd_526336, times 8 dd 8192*64+2048 + +const tab_Vm, db 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1 + db 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3 + +const tab_Cm, db 0, 2, 1, 3, 0, 2, 1, 3, 0, 2, 1, 3, 0, 2, 1, 3 + +const interp_vert_shuf, times 2 db 0, 2, 1, 3, 2, 4, 3, 5, 4, 6, 5, 7, 6, 8, 7, 9 + times 2 db 4, 6, 5, 7, 6, 8, 7, 9, 8, 10, 9, 11, 10, 12, 11, 13 + +const v4_interp4_vpp_shuf, times 2 db 0, 4, 1, 5, 2, 6, 3, 7, 8, 12, 9, 13, 10, 14, 11, 15 + +const v4_interp4_vpp_shuf1, dd 0, 1, 1, 2, 2, 3, 3, 4 + dd 2, 3, 3, 4, 4, 5, 5, 6 + +const tab_ChromaCoeff, db 0, 64, 0, 0 + db -2, 58, 10, -2 + db -4, 54, 16, -2 + db -6, 46, 28, -4 + db -4, 36, 36, -4 + db -4, 28, 46, -6 + db -2, 16, 54, -4 + db -2, 10, 58, -2 + +const tabw_ChromaCoeff, dw 0, 64, 0, 0 + dw -2, 58, 10, -2 + dw -4, 54, 16, -2 + dw -6, 46, 28, -4 + dw -4, 36, 36, -4 + dw -4, 28, 46, -6 + dw -2, 16, 54, -4 + dw -2, 10, 58, -2 + +const tab_ChromaCoeffV, times 4 dw 0, 64 + times 4 dw 0, 0 + + times 4 dw -2, 58 + times 4 dw 10, -2 + + times 4 dw -4, 54 + times 4 dw 16, -2 + + times 4 dw -6, 46 + times 4 dw 28, -4 + + times 4 dw -4, 36 + times 4 dw 36, -4 + + times 4 dw -4, 28 + times 4 dw 46, -6 + + times 4 dw -2, 16 + times 4 dw 54, -4 + + times 4 dw -2, 10 + times 4 dw 58, -2 + +const tab_ChromaCoeff_V, times 8 db 0, 64 + times 8 db 0, 0 + + times 8 db -2, 58 + times 8 db 10, -2 + + times 8 db -4, 54 + times 8 db 16, -2 + + times 8 db -6, 46 + times 8 db 28, -4 + + times 8 db -4, 36 + times 8 db 36, -4 + + times 8 db -4, 28 + times 8 db 46, -6 + + times 8 db -2, 16 + times 8 db 54, -4 + + times 8 db -2, 10 + times 8 db 58, -2 + +const tab_ChromaCoeffVer_32, times 16 db 0, 64 + times 16 db 0, 0 + + times 16 db -2, 58 + times 16 db 10, -2 + + times 16 db -4, 54 + times 16 db 16, -2 + + times 16 db -6, 46 + times 16 db 28, -4 + + times 16 db -4, 36 + times 16 db 36, -4 + + times 16 db -4, 28 + times 16 db 46, -6 + + times 16 db -2, 16 + times 16 db 54, -4 + + times 16 db -2, 10 + times 16 db 58, -2 + +const pw_ChromaCoeffV, times 8 dw 0, 64 + times 8 dw 0, 0 + + times 8 dw -2, 58 + times 8 dw 10, -2 + + times 8 dw -4, 54 + times 8 dw 16, -2 + + times 8 dw -6, 46 + times 8 dw 28, -4 + + times 8 dw -4, 36 + times 8 dw 36, -4 + + times 8 dw -4, 28 + times 8 dw 46, -6 + + times 8 dw -2, 16 + times 8 dw 54, -4 + + times 8 dw -2, 10 + times 8 dw 58, -2 + +const v4_interp8_hps_shuf, dd 0, 4, 1, 5, 2, 6, 3, 7 + +SECTION .text + +cextern pw_32 +cextern pw_512 +cextern pw_2000 + +%macro WORD_TO_DOUBLE 1 +%if ARCH_X86_64 + punpcklbw %1, m8 +%else + punpcklbw %1, %1 + psrlw %1, 8 +%endif +%endmacro + +;----------------------------------------------------------------------------- +; void interp_4tap_vert_%1_2x%2(pixel *src, intptr_t srcStride, pixel *dst, intptr_t dstStride, int coeffIdx) +;----------------------------------------------------------------------------- +%macro FILTER_V4_W2_H4_sse2 2 +INIT_XMM sse2 +%if ARCH_X86_64 +cglobal interp_4tap_vert_%1_2x%2, 4, 6, 9 + pxor m8, m8 +%else +cglobal interp_4tap_vert_%1_2x%2, 4, 6, 8 +%endif + mov r4d, r4m + sub r0, r1 + +%ifidn %1,pp + mova m1, [pw_32] +%elifidn %1,ps + mova m1, [pw_2000] + add r3d, r3d +%endif + +%ifdef PIC + lea r5, [tabw_ChromaCoeff]
View file
x265_2.6.tar.gz/source/common/x86/x86inc.asm -> x265_2.7.tar.gz/source/common/x86/x86inc.asm
Changed
@@ -66,6 +66,15 @@ %endif %endif +%define FORMAT_ELF 0 +%ifidn __OUTPUT_FORMAT__,elf + %define FORMAT_ELF 1 +%elifidn __OUTPUT_FORMAT__,elf32 + %define FORMAT_ELF 1 +%elifidn __OUTPUT_FORMAT__,elf64 + %define FORMAT_ELF 1 +%endif + %ifdef PREFIX %define mangle(x) _ %+ x %else @@ -88,6 +97,10 @@ default rel %endif +%ifdef __NASM_VER__ + %use smartalign +%endif + ; Macros to eliminate most code duplication between x86_32 and x86_64: ; Currently this works only for leaf functions which load all their arguments ; into registers at the start, and make no other use of the stack. Luckily that @@ -685,7 +698,7 @@ CAT_XDEFINE cglobaled_, %2, 1 %endif %xdefine current_function %2 - %ifidn __OUTPUT_FORMAT__,elf + %if FORMAT_ELF global %2:function %%VISIBILITY %else global %2 @@ -711,14 +724,16 @@ ; like cextern, but without the prefix %macro cextern_naked 1 - %xdefine %1 mangle(%1) + %ifdef PREFIX + %xdefine %1 mangle(%1) + %endif CAT_XDEFINE cglobaled_, %1, 1 extern %1 %endmacro %macro const 1-2+ %xdefine %1 mangle(private_prefix %+ _ %+ %1) - %ifidn __OUTPUT_FORMAT__,elf + %if FORMAT_ELF global %1:data hidden %else global %1 @@ -727,9 +742,8 @@ %1: %2 %endmacro -; This is needed for ELF, otherwise the GNU linker assumes the stack is -; executable by default. -%ifidn __OUTPUT_FORMAT__,elf +; This is needed for ELF, otherwise the GNU linker assumes the stack is executable by default. +%if FORMAT_ELF [SECTION .note.GNU-stack noalloc noexec nowrite progbits] %endif @@ -801,9 +815,17 @@ %endif %if ARCH_X86_64 || cpuflag(sse2) - CPU amdnop + %ifdef __NASM_VER__ + ALIGNMODE p6 + %else + CPU amdnop + %endif %else - CPU basicnop + %ifdef __NASM_VER__ + ALIGNMODE nop + %else + CPU basicnop + %endif %endif %endmacro @@ -1467,7 +1489,7 @@ v%5%6 %1, %2, %3, %4 %elifidn %1, %2 ; If %3 or %4 is a memory operand it needs to be encoded as the last operand. - %ifid %3 + %ifnum sizeof%3 v%{5}213%6 %2, %3, %4 %else v%{5}132%6 %2, %4, %3 @@ -1491,14 +1513,3 @@ FMA4_INSTR fmsubadd, pd, ps FMA4_INSTR fnmadd, pd, ps, sd, ss FMA4_INSTR fnmsub, pd, ps, sd, ss - -; workaround: vpbroadcastq is broken in x86_32 due to a yasm bug (fixed in 1.3.0) -%if __YASM_VERSION_ID__ < 0x01030000 && ARCH_X86_64 == 0 - %macro vpbroadcastq 2 - %if sizeof%1 == 16 - movddup %1, %2 - %else - vbroadcastsd %1, %2 - %endif - %endmacro -%endif
View file
x265_2.6.tar.gz/source/dynamicHDR10/JsonHelper.cpp -> x265_2.7.tar.gz/source/dynamicHDR10/JsonHelper.cpp
Changed
@@ -139,21 +139,13 @@ return JsonObject(); } - ifstream tfile; - string json_str; - string json_str2; + std::ifstream ifs(path); + const std::string json_str2((std::istreambuf_iterator<char>(ifs)), + (std::istreambuf_iterator<char>())); + string err = ""; - tfile.open(path); - while(tfile) - { - std::getline(tfile, json_str); - json_str2.append(json_str); - } - tfile.close(); - size_t beginning = json_str2.find_first_of("{"); - int fixchar = json_str2[json_str2.size() - 2] == '}' ? 1 : 0; - return Json::parse(json_str2.substr(beginning,json_str2.size() - fixchar),err).object_items(); + return Json::parse(json_str2,err, JsonParse::COMMENTS).object_items(); } JsonArray JsonHelper::readJsonArray(const string &path) @@ -174,28 +166,13 @@ return JsonArray(); } - ifstream tfile; - string json_str; - string json_str2; - string err = ""; - tfile.open(path); - while(tfile) - { - std::getline(tfile, json_str); - json_str2.append(json_str); - } + std::ifstream ifs(path); + const std::string json_str2((std::istreambuf_iterator<char>(ifs)), + (std::istreambuf_iterator<char>())); - tfile.close(); + string err = ""; - vector<Json> data; - if (json_str2.size() != 0) - { - size_t beginning = json_str2.find_first_of("["); - int fixchar = json_str2[json_str2.size() - 2] == ']' ? 1 : 0; - return Json::parse(json_str2.substr(beginning, json_str2.size() - fixchar), err).array_items(); - } - else - return data; + return Json::parse(json_str2,err, JsonParse::COMMENTS).array_items(); } bool JsonHelper::validatePathExtension(string &path)
View file
x265_2.6.tar.gz/source/dynamicHDR10/SeiMetadataDictionary.cpp -> x265_2.7.tar.gz/source/dynamicHDR10/SeiMetadataDictionary.cpp
Changed
@@ -28,6 +28,7 @@ const std::string JsonDataKeys::LocalParameters = std::string("LocalParameters"); const std::string JsonDataKeys::TargetDisplayLuminance = std::string("TargetedSystemDisplayMaximumLuminance"); +const std::string JsonDataKeys::NumberOfWindows = std::string("NumberOfWindows"); const std::string BezierCurveNames::TagName = std::string("BezierCurveData"); const std::string BezierCurveNames::NumberOfAnchors = std::string("NumberOfAnchors");
View file
x265_2.6.tar.gz/source/dynamicHDR10/SeiMetadataDictionary.h -> x265_2.7.tar.gz/source/dynamicHDR10/SeiMetadataDictionary.h
Changed
@@ -37,6 +37,7 @@ public: static const std::string LocalParameters; static const std::string TargetDisplayLuminance; + static const std::string NumberOfWindows; }; //Bezier Curve Data
View file
x265_2.6.tar.gz/source/dynamicHDR10/metadataFromJson.cpp -> x265_2.7.tar.gz/source/dynamicHDR10/metadataFromJson.cpp
Changed
@@ -372,7 +372,7 @@ const uint16_t terminalProviderCode = 0x003C; const uint16_t terminalProviderOrientedCode = 0x0001; const uint8_t applicationIdentifier = 4; - const uint8_t applicationVersion = 0; + const uint8_t applicationVersion = 1; mPimpl->appendBits(metadata, countryCode, 8); mPimpl->appendBits(metadata, terminalProviderCode, 16); @@ -384,9 +384,7 @@ //Note: Validated only add up to two local selections, ignore the rest JsonArray jsonArray = fileData[frame][JsonDataKeys::LocalParameters].array_items(); int ellipsesNum = static_cast<int>(jsonArray.size() > 2 ? 2 : jsonArray.size()); - - uint16_t numWindows = 1 + static_cast<uint16_t>(ellipsesNum); - + uint16_t numWindows = (uint16_t)fileData[frame][JsonDataKeys::NumberOfWindows].int_value(); mPimpl->appendBits(metadata, numWindows, 2); for (int i = 0; i < ellipsesNum; ++i) { @@ -426,16 +424,15 @@ mPimpl->appendBits(metadata, semimajorExternalAxis, 16); mPimpl->appendBits(metadata, semiminorExternalAxis, 16); - /*bool*/ uint8_t overlapProcessOption = static_cast<uint8_t>(ellipseJsonObject[EllipseNames::OverlapProcessOption].int_value()); //1; + uint8_t overlapProcessOption = static_cast<uint8_t>(ellipseJsonObject[EllipseNames::OverlapProcessOption].int_value()); //TODO: Uses Layering method, the value is "1" mPimpl->appendBits(metadata, overlapProcessOption, 1); } /* Targeted System Display Data */ - uint32_t TEMPmonitorPeak = fileData[frame][JsonDataKeys::TargetDisplayLuminance].int_value(); //500; - mPimpl->appendBits(metadata, TEMPmonitorPeak, 27); - + uint32_t monitorPeak = fileData[frame][JsonDataKeys::TargetDisplayLuminance].int_value(); //500; + mPimpl->appendBits(metadata, monitorPeak, 27); //NOTE: Set as false for now, as requested - /*bool*/uint8_t targetedSystemDisplayActualPeakLuminanceFlag = 0; /*false*/ + uint8_t targetedSystemDisplayActualPeakLuminanceFlag = 0; mPimpl->appendBits(metadata, targetedSystemDisplayActualPeakLuminanceFlag, 1); if (targetedSystemDisplayActualPeakLuminanceFlag) { @@ -463,7 +460,6 @@ mPimpl->appendBits(metadata, static_cast<uint16_t>((int)luminanceData.maxGLuminance & 0xFFFF), 16); mPimpl->appendBits(metadata, static_cast<uint8_t>(((int)luminanceData.maxBLuminance & 0x10000) >> 16), 1); mPimpl->appendBits(metadata, static_cast<uint16_t>((int)luminanceData.maxBLuminance & 0xFFFF), 16); - /* changed from maxRGBLuminance to average luminance to match stms implementation */ mPimpl->appendBits(metadata, static_cast<uint8_t>(((int)luminanceData.averageLuminance & 0x10000) >> 16), 1); mPimpl->appendBits(metadata, static_cast<uint16_t>((int)luminanceData.averageLuminance & 0xFFFF), 16); @@ -478,7 +474,7 @@ uint8_t distributionMaxrgbPercentage = static_cast<uint8_t>(percentilPercentages.at(i)); mPimpl->appendBits(metadata, distributionMaxrgbPercentage, 7); - // 17bits: 1bit then 16 + /* 17bits: 1bit then 16 */ unsigned int ithPercentile = luminanceData.percentiles.at(i); uint8_t highValue = static_cast<uint8_t>((ithPercentile & 0x10000) >> 16); uint16_t lowValue = static_cast<uint16_t>(ithPercentile & 0xFFFF); @@ -499,33 +495,32 @@ { //TODO } - // BEZIER CURVE DATA + /* Bezier Curve Data */ for (int w = 0; w < numWindows; ++w) { - //TODO: uint8_t toneMappingFlag = 1; - mPimpl->appendBits(metadata, toneMappingFlag, 1); - if (toneMappingFlag) + /* Check if the window contains tone mapping bezier curve data and set toneMappingFlag appropriately */ + //Json bezierData = fileData[frame][BezierCurveNames::TagName]; + BezierCurveData curveData; + /* Select curve data based on global window */ + if (w == 0) { - Json bezierData = fileData[frame][BezierCurveNames::TagName]; - BezierCurveData curveData; - - /* Select curve data based on global window or local window */ - if (w == 0) + if (!mPimpl->bezierCurveFromJson(fileData[frame][BezierCurveNames::TagName], curveData)) { - if (!mPimpl->bezierCurveFromJson(bezierData, curveData)) - { - std::cout << "error parsing bezierCurve frame: " << w << std::endl; - } + toneMappingFlag = 0; } - else + } + /* Select curve data based on local window */ + else + { + if (!mPimpl->bezierCurveFromJson(jsonArray[w - 1][BezierCurveNames::TagName], curveData)) { - if (!mPimpl->bezierCurveFromJson(jsonArray[w - 1][BezierCurveNames::TagName], curveData)) - { - std::cout << "error parsing bezierCurve ellipse: " << w - 1 << std::endl; - } + toneMappingFlag = 0; } - + } + mPimpl->appendBits(metadata, toneMappingFlag, 1); + if (toneMappingFlag) + { uint16_t kneePointX = static_cast<uint16_t>(curveData.sPx); mPimpl->appendBits(metadata, kneePointX, 12); uint16_t kneePointY = static_cast<uint16_t>(curveData.sPy); @@ -541,7 +536,7 @@ mPimpl->appendBits(metadata, anchor, 10); } } - } + } /* Set to false as requested */ bool colorSaturationMappingFlag = 0; mPimpl->appendBits(metadata, colorSaturationMappingFlag, 1);
View file
x265_2.6.tar.gz/source/encoder/analysis.cpp -> x265_2.7.tar.gz/source/encoder/analysis.cpp
Changed
@@ -100,16 +100,17 @@ for (uint32_t depth = 0; depth <= m_param->maxCUDepth; depth++, cuSize >>= 1) { ModeDepth &md = m_modeDepth[depth]; - - md.cuMemPool.create(depth, csp, MAX_PRED_TYPES, *m_param); + ok &= md.cuMemPool.create(depth, csp, MAX_PRED_TYPES, *m_param); ok &= md.fencYuv.create(cuSize, csp); - - for (int j = 0; j < MAX_PRED_TYPES; j++) + if (ok) { - md.pred[j].cu.initialize(md.cuMemPool, depth, *m_param, j); - ok &= md.pred[j].predYuv.create(cuSize, csp); - ok &= md.pred[j].reconYuv.create(cuSize, csp); - md.pred[j].fencYuv = &md.fencYuv; + for (int j = 0; j < MAX_PRED_TYPES; j++) + { + md.pred[j].cu.initialize(md.cuMemPool, depth, *m_param, j); + ok &= md.pred[j].predYuv.create(cuSize, csp); + ok &= md.pred[j].reconYuv.create(cuSize, csp); + md.pred[j].fencYuv = &md.fencYuv; + } } } if (m_param->sourceHeight >= 1080) @@ -158,38 +159,34 @@ if (m_param->bCTUInfo && (*m_frame->m_ctuInfo + ctu.m_cuAddr)) { x265_ctu_info_t* ctuTemp = *m_frame->m_ctuInfo + ctu.m_cuAddr; - if (ctuTemp->ctuPartitions) - { - int32_t depthIdx = 0; - uint32_t maxNum8x8Partitions = 64; - uint8_t* depthInfoPtr = m_frame->m_addOnDepth[ctu.m_cuAddr]; - uint8_t* contentInfoPtr = m_frame->m_addOnCtuInfo[ctu.m_cuAddr]; - int* prevCtuInfoChangePtr = m_frame->m_addOnPrevChange[ctu.m_cuAddr]; - do - { - uint8_t depth = (uint8_t)ctuTemp->ctuPartitions[depthIdx]; - uint8_t content = (uint8_t)(*((int32_t *)ctuTemp->ctuInfo + depthIdx)); - int prevCtuInfoChange = m_frame->m_prevCtuInfoChange[ctu.m_cuAddr * maxNum8x8Partitions + depthIdx]; - memset(depthInfoPtr, depth, sizeof(uint8_t) * numPartition >> 2 * depth); - memset(contentInfoPtr, content, sizeof(uint8_t) * numPartition >> 2 * depth); - memset(prevCtuInfoChangePtr, 0, sizeof(int) * numPartition >> 2 * depth); - for (uint32_t l = 0; l < numPartition >> 2 * depth; l++) - prevCtuInfoChangePtr[l] = prevCtuInfoChange; - depthInfoPtr += ctu.m_numPartitions >> 2 * depth; - contentInfoPtr += ctu.m_numPartitions >> 2 * depth; - prevCtuInfoChangePtr += ctu.m_numPartitions >> 2 * depth; - depthIdx++; - } while (ctuTemp->ctuPartitions[depthIdx] != 0); - - m_additionalCtuInfo = m_frame->m_addOnCtuInfo[ctu.m_cuAddr]; - m_prevCtuInfoChange = m_frame->m_addOnPrevChange[ctu.m_cuAddr]; - memcpy(ctu.m_cuDepth, m_frame->m_addOnDepth[ctu.m_cuAddr], sizeof(uint8_t) * numPartition); - //Calculate log2CUSize from depth - for (uint32_t i = 0; i < cuGeom.numPartitions; i++) - ctu.m_log2CUSize[i] = (uint8_t)m_param->maxLog2CUSize - ctu.m_cuDepth[i]; - } + int32_t depthIdx = 0; + uint32_t maxNum8x8Partitions = 64; + uint8_t* depthInfoPtr = m_frame->m_addOnDepth[ctu.m_cuAddr]; + uint8_t* contentInfoPtr = m_frame->m_addOnCtuInfo[ctu.m_cuAddr]; + int* prevCtuInfoChangePtr = m_frame->m_addOnPrevChange[ctu.m_cuAddr]; + do + { + uint8_t depth = (uint8_t)ctuTemp->ctuPartitions[depthIdx]; + uint8_t content = (uint8_t)(*((int32_t *)ctuTemp->ctuInfo + depthIdx)); + int prevCtuInfoChange = m_frame->m_prevCtuInfoChange[ctu.m_cuAddr * maxNum8x8Partitions + depthIdx]; + memset(depthInfoPtr, depth, sizeof(uint8_t) * numPartition >> 2 * depth); + memset(contentInfoPtr, content, sizeof(uint8_t) * numPartition >> 2 * depth); + memset(prevCtuInfoChangePtr, 0, sizeof(int) * numPartition >> 2 * depth); + for (uint32_t l = 0; l < numPartition >> 2 * depth; l++) + prevCtuInfoChangePtr[l] = prevCtuInfoChange; + depthInfoPtr += ctu.m_numPartitions >> 2 * depth; + contentInfoPtr += ctu.m_numPartitions >> 2 * depth; + prevCtuInfoChangePtr += ctu.m_numPartitions >> 2 * depth; + depthIdx++; + } while (ctuTemp->ctuPartitions[depthIdx] != 0); + + m_additionalCtuInfo = m_frame->m_addOnCtuInfo[ctu.m_cuAddr]; + m_prevCtuInfoChange = m_frame->m_addOnPrevChange[ctu.m_cuAddr]; + memcpy(ctu.m_cuDepth, m_frame->m_addOnDepth[ctu.m_cuAddr], sizeof(uint8_t) * numPartition); + //Calculate log2CUSize from depth + for (uint32_t i = 0; i < cuGeom.numPartitions; i++) + ctu.m_log2CUSize[i] = (uint8_t)m_param->maxLog2CUSize - ctu.m_cuDepth[i]; } - if (m_param->analysisMultiPassRefine && m_param->rc.bStatRead) { m_multipassAnalysis = (analysis2PassFrameData*)m_frame->m_analysis2Pass.analysisFramedata; @@ -207,11 +204,11 @@ } } - if (m_param->analysisReuseMode && m_slice->m_sliceType != I_SLICE && m_param->analysisReuseLevel > 1 && m_param->analysisReuseLevel < 10) + if ((m_param->analysisSave || m_param->analysisLoad) && m_slice->m_sliceType != I_SLICE && m_param->analysisReuseLevel > 1 && m_param->analysisReuseLevel < 10) { int numPredDir = m_slice->isInterP() ? 1 : 2; m_reuseInterDataCTU = (analysis_inter_data*)m_frame->m_analysisData.interData; - m_reuseRef = &m_reuseInterDataCTU->ref[ctu.m_cuAddr * X265_MAX_PRED_MODE_PER_CTU * numPredDir]; + m_reuseRef = &m_reuseInterDataCTU->ref [ctu.m_cuAddr * X265_MAX_PRED_MODE_PER_CTU * numPredDir]; m_reuseDepth = &m_reuseInterDataCTU->depth[ctu.m_cuAddr * ctu.m_numPartitions]; m_reuseModes = &m_reuseInterDataCTU->modes[ctu.m_cuAddr * ctu.m_numPartitions]; if (m_param->analysisReuseLevel > 4) @@ -219,7 +216,7 @@ m_reusePartSize = &m_reuseInterDataCTU->partSize[ctu.m_cuAddr * ctu.m_numPartitions]; m_reuseMergeFlag = &m_reuseInterDataCTU->mergeFlag[ctu.m_cuAddr * ctu.m_numPartitions]; } - if (m_param->analysisReuseMode == X265_ANALYSIS_SAVE) + if (m_param->analysisSave && !m_param->analysisLoad) for (int i = 0; i < X265_MAX_PRED_MODE_PER_CTU * numPredDir; i++) m_reuseRef[i] = -1; } @@ -228,7 +225,7 @@ if (m_slice->m_sliceType == I_SLICE) { analysis_intra_data* intraDataCTU = (analysis_intra_data*)m_frame->m_analysisData.intraData; - if (m_param->analysisReuseMode == X265_ANALYSIS_LOAD && m_param->analysisReuseLevel > 1) + if (m_param->analysisLoad && m_param->analysisReuseLevel > 1) { memcpy(ctu.m_cuDepth, &intraDataCTU->depth[ctu.m_cuAddr * numPartition], sizeof(uint8_t) * numPartition); memcpy(ctu.m_lumaIntraDir, &intraDataCTU->modes[ctu.m_cuAddr * numPartition], sizeof(uint8_t) * numPartition); @@ -239,7 +236,7 @@ } else { - bool bCopyAnalysis = ((m_param->analysisReuseMode == X265_ANALYSIS_LOAD && m_param->analysisReuseLevel == 10) || (m_param->bMVType && m_param->analysisReuseLevel >= 7 && ctu.m_numPartitions <= 16)); + bool bCopyAnalysis = ((m_param->analysisLoad && m_param->analysisReuseLevel == 10) || (m_param->bMVType && m_param->analysisReuseLevel >= 7 && ctu.m_numPartitions <= 16)); bool BCompressInterCUrd0_4 = (m_param->bMVType && m_param->analysisReuseLevel >= 7 && m_param->rdLevel <= 4); bool BCompressInterCUrd5_6 = (m_param->bMVType && m_param->analysisReuseLevel >= 7 && m_param->rdLevel >= 5 && m_param->rdLevel <= 6); bCopyAnalysis = bCopyAnalysis || BCompressInterCUrd0_4 || BCompressInterCUrd5_6; @@ -280,7 +277,7 @@ /* generate residual for entire CTU at once and copy to reconPic */ encodeResidue(ctu, cuGeom); } - else if ((m_param->analysisReuseMode == X265_ANALYSIS_LOAD && m_param->analysisReuseLevel == 10) || ((m_param->bMVType == AVC_INFO) && m_param->analysisReuseLevel >= 7)) + else if ((m_param->analysisLoad && m_param->analysisReuseLevel == 10) || ((m_param->bMVType == AVC_INFO) && m_param->analysisReuseLevel >= 7 && ctu.m_numPartitions <= 16)) { analysis_inter_data* interDataCTU = (analysis_inter_data*)m_frame->m_analysisData.interData; int posCTU = ctu.m_cuAddr * numPartition; @@ -459,11 +456,9 @@ int bestCUQP = qp; int lambdaQP = lqp; - bool doQPRefine = (bDecidedDepth && depth <= m_slice->m_pps->maxCuDQPDepth) || (!bDecidedDepth && depth == m_slice->m_pps->maxCuDQPDepth); - if (m_param->analysisReuseLevel == 10) + if (m_param->analysisReuseLevel >= 7) doQPRefine = false; - if (doQPRefine) { uint64_t bestCUCost, origCUCost, cuCost, cuPrevCost; @@ -652,13 +647,12 @@ cacheCost[cuIdx] = md.bestMode->rdCost; } - /* Save Intra CUs TU depth only when analysis mode is OFF */ - if ((m_limitTU & X265_TU_LIMIT_NEIGH) && cuGeom.log2CUSize >= 4 && !m_param->analysisReuseMode) + if ((m_limitTU & X265_TU_LIMIT_NEIGH) && cuGeom.log2CUSize >= 4) { CUData* ctu = md.bestMode->cu.m_encData->getPicCTU(parentCTU.m_cuAddr); int8_t maxTUDepth = -1; for (uint32_t i = 0; i < cuGeom.numPartitions; i++) - maxTUDepth = X265_MAX(maxTUDepth, md.pred[PRED_INTRA].cu.m_tuDepth[i]); + maxTUDepth = X265_MAX(maxTUDepth, md.bestMode->cu.m_tuDepth[i]); ctu->m_refTuDepth[cuGeom.geomRecurId] = maxTUDepth; } @@ -1265,7 +1259,7 @@ mightSplit &= !bDecidedDepth; } } - if ((m_param->analysisReuseMode == X265_ANALYSIS_LOAD && m_param->analysisReuseLevel > 1 && m_param->analysisReuseLevel != 10)) + if ((m_param->analysisLoad && m_param->analysisReuseLevel > 1 && m_param->analysisReuseLevel != 10)) { if (mightNotSplit && depth == m_reuseDepth[cuGeom.absPartIdx]) { @@ -1305,9 +1299,8 @@ } } } - /* Step 1. Evaluate Merge/Skip candidates for likely early-outs, if skip mode was not set above */ - if ((mightNotSplit && depth >= minDepth && !md.bestMode && !bCtuInfoCheck) || (m_param->bMVType && (m_modeFlag[0] || m_modeFlag[1]))) /* TODO: Re-evaluate if analysis load/save still works */ + if ((mightNotSplit && depth >= minDepth && !md.bestMode && !bCtuInfoCheck) || (m_param->bMVType && m_param->analysisReuseLevel == 7 && (m_modeFlag[0] || m_modeFlag[1]))) /* TODO: Re-evaluate if analysis load/save still works */ { /* Compute Merge Cost */ md.pred[PRED_MERGE].cu.initSubCU(parentCTU, cuGeom, qp); @@ -1317,8 +1310,7 @@ skipModes = (m_param->bEnableEarlySkip || m_param->interRefine == 2) && md.bestMode && md.bestMode->cu.isSkipped(0); // TODO: sa8d threshold per depth } - - if (md.bestMode && m_param->bEnableRecursionSkip && !bCtuInfoCheck && !(m_param->bMVType && (m_modeFlag[0] || m_modeFlag[1]))) + if (md.bestMode && m_param->bEnableRecursionSkip && !bCtuInfoCheck && !(m_param->bMVType && m_param->analysisReuseLevel == 7 && (m_modeFlag[0] || m_modeFlag[1]))) { skipRecursion = md.bestMode->cu.isSkipped(0);
View file
x265_2.6.tar.gz/source/encoder/api.cpp -> x265_2.7.tar.gz/source/encoder/api.cpp
Changed
@@ -67,9 +67,7 @@ "Y PSNR, U PSNR, V PSNR, Global PSNR, SSIM, SSIM (dB), " "I count, I ave-QP, I kbps, I-PSNR Y, I-PSNR U, I-PSNR V, I-SSIM (dB), " "P count, P ave-QP, P kbps, P-PSNR Y, P-PSNR U, P-PSNR V, P-SSIM (dB), " - "B count, B ave-QP, B kbps, B-PSNR Y, B-PSNR U, B-PSNR V, B-SSIM (dB), " - "MaxCLL, MaxFALL, Version\n"; - + "B count, B ave-QP, B kbps, B-PSNR Y, B-PSNR U, B-PSNR V, B-SSIM (dB), "; x265_encoder *x265_encoder_open(x265_param *p) { if (!p) @@ -192,9 +190,10 @@ { if (!enc || !param_in) return -1; - x265_param save; Encoder* encoder = static_cast<Encoder*>(enc); + if (encoder->m_param->csvfn == NULL && param_in->csvfpt != NULL) + encoder->m_param->csvfpt = param_in->csvfpt; if (encoder->m_latestParam->forceFlush != param_in->forceFlush) return encoder->reconfigureParam(encoder->m_latestParam, param_in); bool isReconfigureRc = encoder->isReconfigureRc(encoder->m_latestParam, param_in); @@ -311,7 +310,9 @@ Encoder *encoder = static_cast<Encoder*>(enc); x265_stats stats; encoder->fetchStats(&stats, sizeof(stats)); - x265_csvlog_encode(enc, &stats, argc, argv); + int padx = encoder->m_sps.conformanceWindow.rightOffset; + int pady = encoder->m_sps.conformanceWindow.bottomOffset; + x265_csvlog_encode(encoder->m_param, &stats, padx, pady, argc, argv); } } @@ -356,13 +357,13 @@ return -1; } -int x265_get_ref_frame_list(x265_encoder *enc, x265_picyuv** l0, x265_picyuv** l1, int sliceType, int poc) +int x265_get_ref_frame_list(x265_encoder *enc, x265_picyuv** l0, x265_picyuv** l1, int sliceType, int poc, int* pocL0, int* pocL1) { if (!enc) return -1; Encoder *encoder = static_cast<Encoder*>(enc); - return encoder->getRefFrameList((PicYuv**)l0, (PicYuv**)l1, sliceType, poc); + return encoder->getRefFrameList((PicYuv**)l0, (PicYuv**)l1, sliceType, poc, pocL0, pocL1); } int x265_set_analysis_data(x265_encoder *enc, x265_analysis_data *analysis_data, int poc, uint32_t cuBytes) @@ -398,7 +399,7 @@ pic->userSEI.payloads = NULL; pic->userSEI.numPayloads = 0; - if (param->analysisReuseMode || (param->bMVType == AVC_INFO)) + if ((param->analysisSave || param->analysisLoad) || (param->bMVType == AVC_INFO)) { uint32_t widthInCU = (param->sourceWidth + param->maxCUSize - 1) >> param->maxLog2CUSize; uint32_t heightInCU = (param->sourceHeight + param->maxCUSize - 1) >> param->maxLog2CUSize; @@ -754,7 +755,12 @@ fprintf(csvfp, "\n"); } else + { fputs(summaryCSVHeader, csvfp); + if (param->csvLogLevel >= 2 || param->maxCLL || param->maxFALL) + fputs("MaxCLL, MaxFALL,", csvfp); + fputs(" Version\n", csvfp); + } } return csvfp; } @@ -867,45 +873,40 @@ fflush(stderr); } -void x265_csvlog_encode(x265_encoder *enc, const x265_stats* stats, int argc, char** argv) +void x265_csvlog_encode(const x265_param *p, const x265_stats *stats, int padx, int pady, int argc, char** argv) { - if (enc) + if (p && p->csvfpt) { - Encoder *encoder = static_cast<Encoder*>(enc); - int padx = encoder->m_sps.conformanceWindow.rightOffset; - int pady = encoder->m_sps.conformanceWindow.bottomOffset; const x265_api * api = x265_api_get(0); - if (!encoder->m_param->csvfpt) - return; - - if (encoder->m_param->csvLogLevel) + if (p->csvLogLevel) { // adding summary to a per-frame csv log file, so it needs a summary header - fprintf(encoder->m_param->csvfpt, "\nSummary\n"); - fputs(summaryCSVHeader, encoder->m_param->csvfpt); + fprintf(p->csvfpt, "\nSummary\n"); + fputs(summaryCSVHeader, p->csvfpt); + if (p->csvLogLevel >= 2 || p->maxCLL || p->maxFALL) + fputs("MaxCLL, MaxFALL,", p->csvfpt); + fputs(" Version\n",p->csvfpt); } - // CLI arguments or other if (argc) { - fputc('"', encoder->m_param->csvfpt); + fputc('"', p->csvfpt); for (int i = 1; i < argc; i++) { - fputc(' ', encoder->m_param->csvfpt); - fputs(argv[i], encoder->m_param->csvfpt); + fputc(' ', p->csvfpt); + fputs(argv[i], p->csvfpt); } - fputc('"', encoder->m_param->csvfpt); + fputc('"', p->csvfpt); } else { - const x265_param* paramTemp = encoder->m_param; - char *opts = x265_param2string((x265_param*)paramTemp, padx, pady); + char *opts = x265_param2string((x265_param*)p, padx, pady); if (opts) { - fputc('"', encoder->m_param->csvfpt); - fputs(opts, encoder->m_param->csvfpt); - fputc('"', encoder->m_param->csvfpt); + fputc('"', p->csvfpt); + fputs(opts, p->csvfpt); + fputc('"', p->csvfpt); } } @@ -916,69 +917,70 @@ timeinfo = localtime(&now); char buffer[200]; strftime(buffer, 128, "%c", timeinfo); - fprintf(encoder->m_param->csvfpt, ", %s, ", buffer); + fprintf(p->csvfpt, ", %s, ", buffer); // elapsed time, fps, bitrate - fprintf(encoder->m_param->csvfpt, "%.2f, %.2f, %.2f,", + fprintf(p->csvfpt, "%.2f, %.2f, %.2f,", stats->elapsedEncodeTime, stats->encodedPictureCount / stats->elapsedEncodeTime, stats->bitrate); - if (encoder->m_param->bEnablePsnr) - fprintf(encoder->m_param->csvfpt, " %.3lf, %.3lf, %.3lf, %.3lf,", + if (p->bEnablePsnr) + fprintf(p->csvfpt, " %.3lf, %.3lf, %.3lf, %.3lf,", stats->globalPsnrY / stats->encodedPictureCount, stats->globalPsnrU / stats->encodedPictureCount, stats->globalPsnrV / stats->encodedPictureCount, stats->globalPsnr); else - fprintf(encoder->m_param->csvfpt, " -, -, -, -,"); - if (encoder->m_param->bEnableSsim) - fprintf(encoder->m_param->csvfpt, " %.6f, %6.3f,", stats->globalSsim, x265_ssim2dB(stats->globalSsim)); + fprintf(p->csvfpt, " -, -, -, -,"); + if (p->bEnableSsim) + fprintf(p->csvfpt, " %.6f, %6.3f,", stats->globalSsim, x265_ssim2dB(stats->globalSsim)); else - fprintf(encoder->m_param->csvfpt, " -, -,"); + fprintf(p->csvfpt, " -, -,"); if (stats->statsI.numPics) { - fprintf(encoder->m_param->csvfpt, " %-6u, %2.2lf, %-8.2lf,", stats->statsI.numPics, stats->statsI.avgQp, stats->statsI.bitrate); - if (encoder->m_param->bEnablePsnr) - fprintf(encoder->m_param->csvfpt, " %.3lf, %.3lf, %.3lf,", stats->statsI.psnrY, stats->statsI.psnrU, stats->statsI.psnrV); + fprintf(p->csvfpt, " %-6u, %2.2lf, %-8.2lf,", stats->statsI.numPics, stats->statsI.avgQp, stats->statsI.bitrate); + if (p->bEnablePsnr) + fprintf(p->csvfpt, " %.3lf, %.3lf, %.3lf,", stats->statsI.psnrY, stats->statsI.psnrU, stats->statsI.psnrV); else - fprintf(encoder->m_param->csvfpt, " -, -, -,"); - if (encoder->m_param->bEnableSsim) - fprintf(encoder->m_param->csvfpt, " %.3lf,", stats->statsI.ssim); + fprintf(p->csvfpt, " -, -, -,"); + if (p->bEnableSsim) + fprintf(p->csvfpt, " %.3lf,", stats->statsI.ssim); else - fprintf(encoder->m_param->csvfpt, " -,"); + fprintf(p->csvfpt, " -,"); } else - fprintf(encoder->m_param->csvfpt, " -, -, -, -, -, -, -,"); + fprintf(p->csvfpt, " -, -, -, -, -, -, -,"); if (stats->statsP.numPics) { - fprintf(encoder->m_param->csvfpt, " %-6u, %2.2lf, %-8.2lf,", stats->statsP.numPics, stats->statsP.avgQp, stats->statsP.bitrate); - if (encoder->m_param->bEnablePsnr) - fprintf(encoder->m_param->csvfpt, " %.3lf, %.3lf, %.3lf,", stats->statsP.psnrY, stats->statsP.psnrU, stats->statsP.psnrV); + fprintf(p->csvfpt, " %-6u, %2.2lf, %-8.2lf,", stats->statsP.numPics, stats->statsP.avgQp, stats->statsP.bitrate); + if (p->bEnablePsnr) + fprintf(p->csvfpt, " %.3lf, %.3lf, %.3lf,", stats->statsP.psnrY, stats->statsP.psnrU, stats->statsP.psnrV); else - fprintf(encoder->m_param->csvfpt, " -, -, -,"); - if (encoder->m_param->bEnableSsim) - fprintf(encoder->m_param->csvfpt, " %.3lf,", stats->statsP.ssim); + fprintf(p->csvfpt, " -, -, -,"); + if (p->bEnableSsim)
View file
x265_2.6.tar.gz/source/encoder/dpb.cpp -> x265_2.7.tar.gz/source/encoder/dpb.cpp
Changed
@@ -92,19 +92,14 @@ m_freeList.pushBack(*curFrame); curFrame->m_encData->m_freeListNext = m_frameDataFreeList; m_frameDataFreeList = curFrame->m_encData; - - if (curFrame->m_encData->m_meBuffer) + for (int i = 0; i < INTEGRAL_PLANE_NUM; i++) { - for (int i = 0; i < INTEGRAL_PLANE_NUM; i++) + if (curFrame->m_encData->m_meBuffer[i] != NULL) { - if (curFrame->m_encData->m_meBuffer[i] != NULL) - { - X265_FREE(curFrame->m_encData->m_meBuffer[i]); - curFrame->m_encData->m_meBuffer[i] = NULL; - } + X265_FREE(curFrame->m_encData->m_meBuffer[i]); + curFrame->m_encData->m_meBuffer[i] = NULL; } } - if (curFrame->m_ctuInfo != NULL) { uint32_t widthInCU = (curFrame->m_param->sourceWidth + curFrame->m_param->maxCUSize - 1) >> curFrame->m_param->maxLog2CUSize; @@ -181,7 +176,10 @@ // Mark pictures in m_piclist as unreferenced if they are not included in RPS applyReferencePictureSet(&slice->m_rps, pocCurr); - slice->m_numRefIdx[0] = X265_MIN(newFrame->m_param->maxNumReferences, slice->m_rps.numberOfNegativePictures); // Ensuring L0 contains just the -ve POC + if (slice->m_sliceType != I_SLICE) + slice->m_numRefIdx[0] = x265_clip3(1, newFrame->m_param->maxNumReferences, slice->m_rps.numberOfNegativePictures); + else + slice->m_numRefIdx[0] = X265_MIN(newFrame->m_param->maxNumReferences, slice->m_rps.numberOfNegativePictures); // Ensuring L0 contains just the -ve POC slice->m_numRefIdx[1] = X265_MIN(newFrame->m_param->bBPyramid ? 2 : 1, slice->m_rps.numberOfPositivePictures); slice->setRefPicList(m_picList); @@ -230,11 +228,14 @@ { if ((iterPic->m_poc != curPoc) && iterPic->m_encData->m_bHasReferences) { - rps->poc[poci] = iterPic->m_poc; - rps->deltaPOC[poci] = rps->poc[poci] - curPoc; - (rps->deltaPOC[poci] < 0) ? numNeg++ : numPos++; - rps->bUsed[poci] = !isRAP; - poci++; + if ((m_lastIDR >= curPoc) || (m_lastIDR <= iterPic->m_poc)) + { + rps->poc[poci] = iterPic->m_poc; + rps->deltaPOC[poci] = rps->poc[poci] - curPoc; + (rps->deltaPOC[poci] < 0) ? numNeg++ : numPos++; + rps->bUsed[poci] = !isRAP; + poci++; + } } iterPic = iterPic->m_next; }
View file
x265_2.6.tar.gz/source/encoder/encoder.cpp -> x265_2.7.tar.gz/source/encoder/encoder.cpp
Changed
@@ -50,10 +50,8 @@ /* Threshold for motion vection, based on expermental result. * TODO: come up an algorithm for adoptive threshold */ - -#define MVTHRESHOLD 10 +#define MVTHRESHOLD (10*10) #define PU_2Nx2N 1 - static const char* defaultAnalysisFileName = "x265_analysis.dat"; using namespace X265_NS; @@ -79,7 +77,6 @@ m_param = NULL; m_latestParam = NULL; m_threadPool = NULL; - m_analysisFile = NULL; m_analysisFileIn = NULL; m_analysisFileOut = NULL; m_offsetEmergency = NULL; @@ -344,19 +341,29 @@ m_aborted = true; if (!m_lookahead->create()) m_aborted = true; - initRefIdx(); - - if (m_param->analysisReuseMode) + if (m_param->analysisSave && m_param->bUseAnalysisFile) { - const char* name = m_param->analysisReuseFileName; - if (!name) - name = defaultAnalysisFileName; - const char* mode = m_param->analysisReuseMode == X265_ANALYSIS_LOAD ? "rb" : "wb"; - m_analysisFile = x265_fopen(name, mode); - if (!m_analysisFile) + char* temp = strcatFilename(m_param->analysisSave, ".temp"); + if (!temp) + m_aborted = true; + else { - x265_log_file(NULL, X265_LOG_ERROR, "Analysis load/save: failed to open file %s\n", name); + m_analysisFileOut = x265_fopen(temp, "wb"); + X265_FREE(temp); + } + if (!m_analysisFileOut) + { + x265_log_file(NULL, X265_LOG_ERROR, "Analysis save: failed to open file %s.temp\n", m_param->analysisSave); + m_aborted = true; + } + } + if (m_param->analysisLoad && m_param->bUseAnalysisFile) + { + m_analysisFileIn = x265_fopen(m_param->analysisLoad, "rb"); + if (!m_analysisFileIn) + { + x265_log_file(NULL, X265_LOG_ERROR, "Analysis load: failed to open file %s\n", m_param->analysisLoad); m_aborted = true; } } @@ -450,7 +457,7 @@ return 0; } -int Encoder::getRefFrameList(PicYuv** l0, PicYuv** l1, int sliceType, int poc) +int Encoder::getRefFrameList(PicYuv** l0, PicYuv** l1, int sliceType, int poc, int* pocL0, int* pocL1) { if (!(IS_X265_TYPE_I(sliceType))) { @@ -462,9 +469,10 @@ if (framePtr->m_encData->m_slice->m_refFrameList[0][j] && framePtr->m_encData->m_slice->m_refFrameList[0][j]->m_reconPic != NULL) { int l0POC = framePtr->m_encData->m_slice->m_refFrameList[0][j]->m_poc; + pocL0[j] = l0POC; Frame* l0Fp = m_dpb->m_picList.getPOC(l0POC); - if (l0Fp->m_reconPic->m_picOrg[0] == NULL) - l0Fp->m_reconEncoded.wait(); /* If recon is not ready, current frame encoder need to wait. */ + while (l0Fp->m_reconRowFlag[l0Fp->m_numRows - 1].get() == 0) + l0Fp->m_reconRowFlag[l0Fp->m_numRows - 1].waitForChange(0); /* If recon is not ready, current frame encoder has to wait. */ l0[j] = l0Fp->m_reconPic; } } @@ -473,15 +481,19 @@ if (framePtr->m_encData->m_slice->m_refFrameList[1][j] && framePtr->m_encData->m_slice->m_refFrameList[1][j]->m_reconPic != NULL) { int l1POC = framePtr->m_encData->m_slice->m_refFrameList[1][j]->m_poc; + pocL1[j] = l1POC; Frame* l1Fp = m_dpb->m_picList.getPOC(l1POC); - if (l1Fp->m_reconPic->m_picOrg[0] == NULL) - l1Fp->m_reconEncoded.wait(); /* If recon is not ready, current frame encoder need to wait. */ + while (l1Fp->m_reconRowFlag[l1Fp->m_numRows - 1].get() == 0) + l1Fp->m_reconRowFlag[l1Fp->m_numRows - 1].waitForChange(0); /* If recon is not ready, current frame encoder has to wait. */ l1[j] = l1Fp->m_reconPic; } } } else - x265_log(NULL, X265_LOG_WARNING, "Refrence List is not in piclist\n"); + { + x265_log(NULL, X265_LOG_WARNING, "Current frame is not in DPB piclist.\n"); + return 1; + } } else { @@ -564,19 +576,19 @@ { int cuOffset = cuI * bytes + pu; (interData)->mergeFlag[cuPos + cuOffset] = (srcInterData)->mergeFlag[(mbIndex * 16) + cuOffset]; - + (interData)->sadCost[cuPos + cuOffset] = (srcInterData)->sadCost[(mbIndex * 16) + cuOffset]; (interData)->interDir[cuPos + cuOffset] = (srcInterData)->interDir[(mbIndex * 16) + cuOffset]; for (uint32_t k = 0; k < numDir; k++) { (interData)->mvpIdx[k][cuPos + cuOffset] = (srcInterData)->mvpIdx[k][(mbIndex * 16) + cuOffset]; (interData)->refIdx[k][cuPos + cuOffset] = (srcInterData)->refIdx[k][(mbIndex * 16) + cuOffset]; memcpy(&(interData)->mv[k][cuPos + cuOffset], &(srcInterData)->mv[k][(mbIndex * 16) + cuOffset], sizeof(MV)); - if (m_param->analysisReuseLevel == 7) + if (m_param->analysisReuseLevel == 7 && numPU == PU_2Nx2N && + ((interData)->depth[cuPos + cuOffset] == (m_param->maxCUSize >> 5))) { - int mv_x = ((analysis_inter_data *)curFrame->m_analysisData.interData)->mv[k][(mbIndex * 16) + cuOffset].x; - int mv_y = ((analysis_inter_data *)curFrame->m_analysisData.interData)->mv[k][(mbIndex * 16) + cuOffset].y; - double mv = sqrt(mv_x*mv_x + mv_y*mv_y); - if (numPU == PU_2Nx2N && ((srcInterData)->depth[cuPos + cuOffset] == (m_param->maxCUSize >> 5)) && mv <= MVTHRESHOLD) + int mv_x = (interData)->mv[k][cuPos + cuOffset].x; + int mv_y = (interData)->mv[k][cuPos + cuOffset].y; + if ((mv_x*mv_x + mv_y*mv_y) <= MVTHRESHOLD) memset(&curFrame->m_analysisData.modeFlag[k][cuPos + cuOffset], 1, bytes); } } @@ -642,9 +654,10 @@ if (m_param->analysisReuseLevel > 4) { memset(&(currInterData)->partSize[count], (interData)->partSize[d], bytes); - int numPU = nbPartsTable[(currInterData)->partSize[d]]; - for (int pu = 0; pu < numPU; pu++, d++) + int numPU = nbPartsTable[(interData)->partSize[d]]; + for (int pu = 0; pu < numPU; pu++) { + if (pu) d++; (currInterData)->mergeFlag[count + pu] = (interData)->mergeFlag[d]; if (m_param->analysisReuseLevel >= 7) { @@ -654,12 +667,11 @@ (currInterData)->mvpIdx[i][count + pu] = (interData)->mvpIdx[i][d]; (currInterData)->refIdx[i][count + pu] = (interData)->refIdx[i][d]; memcpy(&(currInterData)->mv[i][count + pu], &(interData)->mv[i][d], sizeof(MV)); - if (m_param->analysisReuseLevel == 7) + if (m_param->analysisReuseLevel == 7 && numPU == PU_2Nx2N && m_param->num4x4Partitions <= 16) { - int mv_x = ((analysis_inter_data *)curFrame->m_analysisData.interData)->mv[i][count + pu].x; - int mv_y = ((analysis_inter_data *)curFrame->m_analysisData.interData)->mv[i][count + pu].y; - double mv = sqrt(mv_x*mv_x + mv_y*mv_y); - if (numPU == PU_2Nx2N && m_param->num4x4Partitions <= 16 && mv <= MVTHRESHOLD) + int mv_x = (currInterData)->mv[i][count + pu].x; + int mv_y = (currInterData)->mv[i][count + pu].y; + if ((mv_x*mv_x + mv_y*mv_y) <= MVTHRESHOLD) memset(&curFrame->m_analysisData.modeFlag[i][count + pu], 1, bytes); } } @@ -720,9 +732,6 @@ X265_FREE(m_offsetEmergency); - if (m_analysisFile) - fclose(m_analysisFile); - if (m_latestParam != NULL && m_latestParam != m_param) { if (m_latestParam->scalingLists != m_param->scalingLists) @@ -737,7 +746,7 @@ { int bError = 1; fclose(m_analysisFileOut); - const char* name = m_param->analysisReuseFileName; + const char* name = m_param->analysisSave ? m_param->analysisSave : m_param->analysisReuseFileName; if (!name) name = defaultAnalysisFileName; char* temp = strcatFilename(name, ".temp"); @@ -765,6 +774,8 @@ free((char*)m_param->numaPools); free((char*)m_param->masteringDisplayColorVolume); free((char*)m_param->toneMapFile); + free((char*)m_param->analysisSave); + free((char*)m_param->analysisLoad); PARAM_NS::x265_param_free(m_param); } } @@ -851,7 +862,7 @@ if (m_exportedPic) { - if (!m_param->bUseAnalysisFile && m_param->analysisReuseMode == X265_ANALYSIS_SAVE) + if (!m_param->bUseAnalysisFile && m_param->analysisSave) freeAnalysis(&m_exportedPic->m_analysisData); ATOMIC_DEC(&m_exportedPic->m_countRefEncoders); m_exportedPic = NULL; @@ -1036,7 +1047,7 @@
View file
x265_2.6.tar.gz/source/encoder/encoder.h -> x265_2.7.tar.gz/source/encoder/encoder.h
Changed
@@ -130,7 +130,6 @@ FrameEncoder* m_frameEncoder[X265_MAX_FRAME_THREADS]; DPB* m_dpb; Frame* m_exportedPic; - FILE* m_analysisFile; FILE* m_analysisFileIn; FILE* m_analysisFileOut; x265_param* m_param; @@ -208,7 +207,7 @@ int copySlicetypePocAndSceneCut(int *slicetype, int *poc, int *sceneCut); - int getRefFrameList(PicYuv** l0, PicYuv** l1, int sliceType, int poc); + int getRefFrameList(PicYuv** l0, PicYuv** l1, int sliceType, int poc, int* pocL0, int* pocL1); int setAnalysisDataAfterZScan(x265_analysis_data *analysis_data, Frame* curFrame);
View file
x265_2.6.tar.gz/source/encoder/frameencoder.cpp -> x265_2.7.tar.gz/source/encoder/frameencoder.cpp
Changed
@@ -335,15 +335,13 @@ while (!m_frame->m_ctuInfo) m_frame->m_copied.wait(); } - if ((m_param->bMVType == AVC_INFO) && !m_param->analysisReuseMode && !(IS_X265_TYPE_I(m_frame->m_lowres.sliceType))) + if ((m_param->bMVType == AVC_INFO) && !m_param->analysisSave && !m_param->analysisLoad && !(IS_X265_TYPE_I(m_frame->m_lowres.sliceType))) { while (((m_frame->m_analysisData.interData == NULL && m_frame->m_analysisData.intraData == NULL) || (uint32_t)m_frame->m_poc != m_frame->m_analysisData.poc)) m_frame->m_copyMVType.wait(); } compressFrame(); m_done.trigger(); /* FrameEncoder::getEncodedPicture() blocks for this event */ - if (m_frame != NULL) - m_frame->m_reconEncoded.trigger(); m_enable.wait(); } } @@ -432,7 +430,7 @@ bool bUseWeightB = slice->m_sliceType == B_SLICE && slice->m_pps->bUseWeightedBiPred; WeightParam* reuseWP = NULL; - if (m_param->analysisReuseMode && (bUseWeightP || bUseWeightB)) + if (m_param->analysisLoad && (bUseWeightP || bUseWeightB)) reuseWP = (WeightParam*)m_frame->m_analysisData.wt; if (bUseWeightP || bUseWeightB) @@ -441,7 +439,7 @@ m_cuStats.countWeightAnalyze++; ScopedElapsedTime time(m_cuStats.weightAnalyzeTime); #endif - if (m_param->analysisReuseMode == X265_ANALYSIS_LOAD) + if (m_param->analysisLoad) { for (int list = 0; list < slice->isInterB() + 1; list++) { @@ -468,6 +466,8 @@ else slice->disableWeights(); + if (m_param->analysisSave && (bUseWeightP || bUseWeightB)) + reuseWP = (WeightParam*)m_frame->m_analysisData.wt; // Generate motion references int numPredDir = slice->isInterP() ? 1 : slice->isInterB() ? 2 : 0; for (int l = 0; l < numPredDir; l++) @@ -480,7 +480,7 @@ slice->m_refReconPicList[l][ref] = slice->m_refFrameList[l][ref]->m_reconPic; m_mref[l][ref].init(slice->m_refReconPicList[l][ref], w, *m_param); } - if (m_param->analysisReuseMode == X265_ANALYSIS_SAVE && (bUseWeightP || bUseWeightB)) + if (m_param->analysisSave && (bUseWeightP || bUseWeightB)) { for (int i = 0; i < (m_param->internalCsp != X265_CSP_I400 ? 3 : 1); i++) *(reuseWP++) = slice->m_weightPredTable[l][0][i]; @@ -1413,7 +1413,7 @@ /* TODO: use defines from slicetype.h for lowres block size */ uint32_t block_y = (ctu->m_cuPelY >> m_param->maxLog2CUSize) * noOfBlocks; uint32_t block_x = (ctu->m_cuPelX >> m_param->maxLog2CUSize) * noOfBlocks; - if (m_param->analysisReuseMode != X265_ANALYSIS_LOAD || !m_param->bDisableLookahead) + if (!m_param->analysisLoad || !m_param->bDisableLookahead) { cuStat.vbvCost = 0; cuStat.intraVbvCost = 0; @@ -1748,8 +1748,8 @@ if (rowInSlice == rowCount) { m_rowSliceTotalBits[sliceId] = 0; - if (bIsVbv) - { + if (bIsVbv && !(m_param->rc.bEnableConstVbv && m_param->bEnableWavefront)) + { for (uint32_t i = m_sliceBaseRow[sliceId]; i < rowCount + m_sliceBaseRow[sliceId]; i++) m_rowSliceTotalBits[sliceId] += curEncData.m_rowStat[i].encodedBits; }
View file
x265_2.6.tar.gz/source/encoder/framefilter.cpp -> x265_2.7.tar.gz/source/encoder/framefilter.cpp
Changed
@@ -795,7 +795,7 @@ void FrameFilter::computeMEIntegral(int row) { int lastRow = row == (int)m_frame->m_encData->m_slice->m_sps->numCuInHeight - 1; - if (m_frame->m_encData->m_meIntegral && m_frame->m_lowres.sliceType != X265_TYPE_B) + if (m_frame->m_lowres.sliceType != X265_TYPE_B) { /* If WPP, other than first row, integral calculation for current row needs to wait till the * integral for the previous row is computed */
View file
x265_2.6.tar.gz/source/encoder/ratecontrol.cpp -> x265_2.7.tar.gz/source/encoder/ratecontrol.cpp
Changed
@@ -219,6 +219,7 @@ m_param->rc.vbvMaxBitrate = x265_clip3(0, 2000000, m_param->rc.vbvMaxBitrate); m_param->rc.vbvBufferInit = x265_clip3(0.0, 2000000.0, m_param->rc.vbvBufferInit); m_param->vbvBufferEnd = x265_clip3(0.0, 2000000.0, m_param->vbvBufferEnd); + m_initVbv = false; m_singleFrameVbv = 0; m_rateTolerance = 1.0; @@ -319,7 +320,7 @@ bool RateControl::init(const SPS& sps) { - if (m_isVbv) + if (m_isVbv && !m_initVbv) { /* We don't support changing the ABR bitrate right now, * so if the stream starts as CBR, keep it CBR. */ @@ -353,6 +354,7 @@ m_bufferFillFinal = m_bufferSize * m_param->rc.vbvBufferInit; m_bufferFillActual = m_bufferFillFinal; m_bufferExcess = 0; + m_initVbv = true; } m_totalBits = 0;
View file
x265_2.6.tar.gz/source/encoder/ratecontrol.h -> x265_2.7.tar.gz/source/encoder/ratecontrol.h
Changed
@@ -132,6 +132,7 @@ bool m_isGrainEnabled; bool m_isAbrReset; bool m_isNextGop; + bool m_initVbv; int m_lastAbrResetPoc; double m_rateTolerance;
View file
x265_2.6.tar.gz/source/encoder/sao.h -> x265_2.7.tar.gz/source/encoder/sao.h
Changed
@@ -55,12 +55,9 @@ enum { NUM_EDGETYPE = 5 }; enum { NUM_PLANE = 3 }; enum { SAO_DEPTHRATE_SIZE = 4 }; - static const uint32_t s_eoTable[NUM_EDGETYPE]; - - typedef int32_t (PerClass[MAX_NUM_SAO_TYPE][MAX_NUM_SAO_CLASS]); - typedef int32_t (PerPlane[NUM_PLANE][MAX_NUM_SAO_TYPE][MAX_NUM_SAO_CLASS]); - + typedef int32_t PerClass[MAX_NUM_SAO_TYPE][MAX_NUM_SAO_CLASS]; + typedef int32_t PerPlane[NUM_PLANE][MAX_NUM_SAO_TYPE][MAX_NUM_SAO_CLASS]; protected: /* allocated per part */
View file
x265_2.6.tar.gz/source/encoder/search.cpp -> x265_2.7.tar.gz/source/encoder/search.cpp
Changed
@@ -1947,7 +1947,7 @@ /* poc difference is out of range for lookahead */ return 0; - MV* mvs = m_frame->m_lowres.lowresMvs[list][diffPoc - 1]; + MV* mvs = m_frame->m_lowres.lowresMvs[list][diffPoc]; if (mvs[0].x == 0x7FFF) /* this motion search was not estimated by lookahead */ return 0; @@ -2073,7 +2073,7 @@ int mvpIdx = selectMVP(interMode.cu, pu, amvp, list, ref); MV mvmin, mvmax, outmv, mvp = amvp[mvpIdx]; - if (!m_param->analysisReuseMode) /* Prevents load/save outputs from diverging if lowresMV is not available */ + if (!m_param->analysisSave && !m_param->analysisLoad) /* Prevents load/save outputs from diverging if lowresMV is not available */ { MV lmv = getLowresMV(interMode.cu, pu, list, ref); if (lmv.notZero()) @@ -2161,7 +2161,7 @@ cu.getNeighbourMV(puIdx, pu.puAbsPartIdx, interMode.interNeighbours); /* Uni-directional prediction */ - if ((m_param->analysisReuseMode == X265_ANALYSIS_LOAD && m_param->analysisReuseLevel > 1 && m_param->analysisReuseLevel != 10) + if ((m_param->analysisLoad && m_param->analysisReuseLevel > 1 && m_param->analysisReuseLevel != 10) || (m_param->analysisMultiPassRefine && m_param->rc.bStatRead) || (m_param->bMVType == AVC_INFO)) { for (int list = 0; list < numPredDir; list++) @@ -2297,7 +2297,7 @@ int mvpIdx = selectMVP(cu, pu, amvp, list, ref); MV mvmin, mvmax, outmv, mvp = amvp[mvpIdx]; - if (!m_param->analysisReuseMode) /* Prevents load/save outputs from diverging when lowresMV is not available */ + if (!m_param->analysisSave && !m_param->analysisLoad) /* Prevents load/save outputs from diverging when lowresMV is not available */ { MV lmv = getLowresMV(cu, pu, list, ref); if (lmv.notZero())
View file
x265_2.6.tar.gz/source/encoder/slicetype.cpp -> x265_2.7.tar.gz/source/encoder/slicetype.cpp
Changed
@@ -154,7 +154,7 @@ int blockXY = 0; int blockX = 0, blockY = 0; double strength = 0.f; - if (param->rc.aqMode == X265_AQ_NONE || param->rc.aqStrength == 0) + if ((param->rc.aqMode == X265_AQ_NONE || param->rc.aqStrength == 0) || (param->rc.bStatRead && param->rc.cuTree && IS_REFERENCED(curFrame))) { /* Need to init it anyways for CU tree */ int cuCount = blockCount; @@ -589,7 +589,7 @@ m_outputSignalRequired = false; m_isActive = true; m_inputCount = 0; - + m_extendGopBoundary = false; m_8x8Height = ((m_param->sourceHeight / 2) + X265_LOWRES_CU_SIZE - 1) >> X265_LOWRES_CU_BITS; m_8x8Width = ((m_param->sourceWidth / 2) + X265_LOWRES_CU_SIZE - 1) >> X265_LOWRES_CU_BITS; m_cuCount = m_8x8Width * m_8x8Height; @@ -646,7 +646,11 @@ m_numRowsPerSlice = m_8x8Height; m_numCoopSlices = 1; } - + if (param->gopLookahead && (param->gopLookahead > (param->lookaheadDepth - param->bframes - 2))) + { + param->gopLookahead = X265_MAX(0, param->lookaheadDepth - param->bframes - 2); + x265_log(param, X265_LOG_WARNING, "Gop-lookahead cannot be greater than (rc-lookahead - length of the mini-gop); Clipping gop-lookahead to %d\n", param->gopLookahead); + } #if DETAILED_CU_STATS m_slicetypeDecideElapsedTime = 0; m_preLookaheadElapsedTime = 0; @@ -742,7 +746,7 @@ /* Called by API thread */ void Lookahead::addPicture(Frame& curFrame, int sliceType) { - if (m_param->analysisReuseMode == X265_ANALYSIS_LOAD && m_param->bDisableLookahead) + if (m_param->analysisLoad && m_param->bDisableLookahead) { if (!m_filled) m_filled = true; @@ -843,7 +847,7 @@ return out; } - if (m_param->analysisReuseMode == X265_ANALYSIS_LOAD && m_param->bDisableLookahead) + if (m_param->analysisLoad && m_param->bDisableLookahead) return NULL; findJob(-1); /* run slicetypeDecide() if necessary */ @@ -875,7 +879,7 @@ Slice *slice = curFrame->m_encData->m_slice; int p0 = 0, p1, b; int poc = slice->m_poc; - int l0poc = slice->m_refPOCList[0][0]; + int l0poc = slice->m_rps.numberOfNegativePictures ? slice->m_refPOCList[0][0] : -1; int l1poc = slice->m_refPOCList[1][0]; switch (slice->m_sliceType) @@ -892,23 +896,34 @@ break; case B_SLICE: - b = poc - l0poc; - p1 = b + l1poc - poc; - frames[p0] = &slice->m_refFrameList[0][0]->m_lowres; - frames[b] = &curFrame->m_lowres; - frames[p1] = &slice->m_refFrameList[1][0]->m_lowres; + if (l0poc >= 0) + { + b = poc - l0poc; + p1 = b + l1poc - poc; + frames[p0] = &slice->m_refFrameList[0][0]->m_lowres; + frames[b] = &curFrame->m_lowres; + frames[p1] = &slice->m_refFrameList[1][0]->m_lowres; + } + else + { + p0 = b = 0; + p1 = b + l1poc - poc; + frames[p0] = frames[b] = &curFrame->m_lowres; + frames[p1] = &slice->m_refFrameList[1][0]->m_lowres; + } + break; default: return; } - if (m_param->analysisReuseMode != X265_ANALYSIS_LOAD || !m_param->bDisableLookahead) + if (!m_param->analysisLoad || !m_param->bDisableLookahead) { X265_CHECK(curFrame->m_lowres.costEst[b - p0][p1 - b] > 0, "Slice cost not estimated\n") if (m_param->rc.cuTree && !m_param->rc.bStatRead) /* update row satds based on cutree offsets */ curFrame->m_lowres.satdCost = frameCostRecalculate(frames, p0, p1, b); - else if (m_param->analysisReuseMode != X265_ANALYSIS_LOAD || m_param->scaleFactor) + else if (!m_param->analysisLoad || m_param->scaleFactor) { if (m_param->rc.aqMode) curFrame->m_lowres.satdCost = curFrame->m_lowres.costEstAq[b - p0][p1 - b]; @@ -982,11 +997,8 @@ ProfileLookaheadTime(m_lookahead.m_preLookaheadElapsedTime, m_lookahead.m_countPreLookahead); ProfileScopeEvent(prelookahead); m_lock.release(); - preFrame->m_lowres.init(preFrame->m_fencPic, preFrame->m_poc); - if (m_lookahead.m_param->rc.bStatRead && m_lookahead.m_param->rc.cuTree && IS_REFERENCED(preFrame)) - /* cu-tree offsets were read from stats file */; - else if (m_lookahead.m_bAdaptiveQuant) + if (m_lookahead.m_bAdaptiveQuant) tld.calcAdaptiveQuantFrame(preFrame, m_lookahead.m_param); tld.lowresIntraEstimate(preFrame->m_lowres, m_lookahead.m_param->rc.qgSize); preFrame->m_lowresInit = true; @@ -1052,7 +1064,7 @@ { slicetypeAnalyse(frames, false); bool bIsVbv = m_param->rc.vbvBufferSize > 0 && m_param->rc.vbvMaxBitrate > 0; - if (m_param->analysisReuseMode == X265_ANALYSIS_LOAD && m_param->scaleFactor && bIsVbv) + if (m_param->analysisLoad && m_param->scaleFactor && bIsVbv) { int numFrames; for (numFrames = 0; numFrames < maxSearch; numFrames++) @@ -1086,7 +1098,8 @@ x265_log(m_param, X265_LOG_WARNING, "B-ref at frame %d incompatible with B-pyramid and %d reference frames\n", frm.sliceType, m_param->maxNumReferences); } - if ((!m_param->bIntraRefresh || frm.frameNum == 0) && frm.frameNum - m_lastKeyframe >= m_param->keyframeMax) + if ((!m_param->bIntraRefresh || frm.frameNum == 0) && frm.frameNum - m_lastKeyframe >= m_param->keyframeMax && + (!m_extendGopBoundary || frm.frameNum - m_lastKeyframe >= m_param->keyframeMax + m_param->gopLookahead)) { if (frm.sliceType == X265_TYPE_AUTO || frm.sliceType == X265_TYPE_I) frm.sliceType = m_param->bOpenGOP && m_lastKeyframe >= 0 ? X265_TYPE_I : X265_TYPE_IDR; @@ -1115,12 +1128,20 @@ /* Closed GOP */ m_lastKeyframe = frm.frameNum; frm.bKeyframe = true; - if (bframes > 0) + if (bframes > 0 && !m_param->radl) { list[bframes - 1]->m_lowres.sliceType = X265_TYPE_P; bframes--; } } + if (m_param->radl && !m_param->bOpenGOP && list[bframes + 1]) + { + if ((frm.frameNum - m_lastKeyframe) > (m_param->keyframeMax - m_param->radl - 1) && (frm.frameNum - m_lastKeyframe) < m_param->keyframeMax) + frm.sliceType = X265_TYPE_B; + if ((frm.frameNum - m_lastKeyframe) == (m_param->keyframeMax - m_param->radl - 1)) + frm.sliceType = X265_TYPE_P; + } + if (bframes == m_param->bframes || !list[bframes + 1]) { if (IS_X265_TYPE_B(frm.sliceType)) @@ -1170,8 +1191,13 @@ if (bframes) { p0 = 0; // last nonb + bool isp0available = frames[bframes + 1]->sliceType == X265_TYPE_IDR ? false : true; + for (b = 1; b <= bframes; b++) { + if (!isp0available) + p0 = b; + if (frames[b]->sliceType == X265_TYPE_B) for (p1 = b; frames[p1]->sliceType == X265_TYPE_B; p1++) ; // find new nonb or bref @@ -1181,7 +1207,10 @@ estGroup.singleCost(p0, p1, b); if (frames[b]->sliceType == X265_TYPE_BREF) + { p0 = b; + isp0available = true; + } } } } @@ -1205,9 +1234,8 @@ int idx = 0; list[bframes]->m_reorderedPts = pts[idx++]; m_outputQueue.pushBack(*list[bframes]); - /* Add B-ref frame next to P frame in output queue, the B-ref encode before non B-ref frame */ - if (bframes > 1 && m_param->bBPyramid) + if (brefs) { for (int i = 0; i < bframes; i++) { @@ -1247,7 +1275,7 @@ frames[j + 1] = NULL; slicetypeAnalyse(frames, true); bool bIsVbv = m_param->rc.vbvBufferSize > 0 && m_param->rc.vbvMaxBitrate > 0; - if (m_param->analysisReuseMode == X265_ANALYSIS_LOAD && m_param->scaleFactor && bIsVbv) + if (m_param->analysisLoad && m_param->scaleFactor && bIsVbv) { int numFrames; for (numFrames = 0; numFrames < maxSearch; numFrames++) @@ -1377,12 +1405,14 @@
View file
x265_2.6.tar.gz/source/encoder/slicetype.h -> x265_2.7.tar.gz/source/encoder/slicetype.h
Changed
@@ -132,6 +132,7 @@ bool m_filled; bool m_isSceneTransition; int m_numPools; + bool m_extendGopBoundary; Lookahead(x265_param *param, ThreadPool *pool); #if DETAILED_CU_STATS int64_t m_slicetypeDecideElapsedTime;
View file
x265_2.6.tar.gz/source/encoder/weightPrediction.cpp -> x265_2.7.tar.gz/source/encoder/weightPrediction.cpp
Changed
@@ -323,7 +323,7 @@ if (!plane && diffPoc <= param.bframes + 1) { - mvs = fenc.lowresMvs[list][diffPoc - 1]; + mvs = fenc.lowresMvs[list][diffPoc]; /* test whether this motion search was performed by lookahead */ if (mvs[0].x != 0x7FFF)
View file
x265_2.6.tar.gz/source/input/y4m.cpp -> x265_2.7.tar.gz/source/input/y4m.cpp
Changed
@@ -20,7 +20,8 @@ * This program is also available under a commercial proprietary license. * For more information, contact us at license @ x265.com. *****************************************************************************/ - +#define _FILE_OFFSET_BITS 64 +#define _LARGEFILE_SOURCE #include "y4m.h" #include "common.h" @@ -38,9 +39,7 @@ using namespace X265_NS; using namespace std; - -static const char header[] = "FRAME"; - +static const char header[] = {'F','R','A','M','E'}; Y4MInput::Y4MInput(InputFileInfo& info) { for (int i = 0; i < QUEUE_SIZE; i++) @@ -60,15 +59,14 @@ ifs = NULL; if (!strcmp(info.filename, "-")) { - ifs = &cin; + ifs = stdin; #if _WIN32 setmode(fileno(stdin), O_BINARY); #endif } else - ifs = new ifstream(info.filename, ios::binary | ios::in); - - if (ifs && ifs->good() && parseHeader()) + ifs = x265_fopen(info.filename, "rb"); + if (ifs && !ferror(ifs) && parseHeader()) { int pixelbytes = depth > 8 ? 2 : 1; for (int i = 0; i < x265_cli_csps[colorSpace].planes; i++) @@ -91,8 +89,8 @@ } if (!threadActive) { - if (ifs && ifs != &cin) - delete ifs; + if (ifs && ifs != stdin) + fclose(ifs); ifs = NULL; return; } @@ -106,61 +104,34 @@ info.csp = colorSpace; info.depth = depth; info.frameCount = -1; - - size_t estFrameSize = framesize + strlen(header) + 1; /* assume basic FRAME\n headers */ - + size_t estFrameSize = framesize + sizeof(header) + 1; /* assume basic FRAME\n headers */ /* try to estimate frame count, if this is not stdin */ - if (ifs != &cin) + if (ifs != stdin) { - istream::pos_type cur = ifs->tellg(); - -#if defined(_MSC_VER) && _MSC_VER < 1700 - /* Older MSVC versions cannot handle 64bit file sizes properly, so go native */ - HANDLE hFile = CreateFileA(info.filename, GENERIC_READ, - FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL, NULL); - if (hFile != INVALID_HANDLE_VALUE) - { - LARGE_INTEGER size; - if (GetFileSizeEx(hFile, &size)) - info.frameCount = (int)((size.QuadPart - (int64_t)cur) / estFrameSize); - CloseHandle(hFile); - } -#else // if defined(_MSC_VER) && _MSC_VER < 1700 + int64_t cur = ftello(ifs); if (cur >= 0) { - ifs->seekg(0, ios::end); - istream::pos_type size = ifs->tellg(); - ifs->seekg(cur, ios::beg); + fseeko(ifs, 0, SEEK_END); + int64_t size = ftello(ifs); + fseeko(ifs, cur, SEEK_SET); if (size > 0) info.frameCount = (int)((size - cur) / estFrameSize); } -#endif // if defined(_MSC_VER) && _MSC_VER < 1700 } - if (info.skipFrames) { -#if X86_64 - if (ifs != &cin) - ifs->seekg((uint64_t)estFrameSize * info.skipFrames, ios::cur); + if (ifs != stdin) + fseeko(ifs, (int64_t)estFrameSize * info.skipFrames, SEEK_CUR); else for (int i = 0; i < info.skipFrames; i++) - { - ifs->read(buf[0], estFrameSize - framesize); - ifs->read(buf[0], framesize); - } -#else - for (int i = 0; i < info.skipFrames; i++) - ifs->ignore(estFrameSize); -#endif + if (fread(buf[0], estFrameSize - framesize, 1, ifs) + fread(buf[0], framesize, 1, ifs) != 2) + break; } } - Y4MInput::~Y4MInput() { - if (ifs && ifs != &cin) - delete ifs; - + if (ifs && ifs != stdin) + fclose(ifs); for (int i = 0; i < QUEUE_SIZE; i++) X265_FREE(buf[i]); } @@ -180,37 +151,31 @@ int csp = 0; int d = 0; - - while (ifs->good()) + int c; + while ((c = fgetc(ifs)) != EOF) { // Skip Y4MPEG string - int c = ifs->get(); - while (ifs->good() && (c != ' ') && (c != '\n')) - c = ifs->get(); - - while (c == ' ' && ifs->good()) + while ((c != EOF) && (c != ' ') && (c != '\n')) + c = fgetc(ifs); + while (c == ' ') { // read parameter identifier - switch (ifs->get()) + switch (fgetc(ifs)) { case 'W': width = 0; - while (ifs->good()) + while ((c = fgetc(ifs)) != EOF) { - c = ifs->get(); - if (c == ' ' || c == '\n') break; else width = width * 10 + (c - '0'); } break; - case 'H': height = 0; - while (ifs->good()) + while ((c = fgetc(ifs)) != EOF) { - c = ifs->get(); if (c == ' ' || c == '\n') break; else @@ -221,15 +186,13 @@ case 'F': rateNum = 0; rateDenom = 0; - while (ifs->good()) + while ((c = fgetc(ifs)) != EOF) { - c = ifs->get(); if (c == '.') { rateDenom = 1; - while (ifs->good()) + while ((c = fgetc(ifs)) != EOF) { - c = ifs->get(); if (c == ' ' || c == '\n') break; else @@ -242,9 +205,8 @@ } else if (c == ':') { - while (ifs->good()) + while ((c = fgetc(ifs)) != EOF) { - c = ifs->get(); if (c == ' ' || c == '\n') break; else
View file
x265_2.6.tar.gz/source/input/y4m.h -> x265_2.7.tar.gz/source/input/y4m.h
Changed
@@ -60,13 +60,9 @@ ThreadSafeInteger readCount; ThreadSafeInteger writeCount; - char* buf[QUEUE_SIZE]; - - std::istream *ifs; - + FILE *ifs; bool parseHeader(); - void threadMain(); bool populateFrameQueue(); @@ -76,15 +72,10 @@ Y4MInput(InputFileInfo& info); virtual ~Y4MInput(); - void release(); - - bool isEof() const { return ifs && ifs->eof(); } - - bool isFail() { return !(ifs && !ifs->fail() && threadActive); } - + bool isEof() const { return ifs && feof(ifs); } + bool isFail() { return !(ifs && !ferror(ifs) && threadActive); } void startReader(); - bool readPicture(x265_picture&); const char *getName() const { return "y4m"; }
View file
x265_2.6.tar.gz/source/input/yuv.cpp -> x265_2.7.tar.gz/source/input/yuv.cpp
Changed
@@ -20,7 +20,8 @@ * This program is also available under a commercial proprietary license. * For more information, contact us at license @ x265.com. *****************************************************************************/ - +#define _FILE_OFFSET_BITS 64 +#define _LARGEFILE_SOURCE #include "yuv.h" #include "common.h" @@ -65,23 +66,21 @@ x265_log(NULL, X265_LOG_ERROR, "yuv: width, height, and FPS must be specified\n"); return; } - if (!strcmp(info.filename, "-")) { - ifs = &cin; + ifs = stdin; #if _WIN32 setmode(fileno(stdin), O_BINARY); #endif } else - ifs = new ifstream(info.filename, ios::binary | ios::in); - - if (ifs && ifs->good()) + ifs = x265_fopen(info.filename, "rb"); + if (ifs && !ferror(ifs)) threadActive = true; else { - if (ifs && ifs != &cin) - delete ifs; + if (ifs && ifs != stdin) + fclose(ifs); ifs = NULL; return; } @@ -98,55 +97,33 @@ } info.frameCount = -1; - /* try to estimate frame count, if this is not stdin */ - if (ifs != &cin) + if (ifs != stdin) { - istream::pos_type cur = ifs->tellg(); - -#if defined(_MSC_VER) && _MSC_VER < 1700 - /* Older MSVC versions cannot handle 64bit file sizes properly, so go native */ - HANDLE hFile = CreateFileA(info.filename, GENERIC_READ, - FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL, NULL); - if (hFile != INVALID_HANDLE_VALUE) - { - LARGE_INTEGER size; - if (GetFileSizeEx(hFile, &size)) - info.frameCount = (int)((size.QuadPart - (int64_t)cur) / framesize); - CloseHandle(hFile); - } -#else // if defined(_MSC_VER) && _MSC_VER < 1700 + int64_t cur = ftello(ifs); if (cur >= 0) { - ifs->seekg(0, ios::end); - istream::pos_type size = ifs->tellg(); - ifs->seekg(cur, ios::beg); + fseeko(ifs, 0, SEEK_END); + int64_t size = ftello(ifs); + fseeko(ifs, cur, SEEK_SET); if (size > 0) info.frameCount = (int)((size - cur) / framesize); } -#endif // if defined(_MSC_VER) && _MSC_VER < 1700 } - if (info.skipFrames) { -#if X86_64 - if (ifs != &cin) - ifs->seekg((uint64_t)framesize * info.skipFrames, ios::cur); + if (ifs != stdin) + fseeko(ifs, (int64_t)framesize * info.skipFrames, SEEK_CUR); else for (int i = 0; i < info.skipFrames; i++) - ifs->read(buf[0], framesize); -#else - for (int i = 0; i < info.skipFrames; i++) - ifs->ignore(framesize); -#endif + if (fread(buf[0], framesize, 1, ifs) != 1) + break; } } - YUVInput::~YUVInput() { - if (ifs && ifs != &cin) - delete ifs; + if (ifs && ifs != stdin) + fclose(ifs); for (int i = 0; i < QUEUE_SIZE; i++) X265_FREE(buf[i]); } @@ -179,12 +156,10 @@ threadActive = false; writeCount.poke(); } - bool YUVInput::populateFrameQueue() { - if (!ifs || ifs->fail()) + if (!ifs || ferror(ifs)) return false; - /* wait for room in the ring buffer */ int written = writeCount.get(); int read = readCount.get(); @@ -195,10 +170,8 @@ // release() has been called return false; } - ProfileScopeEvent(frameRead); - ifs->read(buf[written % QUEUE_SIZE], framesize); - if (ifs->good()) + if (fread(buf[written % QUEUE_SIZE], framesize, 1, ifs) == 1) { writeCount.incr(); return true;
View file
x265_2.6.tar.gz/source/input/yuv.h -> x265_2.7.tar.gz/source/input/yuv.h
Changed
@@ -52,13 +52,9 @@ ThreadSafeInteger readCount; ThreadSafeInteger writeCount; - char* buf[QUEUE_SIZE]; - - std::istream *ifs; - + FILE *ifs; int guessFrameCount(); - void threadMain(); bool populateFrameQueue(); @@ -68,13 +64,9 @@ YUVInput(InputFileInfo& info); virtual ~YUVInput(); - void release(); - - bool isEof() const { return ifs && ifs->eof(); } - - bool isFail() { return !(ifs && !ifs->fail() && threadActive); } - + bool isEof() const { return ifs && feof(ifs); } + bool isFail() { return !(ifs && !ferror(ifs) && threadActive); } void startReader(); bool readPicture(x265_picture&);
View file
x265_2.6.tar.gz/source/output/raw.cpp -> x265_2.7.tar.gz/source/output/raw.cpp
Changed
@@ -21,18 +21,26 @@ * This program is also available under a commercial proprietary license. * For more information, contact us at license @ x265.com. *****************************************************************************/ - #include "raw.h" +#if _WIN32 +#include <io.h> +#include <fcntl.h> +#if defined(_MSC_VER) +#pragma warning(disable: 4996) // POSIX setmode and fileno deprecated +#endif +#endif using namespace X265_NS; using namespace std; - RAWOutput::RAWOutput(const char* fname, InputFileInfo&) { b_fail = false; if (!strcmp(fname, "-")) { ofs = stdout; +#if _WIN32 + setmode(fileno(stdout), O_BINARY); +#endif return; } ofs = x265_fopen(fname, "wb");
View file
x265_2.6.tar.gz/source/test/CMakeLists.txt -> x265_2.7.tar.gz/source/test/CMakeLists.txt
Changed
@@ -7,37 +7,37 @@ # add X86 assembly files if(X86) -enable_language(ASM_YASM) +enable_language(ASM_NASM) if(MSVC_IDE) - set(YASM_SRC checkasm-a.obj) + set(NASM_SRC checkasm-a.obj) add_custom_command( OUTPUT checkasm-a.obj - COMMAND ${YASM_EXECUTABLE} - ARGS ${YASM_FLAGS} ${CMAKE_CURRENT_SOURCE_DIR}/checkasm-a.asm -o checkasm-a.obj + COMMAND ${NASM_EXECUTABLE} + ARGS ${NASM_FLAGS} ${CMAKE_CURRENT_SOURCE_DIR}/checkasm-a.asm -o checkasm-a.obj DEPENDS checkasm-a.asm) else() - set(YASM_SRC checkasm-a.asm) + set(NASM_SRC checkasm-a.asm) endif() endif(X86) # add ARM assembly files if(ARM OR CROSS_COMPILE_ARM) enable_language(ASM) - set(YASM_SRC checkasm-arm.S) + set(NASM_SRC checkasm-arm.S) add_custom_command( OUTPUT checkasm-arm.obj COMMAND ${CMAKE_CXX_COMPILER} - ARGS ${YASM_FLAGS} ${CMAKE_CURRENT_SOURCE_DIR}/checkasm-arm.S -o checkasm-arm.obj + ARGS ${NASM_FLAGS} ${CMAKE_CURRENT_SOURCE_DIR}/checkasm-arm.S -o checkasm-arm.obj DEPENDS checkasm-arm.S) endif(ARM OR CROSS_COMPILE_ARM) # add PowerPC assembly files if(POWER) - set(YASM_SRC) + set(NASM_SRC) endif(POWER) -add_executable(TestBench ${YASM_SRC} +add_executable(TestBench ${NASM_SRC} testbench.cpp testharness.h pixelharness.cpp pixelharness.h mbdstharness.cpp mbdstharness.h
View file
x265_2.6.tar.gz/source/test/checkasm-a.asm -> x265_2.7.tar.gz/source/test/checkasm-a.asm
Changed
@@ -26,7 +26,7 @@ ;* For more information, contact us at license @ x265.com. ;***************************************************************************** -%include "../common/x86/x86inc.asm" +%include "x86inc.asm" SECTION_RODATA @@ -35,24 +35,24 @@ %if ARCH_X86_64 ; just random numbers to reduce the chance of incidental match ALIGN 16 -x6: ddq 0x79445c159ce790641a1b2550a612b48c -x7: ddq 0x86b2536fcd8cf6362eed899d5a28ddcd -x8: ddq 0x3f2bf84fc0fcca4eb0856806085e7943 -x9: ddq 0xd229e1f5b281303facbd382dcf5b8de2 -x10: ddq 0xab63e2e11fa38ed971aeaff20b095fd9 -x11: ddq 0x77d410d5c42c882d89b0c0765892729a -x12: ddq 0x24b3c1d2a024048bc45ea11a955d8dd5 -x13: ddq 0xdd7b8919edd427862e8ec680de14b47c -x14: ddq 0x11e53e2b2ac655ef135ce6888fa02cbf -x15: ddq 0x6de8f4c914c334d5011ff554472a7a10 -n7: dq 0x21f86d66c8ca00ce -n8: dq 0x75b6ba21077c48ad -n9: dq 0xed56bb2dcb3c7736 -n10: dq 0x8bda43d3fd1a7e06 -n11: dq 0xb64a9c9e5d318408 -n12: dq 0xdf9a54b303f1d3a3 -n13: dq 0x4a75479abd64e097 -n14: dq 0x249214109d5d1c88 +x6: dq 0x1a1b2550a612b48c,0x79445c159ce79064 +x7: dq 0x2eed899d5a28ddcd,0x86b2536fcd8cf636 +x8: dq 0xb0856806085e7943,0x3f2bf84fc0fcca4e +x9: dq 0xacbd382dcf5b8de2,0xd229e1f5b281303f +x10: dq 0x71aeaff20b095fd9,0xab63e2e11fa38ed9 +x11: dq 0x89b0c0765892729a,0x77d410d5c42c882d +x12: dq 0xc45ea11a955d8dd5,0x24b3c1d2a024048b +x13: dq 0x2e8ec680de14b47c,0xdd7b8919edd42786 +x14: dq 0x135ce6888fa02cbf,0x11e53e2b2ac655ef +x15: dq 0x011ff554472a7a10,0x6de8f4c914c334d5 +n7: dq 0x21f86d66c8ca00ce +n8: dq 0x75b6ba21077c48ad +n9: dq 0xed56bb2dcb3c7736 +n10: dq 0x8bda43d3fd1a7e06 +n11: dq 0xb64a9c9e5d318408 +n12: dq 0xdf9a54b303f1d3a3 +n13: dq 0x4a75479abd64e097 +n14: dq 0x249214109d5d1c88 %endif SECTION .text @@ -70,14 +70,14 @@ ;----------------------------------------------------------------------------- cglobal checkasm_stack_clobber, 1,2 ; Clobber the stack with junk below the stack pointer - %define size (max_args+6)*8 - SUB rsp, size - mov r1, size-8 + %define argsize (max_args+6)*8 + SUB rsp, argsize + mov r1, argsize-8 .loop: mov [rsp+r1], r0 sub r1, 8 jge .loop - ADD rsp, size + ADD rsp, argsize RET %if WIN64 @@ -156,7 +156,11 @@ mov r9, rax mov r10, rdx lea r0, [error_message] +%if FORMAT_ELF + call puts wrt ..plt +%else call puts +%endif mov r1, [rsp+max_args*8] mov dword [r1], 0 mov rdx, r10
View file
x265_2.6.tar.gz/source/test/regression-tests.txt -> x265_2.7.tar.gz/source/test/regression-tests.txt
Changed
@@ -18,17 +18,17 @@ BasketballDrive_1920x1080_50.y4m,--preset faster --aq-strength 2 --merange 190 --slices 3 BasketballDrive_1920x1080_50.y4m,--preset medium --ctu 16 --max-tu-size 8 --subme 7 --qg-size 16 --cu-lossless --tu-inter-depth 3 --limit-tu 1 BasketballDrive_1920x1080_50.y4m,--preset medium --keyint -1 --nr-inter 100 -F4 --no-sao -BasketballDrive_1920x1080_50.y4m,--preset medium --no-cutree --analysis-reuse-mode=save --analysis-reuse-level 2 --bitrate 7000 --limit-modes::--preset medium --no-cutree --analysis-reuse-mode=load --analysis-reuse-level 2 --bitrate 7000 --limit-modes +BasketballDrive_1920x1080_50.y4m,--preset medium --no-cutree --analysis-save x265_analysis.dat --analysis-reuse-level 2 --bitrate 7000 --limit-modes::--preset medium --no-cutree --analysis-load x265_analysis.dat --analysis-reuse-level 2 --bitrate 7000 --limit-modes BasketballDrive_1920x1080_50.y4m,--preset slow --nr-intra 100 -F4 --aq-strength 3 --qg-size 16 --limit-refs 1 BasketballDrive_1920x1080_50.y4m,--preset slower --lossless --chromaloc 3 --subme 0 --limit-tu 4 -BasketballDrive_1920x1080_50.y4m,--preset slower --no-cutree --analysis-reuse-mode=save --analysis-reuse-level 10 --bitrate 7000 --limit-tu 0::--preset slower --no-cutree --analysis-reuse-mode=load --analysis-reuse-level 10 --bitrate 7000 --limit-tu 0 +BasketballDrive_1920x1080_50.y4m,--preset slower --no-cutree --analysis-save x265_analysis.dat --analysis-reuse-level 10 --bitrate 7000 --limit-tu 0::--preset slower --no-cutree --analysis-load x265_analysis.dat --analysis-reuse-level 10 --bitrate 7000 --limit-tu 0 BasketballDrive_1920x1080_50.y4m,--preset veryslow --crf 4 --cu-lossless --pmode --limit-refs 1 --aq-mode 3 --limit-tu 3 -BasketballDrive_1920x1080_50.y4m,--preset veryslow --no-cutree --analysis-reuse-mode=save --bitrate 7000 --tskip-fast --limit-tu 4::--preset veryslow --no-cutree --analysis-reuse-mode=load --bitrate 7000 --tskip-fast --limit-tu 4 +BasketballDrive_1920x1080_50.y4m,--preset veryslow --no-cutree --analysis-save x265_analysis.dat --bitrate 7000 --tskip-fast --limit-tu 2::--preset veryslow --no-cutree --analysis-load x265_analysis.dat --bitrate 7000 --tskip-fast --limit-tu 2 BasketballDrive_1920x1080_50.y4m,--preset veryslow --recon-y4m-exec "ffplay -i pipe:0 -autoexit" Coastguard-4k.y4m,--preset ultrafast --recon-y4m-exec "ffplay -i pipe:0 -autoexit" Coastguard-4k.y4m,--preset superfast --tune grain --overscan=crop Coastguard-4k.y4m,--preset superfast --tune grain --pme --aq-strength 2 --merange 190 -Coastguard-4k.y4m,--preset veryfast --no-cutree --analysis-reuse-mode=save --analysis-reuse-level 1 --bitrate 15000::--preset veryfast --no-cutree --analysis-reuse-mode=load --analysis-reuse-level 1 --bitrate 15000 +Coastguard-4k.y4m,--preset veryfast --no-cutree --analysis-save x265_analysis.dat --analysis-reuse-level 1 --bitrate 15000::--preset veryfast --no-cutree --analysis-load x265_analysis.dat --analysis-reuse-level 1 --bitrate 15000 Coastguard-4k.y4m,--preset medium --rdoq-level 1 --tune ssim --no-signhide --me umh --slices 2 Coastguard-4k.y4m,--preset slow --tune psnr --cbqpoffs -1 --crqpoffs 1 --limit-refs 1 CrowdRun_1920x1080_50_10bit_422.yuv,--preset ultrafast --weightp --tune zerolatency --qg-size 16 @@ -52,7 +52,7 @@ DucksAndLegs_1920x1080_60_10bit_444.yuv,--preset veryfast --weightp --nr-intra 1000 -F4 DucksAndLegs_1920x1080_60_10bit_444.yuv,--preset medium --nr-inter 500 -F4 --no-psy-rdoq DucksAndLegs_1920x1080_60_10bit_444.yuv,--preset slower --no-weightp --rdoq-level 0 --limit-refs 3 --tu-inter-depth 4 --limit-tu 3 -DucksAndLegs_1920x1080_60_10bit_422.yuv,--preset fast --no-cutree --analysis-reuse-mode=save --bitrate 3000 --early-skip --tu-inter-depth 3 --limit-tu 1::--preset fast --no-cutree --analysis-reuse-mode=load --bitrate 3000 --early-skip --tu-inter-depth 3 --limit-tu 1 +DucksAndLegs_1920x1080_60_10bit_422.yuv,--preset fast --no-cutree --analysis-save x265_analysis.dat --bitrate 3000 --early-skip --tu-inter-depth 3 --limit-tu 1::--preset fast --no-cutree --analysis-load x265_analysis.dat --bitrate 3000 --early-skip --tu-inter-depth 3 --limit-tu 1 FourPeople_1280x720_60.y4m,--preset superfast --no-wpp --lookahead-slices 2 FourPeople_1280x720_60.y4m,--preset veryfast --aq-mode 2 --aq-strength 1.5 --qg-size 8 FourPeople_1280x720_60.y4m,--preset medium --qp 38 --no-psy-rd @@ -69,8 +69,8 @@ KristenAndSara_1280x720_60.y4m,--preset slower --pmode --max-tu-size 8 --limit-refs 0 --limit-modes --limit-tu 1 NebutaFestival_2560x1600_60_10bit_crop.yuv,--preset superfast --tune psnr NebutaFestival_2560x1600_60_10bit_crop.yuv,--preset medium --tune grain --limit-refs 2 -NebutaFestival_2560x1600_60_10bit_crop.yuv,--preset slow --no-cutree --analysis-reuse-mode=save --rd 5 --analysis-reuse-level 10 --bitrate 9000::--preset slow --no-cutree --analysis-reuse-mode=load --rd 5 --analysis-reuse-level 10 --bitrate 9000 -News-4k.y4m,--preset ultrafast --no-cutree --analysis-reuse-mode=save --analysis-reuse-level 2 --bitrate 15000::--preset ultrafast --no-cutree --analysis-reuse-mode=load --analysis-reuse-level 2 --bitrate 15000 +NebutaFestival_2560x1600_60_10bit_crop.yuv,--preset slow --no-cutree --analysis-save x265_analysis.dat --rd 5 --analysis-reuse-level 10 --bitrate 9000::--preset slow --no-cutree --analysis-load x265_analysis.dat --rd 5 --analysis-reuse-level 10 --bitrate 9000 +News-4k.y4m,--preset ultrafast --no-cutree --analysis-save x265_analysis.dat --analysis-reuse-level 2 --bitrate 15000::--preset ultrafast --no-cutree --analysis-load x265_analysis.dat --analysis-reuse-level 2 --bitrate 15000 News-4k.y4m,--preset superfast --lookahead-slices 6 --aq-mode 0 News-4k.y4m,--preset superfast --slices 4 --aq-mode 0 News-4k.y4m,--preset medium --tune ssim --no-sao --qg-size 16 @@ -125,7 +125,7 @@ old_town_cross_444_720p50.y4m,--preset superfast --weightp --min-cu 16 --limit-modes old_town_cross_444_720p50.y4m,--preset veryfast --qp 1 --tune ssim old_town_cross_444_720p50.y4m,--preset faster --rd 1 --tune zero-latency -old_town_cross_444_720p50.y4m,--preset fast --no-cutree --analysis-reuse-mode=save --analysis-reuse-level 1 --bitrate 3000 --early-skip::--preset fast --no-cutree --analysis-reuse-mode=load --analysis-reuse-level 1 --bitrate 3000 --early-skip +old_town_cross_444_720p50.y4m,--preset fast --no-cutree --analysis-save pass1_analysis.dat --analysis-reuse-level 1 --bitrate 3000 --early-skip::--preset fast --no-cutree --analysis-load pass1_analysis.dat --analysis-save pass2_analysis.dat --analysis-reuse-level 1 --bitrate 3000 --early-skip::--preset fast --no-cutree --analysis-load pass2_analysis.dat --analysis-reuse-level 1 --bitrate 3000 --early-skip old_town_cross_444_720p50.y4m,--preset medium --keyint -1 --no-weightp --ref 6 old_town_cross_444_720p50.y4m,--preset slow --rdoq-level 1 --early-skip --ref 7 --no-b-pyramid old_town_cross_444_720p50.y4m,--preset slower --crf 4 --cu-lossless @@ -150,6 +150,8 @@ Kimono1_1920x1080_24_400.yuv,--preset medium --rdoq-level 0 --limit-refs 3 --slices 2 Kimono1_1920x1080_24_400.yuv,--preset veryslow --crf 4 --cu-lossless --slices 2 --limit-refs 3 --limit-modes Kimono1_1920x1080_24_400.yuv,--preset placebo --ctu 32 --max-tu-size 8 --limit-tu 2 +big_buck_bunny_360p24.y4m, --keyint 60 --min-keyint 40 --gop-lookahead 14 +BasketballDrive_1920x1080_50.y4m, --preset medium --no-open-gop --keyint 50 --min-keyint 50 --radl 2 # Main12 intraCost overflow bug test 720p50_parkrun_ter.y4m,--preset medium
View file
x265_2.6.tar.gz/source/x265.cpp -> x265_2.7.tar.gz/source/x265.cpp
Changed
@@ -301,9 +301,15 @@ if (!this->qpfile) x265_log_file(param, X265_LOG_ERROR, "%s qpfile not found or error in opening qp file\n", optarg); } + OPT("fullhelp") + { + param->logLevel = X265_LOG_FULL; + printVersion(param, api); + showHelp(param); + break; + } else bError |= !!api->param_parse(param, long_options[long_options_index].name, optarg); - if (bError) { const char *name = long_options_index > 0 ? long_options[long_options_index].name : argv[optind - 2]; @@ -579,9 +585,9 @@ x265_picture pic_orig, pic_out; x265_picture *pic_in = &pic_orig; - /* Allocate recon picture if analysisReuseMode is enabled */ + /* Allocate recon picture if analysis save/load is enabled */ std::priority_queue<int64_t>* pts_queue = cliopt.output->needPTS() ? new std::priority_queue<int64_t>() : NULL; - x265_picture *pic_recon = (cliopt.recon || !!param->analysisReuseMode || pts_queue || reconPlay || param->csvLogLevel) ? &pic_out : NULL; + x265_picture *pic_recon = (cliopt.recon || param->analysisSave || param->analysisLoad || pts_queue || reconPlay || param->csvLogLevel) ? &pic_out : NULL; uint32_t inFrameCount = 0; uint32_t outFrameCount = 0; x265_nal *p_nal;
View file
x265_2.6.tar.gz/source/x265.h -> x265_2.7.tar.gz/source/x265.h
Changed
@@ -327,15 +327,15 @@ * to allow the encoder to determine base QP */ int forceqp; - /* If param.analysisReuseMode is X265_ANALYSIS_OFF this field is ignored on input - * and output. Else the user must call x265_alloc_analysis_data() to - * allocate analysis buffers for every picture passed to the encoder. + /* If param.analysisLoad and param.analysisSave are disabled, this field is + * ignored on input and output. Else the user must call x265_alloc_analysis_data() + * to allocate analysis buffers for every picture passed to the encoder. * - * On input when param.analysisReuseMode is X265_ANALYSIS_LOAD and analysisData + * On input when param.analysisLoad is enabled and analysisData * member pointers are valid, the encoder will use the data stored here to * reduce encoder work. * - * On output when param.analysisReuseMode is X265_ANALYSIS_SAVE and analysisData + * On output when param.analysisSave is enabled and analysisData * member pointers are valid, the encoder will write output analysis into * this data structure */ x265_analysis_data analysisData; @@ -481,9 +481,7 @@ #define X265_CSP_BGRA 7 /* packed bgr 32bits */ #define X265_CSP_RGB 8 /* packed rgb 24bits */ #define X265_CSP_MAX 9 /* end of list */ - #define X265_EXTENDED_SAR 255 /* aspect ratio explicitly specified as width:height */ - /* Analysis options */ #define X265_ANALYSIS_OFF 0 #define X265_ANALYSIS_SAVE 1 @@ -1129,13 +1127,13 @@ * Default disabled */ int bEnableRdRefine; - /* If X265_ANALYSIS_SAVE, write per-frame analysis information into analysis - * buffers. if X265_ANALYSIS_LOAD, read analysis information into analysis - * buffer and use this analysis information to reduce the amount of work - * the encoder must perform. Default X265_ANALYSIS_OFF */ + /* If save, write per-frame analysis information into analysis buffers. + * If load, read analysis information into analysis buffer and use this + * analysis information to reduce the amount of work the encoder must perform. + * Default disabled. Now deprecated*/ int analysisReuseMode; - /* Filename for analysisReuseMode save/load. Default name is "x265_analysis.dat" */ + /* Filename for multi-pass-opt-analysis/distortion. Default name is "x265_analysis.dat" */ const char* analysisReuseFileName; /*== Rate Control ==*/ @@ -1273,6 +1271,7 @@ /* internally enable if tune grain is set */ int bEnableConstVbv; + } rc; /*== Video Usability Information ==*/ @@ -1455,7 +1454,7 @@ int bHDROpt; /* A value between 1 and 10 (both inclusive) determines the level of - * information stored/reused in save/load analysis-reuse-mode. Higher the refine + * information stored/reused in analysis save/load. Higher the refine * level higher the information stored/reused. Default is 5 */ int analysisReuseLevel; @@ -1532,9 +1531,23 @@ /* Reuse MV information obtained through API */ int bMVType; - /* Allow the encoder to have a copy of the planes of x265_picture in Frame */ int bCopyPicToFrame; + + /*Number of frames for GOP boundary decision lookahead.If a scenecut frame is found + * within this from the gop boundary set by keyint, the GOP will be extented until such a point, + * otherwise the GOP will be terminated as set by keyint*/ + int gopLookahead; + + /*Write per-frame analysis information into analysis buffers. Default disabled. */ + const char* analysisSave; + + /* Read analysis information into analysis buffer and use this analysis information + * to reduce the amount of work the encoder must perform. Default disabled. */ + const char* analysisLoad; + + /*Number of RADL pictures allowed in front of IDR*/ + int radl; } x265_param; /* x265_param_alloc: @@ -1743,7 +1756,7 @@ /* x265_get_ref_frame_list: * returns negative on error, 0 when access unit were output. * This API must be called after(poc >= lookaheadDepth + bframes + 2) condition check */ -int x265_get_ref_frame_list(x265_encoder *encoder, x265_picyuv**, x265_picyuv**, int, int); +int x265_get_ref_frame_list(x265_encoder *encoder, x265_picyuv**, x265_picyuv**, int, int, int*, int*); /* x265_set_analysis_data: * set the analysis data. The incoming analysis_data structure is assumed to be AVC-sized blocks. @@ -1766,9 +1779,10 @@ void x265_csvlog_frame(const x265_param *, const x265_picture *); /* Log final encode statistics to the CSV file handle. 'argc' and 'argv' are - * intended to be command line arguments passed to the encoder. Encode + * intended to be command line arguments passed to the encoder. padx and pady are + * padding offsets for conformance and can be given from sps settings. Encode * statistics should be queried from the encoder just prior to closing it. */ -void x265_csvlog_encode(x265_encoder *encoder, const x265_stats *, int argc, char** argv); +void x265_csvlog_encode(const x265_param*, const x265_stats *, int padx, int pady, int argc, char** argv); /* In-place downshift from a bit-depth greater than 8 to a bit-depth of 8, using * the residual bits to dither each row. */ @@ -1820,10 +1834,10 @@ int (*encoder_intra_refresh)(x265_encoder*); int (*encoder_ctu_info)(x265_encoder*, int, x265_ctu_info_t**); int (*get_slicetype_poc_and_scenecut)(x265_encoder*, int*, int*, int*); - int (*get_ref_frame_list)(x265_encoder*, x265_picyuv**, x265_picyuv**, int, int); + int (*get_ref_frame_list)(x265_encoder*, x265_picyuv**, x265_picyuv**, int, int, int*, int*); FILE* (*csvlog_open)(const x265_param*); void (*csvlog_frame)(const x265_param*, const x265_picture*); - void (*csvlog_encode)(x265_encoder*, const x265_stats*, int, char**); + void (*csvlog_encode)(const x265_param*, const x265_stats *, int, int, int, char**); void (*dither_image)(x265_picture*, int, int, int16_t*, int); int (*set_analysis_data)(x265_encoder *encoder, x265_analysis_data *analysis_data, int poc, uint32_t cuBytes); /* add new pointers to the end, or increment X265_MAJOR_VERSION */
View file
x265_2.6.tar.gz/source/x265cli.h -> x265_2.7.tar.gz/source/x265cli.h
Changed
@@ -38,6 +38,7 @@ static const struct option long_options[] = { { "help", no_argument, NULL, 'h' }, + { "fullhelp", no_argument, NULL, 0 }, { "version", no_argument, NULL, 'V' }, { "asm", required_argument, NULL, 0 }, { "no-asm", no_argument, NULL, 0 }, @@ -119,9 +120,11 @@ { "open-gop", no_argument, NULL, 0 }, { "keyint", required_argument, NULL, 'I' }, { "min-keyint", required_argument, NULL, 'i' }, + { "gop-lookahead", required_argument, NULL, 0 }, { "scenecut", required_argument, NULL, 0 }, { "no-scenecut", no_argument, NULL, 0 }, { "scenecut-bias", required_argument, NULL, 0 }, + { "radl", required_argument, NULL, 0 }, { "ctu-info", required_argument, NULL, 0 }, { "intra-refresh", no_argument, NULL, 0 }, { "rc-lookahead", required_argument, NULL, 0 }, @@ -252,9 +255,11 @@ { "no-slow-firstpass", no_argument, NULL, 0 }, { "multi-pass-opt-rps", no_argument, NULL, 0 }, { "no-multi-pass-opt-rps", no_argument, NULL, 0 }, - { "analysis-reuse-mode", required_argument, NULL, 0 }, - { "analysis-reuse-file", required_argument, NULL, 0 }, + { "analysis-reuse-mode", required_argument, NULL, 0 }, /* DEPRECATED */ + { "analysis-reuse-file", required_argument, NULL, 0 }, { "analysis-reuse-level", required_argument, NULL, 0 }, + { "analysis-save", required_argument, NULL, 0 }, + { "analysis-load", required_argument, NULL, 0 }, { "scale-factor", required_argument, NULL, 0 }, { "refine-intra", required_argument, NULL, 0 }, { "refine-inter", required_argument, NULL, 0 }, @@ -314,6 +319,7 @@ H0(" outfile is raw HEVC bitstream\n"); H0("\nExecutable Options:\n"); H0("-h/--help Show this help text and exit\n"); + H0(" --fullhelp Show all options and exit\n"); H0("-V/--version Show version info and exit\n"); H0("\nOutput Options:\n"); H0("-o/--output <filename> Bitstream output file name\n"); @@ -418,9 +424,11 @@ H0(" --[no-]open-gop Enable open-GOP, allows I slices to be non-IDR. Default %s\n", OPT(param->bOpenGOP)); H0("-I/--keyint <integer> Max IDR period in frames. -1 for infinite-gop. Default %d\n", param->keyframeMax); H0("-i/--min-keyint <integer> Scenecuts closer together than this are coded as I, not IDR. Default: auto\n"); + H0(" --gop-lookahead <integer> Extends gop boundary if a scenecut is found within this from keyint boundary. Default 0\n"); H0(" --no-scenecut Disable adaptive I-frame decision\n"); H0(" --scenecut <integer> How aggressively to insert extra I-frames. Default %d\n", param->scenecutThreshold); H1(" --scenecut-bias <0..100.0> Bias for scenecut detection. Default %.2f\n", param->scenecutBias); + H0(" --radl <integer> Number of RADL pictures allowed in front of IDR. Default %d\n", param->radl); H0(" --intra-refresh Use Periodic Intra Refresh instead of IDR frames\n"); H0(" --rc-lookahead <integer> Number of frames for frame-type lookahead (determines encoder latency) Default %d\n", param->lookaheadDepth); H1(" --lookahead-slices <0..16> Number of slices to use per lookahead cost estimate. Default %d\n", param->lookaheadSlices); @@ -461,18 +469,19 @@ H0(" --[no-]analyze-src-pics Motion estimation uses source frame planes. Default disable\n"); H0(" --[no-]slow-firstpass Enable a slow first pass in a multipass rate control mode. Default %s\n", OPT(param->rc.bEnableSlowFirstPass)); H0(" --[no-]strict-cbr Enable stricter conditions and tolerance for bitrate deviations in CBR mode. Default %s\n", OPT(param->rc.bStrictCbr)); - H0(" --analysis-reuse-mode <string|int> save - Dump analysis info into file, load - Load analysis buffers from the file. Default %d\n", param->analysisReuseMode); + H0(" --analysis-save <filename> Dump analysis info into the specified file. Default Disabled\n"); + H0(" --analysis-load <filename> Load analysis buffers from the file specified. Default Disabled\n"); H0(" --analysis-reuse-file <filename> Specify file name used for either dumping or reading analysis data. Deault x265_analysis.dat\n"); H0(" --analysis-reuse-level <1..10> Level of analysis reuse indicates amount of info stored/reused in save/load mode, 1:least..10:most. Default %d\n", param->analysisReuseLevel); H0(" --refine-mv-type <string> Reuse MV information received through API call. Supported option is avc. Default disabled - %d\n", param->bMVType); H0(" --scale-factor <int> Specify factor by which input video is scaled down for analysis save mode. Default %d\n", param->scaleFactor); - H0(" --refine-intra <0..3> Enable intra refinement for encode that uses analysis-reuse-mode=load.\n" + H0(" --refine-intra <0..3> Enable intra refinement for encode that uses analysis-load.\n" " - 0 : Forces both mode and depth from the save encode.\n" " - 1 : Functionality of (0) + evaluate all intra modes at min-cu-size's depth when current depth is one smaller than min-cu-size's depth.\n" " - 2 : Functionality of (1) + irrespective of size evaluate all angular modes when the save encode decides the best mode as angular.\n" " - 3 : Functionality of (1) + irrespective of size evaluate all intra modes.\n" " Default:%d\n", param->intraRefine); - H0(" --refine-inter <0..3> Enable inter refinement for encode that uses analysis-reuse-mode=load.\n" + H0(" --refine-inter <0..3> Enable inter refinement for encode that uses analysis-load.\n" " - 0 : Forces both mode and depth from the save encode.\n" " - 1 : Functionality of (0) + evaluate all inter modes at min-cu-size's depth when current depth is one smaller than\n" " min-cu-size's depth. When save encode decides the current block as skip(for all sizes) evaluate skip/merge.\n" @@ -563,9 +572,8 @@ #undef OPT #undef H0 #undef H1 - if (level < X265_LOG_DEBUG) - printf("\nUse --log-level full --help for a full listing\n"); + printf("\nUse --fullhelp for a full listing (or --log-level full --help)\n"); printf("\n\nComplete documentation may be found at http://x265.readthedocs.org/en/default/cli.html\n"); exit(1); }
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.