Quantization parameter encoding and decoding method and electronic equipment

By establishing QP prediction values ​​and context models within the quantization parameter group of the coding unit, the inconsistency between the encoding and decoding processes of privacy CU and non-privacy CU is resolved, ensuring the consistency of QP encoding and decoding at decoding ends with different permissions and improving reconstruction quality.

CN121644803APending Publication Date: 2026-03-10HUAWEI TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-08
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

In existing technologies, the encoding and decoding processes of privacy CUs and non-privacy CUs within the same coding unit quantization parameter group are inconsistent, resulting in the QP obtained by the decoder at the low-privilege scenario being inconsistent with the QP encoded by the encoder, thus affecting the reconstruction quality.

Method used

The QP prediction value of the CU to be encoded is determined based on the QP reconstruction value of the encoded CU, and a corresponding context model is established to perform entropy encoding and entropy decoding, ensuring the consistency of the QP encoding and decoding process between the low-privilege decoding end and the high-privilege decoding end.

Benefits of technology

It achieves consistency in the QP encoding and decoding process between low-privilege and high-privilege decoding ends, improving the reconstruction quality of non-privilege CUs and privacy CUs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121644803A_ABST
    Figure CN121644803A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a quantization parameter encoding and decoding method and electronic equipment, and the encoding method comprises the steps: firstly, determining a QP predicted value of a to-be-encoded non-privacy CU in a coding unit quantization parameter CU QP group according to a QP reconstruction value of an encoded non-privacy CU in the CU QP group; then, according to the QP original value of the non-privacy CU to be coded and the QP predicted value of the non-privacy CU to be coded, determining a QP residual error of the non-privacy CU to be coded; then, according to the number of the coded non-privacy CUs in the CU QP group, determining a context model corresponding to the QP residual error of the non-privacy CUs to be coded; and then, according to the context model corresponding to the QP residual error of the to-be-coded non-privacy CU, entropy coding is performed on the QP residual error of the to-be-coded non-privacy CU. In this way, it can be ensured that the decoding process of the decoding end for the QP of the non-privacy CU is consistent with the encoding process of the encoding end for the QP of the non-privacy CU.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the original application with the application number 202311692069.0, and is directed to the divisional application number 202410619808.1, and the original application date is December 8, 2023. The entire contents of the original application are incorporated herein by reference. TECHNICAL FIELD

[0002] Embodiments of the present application relate to the field of coding and decoding, and in particular to a coding and decoding method of a quantization parameter and an electronic device. BACKGROUND

[0003] With the rapid development of the Internet and multimedia technology, and the continuous decline of the hardware cost and implementation cost of video monitoring, video monitoring technology has been widely applied. For example, remote video monitoring is implemented on a target area by using video monitoring technology to assist in public security management, accident warning, etc.

[0004] However, the collected video images may carry user information (such as face, license plate number, etc.), and if the video images are leaked, the user information will also be leaked, which may cause loss to the user. Therefore, video privacy protection technology has emerged as the times require.

[0005] In the prior art, the selection of the context model of the CU-level luminance QP related parameters of the privacy CU and the non-privacy CU in the same CU QP group depends on the same NumDeltaQp (the number of coded CUs in the same CU QP group). Since only non-privacy CUs are decoded in a low-privilege scenario, this will cause the NumDeltaQp in the coding and decoding process to be different, resulting in inconsistent QP related parameter coding and decoding processes for the same CU. In addition, the way of determining the QP prediction value for the privacy CU and the non-privacy CU in the same CU QP group is the same, which produces a prediction bias when decoding in a low-privilege scenario, causing the QP obtained by decoding at the decoding end to be inconsistent with the QP encoded at the encoding end. SUMMARY

[0006] In view of this, the present application provides a coding and decoding method of a quantization parameter and an electronic device.

[0007] Exemplarily, the present application can be applied to any scene (for example, a video monitoring scene) that needs to be protected by video (or image) privacy, and the present application does not limit this.

[0008] In a first aspect, an embodiment of the present application provides a method for encoding a quantization parameter, the method comprising: first, determining a QP prediction value of a non-private CU to be encoded in a CU QP group according to a QP reconstructed value of a non-private CU already encoded in the CU QP group; then, determining a QP residual of the non-private CU to be encoded according to a QP original value of the non-private CU to be encoded and the QP prediction value of the non-private CU to be encoded; subsequently, determining a context model corresponding to the QP residual of the non-private CU to be encoded according to a number of non-private CUs already encoded in the CU QP group; and then, entropy encoding the QP residual of the non-private CU to be encoded according to the context model corresponding to the QP residual of the non-private CU to be encoded.

[0009] In this way, for a decoding end with only low user permissions (e.g., user permissions lower than preset permissions), since the encoding and decoding of the QP of the non-private CU by the encoding and decoding end only depends on the QP of the non-private CU already encoded / decoded, it can be ensured that the QP decoded by the decoding end is consistent with the QP encoded by the encoding end. In addition, since the encoding and decoding of the QP of the non-private CU by the encoding and decoding end only depends on the number of QPs of the non-private CUs already encoded / decoded, it can be ensured that the context model used in the decoding process of the QP residual of the non-private CU by the decoding end is the same as the context model used in the encoding process of the QP residual of the non-private CU by the encoding end. In this way, the decoding process of the QP of the non-private CU by the decoding end can be consistent with the encoding process of the QP of the non-private CU by the encoding end, so that the reconstruction quality of the reconstructed block of the non-private CU can be improved.

[0010] It should be understood that the encoding method of the first aspect is also applicable to the decoding of the QP of the non-private CU by a terminal device with high user permissions (e.g., user permissions higher than preset permissions).

[0011] For example, for video data that needs to be protected, each frame of the video data can include one or more non-private CUs and / or one or more non-private CUs.

[0012] For example, the non-private CU contains non-private information, and the non-private CU does not contain non-private information.

[0013] The non-private information can refer to a secret that is not willing to be disclosed or known by others (people outside a certain range), and the secret is irrelevant to the information of other people and social interests. In some scenarios, the non-private information can also be referred to as user information. The user information can refer to information directly or indirectly describing the identity of a user. For example, the user information includes but is not limited to: user name, date of birth, ID number, address, phone number, face, license plate number, motion posture, clothing, etc. The present application does not limit this.

[0014] For example, a CU QP group (that is, a CU-level QP group) may include multiple CUs; ​​wherein, a CU QP group may include one or more privacy CUs, and / or one or more non-privacy CUs.

[0015] For example, the absolute value of the QP residual of the non-privacy CU to be encoded can be calculated first; then, the absolute value of the QP residual of the non-privacy CU to be encoded can be quantized to obtain a first quantized value; then, entropy encoding can be performed on the first quantized value according to the context model corresponding to the QP residual of the non-privacy CU to be encoded. In this case, the sign (i.e., positive or negative) of the QP residual of the non-privacy CU to be encoded can also be encoded.

[0016] For example, the QP residual of a non-privacy CU can be referred to as the deltaQP of a non-privacy CU.

[0017] For example, the syntax element corresponding to the first quantization value in the bitstream can be cu_qp_delta_abs, and the syntax element corresponding to the sign of the QP residual of the non-privacy CU to be encoded can be cu_qp_delta_sign.

[0018] According to the first aspect, the method further includes: first, determining the predicted QP value of the privacy CU to be encoded in the CUQP group based on the reconstructed QP values ​​of the encoded CUs in the CUQP group; then, determining the QP residual of the privacy CU to be encoded based on the original QP value and the predicted QP value of the privacy CU to be encoded; subsequently, determining the context model corresponding to the QP residual of the privacy CU to be encoded based on the number of encoded CUs in the CUQP group; and finally, performing entropy encoding on the QP residual of the privacy CU to be encoded based on the context model corresponding to the QP residual of the privacy CU to be encoded. In this way, the QP of the privacy CU can be encoded.

[0019] It should be noted that this application does not restrict the encoding order of the QPs of the privacy CU and the QPs of the non-privacy CU at the encoding end.

[0020] It should be noted that the encoding of the QP of the privacy CU in this application can depend on either the already encoded privacy CU or the already encoded non-privacy CU. Since the decoding end with high user privileges can decode both the QP of the privacy CU and the QP of the non-privacy CU, this also ensures that the decoding process of the privacy CU's QP by the decoding end is consistent with the encoding process of the privacy CU's QP by the encoding end.

[0021] According to the first aspect, or any implementation of the first aspect above, the QP prediction value of the privacy CU to be encoded in the CU QP group is determined based on the QP reconstruction value of the encoded CU in the CU QP group, including: determining the QP prediction value of the privacy CU to be encoded based on the QP reconstruction value of the encoded privacy CU in the CU QP group; and the context model corresponding to the QP residual of the privacy CU to be encoded is determined based on the number of encoded CUs in the CU QP group, including: determining the context model corresponding to the QP residual of the privacy CU to be encoded based on the number of encoded privacy CUs in the CU QP group.

[0022] In this way, the encoding process of the QP of the non-privacy CU and the QP of the privacy CU can be completely decoupled, as can the decoding process of the QP of the non-privacy CU and the QP of the privacy CU, so as to ensure that the decoding process of the QP of the non-privacy CU and the QP of the privacy CU at the decoding end can be consistent with the encoding process of the QP of the non-privacy CU and the QP of the privacy CU at the encoding end.

[0023] Furthermore, for terminal devices with high user privileges, the QP decoding of the privacy CU does not depend on the QP of the non-privacy CU; thus, whether or not the QP of the non-privacy CU is lost will not affect the decoding of the QP of the privacy CU; in addition, when the QP of the non-privacy CU is inaccurate, it will not affect the accuracy of the QP of the privacy CU.

[0024] According to the first aspect, or any implementation of the first aspect above, the QP prediction value of the privacy CU to be encoded in the CU QP group is determined based on the QP reconstruction value of the encoded CUs in the CU QP group, including: determining the QP prediction value of the privacy CU to be encoded based on the QP reconstruction value of all encoded CUs in the CU QP group; and the context model corresponding to the QP residual of the privacy CU to be encoded is determined based on the number of encoded CUs in the CU QP group, including: determining the context model corresponding to the QP residual of the privacy CU to be encoded based on the number of encoded CUs in the CU QP group.

[0025] In this way, the encoding process of the QP of the non-privacy CU and the QP of the privacy CU can be partially decoupled, as can the decoding process of the QP of the non-privacy CU and the QP of the privacy CU, so as to ensure that the decoding process of the QP of the non-privacy CU and the QP of the privacy CU at the decoding end can be consistent with the encoding process of the QP of the non-privacy CU and the QP of the privacy CU at the encoding end.

[0026] Furthermore, the predicted QP of the privacy CU to be encoded depends on the encoded non-privacy CU and / or the encoded privacy CU; thus, the information used to determine the predicted value of the privacy CU to be encoded is more comprehensive; consequently, the predicted QP of the determined privacy CU can be more accurate, thereby improving the reconstruction quality of the privacy CU reconstruction block.

[0027] According to the first aspect, or any implementation of the first aspect above, the QP prediction value of the privacy CU to be encoded is determined based on the QP reconstruction value of the coded privacy CU in the CU QP group, including: when the privacy CU to be encoded is not the first CU in the CU QP group, the QP reconstruction value of the previous coded privacy CU is used as the QP prediction value of the privacy CU to be encoded.

[0028] According to the first aspect, or any implementation of the first aspect above, the QP prediction value of the privacy CU to be encoded is determined based on the QP reconstruction value of the coded privacy CU in the CU QP group, including: when the privacy CU to be encoded is the first CU in the CU QP group, the QP reconstruction value of the coded privacy CU to the left of the privacy CU to be encoded in the CU QP group is used as the QP prediction value of the privacy CU to be encoded.

