Bit rate estimation method, device, electronic device and storage medium

By using the preset calculation method in HEVC video coding, the target grammar element coding length of the video data is estimated to solve the problem of large time consumption caused by the complicated process of the code estimation process, and realize the simplified code estimation and improved video coding efficiency.

CN114071163BActive Publication Date: 2025-01-24ALIBABA GROUP HOLDING LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202010772172.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-08-04
Publication Date
2025-01-24
Estimated Expiration
2040-08-04

AI Technical Summary

Technical Problem

In HEVC video encoding, the bit rate estimation process required for pattern decisions is complicated, resulting in high time consumption and it is difficult to quickly calculate the bit rate.

Method used

Putting a code rate estimation method, by obtaining the target transformation coefficient of the video data, the coding length of the target grammar element at the preset calculation method is used to determine the code rate. This method calculates the code length without two -value, and simplifies the process.

Benefits of technology

Simplify the estimation process of code rate, reduce the time consumption of model decision -making, improve the efficiency of video coding, so that the code estimates can be used for hardware parallelization and saving resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114071163B_ABST
    Figure CN114071163B_ABST
Patent Text Reader

Abstract

The disclosed embodiment discloses a method, device, electronic device and storage medium for bit rate estimation, the method comprising: obtaining a target transform coefficient; estimating the coding length of a target syntax element at the coefficient level for the target transform coefficient according to a preset calculation method; wherein the preset calculation method uses the coefficient level as input; and determining the bit rate of the target syntax element according to the coding length. The technical solution simplifies the estimation process of the coding length of the syntax element at the coefficient level for the transform coefficient, thereby simplifying the bit rate estimation process, and ultimately enables the process of rate distortion estimation using the bit rate estimation value to be processed in hardware parallelization, saving resources and improving video encoding efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a bit rate estimation method, device, electronic device and storage medium. Background Art

[0002] In the mode decision of HEVC video coding, it is necessary to count the image distortion caused by compression as the input parameter of the mode decision rate-distortion optimization algorithm. In the process of video coding, mode decision consumes a lot of time. First of all, in the H.265 video codec standard, there is a very flexible block division, such as the quadtree-based coding unit (CU), transform unit (TU) and prediction unit (PU). All CU / PU / TU need to be optimized by rate-distortion to obtain the target division method. As for CU, there are four sizes: 64x64, 32x32, 16x16, and 8x 8. The division method is based on the overall performance decision of bit rate (R) and distortion (D). In the entropy coding process, it is necessary to traverse each coefficient and obtain the syntax elements at the coefficient level. The bit rate is estimated by binarizing the syntax elements and counting the number of bits of the syntax elements. Since this process is accompanied by the update of hundreds of context models, it is a very complicated process. Therefore, quickly calculating the bit rate can greatly improve the time consumption of mode decision. Summary of the invention

[0003] Embodiments of the present disclosure provide a method, device, electronic device, and computer-readable storage medium for estimating a bit rate.

[0004] In a first aspect, an embodiment of the present disclosure provides a method for estimating a bit rate, including:

[0005] Get video data;

[0006] calling a pre-deployed service interface so that the service interface obtains a target transform coefficient of the video data, estimates a coding length of a target syntax element of a coefficient level for the target transform coefficient according to a preset calculation method, and determines a bit rate of the target syntax element according to the coding length; wherein the preset calculation method takes the coefficient level as an input;

[0007] Output the bit rate of the target syntax element.

[0008] In a second aspect, an embodiment of the present disclosure provides a method for estimating a bit rate, including:

[0009] Get target transform coefficients;

[0010] estimating a coding length of a target syntax element for a coefficient level of the target transform coefficient according to a preset calculation method; wherein the preset calculation method takes the coefficient level as input;

[0011] A code rate of the target syntax element is determined according to the coding length.

[0012] Furthermore, the preset calculation method calculates the coding length of the target syntax element when the target syntax element is not binarized.

[0013] Further, the target syntax element is a residual value of the absolute value of the coefficient level; the preset calculation method includes at least one of the following, including:

[0014] When the absolute value of the coefficient level is less than 2, the coding length of the target syntax element is 0;

[0015] When the absolute value of the coefficient level is equal to 2, the coding length of the target syntax element is 1;

[0016] When the absolute value of the coefficient level is greater than 2 and less than 66, the preset calculation method is as shown in formula (1);

[0017] When the absolute value of the coefficient level is greater than or equal to 66, the preset calculation method is as shown in formula (2);

[0018] bit num =int(log2(val))+2 (1)

[0019] bit num =int(log2((val-32)))*2 (2)

[0020] val=cAbslevel-2 (3)

[0021] Among them, bit num is the coding length of the target syntax element, cAbslevel is the absolute value of the coefficient level, and val is an intermediate variable.

[0022] In a third aspect, an embodiment of the present disclosure provides a rate-distortion estimation method, including:

[0023] Get video data;

[0024] calling a pre-deployed service interface so that the service interface obtains a target transform coefficient of the video data, estimates a coding length of a target syntax element of a coefficient level for the target transform coefficient according to a preset calculation method, and predicts a rate-distortion cost of the video data according to the coding length; wherein the preset calculation method takes the coefficient level as an input;

[0025] The rate-distortion cost is output.

[0026] In a fourth aspect, an embodiment of the present disclosure provides a rate-distortion estimation method, including:

[0027] Get target transform coefficients;

[0028] estimating a coding length of a target syntax element for a coefficient level of the target transform coefficient according to a preset calculation method; wherein the preset calculation method takes the coefficient level as input;

[0029] The rate-distortion cost of the video data corresponding to the target transform coefficient is predicted according to the coding length.

[0030] Furthermore, the preset calculation method calculates the coding length of the target syntax element when the target syntax element is not binarized.

[0031] Furthermore, the target syntax element is used to indicate a residual value of the absolute value of the coefficient level.

[0032] Furthermore, the preset calculation method includes at least one of the following:

[0033] When the absolute value of the coefficient level is less than 2, the coding length of the target syntax element is 0;

[0034] When the absolute value of the coefficient level is equal to 2, the coding length of the target syntax element is 1;

[0035] When the absolute value of the coefficient level is greater than 2 and less than 66, the preset calculation method is as shown in formula (1);

[0036] When the absolute value of the coefficient level is greater than or equal to 66, the preset calculation method is as shown in formula (2);

[0037] bit num =int(log2(val))+2 (1)

[0038] bit num =int(log2((val-32)))*2 (2)

[0039] val=cAbslevel-2 (3)

[0040] Among them, bit num is the coding length of the target syntax element, cAbslevel is the absolute value of the coefficient level, and val is an intermediate variable.

[0041] Further, predicting the rate-distortion cost of the video data corresponding to the target transform coefficient according to the coding length includes:

[0042] Determining a coding distortion corresponding to the video data;

[0043] Predicting a bit rate corresponding to the video data according to a coding length of a target syntax element;

[0044] The rate-distortion cost is determined based on the coding distortion and the code rate.

[0045] Further, determining the coding distortion corresponding to the video data includes:

[0046] Obtaining residual data corresponding to the video data and the predicted data;

[0047] Transforming the residual data to obtain a first transform coefficient set; the first transform coefficient set includes the target transform coefficient;

[0048] Performing quantization and inverse quantization operations on the first transform coefficient set to obtain a second transform coefficient set;

[0049] The coding distortion is determined according to the first transform coefficient set and the second transform coefficient set.

[0050] In a fifth aspect, an embodiment of the present disclosure provides a method for estimating a coding length of a target syntax element, including:

[0051] Get video data;

[0052] Invoking a pre-deployed service interface so that the service interface obtains a target transform coefficient of the video data and estimates a coding length of a target syntax element of a coefficient level for the target transform coefficient according to a preset calculation method; wherein the preset calculation method takes the coefficient level as input;

[0053] Output the encoding length of the target syntax element.

[0054] In a sixth aspect, an embodiment of the present disclosure provides a method for estimating a coding length of a target syntax element, including:

[0055] Get target transform coefficients;

[0056] The coding length of a target syntax element of a coefficient level for the target transform coefficient is estimated according to a preset calculation method; wherein the preset calculation method takes the coefficient level as input.

[0057] Further, the target syntax element is a residual value of the absolute value of the coefficient level; the preset calculation method includes at least one of the following, including:

[0058] When the absolute value of the coefficient level is less than 2, the coding length of the target syntax element is 0;

[0059] When the absolute value of the coefficient level is equal to 2, the coding length of the target syntax element is 1;

[0060] When the absolute value of the coefficient level is greater than 2 and less than 66, the preset calculation method is as shown in formula (1);

[0061] When the absolute value of the coefficient level is greater than or equal to 66, the preset calculation method is as shown in formula (2);

[0062] bit num =int(log2(val))+2 (1)

[0063] bit num =int(log2((val-32)))*2 (2)

[0064] val=cAbslevel-2 (3)

[0065] Among them, bit num is the coding length of the target syntax element, cAbslevel is the absolute value of the coefficient level, and val is an intermediate variable.

[0066] In a seventh aspect, an embodiment of the present disclosure provides a rate-distortion estimation device, including:

[0067] A first acquisition module is configured to acquire a target transform coefficient;

[0068] A first estimation module is configured to estimate the coding length of a target syntax element for a coefficient level of the target transform coefficient according to a preset calculation method; wherein the preset calculation method takes the coefficient level as an input;

[0069] The prediction module is configured to predict the rate-distortion cost of the video data corresponding to the target transform coefficient according to the coding length.

[0070] In an eighth aspect, an embodiment of the present disclosure provides a bit rate estimation device, including:

[0071] A second acquisition module is configured to acquire a target transform coefficient;

[0072] A second estimation module is configured to estimate the coding length of the target syntax element for the coefficient level of the target transform coefficient according to a preset calculation method; wherein the preset calculation method takes the coefficient level as input;

[0073] A determination module is configured to determine a code rate of the target syntax element according to the coding length.

[0074] In a ninth aspect, an embodiment of the present disclosure provides a coding length estimation device for a target syntax element, including:

[0075] A third acquisition module is configured to acquire a target transform coefficient;

[0076] The third estimation module is configured to estimate the coding length of the target syntax element of the coefficient level for the target transform coefficient according to a preset calculation method; wherein the preset calculation method uses the coefficient level as input.

[0077] In a tenth aspect, an embodiment of the present disclosure provides a bit rate estimation device, including:

[0078] A fourth acquisition module is configured to acquire video data;

[0079] a first calling module configured to call a pre-deployed service interface so that the service interface obtains a target transform coefficient of the video data, estimates a coding length of a target syntax element of a coefficient level for the target transform coefficient according to a preset calculation method, and determines a bit rate of the target syntax element according to the coding length; wherein the preset calculation method takes the coefficient level as an input;

[0080] The first output module is configured to output the bit rate of the target syntax element.

[0081] In an eleventh aspect, an embodiment of the present disclosure provides a rate-distortion estimation device, including:

[0082] A fifth acquisition module, configured to acquire video data;

[0083] a second calling module configured to call a pre-deployed service interface so that the service interface obtains a target transform coefficient of the video data, estimates a coding length of a target syntax element of a coefficient level for the target transform coefficient according to a preset calculation method, and predicts a rate-distortion cost of the video data according to the coding length; wherein the preset calculation method takes the coefficient level as an input;

[0084] The second output module is configured to output the rate-distortion cost.

[0085] In a twelfth aspect, an embodiment of the present disclosure provides a coding length estimation device for a target syntax element, including:

