Quantization parameter acquisition method and apparatus

In video coding and decoding technology, the coding and decoding method of the regional enhancement layer is used to calculate and adjust the quantization parameter (QP), which solves the problem of insufficient adaptability between the quantization parameter and the image content, improves the coding efficiency and image quality, and is suitable for High specification video data transmission.

WO2024188147A1PCT designated stage expired Publication Date: 2024-09-19HUAWEI TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/080498
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-13
Filing Date
2024-03-07
Publication Date
2024-09-19

AI Technical Summary

Technical Problem

In existing video coding and decoding technology, the compatibility between quantization parameters (QP) and image content is insufficient, resulting in low coding efficiency and poor image quality. Especially when transmitting high-standard video data, the bandwidth of the display interface and display link is insufficient. problem.

Method used

The encoding and decoding method of the regional enhancement layer is used to obtain the bit depth of the current image, the quantization parameter of the coding unit (CU) and the image complexity level, calculate the point-level prediction residual value, and adjust the quantization parameter (QP) to improve coding. Efficiency and accuracy, achieving low-granularity in-CU quantization processing and mitigating subjective distortion differences.

Benefits of technology

It improves the adaptability between quantization parameters and image content, improves encoding and decoding efficiency, reduces subjective distortion differences caused by quantization, and improves image quality within CU.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024080498_19092024_PF_FP_ABST
    Figure CN2024080498_19092024_PF_FP_ABST
Patent Text Reader

Abstract

The present application provides a quantization parameter (QP) acquisition method and apparatus. The present application provides a QP acquisition method, which is suitable for a point-level prediction mode. The method comprises: acquiring a bit depth of a current image; acquiring a QP of a current coding unit (CU), wherein the current CU belongs to the current image; acquiring an image complexity level of the current CU; acquiring a predicted residual value of a current point, wherein the current point is located in the first row of the current CU, a predicted value of the current point is a reconstructed value of a reference point, and the reference point is located on the upper side of the current point; and acquiring a QP of the current point according to the bit depth of the current image, the QP of the current CU, the image complexity level of the current CU and the predicted residual value of the current point. The embodiments of the present application can improve the adaptation degree of QPs and image content, implement quantization processing in low-granularity CUs, reduce a subjective distortion difference caused by quantization in CUs, and effectively improve the subjective quality of flat content in CUs.
Need to check novelty before this filing date? Find Prior Art

Description

Quantization parameter acquisition method and device Technical Field

[0001] The present application relates to video coding and decoding technology, and in particular to a method and device for obtaining quantization parameters. Background Art

[0002] Video and other media data are widely present in various devices, and data transmission between different devices usually uses display interfaces and display links. In recent years, with the improvement of the performance of media acquisition equipment and the increasing demand for video quality, the specifications of video data have also been rapidly improving, reflected in higher video resolution and frame rate. Higher-specification videos have larger data volumes per unit time, which poses 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 of transmitting the original video, it is particularly important to perform display interface compression on the video content.

[0003] The typical process of display interface compression includes: at the input side interface, the encoder performs encoding operations such as prediction, quantization, and entropy coding on the input single frame image and compresses it into a bit stream; the bit stream is transmitted to the output side interface through the display link; at the output side interface, the decoder performs entropy decoding, dequantization, prediction, reconstruction and other decoding operations on the bit stream, and finally outputs the reconstructed image. During the encoding process, the residual value generated by the prediction operation is quantized and written to the bit stream; 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 obvious the degree of quantization. Adjusting the QP value will directly affect the length of the encoded bit stream and the quality of the decoded image.

[0004] Based on this, it is expected that there can be a technology that can improve the adaptability of QP to image content as much as possible to improve encoding and decoding efficiency.

[0005] Summary of the Invention

[0006] The present application provides a coding and decoding method and apparatus for a regional enhancement layer to improve the coding efficiency and coding accuracy of the enhancement layer.

[0007] In a first aspect, the present application provides a method for obtaining a quantization parameter, which is applicable to a point-level prediction mode, and 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 a 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 a reconstructed value of a reference point, and the reference point is located above the current point; obtaining the QP of the current point according to 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 the embodiment of the present application, under point-level prediction, the quantization parameter adjustment of the point at a specific position is implemented, and the point-level QP calculation is realized. This can improve the adaptability of QP to the image content, realize low-granularity quantization processing within the CU, reduce the subjective distortion difference caused by quantization within the CU, and effectively improve the subjective quality of flat content within the CU.

[0009] An image frame consists of multiple pixels, and the image's bit depth indicates the number of bits used by each channel in a pixel. On the encoding side, the image's bit depth is a property of the image itself. Since the encoding side has direct access to the original image, the bit depth can be directly determined from the original image. On the decoding side, the image's bit depth can be determined by parsing the image's bitstream.

