Code rate estimation method and device and electronic equipment

By determining the estimated code rate of the syntax element of the encoding unit in a fixed context probability model in parallel and using the adjustment coefficient to simulate state transitions, the problem of inaccurate bit rate estimation in the prior art is solved, and more efficient coding performance is achieved.

CN120343248APending Publication Date: 2025-07-18CAMBRIAN (KUNSHAN) INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410077329.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-18
Publication Date
2025-07-18

AI Technical Summary

Technical Problem

The existing code rate estimation method based on fixed context probability model has losses in encoding performance, cannot accurately reflect the variation of pattern tendency, and the code rate estimation results among different encoding units are inaccurate.

Method used

The grammatical elements of multiple encoding units are used to determine the estimated code rate in parallel, and the encoding length is adjusted to improve accuracy by adjusting the coefficients to simulate the probability state transition process.

Benefits of technology

While performing fast bit rate estimation, the accuracy and efficiency of coding performance are improved and the loss of coding performance is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120343248A_ABST
    Figure CN120343248A_ABST
Patent Text Reader

Abstract

The invention provides a code rate estimation method and device and electronic equipment, and is applied to the technical field of computers. When video or image data is transmitted, the video or image data to be transmitted needs to be compressed and coded. The invention provides a new code rate estimation method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technologies, and in particular, to a bitrate estimation method, apparatus, and electronic device. Background Art

[0002] For image and video data to be transmitted, it is usually necessary to encode the image and video data, and compress the image and video data during the encoding process to reduce the data volume of the video data to be transmitted.

[0003] The image and video data can be predicted, transformed, quantized, and filtered, thereby generating a large amount of data to be encoded. These data to be encoded can be encoded using various encoding methods, such as using entropy encoding methods, so as to achieve the purpose of compression. Summary of the Invention

[0004] The present disclosure provides a bitrate estimation method, apparatus, and electronic device.

[0005] According to a first aspect of the present disclosure, there is provided a bitrate estimation method, the method including: determining an initial probability model of context variables for a plurality of coding units, where the plurality of coding units belong to a current coding tree unit; determining first coding lengths respectively corresponding to target syntax elements in the plurality of coding units according to the initial probability model; determining adjustment coefficients respectively corresponding to the first coding lengths of the plurality of coding units in a preset order; where the adjustment coefficient is related to a quantization parameter of the coding tree unit and is related to a historical value of the target syntax element after mode decision; for each coding unit, adjusting the first coding length of the coding unit by using the adjustment coefficient to obtain a second coding length of the target syntax element in the coding unit.

[0006] According to a second aspect of the present disclosure, there is provided a bitrate estimation apparatus, the apparatus including: a first determination unit, configured to determine an initial probability model of context variables for a plurality of coding units, where the plurality of coding units belong to a current coding tree unit; a second determination unit, configured to determine first coding lengths respectively corresponding to target syntax elements in the plurality of coding units according to the initial probability model; a third determination unit, configured to determine adjustment coefficients respectively corresponding to the first coding lengths of the plurality of coding units in a preset order; where the adjustment coefficient is related to a quantization parameter of the coding tree unit and is related to a historical value of the target syntax element after mode decision; an adjustment unit, configured to, for each coding unit, adjust the first coding length of the coding unit by using the adjustment coefficient to obtain a second coding length of the target syntax element in the coding unit.

[0007] According to a third aspect of the present disclosure, there is provided an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and when the instructions are executed by the at least one processor, the at least one processor is enabled to execute the method provided in the first aspect.

[0008] According to a fourth aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute the method provided in the first aspect.

[0009] According to a fifth aspect of the present disclosure, there is provided a computer program product, the computer program product including: a computer program, the computer program is stored in a readable storage medium, and at least one processor of an electronic device can read the computer program from the readable storage medium, and when the at least one processor executes the computer program, the electronic device is caused to execute the method described in the first aspect.

[0010] According to the solution of the present disclosure, since an initial probability model of context variables is determined for a plurality of coding units, wherein the plurality of coding units belong to a current coding tree unit; first coding lengths respectively corresponding to target syntax elements in the plurality of coding units are determined according to the initial probability model; adjustment coefficients respectively corresponding to the first coding lengths of the plurality of coding units are determined in a preset order; wherein the adjustment coefficient is related to a quantization parameter of the coding tree unit and is related to a historical value of the target syntax element after pattern decision; for each coding unit, the first coding length of the coding unit is adjusted by using the adjustment coefficient to obtain a second coding length of the target syntax element in the coding unit, so that the first coding lengths of the target syntax elements of the respective coding units can be determined in parallel, and the first coding lengths of different coding units are adjusted by using the adjustment coefficient. Since the adjustment coefficient is related to the quantization parameters of the reference coding tree unit and the current coding tree unit and is related to the coding units in the current coding tree unit for which the code rate estimation has been completed, the above adjustment coefficient can simulate the state transition process and can match the code rate differences under different quantization parameters. Thus, the code rate estimation result can be made more accurate while quickly obtaining the code rate estimation result, thereby achieving better coding performance.

[0011] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it used to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] The drawings are used to better understand the solution and do not constitute a limitation to the present disclosure. Among them:

[0013] Figure 1 is a schematic diagram of a bitrate estimation scheme;

[0014] Figure 2 is another schematic diagram of another bitrate estimation scheme;

[0015] Figure 3 is a schematic diagram of an embodiment of a bitrate determination method provided according to the present disclosure;

[0016] Figure 4 is a schematic diagram of another embodiment of a bitrate determination method provided according to the present disclosure;

[0017] Figure 5 is a schematic diagram of coding units obtained by quadtree partitioning of a CTU;

[0018] Figure 6 is a flowchart for updating the second adjustment coefficient;

[0019] Figure 7 is a schematic diagram of the CTU partitioning process;

[0020] Figure 8 is a schematic structural block diagram of a bitrate determination device provided according to the present disclosure;

[0021] Figure 9 is a schematic block diagram of an exemplary electronic device that can be used to implement the embodiments of the present disclosure. Detailed implementation manners

[0022] The following describes exemplary embodiments of the present disclosure with reference to the accompanying drawings. Various details of the embodiments of the present disclosure are included to assist understanding, and they should be considered merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted below.

[0023] In video coding, "bitrate" and "distortion" restrict each other. Generally, the rate-distortion optimization method (Rate–distortion optimization, RDO) is used to weigh and select various coding methods. The rate-distortion optimization method uses the rate-distortion cost as the evaluation index. The rate-distortion cost (RdCost) can be expressed by the following formula:

[0024] RdCost = D + λ × R; (1); where,

[0025] Let \(D\) be the distortion, \(\lambda\) be the Lagrange multiplier related to the Quantization Parameter (QP), and \(R\) be the bitrate.

[0026] For example, for the partitioning of Coding Tree Units (CTUs) and the selection of prediction modes, Rate-Distortion Optimization (RDO) can be used for decision-making, so as to balance the overall distortion and compression performance. By controlling the bitrate of each frame of the image and even each coding unit, the bitrate and distortion of the overall encoded video can reach the optimal state.

[0027] Generally, an image or video frame can be divided into one or more slices, and each slice can include multiple Coding Tree Units (CTUs). Each CTU can be encoded independently. The shapes of these CTUs can be square or rectangular, and the size can be adjusted as needed. Each CTU has its own encoding parameters, including prediction mode, quantization parameter, transform parameter, etc.

[0028] CTUs adopt a tree-structured coding method. Each CTU can be divided into multiple sub-blocks, and these sub-blocks can be further divided into smaller sub-blocks until the smallest coding unit is reached. These sub-blocks into which a CTU is divided can be called Coding Units (CUs). That is, each CTU can be divided into multiple CUs. For example, a CTU can be divided into multiple CUs in a quadtree manner. The partitioning method of a CTU into different sub-blocks requires an RDO decision.

[0029] For each coding unit, the syntax elements of this coding unit can be determined. Each coding unit can be characterized by syntax elements.

[0030] A coding unit can include multiple syntax elements. The syntax elements include but are not limited to: syntax elements indicating the segmentation information of the coding unit, prediction mode, residual coefficient syntax elements, etc. Schematically, the syntax elements include: the syntax element split indicating the segmentation information of the current coding unit; the syntax element skip indicating whether the current coding unit is skipped; the syntax element pre_mode indicating the prediction mode of the current coding unit, etc.

