Method and apparatus for obtaining quantization parameters

By using a point-level prediction mode, combining the image bit depth, the QP of the CU, and the image complexity level, the prediction residual value of the current point is calculated, and the quantization parameter QP is adjusted. This solves the problem of insufficient QP and image content adaptation in video data transmission, and improves coding efficiency and image quality.

CN118646875BActive Publication Date: 2025-10-28HUAWEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410620041.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-13
Publication Date
2025-10-28
Estimated Expiration
2043-03-13

Smart Images

  • Figure CN118646875B_ABST
    Figure CN118646875B_ABST
Patent Text Reader

Abstract

This application provides a method and apparatus for obtaining quantization parameters. The method, applicable to point-level prediction modes, includes: obtaining the bit depth of the current image; obtaining the quantization parameter QP of the current coding unit (CU), where the current CU belongs to the current image; obtaining the image complexity level of the current CU; obtaining the prediction residual value of the current point, where the current point is located in the first row of the current CU, and the predicted value of the current point is the reconstructed value of a reference point located above the current point; and obtaining the QP of the current point based on the bit depth of the current image, the QP of the current CU, the image complexity level of the current CU, and the prediction residual value of the current point. Embodiments of this application can improve the adaptability of QP to image content, achieve low-granularity quantization processing within CUs, reduce subjective distortion differences caused by quantization within CUs, and effectively improve the subjective quality of flat content within CUs.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application. The original application has the application number 202310283307.6 and the original application date is March 13, 2023. The entire contents of the original application are incorporated herein by reference. Technical Field

[0002] This application relates to video encoding and decoding technology, and more particularly to a method and apparatus for obtaining quantization parameters. Background Technology

[0003] Video and other media data are widely present in various devices, and data transmission between different devices typically utilizes display interfaces and display links. In recent years, with the improvement of media acquisition equipment performance and the increasing demand for video quality, the specifications of video data have also been rapidly improving, manifested in higher video resolution and frame rates. Higher-specification videos have a larger data volume per unit time, posing new challenges to the throughput of display interfaces and / or display links. When the bandwidth of some display interfaces and / or display links cannot meet the throughput requirements for transmitting raw video, display interface compression of video content becomes particularly important.

[0004] A typical display interface compression process includes: at the input interface, the encoder performs encoding operations such as prediction, quantization, and entropy coding on the input single-frame image, compressing it into a bitstream; the bitstream is transmitted to the output interface via the display link; at the output interface, the decoder performs decoding operations such as entropy decoding, dequantization, prediction, and reconstruction on the bitstream, finally outputting the reconstructed image. During the encoding process, the residual value generated by the prediction operation is quantized and written into the bitstream; during the decoding process, the syntax elements are dequantized to obtain the residual value. The quantization parameter (QP) is the parameter used in the aforementioned quantization / dequantization process. Generally, the larger the QP value, the more pronounced the quantization. Adjusting the QP value directly affects the length of the encoded bitstream and the quality of the decoded image.

[0005] Therefore, it is hoped that a technology can be developed to maximize the compatibility between QP and image content in order to improve encoding and decoding efficiency. Summary of the Invention

[0006] This application provides a method and apparatus for encoding and decoding a region enhancement layer to improve the encoding efficiency and accuracy of the enhancement layer.

[0007] In a first aspect, this application provides a method for obtaining quantization parameters, applicable to point-level prediction modes. The method includes: obtaining the bit depth of a current image; obtaining the quantization parameter QP of a current coding unit (CU), wherein the current CU belongs to the current image; obtaining the image complexity level of the current CU; obtaining the prediction residual value of a current point, wherein the current point is located in the first row of the current CU, and the prediction value of the current point is the reconstructed value of a reference point, wherein the reference point is located above the current point; and obtaining the QP of the current point based on the bit depth of the current image, the QP of the current CU, the image complexity level of the current CU, and the prediction residual value of the current point.

[0008] In this embodiment, under point-level prediction, the quantization parameters of points at specific locations are adjusted to achieve point-level QP calculation. This improves the fit between QP and image content, enables low-granularity quantization processing within the CU, reduces subjective distortion differences caused by quantization within the CU, and effectively improves the subjective quality of flat content within the CU.

[0009] An image frame consists of multiple pixels, and the bit depth of an image represents the number of bits occupied by each channel of a pixel in the image. On the encoding side, the bit depth of the current image is an inherent property of the image itself; the encoding side can directly obtain the original image, and therefore can directly obtain the bit depth from the original image. On the decoding side, the bit depth of the current image can be obtained by parsing the bitstream of the current image.

[0010] In this embodiment, the QP of the current CU can be obtained through a rate control module. On the decoding side, the input to the rate control module is the image complexity level of the current CU and the number of encoded bits of the previous CU (e.g., CU 1), and the output of the rate control module is the QP of the current CU. On the encoding side, the input to the rate control module is the image content of the current CU and the number of encoded bits of the previous CU (e.g., CU 1), and the output of the rate control module is the QP of the current CU.

[0011] On the decoding side, the image complexity level of the current CU can be obtained by parsing the bitstream. On the encoding side, the image complexity level of the current CU can be obtained based on its image content, including:

[0012] 1. Calculate the texture image complexity level. Divide the current CU into several sub-blocks. For each sub-block, calculate the difference between adjacent pixel values ​​step by step in horizontal, vertical, and diagonal directions. Sum the absolute values ​​of the differences to obtain the complexity value corresponding to the sub-block. Compare the complexity value with a predefined threshold to obtain the image complexity level of the sub-block. Perform rule-based operations on the image complexity levels of each sub-block to obtain the texture image complexity level of the current CU.

[0013] 2. Calculate the IBC image complexity level. The current CU obtains the IBC similarity prediction sample matrix from the similar IBC prediction pattern. The current CU is divided into several sub-blocks. For each sub-block, the sum of the absolute values ​​of the differences between its IBC similarity prediction samples and the original values ​​is calculated. This is called the sub-block SAD. The sub-block SAD is compared with a pre-defined threshold to obtain the image complexity level of the sub-block. After performing rule-based operations on the image complexity levels of each sub-block, the IBC image complexity level of the current CU is obtained.

[0014] 3. The current image complexity level of CU is the minimum of the texture image complexity level and the IBC image complexity level.

[0015] After obtaining the image complexity level of the current CU on the encoding side, it can use it as a syntax element for entropy encoding, and then concatenate it into the bitstream of the current image so that the decoding end can parse the bitstream to directly obtain the image complexity level of the current CU.

[0016] The embodiments of this application can adjust the quantization parameters of a point at a specific position within the current CU under point-level prediction. This specific position can be the first row within the current CU (e.g., the horizontal position is 0) and the point-level prediction uses the T prediction method (the T prediction method uses the reconstructed value of the point above the current point (i.e., the aforementioned reference point) as the predicted value of the current point).

[0017] Points at a specific location fall into two categories: those at the beginning of the first row of the current control unit (CU), and those not at the beginning of the first row. Based on this, the prediction residual value for the current point can be obtained using the following two methods:

[0018] One approach is to have the current point at the beginning of the first row of the current CU, obtain the reconstruction values ​​of the reference point and the first point, with the first point located to the right of the reference point; and then obtain the prediction residual value of the current point based on the reconstruction values ​​of the reference point and the first point.