[0029] According to the first aspect, or any implementation of the first aspect above, the QP prediction value of the privacy CU to be encoded is determined based on the QP reconstruction values ​​of all encoded CUs in the CU QP group, including: when the privacy CU to be encoded is not the first CU in the CU QP group, the QP reconstruction value of the previous encoded CU of the privacy CU to be encoded is used as the QP prediction value of the privacy CU to be encoded.

[0030] According to the first aspect, or any implementation of the first aspect above, the QP prediction value of the privacy CU to be encoded is determined based on the QP reconstruction values ​​of all encoded CUs in the CU QP group, including: when the privacy CU to be encoded is the first CU in the CU QP group, the QP reconstruction value of the encoded CU to the left of the privacy CU to be encoded in the CU QP group is used as the QP prediction value of the privacy CU to be encoded.

[0031] According to the first aspect, or any implementation of the first aspect above, the QP prediction value of the non-privacy CU to be encoded in the CU QP group is determined based on the QP reconstruction value of the encoded non-privacy CU in the CU QP group, including: when the non-privacy CU to be encoded is not the first CU in the CU QP group, the QP reconstruction value of the previous encoded non-privacy CU to be encoded is used as the QP prediction value of the non-privacy CU to be encoded.

[0032] According to the first aspect, or any implementation of the first aspect above, the QP prediction value of the non-privacy CU to be encoded in the CU QP group is determined based on the QP reconstruction value of the encoded non-privacy CU in the CU QP group, including: when the non-privacy CU to be encoded is the first CU in the CU QP group, the QP reconstruction value of the encoded non-privacy CU to the left of the non-privacy CU to be encoded is used as the QP prediction value of the non-privacy CU to be encoded.

[0033] According to the first aspect, or any implementation of the first aspect above, the bitstream generated by the encoding method according to the quantization parameters includes a first identifier, which indicates the number of non-privacy CUs encoded in the CU QP group; after entropy encoding of the QP residuals of the non-privacy CUs to be encoded, the value of the first identifier is incremented by 1.

[0034] For example, the syntax element corresponding to the first identifier can be NumDeltaQp.

[0035] According to the first aspect, or any implementation of the first aspect above, the bitstream generated by the encoding method according to the quantization parameters includes a second identifier, which indicates the number of privacy CUs encoded in the CU QP group; after entropy encoding of the QP residuals of the privacy CUs to be encoded, the value of the second identifier is incremented by 1.

[0036] For example, the syntax element corresponding to the second identifier can be NumDeltaQpPrivacy.

[0037] According to the first aspect, or any implementation of the first aspect above, the bitstream generated by the encoding method according to the quantization parameters includes a third identifier, which indicates the number of all encoded CUs in the CU QP group; after entropy encoding of the QP residual of the non-privacy CU to be encoded, the value of the third identifier is incremented by 1; after entropy encoding of the QP residual of the privacy CU to be encoded, the value of the third identifier is incremented by 1.

[0038] For example, the syntax element corresponding to the third identifier could be NumDeltaQpPrivacy. It should be noted that the bitstream generated according to the first aspect and any implementation thereof may include the first identifier and the second identifier; or, may include the first identifier and the third identifier.

[0039] Secondly, embodiments of this application provide a decoding method for quantization parameters. The decoding method includes: first, receiving a bitstream, the bitstream including QP residual encoded data of non-privacy CUs in the quantization parameter CU QP group; then, determining the context model corresponding to the QP residual of the non-privacy CU to be decoded in the CU QP group based on the number of decoded non-privacy CUs in the CU QP group; next, performing entropy decoding on the QP residual encoded data of the non-privacy CU to be decoded based on the context model corresponding to the QP residual of the non-privacy CU to be decoded, to obtain the QP residual of the non-privacy CU to be decoded; then, determining the QP predicted value of the non-privacy CU to be decoded based on the QP reconstructed values ​​of the decoded non-privacy CUs in the CU QP group; and finally, adding the QP predicted value and the QP residual of the non-privacy CU to be decoded to obtain the QP reconstructed value of the non-privacy CU to be decoded.

[0040] According to the second aspect, the bitstream also includes QP residual encoded data of privacy CUs in the CU QP group. The method further includes: determining the context model corresponding to the QP residual of the privacy CU to be decoded in the CU QP group based on the number of decoded CUs in the CU QP group; performing entropy decoding on the QP residual encoded data of the privacy CU to be decoded based on the context model corresponding to the QP residual of the privacy CU to be decoded to obtain the QP residual of the privacy CU to be decoded; determining the QP prediction value of the privacy CU to be decoded based on the QP reconstruction value of the decoded CUs in the CU QP group; and adding the QP prediction value of the privacy CU to be decoded and the QP residual of the privacy CU to be decoded to obtain the QP reconstruction value of the privacy CU to be decoded.

[0041] According to the second aspect, or any implementation of the second aspect above, the QP prediction value of the privacy CU to be decoded in the CU QP group is determined based on the QP reconstruction value of the decoded CU in the CU QP group, including: determining the QP prediction value of the privacy CU to be decoded based on the QP reconstruction value of the decoded privacy CU in the CU QP group; and the context model corresponding to the QP residual of the privacy CU to be decoded is determined based on the number of decoded CUs in the CU QP group, including: determining the context model corresponding to the QP residual of the privacy CU to be decoded based on the number of decoded privacy CUs in the CU QP group.

[0042] According to the second aspect, or any implementation of the second aspect above, the QP prediction value of the privacy CU to be decoded in the CU QP group is determined based on the QP reconstruction value of the decoded CUs in the CU QP group, including: determining the QP prediction value of the privacy CU to be decoded based on the QP reconstruction values ​​of all decoded CUs in the CU QP group; and the context model corresponding to the QP residual of the privacy CU to be decoded is determined based on the number of decoded CUs in the CU QP group, including: determining the context model corresponding to the QP residual of the privacy CU to be decoded based on the number of all decoded CUs in the CU QP group.

[0043] According to the second aspect, or any implementation of the second aspect above, the QP prediction value of the privacy CU to be decoded is determined based on the QP reconstruction value of the decoded privacy CU in the CU QP group, including: when the privacy CU to be decoded is not the first CU in the CU QP group, the QP reconstruction value of the previous decoded privacy CU is used as the QP prediction value of the privacy CU to be decoded.

[0044] According to the second aspect, or any implementation of the second aspect above, the QP prediction value of the privacy CU to be decoded is determined based on the QP reconstruction value of the decoded privacy CU in the CU QP group, including: when the privacy CU to be decoded is the first CU in the CU QP group, the QP reconstruction value of the decoded privacy CU to the left of the privacy CU to be decoded in the CU QP group is used as the QP prediction value of the privacy CU to be decoded.

[0045] According to the second aspect, or any implementation of the second aspect above, the QP prediction value of the privacy CU to be decoded is determined based on the QP reconstruction values ​​of all decoded CUs in the CU QP group, including: when the privacy CU to be decoded is not the first CU in the CU QP group, the QP reconstruction value of the previous decoded CU of the privacy CU to be decoded is used as the QP prediction value of the privacy CU to be decoded.

[0046] According to the second aspect, or any implementation of the second aspect above, the QP prediction value of the privacy CU to be decoded is determined based on the QP reconstruction values ​​of all decoded CUs in the CU QP group, including: when the privacy CU to be decoded is the first CU in the CU QP group, the QP reconstruction value of the decoded CU to the left of the privacy CU to be decoded in the CU QP group is used as the QP prediction value of the privacy CU to be decoded.

[0047] According to the second aspect, or any implementation of the second aspect above, the QP prediction value of the non-privacy CU to be decoded in the CU QP group is determined based on the QP reconstruction value of the decoded non-privacy CU in the CU QP group of the decoding unit quantization parameter CU, including: when the non-privacy CU to be decoded is not the first CU in the CU QP group, the QP reconstruction value of the previous decoded non-privacy CU to be decoded is used as the QP prediction value of the non-privacy CU to be decoded.

[0048] According to the second aspect, or any implementation of the second aspect above, the QP prediction value of the non-privacy CU to be decoded in the CU QP group is determined based on the QP reconstruction value of the decoded non-privacy CU in the CU QP group of the decoding unit quantization parameter CU, including: when the non-privacy CU to be decoded is the first CU in the CU QP group, the QP reconstruction value of the decoded non-privacy CU to the left of the non-privacy CU to be decoded is taken as the QP prediction value of the non-privacy CU to be decoded.

[0049] According to the second aspect, or any implementation of the second aspect above, the bitstream further includes a first identifier, and the method further includes: determining the number of decoded non-privacy CUs in the CU QP group based on the value of the first identifier; and incrementing the value of the first identifier by 1 after entropy decoding of the QP residual encoded data of the non-privacy CUs to be decoded.

[0050] According to the second aspect, or any implementation of the second aspect above, the bitstream further includes a second identifier, and the method further includes: determining the number of decoded privacy CUs in the CU QP group based on the value of the second identifier; and incrementing the value of the second identifier by 1 after entropy decoding of the QP residual encoded data of the privacy CU to be decoded.

[0051] According to the second aspect, or any implementation of the second aspect above, the bitstream further includes a third identifier, and the method further includes: determining the number of all decoded CUs in the CU QP group based on the value of the third identifier; incrementing the value of the third identifier by 1 after entropy decoding of the QP residual encoded data of the non-privacy CU to be decoded; and incrementing the value of the third identifier by 1 after entropy decoding of the QP residual encoded data of the privacy CU to be decoded.

[0052] The second aspect and any implementation thereof correspond to the first aspect and any implementation thereof, respectively. The technical effects of the second aspect and any implementation thereof are similar to those of the first aspect and any implementation thereof, and will not be repeated here.

[0053] Thirdly, embodiments of this application provide an encoding device for quantization parameters, the device comprising: The first prediction value determination module is used to determine the QP prediction value of the non-privacy CU to be encoded in the CU QP group based on the QP reconstruction value of the encoded non-privacy CU in the CU QP group. The residual module is used to determine the QP residual of the non-privacy CU to be encoded based on the original QP value and the predicted QP value of the non-privacy CU to be encoded. The first model determination module is used to determine the context model corresponding to the QP residual of the non-privacy CU to be encoded based on the number of non-privacy CUs already encoded in the CU QP group. The entropy coding module is used to entropy code the QP residuals of the non-privacy CU to be encoded based on the context model corresponding to the QP residuals of the non-privacy CU to be encoded.

[0054] It should be understood that the encoding device for the quantization parameters of the third aspect can be used to perform the encoding method in the first aspect or any possible implementation of the first aspect.

[0055] The third aspect and any implementation thereof correspond to the first aspect and any implementation thereof, respectively. The technical effects of the third aspect and any implementation thereof are similar to those of the first aspect and any implementation thereof, and will not be repeated here.

[0056] Fourthly, embodiments of this application provide a decoding device for quantization parameters, the device comprising: The bitstream receiving module is used to receive the bitstream, which includes QP residual coded data of non-privacy CUs in the coding unit quantization parameter CU QP group; The second model determination module is used to determine the context model corresponding to the QP residual of the non-privacy CU to be decoded in the CU QP group based on the number of decoded non-privacy CUs in the CU QP group. The entropy decoding module is used to perform entropy decoding on the QP residual encoded data of the non-privacy CU to be decoded based on the context model corresponding to the QP residual of the non-privacy CU to be decoded, so as to obtain the QP residual of the non-privacy CU to be decoded. The second prediction value determination module is used to determine the QP prediction value of the non-privacy CU to be decoded based on the QP reconstruction value of the decoded non-privacy CU in the CU QP group. The addition module is used to add the QP prediction value of the non-privacy CU to be decoded and the QP residual of the non-privacy CU to be decoded to obtain the QP reconstruction value of the non-privacy CU to be decoded.

