Next Article in Journal
A Countermeasure Approach for Brute-Force Timing Attacks on Cache Privacy in Named Data Networking Architectures
Next Article in Special Issue
PM2.5 Concentration Measurement Based on Image Perception
Previous Article in Journal
Low-Dimensional-Approximate Model Based Improved Fuzzy Non-Singular Terminal Sliding Mode Control for Rigid-Flexible Manipulators
Previous Article in Special Issue
Visible-Infrared Person Re-Identification: A Comprehensive Survey and a New Setting
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Bagged Tree and ResNet-Based Joint End-to-End Fast CTU Partition Decision Algorithm for Video Intra Coding

1
Information Security Center, State Key Laboratory of Networking and Switching Technology, Beijing University of Posts and Telecommunications, Beijing 100876, China
2
National Engineering Laboratory for Disaster Backup and Recovery, Beijing University of Posts and Telecommunications, Beijing 100876, China
3
Department of Computer Science and Engineering, Santa Clara University, Santa Clara, CA 95053, USA
*
Author to whom correspondence should be addressed.
Electronics 2022, 11(8), 1264; https://doi.org/10.3390/electronics11081264
Submission received: 4 March 2022 / Revised: 12 April 2022 / Accepted: 13 April 2022 / Published: 16 April 2022

Abstract

:
Video coding standards, such as high-efficiency video coding (HEVC), versatile video coding (VVC), and AOMedia video 2 (AV2), achieve an optimal encoding performance by traversing all possible combinations of coding unit (CU) partition and selecting the combination with the minimum coding cost. It is still necessary to further reduce the encoding time of HEVC, because HEVC is one of the most widely used coding standards. In HEVC, the process of searching for the best performance is the source of most of the encoding complexity. To reduce the complexity of the coding block partition in HEVC, a new end-to-end fast algorithm is presented to aid the partition structure decisions of the coding tree unit (CTU) in intra coding. In the proposed method, the partition structure decision problem of a CTU is solved by a novel two-stage strategy. In the first stage, a bagged tree model is employed to predict the splitting of a CTU. In the second stage, the partition problem of a 32 × 32-sized CU is modeled as a 17-output classification task for the first time, so that it can be solved by a single prediction. To achieve a high prediction accuracy, a residual network (ResNet) with 34 layers is employed. Jointly using bagged tree and ResNet, the proposed fast CTU partition algorithm is able to generate the partition quad-tree structure of a CTU through an end-to-end prediction process, which abandons the traditional scheme of making multiple decisions at various depth levels. In addition, several datasets are used in this paper to lay the foundation for high prediction accuracy. Compared with the original HM16.7 encoder, the experimental results show that the proposed algorithm can reduce the encoding time by 60.29% on average, while the Bjøntegaard delta rate (BD-rate) loss is as low as 2.03%, which outperforms the results of most of the state-of-the-art approaches in the field of fast intra CU partition.

1. Introduction

Video coding standards have been continuously developed and updated for decades to meet the increasing demand of the video market for videos with higher definition. In recent years, various coding standards have been invented and replaced, such as advanced video coding (AVC), high-efficiency video coding (HEVC), versatile video coding (VVC), audio-video coding standard (AVS), and AOMedia video 1 (AV1). All of these methods have considerable coding benefits; for example, developed by the Joint Collaborative Team on Video Coding (JCT-VC), VVC and HEVC are both able to achieve a 50% lower bit rate than their predecessors while maintaining the same video quality [1]. However, with the repeated transition of the video compression rate, the complexity of various video coding standards has increased dramatically due to the introduction of many efficient but complicated coding tools.
Block-based coding is one of the most important coding techniques and is commonly used in many popular video coding standards. Taking HEVC and VVC as an example, HEVC uses a quad-tree structure to partition a coding unit (CU). There are two options for a CU of size 16 × 16 (i.e., nonsplit or split into four sub-CUs of size 8 × 8). However, the options for a CU of size 32 × 32 increase to 17 (1 + 2 4 ), and for a coding tree unit (CTU), the options are as many as 83,522 (1 + 17 4 ). Specifically, a CTU in VVC can be as large as 128 × 128. VVC uses a quad-tree plus binary-tree (QTBT) structure to finish block partitioning [2]. This supports the use of horizontal and vertical binary-tree (BT) and ternary-tree (TT) structures to further expand the partition structure. The intra-coding complexity of VVC is, on average, 18 times higher than that of HEVC [3]. In block-based video coding standards, each CU can then be iteratively split into sub-CUs according to a specific partition structure. A flexible CU partition rule results in various size combinations for a CU. With many CU sizes and modes to be selected, rate-distortion optimization (RDO) is adopted to select the optimal CU partition structure for a CTU, along with prediction modes. During the encoding process, many video coding standards traverse all possible CU sizes and prediction modes, and then RDO is used to select the best combination with the minimum cost. As a result, RDO results in the greatest encoding complexity burden by exhaustive calculations in the CU size decision process, and it restricts the application of video coding standards in many real-time scenarios. Thus, it is necessary to design a fast CU partition algorithm for existing video coding standards.
Although the encoding complexity of VVC is far greater than that of HEVC, HEVC is used much more widely than VVC in industrial applications [4]. Considering the high complexity of HEVC and VVC, algorithms reducing their encoding time are urgently needed. However, the partition structure of a CTU in HEVC is simpler than that of VVC, although HEVC has a similar block-based coding structure to VVC, while there are differences in some partition cases. Furthermore, acceleration algorithms based on deep learning usually need the support of a graphics processing unit (GPU), and GPUs supporting HEVC hardware encoding–decoding are far more mature and popular than those of VVC. To validate the effectiveness of our approach, the implementation of HEVC is easier than that of VVC, and is also highly practical for industrial applications. Intra coding is frequently used in sequence encoding, in terms of the intra profile and the encoding of key reference frames in other profiles. One of the properties of intra coding is that the splitting decision is only related to the information in the current frame, which allows classifiers to predict the partition structure from pixels directly. In comparison, inter coding involves not only information regarding the current frame, but also factors from the time domain. This makes the splitting decision of inter CU another focus-of-research point, as intra coding is the basis of inter coding. As a result, we focus on the partition problem of HEVC intra coding in this paper.
In the past several years, many approaches have been proposed to reduce the massive encoding complexity of various standards, such as HEVC and VVC. Works focusing on fast 3D-HEVC encoding have been developed [5,6,7,8]. Some researchers proposed fast video coding methods from the perspective of hardware design. Zhang et al. [9] presented four algorithm adaptations and a fully parallel hardware architecture for an H.265/HEVC intra encoder, the first of its kind. In addition, Zhang et al. [10] also presented high-performance algorithm adaptations and a high-throughput hardware architecture for the HEVC intra encoders. Cai et al. [11] proposed an efficient intra mode decision algorithm for the parallel hardware architecture of the AVS3 intra encoder by processing CUs in parallel, including intra prediction and estimating the rate-distortion cost for mode decision. Sjövall et al. [12] introduced the first complete high-level synthesis (HLS) implementation for an HEVC intra encoder on FPGA, and designed a proof-of-concept system for hardware-accelerated HEVC encoding. Zummach et al. [13] proposed a hardware design for the AV1-constrained directional enhancement filter, targeting the real-time processing of 4K ultra-high-definition videos.
Heuristic-based CU depth decision approaches have been proposed and widely studied [14,15,16,17,18,19,20]. For example, Liu et al. [15] proposed a fast CU depth decision algorithm based on statistical analysis. They used a three-stage method to make the splitting result decision according to prior information. Shen et al. [21] proposed an early determination and a bypass strategy for CU size decisions by using the texture property of the current CU and coding information from neighboring CUs. In some approaches, the CU depth range was shorted, and some CU depth levels were skipped according to statistical information [22,23].
Although the heuristic-based fast methods have achieved many acceptable results, they cannot properly consider the partition property of various video sequences. In other words, there are too many factors to influence the partition result. Furthermore, these factors may change with different sequences, such that people do not usually know which combination of these factors has the best performance upon implementation. Generally, we only consider several key factors closely correlated with CU partition, and a small number of the considered factors may lead to a poor result.
The technique of classical machine learning algorithms is introduced in order to overcome the drawbacks of statistical-information-based methods. Support vector machine (SVM) models with three outputs are used to achieve a trade-off between bit distortion and encoding complexity [24,25]. In addition, to further improve the prediction accuracy, two or more SVM models are employed in each CU depth. Zhang et al. [26] employed two SVMs at each depth to make the decisions regarding early CU split and early CU termination. Zhu et al. [27] used the cascaded SVM and defined a misclassification cost and a risk area to jointly make a CU partition decision. Meanwhile, Grellert et al. [28] and Zhang et al. [29] also proposed SVM-based approaches which focused on features analysis. In addition, decision tree or data mining methods were also used to reduce the encoding complexity [30,31,32,33,34]. Furthermore, Fisher’s linear discriminant analysis and the k-nearest neighbors classifier were employed in order to quickly decide on a CU partition [35], and Kim et al. [36] proposed a joint online and offline Bayesian decision rule-based fast CU partition algorithm. Moreover, Yang et al. [37] proposed an efficient low-complexity intra coding algorithm for VVC by using learning-based classifiers.
Although the classical machine learning model-based methods outperform the heuristic-based methods due to their advantages when dealing with high-dimensional problems, their inputs (i.e., features) play a very important role in the encoding results. In addition, the features’ design is entirely manual and requires much experience. Additionally, there are many key features which are commonly used in existing works. Hence, in order to significantly improve the encoding performance, researchers should find more efficient features, which is usually quite difficult. Furthermore, one or more classifiers are generally needed for each depth, which requires much work and a long training time. Algorithms using the convolutional neural network (CNN) were proposed to address these problems [38,39,40]. Due to the properties of CNN when it comes to automatic region feature extraction, these algorithms have enormous advantages in image processing. CNN-based algorithms have also achieved many good encoding results.
Jamali et al. [41] used deep reinforcement learning to reduce the encoding complexity of HEVC intra coding. Amna et al. [42] proposed a LeNet5-based approach for fast intra coding. Liu et al. [43] devised a convolutional neural network (CNN)-based fast algorithm to prune no less than two partition modes for RDO processing on each CTU. However, its CNN structure is too shallow to fully learn the relationship between the image data and the partition structure. In addition, considering all available partition modes for a CU, only a minimum of two CU partition modes are pruned, which is not enough. In addition, the algorithm proposed by Kim et al. [44] used image data and an encoding-information-based vector data to train a CNN for the prediction of the CTU depth. However, in this algorithm, not only image data but also vector data need to be collected before the prediction phase, which requires more pre-encoding time. In addition, three kinds of CNN structures should be constructed, with each being designed for a CU of a certain depth. Therefore, at least three CNNs are needed for one video sequence. Furthermore, Xu et al. [45] proposed an approach using a CNN and a long short-term memory (LSTM) network. Specifically, the CNN was used to predict the CU partition of intra coding, and the LSTM network was used to predict the CU partition for inter coding. In their algorithm, the CNN, especially the LSTM part, is highly complex, and requires time to be trained and refined.
As we can see, these CNN-based methods still complete the CU partition prediction at various depth levels, with one or more CNN models being needed for each CU depth. This means that at least three deep learning models are needed for a single video sequence. In other words, existing works still model the CU partition as a binary classification problem, which is a great waste of the CNN’s abilities. An end-to-end approach is needed. A CTU in HEVC has 83,522 possible partition structures in total, which makes it hard for a deep learning classifier fed with CTU pixels to correctly choose the right partition structure through a single prediction. However, the number of possible partition structures of a 32 × 32 CU is 17, and the partition structure of a 32 × 32 CU is much easier for a deep learning classifier to predict than that of a CTU. Thus, we take a two-stage strategy to complete the CTU partitioning.
Although the name “two-stage” was mentioned by [24,46], the meaning of “two-stage” in our paper is quite different to theirs. Specifically, they both solve the estimation problem in a traditional way, by which the splitting decision of a CU is made depth by depth. In [24,46], “two-stage” means that an additional binary classification will be performed for each depth for CUs left undetermined in the first stage. In our manuscript, the two-stage strategy means we only need to perform a binary classification for a CTU, then the partition structure can be directly determined by a single prediction.
The first stage is the task of splitting decisions from the CTU to 32 × 32 CUs, which can be handled by a simple learning-based method. In this paper, we use a bagged tree at the CTU level due to its simple structure and fast prediction speed. Among traditional machine learning methods, prediction efficiency, time complexity, and implementation difficulty vary a great deal. However, compared with other models, the tree model has its unique advantages. First, it aligns with people’s common sense when it comes to some classification problems. Thus, it can achieve quite a high accuracy among some particular problems through proper training. Second, it is much easier to train and takes less time to finish predictions, which results in negligible overhead times. Third, it is also easier to be implemented into existing works due to the simple “if…else…” structure-based prediction process. A deep learning network can also be used, but it contains far more parameters and is designed for difficult tasks. It would be a waste of ability if we also employed a deep learning network at the CTU level.
The second stage is the decision of the partition structure for a 32 × 32 CU. A 32 × 32 CU can be partitioned 17 ways, such that the decision can be predicted by deep learning techniques as a multi-classification task. Because the differences among these 17 classes are very small, partition structures are similar to each other, which makes it hard for a sample network to solve the end-to-end CU partition problem. More layers usually means a higher accuracy; ResNet can contain many layers while maintaining a good convergence performance. We chose a ResNet with 34 layers as the classifier to achieve a high prediction accuracy, which is suitable for our prediction task.
In this paper, we construct a deep structure to explore the learning capacity of ResNet. Meanwhile, we propose an end-to-end solution for the CTU partition, which models the CU partition as an unprecedented multi-classification problem. To verify the effectiveness of our proposed method, we implement it into HEVC intra coding. First, bagged tree models are employed to classify a CTU to sharply shorten the classification categories. Then, an end-to-end ResNet is trained to predict the final partition structure of a 32 × 32 CU instead of predicting the splitting decision of a CU at a certain depth.
The main contributions of this paper are presented as follows:
  • Adopting a two-stage prediction strategy with a combination of bagged tree and ResNet, the proposed algorithm can achieve more accurate prediction results. It reduces the CU partition categories sharply and effectively, and abandons the traditional scheme of making multiple decisions at various depth levels;
  • For the first time, the partition task of a 32 × 32 CU is modeled as a 17-class problem, for there are 17 ways in total to partition a 32 × 32 CU. The partition structure can be decided by an end-to-end ResNet model through a single prediction;
  • A general solution to CU partitioning in video intra coding is proposed, and is verified on HEVC. In a similar way, it can be implemented on other block-based video coding standards and reduce encoding times.