[0086] A sixth acquisition module, configured to acquire video data;

[0087] a third calling module configured to call a pre-deployed service interface so that the service interface obtains a target transform coefficient of the video data and estimates a coding length of a target syntax element of a coefficient level for the target transform coefficient according to a preset calculation method; wherein the preset calculation method takes the coefficient level as an input;

[0088] The third output module is configured to output the coding length of the target syntax element.

[0089] The functions can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the functions.

[0090] In one possible design, the structure of the above-mentioned device includes a memory and a processor, the memory is used to store one or more computer instructions that support the above-mentioned device to execute the above-mentioned corresponding method, and the processor is configured to execute the computer instructions stored in the memory. The above-mentioned device may also include a communication interface for the above-mentioned device to communicate with other devices or communication networks.

[0091] In a thirteenth aspect, an embodiment of the present disclosure provides a video encoder, including a bit rate estimation unit;

[0092] The bit rate estimation unit is used to obtain a target transform coefficient; estimate the coding length of a target syntax element at a coefficient level for the target transform coefficient according to a preset calculation method; wherein the preset calculation method takes the coefficient level as input; and determine the bit rate of the target syntax element according to the coding length.

[0093] Furthermore, the preset calculation method calculates the coding length of the target syntax element when the target syntax element is not binarized.

[0094] Further, the target syntax element is a residual value of the absolute value of the coefficient level; the preset calculation method includes at least one of the following, including:

[0095] When the absolute value of the coefficient level is less than 2, the coding length of the target syntax element is 0;

[0096] When the absolute value of the coefficient level is equal to 2, the coding length of the target syntax element is 1;

[0097] When the absolute value of the coefficient level is greater than 2 and less than 66, the preset calculation method is as shown in formula (1);

[0098] When the absolute value of the coefficient level is greater than or equal to 66, the preset calculation method is as shown in formula (2);

[0099] bit num =int(log2(val))+2 (1)

[0100] bit num =int(log2((val-32)))*2 (2)

[0101] val=cAbslevel-2 (3)

[0102] Among them, bit num is the coding length of the target syntax element, cAbslevel is the absolute value of the coefficient level, and val is an intermediate variable.

[0103] In a fourteenth aspect, an embodiment of the present disclosure provides a video encoder, including a rate-distortion estimation unit;

[0104] The rate-distortion estimation unit is used to obtain a target transform coefficient, estimate a coding length of a target syntax element at a coefficient level for the target transform coefficient according to a preset calculation method; wherein the preset calculation method takes the coefficient level as input; and predict a rate-distortion cost of the video data according to the coding length.

[0105] Furthermore, the preset calculation method calculates the coding length of the target syntax element when the target syntax element is not binarized.

[0106] Furthermore, the target syntax element is used to indicate a residual value of the absolute value of the coefficient level.

[0107] Furthermore, the preset calculation method includes at least one of the following:

[0108] When the absolute value of the coefficient level is less than 2, the coding length of the target syntax element is 0;

[0109] When the absolute value of the coefficient level is equal to 2, the coding length of the target syntax element is 1;

[0110] When the absolute value of the coefficient level is greater than 2 and less than 66, the preset calculation method is as shown in formula (1);

[0111] When the absolute value of the coefficient level is greater than or equal to 66, the preset calculation method is as shown in formula (2);

[0112] bit num =int(log2(val))+2 (1)

[0113] bit num =int(log2((val-32)))*2 (2)

[0114] val=cAbslevel-2 (3)

[0115] Among them, bit num is the coding length of the target syntax element, cAbslevel is the absolute value of the coefficient level, and val is an intermediate variable.

[0116] Furthermore, it also includes a distortion determination unit;

[0117] The distortion determination unit is used to determine the encoding distortion corresponding to the video data;

[0118] The rate-distortion estimation unit predicts a code rate corresponding to the video data according to a coding length of a target syntax element, and determines the rate-distortion cost based on the coding distortion and the code rate.

[0119] Furthermore, it also includes a residual calculation unit, a transformation unit, a quantization unit and a dequantization unit;

[0120] The residual calculation unit is used to obtain residual data corresponding to the video data and the prediction data;

[0121] The transform unit is used to transform the residual data to obtain a first transform coefficient set; the first transform coefficient set includes the target transform coefficient;

[0122] The quantization unit is used to perform a quantization operation on the first transform coefficient set;

[0123] The dequantization unit is used to perform a dequantization operation on the first transform coefficient set that has been subjected to the quantization operation, and obtain a second transform coefficient set;

[0124] The distortion determination unit determines the coding distortion according to the first transform coefficient set and the second transform coefficient set.

[0125] In the fifteenth aspect, an embodiment of the present disclosure provides an electronic device, comprising a memory and a processor; wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the method described in any one of the above aspects.

[0126] In the sixteenth aspect, an embodiment of the present disclosure provides a computer-readable storage medium for storing computer instructions used by any of the above-mentioned devices, which includes computer instructions involved in executing the method described in any of the above-mentioned aspects.

[0127] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:

[0128] Therefore, the disclosed embodiment proposes a method for bit rate estimation, which includes: obtaining a target transform coefficient; estimating the coding length of a target syntax element at the coefficient level for the target transform coefficient according to a preset calculation method; wherein the preset calculation method uses the coefficient level as input; and determining the bit rate of the target syntax element according to the coding length. The method proposes a preset calculation method with the coefficient level of the target transform coefficient as an input parameter, which is used to directly calculate the coding length of the target syntax element using the coefficient level of the target transform coefficient, and then use the coding length to estimate the bit rate corresponding to the target transform coefficient. This scheme simplifies the estimation process of the coding length of the syntax element at the coefficient level for the transform coefficient, simplifies the bit rate estimation process, and finally enables the process of rate distortion estimation using the bit rate estimation value to be processed in hardware parallelization, saving resources and improving video coding efficiency.

[0129] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0130] Other features, objectives and advantages of the present disclosure will become more apparent through the following detailed description of non-limiting embodiments in conjunction with the accompanying drawings. In the accompanying drawings:

[0131] Figure 1(a) to Figure 1(c) A schematic diagram showing different scanning orders of transform coefficients during video encoding and decoding;

[0132] Figure 2 A flow chart showing a rate-distortion estimation method according to an embodiment of the present disclosure is shown;

[0133] Figure 3 A flow chart showing a method for calculating the coding length of a residual value syntax element according to an embodiment of the present disclosure is shown;

[0134] Figure 4 A schematic diagram showing a process of processing coding distortion according to an embodiment of the present disclosure;

[0135] Figure 5 A flowchart of a method for estimating a bit rate according to an embodiment of the present disclosure is shown;

[0136] Figure 6 A flowchart showing a method for estimating a coding length of a target syntax element according to an embodiment of the present disclosure is shown;

[0137] Figure 7 A structural block diagram of a video encoder according to an embodiment of the present disclosure is shown;

[0138] Figure 8It is a structural diagram of an electronic device suitable for implementing the rate-distortion estimation, code rate estimation and / or target syntax element coding length estimation method according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0139] Hereinafter, exemplary embodiments of the present disclosure will be described in detail with reference to the accompanying drawings so that those skilled in the art can easily implement them. In addition, for the sake of clarity, parts not related to the description of the exemplary embodiments are omitted in the accompanying drawings.

[0140] In the present disclosure, it should be understood that terms such as "include" or "have" are intended to indicate the presence of features, numbers, steps, behaviors, components, parts, or a combination thereof disclosed in the present specification, and are not intended to exclude the possibility that one or more other features, numbers, steps, behaviors, components, parts, or a combination thereof exist or are added.

[0141] It should also be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present disclosure may be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0142] In HEVC and other block-based video coding systems, a picture is encoded using a set of coding units (CUs). Each coding unit of a picture may correspond to one or more co-located coding blocks within the picture. In order to encode a coding unit, the video encoder may determine one or more prediction units (PUs) for the coding unit, and may determine residual data for the coding unit based on the prediction unit and the coding unit. For example, the residual data for the coding unit may be equal to the difference between the prediction unit and the coding unit. The residual data may be partitioned into one or more transform blocks, each of which corresponds to a transform unit (TU) in the coding unit. The video encoder may then apply a transform such as a discrete cosine transform (DCT) to the transform block to determine a transform coefficient block. The values ​​of the transform coefficients in the transform coefficient block may be referred to as "coefficient levels".

[0143] In addition, the video encoder may subdivide each transform coefficient block into one or more coefficient groups (CGs). In HEVC, each coefficient group CG is a 4x4 sub-block of the transform coefficient block. For each corresponding coefficient group CG of the transform coefficient block, the video encoder may generate a syntax element indicating whether the corresponding coefficient group CG includes one or more non-zero coefficient levels. For each corresponding coefficient group CG including one or more non-zero coefficient levels, the video encoder may use a corresponding set of one or more syntax elements corresponding to the corresponding coefficient level to represent each corresponding coefficient level of the coefficient group CG. The set of syntax elements for the coefficient level may include: a syntax element indicating whether the coefficient level is non-zero (i.e., a significance flag syntax element), a syntax element indicating whether the coefficient level is greater than 1 (i.e., a greater1 flag), a syntax element indicating whether the coefficient level is greater than 2 (i.e., a greater2 flag), a syntax element indicating the positive or negative sign of the coefficient level (i.e., a sign flag), and a syntax element indicating the residual value of the absolute value of the coefficient level (i.e., coeff_abs_level_remaining) (i.e., a residual value syntax element). If the significance flag indicates that the coefficient level is 0, then the greater1 flag, greater2 flag, sign flag, and remainder value syntax elements may not be present. If the significance flag indicates that the coefficient level is non-zero and the greater1 flag indicates that the coefficient level is not greater than 1, then the greater2 flag is not present and the remainder value syntax element indicates the coefficient level. If the significance flag indicates that the coefficient level is non-zero and the greater1 flag indicates that the coefficient level is greater than 1, then the greater2 flag is present. If the greater2 flag is present but indicates that the coefficient level is not greater than 2, then the remainder value syntax element indicates the coefficient level minus 1. If the greater2 flag is present and indicates that the coefficient level is greater than 2, then the remainder value syntax element indicates the coefficient level minus 2.

[0144] In the process of rate-distortion optimization, it is necessary to estimate the rate-distortion cost under various modes, and then select one of the modes to encode the coding unit according to the rate-distortion cost. The modes here can include different block division methods of the video frame, and different block division methods correspond to different rate-distortion costs. The rate-distortion cost consists of two parts, namely distortion (D) and bit rate (R). The bit rate is usually related to the number of bits of the bit stream obtained after the video data is encoded. The more bits, the higher the bit rate, and the fewer bits, the lower the bit rate; the estimation of the bit rate mainly depends on the length of the bit stream after the video data is encoded.

[0145] The following is an introduction to the estimation of the bitstream length obtained by encoding video data in the HEVC standard.

[0146] In the HEVC standard, video data is encoded in the form of blocks. In the standard encoding process, the residual data is processed by discrete cosine transform (DCT) to generate transform coefficients. During entropy coding, the transform coefficients are scanned in a predetermined scanning order to generate a serialized vector that can be entropy encoded. In the HEVC standard, the transform coefficients can be scanned in blocks, and each block can be called a sub-block of the transform coefficient block.

[0147] The following example illustrates the scanning method of the transform coefficients.