[0031] The number of bits occupied by a coding unit is equal to the sum of the number of bits occupied by each syntax element of the coding unit. Therefore, the problem of determining the number of bits occupied by a coding unit can be transformed into the problem of determining the number of bits occupied by each syntax element.

[0032] If the implementation complexity and encoding time are not considered, the bitrate \(R\) after normal entropy coding is the most accurate. However, limited by the implementation of software and hardware, especially hardware limitations, a lookup table-based bitrate estimation is usually adopted.

[0033] There are the following two table-based bit rate estimation methods in the related art. One is the bit rate estimation method adopted by Context-based Adaptive Binary Arithmetic Coding (CABAC), and the other is the bit rate estimation method adopted by Table-based Context-fixed Binary Arithmetic Coding (CFBAC).

[0034] Please refer to Figure 1 , which shows a schematic diagram of the hardware structure implemented by the bit rate estimation method in context-based adaptive binary arithmetic coding. As Figure 1 shown, the non-binarized syntax elements of the coding unit are input into the binarization processor, and the syntax elements are binarized by the above binarization processor to obtain binarized syntax elements. Select the context information of the binarized syntax elements. Store the selected context information. Input the stored context information and the binarized syntax element information into the context probability model estimator, and the context probability model estimator outputs the information of the context probability model; then input the information of the context probability model into the bit estimator. The bit estimator estimates the bits of the syntax element according to the information of the context probability model, and then uses the rate-distortion information calculated according to the bits to determine the update information of the context probability model, and feeds back the update information of the context probability model to the context probability model estimator. The context probability model estimator updates the context probability model of the same syntax element according to the above update information, that is, performs probability state transition. The context probability model estimator determines the context probability model corresponding to the subsequent syntax element according to the context probability model after the probability state transition.

[0035] Therefore, CABAC is a highly dependent serial process. Due to the inherent dependence of the context models between each coding element and bit, the estimation speed of the number of bits occupied by the syntax element is very slow.

[0036] Please refer to Figure 2 , Figure 2 shows a schematic diagram of the hardware structure implemented by the bit rate estimation method adopted by table-based context-fixed binary arithmetic coding (CFBAC). Different from Figure 1 , after the bit estimator determines the bit estimation result, it does not return the update information to the context probability model estimator. In Figure 2 , a fixed context probability model is used instead of an adaptive context probability model. Since the context probability model in CFBAC is fixed, multiple bit rate estimation instances can be parallelized. These instances can share the same context probability model to reduce the hardware cost.

[0037] Taking the division of CTUs and the selection of CU prediction modes as an example, when generally determining the number of bits occupied by syntax elements using the CFBAC method, no probability state transfer is performed within the current CTU. Instead, the context probability model after entropy encoding of the reference CTU is directly used as the context probability model for each coding unit of the current CTU. That is, when performing RDO (rate-distortion optimization) for each CU within the current CTU, the context probability model (probability state) used is the same. Each time the bit rate is estimated, only the bits are estimated, and no probability state update is performed. The only source of probability state update is the context probability model obtained from the formal entropy encoding of the previous CTU.

[0038] The bit rate estimation scheme in table-based CFBAC is highly hardware-friendly.

[0039] However Figure 2 The bit rate estimation scheme shown has a large coding performance loss due to the fixed context probability model. In practical applications, the following two problems will also occur:

[0040] (1) The probability of each CU within the current CTU selecting a certain mode is always the same, and no mode preference effect can be generated, that is, the situation where the more times a certain mode is selected, the greater the probability of selecting that mode later cannot occur; for example, the probability of blocks in the skip mode or blocks in the Intra block copy (IBC) mode being connected into a continuous area will be greatly reduced.

[0041] (2) When block-level bit rate control is enabled, the QP of each CTU may be different. If the probability state of the previous CTU is directly used for the current CTU, the obtained bit rate estimation value may deviate greatly from the actual bit rate of entropy encoding, thereby leading to an inaccurate selected mode.

[0042] To solve the above problems, the bit rate estimation method provided in the present disclosure can use a fixed context probability model to parallelly determine the estimated bit rates of syntax elements in multiple coding units, and then determine an adjustment coefficient, and use the adjustment coefficient to adjust the estimated bit rates. The above adjustment coefficient simulates the probability state transfer process in CABAC. Therefore, in the case where fast bit rate estimation can be achieved, the bit rate estimation result is made more accurate, thereby achieving better coding performance.

[0043] Please refer to Figure 3 , Figure 3 which shows a schematic flowchart of the bit rate estimation method provided in the present disclosure. As Figure 3 shown, the bit rate estimation method includes the following steps:

[0044] S301. Determine an initial probability model for context variables for multiple coding units, where the multiple coding units belong to the current coding tree unit.

[0045] In the present disclosure, the execution subject of the bitrate estimation method may be an electronic device with image data processing capabilities, such as various terminal devices or servers.

[0046] To reduce the computational complexity during entropy coding, bitrate estimation can be performed before formal entropy coding.

[0047] In a slice, the coding tree units can be independently coded. It can be understood that the above-mentioned current coding tree unit can be a coding tree unit in at least one slice obtained by dividing an image or video frame. Before performing bitrate estimation, operations such as transformation, quantization, and filtering can be performed on the image data corresponding to the coding tree unit.

[0048] The initial probability model here includes a probability state model corresponding to the context variable. The context variable includes an initial state variable (pStateIdx) and a maximum probability symbol value (val of Most Probable Symbol, valMPS) variable. valMPS corresponds to the most likely value and takes a value of 0 or 1. In this embodiment, during the bitrate estimation process, the context variables corresponding to multiple coding units of the same coding tree unit correspond to the same probability state distribution. That is, during the bitrate estimation process, no probability state transition occurs.

[0049] The initial probability model here includes initial probability models corresponding to multiple syntax elements respectively.

[0050] During initialization, the values of pStateIdx and valMPS can be determined by the quantization parameters of multiple CTUs in the slice.

[0051] In some embodiments, step S301 described above includes the following steps:

[0052] First, for a non-first coding tree unit, determine the reference coding tree unit corresponding to this coding tree unit, where the reference coding tree unit is a coding tree unit that has completed entropy coding.

[0053] Second, according to the first probability state distribution after the reference coding tree unit is coded, determine the initial probability model corresponding to each coding unit in this coding tree unit.

[0054] The reference coding tree unit here can be a coding tree unit in the current slice that has completed entropy coding. According to the intra-frame correlation, for the current coding tree unit, one coding tree unit with the greatest correlation with the current coding tree unit can be determined from the multiple coded coding tree units as the reference coding tree unit.

[0055] The above-mentioned reference coding tree unit may be a completed entropy-coded coding tree unit in the slice that is located above and to the left, directly above, above and to the right, to the left, or to the right of the current coding tree unit.

[0056] In some embodiments, each coding tree unit in the slice is coded sequentially according to a certain coding order. Here, the reference coding tree unit may be the Nth coding tree unit counted backwards from the current coding tree unit as the zero point. The above-mentioned N may be an integer such as 1, 2, 3, 4, etc. Schematically, the above-mentioned N may be equal to 4.

[0057] After the coding tree unit determines the final partitioning method or prediction mode, during the formal entropy coding process, according to the rules of the preset protocol, the probability state of the context variable is updated. After the coding tree unit completes entropy coding, the context variable has a corresponding probability state distribution. The probability state distribution corresponding to the context variable after the reference coding tree unit completes entropy coding can be regarded as the first probability state distribution. The above-mentioned first probability state distribution can be set as the initial probability distribution of multiple coding units in the current coding tree unit for rate estimation.

[0058] In these embodiments, for non-first coding tree units, during the rate estimation process, the probability state distribution of the context variable after the reference coding tree unit is entropy-coded can be used as the initial probability distribution of the current coding tree unit, so that the initial probability distribution used in the rate estimation process is related to the probability distribution after historical coding, which can make the subsequent rate estimation have a certain degree of accuracy.

[0059] S302. Determine the first coding lengths corresponding to the target syntax elements in the multiple coding units according to the initial probability model.