[0019] For example, the prediction residual value of the current point can be calculated according to the following formula (6):

[0020] PredResiTmp=Abs(I[x][y-1]-I[x+1][y-1]) (6)

[0021] Where PredResiTmp represents the prediction residual value of the current point, I represents the reconstructed sample matrix of the current image, x represents the element in the x-th column of the reconstructed sample matrix, and y represents the element in the y-th row of the reconstructed sample matrix.

[0022] Another method is to obtain the reconstruction values ​​of the reference point, the first point, and the second point, where the current point is not the first or second in the first row of the current CU. The first point is located to the right of the reference point, and the second point is located to the left of the reference point. The prediction residual value of the current point is obtained based on the reconstruction values ​​of the reference point, the first point, and the second point.

[0023] For example, the prediction residual value of the current point can be calculated according to the following formula (7):

[0024] PredResiTmp=(Abs(I[x][y-1]-I[x-1][y-1]))+(Abs(I[x][y-1]-I[x+1][y-1])) (7)

[0025] Where PredResiTmp represents the prediction residual value of the current point, I represents the reconstructed sample matrix of the current image, x represents the element in the x-th column of the reconstructed sample matrix, and y represents the element in the y-th row of the reconstructed sample matrix.

[0026] For example, select two points from the first row of the current CU using the T prediction method. One point T1 is located at the beginning of the first row of the current CU, and the other point T2 is located at a non-beginning position in the first row of the current CU. Assume that the positions of these two points are both represented as (x, y).

[0027] For point T1:

[0028] To calculate its predicted residual value, two points are needed: one above it and one to the right of it. The positions of these two points are represented as (x, y-1) and (x+1, y-1), respectively.

[0029] According to the encoding and decoding order from left to right and from top to bottom, the above two points have obtained the reconstructed values ​​before the current point (T1). Therefore, the aforementioned reconstructed values ​​can be obtained from the corresponding positions in the reconstructed sample matrix I of the current image, namely I[x][y-1] and I[x+1][y-1].

[0030] Based on this, the predicted residual value of the current point can be obtained by using the above formula (6).

[0031] For point T2:

[0032] To calculate its predicted residual value, three points are needed: the one above it and the one to the left and right of the one above it. The positions of these three points are represented as (x-1, y-1), (x, y-1), and (x+1, y-1), respectively.

[0033] According to the encoding and decoding order from left to right and from top to bottom, the above three points have obtained the reconstructed values ​​before the current point (T1). Therefore, the aforementioned reconstructed values ​​can be obtained from the corresponding positions in the reconstructed sample matrix I of the current image, namely I[x-1][y-1], I[x][y-1] and I[x+1][y-1].

[0034] Based on this, the predicted residual value of the current point can be obtained by using the above formula (7).

[0035] Through the above process, the embodiments of this application can achieve point-level prediction and obtain the prediction residual value of the point. This enables low-granularity prediction processing within the CU, making the prediction process more accurate and consistent with the image content of the CU.

[0036] In this embodiment, the lower limit of the QP of the current point is first obtained based on the bit depth of the current image, the image complexity level of the current CU, and the prediction residual value of the current point; then the QP of the current point is obtained based on the image complexity level of the current CU, the QP of the current CU, and the lower limit of the adjustment.

[0037] The adjustment lower bound of QP at the current point can be obtained using the following method:

[0038] When the first condition is met, the lower limit of adjustment of QP at the current point is calculated according to the following formula (1):

[0039] JndQp=X2+Clip(0,X3,(BitDepth-X4)>>X5) (1)

[0040] The first condition includes: k≤X1, and PredResiTmp≤ResiThres0;

[0041] When the first condition is not met, the lower limit of adjustment of QP at the current point is calculated according to the following formula (2):

[0042] JndQp=Clip(0,X3,(BitDepth-X4)>>X5)+X6 (2)

[0043] Where JndQp represents the lower limit of QP adjustment at the current point, BitDepth represents the bit depth of the current image, k represents the image complexity level of the current CU, PredResiTmp represents the prediction residual value at the current point, X1, X2, X3, X4, X5, and X6 are pre-set parameters, and ResiThres0 represents the 0th gradient threshold of QP adjustment.

[0044] The QP of the current point can be obtained using the following method:

[0045] When the second condition is met, the QP of the current point is calculated according to the following formula (3):

[0046] PixelQp=Max(Qp-X7,JndQp) (3)

[0047] The second condition includes: Qp > JndQp, and PredResiTmp ≤ ResiThres0, and k ≥ ComplexTh;

[0048] When the second condition is not met, but the third condition is met, the QP of the current point is calculated according to the following formula (4):

[0049] PixelQp=Max(Qp-X8,JndQp) (4)

[0050] The third condition includes: Qp > JndQp, and PredResiTmp ≤ ResiThres1;

[0051] When neither the second nor the third condition is met, the QP of the current point is calculated according to the following formula (5):

[0052] PixelQp = Qp (5)

[0053] Where PixelQp represents the QP of the current point, k represents the image complexity level of the current CU, PredResiTmp represents the prediction residual value of the current point, Qp represents the QP of the current CU, JndQp represents the adjustment lower limit, X7 and X8 are preset parameters, ResiThres0 represents the 0th gradient threshold of QP adjustment, ResiThres1 represents the 1st gradient threshold of QP adjustment, ComplexTh represents the complexity threshold of QP adjustment, and is optional, ComplexTh = 2.

[0054] Through the above process, the embodiments of this application can realize point-level QP adjustment, obtain the adjusted QP of points at specific locations, and realize point-level QP calculation. This can improve the adaptability of QP to image content, realize low-granularity quantization processing within CU, reduce the subjective distortion differences caused by quantization within CU, and effectively improve the subjective quality of flat content within CU.

[0055] Secondly, this application provides a quantization parameter acquisition device, which is applicable to point-level prediction mode. The device includes: an acquisition module for acquiring the bit depth of the current image; acquiring the quantization parameter QP of the current coding unit (CU), wherein the current CU belongs to the current image; and acquiring the image complexity level of the current CU; a point prediction module for acquiring the prediction residual value of the current point, wherein the current point is located in the first row of the current CU, and the prediction value of the current point is the reconstructed value of a reference point, wherein the reference point is located above the current point; and a rate control module for acquiring the QP of the current point based on the bit depth of the current image, the QP of the current CU, the image complexity level of the current CU, and the prediction residual value of the current point.

[0056] In one possible implementation, the rate control module is specifically configured to obtain the lower limit of the QP adjustment for the current point based on the bit depth of the current image, the image complexity level of the current CU, and the prediction residual value of the current point; and to obtain the QP of the current point based on the image complexity level of the current CU, the QP of the current CU, and the lower limit of the adjustment.

[0057] In one possible implementation, the rate control module is specifically used to calculate the lower limit of the QP at the current point according to the following formula (1) when the first condition is met:

[0058] JndQp=X2+Clip(0,X3,(BitDepth-X4)>>X5) (1)

[0059] The first condition includes: k≤X1, and PredResiTmp≤ResiThres0;

[0060] When the first condition is not met, the lower limit of the adjustment of QP at the current point is calculated according to the following formula (2):

[0061] JbdQp=Clip(0,X3,(BitDepth-X4)>>X5)+X6 (2)