[0010] In an embodiment of the present application, the QP of the current CU can be obtained through the rate control module. On the decoding side, the input of the rate control module is the image complexity level of the current CU and the number of coded bits of the previous CU (for example, CU 1), and the output of the rate control module is the QP of the current CU. On the encoding side, the input of the rate control module is the image content of the current CU and the number of coded bits of the previous CU (for example, 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 the image content of the current CU, including:

[0012] 1. Calculate the texture image complexity level. Divide the current CU into several sub-blocks. For each sub-block, gradually calculate the difference between adjacent pixel values ​​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 the agreed threshold to obtain the image complexity level of the sub-block. After performing regular operations on the image complexity levels of each sub-block, the texture image complexity level of the current CU is obtained.

[0013] 2. Calculate the IBC image complexity level. The current CU obtains an IBC similarity prediction sample matrix based on the similar IBC prediction mode. 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 sum is called the sub-block SAD. The sub-block SAD is compared with the agreed threshold to obtain the image complexity level of the sub-block. After performing regular operations on the image complexity levels of each sub-block, the IBC image complexity level of the current CU is obtained.

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

[0015] After the encoding side obtains the image complexity level of the current CU, it can be entropy-encoded as a syntax element, and then serialized into the bit stream of the current image, so that the decoding end can parse the bit stream to directly obtain the image complexity level of the current CU.

[0016] The embodiment of the present application can adjust the quantization parameters of the points at specific positions in the current CU under point-level prediction. The specific position can be the first row in the current CU (for example, the horizontal position is 0) and the point-level prediction adopts the T prediction method (the T prediction method uses the reconstructed value of the upper point of the current point (that is, the above-mentioned reference point) as the prediction value of the current point).

[0017] There are two cases for points at a specific location: one is located at the first position of the first row of the current CU, and the other is located at a non-first position of the first row of the current CU. Based on this, the prediction residual value of the current point can be obtained in the following two ways:

[0018] One method is that the current point is located at the first position of the first row of the current CU, and the reconstruction value of the reference point and the reconstruction value of the first point are obtained, 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.

[0019] For example, the prediction residual value of the current point can be calculated according to the following formula (6): PredTesiTmp = Abs(I[x][y-1]-I[x+1][y-1]) (6)

[0020] Wherein, PredResiTmp represents the prediction residual value of the current point, I represents the reconstructed sample value matrix of the current image, x represents the element in the xth column of the reconstructed sample value matrix, and y represents the element in the yth row of the reconstructed sample value matrix.

[0021] Another method is that the current point is located at the non-first position in the first row of the current CU, and the reconstruction value of the reference point, the reconstruction value of the first point and the reconstruction value of the second point are obtained, where 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 according to the reconstruction value of the reference point, the reconstruction value of the first point and the reconstruction value of the second point.

[0022] For example, the prediction residual value of the current point can be calculated according to the following formula (7): PredTesiTmp=(Abs(I[x][y-1]-I[x-1][y-1]))+(Abs(I[x][y-1]-I[x+1][y-1])) (7)

[0023] Wherein, PredResiTmp represents the prediction residual value of the current point, I represents the reconstructed sample value matrix of the current image, x represents the element in the xth column of the reconstructed sample value matrix, and y represents the element in the yth row of the reconstructed sample value matrix.

[0024] For example, two points using T prediction are selected from the first row of the current CU. 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-leading position in the first row of the current CU. Assume that the positions of these two points are both represented by (x, y).

[0025] For point T1:

[0026] To calculate the predicted residual value, two points on the upper side and the right side of the upper side are used. The positions of these two points are represented as (x, y-1) and (x+1, y-1) respectively.

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

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

[0029] For point T2:

[0030] The prediction residual value is calculated using the three points on its upper side and on the left and right sides of the upper side. The positions of these three points are represented as (x-1, y-1), (x, y-1), and (x+1, y-1).

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

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

[0033] Through the above process, the embodiment of the present application can realize point-level prediction and obtain the prediction residual value of the point, so that low-granularity prediction processing within the CU can be realized, making the prediction process more accurate and consistent with the image content of the CU.

[0034] In an embodiment of the present application, the adjustment 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 adjustment lower limit.

[0035] The following method can be used to obtain the lower limit of the QP at the current point:

[0036] When the first condition is met, the lower limit of the QP adjustment of the current point is calculated according to the following formula (1): JndQp=X2+Clip(0,X3,(BitDepth-X4)>>X5) (1)

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

[0038] When the first condition is not met, the lower limit of the QP adjustment of the current point is calculated according to the following formula (2): JndQp=Clip(0,X3,(BitDepth-X4)>>X5)+X6 (2)

[0039] Among them, 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 of the current point, X1, X2, X3, X4, X5, and X6 are pre-set parameters, and ResiThres0 represents the 0th gradient threshold of QP adjustment.

[0040] The following methods can be used to obtain the QP of the current point:

[0041] 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)

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

[0043] 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)

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

[0045] When the second condition and the third condition are not met, the QP of the current point is calculated according to the following formula (5): PixelQp=Qp (5)

[0046] Among them, 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 pre-set 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 optionally, ComplexTh=2.

[0047] Through the above process, the embodiment of the present application can implement point-level QP adjustment, obtain the adjusted QP of the point at a specific position, and implement point-level QP calculation. This can improve the adaptability of QP to image content, implement low-granularity quantization processing within the CU, reduce the subjective distortion difference caused by quantization within the CU, and effectively improve the subjective quality of flat content within the CU.

[0048] In a second aspect, the present application provides a quantization parameter acquisition device, which is suitable for a point-level prediction mode, and the device includes: an acquisition module, used to obtain the bit depth of the current image; obtain the quantization parameter QP of the current coding unit CU, the current CU belonging to the current image; obtain the image complexity level of the current CU; a point prediction module, used to 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 a reconstructed value of a reference point, and the reference point is located above the current point; a bit rate control module, used to obtain the QP of the current point according to 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.

[0049] In one possible implementation, the bit rate control module 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 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.

