Skip to content

Commit

Permalink
Merge commit '6c1e94bd89ae86fbff19677112cadc98490a376b'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sibras committed Dec 31, 2016
2 parents 6d03f55 + 6c1e94b commit 3de6d40
Show file tree
Hide file tree
Showing 62 changed files with 39,979 additions and 406 deletions.
1 change: 1 addition & 0 deletions .hgtags
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ cbeb7d8a4880e4020c4545dd8e498432c3c6cad3 1.6
e27327f5da35c5feb660360336fdc94bd0afe719 1.8
1d3b6e448e01ec40b392ef78b7e55a86249fbe68 1.9
960c9991d0dcf46559c32e070418d3cbb7e8aa2f 2.0
981e3bfef16a997bce6f46ce1b15631a0e234747 2.1
67 changes: 55 additions & 12 deletions doc/reST/cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ the prediction quad-tree.
and less frame parallelism as well. Because of this the faster
presets use a CU size of 32. Default: 64

.. option:: --min-cu-size <64|32|16|8>
.. option:: --min-cu-size <32|16|8>

Minimum CU size (width and height). By using 16 or 32 the encoder
will not analyze the cost of CUs below that minimum threshold,
Expand Down Expand Up @@ -869,6 +869,24 @@ as the residual quad-tree (RQT).
partitions, in which case a TU split is implied and thus the
residual quad-tree begins one layer below the CU quad-tree.

.. option:: --limit-tu <0..4>

Enables early exit from TU depth recursion, for inter coded blocks.
Level 1 - decides to recurse to next higher depth based on cost
comparison of full size TU and split TU.

Level 2 - based on first split subTU's depth, limits recursion of
other split subTUs.

Level 3 - based on the average depth of the co-located and the neighbor
CUs' TU depth, limits recursion of the current CU.

Level 4 - uses the depth of the neighbouring/ co-located CUs TU depth
to limit the 1st subTU depth. The 1st subTU depth is taken as the
limiting depth for the other subTUs.

Default: 0

.. option:: --nr-intra <integer>, --nr-inter <integer>

Noise reduction - an adaptive deadzone applied after DCT
Expand Down Expand Up @@ -949,13 +967,17 @@ Temporal / motion search options
encoder: a star-pattern search followed by an optional radix scan
followed by an optional star-search refinement. Full is an
exhaustive search; an order of magnitude slower than all other
searches but not much better than umh or star.
searches but not much better than umh or star. SEA is similar to
FULL search; a three step motion search adopted from x264: DC
calculation followed by ADS calculation followed by SAD of the
passed motion vector candidates, hence faster than Full search.

0. dia
1. hex **(default)**
2. umh
3. star
4. full
4. sea
5. full

.. option:: --subme, -m <0..7>

Expand Down Expand Up @@ -1153,6 +1175,13 @@ Slice decision options
:option:`--scenecut` 0 or :option:`--no-scenecut` disables adaptive
I frame placement. Default 40

.. option:: --scenecut-bias <0..100.0>

This value represents the percentage difference between the inter cost and
intra cost of a frame used in scenecut detection. For example, a value of 5 indicates,
if the inter cost of a frame is greater than or equal to 95 percent of the intra cost of the frame,
then detect this frame as scenecut. Values between 5 and 15 are recommended. Default 5.

.. option:: --intra-refresh

Enables Periodic Intra Refresh(PIR) instead of keyframe insertion.
Expand Down Expand Up @@ -1304,7 +1333,7 @@ Quality, rate control and rate distortion options
slices using param->rc.ipFactor and param->rc.pbFactor unless QP 0
is specified, in which case QP 0 is used for all slice types. Note
that QP 0 does not cause lossless encoding, it only disables
quantization. Default disabled (CRF)
quantization. Default disabled.

**Range of values:** an integer from 0 to 51

Expand Down Expand Up @@ -1824,7 +1853,7 @@ Bitstream options
enhancement layer. A decoder may chose to drop the enhancement layer
and only decode and display the base layer slices.

If used with a fixed GOP (:option:`b-adapt` 0) and :option:`bframes`
If used with a fixed GOP (:option:`--b-adapt` 0) and :option:`--bframes`
3 then the two layers evenly split the frame rate, with a cadence of
PbBbP. You probably also want :option:`--no-scenecut` and a keyframe
interval that is a multiple of 4.
Expand All @@ -1833,15 +1862,29 @@ Bitstream options