[0057] It should be understood that the decoding device of the fourth aspect can be used to perform the decoding method in the second aspect or any possible implementation of the second aspect.

[0058] The fourth aspect and any implementation thereof correspond to the second aspect and any implementation thereof, respectively. The technical effects of the fourth aspect and any implementation thereof can be found in the technical effects of the second aspect and any implementation thereof, as described above, and will not be repeated here.

[0059] Fifthly, embodiments of this application provide an electronic device, including: a memory and a processor, the memory being coupled to the processor; the memory storing program instructions, which, when executed by the processor, cause the electronic device to perform the method in the first aspect or any possible implementation thereof.

[0060] The fifth aspect and any implementation thereof correspond to the first aspect and any implementation thereof, respectively. The technical effects of the fifth aspect and any implementation thereof are similar to those of the first aspect and any implementation thereof, and will not be repeated here.

[0061] In a sixth aspect, embodiments of this application provide an electronic device, including: a memory and a processor, the memory being coupled to the processor; the memory storing program instructions, which, when executed by the processor, cause the electronic device to perform the method in the second aspect or any possible implementation thereof.

[0062] The sixth aspect and any implementation thereof correspond to the second aspect and any implementation thereof, respectively. The technical effects of the sixth aspect and any implementation thereof are similar to those of the second aspect and any implementation thereof, and will not be repeated here.

[0063] In a seventh aspect, embodiments of this application provide a chip including one or more interface circuits and one or more processors; the one or more processors receive or send data through the one or more interface circuits, and when the one or more processors execute computer instructions, the steps in the first aspect or any possible implementation of the first aspect are executed.

[0064] The seventh aspect and any implementation thereof correspond to the first aspect and any implementation thereof, respectively. The technical effects of the seventh aspect and any implementation thereof are similar to those of the first aspect and any implementation thereof, and will not be repeated here.

[0065] Eighthly, embodiments of this application provide a chip including one or more interface circuits and one or more processors; the one or more processors receive or send data through the one or more interface circuits, and when the one or more processors execute computer instructions, the steps in the second aspect or any possible implementation of the second aspect are executed.

[0066] The eighth aspect and any implementation thereof correspond to the second aspect and any implementation thereof, respectively. The technical effects corresponding to the eighth aspect and any implementation thereof are similar to those corresponding to the second aspect and any implementation thereof, and will not be repeated here.

[0067] Ninthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when run on a computer or processor, causes the computer or processor to perform the method of the first aspect or any possible implementation thereof.

[0068] The ninth aspect and any implementation thereof correspond to the first aspect and any implementation thereof, respectively. The technical effects corresponding to the ninth aspect and any implementation thereof are similar to those corresponding to the first aspect and any implementation thereof, and will not be repeated here.

[0069] In a tenth aspect, embodiments of this application provide a computer-readable storage medium storing a computer program that, when run on a computer or processor, causes the computer or processor to perform the method of the second aspect or any possible implementation thereof.

[0070] The tenth aspect and any implementation thereof correspond to the second aspect and any implementation thereof, respectively. The technical effects corresponding to the tenth aspect and any implementation thereof are similar to those corresponding to the second aspect and any implementation thereof, and will not be repeated here.

[0071] Eleventhly, embodiments of this application provide a computer program product, which includes computer instructions that, when executed by a computer or processor, cause the computer or processor to perform the method in the first aspect or any possible implementation thereof.

[0072] The eleventh aspect and any implementation thereof correspond to the first aspect and any implementation thereof, respectively. The technical effects corresponding to the eleventh aspect and any implementation thereof can be found in the technical effects corresponding to the first aspect and any implementation thereof, as described above, and will not be repeated here.

[0073] In a twelfth aspect, embodiments of this application provide a computer program product including computer instructions that, when executed by a computer or processor, cause the computer or processor to perform the method in the second aspect or any possible implementation thereof.

[0074] The twelfth aspect and any implementation thereof correspond to the second aspect and any implementation thereof, respectively. The technical effects corresponding to the twelfth aspect and any implementation thereof are similar to those corresponding to the second aspect and any implementation thereof, and will not be repeated here.

[0075] In a thirteenth aspect, embodiments of this application provide a bitstream generated in accordance with the first aspect and any implementation thereof.

[0076] In a fourteenth aspect, embodiments of this application provide a bitstream that includes QP residual encoded data of non-privacy CUs in a CUQP group and a first identifier, the first identifier indicating the number of non-privacy CUs encoded in the CU QP group.

[0077] According to the fourteenth aspect, the bitstream also includes QP residual encoded data of privacy CUs in the CU QP group and a second identifier, the second identifier indicating the number of privacy CUs encoded in the CU QP group.

[0078] According to aspect fourteen, or any implementation thereof, the bitstream also includes QP residual encoded data of privacy CUs in the CU QP group and a third identifier indicating the number of all encoded CUs in the CU QP group.

[0079] In a fifteenth aspect, embodiments of this application also provide a computer-readable storage medium, characterized in that the computer-readable storage medium stores a bitstream as described in the fourteenth aspect and any implementation thereof, or stores a bitstream as described in the thirteenth aspect. Attached Figure Description

[0080] Figure 1A This is a schematic diagram illustrating an application scenario.

[0081] Figure 1A This is a schematic diagram of a compression frame as an example.

[0082] Figure 2A This is a schematic diagram of an exemplary coding framework.

[0083] Figure 2A This is a schematic diagram of an exemplary decoding framework.

[0084] Figure 3 The encoding process of the quantization parameter QP is shown as an example.

[0085] Figure 3 The decoding process of the quantization parameter QP is shown as an example.

[0086] Figure 4The encoding process of the quantization parameter QP is shown as an example.

[0087] Figure 4 The decoding process of the quantization parameter QP is shown as an example.

[0088] Figure 5 The encoding process of the quantization parameter QP is shown as an example.

[0089] Figure 5 The decoding process of the quantization parameter QP is shown as an example.

[0090] Figure 6 This is a schematic diagram of the structure of an exemplary device. Detailed Implementation

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

[0092] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone.

[0093] The terms "first" and "second," etc., used in the specification and claims of this application are used to distinguish different objects, not to describe a specific order of objects. For example, "first target object" and "second target object," etc., are used to distinguish different target objects, not to describe a specific order of target objects.

[0094] In the embodiments of this application, the words "exemplarily" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Specifically, the use of the words "exemplarily" or "for example" is intended to present the relevant concepts in a specific manner.

[0095] In the description of the embodiments in this application, unless otherwise stated, "multiple" means two or more. For example, multiple processing units means two or more processing units; multiple systems means two or more systems. Figure 6 This is a schematic diagram illustrating an exemplary application scenario. Figure 7The application scenario shown is a video surveillance scenario; it should be understood that this application can also be applied to any scenario that requires video (or image) privacy protection, and this application does not limit it.

[0096] Reference Figure 7 For example, image acquisition devices can be deployed at locations such as intersections, shopping mall entrances / exits, and school gates. These devices collect video data and then transmit it via a network to at least one terminal device. For instance, video data collected by devices at intersections can be transmitted to a smart screen; data collected by devices at shopping mall entrances / exits can be transmitted to a smart screen and a tablet computer; data collected by devices at school gates can be transmitted to a smart screen and a personal computer, and so on. After receiving the video data from the image acquisition devices, the terminal devices can store and display the video data (or processed video data as needed) to facilitate user monitoring of the monitored area. It should be noted that the actions of the image acquisition device in this application in acquiring video data, transmitting video data, and the terminal device in storing, processing, and displaying video data are all carried out in compliance with the relevant data protection laws and regulations of the country where the device is located, and with the authorization granted by the owner of the relevant device.

[0097] For example, an image acquisition device can compress (or encode) the acquired video data to obtain a bit stream (also known as a bit stream) and then transmit the bit stream to the terminal device to reduce the amount of data transmitted and reduce bandwidth requirements.

[0098] Figure 8 This is a schematic diagram of a compression frame as an example.

[0099] Reference Figure 8 For example, an image acquisition device may include a camera, an encoding module (or encoder), and a transmitting module. For example, the encoding module may be a software module or a hardware module, and this application embodiment is not limited in this regard. It should be understood that... Figure 9 This is merely one example of an image acquisition device; other embodiments of the image acquisition device in this application have... Figure 9 The embodiments of this application do not limit the number of modules shown.

[0100] Reference Figure 1A For example, the terminal device may include a display module, a decoding module (or decoder), and a receiving module. For example, the decoding module may be a software module or a hardware module, and this application embodiment is not limited in this regard. It should be understood that... Figure 1AThis is merely one example of a terminal device; other embodiments of the terminal device in this application have... Figure 1A The embodiments of this application do not limit the number of modules shown.

[0101] Continue to refer to Figure 1B For example, the process by which an image acquisition device sends raw video data captured by a camera to a terminal device for display is as follows: The camera outputs the captured raw video data to the encoding module; then, the encoding module encodes the raw video data to obtain a bitstream, and outputs the encoded bitstream to the sending module; subsequently, the sending module sends the bitstream to the terminal device. The receiving module of the terminal device then receives the bitstream; then, it outputs the bitstream to the decoding module; next, the decoding module decodes the bitstream to obtain reconstructed video data and outputs the reconstructed video data to the display module, which then displays the reconstructed video data.

[0102] For example, subsequently, it can be Figure 1B The image acquisition device in the middle is called the encoding end, and it can be used to... Figure 1B The terminal device is referred to as the decoding end; the encoding process of the encoding end and the decoding process of the decoding end can be referred to the description of the following embodiments.

[0103] Figure 1B This is a schematic diagram of the encoder's encoding framework, shown as an example. Figure 1B The dashed lines in the diagram represent the data flow of control parameters. For example, control parameters may include, but are not limited to: mode decision results, coding unit (CU) partitioning information, transformation parameters, and quantization parameters (QP), etc., and this application does not impose any limitations on them.

[0104] Reference Figure 1B For example, a frame of video data (which can be called the original image of the current frame) can be input into the segmentation module. The segmentation module can divide the original image of the current frame into multiple CUs according to the CU segmentation information, and then encode each CU in sequence. The following explanation uses the encoding of one CU (called the current CU) as an example.

[0105] For example, based on the mode decision result, it can be determined whether to perform inter-frame prediction or intra-frame prediction for the current CU. When it is determined that intra-frame prediction is to be performed for the current CU, the intra-frame prediction module can search from the reconstructed blocks of the current frame to determine the prediction block of the current CU; then, it determines the residual between the current CU and the prediction block of the current CU (also called the residual of the current CU or the image residual of the current CU). Afterwards, the transform module transforms the residual according to the transform parameters to obtain the transformed residual; the quantization module quantizes the transformed residual according to the quantization parameters to obtain the transformed and quantized residual; the entropy coding module performs entropy coding and other operations on the transformed and quantized residual to obtain the bitstream of the current CU.

[0106] For example, when it is determined that inter-frame prediction is to be performed on the current CU, the inter-frame prediction module can perform motion search and motion estimation from the encoded frames to determine the motion vector (MV) of the current CU and the prediction block of the current CU; then, it determines the residual between the current CU and the prediction block of the current CU. Afterwards, the transform module transforms the residual according to the transform parameters to obtain the transformed residual; the quantization module quantizes the transformed residual according to the quantization parameters to obtain the transformed and quantized residual; the entropy coding module performs entropy coding and other operations on the transformed and quantized residual to obtain the bitstream of the current CU.

[0107] In addition, control parameters can be encoded into the bitstream. This can be achieved by quantizing and entropy encoding the control parameters.