This paper is organized as follows. Section 2 introduces the quad-tree-based partition structure and gives a brief review of bagged tree and ResNet. Section 3 describes the proposed bagged tree and ResNet-based end-to-end joint fast CTU partition algorithm. Section 4 reports the experimental results. The conclusions are summarized in Section 5.

2. Background

In this section, we first describe the CU partition technique in HEVC. Then, we give a brief review of the bagged tree method, followed by a short introduction of the ResNet model.

2.1. CU Partition of HEVC

To encode a video sequence, each frame among a sequence is divided into multiple non-overlapping squares of size 64 × 64. As the largest CU, a CU of size 64 × 64 is also called a CTU. As is known, a larger CU can save more semantic information, while smaller CUs can achieve more precise pixel prediction values. Thus, HEVC employs a recursive splitting process to traverse all the possible partition results of a CU. Figure 1 shows the recursive splitting process of a CTU, and this process terminates when it reaches the smallest CU, the size of which is usually configured before encoding, and defaults to 8 × 8. Therefore, there are, in total, four kinds of CUs, all of which have different sizes, i.e., 64 × 64, 32 × 32, 16 × 16, and 8 × 8, shown as squares of different colors in Figure 1.
According to a quad-tree structure, HEVC employs RDO to make the optimal partition decision for a CTU. The left part of Figure 2 shows a partition example of a CTU, and the right part of Figure 2 is the corresponding quad-tree structure.

2.2. Bagged Tree

Traditional machine learning methods have shown great advantages in classification tasks. As one of the most famous classical machine learning models, the decision tree is widely used in various application scenarios, such as image recognition and data mining. As its name suggests, the decision tree employs a tree structure to make a classification decision. For a classification task, each leaf node in a decision tree model represents a target class, and each parent node contains an attribute along with a threshold. In this way, the decision-making process becomes deeper, and the predicted labels are generated.
However, the decision tree is likely to overfit the training set. The bagging technique is introduced to address this problem. As a result, the bagged tree model is generated [47] as an ensemble of many decision tree classifiers, each of which is trained with a random subset of the training dataset. After training, the final prediction of a bagged tree model for an instance is made by taking the majority vote of the predictions from all individual decision trees of the input sample. Figure 3 shows the structure of a bagged tree model consisting of n decision trees, and also illustrates how the bagged tree generates the final prediction for an instance. Since the bagging technique decreases the variance of the model without increasing the bias, the performance of the bagged tree model is better than that of a single decision tree model. Therefore, in the proposed joint fast CU partition algorithm, the bagged tree is used in the first phase to predict the splitting result of a CTU.
One of the most important features of the bagged tree model is that the importance of features can be evaluated during the training process without having to repeatedly train models with different feature combinations, as is required by most other feature-selection techniques. Caruana et al. [48] proposed a feature importance measurement technique, referred to as multiple counting, for a bagged tree model. In multiple counting, the importance value for every feature of a single decision tree model is calculated according to the number of data samples decided by this feature in all decision tree nodes. To compute the importance value of a feature for the bagged tree model, the importance values of a feature on the individual decision trees are summed and normalized by the feature entropy to ensure the comparability of features with different numbers of values. More details about the feature importance measurement technique are available in [48].

2.3. Residual Network

In recent years, the CNN has been a hot topic due to its excellent performance in solving image problems, such as image recognition and object detection. Compared with traditional machine learning methods, the CNN extracts effective features by using filters of various sizes instead of hand-crafted ones. Using the convolution, the CNN also reduces the massive parameters required in a neural network. However, when deeper networks start converging, previous research found that with the increment in network depth, the training error became higher, and the accuracy degraded rapidly [49].
To address this problem, He et al. [49] proposed ResNet using a deep residual learning framework. Figure 4a shows the structure of a basic building block in ResNet. With the introduction of a shortcut in Figure 4a, a deep network, constructed by many building blocks, can converge easily, and the degradation problem is solved. A ResNet is constructed by a stack of numbers of building blocks, as shown in Figure 4a, and He et al. [49] provided two kinds of such building blocks (Figure 4b,c), by which a well-performed ResNet of expected depth can be generated. The building block in Figure 4b is used to build a relative deep network (ResNet-34). The building block in Figure 4c, called “bottleneck”, is used to stack ResNet-50/101/152, which represents ResNets containing 50, 101, and 152 layers, respectively.

3. The Proposed Bagged Tree and ResNet-Based Joint CTU Partition Method

In this section, we describe the proposed fast CTU partition algorithm for HEVC intra coding. First, we illustrate the overall process, which explains how the bagged tree model and the ResNet model work jointly. Then, effective features are designed to train the bagged tree models. Furthermore, the architecture of the ResNet is designed to achieve a good prediction performance. Finally, the databases are constructed to train and validate our bagged tree and ResNet models. Using these databases, we train 20 bagged tree models (each is used for sequences under the same resolution and quantization parameter (QP) value). In addition, we also train four ResNet models with the same architecture, and each model is generated when a certain QP is set at different values, i.e., 22, 27, 32, and 37.

3.1. Flowchart of Our Fast Splitting Method

The flowchart of the proposed two-stage CTU partition algorithm is shown in Figure 5. As can be seen from Figure 5, there are roughly two phases in the proposed bagged tree and ResNet-based joint CTU partition algorithm.
In the first stage, a bagged tree-based classifier is used to predict the splitting status of a CTU, and the output is either split or nonsplit. Specifically, if a CTU is predicted to be of the nonsplit class, it goes to the CTU partition structure determination process directly, as shown in Figure 5, and the final partition is a whole 64 × 64 CTU without any splitting. On the other hand, if a CTU is predicted to be split by the bagged tree classifier, it will immediately be split into four sub-CUs with size 32 × 32. Sequentially, each of these four CUs will be passed to the second stage for further processing.
In the second stage, a 32 × 32-sized CU is fed to the finely trained ResNet classifier. As a result, of 17 labels, each of which represents a partition structure for a CU with size 32 × 32, one label is the output by ResNet. Similarly, all four sub-CUs of a CTU predicted to be split in the first stage are classified, and four corresponding predicted labels are generated. Then, these four labels, as well as the parent CTUs, are processed further.
A CTU partition structure determination process is adopted by following the two above-mentioned stages. According to the four labels generated by ResNet in stage 2, the partition structure of the corresponding parent CTU is decided. Figure 6 shows the flowchart of the proposed algorithm. The predicted label ( P L ) output by ResNet for a CU of size 32 × 32 is from 1 to 17. The corresponding partition quad-tree structure is illustrated in Figure 6, where the P L values of four sub-CUs (numbered 1, 2, 3, and 4) are assumed to be 1, 5, 17, and 2. Once a partition of a CTU is generated, an optimal rate-distortion cost can be calculated directly without many comparisons. Then, an encoding process is executed.
Compared with traditional recursive RDO, the proposed algorithm effectively skips the unnecessary search for different combinations of CU sizes. In addition, compared with other existing fast partition methods implemented on a depth level, this paper proposes a novel end-to-end two-stage CTU partition algorithm by using the bagged tree and ResNet techniques. In this way, the CTU partition result can be calculated through a well-trained bagged tree model and a fine-tuned ResNet model. As a result, we not only significantly reduce the time spent on RDO, but also spend less time on training the required learning models compared with existing works, which train as many as three or more models on a depth level.

3.2. Features Design for Bagged Tree Model