[0062] Where JndQp represents the lower limit of QP adjustment at the current point, BitDepth represents the bit depth of the current image, k represents the image complexity level of the current CU, PredResiTmp represents the prediction residual value at the current point, X1, X2, X3, X4, X5, and X6 are preset parameters, and ResiThres0 represents the 0th gradient threshold of QP adjustment.

[0063] In one possible implementation, the rate control module is specifically used to calculate the QP of the current point according to the following formula (3) when the second condition is met:

[0064] PixelQp=Max(Qp-X7,JndQp) (3)

[0065] The second condition includes: Qp > JndQp, and PredResiTmp ≤ ResiThres0, and k ≥ ComplexTh;

[0066] When the second condition is not met, but the third condition is met, the QP of the current point is calculated according to the following formula (4):

[0067] PixelQp=Max(Qp-X8,JndQp) (4)

[0068] The third condition includes: Qp > JndQp, and PredResiTmp ≤ ResiThres1;

[0069] When neither the second condition nor the third condition is met, the QP of the current point is calculated according to the following formula (5):

[0070] PixeQp=Qp (5)

[0071] Wherein, PixelQp represents the QP of the current point, k represents the image complexity level of the current CU, PredResiTmp represents the prediction residual value of the current point, Qp represents the QP of the current CU, JndQp represents the adjustment lower limit, X7 and X8 are preset parameters, ResiThres0 represents the 0th gradient threshold of QP adjustment, ResiThres1 represents the 1st gradient threshold of QP adjustment, and ComplexTh represents the complexity threshold of QP adjustment.

[0072] In one possible implementation, the point prediction module is specifically used to obtain the reconstruction value of the reference point and the reconstruction value of the first point when the current point is located at the beginning of the first row of the current CU, wherein the first point is located to the right of the reference point; and to obtain the prediction residual value of the current point based on the reconstruction value of the reference point and the reconstruction value of the first point.

[0073] In one possible implementation, the point prediction module is specifically used to obtain the reconstruction value of the reference point, the reconstruction value of the first point, and the reconstruction value of the second point when the current point is not the first position in the first row of the current CU, wherein the first point is located to the right of the reference point and the second point is located to the left of the reference point; and to obtain the prediction residual value of the current point based on the reconstruction value of the reference point, the reconstruction value of the first point, and the reconstruction value of the second point.

[0074] In one possible implementation, the point prediction module is specifically used to calculate the prediction residual value of the current point according to the following formula (6):

[0075] PredResiTmp=Abs(I[x][y-1]-I[x+1][y-1]) (6)

[0076] Where PredResiTmp represents the prediction residual value of the current point, I represents the reconstructed sample matrix of the current image, x represents the element in the x-th column of the reconstructed sample matrix, and y represents the element in the y-th row of the reconstructed sample matrix.

[0077] In one possible implementation, the point prediction module is specifically used to calculate the prediction residual value of the current point according to the following formula (7):

[0078] PredResiTmp=(Abs(I[x][y-1]-I[x-1][y-1]))+(Abs(I[x][y-1]-I[x+1][y-1])) (7)

[0079] Where PredResiTmp represents the prediction residual value of the current point, I represents the reconstructed sample matrix of the current image, x represents the element in the x-th column of the reconstructed sample matrix, and y represents the element in the y-th row of the reconstructed sample matrix.

[0080] Thirdly, this application provides a decoder, comprising: one or more processors; a memory for storing one or more programs; and, when the one or more programs are executed by the one or more processors, causing the one or more processors to implement the method as described in any one of the first aspects above.

[0081] Fourthly, this application provides an encoder comprising: one or more processors; a memory for storing one or more programs; and, when the one or more programs are executed by the one or more processors, causing the one or more processors to implement the method as described in any one of the first aspects above.

[0082] Fifthly, this application provides a computer-readable storage medium, characterized in that it includes a computer program, which, when executed on a computer, causes the computer to perform the method described in any one of the first aspects above.

[0083] In a sixth aspect, this application provides a computer program product comprising instructions, characterized in that, when the instructions are executed on a computer or processor, the computer or processor causes the computer or processor to implement the method described in any one of the first aspects above.

[0084] In a seventh aspect, this application provides a bitstream that can be stored in a computer-readable storage medium or transmitted in the form of a signal such as an electromagnetic wave. The bitstream includes encoded image data and syntax elements. The syntax elements include quantization parameters of the current point when using point-level prediction. The current point is located in the first row of the current CU, and the predicted value of the current point is the reconstructed value of a reference point located above the current point. Attached Figure Description

[0085] Figure 1 This is a schematic diagram of the decoding architecture;

[0086] Figure 2 This is a schematic diagram of the coding architecture;

[0087] Figure 3 This is a schematic diagram of point-level prediction;

[0088] Figure 4 This is a flowchart of process 400 of the quantization parameter acquisition method according to an embodiment of this application;

[0089] Figure 5 A schematic diagram showing the points selected for calculating the predicted residual values;

[0090] Figure 6 A flowchart for obtaining quantization parameters at the decoding end;

[0091] Figure 7 A flowchart for obtaining quantization parameters at the encoding end;

[0092] Figure 8 This is an exemplary structural diagram of a quantization parameter acquisition device 800 according to an embodiment of this application. Detailed Implementation

[0093] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0094] The terms "first," "second," etc., used in the specification, embodiments, claims, and drawings of this application are for distinguishing purposes only and should not be construed as indicating or implying relative importance or order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, such as including a series of steps or units. A method, system, product, or apparatus is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products, or apparatuses.

[0095] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0096] To facilitate understanding, the relevant terms are explained below:

[0097] Interface compression: Electronic devices use display interfaces to transmit video. The operation of compressing (encoding) and decompressing (decoding) video data passing through the display interface is called interface compression.

[0098] Bitstream: A binary stream generated after encoding video data.

[0099] Rate control: The process of adjusting the output bit rate during encoding. Based on the analysis of information such as the current image content and bit stream buffer space, the output bit rate is adjusted by changing the quantization parameters and encoding mode.

[0100] Quantization Parameter (QP): During encoding, the residual values ​​generated by the prediction operation or the coefficients generated by the transform operation are quantized and written into the bitstream; during decoding, the syntax elements are dequantized to obtain the residual values ​​or coefficients. QP is the parameter used in the aforementioned quantization / dequantization process. Generally, the larger the QP value, the more pronounced the quantization. Adjusting the QP value directly affects the length of the encoded bitstream and the quality of the decoded image.

[0101] Constant Bit Rate (CBR) strategy: a code control strategy characterized by the consistent length of the bit stream output by the encoder per unit time.

[0102] Block-level prediction: The block is the prediction unit. The reconstructed value of a point within the current code unit (CU) cannot be used as the prediction reference value for subsequent points within the current CU.

[0103] Point-level prediction: using points as prediction units. The reconstructed values ​​of already reconstructed points within the current coding unit can be used as prediction reference values ​​for subsequent points within the current CU.

[0104] This application's embodiments relate to the acquisition of QP, and the relevant technologies are explained below:

[0105] Figure 1 A schematic diagram of the decoding architecture, such as Figure 1 As shown, after the bitstream of any coding unit (CU 1 or CU 2 in the figure) is input into the decoder, it goes through the decoding process, such as entropy decoding, dequantization, prediction, etc., and finally outputs the reconstructed image of the CU.

