Chroma quantization parameter offset value determination method and coding method

By obtaining the single-frame image and current frame chromaticity quantization parameters of the HDR video, calculating the chromaticity quantization parameter offset value and adjusting it according to the frame type, the problem that the chromaticity quantization parameter offset value cannot be flexibly adjusted in HDR video encoding is solved, thereby improving encoding efficiency and visual quality.

CN120769044APending Publication Date: 2025-10-10MALANSHAN AUDIO & VIDEO LABORATORY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510986154.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-17
Publication Date
2025-10-10

AI Technical Summary

Technical Problem

In existing HDR video encoding, the chroma quantization parameter offset value cannot be flexibly adjusted, resulting in poor encoding effect and inability to adapt to differences in human eye perception and uneven content complexity.

Method used

By obtaining the single-frame image and current frame chromaticity quantization parameters of the HDR video, calculating the original chromaticity quantization parameter offset value, and determining the offset range according to the frame type, the chromaticity quantization parameters are dynamically adjusted in combination with time domain filtering and complexity estimation to generate a coded stream that meets the coding standard.

Benefits of technology

It realizes dynamic and scene-by-scene adaptive adjustment of color quantization parameters in HDR video encoding, improves encoding efficiency and visual quality, and avoids over-compression or resource waste caused by fixed offset.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120769044A_ABST
    Figure CN120769044A_ABST
Patent Text Reader

Abstract

The invention discloses a chromaticity quantization parameter offset value determination method and a coding method, which are applied to the technical field of video coding and comprise the following steps: acquiring a single-frame picture of an HDR video and a chromaticity quantization parameter of a current frame; calculating based on the chroma quantization parameter of the current frame to obtain an original chroma quantization parameter offset value; determining the frame type of the single-frame picture, and determining an offset range according to the frame type; and calculating to obtain a chroma quantization parameter offset value based on the original quantization parameter offset value and the offset range. The chroma quantization parameter offset value is calculated according to the frame type of the picture and the current coding state (namely, the chroma quantization parameter of the current frame). Therefore, aiming at the HDR characteristics, the method can dynamically and adaptively adjust the color quantization parameters according to scenes, so that the volume and the image quality of the coded file are more balanced, and the problem that the traditional fixed offset is poor in HDR adaptation is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of video coding, and in particular to a method for determining a chrominance quantization parameter offset value and a coding method. Background Art

[0002] In the AVS3 video coding standard, perceptual quantization (PQ) is typically used for encoding high dynamic range (HDR) video. A method for adjusting the chroma quantization parameter (QP) is currently available. However, due to the simple design of the baseline parameter, the chroma quantization parameter offset cannot be flexibly adjusted to changes in the baseline parameter when calculating the offset value, resulting in poor performance. In traditional video coding, chroma components typically use fixed chroma quantization parameter offsets. This method is not suitable for HDR video because human perception varies, image complexity varies, and different frame requirements vary. Therefore, a fixed chroma quantization offset relationship leads to poor encoding performance.

[0003] Therefore, how to improve the visual quality of HDR video encoding is a technical problem that needs to be solved urgently. Summary of the Invention

[0004] In view of this, the object of the present invention is to provide a method for determining a chrominance quantization parameter offset value and an encoding method, apparatus, device and storage medium, which solve the problem of poor visual quality of HDR video encoding in the prior art.

[0005] To solve the above technical problems, the present invention provides a method for determining a colorimetric quantization parameter offset value, comprising:

[0006] Get a single frame of HDR video and the chroma quantization parameters of the current frame;

[0007] Calculating based on the current frame chromaticity quantization parameter to obtain an original chromaticity quantization parameter offset value;

[0008] Determining a frame type of the single frame, and determining an offset range according to the frame type;

[0009] A chrominance quantization parameter offset value is calculated based on the original quantization parameter offset value and the offset range.

[0010] Optionally, performing calculation based on the current frame chroma quantization parameter to obtain an original chroma quantization parameter offset value includes:

[0011] The original chromaticity quantization parameter offset value is obtained by calculating the original chromaticity quantization parameter offset value according to the original chromaticity quantization parameter offset value calculation formula and the current frame chromaticity quantization parameter;

[0012] The original chroma quantization parameter offset value calculation formula is raw_chroma_qp_offset=a*current_qp+b; current_qp is the current frame chroma quantization parameter; a is a quantization coefficient; b is a reference offset; and raw_chroma_qp_offset is the original chroma quantization parameter offset value.

[0013] Optionally, the frame type of the single frame picture is determined, and the offset range is determined according to the frame type, including:

[0014] If the frame type of the single frame picture is an I frame, the offset range is a first offset range.

[0015] If the frame type of the single frame picture is a non-I frame, the offset range is a second offset range.

[0016] The second offset range is greater than the first offset range.

[0017] Optionally, the chroma quantization parameter offset value is calculated based on the original quantization parameter offset value and the offset range, including:

[0018] The chroma quantization parameter offset value is determined based on the first offset range and the original chroma quantization parameter offset value; and the chroma quantization parameter offset value includes a Cb offset value and a Cr offset value.

[0019] The initial chroma quantization parameter offset value is determined based on the second offset range and the original chroma quantization parameter offset value, and the chroma quantization parameter offset value is calculated according to the initial chroma quantization parameter offset value and a chroma offset parameter scaling factor.

[0020] Optionally, before the initial chroma quantization parameter offset value is determined based on the second offset range and the original chroma quantization parameter offset value, and the chroma quantization parameter offset value is calculated according to the initial chroma quantization parameter offset value and a chroma offset parameter scaling factor, the method further includes:

[0021] The single frame picture is subjected to time domain filtering processing to remove time domain noise.

[0022] The single frame picture subjected to the time domain filtering processing is subjected to complexity estimation to obtain complexity related information of a luminance component and a chroma component.

[0023] The complexity related information is used to calculate a luminance component complexity value, a Cb component complexity value, a Cr component complexity value, and a total complexity value, respectively.

[0024] The chroma offset parameter scaling factor is calculated based on the total complexity value, the complexity value of the luminance component, the complexity value of the Cb component, and the complexity value of the Cr component; the chroma offset parameter scaling factor includes the chroma scaling factors of the Cb component and the Cr component.

[0025] The present invention also provides an encoding method, comprising:

[0026] Obtaining a brightness quantization parameter of the single frame and using it as a basic reference value;

[0027] Obtaining a colorimetric quantization parameter offset value obtained by using the above-mentioned colorimetric quantization parameter offset value determination method;

[0028] Calculate the chromaticity quantization parameter according to the basic reference value and the chromaticity quantization parameter offset value;

[0029] The chroma quantization parameters are input into a chroma residual quantization unit of an encoder, so that the encoder controls the compression degree of the chroma residual according to the chroma quantization parameters and generates a coding stream that complies with a coding standard.

[0030] The present invention also provides a device for determining a chromaticity quantization parameter offset value, comprising:

[0031] The acquisition module is used to obtain a single frame of HDR video and the chromaticity quantization parameters of the current frame;

[0032] an original chromaticity quantization parameter offset value obtaining module, configured to calculate based on the current frame chromaticity quantization parameter to obtain an original chromaticity quantization parameter offset value;

[0033] an offset range determining module, configured to determine a frame type of the single frame and determine an offset range according to the frame type;

[0034] The chrominance quantization parameter offset value determining module is configured to calculate a chrominance quantization parameter offset value based on the original quantization parameter offset value and the offset range.

[0035] The present invention also provides an encoding device, comprising:

[0036] A brightness quantization parameter acquisition module, configured to acquire the brightness quantization parameter of the single frame and use it as a basic reference value;

[0037] A chromaticity quantization parameter offset value obtaining module, configured to obtain a chromaticity quantization parameter offset value obtained by using the above-mentioned chromaticity quantization parameter offset value determining method;

[0038] a chromaticity quantization parameter acquisition module, configured to calculate the chromaticity quantization parameter according to the basic reference value and the chromaticity quantization parameter offset value;

[0039] The encoding module is used to pass the chroma quantization parameters to the chroma residual quantization unit of the encoder, so that the encoder controls the compression degree of the chroma residual according to the chroma quantization parameters and generates a coded stream that meets the coding standard.

[0040] The present invention also provides an electronic device, comprising:

[0041] memory for storing computer programs;

[0042] The processor is configured to implement the steps of the above-mentioned method for determining a chrominance quantization parameter offset value and / or encoding method when executing the computer program.

[0043] The present invention also provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are loaded and executed by a processor, the steps of the above-mentioned colorimetric quantization parameter offset value determination method and / or encoding method are implemented.

[0044] As can be seen, the present invention obtains a single frame of HDR video and the chromaticity quantization parameters of the current frame; calculates the original chromaticity quantization parameter offset value based on the chromaticity quantization parameters of the current frame; determines the frame type of the single frame and determines the offset range based on the frame type; and calculates the chromaticity quantization parameter offset value based on the original quantization parameter offset value and the offset range. The present invention calculates the chromaticity quantization parameter offset value based on the frame type and the current encoding state (i.e., the chromaticity quantization parameters of the current frame). In response to the characteristics of HDR, this method can dynamically, scene-by-scene, and adaptively adjust the color quantization parameters, achieving a better balance between file size and image quality after encoding, and resolving the problem that traditional fixed offsets are not well adapted to HDR.

[0045] In addition, the present invention also provides an encoding method, a chrominance quantization parameter offset value determination device, an encoding device, an electronic device, and a computer-readable storage medium, which also have the above-mentioned beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0047] Figure 1 A flowchart of a method for determining a colorimetric quantization parameter offset value provided by an embodiment of the present invention;

[0048] Figure 2 An example diagram of a frame type differentiation processing flow provided by an embodiment of the present invention;

[0049] Figure 3 An example diagram of a process for determining a chroma scaling factor provided by an embodiment of the present invention;

[0050] Figure 4 A flowchart of an encoding method provided by an embodiment of the present invention;

[0051] Figure 5 An example flow chart of a method for determining a colorimetric quantization parameter offset value provided by an embodiment of the present invention;

[0052] Figure 6 A schematic structural diagram of a device for determining a colorimetric quantization parameter offset value provided by an embodiment of the present invention;

[0053] Figure 7 A schematic structural diagram of an encoding device provided by an embodiment of the present invention;

[0054] Figure 8 A schematic structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

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