[0060] The target syntax element here can be any syntax element. The video coding-related protocol standardizes the organizational structure of each syntax element. The semantics of the syntax element expounds the specific meaning of the syntax element. The syntax element may include, for example: prediction mode, and the prediction mode may specifically include: skip mode, direct mode, inter-frame mode, merge mode, intra-frame mode, etc.; split flag; quantization parameter, etc. Among them, each syntax element has an identifier. For example, the identifier corresponding to the skip mode is skip_flag; the identifier corresponding to the split flag is split_flag, etc.

[0061] In the present disclosure, the rate estimation of the syntax element can be the rate estimation of the value of the binarized syntax element. As a schematic illustration, the above-mentioned syntax element may have a 1-bit value after binarization, that is, the value of the binarized syntax element is "0" or "1".

[0062] The above initial probability model may include initial probability models corresponding to multiple syntax elements. Specifically, for each syntax element, different values of the syntax element correspond to their respective initial probability models (initial probability models of context variables). For the target syntax element, according to the initial probability model corresponding to the syntax element, the initial probability state corresponding to the target syntax element is determined.

[0063] As an implementation manner, step S302 above includes the following steps:

[0064] First, determine the initial probability state index corresponding to the target syntax element.

[0065] Second, according to the initial probability state index, determine the initial probability state corresponding to the context variable of the target syntax element in the initial probability model.

[0066] Finally, look up the first coding length according to the initial probability state in a table.

[0067] In these implementation manners, each coding unit can parallelly determine the first coding length corresponding to the target syntax element therein according to the above steps.

[0068] For each syntax element, various binarization methods can be used to binarize the syntax element to obtain the binarization result of the syntax element. The binarization result of the above syntax element can be the value of the syntax element, or can be referred to as the value of the syntax element. The context index ctxIdx (i.e., the initial probability state index) can be determined according to the binarization result of the syntax element. The initial probability state can be indexed using ctxIdx. The method for determining the context index ctxIdx can be the same as the method for determining ctxIdx in the related art, and will not be elaborated here.

[0069] After obtaining the context index of the value of the target syntax element, the initial probability state pState corresponding to the value of the target syntax element can be determined in the initial probability model according to the above context index. Then, according to the initial probability state, the first coding length of the value of the target syntax element is found in a pre-stored probability model table (also called a code rate estimation table). The above probability model table corresponds to the target element. It can be understood that different values of the target syntax element can determine their respective corresponding first coding lengths through the above manner.

[0070] For steps S301 - S302 above, since multiple coding units use the same initial probability model, that is, during the process of code rate estimation in different coding units, no probability state transition occurs, so the dependency relationship between different coding units is weak. For multiple coding units, the operation of determining the first coding lengths corresponding to the respective target syntax element values in the multiple coding units can be executed in parallel.

[0071] In addition, the probability distributions of different syntax elements can be regarded as independent of each other. Therefore, for the same coding unit, the operations of determining the first coding lengths corresponding to different syntax elements of the coding unit can also be performed in parallel.

[0072] S303. Determine adjustment coefficients corresponding to the first coding lengths of multiple coding units in a preset order; wherein, the adjustment coefficient is related to the quantization parameter of the coding tree unit and is also related to the historical value of the target syntax element after mode decision.

[0073] In step S303, for multiple coding units in the coding tree unit, the adjustment coefficients corresponding to the first coding lengths of the target syntax elements in each coding unit can be determined in a preset order. The above preset order can be, for example, the order of recursion from small blocks to large blocks.

[0074] The historical value of the target syntax element after mode decision can be the value of the target syntax element obtained by RDO mode decision before the current coding unit in the above preset order. Generally, in different coding units, if the value of the target syntax element is the same, it means that the probability of this value increases. If the probability of this value increases, the code rate corresponding to this value should decrease. The adjustment coefficient related to the value of the target syntax element can be determined according to this principle.

[0075] Quantization is the process of mapping the continuous values of a signal into multiple discrete amplitudes, realizing the many-to-one mapping of signal values. After the residual data is transformed, the variation coefficient has a large value range. Quantization can effectively reduce the value range of the signal, thereby obtaining a better compression effect. The quantization process will cause distortion.

[0076] The quantization parameter (Quantizer Parameter, QP) reflects the spatial detail compression situation. If QP is small, most details will be retained and the code rate increases; as QP increases, some details are lost, the code rate decreases, but the image distortion intensifies and the quality deteriorates. That is to say, there is an inverse relationship between QP and the code rate. The value of QP is jointly determined by the resolution of the video, the input frame rate, and the code rate. The quantization parameter QP can determine the quantization step Qstep. The smaller the quantization parameter, the smaller the quantization step, the smaller the quantization loss, and the larger the code rate. The larger the quantization parameter, the larger the quantization step, the larger the quantization loss, and the smaller the code rate. The adjustment coefficient related to the quantization parameter of the current coding tree unit can be determined according to the quantization parameter of the current coding tree unit. Finally, according to the adjustment coefficient related to the quantization parameter and the adjustment coefficient related to the value of the target syntax element, the adjustment coefficient of the target syntax element in the current coding unit is determined.

[0077] S304. For each coding unit, adjust the first coding length of the coding unit by using an adjustment coefficient to obtain the second coding length of the target syntax element in the coding unit.

[0078] For the target syntax element in the coding unit, the above adjustment coefficient can be used to adjust the first coding length, thereby obtaining the second coding length of the target syntax element in the coding unit.

[0079] By using the adjustment coefficient determined in S303 - S304 and adjusting the first coding length with the adjustment coefficient, to a certain extent, the state transition process in CABAC bitrate estimation can be simulated, thereby improving the performance loss of the estimated bitrate obtained by the bitrate estimation method using CFBAC.

[0080] In this embodiment, an initial probability model of context variables is determined for multiple coding units, where the multiple coding units belong to the current coding tree unit; the first coding lengths respectively corresponding to the target syntax elements in the multiple coding units are determined according to the initial probability model; the adjustment coefficients respectively corresponding to the first coding lengths of the multiple coding units are determined in a preset order; wherein, the adjustment coefficient is related to the quantization parameter of the coding tree unit and is related to the historical value of the target syntax element after mode decision; for each coding unit, adjust the first coding length of the coding unit by using the adjustment coefficient to obtain the second coding length of the target syntax element in the coding unit. The first coding lengths of the target syntax elements of each coding unit can be determined in parallel, and the first coding lengths of different coding units are adjusted by using the adjustment coefficient. Since the adjustment coefficient is related to the quantization parameters of the reference coding tree unit and the current coding tree unit, and is related to the coding units in the current coding tree unit for which the bitrate estimation has been completed, the above adjustment coefficient can simulate the state transition process and can match the bitrate differences under different quantization parameters. Thus, the bitrate estimation result can be made more accurate while quickly obtaining the bitrate estimation result, thereby achieving better coding performance.

[0081] Please refer to Figure 4 , which shows a schematic flowchart of another embodiment of the bitrate estimation method provided by the present disclosure. As Figure 4 shown, the bitrate estimation method includes the following steps:

[0082] S401. Determine an initial probability model of context variables for multiple coding units, where the multiple coding units belong to the current coding tree unit.

[0083] S402. Determine the first coding lengths respectively corresponding to the target syntax elements in the multiple coding units according to the initial probability model.

[0084] The specific implementation of the above steps S401 - S402 can refer toFigure 3 The descriptions in steps S301 - S302 in the illustrated embodiments are not elaborated here.

[0085] S403. Determine a first adjustment coefficient according to the first quantization parameter of the current coding tree unit and the second quantization parameter of the reference coding tree unit.

[0086] A coding tree unit may have a quantization parameter (QP). The quantization parameter reflects the process of mapping the continuous values of a signal into multiple discrete amplitudes. One quantization parameter may correspond to a certain quantization step size. Different quantization parameters correspond to different quantization step sizes.

[0087] It can be understood that the smaller the QP, the larger the code rate, and the larger the first adjustment coefficient. Conversely, the larger the QP, the smaller the code rate, and the smaller the first adjustment coefficient.

[0088] The first quantization parameter is the quantization parameter of the current coding tree unit. The second quantization parameter is the quantization parameter of the reference coding tree unit.

[0089] As an implementation, respective corresponding first adjustment coefficients may be set for different combinations of the first quantization parameter and the second quantization parameter, a quantization parameter combination - first adjustment coefficient correspondence table is generated and stored in advance. When performing code rate estimation, the above - mentioned first adjustment coefficient may be determined by looking up the pre - stored quantization parameter combination - first adjustment coefficient correspondence table according to the actual first quantization parameter and the second parameter.