[0106] In this decoding framework, when processing the current CU (e.g., CU 2), the input to the rate control module is the image complexity level of the current CU and the number of encoded bits of the previous CU (e.g., CU 1), and the output of the rate control module is the quantization parameters of the current CU. The image complexity level of the current CU can be obtained by decoding the corresponding bitstream entropy, and the number of encoded bits of the previous CU can be obtained by decoding the corresponding bitstream entropy.

[0107] The current CU obtains predicted samples (also called predicted values / predicted blocks) through the prediction module. Then, it uses the predicted samples and the residual samples obtained through inverse quantization (also called residual values / residual blocks) to calculate reconstructed samples (also called reconstructed values / reconstructed blocks), and finally outputs the reconstructed image. The prediction mode of the prediction module can include point-level prediction and block-level prediction, etc. The prediction mode of this embodiment is point-level prediction.

[0108] Figure 2 A schematic diagram of the coding architecture, such as Figure 2 As shown, the current image is divided into image blocks (coding units). Any coding unit (CU 1 or CU 2 in the diagram) is input into the encoder and undergoes an encoding process, such as prediction, quantization, and entropy coding, to output the bitstream of that CU. The bitstreams of all the CUs are concatenated to obtain the bitstream of the current image.

[0109] In this coding framework, when processing the current CU (e.g., CU 2), the input to the rate control module is the image content of the current CU and the number of encoded bits of the previous CU (e.g., CU 1), and the output of the rate control module is the quantization parameters of the current CU. The image complexity level of the current CU can be obtained based on its image content, and the number of encoded bits of the previous CU can be obtained through entropy coding.

[0110] The image complexity level of the current CU can be obtained based on its image content, using the following method:

[0111] 1. Calculate the texture image complexity level. Divide the current CU into several sub-blocks. For each sub-block, calculate the difference between adjacent pixel values ​​step by step in horizontal, vertical, and diagonal directions. Sum the absolute values ​​of the differences to obtain the complexity value corresponding to the sub-block. Compare the complexity value with a predefined threshold to obtain the image complexity level of the sub-block. Perform rule-based operations on the image complexity levels of each sub-block to obtain the texture image complexity level of the current CU.

[0112] 2. Calculate the image complexity level of the Intra Block Copy (IBC) prediction mode. The current CU obtains an IBC similarity prediction sample matrix from similar IBC prediction modes. The current CU is divided into several sub-blocks. For each sub-block, the sum of the absolute values ​​of the differences between its IBC similarity prediction samples and the original values ​​is calculated. This is called the Sum of Absolute Difference (SAD) of the sub-block. The SAD of the sub-block is compared with a predefined threshold to obtain the image complexity level of the sub-block. After performing rule-based operations on the image complexity levels of each sub-block, the IBC image complexity level of the current CU is obtained.

[0113] 3. The current image complexity level of CU is the minimum of the texture image complexity level and the IBC image complexity level.

[0114] The current CU obtains predicted samples through the prediction module, then quantizes and entropy-encodes the difference between the predicted samples and the original samples (i.e., the residual samples), and finally outputs a bitstream. The prediction mode of the prediction module can include point-level prediction and block-level prediction, etc. The prediction mode in this embodiment is point-level prediction.

[0115] Figure 3 This is a schematic diagram of point-level prediction, such as... Figure 3 As shown, point-level prediction includes three prediction methods: T-prediction, RL-prediction, and L-prediction. Among them,

[0116] The T-prediction method uses the reconstructed value of the point above the current point as the predicted value of the current point.

[0117] The L-prediction method uses the reconstructed value of the point to the left of the current point as the predicted value of the current point.

[0118] The RL prediction method averages the reconstructed values ​​of the points to the left and right of the current point to obtain the predicted value of the current point. The CU in the diagram has a size of 16×2. From left to right, the horizontal position of the first column of points is marked as 0, and from top to bottom, the vertical position of the first row of points is marked as 0. Based on this, in the horizontal direction, even-numbered columns of points in this CU use the T prediction method, the last column uses the L prediction method, and points at other positions use the RL prediction method.

[0119] It should be noted that, Figure 3 As an example, only one CU size and its point-level prediction method are shown, but this is not necessarily a limitation, and the embodiments of this application do not impose any specific limitations on this.

[0120] To improve the compatibility of quantization parameters (QP) with image content and enhance encoding / decoding efficiency, this application provides a method and apparatus for obtaining quantization parameters. The technical solutions of this application embodiment will be described below.

[0121] Figure 4 This is a flowchart of process 400 of the quantization parameter acquisition method according to an embodiment of this application. Process 400 can be generated by... Figure 1 The decoder or in the illustrated embodiment Figure 2 The encoder in the illustrated embodiment is executed. Process 400 is described as a series of steps or operations, and it should be understood that process 400 can be executed in various orders and / or occur simultaneously, and is not limited to... Figure 4 The execution order is shown. Process 400 may include:

[0122] Step 401: Obtain the bit depth of the current image.

[0123] An image frame consists of multiple pixels, and the bit depth of an image represents the number of bits occupied by each channel of a pixel in the image.

[0124] On the encoding side, the bit depth of the current image is an attribute of the image itself. The encoding side can directly obtain the original image, so the bit depth can be directly obtained from the original image.

[0125] On the decoding side, the bit depth of the current image can be obtained by parsing the bitstream of the current image.

[0126] Step 402: Obtain the QP of the current CU. The current CU belongs to the current image.

[0127] In this embodiment of the application, a bitrate control module (e.g.) can be used. Figure 1 and Figure 2 As shown, the QP of the current CU is obtained.

[0128] On the decoding side, the input to the rate control module is the image complexity level of the current CU and the number of encoded bits of the previous CU (e.g., CU1), and the output of the rate control module is the QP of the current CU.

[0129] On the encoding side, the input to the rate control module is the image content of the current CU and the number of encoded bits of the previous CU (e.g., CU 1), and the output of the rate control module is the QP of the current CU.

[0130] Step 403: Obtain the current image complexity level of the CU.

[0131] On the decoding side, the image complexity level of the current CU can be obtained by parsing the bitstream.

[0132] On the encoding side, the image complexity level of the current CU can be obtained based on the image content of the current CU, including:

[0133] 1. Calculate the texture image complexity level. Divide the current CU into several sub-blocks. For each sub-block, calculate the difference between adjacent pixel values ​​step by step in horizontal, vertical, and diagonal directions. Sum the absolute values ​​of the differences to obtain the complexity value corresponding to the sub-block. Compare the complexity value with a predefined threshold to obtain the image complexity level of the sub-block. Perform rule-based operations on the image complexity levels of each sub-block to obtain the texture image complexity level of the current CU.

[0134] 2. Calculate the IBC image complexity level. The current CU obtains the IBC similarity prediction sample matrix from the similar IBC prediction pattern. The current CU is divided into several sub-blocks. For each sub-block, the sum of the absolute values ​​of the differences between its IBC similarity prediction samples and the original values ​​is calculated. This is called the sub-block SAD. The sub-block SAD is compared with a pre-defined threshold to obtain the image complexity level of the sub-block. After performing rule-based operations on the image complexity levels of each sub-block, the IBC image complexity level of the current CU is obtained.

[0135] 3. The current image complexity level of CU is the minimum of the texture image complexity level and the IBC image complexity level.