[0148] Figure 1(a) to Figure 1(c) A schematic diagram showing different scanning orders of transform coefficients in the video encoding and decoding process. As shown in FIG1, taking 4x4 sub-blocks as an example for encoding, the 8x8 transform coefficient block is divided into four 4x4 sub-blocks, and the coefficients have three scanning orders, among which FIG1(a) shows the diagonal scanning method, FIG1(b) shows the horizontal scanning method, and FIG1(c) shows the vertical scanning method. Each sub-block scan obtains 16 consecutive coefficients.

[0149] According to the HEVC standard, when estimating the coding length of the syntax element at the coefficient level for the above coefficient, the syntax element needs to be binarized, and after the binarization is completed, the coding length of the syntax element is obtained by counting the number of bits.

[0150] The following describes the coding length estimation process of the syntax element in the HEVC standard by taking the coefficient level residual value syntax element for transform coefficients as an example. The residual value syntax element is used to indicate the residual value of the absolute value of the coefficient level, that is, coeff_abs_level_remaining defined in the HEVC standard.

[0151] According to the standard encoding process, each 4x4 sub-block scanned in a predefined scanning order is processed as follows:

[0152] Assuming that the input transformation coefficient is TransCoeffLevel[n] (n is between 0 and 15), two variables cLastAbsLevel and cLastRiceParam are defined:

[0153] 1. If the process of encoding the residual value syntax element coeff_abs_level_remaining is called for the first time in this 4x4 sub-block, then cLastAbsLevel and cLastRiceParam are both set to 0; otherwise, cLastAbsLevel and cLastRiceParam are set to the coefficient level cAbsLevel and parameter cRiceParam of the transform coefficient respectively;

[0154] 2. Settings

[0155] (1)cAbsLevel=baseLevel+coeff_abs_level_remaining[n],

[0156] Among them, baseLevel=1+coeff_abs_level_greater1_flag[n]+coeff_abs_level_greater2_flag[n]

[0157] TransCoeffLevel[n]=(coeff_abs_level_remaining[n]+baseLevel)*(1-2*coeff_sign_flag[n])

[0158] Among them, coeff_abs_level_greater1_flag[n] is the greater1 flag,

[0159] coeff_abs_level_greater2_flag[n] is the greater2 flag.

[0160] (2)cRiceParam=Min(cLastRiceParam+(cLastAbsLevel>(3*(1< <cLastRiceParam))?1:0),4)

[0161] (3) cMax=4< <cRiceParam

[0162] 3. The binarization process of coeff_abs_level_remaining[n] includes two processes: determining the prefix prefix and the suffix suffix:

[0163] (1) prefixVal = Min(cMax, coeff_abs_level_remaining[n]); The prefix prefix is ​​binarized using the Truncated Rice coding process, with cMax and cRiceParam serving as input parameters of the binarization process;

[0164] (2) If the bit length of the prefix generated in the process of determining the prefix is ​​4 and all bits are 1, then the process of determining the suffix suffix will be called:

[0165] suffixVal=coeff_abs_level_remaining[n]–cMax;

[0166] The binarization of the suffix suffix adopts the K-th order EGk (k-th order exponential Golomb coding) process, and its parameter riceParam is cRiceParam+1.

[0167] 4. The length after binarization is the number of bits_num of the syntax element.

[0168] From the above standard process, it can be seen that estimating the coding length of the syntax element requires binarization encoding and then counting the number of bits. It is a process with a lot of forward and backward coupling: first, the calculation of baseLevel depends on the number of coefficients whose coefficient levels are greater than 0 and 1 in the aforementioned scan. Secondly, the binarization parameter of each scanned coefficient is related to the coefficient level of the last scanned coefficient. Therefore, the coding length estimation method of the above syntax elements applied in the rate-distortion estimation process is not suitable for parallel processing by hardware.

[0169] Therefore, the disclosed embodiment proposes a rate-distortion estimation method, which includes: obtaining a target transform coefficient; estimating the coding length of a target syntax element at the coefficient level for the target transform coefficient according to a preset calculation method; wherein the preset calculation method uses the coefficient level as input; and predicting the rate-distortion cost of the video data corresponding to the target transform coefficient according to the coding length. The method proposes a preset calculation method using the coefficient level of the target transform coefficient as an input parameter, which is used to directly calculate the coding length of the target syntax element using the coefficient level of the target transform coefficient, and then use the coding length to predict the rate-distortion cost of the video data corresponding to the target transform coefficient. This scheme simplifies the estimation process of the coding length of the syntax element at the coefficient level for the transform coefficient, thereby enabling the rate-distortion estimation process to be processed in hardware parallelization, saving resources and improving video coding efficiency.

[0170] The details of the embodiments of the present disclosure are described in detail below through specific examples.

[0171] Figure 2 FIG. 4 is a flow chart of a rate-distortion estimation method according to an embodiment of the present disclosure. Figure 2 As shown, the rate distortion estimation method includes the following steps:

[0172] In step S201, a target transform coefficient is obtained;

[0173] In step S202, a coding length of a target syntax element for a coefficient level of the target transform coefficient is estimated according to a preset calculation method; wherein the preset calculation method takes the coefficient level as input;

[0174] In step S203, the rate-distortion cost of the video data corresponding to the target transform coefficient is predicted according to the coding length.

[0175] In this embodiment, the target transform coefficient may include any transform coefficient in a transform coefficient block obtained by applying a transform such as discrete cosine transform to the transform block during video encoding. The coefficient level of the target transform coefficient may be understood as the value of the target transform coefficient.

[0176] In some embodiments, the preset calculation method takes the coefficient level of the target transform coefficient as input, and uses the coefficient level to calculate the coding length of the target syntax element. In the preset calculation method, only the coefficient level of the target transform coefficient is needed to calculate the coding length of the target syntax element, that is, the coefficient level of the target transform coefficient is the only input of the preset calculation method, and its output is the coding length of the target syntax element. In other embodiments, since the preset calculation method only involves the coefficient level of the target transform coefficient, the preset calculation method does not need to estimate the coding length of the target syntax element after binarization, but can calculate the coding length of the target syntax element after scanning the coefficient level of the target transform coefficient, that is, the preset calculation method uses the coefficient level to calculate the coding length of the target syntax element without binarization of the target syntax element. The preset calculation method can be pre-set, and after determining the coefficient level of the target transform coefficient, the coding length of the target syntax element can be obtained according to the preset calculation method, without the need to perform complex binarization coding on the syntax element used for the coefficient level as specified in the HEVC standard in the previous text, and then obtain its coding length by counting the number of bits of binarization coding. The preset calculation method can be understood as a simplified processing method of the relevant content in the HEVC standard.

[0177] In some embodiments, the preset calculation method may define the coding length of the target syntax element under different value ranges of the coefficient level or the linear relationship between the coefficient level and the coding length. For example, when the coefficient level is 0, since the target syntax element may not exist, the coding length of the target syntax element may be defined as 0, and when the coefficient level is in other value ranges, a linear relationship between the coding length of the target syntax element and the coefficient level may be defined.

[0178] After the coding length of the target syntax element is obtained by using the above preset calculation method, the rate-distortion cost of the video data corresponding to the target transform coefficient can be estimated by using the coding length and the coding length of other information involved in the coding process.

[0179] In some embodiments, the calculation formula of the rate-distortion cost can be expressed as follows: RDCost = SSE + λRate, where SSE is the degree of distortion, Rate is the bit rate, and λ is the Lagrangian parameter, that is, the weight coefficient of the bit rate. The bit rate can be calculated based on the frame rate and the number of bits obtained by encoding each frame of the image, and the number of bits obtained by encoding each frame of the image includes the coding length of the target syntax element for the target transform coefficient. Each frame of the image can correspond to multiple target transform coefficients in each coding mode, and each target transform coefficient can correspond to multiple target syntax elements of the coefficient level for the target transform coefficient. The above method of the embodiment of the present disclosure can estimate the coding length of the target syntax elements of all target transform coefficients corresponding to each frame of the image, and then estimate the bit rate corresponding to each frame of the image, and based on the bit rate, the rate-distortion cost of the current coding mode can be estimated.

[0180] The rate-distortion estimation method proposed in the embodiment of the present disclosure is suitable for being performed in parallel with other processes in the video encoding process on a hardware encoder. Of course, it can be understood that the rate-distortion estimation method is also suitable for being executed by software. Through the rate-distortion estimation method proposed in the embodiment of the present disclosure, the rate-distortion estimation process can be simplified, and the rate-distortion estimation process can be made suitable for parallel operation on hardware, which can further improve the video encoding efficiency.

[0181] In an optional implementation of this embodiment, the target syntax element is used to indicate a residual value of the absolute value of the coefficient level.

[0182] In this optional implementation, a preset calculation method can be used to predict the coding length of the residual value syntax element at the coefficient level for the target transform coefficient. The residual value syntax element is used to indicate the residual value of the absolute value of the coefficient level of the target transform coefficient, that is, coeff_abs_level_remaining defined in the HEVC standard. From the description above, it can be seen that the binarization process of the residual value syntax element is relatively complicated and depends on multiple other syntax elements at the coefficient level. Therefore, it is highly dependent and not suitable for hardware parallel processing. However, the embodiment of the present disclosure proposes to obtain the coding length of the residual value syntax element by using the coefficient level calculation without binarizing the residual value syntax element, which can simplify the rate-distortion estimation process, and make the rate-distortion estimation suitable for hardware parallel operation, which can further improve the video coding efficiency.

[0183] In an optional implementation of this embodiment, the preset calculation method includes at least one of the following:

[0184] When the absolute value of the coefficient level is less than 2, the coding length of the target syntax element is 0;

[0185] When the absolute value of the coefficient level is equal to 2, the coding length of the target syntax element is 1;

[0186] When the absolute value of the coefficient level is greater than 2 and less than 66, the preset calculation method is as shown in formula (1);

[0187] When the absolute value of the coefficient level is greater than or equal to 66, the preset calculation method is as shown in formula (2);

[0188] bit num =int(log2(val))+2 (1)

[0189] bit num =int(log2((val-32)))*2 (2)

[0190] val=cAbslevel-2 (3)

[0191] Among them, bit num is the coding length of the target syntax element, cAbslevel is the absolute value of the coefficient level, and val is an intermediate variable.

[0192] In this optional implementation, for the residual value syntax element, the preset calculation method as described above can be obtained. For example, when the absolute value of the coefficient level is 0 or 1, the residual value syntax element may not exist, so the coding length of the residual value syntax element can be determined to be 0; when the absolute value of the coefficient level is 2, the residual value syntax element can be directly encoded as "0", so its coding length can be determined to be 1; when the absolute value of the coefficient level is greater than 2 and less than 66, the bit number of the residual value syntax element changes in a rule of adding 1 each time, so it can be calculated using formula (1), and when the absolute value of the coefficient level is greater than or equal to 66, the bit number of the residual value syntax element changes in a rule of adding 2 each time, so it can be calculated using formula (2).

[0193] Multiple verifications of the above-mentioned preset calculation method of the residual value syntax element show that the coding length of the residual value syntax element obtained by the above-mentioned preset calculation method proposed in the embodiment of the present disclosure has a bd-rate loss of 0.1% compared with the coding length calculated using the HEVC standard, and this loss is negligible. It can be seen that the embodiment of the present disclosure can achieve the same technical effect as the HEVC standard while simplifying the calculation method of the coding length of the syntax element.