The traditional machine learning methods rely heavily on handcrafted features. Many existing works have developed a number of useful attributes for CU splitting label prediction. Based on these existing features, in our previous work [50], we also designed several novel features which were proven to be effective. As a result, in this paper, we select a total of 29 feature candidates used in [50], which are listed in Table 1 along with their corresponding meanings. These feature candidates are from four fields: information from neighboring CTUs, side information during the pre-encoding process, statistical information of CTU pixels, and information from pixel filtering results. We will give a brief introduction of these feature candidates in the following paragraphs, and more details are available in our previous work [50].
The results of [51] suggest that information from neighboring CTUs is useful for the decision making of current CU in regard to partitions. Thus, the features m _ n b C t u A b o R d , m _ n b C t u L e f R d , m _ n b C t u A b l R d , and m _ n b C t u A b r R d are extracted, which represent the RD cost of the neighboring CTUs located at the the above, left, above-left and above-right regions of the current CTU, respectively. In addition, for a target CTU, m _ n b C t u A b o D e p t h , m _ n b C t u L e f D e p t h , m _ n b C t u A b l D e p t h , and m _ n b C t u A b r D e p t h denote the average depth values of its above, left, above-left, and above-right neighbored CTUs, respectively.
In addition, some bypass results during the encoding process are also important and widely used [52]. Hence, we pre-encode the current CTU with PLANAR mode and use several useful encoding results as key features. As a result, the features t o t a l C o s t , t o t a l D i s t o r t i o n , and t o t a l B i n s represent the total cost, the total distortion, and the number of bits under PLANAR mode, respectively. Furthermore, m _ a v e C B F is the coded block flag (CBF) of the current CTU encoded with PLANAR mode. Moreover, HEVC uses the Hadamard transformation to quickly estimate the encoding performance, so the encoding cost, the distortion, and the number of bits generated under Hadamard conditions are extracted as features, which are denoted as m _ c o s t H a d a m a r d , m _ s a d H a d a m a r d , and m _ b i t s H a d a m a r d , respectively.
Some classic statistical data, such as mean, variance, and gradient, can reflect the content complexity of a CU and the difference among the four sub-CUs comprising one CU. Thus, for a target CTU, we calculate the mean and the variance of all pixel values as m _ m e a n M a i n and m _ v a r M a i n , respectively, which are calculated according to the following equations:
m _ m e a n M a i n = 1 n i = 1 n p i
m _ v a r M a i n = 1 n i = 1 n p i m _ m e a n M a i n 2
where p i is the luminance value of the ith pixel, and n is the number of pixels in the current CU.
Furthermore, the variance of the four sub-CU means is calculated and denoted as m _ v a r M e a n S u b , and m _ v a r V a r S u b is the variance of the four sub-CU variances. These values are calculated through the following equations:
m _ v a r M e a n S u b = 1 4 i = 1 4 m e a n S u b i m _ m e a n M a i n 2
m _ v a r V a r S u b = 1 4 i = 1 4 v a r S u b i m e a n V a r S u b 2
where v a r S u b i represents the variance of luma pixels within the ith CU, and m e a n V a r S u b is the mean of all four sub-CU variances (i.e., v a r S u b 1 , v a r S u b 2 , v a r S u b 3 , and v a r S u b 4 ).
In addition, we also reuse the feature m _ n m s e , which was designed and proved to be efficient in [25]. m _ n m s e is the mean of squared errors between each pixel and the mean of its eight neighboring pixels of a CTU. It is calculated as follows:
p ¯ i , j = 1 8 p i 1 , j 1 + p i 1 , j + p i 1 , j + 1 + p i , j 1 + p i , j + 1 + p i + 1 , j 1 + p i + 1 , j + p i + 1 , j + 1
m _ n m s e = 1 N 2 i = 1 N j = 1 N p i , j p ¯ i , j 2
where p i , j is the luma value of the pixel located at ( i , j ) in the current CU. N is the side length of a CU, which is 64 in the case of a CTU.
In addition, we also apply several kinds of filters to the pixels of a CTU and process these filter results to obtain useful features, which can reflect the pixel change, the content complexity, and even the edge information of a target CTU. As a result, m _ e d g e S o b e l and m _ d c o m are features calculated from the responses of Sobel filters, widely used in edge detection. Figure 7 shows four Sobel filters for detecting edges in different directions. Each filter is applied with overlap on every 3 × 3 square pixel block within the current CU. Figure 7a is an example of the 3 × 3 square pixel block. m _ e d g e S o b e l and m _ d c o m are calculated through the following equations:
g h = a 2 b c + g + 2 h + i
g v = a 2 d g + c + 2 f + i
g 45 = 2 a + b + d f h 2 i
g 135 = b + 2 c d + f 2 g h
m _ e d g e S o b e l = 1 N 2 2 k = 0 N 2 2 g h k 2 + g v k 2 1 / 2
m _ d c o m = 1 N 2 2 k = 0 N 2 2 g h k + g v k + g 45 k + g 135 k
where N is the pixel number of a CU along a side, which is 64 in the case of a CTU. k denotes the kth 3 × 3 square pixel block within the current CU.
As we can see, m _ e d g e S o b e l can reflect information about the horizontal and vertical edges, and m _ d c o m represents the comprehensive gradient information of the current CU from four directions. Moreover, Bay et al. [53] systematically analyzed the significant advantage of the Haar wavelet on the edge changing and scene shading of a picture. Therefore, we performed three Haar filters of different directions on the pixels in a target CTU. Figure 8b–d show the Haar filters of horizontal, vertical, and diagonal directions, respectively. Figure 8a is an example of a 2 × 2 square pixel block on which the Haar filters are performed. Specifically, we first split a CTU into 2 × 2 non-overlapped sub-squares. Then, each sub-square was filtered by the same Haar filter to obtain the corresponding filter responses of a certain direction. The responses of a certain filter on a sub-square are calculated according to the following equations:
d x = a + b c d
d y = a b + c d
d x y = a b c + d
where d x , d y , and d x y are the filter responses of horizontal, vertical, and diagonal directions, respectively.
Based on these responses, we can sum them to obtain the features m _ h a a r S u m x , m _ h a a r S u m y , m _ h a a r S u m x y , m _ h a a r S u m A b s x , m _ h a a r S u m A b s y , and m _ h a a r S u m A b s x y , according to the following equations:
m _ h a a r S u m x = 1 N 2 2 k = 1 N 2 2 d x k
m _ h a a r S u m y = 1 N 2 2 k = 1 N 2 2 d y k
m _ h a a r S u m x y = 1 N 2 2 k = 1 N 2 2 d x y k
m _ h a a r S u m A b s x = 1 N 2 2 k = 1 N 2 2 d x k
m _ h a a r S u m A b s y = 1 N 2 2 k = 1 N 2 2 d y k
m _ h a a r S u m A b s x y = 1 N 2 2 k = 1 N 2 2 d x y k
where N is the number of pixels of the current CU along one side, which is 64 in the case of a CTU.
Furthermore, the number of interest-related points within a picture can reflect people’s visual perception, while its influence on the CU splitting goes unnoticed. So, we extract the interest-related points of the feature m _ n u m A v e I n t e r e s t P o i n t for a target CTU by using a particular filter on a CTU. The feature m _ n u m A v e I n t e r e s t P o i n t represents the average number of interest points for each pixel of a CTU. This reflects how much attention people will pay to a CTU and how many details a CTU contains. Three filters, as shown in Figure 9, are used on each of the current CTUs, and three corresponding results D x x , D y y , D x y are obtained as the filter responds in the horizontal, vertical, and diagonal directions, respectively. We obtain the final value of the feature m _ n u m A v e I n t e r e s t P o i n t for the current CTU by using the following equations:
P i , j = D x x D y y 0.9 D x y 2
B i , j = 0 , P i , j < t 1 , P i , j t
m _ n u m A v e I n t e r e s t P o i n t = 1 N 2 i = 0 N 1 j = 0 N 1 B i , j
where P ( i , j ) is the interest value of the pixel located at ( i , j ) , and B ( i , j ) is the Boolean value of the decision to create an interest point for pixel ( i , j ) . t is the threshold to judge the interest point. N, the value of which is 64, represents the size of the current CTU. Because the original interest point detection method uses more complicated filters to obtain P ( i , j ) , which is much more time consuming, the relative weight of 0.9 is used to minimize the error between them.

3.3. Features Selection for Bagged Tree Model

These 29 feature candidates, as shown in Table 1, are too numerous to be implemented. Hence, these candidates are ranked by the feature importance measurement technique introduced in Section 2.2 during the bagged tree training phase.
According to the ranking results, we find that the importance values are divided between the 10th and the 11th most-important features. In addition, the importance values of the 10 most-important features stay at a relatively high level, while the importance values for the rest of the feature candidates are generally very low. Thus, we pick the 10 most-important features as our final attributes. Hence, each bagged tree model has its own unique feature set consisting of the 10 most-important features.
Table 2 lists the top-10 features of the classifiers for the 5 resolution classes (i.e., A, B, C, D and E) and different QP values. The importance values of the corresponding features are also shown in Table 2. These top 10 features of classifiers for different QPs and resolution classes are almost the same, while their rankings change.

3.4. ResNet Model Designing and Training

Four ResNets with the same architecture are used, which dedicate video sequences under different QP values, i.e., 22, 27, 32, and 37, respectively. The ResNets used in this work are based on the 34-layer ResNet in [49]. The specific architecture of the ResNet is shown in Figure 10. Each convolution block in Figure 10 represents a convolution process followed by a normalization process and a rectified linear unit (ReLU) calculation. The ResNet used in this work consists of 34 layers, and takes a luma CU of size 32 × 32 as the input. With a fully connected layer at the very end, the ResNet outputs a vector to describe the probability of a CU belonging to each class. Using this probability vector and the ground truth vector of the target CU, the cross entropy loss is calculated according to the following equation:
L = loss ( V 1 , V 2 ) = log exp V 1 × V 2 i = 1 17 exp ( V 1 × i )
where V 1 is the probability vector output by ResNet, which contains the probabilities of a CU belonging to every class; V 2 is the class label ground truth of a CU, in the form of one-hot encoding; and L is the cross entropy loss between V 1 and V 2 . The cross entropy loss is used to measure the difference between the predicted label and the ground truth of the 32 × 32 CU. Since it is a convex function, the global minimum can be easily calculated by taking a partial derivative. Generally, training the ResNet model involves finding suitable parameters to minimize the cross entropy loss of all the training samples.
We use the deep learning framework PyTorch to train the ResNets in this paper. The Adam optimizer is used with a learning rate of 0.01. Specifically, the models are trained on 40 epochs with a batch size of 32.

3.5. Database Generation for Training and Validation

