Next Generation 4K Video Codec Experience - Ultra HD.pdf

Embed Size (px)

Citation preview

  • 8/14/2019 Next Generation 4K Video Codec Experience - Ultra HD.pdf

    1/9

    Technical Insights - Embedded

    FossilShale Embedded Technologies Confidential Page 1 of 9

    Next Generation 4K Video Codec Experience Ultra HD

    The next-generation High Efficiency Video codec (HEVC), H.265, has hit a major public milestone, the

    x265 encoder is already impressively parallelized and supports all of the major instruction sets includingAVX/AVX2 and FMA3/FMA4.

    There are lots of discussion about H.265 and next-generation video encoding technologies, but this is

    the first time weve had the chance to sit down with a next-generation encoder (albeit a pre-alpha

    version) to examine both performance and video quality. Weve put together a comparison of both

    video quality and stream encode sizes versus H.264, as well as a quick look at performance across Sandy

    Bridge-E, Ivy Bridge, and Haswell.

    The benefits of H.265

    H.264 has been a huge success. Its a flexible codec standard thats used by streaming services, satellite

    providers, and for Blu-ray discs. Its scaled remarkably well since it was first proposed and is capable of

  • 8/14/2019 Next Generation 4K Video Codec Experience - Ultra HD.pdf

    2/9

    Technical Insights - Embedded

    FossilShale Embedded Technologies Confidential Page 2 of 9

    handling 3D, 48-60 fps encodes, and even 4K. The Blu-ray disc standard doesnt currently include

    provisions for some of these technologies, but the H.264 codec itself is capable of handling them.

    The problem with H.264, however, is that while it can handle these types of encodes, it cant do so while

    simultaneously keeping file sizes low. A new standard is necessary to push file/stream sizes back down

    while driving next-generation adoption, and thats where H.265 comes in. Its designed to utilize

    substantially less bandwidth thanks to advanced encoding techniques and a more sophisticated

    encode/decode model.

    Unlike H.264, which can extend to cover 4K television but wasnt designed with the feature in mind,

    H.265 was built to match the capabilities of future screens and includes support for 10-bit color and high

    frame rates. This is early days support and capability of the current alpha are limited to 8-bit color

    and YUV output, but we still wanted to take the alpha technology out for a spin. Armed with a freshly

    compiled version and some test clips, we set out to see what we could build.

  • 8/14/2019 Next Generation 4K Video Codec Experience - Ultra HD.pdf

    3/9

    Technical Insights - Embedded

    FossilShale Embedded Technologies Confidential Page 3 of 9

    First up file sizes. What were comparing here is actually the size of the elementary video stream.

    Note that these are video streams only audio isnt encoded in either instance. Encode sizes were

    defined by the quantizer setting, with lower q-values equaling a higher quality (and larger file size). The

    base encoded file is 500 frames of a 1.5GB, YUV 4:2:0 file at 50 fps. The elementary stream file size is

    used for comparison here because it represents whats transmitted to the decoder to create the final

    output. Were working with elementary streams because, at this stage of the project (pre-alpha), the

    decoded video file always comes back at 1.5GB, regardless of the stream quality used to create it.

    This gives a good basic idea of what sorts of benefits H.265 can offer compared to H.264. While its not

    hitting 50% bandwidth savings in most cases, its close quantizer 24 is 57% the size, q=30 is 59%, and

    q=40 is just 47%. Granted, at a quantizer of 40, the final output is wretched but its wretched at less

    than half the bandwidth.

  • 8/14/2019 Next Generation 4K Video Codec Experience - Ultra HD.pdf

    4/9

    Technical Insights - Embedded

    FossilShale Embedded Technologies Confidential Page 4 of 9

    Performance & image quality

    The next area we wanted to consider was performance. H.265 is known for taking more horsepower to

    encode and decode than H.264, though the team developing the standard continues to emphasize the

    role of parallel computing in speeding the encode/decode process. Its implied that OpenCL support will

    materialize sooner, rather than later, which means initiatives like AMDs HAS could get a boost from

    x265 support early in 2014.

    Right now, were limited to CPU support, but MultiCoreWare spokesperson Tom Vaughan emphasized

    that the team has already been working on strong multithreading. We decided to test the alpha decoder

    using Sandy Bridge-E, Ivy Bridge, and Haswell. We experimented with different levels of parallelization

    but settled on options that stuck to the number of physical cores in a system (6, 4, and 4). Hyper-Threading was enabled, but setting for 12/8 - thread parallelization actually increased encode time

    slightly.

    HDMI 2.0 (the name going around the industry, despite the HDMI forum's decision to do away with

    version numbers for all HDMI products) is going to be ratified soon, and will apparently simply double

    the operating frequency of the controller / PHY to provide enough bandwidth to send across

    uncompressed 4Kp60 video. The high cost of current 4K solutions is already a deterrent, and if one is

    hesitating to jump in right now, these facts should serve as an incentive to wait for some more time.

    Contrary to popular belief, there is really no dearth of 4K content since most professional videographing

    solutions have been 4K capable for a number of years. It is a simple matter of bringing that content in

    the right format to the end-consumer. H.264 emerged as the codec of choice (and replaced MPEG-2 due

    to better compression efficiency) when moving from SD to HD. However, both H.264 and MPEG-2 co-

    exist in the Blu-ray standard for HD content. Similarly, H.265 (HEVC) is expected to become the codec of

    choice (and replace H.264 due to better compression efficiency) when moving from HD to 4K. However,

    consumers can expect a lot of the initial 4K end-user content to be in H.264 format (such as the current

    4K videos on YouTube or the 4K videos being shot on the GoPro Hero 3 Black). All said, a future-proof 4K

    solution should have the capability to decode 4K content in both H.264 and H.265 (HEVC) formats.

  • 8/14/2019 Next Generation 4K Video Codec Experience - Ultra HD.pdf

    5/9

    Technical Insights - Embedded

    FossilShale Embedded Technologies Confidential Page 5 of 9

    The parallelization performance looks good Sandy Bridge-E, with six cores, is somewhat ahead of Ivy

    Bridge with four. Similarly, Ivy Bridge is beaten out by Haswell, thanks to the new cores AVX2 support

    and better performance characteristics. Compared to x264, even on the very slow preset, x265

    encodes take noticeably longer our Ivy Bridge 3770K encoded the same file in H.264 in 129 seconds

    as compared to 247 seconds for H.265. Keep in mind, however, that this is very, very early software.

    Of more interest is the quality question how does the H.265 output compare to the uncompressed

    original? We chose a basketball clip because, at 50 fps, its full of the sort of fast motion that often gives

    encoders fits. H.265s smaller sizes wont be worth much if the final output isnt as good.

    To that end, heres the original uncompressed YUV output, the H.265 encode at q=24, and the H.264

    output at q=24. Click on each image to enlarge it.

  • 8/14/2019 Next Generation 4K Video Codec Experience - Ultra HD.pdf

    6/9

    Technical Insights - Embedded

    FossilShale Embedded Technologies Confidential Page 6 of 9

    Original uncompressed

    H265 Q=24

  • 8/14/2019 Next Generation 4K Video Codec Experience - Ultra HD.pdf

    7/9

    Technical Insights - Embedded

    FossilShale Embedded Technologies Confidential Page 7 of 9

    H264 Q=24

    The variance here is minimal. The hardwood floor underneath the leaping player is slightly less blurry in

    the H.264 variant, but the H.265 image quality is phenomenal considering its half the size. What about

    lower qualities? Heres H.265 and H.264 at q=30; H.265 is first.

    H.265 Q=30

  • 8/14/2019 Next Generation 4K Video Codec Experience - Ultra HD.pdf

    8/9

    Technical Insights - Embedded

    FossilShale Embedded Technologies Confidential Page 8 of 9

    H.264 Q=30

    At q=30 (file sizes of 6.39MB and 10.87MB), the H.265 video stream is arguably better than the H.264

    encode stream. Were not trying to claim this is an absolute as always, encode settings matter a great

    deal and are sensitive to tweaking. But after waiting more than a year for H.265 to break cover, its clear

    that the new standard is going to offer what its proponents have claimed.

  • 8/14/2019 Next Generation 4K Video Codec Experience - Ultra HD.pdf

    9/9

    Technical Insights - Embedded

    FossilShale Embedded Technologies Confidential Page 9 of 9

    Encode/decode support, meanwhile, is already going to be possible on a vast range of products. ModernCPUs are more than capable of decoding H.265 in software, OpenCL support is coming in future

    iterations, and hardware GPU support, while not formally guaranteed by AMD, Intel, or Nvidia for next-

    generation products, is a mid-term certainty. All three companies have previously leapt to include

    advanced video pipelines in their products as the H.265 presentation notes, video is something thats

    become ubiquitous across every type of device.

    Long-term, H.265 will likely succeed H.264s position as the premier solution for advanced video, though

    that may depend on whether or not battery consumption while decoding can match H.264s levels in the

    long term. Thats something well only be able to evaluate once hardware is available, but for now were

    optimistic. H.265s explicitly parallel model should map well against multi-core devices of the future.

    Source: Extremetech.com