[0056] In the AVS3 video coding standard, high dynamic range content is typically encoded using a perceptual quantizer. Existing chroma quantization methods, such as the adaptive chroma quantization parameter calculation method described in the AVS M6621 proposal, aim to reduce banding artifacts and improve overall coding efficiency by adjusting chroma. However, comparative analysis shows that the AVS3 reference software (HPM15.7) significantly lags behind other standards, such as H.266 and H.265, in the performance of chroma components. For example, in key metrics such as PSNRYUV, wPSNRYUV, PSNRL100, and DE100, HPM15.7's performance is approximately 4.75%, 10.3%, and 25.35% lower than H.266, respectively. Although HPM15.7 slightly outperforms H.266 in the luma component, its weaker chroma performance leads to poor overall HDR performance. Therefore, further optimization of chroma quantization methods is needed to achieve a smoother rate-distortion curve and higher coding efficiency. After analysis, it was found that a major reason for this problem is that HPM uses the adaptive calculation method of chroma parameters for PQ (perceptual quantizer) signals in the AVS M6621 proposal. This method oversimplifies the modeling of the base QP when calculating the chroma quantization parameter offset, making it impossible for the chroma quantization parameter offset of the chroma component to dynamically track the changes in the base QP. In addition, in traditional video coding, the luminance and chroma components usually use a fixed quantization parameter offset relationship. However, due to the following characteristics of HDR, the coding effect of the fixed chroma quantization parameter offset is poor. (1) Visual perception difference: HDR content has a wider dynamic range, and the human eye's perception of chroma information in HDR content is significantly different from that of standard dynamic range (SDR) content. The fixed adjustment method does not conform to the actual perception of the human eye; (2) Complex complexity characteristics: The complexity distribution of HDR content is uneven across different chroma components; (3) Coding efficiency issues: The fixed chroma QP offset cannot adapt to the complex characteristics of HDR content, resulting in low coding efficiency or reduced visual quality; (4) Frame type differences: Different frame types have different sensitivities to chroma quantization and need to be treated differently.

[0057] In response to the above problems, the present invention aims to solve the problem of unreasonable setting of chrominance quantization parameters in HDR video encoding in the prior art, and provide a method for determining adaptive chrominance quantization parameter offset values ​​based on HDR content characteristics, thereby improving the visual quality of HDR video encoding, optimizing encoding efficiency, and adaptively adjusting quantization parameters.

[0058] Please refer to Figure 1 , Figure 1 A flowchart of a method for determining a colorimetric quantization parameter offset value provided by an embodiment of the present invention. The method may include:

[0059] S101: Obtain a single frame of an HDR video and chromaticity quantization parameters of the current frame.

[0060] This embodiment is implemented by a terminal. This embodiment does not limit the type of terminal; any terminal capable of performing the method for determining a chromaticity quantization parameter offset value is acceptable. This method can be applied to the following scenarios: When using a perceptual quantizer (PQ) for high dynamic range (HDR) video encoding in the AVS3 video standard, the calculated chromaticity quantization parameter offset value is used to optimize chromaticity quantization.

[0061] The object of this embodiment is HDR video, and a single frame of the current frame and the corresponding chroma quantization parameters of the current frame are obtained. For example, in the AVS3 standard, the chroma quantization parameters of the current frame can be obtained by parsing the syntax elements in the bitstream.

[0062] S102: Calculate based on the chroma quantization parameter of the current frame to obtain an original chroma quantization parameter offset value.

[0063] This step can refer to the following calculation formula, based on the current frame chromaticity quantization parameters to calculate the original chromaticity quantization parameter offset value. The calculation formula for the original chromaticity quantization parameter offset value is:

[0064] raw_chroma_qp_offset=a×current_qp+b;

[0065] current_qp is the chroma quantization parameter of the current frame; a is the quantization coefficient; b is the reference offset; raw_chroma_qp_offset is the original chroma quantization parameter offset value.

[0066] As can be seen from the above calculation formula, the calculation formula takes into account: (1) linear attenuation characteristics: the quantization coefficient a can be -0.613, and the quantization coefficient a ensures that the chroma offset gradually decreases as the QP increases; (2) reference offset: b is the reference offset, and b can be 12.347. Furthermore, optimization rounding can be added. For example, the above calculation formula can be specifically:

[0067] raw_chroma_qp_offset=-0.613×current_qp+12.347-0.5.

[0068] S103: Determine the frame type of the single frame, and determine the offset range according to the frame type.

[0069] The frame types in this embodiment may include I-type frames that do not require reference to other frames and non-I-type frames that rely on reference frames, and different calculation methods are adopted for I-type frames and non-I-type frames. Exemplarily, this embodiment can be based on the degree of change in picture content and the necessity of encoding. For example: calculate the content similarity between the single-frame picture of the current frame and the previous frame picture; if the content similarity is less than a preset threshold, the single-frame picture is an I-frame; if the content similarity is greater than or equal to the preset threshold, the frame type is determined based on the content complexity and the encoding scene characteristics; if the content complexity meets the preset requirements or the HDR metadata is updated, the single-frame picture is I-type; if the content complexity does not meet the preset requirements, the single-frame picture is non-I-type. That is to say, the content similarity between the current frame and the previous frame is first calculated (such as through SSIM or histogram distance). If the similarity is lower than the preset threshold (indicating a drastic change in content, such as a shot switch or a scene mutation), it is determined to be an I-type frame. If the similarity is high, the content complexity and the encoding scene characteristics are combined to make a judgment. If the picture is rich in details (high complexity), there is a sudden change in brightness or the HDR metadata is updated, it is also determined to be an I-type frame. In other cases (stable content, can be predicted by referring to other frames), it is classified as a non-I-type frame (P / B type).

[0070] Furthermore, the above-mentioned determination of the frame type of the single-frame picture and determination of the offset range according to the frame type may specifically include: if the frame type of the single-frame picture is an I frame, the offset range is a first offset range; if the frame type of the single-frame picture is non-I frame, the offset range is a second offset range; the second offset range is greater than the first offset range.

[0071] Specifically, you can refer to Figure 2 , Figure 2 This figure illustrates an example flow chart for differentiating frame types according to an embodiment of the present invention. For I-frames, the first offset range can be set to [-6, 0], and the final offset range can be set to [-6, 6]. For non-I-frames (P-frames / B-frames), the second offset range can be set to [-12, 0], and the final offset range can be set to [-12, 12].

