A code rate estimation apparatus and method, a video encoder, an electronic device, a storage medium and a computer program product
By pre-calculating and storing the bitrate estimation reference information of the residual block in the video encoder, the problem of large bitrate estimation delay in the prior art is solved, and more efficient bitrate estimation and fast processing of coding units are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- MOORE THREADS TECH CO LTD
- Filing Date
- 2025-10-30
- Publication Date
- 2026-04-10
AI Technical Summary
The bitrate estimation device in existing video encoders needs to wait for the relevant information of all residual blocks in the coding unit to be obtained before it can perform bitrate estimation, resulting in a large delay and affecting the performance of the video encoder.
A rate estimation device is provided, which calculates and stores rate estimation reference information of residual blocks in coding units through a parameter determination module, and performs rate estimation of residual blocks under advance conditions, including two cases: whether each residual block is the last non-zero residual block, thereby reducing the amount of stored data and computation latency.
It effectively accelerates the bitrate estimation process of the coding unit, reduces the amount of stored data and computational latency, and improves the coding efficiency of the video encoder.
Smart Images

Figure CN121309820B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of computer, and particularly relates to a code rate estimation device and method, a video encoder, an electronic device, a storage medium and a computer program product. BACKGROUND
[0002] In order to improve the coding quality of a video encoder, in the rate-distortion optimization process, in order to obtain more accurate code rate information, a code rate estimation method of context-adaptive binary arithmetic coding (CABAC) needs to be used. In the entropy coding scheme of a high efficiency video coding (HEVC) encoder, the CABAC code rate estimation method can obtain higher compression efficiency.
[0003] In the CABAC code rate estimation process, there is a calculation dependency relationship between each residual block in each coding unit. The residual block in the upper left part of the coding unit needs to depend on the residual block in the lower right part, and the residual block in the upper left part needs to wait for the calculation result of the residual block in the lower right part to be completed before starting calculation. In the prior art, the code rate estimation device in the video encoder needs to wait for the related information of all residual blocks in the coding unit to be obtained before starting the code rate estimation of the coding unit, which leads to a large code rate estimation delay, and further affects the performance of the video encoder. SUMMARY
[0004] Therefore, the present disclosure provides a code rate estimation device and method, a video encoder, an electronic device, a storage medium and a computer program product.
[0005] According to an aspect of the present disclosure, a code rate estimation device is provided, comprising: a parameter determination module configured to calculate and store code rate estimation reference information corresponding to residual blocks in a coding unit; and a code rate estimation module configured to, for any one residual block, perform code rate estimation on the residual block under an early code rate estimation condition after the parameter determination module stores code rate estimation reference information of residual blocks on which the residual block depends for performing code rate estimation, wherein the early code rate estimation condition includes two cases of whether each residual block is the last non-zero residual block.
[0006] In a possible implementation, the parameter determination module is specifically configured to: for any one residual block in the coding unit, calculate and store code rate estimation reference information corresponding to the residual block according to the size of residual coefficients in the residual block, wherein different types of code rate estimation reference information correspond to different sizes of residual coefficients.
[0007] In a possible implementation, the parameter determination module comprises: a B code rate parameter determination submodule, configured to, for any one residual block in the coding unit, calculate and store B code rate estimation reference information corresponding to the residual block according to whether the residual block contains a non-zero residual coefficient; a C code rate parameter determination submodule, configured to, for any one residual block in the coding unit, calculate and store C code rate estimation reference information corresponding to the residual block according to whether each residual coefficient in the residual block is zero; a D code rate parameter determination submodule, configured to, for any one residual block in the coding unit, determine D code rate estimation reference information corresponding to the residual block according to the first N non-zero residual coefficients in the residual block, wherein N is a positive integer; and an E code rate parameter determination submodule, configured to, for any one residual block in the coding unit, determine E code rate estimation reference information corresponding to the residual block according to the first residual coefficient greater than 1 in the residual block.
[0008] In a possible implementation, the code rate estimation module is specifically configured to: for any one residual block, perform B code rate estimation on whether the residual block contains a non-zero residual coefficient according to B code rate estimation reference information of a residual block relied on by the residual block to perform code rate estimation, to determine a B code rate estimation value of the residual block; in a case where the early code rate estimation condition is that each residual block is not the last non-zero residual block, perform C1 code rate estimation on whether each residual coefficient in the residual block is zero according to C code rate estimation reference information of a residual block relied on by the residual block to perform code rate estimation, to determine a C1 code rate estimation value of the residual block; and in a case where the early code rate estimation condition is that each residual block is the last non-zero residual block, perform C2 code rate estimation on the last residual coefficient to the last non-zero residual coefficient in the residual block according to C code rate estimation reference information of a residual block relied on by the residual block to perform code rate estimation, to determine a C2 code rate estimation value of the residual block.
[0009] In a possible implementation, the code rate estimation module is specifically configured to: for any one residual block, perform B code rate estimation on whether the residual block contains a non-zero residual coefficient according to B code rate estimation reference information of a residual block relied on by the residual block to perform code rate estimation, to determine a B code rate estimation value of the residual block; in a case where the early code rate estimation condition is that each residual block is not the last non-zero residual block, perform C1 code rate estimation on whether each residual coefficient in the residual block is zero according to C code rate estimation reference information of a residual block relied on by the residual block to perform code rate estimation, to determine a C1 code rate estimation value of the residual block; and in a case where the early code rate estimation condition is that each residual block is the last non-zero residual block, perform C2 code rate estimation on the last residual coefficient to the last non-zero residual coefficient in the residual block according to C code rate estimation reference information of a residual block relied on by the residual block to perform code rate estimation, to determine a C2 code rate estimation value of the residual block.
[0010] In a possible implementation, the apparatus further includes: a first accumulator configured to accumulate the B-rate estimation value of each residual block to obtain an initial B-rate estimation value of the coding unit; and a second accumulator configured to accumulate the C1-rate estimation value of each residual block to obtain an initial C-rate estimation value of the coding unit.
[0011] In a possible implementation, the rate estimation module is further configured to: perform F-rate estimation on the sign bits of the non-zero residual coefficients in any one residual block to determine an F-rate estimation value of the residual block; and perform G-rate estimation on the residual remainder values of all the residual coefficients in the residual block to determine a G-rate estimation value of the residual block.
[0012] In a possible implementation, the apparatus further includes: a third accumulator configured to accumulate the F-rate estimation value of each residual block to obtain a target F-rate estimation value of the coding unit; and a fourth accumulator configured to accumulate the G-rate estimation value of each residual block to obtain a target G-rate estimation value of the coding unit.
[0013] In a possible implementation, the rate estimation module is further configured to: after storing the rate estimation reference information of each residual block in the coding unit in the parameter determination module, determine an input index of a last non-zero residual block in the coding unit.
[0014] In a possible implementation, the rate estimation module is further configured to: perform A-rate estimation on a position of a last non-zero residual coefficient in the last non-zero residual block to determine a target A-rate estimation value of the coding unit; perform D-rate estimation on the first N non-zero residual coefficients in each residual block with an input index less than or equal to the last non-zero residual block according to D-rate estimation reference information of residual blocks relied on by the rate estimation of the residual block to determine a D-rate estimation value of the residual block; and perform E-rate estimation on a first residual coefficient greater than 1 in each residual block with an input index less than or equal to the last non-zero residual block according to E-rate estimation reference information of residual blocks relied on by the rate estimation of the residual block to determine an E-rate estimation value of the residual block.
[0015] In a possible implementation, the apparatus further includes: a fifth accumulator configured to accumulate the D-rate estimation value of each residual block with an input index less than or equal to the last non-zero residual block to obtain a target D-rate estimation value of the coding unit; and a sixth accumulator configured to accumulate the E-rate estimation value of each residual block with an input index less than or equal to the last non-zero residual block to obtain a target E-rate estimation value of the coding unit.
[0016] In a possible implementation, the apparatus further includes a first subtractor configured to subtract the B-rate estimation value of each residual block with an input index greater than the last non-zero residual block from the initial B-rate estimation value of the coding unit to obtain a target B-rate estimation value of the coding unit; and a second subtractor configured to subtract the C2-rate estimation value of each residual block with an input index greater than the last non-zero residual block from the initial C-rate estimation value of the coding unit to obtain a target C-rate estimation value of the coding unit.
[0017] In a possible implementation, the apparatus further includes a seventh adder configured to add the target A-rate estimation value, the target B-rate estimation value, the target C-rate estimation value, the target D-rate estimation value, the target E-rate estimation value, the target F-rate estimation value, and the target G-rate estimation value to determine the target rate estimation value of the coding unit.
[0018] According to another aspect of the present disclosure, a rate estimation method is provided, including: calculating and storing rate estimation reference information corresponding to residual blocks in a coding unit; and performing rate estimation on any one of the residual blocks under an early rate estimation condition after storing rate estimation reference information of residual blocks on which rate estimation of the any one of the residual blocks depends, wherein the early rate estimation condition includes two cases of whether each residual block is the last non-zero residual block.
[0019] According to another aspect of the present disclosure, a video encoder is provided, including the rate estimation apparatus.
[0020] According to another aspect of the present disclosure, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement steps of the method.
[0021] According to another aspect of the present disclosure, a non-volatile computer readable storage medium is provided, which stores a computer program, wherein the computer program is executed by a processor to implement steps of the method.
[0022] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, or a non-volatile computer readable storage medium carrying the computer program, wherein the computer program is executed by a processor to implement steps of the method.
[0023] The code rate estimation device of the embodiment of the present disclosure, the parameter determination module calculates and stores the code rate estimation reference information corresponding to the residual blocks in the coding unit; for any one residual block, as long as the parameter determination module stores the code rate estimation reference information of the residual blocks relied on by the residual block for performing code rate estimation, the code rate estimation module can start to perform code rate estimation on the residual block under the early code rate estimation conditions including whether each residual block is the last non-zero residual block, without waiting for the code rate estimation reference information of all residual blocks to be obtained before starting code rate estimation, thereby effectively accelerating the code rate estimation process of the coding unit.
[0024] Other features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments, taken in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF DRAWINGS
[0025] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate exemplary embodiments, features, and aspects of the present disclosure and serve to explain the principles of the present disclosure.
[0026] Figure 1 A schematic diagram of a code rate estimation in the prior art is shown.
[0027] Figure 2 A block diagram of a code rate estimation device according to an embodiment of the present disclosure is shown.
[0028] Figure 3 A schematic diagram of a code rate estimation according to an embodiment of the present disclosure is shown.
[0029] Figure 4 A flowchart of a code rate estimation method according to an embodiment of the present disclosure is shown.
[0030] Figure 5 A block diagram of an electronic device according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0031] Various exemplary embodiments, features, and aspects of the present disclosure will be explained in detail below with reference to the accompanying drawings. The same reference numbers in the drawings indicate the same or similar elements throughout the several drawings. The drawings are not necessarily drawn to scale, unless specifically noted.
[0032] As used herein, the terms "comprises", "comprising", "includes", "including", "has", "having", or variants thereof are open-ended, and include one or more stated features, integers, elements, steps, components or functions but do not preclude the presence or addition of one or more other features, integers, elements, steps, components, functions or groups thereof.
[0033] When an element is referred to as being "connected", "coupled", "responsive", or "in communication" with, to another element, it can be directly connected, coupled, responsive, or in communication with the other element or intervening elements can be present.
[0034] Although the terms first, second, third, etc. can be used herein to describe various elements / operation, these elements / operation should not be limited by these terms. These terms are only used to distinguish one element / operation from another element / operation. Thus, a first element / operation in some embodiments could be termed a second element / operation in other embodiments without departing from the teachings of the present inventive concept.
[0035] The word "exemplary" is used herein to mean "serving as an example, instance, or illustration." Any implementation described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other implementations.
[0036] In addition, for the purpose of convenience and brevity, detailed descriptions of well-known functions and structures incorporated in the disclosure can be omitted. It will be appreciated that those skilled in the art will be able to devise various modes of implementing the application without the benefits of these particulars. In some instances, well-known methods, structures, elements, and circuits have not been described in detail in order to avoid obscuring the point of the present disclosure.
[0037] The CABAC rate estimation method needs to go through the calculation process of binarization, context modeling, and binary arithmetic coding. Binarization refers to converting non-binary syntax elements into binary strings, and each binary bit is called a bin. According to the position and context of each bin, a probability model is selected for the current bin, which can give the probability estimation of the current bin being 0 or 1. Finally, according to the probability provided by the probability model of each bin, each bin in the binary string is gradually arithmetically coded to compress the data into a shorter bit stream.
[0038] The CABAC rate estimation method has high computational complexity, slow encoding speed, and high difficulty in hardware implementation and power consumption. However, the rate estimation of the CABAC rate estimation method is more accurate, which can improve the mode decision accuracy of rate distortion optimization, and further improve the encoding quality of the video encoder.
[0039] In the rate estimation process, each residual block in the coding unit is input into the rate estimation device according to a preset scanning order, and then the rate estimation of each residual block is performed according to the inverse scanning order. In the rate estimation process, there is a calculation dependency relationship between each residual block in each coding unit, and the upper left part of the residual block depends on the lower right part of the residual block. The upper left part of the residual block needs to wait for the calculation result of the lower right part of the residual block to be completed before starting calculation.
[0040] In the process of estimating the code rate of a coding unit based on the CABAC code rate estimation method, the following information needs to be calculated:
[0041] The A-rate estimate of the position of the last non-zero residual coefficient in the coding unit;
[0042] Does each residual block in the coding unit contain a B-rate estimate of non-zero residual coefficients?
[0043] The C-rate estimate of whether each residual coefficient in each residual block of the coding unit is zero;
[0044] The D-rate estimate of the first N non-zero residual coefficients in each residual block of the coding unit;
[0045] The E-rate estimate of the first residual coefficient greater than 1 in each residual block of the coding unit;
[0046] The F-rate estimate of the sign bits of the non-zero residual coefficients in each residual block of the coding unit;
[0047] The G-rate estimate of the residual residual values of all residual coefficients in each residual block of the coding unit.
[0048] Figure 1 This diagram illustrates a bitrate estimation method in the prior art. (For example...) Figure 1 As shown, the first step is the input storage procedure for each residual block in the coding unit. One residual block is input and stored each time according to the preset scanning order. The input order of the residual blocks is not equal to the computational dependency order of the residual blocks in the rate estimation process. Therefore, it is necessary to store all residual blocks in the coding unit.
[0049] In one example, a 4×4 residual block contains 16 residual coefficients. Assuming each residual coefficient has a bit width of 16 bits, the 4×4 residual block contains 256 bits of residual coefficients. A 32×32 coding unit contains 64 4×4 residual blocks, requiring the storage of 64×256 bits of residual coefficients; a 16×16 coding unit contains 16 4×4 residual blocks, requiring the storage of 16×256 bits of residual coefficients; and an 8×8 coding unit contains 4 4×4 residual blocks, requiring the storage of 4×256 bits of residual coefficients.
[0050] like Figure 1As shown in FIG. 2, the second step is a code rate estimation preparation process. For any one residual block, since the code rate estimation process of the residual block performing B-E code rate estimation needs to rely on the relevant information of the residual blocks input before the residual block in the preset scan order, the residual block performing B-E code rate estimation needs B-E code rate estimation preparation; the code rate estimation process of the residual block performing A code rate estimation needs to rely on all the residual blocks in the coding unit; the code rate estimation process of the residual block performing F-G code rate estimation only relies on the residual block itself.
[0051] As shown in FIG. 3, the third step is a code rate estimation process. When the storage of the residual coefficients of all the residual blocks in the coding unit is completed, the A-G code rate estimation values of each residual block are determined in the reverse scan order of the preset scan order, and then the A-G code rate estimation values of each residual block are accumulated by using an accumulator to obtain the code rate estimation value of each residual block, so as to obtain the code rate estimation values of all the residual blocks in the coding unit. Finally, the code rate estimation values of all the residual blocks in the coding unit are accumulated to obtain the code rate estimation value of the coding unit. Figure 1 The CABAC code rate estimation process in the prior art needs to wait until the relevant information of all the residual blocks in the coding unit is obtained before starting the B-E code rate estimation of each residual block in the coding unit, which causes a large delay in the code rate estimation of the coding unit. In addition, since the calculation processes of B code rate estimation and C code rate estimation are complex, the B code rate estimation and the C code rate estimation have a great impact on the calculation delay.
[0052] To solve the above technical problems, the embodiment of the present disclosure provides a code rate estimation device which can effectively accelerate the code rate estimation process of the coding unit in the CABAC code rate estimation process.
[0053]
[0054] A block diagram of a code rate estimation device provided by the embodiment of the present disclosure is shown in FIG. 4. As shown in FIG. 4, the device 20 includes: a parameter determination module 21 configured to calculate and store the code rate estimation reference information corresponding to the residual blocks in the coding unit; and a code rate estimation module 22 configured to, for any one residual block, perform code rate estimation on the residual block under the early code rate estimation condition after the code rate estimation reference information of the residual blocks relied on by the residual block performing code rate estimation is stored in the parameter determination module 21, wherein the early code rate estimation condition includes two cases of whether each residual block is the last non-zero residual block. Figure 2 Figure 2
[0055] The rate estimation device of the embodiment of the present disclosure, the parameter determination module calculates and stores the rate estimation reference information corresponding to the residual block in the coding unit; for any one residual block, as long as the parameter determination module stores the rate estimation reference information of the residual block on which the rate estimation of the residual block depends, the rate estimation module can start the rate estimation of the residual block according to the early rate estimation conditions including whether each residual block is the last non-zero residual block, without waiting for the rate estimation reference information of all residual blocks to be obtained before starting the rate estimation, thereby effectively accelerating the rate estimation process of the coding unit.
[0056] In a possible implementation, the rate estimation device 20 further includes an input module configured to receive each residual block in the coding unit.
[0057] Figure 3 A schematic diagram of rate estimation according to an embodiment of the present disclosure is shown. As shown in the figure, first, each residual block in the coding unit is input according to a preset scanning order. The specific process of inputting each residual block in the coding unit into the rate estimation device according to the preset scanning order can refer to related technologies, and the present disclosure does not make specific limitations thereto. Figure 3
[0058] The preset scanning order can indicate the input index of each residual block in the coding unit, and the input index of each residual block can be different under different preset scanning orders. The preset scanning order can be a horizontal order or a vertical order, and the present disclosure does not make specific limitations thereto.
[0059] Based on the input module, each residual block in the coding unit is input according to the preset scanning order. After the input module receives a residual block, the parameter determination module starts to calculate and store the rate estimation reference information corresponding to the residual block. Compared with the prior art which needs to store each residual block itself, the embodiment of the present disclosure only stores the rate estimation reference information corresponding to each residual block, which can effectively reduce the amount of data to be stored for rate estimation.
[0060] In a possible implementation, the parameter determination module 21 is specifically configured to: for any one residual block in the coding unit, calculate and store the rate estimation reference information corresponding to the residual block according to the size of the residual coefficient in the residual block, wherein the size of the residual coefficient corresponding to different types of rate estimation reference information is different.
[0061] For any one residual block in the coding unit, the rate estimation reference information corresponding to the residual block is calculated and stored according to the size of the residual coefficient in the residual block, so that other residual blocks which need to rely on the residual block for rate estimation can sequentially obtain the rate estimation reference information corresponding to the residual block to complete the rate estimation.
[0062] Since the B-E rate estimation both need the dependency between residual blocks, for any one residual block, the different types of rate estimation reference information are determined to adapt to the B-E rate estimation. According to the specific difference of the B-E rate estimation, the size of the residual coefficients corresponding to the different types of rate estimation reference information is different.
[0063] In a possible implementation, the parameter determination module 21 includes: a B rate parameter determination submodule, configured to, for any one residual block in the coding unit, calculate and store the B rate estimation reference information corresponding to the residual block according to whether the residual block contains non-zero residual coefficients; a C rate parameter determination submodule, configured to, for any one residual block in the coding unit, calculate and store the C rate estimation reference information corresponding to the residual block according to whether each residual coefficient in the residual block is zero; a D rate parameter determination submodule, configured to, for any one residual block in the coding unit, determine the D rate estimation reference information corresponding to the residual block according to the first N non-zero residual coefficients in the residual block, wherein N is a positive integer; and an E rate parameter determination submodule, configured to, for any one residual block in the coding unit, determine the E rate estimation reference information corresponding to the residual block according to the first residual coefficient greater than 1 in the residual block.
[0064] As shown in FIG. 6, after receiving any one input residual block, the B rate parameter determination submodule starts to calculate and store the B rate estimation reference information corresponding to the residual block according to whether the residual block contains non-zero residual coefficients. Figure 3
[0065] Taking the 4x4 residual block including 16 residual coefficients, each of which has a bit width of 16 bits, as an example. The B rate parameter determination submodule traverses the 16 residual coefficients in the 4x4 residual block, and marks the B rate estimation reference information as 1 when the 4x4 residual block includes non-zero residual coefficients, and marks the B rate estimation reference information as 0 when the 4x4 residual block does not include non-zero residual coefficients. Therefore, compared with the 256 bits of residual coefficients that need to be stored for the 4x4 residual block itself, the B rate parameter determination submodule only needs to store the 1-bit B rate estimation reference information corresponding to the 4x4 residual block, effectively reducing the amount of data that needs to be stored for subsequent B rate estimation.
[0066] As shown in FIG. 7, after receiving any one input residual block, the C rate parameter determination submodule starts to calculate and store the C rate estimation reference information corresponding to the residual block according to whether each residual coefficient in the residual block is zero. Figure 3
[0067] For example, the 4x4 residual block includes 16 residual coefficients, and each residual coefficient has a bit width of 16 bits. The C-rate parameter determination submodule traverses the 16 residual coefficients in the 4x4 residual block, marks the C-rate estimation reference information as 1 for a non-zero residual coefficient in the 4x4 residual block, and marks the C-rate estimation reference information as 0 for a zero residual coefficient. Therefore, compared with the 256 bits of residual coefficients that need to be stored for the 4x4 residual block itself, the C-rate parameter determination submodule only needs to store 16 bits of C-rate estimation reference information corresponding to the 4x4 residual block, effectively reducing the amount of data that needs to be stored for subsequent C-rate estimation.
[0068] As shown in FIG. 6, after receiving any one of the input residual blocks, the D-rate parameter determination submodule starts to calculate and store the D-rate estimation reference information corresponding to the residual block according to the first N non-zero residual coefficients in the residual block. The specific value of N can be flexibly set according to actual conditions, and the present disclosure does not make a specific limitation thereon. For example, under the CABAC rate method of the HEVC video coding standard, the residual block size is 4x4, and N = 8. Figure 3 For example, the 4x4 residual block includes 16 residual coefficients, and each residual coefficient has a bit width of 16 bits. The D-rate parameter determination submodule traverses the 16 residual coefficients in the 4x4 residual block, determines the first 8 non-zero residual coefficients among the 16 residual coefficients, and then marks the D-rate estimation reference information as 1 for any one of the first 8 non-zero residual coefficients when the non-zero residual coefficient is greater than 1, and marks the D-rate estimation reference information as 0 when the non-zero residual coefficient is equal to 1. Therefore, compared with the 256 bits of residual coefficients that need to be stored for the 4x4 residual block itself, the D-rate parameter determination submodule only needs to store 8 bits of D-rate estimation reference information corresponding to the 4x4 residual block, effectively reducing the amount of data that needs to be stored for subsequent D-rate estimation.
[0069] As shown in FIG. 6, after receiving any one of the input residual blocks, the D-rate parameter determination submodule starts to calculate and store the D-rate estimation reference information corresponding to the residual block according to the first N non-zero residual coefficients in the residual block. The specific value of N can be flexibly set according to actual conditions, and the present disclosure does not make a specific limitation thereon. For example, under the CABAC rate method of the HEVC video coding standard, the residual block size is 4x4, and N = 8.
[0070] Figure 3 As shown in FIG. 6, after receiving any one of the input residual blocks, the D-rate parameter determination submodule starts to calculate and store the D-rate estimation reference information corresponding to the residual block according to the first N non-zero residual coefficients in the residual block. The specific value of N can be flexibly set according to actual conditions, and the present disclosure does not make a specific limitation thereon. For example, under the CABAC rate method of the HEVC video coding standard, the residual block size is 4x4, and N = 8.
[0071] The 16 residual coefficients in the 4x4 residual block are taken as an example, and the bit width of each residual coefficient is 16 bits. The E-rate parameter determination submodule traverses the 16 residual coefficients in the 4x4 residual block, determines the first residual coefficient greater than 1 in the 4x4 residual block, and marks the E-rate estimation reference information as 1 when the first residual coefficient greater than 1 is greater than 2, and marks the E-rate estimation reference information as 0 when the first residual coefficient greater than 1 is equal to 2. Therefore, compared with the 256 bits of residual coefficients that need to be stored in the 4x4 residual block itself, the E-rate parameter determination submodule only needs to store the 1-bit E-rate estimation reference information corresponding to the 4x4 residual block, effectively reducing the amount of data that needs to be stored for subsequent E-rate estimation.
[0072] The 32x32 coding unit includes 64 4x4 residual blocks, and the B-rate estimation reference information (1x64=64 bits), the C-rate estimation reference information (16x64=1024 bits), the D-rate estimation reference information (8x64=512 bits), and the E-rate estimation reference information (1x64=64 bits) corresponding to the 64 4x4 residual blocks need to be stored. A total of 1664 bits of rate estimation reference information need to be stored. Compared with the 64x256=16384 bits of residual coefficients that need to be stored in the 32x32 coding unit in the prior art, only about one tenth of the data amount needs to be stored, which can effectively reduce the amount of data that needs to be stored.
[0073] The 16x16 coding unit includes 16 4x4 residual blocks, and the B-rate estimation reference information (1x16=16 bits), the C-rate estimation reference information (16x16=256 bits), the D-rate estimation reference information (8x16=128 bits), and the E-rate estimation reference information (1x16=16 bits) corresponding to the 16 4x4 residual blocks need to be stored. A total of 416 bits of rate estimation reference information need to be stored. Compared with the 16x256=4096 bits of residual coefficients that need to be stored in the 16x16 coding unit in the prior art, only about one tenth of the data amount needs to be stored, which can effectively reduce the amount of data that needs to be stored.
[0074] The 8x8 coding unit includes 4 4x4 residual blocks, and the B-rate estimation reference information (1x4=4 bits), the C-rate estimation reference information (16x4=64 bits), the D-rate estimation reference information (8x4=32 bits), and the E-rate estimation reference information (1x4=16 bits) corresponding to the 4 4x4 residual blocks need to be stored. A total of 104 bits of rate estimation reference information need to be stored. Compared with the 4x256=1024 bits of residual coefficients that need to be stored in the 8x8 coding unit in the prior art, only about one tenth of the data amount needs to be stored, which can effectively reduce the amount of data that needs to be stored.
[0075] In one possible implementation, the rate estimation module 22 is further configured to: perform F rate estimation on the sign bits of the non-zero residual coefficients in any input residual block to determine the F rate estimate of the residual block; and perform G rate estimation on the residual residual values of all residual coefficients in the residual block to determine the G rate estimate of the residual block.
[0076] The rate estimation process, which performs F-rate estimation and G-rate estimation for each residual block in the coding unit, depends only on the residual block itself. Therefore, upon receiving any input residual block, the rate estimation module can immediately perform F-rate estimation on the sign bits of the non-zero residual coefficients in the residual block to determine the F-rate estimate of the residual block; and perform G-rate estimation on the residual values of all residual coefficients in the residual block to determine the G-rate estimate of the residual block.
[0077] For any received input residual block, the B rate parameter determination submodule, C rate parameter determination submodule, D rate parameter determination submodule, E rate parameter determination submodule, and rate estimation module can calculate the BE rate estimation reference information and FG rate estimation for the residual block in parallel. After calculating and storing the BE rate estimation reference information, F rate estimation value, and G rate estimation value for the residual block, the residual block is deleted.
[0078] In one possible implementation, the apparatus 20 further includes: a third accumulator for accumulating the F-rate estimate of each residual block to obtain the target F-rate estimate of the coding unit; and a fourth accumulator for accumulating the G-rate estimate of each residual block to obtain the target G-rate estimate of the coding unit.
[0079] The F-rate estimate of each residual block determined by the rate estimation module can be accumulated in the third accumulator to finally obtain the target F-rate estimate of the coding unit; the G-rate estimate of each residual block determined by the rate estimation module can be accumulated in the fourth accumulator to finally obtain the target G-rate estimate of the coding unit.
[0080] like Figure 3 As shown, the rate estimation device also includes a third accumulator and a fourth accumulator. The third accumulator accumulates the F rate estimate for each residual block, and the fourth accumulator accumulates the G rate estimate for each residual block.
[0081] In a possible implementation, the code rate estimation module is configured to: for any one residual block, when the early code rate estimation condition is that each residual block is not the last non-zero residual block, determine a first code rate estimation result of the residual block according to the code rate estimation reference information of the residual block on which the code rate estimation of the residual block depends; when the early code rate estimation condition is that each residual block is the last non-zero residual block, determine a second code rate estimation result of the residual block according to the code rate estimation reference information of the residual block on which the code rate estimation of the residual block depends; and determine a target code rate estimation result of the coding unit according to the first code rate estimation result and the second code rate estimation result of each residual block in the coding unit.
[0082] In the residual block input process in the coding unit, for any one input residual block, after the code rate estimation reference information of the residual block on which the code rate estimation of the residual block depends is stored in the parameter determination module, the code rate estimation module can immediately start the code rate estimation of the residual block according to the early code rate estimation condition including two conditions of whether each residual block is the last non-zero residual block, to determine two code rate estimation results of the residual block. When the real last non-zero residual block is determined, the target code rate estimation result of the coding unit can be determined according to the first code rate estimation result and the second code rate estimation result of each residual block in the coding unit.
[0083] In the prior art, the B-E code rate estimation of each residual block in the coding unit cannot be started until the relevant information of all residual blocks in the coding unit is acquired, because the input index of the last non-zero residual block in the coding unit needs to be determined according to the relevant information of all residual blocks in the coding unit, so that the B-E code rate estimation can be started for the residual blocks with an input index less than or equal to the input index of the last non-zero residual block, that is, the B-E code rate estimation is performed for the last non-zero residual block and the residual blocks input before the last non-zero residual block, and the redundant B-E code rate estimation is not performed for the zero residual blocks input after the last non-zero residual block.
[0084] Because the calculation process of the B code rate estimation and the C code rate estimation is complex, and the B code rate estimation and the C code rate estimation have a greater impact on the calculation delay, the code rate estimation device in the embodiment of the present disclosure can set the early code rate estimation condition including two conditions of whether each residual block is the last non-zero residual block, to effectively start the B-C code rate estimation in advance without actually determining the last non-zero residual block, to speed up the B-C code rate estimation process.
[0085] In a possible implementation, the code rate estimation module 22 is configured to: for any one residual block, determine the B code rate estimation value of the residual block by performing B code rate estimation on whether the residual block contains non-zero residual coefficients according to the B code rate estimation reference information of the residual blocks relied on by the residual block for performing code rate estimation; when the early code rate estimation condition is that each residual block is not the last non-zero residual block, determine the C1 code rate estimation value of the residual block by performing C1 code rate estimation on whether each residual coefficient of the residual block is zero according to the C code rate estimation reference information of the residual blocks relied on by the residual block for performing code rate estimation; and when the early code rate estimation condition is that each residual block is the last non-zero residual block, determine the C2 code rate estimation value of the residual block by performing C2 code rate estimation on the last residual coefficient to the last non-zero residual coefficient of the residual block according to the C code rate estimation reference information of the residual blocks relied on by the residual block for performing code rate estimation.
[0086] After inputting any one residual block, if it is determined that the code rate estimation reference information of the residual blocks relied on by the residual block for performing B-C code rate estimation has been stored in the parameter determination module, the code rate estimation module immediately starts to perform B, C1 and C2 code rate estimation on the residual block.
[0087] The code rate estimation module determines the probability model of the residual block according to the B code rate estimation reference information of the residual blocks relied on by the residual block for performing B code rate estimation, and then performs B code rate estimation on whether the residual block contains non-zero residual coefficients by using the determined probability model to determine the B code rate estimation value of the residual block. The specific residual blocks relied on by the residual block for performing B code rate estimation can be determined according to related technologies, which are not limited in the present disclosure.
[0088] The code rate estimation module determines the probability model of the residual block according to the C code rate estimation reference information of the residual blocks relied on by the residual block for performing C code rate estimation. According to the early code rate estimation condition that each residual block is not the last non-zero residual block, the code rate estimation module performs C1 code rate estimation on whether each residual coefficient of the residual block is zero by using the determined probability model to determine the C1 code rate estimation value of the residual block. According to the early code rate estimation condition that each residual block is the last non-zero residual block, the code rate estimation module performs C2 code rate estimation on the last residual coefficient to the last non-zero residual coefficient of the residual block by using the determined probability model to determine the C2 code rate estimation value of the residual block. The specific residual blocks relied on by the residual block for performing C code rate estimation can be determined according to related technologies, which are not limited in the present disclosure.
[0089] In one possible implementation, the apparatus 20 further includes: a first accumulator for accumulating the B-rate estimate of each residual block to obtain an initial B-rate estimate of the coding unit; and a second accumulator for accumulating the C1-rate estimate of each residual block to obtain an initial C-rate estimate of the coding unit.
[0090] The B-rate estimate of each residual block determined by the rate estimation module can be accumulated in the first accumulator to obtain the initial B-rate estimate of the coding unit; the C1-rate estimate of each residual block determined sequentially by the rate estimation module can be accumulated in the second accumulator to obtain the initial C-rate estimate of the coding unit.
[0091] In one possible implementation, the device 20 further includes a memory for storing the B-rate estimate and the C2-rate estimate for each residual block.
[0092] In addition, the B-rate estimate and C2-rate estimate of each residual block determined by the rate estimation module need to be temporarily stored in memory for later use after the true last non-zero residual block is determined.
[0093] like Figure 3 As shown, the rate estimation device further includes: a first accumulator, a second accumulator, and a memory. The first accumulator accumulates the B-rate estimate for each residual block, the second accumulator accumulates the C1-rate estimate for each residual block, and the memory stores the B-rate estimate and C2-rate estimate for each residual block.
[0094] In one possible implementation, the rate estimation module 22 is used to: determine the input index of the last non-zero residual block in the coding unit after storing the rate estimation reference information for each residual block in the coding unit in the parameter determination module 21.
[0095] After all residual blocks in the coding unit have been input, and the rate estimation reference information for each residual block has been calculated and stored, the input index of the last non-zero residual block in the coding unit is determined so that A rate estimation can be performed on the last non-zero residual block, and DE rate estimation can be performed on residual blocks whose input index is less than or equal to the input index of the last non-zero residual block, that is, on the last non-zero residual block and the residual blocks input before it. There is no need to perform redundant DE rate estimation on the zero residual blocks input to the last non-zero residual block.
[0096] In the case where the rate estimation device includes only one rate estimation module, the rate estimation module performs BE rate estimation serially on the last non-zero residual block and each of the preceding input residual blocks.
[0097] In one possible implementation, the rate estimation module 22 is used to: perform A-rate estimation on the position of the last non-zero residual coefficient in the last non-zero residual block to determine the target A-rate estimate of the coding unit; for each residual block whose input index is less than or equal to the last non-zero residual block, perform D-rate estimation on the first N non-zero residual coefficients in the residual block according to the D-rate estimation reference information of the residual block on which the rate estimation of the residual block depends, to determine the D-rate estimate of the residual block; for each residual block whose input index is less than or equal to the last non-zero residual block, perform E-rate estimation on the first residual coefficient greater than 1 in the residual block according to the E-rate estimation reference information of the residual block on which the rate estimation of the residual block depends, to determine the E-rate estimate of the residual block.
[0098] For the last non-zero residual block, the rate estimation module first determines the position of the last non-zero residual coefficient in the last non-zero residual block, and then performs A-rate estimation at that position to determine the A-rate estimate of the coding unit.
[0099] Taking the aforementioned 4×4 residual block containing 16 residual coefficients as an example, the rate estimation module iterates through the 16 residual coefficients in the last non-zero 4×4 residual block to determine the position (y, x) of the last non-zero residual coefficient in the last non-zero 4×4 residual block. Then, the rate estimation module performs A-rate estimation on the position (y, x) of the last non-zero residual coefficient in the last non-zero 4×4 residual block to determine the target A-rate estimate for the coding unit.
[0100] The target A code rate estimate of the coding unit can be temporarily stored in the seventh accumulator for later use.
[0101] like Figure 3 As shown, the rate estimation device also includes a seventh accumulator, which is used by the rate estimation module to determine the target A rate estimate of the coding unit and store it in the seventh accumulator.
[0102] For any residual block, the rate estimation module determines a probabilistic model for the residual block based on the D-rate estimation reference information of the residual blocks that the D-rate estimation of the residual block depends on. Then, using the determined probabilistic model, the module performs D-rate estimation on the first N non-zero residual coefficients in the residual block to determine the estimated D-rate value of the residual block. The specific residual blocks that the D-rate estimation of the residual block depends on can be determined based on relevant technologies, and this disclosure does not impose specific limitations on this.
[0103] The rate estimation module determines a probability model for the residual block based on the E-rate estimation reference information of the residual block that the residual block needs to rely on for E-rate estimation. Then, it uses the determined probability model to perform E-rate estimation on the first residual coefficient greater than 1 in the residual block, thus determining the E-rate estimate of the residual block. The specific residual block that the residual block needs to rely on for E-rate estimation can be determined based on relevant technologies, and this disclosure does not impose specific limitations on it.
[0104] In one possible implementation, the apparatus 20 further includes: a fifth accumulator for accumulating the D rate estimate of each residual block whose input index is less than or equal to the last non-zero residual block to obtain the target D rate estimate of the coding unit; and a sixth accumulator for accumulating the E rate estimate of each residual block whose input index is less than or equal to the last non-zero residual block to obtain the target E rate estimate of the coding unit.
[0105] The D-rate estimate of each residual block whose input index is less than or equal to the last non-zero residual block, determined by the rate estimation module, can be accumulated in the fifth accumulator to obtain the target D-rate estimate of the coding unit; the E-rate estimate of each residual block whose input index is less than or equal to the last non-zero residual block, determined by the rate estimation module, can be accumulated in the sixth accumulator to obtain the target E-rate estimate of the coding unit.
[0106] like Figure 3 As shown, the rate estimation device further includes a fifth accumulator and a sixth accumulator. The fifth accumulator accumulates the D rate estimate for each residual block whose input index is less than or equal to the last non-zero residual block, and the sixth accumulator accumulates the E rate estimate for each residual block whose input index is less than or equal to the last non-zero residual block.
[0107] In one possible implementation, the apparatus 20 further includes: a first subtractor for subtracting the B-rate estimate of each residual block whose input index is greater than the last non-zero residual block from the initial B-rate estimate of the coding unit to obtain a target B-rate estimate of the coding unit; and a second subtractor for subtracting the C2-rate estimate of each residual block whose input index is greater than the last non-zero residual block from the initial C-rate estimate of the coding unit to obtain a target C-rate estimate of the coding unit.
[0108] Because redundant B, C1, and C2 rate estimates have been performed on each residual block input after the last non-zero residual block before determining the input index of the last non-zero residual block, the initial B rate estimate of the coding unit determined by the first accumulator and the initial C rate estimate of the coding unit determined by the second accumulator need to be corrected based on the input index of the last non-zero residual block.
[0109] Therefore, the first subtractor needs to determine the residual blocks with input index greater than the last non-zero residual block according to the input index of the last non-zero residual block, and then subtract the B-rate estimation values of each residual block with input index greater than the last non-zero residual block stored in the memory from the initial B-rate estimation value of the coding unit determined by the first accumulator, so as to finally obtain the target B-rate estimation value of the coding unit, so as to avoid the influence of each residual block input after the last non-zero residual block on the actual B-rate estimation value.
[0110] In addition, the second subtractor needs to determine the residual blocks with input index greater than the last non-zero residual block according to the input index of the last non-zero residual block, and then subtract the C2-rate estimation values of each residual block with input index greater than the last non-zero residual block stored in the memory from the initial C-rate estimation value of the coding unit determined by the second accumulator, so as to obtain the target C-rate estimation value of the coding unit, so as to avoid the influence of each residual block input after the last non-zero residual block on the actual C-rate estimation value.
[0111] In a possible implementation, the apparatus 20 further includes a seventh accumulator configured to accumulate the target A-rate estimation value, the target B-rate estimation value, the target C-rate estimation value, the target D-rate estimation value, the target E-rate estimation value, the target F-rate estimation value, and the target G-rate estimation value, and determine the target rate estimation value of the coding unit.
[0112] After the target A-G-rate estimation values of the coding unit are determined, the seventh accumulator accumulates the target A-G-rate estimation values of the coding unit, and determines the target rate estimation value of the coding unit, and thus the rate estimation of the coding unit is completed.
[0113] As shown in FIG. 7, the seventh accumulator outputs the target rate estimation value of the coding unit. Figure 4
[0114] The rate estimation apparatus of the embodiments of the present disclosure can calculate and store the rate estimation reference information corresponding to the residual blocks in the coding unit; for any one residual block, as long as the parameter determination module stores the rate estimation reference information of the residual blocks relied on by the residual block for performing rate estimation, the rate estimation module can start rate estimation of the residual block according to the early rate estimation conditions including two cases of whether each residual block is the last non-zero residual block, without waiting for all the rate estimation reference information corresponding to the residual blocks to be obtained before starting rate estimation, so as to effectively speed up the rate estimation process of the coding unit.
[0115] Without affecting the quality of the video encoder, the B-C rate estimation on the residual blocks in the coding unit is performed in advance before the last non-zero residual block in the coding unit is determined, so that the B-C rate estimation can be accelerated, the impact of the B-C rate estimation on the calculation delay is reduced, and the calculation performance bottleneck of the rate estimation of the video encoder is solved.
[0116] Finally, after the last non-zero residual block in the coding unit is determined, the initial B-C rate estimation value of the coding unit determined before is corrected, so that the B-C rate estimation accuracy of the coding unit is not affected, the calculation time of the rate estimation is effectively shortened, and the calculation performance of the entire video encoder is improved.
[0117] Figure 4 A flowchart of a rate estimation method according to an embodiment of the present disclosure is shown. As shown in the flowchart, the method can include: Figure 5
[0118] In step S41, the rate estimation reference information corresponding to the residual blocks in the coding unit is calculated and stored;
[0119] In step S42, for any one residual block, after the rate estimation reference information of the residual blocks on which the rate estimation of the residual block depends is stored, the rate estimation of the residual block is performed under the early rate estimation condition, wherein the early rate estimation condition includes two cases of whether each residual block is the last non-zero residual block.
[0120] In a possible implementation, the rate estimation reference information corresponding to each residual block in the coding unit is calculated and stored, including:
[0121] For any one residual block in the coding unit, the rate estimation reference information corresponding to the residual block is calculated and stored according to the size of the residual coefficients in the residual block, wherein the size of the residual coefficients corresponding to different types of rate estimation reference information is different.
[0122] In a possible implementation, the rate estimation reference information corresponding to each residual block in the coding unit is calculated and stored, including:
[0123] For any one residual block in the coding unit, the B rate estimation reference information corresponding to the residual block is calculated and stored according to whether the residual block contains non-zero residual coefficients;
[0124] The C rate estimation reference information corresponding to the residual block is calculated and stored according to whether each residual coefficient in the residual block is zero;
[0125] The D rate estimation reference information corresponding to the residual block is determined according to the first N non-zero residual coefficients in the residual block, wherein N is a positive integer;
[0126] According to the first residual coefficient greater than 1 in the residual block, the E-rate estimation reference information corresponding to the residual block is determined.
[0127] In a possible implementation, for any one residual block, after storing the rate estimation reference information of the residual blocks relied on by the residual block for performing rate estimation, the rate estimation of the residual block is performed under the early rate estimation condition, including:
[0128] For any one residual block, when the early rate estimation condition is that each residual block is not the last non-zero residual block, according to the B-rate estimation reference information of the residual blocks relied on by the residual block for performing rate estimation, the B-rate estimation of whether the residual block contains a non-zero residual coefficient is performed, to determine the B-rate estimation value of the residual block.
[0129] When the early rate estimation condition is that each residual block is the last non-zero residual block, according to the C-rate estimation reference information of the residual blocks relied on by the residual block for performing rate estimation, the C2-rate estimation of the last residual coefficient to the last non-zero residual coefficient in the residual block is performed, to determine the C2-rate estimation value of the residual block.
[0130] According to the first-rate estimation value and the second-rate estimation value of each residual block in the coding unit, the target rate estimation result of the coding unit is determined.
[0131] In a possible implementation, for any one residual block, after storing the rate estimation reference information of the residual blocks relied on by the residual block for performing rate estimation, the rate estimation of the residual block is performed under the early rate estimation condition, including:
[0132] For any one residual block, according to the B-rate estimation reference information of the residual blocks relied on by the residual block for performing rate estimation, the B-rate estimation of whether the residual block contains a non-zero residual coefficient is performed, to determine the B-rate estimation value of the residual block.
[0133] When the early rate estimation condition is that each residual block is not the last non-zero residual block, according to the C-rate estimation reference information of the residual blocks relied on by the residual block for performing rate estimation, the C1-rate estimation of whether each residual coefficient in the residual block is zero is performed, to determine the C1-rate estimation value of the residual block.
[0134] When the early rate estimation condition is that each residual block is the last non-zero residual block, according to the C-rate estimation reference information of the residual blocks relied on by the residual block for performing rate estimation, the C2-rate estimation of the last residual coefficient to the last non-zero residual coefficient in the residual block is performed, to determine the C2-rate estimation value of the residual block.
[0135] In a possible implementation, the method further includes:
[0136] The B code rate estimation value of each residual block is accumulated to obtain an initial B code rate estimation value of the coding unit;
[0137] The C1 code rate estimation value of each residual block is accumulated to obtain an initial C code rate estimation value of the coding unit.
[0138] In a possible implementation, the method further includes:
[0139] For any one residual block, the F code rate estimation is performed on the sign bit of the non-zero residual coefficient in the residual block to determine the F code rate estimation value of the residual block;
[0140] The G code rate estimation is performed on the residual remainder value of all residual coefficients in the residual block to determine the G code rate estimation value of the residual block.
[0141] In a possible implementation, the method further includes:
[0142] The F code rate estimation value of each residual block is accumulated to obtain a target F code rate estimation value of the coding unit;
[0143] The G code rate estimation value of each residual block is accumulated to obtain a target G code rate estimation value of the coding unit.
[0144] In a possible implementation, the method further includes:
[0145] After the code rate estimation reference information of each residual block in the coding unit is stored, the input index of the last non-zero residual block in the coding unit is determined.
[0146] In a possible implementation, the method further includes:
[0147] The A code rate estimation is performed on the position of the last non-zero residual coefficient in the last non-zero residual block to determine a target A code rate estimation value of the coding unit;
[0148] For each residual block with an input index less than or equal to the last non-zero residual block, the D code rate estimation is performed on the first N non-zero residual coefficients in the residual block according to the D code rate estimation reference information of the residual block that needs to be relied on for performing the code rate estimation of the residual block to determine the D code rate estimation value of the residual block;
[0149] For each residual block with an input index less than or equal to the last non-zero residual block, the E code rate estimation is performed on the first residual coefficient greater than 1 in the residual block according to the E code rate estimation reference information of the residual block that needs to be relied on for performing the code rate estimation of the residual block to determine the E code rate estimation value of the residual block.
[0150] In a possible implementation, the method further includes:
[0151] The D code rate estimation values of each residual block with an input index less than or equal to the last non-zero residual block are accumulated to obtain a target D code rate estimation value of the coding unit;
[0152] The E code rate estimation values of each residual block with an input index less than or equal to the last non-zero residual block are accumulated to obtain a target E code rate estimation value of the coding unit.
[0153] In a possible implementation, the method further includes:
[0154] The initial B code rate estimation value of the coding unit is subtracted by the B code rate estimation values of each residual block with an input index greater than the last non-zero residual block to obtain a target B code rate estimation value of the coding unit.
[0155] The initial C code rate estimation value of the coding unit is subtracted by the C2 code rate estimation values of each residual block with an input index greater than the last non-zero residual block to obtain a target C code rate estimation value of the coding unit.
[0156] In a possible implementation, the method further includes:
[0157] The target A code rate estimation value, the target B code rate estimation value, the target C code rate estimation value, the target D code rate estimation value, the target E code rate estimation value, the target F code rate estimation value and the target G code rate estimation value are accumulated to determine a target code rate estimation value of the coding unit.
[0158] In some embodiments, the apparatus provided by the embodiments of the present disclosure has functions or includes modules that can be used to perform the methods described in the above method embodiments, and the specific implementation can be referred to the description of the above method embodiments. For briefness, details are not described here again.
[0159] The embodiments of the present disclosure further provide a video encoder comprising the above rate estimation apparatus.
[0160] The embodiments of the present disclosure further provide an electronic device comprising a memory, a processor and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the above method.
[0161] The embodiments of the present disclosure further provide a non-volatile computer readable storage medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement the steps of the above method.
[0162] The embodiments of the present disclosure further provide a computer program product comprising a computer program, or a non-volatile computer readable storage medium carrying the computer program, wherein the computer program is executed by a processor to implement the steps of the above method.
[0163] Figure 5is a block diagram illustrating an electronic device according to an embodiment of the disclosure. Referring to Figure 5 The electronic device 1900 can be provided as a server or a terminal device. Referring to The electronic device 1900 includes a processing component 1922, further including one or more processors, and a memory resource represented by a memory 1932, for storing instructions executable by the processing component 1922, such as an application program. The application program stored in the memory 1932 can include one or more than one module each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute the instructions to perform the above method.
[0164] The electronic device 1900 can further include a power supply component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input / output interface 1958 (I / O interface). The electronic device 1900 can operate based on an operating system stored in the memory 1932, such as Windows Server TM , Mac OS X TM , Unix TM , Linux TM , FreeBSD TM or the like.
[0165] In an exemplary embodiment, a non-transitory computer readable storage medium, such as the memory 1932 including computer program instructions executable by the processing component 1922 of the electronic device 1900 to complete the above method, is also provided.
[0166] Computer readable storage media can be any media that can be read by a machine. Such media can include, but is not limited to, optical discs, magnetic discs, magnetic tapes, electronic memories, and / or any combination thereof. Computer readable storage media can be non-transitory, in that it can be a tangible medium. In some embodiments, computer readable storage media can be non-transitory, in that it can not be a signal per se. In other embodiments, computer readable storage media can be a transitory medium, in that it can be a signal. In some embodiments, computer readable storage media can be non-transitory, in that it can not be a signal per se, but can be a tangible medium. In other embodiments, computer readable storage media can be a transitory medium, in that it can be a signal. In some embodiments, computer readable storage media can be non-transitory, in that it can not be a signal per se, but can be a tangible medium. In other embodiments, computer readable storage media can be a transitory medium, in that it can be a signal.
[0167] The computer programs (or computer readable program instructions) described herein can be downloaded from a computer readable storage medium to respective computing / processing devices or to external computers or external storage devices via a network, for example, the Internet, a local area network, a wide area network and / or a wireless network. The network can comprise copper transmission cables, optical transmission fibers, wireless transmission, routers, firewalls, switches, gateway computers and / or edge servers. A network adapter card or network interface in each computing / processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium within the respective computing / processing device.
[0168] Computer readable program instructions for carrying out operations of the present disclosure can be assembler instructions, instruction-set-architecture (ISA) instructions, machine instructions, machine dependent instructions, microcode, firmware instructions, state-setting data, or either source code or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer readable program instructions can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider). In some embodiments, electronic circuitry including, for example, programmable logic circuitry, field-programmable gate array (FPGA), or programmable logic array (PLA) can execute the computer readable program instructions by utilizing state information of the computer readable program instructions to personalize the electronic circuitry, in order to perform aspects of the present disclosure.
[0169] The computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other device to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks.
[0170] These computer readable program instructions can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks. These computer readable program instructions can also be stored in a computer readable storage medium that can include random access memory (RAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other data storage device. When the computer readable program instructions are loaded into the computer and other programmable data processing apparatus, a series of operational steps are implemented that provide processes such that the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks.
[0171] The computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus or other device to produce a computer implemented process such that the instructions which execute on the computer, other programmable data processing apparatus, or other device implement the functions / acts specified in the flowchart and / or block diagram block or blocks.
[0172] The flow diagrams and the block diagrams in the drawings are presented to illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flow diagrams and the block diagrams can represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logic functions. In some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks can sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and / or flow diagrams, and combinations thereof, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and
[0173] Embodiments of the present disclosure have been described above, and the description is intended to be illustrative of the embodiments and not restrictive. Many modifications and variations of the described embodiments are possible and are within the scope of the disclosure. The selection of terms is intended to best describe the principles of the embodiments, practical application, or technical improvements in the art, or to enable others skilled in the art to understand the embodiments disclosed herein.
Claims
1. A code rate estimation apparatus characterized by comprising: The method comprises the following steps: A parameter determination module is configured to calculate and store the rate estimation reference information corresponding to the residual block in the coding unit; A rate estimation module is configured to perform rate estimation on any residual block under the condition of early rate estimation after the rate estimation reference information of the residual block on which the rate estimation of the residual block depends is stored in the parameter determination module, wherein the condition of early rate estimation includes two cases: whether each residual block is the last non-zero residual block; The rate estimation module is configured to perform rate estimation on any residual block under the condition of early rate estimation assuming that each residual block is not the last non-zero residual block and assuming that each residual block is the last non-zero residual block.
2. The apparatus of claim 1, wherein, The parameter determination module is specifically configured to: For any residual block in the coding unit, the rate estimation reference information corresponding to the residual block is calculated and stored according to the size of the residual coefficient in the residual block, wherein the size of the residual coefficient corresponding to different types of rate estimation reference information is different.
3. The apparatus of claim 1 or 2, wherein, The parameter determination module comprises: A B-rate parameter determination submodule is configured to calculate and store the B-rate estimation reference information corresponding to any residual block in the coding unit according to whether the residual block contains a non-zero residual coefficient; A C-rate parameter determination submodule is configured to calculate and store the C-rate estimation reference information corresponding to any residual block in the coding unit according to whether each residual coefficient in the residual block is zero; A D-rate parameter determination submodule is configured to determine the D-rate estimation reference information corresponding to any residual block in the coding unit according to the first N non-zero residual coefficients in the residual block, wherein N is a positive integer; An E-rate parameter determination submodule is configured to determine the E-rate estimation reference information corresponding to any residual block in the coding unit according to the first residual coefficient greater than 1 in the residual block.
4. The apparatus of claim 1, wherein, The rate estimation module is configured to: For any residual block, the first type of rate estimation result of the residual block is determined according to the rate estimation reference information of the residual block on which the rate estimation of the residual block depends under the condition of early rate estimation assuming that each residual block is not the last non-zero residual block; The second type of rate estimation result of the residual block is determined according to the rate estimation reference information of the residual block on which the rate estimation of the residual block depends under the condition of early rate estimation assuming that each residual block is the last non-zero residual block; The target rate estimation result of the coding unit is determined according to the first type of rate estimation value and the second type of rate estimation value of each residual block in the coding unit.
5. The apparatus of claim 4, wherein, The rate estimation module is specifically configured to: For any residual block, the B-rate estimation value of the residual block is determined by performing B-rate estimation on whether the residual block contains a non-zero residual coefficient according to the B-rate estimation reference information of the residual block on which the rate estimation of the residual block depends. In a case that the early rate estimation condition is that each residual block is not the last non-zero residual block, the C rate estimation of the residual block is performed according to the C rate estimation reference information of the dependent residual block, the C1 rate estimation of whether each residual coefficient in the residual block is zero is performed, and the C1 rate estimation value of the residual block is determined. In a case that the early rate estimation condition is that each residual block is the last non-zero residual block, the C rate estimation of the residual block is performed according to the C rate estimation reference information of the dependent residual block, the C2 rate estimation of the last residual coefficient to the last non-zero residual coefficient in the residual block is performed, and the C2 rate estimation value of the residual block is determined.
6. The apparatus of claim 5, wherein, The apparatus further comprises: A first accumulator is configured to accumulate the B rate estimation values of each residual block to obtain an initial B rate estimation value of the coding unit; A second accumulator is configured to accumulate the C1 rate estimation values of each residual block to obtain an initial C rate estimation value of the coding unit.
7. The apparatus of claim 1, wherein, The rate estimation module is further configured to: perform the F rate estimation of the sign bit of the non-zero residual coefficient in the residual block to determine the F rate estimation value of the residual block; perform the G rate estimation of the residual remainder value of all residual coefficients in the residual block to determine the G rate estimation value of the residual block.
8. The apparatus of claim 7, wherein, The apparatus further comprises: A third accumulator is configured to accumulate the F rate estimation values of each residual block to obtain a target F rate estimation value of the coding unit; A fourth accumulator is configured to accumulate the G rate estimation values of each residual block to obtain a target G rate estimation value of the coding unit.
9. The apparatus of claim 1, wherein, The rate estimation module is further configured to: after the parameter determination module stores the rate estimation reference information of each residual block in the coding unit, determine the input index of the last non-zero residual block in the coding unit.
10. The apparatus of claim 9, wherein, The rate estimation module is further configured to: perform the A rate estimation of the position of the last non-zero residual coefficient in the last non-zero residual block to determine the target A rate estimation value of the coding unit; for each residual block with an input index less than or equal to the last non-zero residual block, perform the D rate estimation of the first N non-zero residual coefficients in the residual block according to the D rate estimation reference information of the dependent residual block to determine the D rate estimation value of the residual block; for each residual block with an input index less than or equal to the last non-zero residual block, perform the E rate estimation of the first residual coefficient greater than 1 in the residual block according to the E rate estimation reference information of the dependent residual block to determine the E rate estimation value of the residual block.
11. The apparatus of claim 10, wherein, The apparatus further comprises: A fifth accumulator is configured to accumulate the D rate estimation values of each residual block with an input index less than or equal to the last non-zero residual block to obtain a target D rate estimation value of the coding unit; A sixth accumulator is configured to accumulate the E rate estimation values of each residual block with an input index less than or equal to the last non-zero residual block to obtain a target E rate estimation value of the coding unit.
12. The apparatus of claim 9, wherein, The apparatus further comprises: a first subtractor configured to subtract the B-rate estimation value of each residual block with an input index greater than the last non-zero residual block from the initial B-rate estimation value of the coding unit to obtain a target B-rate estimation value of the coding unit; a second subtractor configured to subtract the C2-rate estimation value of each residual block with an input index greater than the last non-zero residual block from the initial C-rate estimation value of the coding unit to obtain a target C-rate estimation value of the coding unit.
13. The apparatus of any one of claims 8 to 12, wherein, The apparatus further comprises: a seventh accumulator configured to accumulate the target A-rate estimation value, the target B-rate estimation value, the target C-rate estimation value, the target D-rate estimation value, the target E-rate estimation value, the target F-rate estimation value, and the target G-rate estimation value to determine a target rate estimation value of the coding unit.
14. A method of code rate estimation, characterized by, The method comprises: calculating and storing rate estimation reference information corresponding to each residual block in a coding unit; for any one residual block, after storing rate estimation reference information of residual blocks on which rate estimation of the residual block depends, performing rate estimation on the residual block under an early rate estimation condition, wherein the early rate estimation condition includes two cases of whether each residual block is the last non-zero residual block; the performing rate estimation on the residual block under the early rate estimation condition comprises: for any one residual block, performing rate estimation on the residual block under two cases of assuming that each residual block is not the last non-zero residual block and assuming that each residual block is the last non-zero residual block.
15. A video encoder, comprising: The rate estimation apparatus comprises any one of claims 1 to 13.
16. An electronic device comprising a memory, a processor, and a computer program stored on the memory, wherein the computer program, when executed by the processor, is arranged to perform the method of any one of claims 1 to 15. The processor executes the computer program to implement the steps of the method of claim 14.
17. A non-transitory computer readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of claim 14.
18. A computer program product comprising a computer program or a non-transitory computer readable storage medium bearing a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of claim 14. The computer program is executed by the processor to implement the steps of the method of claim 14.
Citation Information
Patent Citations
Linear code rate estimation method based on element category
CN108063945A
Rate-distortion optimized quantization method, system and device for video coding, and storage medium
WO2025001888A1