[0136] After obtaining the image complexity level of the current CU on the encoding side, it can use it as a syntax element for entropy encoding, and then concatenate it into the bitstream of the current image so that the decoding end can parse the bitstream to directly obtain the image complexity level of the current CU.

[0137] Step 404: Obtain the prediction residual value of the current point. The current point is located in the first row of the current CU, and the prediction value of the current point is the reconstruction value of the reference point, which is located above the current point.

[0138] This application embodiment can adjust the quantization parameters of a point at a specific location within the current CU under point-level prediction. This specific location can be the first row within the current CU (e.g., a horizontal position of 0) and the point-level prediction uses the T-prediction method (the T-prediction method uses the reconstructed value of the point above the current point (i.e., the aforementioned reference point) as the predicted value for the current point). For example, referencing... Figure 3 The point in row 0 and even-numbered column is the point at the aforementioned specific position, which can be used as the current point to adjust QP.

[0139] Or refer to Figure 3 Points at specific locations fall into two categories: those at position (0,0), which are at the beginning of the first row of the current control unit (CU), and those at positions other than (0,0), which are not at the beginning of the first row of the current CU. Based on this, the prediction residual value for the current point can be obtained using the following two methods:

[0140] One approach is to have the current point at the beginning of the first row of the current CU, obtain the reconstruction values ​​of the reference point and the first point, with the first point located to the right of the reference point; and then obtain the prediction residual value of the current point based on the reconstruction values ​​of the reference point and the first point.

[0141] For example, the prediction residual value of the current point can be calculated according to the following formula (6):

[0142] PredResiTmp=Abs(I[x][y-1]-I[x+1][y-1]) (6)

[0143] Where PredResiTmp represents the prediction residual value of the current point, I represents the reconstructed sample matrix of the current image, x represents the element in the x-th column of the reconstructed sample matrix, and y represents the element in the y-th row of the reconstructed sample matrix.

[0144] Another method is to obtain the reconstruction values ​​of the reference point, the first point, and the second point, where the current point is not the first or second in the first row of the current CU. The first point is located to the right of the reference point, and the second point is located to the left of the reference point. The prediction residual value of the current point is obtained based on the reconstruction values ​​of the reference point, the first point, and the second point.

[0145] For example, the prediction residual value of the current point can be calculated according to the following formula (7):

[0146] PredResiTmp=(Abs(I[x][y-1]-I[x-1][y-1]))+(Abs(I[x][y-1]-I[x+1][y-1])) (7)

[0147] Where PredResiTmp represents the prediction residual value of the current point, I represents the reconstructed sample matrix of the current image, x represents the element in the x-th column of the reconstructed sample matrix, and y represents the element in the y-th row of the reconstructed sample matrix.

[0148] For example, Figure 5 A schematic diagram showing the points selected for calculating the predicted residual values, as shown below. Figure 5 As shown, the current CU has a size of 16×2, including row y (the first row of the current CU) and row y+1 (the second row of the current CU). Row y-1 is the second row of the CU located above the current CU. Two points are selected from the first row of the current CU using the T prediction method. One point T1 is located at the beginning of the first row of the current CU, and the other point T2 is located at a non-beginning position in the first row of the current CU. Assume that the positions of these two points are both represented as (x, y).

[0149] For point T1:

[0150] To calculate its predicted residual value, two points are needed: one above it and one to the right of it. The positions of these two points are represented as (x, y-1) and (x+1, y-1), respectively.

[0151] According to the encoding and decoding order from left to right and from top to bottom, the above two points have obtained the reconstructed values ​​before the current point (T1). Therefore, the aforementioned reconstructed values ​​can be obtained from the corresponding positions in the reconstructed sample matrix I of the current image, namely I[x][y-1] and I[x+1][y-1].

[0152] Based on this, the predicted residual value of the current point can be obtained by using the above formula (6).

[0153] For point T2:

[0154] To calculate its predicted residual value, three points are needed: the one above it and the one to the left and right of the one above it. The positions of these three points are represented as (x-1, y-1), (x, y-1), and (x+1, y-1), respectively.

[0155] According to the encoding and decoding order from left to right and from top to bottom, the above three points have obtained the reconstructed values ​​before the current point (T1). Therefore, the aforementioned reconstructed values ​​can be obtained from the corresponding positions in the reconstructed sample matrix I of the current image, namely I[x-1][y-1], I[x][y-1] and I[x+1][y-1].

[0156] Based on this, the predicted residual value of the current point can be obtained by using the above formula (7).

[0157] Through the above process, the embodiments of this application can achieve point-level prediction and obtain the prediction residual value of the point. This enables low-granularity prediction processing within the CU, making the prediction process more accurate and consistent with the image content of the CU.

[0158] Step 405: Obtain the QP of the current point based on the bit depth of the current image, the QP of the current CU, the image complexity level of the current CU, and the prediction residual value of the current point.

[0159] In this embodiment, the lower limit of the QP of the current point is first obtained based on the bit depth of the current image, the image complexity level of the current CU, and the prediction residual value of the current point; then the QP of the current point is obtained based on the image complexity level of the current CU, the QP of the current CU, and the lower limit of the adjustment.

[0160] The adjustment lower bound of QP at the current point can be obtained using the following method:

[0161] When the first condition is met, the lower limit of adjustment of QP at the current point is calculated according to the following formula (1):

[0162] JndQp=X2+Clip(0,X3,(BitDepth-X4)>>X5) (1)

[0163] The first condition includes: k≤X1, and PredResiTmp≤ResiThres0;

[0164] When the first condition is not met, the lower limit of adjustment of QP at the current point is calculated according to the following formula (2):

[0165] JndQp=Clip(0,X3,(BitDepth-X4)>>X5)+X6 (2)

[0166] Where JndQp represents the lower limit of QP adjustment at the current point, BitDepth represents the bit depth of the current image, k represents the image complexity level of the current CU, PredResiTmp represents the prediction residual value at the current point, X1, X2, X3, X4, X5, and X6 are pre-set parameters, and ResiThres0 represents the 0th gradient threshold of QP adjustment.

[0167] The QP of the current point can be obtained using the following method:

[0168] When the second condition is met, the QP of the current point is calculated according to the following formula (3):

[0169] PixelQp=Max(Qp-X7,JndQp) (3)

[0170] The second condition includes: Qp > JndQp, and PredResiTmp ≤ ResiThres0, and k ≥ ComplexTh;

[0171] When the second condition is not met, but the third condition is met, the QP of the current point is calculated according to the following formula (4):

[0172] PixeQp=Max(Qp-X8,JndQp) (4)

[0173] The third condition includes: Qp > JndQp, and PredResiTmp ≤ ResiThres1;

[0174] When neither the second nor the third condition is met, the QP of the current point is calculated according to the following formula (5):

[0175] PixelQp = Qp (5)

[0176] Where PixelQp represents the QP of the current point, k represents the image complexity level of the current CU, PredResiTmp represents the prediction residual value of the current point, Qp represents the QP of the current CU, JndQp represents the adjustment lower limit, X7 and X8 are preset parameters, ResiThres0 represents the 0th gradient threshold of QP adjustment, ResiThres1 represents the 1st gradient threshold of QP adjustment, ComplexTh represents the complexity threshold of QP adjustment, and is optional, ComplexTh = 2.