[0194] Figure 3 FIG. 1 is a flow chart showing a method for calculating the coding length of a residual value syntax element according to an embodiment of the present disclosure. Figure 3As shown, during the encoding process, after obtaining residual data based on the original video data and the predicted data, a transform operation such as discrete cosine transform DCT is performed to obtain a transform coefficient block. For further compression, a quantization operation can be performed on the transform coefficient block, and the transform coefficient block after the quantization operation is scanned in a predetermined order (such as horizontal scanning, vertical scanning, and diagonal scanning, etc.) to obtain the transform coefficients in each transform coefficient block. The transform coefficient may include coefficient levels and syntax elements generated during the scanning process. For example, syntax elements for coefficient levels include: syntax elements indicating whether the coefficient level is non-zero, syntax elements indicating whether the coefficient level is greater than 1, syntax elements indicating whether the coefficient level is greater than 2, syntax elements indicating the positive or negative sign of the coefficient level, and residual value syntax elements indicating the residual value of the absolute value of the coefficient level. The scanned transform coefficient is input into the coding length calculation module of the residual value syntax element, and the calculation module obtains val by using the coefficient level of the transform coefficient, and the val is equal to the coefficient level cAbslevel-2. When the val is less than 0, that is, the coefficient level is less than 2, the coding length of the residual value syntax element is 0. When the val is equal to 0, that is, the coefficient level is equal to 2, the coding length of the residual value syntax element is 1. When the val is less than 64, that is, the coefficient level is less than 66, the coding length of the residual value syntax element is int(log2(val))+2; when the val is greater than or equal to 64, that is, the coefficient level is greater than or equal to 66, the coding length of the residual value syntax element is int(log2(val-32))*2. After the coding length of the residual value syntax element is calculated, the coding length can be input into the rate-distortion estimation module to estimate the rate-distortion cost of the video data.

[0195] In an optional implementation of this embodiment, step S203, i.e., the step of predicting the rate-distortion cost of the video data corresponding to the target transform coefficient according to the coding length, further includes the following steps:

[0196] Determining a coding distortion corresponding to the video data;

[0197] Predicting a bit rate corresponding to the video data according to a coding length of a target syntax element;

[0198] The rate-distortion cost is determined based on the coding distortion and the code rate.

[0199] In this optional implementation, each video frame to be encoded can be divided into multiple coding units CU and then encoded. Each coding unit corresponds to one or more prediction units PU, and residual data can be obtained based on the difference between the coding unit and the prediction unit. The residual data can be transformed by, for example, DCT to obtain a transform coefficient block. In some embodiments, the coding distortion can be calculated based on the transform coefficient block and the processing result obtained after quantization and dequantization of the transform coefficient block. In other embodiments, the coding distortion can be calculated using a traditional method, that is, after quantization and dequantization of the transform coefficient block, an inverse transform process such as IDCT is performed on it, and the coding distortion is calculated based on, for example, the transform coefficient block after DCT transformation and the processing result after, for example, IDCT inverse transformation.

[0200] The bit rate of the video data can be determined according to the traditional bit rate calculation method after the length of the encoded data is determined. The length of the encoded data at least includes the encoding length of the target syntax element. Therefore, after determining the encoding length of the target syntax element using the above method proposed in the embodiment of the present disclosure and determining the length of other parts of the encoded data using other methods, the bit rate of the video data can be determined.

[0201] As mentioned above, the rate-distortion cost calculation formula can be expressed as follows: RDCost = SSE + λRate, where SSE is the distortion, Rate is the bit rate, and λ is the Lagrange parameter, that is, the weight coefficient of the bit rate. After determining the coding distortion and bit rate, the rate-distortion cost can be calculated according to the above formula.

[0202] In an optional implementation of this embodiment, the step of determining the coding distortion corresponding to the video data further includes the following steps:

[0203] Obtaining residual data corresponding to the video data and the predicted data;

[0204] Transforming the residual data to obtain a first transform coefficient set; the first transform coefficient set includes the target transform coefficient;

[0205] Performing quantization and inverse quantization operations on the first transform coefficient set to obtain a second transform coefficient set;

[0206] The coding distortion is determined according to the first transform coefficient set and the second transform coefficient set.

[0207] In this optional implementation, as described above, the prediction data is the prediction data corresponding to the video data, such as the prediction unit PU corresponding to the coding unit CU, and the residual data can be the residual pixel value, and the transformation of the residual data can be understood as transforming the residual pixel value to a two-dimensional array of transform coefficients in the transform domain (such as the frequency domain), and the two-dimensional array of transform coefficients is the transform coefficient block mentioned above. In order to distinguish it from the transform coefficient block obtained by subsequent quantization and inverse quantization, it is referred to as the first transform coefficient set, and the first transform coefficient set includes the above-mentioned target transform coefficient. The transform can be, for example, a discrete cosine transform (DCT), or other transforms, such as a discrete sine transform (DST), an integer transform, a Karhunen-Lössl (KL) transform, and the like.

[0208] After quantization and dequantization processing is performed on the first transform coefficient set, a quantized and dequantized transform coefficient block can be obtained, which is referred to as the second transform coefficient set. After the second transform coefficient set is determined, the coding distortion can be determined according to the first transform coefficient set and the second transform coefficient set.

[0209] The following description will be made by taking DCT transformation as an example.

[0210] Figure 4 FIG. 2 is a schematic diagram showing a process of processing coding distortion according to an embodiment of the present disclosure. Figure 4 As shown, the original ORG image is compared with the predicted image to obtain residual data. After the residual data is subjected to DCT transformation, quantization and inverse quantization, the coding distortion D value is calculated using the first transformation coefficient set obtained by DCT transformation and the second transformation coefficient set obtained by inverse quantization. The coding distortion is calculated as follows:

[0211]

[0212] Wherein, DCT(i, j) is the (i, j)th element in the first transform coefficient set, IQ(i, j) is the (i, j)th element in the second transform coefficient set, and LOG2_TU is the logarithm of the width or height of DCT with base 2.

[0213] According to another embodiment of the present disclosure, a rate-distortion estimation method comprises the following steps:

[0214] Get video data;

[0215] calling a pre-deployed service interface so that the service interface obtains a target transform coefficient of the video data, estimates a coding length of a target syntax element of a coefficient level for the target transform coefficient according to a preset calculation method, and predicts a rate-distortion cost of the video data according to the coding length; wherein the preset calculation method takes the coefficient level as an input;

[0216] The rate-distortion cost is output.

[0217] In this embodiment, the service interface may be a SaaS service interface, which may be deployed locally or in the cloud. When necessary, users or relevant personnel may call the service interface and provide video data to the service interface. After receiving the video data to be processed, the service interface may obtain the target transform coefficient by performing a series of processes described above on the video data, and estimate the coding length of the target syntax element at the coefficient level for the target transform coefficient based on a preset calculation method, and predict the rate-distortion cost corresponding to the target transform coefficient based on the coding length. The process of determining the rate-distortion cost can be referred to above. Figure 2 The related descriptions of the rate-distortion estimation method in the related embodiments will not be repeated here.

[0218] After the processing is completed, the service interface returns the rate distortion cost.

[0219] Figure 5 FIG. 1 is a flow chart of a method for estimating a bit rate according to an embodiment of the present disclosure. Figure 5 As shown, the code rate estimation method includes the following steps:

[0220] In step S501, the target transform coefficients are obtained;

[0221] In step S502, a coding length of a target syntax element for a coefficient level of the target transform coefficient is estimated according to a preset calculation method; wherein the preset calculation method takes the coefficient level as input;

[0222] In step S503, a code rate of the target syntax element is determined according to the coding length.

[0223] In this embodiment, the target transform coefficient may include any transform coefficient in a transform coefficient block obtained by applying a transform such as discrete cosine transform to the transform block during video encoding. The coefficient level of the target transform coefficient may be understood as the value of the target transform coefficient.

[0224] In some embodiments, the preset calculation method takes the coefficient level of the target transform coefficient as input, and uses the coefficient level to calculate the coding length of the target syntax element. In the preset calculation method, only the coefficient level of the target transform coefficient is needed to calculate the coding length of the target syntax element, that is, the coefficient level of the target transform coefficient is the only input of the preset calculation method, and its output is the coding length of the target syntax element. In other embodiments, since the preset calculation method only involves the coefficient level of the target transform coefficient, the preset calculation method does not need to estimate the coding length of the target syntax element after binarization, but can calculate the coding length of the target syntax element after scanning the coefficient level of the target transform coefficient, that is, the preset calculation method uses the coefficient level to calculate the coding length of the target syntax element without binarization of the target syntax element. The preset calculation method can be pre-set, and after determining the coefficient level of the target transform coefficient, the coding length of the target syntax element can be obtained according to the preset calculation method, without the need to perform complex binarization coding on the syntax element used for the coefficient level as specified in the HEVC standard in the previous text, and then obtain its coding length by counting the number of bits of binarization coding. The preset calculation method can be understood as a simplified processing method of the relevant content in the HEVC standard.

[0225] In some embodiments, the preset calculation method may define the coding length of the target syntax element under different value ranges of the coefficient level or the linear relationship between the coefficient level and the coding length. For example, when the coefficient level is 0, since the target syntax element may not exist, the coding length of the target syntax element may be defined as 0, and when the coefficient level is in other value ranges, a linear relationship between the coding length of the target syntax element and the coefficient level may be defined.

[0226] After the coding length of the target syntax element is obtained by using the above preset calculation method, the bit rate of the target syntax element can be estimated by using the coding length, so that the rate-distortion cost of the video data can be estimated according to the bit rate.

[0227] The bit rate can be calculated based on the frame rate and the number of bits obtained by encoding each frame of the image, and the number of bits obtained by encoding each frame of the image includes the coding length of the target syntax element for the target transform coefficient. Each frame of the image can correspond to multiple target transform coefficients in each coding mode, and each target transform coefficient can correspond to multiple target syntax elements of the coefficient level for the target transform coefficient. The above method of the embodiment of the present disclosure can estimate the coding length of the target syntax elements of all target transform coefficients corresponding to each frame of the image, and then estimate the bit rate corresponding to each frame of the image. After determining the length of the encoded data, the bit rate of the video data can be determined according to the traditional bit rate calculation method. The length of the encoded data at least includes the coding length of the target syntax element. Therefore, after determining the coding length of the target syntax element using the above method proposed in the embodiment of the present disclosure and determining the length of other parts of the encoded data using other methods, the bit rate of the video data can be determined.

[0228] The above-mentioned bit rate estimation method proposed in the embodiment of the present disclosure can be used in the rate-distortion optimization process. Since the above-mentioned bit rate estimation process only depends on the coefficient level of the target transform coefficient, the rate-distortion estimation process can be suitable for parallel operation on hardware, which can further improve the video encoding efficiency.

[0229] In an optional implementation of this embodiment, the target syntax element is a residual value of the absolute value of the coefficient level; the preset calculation method includes at least one of the following, including:

[0230] When the absolute value of the coefficient level is less than 2, the coding length of the target syntax element is 0;

[0231] When the absolute value of the coefficient level is equal to 2, the coding length of the target syntax element is 1;

[0232] When the absolute value of the coefficient level is greater than 2 and less than 66, the preset calculation method is as shown in formula (1);

[0233] When the absolute value of the coefficient level is greater than or equal to 66, the preset calculation method is as shown in formula (2);

[0234] bit num =int(log2(val))+2 (1)

[0235] bit num =int(log2((val-32)))*2 (2)

[0236] val=cAbslevel-2 (3)