[0108] For example, a reconstruction operation can also be performed during the encoding of the original image of the current frame to generate a reconstructed image of the current frame. For example, the inverse quantization module can inverse quantize the transformed and quantized residuals according to the quantization parameters to obtain the transformed residuals; the inverse transform module can inverse transform the transformed residuals according to the transform parameters to obtain the residuals of the current CU (wherein, the residuals obtained by inverse quantization and inverse transform differ from the residuals before transformation and quantization, and this application does not distinguish between the two in terms of name). Next, the residuals of the current CU are added to the prediction block of the current CU to obtain the reconstructed block of the current CU. Then, the loop filtering module can perform loop filtering on the reconstructed block of the current CU to obtain the filtered reconstructed block of the current CU and store it in the decoded image buffer. In this way, all the filtered reconstructed blocks of the CUs obtained by dividing the original image of the current frame can form the reconstructed image of the current frame.

[0109] Figure 1B This is a schematic diagram illustrating the decoding process of a decoder as an example. Figure 1BThe dashed lines in the diagram represent the data flow of control parameters. For example, control parameters may include, but are not limited to: mode decision results, coding unit (CU) partitioning information, transformation parameters, and quantization parameters (QP), etc., and this application does not impose any limitations on them.

[0110] Reference Figure 1B For example, the entropy decoding module can parse (also known as entropy decoding) the CU partitioning information from the bitstream and determine the current CU based on the CU partitioning information. Then, for the current CU, the entropy decoding module can parse the mode decision result from the corresponding part of the current CU in the bitstream. When the mode decision result determines that the prediction mode of the current CU is inter-frame prediction mode, the inter-frame prediction module can perform inter-frame prediction on the current CU to obtain the prediction block of the current CU. When the mode decision result determines that the prediction mode of the current CU is intra-frame prediction mode, the intra-frame prediction module can perform intra-frame prediction on the current CU to obtain the prediction block of the current CU.

[0111] For example, the entropy decoding module can also parse control parameters and the transformed and quantized residuals from the bitstream. Then, the inverse quantization module can inverse quantize the transformed and quantized residuals according to the quantization parameters to obtain the transformed residuals. The inverse transform module can then inverse transform the transformed residuals according to the transform parameters to obtain the residuals of the current CU. Next, the residuals of the current CU and the prediction blocks of the current CU can be added to obtain the reconstructed blocks of the current CU. Then, the loop filtering module can perform loop filtering on the reconstructed blocks of the current CU to obtain the filtered reconstructed blocks of the current CU, and store them in the decoded image buffer. Multiple filtered reconstructed blocks of CUs belonging to the current frame can form the reconstructed image of the current frame.

[0112] The encoding and decoding process of the quantization parameter QP is explained below.

[0113] For example, for video data that requires privacy protection, each frame of the video data may include one or more privacy CUs and / or one or more non-privacy CUs.

[0114] For example, the privacy CU contains privacy information, while the non-privacy CU does not contain privacy information.

[0115] Privacy information can refer to secrets that one does not wish to be disclosed or known by others (those outside a certain scope), and that such secrets are unrelated to the interests of others or society. In some scenarios, privacy information can also be referred to as user information, which can refer to information that directly or indirectly describes a user's identity. For example, user information includes, but is not limited to: user's name, date of birth, ID number, address, phone number, face, license plate number, posture, clothing, etc., and this application does not impose any restrictions on this.

[0116] The encoding and decoding processes of the quantization parameter QP for the privacy CU and the non-privacy CU are explained below.

[0117] Figure 2A The encoding process for the quantization parameter QP is illustrated as an example. Figure 2A The text describes the encoding process of the quantization parameter QP for the non-privacy CU.

[0118] S301, based on the QP reconstruction values ​​of the encoded non-privacy CUs in the CU QP group, determine the QP prediction values ​​of the non-privacy CUs to be encoded in the CU QP group.

[0119] For example, a CU QP group (that is, a CU-level QP group) may include multiple CUs; ​​wherein, a CU QP group may include one or more privacy CUs, and / or one or more non-privacy CUs.

[0120] Typically, to protect privacy information in video data, only decoding ends with low user privileges (e.g., user privileges below a preset level) are allowed to decode non-privacy CUs, while decoding ends with low user privileges are not allowed to decode privacy CUs. Therefore, this application can determine the QP prediction value of the non-privacy CU to be encoded in the CU QP group based on the QP reconstruction value of the encoded non-privacy CU in the CU QP group; thus, the decoding end can also determine the QP prediction value of the non-privacy CU to be decoded in the CU QP group in the same way during the decoding process, without relying on the privacy CU.

[0121] S302, Based on the original QP value and the predicted QP value of the non-privacy CU to be encoded, determine the QP residual of the non-privacy CU to be encoded.

[0122] One possible approach is to subtract the predicted QP value of the non-privacy CU from the original QP value of the non-privacy CU to be encoded, and obtain the QP residual of the non-privacy CU to be encoded.

[0123] One possible approach is to subtract the original QP value of the non-privacy CU from the QP prediction value of the non-privacy CU to be encoded, and obtain the QP residual of the non-privacy CU to be encoded.

[0124] The raw QP value of the non-privacy CU to be encoded can refer to the QP value used to quantize the non-privacy CU to be encoded, or the raw QP value of the non-privacy CU to be encoded can be called the target QP value of the non-privacy CU to be encoded.

[0125] For example, the QP residual of a non-privacy CU can be referred to as the deltaQP of a non-privacy CU.

[0126] S303, based on the number of non-privacy CUs already encoded in the CU QP group, determine the context model corresponding to the QP residual of the non-privacy CU to be encoded.

[0127] For example, the encoder can pre-store multiple context models (also called probability models); each context model can be assigned a context model index. During the encoding of the QP of the non-privacy CU to be encoded, the first context model index can be determined based on the number of non-privacy CUs already encoded in the CU QP group; then, based on the first context model index, the context model corresponding to the QP residual of the non-privacy CU to be encoded is selected from the multiple context models.

[0128] For example, the encoder stores four context models, whose context model indices (which can be represented by ctxIdxInc) are 0, 1, 2, and 3, respectively. One way to determine the context model index corresponding to the QP residual of the non-privacy CU to be encoded, based on the number of encoded non-privacy CUs in the CU QP group (which can be represented by NumDeltaQp), is: ctxIdxInc = min(NumDeltaQp, 2); that is, selecting the minimum value between the number of encoded non-privacy CUs in the CU QP group and 2 as the first context model index.

[0129] It should be understood that modeling can also be performed during the encoding process. For example, a context model corresponding to the QP residual of the non-privacy CU to be encoded can be established based on the first context model index. This application does not limit this.

[0130] In this way, the decoding end can also determine the context model corresponding to the QP residual of the non-privacy CU to be decoded in this manner, without relying on the privacy CU.

[0131] S304. Based on the context model corresponding to the QP residual of the non-privacy CU to be encoded, entropy encoding is performed on the QP residual of the non-privacy CU to be encoded.

[0132] For example, the absolute value of the QP residual of the non-privacy CU to be encoded can be calculated first; then, the absolute value of the QP residual of the non-privacy CU to be encoded can be quantized to obtain a first quantized value; then, entropy encoding can be performed on the first quantized value according to the context model corresponding to the QP residual of the non-privacy CU to be encoded. In this case, the sign (i.e., positive or negative) of the QP residual of the non-privacy CU to be encoded can also be encoded.

[0133] Thus, the bitstream obtained by encoding according to S301~S304 may include QP residual coded data of non-privacy CUs in the CU QP group. Specifically, the QP residual coded data of non-privacy CUs in the CU QP group may include coded data of the first quantization value and coded data of the symbols of the QP residuals of the non-privacy CUs.

[0134] Figure 2A The decoding process for the quantization parameter QP is illustrated as an example. Figure 2B The process of decoding the quantization parameter QP of the non-privacy CU is described in the paper. Figure 2B The decoding process and Figure 2B The encoding process corresponds to this.

[0135] S401, Receive bitstream, the bitstream includes QP residual coded data of non-privacy CUs in the coding unit quantization parameter CU QP group.

[0136] For example, after the encoding end sends the bitstream to the decoding end, the decoding end can receive the bitstream; the bitstream may include QP residual encoded data of non-privacy CUs in the CU QP group.

[0137] S402, based on the number of decoded non-privacy CUs in the CU QP group, determine the context model corresponding to the QP residual of the non-privacy CU to be decoded in the CU QP group.

[0138] For example, the decoding end can pre-store multiple context models (also called probability models); each context model can be assigned a corresponding context model index. It should be noted that the context models stored on the decoding end and the context models stored on the encoding end are the same, and the context model indexes of the same context model are also the same in the decoding end and the encoding end.

[0139] For example, a first context model index can be determined based on the number of decoded non-privacy CUs in the CU QP group; then, based on the first context model index, the context model corresponding to the QP residual of the non-privacy CU to be decoded can be selected from multiple context models.

[0140] For example, the decoder stores four context models, whose context model indices (which can be represented by ctxIdxInc) are 0, 1, 2, and 3, respectively. One way to determine the context model index corresponding to the QP residual of the non-privacy CU to be decoded, based on the number of decoded non-privacy CUs in the CU QP group (which can be represented by NumDeltaQp), is: ctxIdxInc = min(NumDeltaQp, 2); that is, selecting the minimum value between the number of decoded non-privacy CUs in the CU QP group and 2 as the first context model index.

[0141] It should be understood that modeling can also be performed during the decoding process. For example, a context model corresponding to the QP residual of the non-privacy CU to be decoded can be established based on the first context model index. This application does not limit this.

[0142] S403, based on the context model corresponding to the QP residual of the non-privacy CU to be decoded, entropy decoding is performed on the QP residual encoded data of the non-privacy CU to be decoded to obtain the QP residual of the non-privacy CU to be decoded.

[0143] For example, the QP residual encoded data of the non-privacy CU to be decoded in the CU QP group may include encoded data of the first quantization value and encoded data of the sign of the QP residual of the non-privacy CU to be decoded.

[0144] For example, based on the context model corresponding to the QP residual of the non-privacy CU to be decoded, the encoded data of the first quantization value is entropy decoded to obtain the first quantization value; then, the first quantization value can be dequantized to obtain the absolute value of the QP residual of the non-privacy CU to be decoded.

[0145] For example, entropy decoding can be performed on the encoded data of the symbol of the QP residual of the non-privacy CU to be decoded to obtain the symbol of the QP residual of the non-privacy CU to be decoded; the QP residual of the non-privacy CU to be decoded can be determined based on the absolute value of the QP residual of the non-privacy CU to be decoded and the symbol of the QP residual of the non-privacy CU to be decoded.

[0146] For example, you can refer to the following method: deltaQP = cu_qp_delta_sign ? -cu_qp_delta_abs :cu_qp_delta_abs Where deltaQP is the QP residual of the non-privacy CU to be decoded, cu_qp_delta_abs is the absolute value of the QP residual of the non-privacy CU to be decoded, and cu_qp_delta_sign is the sign of the QP residual of the non-privacy CU to be decoded.

[0147] S404. Based on the QP reconstruction values ​​of the decoded non-privacy CUs in the CU QP group, determine the QP prediction value of the non-privacy CU to be decoded.

[0148] For example, S404 can be referred to the description of S301, and will not be repeated here. That is to say, the way the decoding end determines the QP prediction value of the non-privacy CU to be decoded is the same as the way the encoding end determines the QP prediction value of the non-privacy CU to be encoded.

[0149] S405, add the QP prediction value of the non-privacy CU to be decoded and the QP residual of the non-privacy CU to be decoded to obtain the QP reconstruction value of the non-privacy CU to be decoded.

[0150] For example, the QP prediction value of the non-privacy CU to be decoded and the QP residual of the non-privacy CU to be decoded can be added together to obtain the QP reconstruction value of the non-privacy CU to be decoded.