In this paper, the bagged tree and the ResNet are used jointly to make an end-to-end decision of the partition structure for a CTU. Specifically, the bagged tree is used to make the splitting decision for a 64 × 64 CU, while the ResNet is used to determine the partition structure of a 32 × 32 CU through a single prediction. Thus, two kinds of databases are needed. One is constructed for the bagged tree model and the other is constructed for the ResNet model.
Because resolution and QP both have a strong influence on the splitting of a CU, we cannot train a prediction model without considering them. In this paper, we train one bagged tree model for each resolution and each QP value, and train one ResNet model for each QP value. In practical applications, people can pick specific models according to their own encoding scenarios. It would be ideal to train a general model for every situation, but it is difficult to maintain a high encoding performance while achieving generality, and a much bigger training set is required, including all possible resolutions and QPs. In addition, the strategy of training a single model for a certain condition can improve the prediction accuracy in order to achieve a better encoding performance. Moreover, it provides people with more specific solutions according to their own encoding tasks.
First, five sequences of different resolutions are picked from the standard test sequences established by JCT-VC [54] as training sequences: Traffic (2560 × 2600), ParkScene (1920 × 1080), BasketballDrill (832 × 480), BQSquare (416 × 240), and FourPeople (1280 × 720). Then, these five sequences are encoded by HM16.7 under all intra configurations but four QPs (22, 27, 32, and 37).
As for the databases used to train bagged tree models, we extract 10 key features of each CTU among a training sequence under a particular QP and resolution class. In addition, the splitting label of a CTU is also extracted to form the training database. So, there are 20 databases in total, each of which is constructed for a QP value and a resolution class, as shown in Table 3. D B x y represents the database used to train the resolution class x and QP y bagged tree model. For example, D B A 22 is the database constructed to train the bagged tree model, which is used to make the splitting decision of the CTUs in a sequence under resolution A and QP 22.
Specifically, to form the database used to train the bagged tree models, 36,000 CTU samples are randomly picked from the training sequences encoded by HM16.7. To balance the database, the ratio between the samples of split and nonsplit labels in each database is 1. When there are not enough samples in the whole encoded sequence, all of the nonsplit samples are picked, and the same number of split samples is randomly picked.
As for the databases constructed to train the ResNet, due to the end-to-end prediction structure, each partition structure of a 32 × 32 CU corresponds to a class label. There are 17 classes in total, and these classes, together with the corresponding partition structures, are shown in Figure 11. As we can see from Figure 11, these classes cover all the possible partition results for a CU of size 32 × 32. In this way, a partition structure can be predicted by ResNet through a single prediction.
In the databases for ResNet, each sample includes the luma values of a 32 × 32 CU and its ground truth label according to the encoding results. To form the database, all 32 × 32 CUs in a training sequence are collected. Different from the 20 bagged tree models, each ResNet model is designed for the sequences encoded under a certain QP, so four ResNet models are required in total. Hence, four databases are generated (denoted as DB-22, DB-27, DB-32, and DB-37), and constructed for the sequences encoded with QP 22, 27, 32, and 37, respectively. Taking the generation of DB-22, for example, we firstly encode five training sequences with QP 22. Then, the luma values and class labels of 32 × 32 CUs from these five sequences are all collected to obtain DB-22. Similarly, DB-27, DB-32, and DB-37 are generated. It is worth noting that the difference among these four databases lies only in the labels. The luma pixel values between different databases are the same, because they are all from the same training sequences.
After all databases are generated, each is divided into two parts: the training datasets and validation datasets. The number of samples in the training dataset accounts for 90% of the total number of samples, and samples in the validation dataset account for 10%. In this paper, chroma CUs are split in the same manner as luma CUs. Hence, the models and datasets for chroma are not considered.

4. Experimental Results

In order to verify the performance of the proposed bagged tree and ResNet joint fast algorithm (BTRNFA), we implemented this algorithm in the HEVC reference encoder HM16.7. The original software HM16.7 is available online [55]. In addition, the deep learning framework PyTorch is used to perform the training and the prediction of ResNet models. Test sequences were selected from the HEVC common test conditions (CTC) [54].
Experiments were conducted on an Aliyun host, which has a Windows 64-bit operating system. The host has four kernels of Intel(R) Xeon(R) Platinum 8269CY CPU @ 2.50 GHz, 3.10 GHz with a 16 GB memory, and is also equipped with an NVIDIA RTX 2080s GPU. Coding parameters were set as the default, and all results were generated under the all-intra main configuration. The number of frames to be encoded was set as the maximal value for each sequence according to the CTC. When HM16.7 begins to encode a video sequence, the python code of ResNet starts running on the GPU to predict the partition structures of all frames in the current video sequence. Due to the computing capability of a GPU, the ResNet outputs the partition structure of a CTU before the encoder begins to encode it. We sum the inference time of ResNet and the time spent by the encoder together as the final encoding time of the proposed algorithm.
There are three versions of the proposed BTRNFA. The first version is denoted as BTRNFA DT , in which only the bagged tree model is active. In this situation, the CUs of depth 0 are partitioned according to the predicted labels output by a bagged tree model, and CUs of depth 1 and 2 are processed by RDO. The second version is BTRNFA ResNet , in which only the ResNet model for the CUs of depths 1 and 2 is active. RDO is performed on CUs of depth 0. The third version is BTRNFA joint , which is also the most aggressive version. In the BTRNFA joint , both the bagged tree model and the ResNet model are activated. As a result, BTRNFA joint can achieve the greatest reduction in the encoding time.
First, BTRNFA DT , BTRNFA ResNet , and BTRNFA joint were carried out for performance comparison. We analyzed the contributions of the bagged tree model and the ResNet model on the proposed joint algorithm. In addition, we also compared the BTRNFA joint algorithm with the CNN-based state-of-the-art CU depth decision algorithms, i.e., the CU partition mode decision algorithm (PMDA) in [43] and the complexity reduction method (CRM) in [45]. To measure the rate-distortion performance, the BD-rate was calculated. The fast algorithm usually leads to an increase in the BD-rate, and the BD-rates of all sequences are averaged to reflect an overall encoding quality. The greater the increase in BD-rate is, the worse the encoding quality. Complexity reduction was measured by the savings in encoding time (denoted as TS), which was calculated according to the following equation:
T S = t i m e r e f t i m e p r o t i m e r e f × 100 %
where t i m e p r o is the sequence encoding time of the proposed algorithm, and t i m e r e f is the encoding time spent by the reference encoder. Encoding time is calculated by the function “clock”, with the standard header “time.h” for C, which measures the time the encoding process takes from start to finish. The referring time of ResNet is measured in the Python code by using Python package “time”. t i m e p r o equals the sum of the referring time of ResNet and the encoding time outputted by the encoder.

4.1. Performance of Three Versions of The Proposed Algorithm

In this section, we discuss the BD-rate loss and time-saving performance of three versions of the proposed BTRNFA (i.e., BTRNFA DT , BTRNFA ResNet , and BTRNFA joint ). The experimental results of each version are shown in Table 4.
We can see from Table 4 that BTRNFA DT achieves a 0.25% BD-rate loss with an encoding time reduction of 22.37% on average. Its BD-rate loss is the smallest among the three versions of the proposed algorithm, as are its encoding time savings. The average BD-rate loss of 0.25% shows that our bagged tree model is trained well and has a high prediction accuracy in test sequences. However, the time-savings results are not the highest, because only the bagged tree model is activated in this version of the proposed algorithm, and the encoding complexity among the CU partitioning of depths 1 and 2 is not considered reduced.
On the contrary, the bagged tree model is disabled in BTRNFA ResNet , and only the ResNet model is active. In this case, RDO is performed on each CTU while the partition structure of CUs with depth 1 is generated by the end-to-end prediction. This version of the proposed algorithm achieves a BD-rate loss of 1.81% with a time saving of 49.83% on average, compared with the original algorithm in HM16.7. We can see from Table 4 that, compared with BTRNFA DT , the time savings of BTRNFA ResNet increase by about 27.46%, with a 1.56% sacrifice in terms of BD-rate. The results given in Table 4 show that the prediction accuracy of ResNet is not quite so high that further BD-rate loss is caused. On the other hand, we can also see that more complexity can be saved with CU depths 1 and 2 than that in a CU with depth 0.
BTRNFA joint is the most aggressive version, in which both the bagged tree model for CTU and the ResNet model for CU in depth 1 are activated. Its results are shown in the last two columns of Table 4. BTRNFA joint achieves a complexity reduction as great as 60.29%, with a BD-rate loss of only 2.03%. Since it has the best time-savings results of the three algorithm versions, its BD-rate loss performance is acceptable.
As we can see, the performance of the proposed BTRNFA joint varies with the sequences listed in Table 4. To determine the kinds of videos suitable for BTRNFA joint , such that good results can be obtained, we use the ratio of time savings versus BD-rate loss to conduct further analysis. As shown in Table 4, BTRNFA joint performs better in videos of resolution class C and D than those of A, B, and E, which means our method has better performance in low-resolution videos, which may be due to the high prediction accuracy of CTUs in low-resolution videos. In addition, observing performance differences on sequences of the same resolution class, we can see that BQTerrace shows better results than BasketballDrive. Considering BD-rate and time savings jointly, PartyScene and BlowingBubbles outperform BQMalll and BasketballPass, respectively. It is easy to find the sequences BasketballDrive, BQMalll, and BasketballPass, which all contain multiple fast-moving objects in a scene. Sequences which contain much still or slow-moving content allow our method to achieve good results easily. Thus, we can conclude that low-resolution videos with less moving content are suitable for the proposed method.
As for the performance of our method on other QP settings, on the one hand, we can use the current models to directly encode videos under other QPs. This does not affect the RD performance, but only affects the benefit of time savings. On the other hand, we can train one model for a particular QP. This will obviously result in a better RD performance and more time savings, since it is targeted to the QP. In short, experiments on existing QPs have verified the effectiveness of our algorithm. For other QPs, our method can achieve a better trade-off between RD performance and time savings by training the corresponding models.

4.2. Prediction Accuracy and Inference Overhead of the Proposed Method

To analyze the performance of the proposed BTRNFA joint at each stage, we present the prediction accuracy of the bagged tree and ResNet models, as well as the overhead GPU inference time.
Firstly, Table 5 shows the prediction accuracy of different bagged tree models for CUs in depth 0. The average accuracy of these 20 bagged tree models is 89.86% on the splitting prediction for CUs in depth 0. The prediction accuracy is quite stable, at around 90% for four QP values, which can be observed from the last row of Table 5. In addition, we find these four bagged tree models trained for resolution class A all perform below average, perhaps because the video sequence used for training is not representative.
In addition, from different levels, Table 6 presents the prediction accuracy of four ResNets. On the overall prediction level, four ResNets show quite stable accuracy performances, which are distributed between 56% and 58%. Although the overall accuracy is low, their accuracy on different depth levels is quite good. In Table 6, the prediction level of depth 1 refers to the split flag prediction (i.e., split or non-split) of CUs in depth 1. Furthermore, the prediction level depth 2 refers to the splitting decision prediction for CUs in depth 2, which is also a binary decision. As we can see from depth level 1 of Table 6, the highest split flag prediction accuracy for CU in depth 1 is 89.34% of the ResNet trained for QP 27. Even the lowest split flag prediction accuracy for CU in depth 1 is as high as 86.43%. Furthermore, the accuracy of four ResNets on depth level 2 is similar to that of depth level 1. It can be observed that, although the overall prediction accuracy of four ResNet models is not high, the prediction accuracy of the splitting decision at each depth level is quite high. This is because the difference between classes is not obvious in the multi-classification task for CU partitioning, and a slight prediction error will not lead to the splitting decision error at each depth level. The high prediction accuracy of ResNets at each depth level also verifies the correctness of our algorithm.
This paper aims to reduce the encoding complexity by deciding the partitioning structure of a CTU early, so the complexity introduced by the ResNet model must be considered. As a result, an appropriate network structure, as shown in Figure 10, is designed, and the encoding time of the proposed method includes the corresponding inference time, which is shown in Table 7. It can be observed from Table 7 that the inference overhead of four ResNets is about 1% of the original HM encoder. It is worth noting that the inference process is carried out on a GPU, so the consumption is very low.

4.3. Performance Comparison with CNN-Based State-of-the-Art Algorithms

