Step by step to build x265 HEVC library


H.265 definitely is one of the top topics for video and streaming media developers, and H.265 will be one of the key technique for Kedacom’s new VC products(To be released within 2014).
I’m here to share with you a simple guide of start with x265.
As you know, x265 project is also developed by VideoLan Orgnization, same with x264 project, even the x265 APIs are similar to x264 APIs, good for we, isn’t it?

About x265

x265 is a free software library and application for encoding video streams into the H.265/MPEG-H HEVC compression format, and is released under the terms of the GNU GPL.

x265

x265

x265 source code is freely available for personal or private use. To inquire about a commercial license please contact us ((license @ x265.com).
Source code may be downloaded and contributions submitted here: https://bitbucket.org/multicoreware/x265

Pre-requirements for compiling x265

To compile x265 you must first install Mercurial (or TortoiseHg on Windows) and CMake 2.8.8 or later.
To insure your build of x265 is capable of full performance, install YASM 1.2.0 or greater to compile assembly primitives.

  • Hg: used to download source code

Mercurial : http://mercurial.selenic.com/
TortoiseHg on Windows: http://tortoisehg.org

  • CMake

Where to download: http://www.cmake.org/cmake/resources/software.html

  • YASM

Where to download: http://www.tortall.net/projects/yasm/releases
By default yasm uses a hash table that is too small for our assembly files. By applying this patch you can speed up the compile of our assembly files by a great amount. We have a build of yasm.exe (1.2.0 Win32/VC9) available for free download: https://bitbucket.org/multicoreware/x265/downloads/yasm.exe

and if you think that’s too complicated for you, I’m here prepared a full list of win32 version of tools along with x265 source code for lazy guys on my blog:

CMake: http://rg4.net/p/x265/cmake-2.8.12.2-win32-x86.exe
YASM: http://rg4.net/p/x265/yasm.exe
x265 source code: http://rg4.net/x265/x265.tar.gz

Then follow these easy steps:

Linux Instructions

# ubuntu packages:
$ sudo apt-get install mercurial cmake cmake-curses-gui build-essential yasm
# Note: if the packaged yasm is older than 1.2, you must download yasm-1.2 and build it

$ hg clone https://bitbucket.org/multicoreware/x265
$ cd x265/build/linux
$ ./make-Makefiles.bash
$ make

Windows (Visual Studio) Instructions

hg clone https://bitbucket.org/multicoreware/x265

Then run make-solutions.bat in the build\ folder that corresponds to your favorite compiler, configure your build options, click ‘configure’, click ‘generate’, then close cmake-gui.
You will be rewarded with an x265.sln file. Also see cmake documentation.

Mac OS X

The latest Mac OS X 10.8 gcc and clang based compilers can build x265 using the linux instructions above. Xcode 5 with the most recent patches can build, debug, and profile x265.

Some encoder features declared by VideoLan about x265

  • Full prediction and transform quad-tree recursion supported
  • Adaptive B-frame placement
  • B-frames as references / arbitrary frame order
  • CABAC entropy coding
  • Intra: all block types (32×32, 16×16, 8×8, 4×4, and PCM with all predictions)
  • Inter P: all partitions (from 64×64 down to 8×4)
  • Inter B: partitions from 64×64 down to 8×4 (including all merge modes and biprediction)
  • Weighted prediction for P slices
  • Multiple reference frames
  • Ratecontrol: constant quantizer, constant quality, single pass ABR, optional VBV
  • Scenecut detection
  • Parallel encoding on multiple CPUs, both frame-level and wavefront parallelism

Leave a comment

Your email address will not be published. Required fields are marked *