A sample adaptive compensation bit rate estimation method suitable for HEVC standard

By determining the syntax elements of the SAO parameters in HEVC encoding and establishing a simplified code rate estimation model, the problems of complex code rate estimation and high resource consumption in HEVC encoding are solved, and efficient coding performance and low-complexity hardware implementation are achieved.

CN119767015APending Publication Date: 2025-04-04上海芯开技术有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510005120.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-02
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

The code rate estimation process of SAO parameters in HEVC encoding is complicated and the hardware implementation resource consumption is high.

Method used

A sample point adaptive compensation code rate estimation method is proposed for the HEVC standard. By determining the syntax elements and establishing the code rate estimation model, accumulating the grammatical element code rate estimation values ​​of each stage, and selecting the sample point adaptive compensation parameter combination with the minimum rate distortion cost.

Benefits of technology

The code rate estimation model is simplified, the cycle and resource consumption of hardware implementation is reduced, the efficiency of the encoder and the utilization of storage resources are improved, and the balance between efficient coding performance and low complexity is achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119767015A_ABST
    Figure CN119767015A_ABST
Patent Text Reader

Abstract

The present application relates to the field of video coding, and discloses a sample adaptive compensation rate estimation method applicable to the HEVC standard, comprising the following steps: determining the syntax elements and values ​​of the current SAO parameters, establishing a rate estimation model based on the determined syntax elements, accumulating the syntax element rate estimation values ​​of each stage to obtain the total rate estimation value, using the total rate estimation value to perform rate distortion optimization calculation, and selecting the SAO parameter combination with the minimum rate distortion cost. The present invention avoids the high-complexity calculation and large lookup table in traditional CABAC coding through a simplified rate estimation model, significantly reduces hardware resource consumption, improves computational efficiency, is suitable for real-time coding applications, and achieves good coding performance and image quality under the premise of low resource overhead.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of video coding, and in particular to a sample adaptive compensation bit rate estimation method applicable to the HEVC standard. Background Art

[0002] The High Efficiency Video Coding (HEVC) standard is an important video coding standard jointly developed by the Joint Video Coding Team (JCT-VC) jointly established by the Video Coding Experts Group (VCEG) and the Moving Picture Experts Group (MPEG). Its main goal is to significantly improve compression efficiency under the same video quality conditions. Compared with its previous generation standard (i.e. Advanced Video Coding AVC), HEVC can achieve about double the compression gain. In order to reduce distortion in the encoding process and coding artifacts in the reconstructed video, the HEVC standard uses two loop filtering tools: deblocking filtering (DBF) and sample adaptive offset (SAO).

[0003] Among them, the SAO tool uses a classifier to assign pixels to different categories, and calculates the corresponding compensation value based on the difference between the pixel values ​​before and after filtering in each category, and then applies the compensation value to the pixels before filtering to reduce distortion and reduce ringing effects. Specifically, the classifier used by SAO and the compensation values ​​of each category together constitute the SAO parameters, which are generated by the encoder and encoded into the bitstream for transmission. For each given pre-filtered pixel, the selection of different classifiers and compensation values ​​can reduce distortion to varying degrees, but will introduce different encoding bit rates. Therefore, it is necessary to test multiple SAO parameter combinations on the encoder side, and by calculating the rate-distortion (RDO) cost of each combination, select the parameter combination with the minimum rate-distortion cost to achieve the optimal distortion reduction and bit rate control effect.

[0004] In the official reference software HM of the HEVC standard, the coding rate calculation of the SAO parameters is implemented through the context-based adaptive binary arithmetic coding (CABAC) method. However, CABAC coding is relatively complex, and its implementation requires binarization and arithmetic coding of a large number of syntax elements. This process not only involves probability modeling and state updates, but also relies on multi-level lookup table operations. Therefore, CABAC coding consumes more resources and cycles in actual hardware implementation, which in turn affects the chip throughput and increases the chip area requirements. Summary of the invention

[0005] In view of the deficiencies in the prior art, the present invention provides a sample adaptive compensation bit rate estimation method applicable to the HEVC standard, which solves the problems of complex bit rate estimation process of SAO parameters and high resource consumption of hardware implementation in the existing HEVC encoding.

[0006] To achieve the above objectives, the present invention is implemented by the following technical scheme: A sample adaptive compensation bit rate estimation method applicable to the HEVC standard comprises the following steps: Determine the syntax elements and corresponding values ​​of the current sample adaptive compensation parameters; Establishing a rate estimation model based on the determined syntax elements; According to the established bit rate estimation model, the estimated bit rate values ​​of the syntax elements at each stage are accumulated to obtain the total bit rate estimation value of each stage; The obtained total bit rate estimation value is used to calculate the rate distortion optimization cost and select the sample adaptive compensation parameter combination with the minimum rate distortion cost.

[0007] Preferably, the sample point adaptive compensation parameters include three classifier types: no compensation, boundary compensation and sideband compensation.

[0008] Preferably, the step of determining the syntax elements and values ​​of the current sample adaptive compensation parameters includes: According to the classifier type of the sample adaptive compensation tool, select the corresponding compensation mode for the luminance component Y and the two chrominance components Cb and Cr; When boundary compensation is selected, a one-dimensional direction affecting pixel classification is further determined, wherein the direction options include 0 degrees, 90 degrees, 135 degrees, and 45 degrees, and four absolute values ​​of compensation values ​​of the corresponding directions are transmitted; When selecting the sideband compensation, further selecting four consecutive sidebands from the 32 sidebands of the pixel intensity value, and transmitting the minimum sideband index in the selected sidebands and the absolute values ​​and signs of the four compensation values; If the left merge mode is adopted to multiplex the SAO parameters on the left, the left merge flag is transmitted as 1; if the upper merge mode is adopted to multiplex the SAO parameters above, the left merge flag is transmitted as 0 and the upper merge flag is transmitted as 1; if the merge mode is not adopted, the left merge flag and the upper merge flag are both transmitted as 0, and the detailed classifier and compensation value information of the luminance component and the chrominance component continue to be transmitted.

[0009] Preferably, the step of establishing a rate estimation model based on the determined syntax elements comprises: For the left merge flag and the upper merge flag, the code rate is estimated by using the conventional arithmetic coding method; For the luminance classifier type and the chrominance classifier type, the highest bit is estimated by conventional arithmetic coding, and the remaining bits are estimated by bypass arithmetic coding; For the absolute value and sign of the compensation value, bypass arithmetic coding is used to perform code rate estimation; For boundary compensation classes and sideband compensation positions, bypass arithmetic coding is used for rate estimation.

[0010] Preferably, the code rate estimation of the left merge mark and the upper merge mark includes using and The function maps a probability state to a bitrate estimate.

[0011] Preferably, the code rate estimation of the brightness classifier type and the chrominance classifier type includes: The code rate estimate for conventional arithmetic coding based on the probability states and the most probable symbol for the highest bits of the luma classifier type and the chroma classifier type; For the remaining bits of the luminance classifier type and the chrominance classifier type, the rate estimation is performed using bypass arithmetic coding with a fixed rate value.

[0012] Preferably, the bit rate estimation of the absolute value of the compensation value is to determine the bit rate estimation value by comparing the absolute value of the compensation value with an upper limit threshold, including: If the absolute value of the compensation value is less than the threshold, the bit rate estimation value is the absolute value of the compensation value plus 1; If the absolute value of the compensation value is equal to the threshold, the bit rate estimation value is the absolute value of the compensation value.

[0013] Preferably, the code rate estimates of the compensation value symbol, boundary compensation class and sideband compensation position are all fixed values.

[0014] Preferably, the step of accumulating the estimated values ​​of the syntax element rates of each stage according to the established rate estimation model to obtain the estimated value of the total rate of each stage comprises: In the stage of selecting the optimal compensation value, the absolute value of the compensation value and the estimated value of the code rate of the symbol are added to obtain the total estimated value of the code rate in the stage of the optimal compensation value; In the stage of selecting the best classifier, the estimated bit rates of the classifier type, the boundary compensation class, the sideband compensation position and the four related compensation values ​​are added together to determine the total estimated bit rate of the best classifier stage; In the stage of selecting the optimal sample adaptive compensation parameters, the bit rate estimates of the merge flag, the classifiers of the luminance and chrominance components, and the compensation values ​​are added together to calculate the total bit rate estimate of the optimal sample adaptive compensation parameter stage.

[0015] Preferably, the step of using the obtained total bit rate estimation value to calculate the rate distortion optimization cost and selecting the sample adaptive compensation parameter combination with the minimum rate distortion cost comprises: The accumulated total bit rate estimate is used to perform rate distortion optimization calculation, and a sample adaptive compensation parameter combination that minimizes the video coding distortion under a given bit rate constraint is selected.

[0016] The present invention provides a sample adaptive compensation bit rate estimation method applicable to the HEVC standard. It has the following beneficial effects: 1. The present invention avoids the complicated binarization and arithmetic coding process in the traditional CABAC coding method through a simplified bit rate estimation model, and saves a lot of probability modeling and state update operations. This design significantly reduces the cycle and processing resources required for hardware implementation, making the implementation of the encoder more efficient and simple.

[0017] 2. The present invention no longer relies on the large lookup table in the HM model, avoiding the need for a lookup table with 128 entries, each containing 20 bits of data, thereby reducing the need for hardware storage. By removing such a lookup table, the present invention significantly reduces the reliance on storage space and improves resource utilization efficiency in hardware implementation.

[0018] 3. The present invention adopts simplified arithmetic operations and fixed bit rate estimation strategies, especially when processing syntax elements such as merge flags, classifier types and compensation values ​​in SAO parameters, simple accumulation and conditional judgment are used to replace complex operations. Therefore, the computing efficiency can be significantly improved in hardware implementation, which is suitable for real-time encoding requirements.

[0019] 4. The present invention provides a flexible rate-distortion optimization (RDO) calculation process, which allows adjustment according to specific coding requirements and bit rate requirements. For example, by adjusting the Lagrange multiplier, distortion minimization or bit rate minimization can be prioritized under different bit rate budgets, thereby meeting a variety of requirements in high-quality or low-bandwidth scenarios.

[0020] 5. Although the present invention simplifies the bit rate estimation process, it still maintains the high compression rate and image quality in HEVC encoding. Through the accurate estimation of SAO parameters, the present invention can effectively control the encoding overhead and ensure that the image distortion is within an acceptable range, thereby achieving a balance between efficient encoding performance and low complexity in hardware.

[0021] 6. Since the present invention reduces complex calculations and a large number of storage access requirements, the power consumption in hardware implementation is relatively reduced. In power-sensitive application scenarios, such as mobile devices and low-power video transmission devices, the method of the present invention can extend the battery life of the device and improve energy efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 It is a schematic diagram of the method flow of the present invention; Figure 2 A flowchart of the syntax elements required to transmit the SAO parameters of the present invention; Figure 3 Schematic diagram of four EO types of the EO mode of the SAO of the present invention; Figure 4 Schematic diagram of 32 sidebands of the BO mode of the SAO of the present invention. DETAILED DESCRIPTION

[0023] The following will be combined with the drawings in the specification of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0024] Please see attached Figure 1 -Attached Figure 4 The embodiment of the present invention provides a sample adaptive compensation bit rate estimation method applicable to the HEVC standard, comprising the following steps: S1. Determine the syntax elements and corresponding values ​​of the current sample adaptive compensation parameters Step S1 mainly determines the syntax elements and values ​​of the current sample adaptive offset (SAO) parameters. This step is closely related to the function of the SAO tool in the HEVC standard to improve the quality of reconstructed video. By reasonably selecting and setting different syntax elements, compensation for pixel distortion is achieved, thereby improving the video encoding effect without increasing the bit rate too much.

[0025] like Figure 2 As shown, in some embodiments, the SAO parameters include multiple syntax elements for controlling whether compensation is performed, how to classify pixels, and setting compensation values. Specifically, in the HEVC standard, the SAO tool includes three main classifier types: no compensation (OFF), boundary compensation (EO), and sideband compensation (BO). In each embodiment, it is first necessary to select a suitable classifier type based on the requirements of the current video encoding frame, and further determine the specific syntax elements and their values ​​to achieve the best compensation effect. The following describes in detail the selection method of each classifier and merge mode and the composition of the corresponding syntax elements.

[0026] In this embodiment, the non-compensation (OFF) classifier is used to retain the original filtering result of the current pixel without additional compensation. This classifier is suitable for areas where sample point compensation is not required, and can usually reduce coding complexity and unnecessary bit rate consumption.