[0237] Among them, bit numis the coding length of the target syntax element, cAbslevel is the absolute value of the coefficient level, and val is an intermediate variable.

[0238] In this optional implementation, a preset calculation method can be used to predict the coding length of the residual value syntax element at the coefficient level for the target transform coefficient. The residual value syntax element is used to indicate the residual value of the absolute value of the coefficient level of the target transform coefficient, which is coeff_abs_level_remaining defined in the HEVC standard. From the description above, it can be seen that the binarization process of the residual value syntax element is relatively complicated and depends on multiple other syntax elements at the coefficient level. Therefore, it is highly dependent and not suitable for hardware parallel processing. However, the embodiment of the present disclosure proposes to obtain the coding length of the residual value syntax element by using the coefficient level calculation without binarizing the residual value syntax element, which can simplify the bit rate estimation process, and then simplify the rate-distortion estimation process, and can make the rate-distortion estimation suitable for hardware parallel operation, which can further improve the video coding efficiency.

[0239] For the residual value syntax element, the preset calculation method as described above can be obtained. For example, when the absolute value of the coefficient level is 0 or 1, the residual value syntax element may not exist, so the coding length of the residual value syntax element can be determined to be 0; when the absolute value of the coefficient level is 2, the residual value syntax element can be directly encoded as "0", so its coding length can be determined to be 1; when the absolute value of the coefficient level is greater than 2 and less than 66, the number of bits of the residual value syntax element changes in a rule of adding 1 each time, so it can be calculated using formula (1), and when the absolute value of the coefficient level is greater than or equal to 66, the number of bits of the residual value syntax element changes in a rule of adding 2 each time, so it can be calculated using formula (2).

[0240] Multiple verifications of the above-mentioned preset calculation method of the residual value syntax element show that the coding length of the residual value syntax element obtained by the above-mentioned preset calculation method proposed in the embodiment of the present disclosure has a bd-rate loss of 0.1% compared with the coding length calculated using the HEVC standard, and this loss is negligible. It can be seen that the embodiment of the present disclosure can achieve the same technical effect as the HEVC standard while simplifying the calculation method of the coding length of the syntax element.

[0241] According to another embodiment of the present disclosure, a bit rate estimation method comprises the following steps:

[0242] Get video data;

[0243] calling a pre-deployed service interface so that the service interface obtains a target transform coefficient of the video data, estimates a coding length of a target syntax element of a coefficient level for the target transform coefficient according to a preset calculation method, and determines a bit rate of the target syntax element according to the coding length; wherein the preset calculation method takes the coefficient level as an input;

[0244] Output the bit rate of the target syntax element.

[0245] In this embodiment, the service interface may be a SaaS service interface, which may be deployed locally or in the cloud. When necessary, users or relevant personnel may call the service interface and provide video data to the service interface. After receiving the video data to be processed, the service interface may obtain the target transform coefficient by performing a series of processes described above on the video data, and estimate the coding length of the target syntax element at the coefficient level for the target transform coefficient according to a preset calculation method, and determine the bit rate of the target syntax element according to the coding length; the bit rate estimation process can refer to Figure 5 The related description of the bit rate estimation method in the related embodiments will not be repeated here.

[0246] After processing is completed, the service interface returns the bit rate of the target syntax element.

[0247] Figure 6 A flowchart of a method for estimating the coding length of a target syntax element according to an embodiment of the present disclosure is shown. Figure 6 As shown, the coding length estimation method of the target syntax element includes the following steps:

[0248] In step S601, the target transform coefficients are obtained;

[0249] In step S602, a coding length of a target syntax element of a coefficient level for the target transform coefficient is estimated according to a preset calculation method; wherein the preset calculation method takes the coefficient level as input.

[0250] In this embodiment, the target transform coefficient may include any transform coefficient in a transform coefficient block obtained by applying a transform such as discrete cosine transform to the transform block during video encoding. The coefficient level of the target transform coefficient may be understood as the value of the target transform coefficient.

[0251] In some embodiments, the preset calculation method takes the coefficient level of the target transform coefficient as input, and uses the coefficient level to calculate the coding length of the target syntax element. In the preset calculation method, only the coefficient level of the target transform coefficient is needed to calculate the coding length of the target syntax element, that is, the coefficient level of the target transform coefficient is the only input of the preset calculation method, and its output is the coding length of the target syntax element. In other embodiments, since the preset calculation method only involves the coefficient level of the target transform coefficient, the preset calculation method does not need to estimate the coding length of the target syntax element after binarization, but can calculate the coding length of the target syntax element after scanning the coefficient level of the target transform coefficient, that is, the preset calculation method uses the coefficient level to calculate the coding length of the target syntax element without binarization of the target syntax element. The preset calculation method can be pre-set, and after determining the coefficient level of the target transform coefficient, the coding length of the target syntax element can be obtained according to the preset calculation method, without the need to perform complex binarization coding on the syntax element used for the coefficient level as specified in the HEVC standard in the previous text, and then obtain its coding length by counting the number of bits of binarization coding. The preset calculation method can be understood as a simplified processing method of the relevant content in the HEVC standard.

[0252] In some embodiments, the preset calculation method may define the coding length of the target syntax element under different value ranges of the coefficient level or the linear relationship between the coefficient level and the coding length. For example, when the coefficient level is 0, since the target syntax element may not exist, the coding length of the target syntax element may be defined as 0, and when the coefficient level is in other value ranges, a linear relationship between the coding length of the target syntax element and the coefficient level may be defined.

[0253] In this embodiment, the method of obtaining the coding length of the target syntax element by using the above-mentioned preset calculation method can be used in the rate-distortion estimation process.

[0254] Since the coding length estimation method of the above-mentioned syntax elements proposed in the embodiment of the present disclosure simplifies the relevant processes defined in the HEVC standard, the rate-distortion estimation process of the coding length estimation method of the above-mentioned syntax elements using the embodiment of the present disclosure is suitable for being performed in parallel with other processes in the video encoding process on the hardware encoder. The coding length estimation method of the above-mentioned syntax elements proposed in the embodiment of the present disclosure can simplify the rate-distortion estimation process, and can make the rate-distortion estimation process suitable for parallel operation on hardware, which can further improve the video encoding efficiency.

[0255] In an optional implementation of this embodiment, the target syntax element is a residual value of the absolute value of the coefficient level; the preset calculation method includes at least one of the following, including:

[0256] When the absolute value of the coefficient level is less than 2, the coding length of the target syntax element is 0;

[0257] When the absolute value of the coefficient level is equal to 2, the coding length of the target syntax element is 1;

[0258] When the absolute value of the coefficient level is greater than 2 and less than 66, the preset calculation method is as shown in formula (1);

[0259] When the absolute value of the coefficient level is greater than or equal to 66, the preset calculation method is as shown in formula (2);

[0260] bit num =int(log2(val))+2 (1)

[0261] bit num =int(log2((val-32)))*2 (2)

[0262] val=cAbslevel-2 (3)

[0263] Among them, bit num is the coding length of the target syntax element, cAbslevel is the absolute value of the coefficient level, and val is an intermediate variable.

[0264] In this optional implementation, a preset calculation method can be used to predict the coding length of the residual value syntax element at the coefficient level for the target transform coefficient. The residual value syntax element is used to indicate the residual value of the absolute value of the coefficient level of the target transform coefficient, which is coeff_abs_level_remaining defined in the HEVC standard. From the description above, it can be seen that the binarization process of the residual value syntax element is relatively complicated and depends on multiple other syntax elements at the coefficient level. Therefore, it is highly dependent and not suitable for hardware parallel processing. However, the embodiment of the present disclosure proposes to obtain the coding length of the residual value syntax element by using the coefficient level calculation without binarizing the residual value syntax element, which simplifies the estimation process of the coding length of the residual value syntax element, thereby simplifying the rate estimation process and the rate-distortion estimation process, and can make the rate-distortion estimation suitable for hardware parallel operation, which can further improve the video coding efficiency.

[0265] For the residual value syntax element, the preset calculation method as described above can be obtained. For example, when the absolute value of the coefficient level is 0 or 1, the residual value syntax element may not exist, so the coding length of the residual value syntax element can be determined to be 0; when the absolute value of the coefficient level is 2, the residual value syntax element can be directly encoded as "0", so its coding length can be determined to be 1; when the absolute value of the coefficient level is greater than 2 and less than 66, the number of bits of the residual value syntax element changes in a rule of adding 1 each time, so it can be calculated using formula (1), and when the absolute value of the coefficient level is greater than or equal to 66, the number of bits of the residual value syntax element changes in a rule of adding 2 each time, so it can be calculated using formula (2).

[0266] Multiple verifications of the above-mentioned preset calculation method of the residual value syntax element show that the coding length of the residual value syntax element obtained by the above-mentioned preset calculation method proposed in the embodiment of the present disclosure has a bd-rate loss of 0.1% compared with the coding length calculated using the HEVC standard, and this loss is negligible. It can be seen that the embodiment of the present disclosure can achieve the same technical effect as the HEVC standard while simplifying the calculation method of the coding length of the syntax element.

[0267] According to another embodiment of the present disclosure, a method for estimating the coding length of a target syntax element includes the following steps:

[0268] Get video data;

[0269] Invoking a pre-deployed service interface so that the service interface obtains a target transform coefficient of the video data and estimates a coding length of a target syntax element of a coefficient level for the target transform coefficient according to a preset calculation method; wherein the preset calculation method takes the coefficient level as input;

[0270] Output the encoding length of the target syntax element.

[0271] In this embodiment, the service interface may be a SaaS service interface, which may be deployed locally or in the cloud. When necessary, users or relevant personnel may call the service interface and provide video data to the service interface. After receiving the video data to be processed, the service interface may obtain the target transform coefficient by performing a series of processes described above on the video data, and estimate the coding length of the target syntax element at the coefficient level for the target transform coefficient according to a preset calculation method; the estimation process of the coding length of the target syntax element may refer to the above Figure 6 The description of the method for estimating the coding length of the target syntax element in the related embodiments will not be repeated here.

[0272] After processing is completed, the service interface returns the bit rate of the target syntax element.

[0273] Figure 7 FIG. 2 shows a structural block diagram of a video encoder according to an embodiment of the present disclosure. Figure 7 As shown, the video encoder 700 includes a rate-distortion estimation unit 701; the rate-distortion estimation unit 701 is used to obtain a target transform coefficient, and estimate the coding length of a target syntax element of a coefficient level for the target transform coefficient according to a preset calculation method; wherein the preset calculation method takes the coefficient level as input; and predicts the rate-distortion cost of the video data corresponding to the target transform coefficient according to the coding length.

[0274] In the process of encoding the video frame, the video encoder 700 in this embodiment uses the rate-distortion estimation unit 701 to predict the rate-distortion cost of the video data. The video encoder 700 can be implemented by a variety of suitable hardware circuits, such as a microprocessor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array, a discrete logic, and other hardware and hardware combinations. The rate-distortion estimation unit 701 can be implemented by one or more components in the video encoder 700. The process of the rate-distortion estimation unit 701 implementing the rate-distortion estimation can be seen in the above description of the rate-distortion estimation method, which will not be repeated here.

[0275] In the embodiment of the present disclosure, the process of implementing rate-distortion estimation by the rate-distortion estimation unit in the video encoder can be implemented in parallel with other related processes in the video encoder.

[0276] In an optional implementation manner of this embodiment, the preset calculation method calculates the coding length of the target syntax element when the target syntax element is not binarized.

