A Comprehensive Guide on H.265 Codec
h.265

A Comprehensive Guide on H.265 Codec

6 min read

H.265 is a video compression codec and is a successor of H.264. Read more about H.265 and how it works in this article.

What is H.265?

H.265 is a video compression codec and is a successor of H.264. It is built on concepts similar to its predecessor, but it is becoming prevalent because of the rapid adoption of 4K content everywhere. Without compromising on video quality, H.265 allows video compression to happen at half the bitrate of its predecessor - H.264 - making it twice as efficient in theory. When we perform H.265 compression to the same bitrate as H.264, we find that H.265 provides significantly improved video quality. As a result of all of these benefits and upgrades, H.265 makes it easier to stream and download 4K videos - which was not possible with H.264 since it took a lot of space and had a high bitrate.

How does the h.265 codec work?

The H.265 codec is based on the same general idea and structure as the previous H.264 standard. As earlier, this has source video consisting of a series of frames which is encoded (or compressed) by an encoder - this results in a compressed bitstream. This compressed bitstream is either stored or shared, and a decoder at the other end decompresses the bitstream to create the original sequence of frames.

In terms of H.265 codec working, the steps carried out by the encoder include the following:

  • The first step is about predicting each unit and performing necessary computations (i.e., subtracting it from the original picture unit). In this step, the encoder takes in a frame of video units of 16x16 displayed pixels (macroblocks). That macroblock forms a prediction in two ways - either from the current frame (intra-prediction) or from the previously transmitted frames (inter-transmission).
  • Quantizing and transforming the residual. Residual refers to the difference between the prediction and the original picture unit. This is done by using an approximate form of Discrete Cosine Transform to output a set of coefficients, each of which relates to the weighting value of basic patterns. These basis patterns can later be combined to create the initial residual.
  • Entropy encoding - that is, performing a lossless data compression scheme - of the transformed output, mode information, prediction information, and headers.

An H.265 decoder, on the other hand, performs the following steps:

  • Entropy decoding - that is, reversing the steps performed during entropy encoding - and extracting the original elements from the sequence that was coded.
  • Inverting the transformations and rescaling.
  • Predicting each unit and adding it to the output of the inverse transform
  • Reconstructing the final decoded video image.

In essence, rather than encoding every pixel from each and every frame, bandwidth use is minimized by identifying areas that are static and don’t change from frame to frame. This ensures that encoding efforts can be better applied to areas that are changing with every frame.

If we look at it from a more technical point of view, from the perspective of computation power, we find that HEVC is more demanding, but it offers significantly more intelligent approaches to video encoding and decoding. H.265 works by looking for spatial repetition within frames. With that information, H.265 looks for opportunities to not send out the same information over a series of frames. Instead of sending every individual image in a sequence, H.265 can send the first full frame, and if it finds any repetitions within spaces in those frames, it doesn’t send those frames again. This leads to an overall reduction in the total file size. Essentially, H.265 works by increasing the complexity levels of how spatial and motion resolutions are estimated so that repetitive information can be held back from being sent and size can be compressed even further.

High Efficiency Video Coding
H.265

📹
Experience better compression without compromising on video quality with H265 and enhance your end-user video experience with Gumlet.

H.265 / HEVC Overview

The HEVC standard for video compression has the potential to deliver performances far superior to its predecessors like H.264/AVC. While HEVC has the same core structure as AVC and MPEG-2, it also has many incremental and much-needed improvements like:

  • Increased flexibility of partitioning.
  • Greater flexibility in transforming block sizes and prediction modes.
  • Better interpolation and deblocking filters.
  • Improved signaling of modes and motion vectors.
  • Efficient parallel processing features.

All of this cumulatively resulted in a video coding format that offers much better compression without compromising the quality, even for the most high-end video types. Here’s a brief overview of other important aspects that you need to know about the H.265 video compression format.

Profile, levels, and parameters

A profile can simply be understood as a set of tools required for coding, that are utilized to create bitstreams relevant to that particular profile. An encoder for a particular profile may choose the coding tools it needs to use in order to generate a relevant bitstream. On the other hand, a decoder for a particular profile must support all the encoding tools that the profile can use.

Getting into more technicalities, the first version of HEVC defined three profiles:

  • Main
  • Main 10
  • Main Still Picture.

The second version added 21 range extension profiles, one multi-view profile, and two scalable extensions profiles. This has further undergone a few changes and modifications.

In terms of tiers and levels, the HEVC standard defines two main tiers - High and Main. It also defines thirteen levels. A level is essentially a set of constraints for a bitstream. For levels below 4, only the main tier is allowed. The tiers were developed to deal with applications that have varied maximum bitrates. The Main tier is designed keeping most applications in mind, whereas the High tier caters to the more high-end applications. A decoder that conforms to a given level/tier should be able to easily decode all bitstreams encoded for that particular level/tier and all lower levels/tiers.

Applications of h.265

The H.265 codec uses a macroblock-encoding method that is different from H.264, called Coding Tree Units (CTU). The CTU processes information with higher coding efficiency and supports 64 x 64 macroblocks. This makes the H.265 format highly useful in many applications. Some such applications include:

  • H.265 supports a wide gamut of color spaces - such as NTSC, Rec. 601, PAL, generic film, SMPTE 170M, sRGN, sYCC, and more.
  • Seamless video streaming and data sharing for next-generation HDTV displays and content capture systems.

Why h.265 compression?

The simple answer to this question is to attain improved efficiency. The fewer bitstreams that codec can use to compress and decompress an image without sacrificing its quality, its efficiency is more. From that point of view, H.265 is highly more efficient than the H.264 codec. Learn more about H.264 vs. H.265. Apart from that, as things have evolved, people’s viewing resolutions have also changed, and so have the resolutions of screens that people use to view videos. With so many constraints and modifications, it makes sense to move towards a compression technique that is designed for modern-day video requirements.

Benefits of h.265

To summarise things, here are the key benefits and improvements that H.265 compression standard offers:

  • Provides half the compression ratio of H.264.
  • Supports 64x64 pixel macroblocks, as compared to the 16x16 that was supported by H.264.
  • Video compression depends on the prediction motion between frames, and H.265 has better motion prediction mechanisms. This leads to an improved compression standard.
  • The interframe predictions are more detailed in H.265 than in H.264.
  • H.265 supports resolutions much higher than 8K Ultra High-Definition which is supported by H.264.
  • H.265 works on much fewer bit rates as compared to H.264 codecs, thereby making the entire process a lot more efficient.

Conclusion

The thing about technology is that it keeps upgrading and getting better. H.264 was undoubtedly a good compression standard, but it had some flaws. H.265 picked up on those flaws and improved on them to provide us with an even better compression standard. Rest assured that we will soon have an even more improved version of this. The goal for you, in such scenarios, should be to stay updated with all the happenings and updates so that you can make the best decision when it comes to choosing a video codec!

We hope this article gave you a good insight into the overview and workings of the H.265 compression technique!

📹
Stream videos to millions in minutes with a seamless end-user experience with every view. No credit card required.


Related Readings

Difference between h.264 and h.265

Difference between h.264 and h.265

H.264 and H.265 are the two most commonly used codecs in the world of video streaming. Here's a detailed guide exploring the differences between H.264 and H.265.
Naveed Altaf A
Naveed Altaf A

10 Jun 2022 - 5 min read