[0050] In a possible implementation, the bit rate control module is specifically configured to calculate the lower limit of the QP of the current point according to the following formula (1) when the first condition is met: JndQp=X2+Clip(0,X3,(BitDepth-X4)>>X5) (1)

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

[0052] When the first condition is not met, the lower limit of the QP adjustment of the current point is calculated according to the following formula (2): JndQp=Clip(0,X3,(BitDepth-X4)>>X5)+X6 (2)

[0053] Among them, JndQp represents the lower limit of QP adjustment of 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 of the current point, X1, X2, X3, X4, X5, and X6 are pre-set parameters, and ResiThres0 represents the 0th gradient threshold of QP adjustment.

[0054] In a possible implementation, the bit rate control module is specifically configured 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)

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

[0056] 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)

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

[0058] When the second condition and the third condition are not met, the QP of the current point is calculated according to the following formula (5): PixelQp=Qp (5)

[0059] Among them, 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 pre-set 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.

[0060] 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 first position of the first row of the current CU, and the first point is located to the right of the reference point; and 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.

[0061] 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 located at a non-first 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; and 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.

[0062] In a possible implementation, the point prediction module is specifically configured to calculate the prediction residual value of the current point according to the following formula (6): PredTesiTmp = Abs(I[x][y-1]-I[x+1][y-1]) (6)

[0063] Wherein, PredResiTmp represents the predicted residual value of the current point, I represents the reconstructed sample value matrix of the current image, x represents the element in the xth column of the reconstructed sample value matrix, and y represents the element in the yth row of the reconstructed sample value matrix.

[0064] In one possible implementation, the point prediction module is specifically configured to calculate the prediction residual value of the current point according to the following formula (7): PredTesiTmp = (Abs(I[x][y-1]-I[x-1][y-1])) + (Abs(I[x][y-1]-I[x+1][y-1])) (7)

[0065] Wherein, PredResiTmp represents the predicted residual value of the current point, I represents the reconstructed sample value matrix of the current image, x represents the element in the xth column of the reconstructed sample value matrix, and y represents the element in the yth row of the reconstructed sample value matrix.

[0066] In a third aspect, the present application provides a decoder comprising: one or more processors; a memory for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement a method as described in any one of the above-mentioned first aspects.

[0067] In a fourth aspect, the present application provides an encoder comprising: one or more processors; a memory for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement a method as described in any one of the above-mentioned first aspects.

[0068] In a fifth aspect, the present application provides a computer-readable storage medium, characterized in that it includes a computer program, and when the computer program is executed on a computer, it enables the computer to execute any one of the methods in the first aspect above.

[0069] In a sixth aspect, the present application provides a computer program product, which includes instructions, and is characterized in that when the instructions are executed on a computer or a processor, the computer or the processor implements any one of the methods described in the first aspect above.

[0070] In the seventh aspect, the present application provides a bit stream, which can be stored in a computer-readable storage medium or transmitted in the form of signals such as electromagnetic waves. The bit stream includes encoded image data and syntax elements. The syntax elements include a quantization parameter of the current point when point-level prediction is used. The current point is located in the first row of the current CU, and the prediction value of the current point is a reconstructed value of a reference point, which is located above the current point. BRIEF DESCRIPTION OF THE DRAWINGS

[0071] FIG1 is a schematic diagram of a decoding architecture;

[0072] FIG2 is a schematic diagram of the coding architecture;

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

[0074] FIG4 is a flowchart of a process 400 of a method for obtaining a quantization parameter according to an embodiment of the present application;

[0075] FIG5 is a schematic diagram of points for calculating the prediction residual value;

[0076] FIG6 is a flowchart of a decoding end obtaining a quantization parameter;

[0077] FIG7 is a flow chart showing how the encoder obtains quantization parameters;

[0078] FIG8 is a schematic diagram of an exemplary structure of a quantization parameter acquisition device 800 according to an embodiment of the present application. DETAILED DESCRIPTION

[0079] To make the objectives, technical solutions, and advantages of this application more clear, the technical solutions of this application will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments of this application, all other embodiments obtained by ordinary technicians in this field without making any creative efforts are within the scope of protection of this application.

[0080] The terms "first," "second," and the like in the description, embodiments, claims, and drawings of this application are used solely for descriptive purposes and are not to be construed as indicating or implying relative importance or order. Furthermore, the terms "including," "having," and any variations thereof are intended to cover non-exclusive inclusions, such as, for example, inclusion of 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 such processes, methods, products, or apparatus.

[0081] It should be understood that in this application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0082] For ease of understanding, the following are explanations of relevant terms:

[0083] Interface compression: Electronic devices use display interfaces when transmitting video. They compress (encode) and decompress (decode) the video data passing through the display interface, which is referred to as interface compression.

[0084] Bitstream: A binary stream generated by encoding video data.

[0085] Rate control: The process of adjusting the output bit rate during the encoding process. It is based on the analysis of information such as the current image content and the bitstream buffer margin, and adjusts the output bit rate by changing the encoding quantization parameters, encoding mode, etc., which is referred to as rate control.

[0086] Quantization Parameter (QP): During encoding, the residual values ​​generated by prediction operations or the coefficients generated by transform operations are quantized and written to the bitstream. During decoding, syntax elements are dequantized to obtain the residual values ​​or coefficients. QP is a parameter used in the aforementioned quantization and dequantization processes. Generally, a larger QP value indicates a greater degree of quantization. Adjusting the QP value directly affects the length of the encoded bitstream and the quality of the decoded image.