[0151] For a decoder with only low-level user privileges, since the encoding and decoding of QPs for non-privacy CUs by the decoder only depends on the QPs of the encoded / decoded non-privacy CUs, it can be guaranteed that the QPs decoded by the decoder are consistent with the QPs encoded by the encoder. Furthermore, since the encoding and decoding of QPs for non-privacy CUs by the decoder only depends on the number of QPs of the encoded / decoded non-privacy CUs, it can be guaranteed that the context model used by the decoder in decoding the QP residuals of non-privacy CUs is the same as the context model used by the encoder in encoding the QP residuals of non-privacy CUs. This ensures that the decoding process of QPs for non-privacy CUs by the decoder is consistent with the encoding process by the encoder, thereby improving the reconstruction quality of the reconstructed blocks of non-privacy CUs.

[0152] It should be understood that the decoding process of S401~S405 is also applicable to terminal devices with high user privileges (such as user privileges higher than preset privileges) decoding QPs of non-privacy CUs.

[0153] In one possible approach, the encoding process of the QP of the non-privacy CU and the QP of the privacy CU can be completely decoupled, as can the decoding process of the QP of the non-privacy CU and the QP of the privacy CU, to ensure that the decoding process of the QP of the non-privacy CU and the QP of the privacy CU at the decoding end is consistent with the encoding process of the QP of the non-privacy CU and the QP of the privacy CU at the encoding end.

[0154] Figure 3 This is a schematic diagram illustrating the encoding process of the quantization parameter QP as an example. Figure 3 The encoding process for the quantization parameters QP of the non-privacy CU and the privacy CU is described in the paper.

[0155] S501, based on the QP reconstruction values ​​of the encoded non-privacy CUs in the CU QP group, determine the QP prediction values ​​of the non-privacy CUs to be encoded in the CU QP group.

[0156] For example, when the non-privacy CU to be encoded is not the first CU in the CU QP group, the QP reconstruction value of the preceding encoded non-privacy CU is used as the QP prediction value of the non-privacy CU to be encoded. When the non-privacy CU to be encoded is the first CU in the CU QP group, the QP reconstruction value of the encoded non-privacy CU to the left of the non-privacy CU to be encoded is used as the QP prediction value of the non-privacy CU to be encoded.

[0157] S502, Based on the original QP value of the non-privacy CU to be encoded and the predicted QP value of the non-privacy CU to be encoded, determine the QP residual of the non-privacy CU to be encoded.

[0158] S503, based on the number of non-privacy CUs already encoded in the CU QP group, determine the context model corresponding to the QP residual of the non-privacy CU to be encoded.

[0159] For example, the bitstream includes a first identifier (which may be NumDeltaQp, and the first identifier may indicate the number of non-privacy CUs encoded in the CU QP group); and then the number of non-privacy CUs encoded in the CU QP group can be determined based on the value of the first identifier.

[0160] For example, S502 to S503 can be described with reference to the above description of S302 to S303, and will not be repeated here.

[0161] S504. Based on the context model corresponding to the QP residual of the non-privacy CU to be encoded, entropy encoding is performed on the QP residual of the non-privacy CU to be encoded.

[0162] For example, the absolute value of the QP residual of the non-privacy CU to be encoded can be calculated first; then the absolute value of the QP residual of the non-privacy CU to be encoded can be quantized to obtain a first quantized value. The first quantized value may include multiple bits, and different context models can be used for entropy encoding of the multiple bits of the first quantized value.

[0163] For example, the first bit of the first quantization value can be entropy encoded according to the context model corresponding to the QP residual of the non-privacy CU to be encoded; other bits of the first quantization value can be entropy encoded using a specified context model.

[0164] For example, the specified context model can refer to the context model with context model index ctxIdxInc=3.

[0165] For example, unary codes can be used to entropy encode the QP residuals of the non-privacy CU to be encoded based on the context model corresponding to the QP residuals. It should be understood that this application does not limit the algorithm used for entropy encoding of the first quantization value.

[0166] For example, after S504 is executed, the value of the first identifier can be incremented by 1. In this way, when S503 is executed for the next non-privacy CU to be encoded, the number of non-privacy CUs already encoded in the CU QP group can be determined based on the value of the first identifier.

[0167] S505, Based on the QP reconstruction values ​​of the coded privacy CUs in the CU QP group, determine the QP prediction values ​​of the privacy CUs to be encoded in the CU QP group.

[0168] Typically, a decoding end with high user privileges can decode both non-privacy CUs and privacy CUs. This application aims to decouple the encoding and decoding processes of QPs for non-privacy CUs and privacy CUs by determining the predicted QP values ​​of the privacy CUs to be encoded in the CU QP group solely based on the reconstructed QP values ​​of the already encoded privacy CUs within the CU QP group. This allows the decoding end to determine the predicted QP values ​​of the privacy CUs to be encoded in the CU QP group using the same method during the decoding process, without relying on the non-privacy CUs.

[0169] For example, when the privacy CU to be encoded is not the first CU in the CU QP group, the QP reconstruction value of the previous encoded privacy CU is used as the QP prediction value of the privacy CU to be encoded. When the privacy CU to be encoded is the first CU in the CU QP group, the QP reconstruction value of the encoded privacy CU to the left of the privacy CU to be encoded in the CU QP group is used as the QP prediction value of the privacy CU to be encoded.

[0170] S506, Based on the original QP value and the predicted QP value of the privacy CU to be encoded, determine the QP residual of the privacy CU to be encoded.

[0171] One possible approach is to subtract the predicted QP value of the privacy CU to be encoded from the original QP value of the privacy CU to be encoded, and then obtain the QP residual of the privacy CU to be encoded.

[0172] One possible approach is to subtract the original QP value of the privacy CU to be encoded from the predicted QP value of the privacy CU to be encoded, and then obtain the QP residual of the privacy CU to be encoded.

[0173] The original QP value of the privacy CU to be encoded can refer to the QP value used to quantize the privacy CU to be encoded, or the original QP value of the privacy CU to be encoded can be called the target QP value of the privacy CU to be encoded.

[0174] S507, Based on the number of coded privacy CUs in the CU QP group, determine the context model corresponding to the QP residual of the privacy CU to be encoded in the CU QP group.

[0175] For example, the encoder can pre-store multiple context models (also known as probabilistic models); each context model can be assigned a context model index; a second context model index can be determined based on the number of privacy CUs encoded in the CU QP group; then, based on the second context model index, the context model corresponding to the QP residual of the privacy CU to be encoded is selected from the multiple context models.

[0176] For example, the encoder stores four context models, whose context model indices (which can be represented by ctxIdxInc) are 0, 1, 2, and 3, respectively. One way to determine the context model index corresponding to the QP residual of the privacy CU to be encoded, based on the number of encoded privacy CUs in the CU QP group (which can be represented by NumDeltaQpPrivacy), is: ctxIdxInc = min(NumDeltaQpPrivacy, 2); that is, selecting the minimum value between the number of encoded privacy CUs in the CU QP group and 2 as the second context model index.

[0177] It should be understood that modeling can also be performed during the encoding process. For example, a context model corresponding to the QP residual of the privacy CU to be encoded can be established based on the second context model index. This application does not limit this.

[0178] In this way, the decoding end can also determine the context model corresponding to the QP residual of the privacy CU to be decoded in this manner, without relying on the non-privacy CU.

[0179] For example, the bitstream includes a second identifier (which may be NumDeltaQpPrivacy, indicating the number of privacy CUs encoded in the CUQP group); and the number of privacy CUs encoded in the CU QP group can then be determined based on the value of the second identifier.

[0180] S508, based on the context model corresponding to the QP residual of the privacy CU to be encoded, entropy encoding is performed on the QP residual of the privacy CU to be encoded.

[0181] For example, the absolute value of the QP residual of the privacy CU to be encoded can be calculated first; then the absolute value of the QP residual of the privacy CU to be encoded can be quantized to obtain a second quantized value. The second quantized value may include multiple bits, and different context models can be used for entropy coding of the multiple bits of the first quantized value.

[0182] For example, the first bit of the second quantization value can be entropy encoded according to the context model corresponding to the QP residual of the privacy CU to be encoded; other bits of the second quantization value can be entropy encoded using a specified context model.

[0183] For example, unary codes can be used to entropy encode the QP residuals of the privacy CU to be encoded based on the context model corresponding to the QP residuals. It should be understood that this application does not limit the algorithm used for entropy encoding of the second quantization value.

[0184] For example, after S508 is executed, the value of the second identifier can be incremented by 1. In this way, when S507 is executed for the next privacy CU to be encoded, the number of encoded privacy CUs in the CU QP group can be determined based on the value of the second identifier.

[0185] The following is a brief explanation of the encoding process for non-privacy CUs.

[0186] Intra-frame mode and inter-frame motion information derivation: When performing intra-prediction mode derivation on a non-privacy CU, if the reference location is a privacy region, then that location is set to unavailable. When deriving inter-frame motion information for a non-privacy CU, if the referenced spatial or temporal (TMVP) location is a privacy region, then that location is set to unavailable.

[0187] Intra-frame prediction and inter-frame prediction: When performing intra-frame prediction on a non-privacy CU, if the reference pixel is located in a privacy region, then the reference pixel is set to unavailable. When performing inter-frame prediction on a non-privacy CU, if the reference pixel is located within a privacy region, then that reference pixel is set as the median. The median can be the average of the maximum and minimum pixel values.

[0188] Loop filtering: Deblocking filter (DBK) module: Does not filter the boundary between privacy CU and non-privacy CU (pixels on both sides of the boundary are not filtered).

[0189] Adaptive Loop Filtering (ALF) module: When filtering non-privacy CUs, if a reference pixel for the pixel to be filtered contains a pixel within a privacy region, then that pixel is skipped from the filtering process. The boundary between non-privacy CUs and privacy CUs is not filtered.

[0190] Sampling Adaptive Offset (SAO) module: When filtering non-privacy CUs, if a reference pixel for the pixel to be filtered contains a pixel within a privacy region, then that pixel is skipped from the filtering process. The boundary between non-privacy CUs and privacy CUs is not filtered.

[0191] Entropy coding process: A first entropy encoder is used to entropy encode the image of the non-privacy CU (e.g., the image residual of the CU) to obtain a non-privacy VCL NALU (Video Coding Layer; Network abstract layer unit); a second entropy encoder is used to entropy encode the image of the privacy CU (or the image residual of the privacy CU) to obtain a privacy VCL NALU.

[0192] It should be noted that S504 can be executed using a first entropy encoder, and S508 can be executed using a second entropy encoder. The difference between the first entropy encoder and the second entropy encoder lies in the different upper and lower bound models they store.

[0193] For example, the bitstream obtained by encoding according to the encoding methods of S501 to S508 may include non-privacy VCLNALU (Video Coding Layer; Network abstract layer unit) and privacy VCL NALU.

[0194] For example, during the encoding process according to the encoding methods of S501 to S508, non-image encoded data can also be encoded, such as some high-level syntax (e.g., Sequence Parameter Set (SPS), Picture Parameter Set (PPS), Picture Header (PH), etc.), to obtain NON-VCL NALU.

[0195] In other words, the bitstream encoded at the encoding end can include privacy VCL NALU, non-privacy VCL NALU, and NON-VCL NALU.

[0196] For example, a non-privacy VCL NALU may include image residual coding data of a non-privacy CU (obtained by encoding the image residual of a non-privacy CU), QP residual coding data of a non-privacy CU (such as cu_qp_delta_abs of a non-privacy CU and cu_qp_delta_sign of a non-privacy CU), and a first identifier.

