Changes of Revision 27

x265.changes Changed
x
 
1
@@ -1,35 +1,4 @@
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  151
6
+%define soname  146
7
 %define libname lib%{name}
8
 %define libsoname %{libname}-%{soname}
9
-Version:        2.7
10
+Version:        2.6
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}_%{version}
19
+%setup -q -n %{name}_v%{version}
20
 %patch0 -p1
21
 %patch1 -p1
22
 
23
baselibs.conf Changed
4
 
1
@@ -1,1 +1,1 @@
2
-libx265-151
3
+libx265-130
4
x265_2.7.tar.gz/.hg_archival.txt -> x265_2.6.tar.gz/.hg_archival.txt Changed
8
 
1
@@ -1,4 +1,4 @@
2
 repo: 09fe40627f03a0f9c3e6ac78b22ac93da23f9fdf
3
-node: e41a9bf2bac4a7af2bec2bbadf91e63752d320ef
4
+node: 0e9ea76945c89962cd46cee6537586e2054b2935
5
 branch: stable
6
-tag: 2.7
7
+tag: 2.6
8
x265_2.7.tar.gz/.hgtags -> x265_2.6.tar.gz/.hgtags Changed
6
 
1
@@ -24,4 +24,3 @@
2
 3037c1448549ca920967831482c653e5892fa8ed 2.3
3
 e7a4dd48293b7956d4a20df257d23904cc78e376 2.4
4
 64b2d0bf45a52511e57a6b7299160b961ca3d51c 2.5
5
-0e9ea76945c89962cd46cee6537586e2054b2935 2.6
6
x265_2.7.tar.gz/build/README.txt -> x265_2.6.tar.gz/build/README.txt Changed
36
 
1
@@ -9,8 +9,7 @@
2
 
3
 = Optional Prerequisites =
4
 
5
-1. To compile assembly primitives (performance) 
6
-   a) If you are using release 2.6 or older, download and install Yasm 1.2.0 or later, 
7
+1. Yasm 1.2.0 or later, to compile assembly primitives (performance)
8
 
9
    For Windows, download the latest yasm executable
10
    http://yasm.tortall.net/Download.html and copy the EXE into
11
@@ -34,24 +33,6 @@
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.7.tar.gz/doc/reST/api.rst -> x265_2.6.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, int*, int*);
6
+     int x265_get_ref_frame_list(x265_encoder *encoder, x265_picyuv**, x265_picyuv**, int, int);
7
  
8
 **x265_encoder_ctu_info** may be used to provide additional CTU-specific information to the encoder::
9
 
10
x265_2.7.tar.gz/doc/reST/cli.rst -> x265_2.6.tar.gz/doc/reST/cli.rst Changed
91
 
1
@@ -863,22 +863,21 @@
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-save <filename>
6
+.. option:: --analysis-reuse-mode <string|int>
7
 
8
-   Encoder outputs analysis information of each frame. Analysis data from save mode is
9
-   written to the file specified. Requires cutree, pmode to be off. Default disabled.
10
-   
11
-.. option:: --analysis-load <filename>
12
-
13
-   Encoder reuses analysis information from the file specified. By reading the analysis data writen by
14
-   an earlier encode of the same sequence, substantial redundant work may be avoided. Requires cutree, pmode
15
-   to be off. Default disabled.
16
+   This option allows reuse of analysis information from first pass to second pass.
17
+   :option:`--analysis-reuse-mode save` specifies that encoder outputs analysis information of each frame.
18
+   :option:`--analysis-reuse-mode load` specifies that encoder reuses analysis information from first pass.
19
+   There is no benefit using load mode without running encoder in save mode. Analysis data from save mode is
20
+   written to a file specified by :option:`--analysis-reuse-file`. The amount of analysis data stored/reused
21
+   is determined by :option:`--analysis-reuse-level`. By reading the analysis data writen by an earlier encode
22
+   of the same sequence, substantial redundant work may be avoided. Requires cutree, pmode to be off. Default 0.
23
 
24
-   The amount of analysis data stored/reused is determined by :option:`--analysis-reuse-level`.
25
+   **Values:** off(0), save(1): dump analysis data, load(2): read analysis data
26
 
27
 .. option:: --analysis-reuse-file <filename>
28
 
29
-   Specify a filename for `multi-pass-opt-analysis` and `multi-pass-opt-distortion`.
30
+   Specify a filename for analysis data (see :option:`--analysis-reuse-mode`)
31
    If no filename is specified, x265_analysis.dat is used.
32
 
33
 .. option:: --analysis-reuse-level <1..10>
34
@@ -1029,13 +1028,7 @@
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
-   Enabling levels 3 or 4 may cause a mismatch in the output bitstreams 
40
-   between option:`--analysis-save` and option:`--analysis-load`
41
-   as all neighbouring CUs TU depth may not be available in the 
42
-   option:`--analysis-load` run as only the best mode's information is 
43
-   available to it.
44
-   
45
+
46
    Default: 0
47
 
48
 .. option:: --nr-intra <integer>, --nr-inter <integer>
49
@@ -1351,14 +1344,7 @@
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
-   
55
-.. option:: --radl <integer>
56
-   
57
-   Number of RADL pictures allowed infront of IDR. Requires fixed keyframe interval.
58
-   Recommended value is 2-3. Default 0 (disabled).
59
-   
60
-   **Range of values: Between 0 and `--bframes`
61
+   then detect this frame as scenecut. Values between 5 and 15 are recommended. Default 5. 
62
 
63
 .. option:: --ctu-info <0, 1, 2, 4, 6>
64
 
65
@@ -1387,16 +1373,6 @@
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
@@ -2064,7 +2040,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.7.tar.gz/doc/reST/releasenotes.rst -> x265_2.6.tar.gz/doc/reST/releasenotes.rst Changed
34
 
1
@@ -2,32 +2,6 @@
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.7.tar.gz/source/CMakeLists.txt -> x265_2.6.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 151)
6
+set(X265_BUILD 146)
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(Nasm)
15
+find_package(Yasm)
16
 if(ARM OR CROSS_COMPILE_ARM)
17
     option(ENABLE_ASSEMBLY "Enable use of assembly coded primitives" ON)
18
-elseif(NASM_FOUND AND X86)
19
-    if (NASM_VERSION_STRING VERSION_LESS "2.13.0")
20
-        message(STATUS "Nasm version ${NASM_VERSION_STRING} is too old. 2.13.0 or later required")
21
+elseif(YASM_FOUND AND X86)
22
+    if (YASM_VERSION_STRING VERSION_LESS "1.2.0")
23
+        message(STATUS "Yasm version ${YASM_VERSION_STRING} is too old. 1.2.0 or later required")
24
         option(ENABLE_ASSEMBLY "Enable use of assembly coded primitives" OFF)
25
     else()
26
-        message(STATUS "Found Nasm ${NASM_VERSION_STRING} to build assembly primitives")
27
+        message(STATUS "Found Yasm ${YASM_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 ${NASM_EXECUTABLE} ARGS ${NASM_FLAGS} ${ASM_SRC} -o ${ASM}.${SUFFIX}
36
+                COMMAND ${YASM_EXECUTABLE} ARGS ${YASM_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})
44
+    add_library(x265-static STATIC $<TARGET_OBJECTS:encoder> $<TARGET_OBJECTS:common> $<TARGET_OBJECTS:dynamicHDR10> ${ASM_OBJS} ${ASM_SRCS})
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})
49
+    add_library(x265-static STATIC $<TARGET_OBJECTS:encoder> $<TARGET_OBJECTS:common> ${ASM_OBJS} ${ASM_SRCS})
50
 endif()
51
 if(NOT MSVC)
52
     set_target_properties(x265-static PROPERTIES OUTPUT_NAME x265)