[0072] S104: Calculate a chrominance quantization parameter offset value based on the original quantization parameter offset value and the offset range.

[0073] Furthermore, the above-mentioned calculation based on the original quantization parameter offset value and the offset range to obtain the chroma quantization parameter offset value may specifically include: determining the chroma quantization parameter offset value based on the first offset range and the original chroma quantization parameter offset value; the chroma quantization parameter offset value includes a Cb offset value and a Cr offset value; determining an initial chroma quantization parameter offset value based on the second offset range and the original chroma quantization parameter offset value, and calculating the chroma quantization parameter offset value based on the initial chroma quantization parameter offset value and the chroma offset parameter scaling factor.

[0074] Similarly, you can also refer to Figure 2 . For I frame type, the original chromaticity quantization parameter offset value is limited and adjusted based on the first offset range, and the adjusted offset value is used as the final chromaticity quantization parameter offset value. For non-I frame type, the original chromaticity quantization parameter offset value is limited and adjusted based on the second offset unit, and the adjusted offset value is further processed using the chromaticity scaling factor to obtain the chromaticity quantization parameter offset value. Taking the above-set offset range as an example, the specific limited adjustment process is as follows: If it is an I frame type, the original chromaticity quantization parameter offset value is 10, and the offset value is not within the first offset range, then it needs to be adjusted, and the adjusted offset value is 6. The offset value is within the final offset range, so the final offset value is 6; if it is a non-I frame type, the original chromaticity quantization parameter offset value is 10, and the offset value is within the second offset range, then it does not need to be adjusted. After directly processing the chromaticity scaling factor, the processed offset value is 15. The offset value is not within the final offset range and needs to be adjusted. The final offset value is 12.

[0075] Furthermore, before determining the initial chromaticity quantization parameter offset value based on the second offset range and the original chromaticity quantization parameter offset value, and calculating the chromaticity quantization parameter offset value based on the initial chromaticity quantization parameter offset value and the chromaticity offset parameter scaling factor, it can also include: performing time domain filtering on the single frame to remove time domain noise; performing complexity estimation on the single frame after time domain filtering to obtain complexity related information of the luminance component and the chromaticity component; calculating the complexity value of the luminance component, the complexity value of the Cb component, the complexity value of the Cr component and the total complexity value based on the complexity related information; calculating the chromaticity offset parameter scaling factor based on the total complexity value, the complexity value of the luminance component, the complexity value of the Cb component and the complexity value of the Cr component; the chromaticity offset parameter scaling factor includes the chromaticity scaling factors of the Cb component and the Cr component.

[0076] Specifically, refer to Figure 3 , Figure 3 This is an example flow chart of a method for determining a chroma scaling factor according to an embodiment of the present invention. The calculation process of the chroma scaling factor includes:

[0077] (1) Temporal filtering stage: This stage aims to remove temporal noise (such as inter-frame jitter and flicker) in the video sequence to reduce interference with subsequent complexity analysis. Specifically, this stage can be achieved by pre-processing the difference between the current frame and the reference frame through inter-frame filtering (such as motion compensation filtering and temporal smoothing) to obtain more stable luminance and chrominance signals.

[0078] (2) Complexity estimation: This stage aims to evaluate the "information complexity" (i.e., the richness of details and their impact on visual quality) of the luminance (Y) and chrominance (Cb, Cr) components. Common metrics include pixel gradient, texture variance, and motion activity (for example, high-gradient regions indicate rich details and high complexity).

[0079] (3) Calculate the complexity s of each component. Based on the above complexity estimation results, this stage outputs the following: the complexity value s_Y of the luminance component; the complexity value s_Cb of the Cb component; and the complexity value s_Cr of the Cr component. The larger the value, the richer the detail of the component, and the more quantization resources are required (i.e., the compression caused by the QP offset should be reduced).

[0080] (4) Calculate the total complexity (total_noise). The specific formula is: total_noise = s_Y + s_Cb + s_Cr. Its purpose is to normalize the complexity of luminance and chrominance to the same scale, which will serve as the denominator (total weight) for subsequent "resource allocation".

[0081] (5) Calculate the chroma scaling factor chroma_qp_scale stage. The specific formula is: chroma_qp_scale[i]=1.0-s_chroma[i] / total_noise (i represents Cb or Cr component). Among them, s_chroma[i] / total_noise represents the ratio of the complexity of the current chroma component to the total complexity. The larger the value, the more difficult the chroma component is to encode. The chroma quantization intensity should be increased, the QP should be increased, the offset amplitude should be reduced, and a smaller scaling factor should be used. The scaling factor is finally expressed as follows: if the chroma complexity is high (s_chroma[i] is large) → chroma_qp_scale is less than 1.0 (small offset amplitude, enhanced compression); if the chroma complexity is low (s_chroma[i] is small) → chroma_qp_scale is close to 1.0 (large offset amplitude, retaining more details).

[0082] (6) Chroma scaling factor applied to the chroma QP offset stage: Applied to non-I frames. Chroma quantization parameter offset value = initial chroma quantization parameter offset value × scaling factor (chroma_qp_scale).