Maximum of the picture order count. Default 8

.. option:: --discard-sei
.. option:: --[no-]vui-timing-info

Discard SEI messages generated from the final bitstream. HDR-related SEI
messages are always dumped, immaterial of this option. Default disabled.

.. option:: --discard-vui
Emit VUI timing info in bitstream. Default enabled.

.. option:: --[no-]vui-hrd-info

Emit VUI HRD info in bitstream. Default enabled when
:option:`--hrd` is enabled.

.. option:: --[no-]opt-qp-pps

Optimize QP in PPS (instead of default value of 26) based on the QP values
observed in last GOP. Default enabled.

.. option:: --[no-]opt-ref-list-length-pps

Optimize L0 and L1 ref list length in PPS (instead of default value of 0)
based on the lengths observed in the last GOP. Default enabled.

.. option:: --[no-]multi-pass-opt-rps

Enable storing commonly used RPS in SPS in multi pass mode. Default disabled.

Discard optional VUI information (timing, HRD info) from the
bitstream. Default disabled.

Debugging options
=================
Expand Down
1 change: 1 addition & 0 deletions doc/reST/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ x265 Documentation
threading
presets
lossless
releasenotes
141 changes: 141 additions & 0 deletions doc/reST/releasenotes.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
*************
Release Notes
*************

Version 2.2
===========

Release date - 26th December, 2016.

Encoder enhancements
--------------------
1. Enhancements to TU selection algorithm with early-outs for improved speed; use :option:`--limit-tu` to exercise.
2. New motion search method SEA (Successive Elimination Algorithm) supported now as :option: `--me` 4
3. Bit-stream optimizations to improve fields in PPS and SPS for bit-rate savings through :option:`--[no-]opt-qp-pps`, :option:`--[no-]opt-ref-list-length-pps`, and :option:`--[no-]multi-pass-opt-rps`.
4. Enabled using VBV constraints when encoding without WPP.
5. All param options dumped in SEI packet in bitstream when info selected.
6. x265 now supports POWERPC-based systems. Several key functions also have optimized ALTIVEC kernels.

API changes
-----------
1. Options to disable SEI and optional-VUI messages from bitstream made more descriptive.
2. New option :option:`--scenecut-bias` to enable controlling bias to mark scene-cuts via cli.
3. Support mono and mono16 color spaces for y4m input.
4. :option:`--min-cu-size` of 64 no-longer supported for reasons of visual quality (was crashing earlier anyways.)
5. API for CSV now expects version string for better integration of x265 into other applications.

Bug fixes
---------
1. Several fixes to slice-based encoding.
2. :option:`--log2-max-poc-lsb`'s range limited according to HEVC spec.
3. Restrict MVs to within legal boundaries when encoding.

Version 2.1
===========

Release date - 27th September, 2016

Encoder enhancements
--------------------
1. Support for qg-size of 8
2. Support for inserting non-IDR I-frames at scenecuts and when running with settings for fixed-GOP (min-keyint = max-keyint)
3. Experimental support for slice-parallelism.

API changes
-----------
1. Encode user-define SEI messages passed in through x265_picture object.
2. Disable SEI and VUI messages from the bitstream
3. Specify qpmin and qpmax
4. Control number of bits to encode POC.

Bug fixes
---------
1. QP fluctuation fix for first B-frame in mini-GOP for 2-pass encoding with tune-grain.
2. Assembly fix for crashes in 32-bit from dct_sse4.
3. Threadpool creation fix in windows platform.

Version 2.0
===========

Release date - 13th July, 2016

New Features
------------

1. uhd-bd: Enable Ultra-HD Bluray support
2. rskip: Enables skipping recursion to analyze lower CU sizes using heuristics at different rd-levels. Provides good visual quality gains at the highest quality presets.
3. rc-grain: Enables a new ratecontrol mode specifically for grainy content. Strictly prevents QP oscillations within and between frames to avoid grain fluctuations.
4. tune grain: A fully refactored and improved option to encode film grain content including QP control as well as analysis options.
5. asm: ARM assembly is now enabled by default, native or cross compiled builds supported on armv6 and later systems.