[0090] As another implementation, a QP - first adjustment coefficient expression reflecting the relationship between the first quantization parameter, the second quantization parameter, and the first adjustment coefficient may be generated. When performing code rate estimation, the first adjustment coefficient may be determined according to the actual first quantization parameter, the second quantization parameter, and the above - mentioned QP - first adjustment coefficient expression.

[0091] In addition, the first quantization parameter may also be determined according to the relationship between the first quantization parameter and the second quantization parameter.

[0092] The relationship between the above - mentioned first quantization parameter and the second quantization parameter includes that the first quantization parameter is equal to the second quantization parameter, or the first quantization parameter is not equal to the second quantization parameter.

[0093] The first adjustment coefficient may be determined according to the above - mentioned relationship.

[0094] In some implementations, the above step S403 includes:

[0095] In response to the first quantization parameter being equal to the second quantization parameter, determine a first adjustment coefficient with a value of 1; or

[0096] In response to the first quantization parameter being different from the second quantization parameter, determine a first adjustment coefficient that is negatively correlated with the difference between the first quantization parameter and the second quantization parameter.

[0097] Specifically, the above-mentioned first adjustment coefficient Zf can be characterized by the following formula:

[0098] where

[0099] Z0 is an empirical value and Z0 is less than or equal to 1; QPcurr is the first quantization parameter of the current coding tree unit, and QPprev is the second quantization parameter of the reference coding tree unit.

[0100] When the first quantization parameter is equal to the second quantization parameter, Z0 = 1; when the first quantization parameter is not equal to the second quantization parameter, Z0 = 0.98.

[0101] That is to say, if the first quantization parameter is equal to the second quantization parameter, there is no need to make a quantization parameter-related adjustment to the bit rate.

[0102] According to the above formula (1), the larger the QP, the larger the λ, and the larger the proportion of the bit rate in RdCost. In order to balance with the distortion, the larger the QP, the smaller the bit rate R should be. When the first quantization parameter is not equal to the second quantization parameter, according to the above formula (2), the larger the difference between the first quantization parameter and the second quantization parameter, the smaller the above-mentioned first adjustment coefficient Zf, so as to achieve the effect of reducing the bit rate when QP increases.

[0103] S404. Obtain the updated second adjustment coefficient of the historical coding unit in the preset order after determining the value of the target syntax element through mode decision, and use the updated second adjustment coefficient as the initial second adjustment coefficient of the target syntax element in the current coding unit.

[0104] The above-mentioned preset order includes that for different sub-coding units in the same parent coding unit, the second adjustment coefficients of each sub-coding unit can be determined in a "Z"-shaped order.

[0105] Please combine Figure 5 to understand the above-mentioned preset order. Figure 5 Shows a schematic diagram of the coding units obtained by quadtree partitioning of a CTU. Calculate the cost of each CU inside the current CTU in the "Z"-scan order, and calculate the bit rate adjustment coefficient in this order.

[0106] Assume that the current block is the first 32×32 coding unit inside the CTU. This coding unit is divided into multiple sub-blocks (sub-coding units). As Figure 5As shown, the above-mentioned sub-blocks include: 21 sub-blocks numbered 0, 1, 2, 3, …, 20. The unit of the size of each sub-block can be pixel × pixel. Among them, sub-blocks numbered 0, 1, 2, 3 are blocks with a size of 8×8, and the parent block corresponding to these four 8×8 blocks is the block numbered 4. Sub-blocks numbered 5, 6, 7, 8 are blocks with a size of 8×8, and the parent block corresponding to these four 8×8 blocks is the block numbered 9. Sub-blocks numbered 10, 11, 12, 13 are blocks with a size of 8×8, and the parent block corresponding to these four 8×8 blocks is the block numbered 14. Sub-blocks numbered 15, 16, 17, 18 are blocks with a size of 8×8. The parent block of these four 8×8 blocks is the block numbered 19. Blocks numbered 4, 9, 14, 19 are respectively blocks with a size of 16×16. The parent block of these four 16×16 blocks is the block numbered 20. The block numbered 20 has a size of 32×32.

[0107] The above preset order is the Z-scan order, and the above preset order is as follows: four 8×8 blocks (0, 1, 2, 3), one 16×16 block (4); four 8×8 blocks (5, 6, 7, 8), one 16×16 block (9); four 8×8 blocks (10, 11, 12, 13), one 16×16 block (14); four 8×8 blocks (15, 16, 17, 18), one 16×16 block (19); one block with a size of 32×32 (20).

[0108] In a parent coding unit, the initial second adjustment coefficient of the parent coding unit can be the same as the initial second adjustment coefficient of the first coding unit belonging to this parent coding unit.

[0109] It should be noted that the second adjustment coefficient of the target syntax element can include the second adjustment coefficients corresponding to different values of the target syntax element.

[0110] The initial second adjustment parameter corresponding to the first coding unit of the current coding tree unit can be assigned according to experience. When performing rate estimation on the first coding unit, for the better value in this coding unit, a decision can be made according to the RDO method. After determining the better value of the target syntax element according to the RDO method, the initial second adjustment coefficient is updated according to the specified update rule. For subsequent coding units, the updated second adjustment coefficient corresponding to the historical coding unit of the coding unit that has completed rate estimation can be used as the initial second adjustment coefficient.

[0111] The historical coding unit here can be the previous coding unit in the process of rate estimation in accordance with the preset order.

[0112] In the scenario of judging the CTU partition mode, the above historical coding unit can be the previous coding unit among the coding units retained after the preliminary mode partition judgment.

[0113] The historical coding unit here can be the previous coding unit retained through mode decision.

[0114] S405. Determine the adjustment coefficient of the first coding length in the current coding unit based on the first adjustment coefficient and the initial second adjustment coefficient.

[0115] As an implementation manner, the product between the first adjustment coefficient and the initial second adjustment coefficient can be used as the above-mentioned adjustment coefficient of this coding unit.

[0116] F = Z f ×T ff (3); where

[0117] F is the adjustment coefficient corresponding to the value of the target syntax element in the current coding unit, and T ff is the initial second adjustment coefficient corresponding to the value of the target syntax element in the current coding unit.

[0118] S406. For each coding unit, adjust the first coding length of this coding unit by using the adjustment coefficient to obtain the second coding length of the target syntax element in this coding unit.

[0119] Specifically, the above-mentioned adjustment of the first coding length by using the adjustment coefficient can be represented by the following formula (4):

[0120] R = R p ×F (4); where

[0121] R p is the first coding length; R is the second coding length.

[0122] Compared with the embodiment Figure 3 shown, this embodiment further elaborates the steps of determining the adjustment coefficient according to the first quantization parameter and the second quantization parameter and according to the historical value of the target syntax element, so that the adjustment coefficient is related to the quantization parameter and the value of the target syntax element in the historical coding unit of the current coding unit, making the adjustment coefficient closer to the probability state transition process, and thus making the code rate estimation have higher accuracy.

[0123] In some embodiments, the above-mentioned code rate estimation method further includes the following steps:

[0124] Update the initial second adjustment coefficient of the target syntax element in the current coding unit according to the relationship between the respective values of the target syntax element in the current coding unit and in the historical coding unit; where the value is the value after mode decision.

[0125] As an implementation, the initial second adjustment coefficient of the target syntax element in the current coding unit is updated according to the relationship between the respective values of the target syntax element in the current coding unit and in the historical coding unit, including:

[0126] If the relationship indicates that the respective values of the target syntax element in the current coding unit and in the historical coding unit are the same, reduce the second adjustment coefficient to obtain the updated second adjustment coefficient;

[0127] If the relationship indicates that the respective values of the target syntax element in the current coding unit and in the historical coding unit are different, increase the second adjustment coefficient to obtain the updated second adjustment coefficient.

[0128] If the value of the target syntax element in the current coding unit is the same as that in the historical coding unit, then this value appears repeatedly and the bit rate decreases. Therefore, the second adjustment coefficient can be reduced to achieve the purpose of reducing the bit rate.

[0129] If the value of the target syntax element in the current coding unit is different from that in the historical unit, then this value changes and the bit rate increases. Therefore, the second adjustment coefficient can be increased to achieve the purpose of increasing the bit rate.

