Changes of Revision 26

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