[0277] In an optional implementation of this embodiment, the target syntax element is used to indicate a residual value of the absolute value of the coefficient level.

[0278] In an optional implementation of this embodiment, the preset calculation method includes at least one of the following:

[0279] When the absolute value of the coefficient level is less than 2, the coding length of the target syntax element is 0;

[0280] When the absolute value of the coefficient level is equal to 2, the coding length of the target syntax element is 1;

[0281] When the absolute value of the coefficient level is greater than 2 and less than 66, the preset calculation method is as shown in formula (1);

[0282] When the absolute value of the coefficient level is greater than or equal to 66, the preset calculation method is as shown in formula (2);

[0283] bit num =int(log2(val))+2 (1)

[0284] bit num =int(log2((val-32)))*2 (2)

[0285] val=cAbslevel-2 (3)

[0286] Among them, bit num is the coding length of the target syntax element, cAbslevel is the absolute value of the coefficient level, and val is an intermediate variable.

[0287] For specific details of the above optional implementation manner, reference may be made to the above description of the rate-distortion estimation method, which will not be described in detail here.

[0288] In an optional implementation of this embodiment, the video encoder further includes a distortion determination unit;

[0289] The distortion determination unit is used to determine the encoding distortion corresponding to the video data;

[0290] The rate-distortion estimation unit predicts a code rate corresponding to the video data according to a coding length of a target syntax element, and determines the rate-distortion cost based on the coding distortion and the code rate.

[0291] In this optional implementation, the video encoder further includes a distortion determination unit for determining the coding distortion corresponding to the video data, and the rate-distortion estimation unit determines the rate-distortion cost according to the coding distortion output by the distortion determination unit and the bit rate predicted according to the coding length of the target syntax element. The distortion determination unit and the rate-distortion estimation unit can be different hardware components in the video encoder or the same hardware combination. The above detailed processing process can be referred to the description in the rate-distortion estimation method, which will not be repeated here.

[0292] In an optional implementation of this embodiment, the video encoder also includes a residual calculation unit, a transformation unit, a quantization unit and an inverse quantization unit; the residual calculation unit is used to obtain residual data corresponding to the video data and the prediction data; the transformation unit is used to transform the residual data to obtain a first transformation coefficient set; the first transformation coefficient set includes the target transformation coefficient; the quantization unit is used to perform a quantization operation on the first transformation coefficient set; the inverse quantization unit is used to perform an inverse quantization operation on the first transformation coefficient set that has been quantized, and obtain a second transformation coefficient set; the distortion determination unit determines the coding distortion based on the first transformation coefficient set and the second transformation coefficient set.

[0293] In this optional implementation, the video encoder further includes a residual calculation unit, a transform unit, a quantization unit, and an inverse quantization unit; the residual calculation unit, the transform unit, the quantization unit, and the inverse quantization unit can be implemented as one or more hardware components in the video encoder, for calculating residual data from video data and prediction data, and performing transform, quantization, and inverse quantization operations on the residual data; the distortion determination unit determines the coding distortion according to the first transform coefficient set obtained by the transform operation and the second transform coefficient set obtained by the inverse quantization operation. The above detailed processing process can be referred to the description in the rate-distortion estimation method, which will not be repeated here.

[0294] According to a video encoder of one embodiment of the present disclosure, the video encoder includes a bit rate estimation unit; the bit rate estimation unit is used to obtain a target transform coefficient; the coding length of a target syntax element of a coefficient level for the target transform coefficient is estimated according to a preset calculation method; wherein the preset calculation method takes the coefficient level as input; and the bit rate of the target syntax element is determined according to the coding length.

[0295] In the process of encoding the video frame, the video encoder in this embodiment uses the rate estimation unit to estimate the rate of the target syntax element. The video encoder can be implemented by a variety of suitable hardware circuits, such as a microprocessor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array, a discrete logic and other hardware and hardware combinations. The rate estimation unit can be implemented by one or more components in the video encoder. The process of the rate estimation unit implementing the rate estimation can be seen in the above description of the rate estimation method, which will not be repeated here.

[0296] In an optional implementation of this embodiment, the target syntax element is a residual value of the absolute value of the coefficient level; and the preset calculation method includes at least one of the following:

[0297] When the absolute value of the coefficient level is less than 2, the coding length of the target syntax element is 0;

[0298] When the absolute value of the coefficient level is equal to 2, the coding length of the target syntax element is 1;

[0299] When the absolute value of the coefficient level is greater than 2 and less than 66, the preset calculation method is as shown in formula (1);

[0300] When the absolute value of the coefficient level is greater than or equal to 66, the preset calculation method is as shown in formula (2);

[0301] bit num =int(log2(val))+2 (1)

[0302] bit num =int(log2((val-32)))*2 (2)

[0303] val=cAbslevel-2 (3)

[0304] Among them, bit num is the coding length of the target syntax element, cAbslevel is the absolute value of the coefficient level, and val is an intermediate variable.

[0305] For specific details of the above optional implementation, please refer to the above description of the bit rate estimation method, which will not be repeated here.

[0306] The following are embodiments of the apparatus of the present disclosure, which can be used to execute embodiments of the method of the present disclosure.

[0307] According to a rate-distortion estimation device according to an embodiment of the present disclosure, the device can be implemented as part or all of an electronic device through software, hardware, or a combination of both. The rate-distortion estimation device includes:

[0308] A first acquisition module is configured to acquire a target transform coefficient;

[0309] A first estimation module is configured to estimate the coding length of a target syntax element for a coefficient level of the target transform coefficient according to a preset calculation method; wherein the preset calculation method takes the coefficient level as an input;

[0310] The prediction module is configured to predict the rate-distortion cost of the video data corresponding to the target transform coefficient according to the coding length.

[0311] In an optional implementation manner of this embodiment, the preset calculation method calculates the coding length of the target syntax element when the target syntax element is not binarized.

[0312] In an optional implementation of this embodiment, the target syntax element is used to indicate a residual value of the absolute value of the coefficient level.

[0313] In an optional implementation of this embodiment, the preset calculation method includes at least one of the following:

[0314] When the absolute value of the coefficient level is less than 2, the coding length of the target syntax element is 0;

[0315] When the absolute value of the coefficient level is equal to 2, the coding length of the target syntax element is 1;

[0316] When the absolute value of the coefficient level is greater than 2 and less than 66, the preset calculation method is as shown in formula (1);

[0317] When the absolute value of the coefficient level is greater than or equal to 66, the preset calculation method is as shown in formula (2);

[0318] bit num =int(log2(val))+2 (1)

[0319] bit num =int(log2((val-32)))*2 (2)

[0320] val=cAbslevel-2 (3)

[0321] Among them, bit num is the coding length of the target syntax element, cAbslevel is the absolute value of the coefficient level, and val is an intermediate variable.

[0322] In an optional implementation of this embodiment, the prediction module includes:

[0323] A first determination submodule is configured to determine a coding distortion corresponding to the video data;

[0324] A prediction submodule, configured to predict a bit rate corresponding to the video data according to a coding length of a target syntax element;

[0325] The second determining submodule is configured to determine the rate-distortion cost based on the coding distortion and the bit rate.

[0326] In an optional implementation of this embodiment, the first determining submodule includes:

[0327] An acquisition submodule, configured to acquire residual data corresponding to the video data and the prediction data;

[0328] A transform submodule, configured to transform the residual data to obtain a first transform coefficient set; the first transform coefficient set includes the target transform coefficient;

[0329] a quantization and dequantization submodule, configured to perform quantization and dequantization operations on the first transform coefficient set to obtain a second transform coefficient set;

[0330] The third determination submodule is configured to determine the coding distortion according to the first transform coefficient set and the second transform coefficient set.

[0331] The rate distortion estimation device in this embodiment is Figure 2 The rate distortion estimation method shown in the related embodiments corresponds to the same. For details, please refer to the above Figure 2 The description of the rate-distortion estimation method shown in the related embodiments will not be repeated here.

[0332] According to a bit rate estimation device according to an embodiment of the present disclosure, the device can be implemented as part or all of an electronic device through software, hardware, or a combination of both. The bit rate estimation device includes:

[0333] A second acquisition module is configured to acquire a target transform coefficient;

[0334] A second estimation module is configured to estimate the coding length of the target syntax element for the coefficient level of the target transform coefficient according to a preset calculation method; wherein the preset calculation method takes the coefficient level as input;

[0335] A determination module is configured to determine a code rate of the target syntax element according to the coding length.

[0336] In an optional implementation of this embodiment, the target syntax element is a residual value of the absolute value of the coefficient level; the preset calculation method includes at least one of the following, including:

[0337] When the absolute value of the coefficient level is less than 2, the coding length of the target syntax element is 0;

[0338] When the absolute value of the coefficient level is equal to 2, the coding length of the target syntax element is 1;

[0339] When the absolute value of the coefficient level is greater than 2 and less than 66, the preset calculation method is as shown in formula (1);

[0340] When the absolute value of the coefficient level is greater than or equal to 66, the preset calculation method is as shown in formula (2);

[0341] bit num=int(log2(val))+2 (1)

[0342] bit num =int(log2((val-32)))*2 (2)

[0343] val=cAbslevel-2 (3)

[0344] Among them, bit num is the coding length of the target syntax element, cAbslevel is the absolute value of the coefficient level, and val is an intermediate variable.

[0345] The above-mentioned bit rate estimation device in this embodiment is Figure 5 The bit rate estimation method shown in the relevant embodiment corresponds to the same. For details, please refer to the above Figure 5 The description of the bit rate estimation method shown in the related embodiments will not be repeated here.

[0346] According to an embodiment of the present disclosure, a coding length estimation device for a target syntax element can be implemented as part or all of an electronic device through software, hardware, or a combination of both. The coding length estimation device for a target syntax element includes:

[0347] A third acquisition module is configured to acquire a target transform coefficient;

[0348] The third estimation module is configured to estimate the coding length of the target syntax element of the coefficient level for the target transform coefficient according to a preset calculation method; wherein the preset calculation method uses the coefficient level as input.

[0349] In an optional implementation of this embodiment, the target syntax element is a residual value of the absolute value of the coefficient level; the preset calculation method includes at least one of the following, including:

[0350] When the absolute value of the coefficient level is less than 2, the coding length of the target syntax element is 0;

[0351] When the absolute value of the coefficient level is equal to 2, the coding length of the target syntax element is 1;

[0352] When the absolute value of the coefficient level is greater than 2 and less than 66, the preset calculation method is as shown in formula (1);

[0353] When the absolute value of the coefficient level is greater than or equal to 66, the preset calculation method is as shown in formula (2);

[0354] bit num =int(log2(val))+2 (1)

[0355] bit num =int(log2((val-32)))*2 (2)

[0356] val=cAbslevel-2 (3)

[0357] Among them, bit num is the coding length of the target syntax element, cAbslevel is the absolute value of the coefficient level, and val is an intermediate variable.

[0358] The coding length estimation device of the target syntax element in this embodiment is Figure 6 The coding length estimation method of the target syntax element shown in the related embodiments corresponds to the same. For details, please refer to the above Figure 6 The description of the coding length estimation method of the target syntax element shown in the related embodiments will not be repeated here.

[0359] According to a bit rate estimation device according to an embodiment of the present disclosure, the device can be implemented as part or all of an electronic device through software, hardware, or a combination of both. The bit rate estimation device includes:

[0360] A fourth acquisition module is configured to acquire video data;

