We truncated the diff of some files because they were too big.
If you want to see the full diff for every file, click here.
Changes of Revision 40
x265.changes
Changed
x
1
2
-------------------------------------------------------------------
3
+Fri Mar 26 12:02:14 UTC 2021 - Luigi Baldoni <aloisio@gmx.com>
4
+
5
+- Update to version 3.5
6
+ New features:
7
+ * Real-time VBV for ABR (Average BitRate) encodes in –pass 2
8
+ using --vbv-live-multi-pass. Improves VBV compliance with no
9
+ significant impact on coding efficiency.
10
+ Enhancements to existing features:
11
+ * Improved hist-based scene cut algorithm: Reduces false
12
+ positives by leveraging motion and scene transition info.
13
+ * Support for RADL pictures at IDR scene cuts: Improves coding
14
+ efficiency with no significant impact on performance.
15
+ * Bidirectional scene cut aware Frame Quantizer Selection:
16
+ Saves bits than forward masking with no noticeable perceptual
17
+ quality difference.
18
+ API changes:
19
+ * Additions to x265_param structure to support the newly added
20
+ features and encoder enhancements.
21
+ * New x265_param options --min-vbv-fullness and
22
+ --max-vbv-fullness to control min and max VBV fullness.
23
+ Bug fixes:
24
+ * Incorrect VBV lookahead in --analysis-load + --scale-factor.
25
+ * Encoder hang when VBV is used with slices.
26
+ * QP spikes in the row-level VBV rate-control when WPP enabled.
27
+ * Encoder crash in --abr-ladder.
28
+- Use new homepage and download URLs.
29
+- Add subpackage for HDR10+ library
30
+- Add update.sh
31
+
32
+-------------------------------------------------------------------
33
Mon Jun 1 17:51:22 UTC 2020 - Luigi Baldoni <aloisio@gmx.com>
34
35
- Update to version 3.4
36
x265.spec
Changed
130
1
2
#
3
# spec file for package x265
4
#
5
-# Copyright (c) 2020 Packman Team <packman@links2linux.de>
6
+# Copyright (c) 2021 Packman Team <packman@links2linux.de>
7
# Copyright (c) 2014 Torsten Gruner <t.gruner@katodev.de>
8
#
9
# All modifications and additions to the file contributed by third parties
10
11
#
12
13
14
-%define sover 192
15
+%define sover 199
16
%define libname lib%{name}
17
%define libsoname %{libname}-%{sover}
18
+%define uver 3_5
19
Name: x265
20
-Version: 3.4
21
+Version: 3.5
22
Release: 0
23
Summary: A free h265/HEVC encoder - encoder binary
24
License: GPL-2.0-or-later
25
Group: Productivity/Multimedia/Video/Editors and Convertors
26
-URL: https://bitbucket.org/multicoreware/x265/wiki/Home
27
-Source0: https://bitbucket.org/multicoreware/x265/downloads/%{name}_%{version}.tar.gz
28
+URL: https://bitbucket.org/multicoreware/x265_git
29
+Source0: https://bitbucket.org/multicoreware/x265_git/downloads/%{name}_%{version}.tar.gz
30
Patch0: arm.patch
31
Patch1: x265.pkgconfig.patch
32
Patch2: x265-fix_enable512.patch
33
34
x265 is a free library for encoding next-generation H265/HEVC video
35
streams.
36
37
+%package -n libhdr10plus-%{uver}
38
+Summary: A free HDR10+ library
39
+Group: Productivity/Multimedia/Video/Editors and Convertors
40
+
41
+%description -n libhdr10plus-%{uver}
42
+A free library supporting HDR10+.
43
+
44
%package -n %{libname}-devel
45
Summary: Libraries and include file for the %{libname} encoder
46
Group: Development/Libraries/C and C++
47
Requires: %{libsoname} = %{version}-%{release}
48
+Requires: libhdr10plus-%{uver} = %{version}-%{release}
49
Provides: %{name}-devel = %{version}
50
Obsoletes: %{name}-devel < %{version}
51
52
53
%patch0 -p1
54
%patch1 -p1
55
%patch2 -p1
56
-sed -i -e "s/0.0/%{sover}.0/g" source/cmake/version.cmake
57
-
58
+# set the version by hand
59
+sed -i "/^include(Version)/d" source/CMakeLists.txt
60
+# force version number in the soname
61
+sed -i 's/hdr10plus-shared PROPERTIES OUTPUT_NAME hdr10plus/hdr10plus-shared PROPERTIES OUTPUT_NAME hdr10plus-%{version}/' \
62
+ source/CMakeLists.txt
63
64
%build
65
SOURCE_DIR="$PWD"/source
66
-COMMON_FLAGS="-DENABLE_TESTS=OFF -DENABLE_PIC=ON"
67
+COMMON_FLAGS="-DENABLE_TESTS=OFF -DENABLE_PIC=ON -Wno-dev"
68
HIGH_BIT_DEPTH_FLAGS="-DENABLE_CLI=OFF -DENABLE_SHARED=OFF -DEXPORT_C_API=OFF -DHIGH_BIT_DEPTH=ON"
69
70
%if 0%{?suse_version} >= 1500
71
72
# Build general version of the library linking in the 10/12bit depth versions
73
%define __builddir ./source/build
74
%cmake -DENABLE_TESTS=OFF \
75
+ -DENABLE_SHARED=ON \
76
+ -DX265_LATEST_TAG="%{sover}.0" \
77
+ -DX265_VERSION="%{version}" \
78
+ -DENABLE_HDR10_PLUS=ON \
79
-DENABLE_PIC=ON \
80
-DENABLE_CLI=ON \
81
-DLINKED_10BIT=ON \
82
-DLINKED_12BIT=ON \
83
-DEXTRA_LINK_FLAGS="-L$SOURCE_DIR/build-10bit -L$SOURCE_DIR/build-12bit" \
84
- -DEXTRA_LIB="x265_main10.a;x265_main12.a"
85
-
86
+ -DEXTRA_LIB="x265_main10.a;x265_main12.a" \
87
+ -Wno-dev
88
%else
89
cd source
90
-%cmake $COMMON_FLAGS
91
+%cmake $COMMON_FLAGS \
92
+ -DENABLE_SHARED=ON \
93
+ -DX265_LATEST_TAG="%{sover}.0" \
94
+ -DX265_VERSION="%{version}" \
95
+ -DENABLE_HDR10_PLUS=ON
96
%endif
97
make %{?_smp_mflags}
98
cd ../../
99
100
cd source
101
%endif
102
%cmake_install
103
-rm -f %{buildroot}%{_libdir}/%{libname}.a
104
-echo "%{libname}-%{sover}" > %{_sourcedir}/baselibs.conf
105
+find %{buildroot} -type f -name "*.a" -delete -print0
106
107
%post -n %{libsoname} -p /sbin/ldconfig
108
%postun -n %{libsoname} -p /sbin/ldconfig
109
110
+%post -n libhdr10plus-%{uver} -p /sbin/ldconfig
111
+%postun -n libhdr10plus-%{uver} -p /sbin/ldconfig
112
+
113
%files -n %{libsoname}
114
%{_libdir}/%{libname}.so.%{sover}*
115
116
+%files -n libhdr10plus-%{uver}
117
+%{_libdir}/libhdr10plus-%{version}.so
118
+
119
%files
120
%{_bindir}/%{name}
121
122
123
%doc readme.rst
124
%{_includedir}/%{name}.h
125
%{_includedir}/%{name}_config.h
126
+%{_includedir}/hdr10plus.h
127
%{_libdir}/pkgconfig/%{name}.pc
128
%{_libdir}/%{libname}.so
129
130
baselibs.conf
Changed
4
1
2
-libx265-192
3
+libx265-199
4
update.sh
Added
12
1
2
+#!/bin/sh
3
+
4
+rm -f x265_*.tar.gz
5
+osc service disabledrun download_files
6
+version=$(grep ^Version x265.spec|awk '{print $2}')
7
+echo "The new version is:" $version
8
+api=$(tar xzfO x265_${version}.tar.gz x265_${version}/source/CMakeLists.txt|grep "set(X265_BUILD"|sed 's/^.* \([1-9][0-9]*\).*$/\1/')
9
+echo "The new api version is:" $api
10
+echo "libx265-${api}" > baselibs.conf
11
+sed -i "/^%define sover/c%define sover ${api}" x265.spec
12
x265_3.4.tar.gz/.hg_archival.txt
Deleted
6
1
2
-repo: 09fe40627f03a0f9c3e6ac78b22ac93da23f9fdf
3
-node: 2a65b720985096bcb1664f7cb05c3d04aeb576f5
4
-branch: Release_3.4
5
-tag: 3.4
6
x265_3.4.tar.gz/source/cmake/version.cmake
Deleted
107
1
2
-if(CMAKE_VERSION VERSION_LESS "2.8.10")
3
- find_program(HG_EXECUTABLE hg)
4
-else()
5
- find_package(Hg QUIET)
6
-endif()
7
-find_package(Git QUIET) # present in 2.8.8
8
-
9
-# defaults, in case everything below fails
10
-set(X265_VERSION "unknown")
11
-set(X265_LATEST_TAG "0.0")
12
-set(X265_TAG_DISTANCE "0")
13
-
14
-if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../.hg_archival.txt)
15
- # read the lines of the archive summary file to extract the version
16
- file(READ ${CMAKE_CURRENT_SOURCE_DIR}/../.hg_archival.txt archive)
17
- STRING(REGEX REPLACE "\n" ";" archive "${archive}")
18
- foreach(f ${archive})
19
- string(FIND "${f}" ": " pos)
20
- string(SUBSTRING "${f}" 0 ${pos} key)
21
- string(SUBSTRING "${f}" ${pos} -1 value)
22
- string(SUBSTRING "${value}" 2 -1 value)
23
- set(hg_${key} ${value})
24
- endforeach()
25
- if(DEFINED hg_tag)
26
- set(X265_LATEST_TAG ${hg_tag})
27
- elseif(DEFINED hg_node)
28
- set(X265_LATEST_TAG ${hg_latesttag})
29
- set(X265_TAG_DISTANCE ${hg_latesttagdistance})
30
- string(SUBSTRING "${hg_node}" 0 12 X265_REVISION_ID)
31
- endif()
32
-elseif(HG_EXECUTABLE AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../.hg)
33
- if(EXISTS "${HG_EXECUTABLE}.bat")
34
- # mercurial source installs on Windows require .bat extension
35
- set(HG_EXECUTABLE "${HG_EXECUTABLE}.bat")
36
- endif()
37
- message(STATUS "hg found at ${HG_EXECUTABLE}")
38
-
39
- execute_process(COMMAND
40
- ${HG_EXECUTABLE} log -r. --template "{latesttag}"
41
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
42
- OUTPUT_VARIABLE X265_LATEST_TAG
43
- ERROR_QUIET
44
- OUTPUT_STRIP_TRAILING_WHITESPACE
45
- )
46
- execute_process(COMMAND
47
- ${HG_EXECUTABLE} log -r. --template "{latesttagdistance}"
48
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
49
- OUTPUT_VARIABLE X265_TAG_DISTANCE
50
- ERROR_QUIET
51
- OUTPUT_STRIP_TRAILING_WHITESPACE
52
- )
53
- execute_process(
54
- COMMAND
55
- ${HG_EXECUTABLE} log -r. --template "{node}"
56
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
57
- OUTPUT_VARIABLE X265_REVISION_ID
58
- ERROR_QUIET
59
- OUTPUT_STRIP_TRAILING_WHITESPACE
60
- )
61
- string(SUBSTRING "${X265_REVISION_ID}" 0 12 X265_REVISION_ID)
62
-
63
- if(X265_LATEST_TAG MATCHES "^r")
64
- string(SUBSTRING ${X265_LATEST_TAG} 1 -1 X265_LATEST_TAG)
65
- endif()
66
-elseif(GIT_EXECUTABLE AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../.git)
67
- execute_process(
68
- COMMAND
69
- ${GIT_EXECUTABLE} rev-list --tags --max-count=1
70
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
71
- OUTPUT_VARIABLE X265_LATEST_TAG_COMMIT
72
- ERROR_QUIET
73
- OUTPUT_STRIP_TRAILING_WHITESPACE
74
- )
75
- execute_process(
76
- COMMAND
77
- ${GIT_EXECUTABLE} describe --tags ${X265_LATEST_TAG_COMMIT}
78
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
79
- OUTPUT_VARIABLE X265_LATEST_TAG
80
- ERROR_QUIET
81
- OUTPUT_STRIP_TRAILING_WHITESPACE
82
- )
83
- execute_process(
84
- COMMAND
85
- ${GIT_EXECUTABLE} rev-list ${X265_LATEST_TAG}.. --count --first-parent
86
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
87
- OUTPUT_VARIABLE X265_TAG_DISTANCE
88
- ERROR_QUIET
89
- OUTPUT_STRIP_TRAILING_WHITESPACE
90
- )
91
- execute_process(
92
- COMMAND
93
- ${GIT_EXECUTABLE} log -1 --format=g%h
94
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
95
- OUTPUT_VARIABLE X265_REVISION_ID
96
- ERROR_QUIET
97
- OUTPUT_STRIP_TRAILING_WHITESPACE
98
- )
99
-endif()
100
-if(X265_TAG_DISTANCE STREQUAL "0")
101
- set(X265_VERSION "${X265_LATEST_TAG}")
102
-else()
103
- set(X265_VERSION "${X265_LATEST_TAG}+${X265_TAG_DISTANCE}-${X265_REVISION_ID}")
104
-endif()
105
-
106
-message(STATUS "x265 version ${X265_VERSION}")
107
x265_3.5.tar.gz/.
Added
2
1
+(directory)
2
x265_3.5.tar.gz/build
Added
2
1
+(directory)
2
x265_3.5.tar.gz/build/aarch64-linux
Added
2
1
+(directory)
2
x265_3.5.tar.gz/build/arm-linux
Added
2
1
+(directory)
2
x265_3.5.tar.gz/build/linux
Added
2
1
+(directory)
2
x265_3.5.tar.gz/build/msys
Added
2
1
+(directory)
2
x265_3.5.tar.gz/build/msys-cl
Added
2
1
+(directory)
2
x265_3.5.tar.gz/build/vc10-x86
Added
2
1
+(directory)
2
x265_3.5.tar.gz/build/vc10-x86_64
Added
2
1
+(directory)
2
x265_3.5.tar.gz/build/vc11-x86
Added
2
1
+(directory)
2
x265_3.5.tar.gz/build/vc11-x86_64
Added
2
1
+(directory)
2
x265_3.5.tar.gz/build/vc12-x86
Added
2
1
+(directory)
2
x265_3.5.tar.gz/build/vc12-x86_64
Added
2
1
+(directory)
2
x265_3.5.tar.gz/build/vc15-x86
Added
2
1
+(directory)
2
x265_3.5.tar.gz/build/vc15-x86_64
Added
2
1
+(directory)
2
x265_3.5.tar.gz/build/vc9-x86
Added
2
1
+(directory)
2
x265_3.5.tar.gz/build/vc9-x86_64
Added
2
1
+(directory)
2
x265_3.5.tar.gz/build/xcode
Added
2
1
+(directory)
2
x265_3.5.tar.gz/doc
Added
2
1
+(directory)
2
x265_3.5.tar.gz/doc/intra
Added
2
1
+(directory)
2
x265_3.5.tar.gz/doc/reST
Added
2
1
+(directory)
2
x265_3.4.tar.gz/doc/reST/cli.rst -> x265_3.5.tar.gz/doc/reST/cli.rst
Changed
201
1
2
3
.. option:: --help, -h
4
5
- Display help text
6
+ Displays help text
7
8
**CLI ONLY**
9
10
.. option:: --version, -V
11
12
- Display version details
13
+ Displays version details in the following manner *[Version Name]+/-[Number of commits from the release changeset]-/+[repository's head changeset SHA-1 paraphrase identifier]*
14
+ along with the compilation platform, build information and supported cpu capabilities.
15
+
16
+ In case of release tar balls version information is partly derived from configuration file *x265Version.txt*
17
+ .. seeAlso:: For more information on how to configure the version file please refer to `<https://bitbucket.org/multicoreware/x265_git/wiki/Home>`_ and Contribute pages for updates specific
18
+ release and version control management.
19
+
20
+ **Example:**
21
+
22
+ *x265 [info]: HEVC encoder version 3.4+27-'d9217cf00'*
23
+
24
+ *x265 [info]: build info [Windows][MSVC 1916][64 bit] 10bit*
25
+
26
+ *x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2*
27
28
**CLI ONLY**
29
30
31
**Residual Energy** Average residual energy. SSE is calculated on fenc
32
and pred(before quantization).
33
34
- **Luma/Chroma Values** minumum, maximum and average(averaged by area)
35
+ **Luma/Chroma Values** minimum, maximum and average(averaged by area)
36
luma and chroma values of source for each frame.
37
38
**PU Statistics** percentage of PU modes at each depth.
39
40
41
.. option:: --pools <string>, --numa-pools <string>
42
43
- Comma seperated list of threads per NUMA node. If "none", then no worker
44
+ Comma separated list of threads per NUMA node. If "none", then no worker
45
pools are created and only frame parallelism is possible. If NULL or ""
46
(default) x265 will use all available threads on each NUMA node::
47
48
49
the last thread pool is spawned only if it has more than 32 threads for
50
64-bit machines, or 16 for 32-bit machines. If the total number of threads
51
in the system doesn't obey this constraint, we may spawn fewer threads
52
- than cores which has been emperically shown to be better for performance.
53
+ than cores which has been empirically shown to be better for performance.
54
55
If the four pool features: :option:`--wpp`, :option:`--pmode`,
56
:option:`--pme` and :option:`--lookahead-slices` are all disabled,
57
58
59
Allow encoder to copy input x265 pictures to internal frame buffers. When disabled,
60
x265 will not make an internal copy of the input picture and will work with the
61
- application's buffers. While this allows for deeper integration, it is the responsbility
62
+ application's buffers. While this allows for deeper integration, it is the responsibility
63
of the application to (a) ensure that the allocated picture has extra space for padding
64
that will be done by the library, and (b) the buffers aren't recycled until the library
65
has completed encoding this frame (which can be figured out by tracking NALs output by x265)
66
67
68
.. option:: --chunk-start <integer>
69
70
- First frame of the chunk. Frames preceeding this in display order will
71
+ First frame of the chunk. Frames preceding this in display order will
72
be encoded, however, they will be discarded in the bitstream. This
73
feature can be enabled only in closed GOP structures.
74
Default 0 (disabled).
75
76
.. option:: --chunk-end <integer>
77
78
Last frame of the chunk. Frames following this in display order will be
79
- used in taking lookahead decisions, but, they will not be encoded.
80
+ used in taking lookahead decisions, but they will not be encoded.
81
This feature can be enabled only in closed GOP structures.
82
Default 0 (disabled).
83
84
85
If :option:`--level-idc` has been specified, --high-tier allows the
86
support of high tier at that level. The encoder will first attempt to encode
87
at the specified level, main tier first, turning on high tier only if
88
- necessary and available at that level.If your requested level does not
89
+ necessary and available at that level. If your requested level does not
90
support a High tier, high tier will not be supported. If --no-high-tier
91
has been specified, then the encoder will attempt to encode only at the main tier.
92
93
94
.. option:: --ref <1..16>
95
96
Max number of L0 references to be allowed. This number has a linear
97
- multiplier effect on the amount of work performed in motion search,
98
- but will generally have a beneficial affect on compression and
99
+ multiplier effect on the amount of work performed in motion search
100
+ but will generally have a beneficial effect on compression and
101
distortion.
102
103
Note that x265 allows up to 16 L0 references but the HEVC
104
105
.. option:: --allow-non-conformance, --no-allow-non-conformance
106
107
Allow libx265 to generate a bitstream with profile and level NONE.
108
- By default it will abort any encode which does not meet strict level
109
+ By default, it will abort any encode which does not meet strict level
110
compliance. The two most likely causes for non-conformance are
111
:option:`--ctu` being too small, :option:`--ref` being too high,
112
or the bitrate or resolution being out of specification.
113
114
used. The lower the value the faster the encode, the higher the
115
value the smaller the bitstream (in general). Default 3
116
117
- Note that this table aims for accuracy, but is not necessarily our
118
+ Note that this table aims for accuracy but is not necessarily our
119
final target behavior for each mode.
120
121
+-------+---------------------------------------------------------------+
122
123
124
Maximum CU size (width and height). The larger the maximum CU size,
125
the more efficiently x265 can encode flat areas of the picture,
126
- giving large reductions in bitrate. However this comes at a loss of
127
+ giving large reductions in bitrate. However, this comes at a loss of
128
parallelism with fewer rows of CUs that can be encoded in parallel,
129
and less frame parallelism as well. Because of this the faster
130
presets use a CU size of 32. Default: 64
131
132
133
For all non-zero values of limit-refs, the current depth will evaluate
134
intra mode (in inter slices), only if intra mode was chosen as the best
135
- mode for atleast one of the 4 sub-blocks.
136
+ mode for at least one of the 4 sub-blocks.
137
138
You can often increase the number of references you are using
139
(within your decoder level limits) if you enable one or
140
141
142
Provides minimal quality degradation at good performance gains for non-zero modes.
143
:option:`--rskip mode 0` means disabled. Default: 1, disabled when :option:`--tune grain` is used.
144
- This is a integer value representing the edge-density percentage within the CU. Internally normalized to a number between 0.0 to 1.0 in x265.
145
- Recommended low thresholds for slow encodes and high for fast encodes.
146
147
.. option:: --rskip-edge-threshold <0..100>
148
149
Denotes the minimum expected edge-density percentage within the CU, below which the recursion is skipped.
150
- Default: 5, requires :option:`--rskip mode 2` to be enabled.
151
+ Internally normalized to decimal value in x265 library. Recommended low thresholds for slow encodes and high
152
+ for fast encodes. Default: 5, requires :option:`--rskip mode 2` to be enabled.
153
154
.. option:: --splitrd-skip, --no-splitrd-skip
155
156
157
158
.. option:: --analysis-load <filename>
159
160
- Encoder reuses analysis information from the file specified. By reading the analysis data writen by
161
+ Encoder reuses analysis information from the file specified. By reading the analysis data written by
162
an earlier encode of the same sequence, substantial redundant work may be avoided. Requires cutree, pmode
163
to be off. Default disabled.
164
165
166
167
Note that when the CU intra prediction is NxN (only possible with
168
8x8 CUs), a TU split is implied, and thus the residual quad-tree
169
- begins at 4x4 and cannot split any futhrer.
170
+ begins at 4x4 and cannot split any further.
171
172
.. option:: --tu-inter-depth <1..4>
173
174
175
Enables early exit from TU depth recursion, for inter coded blocks.
176
177
Level 1 - decides to recurse to next higher depth based on cost
178
- comparison of full size TU and split TU.
179
+ comparison of full-size TU and split TU.
180
181
Level 2 - based on first split subTU's depth, limits recursion of
182
other split subTUs.
183
184
Level 3 - based on the average depth of the co-located and the neighbor
185
CUs' TU depth, limits recursion of the current CU.
186
187
- Level 4 - uses the depth of the neighbouring/ co-located CUs TU depth
188
+ Level 4 - uses the depth of the neighboring/ co-located CUs TU depth
189
to limit the 1st subTU depth. The 1st subTU depth is taken as the
190
limiting depth for the other subTUs.
191
192
Enabling levels 3 or 4 may cause a mismatch in the output bitstreams
193
between :option:`--analysis-save` and :option:`--analysis-load`
194
- as all neighbouring CUs TU depth may not be available in the
195
+ as all neighboring CUs TU depth may not be available in the
196
:option:`--analysis-load` run as only the best mode's information is
197
available to it.
198
199
200
Motion search method. Generally, the higher the number the harder
201
x265_3.4.tar.gz/doc/reST/introduction.rst -> x265_3.5.tar.gz/doc/reST/introduction.rst
Changed
10
1
2
features and optimizations from the x264 AVC encoder project.
3
4
The x265 software is available for free under the GNU GPL 2 license,
5
-from https://bitbucket.org/multicoreware/x265. For commercial companies
6
+from https://bitbucket.org/multicoreware/x265_git. For commercial companies
7
that wish to distribute x265 without being subject to the open source
8
requirements of the GPL 2 license, commercial licenses are available
9
with competitive terms. Contact license @ x265.com to inquire about
10
x265_3.4.tar.gz/doc/reST/releasenotes.rst -> x265_3.5.tar.gz/doc/reST/releasenotes.rst
Changed
35
1
2
Release Notes
3
*************
4
5
+Version 3.5
6
+===========
7
+
8
+Release date - 16th March, 2021.
9
+
10
+New feature
11
+-----------
12
+1. Real-time VBV for ABR (Average BitRate) encodes in –pass 2 using :option:`--vbv-live-multi-pass`: Improves VBV compliance with no significant impact on coding efficiency.
13
+
14
+Enhancements to existing features
15
+---------------------------------
16
+1. Improved hist-based scene cut algorithm: Reduces false positives by leveraging motion and scene transition info.
17
+2. Support for RADL pictures at IDR scene cuts: Improves coding efficiency with no significant impact on performance.
18
+3. Bidirectional scene cut aware Frame Quantizer Selection: Saves bits than forward masking with no noticeable perceptual quality difference.
19
+
20
+API changes
21
+-----------
22
+1. Additions to x265_param structure to support the newly added features and encoder enhancements.
23
+2. New x265_param options :option:`--min-vbv-fullness` and :option:`--max-vbv-fullness` to control min and max VBV fullness.
24
+
25
+Bug fixes
26
+---------
27
+1. Incorrect VBV lookahead in :option:`--analysis-load` + :option:`--scale-factor`.
28
+2. Encoder hang when VBV is used with slices.
29
+3. QP spikes in the row-level VBV rate-control when WPP enabled.
30
+4. Encoder crash in :option:`--abr-ladder`.
31
+
32
Version 3.4
33
===========
34
35
x265_3.5.tar.gz/doc/uncrustify
Added
2
1
+(directory)
2
x265_3.5.tar.gz/source
Added
2
1
+(directory)
2
x265_3.4.tar.gz/source/CMakeLists.txt -> x265_3.5.tar.gz/source/CMakeLists.txt
Changed
19
1
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 192)
6
+set(X265_BUILD 199)
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
11
endif()
12
endif()
13
14
-include(version) # determine X265_VERSION and X265_LATEST_TAG
15
+include(Version) # determine X265_VERSION and X265_LATEST_TAG
16
include_directories(. common encoder "${PROJECT_BINARY_DIR}")
17
18
option(ENABLE_PPA "Enable PPA profiling instrumentation" OFF)
19
x265_3.4.tar.gz/source/abrEncApp.cpp -> x265_3.5.tar.gz/source/abrEncApp.cpp
Changed
35
1
2
x265_picture_init(m_passEnc[pass]->m_param, m_inputPicBuffer[pass][idx]);
3
}
4
5
- m_analysisBuffer[pass] = X265_MALLOC(x265_analysis_data, m_queueSize);
6
+ CHECKED_MALLOC_ZERO(m_analysisBuffer[pass], x265_analysis_data, m_queueSize);
7
m_picIdxReadCnt[pass] = new ThreadSafeInteger[m_queueSize];
8
m_analysisWrite[pass] = new ThreadSafeInteger[m_queueSize];
9
m_analysisRead[pass] = new ThreadSafeInteger[m_queueSize];
10
m_readFlag[pass] = X265_MALLOC(int, m_queueSize);
11
}
12
return true;
13
+ fail:
14
+ return false;
15
}
16
17
void AbrEncoder::destroy()
18
19
20
x265_analysis_data *m_analysisInfo = &m_parent->m_analysisBuffer[m_id][index];
21
22
+ x265_free_analysis_data(m_param, m_analysisInfo);
23
memcpy(m_analysisInfo, src, sizeof(x265_analysis_data));
24
x265_alloc_analysis_data(m_param, m_analysisInfo);
25
26
27
api->encoder_get_stats(m_encoder, &stats, sizeof(stats));
28
if (m_param->csvfn && !b_ctrl_c)
29
#if ENABLE_LIBVMAF
30
- api->vmaf_encoder_log(m_encoder, m_cliopt.argCount, m_cliopt.argString, m_cliopt.param, vmafdata);
31
+ api->vmaf_encoder_log(m_encoder, m_cliopt.argCnt, m_cliopt.argString, m_cliopt.param, vmafdata);
32
#else
33
api->encoder_log(m_encoder, m_cliopt.argCnt, m_cliopt.argString);
34
#endif
35
x265_3.5.tar.gz/source/cmake
Added
2
1
+(directory)
2
x265_3.5.tar.gz/source/cmake/Version.cmake
Added
181
1
2
+ #################################################################################################################
3
+ #
4
+ # Copyright (C) 2013-2020 MulticoreWare, Inc
5
+ #
6
+ # This program is free software; you can redistribute it and/or modify
7
+ # it under the terms of the GNU General Public License as published by
8
+ # the Free Software Foundation; either version 2 of the License, or
9
+ # (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with this program; if not, write to the Free Software
18
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA.
19
+ #
20
+ # This program is also available under a commercial proprietary license.
21
+ # For more information, contact us at license @ x265.com
22
+ #
23
+ # Authors: Janani T.E <janani.te@multicorewareinc.com>, Srikanth Kurapati <srikanthkurapati@multicorewareinc.com>
24
+ #
25
+ #################################################################################################################
26
+ # PURPOSE: Identity version control software version display, also read version files to present x265 version.
27
+ #################################################################################################################
28
+ #Default Settings, for user to be vigilant about x265 version being reported during product build.
29
+set(X265_VERSION "unknown")
30
+set(X265_LATEST_TAG "0.0")
31
+set(X265_TAG_DISTANCE "0")
32
+
33
+#Find version control software to be used for live and extracted repositories from compressed tarballs
34
+if(CMAKE_VERSION VERSION_LESS "2.8.10")
35
+ find_program(HG_EXECUTABLE hg)
36
+ if(EXISTS "${HG_EXECUTABLE}.bat")
37
+ set(HG_EXECUTABLE "${HG_EXECUTABLE}.bat")
38
+ endif()
39
+ message(STATUS "hg found at ${HG_EXECUTABLE}")
40
+else()
41
+ find_package(Hg QUIET)
42
+endif()
43
+if(HG_EXECUTABLE)
44
+ #Set Version Control binary for source code kind
45
+ if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../.hg_archival.txt)
46
+ set(HG_ARCHETYPE "1")
47
+ elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../.hg)
48
+ set(HG_ARCHETYPE "0")
49
+ endif()
50
+endif(HG_EXECUTABLE)
51
+find_package(Git QUIET) #No restrictions on Git versions used, any versions from 1.8.x to 2.2.x or later should do.
52
+if(GIT_FOUND)
53
+ find_program(GIT_EXECUTABLE git)
54
+ message(STATUS "GIT_EXECUTABLE ${GIT_EXECUTABLE}")
55
+ if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../.git)
56
+ set(GIT_ARCHETYPE "0")
57
+ elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../x265Version.txt)
58
+ set(GIT_ARCHETYPE "1")
59
+ endif()
60
+endif(GIT_FOUND)
61
+if(HG_ARCHETYPE)
62
+ #Read the lines of the archive summary file to extract the version
63
+ message(STATUS "SOURCE CODE IS FROM x265 HG ARCHIVED ZIP OR TAR BALL")
64
+ file(READ ${CMAKE_CURRENT_SOURCE_DIR}/../.hg_archival.txt archive)
65
+ STRING(REGEX REPLACE "\n" ";" archive "${archive}")
66
+ foreach(f ${archive})
67
+ string(FIND "${f}" ": " pos)
68
+ string(SUBSTRING "${f}" 0 ${pos} key)
69
+ string(SUBSTRING "${f}" ${pos} -1 value)
70
+ string(SUBSTRING "${value}" 2 -1 value)
71
+ set(hg_${key} ${value})
72
+ endforeach()
73
+ if(DEFINED hg_tag)
74
+ set(X265_LATEST_TAG ${hg_tag})
75
+ elseif(DEFINED hg_node)
76
+ set(X265_LATEST_TAG ${hg_latesttag})
77
+ set(X265_TAG_DISTANCE ${hg_latesttagdistance})
78
+ string(SUBSTRING "${hg_node}" 0 12 X265_REVISION_ID)
79
+ endif()
80
+ message(STATUS "HG ARCHIVAL INFORMATION PROCESSED")
81
+elseif(NOT DEFINED GIT_ARCHETYPE)
82
+# means that's its neither hg archive nor git clone/archive hence it has to be hg live repo as these are only four cases that need to processed in mutual exclusion.
83
+ execute_process(COMMAND
84
+ ${HG_EXECUTABLE} log -r. --template "{latesttag}"
85
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
86
+ OUTPUT_VARIABLE X265_LATEST_TAG
87
+ ERROR_QUIET
88
+ OUTPUT_STRIP_TRAILING_WHITESPACE
89
+ )
90
+ execute_process(COMMAND
91
+ ${HG_EXECUTABLE} log -r. --template "{latesttagdistance}"
92
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
93
+ OUTPUT_VARIABLE X265_TAG_DISTANCE
94
+ ERROR_QUIET
95
+ OUTPUT_STRIP_TRAILING_WHITESPACE
96
+ )
97
+ execute_process(
98
+ COMMAND
99
+ ${HG_EXECUTABLE} log -r. --template "{node}"
100
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
101
+ OUTPUT_VARIABLE X265_REVISION_ID
102
+ ERROR_QUIET
103
+ OUTPUT_STRIP_TRAILING_WHITESPACE
104
+ )
105
+ string(SUBSTRING "${X265_REVISION_ID}" 0 12 X265_REVISION_ID)
106
+ if(X265_LATEST_TAG MATCHES "^r")
107
+ string(SUBSTRING ${X265_LATEST_TAG} 1 -1 X265_LATEST_TAG)
108
+ endif()
109
+ message(STATUS "HG LIVE REPO STATUS CHECK DONE")
110
+elseif(GIT_ARCHETYPE)
111
+ message(STATUS "SOURCE CODE IS FROM x265 GIT ARCHIVED ZIP OR TAR BALL")
112
+ #Read the lines of the archive summary file to extract the version
113
+ file(READ ${CMAKE_CURRENT_SOURCE_DIR}/../x265Version.txt filebuf)
114
+ STRING(REGEX REPLACE "\n" ";" filebuf "${filebuf}")
115
+ foreach(line ${filebuf})
116
+ string(FIND "${line}" ": " pos)
117
+ string(SUBSTRING "${line}" 0 ${pos} key)
118
+ string(SUBSTRING "${line}" ${pos} -1 value)
119
+ string(SUBSTRING "${value}" 2 -1 value)
120
+ set(git_${key} ${value})
121
+ endforeach()
122
+ if(DEFINED git_releasetag)
123
+ set(X265_LATEST_TAG ${git_releasetag})
124
+ if(DEFINED git_releasetagdistance)
125
+ set(X265_TAG_DISTANCE ${git_releasetagdistance})
126
+ if(X265_TAG_DISTANCE STRGREATER "0" OR X265_TAG_DISTANCE STREQUAL "0")
127
+ #for x265 the repository changeset has to be a tag id or commit id after the tag
128
+ #hence mandating it's presence in version file always for valid tag distances.
129
+ if(DEFINED git_repositorychangeset)
130
+ string(SUBSTRING "${git_repositorychangeset}" 0 9 X265_REVISION_ID)
131
+ else()
132
+ message(WARNING "X265 LATEST COMMIT TIP INFORMATION NOT AVAILABLE")
133
+ endif()
134
+ else()
135
+ message(WARNING "X265 TAG DISTANCE INVALID")
136
+ endif()
137
+ else()
138
+ message(WARNING "COMMIT INFORMATION AFTER LATEST REVISION UNAVAILABLE")
139
+ endif()
140
+ else()
141
+ message(WARNING "X265 RELEASE VERSION LABEL MISSING: ${X265_LATEST_TAG}")
142
+ endif()
143
+ message(STATUS "GIT ARCHIVAL INFORMATION PROCESSED")
144
+else()
145
+ execute_process(
146
+ COMMAND
147
+ ${GIT_EXECUTABLE} describe --abbrev=0 --tags
148
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
149
+ OUTPUT_VARIABLE X265_LATEST_TAG
150
+ ERROR_QUIET
151
+ OUTPUT_STRIP_TRAILING_WHITESPACE
152
+ )
153
+ execute_process(
154
+ COMMAND
155
+ ${GIT_EXECUTABLE} rev-list ${X265_LATEST_TAG}.. --count --first-parent
156
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
157
+ OUTPUT_VARIABLE X265_TAG_DISTANCE
158
+ ERROR_QUIET
159
+ OUTPUT_STRIP_TRAILING_WHITESPACE
160
+ )
161
+ execute_process(
162
+ COMMAND
163
+ ${GIT_EXECUTABLE} log --pretty=format:%h -n 1
164
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
165
+ OUTPUT_VARIABLE X265_REVISION_ID
166
+ ERROR_QUIET
167
+ OUTPUT_STRIP_TRAILING_WHITESPACE
168
+ )
169
+ message(STATUS "GIT LIVE REPO VERSION RETRIEVED")
170
+endif()
171
+
172
+# formatting based on distance from tag
173
+if(X265_TAG_DISTANCE STREQUAL "0")
174
+ set(X265_VERSION "${X265_LATEST_TAG}")
175
+elseif(X265_TAG_DISTANCE STRGREATER "0")
176
+ set(X265_VERSION "${X265_LATEST_TAG}+${X265_TAG_DISTANCE}-${X265_REVISION_ID}")
177
+endif()
178
+
179
+#will always be printed in its entirety based on version file configuration to avail revision monitoring by repo owners
180
+message(STATUS "X265 RELEASE VERSION ${X265_VERSION}")
181
x265_3.5.tar.gz/source/common
Added
2
1
+(directory)
2
x265_3.5.tar.gz/source/common/aarch64
Added
2
1
+(directory)
2
x265_3.5.tar.gz/source/common/arm
Added
2
1
+(directory)
2
x265_3.4.tar.gz/source/common/frame.cpp -> x265_3.5.tar.gz/source/common/frame.cpp
Changed
9
1
2
m_thetaPic = NULL;
3
m_edgeBitPlane = NULL;
4
m_edgeBitPic = NULL;
5
+ m_isInsideWindow = 0;
6
}
7
8
bool Frame::create(x265_param *param, float* quantOffsets)
9
x265_3.4.tar.gz/source/common/frame.h -> x265_3.5.tar.gz/source/common/frame.h
Changed
10
1
2
pixel* m_edgeBitPlane;
3
pixel* m_edgeBitPic;
4
5
+ int m_isInsideWindow;
6
+
7
Frame();
8
9
bool create(x265_param *param, float* quantOffsets);
10
x265_3.4.tar.gz/source/common/lowres.cpp -> x265_3.5.tar.gz/source/common/lowres.cpp
Changed
12
1
2
indB = 0;
3
memset(costEst, -1, sizeof(costEst));
4
memset(weightedCostDelta, 0, sizeof(weightedCostDelta));
5
+ interPCostPercDiff = 0.0;
6
+ intraCostPercDiff = 0.0;
7
+ m_bIsMaxThres = false;
8
+ m_bIsHardScenecut = false;
9
10
if (qpAqOffset && invQscaleFactor)
11
memset(costEstAq, -1, sizeof(costEstAq));
12
x265_3.4.tar.gz/source/common/lowres.h -> x265_3.5.tar.gz/source/common/lowres.h
Changed
14
1
2
uint16_t* propagateCost;
3
double weightedCostDelta[X265_BFRAME_MAX + 2];
4
ReferencePlanes weightedRef[X265_BFRAME_MAX + 2];
5
+ /* For hist-based scenecut */
6
+ bool m_bIsMaxThres;
7
+ double interPCostPercDiff;
8
+ double intraCostPercDiff;
9
+ bool m_bIsHardScenecut;
10
+
11
bool create(x265_param* param, PicYuv *origPic, uint32_t qgSize);
12
void destroy();
13
void init(PicYuv *origPic, int poc);
14
x265_3.4.tar.gz/source/common/param.cpp -> x265_3.5.tar.gz/source/common/param.cpp
Changed
201
1
2
param->bFrameAdaptive = X265_B_ADAPT_TRELLIS;
3
param->bBPyramid = 1;
4
param->scenecutThreshold = 40; /* Magic number pulled in from x264 */
5
- param->edgeTransitionThreshold = 0.01;
6
+ param->edgeTransitionThreshold = 0.03;
7
param->bHistBasedSceneCut = 0;
8
param->lookaheadSlices = 8;
9
param->lookaheadThreads = 0;
10
11
param->bEnableHRDConcatFlag = 0;
12
param->bEnableFades = 0;
13
param->bEnableSceneCutAwareQp = 0;
14
- param->scenecutWindow = 500;
15
- param->maxQpDelta = 5;
16
+ param->fwdScenecutWindow = 500;
17
+ param->fwdRefQpDelta = 5;
18
+ param->fwdNonRefQpDelta = param->fwdRefQpDelta + (SLICE_TYPE_DELTA * param->fwdRefQpDelta);
19
+ param->bwdScenecutWindow = 100;
20
+ param->bwdRefQpDelta = -1;
21
+ param->bwdNonRefQpDelta = -1;
22
23
/* Intra Coding Tools */
24
param->bEnableConstrainedIntra = 0;
25
26
param->rc.vbvBufferInit = 0.9;
27
param->vbvBufferEnd = 0;
28
param->vbvEndFrameAdjust = 0;
29
+ param->minVbvFullness = 50;
30
+ param->maxVbvFullness = 80;
31
param->rc.rfConstant = 28;
32
param->rc.bitrate = 0;
33
param->rc.qCompress = 0.6;
34
35
param->bResetZoneConfig = 1;
36
param->reconfigWindowSize = 0;
37
param->decoderVbvMaxRate = 0;
38
+ param->bliveVBV2pass = 0;
39
40
/* Video Usability Information (VUI) */
41
param->vui.aspectRatioIdc = 0;
42
43
p->vui.bEnableOverscanInfoPresentFlag = 1;
44
p->vui.bEnableOverscanAppropriateFlag = 1;
45
}
46
- else if (!strcmp(value, "undef"))
47
+ else if (!strcmp(value, "unknown"))
48
p->vui.bEnableOverscanInfoPresentFlag = 0;
49
else
50
bError = true;
51
52
p->selectiveSAO = atoi(value);
53
}
54
OPT("fades") p->bEnableFades = atobool(value);
55
- OPT("scenecut-aware-qp") p->bEnableSceneCutAwareQp = atobool(value);
56
- OPT("scenecut-window") p->scenecutWindow = atoi(value);
57
- OPT("max-qp-delta") p->maxQpDelta = atoi(value);
58
+ OPT("scenecut-aware-qp") p->bEnableSceneCutAwareQp = atoi(value);
59
+ OPT("masking-strength")
60
+ {
61
+ int window1;
62
+ double refQpDelta1, nonRefQpDelta1;
63
+
64
+ if (p->bEnableSceneCutAwareQp == FORWARD)
65
+ {
66
+ if (3 == sscanf(value, "%d,%lf,%lf", &window1, &refQpDelta1, &nonRefQpDelta1))
67
+ {
68
+ if (window1 > 0)
69
+ p->fwdScenecutWindow = window1;
70
+ if (refQpDelta1 > 0)
71
+ p->fwdRefQpDelta = refQpDelta1;
72
+ if (nonRefQpDelta1 > 0)
73
+ p->fwdNonRefQpDelta = nonRefQpDelta1;
74
+ }
75
+ else
76
+ {
77
+ x265_log(NULL, X265_LOG_ERROR, "Specify all the necessary offsets for masking-strength \n");
78
+ bError = true;
79
+ }
80
+ }
81
+ else if (p->bEnableSceneCutAwareQp == BACKWARD)
82
+ {
83
+ if (3 == sscanf(value, "%d,%lf,%lf", &window1, &refQpDelta1, &nonRefQpDelta1))
84
+ {
85
+ if (window1 > 0)
86
+ p->bwdScenecutWindow = window1;
87
+ if (refQpDelta1 > 0)
88
+ p->bwdRefQpDelta = refQpDelta1;
89
+ if (nonRefQpDelta1 > 0)
90
+ p->bwdNonRefQpDelta = nonRefQpDelta1;
91
+ }
92
+ else
93
+ {
94
+ x265_log(NULL, X265_LOG_ERROR, "Specify all the necessary offsets for masking-strength \n");
95
+ bError = true;
96
+ }
97
+ }
98
+ else if (p->bEnableSceneCutAwareQp == BI_DIRECTIONAL)
99
+ {
100
+ int window2;
101
+ double refQpDelta2, nonRefQpDelta2;
102
+ if (6 == sscanf(value, "%d,%lf,%lf,%d,%lf,%lf", &window1, &refQpDelta1, &nonRefQpDelta1, &window2, &refQpDelta2, &nonRefQpDelta2))
103
+ {
104
+ if (window1 > 0)
105
+ p->fwdScenecutWindow = window1;
106
+ if (refQpDelta1 > 0)
107
+ p->fwdRefQpDelta = refQpDelta1;
108
+ if (nonRefQpDelta1 > 0)
109
+ p->fwdNonRefQpDelta = nonRefQpDelta1;
110
+ if (window2 > 0)
111
+ p->bwdScenecutWindow = window2;
112
+ if (refQpDelta2 > 0)
113
+ p->bwdRefQpDelta = refQpDelta2;
114
+ if (nonRefQpDelta2 > 0)
115
+ p->bwdNonRefQpDelta = nonRefQpDelta2;
116
+ }
117
+ else
118
+ {
119
+ x265_log(NULL, X265_LOG_ERROR, "Specify all the necessary offsets for masking-strength \n");
120
+ bError = true;
121
+ }
122
+ }
123
+ }
124
OPT("field") p->bField = atobool( value );
125
OPT("cll") p->bEmitCLL = atobool(value);
126
OPT("frame-dup") p->bEnableFrameDuplication = atobool(value);
127
128
sscanf(value, "%d,%d,%d", &p->hmeRange[0], &p->hmeRange[1], &p->hmeRange[2]);
129
p->bEnableHME = true;
130
}
131
+ OPT("vbv-live-multi-pass") p->bliveVBV2pass = atobool(value);
132
+ OPT("min-vbv-fullness") p->minVbvFullness = atof(value);
133
+ OPT("max-vbv-fullness") p->maxVbvFullness = atof(value);
134
else
135
return X265_PARAM_BAD_NAME;
136
}
137
138
"Sample Aspect Ratio height must be greater than 0");
139
CHECK(param->vui.videoFormat < 0 || param->vui.videoFormat > 5,
140
"Video Format must be component,"
141
- " pal, ntsc, secam, mac or undef");
142
+ " pal, ntsc, secam, mac or unknown");
143
CHECK(param->vui.colorPrimaries < 0
144
|| param->vui.colorPrimaries > 12
145
|| param->vui.colorPrimaries == 3,
146
- "Color Primaries must be undef, bt709, bt470m,"
147
+ "Color Primaries must be unknown, bt709, bt470m,"
148
" bt470bg, smpte170m, smpte240m, film, bt2020, smpte-st-428, smpte-rp-431 or smpte-eg-432");
149
CHECK(param->vui.transferCharacteristics < 0
150
|| param->vui.transferCharacteristics > 18
151
|| param->vui.transferCharacteristics == 3,
152
- "Transfer Characteristics must be undef, bt709, bt470m, bt470bg,"
153
+ "Transfer Characteristics must be unknown, bt709, bt470m, bt470bg,"
154
" smpte170m, smpte240m, linear, log100, log316, iec61966-2-4, bt1361e,"
155
" iec61966-2-1, bt2020-10, bt2020-12, smpte-st-2084, smpte-st-428 or arib-std-b67");
156
CHECK(param->vui.matrixCoeffs < 0
157
|| param->vui.matrixCoeffs > 14
158
|| param->vui.matrixCoeffs == 3,
159
- "Matrix Coefficients must be undef, bt709, fcc, bt470bg, smpte170m,"
160
- " smpte240m, GBR, YCgCo, bt2020nc, bt2020c, smpte-st-2085, chroma-nc, chroma-c or ictcp");
161
+ "Matrix Coefficients must be unknown, bt709, fcc, bt470bg, smpte170m,"
162
+ " smpte240m, gbr, ycgco, bt2020nc, bt2020c, smpte-st-2085, chroma-nc, chroma-c or ictcp");
163
CHECK(param->vui.chromaSampleLocTypeTopField < 0
164
|| param->vui.chromaSampleLocTypeTopField > 5,
165
"Chroma Sample Location Type Top Field must be 0-5");
166
167
"scenecutThreshold must be greater than 0");
168
CHECK(param->scenecutBias < 0 || 100 < param->scenecutBias,
169
"scenecut-bias must be between 0 and 100");
170
- CHECK(param->edgeTransitionThreshold < 0.0 || 2.0 < param->edgeTransitionThreshold,
171
- "hist-threshold must be between 0.0 and 2.0");
172
+ CHECK(param->edgeTransitionThreshold < 0.0 || 1.0 < param->edgeTransitionThreshold,
173
+ "hist-threshold must be between 0.0 and 1.0");
174
CHECK(param->radl < 0 || param->radl > param->bframes,
175
"radl must be between 0 and bframes");
176
CHECK(param->rdPenalty < 0 || param->rdPenalty > 2,
177
178
"Valid vbv-end-fr-adj must be a fraction 0 - 1");
179
CHECK(!param->totalFrames && param->vbvEndFrameAdjust,
180
"vbv-end-fr-adj cannot be enabled when total number of frames is unknown");
181
+ CHECK(param->minVbvFullness < 0 && param->minVbvFullness > 100,
182
+ "min-vbv-fullness must be a fraction 0 - 100");
183
+ CHECK(param->maxVbvFullness < 0 && param->maxVbvFullness > 100,
184
+ "max-vbv-fullness must be a fraction 0 - 100");
185
CHECK(param->rc.bitrate < 0,
186
"Target bitrate can not be less than zero");
187
CHECK(param->rc.qCompress < 0.5 || param->rc.qCompress > 1.0,
188
189
CHECK((param->rc.vbvMaxBitrate <= 0 || param->rc.vbvBufferSize <= 0), "Dolby Vision requires VBV settings to enable HRD.\n");
190
CHECK((param->internalBitDepth != 10), "Dolby Vision profile - 5, profile - 8.1 and profile - 8.2 is Main10 only\n");
191
CHECK((param->internalCsp != X265_CSP_I420), "Dolby Vision profile - 5, profile - 8.1 and profile - 8.2 requires YCbCr 4:2:0 color space\n");
192
-
193
if (param->dolbyProfile == 81)
194
CHECK(!(param->masteringDisplayColorVolume), "Dolby Vision profile - 8.1 requires Mastering display color volume information\n");
195
}
196
-
197
if (param->bField && param->interlaceMode)
198
{
199
CHECK( (param->bFrameAdaptive==0), "Adaptive B-frame decision method should be closed for field feature.\n" );
200
201
x265_3.5.tar.gz/source/common/ppc
Added
2
1
+(directory)
2
x265_3.5.tar.gz/source/common/vec
Added
2
1
+(directory)
2
x265_3.5.tar.gz/source/common/x86
Added
2
1
+(directory)
2
x265_3.5.tar.gz/source/compat
Added
2
1
+(directory)
2
x265_3.5.tar.gz/source/compat/getopt
Added
2
1
+(directory)
2
x265_3.5.tar.gz/source/compat/msvc
Added
2
1
+(directory)
2
x265_3.5.tar.gz/source/dynamicHDR10
Added
2
1
+(directory)
2
x265_3.5.tar.gz/source/dynamicHDR10/json11
Added
2
1
+(directory)
2
x265_3.5.tar.gz/source/encoder
Added
2
1
+(directory)
2
x265_3.4.tar.gz/source/encoder/api.cpp -> x265_3.5.tar.gz/source/encoder/api.cpp
Changed
10
1
2
#include "svt.h"
3
4
#if ENABLE_LIBVMAF
5
-#include "libvmaf.h"
6
+#include "libvmaf/libvmaf.h"
7
#endif
8
9
/* multilib namespace reflectors */
10
x265_3.4.tar.gz/source/encoder/encoder.cpp -> x265_3.5.tar.gz/source/encoder/encoder.cpp
Changed
201
1
2
uint32_t pixelbytes = m_param->internalBitDepth > 8 ? 2 : 1;
3
m_edgePic = X265_MALLOC(pixel, m_planeSizes[0] * pixelbytes);
4
m_edgeHistThreshold = m_param->edgeTransitionThreshold;
5
- m_chromaHistThreshold = m_edgeHistThreshold * 10.0;
6
- m_chromaHistThreshold = x265_min(m_chromaHistThreshold, MAX_SCENECUT_THRESHOLD);
7
- m_scaledEdgeThreshold = m_edgeHistThreshold * SCENECUT_STRENGTH_FACTOR;
8
- m_scaledEdgeThreshold = x265_min(m_scaledEdgeThreshold, MAX_SCENECUT_THRESHOLD);
9
- m_scaledChromaThreshold = m_chromaHistThreshold * SCENECUT_STRENGTH_FACTOR;
10
- m_scaledChromaThreshold = x265_min(m_scaledChromaThreshold, MAX_SCENECUT_THRESHOLD);
11
+ m_chromaHistThreshold = x265_min(m_edgeHistThreshold * 10.0, MAX_SCENECUT_THRESHOLD);
12
+ m_scaledEdgeThreshold = x265_min(m_edgeHistThreshold * SCENECUT_STRENGTH_FACTOR, MAX_SCENECUT_THRESHOLD);
13
+ m_scaledChromaThreshold = x265_min(m_chromaHistThreshold * SCENECUT_STRENGTH_FACTOR, MAX_SCENECUT_THRESHOLD);
14
if (m_param->sourceBitDepth != m_param->internalBitDepth)
15
{
16
int size = m_param->sourceWidth * m_param->sourceHeight;
17
18
}
19
20
size_t bufSize = sizeof(pixel) * m_planeSizes[0];
21
- int32_t planeCount = x265_cli_csps[m_param->internalCsp].planes;
22
memset(m_edgePic, 0, bufSize);
23
24
if (!computeEdge(m_edgePic, src, NULL, pic->width, pic->height, pic->width, false, 1))
25
26
27
pixel pixelVal;
28
int32_t *edgeHist = m_curEdgeHist;
29
- memset(edgeHist, 0, 2 * sizeof(int32_t));
30
- for (int64_t i = 0; i < m_planeSizes[0]; i++)
31
+ memset(edgeHist, 0, EDGE_BINS * sizeof(int32_t));
32
+ for (uint32_t i = 0; i < m_planeSizes[0]; i++)
33
{
34
- if (!m_edgePic[i])
35
- edgeHist[0]++;
36
+ if (m_edgePic[i])
37
+ edgeHist[1]++;
38
else
39
- edgeHist[1]++;
40
+ edgeHist[0]++;
41
+ }
42
+
43
+ /* Y Histogram Calculation */
44
+ int32_t *yHist = m_curYUVHist[0];
45
+ memset(yHist, 0, HISTOGRAM_BINS * sizeof(int32_t));
46
+ for (uint32_t i = 0; i < m_planeSizes[0]; i++)
47
+ {
48
+ pixelVal = src[i];
49
+ yHist[pixelVal]++;
50
}
51
52
if (pic->colorSpace != X265_CSP_I400)
53
{
54
/* U Histogram Calculation */
55
- int32_t *uHist = m_curUVHist[0];
56
- memset(uHist, 0, HISTOGRAM_BINS * sizeof(int32_t));
57
-
58
- for (int64_t i = 0; i < m_planeSizes[1]; i++)
59
+ int32_t *uHist = m_curYUVHist[1];
60
+ memset(uHist, 0, sizeof(m_curYUVHist[1]));
61
+ for (uint32_t i = 0; i < m_planeSizes[1]; i++)
62
{
63
pixelVal = planeU[i];
64
uHist[pixelVal]++;
65
}
66
67
/* V Histogram Calculation */
68
- if (planeCount == 3)
69
+ pixelVal = 0;
70
+ int32_t *vHist = m_curYUVHist[2];
71
+ memset(vHist, 0, sizeof(m_curYUVHist[2]));
72
+ for (uint32_t i = 0; i < m_planeSizes[2]; i++)
73
{
74
- pixelVal = 0;
75
- int32_t *vHist = m_curUVHist[1];
76
- memset(vHist, 0, HISTOGRAM_BINS * sizeof(int32_t));
77
-
78
- for (int64_t i = 0; i < m_planeSizes[2]; i++)
79
- {
80
- pixelVal = planeV[i];
81
- vHist[pixelVal]++;
82
- }
83
- for (int i = 0; i < HISTOGRAM_BINS; i++)
84
- {
85
- m_curMaxUVHist[i] = x265_max(uHist[i], vHist[i]);
86
- }
87
- }
88
- else
89
- { /* in case of bi planar color space */
90
- memcpy(m_curMaxUVHist, m_curUVHist[0], HISTOGRAM_BINS * sizeof(int32_t));
91
+ pixelVal = planeV[i];
92
+ vHist[pixelVal]++;
93
}
94
}
95
return true;
96
}
97
98
-void Encoder::computeHistogramSAD(double *maxUVNormalizedSad, double *edgeNormalizedSad, int curPoc)
99
+void Encoder::computeHistogramSAD(double *normalizedMaxUVSad, double *normalizedEdgeSad, int curPoc)
100
{
101
102
if (curPoc == 0)
103
{ /* first frame is scenecut by default no sad computation for the same. */
104
- *maxUVNormalizedSad = 0.0;
105
- *edgeNormalizedSad = 0.0;
106
+ *normalizedMaxUVSad = 0.0;
107
+ *normalizedEdgeSad = 0.0;
108
}
109
else
110
{
111
- /* compute sum of absolute difference of normalized histogram bins for maxUV and edge histograms. */
112
- int32_t edgefreqDiff = 0;
113
- int32_t maxUVfreqDiff = 0;
114
- double edgeProbabilityDiff = 0;
115
+ /* compute sum of absolute differences of histogram bins of chroma and luma edge response between the current and prev pictures. */
116
+ int32_t edgeHistSad = 0;
117
+ int32_t uHistSad = 0;
118
+ int32_t vHistSad = 0;
119
+ double normalizedUSad = 0.0;
120
+ double normalizedVSad = 0.0;
121
122
for (int j = 0; j < HISTOGRAM_BINS; j++)
123
{
124
if (j < 2)
125
{
126
- edgefreqDiff = abs(m_curEdgeHist[j] - m_prevEdgeHist[j]);
127
- edgeProbabilityDiff = (double) edgefreqDiff / m_planeSizes[0];
128
- *edgeNormalizedSad += edgeProbabilityDiff;
129
+ edgeHistSad += abs(m_curEdgeHist[j] - m_prevEdgeHist[j]);
130
}
131
- maxUVfreqDiff = abs(m_curMaxUVHist[j] - m_prevMaxUVHist[j]);
132
- *maxUVNormalizedSad += (double)maxUVfreqDiff / m_planeSizes[2];
133
+ uHistSad += abs(m_curYUVHist[1][j] - m_prevYUVHist[1][j]);
134
+ vHistSad += abs(m_curYUVHist[2][j] - m_prevYUVHist[2][j]);
135
}
136
+ *normalizedEdgeSad = normalizeRange(edgeHistSad, 0, 2 * m_planeSizes[0], 0.0, 1.0);
137
+ normalizedUSad = normalizeRange(uHistSad, 0, 2 * m_planeSizes[1], 0.0, 1.0);
138
+ normalizedVSad = normalizeRange(vHistSad, 0, 2 * m_planeSizes[2], 0.0, 1.0);
139
+ *normalizedMaxUVSad = x265_max(normalizedUSad, normalizedVSad);
140
}
141
142
/* store histograms of previous frame for reference */
143
- size_t bufsize = HISTOGRAM_BINS * sizeof(int32_t);
144
- memcpy(m_prevMaxUVHist, m_curMaxUVHist, bufsize);
145
- memcpy(m_prevEdgeHist, m_curEdgeHist, 2 * sizeof(int32_t));
146
+ memcpy(m_prevEdgeHist, m_curEdgeHist, sizeof(m_curEdgeHist));
147
+ memcpy(m_prevYUVHist, m_curYUVHist, sizeof(m_curYUVHist));
148
+}
149
+
150
+double Encoder::normalizeRange(int32_t value, int32_t minValue, int32_t maxValue, double rangeStart, double rangeEnd)
151
+{
152
+ return (double)(value - minValue) * (rangeEnd - rangeStart) / (maxValue - minValue) + rangeStart;
153
}
154
155
-void Encoder::findSceneCuts(x265_picture *pic, bool& bDup, double maxUVSad, double edgeSad)
156
+void Encoder::findSceneCuts(x265_picture *pic, bool& bDup, double maxUVSad, double edgeSad, bool& isMaxThres, bool& isHardSC)
157
{
158
+ double minEdgeT = m_edgeHistThreshold * MIN_EDGE_FACTOR;
159
+ double minChromaT = minEdgeT * SCENECUT_CHROMA_FACTOR;
160
+ double maxEdgeT = m_edgeHistThreshold * MAX_EDGE_FACTOR;
161
+ double maxChromaT = maxEdgeT * SCENECUT_CHROMA_FACTOR;
162
pic->frameData.bScenecut = false;
163
164
if (pic->poc == 0)
165
166
{
167
bDup = true;
168
}
169
- else if (edgeSad > m_edgeHistThreshold && maxUVSad >= m_chromaHistThreshold)
170
+ else if (edgeSad < minEdgeT && maxUVSad < minChromaT)
171
+ {
172
+ pic->frameData.bScenecut = false;
173
+ }
174
+ else if (edgeSad > maxEdgeT && maxUVSad > maxChromaT)
175
{
176
pic->frameData.bScenecut = true;
177
- bDup = false;
178
+ isMaxThres = true;
179
+ isHardSC = true;
180
}
181
- else if (edgeSad > m_scaledEdgeThreshold || maxUVSad >= m_scaledChromaThreshold)
182
+ else if (edgeSad > m_scaledEdgeThreshold || maxUVSad >= m_scaledChromaThreshold
183
+ || (edgeSad > m_edgeHistThreshold && maxUVSad >= m_chromaHistThreshold))
184
{
185
pic->frameData.bScenecut = true;
186
bDup = false;
187
+ if (edgeSad > m_scaledEdgeThreshold || maxUVSad >= m_scaledChromaThreshold)
188
+ isHardSC = true;
189
}
190
}
191
-
192
- if (pic->frameData.bScenecut)
193
- x265_log(m_param, X265_LOG_DEBUG, "scene cut at %d \n", pic->poc);
194
}
195
196
/**
197
198
bool dontRead = false;
199
bool bdropFrame = false;
200
bool dropflag = false;
201
x265_3.4.tar.gz/source/encoder/encoder.h -> x265_3.5.tar.gz/source/encoder/encoder.h
Changed
36
1
2
class ThreadPool;
3
class FrameData;
4
5
-#define MAX_SCENECUT_THRESHOLD 2.0
6
+#define MAX_SCENECUT_THRESHOLD 1.0
7
#define SCENECUT_STRENGTH_FACTOR 2.0
8
+#define MIN_EDGE_FACTOR 0.5
9
+#define MAX_EDGE_FACTOR 1.5
10
+#define SCENECUT_CHROMA_FACTOR 10.0
11
12
class Encoder : public x265_encoder
13
{
14
15
/* For histogram based scene-cut detection */
16
pixel* m_edgePic;
17
pixel* m_inputPic[3];
18
- int32_t m_curUVHist[2][HISTOGRAM_BINS];
19
- int32_t m_curMaxUVHist[HISTOGRAM_BINS];
20
- int32_t m_prevMaxUVHist[HISTOGRAM_BINS];
21
+ int32_t m_curYUVHist[3][HISTOGRAM_BINS];
22
+ int32_t m_prevYUVHist[3][HISTOGRAM_BINS];
23
int32_t m_curEdgeHist[2];
24
int32_t m_prevEdgeHist[2];
25
uint32_t m_planeSizes[3];
26
27
28
bool computeHistograms(x265_picture *pic);
29
void computeHistogramSAD(double *maxUVNormalizedSAD, double *edgeNormalizedSAD, int curPoc);
30
- void findSceneCuts(x265_picture *pic, bool& bDup, double m_maxUVSADVal, double m_edgeSADVal);
31
+ double normalizeRange(int32_t value, int32_t minValue, int32_t maxValue, double rangeStart, double rangeEnd);
32
+ void findSceneCuts(x265_picture *pic, bool& bDup, double m_maxUVSADVal, double m_edgeSADVal, bool& isMaxThres, bool& isHardSC);
33
34
void initRefIdx();
35
void analyseRefIdx(int *numRefIdx);
36
x265_3.4.tar.gz/source/encoder/frameencoder.cpp -> x265_3.5.tar.gz/source/encoder/frameencoder.cpp
Changed
113
1
2
m_slicetypeWaitTime = 0;
3
m_activeWorkerCount = 0;
4
m_completionCount = 0;
5
- m_bAllRowsStop = false;
6
- m_vbvResetTriggerRow = -1;
7
m_outStreams = NULL;
8
m_backupStreams = NULL;
9
m_substreamSizes = NULL;
10
11
delete[] m_outStreams;
12
delete[] m_backupStreams;
13
X265_FREE(m_sliceBaseRow);
14
+ X265_FREE((void*)m_bAllRowsStop);
15
+ X265_FREE((void*)m_vbvResetTriggerRow);
16
X265_FREE(m_sliceMaxBlockRow);
17
X265_FREE(m_cuGeoms);
18
X265_FREE(m_ctuGeomMap);
19
20
bool ok = !!m_numRows;
21
22
m_sliceBaseRow = X265_MALLOC(uint32_t, m_param->maxSlices + 1);
23
+ m_bAllRowsStop = X265_MALLOC(bool, m_param->maxSlices);
24
+ m_vbvResetTriggerRow = X265_MALLOC(int, m_param->maxSlices);
25
ok &= !!m_sliceBaseRow;
26
m_sliceGroupSize = (uint16_t)(m_numRows + m_param->maxSlices - 1) / m_param->maxSlices;
27
uint32_t sliceGroupSizeAccu = (m_numRows << 8) / m_param->maxSlices;
28
29
m_stallStartTime = 0;
30
31
m_completionCount = 0;
32
- m_bAllRowsStop = false;
33
- m_vbvResetTriggerRow = -1;
34
+ memset((void*)m_bAllRowsStop, 0, sizeof(bool) * m_param->maxSlices);
35
+ memset((void*)m_vbvResetTriggerRow, -1, sizeof(int) * m_param->maxSlices);
36
m_rowSliceTotalBits[0] = 0;
37
m_rowSliceTotalBits[1] = 0;
38
39
40
curRow.bufferedEntropy.copyState(rowCoder);
41
curRow.bufferedEntropy.loadContexts(rowCoder);
42
}
43
- if (bFirstRowInSlice && m_vbvResetTriggerRow != intRow)
44
+ if (bFirstRowInSlice && m_vbvResetTriggerRow[curRow.sliceId] != intRow)
45
{
46
curEncData.m_rowStat[row].rowQp = curEncData.m_avgQpRc;
47
curEncData.m_rowStat[row].rowQpScale = x265_qp2qScale(curEncData.m_avgQpRc);
48
}
49
50
FrameData::RCStatCU& cuStat = curEncData.m_cuStat[cuAddr];
51
- if (m_param->bEnableWavefront && rowInSlice >= col && !bFirstRowInSlice && m_vbvResetTriggerRow != intRow)
52
+ if (m_param->bEnableWavefront && rowInSlice >= col && !bFirstRowInSlice && m_vbvResetTriggerRow[curRow.sliceId] != intRow)
53
cuStat.baseQp = curEncData.m_cuStat[cuAddr - numCols + 1].baseQp;
54
- else if (!m_param->bEnableWavefront && !bFirstRowInSlice && m_vbvResetTriggerRow != intRow)
55
+ else if (!m_param->bEnableWavefront && !bFirstRowInSlice && m_vbvResetTriggerRow[curRow.sliceId] != intRow)
56
cuStat.baseQp = curEncData.m_rowStat[row - 1].rowQp;
57
else
58
cuStat.baseQp = curEncData.m_rowStat[row].rowQp;
59
60
x265_log(m_param, X265_LOG_DEBUG, "POC %d row %d - encode restart required for VBV, to %.2f from %.2f\n",
61
m_frame->m_poc, row, qpBase, curEncData.m_cuStat[cuAddr].baseQp);
62
63
- m_vbvResetTriggerRow = row;
64
+ m_vbvResetTriggerRow[curRow.sliceId] = row;
65
m_outStreams[0].copyBits(&m_backupStreams[0]);
66
67
rowCoder.copyState(curRow.bufferedEntropy);
68
69
m_frame->m_poc, row, qpBase, curEncData.m_cuStat[cuAddr].baseQp);
70
71
// prevent the WaveFront::findJob() method from providing new jobs
72
- m_vbvResetTriggerRow = row;
73
- m_bAllRowsStop = true;
74
+ m_vbvResetTriggerRow[curRow.sliceId] = row;
75
+ m_bAllRowsStop[curRow.sliceId] = true;
76
77
for (uint32_t r = m_sliceBaseRow[sliceId + 1] - 1; r >= row; r--)
78
{
79
80
stopRow.lock.acquire();
81
while (stopRow.active)
82
{
83
- if (dequeueRow(r * 2))
84
+ if (dequeueRow(m_row_to_idx[r] * 2))
85
stopRow.active = false;
86
else
87
{
88
89
curEncData.m_rowStat[r].sumQpAq = 0;
90
}
91
92
- m_bAllRowsStop = false;
93
+ m_bAllRowsStop[curRow.sliceId] = false;
94
}
95
}
96
}
97
98
if (m_param->bEnableWavefront && curRow.completed >= 2 && !bLastRowInSlice &&
99
- (!m_bAllRowsStop || intRow + 1 < m_vbvResetTriggerRow))
100
+ (!m_bAllRowsStop[curRow.sliceId] || intRow + 1 < m_vbvResetTriggerRow[curRow.sliceId]))
101
{
102
/* activate next row */
103
ScopedLock below(m_rows[row + 1].lock);
104
105
}
106
107
ScopedLock self(curRow.lock);
108
- if ((m_bAllRowsStop && intRow > m_vbvResetTriggerRow) ||
109
+ if ((m_bAllRowsStop[curRow.sliceId] && intRow > m_vbvResetTriggerRow[curRow.sliceId]) ||
110
(!bFirstRowInSlice && ((curRow.completed < numCols - 1) || (m_rows[row - 1].completed < numCols)) && m_rows[row - 1].completed < curRow.completed + 2))
111
{
112
curRow.active = false;
113
x265_3.4.tar.gz/source/encoder/frameencoder.h -> x265_3.5.tar.gz/source/encoder/frameencoder.h
Changed
13
1
2
int m_localTldIdx;
3
bool m_reconfigure; /* reconfigure in progress */
4
volatile bool m_threadActive;
5
- volatile bool m_bAllRowsStop;
6
+ volatile bool *m_bAllRowsStop;
7
volatile int m_completionCount;
8
- volatile int m_vbvResetTriggerRow;
9
+ volatile int *m_vbvResetTriggerRow;
10
volatile int m_sliceCnt;
11
12
uint32_t m_numRows;
13
x265_3.4.tar.gz/source/encoder/ratecontrol.cpp -> x265_3.5.tar.gz/source/encoder/ratecontrol.cpp
Changed
201
1
2
m_bufferFillFinal = m_bufferSize * m_param->rc.vbvBufferInit;
3
m_bufferFillActual = m_bufferFillFinal;
4
m_bufferExcess = 0;
5
+ m_minBufferFill = m_param->minVbvFullness / 100;
6
+ m_maxBufferFill = 1 - (m_param->maxVbvFullness / 100);
7
m_initVbv = true;
8
}
9
10
11
double totalQpAq = 0;
12
for (int i = 0; i < m_numEntries; i++)
13
{
14
- RateControlEntry *rce;
15
+ RateControlEntry *rce, *rcePocOrder;
16
int frameNumber;
17
int encodeOrder;
18
char picType;
19
20
return false;
21
}
22
rce = &m_rce2Pass[encodeOrder];
23
+ rcePocOrder = &m_rce2Pass[frameNumber];
24
m_encOrder[frameNumber] = encodeOrder;
25
if (!m_param->bMultiPassOptRPS)
26
{
27
- e += sscanf(p, " in:%*d out:%*d type:%c q:%lf q-aq:%lf q-noVbv:%lf q-Rceq:%lf tex:%d mv:%d misc:%d icu:%lf pcu:%lf scu:%lf",
28
+ int scenecut = 0;
29
+ e += sscanf(p, " in:%*d out:%*d type:%c q:%lf q-aq:%lf q-noVbv:%lf q-Rceq:%lf tex:%d mv:%d misc:%d icu:%lf pcu:%lf scu:%lf sc:%d",
30
&picType, &qpRc, &qpAq, &qNoVbv, &qRceq, &rce->coeffBits,
31
&rce->mvBits, &rce->miscBits, &rce->iCuCount, &rce->pCuCount,
32
- &rce->skipCuCount);
33
+ &rce->skipCuCount, &scenecut);
34
+ rcePocOrder->scenecut = scenecut != 0;
35
}
36
else
37
{
38
39
copyRceData(rce, &m_rce2Pass[index]);
40
}
41
rce->isActive = true;
42
- rce->scenecut = false;
43
+ if (!m_param->rc.bStatRead)
44
+ rce->scenecut = false;
45
rce->isFadeEnd = curFrame->m_lowres.bIsFadeEnd;
46
bool isRefFrameScenecut = m_sliceType!= I_SLICE && m_curSlice->m_refFrameList[0][0]->m_lowres.bScenecut;
47
m_isFirstMiniGop = m_sliceType == I_SLICE ? true : m_isFirstMiniGop;
48
49
g_sliceTypeToChar[m_sliceType], g_sliceTypeToChar[rce->sliceType]);
50
}
51
}
52
- else
53
+
54
+ if ((m_param->bliveVBV2pass && m_param->rc.rateControlMode == X265_RC_ABR) || m_isAbr)
55
{
56
- if (m_isAbr)
57
+ int pos = m_sliderPos % s_slidingWindowFrames;
58
+ int addPos = (pos + s_slidingWindowFrames - 1) % s_slidingWindowFrames;
59
+ if (m_sliderPos > s_slidingWindowFrames)
60
{
61
- int pos = m_sliderPos % s_slidingWindowFrames;
62
- int addPos = (pos + s_slidingWindowFrames - 1) % s_slidingWindowFrames;
63
- if (m_sliderPos > s_slidingWindowFrames)
64
- {
65
- const static double base = pow(0.5, s_slidingWindowFrames - 1);
66
- m_movingAvgSum -= m_lastRemovedSatdCost * base;
67
- m_movingAvgSum *= 0.5;
68
- m_movingAvgSum += m_satdCostWindow[addPos];
69
- }
70
- else if (m_sliderPos == s_slidingWindowFrames)
71
- {
72
- m_movingAvgSum += m_satdCostWindow[addPos];
73
- }
74
- else if (m_sliderPos > 0)
75
- {
76
- m_movingAvgSum += m_satdCostWindow[addPos];
77
- m_movingAvgSum *= 0.5;
78
- }
79
-
80
- rce->movingAvgSum = m_movingAvgSum;
81
- m_lastRemovedSatdCost = m_satdCostWindow[pos];
82
- m_satdCostWindow[pos] = rce->lastSatd;
83
- m_sliderPos++;
84
+ const static double base = pow(0.5, s_slidingWindowFrames - 1);
85
+ m_movingAvgSum -= m_lastRemovedSatdCost * base;
86
+ m_movingAvgSum *= 0.5;
87
+ m_movingAvgSum += m_satdCostWindow[addPos];
88
+ }
89
+ else if (m_sliderPos == s_slidingWindowFrames)
90
+ {
91
+ m_movingAvgSum += m_satdCostWindow[addPos];
92
+ }
93
+ else if (m_sliderPos > 0)
94
+ {
95
+ m_movingAvgSum += m_satdCostWindow[addPos];
96
+ m_movingAvgSum *= 0.5;
97
}
98
+
99
+ rce->movingAvgSum = m_movingAvgSum;
100
+ m_lastRemovedSatdCost = m_satdCostWindow[pos];
101
+ m_satdCostWindow[pos] = rce->lastSatd;
102
+ m_sliderPos++;
103
}
104
105
if (m_sliceType == B_SLICE)
106
107
{
108
double lqmin = m_lmin[m_sliceType];
109
double lqmax = m_lmax[m_sliceType];
110
- qScale = scenecutAwareQp(curFrame, qScale);
111
+ if (m_param->bEnableSceneCutAwareQp & FORWARD)
112
+ qScale = forwardMasking(curFrame, qScale);
113
+ if (m_param->bEnableSceneCutAwareQp & BACKWARD)
114
+ qScale = backwardMasking(curFrame, qScale);
115
qScale = x265_clip3(lqmin, lqmax, qScale);
116
q = x265_qScale2qp(qScale);
117
rce->qpNoVbv = q;
118
}
119
+
120
if (m_isVbv)
121
{
122
lmin = m_lastQScaleFor[P_SLICE] / m_lstep;
123
124
qScale = x265_clip3(lqmin, lqmax, qScale);
125
}
126
127
- if (!m_2pass)
128
+ if (!m_2pass || m_param->bliveVBV2pass)
129
{
130
/* clip qp to permissible range after vbv-lookahead estimation to avoid possible
131
* mispredictions by initial frame size predictors */
132
133
else
134
q /= zone->bitrateFactor;
135
}
136
- q /= x265_clip3(0.5, 2.0, (double)(abrBuffer - diff) / abrBuffer);
137
+ /*Existing ABR conformance check may not be valid with real time VBV*/
138
+ if(!m_param->bliveVBV2pass)
139
+ q /= x265_clip3(0.5, 2.0, (double)(abrBuffer - diff) / abrBuffer);
140
if (m_expectedBitsSum > 0)
141
{
142
/* Adjust quant based on the difference between
143
144
m_avgPFrameQp = (m_avgPFrameQp + rce->qpNoVbv) / 2;
145
}
146
147
+ /* Scenecut Aware QP offsets*/
148
+ if (m_param->bEnableSceneCutAwareQp)
149
+ {
150
+ double qmin = m_lmin[m_sliceType];
151
+ double qmax = m_lmax[m_sliceType];
152
+
153
+ if (m_param->bEnableSceneCutAwareQp & FORWARD)
154
+ q = forwardMasking(curFrame, q);
155
+ if (m_param->bEnableSceneCutAwareQp & BACKWARD)
156
+ q = backwardMasking(curFrame, q);
157
+
158
+ q = x265_clip3(qmin, qmax, q);
159
+ rce->qpNoVbv = x265_qScale2qp(q);
160
+ }
161
+
162
if (m_isVbv)
163
{
164
- /* Do not overflow vbv */
165
- double expectedSize = qScale2bits(rce, q);
166
- double expectedVbv = m_bufferFill + m_bufferRate - expectedSize;
167
- double expectedFullness = rce->expectedVbv / m_bufferSize;
168
- double qmax = q * (2 - expectedFullness);
169
- double sizeConstraint = 1 + expectedFullness;
170
- qmax = X265_MAX(qmax, rce->newQScale);
171
- if (expectedFullness < .05)
172
- qmax = lmax;
173
- qmax = X265_MIN(qmax, lmax);
174
- while (((expectedVbv < rce->expectedVbv/sizeConstraint) && (q < qmax)) ||
175
+ if (!m_param->bliveVBV2pass)
176
+ {
177
+ /* Do not overflow vbv */
178
+ double expectedSize = qScale2bits(rce, q);
179
+ double expectedVbv = m_bufferFill + m_bufferRate - expectedSize;
180
+ double expectedFullness = rce->expectedVbv / m_bufferSize;
181
+ double qmax = q * (2 - expectedFullness);
182
+ double sizeConstraint = 1 + expectedFullness;
183
+ qmax = X265_MAX(qmax, rce->newQScale);
184
+ if (expectedFullness < .05)
185
+ qmax = lmax;
186
+ qmax = X265_MIN(qmax, lmax);
187
+ while (((expectedVbv < rce->expectedVbv / sizeConstraint) && (q < qmax)) ||
188
((expectedVbv < 0) && (q < lmax)))
189
+ {
190
+ q *= 1.05;
191
+ expectedSize = qScale2bits(rce, q);
192
+ expectedVbv = m_bufferFill + m_bufferRate - expectedSize;
193
+ }
194
+ }
195
+ else
196
{
197
- q *= 1.05;
198
- expectedSize = qScale2bits(rce, q);
199
- expectedVbv = m_bufferFill + m_bufferRate - expectedSize;
200
+ /* clip qp to permissible range after vbv-lookahead estimation to avoid possible
201
x265_3.4.tar.gz/source/encoder/ratecontrol.h -> x265_3.5.tar.gz/source/encoder/ratecontrol.h
Changed
35
1
2
#define CLIP_DURATION(f) x265_clip3(MIN_FRAME_DURATION, MAX_FRAME_DURATION, f)
3
4
/*Scenecut Aware QP*/
5
-#define I_SLICE_DELTA 2 /* Subtracted from base QP for the scenecut I frames*/
6
-#define SLICE_TYPE_DELTA 0.3 /* The offset decremented or incremented for P-frames or b-frames respectively*/
7
-#define WINDOW1_DELTA 0 /* The offset for the frames coming in the window-1*/
8
-#define WINDOW2_DELTA 0.3 /* The offset for the frames coming in the window-2*/
9
-#define WINDOW3_DELTA 0.6 /* The offset for the frames coming in the window-3*/
10
+#define WINDOW1_DELTA 1.0 /* The offset for the frames coming in the window-1*/
11
+#define WINDOW2_DELTA 0.7 /* The offset for the frames coming in the window-2*/
12
+#define WINDOW3_DELTA 0.4 /* The offset for the frames coming in the window-3*/
13
14
struct Predictor
15
{
16
17
double m_avgPFrameQp;
18
double m_bufferFillActual;
19
double m_bufferExcess;
20
+ double m_minBufferFill;
21
+ double m_maxBufferFill;
22
bool m_isFirstMiniGop;
23
Predictor m_pred[4]; /* Slice predictors to preidct bits for each Slice type - I,P,Bref and B */
24
int64_t m_leadingNoBSatd;
25
26
int writeRateControlFrameStats(Frame* curFrame, RateControlEntry* rce);
27
bool initPass2();
28
29
- double scenecutAwareQp(Frame* curFrame, double q);
30
+ double forwardMasking(Frame* curFrame, double q);
31
+ double backwardMasking(Frame* curFrame, double q);
32
33
protected:
34
35
x265_3.4.tar.gz/source/encoder/slicetype.cpp -> x265_3.5.tar.gz/source/encoder/slicetype.cpp
Changed
201
1
2
}
3
}
4
5
- if (m_lastNonB && !m_param->rc.bStatRead &&
6
+ if (m_lastNonB &&
7
((m_param->bFrameAdaptive && m_param->bframes) ||
8
m_param->rc.cuTree || m_param->scenecutThreshold || m_param->bHistBasedSceneCut ||
9
(m_param->lookaheadDepth && m_param->rc.vbvBufferSize)))
10
{
11
- slicetypeAnalyse(frames, false);
12
+ if(!m_param->rc.bStatRead)
13
+ slicetypeAnalyse(frames, false);
14
bool bIsVbv = m_param->rc.vbvBufferSize > 0 && m_param->rc.vbvMaxBitrate > 0;
15
- if (m_param->analysisLoad && m_param->scaleFactor && bIsVbv)
16
+ if ((m_param->analysisLoad && m_param->scaleFactor && bIsVbv) || m_param->bliveVBV2pass)
17
{
18
int numFrames;
19
for (numFrames = 0; numFrames < maxSearch; numFrames++)
20
21
if (!fenc)
22
break;
23
}
24
- vbvLookahead(frames, numFrames, true);
25
+ vbvLookahead(frames, numFrames, false);
26
}
27
}
28
29
int bframes, brefs;
30
if (!m_param->analysisLoad || m_param->bAnalysisType == HEVC_INFO)
31
{
32
+ bool isClosedGopRadl = m_param->radl && (m_param->keyframeMax != m_param->keyframeMin);
33
for (bframes = 0, brefs = 0;; bframes++)
34
{
35
Lowres& frm = list[bframes]->m_lowres;
36
37
else
38
frm.sliceType = X265_TYPE_IDR;
39
}
40
+ if (frm.sliceType == X265_TYPE_IDR && frm.bScenecut && isClosedGopRadl)
41
+ {
42
+ if (!m_param->bHistBasedSceneCut || (m_param->bHistBasedSceneCut && frm.m_bIsHardScenecut))
43
+ {
44
+ for (int i = bframes; i < bframes + m_param->radl; i++)
45
+ list[i]->m_lowres.sliceType = X265_TYPE_B;
46
+ list[(bframes + m_param->radl)]->m_lowres.sliceType = X265_TYPE_IDR;
47
+ }
48
+ }
49
if (frm.sliceType == X265_TYPE_IDR)
50
{
51
/* Closed GOP */
52
53
}
54
}
55
56
- bool isKeyFrameAnalyse = (m_param->rc.cuTree || (m_param->rc.vbvBufferSize && m_param->lookaheadDepth)) && !m_param->rc.bStatRead;
57
+ bool isKeyFrameAnalyse = (m_param->rc.cuTree || (m_param->rc.vbvBufferSize && m_param->lookaheadDepth));
58
if (isKeyFrameAnalyse && IS_X265_TYPE_I(m_lastNonB->sliceType))
59
{
60
m_inputLock.acquire();
61
62
m_inputLock.release();
63
64
frames[j + 1] = NULL;
65
- slicetypeAnalyse(frames, true);
66
+ if (!m_param->rc.bStatRead)
67
+ slicetypeAnalyse(frames, true);
68
bool bIsVbv = m_param->rc.vbvBufferSize > 0 && m_param->rc.vbvMaxBitrate > 0;
69
- if (m_param->analysisLoad && m_param->scaleFactor && bIsVbv)
70
+ if ((m_param->analysisLoad && m_param->scaleFactor && bIsVbv) || m_param->bliveVBV2pass)
71
{
72
int numFrames;
73
for (numFrames = 0; numFrames < maxSearch; numFrames++)
74
75
void Lookahead::vbvLookahead(Lowres **frames, int numFrames, int keyframe)
76
{
77
int prevNonB = 0, curNonB = 1, idx = 0;
78
- while (curNonB < numFrames && frames[curNonB]->sliceType == X265_TYPE_B)
79
+ while (curNonB < numFrames && IS_X265_TYPE_B(frames[curNonB]->sliceType))
80
curNonB++;
81
int nextNonB = keyframe ? prevNonB : curNonB;
82
int nextB = prevNonB + 1;
83
84
}
85
prevNonB = curNonB;
86
curNonB++;
87
- while (curNonB <= numFrames && frames[curNonB]->sliceType == X265_TYPE_B)
88
+ while (curNonB <= numFrames && IS_X265_TYPE_B(frames[curNonB]->sliceType))
89
curNonB++;
90
}
91
92
93
int numAnalyzed = numFrames;
94
bool isScenecut = false;
95
96
- /* When scenecut threshold is set, use scenecut detection for I frame placements */
97
+ /* Temporal computations for scenecut detection */
98
if (m_param->bHistBasedSceneCut)
99
- isScenecut = frames[1]->bScenecut;
100
- else
101
+ {
102
+ for (int i = numFrames - 1; i > 0; i--)
103
+ {
104
+ if (frames[i]->interPCostPercDiff > 0.0)
105
+ continue;
106
+ int64_t interCost = frames[i]->costEst[1][0];
107
+ int64_t intraCost = frames[i]->costEst[0][0];
108
+ if (interCost < 0 || intraCost < 0)
109
+ continue;
110
+ int times = 0;
111
+ double averagePcost = 0.0, averageIcost = 0.0;
112
+ for (int j = i - 1; j >= 0 && times < 5; j--, times++)
113
+ {
114
+ if (frames[j]->costEst[0][0] > 0 && frames[j]->costEst[1][0] > 0)
115
+ {
116
+ averageIcost += frames[j]->costEst[0][0];
117
+ averagePcost += frames[j]->costEst[1][0];
118
+ }
119
+ else
120
+ times--;
121
+ }
122
+ if (times)
123
+ {
124
+ averageIcost = averageIcost / times;
125
+ averagePcost = averagePcost / times;
126
+ frames[i]->interPCostPercDiff = abs(interCost - averagePcost) / X265_MIN(interCost, averagePcost) * 100;
127
+ frames[i]->intraCostPercDiff = abs(intraCost - averageIcost) / X265_MIN(intraCost, averageIcost) * 100;
128
+ }
129
+ }
130
+ }
131
+
132
+ /* When scenecut threshold is set, use scenecut detection for I frame placements */
133
+ if (!m_param->bHistBasedSceneCut || (m_param->bHistBasedSceneCut && frames[1]->bScenecut))
134
isScenecut = scenecut(frames, 0, 1, true, origNumFrames);
135
136
if (isScenecut && (m_param->bHistBasedSceneCut || m_param->scenecutThreshold))
137
138
m_extendGopBoundary = false;
139
for (int i = m_param->bframes + 1; i < origNumFrames; i += m_param->bframes + 1)
140
{
141
- if (!m_param->bHistBasedSceneCut)
142
+ if (!m_param->bHistBasedSceneCut || (m_param->bHistBasedSceneCut && frames[i + 1]->bScenecut))
143
scenecut(frames, i, i + 1, true, origNumFrames);
144
145
for (int j = i + 1; j <= X265_MIN(i + m_param->bframes + 1, origNumFrames); j++)
146
{
147
- if ((!m_param->bHistBasedSceneCut && frames[j]->bScenecut && scenecutInternal(frames, j - 1, j, true)) ||
148
- (m_param->bHistBasedSceneCut && frames[j]->bScenecut))
149
- {
150
- m_extendGopBoundary = true;
151
- break;
152
- }
153
+ if (frames[j]->bScenecut && scenecutInternal(frames, j - 1, j, true))
154
+ {
155
+ m_extendGopBoundary = true;
156
+ break;
157
+ }
158
}
159
if (m_extendGopBoundary)
160
break;
161
162
}
163
164
int zoneRadl = m_param->rc.zonefileCount && m_param->bResetZoneConfig ? m_param->rc.zones->zoneParam->radl : 0;
165
- bool bForceRADL = (m_param->radl || zoneRadl) && !m_param->bOpenGOP;
166
+ bool bForceRADL = zoneRadl || (m_param->radl && (m_param->keyframeMax == m_param->keyframeMin));
167
bool bLastMiniGop = (framecnt >= m_param->bframes + 1) ? false : true;
168
int radl = m_param->radl ? m_param->radl : zoneRadl;
169
int preRADL = m_lastKeyframe + m_param->keyframeMax - radl - 1; /*Frame preceeding RADL in POC order*/
170
171
{
172
for (int j = 1; j < numBFrames + 1; j++)
173
{
174
- if ((!m_param->bHistBasedSceneCut && scenecut(frames, j, j + 1, false, origNumFrames)) ||
175
- (m_param->bHistBasedSceneCut && frames[j + 1]->bScenecut) ||
176
- (bForceRADL && (frames[j]->frameNum == preRADL)))
177
- {
178
- frames[j]->sliceType = X265_TYPE_P;
179
- numAnalyzed = j;
180
- break;
181
- }
182
+ bool isNextScenecut = false;
183
+ if (!m_param->bHistBasedSceneCut || (m_param->bHistBasedSceneCut && frames[j + 1]->bScenecut))
184
+ isNextScenecut = scenecut(frames, j, j + 1, false, origNumFrames);
185
+ if (isNextScenecut || (bForceRADL && frames[j]->frameNum == preRADL))
186
+ {
187
+ frames[j]->sliceType = X265_TYPE_P;
188
+ numAnalyzed = j;
189
+ break;
190
+ }
191
}
192
}
193
resetStart = bKeyframe ? 1 : X265_MIN(numBFrames + 2, numAnalyzed + 1);
194
195
* and not considered a scenecut. */
196
for (int cp1 = p1; cp1 <= maxp1; cp1++)
197
{
198
- if (!scenecutInternal(frames, p0, cp1, false))
199
+ if (!scenecutInternal(frames, p0, cp1, false) && !m_param->bHistBasedSceneCut)
200
{
201
x265_3.4.tar.gz/source/encoder/slicetype.h -> x265_3.5.tar.gz/source/encoder/slicetype.h
Changed
9
1
2
#define LOWRES_COST_SHIFT 14
3
#define AQ_EDGE_BIAS 0.5
4
#define EDGE_INCLINATION 45
5
+#define TEMPORAL_SCENECUT_THRESHOLD 50
6
7
#if HIGH_BIT_DEPTH
8
#define EDGE_THRESHOLD 1023.0
9
x265_3.5.tar.gz/source/input
Added
2
1
+(directory)
2
x265_3.5.tar.gz/source/output
Added
2
1
+(directory)
2
x265_3.5.tar.gz/source/profile
Added
2
1
+(directory)
2
x265_3.5.tar.gz/source/profile/PPA
Added
2
1
+(directory)
2
x265_3.5.tar.gz/source/profile/vtune
Added
2
1
+(directory)
2
x265_3.5.tar.gz/source/test
Added
2
1
+(directory)
2
x265_3.4.tar.gz/source/test/rate-control-tests.txt -> x265_3.5.tar.gz/source/test/rate-control-tests.txt
Changed
11
1
2
RaceHorses_416x240_30_10bit.yuv,--preset medium --crf 26 --vbv-maxrate 1000 --vbv-bufsize 1000 --pass 1::--preset fast --bitrate 1000 --vbv-maxrate 1000 --vbv-bufsize 700 --pass 3 -F4::--preset slow --bitrate 500 --vbv-maxrate 500 --vbv-bufsize 700 --pass 2 -F4
3
sita_1920x1080_30.yuv, --preset ultrafast --crf 20 --no-cutree --keyint 50 --min-keyint 50 --no-open-gop --pass 1 --vbv-bufsize 7000 --vbv-maxrate 5000:: --preset ultrafast --crf 20 --no-cutree --keyint 50 --min-keyint 50 --no-open-gop --pass 2 --vbv-bufsize 7000 --vbv-maxrate 5000 --repeat-headers
4
sita_1920x1080_30.yuv, --preset medium --crf 20 --no-cutree --keyint 50 --min-keyint 50 --no-open-gop --pass 1 --vbv-bufsize 7000 --vbv-maxrate 5000 --repeat-headers --multi-pass-opt-rps:: --preset medium --crf 20 --no-cutree --keyint 50 --min-keyint 50 --no-open-gop --pass 2 --vbv-bufsize 7000 --vbv-maxrate 5000 --repeat-headers --multi-pass-opt-rps
5
+sintel_trailer_2k_1920x1080_24.yuv,--preset medium --bitrate 6000 --no-cutree --aq-mode 0 --pass 1::--preset medium --bitrate 6000 --no-cutree --aq-mode 0 --pass 2 --scenecut-aware-qp 1
6
+sintel_trailer_2k_1920x1080_24.yuv,--preset medium --bitrate 6000 --no-cutree --aq-mode 0 --hist-scenecut --pass 1::--preset medium --bitrate 6000 --no-cutree --aq-mode 0 --hist-scenecut --pass 2 --scenecut-aware-qp 3 --masking-strength 300,-1,7,100,2,3
7
+sintel_trailer_2k_1920x1080_24.yuv,--preset medium --bitrate 6000 --no-cutree --aq-mode 0 --pass 1::--preset medium --bitrate 6000 --no-cutree --aq-mode 0 --pass 2 --scenecut-aware-qp 2 --masking-strength 100,-1,-1
8
9
# multi-pass rate control and analysis
10
ducks_take_off_1080p50.y4m,--bitrate 6000 --pass 1 --multi-pass-opt-analysis --hash 1 --ssim --psnr:: --bitrate 6000 --pass 2 --multi-pass-opt-analysis --hash 1 --ssim --psnr
11
x265_3.4.tar.gz/source/test/regression-tests.txt -> x265_3.5.tar.gz/source/test/regression-tests.txt
Changed
9
1
2
ducks_take_off_420_1_720p50.y4m,--preset medium --selective-sao 4 --sao --crf 20
3
Traffic_4096x2048_30p.y4m, --preset medium --frame-dup --dup-threshold 60 --hrd --bitrate 10000 --vbv-bufsize 15000 --vbv-maxrate 12000
4
Kimono1_1920x1080_24_400.yuv,--preset superfast --qp 28 --zones 0,139,q=32
5
-Island_960x540_24.yuv,--no-cutree --aq-mode 0 --bitrate 6000 --scenecut-aware-qp
6
sintel_trailer_2k_1920x1080_24.yuv, --preset medium --hist-scenecut --hist-threshold 0.02 --frame-dup --dup-threshold 60 --hrd --bitrate 10000 --vbv-bufsize 15000 --vbv-maxrate 12000
7
sintel_trailer_2k_1920x1080_24.yuv, --preset medium --hist-scenecut --hist-threshold 0.02
8
sintel_trailer_2k_1920x1080_24.yuv, --preset ultrafast --hist-scenecut --hist-threshold 0.02
9
x265_3.4.tar.gz/source/x265.cpp -> x265_3.5.tar.gz/source/x265.cpp
Changed
13
1
2
using namespace X265_NS;
3
4
#define X265_HEAD_ENTRIES 3
5
+#define CONSOLE_TITLE_SIZE 200
6
7
#ifdef _WIN32
8
#define strdup _strdup
9
+static char orgConsoleTitle[CONSOLE_TITLE_SIZE] = "";
10
#endif
11
12
#ifdef _WIN32
13
x265_3.4.tar.gz/source/x265.h -> x265_3.5.tar.gz/source/x265.h
Changed
102
1
2
}x265_analysis_distortion_data;
3
4
#define MAX_NUM_REF 16
5
+#define EDGE_BINS 2
6
+#define MAX_HIST_BINS 1024
7
+
8
/* Stores all analysis data for a single frame */
9
typedef struct x265_analysis_data
10
{
11
12
uint32_t numCUsInFrame;
13
uint32_t numPartitions;
14
uint32_t depthBytes;
15
+ int32_t edgeHist[EDGE_BINS];
16
+ int32_t yuvHist[3][MAX_HIST_BINS];
17
int bScenecut;
18
x265_weight_param* wt;
19
x265_analysis_inter_data* interData;
20
21
#define X265_ANALYSIS_SAVE 1
22
#define X265_ANALYSIS_LOAD 2
23
24
+#define FORWARD 1
25
+#define BACKWARD 2
26
+#define BI_DIRECTIONAL 3
27
+#define SLICE_TYPE_DELTA 0.3 /* The offset decremented or incremented for P-frames or b-frames respectively*/
28
+#define BACKWARD_WINDOW 1 /* Scenecut window before a scenecut */
29
+#define FORWARD_WINDOW 2 /* Scenecut window after a scenecut */
30
+
31
typedef struct x265_cli_csp
32
{
33
int planes;
34
35
Default 1 (Enabled). API only. */
36
int bResetZoneConfig;
37
38
- /* Enables a ratecontrol algorithm for reducing the bits spent on the inter-frames
39
- * within the scenecutWindow after a scenecut by increasing their QP without
40
- * any deterioration in visual quality. It also increases the quality of scenecut I-Frames by reducing their QP.
41
- * Default is disabled. */
42
+ /* It reduces the bits spent on the inter-frames within the scenecutWindow before and / or after a scenecut
43
+ * by increasing their QP in ratecontrol pass2 algorithm without any deterioration in visual quality.
44
+ * 0 - Disabled (default).
45
+ * 1 - Forward masking.
46
+ * 2 - Backward masking.
47
+ * 3 - Bi-directional masking. */
48
int bEnableSceneCutAwareQp;
49
50
/* The duration(in milliseconds) for which there is a reduction in the bits spent on the inter-frames after a scenecut
51
- * by increasing their QP, when bEnableSceneCutAwareQp is set. Default is 500ms.*/
52
- int scenecutWindow;
53
+ * by increasing their QP, when bEnableSceneCutAwareQp is 1 or 3. Default is 500ms.*/
54
+ int fwdScenecutWindow;
55
56
- /* The offset by which QP is incremented for inter-frames when bEnableSceneCutAwareQp is set.
57
+ /* The offset by which QP is incremented for inter-frames after a scenecut when bEnableSceneCutAwareQp is 1 or 3.
58
* Default is +5. */
59
- int maxQpDelta;
60
+ double fwdRefQpDelta;
61
+
62
+ /* The offset by which QP is incremented for non-referenced inter-frames after a scenecut when bEnableSceneCutAwareQp is 1 or 3. */
63
+ double fwdNonRefQpDelta;
64
65
/* A genuine threshold used for histogram based scene cut detection.
66
* This threshold determines whether a frame is a scenecut or not
67
* when compared against the edge and chroma histogram sad values.
68
- * Default 0.01. Range: Real number in the interval (0,2). */
69
+ * Default 0.03. Range: Real number in the interval (0,1). */
70
double edgeTransitionThreshold;
71
72
/* Enables histogram based scenecut detection algorithm to detect scenecuts. Default disabled */
73
74
75
/* Maxrate that could be signaled to the decoder. Default 0. API only. */
76
int decoderVbvMaxRate;
77
+
78
+ /*Enables Qp tuning with respect to real time VBV buffer fullness in rate
79
+ control 2 pass. Experimental.Default is disabled*/
80
+ int bliveVBV2pass;
81
+
82
+ /* Minimum VBV fullness to be maintained. Default 50. Keep the buffer
83
+ * at least 50% full */
84
+ double minVbvFullness;
85
+
86
+ /* Maximum VBV fullness to be maintained. Default 80. Keep the buffer
87
+ * at max 80% full */
88
+ double maxVbvFullness;
89
+
90
+ /* The duration(in milliseconds) for which there is a reduction in the bits spent on the inter-frames before a scenecut
91
+ * by increasing their QP, when bEnableSceneCutAwareQp is 2 or 3. Default is 100ms.*/
92
+ int bwdScenecutWindow;
93
+
94
+ /* The offset by which QP is incremented for inter-frames before a scenecut when bEnableSceneCutAwareQp is 2 or 3. */
95
+ double bwdRefQpDelta;
96
+
97
+ /* The offset by which QP is incremented for non-referenced inter-frames before a scenecut when bEnableSceneCutAwareQp is 2 or 3. */
98
+ double bwdNonRefQpDelta;
99
} x265_param;
100
101
/* x265_param_alloc:
102
x265_3.4.tar.gz/source/x265cli.cpp -> x265_3.5.tar.gz/source/x265cli.cpp
Changed
72
1
2
H0(" --[no-]ssim-rd Enable ssim rate distortion optimization, 0 to disable. Default %s\n", OPT(param->bSsimRd));
3
H0(" --[no-]rd-refine Enable QP based RD refinement for rd levels 5 and 6. Default %s\n", OPT(param->bEnableRdRefine));
4
H0(" --[no-]early-skip Enable early SKIP detection. Default %s\n", OPT(param->bEnableEarlySkip));
5
- H0(" --rskip <mode> Set mode for early exit from recursion. Mode 1: exit using rdcost & CU homogenity. Mode 2: exit using CU edge density.\n"
6
- " Mode 0: disabled. Default %d\n", param->recursionSkipMode);
7
- H1(" --rskip-edge-threshold Threshold in terms of percentage (integer of range [0,100]) for minimum edge density in CUs used to prun the recursion depth. Applicable only for rskip mode 2. Value is preset dependent. Default: %.f\n", param->edgeVarThreshold*100.0f);
8
+ H0(" --rskip <Integer> Enable recursion skip for early exit from CTU analysis during inter prediction. 1: exit using RD cost & CU homogeneity. 2: exit using CU edge density. 0: disabled. Default %d\n", param->recursionSkipMode);
9
+ H1(" --rskip-edge-threshold Threshold in terms of percentage (an integer of range [0,100]) for minimum edge density in CU's used to prune the recursion depth. Applicable only to rskip mode 2. Value is preset dependent. Default: %.f\n", param->edgeVarThreshold*100.0f);
10
H1(" --[no-]tskip-fast Enable fast intra transform skipping. Default %s\n", OPT(param->bEnableTSkipFast));
11
H1(" --[no-]splitrd-skip Enable skipping split RD analysis when sum of split CU rdCost larger than one split CU rdCost for Intra CU. Default %s\n", OPT(param->bEnableSplitRdSkip));
12
H1(" --nr-intra <integer> An integer value in range of 0 to 2000, which denotes strength of noise reduction in intra CUs. Default 0\n");
13
14
H1(" --scenecut-bias <0..100.0> Bias for scenecut detection. Default %.2f\n", param->scenecutBias);
15
H0(" --hist-scenecut Enables histogram based scene-cut detection using histogram based algorithm.\n");
16
H0(" --no-hist-scenecut Disables histogram based scene-cut detection using histogram based algorithm.\n");
17
- H1(" --hist-threshold <0.0..2.0> Luma Edge histogram's Normalized SAD threshold for histogram based scenecut detection Default %.2f\n", param->edgeTransitionThreshold);
18
+ H1(" --hist-threshold <0.0..1.0> Luma Edge histogram's Normalized SAD threshold for histogram based scenecut detection Default %.2f\n", param->edgeTransitionThreshold);
19
H0(" --[no-]fades Enable detection and handling of fade-in regions. Default %s\n", OPT(param->bEnableFades));
20
- H1(" --[no-]scenecut-aware-qp Enable increasing QP for frames inside the scenecut window after scenecut. Default %s\n", OPT(param->bEnableSceneCutAwareQp));
21
- H1(" --scenecut-window <0..1000> QP incremental duration(in milliseconds) when scenecut-aware-qp is enabled. Default %d\n", param->scenecutWindow);
22
- H1(" --max-qp-delta <0..10> QP offset to increment with base QP for inter-frames. Default %d\n", param->maxQpDelta);
23
+ H1(" --scenecut-aware-qp <0..3> Enable increasing QP for frames inside the scenecut window around scenecut. Default %s\n", OPT(param->bEnableSceneCutAwareQp));
24
+ H1(" 0 - Disabled\n");
25
+ H1(" 1 - Forward masking\n");
26
+ H1(" 2 - Backward masking\n");
27
+ H1(" 3 - Bidirectional masking\n");
28
+ H1(" --masking-strength <string> Comma separated values which specify the duration and offset for the QP increment for inter-frames when scenecut-aware-qp is enabled.\n");
29
H0(" --radl <integer> Number of RADL pictures allowed in front of IDR. Default %d\n", param->radl);
30
H0(" --intra-refresh Use Periodic Intra Refresh instead of IDR frames\n");
31
H0(" --rc-lookahead <integer> Number of frames for frame-type lookahead (determines encoder latency) Default %d\n", param->lookaheadDepth);
32
33
H0(" --vbv-bufsize <integer> Set size of the VBV buffer (kbit). Default %d\n", param->rc.vbvBufferSize);
34
H0(" --vbv-init <float> Initial VBV buffer occupancy (fraction of bufsize or in kbits). Default %.2f\n", param->rc.vbvBufferInit);
35
H0(" --vbv-end <float> Final VBV buffer emptiness (fraction of bufsize or in kbits). Default 0 (disabled)\n");
36
+ H0(" --min-vbv-fullness <double> Minimum VBV fullness percentage to be maintained. Default %.2f\n", param->minVbvFullness);
37
+ H0(" --max-vbv-fullness <double> Maximum VBV fullness percentage to be maintained. Default %.2f\n", param->maxVbvFullness);
38
H0(" --vbv-end-fr-adj <float> Frame from which qp has to be adjusted to achieve final decode buffer emptiness. Default 0\n");
39
H0(" --chunk-start <integer> First frame of the chunk. Default 0 (disabled)\n");
40
H0(" --chunk-end <integer> Last frame of the chunk. Default 0 (disabled)\n");
41
42
" - 3 : Nth pass, overwrites stats file\n");
43
H0(" --[no-]multi-pass-opt-analysis Refine analysis in 2 pass based on analysis information from pass 1\n");
44
H0(" --[no-]multi-pass-opt-distortion Use distortion of CTU from pass 1 to refine qp in 2 pass\n");
45
+ H0(" --[no-]vbv-live-multi-pass Enable realtime VBV in rate control 2 pass.Default %s\n", OPT(param->bliveVBV2pass));
46
H0(" --stats Filename for stats file in multipass pass rate control. Default x265_2pass.log\n");
47
H0(" --[no-]analyze-src-pics Motion estimation uses source frame planes. Default disable\n");
48
H0(" --[no-]slow-firstpass Enable a slow first pass in a multipass rate control mode. Default %s\n", OPT(param->rc.bEnableSlowFirstPass));
49
50
H0(" 5=40:33, 6=24:11, 7=20:11, 8=32:11, 9=80:33, 10=18:11, 11=15:11,\n");
51
H0(" 12=64:33, 13=160:99, 14=4:3, 15=3:2, 16=2:1 or custom ratio of <int:int>. Default %d\n", param->vui.aspectRatioIdc);
52
H1(" --display-window <string> Describe overscan cropping region as 'left,top,right,bottom' in pixels\n");
53
- H1(" --overscan <string> Specify whether it is appropriate for decoder to show cropped region: undef, show or crop. Default undef\n");
54
- H0(" --videoformat <string> Specify video format from undef, component, pal, ntsc, secam, mac. Default undef\n");
55
+ H1(" --overscan <string> Specify whether it is appropriate for decoder to show cropped region: unknown, show or crop. Default unknown\n");
56
+ H0(" --videoformat <string> Specify video format from unknown, component, pal, ntsc, secam, mac. Default unknown\n");
57
H0(" --range <string> Specify black level and range of luma and chroma signals as full or limited Default limited\n");
58
H0(" --colorprim <string> Specify color primaries from bt709, unknown, reserved, bt470m, bt470bg, smpte170m,\n");
59
- H0(" smpte240m, film, bt2020, smpte428, smpte431, smpte432. Default undef\n");
60
+ H0(" smpte240m, film, bt2020, smpte428, smpte431, smpte432. Default unknown\n");
61
H0(" --transfer <string> Specify transfer characteristics from bt709, unknown, reserved, bt470m, bt470bg, smpte170m,\n");
62
H0(" smpte240m, linear, log100, log316, iec61966-2-4, bt1361e, iec61966-2-1,\n");
63
- H0(" bt2020-10, bt2020-12, smpte2084, smpte428, arib-std-b67. Default undef\n");
64
- H1(" --colormatrix <string> Specify color matrix setting from undef, bt709, fcc, bt470bg, smpte170m,\n");
65
- H1(" smpte240m, GBR, YCgCo, bt2020nc, bt2020c, smpte2085, chroma-derived-nc, chroma-derived-c, ictcp. Default undef\n");
66
+ H0(" bt2020-10, bt2020-12, smpte2084, smpte428, arib-std-b67. Default unknown\n");
67
+ H1(" --colormatrix <string> Specify color matrix setting from unknown, bt709, fcc, bt470bg, smpte170m,\n");
68
+ H1(" smpte240m, gbr, ycgco, bt2020nc, bt2020c, smpte2085, chroma-derived-nc, chroma-derived-c, ictcp. Default unknown\n");
69
H1(" --chromaloc <integer> Specify chroma sample location (0 to 5). Default of %d\n", param->vui.chromaSampleLocTypeTopField);
70
H0(" --master-display <string> SMPTE ST 2086 master display color volume info SEI (HDR)\n");
71
H0(" format: G(x,y)B(x,y)R(x,y)WP(x,y)L(max,min)\n");
72
x265_3.4.tar.gz/source/x265cli.h -> x265_3.5.tar.gz/source/x265cli.h
Changed
44
1
2
3
#include <getopt.h>
4
5
-#define CONSOLE_TITLE_SIZE 200
6
#ifdef _WIN32
7
#include <windows.h>
8
#define SetThreadExecutionState(es)
9
-static char orgConsoleTitle[CONSOLE_TITLE_SIZE] = "";
10
#else
11
#define GetConsoleTitle(t, n)
12
#define SetConsoleTitle(t)
13
14
{ "hist-threshold", required_argument, NULL, 0},
15
{ "fades", no_argument, NULL, 0 },
16
{ "no-fades", no_argument, NULL, 0 },
17
- { "scenecut-aware-qp", no_argument, NULL, 0 },
18
- { "no-scenecut-aware-qp", no_argument, NULL, 0 },
19
- { "scenecut-window",required_argument, NULL, 0 },
20
- { "max-qp-delta", required_argument, NULL, 0 },
21
+ { "scenecut-aware-qp", required_argument, NULL, 0 },
22
+ { "masking-strength", required_argument, NULL, 0 },
23
{ "radl", required_argument, NULL, 0 },
24
{ "ctu-info", required_argument, NULL, 0 },
25
{ "intra-refresh", no_argument, NULL, 0 },
26
27
{ "no-multi-pass-opt-analysis", no_argument, NULL, 0 },
28
{ "multi-pass-opt-distortion", no_argument, NULL, 0 },
29
{ "no-multi-pass-opt-distortion", no_argument, NULL, 0 },
30
+ { "vbv-live-multi-pass", no_argument, NULL, 0 },
31
+ { "no-vbv-live-multi-pass", no_argument, NULL, 0 },
32
{ "slow-firstpass", no_argument, NULL, 0 },
33
{ "no-slow-firstpass", no_argument, NULL, 0 },
34
{ "multi-pass-opt-rps", no_argument, NULL, 0 },
35
36
{ "no-cll", no_argument, NULL, 0 },
37
{ "hme-range", required_argument, NULL, 0 },
38
{ "abr-ladder", required_argument, NULL, 0 },
39
+ { "min-vbv-fullness", required_argument, NULL, 0 },
40
+ { "max-vbv-fullness", required_argument, NULL, 0 },
41
{ 0, 0, 0, 0 },
42
{ 0, 0, 0, 0 },
43
{ 0, 0, 0, 0 },
44
x265_3.5.tar.gz/x265Version.txt
Added
6
1
2
+#Attribute: Values
3
+repositorychangeset: f0c1022b6
4
+releasetagdistance: 1
5
+releasetag: 3.5
6