[0087] 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.

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

[0089] Point-level prediction: A point is used as the prediction unit. The reconstructed value of a reconstructed point in the current coding unit can be used as a prediction reference value for subsequent points in the current CU.

[0090] The embodiments of this application involve obtaining QP. The following is an explanation of the relevant technologies:

[0091] Figure 1 is a schematic diagram of the decoding architecture. As shown in Figure 1, after the bit stream 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, inverse quantization, prediction, etc., and finally outputs the reconstructed image of the CU.

[0092] 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 coded bits of the previous CU (e.g., CU 1). The output of the rate control module is the quantization parameter of the current CU. The image complexity level of the current CU can be obtained by entropy decoding the corresponding bitstream, and the number of coded bits of the previous CU can be obtained by entropy decoding the corresponding bitstream.

[0093] The current CU is passed through the prediction module to obtain prediction samples (also called prediction values / prediction blocks). The prediction samples and the residual samples (also called residual values / residual blocks) obtained through inverse quantization are then used to calculate reconstruction samples (also called reconstruction values / reconstruction blocks), and the reconstructed image is finally output. The prediction module's prediction modes can include point-level prediction and block-level prediction. The prediction mode in the embodiment of the present application is point-level prediction.

[0094] Figure 2 is a schematic diagram of the encoding architecture. As shown in Figure 2, the current image is divided into image blocks (coding units). After any coding unit (CU 1 or CU 2 in the figure) is input into the encoder, it undergoes encoding processes such as prediction, quantization, and entropy coding, and outputs the bitstream of the CU. The bitstreams of all CUs are concatenated to obtain the bitstream of the current image.

[0095] 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 coded bits of the previous CU (e.g., CU 1). The output of the rate control module is the quantization parameter of the current CU. The image complexity level of the current CU can be obtained based on the image content of the current CU, and the number of coded bits of the previous CU can be obtained through entropy coding.

[0096] The image complexity level of the current CU can be obtained based on the image content of the current CU. The following method can be used:

[0097] 1. Calculate the texture image complexity level. Divide the current CU into several sub-blocks. For each sub-block, gradually calculate the difference between adjacent pixel values ​​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 the agreed threshold to obtain the image complexity level of the sub-block. After performing regular operations on the image complexity levels of each sub-block, the texture image complexity level of the current CU is obtained.

[0098] 2. Calculate the image complexity level for the intra block copy (IBC) prediction mode. The current CU is divided into several sub-blocks using an IBC similarity prediction sample matrix derived from a similar IBC prediction mode. For each sub-block, the sum of the absolute differences between its IBC similarity prediction samples and the original values ​​is calculated. This sum is called the Sum of Absolute Difference (SAD). The SAD of each sub-block is compared with a pre-defined threshold to determine the image complexity level of that sub-block. After performing regular operations on the image complexity levels of each sub-block, the IBC image complexity level of the current CU is obtained.

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

[0100] The current CU is passed through the prediction module to obtain a predicted sample. The difference between the predicted sample and the original sample (i.e., the residual sample) is then quantized and entropy encoded, and the bitstream is finally output. Among them, the prediction module's prediction mode can include point-level prediction and block-level prediction. The prediction mode of the embodiment of the present application is point-level prediction.

[0101] Figure 3 is a schematic diagram of point-level prediction. As shown in Figure 3, point-level prediction includes three prediction methods: T prediction method, RL prediction method, and L prediction method.

[0102] The T prediction method uses the reconstructed value of the point above the current point as the predicted value of the current point;

[0103] 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;

[0104] 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 for the current point. The CU in the figure is 16×2 in size. 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 of this CU, the even-numbered columns of points use the T prediction method, the last column of points uses the L prediction method, and all other points use the RL prediction method.

[0105] It should be noted that FIG3 shows only one CU size and the point-level prediction method it adopts as an example, but this is not a limitation, and the embodiments of the present application do not make specific limitations on this.

[0106] In order to improve the adaptability of QP to image content and enhance encoding and decoding efficiency, the present invention provides a method and apparatus for obtaining quantization parameters. The technical solution of the present invention will be described below.

[0107] FIG4 is a flow chart of process 400 of the method for obtaining a quantization parameter according to an embodiment of the present application. Process 400 may be performed by the decoder in the embodiment shown in FIG1 or the encoder in the embodiment shown in FIG2 . Process 400 is described as a series of steps or operations. It should be understood that process 400 may be performed in various orders and / or concurrently, and is not limited to the order shown in FIG4 . Process 400 may include:

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

[0109] A frame of image includes multiple pixels, and the bit depth of the image represents the number of bits occupied by each channel of a pixel in the image.

[0110] On the encoding side, the bit depth of the current image is a property of the image itself. The encoding side can directly obtain the original image, so the bit depth can be directly obtained based on the original image.

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

[0112] Step 402: Get the QP of the current CU, where the current CU belongs to the current image.

[0113] In the embodiment of the present application, the QP of the current CU can be obtained through a rate control module (such as shown in Figures 1 and 2).

[0114] On the decoding side, the input of the rate control module is the image complexity level of the current CU and the number of coded bits of the previous CU (for example, CU 1), and the output of the rate control module is the QP of the current CU.