[0197] For example, the privacy VCL NALU may include image residual coding data of the privacy CU (obtained by coding the image residual of the privacy CU), coding data of the QP residual of the privacy CU (such as cu_qp_delta_abs and cu_qp_delta_sign of the privacy CU), and a second identifier.

[0198] For example, different non-privacy CUs belonging to the same CU QP group can be located in different non-privacy VCLNALUs.

[0199] For example, different privacy CUs belonging to the same CU QP group can be located in different privacy VCL NALUs.

[0200] For example, the NALU header of a VCL NALU contains a fourth identifier that indicates whether the VCL NALU is a privacy VCL NALU or a non-privacy VCL NALU.

[0201] For example, the VCL NALU also includes the QP residual coding data of the CU and the image residual coding data of the CU. The non-privacy VCL NALU also includes a fifth identifier, which indicates whether the CU is located in a privacy region. Furthermore, the non-privacy VCL NALU may also include parameters such as filtering parameters, as described in the AVS 3 standard; this application does not impose any limitations on this.

[0202] Table 1 Definition of Coding Tree

[0203] NumDeltaQp This can be called the first identifier, indicating the number of non-privacy CUs encoded in a CU QP group.

[0204] NumDeltaQpPrivacy This can be called a second identifier, indicating the number of privacy CUs encoded in a CU QP group.

[0205] The definitions of other syntax elements in Table 1 can be found in the descriptions in the AVS 3 standard, and will not be repeated here.

[0206] It should be noted that, compared with the existing coding tree, the coding tree in Table 1 of this application adds NumDeltaQpPrivacy.

[0207] For example, the definitions of coding units in the bitstream obtained by encoding according to the encoding methods of S501 to S508 can be shown in Table 2 below: Table 2 Definition of Encoding Unit

[0208] cu_qp_delta_abs Indicates the absolute value of the QP residual of the CU.

[0209] cu_qp_delta_sign The sign indicating the QP residual of CU NumDeltaQpPrivacy This can be called a second identifier, indicating the number of privacy CUs encoded in a CU QP group.

[0210] NumDeltaQp This can be called the first identifier, indicating the number of non-privacy CUs encoded in a CU QP group.

[0211] The definitions of other syntax elements in Table 2 can be found in the descriptions in the AVS 3 standard, and will not be repeated here.

[0212] It should be noted that, compared with the existing technology coding units, the coding unit in Table 2 of this application adds NumDeltaQpPrivacy.

[0213] For example, the ctxIndexInc of cu_qp_delta_abs can be determined as follows: If binIndex is 0 and PrivacyLevel is 0, then ctxIndexInc = min(NumDeltaQp, 2); Otherwise, if binIndex is 0 and PrivacyLevel is not 0, then ctxIndexInc = min(NumDeltaQpPrivacy, 2); Otherwise, ctxIndexInc equals 3.

[0214] The definitions of binIndex and PrivacyLevel can be found in the description in the AVS 3 standard, and will not be repeated here.

[0215] Figure 4 This is a schematic diagram illustrating the decoding process of the quantization parameter QP as an example. Figure 4 The decoding process of the quantization parameter QP for non-privacy CU and the decoding process of the quantization parameter QP for privacy CU are described. Figure 4 The decoding process and Figure 3 The encoding process corresponds to this.

[0216] S601, Receive bitstream, the bitstream includes QP residual coded data of non-privacy CUs in the coding unit quantization parameter CU QP group.

[0217] For example, after receiving the bitstream, the decoder can first parse the higher-level syntax such as SPS, PPS, and PH from the NON-VCL NALU, and then parse the fourth identifier from the NALU header of the VCL NALU; then, based on the fourth identifier, it can determine the privacy VCL NALU and non-privacy VCL NALU in the bitstream.

[0218] For example, the Slice / Tile / Patch Header can be parsed from a non-privacy VCL NALU using a first entropy decoder.

[0219] For example, the first entropy decoder can be used to parse the filtering parameters of the coding tree (e.g., adaptive loop filter (ALF) parameters, sample adaptive offset (SAO) parameters, etc.) from the non-privacy VCL NALU.

[0220] For example, a first entropy decoder can be used to parse the partitioning information from the non-privacy VCL NALU until partitioning stops (leaf nodes (i.e., CUs)); then a fifth identifier can be parsed from the non-privacy VCL NALU to determine whether the CU to be decoded is a non-privacy CU to be decoded.

[0221] If the CU is located in the privacy region and the current permission is high user permission, then switch to the second entropy decoder, parse the privacy CU information from the privacy VCLNALU, and then execute S606 to S609.

[0222] If the CU is located in a privacy zone and the current permissions are low-user permissions, then the CU resolution will be skipped.

[0223] If the CU is not located in the privacy region, the first entropy decoder is used again to parse the information of the non-privacy CU from the non-privacy VCL NALU, and then S602 to S605 are executed.

[0224] For example, the difference between the first entropy decoder and the second entropy decoder is that they store different context models. Specifically, the first entropy decoder corresponds to the first entropy encoder, and the second entropy decoder corresponds to the second entropy encoder.

[0225] S602, based on the number of decoded non-privacy CUs in the CU QP group, determine the context model corresponding to the QP residual of the non-privacy CU to be decoded in the CU QP group.

[0226] For example, if the CU is not located in the privacy region, the information of the non-privacy CU obtained by parsing from the non-privacy VCL NALU using the first entropy decoder can be used again, which may include the first identifier (NumDeltaQp); then, the number of decoded non-privacy CUs in the CU QP group can be determined according to the value of the first identifier.

[0227] The number of decoded non-privacy CUs in the CU QP group is the value of NumDeltaQp.

[0228] For example, after determining the context model corresponding to the QP residual of the non-privacy CU to be decoded, the first entropy decoder can execute the following S603~S605. For details, please refer to the description of S403~S405 above, which will not be repeated here.

[0229] S603, based on the context model corresponding to the QP residual of the non-privacy CU to be decoded, entropy decoding is performed on the QP residual encoded data of the non-privacy CU to be decoded to obtain the QP residual of the non-privacy CU to be decoded.

[0230] S604. Based on the QP reconstruction values ​​of the decoded non-privacy CUs in the CU QP group, determine the QP prediction value of the non-privacy CU to be decoded.

[0231] S605, add the QP prediction value of the non-privacy CU to be decoded and the QP residual of the non-privacy CU to be decoded to obtain the QP reconstruction value of the non-privacy CU to be decoded.

[0232] For example, after executing S605, the value of the first identifier can be incremented by 1. In this way, when executing S602 for the next non-privacy CU to be decoded, the number of encoded non-privacy CUs in the CU QP group can be determined based on the value of the first identifier.

[0233] S606, Based on the number of decoded privacy CUs in the CU QP group, determine the context model corresponding to the QP residual of the privacy CU to be decoded.

[0234] For example, if the CU is located in a privacy region and the decoding end has high user privileges, then switch to the second entropy decoder to parse the privacy CU information from the privacy VCL NALU, which may include a second identifier (NumDeltaQpPrivacy); then, the number of decoded privacy CUs in the CU QP group can be determined according to the value of the second identifier.

[0235] The number of decoded privacy CUs in the CU QP group is the value of NumDeltaQpPrivacy.

[0236] For example, after determining the context model corresponding to the QP residual of the privacy CU to be decoded, the second entropy decoder can execute the following S607~S609. For details, please refer to the description of S407~S409 above, which will not be repeated here.

[0237] S607. Based on the context model corresponding to the QP residual of the privacy CU to be decoded, entropy decoding is performed on the QP residual encoded data of the privacy CU to be decoded to obtain the QP residual of the privacy CU to be decoded.

[0238] S608, Based on the QP reconstruction values ​​of the decoded privacy CUs in the CU QP group, determine the QP prediction value of the privacy CU to be decoded.

[0239] S609, add the QP prediction value of the privacy CU to be decoded and the QP residual of the privacy CU to be decoded to obtain the QP reconstruction value of the privacy CU to be decoded.

[0240] For example, after executing S609, the value of the second identifier can be incremented by 1. In this way, when executing S606 for the next privacy CU to be decoded, the number of encoded privacy CUs in the CU QP group can be determined based on the value of the second identifier.

[0241] It should be noted that the derivation of intra-frame mode and inter-frame motion information, intra-frame prediction and inter-frame prediction, and loop filtering in the decoding process of non-privacy CU are similar to the derivation of intra-frame mode and inter-frame motion information, intra-frame prediction and inter-frame prediction, and loop filtering in the encoding process of non-privacy CU, and will not be repeated here.

[0242] For example, the decoding process of a non-privacy CU also includes an entropy decoding process and inverse quantization, inverse transformation, and reconstruction, as illustrated below.

[0243] Inverse quantization, inverse transform, and reconstruction: If the decoder has low user privileges, set the reconstructed pixels in the privacy area to the default value.

[0244] Entropy decoding process: The non-privacy VCL NALU is entropy decoded using a first entropy encoder to obtain the reconstructed block of the non-privacy CU. When the decoding end has high user privileges, a second entropy encoder can also be used to decode the privacy VCL NALU to obtain the reconstructed block of the privacy CU.

[0245] For example, the specific implementation process of the encoder / decoder end determining the quantization parameter QP of the CU to be encoded / decoded (including privacy CU and non-privacy CU) can be as follows: For example, the quantization parameter of the CU to be encoded / decoded is QPx (where X is Y, Cb, or Cr).

[0246] Step 1: Determine the quantization parameter CurrentQp of the CU to be encoded / decoded. Its value range should be 0 to (63 + 8 × (BitDepth – 8)).

[0247] —If FixedQP is 0 and CuDeltaQpFlag is 1, and the coordinates of the top-left corner of the CU to be encoded are equal to (CuQpGroupX, CuQpGroupY) (i.e., the coordinates of the top-left corner of the CU QP group to which the CU to be encoded belongs), initialize the predicted quantization parameter (i.e., the QP prediction value of the non-privacy CU) PreviousCuQp to the luminance quantization parameter (QP reconstruction value) QPY of the coding unit A (the encoded non-privacy CU) to the left of the CU to be encoded, which contains the luminance component. Set the PrivacyLevel of the CU to be encoded to 0 and determine whether coding unit A is available. If coding unit A is "unavailable", then the value of PreviousCuQp is equal to PatchQp. Initialize the predicted quantization parameter (i.e., the QP prediction value of the privacy CU) PreviousCuQpPrivacy to the luminance quantization parameter QPY of the coding unit A (the encoded privacy CU) to the left of the CU to be encoded, which contains the luminance component. Set the PrivacyLevel of the CU to be encoded to 1 to determine whether encoding unit A is available. If encoding unit A is "unavailable", then the value of PreviousCuQpPrivacy is equal to PatchQp.

[0248] —If the PrivacyLevel of the CU to be encoded is 0, predCuQp equals PreviousCuQp; otherwise, predCuQp equals PreviousCuQpPrivacy.

[0249] —If FixedQP is 1 or CuDeltaQpFlag is 0, then CurrentQp = ((PreviousQp +LCuDeltaQp + 64 + 8)) (BitDepth–8)) % (64 + 8 (BitDepth–8)))CurrentQp.

[0250] —Otherwise, if FixedQP is 0 and CuDeltaQpFlag is 1, and the CU to be encoded contains only chroma components, then CurrentQp is equal to the bottom right corner 4 of the CU to be encoded. Quantization parameters of the luminance coding unit corresponding to the 4 sub-blocks.

[0251] Otherwise, if FixedQP is 0, CuDeltaQpFlag is 1, and CuCtp is 0, then CurrentQp equals PreviousCuQPpredCuQp.

[0252] Otherwise, CurrentQp = ((PreviousCuQPpredCuQp + CuDeltaQp + 64 + 8) (BitDepth–8)) % (64 + 8 (BitDepth–8))).