This section firstly compares the encoding performance between the proposed BTRNFA joint and two other CNN-based intra mode fast decision algorithms: PMDA and CRM. These two algorithms, compared to BTRNFA joint , are implemented on different versions of reference software. In order to make a fair comparison, we apply the proposed BTRNFA joint to these reference software versions of the two comparison objects, respectively. The corresponding results are presented in the following paragraphs.
The PMDA in [43] reduces the hardware complexity of the encoder by decreasing more than two CTU partition modes for RDO. It achieves a 60.86% complexity reduction on average, and the BD-rate loss increases by as much as 2.74% on HM12.0. Compared with their results, the proposed BTRNFA joint saves about 0.73% in terms of BD-rate loss, with a negligible encoding time increment of 0.54% on average. The detailed results shown in Table 8 indicate that BTRNFA joint exceeds PMDA in BD-rate with a similar time savings.
As for the encoding complexity-reducing approach, CRM, in [45], an early terminated hierarchical CNN is proposed to decide the CU partitioning. The encoding complexity of the HEVC intra mode decision is dramatically reduced by replacing the RDO with the predicted partitioning result. On average, 61.91% of the encoding complexity is saved with 2.24% of the BD-rate loss increment, compared with the original HM16.5. Comparison results are shown in Table 9. Compared with CRM, the proposed BTRNFA joint achieves 0.22% less BD-rate loss, at 2.02%, with only 2.60% more encoding time. In addition, only one ResNet model is required in the BTRNFA joint , while the number of CNN models used in CRM is as many as three, which means that the proposed algorithm has advantages no matter the model training or encoder implementation.
Generally speaking, the proposed BTRNFA joint outperforms two CNN-based state-of-the-art algorithms. On average, an additional 0.73% and 0.22% in the BD-rate is saved, compared with PMDA and CRM, respectively. Although the time savings of BTRNFA joint are very similar, our approach shows an advance in terms of the model number required in encoding by introducing an end-to-end partitioning solution. Thus, the complexity of model training and implementation is quite low and is competitive for the proposed BTRNFA joint .
In addition, we also compare our work with two other machine-learning-based methods, RDNet and TCA, in terms of encoding performance. RDNet was proposed by Yao et al. [56] using a CNN network named RDNet. TCA was also a CNN-based CU partition approach, proposed by Zhang et al. [57]. RDNet and TCA both employ deep learning as their key techniques, which is necessary to carry out the comparisons. The encoding results of each algorithm are shown in Table 10. The proposed algorithm BTRNFA joint outperforms RDNet, in terms of encoding time savings, by 5.29%, while the BD-rate of our approach slightly increases, to about 0.19% more than that of RDNet. Our algorithm may not defeat RDNet thoroughly, but it is competitive. Compared with TCA, BTRNFA joint performs well. Their encoding performances are quite close. Considering the overall average, TCA causes as little as 0.1% less BD-rate loss compared with our method, and displays 2.14% more time savings. As for performances on the sequence in class A, the differences between TCA and BTRNFA joint are negligible. In addition, BTRNFA joint causes less BD-rate loss on class D and TCA causes less BD-rate loss on class B. They both have resolution categories that they excel in. It is worth noting that BTRNFA joint has an advantage in terms of the number of models when encoding a video sequence. TCA uses a three-stage strategy, such that it has to employ three CNN models while encoding a video sequence. BTRNFA joint only needs one bagged tree model and a ResNet model due to the two-stage strategy.

4.4. Comparisons of CU Partition Results

To compare the differences in the CU partition results between the original algorithm in HM16.7 and the proposed BTRNFA joint algorithm, we encode the 180th frame of the sequence RaceHorses (416 × 240) with QP 22 by using these two algorithms. Figure 12 presents the CU partition results of the original HM16.7. In Figure 12, the black line represents the CU boundaries. Figure 13 shows the CU partition results of the proposed BTRNFA joint . In Figure 13, we use the gold and red lines to represent the differences of the CU boundaries between the original HM16.7 and the BTRNFA joint .
It can be observed from Figure 13 that the same CU partition results take up a quite large portion. Setting the results in Figure 12 as the baseline, we observe that almost all the partition results upon the background and plain areas stay the same as those in Figure 13. This observation indicates that our bagged tree model and ResNet model achieve a high accuracy on CUs with flat contents. In addition, as we can see, the differences between Figure 12 and Figure 13 mainly exist among the edge areas. This means that our algorithm should be improved, in terms of the prediction of some particular CUs which cross the boundaries of objects. In addition, we also count the bits of this frame encoded by the original HM16.7 and the proposed algorithm, respectively. The frame encoded by the proposed approach takes 145,352 bits, which outnumbers the 144,552 bits of the original. This means that our approach loses 800 bits on this frame. The increase of 800 bits is reasonable since there are some partition errors which result in a decrease in compression ratio.
In general, compared with the optimal CU partition results generated by the original HM16.7, as shown in Figure 12, there are not many differences in the CU partition results generated by the proposed BTRNFA joint . Our BTRNFA joint algorithm performs well, and its CU partition results are satisfactory.

5. Conclusions

In this paper, we propose a bagged tree and ResNet-based joint end-to-end CTU partition structure prediction algorithm for HEVC intra coding. First, we construct effective datasets for our models. Then, the bagged tree model is designed to predict the splitting flag of a CTU. In addition, a ResNet-based model is designed and used on each CU of size 32 × 32, so that the partition structure can be determined through a single prediction. In this way, the traditional brute-force RDO is replaced, so that much encoding complexity is saved. Compared with the original HM16.7, the proposed algorithm saves as much as 60.29% encoding time, with only 2.03% BD-rate loss on average. Furthermore, our approach defeats four CNN-based state-of-the-art fast algorithms when making intra mode decisions, which shows the great application prospects of our approach. However, the ResNet used in our approach is on a large scale, which introduces huge complexity in terms of training and prediction. To reduce the number of trainable parameters, we will use pruning techniques to prune the ResNet. Transfer learning techniques will also be considered to increase the generalization ability of our ResNet in future work.

Author Contributions

Conceptualization, Y.L., L.L. and H.P.; formal analysis, Y.L. and Y.F.; software, Y.L. and Y.F.; supervision, H.P. and N.L.; writing—original draft preparation, Y.L. and H.P.; writing—review and editing, L.L. and N.L. All authors have read and agreed to the published version of the manuscript.

Funding

This work is supported in part by the National Key Research and Development Program of China (grant no. 2020YFB1805403), the National Natural Science Foundation of China (grant nos. 62032002, 61972051 and 61932005), the Natural Science Foundation of Beijing Municipality (grant no. M21034) and the 111 Project (grant no. B21049).

Data Availability Statement

The data presented in this study are available on request from the corresponding author.

Conflicts of Interest

The authors declare no conflict of interest.

Abbreviations

The following abbreviations are used in this manuscript:
HEVCHigh-efficiency video coding
VVCVersatile video voding
AVCAdvanced video coding
AV1AOMedia video 1
AV2AOMedia video 2
AVSAudio-video standards
JCT-VCJoint collaborative team on video coding
CTUCoding tree unit
CUCoding unit
QTBTQuad-tree plus binary tree
RDORate-distortion optimization
SVMSupport vector machine
ResNetResidual network
CNNConvolutional neural network
LSTMLong short-term memory network
QPQuantization parameter
CBFCoded block flag
CTCCommon test conditions
BD-rateBit-distortion rate
BTRNFABagged tree and ResNet joint fast algorithm
BTRNFA DT BTRNFA version in which only bagged tree is active
BTRNFA ResNet BTRNFA version in which only ResNet is active
BTRNFA joint BTRNFA version in which bagged tree and ResNet are both active
PMDAThe algorithm proposed by [43]
CRMThe algorithm proposed by [45]
RDNetThe algorithm proposed by [56]
TCAThe algorithm proposed by [57]