[0115] On the encoding side, the input of the rate control module is the image content of the current CU and the number of coded bits of the previous CU (for example, CU 1), and the output of the rate control module is the QP of the current CU.

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

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

[0118] 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:

[0119] 1. Calculate the texture image complexity level. Divide the current CU into several sub-blocks. For each sub-block, gradually calculate the difference between adjacent pixel values ​​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 the agreed threshold to obtain the image complexity level of the sub-block. After performing regular operations on the image complexity levels of each sub-block, the texture image complexity level of the current CU is obtained.

[0120] 2. Calculate the IBC image complexity level. The current CU obtains an IBC similarity prediction sample matrix using a similar IBC prediction mode. The current CU is divided into several sub-blocks. For each sub-block, the sum of the absolute differences between its IBC similarity prediction samples and the original values ​​is calculated. This sum is called the sub-block SAD. The sub-block SAD is compared with a predetermined threshold to determine the image complexity level of the sub-block. After performing regular operations on the image complexity levels of each sub-block, the IBC image complexity level of the current CU is obtained.

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

[0122] After the encoding side obtains the image complexity level of the current CU, it can be entropy-encoded as a syntax element, and then serialized into the bit stream of the current image, so that the decoding end can parse the bit stream to directly obtain the image complexity level of the current CU.

[0123] Step 404: 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.

[0124] In embodiments of the present application, the quantization parameter of a point at a specific location within the current CU under point-level prediction can be adjusted. This specific location can be a point in the first row of the current CU (e.g., horizontal position 0) and a point whose 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 reference point) as the predicted value for the current point). For example, referring to Figure 3 , the point at row 0 and even column is the specific location, and its QP can be adjusted as the current point.

[0125] Still referring to Figure 3, there are two cases for points at specific positions: one is the point at position (0,0), that is, the first point in the first row of the current CU, and the other is the point at a non-(0,0) position, that is, the point not at the first position in the first row of the current CU. Based on this, the prediction residual value of the current point can be obtained in the following two ways:

[0126] One method is that the current point is located at the first position of the first row of the current CU, and the reconstruction value of the reference point and the reconstruction value of the first point are obtained, 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.

[0127] For example, the prediction residual value of the current point can be calculated according to the following formula (6): PredTesiTmp = Abs(I[x][y-1]-I[x+1][y-1]) (6)

[0128] Wherein, PredResiTmp represents the prediction residual value of the current point, I represents the reconstructed sample value matrix of the current image, x represents the element in the xth column of the reconstructed sample value matrix, and y represents the element in the yth row of the reconstructed sample value matrix.

[0129] Another method is that the current point is located at the non-first position in the first row of the current CU, and the reconstruction value of the reference point, the reconstruction value of the first point and the reconstruction value of the second point are obtained, where 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 according to the reconstruction value of the reference point, the reconstruction value of the first point and the reconstruction value of the second point.

[0130] For example, the prediction residual value of the current point can be calculated according to the following formula (7): PredTesiTmp=(Abs(I[x][y-1]-I[x-1][y-1]))+(Abs(I[x][y-1]-I[x+1][y-1])) (7)

[0131] Wherein, PredResiTmp represents the prediction residual value of the current point, I represents the reconstructed sample value matrix of the current image, x represents the element in the xth column of the reconstructed sample value matrix, and y represents the element in the yth row of the reconstructed sample value matrix.

[0132] For example, FIG5 is a schematic diagram of points for calculating the prediction residual value. As shown in FIG5 , the size of the current CU is 16×2, including the y row (the first row of the current CU) and the y+1 row (the second row of the current CU). The y-1 row is the second row of the CU located above the current CU. Two points using the T prediction method are selected from the first row of the current CU, one point T1 is located at the first position of the first row of the current CU, and the other point T2 is located at the non-first position of the first row of the current CU. Assume that the positions of these two points are both expressed as (x, y).

[0133] For point T1:

[0134] To calculate the predicted residual value, two points on the upper side and the right side of the upper side are used. The positions of these two points are represented as (x, y-1) and (x+1, y-1) respectively.

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

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

[0137] For point T2:

[0138] The prediction residual value is calculated using the three points on its upper side and on the left and right sides of the upper side. The positions of these three points are represented as (x-1, y-1), (x, y-1), and (x+1, y-1).

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

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

[0141] Through the above process, the embodiment of the present application can realize point-level prediction and obtain the prediction residual value of the point, so that low-granularity prediction processing within the CU can be realized, making the prediction process more accurate and consistent with the image content of the CU.

[0142] Step 405: Obtain the QP of the current point according to 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.

[0143] In an embodiment of the present application, the adjustment 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 adjustment lower limit.

[0144] The following method can be used to obtain the lower limit of the QP at the current point:

[0145] When the first condition is met, the lower limit of the QP adjustment of the current point is calculated according to the following formula (1): JndQp=X2+Clip(0,X3,(BitDepth-X4)>>X5) (1)

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

[0147] When the first condition is not met, the lower limit of the QP adjustment of the current point is calculated according to the following formula (2): JndQp=Clip(0,X3,(BitDepth-X4)>>X5)+X6 (2)

[0148] Among them, 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 of the current point, X1, X2, X3, X4, X5, and X6 are pre-set parameters, and ResiThres0 represents the 0th gradient threshold of QP adjustment.

[0149] The following methods can be used to obtain the QP of the current point:

[0150] 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)

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

[0152] 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)

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