[0361] a first calling module configured to call a pre-deployed service interface so that the service interface obtains a target transform coefficient of the video data, estimates a coding length of a target syntax element of a coefficient level for the target transform coefficient according to a preset calculation method, and determines a bit rate of the target syntax element according to the coding length; wherein the preset calculation method takes the coefficient level as an input;

[0362] The first output module is configured to output the bit rate of the target syntax element.

[0363] The above-mentioned bit rate estimation device in this embodiment corresponds to and is consistent with the bit rate estimation method shown in the above-mentioned related embodiments. For specific details, reference may be made to the above-mentioned description of the bit rate estimation method, which will not be repeated here.

[0364] According to a rate-distortion estimation device according to an embodiment of the present disclosure, the device can be implemented as part or all of an electronic device through software, hardware, or a combination of both. The rate-distortion estimation device includes:

[0365] A fifth acquisition module, configured to acquire video data;

[0366] a second calling module configured to call a pre-deployed service interface so that the service interface obtains a target transform coefficient of the video data, estimates a coding length of a target syntax element of a coefficient level for the target transform coefficient according to a preset calculation method, and predicts a rate-distortion cost of the video data according to the coding length; wherein the preset calculation method takes the coefficient level as an input;

[0367] The second output module is configured to output the rate-distortion cost.

[0368] The rate-distortion estimation device in this embodiment corresponds to and is consistent with the rate-distortion estimation method shown in the above-mentioned related embodiments. For specific details, reference may be made to the above-mentioned description of the rate-distortion estimation method, which will not be described in detail here.

[0369] According to an embodiment of the present disclosure, a coding length estimation device for a target syntax element can be implemented as part or all of an electronic device through software, hardware, or a combination of both. The coding length estimation device for a target syntax element includes:

[0370] A sixth acquisition module, configured to acquire video data;

[0371] a third calling module configured to call a pre-deployed service interface so that the service interface obtains a target transform coefficient of the video data and estimates a coding length of a target syntax element of a coefficient level for the target transform coefficient according to a preset calculation method; wherein the preset calculation method takes the coefficient level as an input;

[0372] The third output module is configured to output the coding length of the target syntax element.

[0373] The above-mentioned target syntax element coding length estimation device in this embodiment corresponds to the target syntax element coding length estimation method shown in the above-mentioned related embodiments. For specific details, please refer to the above-mentioned description of the target syntax element coding length estimation method, which will not be repeated here.

[0374] Figure 8 It is a structural diagram of an electronic device suitable for implementing the rate-distortion estimation, code rate estimation and / or target syntax element coding length estimation method according to an embodiment of the present disclosure.

[0375] like Figure 8As shown, the electronic device 800 includes a processing unit 801, which can be implemented as a processing unit such as a CPU, a GPU, an FPGA, and an NPU. The processing unit 801 can perform various processes in the implementation of any of the above methods of the present disclosure according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage part 808 to a random access memory (RAM) 803. In RAM803, various programs and data required for the operation of the electronic device 800 are also stored. The processing unit 801, ROM802, and RAM803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0376] The following components are connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed, so that a computer program read therefrom is installed into the storage section 808 as needed.

[0377] In particular, according to an embodiment of the present disclosure, any method in the above referenced embodiment of the present disclosure may be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program tangibly contained on a readable medium thereof, and the computer program includes a program code for executing any method in the embodiment of the present disclosure. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 809, and / or installed from a removable medium 811.

[0378] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the road map or block diagram can represent a part of a module, program segment or code, and the part of the module, program segment or code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a different order from the order marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0379] The units or modules involved in the embodiments described in the present disclosure may be implemented by software or hardware. The units or modules described may also be set in a processor, and the names of these units or modules do not constitute limitations on the units or modules themselves in some cases.

[0380] As another aspect, the present disclosure further provides a computer-readable storage medium, which may be a computer-readable storage medium included in the device described in the above embodiment; or a computer-readable storage medium that exists independently and is not assembled into the device. The computer-readable storage medium stores one or more programs, and the programs are used by one or more processors to execute the method described in the present disclosure.

[0381] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present disclosure is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the inventive concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other.

Claims

1. A bit rate estimation method, wherein: include: Get video data; calling a pre-deployed service interface so that the service interface obtains a target transform coefficient of the video data, estimates a coding length of a target syntax element of a coefficient level for the target transform coefficient according to a preset calculation method, and determines a bit rate of the target syntax element according to the coding length; wherein the preset calculation method takes the coefficient level as an input; Outputting a bit rate of the target syntax element; The preset calculation method calculates the coding length of the target syntax element without binarizing the target syntax element; The preset calculation method includes at least one of the following: When the absolute value of the coefficient level is less than 2, the coding length of the target syntax element is 0; When the absolute value of the coefficient level is equal to 2, the coding length of the target syntax element is 1; When the absolute value of the coefficient level is greater than 2 and less than 66, the preset calculation method is as shown in formula (1); When the absolute value of the coefficient level is greater than or equal to 66, the preset calculation method is as shown in formula (2); bitnum=int(log2(val))+2 (1) bitnum=int(log2((val-32)))×2 (2) val=cAbslevel-2 (3) Among them, bitnum is the coding length of the target syntax element, cAbslevel is the absolute value of the coefficient level, and val is an intermediate variable.

2. A method for estimating bit rate, wherein: include: Get target transform coefficients; estimating a coding length of a target syntax element for a coefficient level of the target transform coefficient according to a preset calculation method; wherein the preset calculation method takes the coefficient level as input; Determining a bit rate of the target syntax element according to the coding length; The preset calculation method calculates the coding length of the target syntax element without binarizing the target syntax element; The preset calculation method includes at least one of the following: When the absolute value of the coefficient level is less than 2, the coding length of the target syntax element is 0; When the absolute value of the coefficient level is equal to 2, the coding length of the target syntax element is 1; When the absolute value of the coefficient level is greater than 2 and less than 66, the preset calculation method is as shown in formula (1); When the absolute value of the coefficient level is greater than or equal to 66, the preset calculation method is as shown in formula (2); bitnum=int(log2(val))+2 (1) bitnum=int(log2((val-32)))×2 (2) val=cAbslevel-2 (3) Among them, bitnum is the coding length of the target syntax element, cAbslevel is the absolute value of the coefficient level, and val is an intermediate variable.

3. A rate-distortion estimation method, wherein: include: Get video data; calling a pre-deployed service interface so that the service interface obtains a target transform coefficient of the video data, estimates a coding length of a target syntax element of a coefficient level for the target transform coefficient according to a preset calculation method, and predicts a rate-distortion cost of the video data according to the coding length; wherein the preset calculation method takes the coefficient level as an input; Outputting the rate-distortion cost; Wherein, the preset calculation method calculates the coding length of the target syntax element without binarizing the target syntax element; The preset calculation method includes at least one of the following: When the absolute value of the coefficient level is less than 2, the coding length of the target syntax element is 0; When the absolute value of the coefficient level is equal to 2, the coding length of the target syntax element is 1; When the absolute value of the coefficient level is greater than 2 and less than 66, the preset calculation method is as shown in formula (1); When the absolute value of the coefficient level is greater than or equal to 66, the preset calculation method is as shown in formula (2); bitnum=int(log2(val))+2 (1) bitnum=int(log2((val-32)))×2 (2) val=cAbslevel-2 (3) Among them, bitnum is the coding length of the target syntax element, cAbslevel is the absolute value of the coefficient level, and val is an intermediate variable.

4. The method according to claim 3, wherein: The target syntax element is used to indicate the remaining value of the absolute value of the coefficient level.

5. The method according to claim 3, wherein: Predicting the rate-distortion cost of the video data corresponding to the target transform coefficient according to the coding length includes: Determining a coding distortion corresponding to the video data; Predicting a bit rate corresponding to the video data according to a coding length of a target syntax element; The rate-distortion cost is determined based on the coding distortion and the code rate.

6. The method according to claim 5, wherein: Determining the coding distortion corresponding to the video data includes: Obtaining residual data corresponding to the video data and the predicted data; Transforming the residual data to obtain a first transform coefficient set; the first transform coefficient set includes the target transform coefficient; Performing quantization and inverse quantization operations on the first transform coefficient set to obtain a second transform coefficient set; The coding distortion is determined according to the first transform coefficient set and the second transform coefficient set.

7. A rate-distortion estimation method, wherein: include: Get target transform coefficients; estimating a coding length of a target syntax element for a coefficient level of the target transform coefficient according to a preset calculation method; wherein the preset calculation method takes the coefficient level as input; Predicting a rate-distortion cost of video data corresponding to the target transform coefficient according to the coding length; The preset calculation method calculates the coding length of the target syntax element without binarizing the target syntax element; The preset calculation method includes at least one of the following: When the absolute value of the coefficient level is less than 2, the coding length of the target syntax element is 0; When the absolute value of the coefficient level is equal to 2, the coding length of the target syntax element is 1; When the absolute value of the coefficient level is greater than 2 and less than 66, the preset calculation method is as shown in formula (1); When the absolute value of the coefficient level is greater than or equal to 66, the preset calculation method is as shown in formula (2); bitnum=int(log2(val))+2 (1) bitnum=int(log2((val-32)))×2 (2) val=cAbslevel-2 (3) Among them, bitnum is the coding length of the target syntax element, cAbslevel is the absolute value of the coefficient level, and val is an intermediate variable.

8. The method according to claim 7, wherein: The target syntax element is used to indicate the remaining value of the absolute value of the coefficient level.

9. The method according to any one of claim 7, wherein: Predicting the rate-distortion cost of the video data corresponding to the target transform coefficient according to the coding length includes: Determining a coding distortion corresponding to the video data; Predicting a bit rate corresponding to the video data according to a coding length of a target syntax element; The rate-distortion cost is determined based on the coding distortion and the code rate.

10. The method according to claim 9, wherein: Determining the coding distortion corresponding to the video data includes: Obtaining residual data corresponding to the video data and the predicted data; Transforming the residual data to obtain a first transform coefficient set; the first transform coefficient set includes the target transform coefficient; Performing quantization and inverse quantization operations on the first transform coefficient set to obtain a second transform coefficient set; The coding distortion is determined according to the first transform coefficient set and the second transform coefficient set.

11. A method for estimating the coding length of a target syntax element, wherein: include: Get video data; calling a pre-deployed service interface so that the service interface obtains a target transform coefficient of the video data and estimates a coding length of a target syntax element of a coefficient level for the target transform coefficient according to a preset calculation method; wherein the preset calculation method takes the coefficient level as input; Outputting the encoding length of the target syntax element; The preset calculation method calculates the coding length of the target syntax element without binarizing the target syntax element; The preset calculation method includes at least one of the following: When the absolute value of the coefficient level is less than 2, the coding length of the target syntax element is 0; When the absolute value of the coefficient level is equal to 2, the coding length of the target syntax element is 1; When the absolute value of the coefficient level is greater than 2 and less than 66, the preset calculation method is as shown in formula (1); When the absolute value of the coefficient level is greater than or equal to 66, the preset calculation method is as shown in formula (2); bitnum=int(log2(val))+2 (1) bitnum=int(log2((val-32)))×2 (2) val=cAbslevel-2 (3) Among them, bitnum is the coding length of the target syntax element, cAbslevel is the absolute value of the coefficient level, and val is an intermediate variable.

