Coding Tree Unit: The Key to Better HEVC Performance

Author

Reads 12K

Two Women Looking at the Code at Laptop
Credit: pexels.com, Two Women Looking at the Code at Laptop

The Coding Tree Unit is a crucial component of the HEVC (High Efficiency Video Coding) standard, and it plays a significant role in determining the overall performance of the codec.

By using a quadtree structure, the Coding Tree Unit efficiently represents the spatial and temporal relationships between pixels in a video frame.

This allows for more accurate prediction of pixel values and better compression efficiency.

Discover more: Html Tree

What is Coding Tree Unit?

A Coding Tree Unit, or CTU, is a block of 64×64 pixels that the video encoder divides the image into. These blocks contain 4096 pixels and are the fundamental unit of decision-making for the encoder.

The CTU is called a tree because it has sub-division levels within it. This means that the CTU can be further divided into smaller units.

A CTU can contain multiple Coding Units, or CUs, which are smaller blocks of pixels. The sizes of these CUs can be 32×32, 16×16, or 8×8 pixels.

Here are the different sizes of CUs that can be contained within a CTU:

  • 32×32 CU’s
  • 16×16 CUs
  • 8×8 CU’s

Prediction Units, or PUs, are special types of CUs that contain prediction information. They are used when objects move within a unit.

HEVC Structure and Components

Credit: youtube.com, HEVC Basics part 1

The HEVC structure is quite complex, but it's based on the coding tree structure of the Coding Unit (CU). A CU size of 64×64 is defined as a root node, and it can be recursively split into four equally sized nodes.

The coding tree structure of HEVC is hierarchical, allowing for a content adaptive coding tree structure. This means that the CU size can vary depending on the content of the image.

A CTU (Coding Tree Unit) size of 64×64 and a maximum tree depth of four imply that the leaf node has a smallest CU size of 8×8. This is because each split results in dividing a CU into partitions for prediction.

The optimal CU size for a given depth is as follows:

  • CU64 for depth = 1
  • CU32 for depth = 2
  • CU16 for depth = 3
  • CU08 for depth = 4

This flexible coding tree structure contributes a significant improvement in coding gain, but it also causes a dramatic increase in encoding complexity.

Coding Tree Unit Efficiency

Coding tree units in H265/HEVC allow for larger block sizes, up to 64×64 pixels, which can lead to more efficient compression.

Credit: youtube.com, INCEPT: INTRA CU Depth Prediction for HEVC

This is a significant improvement over H264/AVC, which had block sizes limited to 8×8 and 16×16 macroblocks.

Using larger CTU sizes in HEVC can increase coding efficiency, reducing the bit rate required to encode video while maintaining the same level of quality.

For example, tests showed that using 32×32 CTU sizes increased the HEVC bit rate by 2.2% compared to 64×64 CTU sizes, while using 16×16 CTU sizes increased the bit rate by 11.0%.

Using larger CTU sizes can also reduce decoding time, with tests showing that decoding time increased by 60% when using 16×16 CTU sizes compared to 64×64 CTU sizes.

Efficiency

Coding efficiency is a critical aspect of video coding standards, and HEVC (High Efficiency Video Coding) is no exception. It's designed to encode video at the lowest possible bit rate while maintaining a certain level of video quality.

The use of larger Coding Tree Block (CTB) sizes in HEVC benefits coding efficiency significantly. In fact, tests have shown that when forced to use progressively smaller CTU sizes, the HEVC bit rate increases substantially. For example, when compared to a 64×64 CTU size, the HEVC bit rate increased by 2.2% when forced to use a 32×32 CTU size and increased by 11.0% when forced to use a 16×16 CTU size.

Credit: youtube.com, Video Coding Basics - How is this so efficient?

This is especially true for higher resolution videos. In Class A test sequences, where the resolution of the video was 2560×1600, the HEVC bit rate increased by 5.7% when forced to use a 32×32 CTU size and increased by 28.2% when forced to use a 16×16 CTU size.