[0253] —If PrivacyLevel is 0, set the value of PriviousCuQp to CurrentQp; otherwise, set the value of PreviousCuQpPrivacy to CurrentQp. [Updated for use by the next CU] The value of PreviousQp is equal to the quantization parameter QPY of the maximum coding unit (MCU) of the previous decoded chip. If the maximum coding unit of the previous decoded chip is "unavailable" or FixedQP is equal to 1, then the value of PreviousQp is equal to PatchQp. If the maximum coding unit of the previous decoded chip does not belong to the same slice as the CU to be encoded, then the maximum coding unit of the previous decoded chip is "unavailable".

[0254] The specific implementation process of the quantization parameter QP involves syntax elements that can be found in the description of the AVS 3 standard, and will not be repeated here.

[0255] For terminal devices with only low user privileges, since the encoding and decoding of QPs of non-privacy CUs by the encoder and decoder end only depends on the QPs of the encoded / decoded non-privacy CUs, it can be guaranteed that the QPs decoded by the decoder end are consistent with the QPs encoded by the encoder end. Furthermore, since the encoding and decoding of QPs of non-privacy CUs by the encoder and decoder end only depends on the number of QPs of the encoded / decoded non-privacy CUs, it can be guaranteed that the context model used by the decoder end in decoding the QP residuals of non-privacy CUs is the same as the context model used by the encoder end in encoding the QP residuals of non-privacy CUs. This ensures that the decoding process of QPs of non-privacy CUs by the decoder end is consistent with the encoding process of QPs of non-privacy CUs by the encoder end, thereby improving the reconstruction quality of the reconstructed blocks of non-privacy CUs.

[0256] For terminal devices with high user privileges, the QP decoding of the privacy CU does not depend on the QP of the non-privacy CU; thus, whether or not the QP of the non-privacy CU is lost will not affect the decoding of the QP of the privacy CU; in addition, when the QP of the non-privacy CU is inaccurate, it will not affect the accuracy of the QP of the privacy CU.

[0257] For terminal devices with only low user privileges, since the encoding and decoding of QPs of non-privacy CUs by the encoder and decoder end only depends on the QPs of the encoded / decoded non-privacy CUs, it can be guaranteed that the QPs decoded by the decoder end are consistent with the QPs encoded by the encoder end. Furthermore, since the encoding and decoding of QPs of non-privacy CUs by the encoder and decoder end only depends on the number of QPs of the encoded / decoded non-privacy CUs, it can be guaranteed that the context model used by the decoder end in decoding the QP residuals of non-privacy CUs is the same as the context model used by the encoder end in encoding the QP residuals of non-privacy CUs. This ensures that the decoding process of QPs of non-privacy CUs by the decoder end is consistent with the encoding process of QPs of non-privacy CUs by the encoder end, thereby improving the reconstruction quality of the reconstructed blocks of non-privacy CUs.

[0258] For terminal devices with high user privileges, the QP decoding of the privacy CU does not depend on the QP of the non-privacy CU; thus, whether or not the QP of the non-privacy CU is lost will not affect the decoding of the QP of the privacy CU; in addition, when the QP of the non-privacy CU is inaccurate, it will not affect the accuracy of the QP of the privacy CU.

[0259] In one possible approach, the encoding process of the QP of the non-privacy CU and the QP of the privacy CU can be partially decoupled, as can the decoding process of the QP of the non-privacy CU and the QP of the privacy CU. This ensures that the decoding process of the QP of the non-privacy CU and the QP of the privacy CU at the decoding end is consistent with the encoding process of the QP of the non-privacy CU and the QP of the privacy CU at the encoding end.

[0260] Figure 5 This is a schematic diagram illustrating the encoding process of the quantization parameter QP as an example. Figure 5 The encoding process for the quantization parameters QP of the non-privacy CU and the privacy CU is described in the paper.

[0261] S701, based on the QP reconstruction values ​​of the encoded non-privacy CUs in the CU QP group, determine the QP prediction values ​​of the non-privacy CUs to be encoded in the CU QP group.

[0262] S702, Based on the original QP value and the predicted QP value of the non-privacy CU to be encoded, determine the QP residual of the non-privacy CU to be encoded.

[0263] S703, based on the number of non-privacy CUs already encoded in the CU QP group, determine the context model corresponding to the QP residual of the non-privacy CU to be encoded.

[0264] S704. Based on the context model corresponding to the QP residual of the non-privacy CU to be encoded, entropy encoding is performed on the QP residual of the non-privacy CU to be encoded.

[0265] For example, S701 to S704 can be referred to the description of S501 to S504 above, and will not be repeated here.

[0266] S705, based on the QP reconstruction values ​​of all encoded CUs in the CU QP group, determine the QP prediction value of the privacy CU to be encoded.

[0267] Typically, a decoding end with high user privileges can decode both non-privacy CUs and privacy CUs. Therefore, this application determines the QP prediction value of the privacy CU to be encoded in the CU QP group at the encoding end based on the QP reconstruction values ​​of all encoded CUs (including encoded privacy CUs and encoded non-privacy CUs) in the CU QP group. In this way, the decoding end can also determine the QP prediction value of the privacy CU to be decoded in the CU QP group in the same way during the decoding process.

[0268] In this case, the predicted QP of the privacy CU to be encoded depends on the encoded non-privacy CU and / or the encoded privacy CU; thus, the information used to determine the predicted value of the privacy CU to be encoded is more comprehensive; consequently, the predicted value of the determined privacy CU's QP can be more accurate, thereby improving the reconstruction quality of the privacy CU's reconstructed block.

[0269] For example, when the privacy CU to be encoded is not the first CU in the CU QP group, the QP reconstruction value of the preceding encoded CU (which may be an encoded privacy CU or an encoded non-privacy CU) is used as the QP prediction value of the privacy CU to be encoded. When the privacy CU to be encoded is the first CU in the CU QP group, the QP reconstruction value of the encoded CU to the left of the privacy CU to be encoded (which may be an encoded privacy CU or an encoded non-privacy CU) in the CU QP group is used as the QP prediction value of the privacy CU to be encoded.

[0270] S706. Based on the original QP value and the predicted QP value of the privacy CU to be encoded, determine the QP residual of the privacy CU to be encoded.

[0271] For example, S706 can be referred to the description of 506 above, and will not be repeated here.

[0272] S707, based on the number of all encoded CUs in the CU QP group, determine the context model corresponding to the QP residual of the privacy CU to be encoded.

[0273] For example, the encoder can pre-store multiple context models (also known as probabilistic models); each context model can be assigned a context model index; the third context model index can be determined based on the number of all encoded CUs in the CU QP group (i.e., the sum of the number of encoded privacy CUs and the number of encoded non-privacy CUs); then, based on the third context model index, the context model corresponding to the QP residual of the privacy CU to be encoded is selected from the multiple context models.

[0274] For example, the encoder stores four context models, whose context model indices (which can be represented by ctxIdxInc) are 0, 1, 2, and 3, respectively. One way to determine the context model index corresponding to the QP residual of the privacy CU to be encoded, based on the number of encoded CUs in the CU QP group (which can be represented by NumDeltaQpPrivacy), is: ctxIdxInc = min(NumDeltaQpPrivacy, 2); that is, selecting the minimum value between the number of encoded CUs in the CU QP group and 2 as the third context model index.

[0275] For example, the bitstream includes a third identifier (which may be NumDeltaQpPrivacy, indicating the number of encoded CUs in the CUQP group); and the number of encoded CUs in the CU QP group can then be determined based on the value of the third identifier.

[0276] It should be understood that modeling can also be performed during the encoding process. For example, a context model corresponding to the QP residual of the privacy CU to be encoded can be established based on the third context model index. This application does not limit this.

[0277] S708, based on the context model corresponding to the QP residual of the privacy CU to be encoded, entropy encoding is performed on the QP residual of the privacy CU to be encoded.

[0278] For example, the absolute value of the QP residual of the privacy CU to be encoded can be calculated first; then the absolute value of the QP residual of the privacy CU to be encoded can be quantized to obtain a third quantized value. The third quantized value may include multiple bits, and different context models can be used for entropy coding of the multiple bits of the first quantized value.

[0279] For example, the first bit of the third quantization value can be entropy encoded according to the context model corresponding to the QP residual of the privacy CU to be encoded; other bits of the third quantization value can be entropy encoded using a specified context model to obtain the bitstream.

[0280] For example, unary codes can be used to entropy encode the QP residuals of the privacy CU to be encoded based on the context model corresponding to the QP residuals. It should be understood that this application does not limit the algorithm used for entropy encoding of the QP residuals of the privacy CU.

[0281] For example, after S708 is executed, the value of the third identifier can be incremented by 1. In this way, when S707 is executed for the next privacy CU to be encoded, the number of CUs already encoded in the CU QP group can be determined based on the value of the third identifier.

[0282] For example, the definition of the coding tree in the bitstream obtained by encoding according to the encoding methods of S701~S708 can be shown in Table 3 below: Table 3 Definition of Coding Tree

[0283] The definitions of the grammatical elements in Table 3 can be found in Table 1, and will not be repeated here.

[0284] It should be noted that, compared with the existing coding tree, the coding tree in Table 3 of this application adds NumDeltaQpPrivacy.

[0285] For example, the definitions of coding units in the bitstream obtained by encoding according to the encoding methods of S701 to S708 can be shown in Table 4 below: Table 4 Definition of Encoding Unit

[0286] The definitions of the grammatical elements in Table 4 can be found in Table 2, and will not be repeated here.

[0287] It should be noted that, compared with the existing technology coding units, the coding unit in Table 4 of this application adds NumDeltaQpPrivacy.

[0288] also, Figure 6 The encoding process for the non-privacy CU corresponding to the embodiment is similar to the encoding process for the non-privacy CU described above, and will not be repeated here.

[0289] Figure 6 This is a schematic diagram illustrating the decoding process of the quantization parameter QP as an example. Figure 6 The decoding process of the quantization parameter QP for non-privacy CU and the decoding process of the quantization parameter QP for privacy CU are described. Figure 5 The decoding process and Figure 7 The encoding process corresponds to this.

[0290] S801, receive the bitstream, which includes QP residual coded data of non-privacy CUs in the coding unit quantization parameter CU QP group.

[0291] S802, based on the number of decoded non-privacy CUs in the CU QP group, determine the context model corresponding to the QP residual of the non-privacy CU to be decoded in the CU QP group.

[0292] S803, based on the context model corresponding to the QP residual of the non-privacy CU to be decoded, entropy decoding is performed on the QP residual encoded data of the non-privacy CU to be decoded to obtain the QP residual of the non-privacy CU to be decoded.

[0293] S804. Based on the QP reconstruction values ​​of the decoded non-privacy CUs in the CU QP group, determine the QP prediction value of the non-privacy CU to be decoded.

[0294] S805, add the QP prediction value of the non-privacy CU to be decoded and the QP residual of the non-privacy CU to be decoded to obtain the QP reconstruction value of the non-privacy CU to be decoded.

[0295] For example, S801 to S805 can be specifically referred to in the description of S601 to S605 above, and will not be repeated here.

[0296] S806, based on the number of all decoded CUs in the CU QP group, determine the context model corresponding to the QP residual of the privacy CU to be decoded.

[0297] For example, if the CU is located in a privacy region and the decoding end has high user privileges, then switch to the second entropy decoder to parse the privacy CU information from the privacy VCL NALU, which may include a third identifier (NumDeltaQpPrivacy); then, the number of decoded privacy CUs in the CU QP group can be determined according to the value of the third identifier.

[0298] The number of decoded privacy CUs in the CU QP group is the value of NumDeltaQpPrivacy.