References

  1. Sullivan, G.J.; Ohm, J.; Han, W.; Wiegand, T. Overview of the High Efficiency Video Coding (HEVC) Standard. IEEE Trans. Circuits Syst. Video Technol. 2012, 22, 1649–1668. [Google Scholar] [CrossRef]
  2. Fan, Y.; Chen, J.; Sun, H.; Katto, J.; Jing, M. A Fast QTMT Partition Decision Strategy for VVC Intra Prediction. IEEE Access 2020, 8, 107900–107911. [Google Scholar] [CrossRef]
  3. Wu, S.; Shi, J.; Chen, Z. HG-FCN: Hierarchical Grid Fully Convolutional Network for Fast VVC Intra Coding. IEEE Trans. Circuits Syst. Video Technol. 2022. [Google Scholar] [CrossRef]
  4. Video Developer Report 2021. Available online: https://go.bitmovin.com/video-developer-report (accessed on 12 January 2022).
  5. Chen, M.J.; Lin, J.R.; Hsu, Y.C.; Ciou, Y.S.; Yeh, C.H.; Lin, M.H.; Kau, L.J.; Chang, C.Y. Fast 3D-HEVC Depth Intra Coding Based on Boundary Continuity. IEEE Access 2021, 9, 79588–79599. [Google Scholar] [CrossRef]
  6. Saldanha, M.; Sanchez, G.; Marcon, C.; Agostini, L. Fast 3D-HEVC Depth Map Encoding Using Machine Learning. IEEE Trans. Circuits Syst. Video Technol. 2020, 30, 850–861. [Google Scholar] [CrossRef]
  7. Bakkouri, S.; Elyousfi, A. FCM-Based Fast Texture CU Size Decision Algorithm for 3D-HEVC Inter-Coding. In Proceedings of the 2020 IEEE/ACS 17th International Conference on Computer Systems and Applications (AICCSA), Antalya, Turkey, 2–5 November 2020; pp. 1–5. [Google Scholar] [CrossRef]
  8. Fu, C.H.; Chan, Y.L.; Zhang, H.B.; Tsang, S.H.; Xu, M.T. Efficient Depth Intra Frame Coding in 3D-HEVC by Corner Points. IEEE Trans. Image Process. 2021, 30, 1608–1622. [Google Scholar] [CrossRef] [PubMed]
  9. Zhang, Y.; Lu, C. Efficient Algorithm Adaptations and Fully Parallel Hardware Architecture of H.265/HEVC Intra Encoder. IEEE Trans. Circuits Syst. Video Technol. 2019, 29, 3415–3429. [Google Scholar] [CrossRef]
  10. Zhang, Y.; Lu, C. High-Performance Algorithm Adaptations and Hardware Architecture for HEVC Intra Encoders. IEEE Trans. Circuits Syst. Video Technol. 2019, 29, 2138–2145. [Google Scholar] [CrossRef]
  11. Cai, Z.; Gao, W. Efficient Fast Algorithm and Parallel Hardware Architecture for Intra Prediction of AVS3. In Proceedings of the 2021 IEEE International Symposium on Circuits and Systems (ISCAS), Daegu, Korea, 22–28 May 2021; pp. 1–5. [Google Scholar] [CrossRef]
  12. Sjövall, P.; Lemmetti, A.; Vanne, J.; Lahti, S.; Hämäläinen, T.D. High-Level Synthesis Implementation of an Embedded Real-Time HEVC Intra Encoder on FPGA for Media Applications. ACM Trans. Des. Autom. Electron. Syst. 2022, 27, 1–34. [Google Scholar] [CrossRef]
  13. Zummach, E.; Palau, R.; Goebel, J.; Palomino, D.; Agostini, L.; Porto, M. Efficient Hardware Design for the AV1 CDEF Filter Targeting 4K UHD Videos. In Proceedings of the 2020 IEEE International Symposium on Circuits and Systems (ISCAS), Seville, Spain, 12–14 October 2020; pp. 1–5. [Google Scholar] [CrossRef]
  14. Lee, D.; Jeong, J. Fast intra coding unit decision for high efficiency video coding based on statistical information. Signal Process. Image Commun. 2017, 55, 121–129. [Google Scholar] [CrossRef]
  15. Liu, Z.; Lin, T.L.; Chou, C.C. HEVC coding-unit decision algorithm using tree-block classification and statistical data analysis. Multimed. Tools Appl. 2017, 76, 9051–9072. [Google Scholar] [CrossRef]
  16. Ahn, S.; Lee, B.; Kim, M. A novel fast CU encoding scheme based on spatiotemporal encoding parameters for HEVC inter coding. IEEE Trans. Circuits Syst. Video Technol. 2014, 25, 422–435. [Google Scholar] [CrossRef]
  17. Min, B.; Cheung, R.C. A fast CU size decision algorithm for the HEVC intra encoder. IEEE Trans. Circuits Syst. Video Technol. 2014, 25, 892–896. [Google Scholar]
  18. Xiong, J.; Li, H.; Wu, Q.; Meng, F. A fast HEVC inter CU selection method based on pyramid motion divergence. IEEE Trans. Multimed. 2013, 16, 559–564. [Google Scholar] [CrossRef]
  19. Sergeev, V.M.; Dvorkovich, A.V. The Fast CU Splitting Method Based on CU Size, Quantization Parameters and Difference of Variances. In Proceedings of the 2021 International Conference Engineering and Telecommunication (En T), Dolgoprudny, Russia, 24–25 November 2021; pp. 1–4. [Google Scholar] [CrossRef]
  20. Wu, T.; Liu, S.; Wang, F.; Wang, Z.; Wang, R.; Wang, R. Fast CU Partition Decision Algorithm for AVS3 Intra Coding. IEEE Access 2021, 9, 7540–7549. [Google Scholar] [CrossRef]
  21. Shen, L.; Zhang, Z.; Liu, Z. Effective CU size decision for HEVC intracoding. IEEE Trans. Image Process. 2014, 23, 4232–4241. [Google Scholar] [CrossRef]
  22. Shen, L.; Liu, Z.; Zhang, X.; Zhao, W.; Zhang, Z. An effective CU size decision method for HEVC encoders. IEEE Trans. Multimed. 2012, 15, 465–470. [Google Scholar] [CrossRef]
  23. Shen, L.; Zhang, Z.; An, P. Fast CU size decision and mode decision algorithm for HEVC intra coding. IEEE Trans. Consum. Electron. 2013, 59, 207–213. [Google Scholar] [CrossRef]
  24. Zhang, Y.; Pan, Z.; Li, N.; Wang, X.; Jiang, G.; Kwong, S. Effective data driven coding unit size decision approaches for HEVC INTRA coding. IEEE Trans. Circuits Syst. Video Technol. 2017, 28, 3208–3222. [Google Scholar] [CrossRef]
  25. Liu, X.; Li, Y.; Liu, D.; Wang, P.; Yang, L.T. An adaptive CU size decision algorithm for HEVC intra prediction based on complexity classification using machine learning. IEEE Trans. Circuits Syst. Video Technol. 2017, 29, 144–155. [Google Scholar] [CrossRef]
  26. Zhang, T.; Sun, M.T.; Zhao, D.; Gao, W. Fast intra-mode and CU size decision for HEVC. IEEE Trans. Circuits Syst. Video Technol. 2016, 27, 1714–1726. [Google Scholar] [CrossRef]
  27. Zhu, L.; Zhang, Y.; Kwong, S.; Wang, X.; Zhao, T. Fuzzy SVM-based coding unit decision in HEVC. IEEE Trans. Broadcast. 2017, 64, 681–694. [Google Scholar] [CrossRef]
  28. Grellert, M.; Zatt, B.; Bampi, S.; da Silva Cruz, L.A. Fast coding unit partition decision for HEVC using support vector machines. IEEE Trans. Circuits Syst. Video Technol. 2018, 29, 1741–1753. [Google Scholar] [CrossRef]
  29. Zhang, Y.; Kwong, S.; Wang, X.; Yuan, H.; Pan, Z.; Xu, L. Machine learning-based coding unit depth decisions for flexible complexity allocation in high efficiency video coding. IEEE Trans. Image Process. 2015, 24, 2225–2238. [Google Scholar] [CrossRef] [PubMed]
  30. Qin, J.; Bai, H.; Zhang, M.; Zhao, Y. Fast intra coding algorithm for HEVC based on decision tree. IEICE Trans. Fundam. Electron. Commun. Comput. Sci. 2017, 100, 1274–1278. [Google Scholar] [CrossRef]
  31. Zhang, D.; Duan, X.; Zang, D. Decision tree based fast CU partition for HEVC lossless compression of medical image sequences. In Proceedings of the 2017 9th International Conference on Wireless Communications and Signal Processing (WCSP), Nanjing, China, 11–13 October 2017; pp. 1–6. [Google Scholar]
  32. Correa, G.; Assuncao, P.A.; Agostini, L.V.; da Silva Cruz, L.A. Fast HEVC encoding decisions using data mining. IEEE Trans. Circuits Syst. Video Technol. 2014, 25, 660–673. [Google Scholar] [CrossRef]
  33. Ruiz, D.; Fernández-Escribano, G.; Adzic, V.; Kalva, H.; Martínez, J.L.; Cuenca, P. Fast CU partitioning algorithm for HEVC intra coding using data mining. Multimed. Tools Appl. 2017, 76, 861–894. [Google Scholar] [CrossRef]
  34. Zhu, S.; Zhang, C. A fast algorithm of intra prediction modes pruning for HEVC based on decision trees and a new three-step search. Multimed. Tools Appl. 2017, 76, 21707–21728. [Google Scholar] [CrossRef]
  35. Lee, D.; Jeong, J. Fast CU size decision algorithm using machine learning for HEVC intra coding. Signal Process. Image Commun. 2018, 62, 33–41. [Google Scholar] [CrossRef]
  36. Kim, H.S.; Park, R.H. Fast CU partitioning algorithm for HEVC using an online-learning-based Bayesian decision rule. IEEE Trans. Circuits Syst. Video Technol. 2015, 26, 130–138. [Google Scholar] [CrossRef]
  37. Yang, H.; Shen, L.; Dong, X.; Ding, Q.; An, P.; Jiang, G. Low complexity CTU partition structure decision and fast intra mode decision for versatile video coding. IEEE Trans. Circuits Syst. Video Technol. 2020, 30, 1668–1682. [Google Scholar] [CrossRef]
  38. Galpin, F.; Racapé, F.; Jaiswal, S.; Bordes, P.; Le Léannec, F.; François, E. CNN-Based Driving of Block Partitioning for Intra Slices Encoding. In Proceedings of the 2019 Data Compression Conference (DCC), Snowbird, UT, USA, 26–29 March 2019; pp. 162–171. [Google Scholar]
  39. Huang, C.; Peng, Z.; Chen, F.; Jiang, Q.; Jiang, G.; Hu, Q. Efficient CU and PU decision based on neural network and gray level co-occurrence matrix for intra prediction of screen content coding. IEEE Access 2018, 6, 46643–46655. [Google Scholar] [CrossRef]
  40. Shi, J.; Gao, C.; Chen, Z. Asymmetric-Kernel CNN Based Fast CTU Partition for HEVC Intra Coding. In Proceedings of the 2019 IEEE International Symposium on Circuits and Systems (ISCAS), Sapporo, Japan, 26–29 May 2019; pp. 1–5. [Google Scholar]
  41. Jamali, M.; Coulombe, S.; Sadreazami, H. CU Size Decision for Low Complexity HEVC Intra Coding based on Deep Reinforcement Learning. In Proceedings of the 2020 IEEE 63rd International Midwest Symposium on Circuits and Systems (MWSCAS), Springfield, MA, USA, 9–12 August 2020; pp. 586–591. [Google Scholar] [CrossRef]
  42. Amna, M.; Imen, W.; Ezahra, S.F. LeNet5-Based approach for fast intra coding. In Proceedings of the 2020 10th International Symposium on Signal, Image, Video and Communications (ISIVC), Saint-Etienne, France, 7–9 April 2021; pp. 1–4. [Google Scholar] [CrossRef]
  43. Liu, Z.; Yu, X.; Gao, Y.; Chen, S.; Ji, X.; Wang, D. CU partition mode decision for HEVC hardwired intra encoder using convolution neural network. IEEE Trans. Image Process. 2016, 25, 5088–5103. [Google Scholar] [CrossRef] [PubMed]
  44. Kim, K.; Ro, W.W. Fast CU depth decision for HEVC using neural networks. IEEE Trans. Circuits Syst. Video Technol. 2018, 29, 1462–1473. [Google Scholar] [CrossRef]
  45. Xu, M.; Li, T.; Wang, Z.; Deng, X.; Yang, R.; Guan, Z. Reducing complexity of HEVC: A deep learning approach. IEEE Trans. Image Process. 2018, 27, 5044–5059. [Google Scholar] [CrossRef] [Green Version]
  46. Qi, Z.; Sun, J.; Duan, Y.; Guo, Z. A two-stage fast CU size decision method for HEVC intracoding. In Proceedings of the IEEE International Workshop on Multimedia Signal Processing (MMSP), Xiamen, China, 19–21 October 2015; pp. 1–6. [Google Scholar]
  47. Shah, S.A.A.; Aziz, W.; Arif, M.; Nadeem, M.S.A. Decision Trees Based Classification of Cardiotocograms Using Bagging Approach. In Proceedings of the 2015 13th International Conference on Frontiers of Information Technology (FIT), Islamabad, Pakistan, 14–16 December 2015; pp. 12–17. [Google Scholar] [CrossRef]
  48. Caruana, R.; Elhawary, M.; Munson, A.; Riedewald, M.; Sorokina, D.; Fink, D.; Hochachka, W.M.; Kelling, S. Mining citizen science data to predict orevalence of wild bird species. In Proceedings of the 12th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, Philadelphia, PA, USA, 20–23 August 2006; pp. 909–915. [Google Scholar]
  49. He, K.; Zhang, X.; Ren, S.; Sun, J. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA, 27–30 June 2016; pp. 770–778. [Google Scholar]
  50. Li, Y.; Li, L.; Fang, Y.; Peng, H.; Yang, Y. Bagged Tree Based Frame-Wise Beforehand Prediction Approach for HEVC Intra-Coding Unit Partitioning. Electronics 2020, 9, 1523. [Google Scholar] [CrossRef]
  51. Shen, X.; Yu, L. CU splitting early termination based on weighted SVM. EURASIP J. Image Video Process. 2013, 2013, 4. [Google Scholar] [CrossRef]
  52. Grellert, M.; Bampi, S.; Correa, G.; Zatt, B.; da Silva Cruz, L.A. Learning-based complexity reduction and scaling for HEVC encoders. In Proceedings of the 2018 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), Calgary, AB, Canada, 15–20 April 2018; pp. 1208–1212. [Google Scholar]
  53. Bay, H.; Tuytelaars, T.; Van Gool, L. Surf: Speeded up robust features. European Conference on Computer Vision; Springer: Berlin/Heidelberg, Germany, 2006; pp. 404–417. [Google Scholar]
  54. Bossen, F. Common test conditions and software reference configurations. In Proceedings of the 12th Meeting of the JCT-VC, Geneva, Switzerland, 14–23 January 2013. [Google Scholar]
  55. HEVC Reference Software HM16.7. Available online: https://hevc.hhi.fraunhofer.de/svn/svn_HEVCSoftware/tags/HM-16.7/ (accessed on 6 September 2016).
  56. Yao, C.; Xu, C.; Liu, M. RDNet: Rate–Distortion-Based Coding Unit Partition Network for Intra-Prediction. Electronics 2022, 11, 916. [Google Scholar] [CrossRef]
  57. Zhang, Y.; Wang, G.; Tian, R.; Xu, M.; Kuo, C.C.J. Texture-Classification Accelerated CNN Scheme for Fast Intra CU Partition in HEVC. In Proceedings of the 2019 Data Compression Conference (DCC), Snowbird, UT, USA, 26–29 March 2019; pp. 241–249. [Google Scholar] [CrossRef]