[0154] When the second condition and the third condition are not met, the QP of the current point is calculated according to the following formula (5): PixelQp=Qp (5)

[0155] Among them, 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 pre-set 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 optionally, ComplexTh=2.

[0156] Through the above process, the embodiment of the present application can implement point-level QP adjustment, obtain the adjusted QP of the point at a specific position, and implement point-level QP calculation. This can improve the adaptability of QP to image content, implement low-granularity quantization processing within the CU, reduce the subjective distortion difference caused by quantization within the CU, and effectively improve the subjective quality of flat content within the CU.

[0157] In the embodiment of the present application, under point-level prediction, the quantization parameter adjustment of the point at a specific position is implemented, and the point-level QP calculation is realized. This can improve the adaptability of QP to the image content, realize low-granularity quantization processing within the CU, reduce the subjective distortion difference caused by quantization within the CU, and effectively improve the subjective quality of flat content within the CU.

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

[0159] Figure 6 is a flowchart of how the decoder obtains quantization parameters. As shown in Figure 6, at the decoder, the quantization parameters are adjusted for a specific point in the current CU (corresponding to the current point mentioned above) using point-level prediction. The specific position refers to a position in the first row of the current CU that uses T prediction.

[0160] After the bit stream of the current CU is input into the decoder, it undergoes entropy decoding, inverse quantization, point-level prediction, etc., and finally outputs the reconstructed block corresponding to the current CU.

[0161] When calculating the quantization parameter of a point at a specific location, the input is the quantization parameter of the current CU (i.e., the quantization parameter output by the bit rate control module), the predicted residual value of the point at a specific location in the current CU, and the bit depth of the current image, and the output is the quantization parameter of the point at a specific location in the current CU. Under point-level prediction, the point at a specific location is dequantized using the adjusted quantization parameter. Under point-level prediction, the calculation process of the quantization parameter of a point at a specific location is as follows:

[0162] a) Calculate the prediction residual value PredResiTmp of a point at a specific position in the current CU. The horizontal index of the point at a specific position in the current CU is x, and the vertical index is y. I represents the reconstructed sample matrix of the current CU. The prediction residual value PredResiTmp of the point at a specific position in the current CU can be calculated by the difference between the reconstructed values ​​of the point above the point and the point adjacent to the left or right of the point above the point.

[0163] Referring to Figure 5, if the point is located in the first row of the current CU and is the first to use the T prediction method, PredResiTmp is equal to the difference between the reconstructed values ​​of the point above the point and its right adjacent point, and the calculation formula is: PredResiTmp = Abs(I[x][y–1]–I[x+1][y–1])); otherwise, if the point is located in the first row of the current CU and is not the first to use the T prediction method, PredResiTmp is equal to the average of the differences between the reconstructed values ​​of the point above the point and its left and right adjacent points, and the calculation formula is: PredResiTmp = (Abs(I[x][y–1]–I[x-1][y–1])+Abs(I[x][y–1]–I[x+1][y–1])+1)>>1.

[0164] b) Calculate the quantization parameter PixelQp of a specific point in the current CU. The process is as follows:

[0165] 1) Calculate the lower limit JndQp of the quantization parameter PixelQp of a point at a specific position.

[0166] The lower limit JndQp of the quantization parameter adjustment for a point at a specific location is calculated based on the image complexity level k, bit depth BitDepth, and the prediction residual value of the point at the specific location. If the image complexity level k of the current CU is less than or equal to X1, and the prediction residual value PredResiTmp of the point at the 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. Among them, X1, X2, X3, X4, X5, and X6 are agreed threshold parameters, and ResiThres0 represents the 0th gradient threshold for quantization parameter adjustment.

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

[0168] PixelQp is calculated based on the image complexity level k of the current CU, the quantization parameter Qp of the current CU, and the lower limit of the quantization parameter adjustment JndQp. If the quantization parameter Qp of the current CU is greater than JndQp, the prediction residual value PredResiTmp of the point at the specific location is less than or equal to ResiThres0, and the image complexity level k of the current CU is greater than or equal to ComplexTh, then PixelQp = Max(Qp – X7, JndQp). Otherwise, if the quantization parameter Qp of the current CU is greater than JndQp, and the prediction residual value PredResiTmp of the point at the specific location is less than or equal to ResiThres1, then PixelQp = Max(Qp – X8, JndQp). Otherwise, PixelQp is equal to Qp. 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.

[0169] Figure 7 is a flowchart of how the encoder obtains quantization parameters. As shown in Figure 7, at the encoder, the quantization parameters are adjusted for a point at a specific location within the current CU (corresponding to the current point mentioned above) using point-level prediction. The specific location refers to a location in the first row of the current CU that uses T prediction.

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

[0171] Under point-level prediction, the point at a specific position is quantized using the adjusted quantization parameter. The calculation process of the quantization parameter of the point at a specific position can refer to the calculation process in the embodiment shown in FIG6 , and will not be repeated here.

[0172] FIG8 is a schematic diagram of an exemplary structure of a quantization parameter acquisition device 800 according to an embodiment of the present application. As shown in FIG8 , the quantization parameter acquisition device 800 according to the present embodiment can be applied to the decoder in the embodiment shown in FIG1 or the encoder in the embodiment shown in FIG2 . The quantization parameter acquisition device 800 may include: an acquisition module 801, a point prediction module 802, and a bit rate control module 803.