[0177] Through the above process, the embodiments of this application can realize point-level QP adjustment, obtain the adjusted QP of points at specific locations, and realize point-level QP calculation. This can improve the adaptability of QP to image content, realize low-granularity quantization processing within CU, reduce the subjective distortion differences caused by quantization within CU, and effectively improve the subjective quality of flat content within CU.

[0178] In this embodiment, under point-level prediction, the quantization parameters of points at specific locations are adjusted to achieve point-level QP calculation. This improves the fit between QP and image content, enables low-granularity quantization processing within the CU, reduces subjective distortion differences caused by quantization within the CU, and effectively improves the subjective quality of flat content within the CU.

[0179] The technical solutions of the embodiments of this application are described below through specific examples.

[0180] Figure 6 A flowchart for obtaining quantization parameters at the decoding end, such as... Figure 6 As shown, at the decoding end, point-level prediction adjusts the quantization parameters of a point at a specific location within the current CU (corresponding to the current point mentioned above). The specific location refers to the position located in the first row of the current CU using the T-prediction method.

[0181] The bitstream of the current CU is input to the decoder, and after entropy decoding, dequantization, point-level prediction, etc., the reconstructed block corresponding to the current CU is finally output.

[0182] When calculating the quantization parameters of a point at a specific location, the inputs are the quantization parameters of the current CU (i.e., the quantization parameters output by the rate control module), the prediction residual value of the point at the specific location within the current CU, and the bit depth of the current image. The output is the quantization parameters of the point at the specific location within the current CU. In point-level prediction, the point at the specific location is inverse-quantized using the adjusted quantization parameters. The calculation process for the quantization parameters of a point at a specific location in point-level prediction is as follows:

[0183] a) Calculate the prediction residual value PredResiTmp for a specific point within the current CU. The horizontal index of the point at a specific location within the current CU is x, and the vertical index is y. Let I represent the reconstructed sample matrix of the current CU. The prediction residual value PredResiTmp for a specific point within the current CU can be calculated from the difference between the reconstructed values ​​of the point above it and the points to its left or right.

[0184] Reference Figure 5 If a point is located in the first row of the current CU and is the first point to use the T-prediction method, PredResiTmp is equal to the difference between the reconstructed values ​​of the point above it and its right neighbor, calculated as: PredResiTmp = Abs(I[x][y–1]–I[x+1][y–1])); otherwise, if a point is located in the first row of the current CU and is not the first point to use the T-prediction method, PredResiTmp is equal to the average of the differences between the reconstructed values ​​of the point above it and its left and right neighbors, calculated as:

[0185] PredResiTmp=(Abs(I[x][y–1]–I[x-1][y–1])+Abs(I[x][y–1]–I[x+1][y–1])+1)>>1.

[0186] b) Calculate the quantization parameter PixelQp for a specific location within the current CU. The process is as follows:

[0187] 1) Calculate the lower limit JndQp of the quantization parameter PixelQp at a specific location.

[0188] The lower bound JndQp for adjusting the quantization parameters at a specific location is calculated based on the current image complexity level k, bit depth BitDepth, and the prediction residual value of the point at that specific location. If the current image complexity level k of the CU is less than or equal to X1, and the prediction residual value PredResiTmp of the point at that specific location is less than or equal to ResiThres0, then JndQp = X2 + Clip(0, X3, (BitDepth - X4) >> X5); otherwise, JndQp = Clip(0, X3, (BitDepth - X4) >> X5) + X6. Here, X1, X2, X3, X4, X5, and X6 are predefined threshold parameters, and ResiThres0 represents the 0th gradient threshold for adjusting the quantization parameters.

[0189] 2) Calculate the quantization parameter PixelQp of a point at a specific location within the current CU.

[0190] PixelQp is calculated based on the current CU's image complexity level k, the current CU's quantization parameter Qp, and the quantization parameter adjustment lower limit JndQp. If the current CU's quantization parameter Qp is greater than JndQp, and the prediction residual value PredResiTmp at a specific location is less than or equal to ResiThres0, and the current CU's image complexity level k is greater than or equal to ComplexTh, then PixelQp = Max(Qp – X7, JndQp); otherwise, if the current CU's quantization parameter Qp is greater than JndQp, and the prediction residual value PredResiTmp at a specific location is less than or equal to ResiThres1, then PixelQp = Max(Qp – X8, JndQp); otherwise, PixelQp equals Qp. Here, ResiThres0 represents the 0th gradient threshold for quantization parameter adjustment, ResiThres1 represents the 1st gradient threshold for quantization parameter adjustment, and ComplexTh represents the complexity threshold for quantization parameter adjustment.

[0191] Figure 7 A flowchart for obtaining quantization parameters at the encoding end, such as... Figure 7 As shown, at the encoding end, point-level prediction adjusts the quantization parameters of a point at a specific location within the current CU (corresponding to the current point mentioned above). The specific location refers to the position located in the first row of the current CU using the T-prediction method.

[0192] After the current CU is input to the encoder, it undergoes point-level prediction, quantization, entropy coding, etc., and finally outputs the bit stream of the CU.

[0193] In point-level prediction, points at specific locations are quantized using adjusted quantization parameters. The calculation process for the quantization parameters of points at specific locations can be found in [reference needed]. Figure 6 The calculation process in the illustrated embodiment will not be repeated here.

[0194] Figure 8 This is an exemplary structural diagram of the quantization parameter acquisition device 800 according to an embodiment of this application, as shown below. Figure 8 As shown, the quantization parameter acquisition device 800 of this embodiment can be applied to... Figure 1 The decoder or in the illustrated embodiment Figure 2 The encoder in the illustrated embodiment. The quantization parameter acquisition device 800 may include: an acquisition module 801, a point prediction module 802, and a bit rate control module 803.

[0195] In point-level prediction mode, the acquisition module 801 is used to acquire the bit depth of the current image; acquire the quantization parameter QP of the current coding unit (CU), wherein the current CU belongs to the current image; and acquire the image complexity level of the current CU. The point prediction module 802 is used to acquire the prediction residual value of the current point, wherein the current point is located in the first row of the current CU, and the prediction value of the current point is the reconstructed value of the reference point, wherein the reference point is located above the current point. The rate control module 803 is used to acquire the QP of the current point based on the bit depth of the current image, the QP of the current CU, the image complexity level of the current CU, and the prediction residual value of the current point.

[0196] In one possible implementation, the rate control module 803 is specifically used to obtain the adjustment lower limit of the QP of the current point based on the bit depth of the current image, the image complexity level of the current CU, and the prediction residual value of the current point; and to obtain the QP of the current point based on the image complexity level of the current CU, the QP of the current CU, and the adjustment lower limit.

[0197] In one possible implementation, the rate control module 803 is specifically used to calculate the lower limit of the QP adjustment at the current point according to the following formula (1) when the first condition is met:

[0198] JndQp=X2+Clip(0,X3,(BitDepth-X4)>>X5) (1)

[0199] The first condition includes: k≤X1, and PredResiTmp≤ResiThres0;

[0200] When the first condition is not met, the lower limit of the adjustment of QP at the current point is calculated according to the following formula (2):

[0201] JndQp=Clip(0,X3,(BitDepth-X4)>>X5)+X6 (2)

[0202] Where JndQp represents the lower limit of QP adjustment at the current point, BitDepth represents the bit depth of the current image, k represents the image complexity level of the current CU, PredResiTmp represents the prediction residual value at the current point, X1, X2, X3, X4, X5, and X6 are preset parameters, and ResiThres0 represents the 0th gradient threshold of QP adjustment.