[0083] The method for determining a chroma quantization parameter offset value provided by an embodiment of the present invention obtains a single frame of HDR video and the chroma quantization parameters of the current frame; calculates the original chroma quantization parameter offset value based on the chroma quantization parameters of the current frame; determines the frame type of the single frame and determines the offset range based on the frame type; and calculates the chroma quantization parameter offset value based on the original quantization parameter offset value and the offset range. The present invention calculates the chroma quantization parameter offset value based on the frame type and the current encoding state (i.e., the chroma quantization parameters of the current frame). This method dynamically and adaptively adjusts the color quantization parameters based on the HDR characteristics, achieving a better balance between encoded file size and image quality, and addressing the problem of traditional fixed offsets being poorly adapted to HDR. Furthermore, by purifying the signal through temporal filtering, evaluating the visual importance (complexity) of each component, and dynamically adjusting the chroma quantization intensity based on the overall complexity ratio, the method achieves "less compression of high-complexity chroma components and more compression of low-complexity components," achieving a balance between coding efficiency and image quality. It is particularly suitable for HDR video (under high dynamic range, the visual sensitivity of color details varies more), and can avoid local over-compression or resource waste caused by fixed offset.

[0084] Please refer to Figure 4 , Figure 4 A flowchart of an encoding method provided by an embodiment of the present invention. The method may include:

[0085] S201: Obtaining a brightness quantization parameter of a single frame and using it as a basic reference value;

[0086] S202: Obtaining a chromaticity quantization parameter offset value obtained by using the above-mentioned chromaticity quantization parameter offset value determination method;

[0087] S203: Calculate the chromaticity quantization parameter according to the basic reference value and the chromaticity quantization parameter offset value;

[0088] S204: The chroma quantization parameter is passed to the chroma residual quantization unit of the encoder, so that the encoder controls the compression degree of the chroma residual according to the chroma quantization parameter to generate a coded stream that meets the coding standard.

[0089] In video coding (such as AVS3 coding), quantization is a key step in determining compression efficiency and image quality, and the setting of chroma quantization parameters (QP_Cb, QP_Cr) directly affects the quantization accuracy of chroma components. The above process of passing the calculated QP_Cb and QP_Cr to the chroma residual quantization unit, replacing the default offset value and controlling the quantization of the residual coefficient is essentially the specific operation of the "quantization stage" in the coding process: by adjusting the chroma quantization parameters, the compression degree of the chroma residual is controlled, and finally a bitstream that meets the coding standard is generated. Therefore, it is part of the coding process. In the coding process, the core logic of applying the calculated chroma quantization parameter offset value to the coding is: taking the luminance quantization parameter (QP_Y) as the reference, the final quantization parameters of the chroma components (Cb, Cr) are obtained by adjusting the chroma quantization parameter offset value, and then passed to the quantization module of the encoder to guide the quantization process of the chroma residual. The specific application method is as follows: (1) Determine the base luminance QP: Obtain the luminance quantization parameter QP_Y from the coding parameters of the current frame (such as the Slice header) as the basic reference value. (2) Calculate chroma QP: According to the formula of AVS3 standard, combined with the calculated chroma quantization parameter offset value, calculate the quantization parameters of Cb and Cr components respectively:

[0090] QP_Cb=QP_Y+chroma_qp_offset_cb (offset value of Cb component);

[0091] QP_Cr=QP_Y+chroma_qp_offset_cr (offset value of Cr component);

[0092] The offset value can be positive or negative. A positive value indicates coarser quantization of the color (stronger compression), while a negative value indicates finer quantization (retaining more details).

[0093] (3) Transfer to the quantization module: The calculated QP_Cb and QP_Cr are passed to the chroma residual quantization unit of the encoder to replace the default offset value, control the quantization process of the residual coefficient of the chroma component after transformation, and ultimately affect the compression accuracy and reconstruction quality of the encoded chroma information. For example, in an HDR scene, if the calculated Cb component needs to retain more details (such as high saturation areas), chroma_qp_offset_cb can be set to -2. At this time, QP_Cb=QP_Y-2, the chroma quantization is lighter, and the details are more fully preserved.

[0094] The method for determining the chroma quantization parameter offset value provided in an embodiment of the present invention is applied, through S201: obtaining the luminance quantization parameter of a single frame and using it as a basic reference value; S202: obtaining the chroma quantization parameter offset value obtained using the above-mentioned method for determining the chroma quantization parameter offset value; S203: calculating the chroma quantization parameter based on the basic reference value and the chroma quantization parameter offset value; S204: transmitting the chroma quantization parameter to the chroma residual quantization unit of the encoder, so that the encoder controls the degree of compression of the chroma residual according to the chroma quantization parameter and generates a coded stream that meets the coding standard. It can be seen that, in response to HDR characteristics, this method can dynamically, scene-by-scene, and adaptively adjust the color quantization parameter, so that the file size and image quality after encoding are more balanced, and solve the problem that traditional fixed offsets are not well adapted to HDR.

[0095] In order to make the present invention easier to understand, please refer to Figure 5 , Figure 5 The flowchart of the method for determining the colorimetric quantization parameter offset value provided in the embodiment of the present invention may specifically include:

[0096] An HDR video frame is input and the HDR chroma QP offset switch is checked to see if it is on. If it is off, the traditional QP offset method is used to output the final chroma QP offset value. If it is on, the chroma QP of the current frame is obtained and the original chroma QP offset value is calculated. The frame type is determined: if it is a non-I frame, an extended range offset is applied, and the Cb component QP offset value and Cr component QP offset value are calculated based on the extended range offset and the original chroma QP offset value. The chroma QP offset factor is further applied to output the final chroma QP offset value. If it is an I frame, a restricted range offset is applied, and the Cb component QP offset value and Cr component QP offset value are calculated based on the restricted range offset and the original chroma QP offset value, and the final chroma QP offset value is output. It can be seen that the present invention dynamically adjusts according to content characteristics to avoid over-quantization or under-quantization, and is adaptive. It also adopts differentiated strategies for the different characteristics of I frames and P / B frames. The scaling factor based on complexity analysis improves encoding accuracy. It also has compatibility and can be controlled by the switch to maintain backward compatibility.