API and Key Behaviour Changes
-----------------------------

1. x265_rc_stats added to x265_picture, containing all RC decision points for that frame
2. PTL: high tier is now allowed by default, chosen only if necessary
3. multi-pass: First pass now uses slow-firstpass by default, enabling better RC decisions in future passes
4. pools: fix behaviour on multi-socketed Windows systems, provide more flexibility in determining thread and pool counts
5. ABR: improve bits allocation in the first few frames, abr reset, vbv and cutree improved

Misc
----
1. An SSIM calculation bug was corrected

Version 1.9
===========

Release date - 29th January, 2016

New Features
------------

1. Quant offsets: This feature allows block level quantization offsets to be specified for every frame. An API-only feature.
2. --intra-refresh: Keyframes can be replaced by a moving column of intra blocks in non-keyframes.
3. --limit-modes: Intelligently restricts mode analysis.
4. --max-luma and --min-luma for luma clipping, optional for HDR use-cases
5. Emergency denoising is now enabled by default in very low bitrate, VBV encodes

API Changes
-----------

1. x265_frame_stats returns many additional fields: maxCLL, maxFALL, residual energy, scenecut and latency logging
2. --qpfile now supports frametype 'K"
3. x265 now allows CRF ratecontrol in pass N (N greater than or equal to 2)
4. Chroma subsampling format YUV 4:0:0 is now fully supported and tested

Presets and Performance
-----------------------

1. Recently added features lookahead-slices, limit-modes, limit-refs have been enabled by default for applicable presets.
2. The default psy-rd strength has been increased to 2.0
3. Multi-socket machines now use a single pool of threads that can work cross-socket.

Version 1.8
===========

Release date - 10th August, 2015

API Changes
-----------
1. Experimental support for Main12 is now enabled. Partial assembly support exists.
2. Main12 and Intra/Still picture profiles are now supported. Still picture profile is detected based on x265_param::totalFrames.
3. Three classes of encoding statistics are now available through the API.
a) x265_stats - contains encoding statistics, available through x265_encoder_get_stats()
b) x265_frame_stats and x265_cu_stats - contains frame encoding statistics, available through recon x265_picture
4. --csv
a) x265_encoder_log() is now deprecated
b) x265_param::csvfn is also deprecated
5. --log-level now controls only console logging, frame level console logging has been removed.
6. Support added for new color transfer characteristic ARIB STD-B67

New Features
------------
1. limit-refs: This feature limits the references analysed for individual CUS. Provides a nice tradeoff between efficiency and performance.
2. aq-mode 3: A new aq-mode that provides additional biasing for low-light conditions.
3. An improved scene cut detection logic that allows ratecontrol to manage visual quality at fade-ins and fade-outs better.

Preset and Tune Options
-----------------------

1. tune grain: Increases psyRdoq strength to 10.0, and rdoq-level to 2.
2. qg-size: Default value changed to 32.
36 changes: 35 additions & 1 deletion source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ option(STATIC_LINK_CRT "Statically link C runtime for release builds" OFF)
mark_as_advanced(FPROFILE_USE FPROFILE_GENERATE NATIVE_BUILD)