[0130] Please refer to Figure 6 which shows the flowchart for updating the second adjustment coefficient. As Figure 6 shown, for the current coding unit, set the initial second adjustment coefficient T ff . For different values of the target syntax element, the respective corresponding initial second adjustment coefficients are assigned. For the "0" value (binVal = 0) of the target element, the corresponding initial second adjustment coefficient is T ff0 . For the "1" value (binVal = 1) of the target element, the corresponding initial second adjustment coefficient is T ff1 . For non-first coding units, the T ff0 , T ff1 are respectively the updated second adjustment coefficients T" ff0 and T" ff1 of the historical coding unit after determining the better value of the target syntax element through RDO decision. For the T ff0 and T ff1 of the first coding unit, they can be values set according to experience. The second coding length of the target element in this coding unit can be determined using this initial second adjustment coefficient. Then, pre-encoding is performed on this coding unit according to the second coding length. The distortion is calculated according to the pre-encoding result. Then, the RDCost is calculated according to formula (1). Select the value with the smaller RDcost value as the better value of the target syntax element. According to this better value, for T ff0 and T ff1Update to obtain the updated second adjustment coefficient T" of the current coding unit ff0 and T" ff1 .

[0131] During the update, if the determined optimal value is equal to 0 (binVal = 0), determine the first update parameters corresponding to each value of the target syntax element, and then update the initial second adjustment coefficients of each value according to the above first update parameters to obtain the updated second adjustment coefficients T" of each value ff0 and T" ff1 . If the determined optimal value is equal to 1 (binVal = 1), determine the second update parameters corresponding to each value of the target syntax element, and then update the initial second adjustment coefficients of each value according to the above second update parameters to obtain the updated second adjustment coefficients T" of each value ff0 and T" ff1 .

[0132] Traverse each coding unit in the current coding tree unit in the preset order until the last coding unit is reached.

[0133] The following combines Figure 5 Taking the bitrate estimation of the target syntax element as frame - skip_flag as an example to illustrate the process of updating the second adjustment coefficient. The values of skip_flag can be 0 (denoted as binVal0) and 1 (denoted as binVal1).

[0134] Assume that the initial estimated bitrates (the first coding lengths) of binVal 0 and binVal 1 are R p0 、R p1 , assume that the QP of the current CTU and the reference CTU is the same, then Z0 = 1, Z f = 1.

[0135] The initial value of the initial second adjustment coefficient T ff is set to an empirical value: T0 = 0.98;

[0136] For cu0, when skip_flag is 0, the initial second adjustment coefficient T ff is: T ff0 = (T0) 0 ; the bitrate is: R0 = R p0 ×T ff0 .

[0137] When skip_flag is 1, the initial second adjustment coefficient T ff is: T ff1 = (T0) 0 ; the bitrate is: R1 = R p1 ×T ff1 .

[0138] If the RdCost decision comparing skip_flag results in skip_flag being 1, the first update parameter corresponding to binVal0 is T0; the second update parameter corresponding to binVal1 is In this way, the updated second adjustment coefficient is:

[0139] T" ff0 = T0,

[0140] For cu1, when skip_flag is 0, the code rate is: R0 = R p0 × T ff0 ;

[0141] When skip_flag is 1, the code rate is: R1 = R p1 × T ff1 ;

[0142] Here, T ff0 and T ff1 are respectively the updated second adjustment coefficients T" ff0 and T" ff1 .

[0143] If the RdCost decision comparing skip_flag results in skip_flag being 0, the second update parameter corresponding to binVal1 is T0; the first update parameter corresponding to binVal0 is According to the above update coefficient, the initial second adjustment coefficient is updated, and the updated second adjustment coefficient is:

[0144] T" ff1 = T ff1 × T0.

[0145] For cu2, when skip_flag is 0, the code rate is: R0 = R p0 × T ff0 ;

[0146] When skip_flag is 1, the code rate is: R1 = R p1 × T ff1 ;

[0147] Here, T ff0 and T ff1 are respectively the updated second adjustment coefficients T" ff0 and T" ff1 .

[0148] If the RdCost decision comparing skip_flag results in skip_flag being 0, the second update parameter corresponding to binVal1 is T0; the first update parameter corresponding to binVal0 is Update the initial second adjustment coefficient according to the above update coefficient, and the updated second adjustment coefficient is:

[0149] T" ff1 = T ff1 × T0.

[0150] For cu3, when skip_flag is 0, the code rate is: R0 = R p0 × T ff0 ;

[0151] When skip_flag is 1, the code rate is: R1 = R p1 × T ff1 ;

[0152] Here, T ff0 and T ff1 are respectively the updated second adjustment coefficients T" ff0 and T" ff1 .

[0153] If the RdCost decision comparing skip_flag results in skip_flag being 1, the second update parameter corresponding to binVal0 is T0; the first update parameter corresponding to binVal1 is Update the initial second adjustment coefficient according to the above update coefficient, and the updated second adjustment coefficient is:

[0154] T" ff0 = T ff0 × T0,

[0155] For cu4, since this 16×16 block and the four 8×8 blocks are in a parent - child relationship, the second adjustment coefficient is the same as that of cu0.

[0156] For cu4, when skip_flag is 0, the initial second adjustment coefficient T ff : T ff0 = (T0) 0 ; The code rate is: R0 = R p0 × T ff0 ;

[0157] When skip_flag is 1, the initial second adjustment coefficient T ff : T ff1 = (T0) 0 ; The code rate is: R p1×T ff1 ;

[0158] If the RdCost judgment comparing skip_flag results in skip_flag being 1, the updated second adjustment coefficient is:

[0159] T" ff0 = T0,

[0160] Next, update the next 8×8 or 16×16 initial second adjustment coefficient through a simple preliminary division judgment. By comparing the sum of the costs of 4 calculated 8×8s with the cost of 1 16×16, if the cost of 4 8×8s is less than that of 16×16, the initial second adjustment coefficient T of cu5 and cu9 ff Take the T obtained by updating cu3 ff0 , T ff1 ; Otherwise, take the T obtained by updating cu4 ff0 , T ff1 .

[0161] For cu5, when skip_flag is 0, the initial second adjustment coefficient T ff is: T ff0 = T ff0 ; The code rate is: R0 = R p0 ×T ff0 .

[0162] When skip_flag is 1, the initial second adjustment coefficient T ff is: T ff1 = T ff1 ; The code rate is: R0 = R p1 ×Tf1.

[0163] If the RdCost judgment comparing skip_flag results in skip_flag being 1, the second update parameter corresponding to binVal0 is T0; the first update parameter corresponding to binVal1 is Update the initial second adjustment coefficient according to the above update coefficient. The updated second adjustment coefficient is:

[0164] T" ff0 = T ff0 ×T0,

[0165] For cu6, when skip_flag is 0, the code rate is: R0 = R p0 ×T ff0 ;

[0166] When skip_flag is 1, the code rate is: R1 = R p1 ×Tff1 ;

[0167] The T here ff0 and T ff1 are respectively the updated second adjustment coefficients T" obtained by cu5 ff0 and T" ff1 .

[0168] If the RdCost judgment comparing skip_flag results in skip_flag being 0, according to the above rules, the updated second adjustment coefficient is:

[0169] T" ff1 = T ff1 × T0.

[0170] For cu7, when skip_flag is 0, the code rate is: R0 = R p0 × T ff0 ;

[0171] When skip_flag is 1, the code rate is: R1 = R p1 × T ff1 .

[0172] The T here ff0 and T ff1 are respectively the updated second adjustment coefficients T" obtained by cu6 ff0 and T" ff1 .

[0173] If the RdCost judgment comparing skip_flag results in skip_flag being 0, according to the above rules, the updated second adjustment coefficient is:

[0174] T" ff1 = T ff1 × T0.

[0175] For cu8, when skip_flag is 0, the code rate is: R0 = R p0 × T ff0 ;

[0176] When skip_flag is 1, the code rate is: R1 = R p1 × T ff1 ;

[0177] The T here ff0 and T ff1 are respectively the updated second adjustment coefficients T" obtained by cu7 ff0 and T" ff1 .

[0178] If the RdCost judgment of comparing skip_flag results in skip_flag being 1, according to the above rules, the updated second adjustment coefficient is obtained as follows:

[0179] T" ff0 = T ff0 × T0,

[0180] For cu9, since the 16x16 block and the four 8×8 blocks are in a parent - child relationship, the initial second adjustment coefficient is the same as that of cu5.