[0173] In the point-level prediction mode, the acquisition module 801 is used to obtain the bit depth of the current image; obtain the quantization parameter QP of the current coding unit CU, the current CU belongs to the current image; obtain the image complexity level of the current CU; the point prediction module 802 is used to 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 reconstructed value of the reference point, and the reference point is located on the upper side of the current point; the bit rate control module 803 is used to obtain the QP of the current point according to 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.

[0174] In one possible implementation, the bit rate control module 803 is specifically used to obtain the adjustment lower limit of the QP of the current point according to 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 obtain the QP of the current point according to the image complexity level of the current CU, the QP of the current CU, and the adjustment lower limit.

[0175] In one possible implementation, the bit rate control module 803 is specifically configured to calculate the lower limit of the QP of the current point according to the following formula (1) when the first condition is met: JndQp=X2+Clip(0,X3,(BitDepth-X4)>>X5) (1)

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

[0177] When the first condition is not met, the lower limit of the QP adjustment of the current point is calculated according to the following formula (2): JndQp=Clip(0,X3,(BitDepth-X4)>>X5)+X6 (2)

[0178] Among them, JndQp represents the lower limit of QP adjustment of 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 of the current point, X1, X2, X3, X4, X5, and X6 are pre-set parameters, and ResiThres0 represents the 0th gradient threshold of QP adjustment.

[0179] In a possible implementation, the bit rate control module 803 is specifically configured 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)

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

[0181] 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)

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

[0183] When the second condition and the third condition are not met, the QP of the current point is calculated according to the following formula (5): PixelQp=Qp (5)

[0184] Among them, 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 pre-set 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.

[0185] In one possible implementation, the point prediction module 802 is specifically used to obtain the reconstructed value of the reference point and the reconstructed value of the first point when the current point is located at the first position of the first row of the current CU, and the first point is located to the right of the reference point; and obtain 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.

[0186] In one possible implementation, the point prediction module 802 is specifically used to obtain the reconstructed value of the reference point, the reconstructed value of the first point and the reconstructed value of the second point when the current point is located at a non-first 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; and obtain 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.

[0187] In one possible implementation, the point prediction module 802 is specifically configured to calculate the prediction residual value of the current point according to the following formula (6): PredTesiTmp = Abs(I[x][y-1]-I[x+1][y-1]) (6)

[0188] Wherein, PredResiTmp represents the predicted residual value of the current point, I represents the reconstructed sample value matrix of the current image, x represents the element in the xth column of the reconstructed sample value matrix, and y represents the element in the yth row of the reconstructed sample value matrix.

[0189] In one possible implementation, the point prediction module 802 is specifically configured to calculate the prediction residual value of the current point according to the following formula (7): PredTesiTmp = (Abs(I[x][y-1]-I[x-1][y-1])) + (Abs(I[x][y-1]-I[x+1][y-1])) (7)

[0190] Wherein, PredResiTmp represents the predicted residual value of the current point, I represents the reconstructed sample value matrix of the current image, x represents the element in the xth column of the reconstructed sample value matrix, and y represents the element in the yth row of the reconstructed sample value matrix.

[0191] The device of this embodiment can be used to execute the technical solution of the method embodiment shown in Figure 4. Its implementation principle and technical effects are similar and will not be repeated here.

[0192] During implementation, each step of the above method embodiment can be completed by an integrated logic circuit of hardware in a processor or by instructions in the form of software. 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 device, a discrete gate or transistor logic device, or a discrete hardware component. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present application can be directly embodied as being executed by a hardware coding processor, or can be executed by a combination of hardware and software modules in the coding processor. The software module can be located in a mature storage medium in the art such as random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.

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

[0194] Those skilled in the art will appreciate that the units and algorithm steps of each example 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 performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel 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.

[0195] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0196] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0197] The units described as separate components may or may not be physically separate, and 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 these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0198] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0199] If the functions are implemented in the form of 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 the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0200] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

Claims

1. A method for obtaining a quantization parameter, It is characterized in that The method is applicable to a point-level prediction mode, and the method comprises: Get the bit depth of the current image; Obtaining a quantization parameter QP of a current coding unit CU, where the current CU belongs to the current image; Obtaining the image complexity level of the current CU; Obtain a prediction residual value of a 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 a reconstructed value of a reference point, where the reference point is located above the current point; The QP of the current point is obtained according to 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, It is characterized in that The obtaining the QP of the current point according to 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: Obtaining an adjustment lower limit of the QP of the current point according to the bit depth of the current image, the image complexity level of the current CU and the prediction residual value of the current point; The QP of the current point is obtained according to the image complexity level of the current CU, the QP of the current CU and the adjustment lower limit.

3. The method according to claim 2, It is characterized in that The obtaining the adjustment lower limit of the QP of the current point according to 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 QP adjustment of 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 QP adjustment of the current point is calculated according to the following formula (2): JndQp=Clip(0,X3,(BitDepth-X4)>>X5)+X6 (2) Among them, JndQp represents the lower limit of the QP adjustment of 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 predicted residual value of the current point, X1, X2, X3, X4, X5, and X6 are pre-set parameters, and ResiThres0 represents the 0th gradient threshold of QP adjustment.

4. The method according to claim 2 or 3, It is characterized in that The obtaining the QP of the current point according to 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 the second condition and the third condition are not met, the QP of the current point is calculated according to the following formula (5): PixelQp=Qp (5) Among them, 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 pre-set 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.