[0203] In one possible implementation, the rate control module 803 is specifically used to calculate the QP of the current point according to the following formula (3) when the second condition is met:

[0204] PixelQp=Max(Qp-X7,JndQp) (3)

[0205] The second condition includes: Qp > JndQp, and PredResiTmp ≤ ResiThres0, and k ≥ ComplexTh;

[0206] When the second condition is not met, but the third condition is met, the QP of the current point is calculated according to the following formula (4):

[0207] PixelQp=Max(Qp-X8,JndQp) (4)

[0208] The third condition includes: Qp > JndQp, and PredResiTmp ≤ ResiThres1;

[0209] When neither the second condition nor the third condition is met, the QP of the current point is calculated according to the following formula (5):

[0210] PixelQp = Qp (5)

[0211] Wherein, PixelQp represents the QP of the current point, k represents the image complexity level of the current CU, PredResiTmp represents the prediction residual value of the current point, Qp represents the QP of the current CU, JndQp represents the adjustment lower limit, X7 and X8 are preset parameters, ResiThres0 represents the 0th gradient threshold of QP adjustment, ResiThres1 represents the 1st gradient threshold of QP adjustment, and ComplexTh represents the complexity threshold of QP adjustment.

[0212] In one possible implementation, the point prediction module 802 is specifically used to obtain the reconstruction value of the reference point and the reconstruction value of the first point when the current point is located at the beginning of the first row of the current CU, wherein the first point is located to the right of the reference point; and to obtain the prediction residual value of the current point based on the reconstruction value of the reference point and the reconstruction value of the first point.

[0213] In one possible implementation, the point prediction module 802 is specifically used to obtain the reconstruction value of the reference point, the reconstruction value of the first point, and the reconstruction value of the second point when the current point is not the first or second position in the first row of the current CU, wherein the first point is located to the right of the reference point and the second point is located to the left of the reference point; and to obtain the prediction residual value of the current point based on the reconstruction value of the reference point, the reconstruction value of the first point, and the reconstruction value of the second point.

[0214] In one possible implementation, the point prediction module 802 is specifically used to calculate the prediction residual value of the current point according to the following formula (6):

[0215] PredResiTmp=Abs(I[x][y-1]-I[x+1][y-1]) (6)

[0216] Where PredResiTmp represents the prediction residual value of the current point, I represents the reconstructed sample matrix of the current image, x represents the element in the x-th column of the reconstructed sample matrix, and y represents the element in the y-th row of the reconstructed sample matrix.

[0217] In one possible implementation, the point prediction module 802 is specifically used to calculate the prediction residual value of the current point according to the following formula (7):

[0218] PredResiTmp=(Abs(I[x][y-1]-I[x-1][y-1]))+(Abs(I[x][y-1]-I[x+1][y-1])) (7)

[0219] Where PredResiTmp represents the prediction residual value of the current point, I represents the reconstructed sample matrix of the current image, x represents the element in the x-th column of the reconstructed sample matrix, and y represents the element in the y-th row of the reconstructed sample matrix.

[0220] The apparatus of this embodiment can be used to perform Figure 4 The technical solutions of the method embodiments shown are similar in principle and in effect, and will not be described again here.

[0221] In implementation, each step of the above method embodiments can be completed by integrated logic circuits in the processor hardware or by instructions in software form. The processor can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this application can be directly implemented by a hardware encoding processor, or by a combination of hardware and software modules in the encoding processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory; the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.

[0222] The memory mentioned in the above embodiments can be volatile memory or non-volatile memory, or may include both. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM). It should be noted that the memory used in the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0223] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0224] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0225] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0226] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0227] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0228] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0229] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for obtaining quantization parameters, characterized in that, The method is applicable to point-level prediction models, and the method includes: Get the bit depth of the current image; Obtain the quantization parameter QP of the current coding unit (CU), where the current CU belongs to the current image; Obtain the image complexity level of the current CU; Obtain the prediction residual value of the current point, where the current point is located in the first row of the current CU, and the prediction value of the current point is the reconstructed value of the reference point, which is located above the current point; The QP of the current point is obtained based on the bit depth of the current image, the QP of the current CU, the image complexity level of the current CU, and the prediction residual value of the current point.

2. The method according to claim 1, characterized in that, The step of obtaining the QP of the current point based on the bit depth of the current image, the QP of the current CU, the image complexity level of the current CU, and the prediction residual value of the current point includes: The lower limit of the QP for the current point is obtained based on the bit depth of the current image, the image complexity level of the current CU, and the prediction residual value of the current point.

3. The method according to claim 1 or 2, characterized in that, The step of obtaining the QP of the current point based on the bit depth of the current image, the QP of the current CU, the image complexity level of the current CU, and the prediction residual value of the current point includes: The QP of the current point is obtained based on the image complexity level of the current CU, the QP of the current CU, and the adjustment lower limit.

4. The method according to claim 2, characterized in that, The step of obtaining the adjustment lower limit of QP for the current point based on the bit depth of the current image, the image complexity level of the current CU, and the prediction residual value of the current point includes: When the first condition is met, the lower limit of the adjustment of QP at the current point is calculated according to the following formula (1): JndQp=X2+Clip(0,X3,(BitDepth-X4)>>X5) (1) The first condition includes: k≤X1, and PredResiTmp≤ResiThres0; When the first condition is not met, the lower limit of the adjustment of QP at the current point is calculated according to the following formula (2): JndQp=Clip(0,X3,(BitDepth-X4)>>X5)+X6 (2) Where JndQp represents the lower limit of QP adjustment at the current point, BitDepth represents the bit depth of the current image, k represents the image complexity level of the current CU, PredResiTmp represents the prediction residual value at the current point, X1, X2, X3, X4, X5, and X6 are preset parameters, and ResiThres0 represents the 0th gradient threshold of QP adjustment.

5. The method according to claim 3, characterized in that, The step of obtaining the QP of the current point based on the image complexity level of the current CU, the QP of the current CU, and the adjustment lower limit includes: When the second condition is met, the QP of the current point is calculated according to the following formula (3): PixelQp=Max(Qp-X7,JndQp) (3) The second condition includes: Qp > JndQp, and PredResiTmp ≤ ResiThres0, and k ≥ ComplexTh; When the second condition is not met, but the third condition is met, the QP of the current point is calculated according to the following formula (4): PixelQp=Max(Qp-X8,JndQp) (4) The third condition includes: Qp > JndQp, and PredResiTmp ≤ ResiThres1; When neither the second condition nor the third condition is met, the QP of the current point is calculated according to the following formula (5): PixelQp = Qp (5) Wherein, PixelQp represents the QP of the current point, k represents the image complexity level of the current CU, PredResiTmp represents the prediction residual value of the current point, Qp represents the QP of the current CU, JndQp represents the adjustment lower limit, X7 and X8 are preset parameters, ResiThres0 represents the 0th gradient threshold of QP adjustment, ResiThres1 represents the 1st gradient threshold of QP adjustment, and ComplexTh represents the complexity threshold of QP adjustment.

