HEVC (High Efficiency Video Coding) rate control method based on maximum coding unit level
By adopting the code rate control method based on the maximum encoding unit level in the HEVC standard, the complexity weight of each LCU block is calculated and the target bit number weight prediction is performed, and the code in the dynamic scene switching process of the HEVC standard medium code rate control model is solved. The problem of large rate fluctuations has achieved more accurate and stable bit rate control and improved video quality.
Patent Information
- Application Number
- CN202510019524.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-07
- Publication Date
- 2025-02-14
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The HEVC standard code rate control model is difficult to achieve bit savings in flat areas within the frame and bit allocation in complex areas during dynamic scene switching, resulting in large fluctuations in bit rate and affecting video quality.
Using the HEVC bit rate control method based on the maximum encoding unit level, the complexity weight of each LCU block is calculated, and the target bit rate control parameters are optimized to meet the needs of different complexity areas. .
It effectively reduces the actual number of coded bits consumed by the video sequence, improves the accuracy and stability of bit rate control, and ensures that the subjective performance of video quality is not affected.
Smart Images

Figure CN119450052A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of video coding and bit rate control, and in particular to a HEVC bit rate control method based on maximum coding unit level. Background Art
[0002] With the vigorous development of network transmission bandwidth and video image technology, the actual application of video is moving towards high definition and high fluency, and the video coding and decoding standards are also being updated and iterated. In recent years, video coding standard technologies such as MPEG and H.264 / AVC have been greatly supplemented and improved, and HEVC / H.265 based on the hybrid coding framework was born. Compared with the previous generation H.264 / AVC, HEVC proposes a more flexible and effective block division, and the bit rate consumed for encoding the same quality video is equivalent to half the bit rate of H264 / AVC encoding.
[0003] Although the compression performance of the HEVC coding standard is nearly 1 times higher than that of the H.264 / AVC standard, during dynamic scene switching, the amount of information represented in each frame of the video sequence varies greatly, resulting in large fluctuations in the encoder's encoding bit rate. In an online video conferencing environment or under limited network bandwidth conditions, it is usually expected that the encoder's encoding bit rate will be stable within a smaller range to avoid network congestion while ensuring the quality of the video output in the network after encoding. The rate control technology corresponding to the new generation of video coding standards can solve the above problems.
[0004] Two different rate control models are used in the HEVC Test Model (HM), namely the Unified Rate-Quantization (URQ) model rate control algorithm and the R-λ model rate control algorithm. Among them, the URQ model was first adopted by the corresponding rate control algorithm of HM in its first version released in 2013. The URQ model rate control algorithm uses equal-sized code control related parameters to determine the target number of bits for each group of picture (Group Of Picture, GOP), image frame, and LCU, and then calculates the quantization parameter (Quantization Parameter, QP) at the frame level and LCU level through the URQ model for encoding. Due to the large error between the target bits predetermined in advance by the model and the actual consumed bits, the actual clarity of the encoded video fluctuates significantly. Scholar Li Bin found that the hyperbolic model is closer to the rate-distortion (RD) characteristics of HEVC encoding by statistically analyzing a large amount of video data, and proposed a two-level rate control algorithm at the frame level and LCU level based on this model. The frame level allocates target bits according to parameters such as the frame structure in the GOP, the complexity of video texture, and motion characteristics. The frame-level rate control has the same QP for the entire frame, and the encoding target rate is very different from the actual encoding rate. It cannot properly save bitrate in flat areas and enrich details in complex areas. The LCU level uses CTU as the minimum processing unit based on the frame level. The LCU-level QP size of different areas with different texture complexity and motion speed in each frame image is different, which effectively solves the shortcomings of frame-level rate control. The iterative model is updated according to the rate control parameters, and the target number of bits for each CTU is calculated to enter the final encoding process. The R-λ model has obvious rate control effect and less fluctuation in the rate range. Despite this, the R-λ model of HEVC standard rate control still cannot properly save bits in flat areas within the frame and allocate more bits to complex areas. The model is still not accurate enough in the LCU-level bit allocation, and there is room for improving the objective quality of the image.
[0005] First, the update process between λ and the bit per pixel (bpp) at the edge of complex scenes cannot accurately approach the current maximum coding block bit consumption; second, the mean absolute difference (MAD) at the LCU layer only reflects the bit consumption of the LCU residual part, and does not consider the bit consumption of coding tools such as motion vectors and information flags. In response to the above shortcomings, scholars in the field have proposed many HEVC standard rate control optimization algorithms.
[0006] For example, in prior art 1, a rate control algorithm based on visual saliency [J]. Communications Technology, 2024, 20(3): 244-250, a saliency detection algorithm is used to obtain the salient area of each frame image, and a weighted formula for the visual salient area is established for each CTU block in the encoded image. The new CTU-level QP is calculated by the CTU saliency weight. Experimental results show that the algorithm improves the PSNR by 0.5-1dB in a given standard video sequence.
[0007] For example, prior art 2, HEVC rate control algorithm based on human eye salient area detection [J]. Science and Technology Innovation and Application, 2024, 27(11):11-17; a pixel-level perceptible distortion model based on the human eye is proposed, and the pixel area where the human eye sees obvious frame loss in the previous and next frames is regarded as a salient area, and subdivided according to the perception model and a multi-level rate control model is constructed to guide the rate allocation.
[0008] As in prior art 3, HEVC_CTU layer bit rate control method based on visual perception characteristics [D]. Beijing: National Space Science Center, Chinese Academy of Sciences, 2021.06; First, the frame layer bit allocation and the CTU layer significance weight are calculated, and then the frame is allocated the pre-allocated number of bits according to the significance weight of each CTU. Under the premise of ensuring that the overall video quality is not reduced, the algorithm improves the PSNR of the significant area by 0.52dB.
[0009] For example, prior art 4, research on HEVC low-complexity algorithm and bit rate control algorithm [D]. Xi'an: Xi'an Branch of the Fifth Academy of China Aerospace Science and Technology Corporation, 2024.06; comprehensively considering the current LCU visual saliency and the discrete cosine transform of the LCU residual corresponding to the reference frame, the weighting factor is multiplied on the basis of the original LCU target bit number to optimize the LCU-level target bit number allocation. Summary of the invention
[0010] The present invention aims to solve the problem that in the prior art, although there is a strong correlation between corresponding LCU matching blocks between frames, the MAD value can only reflect the number of bits required for the corresponding LCU residuals of the previous and next two frames. If the LCU block is further divided into skip blocks, the bits consumed by the motion vector information encoding of these skip blocks are not taken into account, so that the actual number of LCU bits cannot be optimally allocated. The present invention provides a HEVC bit rate control method based on the maximum coding unit level.
[0011] In order to solve the above technical problems, the present invention is solved by the following technical solutions: A maximum coding unit level HEVC bit rate control method, the method comprising: before encoding a current frame, calculating the number of bits, frame level QP and λ required for encoding the current frame; After LCU level, initialize the rate control related parameters of the current LCU. The complexity of the R-λ model of the LCU is used as the weight to calculate the current LCU block complexity weight. CurLCU ; ; ; Among them, λ is the Lagrangian factor for encoding the current LCU level bit rate control, numberOfPixels CurLCU is the number of valid pixels at the current CTU level, α and β are the bit rate control parameters at the current LCU level; The current LCU initialization bit InitBits is calculated based on the proportion of the LCU weight to all LCU weights in the entire frame and the current frame pre-allocated target bits. CurLCU ; ; Among them, T CurPic Pre-allocate the target number of bits for the current frame, numberOfLCU is the number of all LCUs in the current frame, Weight i The corresponding weight value of each LCU in the current frame; Calculate the number of uncoded LCUs and remaining bits in the current frame to pre-allocate bits LeftBits to the current LCU CurLCU ; ; Among them, BitsLeft CurPic The number of pre-allocated bits remaining for encoding the current frame to this LCU; numberOfLCU is the number of all LCUs in the current frame; Weight i The corresponding weight value of each LCU in the current frame; The target number of bits in the improved frame of the current LCU is calculated by weighting the initial pre-allocated bits of the current LCU and the actual remaining bits allocated to the current LCU in the current frame. CurLCU ; ; in, Indicates the weight coefficient corresponding to the initial number of bits of the current LCU, and ; LCU finally predicts the target bit number TargetBitSpre CurLCU(n) Calculation; based on the actual number of bits consumed by the corresponding CTU block in the previous frame ActualBits CutrLCU(n-1) and the number of pre-allocated bits TargetBits for the current CTU block in the frame CurLCU(n)Obtained by weighted calculation of inter-frame prediction; ; in, is the weighting parameter of the prediction model.
[0012] Preferably, before encoding the current frame, the number of bits, frame level λ and QP required for encoding the current frame are calculated, and then the current LCU level code rate control related parameters are initialized.
[0013] Preferably, for calculating the target number of bits after weighted improvement within and between the current LCU frames, the initial QP and λ corresponding to the CTU block participating in the encoding are calculated through the LCU-level R-λ model.
[0014] Preferably, determine the proportion of skip mode used after the current LCU encoding is completed; if the current encoded LCU uses skip mode exceeding the set threshold K, appropriately reduce the actual number of bits consumed by the current LCU to predict the next LCU, and adjust the bit rate control parameters α and β; otherwise, only update the current LCU bit rate R-λ parameter.
[0015] As a preferred embodiment, the control parameters α and β are adjusted by setting them so as to obtain the adjusted α 新 and β 新 , α 新 =0.05α;β 新 =0.025β.
[0016] Preferably, it also includes judging whether the current LCU is the last LCU of the current frame, if not, entering into the next LCU bit rate control; otherwise, ending the encoding work of the current frame and entering into the next frame.
[0017] The present invention has significant technical effects due to the adoption of the above technical solution: The present invention optimizes and improves the HEVC test platform rate control model, making the HM16.9 rate control model more universal for reasonable rate allocation of scene changes and areas of different complexity, while ensuring that the subjective quality of video encoding is not affected. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 It is a flow chart of the present invention.
[0019] Figure 2 It is the RD performance curve diagram of the prior art.
[0020] Figure 3 It is the RD performance curve diagram of the present invention.
[0021] Among them: LDP (Low Delay P) low delay P frame; LCU (Large Coding Unit) maximum coding unit; HEVC (High Efficiency Video Coding) high performance video coding; QP (Quantization Parameter) quantization parameter. DETAILED DESCRIPTION
[0022] The present invention is further described in detail below in conjunction with the accompanying drawings and embodiments.
[0023] Example 1
[0024] A HEVC bit rate control method based on maximum coding unit level, Figure 1 The method includes: Before encoding the current frame, the number of bits, frame-level λ and QP required to encode the current frame are calculated, and then the current LCU-level rate control related parameters are initialized; Before encoding the current frame, the number of bits, frame-level QP, and λ required to encode the current frame are calculated; After LCU level, the rate control related parameters of the current LCU are initialized, and the complexity of the R-λ model of the LCU is used as the weight to calculate the complexity weight of the current LCU block. CurLCU ; ; ; Among them, λ is the Lagrangian factor for encoding the current LCU level bit rate control, numberOfPixels CurLCU is the number of valid pixels at the current CTU level, α and β are the bit rate control parameters at the current LCU level; The current LCU initialization bit InitBits is calculated based on the proportion of the LCU weight to all LCU weights in the entire frame and the current frame pre-allocated target bits. CurLCU ; ; Among them, T CurPic Pre-allocate the target number of bits for the current frame, numberOfLCU is the number of all LCUs in the current frame, Weight i The corresponding weight value of each LCU in the current frame; Calculate the pre-allocated bits LeftBits for the current LCU based on the number of remaining uncoded LCUs and the number of remaining bits in the current frame CurLCU ; ; Among them, BitsLeft CurPicThe number of pre-allocated bits remaining for encoding the current frame to this LCU; numberOfLCU is the number of all LCUs in the current frame; Weight i The corresponding weight value of each LCU in the current frame; The target number of bits in the improved frame of the current LCU is calculated by weighting the initial pre-allocated bits of the current LCU and the actual remaining bits allocated to the current LCU in the current frame. CurLCU ; ; in, Indicates the weight coefficient corresponding to the initial number of bits of the current LCU, and ; To better determine InitBits CurLCU and LeftBitS curLCU The weight size, Indicates the current LCU weight coefficient ( ). This embodiment selects the following four sample sequences from the HEVC standard test sequence for testing, see Table 1. Table 1 is The comparison of the value size and the encoding bit rate of the HM16.9 platform, ParkScene (1920×1080) RaceHorsesC (832×480); BQSquare (416×240); BasketballPass (416×240). HM16.9 is used as the test platform, QP is 32, LDP configuration is used, and 100 frames are encoded for each test sequence. Through test statistics, it is found that when the value is 0.4, the average bit rate of the four groups of standard video sequences is saved more.
[0025] Table 1
[0026] After calculating the target number of bits in the improved frame of the current LCU, the parameter λ is calculated through the target bit rate and the R-λ model at the LCU level; the number of bits of the LCU before encoding the current frame, the frame-level QP and λ are calculated.
[0027] Determine the proportion of skip mode used after the current LCU is encoded; if the current encoded LCU uses skip mode exceeding the set threshold K, appropriately reduce the actual number of bits consumed by the current LCU to predict the next LCU ActualBitS CutrLCU(n) size, and adjust the bit rate control parameters α and β at the same time; otherwise, only the current LCU bit rate R-λ parameter is updated. In this embodiment, the threshold K is set to 90%; when the skip mode exceeds 90%, the actual bit consumption ActualBitS of the current LCU to predict the next LCU is appropriately reduced.CutrLCU(n) size, and adjust the rate control parameters α and β at the same time; otherwise, only the current LCU rate R-parameter is updated.
[0028] The adjustment method of control parameters α and β is adjusted by setting, so as to obtain the adjusted α 新 and β 新 , α 新 =0.05α;β 新 =0.025β.
[0029] It also includes judging whether the current LCU is the last LCU of the current frame. If not, it enters the next LCU bit rate control; otherwise, it ends the encoding work of the current frame and enters the next frame.
[0030] Example 2
[0031] Based on Example 1, LCU finally predicts the target bit number TargetBitSpre CurLCU(n) Calculation; based on the actual number of bits consumed by the corresponding CTU block in the previous frame ActualBits CutrLCU(n-1) and the number of pre-allocated bits TargetBits for the current CTU block in the frame CurLCU(n) Obtained by weighted calculation of inter-frame prediction; ; in, is the weighted parameter of the prediction model. After statistical tests on multiple sets of standard video sequences, The empirical values are set to 0.35 and 0.65 respectively, which can achieve precise control and savings of the target video bit rate.
[0032] Example 3
[0033] Based on the above embodiment, this embodiment also includes coding verification, for the calculated target number of bits TargetBits in the improved frame of the current LCU CurLCU Verify the encoding by using the comprehensive peak signal-to-noise ratio (PSNR). PSNR = (PSNR Y ×6+PSNR U +PSNR V ) / 8 Among them, PSNR U 、PSNR V Respectively represent the chroma peak signal-to-noise ratio, PSNR Y Indicates the brightness peak signal-to-noise ratio.
[0034] Implemented on the software HM16.9 platform, the basic encoding parameters are set as follows: the maximum CTU size is 64, the maximum CTU depth is 3, the encoding frame configuration type is LDP, the depth quantization step size QP is 22, 27, 32 and 37, and 16 groups of standard test sequences are selected, including four types of B, C, D and E, and the input bit depth of each test sequence is 8. PSNR=(PSNR Y ×6+PSNR U +PSNR V ) / 8 In the formula, PSNR U 、PSNR V Respectively represent the chroma peak signal-to-noise ratio, PSNR Y Indicates the brightness peak signal-to-noise ratio.
[0035] Table 2
[0036] Through the performance comparison between the improved algorithm and the existing algorithm in Table 2, it can be found that compared with HM16.9, the improved algorithm actually consumes a slightly lower bit rate than HM16.9, while the existing technology consumes a bit rate slightly higher than HM16.9. For the four types of videos, the bit rate consumed by this paper is saved by an average of 1.609% compared with the HM16.9 platform; the bit rate consumed by the existing technology is increased by an average of 0.065% compared with the HM16.9 platform.
[0037] In terms of BDPSNR performance, from the comparison results of the existing algorithm, the improved algorithm and HM16.9, the existing algorithm has an average improvement of 0.133dB in encoding quality, and the improved algorithm has an improvement of 0.065dB. Although the loss in improving encoding quality is only 0.68dB compared to the existing technology, the average bit rate is saved by more than 1.6%, indicating that the improved algorithm is more effective in target bit rate control. The use of intra-frame and inter-frame target bit number joint weighted prediction can effectively reduce the actual number of encoding bits consumed by the encoded video sequence.
[0038] Figure 2 and Figure 3 They are the comparison of RD performance curves of the existing algorithm and the improved algorithm. Figure 2 is the video sequence PartyScene, Figure 3 It is the rate-distortion curve of the video sequence FourPeople. From the rate-distortion curve in the figure, we can see that the actual number of bits consumed by encoding in this paper is on the left of the existing technology at the same PSNR, so the RD performance is better.
[0039] In terms of BDPSNR performance, from the comparison results of the existing algorithm, the improved algorithm and HM16.9, the existing algorithm has an average improvement of 0.133dB in encoding quality, and the improved algorithm has an improvement of 0.065dB. Although the loss in improving encoding quality is only 0.68dB compared to the existing technology, the average bit rate is saved by more than 1.6%, indicating that the improved algorithm is more effective in target bit rate control. The use of intra-frame and inter-frame target bit number joint weighted prediction can effectively reduce the actual number of encoding bits consumed by the encoded video sequence.
Claims
1. A HEVC rate control method based on maximum coding unit level, the method comprising: Before encoding the current frame, the number of bits, frame-level QP, and λ required to encode the current frame are calculated; After LCU level, initialize the rate control related parameters of the current LCU. The complexity of the R-λ model of the LCU is used as the weight to calculate the current LCU block complexity weight. CurLCU ; ; ; Among them, λ is the Lagrangian factor for encoding the current LCU level bit rate control, numberOfPixels CurLCU is the number of valid pixels at the current CTU level, α and β are the bit rate control parameters at the current LCU level; The current LCU initialization bit InitBits is calculated based on the proportion of the LCU weight to all LCU weights in the entire frame and the current frame pre-allocated target bits. CurLCU ; ; Among them, T CurPic Pre-allocate the target number of bits for the current frame, numberOfLCU is the number of all LCUs in the current frame, Weight i The corresponding weight value of each LCU in the current frame; Calculate the pre-allocated bits LeftBits for the current LCU based on the number of remaining uncoded LCUs and the number of remaining bits in the current frame CurLCU ; ; Among them, BitsLeft CurPic The number of pre-allocated bits remaining for encoding the current frame to this LCU; numberOfLCU is the number of all LCUs in the current frame; Weight i The corresponding weight value of each LCU in the current frame; The target number of bits in the improved frame of the current LCU is calculated by weighting the initial pre-allocated bits of the current LCU and the actual remaining bits allocated to the current LCU in the current frame. CurLCU ; ; in, Indicates the weight coefficient corresponding to the initial number of bits of the current LCU, and ; LCU finally predicts the target bit number TargetBitSpre CurLCU(n) Calculation; based on the actual number of bits consumed by the corresponding CTU block in the previous frame ActualBits CutrLCU(n-1) and the number of pre-allocated bits TargetBits for the current CTU block in the frame CurLCU(n) Obtained by weighted calculation of inter-frame prediction; ; in, is the weighting parameter of the prediction model.
2. The HEVC rate control method based on the maximum coding unit level according to claim 1, characterized in that: Before encoding the current frame, the number of bits, frame level λ and QP required for encoding the current frame are calculated, and then the current LCU level rate control related parameters are initialized.
3. The HEVC rate control method based on maximum coding unit level according to claim 1, characterized in that: For calculating the target number of bits after weighted improvement within and between the current LCU frames, the initial QP and λ corresponding to the CTU block participating in the encoding are calculated through the LCU-level R-λ model.
4. The HEVC bit rate control method based on the maximum coding unit level according to claim 1, characterized in that: Determine the proportion of skip mode used after the current LCU is encoded; if the current encoded LCU uses skip mode exceeding the set threshold K, appropriately reduce the actual number of bits consumed by the current LCU to predict the next LCU, and adjust the bit rate control parameters α and β; otherwise, only update the current LCU bit rate R-λ parameter.
5. The HEVC bit rate control method based on the maximum coding unit level according to claim 1, characterized in that: The adjustment method of control parameters α and β is adjusted by setting, so as to obtain the adjusted α 新 and β 新 , α 新 =0.05α;β 新 =0.025β。 6. The HEVC bit rate control method based on maximum coding unit level according to claim 4, characterized in that: It also includes judging whether the current LCU is the last LCU of the current frame. If not, it enters the next LCU bit rate control; otherwise, it ends the encoding work of the current frame and enters the next frame.
Citation Information
Patent Citations
HEVC encoding unit level code rate control method
CN105554503A
Visual perception-based rate control method and device
WO2023159965A1