5. The method according to any one of claims 1 to 4, It is characterized in that The obtaining of the prediction residual value of the current point includes: When the current point is located at the first position of the first row of the current CU, obtaining a reconstruction value of the reference point and a reconstruction value of a 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 according to the reconstructed value of the reference point and the reconstructed value of the first point.

6. The method according to any one of claims 1 to 4, It is characterized in that The obtaining of the prediction residual value of the current point includes: When the current point is located at a non-first position in the first row of the current CU, obtaining a reconstruction value of the reference point, a reconstruction value of a first point, and a reconstruction value of a second point, wherein the first point is located on the right side of the reference point, and the second point is located on the left side of the reference point; The prediction residual value of the current point is obtained according to the reconstruction value of the reference point, the reconstruction value of the first point and the reconstruction value of the second point.

7. The method according to claim 5, It is characterized in that The acquiring the prediction residual value of the current point according to the reconstructed value of the reference point and the reconstructed value of the first point comprises: 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) Wherein, PredResiTmp represents the predicted residual value of the current point, I represents the reconstructed sample value matrix of the current image, x represents the element of the xth column in the reconstructed sample value matrix, and y represents the element of the yth row in the reconstructed sample value matrix.

8. The method according to claim 6, It is characterized in that The acquiring the prediction residual value of the current point according to the reconstruction value of the reference point, the reconstruction value of the first point and the reconstruction value of the second point comprises: 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) Wherein, PredResiTmp represents the predicted residual value of the current point, I represents the reconstructed sample value matrix of the current image, x represents the element of the xth column in the reconstructed sample value matrix, and y represents the element of the yth row in the reconstructed sample value matrix.

9. A quantization parameter acquisition device, It is characterized in that The device is applicable to a point-level prediction mode, and comprises: An acquisition module, used to acquire a bit depth of a current image; acquire a quantization parameter QP of a current coding unit CU, the current CU belonging to the current image; and acquire an image complexity level of the current CU; A point prediction module, used to obtain a prediction residual value of a current point, the current point is located in the first row of the current CU, and the prediction value of the current point is a reconstructed value of a reference point, the reference point is located above the current point; The bit rate control module is used to obtain the QP of the current point according to 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.

10. The device according to claim 9, It is characterized in that The bit rate control module is specifically used to obtain the adjustment lower limit of the QP of the current point according to the bit depth of the current image, the image complexity level of the current CU and the prediction residual value of the current point; The QP of the current point is obtained according to the image complexity level of the current CU, the QP of the current CU and the adjustment lower limit.

11. The device according to claim 10, It is characterized in that The bit rate control module is specifically used to calculate the adjustment lower limit of the QP of 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 QP adjustment of the current point is calculated according to the following formula (2): JndQp=Clip(0,X3,(BitDepth-X4)>>X5)+X6 (2) Among them, JndQp represents the lower limit of the QP adjustment of 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 predicted residual value of the current point, X1, X2, X3, X4, X5, and X6 are pre-set parameters, and ResiThres0 represents the 0th gradient threshold of QP adjustment.

12. The device according to claim 10 or 11, It is characterized in that The bit rate control module is specifically configured 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 the second condition and the third condition are not 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 predicted residual value of the current point, Qp represents the QP of the current CU, JndQp represents the lower limit of the adjustment, X7 and X8 are pre-set parameters, ResiThres0 represents the 0th gradient threshold of QP adjustment, ResiThres1 represents the 1st gradient threshold of QP adjustment, ComplexTh represents Indicates the complexity threshold of QP adjustment.

13. The device according to any one of claims 9 to 12, It is 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 first position of the first row of the current CU, and the first point is located on the right side of the reference point; and obtain the prediction residual value of the current point according to the reconstruction value of the reference point and the reconstruction value of the first point.

14. The device according to any one of claims 9 to 12, It is 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 located at a non-first position in the first row of the current CU, the first point is located on the right side of the reference point, and the second point is located on the left side of the reference point; and obtain the prediction residual value of the current point according to the reconstruction value of the reference point, the reconstruction value of the first point and the reconstruction value of the second point.

15. The device according to claim 13, It is 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) Wherein, PredResiTmp represents the predicted residual value of the current point, I represents the reconstructed sample value matrix of the current image, x represents the element of the xth column in the reconstructed sample value matrix, and y represents the element of the yth row in the reconstructed sample value matrix.

16. The device according to claim 14, It is 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) Wherein, PredResiTmp represents the predicted residual value of the current point, I represents the reconstructed sample value matrix of the current image, x represents the element of the xth column in the reconstructed sample value matrix, and y represents the element of the yth row in the reconstructed sample value matrix.

17. A decoder, It is characterized in that include: one or more processors; A memory for storing 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 according to any one of claims 1 to 8.

18. An encoder, It is characterized in that include: one or more processors; A memory for storing 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 according to any one of claims 1 to 8.

19. A computer-readable storage medium, It is characterized in that The invention comprises a computer program, which, when executed on a computer, causes the computer to execute the method according to any one of claims 1 to 8.

20. A computer program product comprising instructions, It is characterized in that When the instructions are executed on a computer or a processor, the computer or the processor is enabled to implement the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Video frame pixel block compression method and device

    CN105763877A

  • HEVC TILE coding boundary quality optimization method and system

    CN113747153A

  • Quantization parameter decoding method and device

    CN114598873A

  • Image processing apparatus, and control method, and program therefor

    JP2018182484A