[0097] The test results of the method are compared with the test results of the high performance model v15.8, and the comparison results are shown in Table 1. wPsnrY is a weighted peak signal-to-noise ratio (luminance component); wPsnrU is a weighted peak signal-to-noise ratio (U chrominance component, generally referring to a blue difference component); wPsnrV is a weighted peak signal-to-noise ratio (V chrominance component, generally referring to a red difference component); wPsnrYUV is a weighted peak signal-to-noise ratio (YUV as a whole, that is, luminance and two chrominance components are integrated); PsnrY is a peak signal-to-noise ratio (luminance component); PsnrU is a peak signal-to-noise ratio (U chrominance component); PsnrV is a peak signal-to-noise ratio (V chrominance component); PsnrYUV is a peak signal-to-noise ratio (YUV as a whole). The left side Life-Untouched, Meridian, Sol-Levante, Cosmos, Elevator and Nocturne represent each test sequence.

[0098] Table 1: Comparison of results

[0099]

[0100] The values in Table 1 represent the ratio of the change amount of the code rate required to achieve the same evaluation index (wPsnr or Psnr) corresponding quality (that is, the change rate), and the smaller the value, the less code rate is required to achieve the same quality. Therefore, the smaller the value, the higher the benefit. As known from the table, the method can obtain a code rate saving of 0.95% (performance benefit) on the AVS3 standard reference encoder.

[0101] The chroma quantization parameter offset value determination device provided in the embodiments of the present application is described below. The chroma quantization parameter offset value determination device described below can be correspondingly referred to the chroma quantization parameter offset value determination method described above.

[0102] For details, please refer to Figure 6 , Figure 6 A structure diagram of a chroma quantization parameter offset value determination device provided in the embodiments of the present application can include:

[0103] The acquisition module 100 is configured to acquire a single frame picture of an HDR video and a current frame chroma quantization parameter.

[0104] The original chroma quantization parameter offset value acquisition module 200 is configured to calculate based on the current frame chroma quantization parameter to obtain an original chroma quantization parameter offset value.

[0105] The offset range determination module 300 is configured to determine a frame type of the single frame picture, and determine an offset range according to the frame type.

[0106] The chrominance quantization parameter offset value determining module 400 is configured to calculate a chrominance quantization parameter offset value based on the original quantization parameter offset value and the offset range.

[0107] Based on the above embodiment, the original chromaticity quantization parameter offset value acquisition module 200 may include:

[0108] A calculation unit is used to calculate the original chroma quantization parameter offset value according to the original chroma quantization parameter offset value calculation formula and the current frame chroma quantization parameter; wherein the original chroma quantization parameter offset value calculation formula is: raw_chroma_qp_offset=a×current_qp+b; current_qp is the current frame chroma quantization parameter; a is the quantization coefficient; b is the reference offset; raw_chroma_qp_offset is the original chroma quantization parameter offset value.

[0109] Based on the above embodiment, the offset range determination module 300 may include:

[0110] a first determining unit, configured to, if the frame type of the single frame is an I frame, set the offset range to a first offset range;

[0111] The second determining unit is configured to determine that, if the frame type of the single-frame picture is non-I frame, the offset range is a second offset range; and the second offset range is greater than the first offset range.

[0112] Based on the above embodiment, the chromaticity quantization parameter offset value determination module 400 may include:

[0113] a first calculating unit, configured to determine the chromaticity quantization parameter offset value based on the first offset range and the original chromaticity quantization parameter offset value; the chromaticity quantization parameter offset value includes a Cb offset value and a Cr offset value;

[0114] The second calculation unit is configured to determine an initial chromaticity quantization parameter offset value based on the second offset range and the original chromaticity quantization parameter offset value, and calculate the chromaticity quantization parameter offset value according to the initial chromaticity quantization parameter offset value and a chromaticity offset parameter scaling factor.

[0115] Based on the above embodiment, the device for determining a chromaticity quantization parameter offset value may further include:

[0116] A filtering processing unit, configured to perform time-domain filtering on the single frame to remove time-domain noise;

[0117] The complexity estimation unit is used to perform complexity estimation on a single frame after time domain filtering to obtain complexity related information of the luminance component and the chrominance component;

[0118] a complexity value calculation unit, configured to calculate the complexity value of the luminance component, the complexity value of the Cb component, the complexity value of the Cr component, and the total complexity value, respectively, based on the complexity-related information;

[0119] A chroma offset parameter scaling factor calculation unit is used to calculate the chroma offset parameter scaling factor based on the total complexity value, the complexity value of the luminance component, the complexity value of the Cb component and the complexity value of the Cr component; the chroma offset parameter scaling factor includes the chroma scaling factors of the Cb component and the Cr component.

[0120] It should be noted that the order of the modules and units in the above-mentioned device for determining the chromaticity quantization parameter offset value can be changed without affecting the logic.

[0121] The chroma quantization parameter offset value determination device provided by an embodiment of the present invention includes an acquisition module 100 for acquiring a single frame of HDR video and the chroma quantization parameters of the current frame; an original chroma quantization parameter offset value acquisition module 200 for calculating an original chroma quantization parameter offset value based on the chroma quantization parameters of the current frame; an offset range determination module 300 for determining the frame type of the single frame and determining an offset range based on the frame type; and a chroma quantization parameter offset value determination module 400 for calculating a chroma quantization parameter offset value based on the original quantization parameter offset value and the offset range. The present invention calculates the chroma quantization parameter offset value based on the frame type and the current encoding state (i.e., the chroma quantization parameters of the current frame). This method dynamically, scene-by-scene, and adaptively adjusts the color quantization parameters to achieve a better balance between encoded file size and image quality, addressing the issue that traditional fixed offset methods are not well-suited for HDR.