[0299] For example, after determining the context model corresponding to the QP residual of the privacy CU to be decoded, the second entropy decoder can execute the following S807~S809. For details, please refer to the description of S407~S409 above, which will not be repeated here.

[0300] S807, based on the context model corresponding to the QP residual of the privacy CU to be decoded, entropy decoding is performed on the QP residual encoded data of the privacy CU to be decoded to obtain the QP residual of the privacy CU to be decoded.

[0301] S808, based on the QP reconstruction values ​​of all decoded CUs in the CU QP group, determines the QP prediction value of the privacy CU to be decoded.

[0302] S809, add the QP prediction value of the privacy CU to be decoded and the QP residual of the privacy CU to be decoded to obtain the QP reconstruction value of the privacy CU to be decoded.

[0303] For example, after executing S809, the value of the third identifier can be incremented by 1. In this way, when executing S806 for the next privacy CU to be decoded, the number of encoded privacy CUs in the CU QP group can be determined based on the value of the third identifier.

[0304] It should be noted that, Figure 7 The decoding process of the non-privacy CU corresponding to the embodiment. Figure 7 The above Figure 8 The decoding process for the non-privacy CU in the embodiment is similar and will not be described again here.

[0305] For example, the specific implementation process of the encoder / decoder end determining the quantization parameter QP of the CU to be encoded / decoded (including privacy CU and non-privacy CU) can be as follows: For example, the quantization parameter of the CU to be encoded / decoded is QPx (where X is Y, Cb, or Cr).

[0306] Step 1: Determine the quantization parameter CurrentQp of the current coding unit. Its value range should be 0 to (63 + 8 × (BitDepth – 8)).

[0307] If FixedQP is 0 and CuDeltaQpFlag is 1, and the coordinates of the top-left corner of the current coding unit are equal to (CuQpGroupX, CuQpGroupY), initialize the prediction quantization parameter PreviousCuQp to the luminance quantization parameter QPY of coding unit A to the left of the current coding unit, which contains the luminance component. Set the PrivacyLevel of the current coding unit to 0 to determine if coding unit A is available. If coding unit A is "unavailable", then the value of PreviousCuQp is equal to PatchQp. Initialize the prediction quantization parameter PreviousCuQpPrivacy to the luminance quantization parameter QPY of coding unit A to the left of the current coding unit, which contains the luminance component. Set the PrivacyLevel of the current coding unit to 1 to determine if coding unit A is available. If coding unit A is "unavailable", then the value of PreviousCuQpPrivacy is equal to PatchQp.

[0308] If the PrivacyLevel of the current coding unit is 0, predCuQp equals PreviousCuQp; otherwise, predCuQp equals PreviousCuQpPrivacy.

[0309] If FixedQP is 1 or CuDeltaQpFlag is 0, then CurrentQp = ((PreviousQp +LCuDeltaQp + 64 + 8)). (BitDepth – 8)) % (64 + 8 (BitDepth – 8)))CurrentQp.

[0310] Otherwise, if FixedQP is 0 and CuDeltaQpFlag is 1 and the current coding unit contains only chroma components, then CurrentQp is equal to the lower right corner of the current coding unit (4). Quantization parameters of the luminance coding unit corresponding to the 4 sub-blocks.

[0311] Otherwise, if FixedQP is 0, CuDeltaQpFlag is 1, and CuCtp is 0, then CurrentQp equals predCuQp.

[0312] Otherwise, CurrentQp = ((predCuQp + CuDeltaQp + 64 + 8) (BitDepth – 8)) %(64 + 8 (BitDepth – 8))).

[0313] Set the value of PreviousCuQpPrivacy to CurrentQp. If PrivacyLevel is 0, set the value of PrioryCuQp to CurrentQp.

[0314] The value of PreviousQp is equal to the quantization parameter QPY of the maximum coding unit (MCU) of the previous decoded chip. If the maximum coding unit of the previous decoded chip is "unavailable" or FixedQP is equal to 1, then the value of PreviousQp is equal to PatchQp. If the maximum coding unit of the previous decoded chip does not belong to the same slice as the current coding unit, then the maximum coding unit of the previous decoded chip is "unavailable".

[0315] It should be noted that this application only encodes cu_qp_delta_abs for CUs that have QP residuals and include luminance (which can be CUs that include luminance and chrominance, with residuals in either component, or if it is a CU that includes luminance, with residuals in the luminance component); and when cu_qp_delta_abs is non-zero, cu_qp_delta_sign is then encoded.

[0316] It should also be noted that the QP of the CU involved in this application can be understood as the CU-level luminance QP.

[0317] It should also be noted that this application does not restrict the encoding order of QPs for privacy CUs and QPs for non-privacy CUs.

[0318] In one example, Figure 8 Figure 8 Figure 7 Figure 8 With Figure 6 Figure 9 A schematic block diagram illustrating an embodiment of the present application shows an apparatus 900. The apparatus 900 may include a processor 901 and a transceiver / transceiver pin 902, and optionally, a memory 903.

[0319] The various components of device 900 are coupled together via bus 904, which includes a data bus, a power bus, a control bus, and a status signal bus. However, for clarity, all buses are referred to as bus 904 in the figure.

[0320] Optionally, the memory 903 can be used to store instructions from the foregoing method embodiments. The processor 901 can be used to execute the instructions in the memory 903, control the receive pin to receive signals, and control the transmit pin to transmit signals.

[0321] The device 900 may be an electronic device or a chip of an electronic device in the above method embodiments.

[0322] All relevant content of each step involved in the above method embodiments can be referenced from the functional description of the corresponding functional module, and will not be repeated here.

[0323] This application also provides a chip, including one or more interface circuits and one or more processors; the one or more processors receive or send data through the one or more interface circuits, and when the one or more processors execute computer instructions, the steps of the above-described related method steps that implement the method in the above embodiments are executed. The interface circuit is a transceiver / transceiver pin 902.

[0324] This embodiment also provides a computer-readable storage medium storing computer instructions. When the computer instructions are executed on an electronic device, the electronic device performs the aforementioned method steps to implement the methods described in the above embodiments.

[0325] This embodiment also provides a computer program product containing computer instructions that, when executed by a computer or processor, cause the computer to perform the aforementioned related steps to implement the methods described in the above embodiments.

[0326] In addition, embodiments of this application also provide an apparatus, which may specifically be a chip, component, or module. The apparatus may include a connected processor and a memory; wherein the memory is used to store computer execution instructions, and when the apparatus is running, the processor may execute the computer execution instructions stored in the memory to cause the chip to execute the methods in the above-described method embodiments.

[0327] In this embodiment, the electronic device, computer-readable storage medium, computer program product or chip are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects of the corresponding methods provided above, and will not be repeated here.

[0328] Through the above description of the embodiments, those skilled in the art will understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

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

[0330] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0331] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0332] Any content in the various embodiments of this application, as well as any content in the same embodiment, can be freely combined. Any combination of the above content is within the scope of this application.

[0333] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0334] The steps of the methods or algorithms described in conjunction with the embodiments of this application can be implemented in hardware or by a processor executing software instructions. The software instructions can consist of corresponding software modules, which can be stored in random access memory (RAM), flash memory, read-only memory (ROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, portable hard disks, CD-ROMs, or any other form of storage medium well known in the art. One exemplary embodiment involves a storage medium coupled to a processor, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can reside in an ASIC.

[0335] Those skilled in the art will recognize that the functions described in the embodiments of this application in one or more of the above examples can be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium. Computer-readable media include computer-readable storage media and communication media, wherein communication media include any medium that facilitates the transmission of a computer program from one place to another. Storage media can be any available medium that can be accessed by a general-purpose or special-purpose computer.

[0336] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.

Claims

1. A method of decoding a quantization parameter, characterized by, The method comprises: receiving a code stream, wherein the code stream comprises quantization parameter (QP) residual coding data of a non-private coding unit (CU); determining a first context model index according to a number of decoded non-private CUs in a CU QP group; determining a context model corresponding to a QP residual of a to-be-decoded non-private CU according to the first context model index; performing entropy decoding on the QP residual coding data of the to-be-decoded non-private CU according to the context model corresponding to the QP residual of the to-be-decoded non-private CU, to obtain a QP residual of the to-be-decoded non-private CU; determining a QP prediction value of the to-be-decoded non-private CU according to a QP reconstruction value of a decoded non-private CU; adding the QP prediction value of the to-be-decoded non-private CU and the QP residual of the to-be-decoded non-private CU to obtain a QP reconstruction value of the to-be-decoded non-private CU.

2. The decoding method of claim 1, wherein, The code stream further comprises QP residual coding data of a private CU, and the method further comprises: determining a context model corresponding to a QP residual of a to-be-decoded private CU according to a number of decoded private CUs in the CU QP group; performing entropy decoding on the QP residual coding data of the to-be-decoded private CU according to the context model corresponding to the QP residual of the to-be-decoded private CU, to obtain a QP residual of the to-be-decoded private CU; determining a QP prediction value of the to-be-decoded private CU according to a QP reconstruction value of a decoded private CU; adding the QP prediction value of the to-be-decoded private CU and the QP residual of the to-be-decoded private CU to obtain a QP reconstruction value of the to-be-decoded private CU.

3. The method of claim 2, wherein, The determining of the QP prediction value of the to-be-decoded private CU according to the QP reconstruction value of the decoded private CU comprises: when the to-be-decoded private CU is not a first CU in the CU QP group, taking a QP reconstruction value of a previous decoded private CU of the to-be-decoded private CU as the QP prediction value of the to-be-decoded private CU.

4. The method according to any one of claims 1 to 3, characterized in that, The determining of the QP prediction value of the to-be-decoded non-private CU according to the QP reconstruction value of the decoded non-private CU comprises: when the to-be-decoded non-private CU is not a first CU in the CU QP group, taking a QP reconstruction value of a previous decoded non-private CU of the to-be-decoded non-private CU as the QP prediction value of the to-be-decoded non-private CU.

5. The method according to any one of claims 1 to 4, characterized in that, The determining of the QP prediction value of the to-be-decoded non-private CU according to the QP reconstruction value of the decoded non-private CU comprises: when the to-be-decoded non-private CU is a first CU in the CU QP group, taking a QP reconstruction value of a left decoded non-private CU of the to-be-decoded non-private CU as the QP prediction value of the to-be-decoded non-private CU.

6. The method according to any one of claims 1 to 5, characterized in that, The method further comprises: adding 1 to a value of the first identifier after performing the entropy decoding on the QP residual coding data of the to-be-decoded non-private CU; the first identifier is used to indicate the number of decoded non-private CUs in the CU QP group.

7. The method of claim 2 or 3, wherein, The method further comprises: adding 1 to a value of the second identifier after performing the entropy decoding on the QP residual coding data of the to-be-decoded private CU; the second identifier is used to indicate the number of decoded private CUs in the CU QP group. The second identifier is used to indicate a number of decoded privacy CUs in the CU QP group.

8. An electronic device, comprising: Comprising: a memory and a processor, the memory coupled with the processor; the memory stores program instructions which, when executed by the processor, cause the electronic device to perform the method of any one of claims 1 to 7.

9. A chip, characterized by comprising one or more interface circuits and one or more processors; the one or more processors receive or send data through the one or more interface circuits, when the one or more processors execute computer instructions, cause the steps of the method of any one of claims 1 to 7 to be performed.

10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, when the computer program runs on a computer or a processor, causes the computer or the processor to perform the method of any one of claims 1 to 7.

11. A computer program product, characterised in that, The computer program product contains computer instructions, when the computer instructions are executed by a computer or a processor, cause the steps of the method of any one of claims 1 to 7 to be performed.

Citation Information

Patent Citations

  • Coding method of quantization parameter and electronic device

    CN118612438B