6. The method according to any one of claims 1-5, characterized in that, The step of obtaining the prediction residual value at the current point includes: When the current point is at the beginning of the first row of the current CU, obtain the reconstruction value of the reference point and the reconstruction value of the first point, where the first point is located to the right of the reference point; The prediction residual value of the current point is obtained based on the reconstruction value of the reference point and the reconstruction value of the first point.

7. The method according to any one of claims 1-6, characterized in that, The step of obtaining the prediction residual value at the current point includes: When the current point is not the first or second position in the first row of the current CU, obtain the reconstruction value of the reference point, the reconstruction value of the first point, and the reconstruction value of the second point, wherein the first point is located to the right of the reference point and the second point is located to the left of the reference point; The prediction residual value of the current point is obtained based on the reconstruction value of the reference point, the reconstruction value of the first point, and the reconstruction value of the second point.

8. The method according to claim 6, characterized in that, The step of obtaining the prediction residual value of the current point based on the reconstructed value of the reference point and the reconstructed value of the first point includes: The prediction residual value of the current point is calculated according to the following formula (6): PredResiTmp=Abs(I[x][y-1]-I[x+1][y-1]) (6) Where PredResiTmp represents the prediction residual value of the current point, I represents the reconstructed sample matrix of the current image, x represents the element in the x-th column of the reconstructed sample matrix, and y represents the element in the y-th row of the reconstructed sample matrix.

9. The method according to claim 7, characterized in that, The step of obtaining the prediction residual value of the current point based on the reconstructed value of the reference point, the reconstructed value of the first point, and the reconstructed value of the second point includes: The prediction residual value of the current point is calculated according to the following formula (7): PredResiTmp=(Abs(I[x][y-1]-I[x-1][y-1]))+(Abs(I[x][y-1]-I[x+1][y-1]))(7) Where PredResiTmp represents the prediction residual value of the current point, I represents the reconstructed sample matrix of the current image, x represents the element in the x-th column of the reconstructed sample matrix, and y represents the element in the y-th row of the reconstructed sample matrix.

10. A device for acquiring quantization parameters, characterized in that, The device is suitable for point-level prediction modes, and the device includes: The acquisition module is used to acquire the bit depth of the current image; acquire the quantization parameter QP of the current coding unit (CU), wherein the current CU belongs to the current image; and acquire the image complexity level of the current CU. The point prediction module is used to obtain the prediction residual value of the current point, which is located in the first row of the current CU, and the prediction value of the current point is the reconstructed value of the reference point, which is located above the current point. The bit rate control module is used to obtain the QP of the current point based on the bit depth of the current image, the QP of the current CU, the image complexity level of the current CU, and the prediction residual value of the current point.

11. The apparatus according to claim 10, characterized in that, The bitrate control module is specifically used to obtain the lower limit of the QP adjustment for the current point based on the bit depth of the current image, the image complexity level of the current CU, and the prediction residual value of the current point.

12. The apparatus according to claim 10 or 11, characterized in that, The bitrate control module is specifically used to obtain the QP of the current point based on the image complexity level of the current CU, the QP of the current CU, and the adjustment lower limit.

13. The apparatus according to claim 11, characterized in that, The bit rate control module is specifically used to calculate the lower limit of the QP adjustment at the current point according to the following formula (1) when the first condition is met: JndQp=X2+Clip(0,X3,(BitDepth-X4)>>X5) (1) The first condition includes: k≤X1, and PredResiTmp≤ResiThres0; When the first condition is not met, the lower limit of the adjustment of QP at the current point is calculated according to the following formula (2): JndQp=Clip(0,X3,(BitDepth-X4)>>X5)+X6 (2) Where JndQp represents the lower limit of QP adjustment at the current point, BitDepth represents the bit depth of the current image, k represents the image complexity level of the current CU, PredResiTmp represents the prediction residual value at the current point, X1, X2, X3, X4, X5, and X6 are preset parameters, and ResiThres0 represents the 0th gradient threshold of QP adjustment.

14. The apparatus according to claim 12, characterized in that, The bit rate control module is specifically used to calculate the QP of the current point according to the following formula (3) when the second condition is met: PixelQp=Max(Qp-X7,JndQp) (3) The second condition includes: Qp > JndQp, and PredResiTmp ≤ ResiThres0, and k ≥ ComplexTh; When the second condition is not met, but the third condition is met, the QP of the current point is calculated according to the following formula (4): PixelQp=Max(Qp-X8,JndQp) (4) The third condition includes: Qp > JndQp, and PredResiTmp ≤ ResiThres1; When neither the second condition nor the third condition is met, the QP of the current point is calculated according to the following formula (5): PixelQp = Qp (5) Wherein, PixelQp represents the QP of the current point, k represents the image complexity level of the current CU, PredResiTmp represents the prediction residual value of the current point, Qp represents the QP of the current CU, JndQp represents the adjustment lower limit, X7 and X8 are preset parameters, ResiThres0 represents the 0th gradient threshold of QP adjustment, ResiThres1 represents the 1st gradient threshold of QP adjustment, and ComplexTh represents the complexity threshold of QP adjustment.

15. The apparatus according to any one of claims 10-14, characterized in that, The point prediction module is specifically used to obtain the reconstruction value of the reference point and the reconstruction value of the first point when the current point is located at the beginning of the first row of the current CU, wherein the first point is located to the right of the reference point; and to obtain the prediction residual value of the current point based on the reconstruction value of the reference point and the reconstruction value of the first point.

16. The apparatus according to any one of claims 10-15, characterized in that, The point prediction module is specifically used to obtain the reconstruction value of the reference point, the reconstruction value of the first point, and the reconstruction value of the second point when the current point is not the first or second position in the first row of the current CU. The first point is located to the right of the reference point, and the second point is located to the left of the reference point. The prediction residual value of the current point is obtained based on the reconstruction value of the reference point, the reconstruction value of the first point, and the reconstruction value of the second point.

17. The apparatus according to claim 15, characterized in that, The point prediction module is specifically used to calculate the prediction residual value of the current point according to the following formula (6): PredResiTmp=Abs(I[x][y-1]-I[x+1][y-1]) (6) Where PredResiTmp represents the prediction residual value of the current point, I represents the reconstructed sample matrix of the current image, x represents the element in the x-th column of the reconstructed sample matrix, and y represents the element in the y-th row of the reconstructed sample matrix.

18. The apparatus according to claim 16, characterized in that, The point prediction module is specifically used to calculate the prediction residual value of the current point according to the following formula (7): PredResiTmp=(Abs(I[x][y-1]-I[x-1][y-1]))+(Abs(I[x][y-1]-I[x+1][y-1]))(7) Where PredResiTmp represents the prediction residual value of the current point, I represents the reconstructed sample matrix of the current image, x represents the element in the x-th column of the reconstructed sample matrix, and y represents the element in the y-th row of the reconstructed sample matrix.

19. A decoder, characterized in that, include: One or more processors; Memory, used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-9.

20. An encoder, characterized in that, include: One or more processors; Memory, used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-9.

21. A computer-readable storage medium, characterized in that, Includes a computer program, which, when executed on a computer, causes the computer to perform the method of any one of claims 1-9.

22. A computer program product, the computer program product comprising instructions, characterized in that, When the instructions are executed on a computer or processor, they cause the computer or processor to perform the method of any one of claims 1-9.

Citation Information

Patent Citations

  • Image coding method and device, equipment and storage medium

    CN113784126A

  • Quantization parameter decoding method and device

    CN114598873A