[0122] The following is an introduction to the encoding device provided by the embodiment of the present invention. The encoding device described below and the encoding method described above can be referenced to each other.

[0123] Please refer to Figure 7 , Figure 7 A schematic structural diagram of an encoding device provided in an embodiment of the present invention may include:

[0124] A luminance quantization parameter acquisition module 500 is used to acquire the luminance quantization parameter of the single frame and use it as a basic reference value;

[0125] The chromaticity quantization parameter offset value obtaining module 600 is used to obtain the chromaticity quantization parameter offset value obtained by using the above-mentioned chromaticity quantization parameter offset value determination method;

[0126] A chromaticity quantization parameter acquisition module 700 is configured to calculate a chromaticity quantization parameter according to the basic reference value and the chromaticity quantization parameter offset value;

[0127] The encoding module 800 is configured to pass the chroma quantization parameters to a chroma residual quantization unit of an encoder, so that the encoder controls the compression degree of the chroma residual according to the chroma quantization parameters and generates an encoded stream that complies with an encoding standard.

[0128] It should be noted that the order of the modules and units in the above encoding device can be changed without affecting the logic.

[0129] The encoding device provided by an embodiment of the present invention includes a luma quantization parameter acquisition module 500 for acquiring the luma quantization parameter of a single frame and using it as a base reference value. A chroma quantization parameter offset acquisition module 600 is used to acquire a chroma quantization parameter offset value obtained using the chroma quantization parameter offset determination method described above. A chroma quantization parameter acquisition module 700 is used to calculate a chroma quantization parameter based on the base reference value and the chroma quantization parameter offset value. An encoding module 800 is used to transmit the chroma quantization parameter to the chroma residual quantization unit of the encoder, so that the encoder controls the degree of chroma residual compression based on the chroma quantization parameter and generates a coded stream that complies with the coding standard. This device calculates the chroma quantization parameter offset value based on the frame type and the current encoding state (i.e., the current frame chroma quantization parameter). This device can dynamically, scene-by-scene, and adaptively adjust the color quantization parameter to better balance the size and image quality of the encoded file, resolving the problem that traditional fixed offsets are not well-suited for HDR.

[0130] The electronic device provided by an embodiment of the present invention is introduced below. The electronic device described below and the colorimetric quantization parameter offset value determination method and / or encoding method described above can refer to each other.

[0131] Please refer to Figure 8 , Figure 8 A schematic structural diagram of an electronic device provided in an embodiment of the present invention may include:

[0132] Memory 10, for storing computer programs;

[0133] The processor 20 is configured to execute a computer program to implement the above-mentioned method for determining a chrominance quantization parameter offset value and / or encoding method.

[0134] The memory 10 , the processor 20 , and the communication interface 31 all communicate with each other via the communication bus 32 .

[0135] In the embodiment of the present invention, the memory 10 is used to store one or more programs. The program may include program code, and the program code includes computer operation instructions. In the embodiment of the present invention, the memory 10 may store programs for implementing the following functions:

[0136] Get a single frame of HDR video and the chroma quantization parameters of the current frame;

[0137] Calculate the original chromaticity quantization parameter offset value based on the current frame chromaticity quantization parameter;

[0138] Determine the frame type of a single frame, and determine the offset range according to the frame type;

[0139] The chrominance quantization parameter offset value is calculated based on the original quantization parameter offset value and the offset range;

[0140] and / or;

[0141] Obtain the brightness quantization parameter of a single frame and use it as a basic reference value;

[0142] Obtaining a colorimetric quantization parameter offset value obtained by using the above-mentioned colorimetric quantization parameter offset value determination method;

[0143] The chromaticity quantization parameter is calculated according to the basic reference value and the chromaticity quantization parameter offset value;

[0144] The chroma quantization parameters are passed to the chroma residual quantization unit of the encoder, so that the encoder controls the compression degree of the chroma residual according to the chroma quantization parameters and generates a coded stream that meets the coding standard.

[0145] In one possible implementation, the memory 10 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and applications required for at least one function, etc.; the data storage area may store data created during use.

[0146] In addition, the memory 10 may include a read-only memory and a random access memory, and provides instructions and data to the processor. A portion of the memory may also include NVRAM. The memory stores an operating system and operating instructions, executable modules or data structures, or a subset or an extended set thereof. The operating instructions may include various operating instructions for implementing various operations. The operating system may include various system programs for implementing various basic tasks and processing hardware-based tasks.

[0147] The processor 20 may be a central processing unit (CPU), an application-specific integrated circuit, a digital signal processor, a field programmable gate array, or other programmable logic device. The processor 20 may be a microprocessor or any conventional processor. The processor 20 may call a program stored in the memory 10 .

[0148] The communication interface 31 may be an interface of a communication module, used for connecting to other devices or systems.

[0149] Of course, it needs to be explained that Figure 8 The structure shown does not constitute a limitation on the electronic device in the embodiment of the present invention. In actual applications, the electronic device may include Figure 8 More or fewer components than shown, or combinations of certain components.

[0150] The computer-readable storage medium provided by an embodiment of the present invention is introduced below. The computer-readable storage medium described below and the colorimetric quantization parameter offset value determination method and / or encoding method described above may refer to each other.

[0151] The present invention also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the computer program implements the steps of the above-mentioned colorimetric quantization parameter offset value determination method and / or encoding method.

[0152] The computer-readable storage medium may include: 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, etc., which can store program codes.