Here's a breakdown of the increase in video bit rate when smaller CTU sizes were used:

Large CTU sizes not only increase coding efficiency but also reduce decoding time. In fact, tests showed that it took 60% longer to decode HEVC video encoded at 16×16 CTU size than at 64×64 CTU size.

Curious to learn more? Check out: Facebook Video Post Size

Establish Cu Model

Establishing a Cu model is a crucial step in achieving Coding Tree Unit efficiency.

The first step in establishing a Cu model is to compute the Cu distribution in a coded GOP. This is done by using the function Festa., which represents the probability of each Cu size for each frame in the coded GOP.

For another approach, see: Simple Html Websites

Credit: youtube.com, 6. Adaptive Huffman Coding in Data Compression | TREE UPDATION | Huffman encoding decoding example

Festa. is performed by calculating the conditional probability Pij that the frequency of a certain Cu size within all CB (a block contained 4×4 pixels) in a frame.

The probability Pij is calculated as follows: Pij = P(CUi|Frame) = (number of Cu sizes i in frame j) / (total number of Cu sizes in frame j).

A sign function Φ is also calculated for Cu coding tree tailor, which is used to predict the probabilities of frames in later GOPs.

The Φ function is used to determine whether the probabilities of some Cu sizes are equal to zero or not, and it's calculated based on the CU distribution redundancy in adjacent GOPs.

By using the Φ function, the encoder can establish a probabilistic model that computes the Cu distribution redundancy in a GOP.

This probabilistic model is used to predict the probabilities of frames in later GOPs, which helps to establish a tailored Cu coding tree for each frame in the predicted GOP.

The size of the new Cu coding tree is less than or equal to the complete Cu coding tree, which means the encoder can obtain an approximate optimal Cu partition result without searching all the Cu sizes.

The probabilistic model is not invariable due to CC, so it needs to be updated in the process of video coding to maintain the accuracy of the model and avoid error propagation to later GOPs.

Technical Details and Analysis

Credit: youtube.com, Amped Authenticate Update 37236: Coding Tree Units Filter, RIFF Viewer, Extended Deepfake Detection

A coding tree unit (CTU) is the largest unit in the HEVC (High Efficiency Video Coding) standard, which replaces the traditional macroblock with a more efficient structure.

CTUs are divided into coding tree blocks (CTBs) which can be 64×64, 32×32, or 16×16 pixels in size, with larger block sizes increasing coding efficiency.

The arrangement of CUs in a CTB is known as a quadtree, as it subdivides into four smaller regions.

CTBs are then divided into one or more coding units (CUs), with the CTU size being the largest CU size. A CU can be 64×64 to 4×4 pixels in size, depending on the type of prediction used.

Here are the possible CU sizes for intra-picture and inter-picture prediction:

  • 64×64
  • 32×32
  • 16×16
  • 8×8
  • 4×4

Prediction units (PUs) are then divided into DCT (Discrete Cosine Transform) transform units (TUs) to code the prediction residual, which can be 32×32, 16×16, 8×8, or 4×4 pixels in size.

Motivations and Analysis

The goal of reducing encoding complexity is to tailor a complete CU coding tree to avoid exhaustive CU size checks. This approach can lead to significant time savings, as demonstrated by experiments that show encoding time can be reduced by up to 72.52% when using a simple CU coding tree structure with a root node size of 64×64 and a depth of 1.

Related reading: Golang Tree

Lines of Code
Credit: pexels.com, Lines of Code

CU coding tree complexity is influenced by both depth and CTU size. The smaller the depth and CTU size, the lower the CU coding tree complexity.

A CU coding tree with a smaller depth and larger CTU size can lead to substantial time savings. For instance, using a CTU size of 64×64 and a depth of 1 can result in a 72.52% reduction in encoding time.

The relationship between CU coding tree structure complexity and encoding saving can be analyzed by comparing various tailored CU coding tree structures to the HEVC complete CU coding tree structure. This comparison reveals that CU coding tree complexity proportionally drops with decreasing depth.