12. A method for estimating the coding length of a target syntax element, wherein: include: Get target transform coefficients; estimating a coding length of a target syntax element for a coefficient level of the target transform coefficient according to a preset calculation method; wherein the preset calculation method takes the coefficient level as input; The preset calculation method calculates the coding length of the target syntax element without binarizing the target syntax element; The preset calculation method includes at least one of the following: When the absolute value of the coefficient level is less than 2, the coding length of the target syntax element is 0; When the absolute value of the coefficient level is equal to 2, the coding length of the target syntax element is 1; When the absolute value of the coefficient level is greater than 2 and less than 66, the preset calculation method is as shown in formula (1); When the absolute value of the coefficient level is greater than or equal to 66, the preset calculation method is as shown in formula (2); bitnum=int(log2(val))+2 (1) bitnum=int(log2((val-32)))×2 (2) val=cAbslevel-2 (3) Among them, bitnum is the coding length of the target syntax element, cAbslevel is the absolute value of the coefficient level, and val is an intermediate variable.

13. A rate-distortion estimation device, wherein: include: A first acquisition module is configured to acquire a target transform coefficient; A first estimation module is configured to estimate the coding length of a target syntax element for a coefficient level of the target transform coefficient according to a preset calculation method; wherein the preset calculation method takes the coefficient level as an input; A prediction module, configured to predict a rate-distortion cost of video data corresponding to the target transform coefficient according to the coding length; The preset calculation method calculates the coding length of the target syntax element without binarizing the target syntax element; The preset calculation method includes at least one of the following: When the absolute value of the coefficient level is less than 2, the coding length of the target syntax element is 0; When the absolute value of the coefficient level is equal to 2, the coding length of the target syntax element is 1; When the absolute value of the coefficient level is greater than 2 and less than 66, the preset calculation method is as shown in formula (1); When the absolute value of the coefficient level is greater than or equal to 66, the preset calculation method is as shown in formula (2); bitnum=int(log2(val))+2 (1) bitnum=int(log2((val-32)))×2 (2) val=cAbslevel-2 (3) Among them, bitnum is the coding length of the target syntax element, cAbslevel is the absolute value of the coefficient level, and val is an intermediate variable.

14. A bit rate estimation device, wherein: include: A second acquisition module is configured to acquire a target transform coefficient; A second estimation module is configured to estimate the coding length of the target syntax element for the coefficient level of the target transform coefficient according to a preset calculation method; wherein the preset calculation method takes the coefficient level as input; A determination module, configured to determine a code rate of the target syntax element according to the coding length; The preset calculation method calculates the coding length of the target syntax element without binarizing the target syntax element; The preset calculation method includes at least one of the following: When the absolute value of the coefficient level is less than 2, the coding length of the target syntax element is 0; When the absolute value of the coefficient level is equal to 2, the coding length of the target syntax element is 1; When the absolute value of the coefficient level is greater than 2 and less than 66, the preset calculation method is as shown in formula (1); When the absolute value of the coefficient level is greater than or equal to 66, the preset calculation method is as shown in formula (2); bitnum=int(log2(val))+2 (1) bitnum=int(log2((val-32)))×2 (2) val=cAbslevel-2 (3) Among them, bitnum is the coding length of the target syntax element, cAbslevel is the absolute value of the coefficient level, and val is an intermediate variable.

15. A coding length estimation device for a target syntax element, wherein: include: A third acquisition module is configured to acquire a target transform coefficient; a third estimation module configured to estimate a coding length of a target syntax element for a coefficient level of the target transform coefficient according to a preset calculation method; wherein the preset calculation method takes the coefficient level as an input; The preset calculation method calculates the coding length of the target syntax element without binarizing the target syntax element; The preset calculation method includes at least one of the following: When the absolute value of the coefficient level is less than 2, the coding length of the target syntax element is 0; When the absolute value of the coefficient level is equal to 2, the coding length of the target syntax element is 1; When the absolute value of the coefficient level is greater than 2 and less than 66, the preset calculation method is as shown in formula (1); When the absolute value of the coefficient level is greater than or equal to 66, the preset calculation method is as shown in formula (2); bitnum=int(log2(val))+2 (1) bitnum=int(log2((val-32)))×2 (2) val=cAbslevel-2 (3) Among them, bitnum is the coding length of the target syntax element, cAbslevel is the absolute value of the coefficient level, and val is an intermediate variable.

16. A bit rate estimation device, wherein: include: A fourth acquisition module is configured to acquire video data; a first calling module configured to call a pre-deployed service interface so that the service interface obtains a target transform coefficient of the video data, estimates a coding length of a target syntax element of a coefficient level for the target transform coefficient according to a preset calculation method, and determines a bit rate of the target syntax element according to the coding length; wherein the preset calculation method takes the coefficient level as an input; A first output module, configured to output a bit rate of the target syntax element; The preset calculation method calculates the coding length of the target syntax element without binarizing the target syntax element; The preset calculation method includes at least one of the following: When the absolute value of the coefficient level is less than 2, the coding length of the target syntax element is 0; When the absolute value of the coefficient level is equal to 2, the coding length of the target syntax element is 1; When the absolute value of the coefficient level is greater than 2 and less than 66, the preset calculation method is as shown in formula (1); When the absolute value of the coefficient level is greater than or equal to 66, the preset calculation method is as shown in formula (2); bitnum=int(log2(val))+2 (1) bitnum=int(log2((val-32)))×2 (2) val=cAbslevel-2 (3) Among them, bitnum is the coding length of the target syntax element, cAbslevel is the absolute value of the coefficient level, and val is an intermediate variable.

17. A rate-distortion estimation device, wherein: include: A fifth acquisition module, configured to acquire video data; a second calling module configured to call a pre-deployed service interface so that the service interface obtains a target transform coefficient of the video data, estimates a coding length of a target syntax element of a coefficient level for the target transform coefficient according to a preset calculation method, and predicts a rate-distortion cost of the video data according to the coding length; wherein the preset calculation method takes the coefficient level as an input; A second output module is configured to output the rate-distortion cost; The preset calculation method calculates the coding length of the target syntax element without binarizing the target syntax element; The preset calculation method includes at least one of the following: When the absolute value of the coefficient level is less than 2, the coding length of the target syntax element is 0; When the absolute value of the coefficient level is equal to 2, the coding length of the target syntax element is 1; When the absolute value of the coefficient level is greater than 2 and less than 66, the preset calculation method is as shown in formula (1); When the absolute value of the coefficient level is greater than or equal to 66, the preset calculation method is as shown in formula (2); bitnum=int(log2(val))+2 (1) bitnum=int(log2((val-32)))×2 (2) val=cAbslevel-2 (3) Among them, bitnum is the coding length of the target syntax element, cAbslevel is the absolute value of the coefficient level, and val is an intermediate variable.

18. A coding length estimation device for a target syntax element, wherein: include: A sixth acquisition module, configured to acquire video data; a third calling module configured to call a pre-deployed service interface so that the service interface obtains a target transform coefficient of the video data and estimates a coding length of a target syntax element of a coefficient level for the target transform coefficient according to a preset calculation method; wherein the preset calculation method takes the coefficient level as an input; A third output module is configured to output the encoding length of the target syntax element; The preset calculation method calculates the coding length of the target syntax element without binarizing the target syntax element; The preset calculation method includes at least one of the following: When the absolute value of the coefficient level is less than 2, the coding length of the target syntax element is 0; When the absolute value of the coefficient level is equal to 2, the coding length of the target syntax element is 1; When the absolute value of the coefficient level is greater than 2 and less than 66, the preset calculation method is as shown in formula (1); When the absolute value of the coefficient level is greater than or equal to 66, the preset calculation method is as shown in formula (2); bitnum=int(log2(val))+2 (1) bitnum=int(log2((val-32)))×2 (2) val=cAbslevel-2 (3) Among them, bitnum is the coding length of the target syntax element, cAbslevel is the absolute value of the coefficient level, and val is an intermediate variable.

19. A video encoder, wherein: Including a bit rate estimation unit; The bit rate estimation unit is used to obtain the target transform coefficient; estimating a coding length of a target syntax element for a coefficient level of the target transform coefficient according to a preset calculation method; wherein the preset calculation method takes the coefficient level as input; and determining a bit rate of the target syntax element according to the coding length; The preset calculation method calculates the coding length of the target syntax element without binarizing the target syntax element; The preset calculation method includes at least one of the following: When the absolute value of the coefficient level is less than 2, the coding length of the target syntax element is 0; When the absolute value of the coefficient level is equal to 2, the coding length of the target syntax element is 1; When the absolute value of the coefficient level is greater than 2 and less than 66, the preset calculation method is as shown in formula (1); When the absolute value of the coefficient level is greater than or equal to 66, the preset calculation method is as shown in formula (2); bitnum=int(log2(val))+2 (1) bitnum=int(log2((val-32)))×2 (2) val=cAbslevel-2 (3) Among them, bitnum is the coding length of the target syntax element, cAbslevel is the absolute value of the coefficient level, and val is an intermediate variable.

20. A video encoder, wherein: including a rate-distortion estimation unit; The rate-distortion estimation unit is used to obtain a target transform coefficient, estimate a coding length of a target syntax element for a coefficient level of the target transform coefficient according to a preset calculation method; wherein the preset calculation method takes the coefficient level as input; and predict a rate-distortion cost of the video data according to the coding length; The preset calculation method calculates the coding length of the target syntax element without binarizing the target syntax element; The preset calculation method includes at least one of the following: When the absolute value of the coefficient level is less than 2, the coding length of the target syntax element is 0; When the absolute value of the coefficient level is equal to 2, the coding length of the target syntax element is 1; When the absolute value of the coefficient level is greater than 2 and less than 66, the preset calculation method is as shown in formula (1); When the absolute value of the coefficient level is greater than or equal to 66, the preset calculation method is as shown in formula (2); bitnum=int(log2(val))+2 (1) bitnum=int(log2((val-32)))×2 (2) val=cAbslevel-2 (3) Among them, bitnum is the coding length of the target syntax element, cAbslevel is the absolute value of the coefficient level, and val is an intermediate variable.

21. The video encoder of claim 20, wherein: The target syntax element is used to indicate the remaining value of the absolute value of the coefficient level.

22. The video encoder of claim 20, wherein: Also included is a distortion determination unit; The distortion determination unit is used to determine the encoding distortion corresponding to the video data; The rate-distortion estimation unit predicts a code rate corresponding to the video data according to a coding length of a target syntax element, and determines the rate-distortion cost based on the coding distortion and the code rate.

23. The video encoder of claim 22, wherein: It also includes a residual calculation unit, a transform unit, a quantization unit and a dequantization unit; The residual calculation unit is used to obtain residual data corresponding to the video data and the prediction data; The transform unit is used to transform the residual data to obtain a first transform coefficient set; the first transform coefficient set includes the target transform coefficient; The quantization unit is used to perform a quantization operation on the first transform coefficient set; The dequantization unit is used to perform a dequantization operation on the first transform coefficient set that has been subjected to the quantization operation, and obtain a second transform coefficient set; The distortion determination unit determines the coding distortion according to the first transform coefficient set and the second transform coefficient set.

24. An electronic device, wherein: comprising a memory and a processor; wherein, The memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the method according to any one of claims 1 to 12.

25. A computer-readable storage medium having computer instructions stored thereon, wherein: When the computer instructions are executed by a processor, the method according to any one of claims 1 to 12 is implemented.

Citation Information

Patent Citations

  • High-efficiency video coding code rate estimation device and method

    CN110460853A