[0153] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from the other embodiments. Reference can be made to the descriptions of the identical or similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple, and the relevant parts can be referred to the descriptions of the methods.

[0154] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0155] Finally, it should be noted that, in this document, relationships such as first and second, etc., are used solely to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.

[0156] The above describes in detail a method for determining a chromaticity quantization parameter offset value, an encoding method, a chromaticity quantization parameter offset value determination device, an encoding device, an electronic device, and a computer-readable storage medium provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the ideas of the present invention, there may be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. A method for determining a colorimetric quantization parameter offset value, characterized in that: include: Get a single frame of HDR video and the chroma quantization parameters of the current frame; Calculating based on the current frame chromaticity quantization parameter to obtain an original chromaticity quantization parameter offset value; Determining a frame type of the single frame, and determining an offset range according to the frame type; A chrominance quantization parameter offset value is calculated based on the original quantization parameter offset value and the offset range.

2. The method for determining a colorimetric quantization parameter offset value according to claim 1, wherein: Calculating based on the current frame chromaticity quantization parameter to obtain an original chromaticity quantization parameter offset value includes: The original chromaticity quantization parameter offset value is obtained by calculating the original chromaticity quantization parameter offset value according to the original chromaticity quantization parameter offset value calculation formula and the current frame chromaticity quantization parameter; The calculation formula of the original chroma quantization parameter offset value is: raw_chroma_qp_offset = a×current_qp+b; current_qp is the current frame chroma quantization parameter; a is the quantization coefficient; b is the reference offset; raw_chroma_qp_offset is the original chroma quantization parameter offset value.

3. The method for determining a colorimetric quantization parameter offset value according to claim 1, wherein: Determining a frame type of the single frame, and determining an offset range according to the frame type, includes: If the frame type of the single-frame picture is an I frame, the offset range is a first offset range; If the frame type of the single frame is non-I frame, the offset range is the second offset range; The second offset range is greater than the first offset range.

4. The method for adjusting the chromaticity quantization parameter offset according to claim 3, wherein: The chrominance quantization parameter offset value is calculated based on the original quantization parameter offset value and the offset range, including: Determine the chromaticity quantization parameter offset value based on the first offset range and the original chromaticity quantization parameter offset value; the chromaticity quantization parameter offset value includes a Cb offset value and a Cr offset value; An initial chromaticity quantization parameter offset value is determined based on the second offset range and the original chromaticity quantization parameter offset value, and the chromaticity quantization parameter offset value is calculated according to the initial chromaticity quantization parameter offset value and a chromaticity offset parameter scaling factor.

5. The method for adjusting the chromaticity quantization parameter offset according to claim 4, wherein: Before determining an initial chromaticity quantization parameter offset value based on the second offset range and the original chromaticity quantization parameter offset value, and calculating the chromaticity quantization parameter offset value according to the initial chromaticity quantization parameter offset value and a chromaticity offset parameter scaling factor, the method further includes: Performing time-domain filtering on the single frame to remove time-domain noise; Perform complexity estimation on a single frame after time-domain filtering to obtain complexity-related information of the luminance component and chrominance component; Calculate the complexity value of the luminance component, the complexity value of the Cb component, the complexity value of the Cr component, and the total complexity value respectively according to the complexity-related information; The chroma offset parameter scaling factor is calculated based on the total complexity value, the complexity value of the luminance component, the complexity value of the Cb component, and the complexity value of the Cr component; the chroma offset parameter scaling factor includes the chroma scaling factors of the Cb component and the Cr component.

6. A coding method, characterized in that include: Obtaining a brightness quantization parameter of the single frame and using it as a basic reference value; Obtaining a chromaticity quantization parameter offset value obtained by using the chromaticity quantization parameter offset value determination method according to any one of claims 1 to 5; Calculate the chromaticity quantization parameter according to the basic reference value and the chromaticity quantization parameter offset value; The chroma quantization parameters are input into a chroma residual quantization unit of an encoder, so that the encoder controls the compression degree of the chroma residual according to the chroma quantization parameters and generates a coding stream that complies with a coding standard.

7. A device for determining a colorimetric quantization parameter offset value, characterized in that: include: The acquisition module is used to obtain a single frame of HDR video and the chromaticity quantization parameters of the current frame; an original chromaticity quantization parameter offset value obtaining module, configured to calculate based on the current frame chromaticity quantization parameter to obtain an original chromaticity quantization parameter offset value; an offset range determining module, configured to determine a frame type of the single frame and determine an offset range according to the frame type; The chrominance quantization parameter offset value determining module is configured to calculate a chrominance quantization parameter offset value based on the original quantization parameter offset value and the offset range.

8. An encoding device, characterized in that include: A brightness quantization parameter acquisition module, used to obtain the brightness quantization parameter of the single frame and use it as a basic reference value; a chromaticity quantization parameter offset value obtaining module, configured to obtain a chromaticity quantization parameter offset value obtained by using the chromaticity quantization parameter offset value determining method according to any one of claims 1 to 5; a chromaticity quantization parameter acquisition module, configured to calculate the chromaticity quantization parameter according to the basic reference value and the chromaticity quantization parameter offset value; The encoding module is used to pass the chroma quantization parameters to the chroma residual quantization unit of the encoder, so that the encoder controls the compression degree of the chroma residual according to the chroma quantization parameters and generates a coded stream that meets the coding standard.

9. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the method for determining a chrominance quantization parameter offset value and / or the encoding method according to any one of claims 1 to 6 when executing the computer program.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, which, when loaded and executed by a processor, implement the steps of the colorimetric quantization parameter offset value determination method and / or encoding method according to any one of claims 1 to 6.