CU coding tree complexity can be reduced by up to 25% when the depth is reduced by 1, as shown by both theoretical and experimental results.

Technical Details

In HEVC, macroblocks are replaced with CTUs, which can use larger block structures of up to 64×64 pixels. This allows for better sub-partitioning of the picture into variable sized structures.

Coding Script
Credit: pexels.com, Coding Script

CTUs are initially divided into CTBs, which can be 64×64, 32×32, or 16×16 in size. A larger pixel block size typically increases coding efficiency.

Here's a breakdown of the CU structure:

  • CUs are divided into prediction units (PUs) of either intra-picture or inter-picture prediction type.
  • PUs can vary in size from 64×64 to 4×4.
  • PUs coded using inter-picture prediction are restricted to a minimum size of 8×4 or 4×8 if they are predicted from a single reference, or 8×8 if they are predicted from two references.
  • A CU is divided into a quadtree of DCT transform units (TUs).
  • TUs contain coefficients for spatial block transform and quantization.
  • TUs can be 32×32, 16×16, 8×8, or 4×4 pixel block sizes.

The CU coding tree structure affects encoding complexity due to exhaustive traversal of its nodes for optimal CU size.

Performance and Comparison

The coding tree unit is a fundamental concept in computer science, and its performance is crucial for efficient coding.

It can solve problems in O(n) time complexity, making it a highly efficient algorithm.

This is because it uses a recursive approach to traverse the tree, visiting each node only once.

The coding tree unit is particularly useful for problems involving tree data structures.

In comparison, other algorithms may require O(n^2) or even O(n^3) time complexity, making them much slower.

This is especially true for large datasets, where the coding tree unit's efficiency can make a significant difference.

By using the coding tree unit, developers can write more efficient and scalable code.

This can lead to improved performance, faster execution times, and a better user experience.

Suggestion: Resource Unit

Experimental Setup and Configuration

Credit: youtube.com, Visual Studio Code (Windows) - Setting up a Python Development Environment and Complete Overview

The proposed low complexity CU coding tree mechanism was tested on various resolution sequences, ranging from 2560×1600 to 416×240.

To validate its effectiveness, the performance of the proposed method was measured against the HEVC test model version 15.0. This test model was chosen as the anchor for comparison.

The experiments were conducted under the common test conditions of the HEVC standardization, which ensures a fair evaluation of the proposed method.

CTU (Coding Tree Unit) sizes varied from 64×64 to 16×16, and partition depth varied from 4 to 1. These settings were used to test the proposed method under different conditions.

The default fast encoding tools in HM15.0 were turned on as the anchor for comparison, allowing for a fair evaluation of the proposed method.

Conclusions

The proposed low complexity CU coding tree mechanism has shown remarkable results in reducing encoding time. It achieves a 27% average encoding time reduction for lossy coding.

By exploring CU distribution and implementing a prediction based on GOP, the method makes full use of CU distribution redundancy. This approach has been found to be effective in reducing unnecessary encoding time.

Credit: youtube.com, MLiS 2024 Python Lab Build Tree g conclusion

The proposed method breaks through the original CU structure by avoiding low probability CU traversal, which is a significant improvement. This results in almost similar compression performance.

For lossless coding and visually lossless coding, the proposed method can achieve a 42% encoding time reduction. This is a substantial improvement in encoding speed.

The proposed low complexity CU coding tree mechanism is willing to devote its applications for various conditions, in which computational resources are limited. This makes it a valuable tool for real-time encoding.

Nancy Rath

Copy Editor

Nancy Rath is a meticulous and detail-oriented Copy Editor with a passion for refining written content. With a keen eye for grammar, syntax, and style, she has honed her skills in ensuring that articles are polished and engaging. Her expertise spans a range of categories, including digital presentation design, where she has a particular interest in the intersection of visual and written communication.

Love What You Read? Stay Updated!

Join our community for insights, tips, and more.