[0181] After calculating cu9, update the initial second adjustment coefficient of the next 8×8 or 16×16 block to be calculated through a simple division judgment.

[0182] Repeat the above process until the RdCost of all CUs is calculated.

[0183] In some embodiments, the bit - rate estimation method is applied to the coding unit partition mode; wherein, multiple coding units are multiple candidate coding units corresponding to the current coding tree unit; the target syntax element is a split syntax element used to indicate whether to continue splitting the coding unit; the first coding length corresponding to each coding unit includes the first coding length of the split syntax element; and the bit - rate estimation method further includes the following steps:

[0184] First, for different coding modes, the second coding lengths corresponding to different values of the split syntax element of the current coding unit.

[0185] Second, according to the second coding length and the rate - distortion optimization algorithm, determine the costs of different values of the split syntax element.

[0186] Third, according to the costs corresponding to different coding methods respectively, determine the target coding mode.

[0187] Finally, in the target coding mode, according to the costs of different values of the split syntax element of different coding units with a parent - child relationship, determine the target partition mode of the current coding tree unit.

[0188] Please refer to Figure 7 , Figure 7 is a schematic flowchart of CTU partitioning. As Figure 7 shown, for multiple coding units, the first coding lengths corresponding to different values of the split syntax element (split_flag) indicating whether to perform splitting in a coding unit are determined by steps S301 - S302.

[0189] Determine that in different coding modes, different values of the split syntax element use Figure 3 the steps S303 - S304 shown orFigure 4 In steps S403 - S406 of the steps shown, the second coding lengths (residual code rate estimation) corresponding to different values of the target syntax element in each coding mode (such as the intra mode, inter mode, and IBC mode shown) in the current coding unit are determined. Figure 7 For each mode, the RDcosts corresponding to different values of the split syntax element are calculated respectively, and then the target coding mode is determined according to the above RDcosts of each mode.

[0190] After determining the target coding mode, in the target coding mode, for a parent block, the sum of the RDcosts of different values (partition types) of the split syntax element under the parent block, and the RDcosts of different values of the parent block are calculated. The target value of the split syntax element of the parent block is determined by comparing the sum of the RDcosts of different child blocks with the RDcost of the parent block. Furthermore, it is determined whether the parent block is split into multiple child blocks.

[0191] Corresponding to the information processing method in the above

[0192] embodiment, Figure 3 it is a schematic structural block diagram of a code rate estimation device provided by an embodiment of the present disclosure. For ease of description, only parts related to the embodiments of the present disclosure are shown. Referring to Figure 8 , device 80 includes: a first determination unit 801, a second determination unit 802, a third determination unit 803, and an adjustment unit 804. Among them, Figure 8 , the first determination unit 801 is configured to determine an initial probability model of context variables for a plurality of coding units, where the plurality of coding units belong to the current coding tree unit;

[0193] The second determination unit 802 is configured to determine the first coding lengths corresponding to the target syntax elements in the plurality of coding units according to the initial probability model;

[0194] The third determination unit 803 is configured to determine adjustment coefficients corresponding to the first coding lengths of the plurality of coding units in a preset order; where the adjustment coefficient is related to the quantization parameter of the coding tree unit and is related to the historical values of the target syntax element after mode decision;

[0195] The adjustment unit 804 is configured to, for each coding unit, adjust the first coding length of the coding unit by using the adjustment coefficient to obtain the second coding length of the target syntax element in the coding unit.

[0196] In an embodiment of the present disclosure, the first determination unit 801 is further configured to:

[0197]

[0198] ​For a non-first coding tree unit, determine the reference coding tree unit corresponding to the coding tree unit, where the reference coding tree unit is a coding tree unit for which entropy coding has been completed;

[0199] According to the first probability state distribution after the reference coding tree unit is coded, determine the initial probability model corresponding to each coding unit in the coding tree unit.

[0200] In an embodiment of the present disclosure, the second determination unit 802 is further configured to:

[0201] Determine the initial probability state index corresponding to the target syntax element;

[0202] According to the initial probability state index, determine the initial probability state corresponding to the context variable of the target syntax element in the initial probability model;

[0203] Look up the first coding length according to the initial probability state in a table.

[0204] In an embodiment of the present disclosure, the third determination unit 803 is further configured to:

[0205] Determine a first adjustment coefficient according to the first quantization parameter of the current coding tree unit and the second quantization parameter of the reference coding tree unit;

[0206] Obtain the updated second adjustment coefficient of the historical coding unit in the preset order after determining the value of the target syntax element through mode decision, and use the updated second adjustment coefficient as the initial second adjustment coefficient of the target syntax element in the current coding unit;

[0207] Based on the first adjustment coefficient and the initial second adjustment coefficient, determine the adjustment coefficient of the first coding length in the current coding unit.

[0208] In an embodiment of the present disclosure, the third determination unit 803 is further configured to:

[0209] Update the initial second adjustment coefficient of the target syntax element in the current coding unit according to the relationship between the values of the target syntax element in the current coding unit and in the historical coding unit; where the value is the value after mode decision.

[0210] In an embodiment of the present disclosure, the third determination unit 803 is further configured to:

[0211] If the relationship indicates that the values of the target syntax element in the current coding unit and in the historical coding unit are the same, decrease the second adjustment coefficient to obtain the updated second adjustment coefficient;

[0212] If the relationship indicates that the respective values of the target syntax element in the current coding unit and in the historical coding unit are different, increase the second adjustment coefficient to obtain an updated second adjustment coefficient.

[0213] In one embodiment of the present disclosure, the third determination unit 803 is further configured to:

[0214] In response to the first quantization parameter being equal to the second quantization parameter, determine a first adjustment coefficient with a value of 1; or

[0215] In response to determining that the first quantization parameter is different from the second quantization parameter, determine a first adjustment coefficient that is negatively correlated with the difference between the first quantization parameter and the second quantization parameter.

[0216] In one embodiment of the present disclosure, the bitrate estimation device can be used in one of the following modes:

[0217] Coding unit partitioning decision mode;

[0218] Prediction mode.

[0219] In some embodiments, the bitrate estimation method is applied in the coding unit partitioning mode; wherein, the multiple coding units are multiple candidate coding units corresponding to the current coding tree unit; the target syntax element is a partitioning syntax element used to indicate whether to continue splitting the coding unit; the first coding length corresponding to each coding unit includes the first coding length of the partitioning syntax element. The device 80 further includes a partitioning mode determination unit (not shown in the figure). The partitioning mode determination unit is configured to:

[0220] Determine the second coding lengths corresponding to different values of the partitioning syntax element in different coding modes;

[0221] According to the second coding lengths and according to the rate-distortion optimization algorithm, determine the costs of different values of the partitioning syntax element;

[0222] According to the costs corresponding to different coding methods respectively, determine the target coding mode;

[0223] In the target coding mode, according to the costs of different values of the partitioning syntax element of different coding units with a parent-child relationship, determine the target partitioning mode of the current coding tree unit.

[0224] Reference Figure 9, which shows a schematic structural diagram of an electronic device 900 suitable for implementing the embodiments of the present disclosure. The electronic device 900 may be a terminal device or a server. Among them, the terminal device may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (PADs), portable media players (PMPs), in-vehicle terminals (such as in-vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 9 The electronic device shown is merely an example and should not impose any limitations on the functions and usage scope of the embodiments of the present disclosure.

[0225] As Figure 9 shown, the electronic device 900 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 901, which may perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 902 or the program loaded from the storage device 908 into the random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the electronic device 900 are also stored. The processing device 901, the ROM 902, and the RAM 903 are connected to each other through a bus 904. The input / output (I / O) interface 905 is also connected to the bus 904.

[0226] Generally, the following devices may be connected to the I / O interface 905: an input device 906 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 907 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 908 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 909. The communication device 909 may allow the electronic device 900 to communicate with other devices wirelessly or wiredly to exchange data. Although Figure 9 the electronic device 900 with various devices is shown, it should be understood that it is not required to implement or have all the shown devices. More or fewer devices may be implemented or had alternatively.

[0227] In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, an embodiment of the present disclosure includes a computer program product that includes a computer program carried on a computer-readable medium, and the computer program includes program codes for performing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from the network via the communication device 909, or installed from the storage device 908, or installed from the ROM 902. When the computer program is executed by the processing device 901, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.

[0228] It should be noted that the above-mentioned computer-readable medium in the present disclosure can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium can include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, the computer-readable storage medium can be any tangible medium that contains or stores a program, and the program (computer-executable instructions) can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present disclosure, a computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program codes. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, and the computer-readable signal medium can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program codes contained on the computer-readable medium can be transmitted by any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0229] The above-mentioned computer-readable medium can be included in the above-mentioned electronic device; or it can exist separately and not be assembled into the electronic device.