Figure 1. Recursive partition process of a CTU in the HEVC intra coding.
Figure 1. Recursive partition process of a CTU in the HEVC intra coding.
Electronics 11 01264 g001
Figure 2. A partition example of a CTU and the corresponding quad-tree splitting structure in the HEVC intra coding.
Figure 2. A partition example of a CTU and the corresponding quad-tree splitting structure in the HEVC intra coding.
Electronics 11 01264 g002
Figure 3. The structure of a bagged tree model. An illustration of how the final prediction for a sample input is generated by such a model, which is composed of multiple decision trees, each trained on a random subset of data.
Figure 3. The structure of a bagged tree model. An illustration of how the final prediction for a sample input is generated by such a model, which is composed of multiple decision trees, each trained on a random subset of data.
Electronics 11 01264 g003
Figure 4. Structure of a building block in ResNet and two examples of a basic block for ResNet constructions of different depths [49]. (a) The basic structure with a shortcut for ResNet. (b) An example of a basic block used to build a shallow ResNet. (c) The “bottleneck” used to construct a deep ResNet by stacking.
Figure 4. Structure of a building block in ResNet and two examples of a basic block for ResNet constructions of different depths [49]. (a) The basic structure with a shortcut for ResNet. (b) An example of a basic block used to build a shallow ResNet. (c) The “bottleneck” used to construct a deep ResNet by stacking.
Electronics 11 01264 g004
Figure 5. Flowchart of the proposed bagged tree and ResNet-based joint fast CTU partition algorithm.
Figure 5. Flowchart of the proposed bagged tree and ResNet-based joint fast CTU partition algorithm.
Electronics 11 01264 g005
Figure 6. An example of CTU partition structure determination process with the corresponding partition quad-tree. P L is the predicted label for a 32 × 32 CU output by ResNet. P L is set as an integer from 1 to 17.
Figure 6. An example of CTU partition structure determination process with the corresponding partition quad-tree. P L is the predicted label for a 32 × 32 CU output by ResNet. P L is set as an integer from 1 to 17.
Electronics 11 01264 g006
Figure 7. Sobel filters for different directions. (a) Example of a 3 × 3 square pixel block to be filtered by Sobel filters. (b) Sobel filter for horizontal direction. (c) Sobel filter for vertical direction. (d,e) Sobel filters for 45 and 135 , respectively.
Figure 7. Sobel filters for different directions. (a) Example of a 3 × 3 square pixel block to be filtered by Sobel filters. (b) Sobel filter for horizontal direction. (c) Sobel filter for vertical direction. (d,e) Sobel filters for 45 and 135 , respectively.
Electronics 11 01264 g007
Figure 8. Haar filters for different directions. (a) Example of a 2 × 2 square pixel block to be filtered by Haar filters. (b) Haar filter for horizontal direction. (c) Haar filter for vertical direction. (d) Haar filter for diagonal direction.
Figure 8. Haar filters for different directions. (a) Example of a 2 × 2 square pixel block to be filtered by Haar filters. (b) Haar filter for horizontal direction. (c) Haar filter for vertical direction. (d) Haar filter for diagonal direction.
Electronics 11 01264 g008
Figure 9. Three filters used for interest point detection in horizontal, vertical, and diagonal directions. (a) The filter used in the horizontal direction. (b) The filter used in the vertical direction. (c) The filter used in the diagonal direction. (ac) are performed on each pixel of a CTU, and the corresponding filtering responses are D x x , D y y , and D x y , respectively.
Figure 9. Three filters used for interest point detection in horizontal, vertical, and diagonal directions. (a) The filter used in the horizontal direction. (b) The filter used in the vertical direction. (c) The filter used in the diagonal direction. (ac) are performed on each pixel of a CTU, and the corresponding filtering responses are D x x , D y y , and D x y , respectively.
Electronics 11 01264 g009
Figure 10. Architecture of the ResNet used in this paper. The dotted lines represent the shortcuts which increase the dimensions.
Figure 10. Architecture of the ResNet used in this paper. The dotted lines represent the shortcuts which increase the dimensions.
Electronics 11 01264 g010
Figure 11. Class labels and corresponding partition structures of a 32 × 32 CU for ResNet multi-classification. Variate l a b e l is the class index of different partitions for a CU of size 32 × 32.
Figure 11. Class labels and corresponding partition structures of a 32 × 32 CU for ResNet multi-classification. Variate l a b e l is the class index of different partitions for a CU of size 32 × 32.
Electronics 11 01264 g011
Figure 12. Partition results of the 180th frame in the sequence RaceHorses (416 × 240), which is encoded by the original HM 16.7 with QP 22. The black line represents the splitting boundaries between CUs.
Figure 12. Partition results of the 180th frame in the sequence RaceHorses (416 × 240), which is encoded by the original HM 16.7 with QP 22. The black line represents the splitting boundaries between CUs.
Electronics 11 01264 g012
Figure 13. Partition results of the 180th frame in the sequence RaceHorses (416 × 240), which is encoded by the third version BTRNFA joint of the proposed algorithm with QP 22. The black line represents the same partition results as those of the original HM16.7. The gold line represents the boundaries of CUs, which are split by the original HM16.7 but are not split by the BTRNFA joint . The boundaries of CUs, which are non-split by the original HM16.7 but are split by the BTRNFA joint , are shown with a red line.
Figure 13. Partition results of the 180th frame in the sequence RaceHorses (416 × 240), which is encoded by the third version BTRNFA joint of the proposed algorithm with QP 22. The black line represents the same partition results as those of the original HM16.7. The gold line represents the boundaries of CUs, which are split by the original HM16.7 but are not split by the BTRNFA joint . The boundaries of CUs, which are non-split by the original HM16.7 but are split by the BTRNFA joint , are shown with a red line.
Electronics 11 01264 g013
Table 1. Feature candidates and corresponding descriptions.
Table 1. Feature candidates and corresponding descriptions.
IndexFeature CandidatesFeature Description
1 m _ v a r M e a n S u b variance of four sub-CUs’ mean
2 m _ v a r V a r S u b variance of four sub-CUs’ variance
3 m _ a v e C B F average value of current CU’s coded block flag
4 m _ n b C t u A b o R d RD cost of current CU’s above CTU
5 m _ n b C t u L e f R d RD cost of current CU’s left CTU
6 m _ n b C t u A b l R d RD cost of current CU’s above-left CTU
7 m _ n b C t u A b r R d RD cost of current CU’s above-right CTU
8 m _ n b C t u A b o D e p t h depth of current CU’s above CTU
9 m _ n b C t u L e f D e p t h depth of current CU’s left CTU
10 m _ n b C t u A b l D e p t h depth of current CU’s above-left CTU
11 m _ n b C t u A b r D e p t h depth of current CU’s above-right CTU
12 t o t a l C o s t total cost of current CU encoded with planar
13 t o t a l D i s t o r t i o n total distortion of current CU encoded with planar
14 t o t a l B i n s total bins of current CU encoded with planar
15 m _ c o s t H a d a m a r d Hadamard cost of planar mode
16 m _ s a d H a d a m a r d distortion of residual after Hadamard transfer
17 m _ b i t s H a d a m a r d Hadamard bits of planar mode
18 m _ e d g e S o b e l edge detection result using Sobel
19 m _ n m s e mean square error of neighbor pixels
20 m _ d c o m mean of gradients of four directions
21 m _ n u m I n t e r e s t P o i n t number of interesting points of current CU
22 m _ h a a r S u m x sum of horizontal value after Haar wavelet transfer
23 m _ h a a r S u m y sum of vertical value after Haar wavelet transfer
24 m _ h a a r S u m x y sum of diagonal value after Haar wavelet transfer
25 m _ h a a r S u m A b s x sum of horizontal absolute value after Haar
26 m _ h a a r S u m A b s y sum of vertical absolute value after Haar
27 m _ h a a r S u m A b s x y sum of diagonal absolute value after Haar
28 m _ m e a n M a i n mean of current CU
29 m _ v a r M a i n variance of current CU
Table 2. Ten most-important features selected for different QPs and resolution classes with corresponding importance values.
Table 2. Ten most-important features selected for different QPs and resolution classes with corresponding importance values.
Resolution Class A
QP22QP27QP32QP37
RankFeatureImportanceFeatureImportanceFeatureImportanceFeatureImportance
1m_aveCBF0.773m_aveCBF0.417m_aveCBF0.361var_var_sub0.255
2var_var_sub0.218var_var_sub0.292var_var_sub0.242m_aveCBF0.198
3meanMain0.128varMain0.078varMain0.107totalBins0.124
4varMain0.085m_numAveInterestPoint0.077m_haarSumxy0.078varMain0.083
5m_nbCtuAboDepth0.082meanMain0.066m_numAveInterestPoint0.066m_haarSumxy0.068
6m_haarSumy0.070m_nbCtuAblDepth0.063m_nbCtuAblDepth0.065m_haarSumx0.067
7m_numAveInterestPoint0.057m_haarSumx0.050m_haarSumAbsxy0.060m_numAveInterestPoint0.058
8m_haarSumx0.056m_nbCtuLefDepth0.042m_nbCtuAbrDepth0.057m_nbCtuAboDepth0.054
9m_haarSumxy0.055m_nbCtuAbrRd0.041meanMain0.049totalCost0.051
10m_haarSumAbsxy0.042m_haarSumxy0.039totalBins0.047m_haarSumy0.051
Resolution Class B
QP22QP27QP32QP37
RankFeatureImportanceFeatureImportanceFeatureImportanceFeatureImportance
1m_aveCBF0.738m_aveCBF0.565m_aveCBF0.384m_nbCtuLefDepth0.282
2m_nbCtuLefDepth0.288m_nbCtuLefDepth0.213m_nbCtuLefDepth0.231m_aveCBF0.254
3m_nbCtuAboDepth0.150var_var_sub0.173var_var_sub0.208var_var_sub0.201
4var_var_sub0.078m_nbCtuAboDepth0.095m_nbCtuAboDepth0.119m_nbCtuAboDepth0.097
5m_nmse0.071totalBins0.076totalCost0.088totalBins0.084
6m_haarSumAbsx0.065m_haarSumAbsx0.060totalBins0.080varMain0.065
7m_haarSumx0.053m_numAveInterestPoint0.051m_numAveInterestPoint0.048totalDistortion0.058
8meanMain0.045totalCost0.049m_haarSumAbsx0.047m_nmse0.051
9totalDistortion0.045m_nmse0.045meanMain0.044meanMain0.048
10m_numAveInterestPoint0.042meanMain0.041m_nmse0.033m_numAveInterestPoint0.046
Resolution Class C
QP22QP27QP32QP37
RankFeatureImportanceFeatureImportanceFeatureImportanceFeatureImportance
1m_aveCBF0.767m_aveCBF0.625m_aveCBF0.509m_aveCBF0.463
2var_var_sub0.164var_var_sub0.203var_var_sub0.226var_var_sub0.162
3m_nbCtuAboDepth0.073m_haarSumAbsy0.079m_haarSumAbsy0.094totalBins0.151
4m_nmse0.060m_nmse0.059totalBins0.093varMain0.112
5var_mean_sub0.039m_nbCtuAboDepth0.044totalCost0.064m_haarSumAbsy0.100
6meanMain0.036m_haarSumy0.040m_nmse0.060meanMain0.066
7varMain0.032totalBins0.031varMain0.040m_nmse0.060
8m_numAveInterestPoint0.023var_mean_sub0.030meanMain0.036m_numAveInterestPoint0.042
9totalDistortion0.021meanMain0.030m_numAveInterestPoint0.033m_haarSumAbsxy0.038
10m_haarSumAbsxy0.019varMain0.026totalDistortion0.030totalCost0.034
Resolution Class D
QP22QP27QP32QP37
RankFeatureImportanceFeatureImportanceFeatureImportanceFeatureImportance
1m_aveCBF0.500m_aveCBF0.260var_var_sub0.173m_aveCBF0.204
2var_var_sub0.089var_var_sub0.158varMain0.067totalBins0.122
3varMain0.043varMain0.063m_nmse0.065var_var_sub0.115
4m_nmse0.016m_haarSumAbsx0.047m_haarSumAbsxy0.051totalCost0.107
5meanMain0.007m_dcom0.038m_aveCBF0.046meanMain0.055
6totalCost0.007totalBins0.035totalBins0.044m_nmse0.050
7m_costHadamard0.005var_mean_sub0.027totalCost0.027totalDistortion0.034
8m_sadHadamard0.005m_nmse0.024totalDistortion0.026m_haarSumAbsxy0.026
9m_numAveInterestPoint0.005m_numAveInterestPoint0.022m_haarSumAbsx0.018var_mean_sub0.025
10totalBins0.004m_haarSumAbsxy0.017m_sadHadamard0.016varMain0.022
Resolution Class E
QP22QP27QP32QP37
RankFeatureImportanceFeatureImportanceFeatureImportanceFeatureImportance
1m_aveCBF0.363var_var_sub0.401var_var_sub0.413var_var_sub0.321
2var_var_sub0.262m_nbCtuLefDepth0.192m_nbCtuLefDepth0.220m_nbCtuLefDepth0.219
3m_nbCtuLefDepth0.104m_aveCBF0.188m_aveCBF0.201m_nbCtuAblDepth0.168
4meanMain0.090m_nbCtuAboDepth0.164meanMain0.099meanMain0.137
5m_bitsHadamard0.083m_nbCtuAbrDepth0.089totalBins0.083m_aveCBF0.121
6m_nbCtuAblRd0.078meanMain0.088m_nbCtuAboDepth0.060m_bitsHadamard0.100
7m_nbCtuAboRd0.059totalBins0.067m_nbCtuAblDepth0.055varMain0.079
8totalBins0.058m_numAveInterestPoint0.063m_numAveInterestPoint0.055m_nmse0.070
9m_nbCtuLefRd0.052m_nbCtuAbrRd0.061varMain0.052totalBins0.065
10m_haarSumy0.049varMain0.056totalDistortion0.048totalCost0.063
Table 3. Databases for bagged tree models of each QP and resolution class.
Table 3. Databases for bagged tree models of each QP and resolution class.
Resolution ClassQP22QP27QP32QP37
A
(2560 × 1600)
D B A 22 D B A 27 D B A 32 D B A 37
B
(1920 × 1080)
D B B 22 D B B 27 D B B 32 D B B 37
C
(832 × 480)
D B C 22 D B C 27 D B C 32 D B C 37
D
(416 × 240)
D B D 22 D B D 27 D B D 32 D B D 37
E
(1280 × 720)
D B E 22 D B E 27 D B E 32 D B E 37
Table 4. BD-rate loss and time-saving performance of three versions of the proposed BTRNFA.
Table 4. BD-rate loss and time-saving performance of three versions of the proposed BTRNFA.
ClassSequence BTRNFA DT BTRNFA ResNet BTRNFA joint
BD-Rate
(%)
TS
(%)
BD-Rate
(%)
TS
(%)
BD-Rate
(%)
TS
(%)
APeopleOnStreet0.1617.212.1951.852.2862.21
Average0.1617.212.1951.852.2862.21
BKimono1.1255.061.6668.652.5079.95
Cactus0.3421.912.3956.132.6666.62
BasketballDrive0.9832.313.1262.143.8373.16
BQTerrace0.1120.241.6852.621.7762.89
Average0.6432.382.2159.882.6970.66
CBQMall0.0414.521.7345.141.8355.16
PartyScene0.0010.790.6133.080.6242.80
RaceHorses0.0818.651.3849.701.5160.50
Average0.0414.651.2442.641.3252.82
DBasketballPass0.0110.171.1938.841.2346.82
BlowingBubbles0.008.900.5027.160.5034.59
RaceHorses0.0110.500.9036.060.9244.17
Average0.019.860.8634.020.8841.86
EJohnny0.2439.923.2464.643.5475.59
KristenAndSara0.1930.622.8961.733.0772.80
Average0.2135.273.0763.193.3074.19
FBasketballDrillText0.0011.221.4243.851.4653.99
SlideEditing0.1617.472.1157.362.3767.39
SlideShow0.2522.182.2755.942.4565.94
Average0.4116.961.9352.382.0962.44
Overall Average0.2321.351.8350.302.0360.29
Table 5. Prediction accuracy of different bagged tree models.
Table 5. Prediction accuracy of different bagged tree models.
Resolution ClassQP22QP27QP32QP37
A
(2560 × 1600)
90.66%94.13%94.09%94.79%
B
(1920 × 1080)
79.21%77.15%78.25%78.95%
C
(832 × 480)
95.15%95.44%96.42%96.44%
D
(416 × 240)
98.83%98.78%98.12%96.91%
E
(1280 × 720)
66.11%83.50%91.99%92.26%
Average85.99%89.80%91.78%91.87%
Table 6. Prediction accuracy from different levels of four ResNets.
Table 6. Prediction accuracy from different levels of four ResNets.
Prediction LevelQP22QP27QP32QP37
Overall57.20%58.86%58.12%56.51%
Depth 186.43%89.34%88.68%86.82%
Depth 285.36%86.51%86.76%86.64%
Table 7. Inference overhead compared with the original HM16.7 encoding time.
Table 7. Inference overhead compared with the original HM16.7 encoding time.
QP22QP27QP32QP37
Percentage0.85%1.00%1.12%1.24%
Table 8. Performance comparison between the proposed BTRNFA joint and PMDA under HM12.0; all intra coding.
Table 8. Performance comparison between the proposed BTRNFA joint and PMDA under HM12.0; all intra coding.
ClassSequence PMDA BTRNFA joint
BD-Rate
(%)
TS
(%)
BD-Rate
(%)
TS
(%)
A
2560 × 1600
PeopleOnStreet2.2761.802.2963.30
Average2.2761.802.2963.30
B
1920 × 1080
Kimono2.4762.602.5179.68
Cactus2.5960.402.6566.73
BasketballDrive3.4970.903.8472.23
BQTerrace2.2662.401.7761.83
Average2.7064.082.6970.12
C
832 × 480
BQMalll2.9357.801.8256.26
PartyScene2.1951.100.6144.59
RaceHorses2.0856.201.5061.09
Average2.4055.031.3153.98
D
416 × 240
BasketballPass2.8959.301.2048.24
BlowingBubbles2.5453.600.4936.27
RaceHorses2.4353.600.8945.26
Average2.6255.500.8643.26
E
1280 × 720
Johnny4.4272.203.5575.40
KristenAndSara3.1269.303.0673.25
Average3.7770.753.3074.33
Overall Average2.7460.862.0160.32
Table 9. Performance comparison between the proposed BTRNFA joint and CRM under HM16.5; all intra coding.
Table 9. Performance comparison between the proposed BTRNFA joint and CRM under HM16.5; all intra coding.
ClassSequence CRM BTRNFA joint
BD-Rate
(%)
TS
(%)
BD-Rate
(%)
TS
(%)
A
2560 × 1600
PeopleOnStreet2.3761.002.2862.08
Average2.3761.002.2862.08
B
1920 × 1080
Kimono2.5983.542.5379.78
Cactus2.2760.962.6565.98
BasketballDrive4.2776.323.8471.71
BQTerrace1.8464.721.7760.73
Average2.7471.392.6969.55
C
832 × 480
BQMalll2.0958.421.8254.80
PartyScene0.6644.500.6142.48
RaceHorses1.9757.121.5060.21
Average1.5753.351.3152.50
D
416 × 240
BasketballPass1.8456.421.2546.79
BlowingBubbles0.6240.540.5034.43
RaceHorses1.3255.760.9344.11
Average1.2650.910.8941.78
E
1280 × 720
Johnny3.8270.683.5575.15
KristenAndSara3.4674.863.0572.74
Average3.6472.773.3073.95
Overall Average2.2461.912.0259.31
Table 10. Encoding performance comparison with RDNet and TCA.
Table 10. Encoding performance comparison with RDNet and TCA.
ClassSequenceRDNetTCA BTRNFA joint
BD-Rate
(%)
TS
(%)
BD-Rate
(%)
TS
(%)
BD-Rate
(%)
TS
(%)
A
2560 × 1600
PeopleOnStreet2.2057.532.2963.122.2862.21
Average2.2057.532.2963.122.2862.21
B
1920 × 1080
Kimono1.4083.531.9369.172.5079.95
Cactus1.9552.722.1859.402.6666.62
BasketballDrive3.9474.293.5865.083.8373.16
BQTerrace1.1947.961.4863.261.7762.89
Average2.1264.632.2964.232.6970.66
C
832 × 480
BQMall1.3333.081.1555.021.8355.16
PartyScene0.3633.661.0757.150.6242.80
RaceHorses1.6636.281.4361.021.5160.50
Average1.1234.341.2257.731.3252.82
D
416 × 240
BasketballPass1.8557.061.7959.081.2346.82
BlowingBubbles0.8537.870.5858.010.5034.59
RaceHorses0.9842.991.1559.040.9244.17
Average1.2345.971.1758.710.8841.86
E
1280 × 720
Johnny3.4277.553.4266.323.5475.59
KristenAndSara2.6674.002.9169.453.0772.80
Average3.0475.783.1767.893.3074.19
Overall Average1.8354.501.9261.932.0259.79
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Li, Y.; Li, L.; Fang, Y.; Peng, H.; Ling, N. Bagged Tree and ResNet-Based Joint End-to-End Fast CTU Partition Decision Algorithm for Video Intra Coding. Electronics 2022, 11, 1264. https://doi.org/10.3390/electronics11081264

AMA Style

Li Y, Li L, Fang Y, Peng H, Ling N. Bagged Tree and ResNet-Based Joint End-to-End Fast CTU Partition Decision Algorithm for Video Intra Coding. Electronics. 2022; 11(8):1264. https://doi.org/10.3390/electronics11081264

Chicago/Turabian Style

Li, Yixiao, Lixiang Li, Yuan Fang, Haipeng Peng, and Nam Ling. 2022. "Bagged Tree and ResNet-Based Joint End-to-End Fast CTU Partition Decision Algorithm for Video Intra Coding" Electronics 11, no. 8: 1264. https://doi.org/10.3390/electronics11081264

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop