Rate-distortion optimized quantization method, system and device for video coding, and storage medium
By using fixed values to replace part of the bit consumption estimation steps in the rate distortion optimization quantization process of video encoding, the calculation process is simplified, and the long-term problem in video encoding technology is solved, and the efficiency and real-timeness of video encoding are improved.
Patent Information
- Application Number
- PCT/CN2024/099398
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-06-30
- Filing Date
- 2024-06-14
- Publication Date
- 2025-01-02
AI Technical Summary
In the existing video encoding technology, the rate distortion optimization quantization process takes a long time, which is difficult to meet real-time requirements, affecting the user experience.
In the entropy encoded bit estimation process of rate distortion optimization quantization, a fixed value is used to replace the bit consumption estimation step with less impact on encoding quality, simplifying the calculation process and shortening time.
On the premise of ensuring coding quality, shorten the time-consuming of optimization and quantization of rate distortion, improve video encoding efficiency, and meet real-time requirements.
Smart Images

Figure CN2024099398_02012025_PF_FP_ABST
Abstract
Description
Rate-distortion optimization quantization method, system, device and storage medium for video coding
[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on June 30, 2023, with application number 202310797042.1, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The embodiments of the present application relate to the field of video coding technology, and in particular to a rate-distortion optimization quantization method, system, device, and storage medium for video coding. Background Art
[0003] Currently, rate-distortion optimized quantization (RDOQ) is often used in video encoding to improve encoding performance. RDOQ combines the quantization process of video encoding with the principle of rate-distortion optimization. It uses the rate-distortion optimization criterion to determine the optimal quantization value for each non-zero coefficient and the position of the last non-zero coefficient, minimizing encoding distortion while still meeting the target bitrate.
[0004] However, to improve video coding performance, the related rate-distortion optimized quantization scheme needs to calculate the context of the coded significant bits for each pixel during the entropy coding bit estimation process. This includes estimating the bit consumption when the pixel's coefficient to be coded is greater than 1, as well as the bit consumption when the pixel is marked as the last non-zero bit of the current transform unit. This entire process requires complex computational procedures and is time-consuming. For some scenarios with high real-time video coding requirements, the complex rate-distortion optimized quantization process struggles to meet these real-time requirements, resulting in a relatively poor user experience.
[0005] Summary of the Invention
[0006] The embodiments of the present application provide a rate-distortion optimization quantization method, system, device and storage medium for video coding, which can simplify the rate-distortion optimization quantization process while ensuring the quality of video coding, improve video coding efficiency, and solve the technical problem that related rate-distortion optimization quantization schemes are time-consuming.
[0007] In a first aspect, an embodiment of the present application provides a rate-distortion optimized quantization method for video coding, comprising:
[0008] In the entropy coding bit estimation process of rate-distortion optimized quantization, according to the set first fixed value representing the first bit consumption information required for encoding the current pixel when the coefficient to be encoded is greater than 1, the optimal quantization coefficient of the current pixel is calculated based on the first fixed value;
[0009] According to the set second fixed value, the second bit consumption information indicating that the current pixel is marked as the last non-zero bit of the current transform unit is represented, and the rate-distortion cost of encoding the current pixel as the last non-zero coefficient is calculated based on the second fixed value.
[0010] In a second aspect, an embodiment of the present application provides a rate-distortion optimized quantization system for video coding, comprising:
[0011] A first optimization module is configured to calculate an optimal quantization coefficient for the current pixel based on a first fixed value representing first bit consumption information required for encoding the current pixel when the coefficient to be encoded is greater than 1 during an entropy coding bit estimation process of rate-distortion optimization quantization;
[0012] The second optimization module is configured to represent the second bit consumption information of the current pixel point marked as the last non-zero bit of the current transformation unit according to the set second fixed value, and calculate the rate-distortion cost of the current pixel point encoded as the last non-zero coefficient based on the second fixed value.
[0013] In a third aspect, an embodiment of the present application provides a rate-distortion optimization quantization device for video coding, comprising:
[0014] memory and one or more processors;
[0015] The memory is configured to store one or more programs;
[0016] When the one or more programs are executed by the one or more processors, the one or more processors implement the rate-distortion optimized quantization method for video coding as described in the first aspect.
[0017] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are executed by a computer processor, they are configured to perform the rate-distortion optimized quantization method for video coding as described in the first aspect.
[0018] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes instructions. When the instructions are executed on a computer or a processor, the computer or the processor executes the rate-distortion optimization quantization method for video coding as described in the first aspect.
[0019] The embodiment of the present application calculates the optimal quantization coefficient of the current pixel point based on the first fixed value in the entropy coding bit estimation process of rate-distortion optimized quantization, and represents the first bit consumption information required for encoding the current pixel point when the coefficient to be encoded is greater than 1 according to the set first fixed value; and calculates the rate-distortion cost of encoding the current pixel point as the last non-zero coefficient based on the second fixed value according to the set second fixed value. By adopting the above technical means, by choosing to skip some bit consumption estimation steps that have little impact on the encoding quality in the entropy coding bit estimation process of rate-distortion optimized quantization, and using fixed values to represent the bit estimation results, the time consumption of rate-distortion optimized quantization can be shortened while ensuring the encoding quality, and the rate-distortion optimized quantization process can be optimized, thereby improving the video encoding efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] FIG1 is a flow chart of a rate-distortion optimization quantization method for video coding provided by an embodiment of the present application;
[0021] FIG2 is a flow chart of rate-distortion optimization quantization in an embodiment of the present application;
[0022] FIG3 is a flow chart of rate-distortion cost calculation in an embodiment of the present application;
[0023] FIG4 is a schematic structural diagram of a rate-distortion optimized quantization system for video coding provided by an embodiment of the present application;
[0024] FIG5 is a schematic structural diagram of a rate-distortion optimization quantization device for video coding provided in an embodiment of the present application. DETAILED DESCRIPTION
[0025] In order to make the purpose, technical solutions and advantages of the present application clearer, the specific embodiments of the present application are further described in detail below in conjunction with the accompanying drawings. It is understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. It should also be noted that, for ease of description, only parts related to the present application, not all of the contents, are shown in the accompanying drawings. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts describe each operation (or step) as a sequential process, many of the operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of the operations can be rearranged. The process can be terminated when its operation is completed, but can also have additional steps not included in the accompanying drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.
[0026] The rate-distortion optimization quantization method for video coding provided in this application aims to skip some bit consumption estimation steps that have little impact on coding quality in the entropy coding bit estimation process of rate-distortion optimization quantization, and use fixed values to represent the bit estimation results, so as to shorten the time consumption of rate-distortion optimization quantization while ensuring coding quality, and realize the optimization of the rate-distortion optimization quantization process.
[0027] In relevant video coding scenarios, in order to achieve performance gains in video coding, the computational complexity of the coding process is relatively large. For the rate-distortion optimization and quantization process, the entire process takes a long time. However, in specific applications, there are some encoders and coding scenarios that have almost stringent requirements for real-time performance, and due to different services, the characteristics of the sequences to be encoded are also different. For example, videos with intense and irregular movements and videos that are mainly live broadcasts have different effects when using different algorithms. For these scenarios with high real-time requirements for video coding, complex rate-distortion optimization and quantization processes are difficult to meet real-time requirements. Based on this, a rate-distortion optimization and quantization method for video coding in an embodiment of the present application is provided to optimize the rate-distortion optimization and quantization process, improve video coding efficiency, and solve the technical problem that the relevant rate-distortion optimization and quantization schemes take a long time.
[0028] Example:
[0029] FIG1 is a flowchart of a rate-distortion optimization quantization method for video coding provided in an embodiment of the present application. The rate-distortion optimization quantization method for video coding provided in this embodiment can be performed by a rate-distortion optimization quantization device for video coding. The rate-distortion optimization quantization device for video coding can be implemented through software and / or hardware. The rate-distortion optimization quantization device for video coding can be composed of two or more physical entities or a single physical entity. Generally speaking, the rate-distortion optimization quantization device for video coding can be an encoder device, a computer, a mobile phone, a tablet, or other computing device.
[0030] The following description is made by taking the rate-distortion optimization quantization device of the video coding as the main body of the rate-distortion optimization quantization method of the video coding as an example. Referring to FIG1 , the rate-distortion optimization quantization method of the video coding specifically includes:
[0031] S110, in the entropy coding bit estimation process of rate-distortion optimized quantization, according to a set first fixed value representing first bit consumption information required for encoding the current pixel when the coefficient to be encoded is greater than 1, calculating the optimal quantization coefficient of the current pixel based on the first fixed value;
[0032] S120 , calculating the rate-distortion cost of encoding the current pixel as the last non-zero coefficient based on the second fixed value according to the second bit consumption information indicating that the current pixel is marked as the last non-zero bit of the current transform unit.
[0033] In the process of rate-distortion optimization and quantization of video coding, the present application selects and skips some steps of the entropy coding bit estimation process, and selects and skips some bit estimation steps that have little impact on the rate-distortion optimization quantization results and the video coding quality, so as to optimize the rate-distortion optimization quantization process, shorten the time consumption of rate-distortion optimization quantization, and improve video coding efficiency.
[0034] Among them, the rate-distortion optimization quantization algorithm combines the quantization process of video coding with the rate-distortion optimization principle, and uses the RDO (Rate-distortion Optimization) criterion to determine the optimal quantization value of each non-zero coefficient and the position of the last non-zero coefficient, so that the coding distortion is as small as possible while the bit rate meets the target bit rate. In the rate-distortion optimization quantization process, for the accuracy of the results, the coding coefficients of each pixel are respectively set with an entropy coding context environment to calculate the accurate bit rate consumption. Since the entropy coding bit estimation process takes a certain amount of time, the present application has found based on actual tests that omitting some entropy coding bit estimation steps can achieve a better cost-effectiveness, that is, ensuring that the coding quality will not be excessively lost, while optimizing the rate-distortion optimization quantization process and improving coding efficiency. Therefore, the present application adaptively selects the corresponding bit consumption estimation process of the entropy coding bit estimation process and sets its bit consumption estimation result to a fixed value, thereby eliminating the calculation of this part of the bit consumption estimation result and simplifying the rate-distortion optimization quantization process.
[0035] As shown in Figure 2, during rate-distortion optimized quantization, uniform quantization is first performed on each pixel in the transform unit (TU). Candidate quantization values for each pixel's coding coefficient are determined, and the number of non-zero coefficients, numsig, is then counted. If numsig = 0, 0 is returned (the function returns the number of non-zero coefficients). Otherwise, the algorithm continues, determining the preliminary position of the last non-zero coefficient in the TU based on the uniform quantization results. The TU is then divided into several 4x4 unit quantization blocks (CGs), and quantization is performed block by block, starting with the quantization block containing the last non-zero coefficient. The scan order within the quantization block (CG) is determined by the variable scantype, which can be horizontal, vertical, or diagonal. For intra blocks, the variable scantype is related to the angle of intra prediction; for inter blocks, the variable scantype is fixed at diag. Rate-distortion optimized quantization is performed on each quantization block (CG). The rate-distortion cost of different candidate quantization values is first calculated based on the candidate quantization value table. The optimal quantization value is selected, and the data required for sign hiding is then calculated. The context model is then updated to attempt to quantize the current quantization block (CG) to all zeros. If the rate-distortion cost is reduced, the previous optimal quantization value is abandoned and the quantization coefficients are set to all zero. Then, it is determined whether to quantize the transform unit TU to an all-zero block, fine-tune the position of the last non-zero coefficient in each quantization block CG, recalculate the number of non-zero coefficients numsig, and hide the sign as 0.
[0036] During the rate-distortion optimization quantization process, the coding coefficients are first checked for all-zeros. If the transform unit is not all-zero, entropy coding bit estimation begins to determine the optimal quantization coefficients and rate-distortion cost based on the results. Because rate-distortion optimization quantization is computationally intensive, the entropy coding model is pre-read to calculate the approximate bit cost required to encode different symbols.
[0037] Among them, the following four entropy coding contexts need to be estimated:
[0038] Among them, significantBits and significantCoeffGroupBits represent the context of the coding effective bits. Actual tests have shown that they cannot be optimized and have a great impact on the coding quality. GreaterOneBits represents the bit consumption of the pixel point when the coefficient to be coded is greater than 1, that is, the first bit consumption information mentioned above. Experimental verification shows that omitting this part of the bit estimation process and replacing it with a specified value has little effect on the coding quality. Moreover, in the assembly implementation of the code, the processing of this syntax element requires operations such as rearrangement and shuffling, which are not easy to implement in the arm instruction set and have a high delay. Therefore, the embodiment of the present application sets a fixed value to replace the bit consumption information greaterOneBits, and defines the fixed value as the first fixed value to reduce the time consumption of rate-distortion optimization quantization. In addition, lastBits represents the bit consumption required to mark the current pixel point as the last non-zero bit of the current transform unit, that is, the second bit consumption information mentioned above. The entropy coding estimation process of this symbol has little effect on the coding quality, so we omit it. By setting a fixed value to replace the bit consumption information lastBits, the fixed value is defined as the second fixed value.
[0039] Subsequently, the context significantBits and significantCoeffGroupBits of the coding significant bits of the above-mentioned bit estimation operation are directly used, combined with the first fixed value set above (i.e., the first bit consumption information corresponding to greaterOneBits), to calculate the optimal quantization coefficient of the current pixel. Since greaterOneBits has little impact on the final result, it has little impact on the calculation result of the optimal quantization coefficient, and the encoding quality will not be excessively reduced. Similarly, the second fixed value is used to represent the second bit consumption information, and the rate-distortion cost of encoding the current pixel as the last non-zero coefficient is calculated. In this way, the entropy coding bit estimation process can be simplified and the time consumption of rate-distortion optimization quantization can be shortened.
[0040] Exemplarily, by skipping the estimation model loading of the above two parts of bit consumption information during bit estimation and deleting the corresponding data structure, the bits consumed here are directly replaced with 0. This is used for subsequent optimal quantization coefficient calculation and rate-distortion cost calculation, thereby obtaining better encoding acceleration, facilitating assembly acceleration, and reducing unnecessary calculations. It should be noted that in actual applications, based on actual test results, the above-mentioned first bit consumption and second bit consumption information adaptability can be set to corresponding fixed values, which are adaptively determined based on the actual bit consumption information of the test and the actual coding acceleration requirements. The embodiment of the present application does not impose fixed restrictions on the specific bit consumption information values, and they are not described here one by one.
[0041] Specifically, as shown in FIG3 , calculating the rate-distortion cost of encoding the current pixel point as the last non-zero coefficient based on the second fixed value includes:
[0042] S1201, traverse each non-zero pixel point of the current transform unit to determine the estimated bit rate required to encode the current pixel point;
[0043] S1202: Calculate the rate-distortion cost of encoding the current pixel as the last non-zero coefficient based on the estimated bit rate and the second fixed value.
[0044] Based on the second fixed value set above, when subsequently locating the last non-zero coefficient of a transform unit, it is necessary to calculate the rate-distortion cost of encoding the corresponding position of each pixel as the last non-zero coefficient. Therefore, this application uses this second fixed value to calculate the rate-distortion cost of encoding the pixel as the last non-zero coefficient. By determining the estimated bit rate of the current pixel and then combining it with the second fixed value, the rate-distortion cost of encoding the current pixel as the last non-zero coefficient is calculated.
[0045] Determining the estimated bit rate required to encode the current pixel includes:
[0046] Determine the pixel value of the current pixel point, query a pre-built mapping relationship table based on the pixel value, and determine the estimated bit rate required to encode the current pixel point. The mapping relationship table is pre-built based on the mapping relationship between different pixel values and corresponding estimated bit rates.
[0047] Based on the pixel value, a table lookup is used to estimate the bitrate required to encode the current pixel, which is referred to as the estimated bitrate. It's understandable that different pixel values require different bitrates when encoding. By pre-testing the bitrates consumed when encoding different pixel values, a mapping relationship is established. By subsequently querying this mapping relationship, the estimated bitrate required to encode the current pixel can be quickly determined, further improving encoding efficiency.
[0048] The rate-distortion cost of encoding the current pixel as the last non-zero coefficient is calculated based on the estimated bit rate and the second fixed value, including:
[0049] Obtain the set rate-distortion cost influence coefficient and the set coefficient amplification information, determine the initial bit rate consumption information based on the estimated bit rate and the sum of the second fixed value, and calculate the rate-distortion cost of the current pixel point encoded as the last non-zero coefficient based on the initial bit rate consumption information, the rate-distortion cost influence coefficient and the coefficient amplification information.
[0050] Based on the estimated bit rate queried above, the bit consumption information of the lastBits flag (the second fixed value) is added, which is the bit rate consumption of encoding non-zero at the current pixel position, and is defined as the initial bit rate consumption information. Based on this initial bit rate consumption information, combined with the set rate-distortion cost influence coefficient and the set coefficient amplification information, the rate-distortion cost of encoding the current pixel as the last non-zero coefficient can be calculated. In addition, since the original rate-distortion cost calculation process is relatively complicated, the embodiment of the present application simplifies the rate-distortion cost calculation process to further improve the coding efficiency. Among them, the original rate-distortion cost calculation formula is as follows:
[0051] lastCoeffCost=lambda*(IEP_RATE*suffixLen+estBitsSbac.lastBits)>>bitsCostShift
[0052] Among them, lastCoeffCost represents the rate-distortion cost of the current pixel encoded as the last non-zero coefficient, suffixLen is the estimated bit rate of the pixel, estBitsSbac.lastBits is the second bit consumption information of the current pixel marked as the last non-zero bit of the current transform unit, lambda and bitsCostShift are the rate-distortion cost impact coefficients set during the rate-distortion calculation process, and IEP_RATE is the original coefficient amplification information, with a value of 1<<15. Because the entropy coding model calculates the second bit consumption information for accuracy, the result is multiplied by IEP_RATE. Therefore, correspondingly, IEP_RATE needs to be multiplied when calculating the rate-distortion cost.
[0053] Taking into account that the above calculation formula greatly affects the coding complexity, this application optimizes it. Since the second bit consumption information estBitsSbac.lastBits takes the second fixed value, the embodiment of the present application takes the second fixed value as 0, and then uses the estimated bit rate suffixLen of the pixel point as the initial bit rate consumption information to perform rate distortion cost calculation. It can be seen that in the original rate distortion cost calculation formula, there is obvious computational redundancy in multiplying the estimated bit rate suffixLen by IEP_RATE and lambda before right shifting, and the reason is that it is necessary to calculate the entropy coding estimated estBitsSbac.lastBits. In the above, we simplified the entropy coding model of estBitsSbac.lastBits and used the second fixed value as estBitsSbac.lastBits, so the entropy coding bit consumption here is no longer calculated, and therefore, it is no longer necessary to multiply IEP_RATE. It is sufficient to subtract 15 from bitsCostShift, which reduces the amount of calculation and is basically lossless. In addition, the actual bit rate consumption no longer needs to be multiplied by IEP_RATE. By modifying the corresponding rate-distortion calculation formula, the amount of calculation can be significantly reduced, reducing the encoder load. The optimized rate-distortion cost calculation formula is as follows:
[0054] lastcoeffcost=lambda*suffixLen>>(bitscostshift-log2_IEP_RATE)
[0055] After calculating the rate-distortion cost of the current pixel encoded as the last non-zero coefficient based on the second fixed value, the method further includes:
[0056] Starting from the last non-zero pixel of the current transform unit, the non-zero pixel is traversed forward, and the non-zero pixel corresponding to the minimum rate-distortion cost is selected as the last non-zero coefficient position of the current transform unit.
[0057] When locating the last non-zero coefficient, we traverse from the last non-zero pixel in the current transform unit to the beginning, and determine the rate-distortion cost for each non-zero pixel using the rate-distortion cost calculation method described above. The pixel with the lowest rate-distortion cost is then selected as the last non-zero coefficient in the current transform unit.
[0058] Among them, starting from the last non-zero pixel point of the current transformation unit, a set number of non-zero pixels are traversed forward, the minimum cost is determined from the rate-distortion costs corresponding to the set number of non-zero pixels, and the non-zero pixel point corresponding to the minimum cost is used as the last non-zero coefficient position of the current transformation unit.
[0059] For statistical reasons, the last non-zero coefficient of most transform units is more likely to be located at the rear of the block, and the rate-distortion optimization process has already determined whether the pixel point is to be quantized to all zeros at the beginning, so there is no need to traverse all pixels completely. Based on this, the embodiment of the present application traverses up to K non-zero coefficients for each transform unit, and calculates the best last non-zero coefficient point from them. This has minimal impact on the coding quality, can more accurately determine the position of the last non-zero coefficient of the current transform unit, and accelerates the coding efficiency to a certain extent. Optionally, the present application takes a value of 3 for K, starts from the last non-zero pixel point of the current transform unit and traverses 3 pixel points forward, and selects the pixel point with the smallest rate-distortion cost as the last non-zero coefficient position of the current transform unit. According to actual tests, the coding efficiency can be improved while ensuring the coding quality.
[0060] In the above, during the entropy coding bit estimation process of rate-distortion optimized quantization, the first bit consumption information required for encoding the current pixel when the coefficient to be encoded is greater than 1 is represented by a set first fixed value, and the optimal quantization coefficient of the current pixel is calculated based on the first fixed value; the second bit consumption information of marking the current pixel as the last non-zero bit of the current transform unit is represented by a set second fixed value, and the rate-distortion cost of encoding the current pixel as the last non-zero coefficient is calculated based on the second fixed value. By adopting the above technical means, during the entropy coding bit estimation process of rate-distortion optimized quantization, some bit consumption estimation steps that have little impact on the encoding quality are selected to be skipped, and the bit estimation results are represented by fixed values. In this way, the time consumption of rate-distortion optimized quantization can be shortened while ensuring the encoding quality, and the rate-distortion optimized quantization process can be optimized, thereby improving the video encoding efficiency.
[0061] Based on the above embodiment, FIG4 is a schematic diagram of the structure of a rate-distortion optimization quantization system for video coding provided by this application. Referring to FIG4 , the rate-distortion optimization quantization system for video coding provided by this embodiment specifically includes: a first optimization module 21 and a second optimization module 22.
[0062] The first optimization module 21 is configured to skip the bit consumption estimation of the current pixel when the coefficient to be encoded is greater than 1 during the entropy coding bit estimation process of rate-distortion optimized quantization, and calculate the optimal quantization coefficient of the current pixel based on the first fixed value according to the first bit consumption information required for encoding the current pixel when the coefficient to be encoded is greater than 1;
[0063] The second optimization module 22 is configured to skip the bit consumption estimation of the current pixel point being marked as the last non-zero bit of the current transformation unit, and calculate the rate-distortion cost of encoding the current pixel point as the last non-zero coefficient based on the second fixed value according to the second bit consumption information of the current pixel point being marked as the last non-zero bit of the current transformation unit.
[0064] Specifically, calculating the rate-distortion cost of encoding the current pixel as the last non-zero coefficient based on the second fixed value includes:
[0065] Traverse each non-zero pixel point of the current transform unit, determine the estimated bit rate required to encode the current pixel point, and calculate the rate-distortion cost of encoding the current pixel point as the last non-zero coefficient based on the estimated bit rate and a second fixed value.
[0066] Determine the estimated bitrate required to encode the current pixel, including:
[0067] Determine the pixel value of the current pixel point, query a pre-built mapping relationship table based on the pixel value, and determine the estimated bit rate required to encode the current pixel point. The mapping relationship table is pre-built based on the mapping relationship between different pixel values and corresponding estimated bit rates.
[0068] The rate-distortion cost of encoding the current pixel as the last non-zero coefficient is calculated based on the estimated bit rate and the second fixed value, including:
[0069] Obtain the set rate-distortion cost influence coefficient and the set coefficient amplification information, determine the initial bit rate consumption information based on the estimated bit rate and the sum of the second fixed value, and calculate the rate-distortion cost of the current pixel point encoded as the last non-zero coefficient based on the initial bit rate consumption information, the rate-distortion cost influence coefficient and the coefficient amplification information.
[0070] Specifically, after calculating the rate-distortion cost of the current pixel encoded as the last non-zero coefficient based on the second fixed value, the method further includes:
[0071] Starting from the last non-zero pixel of the current transform unit, the non-zero pixel is traversed forward, and the non-zero pixel corresponding to the minimum rate-distortion cost is selected as the last non-zero coefficient position of the current transform unit.
[0072] Starting from the last non-zero pixel of the current transform unit, traverse the non-zero pixels forward and select the non-zero pixel corresponding to the minimum rate-distortion cost as the last non-zero coefficient position of the current transform unit, including:
[0073] Starting from the last non-zero pixel point of the current transform unit, traverse forward a set number of non-zero pixels, determine the minimum cost from the rate-distortion costs corresponding to the set number of non-zero pixels, and use the non-zero pixel point corresponding to the minimum cost as the last non-zero coefficient position of the current transform unit.
[0074] In the above, during the entropy coding bit estimation process of rate-distortion optimized quantization, the first bit consumption information required for encoding the current pixel when the coefficient to be encoded is greater than 1 is represented by a set first fixed value, and the optimal quantization coefficient of the current pixel is calculated based on the first fixed value; the second bit consumption information of marking the current pixel as the last non-zero bit of the current transform unit is represented by a set second fixed value, and the rate-distortion cost of encoding the current pixel as the last non-zero coefficient is calculated based on the second fixed value. By adopting the above technical means, during the entropy coding bit estimation process of rate-distortion optimized quantization, some bit consumption estimation steps that have little impact on the encoding quality are selected to be skipped, and the bit estimation results are represented by fixed values. In this way, the time consumption of rate-distortion optimized quantization can be shortened while ensuring the encoding quality, and the rate-distortion optimized quantization process can be optimized, thereby improving the video encoding efficiency.
[0075] The rate-distortion optimized quantization system for video coding provided in the embodiments of the present application can be configured to execute the rate-distortion optimized quantization method for video coding provided in the above embodiments, and has corresponding functions and beneficial effects.
[0076] Based on the above practical example, an embodiment of the present application further provides a rate-distortion optimization and quantization device for video coding, with reference to FIG. The rate-distortion optimization and quantization device for video coding includes: a processor, a memory, a communication module, an input device, and an output device. The memory, as a computer-readable storage medium, can be configured to store software programs, computer-executable programs, and modules, such as program instructions / modules corresponding to the rate-distortion optimization and quantization method for video coding described in any embodiment of the present application (e.g., the first optimization module and the second optimization module in the rate-distortion optimization and quantization system for video coding). The communication module is configured to perform data transmission. The processor executes the software programs, instructions, and modules stored in the memory to execute various functional applications and data processing of the device, thereby implementing the rate-distortion optimization and quantization method for video coding described above. The input device can be configured to receive input digital or character information and generate key signal input related to user settings and function control of the device. The output device can include a display device such as a display screen. The rate-distortion optimization and quantization device for video coding provided above can be configured to execute the rate-distortion optimization and quantization method for video coding provided in the above embodiments, and has corresponding functions and beneficial effects.
[0077] Based on the above embodiments, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a computer processor, the computer-executable instructions are configured to execute a rate-distortion optimization quantization method for video coding. The storage medium can be any of various types of memory devices or storage devices. Of course, the computer-executable instructions of the computer-readable storage medium provided in the embodiment of the present application are not limited to the rate-distortion optimization quantization method for video coding described above, and can also execute related operations in the rate-distortion optimization quantization method for video coding provided in any embodiment of the present application.
[0078] Based on the above embodiments, the embodiments of the present application also provide a computer program product. The technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer program product is stored in a storage medium and includes a number of instructions for enabling a computer device, a mobile terminal, or a processor therein to execute all or part of the steps of the rate-distortion optimization quantization method for video coding described in each embodiment of the present application.
Claims
1. A rate-distortion optimization quantization method for video coding, characterized in that: include: In the entropy coding bit estimation process of rate-distortion optimized quantization, a first fixed value is set to represent first bit consumption information required for encoding the current pixel when the coefficient to be encoded is greater than 1, and an optimal quantization coefficient of the current pixel is calculated based on the first fixed value; The second bit consumption information indicating that the current pixel is marked as the last non-zero bit of the current transform unit according to the set second fixed value is calculated based on the second fixed value for encoding the current pixel as the last non-zero coefficient.
2. The rate-distortion optimization quantization method for video coding according to claim 1, characterized in that: Calculating the rate distortion cost of encoding the current pixel point as the last non-zero coefficient based on the second fixed value includes: Traversing each non-zero pixel of the current transform unit to determine an estimated bit rate required to encode the current pixel; A rate-distortion cost of encoding the current pixel point as the last non-zero coefficient is calculated based on the estimated bit rate and the second fixed value.
3. The rate-distortion optimization quantization method for video coding according to claim 2, characterized in that: The determining of the estimated bit rate required for encoding the current pixel point includes: Determine the pixel value of the current pixel point, query a pre-constructed mapping relationship table based on the pixel value, and determine the estimated bit rate required for encoding the current pixel point. The mapping relationship table is pre-constructed according to the mapping relationship between different pixel values and corresponding estimated bit rates.
4. The rate-distortion optimization quantization method for video coding according to claim 2, characterized in that: Calculating a rate-distortion cost of encoding the current pixel point as the last non-zero coefficient based on the estimated bit rate and the second fixed value, including: Obtain the set rate-distortion cost influence coefficient and the set coefficient amplification information, determine the initial bit rate consumption information according to the sum of the estimated bit rate and the second fixed value, and calculate the rate-distortion cost of the current pixel point encoded as the last non-zero coefficient based on the initial bit rate consumption information, the rate-distortion cost influence coefficient and the coefficient amplification information.
5. The rate-distortion optimization quantization method for video coding according to claim 1, characterized in that: After calculating the rate-distortion cost of the current pixel encoded as the last non-zero coefficient based on the second fixed value, the method further includes: Starting from the last non-zero pixel point of the current transform unit, the non-zero pixel point corresponding to the rate-distortion cost with the smallest value is selected as the last non-zero coefficient position of the current transform unit. Set.
6. The rate-distortion optimization quantization method for video coding according to claim 5, characterized in that: The step of traversing non-zero pixels forward from the last non-zero pixel of the current transformation unit and selecting a non-zero pixel corresponding to the rate-distortion cost with the smallest value as the last non-zero coefficient position of the current transformation unit includes: Starting from the last non-zero pixel point of the current transformation unit, a set number of non-zero pixel points are traversed forward, a minimum cost is determined from the rate-distortion costs corresponding to the set number of non-zero pixel points, and the non-zero pixel point corresponding to the minimum cost is used as the last non-zero coefficient position of the current transformation unit.
7. A rate-distortion optimized quantization system for video coding, characterized in that: include: A first optimization module is configured to calculate an optimal quantization coefficient of the current pixel point based on a first fixed value set to represent first bit consumption information required for encoding the current pixel point when the coefficient to be encoded is greater than 1 during the entropy coding bit estimation process of rate-distortion optimization quantization; The second optimization module is configured to represent the second bit consumption information of marking the current pixel point as the last non-zero bit of the current transformation unit according to the set second fixed value, and calculate the rate-distortion cost of encoding the current pixel point as the last non-zero coefficient based on the second fixed value.
8. A rate-distortion optimized quantization device for video coding, characterized in that: include: memory and one or more processors; The memory is configured to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the rate-distortion optimized quantization method for video coding as described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a computer processor, they are configured to execute the rate-distortion optimized quantization method for video coding according to any one of claims 1-6.
10. A computer program product, characterized in that The computer program product includes instructions, and when the instructions are executed on a computer or a processor, the computer or the processor executes the rate-distortion optimized quantization method for video coding as claimed in any one of claims 1 to 6.
Citation Information
Patent Citations
Improved transformation coefficient sign data hiding method based on recovered transformation coefficient
CN105898300A
Video and audio coding hard decision quantification method based on context adaptive displacement model
CN107257461A
Code rate estimation method and fast mode decision-making method based on code rate estimation
CN110418131A
VVC fast code rate estimation method based on statistical modeling
CN115174918A
Rate distortion optimization quantization method, device, equipment and storage medium
CN115334306A
Cited By
Code rate estimation device and method, video encoder, electronic equipment, storage medium and computer program product
CN121309820A
A code rate estimation apparatus and method, a video encoder, an electronic device, a storage medium and a computer program product
CN121309820B