[0230] The above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the electronic device, the electronic device is caused to perform the methods shown in the above embodiments.

[0231] Computer program code for performing the operations of this disclosure may be written in one or more programming languages or combinations thereof. The above-mentioned programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, execute as a stand-alone software package, partly on the user's computer and partly on a remote computer, or execute entirely on a remote computer or server. In the case of a remote computer, the remote computer may 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 it may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0232] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than that marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, may be implemented by a dedicated hardware-based system that performs the specified functions or operations, or may be implemented by a combination of dedicated hardware and computer instructions.

[0233] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, by way of non-limitation, exemplary types of hardware logic components that may be used include: Field Programmable Gate Arrays (FPGA), Application Specific Integrated Circuits (ASIC), Application Specific Standard Products (ASSP), System on a Chip (SOC), Complex Programmable Logic Devices (CPLD), and so on.

[0234] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0235] The foregoing can be better understood in accordance with the following clauses:

[0236] Clause A1. A bitrate estimation method, comprising: determining an initial probability model of context variables for a plurality of coding units, wherein the plurality of coding units belong to a current coding tree unit;

[0237] Determining first coding lengths respectively corresponding to target syntax elements in the plurality of coding units according to the initial probability model;

[0238] Determining adjustment coefficients respectively corresponding to the first coding lengths of the plurality of coding units in a preset order; wherein the adjustment coefficient is related to the quantization parameter of the coding tree unit and is related to the historical value of the target syntax element after pattern decision;

[0239] For each coding unit, adjusting the first coding length of the coding unit by using the adjustment coefficient to obtain a second coding length of the target syntax element in the coding unit.

[0240] Clause A2. The method according to Clause A1, determining an initial probability model of context variables for a plurality of coding units, comprising: for a non-first coding tree unit, determining a reference coding tree unit corresponding to the coding tree unit, the reference coding tree unit being a coding tree unit that has completed entropy coding; determining an initial probability model respectively corresponding to each coding unit in the coding tree unit according to the first probability state distribution after the reference coding tree unit completes coding.

[0241] Clause A3. The method according to Clause A1, determining first coding lengths respectively corresponding to target syntax elements in the plurality of coding units according to the initial probability model, comprising:

[0242] Determining an initial probability state index corresponding to the target syntax element;

[0243] Determine the initial probability state corresponding to the context variable of the target syntax element in the initial probability model according to the initial probability state index;

[0244] Look up the first coding length according to the initial probability state in a table.

[0245] Clause A4. According to the method of Clause A1, determine the adjustment coefficients corresponding to the first coding lengths of multiple coding units respectively in a preset order; wherein, the adjustment coefficient is related to the quantization parameter of the coding tree unit and is related to the historical value of the target syntax element after pattern decision, including:

[0246] Determine the first adjustment coefficient according to the first quantization parameter of the current coding tree unit and the second quantization parameter of the reference coding tree unit;

[0247] Obtain the updated second adjustment coefficient of the historical coding unit in the preset order after determining the value of the target syntax element through pattern decision, and use the updated second adjustment coefficient as the initial second adjustment coefficient of the target syntax element in the current coding unit;

[0248] Based on the first adjustment coefficient and the initial second adjustment coefficient, determine the adjustment coefficient of the first coding length in the current coding unit.

[0249] Clause A5. According to the method of Clause A4, the method further includes:

[0250] Update the initial second adjustment coefficient of the target syntax element in the current coding unit according to the relationship between the value of the target syntax element in the current coding unit and its value in the historical coding unit; wherein, the value is the value after pattern decision.

[0251] Clause A6. According to the method of Clause A5, update the second adjustment coefficient of the target syntax element in the current coding unit according to the relationship between the value of the target syntax element in the current coding unit and its value in the historical coding unit, including:

[0252] If the relationship indicates that the values of the target syntax element in the current coding unit and in the historical coding unit are the same, decrease the second adjustment coefficient to obtain the updated second adjustment coefficient;

[0253] If the relationship indicates that the values of the target syntax element in the current coding unit and in the historical coding unit are different, increase the second adjustment coefficient to obtain the updated second adjustment coefficient.

[0254] Clause A7. According to the method of Clause A4, determine the first adjustment coefficient according to the first quantization parameter and the second quantization parameter of the reference coding tree unit, including:

[0255] In response to the first quantization parameter being equal to the second quantization parameter, determine a first adjustment coefficient with a value of 1; or

[0256] In response to determining that the first quantization parameter is different from the second quantization parameter, determine a first adjustment coefficient that is negatively correlated with the difference between the first quantization parameter and the second quantization parameter.

[0257] Clause A8. According to the method of Clause A1, the bitrate estimation method is applied in one of the following modes:

[0258] Coding unit partition mode;

[0259] Prediction mode.

[0260] Clause A9. According to the method of any one of Clauses A1 to A8, the bitrate estimation method is applied in the coding unit partition mode; wherein, multiple coding units are multiple candidate coding units corresponding to the current coding tree unit; the target syntax element is a splitting syntax element used to indicate whether to continue splitting the coding unit; the first coding length corresponding to each coding unit includes the first coding length of the splitting syntax element; and the method further includes:

[0261] For the current coding unit, determine the second coding lengths corresponding to different values of the splitting syntax element in different coding modes;

[0262] According to the second coding length and according to the rate-distortion optimization algorithm, determine the costs corresponding to different values of the splitting syntax element;

[0263] According to the costs corresponding to different coding methods respectively, determine the target coding mode;

[0264] In the target coding mode, according to the costs corresponding to different values of the splitting syntax element of different coding units with a parent-child relationship, determine the target partition mode of the current coding tree unit.

[0265] Clause A10. A bitrate estimation device, comprising: a first determination unit for determining an initial probability model of context variables for multiple coding units, wherein the multiple coding units belong to the current coding tree unit;

[0266] A second determination unit for determining the first coding lengths corresponding to the target syntax elements in the multiple coding units according to the initial probability model;

[0267] A third determination unit for determining the adjustment coefficients corresponding to the first coding lengths of the multiple coding units in a preset order; wherein, the adjustment coefficient is related to the quantization parameter of the coding tree unit and is related to the historical values of the target syntax element after mode decision;

[0268] An adjustment unit, configured to, for each coding unit, adjust the first coding length of the coding unit by using an adjustment coefficient to obtain the second coding length of a target syntax element in the coding unit.

[0269] Clause A11. The apparatus according to Clause A10, wherein the first determination unit is further configured to:

[0270] For a non-first coding tree unit, determine a reference coding tree unit corresponding to the coding tree unit, where the reference coding tree unit is a coding tree unit that has completed entropy coding;

[0271] According to the first probability state distribution after the reference coding tree unit completes coding, determine initial probability models respectively corresponding to the coding units in the coding tree unit.

[0272] Clause A12. The apparatus according to Clause A10, wherein the second determination unit is further configured to:

[0273] Determine an initial probability state index corresponding to the target syntax element;

[0274] According to the initial probability state index, determine an initial probability state corresponding to a context variable of the target syntax element in the initial probability model;

[0275] Look up a table according to the initial probability state to obtain a first coding length.

[0276] Clause A13. The apparatus according to Clause A10, wherein the third determination unit is further configured to:

[0277] According to a first quantization parameter of the current coding tree unit and a second quantization parameter of the reference coding tree unit, determine a first adjustment coefficient;

[0278] Obtain a second adjustment coefficient updated after a historical coding unit in a preset order determines a value of a target syntax element through mode decision, and use the updated second adjustment coefficient as an initial second adjustment coefficient of the target syntax element in the current coding unit;

[0279] Based on the first adjustment coefficient and the initial second adjustment coefficient, determine an adjustment coefficient for the first coding length in the current coding unit.

[0280] Clause A14. The apparatus according to Clause A13, wherein the third determination unit is further configured to:

[0281] According to a relationship between values of the target syntax element in the current coding unit and in the historical coding unit respectively, update the initial second adjustment coefficient of the target syntax element in the current coding unit; wherein the values are the values after mode decision.

[0282] Clause A15. The apparatus according to Clause A14, wherein the third determination unit is further configured to:

[0283] If the relationship indicates that the respective values of the target syntax element in the current coding unit and in the historical coding unit are the same, reduce the second adjustment coefficient to obtain an updated second adjustment coefficient;

[0284] If the relationship indicates that the respective values of the target syntax element in the current coding unit and in the historical coding unit are different, increase the second adjustment coefficient to obtain an updated second adjustment coefficient.

[0285] Clause A16. For the apparatus according to Clause A13, the third determination unit is further configured to:

[0286] In response to the first quantization parameter being equal to the second quantization parameter, determine a first adjustment coefficient with a value of 1; or

[0287] In response to determining that the first quantization parameter is different from the second quantization parameter, determine a first adjustment coefficient that is negatively correlated with the difference between the first quantization parameter and the second quantization parameter.

[0288] Clause A17. For the apparatus according to Clause A10, the bitrate estimation apparatus can be used in one of the following modes:

[0289] Coding unit partitioning decision mode;

[0290] Prediction mode.

[0291] Clause A18. For the apparatus according to any one of Clauses A10 to A17, the bitrate estimation method is applied in the coding unit partitioning mode; wherein, the multiple coding units are multiple candidate coding units corresponding to the current coding tree unit; the target syntax element is a splitting syntax element used to indicate whether to continue splitting the coding unit; the first coding length corresponding to each coding unit includes the first coding length of the splitting syntax element; the bitrate estimation apparatus further includes a partitioning mode determination unit; the partitioning mode determination unit is configured to:

[0292] For the current coding unit, determine the second coding lengths corresponding to different values of the splitting syntax element in different coding modes;

[0293] According to the second coding lengths and according to the rate-distortion optimization algorithm, determine the costs of different values of the splitting syntax element;

[0294] According to the costs corresponding to different coding methods respectively, determine the target coding mode;

[0295] In the target coding mode, according to the costs of different values of the splitting syntax element of different coding units with a parent-child relationship, determine the target partitioning mode of the current coding tree unit.

[0296] Clause A19. An electronic device, comprising: a processor and a memory;

[0297] The memory stores computer-executable instructions;

[0298] The processor executes the computer-executable instructions stored in the memory, such that the processor executes the method according to any one of Clauses A1 to A8.

[0299] Clause A20. A computer-readable storage medium stores computer-executable instructions, and when the processor executes the computer-executable instructions, the method according to any one of Clauses A1 to A8 is implemented.

[0300] Clause A21. A computer program product includes a computer program, and when the computer program is executed by the processor, the method according to any one of Clauses A1 to A8 is implemented.

[0301] The above specific embodiments do not constitute a limitation on the protection scope of the present disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principle of the present disclosure shall be included within the protection scope of the present disclosure.

Claims

1. A bit rate estimation method, characterized in that, Including: Determining an initial probability model of context variables for a plurality of coding units, where the plurality of coding units belong to a current coding tree unit; Determining first coding lengths respectively corresponding to target syntax elements in the plurality of coding units according to the initial probability model; Determining adjustment coefficients respectively corresponding to the first coding lengths of the plurality of coding units in a preset order; wherein the adjustment coefficient is related to a quantization parameter of the coding tree unit and is related to a historical value of the target syntax element after mode decision; For each coding unit, adjusting the first coding length of the coding unit by using the adjustment coefficient to obtain a second coding length of the target syntax element in the coding unit.

2. The method according to claim 1, wherein The determining an initial probability model of context variables for a plurality of coding units includes: For a non-first coding tree unit, determining a reference coding tree unit corresponding to the coding tree unit, where the reference coding tree unit is a coding tree unit that has completed entropy coding; Determining an initial probability model respectively corresponding to each coding unit in the coding tree unit according to a first probability state distribution after the reference coding tree unit completes coding.

3. The method according to claim 1, characterized in that The determining first coding lengths respectively corresponding to target syntax elements in the plurality of coding units according to the initial probability model includes: Determining an initial probability state index corresponding to the target syntax element; Determining an initial probability state corresponding to a context variable of the target syntax element in the initial probability model according to the initial probability state index; Looking up the table according to the initial probability state to obtain the first coding length.

4. The method according to claim 1, characterized in that The determining adjustment coefficients respectively corresponding to the first coding lengths of the plurality of coding units in a preset order includes: Determining a first adjustment coefficient according to a first quantization parameter of the current coding tree unit and a second quantization parameter of the reference coding tree unit; Obtaining an updated second adjustment coefficient of a historical coding unit in the preset order after determining the value of the target syntax element through mode decision, and using the updated second adjustment coefficient as an initial second adjustment coefficient of the target syntax element in the current coding unit; Determining an adjustment coefficient of the first coding length in the current coding unit based on the first adjustment coefficient and the initial second adjustment coefficient.

5. The method according to claim 4, wherein The method further includes: Updating an initial second adjustment coefficient of the target syntax element in the current coding unit according to a relationship between values of the target syntax element in the current coding unit and in the historical coding unit; wherein the value is a value after mode decision.

6. The method according to claim 5, wherein Updating the second adjustment coefficient of the target syntax element in the current coding unit according to a relationship between values of the target syntax element in the current coding unit and in the historical coding unit includes: If the relationship indicates that the values of the target syntax element in the current coding unit and in the historical coding unit are the same, reducing the second adjustment coefficient to obtain an updated second adjustment coefficient; If the relationship indicates that the values of the target syntax element in the current coding unit and in the historical coding unit are different, increasing the second adjustment coefficient to obtain an updated second adjustment coefficient.

7. The method according to claim 4, wherein Determining a first adjustment coefficient according to the first quantization parameter and the second quantization parameter of a reference coding tree unit includes: In response to the first quantization parameter being equal to the second quantization parameter, determining a first adjustment coefficient with a value of 1; or In response to determining that the first quantization parameter is different from the second quantization parameter, determining a first adjustment coefficient that is negatively correlated with the difference between the first quantization parameter and the second quantization parameter.

8. The method according to claim 1, wherein The bitrate estimation method is applied in one of the following modes: Coding unit partitioning mode; Prediction mode.

9. The method according to any one of claims 1-8, characterized in that, The bitrate estimation method is applied in the coding unit partitioning mode; wherein, the multiple coding units are multiple candidate coding units corresponding to the current coding tree unit; the target syntax element is a partitioning syntax element used to indicate whether to continue splitting the coding unit; the first coding length corresponding to each coding unit includes the first coding length of the partitioning syntax element; and the method further includes: For the current coding unit, determining the second coding lengths corresponding to different values of the partitioning syntax element in different coding modes; According to the second coding length and according to the rate-distortion optimization algorithm, determining the costs of different values of the partitioning syntax element; According to the costs corresponding to different coding methods respectively, determining the target coding mode; In the target coding mode, according to the costs of different values of the partitioning syntax element of coding units with different parent-child relationships, determining the target partitioning mode of the current coding tree unit.

10. A bit rate estimation device, characterized in that, Including: A first determination unit, configured to determine an initial probability model of context variables for multiple coding units, where the multiple coding units belong to the current coding tree unit; A second determination unit, configured to determine the first coding lengths corresponding to the target syntax elements in the multiple coding units according to the initial probability model; A third determination unit, configured to determine the adjustment coefficients corresponding to the first coding lengths of the multiple coding units in a preset order; wherein, the adjustment coefficient is related to the quantization parameter of the coding tree unit and is related to the historical value of the target syntax element after mode decision; An adjustment unit, configured to, for each coding unit, adjust the first coding length of the coding unit by using the adjustment coefficient to obtain the second coding length of the target syntax element in the coding unit.

11. An electronic device, characterized in that, Including: A processor and a memory; The memory stores computer execution instructions; The processor executes the computer execution instructions stored in the memory, so that the processor executes the bitrate estimation method according to any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that, Computer execution instructions are stored in the computer-readable storage medium, and when the processor executes the computer execution instructions, the bitrate estimation method according to any one of claims 1 to 9 is implemented.

13. A computer program product comprising a computer program, characterized in that, When the computer program is executed by the processor, the bitrate estimation method according to any one of claims 1 to 9 is implemented.