# X265_BUILD must be incremented each time the public API is changed
set(X265_BUILD 95)
set(X265_BUILD 102)
configure_file("${PROJECT_SOURCE_DIR}/x265.def.in"
"${PROJECT_BINARY_DIR}/x265.def")
configure_file("${PROJECT_SOURCE_DIR}/x265_config.h.in"
Expand Down Expand Up @@ -60,6 +60,11 @@ elseif(POWERMATCH GREATER "-1")
message(STATUS "Detected POWER target processor")
set(POWER 1)
add_definitions(-DX265_ARCH_POWER=1)
if("${CMAKE_SIZEOF_VOID_P}" MATCHES 8)
set(PPC64 1)
add_definitions(-DPPC64=1)
message(STATUS "Detected POWER PPC64 target processor")
endif()
elseif(ARMMATCH GREATER "-1")
if(CROSS_COMPILE_ARM)
message(STATUS "Cross compiling for ARM arch")
Expand Down Expand Up @@ -167,6 +172,19 @@ elseif(CLANG)
elseif(CMAKE_COMPILER_IS_GNUCXX)
set(GCC 1)
endif()

if(CC STREQUAL "xlc")
message(STATUS "Use XLC compiler")
set(XLC 1)
set(GCC 0)
#set(CMAKE_C_COMPILER "/usr/bin/xlc")
#set(CMAKE_CXX_COMPILER "/usr/bin/xlc++")
add_definitions(-D__XLC__=1)
add_definitions(-O3 -qstrict -qhot -qaltivec)
add_definitions(-qinline=level=10 -qpath=IL:/data/video_files/latest.tpo/)
endif()


if(GCC)
add_definitions(-Wall -Wextra -Wshadow)
add_definitions(-D__STDC_LIMIT_MACROS=1)
Expand Down Expand Up @@ -396,6 +414,22 @@ if(WIN32)
endif(WINXP_SUPPORT)
endif()

if(POWER)
# IBM Power8
option(ENABLE_ALTIVEC "Enable ALTIVEC profiling instrumentation" ON)
if(ENABLE_ALTIVEC)
add_definitions(-DHAVE_ALTIVEC=1 -maltivec -mabi=altivec)
add_definitions(-flax-vector-conversions -fpermissive)
else()
add_definitions(-DHAVE_ALTIVEC=0)
endif()

option(CPU_POWER8 "Enable CPU POWER8 profiling instrumentation" ON)
if(CPU_POWER8)
add_definitions(-mcpu=power8 -DX265_ARCH_POWER8=1)
endif()
endif()

include(version) # determine X265_VERSION and X265_LATEST_TAG
include_directories(. common encoder "${PROJECT_BINARY_DIR}")

Expand Down
15 changes: 14 additions & 1 deletion source/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,19 @@ if(ENABLE_ASSEMBLY AND (ARM OR CROSS_COMPILE_ARM))
source_group(Assembly FILES ${ASM_PRIMITIVES})
endif(ENABLE_ASSEMBLY AND (ARM OR CROSS_COMPILE_ARM))

if(POWER)
set_source_files_properties(version.cpp PROPERTIES COMPILE_FLAGS -DX265_VERSION=${X265_VERSION})
if(ENABLE_ALTIVEC)
set(ALTIVEC_SRCS pixel_altivec.cpp dct_altivec.cpp ipfilter_altivec.cpp intrapred_altivec.cpp)
foreach(SRC ${ALTIVEC_SRCS})
set(ALTIVEC_PRIMITIVES ${ALTIVEC_PRIMITIVES} ppc/${SRC})
endforeach()
source_group(Intrinsics_altivec FILES ${ALTIVEC_PRIMITIVES})
set_source_files_properties(${ALTIVEC_PRIMITIVES} PROPERTIES COMPILE_FLAGS "-Wno-unused -Wno-unknown-pragmas -Wno-maybe-uninitialized")
endif()
endif()


# set_target_properties can't do list expansion
string(REPLACE ";" " " VERSION_FLAGS "${VFLAGS}")
set_source_files_properties(version.cpp PROPERTIES COMPILE_FLAGS ${VERSION_FLAGS})
Expand All @@ -116,7 +129,7 @@ if(WIN32)
endif(WIN32)

add_library(common OBJECT
${ASM_PRIMITIVES} ${VEC_PRIMITIVES} ${WINXP}
${ASM_PRIMITIVES} ${VEC_PRIMITIVES} ${ALTIVEC_PRIMITIVES} ${WINXP}
primitives.cpp primitives.h
pixel.cpp dct.cpp ipfilter.cpp intrapred.cpp loopfilter.cpp
constants.cpp constants.h
Expand Down
1 change: 1 addition & 0 deletions source/common/bitstream.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class Bitstream : public BitInterface
uint32_t getNumberOfWrittenBytes() const { return m_byteOccupancy; }
uint32_t getNumberOfWrittenBits() const { return m_byteOccupancy * 8 + m_partialByteBits; }
const uint8_t* getFIFO() const { return m_fifo; }
void copyBits(Bitstream* stream) { m_partialByteBits = stream->m_partialByteBits; m_byteOccupancy = stream->m_byteOccupancy; m_partialByte = stream->m_partialByte; }

void write(uint32_t val, uint32_t numBits);
void writeByte(uint32_t val);
Expand Down
Loading

0 comments on commit 3de6d40

Please sign in to comment.