A lightgbm-based vvc intra coding partitioning method
By using a LightGBM-based VVC intra-coding partitioning method, the optimal partitioning mode of coding units is predicted using horizontal and vertical LightGBM models. This solves the problems of overfitting and high time complexity in existing technologies, and achieves faster coding speed and virtually no reduction in coding quality.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHEJIANG WANLI UNIV
- Filing Date
- 2023-02-23
- Publication Date
- 2026-04-10
AI Technical Summary
Existing VVC intra-frame coding partitioning methods are prone to overfitting, have high time complexity, are complex to implement, have low prediction accuracy, and are slow to encode.
A VVC intra-frame coding partitioning method based on LightGBM is adopted. The method predicts whether the coding unit should be partitioned into a ternary tree by using horizontal and vertical LightGBM models, skipping unnecessary rate-distortion cost calculations, and using coding features and preset thresholds to determine the optimal partitioning mode.
It improved the encoding speed and reduced the encoding time by 46.46%, with only a slight decrease in encoding quality. Furthermore, the encoding speed was even faster after embedding the LightGBM model, while the encoding quality remained basically the same. Compared with existing methods, it saved 1.74% of the time and slightly improved the encoding quality.
Smart Images

Figure CN116248902B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of video coding, and in particular to a LightGBM-based VVC intra coding partitioning method. BACKGROUND
[0002] With the development of 5G technology, people's demand for ultra-high-definition video and virtual reality video is increasing, so more storage space is needed to save video data. In order to alleviate the demand for resource space of video storage, video coding standard is a common technical means of video compression technology, which aims to maximize the video compression ratio without reducing the video quality after video decoding. In order to study the potential needs of future video coding technology standardization, the ITU-T Video Coding Experts Group (VCEG) and the ISO / IEC Moving Picture Experts Group (MPEG) jointly established the Video Exploration Team (JVET), which collected high-efficiency video coding and its extension proposals, and introduced a new video coding standard, called Versatile Video Coding (VVC).
[0003] In the existing VVC intra coding partitioning method, machine learning-based or gradient-based or multiple classifiers are generally used for prediction or neural networks are used for partitioning. The partitioning method based on machine learning mostly uses random forests, decision trees and support vector machines, which is prone to overfitting. The partitioning method based on gradient needs to calculate the direction gradient of the coding unit (CU) in advance, which increases the time complexity. The partitioning method using multiple classifiers for prediction has a complex implementation process. The partitioning method using neural networks mostly needs a long training and calculation time, and mostly uses a very simple network structure to save time, which results in low accuracy of the final prediction result. In addition, the original VVC encoder also has the problem of slow encoding speed. SUMMARY
[0004] The technical problem to be solved by the present application is to provide a LightGBM-based VVC intra coding partitioning method, which not only does not overfit, has low time complexity, and has a simple implementation process, high accuracy and improved encoding speed.
[0005] The technical scheme adopted by the present application to solve the above technical problem is: a LightGBM-based VVC intra coding partitioning method, comprising the following steps:
[0006] ①Obtain the coding features of the coding unit to be partitioned in the input video frame;
[0007] ②Obtain the rate-distortion cost of the quadtree partitioning mode, the binary tree horizontal partitioning mode and the binary tree vertical partitioning mode of the coding unit to be partitioned through the VVC original platform;
[0008] If the current partition mode is the ternary tree horizontal partition mode, step 4 is executed; if the current partition mode is the ternary tree vertical partition mode, step 5 is executed;
[0009] In step 4, the coding features of the to-be-partitioned coding unit are input into the pre-trained horizontal LightGBM model to obtain a horizontal prediction value yh, and the horizontal prediction value yh is compared with a preset threshold value a. If the horizontal prediction value yh is less than the preset threshold value a, step 6 is executed; if the horizontal prediction value yh is greater than or equal to the preset threshold value a, the rate-distortion cost of the ternary tree horizontal partition mode is calculated, and step 7 is executed.
[0010] In step 5, the coding features of the to-be-partitioned coding unit are input into the pre-trained vertical LightGBM model to obtain a vertical prediction value yv, and the vertical prediction value yv is compared with the preset threshold value a. If the vertical prediction value yv is less than the preset threshold value a, step 6 is executed; if the vertical prediction value yv is greater than or equal to the preset threshold value a, the rate-distortion cost of the ternary tree vertical partition mode is calculated, and step 7 is executed.
[0011] In step 6, the current partition mode is skipped, and the best partition mode of the to-be-partitioned coding unit is obtained through the Xcheckbestmode function in the VVC original platform.
[0012] In step 7, the rate-distortion cost of all partition modes is compared to obtain the partition mode with the minimum rate-distortion cost, which is the best partition mode of the to-be-partitioned coding unit.
[0013] The coding features include binary tree superiority BTS, binary tree direction BTD, block shape ratio BSR, multi-type tree depth MTD and coding block flag CBF.
[0014] The VVC original platform is VTM4.0.
[0015] The construction and training process of the pre-trained horizontal LightGBM model are as follows:
[0016] In step 1, the first frame of each video in the CTC test sequence is selected, and feature extraction is performed on each coding unit in each first frame through the VVC original platform to obtain the coding features corresponding to each coding unit and the corresponding final partition mode.
[0017] A coding feature corresponding to a coding unit and a corresponding final partition mode are recorded as a sample, and a horizontal data set is constructed, the horizontal data set includes at least 172835 samples, wherein each coding feature is mapped to the range of 0-1 using a floating point format, if the final partition mode of the coding unit is a ternary tree horizontal partition mode, it is recorded as 1, if the final partition mode of the coding unit is not a ternary tree horizontal partition mode, it is recorded as 0;
[0018] The training parameters are set, the horizontal data set is input into the LightGBM model for training, and a horizontal LightGBM model is obtained.
[0019] The construction and training process of the pre-trained vertical LightGBM model are as follows:
[0020] The first frame of each video in the CTC test sequence is selected, feature extraction is performed on each coding unit in each first frame through the VVC original platform, and the coding feature corresponding to each coding unit and the corresponding final partition mode are obtained.
[0021] A coding feature corresponding to a coding unit and a corresponding final partition mode are recorded as a sample, and a horizontal data set is constructed, the horizontal data set includes at least 172835 samples, wherein each coding feature is mapped to the range of 0-1 using a floating point format, if the final partition mode of the coding unit is a ternary tree horizontal partition mode, it is recorded as 1, if the final partition mode of the coding unit is not a ternary tree horizontal partition mode, it is recorded as 0;
[0022] The training parameters are set, the horizontal data set is input into the LightGBM model for training, and a horizontal LightGBM model is obtained.
[0023] In the step 4 and the step 5, the preset threshold alpha is 0.5.
[0024] The LightGBM model is constructed by a histogram algorithm and a leaf growth strategy with depth limitation.
[0025] The training parameters include that the algorithm type is GBDT, the target function is binary classification, the evaluation function is accuracy, the leaf node number is 31, and the learning rate is 0.005.
[0026] Compared with the prior art, the horizontal LightGBM model and the vertical LightGBM model not only have the advantages of the original LightGBM model, such as fast training speed, low memory occupation, support for efficient parallel training, better accuracy, support for distribution, and the ability to quickly process massive data, but also have the advantages of not overfitting and low time complexity because the histogram algorithm of the original LightGBM model can avoid overfitting. The horizontal LightGBM model and the vertical LightGBM model are used to predict the coding unit to be divided, and the horizontal prediction value and the vertical prediction value are used to determine whether the coding unit needs to be divided horizontally or vertically, so that the rate-distortion cost calculation process of the horizontal or vertical division mode of the three-tree in the coding process is skipped, and the coding speed is improved. Compared with the original VVC encoder, the VVC encoder embedded with the present application reduces the coding time by an average of 46.46%, has faster coding speed, and the BDBR only increases by an average of 0.56%, and the BD-PSNR only decreases by an average of 0.03%. Compared with the WC encoder embedded with LNN, the VVC encoder embedded with the present application reduces the coding time by an average of 1.74%, and the BDBR decreases by an average of 0.52%, and the BD-PSNR increases by an average of 0.02%, so the present application can effectively save the coding time while ensuring the coding quality. BRIEF DESCRIPTION OF DRAWINGS
[0027] Figure 1 The present application is a whole process schematic diagram. DETAILED DESCRIPTION
[0028] The present application will be further described in detail below in combination with the embodiments of the drawings.
[0029] A VVC intra-frame coding division method based on LightGBM, comprising the following steps:
[0030] ①Obtain the coding characteristics of the coding unit to be divided in the input video frame; the coding characteristics include binary tree superiority BTS, binary tree direction BTD, block shape ratio BSR, multi-type tree depth MTD and coding block flag CBF;
[0031] ②Obtain the rate-distortion cost of the quad-tree division mode, the binary tree horizontal division mode and the binary tree vertical division mode of the coding unit to be divided through the VVC original platform;
[0032] ③If the current division mode is the three-tree horizontal division mode, step ④ is executed; if the current division mode is the three-tree vertical division mode, step ⑤ is executed;
[0033] iv) inputting the coding features of the to-be-divided coding unit into the pre-trained horizontal LightGBM model to obtain a horizontal prediction value yh, comparing the horizontal prediction value yh with a preset threshold a, if the horizontal prediction value yh is less than the preset threshold a, performing step vi) (i.e., skipping the ternary tree horizontal division mode); if the horizontal prediction value yh is greater than or equal to the preset threshold a, calculating a rate-distortion cost of the ternary tree horizontal division mode, and performing step vii);
[0034] In the present embodiment, the construction and training process of the pre-trained horizontal LightGBM model is as follows:
[0035] In the present embodiment, the construction and training process of the pre-trained horizontal LightGBM model is as follows:
[0036] In the present embodiment, the construction and training process of the pre-trained horizontal LightGBM model is as follows:
[0036]
[0037] Table 1 shows part of the samples in the horizontal data set.
[0038] 0 1 0.66667 0.5 0.33333 0 0 1 0.5 0 0.33333 0 0 1 0.5 1 0.33333 0 0 0 0.5 1 0.33333 1 0 0 0.5 1 0.33333 0 0 1 0.5 1 0.33333 0 0.5 1 0.8 1 0.33333 1 1 1 0.66667 0.5 0.33333 1 0 1 0.33333 1 0.33333 0 0 0 0.33333 0.5 0.33333 0 0.5 1 0.5 1 0.33333 0 0.5 1 0.8 1 0.33333 1 0 1 0.8 1 0.33333 1 1 1 0.66667 0.5 0.33333 1
[0039] In Table 1, the first column represents the binary tree superiority BTS, the second column represents the binary tree direction BTD, the third column represents the block shape ratio BSR, the fourth column represents the multi-type tree depth MTD, the fifth column represents the coding block flag CBF, and the sixth column represents whether the final division mode is the ternary tree horizontal division mode.
[0040] In the present embodiment, the construction and training process of the pre-trained horizontal LightGBM model is as follows:
[0041] iv) inputting the coding features of the to-be-divided coding unit into the pre-trained horizontal LightGBM model to obtain a horizontal prediction value yh, comparing the horizontal prediction value yh with a preset threshold a, if the horizontal prediction value yh is less than the preset threshold a, performing step vi) (i.e., skipping the ternary tree horizontal division mode); if the horizontal prediction value yh is greater than or equal to the preset threshold a, calculating a rate-distortion cost of the ternary tree horizontal division mode, and performing step vii);
[0042] In the present embodiment, the construction and training process of the pre-trained vertical LightGBM model are as follows:
[0043] The first frame of each video in the CTC test sequence is selected, and the VVC original platform is used to extract features from each coding unit in each first frame to obtain the coding features corresponding to each coding unit and the final partition mode corresponding thereto;
[0044] The coding features corresponding to each coding unit and the final partition mode corresponding thereto are recorded as a sample, and a vertical data set is constructed, which includes at least 166920 samples, wherein each coding feature is mapped to the range of 0-1 using a floating point format, and if the final partition mode of the coding unit is a ternary tree vertical partition mode, it is recorded as 1, and if the final partition mode of the coding unit is not a ternary tree vertical partition mode, it is recorded as 0, as shown in Table 2.
[0045] Table 2: Part of the sample in the vertical data set
[0046] 0 0 0.33333 0.5 0.33333 0 0 0 0.5 0 0.33333 0 0 0 0.5 1 0.33333 0 0 0 0.66667 0.5 0.33333 0 1 0 0.33333 0.5 1 0 0 1 0.66667 1 0.33333 0 0 1 0.8 1 0.33333 0 0.5 0 0.5 1 0.33333 0 0 0 0.2 1 0.33333 0 0 0 0.2 1 0.33333 0 0 1 0.66667 1 0.33333 0 0 0 0.5 0 0.33333 0 0.5 1 0.8 1 0.33333 1 0.5 0 0.8 1 0.33333 0
[0047] In Table 2, the first table indicates the binary tree superiority BTS, the second table indicates the binary tree direction BTD, the third table indicates the block shape ratio BSR, the fourth table indicates the multi-type tree depth MTD, the fifth table indicates the coding block flag CBF, and the sixth table indicates whether the final partition mode is a ternary tree vertical partition mode.
[0048] The training parameters are set, the vertical data set is input into the LightGBM model for training, and the vertical LightGBM model is obtained.
[0049] ⑥ Skip the current partition mode, and obtain the best partition mode of the coding unit to be partitioned through the Xcheckbestmode function in the VVC original platform;
[0050] ⑦ After comparing the rate-distortion costs of all partition modes, the partition mode with the minimum rate-distortion cost is obtained, which is the best partition mode of the coding unit to be partitioned; wherein all partition modes include quadtree partition mode, binary tree horizontal partition mode, binary tree vertical partition mode, ternary tree horizontal partition mode and ternary tree vertical partition mode.
[0051] In the present embodiment, the VVC original platform is VTM4.0;
[0052] In the present embodiment, in steps ④ and ⑤, the preset threshold a is 0.5;
[0053] In the present embodiment, the LightGBM model is constructed by a histogram algorithm and a leaf growth strategy with depth limitation;
[0054] In the present embodiment, the training parameters include that the algorithm type is GBDT, the target function is binary classification, the evaluation function is accuracy, the number of leaf nodes is 31, and the learning rate is 0.005;
[0055] The setting process of the training parameters is as follows:
[0056] The first time, the learning rate is set to 0.1, the number of leaf nodes is set to 51, the maximum depth is set to 6, and the training round is set to 1000, and the best result is that the optimal iteration number is 88, and the result of evaluating the model by the cv function is 0.38775;
[0057] The second time, the learning rate is set to 0.1, the number of leaf nodes is set to 51, the maximum depth is set to 6, and the optimal iteration number is set to 88, and when testing, the maximum depth is set to 3 or 5 or 7, and the maximum number of leaf nodes is set to 31 or 51 or 71 or 91, and the best result is that the number of leaf nodes is 31, the maximum depth is 5, and the result of evaluating the model by the cv function is -0.15008;
[0058] The third time, the learning rate is set to 0.1, the number of leaf nodes is set to 31, the maximum depth is set to 5, and the optimal iteration number is set to 88, and when testing, the maximum depth is set to 3 or 4 or 5 or 6 or 7, and the maximum number of leaf nodes is set to 29 or 30 or 31 or 32 or 33, and the best result is that the number of leaf nodes is 31, the maximum depth is 5, and the result of evaluating the model by the cv function is -0.14949;
[0059] The fourth time, the learning rate is set to 0.05, the number of leaf nodes is set to 31, the maximum depth is set to 5, and the training round is set to 10000, and the best result is that the optimal iteration number is 1489, and the result of evaluating the model by the cv function is 0.38706;
[0060] The fifth time, the learning rate is set to 0.005, the number of leaf nodes is set to 31, the maximum depth is set to 5, and the training round is set to 10000, and the best result is that the optimal iteration number is 7404, and the result of evaluating the model by the cv function is 0.38778;
[0061] Therefore, in the present embodiment, the number of leaf nodes is set to 31, and the learning rate is set to 0.005;
[0062] In the present embodiment, the binary tree superiority BTS: when there is a BT (binary tree) with a lower RDcost (rate distortion cost) than other BTs, 0.5 is taken, otherwise 1 is taken;
[0063] The binary tree direction BTD: indicates whether the optimal BT direction of the two BTs on the RD cost is the same as the to-be-tested TT direction, and if so, 1 is taken, and if not, 0 is taken;
[0064] Block shape ratio BSR: if the current partition mode is TT_H (ternary tree horizontal) partition mode if the current partition mode is TT_v (ternary tree vertical) partition mode wherein l h represents the height of the CU to be partitioned, l w represents the width of the CU to be partitioned;
[0065] Multi-type tree depth MTD: half of the depth of BT or TT (ternary tree);
[0066] Coding block flag CBF: when the CU is encoded, if the residual coefficient is very small, that is, the residual is considered to be 0, then the CBF is 0, and if there is a significant residual coefficient, then the CBF is 1;
[0067] In the embodiment, the comparative model is VVC reference software VTM4.0 and VVC reference software VTM4.0 embedded with the LNN model, the compiler is configured in a low delay (Low Delay, LD) mode, the test hardware is a central processing unit of Windows 10 professional edition, Intel(R) Core(TM) i7-9700 CPU @ 3.00 GHz, and the memory is 8 GB;
[0068] The CTC test sequence includes 21 sequences, which are: resolution of 3840*2160 (Campfire, FoodMarket4, Tango2) marked as A1, resolution of 3840*2160 (CatRobot, DaylightRoad2, ParkRunning3) marked as A2, resolution of 1920*1080 and 2560*1600 (PeopleOnStreet, Kimono, Traffic) marked as ADD, resolution of 1920*1080 (BasketballDrive, BQTerrace, Cactus, MarketPlace, RitualDance) marked as B, resolution of 832*480 (BasketballDrill, BQMall, PartyScene) marked as C, resolution of 416*240 (RaceHorses) marked as D, resolution of 1280*720 (FourPeople, KristenAndSara, Johnny) marked as E, and the performance of the application is measured by using BDBR, BD-PSNR and TS.
[0069] Table 3 performance comparison results of original VTM4.0, VTM4.0 embedded with the application, and VTM4.0 embedded with the LNN model
[0070]
[0071]
[0072] Class in Table 3 represents video category; Sequence represents CTC test sequence;
[0073] BDBR VTM BDBR changed when VTM4.0 with the present application is embedded compared with original VTM4.0 when encoding the same video YUV Percentage;
[0074] BDBR LNN BDBR changed when VTM4.0 with the present application is embedded compared with VTM4.0 with LNN model embedded when encoding the same video YUV Percentage;
[0075] BD-PSNR VTM BD-PSNR changed when VTM4.0 with the present application is embedded compared with original VTM4.0 when encoding the same video Y Percentage;
[0076] BD-PSNR LNN BD-PSNR changed when VTM4.0 with the present application is embedded compared with VTM4.0 with LNN model embedded when encoding the same video Y Percentage;
[0077] TS VTM Percentage of time saved when VTM4.0 with the present application is embedded compared with original VTM4.0 when encoding the same video
[0078] TS LNN Percentage of time saved when VTM4.0 with the present application is embedded compared with VTM4.0 with LNN model embedded when encoding the same video
[0079] Average represents average value;
[0080] As shown in Table 3, VTM4.0 with the present application embedded compared with original VTM4.0, the average encoding time is reduced by 46.46%, and the BDBR is only increased by 0.56% on average, and the BD-PSNR is only decreased by 0.03% on average;
[0081] VTM4.0 with the present application embedded compared with VTM4.0 with existing light neural network (LNN) embedded, the average encoding time is reduced by 1.74%, and the BDBR is decreased by 0.52% on average, and the BD-PSNR is increased by 0.02% on average;
[0082] In conclusion, the present application can effectively save coding time under the premise of ensuring coding quality.
[0083] The words of the patent are explained as follows:
[0084] LightGBM represents light gradient boosting machine;
[0085] BDBR represents the code rate saving of two methods under the same objective quality, and if it is negative, it represents that the coding performance of the optimized algorithm is improved;
[0086] BD-PSNR represents the difference of PSNRY of two methods under the same code rate, and if it is positive, it represents that the coding quality of the optimized algorithm is improved;
[0087] TS represents the saved time;
[0088] GBDT represents gradient boosting decision tree.
Claims
1. A LightGBM-based VVC intra coding partitioning method, characterized in that The method comprises the following steps: ①obtaining the encoding features of the to-be-divided coding unit in the input video frame; ②obtaining the rate-distortion cost of the quad-tree division mode, the binary-tree horizontal division mode and the binary-tree vertical division mode of the to-be-divided coding unit through the VVC original platform; ③if the current division mode is the triple-tree horizontal division mode, step ④ is executed; if the current division mode is the triple-tree vertical division mode, step ⑤ is executed; ④inputting the encoding features of the to-be-divided coding unit into the pre-trained horizontal LightGBM model to obtain the horizontal prediction value yh, and comparing the horizontal prediction value yh with the preset threshold α; if the horizontal prediction value yh is less than the preset threshold α, step ⑥ is executed; if the horizontal prediction value yh is greater than or equal to the preset threshold α, the rate-distortion cost of the triple-tree horizontal division mode is calculated, and step ⑦ is executed; ⑤inputting the encoding features of the to-be-divided coding unit into the pre-trained vertical LightGBM model to obtain the vertical prediction value yv, and comparing the vertical prediction value yv with the preset threshold α; if the vertical prediction value yv is less than the preset threshold α, step ⑥ is executed; if the vertical prediction value yv is greater than or equal to the preset threshold α, the rate-distortion cost of the triple-tree vertical division mode is calculated, and step ⑦ is executed; ⑥skipping the current division mode, and obtaining the best division mode of the to-be-divided coding unit through the Xcheckbestmode function in the VVC original platform; ⑦obtaining the division mode with the minimum rate-distortion cost by comparing the rate-distortion costs of all division modes, and the division mode with the minimum rate-distortion cost is the best division mode of the to-be-divided coding unit.
2. The LightGBM-based VVC intra coding partitioning method of claim 1, wherein The encoding features comprise binary-tree superiority BTS, binary-tree direction BTD, block shape ratio BSR, multi-type tree depth MTD and coding block flag CBF.
3. The LightGBM-based VVC intra coding partitioning method of claim 1, wherein The VVC original platform is VTM4.
0.
4. The LightGBM-based VVC intra coding partitioning method of claim 1, wherein The construction and training process of the pre-trained horizontal LightGBM model are as follows: selecting the first frame of each video in the CTC test sequence, extracting the features of each coding unit in each first frame through the VVC original platform to obtain the corresponding encoding features and the corresponding final division mode of each coding unit; taking the corresponding encoding features and the corresponding final division mode of a coding unit as a sample to construct a horizontal data set, wherein the horizontal data set comprises at least 172835 samples, wherein each encoding feature is mapped to the range of 0-1 in floating point format, if the final division mode of the coding unit is the triple-tree horizontal division mode, it is recorded as 1, and if the final division mode of the coding unit is not the triple-tree horizontal division mode, it is recorded as 0; setting the training parameters, inputting the horizontal data set into the LightGBM model for training to obtain the horizontal LightGBM model.
5. The LightGBM-based VVC intra coding partitioning method of claim 1, wherein The construction and training process of the pre-trained vertical LightGBM model are as follows: Selecting the first frame of each video in the CTC test sequence, extracting features of each coding unit in each first frame through the VVC original platform to obtain the coding features corresponding to each coding unit and the final partition mode corresponding thereto; The coding features corresponding to each coding unit and the final partition mode corresponding thereto are recorded as a sample, and a vertical data set is constructed, the vertical data set comprising at least 166920 samples, wherein each coding feature is mapped to the range of 0-1 using a floating point format, and if the final partition mode of the coding unit is a triple tree vertical partition mode, it is recorded as 1, and if the final partition mode of the coding unit is not a triple tree vertical partition mode, it is recorded as 0; Setting training parameters, inputting the vertical data set into a LightGBM model for training to obtain a vertical LightGBM model.
6. The LightGBM-based VVC intra coding partitioning method of claim 1, wherein In the step 4 and the step 5, the preset threshold α is 0.
5.
7. The LightGBM-based VVC intra coding partitioning method of claim 4 or 5, wherein The LightGBM model is obtained by a histogram algorithm and a leaf growth strategy with depth limitation.
8. The LightGBM-based VVC intra coding partitioning method of claim 4 or 5, wherein The training parameters comprise an algorithm type of GBDT, a target function of binary classification, an evaluation function of accuracy, a leaf node number of 31, and a learning rate of 0.005.