53
@@ -546,19 +546,14 @@
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
-    if(MSVC_IDE)
60
-        install(FILES "${PROJECT_BINARY_DIR}/Debug/x265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS Debug)
61
-        install(FILES "${PROJECT_BINARY_DIR}/RelWithDebInfo/x265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS RelWithDebInfo)
62
-        install(FILES "${PROJECT_BINARY_DIR}/Debug/libx265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS Debug OPTIONAL NAMELINK_ONLY)
63
-        install(FILES "${PROJECT_BINARY_DIR}/RelWithDebInfo/libx265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS RelWithDebInfo OPTIONAL NAMELINK_ONLY)
64
-    else()
65
-        install(FILES "${PROJECT_BINARY_DIR}/x265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS Debug)
66
-        install(FILES "${PROJECT_BINARY_DIR}/x265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS RelWithDebInfo)
67
-        install(FILES "${PROJECT_BINARY_DIR}/libx265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS Debug OPTIONAL NAMELINK_ONLY)
68
-        install(FILES "${PROJECT_BINARY_DIR}/libx265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS RelWithDebInfo OPTIONAL NAMELINK_ONLY)
69
-    endif()
70
+    install(FILES "${PROJECT_BINARY_DIR}/Debug/x265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS Debug)
71
+    install(FILES "${PROJECT_BINARY_DIR}/RelWithDebInfo/x265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS RelWithDebInfo)
72
+    install(FILES "${PROJECT_BINARY_DIR}/Debug/libx265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS Debug OPTIONAL NAMELINK_ONLY)
73
+    install(FILES "${PROJECT_BINARY_DIR}/RelWithDebInfo/libx265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS RelWithDebInfo OPTIONAL NAMELINK_ONLY)
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
@@ -647,9 +642,7 @@
80
     endforeach()
81
     if(PLIBLIST)
82
         # blacklist of libraries that should not be in Libs.private
83
-        list(REMOVE_ITEM PLIBLIST "-lc" "-lpthread" "-lmingwex" "-lmingwthrd"
84
-            "-lmingw32" "-lmoldname" "-lmsvcrt" "-ladvapi32" "-lshell32"
85
-            "-luser32" "-lkernel32")
86
+        list(REMOVE_ITEM PLIBLIST "-lc" "-lpthread")
87
         string(REPLACE ";" " " PRIVATE_LIBS "${PLIBLIST}")
88
     else()
89
         set(PRIVATE_LIBS "")
90
@@ -693,11 +686,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})
95
+                        $<TARGET_OBJECTS:encoder> $<TARGET_OBJECTS:common> $<TARGET_OBJECTS:dynamicHDR10> ${ASM_OBJS} ${ASM_SRCS})
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})
100
+                        $<TARGET_OBJECTS:encoder> $<TARGET_OBJECTS:common> ${ASM_OBJS} ${ASM_SRCS})
101
         endif()
102
     else()
103
         add_executable(cli ../COPYING ${InputFiles} ${OutputFiles} ${GETOPT} ${X265_RC_FILE}
104
x265_2.6.tar.gz/source/cmake/CMakeASM_YASMInformation.cmake Added
70
 
1
@@ -0,0 +1,68 @@
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 Added
7
 
1
@@ -0,0 +1,5 @@
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 Added
5
 
1
@@ -0,0 +1,3 @@
2
+set(ASM_DIALECT "_YASM")
3
+include(CMakeTestASMCompiler)
4
+set(ASM_DIALECT)
5
x265_2.6.tar.gz/source/cmake/FindYasm.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(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.7.tar.gz/source/cmake/version.cmake -> x265_2.6.tar.gz/source/cmake/version.cmake Changed
17
 
1
@@ -22,11 +22,12 @@
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
-        set(X265_LATEST_TAG ${hg_latesttag})
10
-        set(X265_TAG_DISTANCE ${hg_latesttagdistance})
11
-        string(SUBSTRING "${hg_node}" 0 12 X265_REVISION_ID)
12
+        string(SUBSTRING "${hg_node}" 0 16 hg_id)
13
+        set(X265_VERSION "${hg_latesttag}+${hg_latesttagdistance}-${hg_id}")
14
     endif()
15
 elseif(HG_EXECUTABLE AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../.hg)
16
     if(EXISTS "${HG_EXECUTABLE}.bat")
17
x265_2.7.tar.gz/source/common/CMakeLists.txt -> x265_2.6.tar.gz/source/common/CMakeLists.txt Changed
35
 
1
@@ -56,26 +56,28 @@
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 v4-ipfilter16.asm h4-ipfilter16.asm h-ipfilter16.asm ipfilter16.asm loopfilter.asm)
12
+        set(A_SRCS ${A_SRCS} sad16-a.asm intrapred16.asm ipfilter16.asm loopfilter.asm)
13
     else()
14
-        set(A_SRCS ${A_SRCS} sad-a.asm intrapred8.asm intrapred8_allangs.asm v4-ipfilter8.asm h-ipfilter8.asm ipfilter8.asm loopfilter.asm)
15
+        set(A_SRCS ${A_SRCS} sad-a.asm intrapred8.asm intrapred8_allangs.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 nasm
24
-        set(MSVC_ASMS "${A_SRCS}" CACHE INTERNAL "nasm sources")
25
+        # MSVC requires custom build rules in the main cmake script for yasm
26
+        set(MSVC_ASMS "${A_SRCS}" CACHE INTERNAL "yasm sources")
27
         set(A_SRCS)
28
     endif()
29
 
30
-    enable_language(ASM_NASM)
31
+    enable_language(ASM_YASM)
32
 
33
     foreach(SRC ${A_SRCS} ${C_SRCS})
34
         set(ASM_PRIMITIVES ${ASM_PRIMITIVES} x86/${SRC})
35
x265_2.7.tar.gz/source/common/common.h -> x265_2.6.tar.gz/source/common/common.h Changed
25
 
1
@@ -75,10 +75,11 @@
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
@@ -86,8 +87,9 @@
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
-#define ftello _ftelli64
19
+
20
 #endif // if defined(__GNUC__)
21
+
22
 #if HAVE_INT_TYPES_H
23
 #define __STDC_FORMAT_MACROS
24
 #include <inttypes.h>
25
x265_2.7.tar.gz/source/common/cudata.cpp -> x265_2.6.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->analysisSave && m_log2CUSize[0] < 4)
6
+                if (m_encData->m_param->scaleFactor && m_encData->m_param->analysisReuseMode == X265_ANALYSIS_SAVE && 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->analysisSave && (m_log2CUSize[0] < 4))
15
+            if (m_encData->m_param->scaleFactor && m_encData->m_param->analysisReuseMode == X265_ANALYSIS_SAVE && (m_log2CUSize[0] < 4))
16
             {
17
                 MV dist(MAX_MV, MAX_MV);
18
                 pmv[numMvc++] = amvpCand[num++] = dist;
19
x265_2.7.tar.gz/source/common/deblock.cpp -> x265_2.6.tar.gz/source/common/deblock.cpp Changed
27
 
1
@@ -207,18 +207,21 @@
2
     static const MV zeroMv(0, 0);
3
     const Slice* const sliceQ = cuQ->m_slice;
4
     const Slice* const sliceP = cuP->m_slice;
5
-    const Frame* refP0 = (cuP->m_refIdx[0][partP] >= 0) ? sliceP->m_refFrameList[0][cuP->m_refIdx[0][partP]] : NULL;
6
-    const Frame* refQ0 = (cuQ->m_refIdx[0][partQ] >= 0) ? sliceQ->m_refFrameList[0][cuQ->m_refIdx[0][partQ]] : NULL;
7
+
8
+    const Frame* refP0 = sliceP->m_refFrameList[0][cuP->m_refIdx[0][partP]];
9
+    const Frame* refQ0 = sliceQ->m_refFrameList[0][cuQ->m_refIdx[0][partQ]];
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 = (cuP->m_refIdx[1][partP] >= 0) ? sliceP->m_refFrameList[1][cuP->m_refIdx[1][partP]] : NULL;
21
-    const Frame* refQ1 = (cuQ->m_refIdx[1][partQ] >= 0) ? sliceQ->m_refFrameList[1][cuQ->m_refIdx[1][partQ]] : NULL;
22
+    const Frame* refP1 = sliceP->m_refFrameList[1][cuP->m_refIdx[1][partP]];
23
+    const Frame* refQ1 = sliceQ->m_refFrameList[1][cuQ->m_refIdx[1][partQ]];
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.7.tar.gz/source/common/frame.h -> x265_2.6.tar.gz/source/common/frame.h Changed
9
 
1
@@ -98,6 +98,7 @@
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.7.tar.gz/source/common/framedata.cpp -> x265_2.6.tar.gz/source/common/framedata.cpp Changed
40
 
1
@@ -40,12 +40,11 @@
2
     m_spsrpsIdx = -1;
3
     if (param.rc.bStatWrite)
4
         m_spsrps = const_cast<RPS*>(sps.spsrps);
5
-    bool isallocated = m_cuMemPool.create(0, param.internalCsp, sps.numCUsInFrame, param);
6
-    if (isallocated)
7
-        for (uint32_t ctuAddr = 0; ctuAddr < sps.numCUsInFrame; ctuAddr++)
8
-            m_picCTU[ctuAddr].initialize(m_cuMemPool, 0, param, ctuAddr);
9
-    else
10
-        return false;
11
+
12
+    m_cuMemPool.create(0, param.internalCsp, sps.numCUsInFrame, param);
13
+    for (uint32_t ctuAddr = 0; ctuAddr < sps.numCUsInFrame; ctuAddr++)
14
+        m_picCTU[ctuAddr].initialize(m_cuMemPool, 0, param, ctuAddr);
15
+
16
     CHECKED_MALLOC_ZERO(m_cuStat, RCStatCU, sps.numCUsInFrame);
17
     CHECKED_MALLOC(m_rowStat, RCStatRow, sps.numCuInHeight);
18
     reinit(sps);
19
@@ -77,12 +76,16 @@
20
 
21
     X265_FREE(m_cuStat);
22
     X265_FREE(m_rowStat);
23
-    for (int i = 0; i < INTEGRAL_PLANE_NUM; i++)
24
+
25
+    if (m_meBuffer)
26
     {
27
-        if (m_meBuffer[i] != NULL)
28
+        for (int i = 0; i < INTEGRAL_PLANE_NUM; i++)
29
         {
30
-            X265_FREE(m_meBuffer[i]);
31
-            m_meBuffer[i] = NULL;
32
+            if (m_meBuffer[i] != NULL)
33
+            {
34
+                X265_FREE(m_meBuffer[i]);
35
+                m_meBuffer[i] = NULL;
36
+            }
37
         }
38
     }
39
 }
40
x265_2.7.tar.gz/source/common/lowres.cpp -> x265_2.6.tar.gz/source/common/lowres.cpp Changed
28
 
1
@@ -89,7 +89,7 @@
2
         }
3
     }
4
 
5
-    for (int i = 0; i < bframes + 2; i++)
6
+    for (int i = 0; i < bframes + 1; 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 + 2; i++)
15
+    for (int i = 0; i < bframes + 1; 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 + 2; i++)
24
+    for (int i = 0; i < bframes + 1; i++)
25
     {
26
         lowresMvs[0][i][0].x = 0x7FFF;
27
         lowresMvs[1][i][0].x = 0x7FFF;
28
x265_2.7.tar.gz/source/common/lowres.h -> x265_2.6.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 + 2];
7
-    MV*       lowresMvs[2][X265_BFRAME_MAX + 2];
8
+    uint16_t(*lowresCosts[X265_BFRAME_MAX + 2][X265_BFRAME_MAX + 2]);
9
+    int32_t*  lowresMvCosts[2][X265_BFRAME_MAX + 1];
10
+    MV*       lowresMvs[2][X265_BFRAME_MAX + 1];
11
     uint32_t  maxBlocksInRow;
12
     uint32_t  maxBlocksInCol;
13
     uint32_t  maxBlocksInRowFullRes;
14
x265_2.7.tar.gz/source/common/param.cpp -> x265_2.6.tar.gz/source/common/param.cpp Changed
139
 
1
@@ -144,7 +144,6 @@
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
@@ -154,7 +153,6 @@
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
@@ -198,12 +196,10 @@
18
     param->rdPenalty = 0;
19
     param->psyRd = 2.0;
20
     param->psyRdoq = 0.0;
21
-    param->analysisReuseMode = 0; /*DEPRECATED*/
22
+    param->analysisReuseMode = 0;
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
@@ -853,7 +849,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); /*DEPRECATED*/
36
+    OPT("analysis-reuse-mode") p->analysisReuseMode = parseName(value, x265_analysis_names, bError);
37
     OPT("sar")
38
     {
39
         p->vui.aspectRatioIdc = parseName(value, x265_sar_names, bError);
40
@@ -1008,10 +1004,6 @@
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
@@ -1318,14 +1310,10 @@
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
@@ -1352,7 +1340,9 @@
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->analysisSave || param->analysisLoad) && (param->analysisReuseLevel < 1 || param->analysisReuseLevel > 10),
71
+    CHECK(param->analysisReuseMode && (param->analysisReuseMode < X265_ANALYSIS_OFF || param->analysisReuseMode > X265_ANALYSIS_LOAD),
72
+        "Invalid analysis mode. Analysis mode 0: OFF 1: SAVE : 2 LOAD");
73
+    CHECK(param->analysisReuseMode && (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
@@ -1530,15 +1520,11 @@
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, bufSize);
88
+    buf = s = X265_MALLOC(char, MAXPARAMSIZE);
89
     if (!buf)
90
         return NULL;
91
+
92
 #define BOOL(param, cliopt) \
93
     s += sprintf(s, " %s", (param) ? cliopt : "no-" cliopt);
94
 
95
@@ -1553,7 +1539,7 @@
96
     BOOL(p->bEnableSsim, "ssim");
97
     s += sprintf(s, " log-level=%d", p->logLevel);
98
     if (p->csvfn)
99
-        s += sprintf(s, " csv csv-log-level=%d", p->csvLogLevel);
100
+        s += sprintf(s, " csvfn=%s csv-log-level=%d", p->csvfn, 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
@@ -1575,7 +1561,6 @@
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
@@ -1583,7 +1568,6 @@
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
@@ -1629,6 +1613,7 @@
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
@@ -1726,10 +1711,6 @@
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.7.tar.gz/source/common/param.h -> x265_2.6.tar.gz/source/common/param.h Changed
10
 
1
@@ -53,5 +53,8 @@
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.7.tar.gz/source/common/picyuv.cpp -> x265_2.6.tar.gz/source/common/picyuv.cpp Changed
30
 
1
@@ -358,20 +358,18 @@
2
     pixel *uPic = m_picOrg[1];
3
     pixel *vPic = m_picOrg[2];
4
 
5
-    if (param.csvLogLevel >= 2 || param.maxCLL || param.maxFALL)
6
+    for (int r = 0; r < height; r++)
7
     {
8
-        for (int r = 0; r < height; r++)
9
+        for (int c = 0; c < width; c++)
10
         {
11
-            for (int c = 0; c < width; c++)
12
-            {
13
-                m_maxLumaLevel = X265_MAX(yPic[c], m_maxLumaLevel);
14
-                m_minLumaLevel = X265_MIN(yPic[c], m_minLumaLevel);
15
-                lumaSum += yPic[c];
16
-            }
17
-            yPic += m_stride;
18
+            m_maxLumaLevel = X265_MAX(yPic[c], m_maxLumaLevel);
19
+            m_minLumaLevel = X265_MIN(yPic[c], m_minLumaLevel);
20
+            lumaSum += yPic[c];
21
         }
22
-        m_avgLumaLevel = (double)lumaSum / (m_picHeight * m_picWidth);
23
+        yPic += m_stride;
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.7.tar.gz/source/common/x86/asm-primitives.cpp -> x265_2.6.tar.gz/source/common/x86/asm-primitives.cpp Changed
9
 
1
@@ -116,6 +116,7 @@
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.7.tar.gz/source/common/x86/blockcopy8.asm -> x265_2.6.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/intrapred8.asm -> x265_2.6.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        r2d, m0
6
+    movd        r2, m0
7
     mov         [r0], r2b
8
     shr         r2, 8
9
     mov         [r0 + r1], r2b
10
x265_2.7.tar.gz/source/common/x86/ipfilter16.asm -> x265_2.6.tar.gz/source/common/x86/ipfilter16.asm Changed
201
 
1
@@ -47,10 +47,75 @@
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
@@ -92,6 +157,14 @@
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
@@ -102,6 +175,255 @@
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.7.tar.gz/source/common/x86/ipfilter8.asm -> x265_2.6.tar.gz/source/common/x86/ipfilter8.asm Changed
201
 
1
@@ -33,16 +33,119 @@
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
@@ -93,6 +196,26 @@
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
@@ -133,10 +256,44 @@
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
@@ -146,6 +303,462 @@
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.7.tar.gz/source/common/x86/loopfilter.asm -> x265_2.6.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.7.tar.gz/source/common/x86/mc-a.asm -> x265_2.6.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.7.tar.gz/source/common/x86/pixel-util8.asm -> x265_2.6.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.7.tar.gz/source/common/x86/sad-a.asm -> x265_2.6.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.7.tar.gz/source/common/x86/seaintegral.asm -> x265_2.6.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/x86inc.asm -> x265_2.6.tar.gz/source/common/x86/x86inc.asm Changed
112
 
1
@@ -66,15 +66,6 @@
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
@@ -97,10 +88,6 @@
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
@@ -698,7 +685,7 @@
29
         CAT_XDEFINE cglobaled_, %2, 1
30
     %endif
31
     %xdefine current_function %2
32
-    %if FORMAT_ELF
33
+    %ifidn __OUTPUT_FORMAT__,elf
34
         global %2:function %%VISIBILITY
35
     %else
36
         global %2
37
@@ -724,16 +711,14 @@
38
 
39
 ; like cextern, but without the prefix
40
 %macro cextern_naked 1
41
-    %ifdef PREFIX
42
-        %xdefine %1 mangle(%1)
43
-    %endif
44
+    %xdefine %1 mangle(%1)
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
-    %if FORMAT_ELF
52
+    %ifidn __OUTPUT_FORMAT__,elf
53
         global %1:data hidden
54
     %else
55
         global %1
56
@@ -742,8 +727,9 @@
57
     %1: %2
58
 %endmacro
59
 
60
-; This is needed for ELF, otherwise the GNU linker assumes the stack is executable by default.
61
-%if FORMAT_ELF
62
+; This is needed for ELF, otherwise the GNU linker assumes the stack is
63
+; executable by default.
64
+%ifidn __OUTPUT_FORMAT__,elf
65
     [SECTION .note.GNU-stack noalloc noexec nowrite progbits]
66
 %endif
67
 
68
@@ -815,17 +801,9 @@
69
     %endif
70
 
71
     %if ARCH_X86_64 || cpuflag(sse2)
72
-        %ifdef __NASM_VER__
73
-            ALIGNMODE p6
74
-        %else
75
-            CPU amdnop
76
-        %endif
77
+        CPU amdnop
78
     %else
79
-        %ifdef __NASM_VER__
80
-            ALIGNMODE nop
81
-        %else
82
-            CPU basicnop
83
-        %endif
84
+        CPU basicnop
85
     %endif
86
 %endmacro
87
 
88
@@ -1489,7 +1467,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
-                %ifnum sizeof%3
93
+                %ifid %3
94
                     v%{5}213%6 %2, %3, %4
95
                 %else
96
                     v%{5}132%6 %2, %4, %3
97
@@ -1513,3 +1491,14 @@
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.7.tar.gz/source/dynamicHDR10/JsonHelper.cpp -> x265_2.6.tar.gz/source/dynamicHDR10/JsonHelper.cpp Changed
62
 
1
@@ -139,13 +139,21 @@
2
         return JsonObject();
3
     }
4
 
5
-    std::ifstream ifs(path);
6
-    const std::string json_str2((std::istreambuf_iterator<char>(ifs)),
7
-                                (std::istreambuf_iterator<char>()));
8
-
9
+    ifstream tfile;
10
+    string json_str;
11
+    string json_str2;
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
-    return Json::parse(json_str2,err, JsonParse::COMMENTS).object_items();
21
+    tfile.close();
22
+    size_t beginning = json_str2.find_first_of("{");
23
+    int fixchar = json_str2[json_str2.size() - 2] == '}' ? 1 : 0;
24
+    return Json::parse(json_str2.substr(beginning,json_str2.size() - fixchar),err).object_items();
25
 }
26
 
27
 JsonArray JsonHelper::readJsonArray(const string &path)
28
@@ -166,13 +174,28 @@
29
         return JsonArray();
30
     }
31
 
32
-    std::ifstream ifs(path);
33
-    const std::string json_str2((std::istreambuf_iterator<char>(ifs)),
34
-                                (std::istreambuf_iterator<char>()));
35
-
36
+    ifstream tfile;
37
+    string json_str;
38
+    string json_str2;
39
     string err = "";
40
+    tfile.open(path);
41
+    while(tfile)
42
+    {
43
+        std::getline(tfile, json_str);
44
+        json_str2.append(json_str);
45
+    }
46
+
47
+    tfile.close();
48
 
49
-    return Json::parse(json_str2,err, JsonParse::COMMENTS).array_items();
50
+    vector<Json> data;
51
+    if (json_str2.size() != 0)
52
+    {
53
+        size_t beginning = json_str2.find_first_of("[");
54
+        int fixchar = json_str2[json_str2.size() - 2] == ']' ? 1 : 0;
55
+        return Json::parse(json_str2.substr(beginning, json_str2.size() - fixchar), err).array_items();
56
+    }
57
+    else
58
+        return data;
59
 }
60
 
61
 bool JsonHelper::validatePathExtension(string &path)
62
x265_2.7.tar.gz/source/dynamicHDR10/SeiMetadataDictionary.cpp -> x265_2.6.tar.gz/source/dynamicHDR10/SeiMetadataDictionary.cpp Changed
9
 
1
@@ -28,7 +28,6 @@
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.7.tar.gz/source/dynamicHDR10/SeiMetadataDictionary.h -> x265_2.6.tar.gz/source/dynamicHDR10/SeiMetadataDictionary.h Changed
9
 
1
@@ -37,7 +37,6 @@
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.7.tar.gz/source/dynamicHDR10/metadataFromJson.cpp -> x265_2.6.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 = 1;
6
+    const uint8_t applicationVersion = 0;
7
 
8
     mPimpl->appendBits(metadata, countryCode, 8);
9
     mPimpl->appendBits(metadata, terminalProviderCode, 16);
10
@@ -384,7 +384,9 @@
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
-    uint16_t numWindows = (uint16_t)fileData[frame][JsonDataKeys::NumberOfWindows].int_value();
15
+
16
+    uint16_t numWindows = 1 + static_cast<uint16_t>(ellipsesNum);
17
+
18
     mPimpl->appendBits(metadata, numWindows, 2);
19
     for (int i = 0; i < ellipsesNum; ++i)
20
     {
21
@@ -424,15 +426,16 @@
22
 
23
         mPimpl->appendBits(metadata, semimajorExternalAxis, 16);
24
         mPimpl->appendBits(metadata, semiminorExternalAxis, 16);
25
-        uint8_t overlapProcessOption = static_cast<uint8_t>(ellipseJsonObject[EllipseNames::OverlapProcessOption].int_value());
26
+        /*bool*/ uint8_t overlapProcessOption = static_cast<uint8_t>(ellipseJsonObject[EllipseNames::OverlapProcessOption].int_value()); //1; 
27
         //TODO: Uses Layering method, the value is "1"
28
         mPimpl->appendBits(metadata, overlapProcessOption, 1);
29
     }
30
     /* Targeted System Display Data */
31
-    uint32_t monitorPeak = fileData[frame][JsonDataKeys::TargetDisplayLuminance].int_value();     //500;
32
-    mPimpl->appendBits(metadata, monitorPeak, 27);
33
+    uint32_t TEMPmonitorPeak = fileData[frame][JsonDataKeys::TargetDisplayLuminance].int_value();     //500;
34
+    mPimpl->appendBits(metadata, TEMPmonitorPeak, 27);
35
+
36
     //NOTE: Set as false for now, as requested
37
-    uint8_t targetedSystemDisplayActualPeakLuminanceFlag = 0;
38
+    /*bool*/uint8_t targetedSystemDisplayActualPeakLuminanceFlag = 0; /*false*/
39
     mPimpl->appendBits(metadata, targetedSystemDisplayActualPeakLuminanceFlag, 1);
40
     if (targetedSystemDisplayActualPeakLuminanceFlag)
41
     {
42
@@ -460,6 +463,7 @@
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
@@ -474,7 +478,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
@@ -495,32 +499,33 @@
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
-       /* Check if the window contains tone mapping bezier curve data and set toneMappingFlag appropriately */
70
-       //Json bezierData = fileData[frame][BezierCurveNames::TagName];
71
-        BezierCurveData curveData;
72
-       /* Select curve data based on global window */
73
-        if (w == 0)
74
+        mPimpl->appendBits(metadata, toneMappingFlag, 1);
75
+        if (toneMappingFlag)
76
         {
77
-            if (!mPimpl->bezierCurveFromJson(fileData[frame][BezierCurveNames::TagName], curveData))
78
+            Json bezierData = fileData[frame][BezierCurveNames::TagName];
79
+            BezierCurveData curveData;
80
+
81
+            /* Select curve data based on global window or local window */
82
+            if (w == 0)
83
             {
84
-               toneMappingFlag = 0;
85
+                if (!mPimpl->bezierCurveFromJson(bezierData, curveData))
86
+                {
87
+                    std::cout << "error parsing bezierCurve frame: " << w << std::endl;
88
+                }
89
             }
90
-        }
91
-       /* Select curve data based on local window */
92
-        else
93
-        {
94
-            if (!mPimpl->bezierCurveFromJson(jsonArray[w - 1][BezierCurveNames::TagName], curveData))
95
+            else
96
             {
97
-               toneMappingFlag = 0;
98
+                if (!mPimpl->bezierCurveFromJson(jsonArray[w - 1][BezierCurveNames::TagName], curveData))
99
+                {
100
+                    std::cout << "error parsing bezierCurve ellipse: " << w - 1 << std::endl;
101
+                }
102
             }
103
-        }      
104
-        mPimpl->appendBits(metadata, toneMappingFlag, 1);
105
-        if (toneMappingFlag)
106
-        {
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
@@ -536,7 +541,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.7.tar.gz/source/encoder/analysis.cpp -> x265_2.6.tar.gz/source/encoder/analysis.cpp Changed
201
 
1
@@ -100,17 +100,16 @@
2
     for (uint32_t depth = 0; depth <= m_param->maxCUDepth; depth++, cuSize >>= 1)
3
     {
4
         ModeDepth &md = m_modeDepth[depth];
5
-        ok &= md.cuMemPool.create(depth, csp, MAX_PRED_TYPES, *m_param);
6
+
7
+        md.cuMemPool.create(depth, csp, MAX_PRED_TYPES, *m_param);
8
         ok &= md.fencYuv.create(cuSize, csp);
9
-        if (ok)
10
+
11
+        for (int j = 0; j < MAX_PRED_TYPES; j++)
12
         {
13
-            for (int j = 0; j < MAX_PRED_TYPES; j++)
14
-            {
15
-                md.pred[j].cu.initialize(md.cuMemPool, depth, *m_param, j);
16
-                ok &= md.pred[j].predYuv.create(cuSize, csp);
17
-                ok &= md.pred[j].reconYuv.create(cuSize, csp);
18
-                md.pred[j].fencYuv = &md.fencYuv;
19
-            }
20
+            md.pred[j].cu.initialize(md.cuMemPool, depth, *m_param, j);
21
+            ok &= md.pred[j].predYuv.create(cuSize, csp);
22
+            ok &= md.pred[j].reconYuv.create(cuSize, csp);
23
+            md.pred[j].fencYuv = &md.fencYuv;
24
         }
25
     }
26
     if (m_param->sourceHeight >= 1080)
27
@@ -159,34 +158,38 @@
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
-        int32_t depthIdx = 0;
32
-        uint32_t maxNum8x8Partitions = 64;
33
-        uint8_t* depthInfoPtr = m_frame->m_addOnDepth[ctu.m_cuAddr];
34
-        uint8_t* contentInfoPtr = m_frame->m_addOnCtuInfo[ctu.m_cuAddr];
35
-        int* prevCtuInfoChangePtr = m_frame->m_addOnPrevChange[ctu.m_cuAddr];
36
-        do
37
-        {
38
-            uint8_t depth = (uint8_t)ctuTemp->ctuPartitions[depthIdx];
39
-            uint8_t content = (uint8_t)(*((int32_t *)ctuTemp->ctuInfo + depthIdx));
40
-            int prevCtuInfoChange = m_frame->m_prevCtuInfoChange[ctu.m_cuAddr * maxNum8x8Partitions + depthIdx];
41
-            memset(depthInfoPtr, depth, sizeof(uint8_t) * numPartition >> 2 * depth);
42
-            memset(contentInfoPtr, content, sizeof(uint8_t) * numPartition >> 2 * depth);
43
-            memset(prevCtuInfoChangePtr, 0, sizeof(int) * numPartition >> 2 * depth);
44
-            for (uint32_t l = 0; l < numPartition >> 2 * depth; l++)
45
-                prevCtuInfoChangePtr[l] = prevCtuInfoChange;
46
-            depthInfoPtr += ctu.m_numPartitions >> 2 * depth;
47
-            contentInfoPtr += ctu.m_numPartitions >> 2 * depth;
48
-            prevCtuInfoChangePtr += ctu.m_numPartitions >> 2 * depth;
49
-            depthIdx++;
50
-        } while (ctuTemp->ctuPartitions[depthIdx] != 0);
51
-
52
-        m_additionalCtuInfo = m_frame->m_addOnCtuInfo[ctu.m_cuAddr];
53
-        m_prevCtuInfoChange = m_frame->m_addOnPrevChange[ctu.m_cuAddr];
54
-        memcpy(ctu.m_cuDepth, m_frame->m_addOnDepth[ctu.m_cuAddr], sizeof(uint8_t) * numPartition);
55
-        //Calculate log2CUSize from depth
56
-        for (uint32_t i = 0; i < cuGeom.numPartitions; i++)
57
-            ctu.m_log2CUSize[i] = (uint8_t)m_param->maxLog2CUSize - ctu.m_cuDepth[i];
58
+        if (ctuTemp->ctuPartitions)
59
+        {
60
+            int32_t depthIdx = 0;
61
+            uint32_t maxNum8x8Partitions = 64;
62
+            uint8_t* depthInfoPtr = m_frame->m_addOnDepth[ctu.m_cuAddr];
63
+            uint8_t* contentInfoPtr = m_frame->m_addOnCtuInfo[ctu.m_cuAddr];
64
+            int* prevCtuInfoChangePtr = m_frame->m_addOnPrevChange[ctu.m_cuAddr];
65
+            do
66
+            {
67
+                uint8_t depth = (uint8_t)ctuTemp->ctuPartitions[depthIdx];
68
+                uint8_t content = (uint8_t)(*((int32_t *)ctuTemp->ctuInfo + depthIdx));
69
+                int prevCtuInfoChange = m_frame->m_prevCtuInfoChange[ctu.m_cuAddr * maxNum8x8Partitions + depthIdx];
70
+                memset(depthInfoPtr, depth, sizeof(uint8_t) * numPartition >> 2 * depth);
71
+                memset(contentInfoPtr, content, sizeof(uint8_t) * numPartition >> 2 * depth);
72
+                memset(prevCtuInfoChangePtr, 0, sizeof(int) * numPartition >> 2 * depth);
73
+                for (uint32_t l = 0; l < numPartition >> 2 * depth; l++)
74
+                    prevCtuInfoChangePtr[l] = prevCtuInfoChange;
75
+                depthInfoPtr += ctu.m_numPartitions >> 2 * depth;
76
+                contentInfoPtr += ctu.m_numPartitions >> 2 * depth;
77
+                prevCtuInfoChangePtr += ctu.m_numPartitions >> 2 * depth;
78
+                depthIdx++;
79
+            } while (ctuTemp->ctuPartitions[depthIdx] != 0);
80
+
81
+            m_additionalCtuInfo = m_frame->m_addOnCtuInfo[ctu.m_cuAddr];
82
+            m_prevCtuInfoChange = m_frame->m_addOnPrevChange[ctu.m_cuAddr];
83
+            memcpy(ctu.m_cuDepth, m_frame->m_addOnDepth[ctu.m_cuAddr], sizeof(uint8_t) * numPartition);
84
+            //Calculate log2CUSize from depth
85
+            for (uint32_t i = 0; i < cuGeom.numPartitions; i++)
86
+                ctu.m_log2CUSize[i] = (uint8_t)m_param->maxLog2CUSize - ctu.m_cuDepth[i];
87
+        }
88
     }
89
+
90
     if (m_param->analysisMultiPassRefine && m_param->rc.bStatRead)
91
     {
92
         m_multipassAnalysis = (analysis2PassFrameData*)m_frame->m_analysis2Pass.analysisFramedata;
93
@@ -204,11 +207,11 @@
94
         }
95
     }
96
 
97
-    if ((m_param->analysisSave || m_param->analysisLoad) && m_slice->m_sliceType != I_SLICE && m_param->analysisReuseLevel > 1 && m_param->analysisReuseLevel < 10)
98
+    if (m_param->analysisReuseMode && 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
@@ -216,7 +219,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->analysisSave && !m_param->analysisLoad)
112
+        if (m_param->analysisReuseMode == X265_ANALYSIS_SAVE)
113
             for (int i = 0; i < X265_MAX_PRED_MODE_PER_CTU * numPredDir; i++)
114
                 m_reuseRef[i] = -1;
115
     }
116
@@ -225,7 +228,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->analysisLoad && m_param->analysisReuseLevel > 1)
121
+        if (m_param->analysisReuseMode == X265_ANALYSIS_LOAD && 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
@@ -236,7 +239,7 @@
126
     }
127
     else
128
     {
129
-        bool bCopyAnalysis = ((m_param->analysisLoad && m_param->analysisReuseLevel == 10) || (m_param->bMVType && m_param->analysisReuseLevel >= 7 && ctu.m_numPartitions <= 16));
130
+        bool bCopyAnalysis = ((m_param->analysisReuseMode == X265_ANALYSIS_LOAD && 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
@@ -277,7 +280,7 @@
135
             /* generate residual for entire CTU at once and copy to reconPic */
136
             encodeResidue(ctu, cuGeom);
137
         }
138
-        else if ((m_param->analysisLoad && m_param->analysisReuseLevel == 10) || ((m_param->bMVType == AVC_INFO) && m_param->analysisReuseLevel >= 7 && ctu.m_numPartitions <= 16))
139
+        else if ((m_param->analysisReuseMode == X265_ANALYSIS_LOAD && m_param->analysisReuseLevel == 10) || ((m_param->bMVType == AVC_INFO) && m_param->analysisReuseLevel >= 7))
140
         {
141
             analysis_inter_data* interDataCTU = (analysis_inter_data*)m_frame->m_analysisData.interData;
142
             int posCTU = ctu.m_cuAddr * numPartition;
143
@@ -456,9 +459,11 @@
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 >= 7)
150
+    if (m_param->analysisReuseLevel == 10)
151
         doQPRefine = false;
152
+
153
     if (doQPRefine)
154
     {
155
         uint64_t bestCUCost, origCUCost, cuCost, cuPrevCost;
156
@@ -647,12 +652,13 @@
157
         cacheCost[cuIdx] = md.bestMode->rdCost;
158
     }
159
 
160
-    if ((m_limitTU & X265_TU_LIMIT_NEIGH) && cuGeom.log2CUSize >= 4)
161
+    /* Save Intra CUs TU depth only when analysis mode is OFF */
162
+    if ((m_limitTU & X265_TU_LIMIT_NEIGH) && cuGeom.log2CUSize >= 4 && !m_param->analysisReuseMode)
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.bestMode->cu.m_tuDepth[i]);
168
+            maxTUDepth = X265_MAX(maxTUDepth, md.pred[PRED_INTRA].cu.m_tuDepth[i]);
169
         ctu->m_refTuDepth[cuGeom.geomRecurId] = maxTUDepth;
170
     }
171
 
172
@@ -1259,7 +1265,7 @@
173
                 mightSplit &= !bDecidedDepth;
174
             }
175
         }
176
-        if ((m_param->analysisLoad && m_param->analysisReuseLevel > 1 && m_param->analysisReuseLevel != 10))
177
+        if ((m_param->analysisReuseMode == X265_ANALYSIS_LOAD && m_param->analysisReuseLevel > 1 && m_param->analysisReuseLevel != 10))
178
         {
179
             if (mightNotSplit && depth == m_reuseDepth[cuGeom.absPartIdx])
180
             {
181
@@ -1299,8 +1305,9 @@
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_param->analysisReuseLevel == 7 && (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_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
@@ -1310,7 +1317,8 @@
193
                 skipModes = (m_param->bEnableEarlySkip || m_param->interRefine == 2)
194
                 && md.bestMode && md.bestMode->cu.isSkipped(0); // TODO: sa8d threshold per depth
195
         }
196
-        if (md.bestMode && m_param->bEnableRecursionSkip && !bCtuInfoCheck && !(m_param->bMVType && m_param->analysisReuseLevel == 7 && (m_modeFlag[0] || m_modeFlag[1])))
197
+
198
+        if (md.bestMode && m_param->bEnableRecursionSkip && !bCtuInfoCheck && !(m_param->bMVType && (m_modeFlag[0] || m_modeFlag[1])))
199
         {
200
             skipRecursion = md.bestMode->cu.isSkipped(0);
201
x265_2.7.tar.gz/source/encoder/api.cpp -> x265_2.6.tar.gz/source/encoder/api.cpp Changed
201
 
1
@@ -67,7 +67,9 @@
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
+    "B count, B ave-QP, B kbps, B-PSNR Y, B-PSNR U, B-PSNR V, B-SSIM (dB), "
7
+    "MaxCLL, MaxFALL, Version\n";
8
+
9
 x265_encoder *x265_encoder_open(x265_param *p)
10
 {
11
     if (!p)
12
@@ -190,10 +192,9 @@
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
@@ -310,9 +311,7 @@
25
         Encoder *encoder = static_cast<Encoder*>(enc);
26
         x265_stats stats;
27
         encoder->fetchStats(&stats, sizeof(stats));
28
-        int padx = encoder->m_sps.conformanceWindow.rightOffset;
29
-        int pady = encoder->m_sps.conformanceWindow.bottomOffset;
30
-        x265_csvlog_encode(encoder->m_param, &stats, padx, pady, argc, argv);
31
+        x265_csvlog_encode(enc, &stats, argc, argv);
32
     }
33
 }
34
 
35
@@ -357,13 +356,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, int* pocL0, int* pocL1)
40
+int x265_get_ref_frame_list(x265_encoder *enc, x265_picyuv** l0, x265_picyuv** l1, int sliceType, int poc)
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, pocL0, pocL1);
47
+    return encoder->getRefFrameList((PicYuv**)l0, (PicYuv**)l1, sliceType, poc);
48
 }
49
 
50
 int x265_set_analysis_data(x265_encoder *enc, x265_analysis_data *analysis_data, int poc, uint32_t cuBytes)
51
@@ -399,7 +398,7 @@
52
     pic->userSEI.payloads = NULL;
53
     pic->userSEI.numPayloads = 0;
54
 
55
-    if ((param->analysisSave || param->analysisLoad) || (param->bMVType == AVC_INFO))
56
+    if (param->analysisReuseMode || (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
@@ -755,12 +754,7 @@
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
@@ -873,40 +867,45 @@
74
     fflush(stderr);
75
 }
76
 
77
-void x265_csvlog_encode(const x265_param *p, const x265_stats *stats, int padx, int pady, int argc, char** argv)
78
+void x265_csvlog_encode(x265_encoder *enc, const x265_stats* stats, int argc, char** argv)
79
 {
80
-    if (p && p->csvfpt)
81
+    if (enc)
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 (p->csvLogLevel)
89
+        if (!encoder->m_param->csvfpt)
90
+            return;
91
+
92
+        if (encoder->m_param->csvLogLevel)
93
         {
94
             // adding summary to a per-frame csv log file, so it needs a summary header
95
-            fprintf(p->csvfpt, "\nSummary\n");
96
-            fputs(summaryCSVHeader, p->csvfpt);
97
-            if (p->csvLogLevel >= 2 || p->maxCLL || p->maxFALL)
98
-                fputs("MaxCLL, MaxFALL,", p->csvfpt);
99
-            fputs(" Version\n",p->csvfpt);
100
+            fprintf(encoder->m_param->csvfpt, "\nSummary\n");
101
+            fputs(summaryCSVHeader, encoder->m_param->csvfpt);
102
         }
103
+
104
         // CLI arguments or other
105
         if (argc)
106
         {
107
-            fputc('"', p->csvfpt);
108
+            fputc('"', encoder->m_param->csvfpt);
109
             for (int i = 1; i < argc; i++)
110
             {
111
-                fputc(' ', p->csvfpt);
112
-                fputs(argv[i], p->csvfpt);
113
+                fputc(' ', encoder->m_param->csvfpt);
114
+                fputs(argv[i], encoder->m_param->csvfpt);
115
             }
116
-            fputc('"', p->csvfpt);
117
+            fputc('"', encoder->m_param->csvfpt);
118
         }
119
         else
120
         {
121
-            char *opts = x265_param2string((x265_param*)p, padx, pady);
122
+            const x265_param* paramTemp = encoder->m_param;
123
+            char *opts = x265_param2string((x265_param*)paramTemp, padx, pady);
124
             if (opts)
125
             {
126
-                fputc('"', p->csvfpt);
127
-                fputs(opts, p->csvfpt);
128
-                fputc('"', p->csvfpt);
129
+                fputc('"', encoder->m_param->csvfpt);
130
+                fputs(opts, encoder->m_param->csvfpt);
131
+                fputc('"', encoder->m_param->csvfpt);
132
             }
133
         }
134
 
135
@@ -917,70 +916,69 @@
136
         timeinfo = localtime(&now);
137
         char buffer[200];
138
         strftime(buffer, 128, "%c", timeinfo);
139
-        fprintf(p->csvfpt, ", %s, ", buffer);
140
+        fprintf(encoder->m_param->csvfpt, ", %s, ", buffer);
141
 
142
         // elapsed time, fps, bitrate
143
-        fprintf(p->csvfpt, "%.2f, %.2f, %.2f,",
144
+        fprintf(encoder->m_param->csvfpt, "%.2f, %.2f, %.2f,",
145
             stats->elapsedEncodeTime, stats->encodedPictureCount / stats->elapsedEncodeTime, stats->bitrate);
146
 
147
-        if (p->bEnablePsnr)
148
-            fprintf(p->csvfpt, " %.3lf, %.3lf, %.3lf, %.3lf,",
149
+        if (encoder->m_param->bEnablePsnr)
150
+            fprintf(encoder->m_param->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(p->csvfpt, " -, -, -, -,");
155
-        if (p->bEnableSsim)
156
-            fprintf(p->csvfpt, " %.6f, %6.3f,", stats->globalSsim, x265_ssim2dB(stats->globalSsim));
157
+            fprintf(encoder->m_param->csvfpt, " -, -, -, -,");
158
+        if (encoder->m_param->bEnableSsim)
159
+            fprintf(encoder->m_param->csvfpt, " %.6f, %6.3f,", stats->globalSsim, x265_ssim2dB(stats->globalSsim));
160
         else
161
-            fprintf(p->csvfpt, " -, -,");
162
+            fprintf(encoder->m_param->csvfpt, " -, -,");
163
 
164
         if (stats->statsI.numPics)
165
         {
166
-            fprintf(p->csvfpt, " %-6u, %2.2lf, %-8.2lf,", stats->statsI.numPics, stats->statsI.avgQp, stats->statsI.bitrate);
167
-            if (p->bEnablePsnr)
168
-                fprintf(p->csvfpt, " %.3lf, %.3lf, %.3lf,", stats->statsI.psnrY, stats->statsI.psnrU, stats->statsI.psnrV);
169
+            fprintf(encoder->m_param->csvfpt, " %-6u, %2.2lf, %-8.2lf,", stats->statsI.numPics, stats->statsI.avgQp, stats->statsI.bitrate);
170
+            if (encoder->m_param->bEnablePsnr)
171
+                fprintf(encoder->m_param->csvfpt, " %.3lf, %.3lf, %.3lf,", stats->statsI.psnrY, stats->statsI.psnrU, stats->statsI.psnrV);
172
             else
173
-                fprintf(p->csvfpt, " -, -, -,");
174
-            if (p->bEnableSsim)
175
-                fprintf(p->csvfpt, " %.3lf,", stats->statsI.ssim);
176
+                fprintf(encoder->m_param->csvfpt, " -, -, -,");
177
+            if (encoder->m_param->bEnableSsim)
178
+                fprintf(encoder->m_param->csvfpt, " %.3lf,", stats->statsI.ssim);
179
             else
180
-                fprintf(p->csvfpt, " -,");
181
+                fprintf(encoder->m_param->csvfpt, " -,");
182
         }
183
         else
184
-            fprintf(p->csvfpt, " -, -, -, -, -, -, -,");
185
+            fprintf(encoder->m_param->csvfpt, " -, -, -, -, -, -, -,");
186
 
187
         if (stats->statsP.numPics)
188
         {
189
-            fprintf(p->csvfpt, " %-6u, %2.2lf, %-8.2lf,", stats->statsP.numPics, stats->statsP.avgQp, stats->statsP.bitrate);
190
-            if (p->bEnablePsnr)
191
-                fprintf(p->csvfpt, " %.3lf, %.3lf, %.3lf,", stats->statsP.psnrY, stats->statsP.psnrU, stats->statsP.psnrV);
192
+            fprintf(encoder->m_param->csvfpt, " %-6u, %2.2lf, %-8.2lf,", stats->statsP.numPics, stats->statsP.avgQp, stats->statsP.bitrate);
193
+            if (encoder->m_param->bEnablePsnr)
194
+                fprintf(encoder->m_param->csvfpt, " %.3lf, %.3lf, %.3lf,", stats->statsP.psnrY, stats->statsP.psnrU, stats->statsP.psnrV);
195
             else
196
-                fprintf(p->csvfpt, " -, -, -,");
197
-            if (p->bEnableSsim)
198
-                fprintf(p->csvfpt, " %.3lf,", stats->statsP.ssim);
199
+                fprintf(encoder->m_param->csvfpt, " -, -, -,");
200
+            if (encoder->m_param->bEnableSsim)
201
x265_2.7.tar.gz/source/encoder/dpb.cpp -> x265_2.6.tar.gz/source/encoder/dpb.cpp Changed
57
 
1
@@ -92,14 +92,19 @@
2
             m_freeList.pushBack(*curFrame);
3
             curFrame->m_encData->m_freeListNext = m_frameDataFreeList;
4
             m_frameDataFreeList = curFrame->m_encData;
5
-            for (int i = 0; i < INTEGRAL_PLANE_NUM; i++)
6
+
7
+            if (curFrame->m_encData->m_meBuffer)
8
             {
9
-                if (curFrame->m_encData->m_meBuffer[i] != NULL)
10
+                for (int i = 0; i < INTEGRAL_PLANE_NUM; i++)
11
                 {
12
-                    X265_FREE(curFrame->m_encData->m_meBuffer[i]);
13
-                    curFrame->m_encData->m_meBuffer[i] = NULL;
14
+                    if (curFrame->m_encData->m_meBuffer[i] != NULL)
15
+                    {
16
+                        X265_FREE(curFrame->m_encData->m_meBuffer[i]);
17
+                        curFrame->m_encData->m_meBuffer[i] = NULL;
18
+                    }
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
@@ -176,10 +181,7 @@
26
     // Mark pictures in m_piclist as unreferenced if they are not included in RPS
27
     applyReferencePictureSet(&slice->m_rps, pocCurr);
28
 
29
-    if (slice->m_sliceType != I_SLICE)
30
-        slice->m_numRefIdx[0] = x265_clip3(1, newFrame->m_param->maxNumReferences, slice->m_rps.numberOfNegativePictures);
31
-    else
32
-        slice->m_numRefIdx[0] = X265_MIN(newFrame->m_param->maxNumReferences, slice->m_rps.numberOfNegativePictures); // Ensuring L0 contains just the -ve POC
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
@@ -228,14 +230,11 @@
38
     {
39
         if ((iterPic->m_poc != curPoc) && iterPic->m_encData->m_bHasReferences)
40
         {
41
-            if ((m_lastIDR >= curPoc) || (m_lastIDR <= iterPic->m_poc))
42
-            {
43
-                    rps->poc[poci] = iterPic->m_poc;
44
-                    rps->deltaPOC[poci] = rps->poc[poci] - curPoc;
45
-                    (rps->deltaPOC[poci] < 0) ? numNeg++ : numPos++;
46
-                    rps->bUsed[poci] = !isRAP;
47
-                    poci++;
48
-            }
49
+            rps->poc[poci] = iterPic->m_poc;
50
+            rps->deltaPOC[poci] = rps->poc[poci] - curPoc;
51
+            (rps->deltaPOC[poci] < 0) ? numNeg++ : numPos++;
52
+            rps->bUsed[poci] = !isRAP;
53
+            poci++;
54
         }
55
         iterPic = iterPic->m_next;
56
     }
57
x265_2.7.tar.gz/source/encoder/encoder.cpp -> x265_2.6.tar.gz/source/encoder/encoder.cpp Changed
201
 
1
@@ -50,8 +50,10 @@
2
 
3
 /* Threshold for motion vection, based on expermental result.
4
  * TODO: come up an algorithm for adoptive threshold */
5
-#define MVTHRESHOLD (10*10)
6
+
7
+#define MVTHRESHOLD 10
8
 #define PU_2Nx2N 1
9
+
10
 static const char* defaultAnalysisFileName = "x265_analysis.dat";
11
 
12
 using namespace X265_NS;
13
@@ -77,6 +79,7 @@
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
@@ -341,29 +344,19 @@
22
         m_aborted = true;
23
     if (!m_lookahead->create())
24
         m_aborted = true;
25
+
26
     initRefIdx();
27
-    if (m_param->analysisSave && m_param->bUseAnalysisFile)
28
-    {
29
-        char* temp = strcatFilename(m_param->analysisSave, ".temp");
30
-        if (!temp)
31
-            m_aborted = true;
32
-        else
33
-        {
34
-            m_analysisFileOut = x265_fopen(temp, "wb");
35
-            X265_FREE(temp);
36
-        }
37
-        if (!m_analysisFileOut)
38
-        {
39
-            x265_log_file(NULL, X265_LOG_ERROR, "Analysis save: failed to open file %s.temp\n", m_param->analysisSave);
40
-            m_aborted = true;
41
-        }
42
-    }
43
-    if (m_param->analysisLoad && m_param->bUseAnalysisFile)
44
+
45
+    if (m_param->analysisReuseMode)
46
     {
47
-        m_analysisFileIn = x265_fopen(m_param->analysisLoad, "rb");
48
-        if (!m_analysisFileIn)
49
+        const char* name = m_param->analysisReuseFileName;
50
+        if (!name)
51
+            name = defaultAnalysisFileName;
52
+        const char* mode = m_param->analysisReuseMode == X265_ANALYSIS_LOAD ? "rb" : "wb";
53
+        m_analysisFile = x265_fopen(name, mode);
54
+        if (!m_analysisFile)
55
         {
56
-            x265_log_file(NULL, X265_LOG_ERROR, "Analysis load: failed to open file %s\n", m_param->analysisLoad);
57
+            x265_log_file(NULL, X265_LOG_ERROR, "Analysis load/save: failed to open file %s\n", name);
58
             m_aborted = true;
59
         }
60
     }
61
@@ -457,7 +450,7 @@
62
     return 0;
63
 }
64
 
65
-int Encoder::getRefFrameList(PicYuv** l0, PicYuv** l1, int sliceType, int poc, int* pocL0, int* pocL1)
66
+int Encoder::getRefFrameList(PicYuv** l0, PicYuv** l1, int sliceType, int poc)
67
 {
68
     if (!(IS_X265_TYPE_I(sliceType)))
69
     {
70
@@ -469,10 +462,9 @@
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
-                    while (l0Fp->m_reconRowFlag[l0Fp->m_numRows - 1].get() == 0)
77
-                        l0Fp->m_reconRowFlag[l0Fp->m_numRows - 1].waitForChange(0); /* If recon is not ready, current frame encoder has to wait. */
78
+                    if (l0Fp->m_reconPic->m_picOrg[0] == NULL)
79
+                        l0Fp->m_reconEncoded.wait(); /* If recon is not ready, current frame encoder need to wait. */
80
                     l0[j] = l0Fp->m_reconPic;
81
                 }
82
             }
83
@@ -481,19 +473,15 @@
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
-                    while (l1Fp->m_reconRowFlag[l1Fp->m_numRows - 1].get() == 0)
90
-                        l1Fp->m_reconRowFlag[l1Fp->m_numRows - 1].waitForChange(0); /* If recon is not ready, current frame encoder has to wait. */
91
+                    if (l1Fp->m_reconPic->m_picOrg[0] == NULL)
92
+                        l1Fp->m_reconEncoded.wait(); /* If recon is not ready, current frame encoder need to wait. */
93
                     l1[j] = l1Fp->m_reconPic;
94
                 }
95
             }
96
         }
97
         else
98
-        {
99
-            x265_log(NULL, X265_LOG_WARNING, "Current frame is not in DPB piclist.\n");
100
-            return 1;
101
-        }
102
+            x265_log(NULL, X265_LOG_WARNING, "Refrence List is not in piclist\n");
103
     }
104
     else
105
     {
106
@@ -576,19 +564,19 @@
107
                     {
108
                         int cuOffset = cuI * bytes + pu;
109
                         (interData)->mergeFlag[cuPos + cuOffset] = (srcInterData)->mergeFlag[(mbIndex * 16) + cuOffset];
110
-                        (interData)->sadCost[cuPos + cuOffset] = (srcInterData)->sadCost[(mbIndex * 16) + cuOffset];
111
+
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 && numPU == PU_2Nx2N &&
119
-                                ((interData)->depth[cuPos + cuOffset] == (m_param->maxCUSize >> 5)))
120
+                            if (m_param->analysisReuseLevel == 7)
121
                             {
122
-                                int mv_x = (interData)->mv[k][cuPos + cuOffset].x;
123
-                                int mv_y = (interData)->mv[k][cuPos + cuOffset].y;
124
-                                if ((mv_x*mv_x + mv_y*mv_y) <= MVTHRESHOLD)
125
+                                int mv_x = ((analysis_inter_data *)curFrame->m_analysisData.interData)->mv[k][(mbIndex * 16) + cuOffset].x;
126
+                                int mv_y = ((analysis_inter_data *)curFrame->m_analysisData.interData)->mv[k][(mbIndex * 16) + cuOffset].y;
127
+                                double mv = sqrt(mv_x*mv_x + mv_y*mv_y);
128
+                                if (numPU == PU_2Nx2N && ((srcInterData)->depth[cuPos + cuOffset] == (m_param->maxCUSize >> 5)) && mv <= MVTHRESHOLD)
129
                                     memset(&curFrame->m_analysisData.modeFlag[k][cuPos + cuOffset], 1, bytes);
130
                             }
131
                         }
132
@@ -654,10 +642,9 @@
133
                     if (m_param->analysisReuseLevel > 4)
134
                     {
135
                         memset(&(currInterData)->partSize[count], (interData)->partSize[d], bytes);
136
-                        int numPU = nbPartsTable[(interData)->partSize[d]];
137
-                        for (int pu = 0; pu < numPU; pu++)
138
+                        int numPU = nbPartsTable[(currInterData)->partSize[d]];
139
+                        for (int pu = 0; pu < numPU; pu++, d++)
140
                         {
141
-                            if (pu) d++;
142
                             (currInterData)->mergeFlag[count + pu] = (interData)->mergeFlag[d];
143
                             if (m_param->analysisReuseLevel >= 7)
144
                             {
145
@@ -667,11 +654,12 @@
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 && numPU == PU_2Nx2N && m_param->num4x4Partitions <= 16)
150
+                                    if (m_param->analysisReuseLevel == 7)
151
                                     {
152
-                                        int mv_x = (currInterData)->mv[i][count + pu].x;
153
-                                        int mv_y = (currInterData)->mv[i][count + pu].y;
154
-                                        if ((mv_x*mv_x + mv_y*mv_y) <= MVTHRESHOLD)
155
+                                        int mv_x = ((analysis_inter_data *)curFrame->m_analysisData.interData)->mv[i][count + pu].x;
156
+                                        int mv_y = ((analysis_inter_data *)curFrame->m_analysisData.interData)->mv[i][count + pu].y;
157
+                                        double mv = sqrt(mv_x*mv_x + mv_y*mv_y);
158
+                                        if (numPU == PU_2Nx2N && m_param->num4x4Partitions <= 16 && mv <= MVTHRESHOLD)
159
                                             memset(&curFrame->m_analysisData.modeFlag[i][count + pu], 1, bytes);
160
                                     }
161
                                 }
162
@@ -732,6 +720,9 @@
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
@@ -746,7 +737,7 @@
173
     {
174
         int bError = 1;
175
         fclose(m_analysisFileOut);
176
-        const char* name = m_param->analysisSave ? m_param->analysisSave : m_param->analysisReuseFileName;
177
+        const char* name = m_param->analysisReuseFileName;
178
         if (!name)
179
             name = defaultAnalysisFileName;
180
         char* temp = strcatFilename(name, ".temp");
181
@@ -774,8 +765,6 @@
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
@@ -862,7 +851,7 @@
191
 
192
     if (m_exportedPic)
193
     {
194
-        if (!m_param->bUseAnalysisFile && m_param->analysisSave)
195
+        if (!m_param->bUseAnalysisFile && m_param->analysisReuseMode == X265_ANALYSIS_SAVE)
196
             freeAnalysis(&m_exportedPic->m_analysisData);
197
         ATOMIC_DEC(&m_exportedPic->m_countRefEncoders);
198
         m_exportedPic = NULL;
199
@@ -1047,7 +1036,7 @@
200
 
201
x265_2.7.tar.gz/source/encoder/encoder.h -> x265_2.6.tar.gz/source/encoder/encoder.h Changed
18
 
1
@@ -130,6 +130,7 @@
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
@@ -207,7 +208,7 @@
10
 
11
     int copySlicetypePocAndSceneCut(int *slicetype, int *poc, int *sceneCut);
12
 
13
-    int getRefFrameList(PicYuv** l0, PicYuv** l1, int sliceType, int poc, int* pocL0, int* pocL1);
14
+    int getRefFrameList(PicYuv** l0, PicYuv** l1, int sliceType, int poc);
15
 
16
     int setAnalysisDataAfterZScan(x265_analysis_data *analysis_data, Frame* curFrame);
17
 
18
x265_2.7.tar.gz/source/encoder/frameencoder.cpp -> x265_2.6.tar.gz/source/encoder/frameencoder.cpp Changed
74
 
1
@@ -335,13 +335,15 @@
2
             while (!m_frame->m_ctuInfo)
3
                 m_frame->m_copied.wait();
4
         }
5
-        if ((m_param->bMVType == AVC_INFO) && !m_param->analysisSave && !m_param->analysisLoad && !(IS_X265_TYPE_I(m_frame->m_lowres.sliceType)))
6
+        if ((m_param->bMVType == AVC_INFO) && !m_param->analysisReuseMode && !(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
@@ -430,7 +432,7 @@
19
     bool bUseWeightB = slice->m_sliceType == B_SLICE && slice->m_pps->bUseWeightedBiPred;
20
 
21
     WeightParam* reuseWP = NULL;
22
-    if (m_param->analysisLoad && (bUseWeightP || bUseWeightB))
23
+    if (m_param->analysisReuseMode && (bUseWeightP || bUseWeightB))
24
         reuseWP = (WeightParam*)m_frame->m_analysisData.wt;
25
 
26
     if (bUseWeightP || bUseWeightB)
27
@@ -439,7 +441,7 @@
28
         m_cuStats.countWeightAnalyze++;
29
         ScopedElapsedTime time(m_cuStats.weightAnalyzeTime);
30
 #endif
31
-        if (m_param->analysisLoad)
32
+        if (m_param->analysisReuseMode == X265_ANALYSIS_LOAD)
33
         {
34
             for (int list = 0; list < slice->isInterB() + 1; list++) 
35
             {
36
@@ -466,8 +468,6 @@
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->analysisSave && (bUseWeightP || bUseWeightB))
50
+        if (m_param->analysisReuseMode == X265_ANALYSIS_SAVE && (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->analysisLoad || !m_param->bDisableLookahead)
59
+            if (m_param->analysisReuseMode != X265_ANALYSIS_LOAD || !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 && !(m_param->rc.bEnableConstVbv && m_param->bEnableWavefront))
68
-            {          
69
+            if (bIsVbv)
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.7.tar.gz/source/encoder/framefilter.cpp -> x265_2.6.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_lowres.sliceType != X265_TYPE_B)
6
+    if (m_frame->m_encData->m_meIntegral && 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.7.tar.gz/source/encoder/ratecontrol.cpp -> x265_2.6.tar.gz/source/encoder/ratecontrol.cpp Changed
26
 
1
@@ -219,7 +219,6 @@
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
@@ -320,7 +319,7 @@
10
 
11
 bool RateControl::init(const SPS& sps)
12
 {
13
-    if (m_isVbv && !m_initVbv)
14
+    if (m_isVbv)
15
     {
16
         /* We don't support changing the ABR bitrate right now,
17
          * so if the stream starts as CBR, keep it CBR. */
18
@@ -354,7 +353,6 @@
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.7.tar.gz/source/encoder/ratecontrol.h -> x265_2.6.tar.gz/source/encoder/ratecontrol.h Changed
9
 
1
@@ -132,7 +132,6 @@
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.7.tar.gz/source/encoder/sao.h -> x265_2.6.tar.gz/source/encoder/sao.h Changed
16
 
1
@@ -55,9 +55,12 @@
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
-    typedef int32_t PerClass[MAX_NUM_SAO_TYPE][MAX_NUM_SAO_CLASS];
8
-    typedef int32_t PerPlane[NUM_PLANE][MAX_NUM_SAO_TYPE][MAX_NUM_SAO_CLASS];
9
+
10
+    typedef int32_t (PerClass[MAX_NUM_SAO_TYPE][MAX_NUM_SAO_CLASS]);
11
+    typedef int32_t (PerPlane[NUM_PLANE][MAX_NUM_SAO_TYPE][MAX_NUM_SAO_CLASS]);
12
+
13
 protected:
14
 
15
     /* allocated per part */
16
x265_2.7.tar.gz/source/encoder/search.cpp -> x265_2.6.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];
6
+    MV* mvs = m_frame->m_lowres.lowresMvs[list][diffPoc - 1];
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->analysisSave && !m_param->analysisLoad) /* Prevents load/save outputs from diverging if lowresMV is not available */
15
+    if (!m_param->analysisReuseMode) /* 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->analysisLoad && m_param->analysisReuseLevel > 1 && m_param->analysisReuseLevel != 10)
24
+        if ((m_param->analysisReuseMode == X265_ANALYSIS_LOAD && 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->analysisSave && !m_param->analysisLoad) /* Prevents load/save outputs from diverging when lowresMV is not available */
33
+                    if (!m_param->analysisReuseMode) /* 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.7.tar.gz/source/encoder/slicetype.cpp -> x265_2.6.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) || (param->rc.bStatRead && param->rc.cuTree && IS_REFERENCED(curFrame)))
6
+    if (param->rc.aqMode == X265_AQ_NONE || param->rc.aqStrength == 0)
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
-    m_extendGopBoundary = false;
15
+
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,11 +646,7 @@
20
         m_numRowsPerSlice = m_8x8Height;
21
         m_numCoopSlices = 1;
22
     }
23
-    if (param->gopLookahead && (param->gopLookahead > (param->lookaheadDepth - param->bframes - 2)))
24
-    {
25
-        param->gopLookahead = X265_MAX(0, param->lookaheadDepth - param->bframes - 2);
26
-        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);
27
-    }
28
+
29
 #if DETAILED_CU_STATS
30
     m_slicetypeDecideElapsedTime = 0;
31
     m_preLookaheadElapsedTime = 0;
32
@@ -746,7 +742,7 @@
33
 /* Called by API thread */
34
 void Lookahead::addPicture(Frame& curFrame, int sliceType)
35
 {
36
-    if (m_param->analysisLoad && m_param->bDisableLookahead)
37
+    if (m_param->analysisReuseMode == X265_ANALYSIS_LOAD && m_param->bDisableLookahead)
38
     {
39
         if (!m_filled)
40
             m_filled = true;
41
@@ -847,7 +843,7 @@
42
             return out;
43
         }
44
 
45
-        if (m_param->analysisLoad && m_param->bDisableLookahead)
46
+        if (m_param->analysisReuseMode == X265_ANALYSIS_LOAD && m_param->bDisableLookahead)
47
             return NULL;
48
 
49
         findJob(-1); /* run slicetypeDecide() if necessary */
50
@@ -879,7 +875,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_rps.numberOfNegativePictures ? slice->m_refPOCList[0][0] : -1;
55
+    int l0poc = slice->m_refPOCList[0][0];
56
     int l1poc = slice->m_refPOCList[1][0];
57
 
58
     switch (slice->m_sliceType)
59
@@ -896,34 +892,23 @@
60
         break;
61
 
62
     case B_SLICE:
63
-        if (l0poc >= 0)
64
-        {
65
-            b = poc - l0poc;
66
-            p1 = b + l1poc - poc;
67
-            frames[p0] = &slice->m_refFrameList[0][0]->m_lowres;
68
-            frames[b] = &curFrame->m_lowres;
69
-            frames[p1] = &slice->m_refFrameList[1][0]->m_lowres;
70
-        }
71
-        else 
72
-        {
73
-            p0 = b = 0;
74
-            p1 = b + l1poc - poc;
75
-            frames[p0] = frames[b] = &curFrame->m_lowres;
76
-            frames[p1] = &slice->m_refFrameList[1][0]->m_lowres;
77
-        }
78
-        
79
+        b = poc - l0poc;
80
+        p1 = b + l1poc - poc;
81
+        frames[p0] = &slice->m_refFrameList[0][0]->m_lowres;
82
+        frames[b] = &curFrame->m_lowres;
83
+        frames[p1] = &slice->m_refFrameList[1][0]->m_lowres;
84
         break;
85
 
86
     default:
87
         return;
88
     }
89
-    if (!m_param->analysisLoad || !m_param->bDisableLookahead)
90
+    if (m_param->analysisReuseMode != X265_ANALYSIS_LOAD || !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->analysisLoad || m_param->scaleFactor)
97
+        else if (m_param->analysisReuseMode != X265_ANALYSIS_LOAD || m_param->scaleFactor)
98
         {
99
             if (m_param->rc.aqMode)
100
                 curFrame->m_lowres.satdCost = curFrame->m_lowres.costEstAq[b - p0][p1 - b];
101
@@ -997,8 +982,11 @@
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_bAdaptiveQuant)
108
+        if (m_lookahead.m_param->rc.bStatRead && m_lookahead.m_param->rc.cuTree && IS_REFERENCED(preFrame))
109
+            /* cu-tree offsets were read from stats file */;
110
+        else 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
@@ -1064,7 +1052,7 @@
115
     {
116
         slicetypeAnalyse(frames, false);
117
         bool bIsVbv = m_param->rc.vbvBufferSize > 0 && m_param->rc.vbvMaxBitrate > 0;
118
-        if (m_param->analysisLoad && m_param->scaleFactor && bIsVbv)
119
+        if (m_param->analysisReuseMode == X265_ANALYSIS_LOAD && m_param->scaleFactor && bIsVbv)
120
         {
121
             int numFrames;
122
             for (numFrames = 0; numFrames < maxSearch; numFrames++)
123
@@ -1098,8 +1086,7 @@
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
-            (!m_extendGopBoundary || frm.frameNum - m_lastKeyframe >= m_param->keyframeMax + m_param->gopLookahead))
129
+        if ((!m_param->bIntraRefresh || frm.frameNum == 0) && frm.frameNum - m_lastKeyframe >= m_param->keyframeMax)
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
@@ -1128,20 +1115,12 @@
134
             /* Closed GOP */
135
             m_lastKeyframe = frm.frameNum;
136
             frm.bKeyframe = true;
137
-            if (bframes > 0 && !m_param->radl)
138
+            if (bframes > 0)
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
@@ -1191,13 +1170,8 @@
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
@@ -1207,10 +1181,7 @@
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
@@ -1234,8 +1205,9 @@
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 (brefs)
187
+    if (bframes > 1 && m_param->bBPyramid)
188
     {
189
         for (int i = 0; i < bframes; i++)
190
         {
191
@@ -1275,7 +1247,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->analysisLoad && m_param->scaleFactor && bIsVbv)
196
+        if (m_param->analysisReuseMode == X265_ANALYSIS_LOAD && m_param->scaleFactor && bIsVbv)
197
         {
198
             int numFrames;
199
             for (numFrames = 0; numFrames < maxSearch; numFrames++)
200
@@ -1405,14 +1377,12 @@
201
x265_2.7.tar.gz/source/encoder/slicetype.h -> x265_2.6.tar.gz/source/encoder/slicetype.h Changed
9
 
1
@@ -132,7 +132,6 @@
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.7.tar.gz/source/encoder/weightPrediction.cpp -> x265_2.6.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];
6
+                mvs = fenc.lowresMvs[list][diffPoc - 1];
7
 
8
                 /* test whether this motion search was performed by lookahead */
9
                 if (mvs[0].x != 0x7FFF)
10
x265_2.7.tar.gz/source/input/y4m.cpp -> x265_2.6.tar.gz/source/input/y4m.cpp Changed
201
 
1
@@ -20,8 +20,7 @@
2
  * This program is also available under a commercial proprietary license.
3
  * For more information, contact us at license @ x265.com.
4
  *****************************************************************************/
5
-#define _FILE_OFFSET_BITS 64
6
-#define _LARGEFILE_SOURCE
7
+
8
 #include "y4m.h"
9
 #include "common.h"
10
 
11
@@ -39,7 +38,9 @@
12
 
13
 using namespace X265_NS;
14
 using namespace std;
15
-static const char header[] = {'F','R','A','M','E'};
16
+
17
+static const char header[] = "FRAME";
18
+
19
 Y4MInput::Y4MInput(InputFileInfo& info)
20
 {
21
     for (int i = 0; i < QUEUE_SIZE; i++)
22
@@ -59,14 +60,15 @@
23
     ifs = NULL;
24
     if (!strcmp(info.filename, "-"))
25
     {
26
-        ifs = stdin;
27
+        ifs = &cin;
28
 #if _WIN32
29
         setmode(fileno(stdin), O_BINARY);
30
 #endif
31
     }
32
     else
33
-        ifs = x265_fopen(info.filename, "rb");
34
-    if (ifs && !ferror(ifs) && parseHeader())
35
+        ifs = new ifstream(info.filename, ios::binary | ios::in);
36
+
37
+    if (ifs && ifs->good() && parseHeader())
38
     {
39
         int pixelbytes = depth > 8 ? 2 : 1;
40
         for (int i = 0; i < x265_cli_csps[colorSpace].planes; i++)
41
@@ -89,8 +91,8 @@
42
     }
43
     if (!threadActive)
44
     {
45
-        if (ifs && ifs != stdin)
46
-            fclose(ifs);
47
+        if (ifs && ifs != &cin)
48
+            delete ifs;
49
         ifs = NULL;
50
         return;
51
     }
52
@@ -104,34 +106,61 @@
53
     info.csp = colorSpace;
54
     info.depth = depth;
55
     info.frameCount = -1;
56
-    size_t estFrameSize = framesize + sizeof(header) + 1; /* assume basic FRAME\n headers */
57
+
58
+    size_t estFrameSize = framesize + strlen(header) + 1; /* assume basic FRAME\n headers */
59
+
60
     /* try to estimate frame count, if this is not stdin */
61
-    if (ifs != stdin)
62
+    if (ifs != &cin)
63
     {
64
-        int64_t cur = ftello(ifs);
65
+        istream::pos_type cur = ifs->tellg();
66
+
67
+#if defined(_MSC_VER) && _MSC_VER < 1700
68
+        /* Older MSVC versions cannot handle 64bit file sizes properly, so go native */
69
+        HANDLE hFile = CreateFileA(info.filename, GENERIC_READ,
70
+                                   FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING,
71
+                                   FILE_ATTRIBUTE_NORMAL, NULL);
72
+        if (hFile != INVALID_HANDLE_VALUE)
73
+        {
74
+            LARGE_INTEGER size;
75
+            if (GetFileSizeEx(hFile, &size))
76
+                info.frameCount = (int)((size.QuadPart - (int64_t)cur) / estFrameSize);
77
+            CloseHandle(hFile);
78
+        }
79
+#else // if defined(_MSC_VER) && _MSC_VER < 1700
80
         if (cur >= 0)
81
         {
82
-            fseeko(ifs, 0, SEEK_END);
83
-            int64_t size = ftello(ifs);
84
-            fseeko(ifs, cur, SEEK_SET);
85
+            ifs->seekg(0, ios::end);
86
+            istream::pos_type size = ifs->tellg();
87
+            ifs->seekg(cur, ios::beg);
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 (ifs != stdin)
97
-            fseeko(ifs, (int64_t)estFrameSize * info.skipFrames, SEEK_CUR);
98
+#if X86_64
99
+        if (ifs != &cin)
100
+            ifs->seekg((uint64_t)estFrameSize * info.skipFrames, ios::cur);
101
         else
102
             for (int i = 0; i < info.skipFrames; i++)
103
-                if (fread(buf[0], estFrameSize - framesize, 1, ifs) + fread(buf[0], framesize, 1, ifs) != 2)
104
-                    break;
105
+            {
106
+                ifs->read(buf[0], estFrameSize - framesize);
107
+                ifs->read(buf[0], framesize);
108
+            }
109
+#else
110
+        for (int i = 0; i < info.skipFrames; i++)
111
+            ifs->ignore(estFrameSize);
112
+#endif
113
     }
114
 }
115
+
116
 Y4MInput::~Y4MInput()
117
 {
118
-    if (ifs && ifs != stdin)
119
-        fclose(ifs);
120
+    if (ifs && ifs != &cin)
121
+        delete ifs;
122
+
123
     for (int i = 0; i < QUEUE_SIZE; i++)
124
         X265_FREE(buf[i]);
125
 }
126
@@ -151,31 +180,37 @@
127
 
128
     int csp = 0;
129
     int d = 0;
130
-    int c;
131
-    while ((c = fgetc(ifs)) != EOF)
132
+
133
+    while (ifs->good())
134
     {
135
         // Skip Y4MPEG string
136
-        while ((c != EOF) && (c != ' ') && (c != '\n'))
137
-            c = fgetc(ifs);
138
-        while (c == ' ')
139
+        int c = ifs->get();
140
+        while (ifs->good() && (c != ' ') && (c != '\n'))
141
+            c = ifs->get();
142
+
143
+        while (c == ' ' && ifs->good())
144
         {
145
             // read parameter identifier
146
-            switch (fgetc(ifs))
147
+            switch (ifs->get())
148
             {
149
             case 'W':
150
                 width = 0;
151
-                while ((c = fgetc(ifs)) != EOF)
152
+                while (ifs->good())
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 ((c = fgetc(ifs)) != EOF)
166
+                while (ifs->good())
167
                 {
168
+                    c = ifs->get();
169
                     if (c == ' ' || c == '\n')
170
                         break;
171
                     else
172
@@ -186,13 +221,15 @@
173
             case 'F':
174
                 rateNum = 0;
175
                 rateDenom = 0;
176
-                while ((c = fgetc(ifs)) != EOF)
177
+                while (ifs->good())
178
                 {
179
+                    c = ifs->get();
180
                     if (c == '.')
181
                     {
182
                         rateDenom = 1;
183
-                        while ((c = fgetc(ifs)) != EOF)
184
+                        while (ifs->good())
185
                         {
186
+                            c = ifs->get();
187
                             if (c == ' ' || c == '\n')
188
                                 break;
189
                             else
190
@@ -205,8 +242,9 @@
191
                     }
192
                     else if (c == ':')
193
                     {
194
-                        while ((c = fgetc(ifs)) != EOF)
195
+                        while (ifs->good())
196
                         {
197
+                            c = ifs->get();
198
                             if (c == ' ' || c == '\n')
199
                                 break;
200
                             else
201
x265_2.7.tar.gz/source/input/y4m.h -> x265_2.6.tar.gz/source/input/y4m.h Changed
34
 
1
@@ -60,9 +60,13 @@
2
     ThreadSafeInteger readCount;
3
 
4
     ThreadSafeInteger writeCount;
5
+
6
     char* buf[QUEUE_SIZE];
7
-    FILE *ifs;
8
+
9
+    std::istream *ifs;
10
+
11
     bool parseHeader();
12
+
13
     void threadMain();
14
 
15
     bool populateFrameQueue();
16
@@ -72,10 +76,15 @@
17
     Y4MInput(InputFileInfo& info);
18
 
19
     virtual ~Y4MInput();
20
+
21
     void release();
22
-    bool isEof() const            { return ifs && feof(ifs); }
23
-    bool isFail()                 { return !(ifs && !ferror(ifs) && threadActive); }
24
+
25
+    bool isEof() const            { return ifs && ifs->eof();  }
26
+
27
+    bool isFail()                 { return !(ifs && !ifs->fail() && threadActive); }
28
+
29
     void startReader();
30
+
31
     bool readPicture(x265_picture&);
32
 
33
     const char *getName() const   { return "y4m"; }
34
x265_2.7.tar.gz/source/input/yuv.cpp -> x265_2.6.tar.gz/source/input/yuv.cpp Changed
133
 
1
@@ -20,8 +20,7 @@
2
  * This program is also available under a commercial proprietary license.
3
  * For more information, contact us at license @ x265.com.
4
  *****************************************************************************/
5
-#define _FILE_OFFSET_BITS 64
6
-#define _LARGEFILE_SOURCE
7
+
8
 #include "yuv.h"
9
 #include "common.h"
10
 
11
@@ -66,21 +65,23 @@
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 = stdin;
19
+        ifs = &cin;
20
 #if _WIN32
21
         setmode(fileno(stdin), O_BINARY);
22
 #endif
23
     }
24
     else
25
-        ifs = x265_fopen(info.filename, "rb");
26
-    if (ifs && !ferror(ifs))
27
+        ifs = new ifstream(info.filename, ios::binary | ios::in);
28
+
29
+    if (ifs && ifs->good())
30
         threadActive = true;
31
     else
32
     {
33
-        if (ifs && ifs != stdin)
34
-            fclose(ifs);
35
+        if (ifs && ifs != &cin)
36
+            delete ifs;
37
         ifs = NULL;
38
         return;
39
     }
40
@@ -97,33 +98,55 @@
41
     }
42
 
43
     info.frameCount = -1;
44
+
45
     /* try to estimate frame count, if this is not stdin */
46
-    if (ifs != stdin)
47
+    if (ifs != &cin)
48
     {
49
-        int64_t cur = ftello(ifs);
50
+        istream::pos_type cur = ifs->tellg();
51
+
52
+#if defined(_MSC_VER) && _MSC_VER < 1700
53
+        /* Older MSVC versions cannot handle 64bit file sizes properly, so go native */
54
+        HANDLE hFile = CreateFileA(info.filename, GENERIC_READ,
55
+                                   FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING,
56
+                                   FILE_ATTRIBUTE_NORMAL, NULL);
57
+        if (hFile != INVALID_HANDLE_VALUE)
58
+        {
59
+            LARGE_INTEGER size;
60
+            if (GetFileSizeEx(hFile, &size))
61
+                info.frameCount = (int)((size.QuadPart - (int64_t)cur) / framesize);
62
+            CloseHandle(hFile);
63
+        }
64
+#else // if defined(_MSC_VER) && _MSC_VER < 1700
65
         if (cur >= 0)
66
         {
67
-            fseeko(ifs, 0, SEEK_END);
68
-            int64_t size = ftello(ifs);
69
-            fseeko(ifs, cur, SEEK_SET);
70
+            ifs->seekg(0, ios::end);
71
+            istream::pos_type size = ifs->tellg();
72
+            ifs->seekg(cur, ios::beg);
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 (ifs != stdin)
82
-            fseeko(ifs, (int64_t)framesize * info.skipFrames, SEEK_CUR);
83
+#if X86_64
84
+        if (ifs != &cin)
85
+            ifs->seekg((uint64_t)framesize * info.skipFrames, ios::cur);
86
         else
87
             for (int i = 0; i < info.skipFrames; i++)
88
-                if (fread(buf[0], framesize, 1, ifs) != 1)
89
-                    break;
90
+                ifs->read(buf[0], framesize);
91
+#else
92
+        for (int i = 0; i < info.skipFrames; i++)
93
+            ifs->ignore(framesize);
94
+#endif
95
     }
96
 }
97
+
98
 YUVInput::~YUVInput()
99
 {
100
-    if (ifs && ifs != stdin)
101
-        fclose(ifs);
102
+    if (ifs && ifs != &cin)
103
+        delete ifs;
104
     for (int i = 0; i < QUEUE_SIZE; i++)
105
         X265_FREE(buf[i]);
106
 }
107
@@ -156,10 +179,12 @@
108
     threadActive = false;
109
     writeCount.poke();
110
 }
111
+
112
 bool YUVInput::populateFrameQueue()
113
 {
114
-    if (!ifs || ferror(ifs))
115
+    if (!ifs || ifs->fail())
116
         return false;
117
+
118
     /* wait for room in the ring buffer */
119
     int written = writeCount.get();
120
     int read = readCount.get();
121
@@ -170,8 +195,10 @@
122
             // release() has been called
123
             return false;
124
     }
125
+
126
     ProfileScopeEvent(frameRead);
127
-    if (fread(buf[written % QUEUE_SIZE], framesize, 1, ifs) == 1)
128
+    ifs->read(buf[written % QUEUE_SIZE], framesize);
129
+    if (ifs->good())
130
     {
131
         writeCount.incr();
132
         return true;
133
x265_2.7.tar.gz/source/input/yuv.h -> x265_2.6.tar.gz/source/input/yuv.h Changed
32
 
1
@@ -52,9 +52,13 @@
2
     ThreadSafeInteger readCount;
3
 
4
     ThreadSafeInteger writeCount;
5
+
6
     char* buf[QUEUE_SIZE];
7
-    FILE *ifs;
8
+
9
+    std::istream *ifs;
10
+
11
     int guessFrameCount();
12
+
13
     void threadMain();
14
 
15
     bool populateFrameQueue();
16
@@ -64,9 +68,13 @@
17
     YUVInput(InputFileInfo& info);
18
 
19
     virtual ~YUVInput();
20
+
21
     void release();
22
-    bool isEof() const                            { return ifs && feof(ifs); }
23
-    bool isFail()                                 { return !(ifs && !ferror(ifs) && threadActive); }
24
+
25
+    bool isEof() const                            { return ifs && ifs->eof();  }
26
+
27
+    bool isFail()                                 { return !(ifs && !ifs->fail() && threadActive); }
28
+
29
     void startReader();
30
 
31
     bool readPicture(x265_picture&);
32
x265_2.7.tar.gz/source/output/raw.cpp -> x265_2.6.tar.gz/source/output/raw.cpp Changed
30
 
1
@@ -21,26 +21,18 @@
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.7.tar.gz/source/test/CMakeLists.txt -> x265_2.6.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_NASM)
6
+enable_language(ASM_YASM)
7
 
8
 if(MSVC_IDE)
9
-    set(NASM_SRC checkasm-a.obj)
10
+    set(YASM_SRC checkasm-a.obj)
11
     add_custom_command(
12
         OUTPUT checkasm-a.obj
13
-        COMMAND ${NASM_EXECUTABLE}
14
-        ARGS ${NASM_FLAGS} ${CMAKE_CURRENT_SOURCE_DIR}/checkasm-a.asm -o checkasm-a.obj
15
+        COMMAND ${YASM_EXECUTABLE}
16
+        ARGS ${YASM_FLAGS} ${CMAKE_CURRENT_SOURCE_DIR}/checkasm-a.asm -o checkasm-a.obj
17
         DEPENDS checkasm-a.asm)
18
 else()
19
-    set(NASM_SRC checkasm-a.asm)
20
+    set(YASM_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(NASM_SRC checkasm-arm.S)
28
+    set(YASM_SRC checkasm-arm.S)
29
     add_custom_command(
30
         OUTPUT checkasm-arm.obj
31
         COMMAND ${CMAKE_CXX_COMPILER}
32
-        ARGS ${NASM_FLAGS} ${CMAKE_CURRENT_SOURCE_DIR}/checkasm-arm.S -o checkasm-arm.obj
33
+        ARGS ${YASM_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(NASM_SRC)
40
+    set(YASM_SRC)
41
 endif(POWER)
42
 
43
-add_executable(TestBench ${NASM_SRC}
44
+add_executable(TestBench ${YASM_SRC}
45
     testbench.cpp testharness.h
46
     pixelharness.cpp pixelharness.h
47
     mbdstharness.cpp mbdstharness.h
48
x265_2.7.tar.gz/source/test/checkasm-a.asm -> x265_2.6.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 "x86inc.asm"
6
+%include "../common/x86/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:  dq 0x1a1b2550a612b48c,0x79445c159ce79064
15
-x7:  dq 0x2eed899d5a28ddcd,0x86b2536fcd8cf636
16
-x8:  dq 0xb0856806085e7943,0x3f2bf84fc0fcca4e
17
-x9:  dq 0xacbd382dcf5b8de2,0xd229e1f5b281303f
18
-x10: dq 0x71aeaff20b095fd9,0xab63e2e11fa38ed9
19
-x11: dq 0x89b0c0765892729a,0x77d410d5c42c882d
20
-x12: dq 0xc45ea11a955d8dd5,0x24b3c1d2a024048b
21
-x13: dq 0x2e8ec680de14b47c,0xdd7b8919edd42786
22
-x14: dq 0x135ce6888fa02cbf,0x11e53e2b2ac655ef
23
-x15: dq 0x011ff554472a7a10,0x6de8f4c914c334d5
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:  ddq 0x79445c159ce790641a1b2550a612b48c
33
+x7:  ddq 0x86b2536fcd8cf6362eed899d5a28ddcd
34
+x8:  ddq 0x3f2bf84fc0fcca4eb0856806085e7943
35
+x9:  ddq 0xd229e1f5b281303facbd382dcf5b8de2
36
+x10: ddq 0xab63e2e11fa38ed971aeaff20b095fd9
37
+x11: ddq 0x77d410d5c42c882d89b0c0765892729a
38
+x12: ddq 0x24b3c1d2a024048bc45ea11a955d8dd5
39
+x13: ddq 0xdd7b8919edd427862e8ec680de14b47c
40
+x14: ddq 0x11e53e2b2ac655ef135ce6888fa02cbf
41
+x15: ddq 0x6de8f4c914c334d5011ff554472a7a10
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 argsize (max_args+6)*8
58
-    SUB  rsp, argsize
59
-    mov   r1, argsize-8
60
+    %define size (max_args+6)*8
61
+    SUB  rsp, size
62
+    mov   r1, size-8
63
 .loop:
64
     mov [rsp+r1], r0
65
     sub   r1, 8
66
     jge .loop
67
-    ADD  rsp, argsize
68
+    ADD  rsp, size
69
     RET
70
 
71
 %if WIN64
72
@@ -156,11 +156,7 @@
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.7.tar.gz/source/test/regression-tests.txt -> x265_2.6.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-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
6
+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
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-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
10
+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
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-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
13
+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
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-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
19
+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
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-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
28
+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
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-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
37
-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
38
+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
39
+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
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-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
48
+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
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,8 +150,6 @@
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.7.tar.gz/source/x265.cpp -> x265_2.6.tar.gz/source/x265.cpp Changed
30
 
1
@@ -301,15 +301,9 @@
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
@@ -585,9 +579,9 @@
19
 
20
     x265_picture pic_orig, pic_out;
21
     x265_picture *pic_in = &pic_orig;
22
-    /* Allocate recon picture if analysis save/load is enabled */
23
+    /* Allocate recon picture if analysisReuseMode 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->analysisSave || param->analysisLoad || pts_queue || reconPlay || param->csvLogLevel) ? &pic_out : NULL;
26
+    x265_picture *pic_recon = (cliopt.recon || !!param->analysisReuseMode || 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.7.tar.gz/source/x265.h -> x265_2.6.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.analysisLoad and param.analysisSave are disabled, this field is
6
-     * ignored on input and output. Else the user must call x265_alloc_analysis_data()
7
-     * to allocate analysis buffers for every picture passed to the encoder.
8
+    /* If param.analysisReuseMode is X265_ANALYSIS_OFF this field is ignored on input
9
+     * and output. Else the user must call x265_alloc_analysis_data() to
10
+     * allocate analysis buffers for every picture passed to the encoder.
11
      *
12
-     * On input when param.analysisLoad is enabled and analysisData
13
+     * On input when param.analysisReuseMode is X265_ANALYSIS_LOAD 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.analysisSave is enabled and analysisData
18
+     * On output when param.analysisReuseMode is X265_ANALYSIS_SAVE 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,7 +481,9 @@
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
@@ -1127,13 +1129,13 @@
33
      * Default disabled */
34
     int       bEnableRdRefine;
35
 
36
-    /* If save, write per-frame analysis information into analysis buffers.
37
-     * If load, read analysis information into analysis buffer and use this
38
-     * analysis information to reduce the amount of work the encoder must perform.
39
-     * Default disabled. Now deprecated*/
40
+    /* If X265_ANALYSIS_SAVE, write per-frame analysis information into analysis
41
+     * buffers.  if X265_ANALYSIS_LOAD, read analysis information into analysis
42
+     * buffer and use this analysis information to reduce the amount of work
43
+     * the encoder must perform. Default X265_ANALYSIS_OFF */
44
     int       analysisReuseMode;
45
 
46
-    /* Filename for multi-pass-opt-analysis/distortion. Default name is "x265_analysis.dat" */
47
+    /* Filename for analysisReuseMode save/load. Default name is "x265_analysis.dat" */
48
     const char* analysisReuseFileName;
49
 
50
     /*== Rate Control ==*/
51
@@ -1271,7 +1273,6 @@
52
 
53
         /* internally enable if tune grain is set */
54
         int      bEnableConstVbv;
55
-
56
     } rc;
57
 
58
     /*== Video Usability Information ==*/
59
@@ -1454,7 +1455,7 @@
60
     int       bHDROpt;
61
 
62
     /* A value between 1 and 10 (both inclusive) determines the level of
63
-    * information stored/reused in analysis save/load. Higher the refine
64
+    * information stored/reused in save/load analysis-reuse-mode. Higher the refine
65
     * level higher the information stored/reused. Default is 5 */
66
     int       analysisReuseLevel;
67
 
68
@@ -1531,23 +1532,9 @@
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
@@ -1756,7 +1743,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, int*, int*);
98
+int x265_get_ref_frame_list(x265_encoder *encoder, x265_picyuv**, x265_picyuv**, 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
@@ -1779,10 +1766,9 @@
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. padx and pady are
107
- * padding offsets for conformance and can be given from sps settings. Encode
108
+ * intended to be command line arguments passed to the encoder. Encode
109
  * statistics should be queried from the encoder just prior to closing it. */
110
-void x265_csvlog_encode(const x265_param*, const x265_stats *, int padx, int pady, int argc, char** argv);
111
+void x265_csvlog_encode(x265_encoder *encoder, const x265_stats *, 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
@@ -1834,10 +1820,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, int*, int*);
120
+    int           (*get_ref_frame_list)(x265_encoder*, x265_picyuv**, x265_picyuv**, int, int);
121
     FILE*         (*csvlog_open)(const x265_param*);
122
     void          (*csvlog_frame)(const x265_param*, const x265_picture*);
123
-    void          (*csvlog_encode)(const x265_param*, const x265_stats *, int, int, int, char**);
124
+    void          (*csvlog_encode)(x265_encoder*, const x265_stats*, 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.7.tar.gz/source/x265cli.h -> x265_2.6.tar.gz/source/x265cli.h Changed
89
 
1
@@ -38,7 +38,6 @@
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
@@ -120,11 +119,9 @@
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
@@ -255,11 +252,9 @@
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 }, /* DEPRECATED */
26
-    { "analysis-reuse-file", required_argument, NULL, 0 },
27
+    { "analysis-reuse-mode",  required_argument, NULL, 0 },
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
@@ -319,7 +314,6 @@
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
@@ -424,11 +418,9 @@
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
@@ -469,19 +461,18 @@
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-save <filename>    Dump analysis info into the specified file. Default Disabled\n");
60
-    H0("   --analysis-load <filename>    Load analysis buffers from the file specified. Default Disabled\n");
61
+    H0("   --analysis-reuse-mode <string|int>  save - Dump analysis info into file, load - Load analysis buffers from the file. Default %d\n", param->analysisReuseMode);
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-load.\n"
67
+    H0("   --refine-intra <0..3>         Enable intra refinement for encode that uses analysis-reuse-mode=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-load.\n"
74
+    H0("   --refine-inter <0..3>         Enable inter refinement for encode that uses analysis-reuse-mode=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
@@ -572,8 +563,9 @@
79
 #undef OPT
80
 #undef H0
81
 #undef H1
82
+
83
     if (level < X265_LOG_DEBUG)
84
-        printf("\nUse --fullhelp for a full listing (or --log-level full --help)\n");
85
+        printf("\nUse --log-level full --help for a full listing\n");
86
     printf("\n\nComplete documentation may be found at http://x265.readthedocs.org/en/default/cli.html\n");
87
     exit(1);
88
 }
89
x265_2.7.tar.gz/source/cmake/CMakeASM_NASMInformation.cmake Deleted
70
 
1
@@ -1,68 +0,0 @@
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 Deleted
7
 
1
@@ -1,5 +0,0 @@
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 Deleted
5
 
1
@@ -1,3 +0,0 @@
2
-set(ASM_DIALECT "_NASM")
3
-include(CMakeTestASMCompiler)
4
-set(ASM_DIALECT)
5
x265_2.7.tar.gz/source/cmake/FindNasm.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(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.7.tar.gz/source/common/x86/h-ipfilter16.asm Deleted
201
 
1
@@ -1,2537 +0,0 @@
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 Deleted
201
 
1
@@ -1,6736 +0,0 @@
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 Deleted
201
 
1
@@ -1,2632 +0,0 @@
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.7.tar.gz/source/common/x86/v4-ipfilter16.asm Deleted
201
 
1
@@ -1,3529 +0,0 @@
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 Deleted
201
 
1
@@ -1,12799 +0,0 @@
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