[0027] like Figure 3As shown, for the boundary compensation (EO) classifier, in some embodiments, classification is performed based on the size relationship between the current pixel and its two adjacent pixels in one-dimensional direction. This classifier can provide four direction options, including 0 degrees, 90 degrees, 135 degrees and 45 degrees, and each direction corresponds to a boundary compensation class (EO class). In this case, the classification of the current pixel is determined by the pixel size relationship in different directions, and each type of pixel is processed according to a predetermined compensation value. The required transmission parameters include the absolute values ​​of the four compensation values ​​and the EO class. As one of the grammatical elements, the EO class is selected based on the pixel characteristics in a specific direction, which can more effectively reduce the distortion of the pixel edge and improve the coding quality.

[0028] like Figure 4 As shown, in an embodiment of a sideband compensation (BO) classifier, pixel intensity values ​​are classified by dividing them into multiple intervals (i.e., sidebands). The HEVC standard divides the intensity values ​​into 32 sidebands, and each sideband corresponds to an intensity value range. In some specific embodiments, four consecutive sidebands may be selected, and the corresponding pixels may be compensated using the compensation values ​​of these sidebands. The minimum sideband index of the selected consecutive sidebands is called the BO sideband position, which needs to be transmitted in the syntax element. In addition, the compensation value of each sideband needs to transmit its absolute value and sign information so as to accurately reconstruct the compensated pixel value at the decoding end. The BO sideband position optimizes the overall performance of the pixel area by setting the compensation value, thereby improving the visual quality.

[0029] In order to further reduce the transmission amount of SAO parameters, the present invention adopts the "merge mode" introduced by the HEVC standard in some embodiments, that is, multiplexing the SAO parameters of the left or upper coding blocks. If the left merge mode is adopted, only the left merge flag (set to 1) is transmitted to indicate that the SAO parameters of the left block have been reused; if the upper merge mode is adopted, only the left merge flag (set to 0) and the upper merge flag (set to 1) are transmitted to indicate that the SAO parameters of the upper block are reused. In the non-merge mode, the left merge flag and the upper merge flag are both 0, and the classifier type and compensation value of the luminance component (Y) and the chrominance component (Cb, Cr) need to be transmitted separately.

[0030] In the case of non-merging, the transmission parameters of the luminance and chrominance components are as follows: first, the classifier type of the luminance component is transmitted. If the classifier type is EO, the absolute values ​​of the four compensation values ​​and the EO class are further transmitted; if the classifier type is BO, the absolute values ​​and signs of the four compensation values, as well as the BO sideband position are further transmitted. The processing of the chrominance component is similar. If it is the EO type, the absolute values ​​of the four compensation values ​​of the Cb component, the EO class, and the absolute values ​​of the four compensation values ​​of the Cr component are transmitted respectively; if it is the BO type, the absolute values ​​and signs of the four compensation values ​​of the Cb component, the BO sideband position, and the absolute values ​​and signs of the four compensation values ​​of the Cr component, and the BO sideband position are transmitted.

[0031] Therefore, when determining the syntax elements and values ​​of the current SAO parameters, by setting each parameter according to a combination of different classifier types and merging modes, the data volume of the SAO parameters can be effectively reduced to adapt to the compensation requirements of different pixels, thereby laying the foundation for subsequent bit rate estimation and optimization.

[0032] S2. Establish a code rate estimation model based on the determined syntax elements Step S2 is to establish a rate estimation model based on the determined syntax elements. This step is a further processing of the SAO parameter syntax elements obtained in step S1. By analyzing the binary and arithmetic coding methods of the syntax elements, a corresponding rate estimation model is established so as to quickly estimate the required rate of the SAO parameters without actual coding. By building a simplified model to achieve rate estimation, the complexity of hardware implementation can be significantly reduced, the occupation of computing resources can be reduced, and basic data can be provided for subsequent rate distortion optimization (RDO) cost calculations.

[0033] In this embodiment, based on the particularity of the left merge flag and the upper merge flag, conventional arithmetic coding is used for bit rate estimation. The left merge flag and the upper merge flag are both only 1 bit, and only need to indicate whether to reuse the SAO parameters on the left or the upper side. Therefore, in this embodiment, the probability state (σ) and the most probable symbol (MPS) are used to estimate the bit rate to avoid the actual coding process. Specifically, the probability state of the merge flag ( ) is 7, the most likely symbol ( ) is set to 0. The estimated bitrate of the merged marker Based on the input tag value ( ) is equal to OK, if they are equal then select , otherwise select , its bit rate estimate The calculation method uses formula (1): (1) in, is the input merge tag value; is the probability state of the merged mark, calculated using formula (2): (2) is the most likely symbol of the merged token, calculated using formula (3): (3) and is a function that maps probability states to bit rate estimates, using formula (4) and formula (5) respectively: (4) (5) In this embodiment, the code rate estimation of the brightness classifier type and the chrominance classifier type simplifies the estimation process by separating the highest bit and the remaining bits. The highest bit uses conventional arithmetic coding, and the remaining bits use bypass arithmetic coding. The classifier type of the brightness and chrominance components is 1 to 2 bits, and has different values ​​in the three classifier types of OFF, EO and BO. Its code rate estimation value The calculation method uses formula (6): (6) in, is the input classifier type value, which can be OFF, EO or BO; yes The part of the value corresponding to the conventional arithmetic coding is calculated using formula (7): (7) in, is the probability state of the classifier type; and is a function that maps probability states to bit rate estimates, using formula (4) and formula (5) respectively; is the most likely symbol of the classifier type, and the calculation method uses formula (8) and formula (9) respectively: (8) (9) Further, in some embodiments, the probability state of the luma or chroma component classifier type ( ) and the most likely symbol ( ) The initial probability state based on the context ( ) is determined. According to the current frame type (I frame or P frame) and quantization parameter ( ) is calculated, and the intermediate variables need to be pre-calculated using formula (10) : (10) in, is the quantization parameter value of the current frame, >> is the right shift operator; In this embodiment, the rate estimation model of the absolute value of the compensation value is adjusted according to its size. When the absolute value of the compensation value is small, the absolute value is usually increased by one when estimating the rate to appropriately increase the rate estimation value; when the absolute value of the compensation value is greater than the upper threshold, the rate estimation value is equal to the absolute value itself. Specifically, the absolute value of the compensation value The estimated bit rate The calculation method uses formula (11): (11) For the code rate estimation of the compensation value symbol, bypass arithmetic coding is adopted in this embodiment, and the code rate estimation value is directly set to 1, which simplifies the coding process of the symbol. The calculation method uses formula (12): (12) In the code rate estimation of the boundary compensation class (EO class) and the sideband compensation position (BO sideband position), in this embodiment, 2-bit bypass arithmetic coding is used for the EO class and 5-bit bypass arithmetic coding is used for the BO sideband position.

[0034] Specifically, the bit rate estimate of the EO class is Set to 2, the estimated bit rate The calculation method uses formula (13): (13) Code rate estimate for BO sideband position Set to 5, the estimated bit rate The calculation method uses formula (14): (14) By establishing the bit rate estimation models for different syntax elements, this embodiment can simplify the encoding process of SAO parameters, avoid complex operations in actual encoding, and directly obtain the bit rate estimation value of each syntax element, thereby reducing hardware complexity and providing support for the overall optimization of the encoding system.

[0035] S3. According to the established bit rate estimation model, the estimated bit rate values ​​of the syntax elements at each stage are accumulated to obtain the total bit rate estimation value of each stage. Step S3 is to obtain the estimated bit rate of the SAO parameter part or the whole by accumulating the estimated bit rate of the syntax elements at each stage, so as to provide a basis for the subsequent rate distortion optimization cost (RDO) calculation. This step is based on the bit rate estimation model constructed in the above step S2. By accumulating the estimated bit rate of the syntax elements at different stages, the total bit rate estimation value of each stage is obtained. This accumulation process can dynamically select the optimal compensation parameter combination according to the coding requirements, improve coding efficiency, and reduce unnecessary bit rate overhead.

[0036] In this embodiment, in the optimal compensation value selection stage, different compensation value combinations are tested, and the absolute value of the compensation value and the estimated code rate of the compensation value symbol are accumulated to calculate the total estimated code rate of this stage. The estimated code rate of the compensation value symbol is calculated using formula (11): It is calculated using formula (12) and is a fixed value of 1. By accumulating these bit rate estimates, the overall bit rate estimate of this stage can be obtained when the optimal compensation value is selected.

[0037] In some embodiments, different classifier and compensation value combinations need to be tested in the optimal classifier selection stage. In this embodiment, the classifier type, boundary compensation class (EO class) or sideband compensation position (BO sideband position) of the luminance and chrominance components, and the bit rate estimation values ​​of the four compensation values ​​are accumulated to obtain the overall bit rate estimation value of this stage. Specifically, the bit rate estimation value of the classifier type is The code rate estimate of the EO class is calculated using formula (6). Calculated using formula (13), with a fixed value of 2, the estimated bit rate at the BO sideband position is Formula (14) is used for calculation, with a fixed value of 5. The absolute value and sign of the compensation value are respectively and The final accumulated result is the total bit rate estimate of the classifier selection stage.

[0038] In the stage of selecting the optimal SAO parameters, this embodiment tests SAO parameter combinations under different merging modes, including left merging, upper merging, or no merging. The bit rate estimation values ​​of the left merging flag and the upper merging flag are accumulated ( ), the classifier type bit rate estimate of the luminance component (Y) and the chrominance component (Cb, Cr) ( ), boundary compensation class ( ) or sideband compensation position ( ), and the bit rate estimate of the compensation value ( and The estimated code rate of the combined mark is based on whether the input value matches the most likely symbol (MPS) through the probability state mapping or Calculated to ensure the accuracy of the merged model.

[0039] Through the accumulation process of the above three stages, the present invention can obtain the total bit rate estimation value of each stage respectively, provide support for subsequent RDO calculation, and ensure that the finally selected SAO parameter combination achieves a better video encoding effect on the basis of meeting the minimum bit rate overhead.

[0040] S4, using the total bit rate estimate obtained, through rate distortion optimization cost calculation, select the sample adaptive compensation parameter combination with the minimum rate distortion cost Step S4 uses the total bit rate estimate accumulated in the above step S3 to calculate the rate distortion optimization cost (RDO) and finally selects the SAO parameter combination with the minimum rate distortion cost. The goal of this step is to minimize the distortion cost so that the encoding effect reaches a better state, thereby achieving higher image quality under a limited bit rate budget. Selecting a combination of SAO parameters through RDO calculation can effectively reduce distortion while maintaining encoding efficiency and ensure the final video quality.

[0041] In this embodiment, the rate distortion optimization cost is calculated based on the total bit rate estimation value accumulated in each stage. Specifically, the calculation formula of the RDO cost is:

[0042] in, represents the rate distortion cost, represents the distortion between the reconstructed image and the original image, represents the estimated bit rate obtained by accumulation, is the Lagrange multiplier associated with the current quantization parameter (QP) and is used to balance the relative weights of distortion and bit rate. The goal of this formula is to select such that The SAO parameter combination with the smallest value is used to optimize the image quality of the encoder under a given bitrate budget.

[0043] In some embodiments, in order to adapt to different encoding scenarios, the distortion metric D can be measured by a mean square error (MSE) or a peak signal-to-noise ratio (PSNR). For example, when the distortion metric is MSE, the RDO cost calculation uses the square difference of the pixel values ​​for cumulative calculation; and when the metric is PSNR, the distortion value is obtained by logarithmic operation of the pixel difference. This flexible distortion metric allows the present embodiment to select the optimal SAO parameter combination under different video content and encoding requirements.

[0044] In this embodiment, the RDO calculation tests each SAO parameter combination, including the merge mode (left merge, top merge, no merge), the classifier type (OFF, EO, BO) and its related compensation value. For each set of SAO parameter combinations, its RDO cost is calculated, and the minimum cost value and the corresponding parameter combination are recorded. By comparing the RDO costs of different combinations, the best parameter configuration can be determined among multiple SAO parameters to achieve the optimal video quality of the encoder.

[0045] In some specific application scenarios, such as those with high bit rate requirements, this embodiment can appropriately increase the Lagrange multiplier. , thus paying more attention to image quality; in low bit rate scenes, it can be appropriately reduced The value of gives priority to reducing the bitrate overhead to ensure that the video encoding meets the bandwidth limit. In different scenarios, by adjusting The value of can flexibly optimize the encoding effect.

[0046] In summary, the present invention performs RDO calculation through the accumulated total bit rate estimate, so that the combination with the minimum rate-distortion cost can be quickly screened out from different SAO parameter combinations, thereby effectively improving the encoding quality without significantly increasing the bit rate, and realizing efficient and low-complexity sample point adaptive compensation parameter optimization.

[0047] In general, the present invention proposes a simplified bit rate estimation method by combining the characteristics of the SAO parameter syntax elements and the process characteristics of its CABAC entropy coding. Unlike the high-complexity CABAC method used in the traditional HEVC reference model (HM), the method provided by the present invention no longer relies on the actual binarization calculation and arithmetic coding process, avoiding complex probability modeling and coding operations. At the same time, the method of the present invention does not need to use the large lookup table in the original HM, which includes 128 entries, each of which contains 20 bits of data. Therefore, the implementation of the present invention can significantly reduce the hardware cycle and resource consumption, and improve the overall efficiency of the encoder in hardware implementation.

[0048] In some embodiments, the method of the present invention decomposes the rate estimation process of different SAO parameter syntax elements into multiple simple accumulation operations by establishing a simplified rate estimation model, thereby reducing a large number of complex calculations originally required in CABAC encoding. These simplified operations make the present invention particularly suitable for implementation in hardware, which can effectively reduce the demand for hardware storage and processing resources and avoid the high cycle consumption problem in the traditional HEVC CABAC encoding process.

[0049] For example, when processing the code rate estimation of the left merge mark and the upper merge mark, the present invention directly uses the preset probability state and the most likely symbol (MPS) to obtain its code rate estimation value through simple conditional judgment without the need for actual arithmetic coding. This method not only reduces the complexity of the actual coding operation, but also eliminates the need to store the lookup table for each possible state in the original HM method, thereby saving a lot of storage space in hardware implementation.

[0050] In addition, for the classifier type bit rate estimation of the luminance and chrominance components, the present invention processes the highest bit and the remaining bits separately, the highest bit is estimated using conventional arithmetic coding, and the remaining bits are estimated using bypass arithmetic coding, avoiding complex context model updates. This design can not only adapt to the encoding requirements of different SAO classifier types, but also effectively reduce the complexity of the bit rate estimation process. In some embodiments, the selection of Lagrange multipliers can be appropriately adjusted according to the encoding scenario, so as to further optimize the encoding quality under different bit rate conditions.

[0051] For the absolute value and sign of the compensation value, the method of the present invention directly processes the absolute value size through a predefined mapping rule. The absolute value of the compensation value below the preset threshold will be added by 1 as the bit rate estimation value, while the absolute value equal to the threshold will be directly used as the bit rate estimation value. This method completes the bit rate estimation of the compensation value through simple comparison and accumulation operations, avoiding the complex arithmetic coding process.

[0052] In the code rate estimation of the edge compensation class (EO class) and the sideband compensation position (BO sideband position), the present invention uniformly adopts bypass arithmetic coding, sets the EO class to a fixed 2-bit code rate, and sets the BO sideband position to a fixed 5-bit code rate. Since it does not rely on the dynamic update of the probability state, the bypass arithmetic coding has higher processing efficiency in hardware, further reducing the implementation complexity.

[0053] Therefore, the present invention realizes the rapid estimation of SAO parameters without significantly affecting the coding performance through a simplified bit rate estimation model. The method avoids the high complexity and large amount of data search requirements of the traditional CABAC method, making it particularly suitable for efficient implementation in a hardware environment. The method of the present invention can also adapt to different video coding scenarios, and achieves a good balance between high performance and low resource consumption by flexibly adjusting relevant parameters, and has significant practical application value.

[0054] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A sample adaptive compensation bit rate estimation method applicable to the HEVC standard, characterized in that: The following steps are involved: Determine the syntax elements and corresponding values ​​of the current sample adaptive compensation parameters; Establishing a rate estimation model based on the determined syntax elements; According to the established bit rate estimation model, the estimated bit rate values ​​of the syntax elements at each stage are accumulated to obtain the total bit rate estimation value of each stage; The obtained total bit rate estimation value is used to calculate the rate distortion optimization cost and select the sample adaptive compensation parameter combination with the minimum rate distortion cost.

2. The method for estimating a sample adaptive compensation bit rate applicable to the HEVC standard according to claim 1, characterized in that: The sample point adaptive compensation parameters include three classifier types: no compensation, boundary compensation and sideband compensation.

3. The method for estimating sample adaptive compensation bit rate applicable to the HEVC standard according to claim 2, characterized in that: The step of determining the syntax elements and values ​​of the current sample adaptive compensation parameters comprises: According to the classifier type of the sample adaptive compensation tool, select the corresponding compensation mode for the luminance component Y and the two chrominance components Cb and Cr; When boundary compensation is selected, a one-dimensional direction affecting pixel classification is further determined, wherein the direction options include 0 degrees, 90 degrees, 135 degrees, and 45 degrees, and four absolute values ​​of compensation values ​​of the corresponding directions are transmitted; When selecting the sideband compensation, further selecting four consecutive sidebands from the 32 sidebands of the pixel intensity value, and transmitting the minimum sideband index in the selected sidebands and the absolute values ​​and signs of the four compensation values; If the left merge mode is adopted to multiplex the SAO parameters on the left, the left merge flag is transmitted as 1; if the upper merge mode is adopted to multiplex the SAO parameters above, the left merge flag is transmitted as 0 and the upper merge flag is transmitted as 1; if the merge mode is not adopted, the left merge flag and the upper merge flag are both transmitted as 0, and the detailed classifier and compensation value information of the luminance component and the chrominance component continue to be transmitted.

4. The method for estimating a sample adaptive compensation bit rate applicable to the HEVC standard according to claim 1, characterized in that: The step of establishing a code rate estimation model based on the determined syntax elements comprises: For the left merge flag and the upper merge flag, the code rate is estimated by using the conventional arithmetic coding method; For the luminance classifier type and the chrominance classifier type, the highest bit is estimated by conventional arithmetic coding, and the remaining bits are estimated by bypass arithmetic coding; For the absolute value and sign of the compensation value, bypass arithmetic coding is used to perform code rate estimation; For boundary compensation classes and sideband compensation positions, bypass arithmetic coding is used for rate estimation.

5. The method for estimating sample adaptive compensation bit rate applicable to the HEVC standard according to claim 4, characterized in that: The code rate estimation of the left merge mark and the upper merge mark includes using the probability state and the most likely symbol of the merge mark to and The function maps a probability state to a bitrate estimate.

6. The method for estimating a sample adaptive compensation bit rate applicable to the HEVC standard according to claim 4, characterized in that: The code rate estimation of the brightness classifier type and the chrominance classifier type includes: The code rate estimate for conventional arithmetic coding based on the probability states and the most probable symbol for the highest bits of the luma classifier type and the chroma classifier type; For the remaining bits of the luminance classifier type and the chrominance classifier type, the rate estimation is performed using bypass arithmetic coding with a fixed rate value.

7. The method for estimating sample adaptive compensation bit rate applicable to the HEVC standard according to claim 4, characterized in that: The bit rate estimation of the absolute value of the compensation value is to determine the bit rate estimation value by comparing the absolute value of the compensation value with an upper limit threshold, including: If the absolute value of the compensation value is less than the threshold, the bit rate estimation value is the absolute value of the compensation value plus 1; If the absolute value of the compensation value is equal to the threshold, the bit rate estimation value is the absolute value of the compensation value.

8. The method for estimating a sample adaptive compensation bit rate applicable to the HEVC standard according to claim 4, characterized in that: The code rate estimates of the compensation value sign, boundary compensation class, and sideband compensation position are all fixed values.

9. The method for estimating a sample adaptive compensation bit rate applicable to the HEVC standard according to claim 1, characterized in that: The step of accumulating the estimated rates of syntax elements at each stage according to the established rate estimation model to obtain the estimated total rate of each stage comprises: In the stage of selecting the optimal compensation value, the absolute value of the compensation value and the estimated value of the code rate of the symbol are added to obtain the total estimated value of the code rate in the stage of the optimal compensation value; In the stage of selecting the best classifier, the estimated bit rates of the classifier type, the boundary compensation class, the sideband compensation position and the four related compensation values ​​are added together to determine the total estimated bit rate of the best classifier stage; In the stage of selecting the optimal sample adaptive compensation parameters, the bit rate estimates of the merge flag, the classifiers of the luminance and chrominance components, and the compensation values ​​are added together to calculate the total bit rate estimate of the optimal sample adaptive compensation parameter stage.

10. The method for estimating sample adaptive compensation bit rate applicable to the HEVC standard according to claim 1, characterized in that: The step of using the obtained total bit rate estimation value to calculate the rate distortion optimization cost and selecting the sample adaptive compensation parameter combination with the minimum rate distortion cost comprises: The accumulated total bit rate estimate is used to perform rate distortion optimization calculation, and a sample adaptive compensation parameter combination that minimizes the video coding distortion under a given bit rate constraint is selected.