Quantization parameter encoding and decoding method and electronic equipment
By quantizing the parameter CU QP group of the encoding unit, determining the QP predicted value and residual of the non-private CU to be encoded based on the QP reconstruction value of the encoded non-private CU, and selecting an appropriate context model for entropy encoding, the problem of inconsistency between the QP-related parameters of the private CU and the non-private CU in the prior art is solved, and higher reconstruction quality and decoding consistency are achieved.
Patent Information
- Application Number
- CN202311692069.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-08
- Publication Date
- 2025-06-10
AI Technical Summary
In the prior art, the context model selection of the CU-level brightness QP-related parameters of the same encoding unit (CU) quantization parameter (QP) group depends on the same NumDeltaQp, resulting in different NumDeltaQp in the encoding and decoding process in low-privileged scenarios, making the QP-related parameters of the same CU inconsistently encode and decode, resulting in prediction deviation.
By quantizing the QP reconstruction value of the coded non-private CU in the CU QP group based on the encoding unit, the QP predicted value of the non-private CU to be encoded, and its residuals are calculated, and the appropriate context model is selected for entropy encoding and encoding to ensure that the decoding end and the encoding end perform consistent encoding and decoding of the QP of the non-private CU.
It is realized that the QP decoded by the decoding side is consistent with the QP encoded by the encoding side in a low-priority scenario, which improves the reconstruction quality of the reconstruction block of the non-private CU, and whether the QP decoding of the private CU is lost or not, the QP decoding of the private CU will not be affected.
Smart Images

Figure CN120128709A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the field of encoding and decoding, and in particular, to a method for encoding and decoding quantization parameters and an electronic device. Background Art
[0002] With the rapid development of Internet and multimedia technologies, and the continuous decline in the hardware cost and implementation cost of video surveillance, video surveillance technology has been widely used; for example, video surveillance technology is used to implement remote video surveillance of a target area to assist in public security management, accident warning, etc.
[0003] However, the collected video images may carry user information (such as faces, license plate numbers, etc.). If the video images are leaked, the user information will also be leaked, which may cause losses to users; therefore, video privacy protection technology has emerged.
[0004] 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 quantization parameter (Quantization Parameter, QP) group of the same coding unit (Coding Unit, CU) depends on the same NumDeltaQp (the number of encoded CUs in the same CU QP group). Since in the low-privilege scenario, only the non-privacy CUs are decoded, this will result in different NumDeltaQps in the encoding and decoding processes, making the encoding and decoding processes of the QP-related parameters of the same CU inconsistent. In addition, for the privacy CU and the non-privacy CU in the same CU QP group, the method for determining the QP prediction value is the same, and a prediction deviation occurs during decoding in the low-privilege scenario, resulting in the QP decoded at the decoding end being inconsistent with the QP encoded at the encoding end. Summary of the Invention
[0005] In view of this, the present application provides a method for encoding and decoding quantization parameters and an electronic device.
[0006] Exemplarily, the present application can be applied to any scenario that requires video (or image) privacy protection (such as a video surveillance scenario), and the present application does not limit this.
[0007] In a first aspect, an embodiment of the present application provides a method for encoding quantization parameters. The method includes: First, determine the QP prediction value of the non-private CU to be encoded in the CU QP group according to the QP reconstruction value of the encoded non-private CUs in the CU QP group; Next, determine the QP residual of the non-private CU to be encoded according to the 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, determine the context model corresponding to the QP residual of the non-private CU to be encoded according to the number of encoded non-private CUs in the CU QP group; After that, perform entropy encoding on 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.
[0008] In this way, for a decoding end with only low user permissions (such as user permissions lower than the preset permissions), since the encoding and decoding of the QP of non-private CUs by the encoding and decoding ends only depend on the QP of the encoded / decoded non-private CUs, it can be ensured that the QP decoded by the decoding end is the same as the QP encoded by the encoding end. And the encoding and decoding of the QP of non-private CUs by the encoding and decoding ends only depend on the number of encoded / decoded non-private CUs, and thus it can be ensured that the context model used in the decoding process of the QP residual of non-private CUs by the decoding end is the same as the context model used in the encoding process of the QP residual of non-private CUs by the encoding end; In this way, it can be ensured that the decoding process of the QP of non-private CUs by the decoding end is consistent with the encoding process of the QP of non-private CUs by the encoding end, thereby improving the reconstruction quality of the reconstructed blocks of non-private CUs.
[0009] It should be understood that the encoding method in the first aspect is also applicable to decoding the QP of non-private CUs by a terminal device with high user permissions (such as user permissions higher than the preset permissions).
[0010] Exemplarily, 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-private CUs.
[0011] Exemplarily, a privacy CU contains privacy information, and a non-private CU does not contain privacy information.
[0012] Among them, privacy information may refer to a secret that a person does not want to be made public or known to others (people outside a certain range), and this secret has nothing to do with the interests of other people and society. In some scenarios, privacy information may also be referred to as user information, and user information may refer to information that directly or indirectly describes a user's identity. For example, 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., and the present application does not limit this.
[0013] Exemplarily, a CU QP group (i.e., a QP group at the CU level) may include multiple CUs; among them, a CU QP group may include one or more privacy CUs and / or one or more non-privacy CUs.
[0014] Exemplarily, the absolute value of the QP residual of the non-privacy CU to be encoded may be calculated first; then, the absolute value of the QP residual of the non-privacy CU to be encoded is quantized to obtain a first quantization value; thereafter, entropy coding is performed on the first quantization 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 may also be encoded.
[0015] Exemplarily, the QP residual of the non-privacy CU may be referred to as the deltaQP of the non-privacy CU.
[0016] Exemplarily, the syntax element corresponding to the first quantization value in the bitstream may 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 may be cu_qp_delta_sign.
[0017] According to the first aspect, the method further includes: First, determine the QP prediction value of the privacy CU to be encoded in the CU QP group according to the QP reconstruction value of the encoded CU in the CU QP group; then, determine the QP residual of the privacy CU to be encoded according to the QP original value and the QP prediction value of the privacy CU to be encoded; subsequently, determine the context model corresponding to the QP residual of the privacy CU to be encoded according to the number of encoded CUs in the CU QP group; thereafter, perform entropy coding on the QP residual of the privacy CU to be encoded according to the context model corresponding to the QP residual of the privacy CU to be encoded. In this way, encoding of the QP of the privacy CU can be achieved.
[0018] It should be noted that this application does not limit the encoding order of the QP of the privacy CU and the QP of the non-privacy CU at the encoding end.
[0019] It should be noted that the encoding of the QP of the privacy CU in this application may depend on the encoded privacy CUs or the encoded non-privacy CUs. Since the decoding end with high user permissions can decode both the QP of the privacy CU and the QP of the non-privacy CU, thus, this can also make the decoding process of the QP of the privacy CU at the decoding end consistent with the encoding process of the QP of the privacy CU at the encoding end.
[0020] According to the first aspect, or any implementation of the above first aspect, determining the QP prediction value of the privacy CU to be encoded in the CU QP group according to the QP reconstruction value of the encoded CUs in the CU QP group includes: determining the QP prediction value of the privacy CU to be encoded according to the QP reconstruction value of the encoded privacy CUs in the CU QP group; determining the context model corresponding to the QP residual of the privacy CU to be encoded according to 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 according to the number of encoded privacy CUs in the CU QP group.
[0021] In this way, it is possible to completely decouple the encoding processes of the QP of the non-privacy CU and the QP of the privacy CU, and completely decouple the decoding processes of the QP of the non-privacy CU and the QP of the privacy CU, so as to ensure that the decoding processes of the QP of the non-privacy CU and the QP of the privacy CU at the decoding end are consistent with the encoding processes of the QP of the non-privacy CU and the QP of the privacy CU at the encoding end.
[0022] In addition, for a terminal device with high user privileges, the decoding of the QP of the privacy CU does not depend on the QP of the non-privacy CU; in this way, regardless of whether the QP of the non-privacy CU is lost, it 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.
[0023] According to the first aspect, or any implementation of the above first aspect, determining the QP prediction value of the privacy CU to be encoded in the CU QP group according to the QP reconstruction value of the encoded CUs in the CU QP group includes: determining the QP prediction value of the privacy CU to be encoded according to the QP reconstruction values of all the encoded CUs in the CU QP group; determining the context model corresponding to the QP residual of the privacy CU to be encoded according to 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 according to the number of all the encoded CUs in the CU QP group.
[0024] In this way, it is possible to partially decouple the encoding processes of the QP of the non-privacy CU and the QP of the privacy CU, and partially decouple the decoding processes of the QP of the non-privacy CU and the QP of the privacy CU, so as to ensure that the decoding processes of the QP of the non-privacy CU and the QP of the privacy CU at the decoding end are consistent with the encoding processes of the QP of the non-privacy CU and the QP of the privacy CU at the encoding end.
[0025] In addition, the predicted value of the QP of the privacy CU to be coded depends on the coded non-privacy CUs and / or the coded privacy CUs; in this way, the information used to determine the predicted value of the QP of the privacy CU to be coded is more comprehensive; furthermore, the predicted value of the QP of the privacy CU determined can be more accurate, so that the reconstruction quality of the reconstructed block of the privacy CU can be improved.
[0026] According to the first aspect, or any one of the implementation manners of the above first aspect, determining the predicted value of the QP of the privacy CU to be coded according to the reconstructed QP value of the coded privacy CU in the CU QP group includes: when the privacy CU to be coded is not the first CU in the CU QP group, using the reconstructed QP value of the previous coded privacy CU of the privacy CU to be coded as the predicted value of the QP of the privacy CU to be coded.
[0027] According to the first aspect, or any one of the implementation manners of the above first aspect, determining the predicted value of the QP of the privacy CU to be coded according to the reconstructed QP value of the coded privacy CU in the CU QP group includes: when the privacy CU to be coded is the first CU in the CU QP group, using the reconstructed QP value of the coded privacy CU on the left side of the privacy CU to be coded in the CU QP group as the predicted value of the QP of the privacy CU to be coded.
[0028] According to the first aspect, or any one of the implementation manners of the above first aspect, determining the predicted value of the QP of the privacy CU to be coded according to the reconstructed QP values of all the coded CUs in the CU QP group includes: when the privacy CU to be coded is not the first CU in the CU QP group, using the reconstructed QP value of the previous coded CU of the privacy CU to be coded as the predicted value of the QP of the privacy CU to be coded.
[0029] According to the first aspect, or any one of the implementation manners of the above first aspect, determining the predicted value of the QP of the privacy CU to be coded according to the reconstructed QP values of all the coded CUs in the CU QP group includes: when the privacy CU to be coded is the first CU in the CU QP group, using the reconstructed QP value of the coded CU on the left side of the privacy CU to be coded in the CU QP group as the predicted value of the QP of the privacy CU to be coded.
[0030] According to the first aspect, or any one of the implementation manners of the above first aspect, determining the predicted value of the QP of the non-privacy CU to be coded in the CU QP group according to the reconstructed QP value of the coded non-privacy CU in the coding unit quantization parameter CU QP group includes: when the non-privacy CU to be coded is not the first CU in the CU QP group, using the reconstructed QP value of the previous coded non-privacy CU of the non-privacy CU to be coded as the predicted value of the QP of the non-privacy CU to be coded.
[0031] According to the first aspect, or any implementation of the above first aspect, determining the QP prediction value of the to-be-encoded non-private CU in the CU QP group based on the reconstructed QP values of the encoded non-private CUs in the CU QP group includes: when the to-be-encoded non-private CU is the first CU in the CU QP group, using the reconstructed QP value of the encoded non-private CU on the left side of the to-be-encoded non-private CU as the QP prediction value of the to-be-encoded non-private CU.
[0032] According to the first aspect, or any implementation of the above first aspect, the bitstream generated according to the encoding method of quantization parameters includes a first identifier, and the first identifier indicates the number of encoded non-private CUs in the CU QP group; after entropy encoding the QP residual of the to-be-encoded non-private CU, increment the value of the first identifier by 1.
[0033] Exemplarily, the syntax element corresponding to the first identifier may be NumDeltaQp.
[0034] According to the first aspect, or any implementation of the above first aspect, the bitstream generated according to the encoding method of quantization parameters includes a second identifier, and the second identifier indicates the number of encoded private CUs in the CU QP group; after entropy encoding the QP residual of the to-be-encoded private CU, increment the value of the second identifier by 1.
[0035] Exemplarily, the syntax element corresponding to the second identifier may be NumDeltaQpPrivacy.
[0036] According to the first aspect, or any implementation of the above first aspect, the bitstream generated according to the encoding method of quantization parameters includes a third identifier, and the third identifier indicates the number of all encoded CUs in the CU QP group; after entropy encoding the QP residual of the to-be-encoded non-private CU, increment the value of the third identifier by 1; after entropy encoding the QP residual of the to-be-encoded private CU, increment the value of the third identifier by 1.
[0037] Exemplarily, the syntax element corresponding to the third identifier may be NumDeltaQpPrivacy
[0038] It should be noted that the bitstream generated according to the first aspect and any implementation of the first aspect may include the first identifier and the second identifier; or, include the first identifier and the third identifier.
[0039] Second aspect, an embodiment of the present application provides a method for decoding quantization parameters. The decoding method includes: First, receiving a bitstream, where the bitstream includes QP residual coding data of non-private CUs in a CU QP group; Subsequently, determining a context model corresponding to the QP residual of the to-be-decoded non-private CUs in the CU QP group according to the number of decoded non-private CUs in the CU QP group; Then, performing entropy decoding on the QP residual coding data of the to-be-decoded non-private CUs according to the context model corresponding to the QP residual of the to-be-decoded non-private CUs to obtain the QP residual of the to-be-decoded non-private CUs; After that, determining a QP prediction value of the to-be-decoded non-private CUs according to the QP reconstruction values of the decoded non-private CUs in the CU QP group; Then, adding the QP prediction value of the to-be-decoded non-private CUs and the QP residual of the to-be-decoded non-private CUs to obtain the QP reconstruction value of the to-be-decoded non-private CUs.
[0040] According to the second aspect, the bitstream further includes QP residual coding data of private CUs in the CU QP group, and the method further includes: determining a context model corresponding to the QP residual of the to-be-decoded private CUs in the CU QP group according to the number of decoded CUs in the CU QP group; performing entropy decoding on the QP residual coding data of the to-be-decoded private CUs according to the context model corresponding to the QP residual of the to-be-decoded private CUs to obtain the QP residual of the to-be-decoded private CUs; determining a QP prediction value of the to-be-decoded private CUs according to the QP reconstruction values of the decoded CUs in the CU QP group; adding the QP prediction value of the to-be-decoded private CUs and the QP residual of the to-be-decoded private CUs to obtain the QP reconstruction value of the to-be-decoded private CUs.
[0041] According to the second aspect, or any one of the implementation manners of the above second aspect, determining a QP prediction value of the to-be-decoded private CUs in the CU QP group according to the QP reconstruction values of the decoded CUs in the CU QP group includes: determining a QP prediction value of the to-be-decoded private CUs according to the QP reconstruction values of the decoded private CUs in the CU QP group; determining a context model corresponding to the QP residual of the to-be-decoded private CUs according to the number of decoded CUs in the CU QP group includes: determining a context model corresponding to the QP residual of the to-be-decoded private CUs according to the number of decoded private CUs in the CU QP group.
[0042] According to the second aspect, or any one of the implementation manners of the above second aspect, determining a QP prediction value of the to-be-decoded private CUs in the CU QP group according to the QP reconstruction values of the decoded CUs in the CU QP group includes: determining a QP prediction value of the to-be-decoded private CUs according to the QP reconstruction values of all the decoded CUs in the CU QP group; determining a context model corresponding to the QP residual of the to-be-decoded private CUs according to the number of decoded CUs in the CU QP group includes: determining a context model corresponding to the QP residual of the to-be-decoded private CUs according to the number of all the decoded CUs in the CU QP group.
[0043] According to the second aspect, or any implementation manner of the above second aspect, determining the QP prediction value of the to-be-decoded private CU according to the QP reconstruction value of the decoded private CU in the CU QP group includes: when the to-be-decoded private CU is not the first CU in the CU QP group, using the QP reconstruction value of the previous decoded private CU of the to-be-decoded private CU as the QP prediction value of the to-be-decoded private CU.
[0044] According to the second aspect, or any implementation manner of the above second aspect, determining the QP prediction value of the to-be-decoded private CU according to the QP reconstruction value of the decoded private CU in the CU QP group includes: when the to-be-decoded private CU is the first CU in the CU QP group, using the QP reconstruction value of the decoded private CU on the left side of the to-be-decoded private CU in the CU QP group as the QP prediction value of the to-be-decoded private CU.
[0045] According to the second aspect, or any implementation manner of the above second aspect, determining the QP prediction value of the to-be-decoded private CU according to the QP reconstruction values of all decoded CUs in the CU QP group includes: when the to-be-decoded private CU is not the first CU in the CU QP group, using the QP reconstruction value of the previous decoded CU of the to-be-decoded private CU as the QP prediction value of the to-be-decoded private CU.
[0046] According to the second aspect, or any implementation manner of the above second aspect, determining the QP prediction value of the to-be-decoded private CU according to the QP reconstruction values of all decoded CUs in the CU QP group includes: when the to-be-decoded private CU is the first CU in the CU QP group, using the QP reconstruction value of the decoded CU on the left side of the to-be-decoded private CU in the CU QP group as the QP prediction value of the to-be-decoded private CU.
[0047] According to the second aspect, or any implementation manner of the above second aspect, determining the QP prediction value of the to-be-decoded non-private CU in the CU QP group according to the QP reconstruction values of the decoded non-private CUs in the decoding unit quantization parameter CU QP group includes: when the to-be-decoded non-private CU is not the first CU in the CU QP group, using the QP reconstruction value of the 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.
[0048] According to the second aspect, or any implementation manner of the above second aspect, determining the QP prediction value of the to-be-decoded non-private CU in the CU QP group according to the QP reconstruction values of the decoded non-private CUs in the decoding unit quantization parameter CU QP group includes: when the to-be-decoded non-private CU is the first CU in the CU QP group, using the QP reconstruction value of the decoded non-private CU on the left side of the to-be-decoded non-private CU as the QP prediction value of the to-be-decoded non-private CU.
[0049] According to a second aspect, or any implementation of the above second aspect, the bitstream further includes a first identifier, and the method further includes: determining the number of decoded non-private CUs in the CU QP group according to the value of the first identifier; after entropy decoding the QP residual coding data of the to-be-decoded non-private CU, incrementing the value of the first identifier by 1.
[0050] According to a second aspect, or any implementation of the above second aspect, the bitstream further includes a second identifier, and the method further includes: determining the number of decoded private CUs in the CU QP group according to the value of the second identifier; after entropy decoding the QP residual coding data of the to-be-decoded private CU, incrementing the value of the second identifier by 1.
[0051] According to a second aspect, or any implementation of the above second aspect, the bitstream further includes a third identifier, and the method further includes: determining the number of all decoded CUs in the CU QP group according to the value of the third identifier; after entropy decoding the QP residual coding data of the to-be-decoded non-private CU, incrementing the value of the third identifier by 1; after entropy decoding the QP residual coding data of the to-be-decoded private CU, incrementing the value of the third identifier by 1.
[0052] The second aspect and any implementation of the second aspect respectively correspond to the first aspect and any implementation of the first aspect. For the technical effects corresponding to the second aspect and any implementation of the second aspect, reference may be made to the technical effects corresponding to the first aspect and any implementation of the first aspect above, which will not be elaborated here.
[0053] In a third aspect, an embodiment of the present application provides a quantization parameter encoding apparatus, and the apparatus includes:
[0054] A first prediction value determination module, configured to determine a QP prediction value of a to-be-encoded non-private CU in the CU QP group according to the QP reconstruction value of the encoded non-private CUs in the CU QP group;
[0055] A residual module, configured to determine a QP residual of the to-be-encoded non-private CU according to the QP original value of the to-be-encoded non-private CU and the QP prediction value of the to-be-encoded non-private CU;
[0056] A first model determination module, configured to determine a context model corresponding to the QP residual of the to-be-encoded non-private CU according to the number of encoded non-private CUs in the CU QP group;
[0057] An entropy encoding module, configured to perform entropy encoding on the QP residual of the to-be-encoded non-private CU according to the context model corresponding to the QP residual of the to-be-encoded non-private CU.
[0058] It should be understood that the encoding device for the quantization parameter of the third aspect can be used to execute the encoding method in the first aspect or any possible implementation manner of the first aspect.
[0059] The third aspect and any implementation manner of the third aspect respectively correspond to the first aspect and any implementation manner of the first aspect. For the technical effects corresponding to the third aspect and any implementation manner of the third aspect, reference can be made to the technical effects corresponding to the first aspect and any implementation manner of the first aspect above, which will not be elaborated here.
[0060] Fourthly, an embodiment of the present application provides a decoding device for quantization parameters, and the device includes:
[0061] A bitstream receiving module, configured to receive a bitstream, where the bitstream includes QP residual coding data of non-private CUs in a CU QP group of encoding unit quantization parameters;
[0062] A second model determining module, configured to determine a context model corresponding to the QP residual of a non-private CU to be decoded in the CU QP group according to the number of decoded non-private CUs in the CU QP group;
[0063] An entropy decoding module, configured to perform entropy decoding on the QP residual coding data of the non-private CU to be decoded according to the context model corresponding to the QP residual of the non-private CU to be decoded, so as to obtain the QP residual of the non-private CU to be decoded;
[0064] A second predicted value determining module, configured to determine a QP predicted value of the non-private CU to be decoded according to the QP reconstruction value of the decoded non-private CUs in the CU QP group;
[0065] An adding module, configured to add the QP predicted value of the non-private CU to be decoded and the QP residual of the non-private CU to be decoded to obtain the QP reconstruction value of the non-private CU to be decoded.
[0066] It should be understood that the decoding device of the fourth aspect can be used to execute the decoding method in the second aspect or any possible implementation manner of the second aspect.
[0067] The fourth aspect and any implementation manner of the fourth aspect respectively correspond to the second aspect and any implementation manner of the second aspect. For the technical effects corresponding to the fourth aspect and any implementation manner of the fourth aspect, reference can be made to the technical effects corresponding to the second aspect and any implementation manner of the second aspect above, which will not be elaborated here.
[0068] Fifth aspect, an embodiment of the present application provides an electronic device, including: a memory and a processor, the memory being coupled to the processor; the memory stores program instructions, and when the program instructions are executed by the processor, the electronic device is caused to execute the method in the first aspect or any possible implementation manner of the first aspect.
[0069] The fifth aspect and any implementation manner of the fifth aspect respectively correspond to the first aspect and any implementation manner of the first aspect. For the technical effects corresponding to the fifth aspect and any implementation manner of the fifth aspect, reference may be made to the technical effects corresponding to the first aspect and any implementation manner of the first aspect above, and details are not described herein again.
[0070] Sixth aspect, an embodiment of the present application provides an electronic device, including: a memory and a processor, the memory being coupled to the processor; the memory stores program instructions, and when the program instructions are executed by the processor, the electronic device is caused to execute the method in the second aspect or any possible implementation manner of the second aspect.
[0071] The sixth aspect and any implementation manner of the sixth aspect respectively correspond to the second aspect and any implementation manner of the second aspect. For the technical effects corresponding to the sixth aspect and any implementation manner of the sixth aspect, reference may be made to the technical effects corresponding to the second aspect and any implementation manner of the second aspect above, and details are not described herein again.
[0072] Seventh aspect, an embodiment of the present application 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 in the first aspect or any possible implementation manner of the first aspect are caused to be executed.
[0073] The seventh aspect and any implementation manner of the seventh aspect respectively correspond to the first aspect and any implementation manner of the first aspect. For the technical effects corresponding to the seventh aspect and any implementation manner of the seventh aspect, reference may be made to the technical effects corresponding to the first aspect and any implementation manner of the first aspect above, and details are not described herein again.
[0074] Eighth aspect, an embodiment of the present application 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 in the second aspect or any possible implementation manner of the second aspect are caused to be executed.
[0075] The eighth aspect and any implementation of the eighth aspect respectively correspond to the second aspect and any implementation of the second aspect. For the technical effects corresponding to the eighth aspect and any implementation of the eighth aspect, reference can be made to the technical effects corresponding to the second aspect and any implementation of the second aspect above, which will not be elaborated here.
[0076] In a ninth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, which, when running on a computer or a processor, causes the computer or the processor to execute the method in the first aspect or any possible implementation of the first aspect.
[0077] The ninth aspect and any implementation of the ninth aspect respectively correspond to the first aspect and any implementation of the first aspect. For the technical effects corresponding to the ninth aspect and any implementation of the ninth aspect, reference can be made to the technical effects corresponding to the first aspect and any implementation of the first aspect above, which will not be elaborated here.
[0078] In a tenth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, which, when running on a computer or a processor, causes the computer or the processor to execute the method in the second aspect or any possible implementation of the second aspect.
[0079] The tenth aspect and any implementation of the tenth aspect respectively correspond to the second aspect and any implementation of the second aspect. For the technical effects corresponding to the tenth aspect and any implementation of the tenth aspect, reference can be made to the technical effects corresponding to the second aspect and any implementation of the second aspect above, which will not be elaborated here.
[0080] In an eleventh aspect, an embodiment of the present application provides a computer program product including computer instructions, which, when executed by a computer or a processor, cause the computer or the processor to execute the method in the first aspect or any possible implementation of the first aspect.
[0081] The eleventh aspect and any implementation of the eleventh aspect respectively correspond to the first aspect and any implementation of the first aspect. For the technical effects corresponding to the eleventh aspect and any implementation of the eleventh aspect, reference can be made to the technical effects corresponding to the first aspect and any implementation of the first aspect above, which will not be elaborated here.
[0082] In a twelfth aspect, an embodiment of the present application provides a computer program product, which includes computer instructions. When the computer instructions are executed by a computer or a processor, the computer or the processor is caused to execute the method in the second aspect or any possible implementation manner of the second aspect.
[0083] The twelfth aspect and any implementation manner of the twelfth aspect respectively correspond to the second aspect and any implementation manner of the second aspect. For the technical effects corresponding to the twelfth aspect and any implementation manner of the twelfth aspect, reference may be made to the technical effects corresponding to the second aspect and any implementation manner of the second aspect above, which will not be elaborated herein.
[0084] In a thirteenth aspect, an embodiment of the present application provides a bitstream, which is generated according to the first aspect and any implementation manner of the first aspect above.
[0085] In a fourteenth aspect, an embodiment of the present application provides a bitstream, which includes QP residual coding data of non-private CUs in a coding unit quantization parameter CUQP group and a first identifier, and the first identifier indicates the number of encoded non-private CUs in the CUQP group.
[0086] According to the fourteenth aspect, the bitstream further includes QP residual coding data of private CUs in the CUQP group and a second identifier, and the second identifier indicates the number of encoded private CUs in the CUQP group.
[0087] According to the fourteenth aspect, or any implementation manner of the above fourteenth aspect, the bitstream further includes QP residual coding data of private CUs in the CUQP group and a third identifier, and the third identifier indicates the number of all encoded CUs in the CUQP group.
[0088] In a fifteenth aspect, an embodiment of the present application further provides a computer-readable storage medium, which is characterized in that the computer-readable storage medium stores a bitstream as in the fourteenth aspect and any implementation manner of the fourteenth aspect, or stores the bitstream in the thirteenth aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0089] Figure 1A It is a schematic diagram of an exemplary application scenario;
[0090] Figure 1B It is a schematic diagram of an exemplary compression framework;
[0091] Figure 2A It is a schematic diagram of an exemplary encoding framework;
[0092] Figure 2B It is a schematic diagram of an exemplary decoding framework;
[0093] Figure 3Encoding process of quantization parameter QP shown exemplarily;
[0094] Figure 4 Decoding process of quantization parameter QP shown exemplarily;
[0095] Figure 5 Encoding process of quantization parameter QP shown exemplarily;
[0096] Figure 6 Decoding process of quantization parameter QP shown exemplarily;
[0097] Figure 7 Encoding process of quantization parameter QP shown exemplarily;
[0098] Figure 8 Decoding process of quantization parameter QP shown exemplarily;
[0099] Figure 9 Schematic structural diagram of the device shown exemplarily. Detailed implementation manners
[0100] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are some, but not all, of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the protection scope of the present application.
[0101] The term "and / or" in this application is only used to describe the associated relationship of associated 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.
[0102] The terms "first", "second", etc. in the description and claims of the embodiments of the present application are used to distinguish different objects, rather than to describe a specific order of the objects. For example, the first target object and the second target object are used to distinguish different target objects, rather than to describe a specific order of the target objects.
[0103] In the embodiments of the present application, words such as "exemplarily" or "for example" are used to give examples, illustrations or explanations. Any embodiment or design solution described as "exemplarily" or "for example" in the embodiments of the present application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Exactly, using words such as "exemplarily" or "for example" aims to present relevant concepts in a specific manner.
[0104] In the description of the embodiments of the present application, unless otherwise specified, the meaning of "a plurality" refers to two or more. For example, a plurality of processing units refers to two or more processing units; a plurality of systems refers to two or more systems.
[0105] Figure 1A It is a schematic diagram of an exemplary application scenario. Among them, Figure 1A The shown application scenario is a video surveillance scenario; it should be understood that the present application can also be applied to any scenario that requires video (or image) privacy protection, and the present application does not limit this.
[0106] Referring to Figure 1A , exemplarily, image acquisition devices can be deployed at positions such as intersections, mall entrances and exits, and school gates. The image acquisition devices collect video data, and then transmit the collected video data to at least one terminal device through a network. For example, the video data collected by the image acquisition device deployed at an intersection can be transmitted to a smart screen, the video data collected by the image acquisition device deployed at a mall entrance and exit can be transmitted to a smart screen and a tablet computer, and the video data collected by the image acquisition device deployed at a school gate can be transmitted to a smart screen and a personal computer, and so on. After receiving the video data sent by the image acquisition device, the terminal device can store and display the video data (or the video data processed according to requirements) to facilitate the user to monitor the monitored area.
[0107] It should be noted that the actions of the image acquisition device in the present application to collect video data, transmit video data, and the terminal device to store, process, and display video data are all carried out on the premise of complying with the corresponding data protection regulations and policies of the country where it is located and obtaining the authorization given by the owner of the corresponding device.
[0108] Exemplarily, after the image acquisition device compresses (or encodes) the collected video data to obtain a bitstream (which can also be called a bitstream or a bit stream (Bit stream)), it can then transmit the bitstream to the terminal device to reduce the amount of data transmitted and reduce the bandwidth requirement.
[0109] Figure 1B It is a schematic diagram of an exemplary compression framework.
[0110] Referring to Figure 1B , exemplarily, the image acquisition device can include a camera, an encoding module (or an encoder), and a sending module. Exemplarily, the encoding module can be a software module or a hardware module, and the embodiments of the present application do not limit this. It should be understood that Figure 1B is only an example of the image acquisition device, and the image acquisition devices in other embodiments of the present application have more Figure 1BFor more modules shown, the embodiments of the present application do not limit this.
[0111] Referring to Figure 1B , exemplarily, the terminal device may include a display module, a decoding module (or decoder), and a receiving module. Exemplarily, the decoding module may be a software module or a hardware module, and the embodiments of the present application do not limit this. It should be understood that Figure 1B is only an example of the terminal device, and the terminal devices in other embodiments of the present application have more modules than Figure 1B shown, and the embodiments of the present application do not limit this.
[0112] Continuing to refer to Figure 1B , exemplarily, the process of the image acquisition device sending the original video data collected by the camera to the terminal device for display is as follows: The camera may output the collected original video data to the encoding module; then, the encoding module may encode the original video data to obtain a bitstream and output the encoded bitstream to the sending module; thereafter, the sending module may send the bitstream to the terminal device. Subsequently, the receiving module of the terminal device may receive the bitstream; then, the bitstream is output to the decoding module; then, the decoding module may decode the bitstream to obtain the reconstructed video data and output the reconstructed video data to the display module, and the display module may display the reconstructed video data.
[0113] Exemplarily, subsequently, the Figure 1B image acquisition device in may be referred to as the encoding end, and the terminal device in Figure 1B may be referred to as the decoding end; the encoding process of the encoding end and the decoding process of the decoding end may refer to the description of the subsequent embodiments.
[0114] Figure 2A is a schematic diagram of the encoding framework of the encoder shown by way of example. Figure 2A The dotted line in represents the data stream of the control parameters. Exemplarily, the control parameters may include but are not limited to: mode decision results, partitioning information of coding units (CUs), transformation parameters, and quantization parameters (QPs), etc., and the present application does not limit this.
[0115] Referring to Figure 2A , exemplarily, a frame of the video data (which may be referred to as the original image of the current frame) may be input to the partitioning module, and the partitioning module may partition the original image of the current frame into multiple CUs according to the partitioning information of the CUs, and then encode each CU in turn. The following takes encoding a CU (referred to as the current CU) as an example for illustration.
[0116] Exemplarily, based on the mode decision result, it can be determined whether to perform inter-frame prediction or intra-frame prediction on the current CU. When it is determined to perform intra-frame prediction on the current CU, the intra-frame prediction module can search in the reconstructed blocks of the current frame to determine the prediction block of the current CU; then, determine the residual between the current CU and the prediction block of the current CU (which can also be referred to as the residual of the current CU or the image residual of the current CU). After that, 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 operations such as entropy coding on the transformed and quantized residual, and thus obtains the bitstream of the current CU.
[0117] Exemplarily, when it is determined to perform inter-frame prediction on the current CU, the inter-frame prediction module can perform motion search and motion estimation in the encoded frames to determine the motion vector (MV) of the current CU and the prediction block of the current CU; then, determine the residual between the current CU and the prediction block of the current CU. After that, 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 operations such as entropy coding on the transformed and quantized residual, and thus obtains the bitstream of the current CU.
[0118] In addition, the control parameters can also be encoded into the bitstream. Among them, the control parameters can be quantized and entropy-coded to achieve encoding the control parameters into the bitstream.
[0119] Exemplarily, a reconstruction operation can also be performed during the process of encoding the original image of the current frame to generate the reconstructed image of the current frame. Exemplarily, the inverse quantization module can inverse-quantize the transformed and quantized residual according to the quantization parameters to obtain the transformed residual; the inverse transform module can inverse-transform the transformed residual according to the transform parameters to obtain the residual of the current CU (where the residual obtained by inverse quantization and inverse transformation is different from the residual before transformation and quantization, and the present application does not distinguish between the two in terms of name). Then, add the residual of the current CU to the prediction block of the current CU to obtain the reconstructed block of the current CU. After that, the loop filter 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, the filtered reconstructed blocks of all CUs obtained by dividing the original image of the current frame can form the reconstructed image of the current frame.
[0120] Figure 2B It is a schematic diagram showing the decoding process of the decoder shown exemplarily. Figure 2BThe dashed lines therein represent the data stream of control parameters. Exemplarily, the control parameters may include, but are not limited to, mode decision results, partitioning information of coding units (CUs), transform parameters, quantization parameters (QPs), etc. This application places no restrictions thereon.
[0121] Referring to Figure 2B , exemplarily, the entropy decoding module may parse (also referred to as entropy decode) the partitioning information of the CU from the bitstream, and determine the current CU according to the partitioning information of the CU. Then, for the current CU, the entropy decoding module may parse the mode decision result from the corresponding part of the current CU in the bitstream. When it is determined according to the mode decision result that the prediction mode of the current CU is the inter prediction mode, the inter prediction module may perform inter prediction on the current CU to obtain the prediction block of the current CU. When it is determined according to the mode decision result that the prediction mode of the current CU is the intra prediction mode, the intra prediction module may perform intra prediction on the current CU to obtain the prediction block of the current CU.
[0122] Exemplarily, the entropy decoding module may also parse the control parameters and the transformed and quantized residuals from the bitstream; then, the dequantization module may dequantize the transformed and quantized residuals according to the quantization parameters to obtain the transformed residuals; the inverse transform module may perform inverse transform on the transformed residuals according to the transform parameters to obtain the residuals of the current CU. Then, the residuals of the current CU and the prediction block of the current CU may be added together to obtain the reconstructed block of the current CU; then, the loop filter module may 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. The filtered reconstructed blocks of multiple CUs belonging to the current frame may form the reconstructed image of the current frame.
[0123] The encoding and decoding process of the quantization parameter QP will be described below.
[0124] Exemplarily, for video data that requires privacy protection, each frame image of the video data may include one or more privacy CUs, and / or one or more non-privacy CUs.
[0125] Exemplarily, the privacy CU contains privacy information, and the non-privacy CU does not contain privacy information.
[0126] Among them, the privacy information may refer to a secret that a person is unwilling to disclose or make known to others (people outside a certain scope), and this secret is information that has nothing to do with the interests of other people and society. In some scenarios, the privacy information may also be referred to as user information, and the user information may refer to information that directly or indirectly describes the user's identity. 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., and the present application does not limit this.
[0127] The encoding and decoding processes of the quantization parameter QP of the privacy CU and the quantization parameter QP of the non-privacy CU are described below, respectively.
[0128] Figure 3 For the encoding process of the quantization parameter QP shown exemplarily. In Figure 3 it describes the encoding process of the quantization parameter QP of the non-privacy CU.
[0129] S301, determine the QP prediction value of the non-privacy CU to be encoded in the CU QP group according to the QP reconstruction value of the encoded non-privacy CU in the CU quantization parameter CU QP group.
[0130] Exemplarily, a CU QP group (that is, a QP group at the CU level) may include multiple CUs; among them, a CU QP group may include one or more privacy CUs and / or one or more non-privacy CUs.
[0131] Generally, in order to protect the privacy information in the video data, only the decoding end with low user permissions (such as the user permissions being lower than the preset permissions) is allowed to decode the non-privacy CU, and the decoding end with low user permissions is not allowed to decode the privacy CU. Furthermore, the present application can determine the QP prediction value of the non-privacy CU to be encoded in the CU QP group according to the QP reconstruction value of the encoded non-privacy CU in the CU QP group; in this way, during the decoding process, 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; without relying on the privacy CU.
[0132] S302, determine the QP residual of the non-privacy CU to be encoded according to the QP original value of the non-privacy CU to be encoded and the QP prediction value of the non-privacy CU to be encoded.
[0133] In a possible way, the QP residual of the non-privacy CU to be encoded can be obtained by subtracting the QP prediction value of the non-privacy CU to be encoded from the QP original value of the non-privacy CU to be encoded.
[0134] In a possible way, the QP residual of the non-privacy CU to be encoded can be obtained by subtracting the QP original value of the non-privacy CU to be encoded from the QP prediction value of the non-privacy CU to be encoded.
[0135] Among them, the original QP value of the non-private CU to be encoded can refer to the QP value used for quantizing the non-private CU to be encoded, and the original QP value of the non-private CU to be encoded can also be referred to as the target QP value of the non-private CU to be encoded.
[0136] Exemplarily, the QP residual of the non-private CU can be referred to as the deltaQP of the non-private CU.
[0137] S303. Determine the context model corresponding to the QP residual of the non-private CU to be encoded according to the number of encoded non-private CUs in the CU QP group.
[0138] Exemplarily, the encoding end can pre-store multiple context models (which can also be referred to as probability models); each context model can be set with a context model index correspondingly. During the process of encoding the QP of the non-private CU to be encoded, the first context model index can be determined according to the number of encoded non-private CUs in the CU QP group; then, according to the first context model index, select the context model corresponding to the QP residual of the non-private CU to be encoded from multiple context models.
[0139] For example, the encoding end stores 4 context models, and the context model indexes (which can be represented by ctxIdxInc) of these 4 context models are 0, 1, 2, and 3 respectively. A way to determine the context model index corresponding to the QP residual of the non-private CU to be encoded according to the number of encoded non-private CUs in the CU QP group (which can be represented by NumDeltaQp) can be: ctxIdxInc = min(NumDeltaQp, 2); that is, select the minimum value from the number of encoded non-private CUs in the CU QP group and 2 as the first context model index.
[0140] It should be understood that modeling can also be performed during the encoding process. For example, according to the first context model index, a context model corresponding to the QP residual of the non-private CU to be encoded can be established, and this application does not limit this.
[0141] In this way, the decoding end can also determine the context model corresponding to the QP residual of the non-private CU to be decoded in this way without relying on the private CU.
[0142] S304. Perform entropy encoding on 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.
[0143] Exemplarily, the absolute value of the QP residual of the non-private CU to be encoded can be calculated first; then, the absolute value of the QP residual of the non-private CU to be encoded is quantized to obtain a first quantization value; thereafter, entropy coding is performed on the first quantization value according to the context model corresponding to the QP residual of the non-private CU to be encoded. In this case, the sign (i.e., positive or negative sign) of the QP residual of the non-private CU to be encoded can also be encoded.
[0144] In this way, the bitstream encoded according to S301 to S304 can include the QP residual encoding data of the non-private CUs in the CU QP group. Among them, the QP residual encoding data of the non-private CUs in the CU QP group can include the encoding data of the first quantization value and the encoding data of the sign of the QP residual of the non-private CU.
[0145] Figure 4 For the decoding process of the quantization parameter QP shown exemplarily. In Figure 4 the decoding process of the quantization parameter QP of the non-private CU is described. Figure 4 The decoding process of Figure 3 corresponds to the encoding process of
[0146] S401, receive the bitstream, which includes the QP residual encoding data of the non-private CUs in the coding unit quantization parameter CU QP group.
[0147] Exemplarily, after the encoding end sends the bitstream to the decoding end, the decoding end can receive the bitstream; the bitstream can include the QP residual encoding data of the non-private CUs in the CU QP group.
[0148] S402, determine the context model corresponding to the QP residual of the non-private CU to be decoded in the CU QP group according to the number of decoded non-private CUs in the CU QP group.
[0149] Exemplarily, the decoding end can pre-store multiple context models (which can also be called probability models); each context model can be set with a context model index. It should be noted that the context models stored by the decoding end and the encoding end are the same, and the context model indexes of the same context model in the decoding end and the encoding end are also the same.
[0150] Exemplarily, the first context model index can be determined according to the number of decoded non-private CUs in the CU QP group; then, according to the first context model index, the context model corresponding to the QP residual of the non-private CU to be decoded is selected from multiple context models.
[0151] For example, the decoding end stores 4 context models, and the context model indexes of these 4 context models (which can be represented by ctxIdxInc) are 0, 1, 2, and 3 respectively. According to the number of decoded non-private CUs in the CU QP group (which can be represented by NumDeltaQp), one way to determine the context model index corresponding to the QP residual of the to-be-decoded non-private CU can be: ctxIdxInc = min(NumDeltaQp, 2); that is, select the minimum value from the number of decoded non-private CUs in the CU QP group and 2 as the first context model index.
[0152] It should be understood that modeling can also be performed during the decoding process. For example, according to the first context model index, a context model corresponding to the QP residual of the to-be-decoded non-private CU can be established, and this application places no restrictions on this.
[0153] S403. According to the context model corresponding to the QP residual of the to-be-decoded non-private CU, perform entropy decoding on the QP residual encoded data of the to-be-decoded non-private CU to obtain the QP residual of the to-be-decoded non-private CU.
[0154] Exemplarily, the QP residual encoded data of the to-be-decoded non-private CU in the CU QP group may include the encoded data of the first quantization value and the encoded data of the sign of the QP residual of the to-be-decoded non-private CU.
[0155] Exemplarily, according to the context model corresponding to the QP residual of the to-be-decoded non-private CU, perform entropy decoding on the encoded data of the first quantization value 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 to-be-decoded non-private CU.
[0156] Exemplarily, the encoded data of the sign of the QP residual of the to-be-decoded non-private CU can be entropy decoded to obtain the sign of the QP residual of the to-be-decoded non-private CU; according to the absolute value of the QP residual of the to-be-decoded non-private CU and the sign of the QP residual of the to-be-decoded non-private CU, determine the QP residual of the to-be-decoded non-private CU.
[0157] For example, the following method can be referred to: deltaQP = cu_qp_delta_sign? -cu_qp_delta_abs:cu_qp_delta_abs
[0158] Wherein, deltaQP is the QP residual of the to-be-decoded non-private CU, cu_qp_delta_abs is the absolute value of the QP residual of the to-be-decoded non-private CU, and cu_qp_delta_sign is the sign of the QP residual of the to-be-decoded non-private CU.
[0159] S404. Determine the QP prediction value of the non-private CU to be decoded according to the reconstructed value of the QP of the decoded non-private CU in the CU QP group.
[0160] Exemplarily, S404 can refer to the description of S301 and will not be elaborated here. That is to say, the way for the decoding end to determine the QP prediction value of the non-private CU to be decoded is the same as the way for the encoding end to determine the QP prediction value of the non-private CU to be encoded.
[0161] S405. Add the QP prediction value of the non-private CU to be decoded and the QP residual of the non-private CU to be decoded to obtain the QP reconstructed value of the non-private CU to be decoded.
[0162] Exemplarily, the QP prediction value of the non-private CU to be decoded and the QP residual of the non-private CU to be decoded can be added to obtain the QP reconstructed value of the non-private CU to be decoded.
[0163] For a decoding end with only low user permissions, since the encoding and decoding of the QP of the non-private CU by the encoding and decoding ends only depend on the QP of the encoded / decoded non-private CU, it can be ensured that the QP decoded by the decoding end is consistent with the QP encoded by the encoding end. And the encoding and decoding of the QP of the non-private CU by the encoding and decoding ends only depend on the number of the QP of the encoded / decoded non-private CU. Furthermore, 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, it can be ensured that the decoding process of the QP of the non-private CU by the decoding end is consistent with the encoding process of the QP of the non-private CU by the encoding end, thereby improving the reconstruction quality of the reconstructed block of the non-private CU.
[0164] It should be understood that the decoding processes of S401 to S405 are also applicable to the decoding of the QP of the non-private CU by a terminal device with high user permissions (such as the user permission is higher than the preset permission).
[0165] In a possible way, the encoding processes of the QP of the non-private CU and the QP of the private CU can be completely decoupled, and the decoding processes of the QP of the non-private CU and the QP of the private CU can be completely decoupled to ensure that the decoding processes of the QP of the non-private CU and the QP of the private CU by the decoding end are both consistent with the encoding processes of the QP of the non-private CU and the QP of the private CU by the encoding end.
[0166] Figure 5 For the schematic diagram of the encoding process of the quantization parameter QP shown exemplarily. In Figure 5 it describes the encoding processes of the quantization parameter QP of the non-private CU and the quantization parameter QP of the private CU.
[0167] S501. Determine the QP prediction value of the non-private CU to be coded in the CU QP group according to the QP reconstruction value of the coded non-private CUs in the CU QP group.
[0168] Exemplarily, when the non-private CU to be coded is not the first CU in the CU QP group, use the QP reconstruction value of the previous coded non-private CU of the non-private CU to be coded as the QP prediction value of the non-private CU to be coded. When the non-private CU to be coded is the first CU in the CU QP group, use the QP reconstruction value of the coded non-private CU on the left side of the non-private CU to be coded as the QP prediction value of the non-private CU to be coded.
[0169] S502. Determine the QP residual of the non-private CU to be coded according to the original QP value of the non-private CU to be coded and the QP prediction value of the non-private CU to be coded.
[0170] S503. Determine the context model corresponding to the QP residual of the non-private CU to be coded according to the number of coded non-private CUs in the CU QP group.
[0171] Exemplarily, the bitstream includes a first identifier (which can be NumDeltaQp, and the first identifier can indicate the number of coded non-private CUs in the CU QP group); thus, the number of coded non-private CUs in the CU QP group can be determined according to the value of the first identifier.
[0172] Exemplarily, S502 to S503 can refer to the descriptions of S302 to S303 above and will not be elaborated here.
[0173] S504. Entropy code the QP residual of the non-private CU to be coded according to the context model corresponding to the QP residual of the non-private CU to be coded.
[0174] Exemplarily, first calculate the absolute value of the QP residual of the non-private CU to be coded; then quantize the absolute value of the QP residual of the non-private CU to be coded to obtain a first quantization value. Among them, the first quantization value can include multiple bits, and different context models can be used for entropy coding of the multiple bits of the first quantization value.
[0175] Exemplarily, entropy code the first bit of the first quantization value according to the context model corresponding to the QP residual of the non-private CU to be coded; use a specified context model to entropy code the other bits of the first quantization value.
[0176] Exemplarily, the specified context model can refer to the context model with the context model index ctxIdxInc = 3.
[0177] Exemplarily, a unary code can be used to perform entropy coding on 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. It should be understood that the algorithm used by this application for entropy coding the first quantization value is not limited.
[0178] Exemplarily, 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-private CU to be encoded, the number of encoded non-private CUs in the CU QP group can be determined according to the value of the first identifier.
[0179] S505, determine the QP prediction value of the private CU to be encoded in the CU QP group according to the QP reconstruction value of the encoded private CUs in the CU QP group.
[0180] Generally, for a decoding end with high user permissions, both non-private CUs and private CUs can be decoded. In order to decouple the encoding and decoding processes of the QP of non-private CUs and the QP of private CUs, this application can determine the QP prediction value of the private CU to be encoded in the CU QP group only according to the QP reconstruction value of the encoded private CUs in the CU QP group; in this way, the decoding end can also use the same method to determine the QP prediction value of the private CU to be encoded in the CU QP group during the decoding process; without relying on non-private CUs.
[0181] Exemplarily, when the private CU to be encoded is not the first CU in the CU QP group, the QP reconstruction value of the previous encoded private CU of the private CU to be encoded is used as the QP prediction value of the private CU to be encoded. When the private CU to be encoded is the first CU in the CU QP group, the QP reconstruction value of the encoded private CU on the left side of the private CU to be encoded in the CU QP group is used as the QP prediction value of the private CU to be encoded.
[0182] S506, determine the QP residual of the private CU to be encoded according to the QP original value of the private CU to be encoded and the QP prediction value of the private CU to be encoded.
[0183] In one possible way, the QP residual of the private CU to be encoded can be obtained by subtracting the QP prediction value of the private CU to be encoded from the QP original value of the private CU to be encoded.
[0184] In one possible way, the QP residual of the private CU to be encoded can be obtained by subtracting the QP original value of the private CU to be encoded from the QP prediction value of the private CU to be encoded.
[0185] Wherein, the QP original value of the private CU to be encoded can refer to the QP value used for quantizing the private CU to be encoded, and the QP original value of the private CU to be encoded can also be referred to as the QP target value of the private CU to be encoded.
[0186] S507. Determine the context model corresponding to the QP residual of the privacy CU to be coded in the CU QP group according to the number of coded privacy CUs in the CU QP group.
[0187] Exemplarily, the encoder may pre-store multiple context models (which may also be referred to as probability models); each context model may be correspondingly set with a context model index; the second context model index may be determined according to the number of coded privacy CUs in the CU QP group; then, according to the second context model index, select the context model corresponding to the QP residual of the privacy CU to be coded from the multiple context models.
[0188] For example, the encoder stores 4 context models, and the context model indexes (which may be represented by ctxIdxInc) of these 4 context models are 0, 1, 2, and 3 respectively. A way to determine the context model index corresponding to the QP residual of the privacy CU to be coded according to the number of coded privacy CUs in the CU QP group (which may be represented by NumDeltaQpPrivacy) may be: ctxIdxInc = min(NumDeltaQpPrivacy, 2); that is, select the minimum value from the number of coded privacy CUs in the CU QP group and 2 as the second context model index.
[0189] It should be understood that modeling may also be performed during the coding process. For example, according to the second context model index, a context model corresponding to the QP residual of the privacy CU to be coded may be established, and this application places no restrictions on this.
[0190] In this way, the decoder can also determine the context model corresponding to the QP residual of the privacy CU to be decoded in this manner without relying on non-privacy CUs.
[0191] Exemplarily, the bitstream includes a second identifier (which may be NumDeltaQpPrivacy, and the second identifier may indicate the number of coded privacy CUs in the CU QP group); furthermore, the number of coded privacy CUs in the CU QP group may be determined according to the value of the second identifier.
[0192] S508. Perform entropy coding on the QP residual of the privacy CU to be coded according to the context model corresponding to the QP residual of the privacy CU to be coded.
[0193] Exemplarily, first calculate the absolute value of the QP residual of the privacy CU to be coded; then quantize the absolute value of the QP residual of the privacy CU to be coded to obtain a second quantization value. Among them, the second quantization value may include multiple bits, and different context models may be used for entropy coding for the multiple bits of the first quantization value.
[0194] Exemplarily, the first bit of the second quantization value may be entropy encoded according to the context model corresponding to the QP residual of the privacy CU to be encoded; the other bits of the second quantization value may be entropy encoded using a specified context model.
[0195] Exemplarily, a unary code may be used to entropy encode the QP residual of the privacy CU to be encoded according to the context model corresponding to the QP residual of the privacy CU to be encoded. It should be understood that the algorithm used by the present application for entropy encoding the second quantization value is not limited.
[0196] Exemplarily, after S508 is executed, the value of the second identifier may 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 may be determined according to the value of the second identifier.
[0197] The encoding process of non-privacy CUs is briefly described below.
[0198] Intra mode and inter - frame motion information derivation :
[0199] When performing intra prediction mode derivation for a non-privacy CU, if the reference position is a privacy area, the position is set to unavailable;
[0200] When performing inter motion information derivation for a non-privacy CU, if the reference spatial position or temporal position (TMVP) is a privacy area, the position is set to unavailable.
[0201] Intra prediction and inter - frame prediction :
[0202] When performing intra prediction for a non-privacy CU, if the reference pixel position is in a privacy area, the reference pixel is set to unavailable;
[0203] When performing inter prediction for a non-privacy CU, if the reference pixel position is in a privacy area, the reference pixel is set to the median value. Here, the median value may refer to the average of the maximum and minimum pixel values.
[0204] Loop filtering :
[0205] Deblocking filter (DBK) module: No filtering is performed on the boundary between the privacy CU and the non-privacy CU (neither pixel on both sides of the boundary is filtered).
[0206] Adaptive loop filter (ALF) module: When filtering a non-privacy CU, if the reference pixel of the pixel to be filtered has a pixel in the privacy area, the pixel filtering is skipped. No filtering is performed on the boundary between the non-privacy CU and the privacy CU.
[0207] Sampling Adaptive Offset (SAO) module: When filtering non-private CUs, if the reference pixel of the pixel to be filtered has a pixel within the privacy area, the filtering of that pixel is skipped. No filtering is performed at the boundary between non-private CUs and private CUs.
[0208] Entropy coding process :
[0209] Use the first entropy encoder to perform entropy coding on the image of the non-private CU (such as the image residual of the CU) to obtain a non-private VCL NALU (Video Coding Layer, Network abstract layer unit); use the second entropy encoder to perform entropy coding on the image of the private CU (or the image residual of the private CU) to obtain a private VCL NALU.
[0210] It should be noted that the first entropy encoder can be used to execute S504, and the second entropy encoder can be used to execute S508. Among them, the difference between the first entropy coding and the second entropy encoder lies in the different storage up and down models.
[0211] Exemplarily, the bitstream encoded according to the encoding method of S501 to S508 may include a non-private VCL NALU (Video Coding Layer, Network abstract layer unit) and a private VCL NALU.
[0212] Exemplarily, during the encoding process according to the encoding method of S501 to S508, non-image coding data such as some high-level syntax (such as Sequence Parameter Set (SPS), Picture Parameter Set (PPS), Picture Header (PH)) can also be encoded to obtain a NON-VCL NALU.
[0213] That is to say, the bitstream encoded by the encoding end may include a private VCL NALU, a non-private VCL NALU, and a NON-VCL NALU.
[0214] Exemplarily, the non-private VCL NALU may include the image residual coding data of the non-private CU (obtained by encoding the image residual of the non-private CU), the QP residual coding data of the non-private CU (such as cu_qp_delta_abs of the non-private CU and cu_qp_delta_sign of the non-private CU), and a first identifier.
[0215] Exemplarily, the privacy VCL NALU may include the image residual coding data of the privacy CU (obtained by coding the image residual of the privacy CU), the coded data of the QP residual of the privacy CU (such as cu_qp_delta_abs of the privacy CU and cu_qp_delta_sign of the privacy CU), and a second identifier.
[0216] Exemplarily, different non-privacy CUs belonging to the same CU QP group may be located in different non-privacy VCL NALUs.
[0217] Exemplarily, different privacy CUs belonging to the same CU QP group may be located in different privacy VCL NALUs.
[0218] Exemplarily, a fourth identifier is included in the NALU header of the VCL NALU, and the fourth identifier indicates whether the VCL NALU is a privacy VCL NALU or a non-privacy VCL NALU.
[0219] Exemplarily, the VCL NALU further includes the QP residual coding data of the CU and the image residual coding data of the CU. A fifth identifier is further included in the non-privacy VCL NALU, where the fifth identifier indicates whether the CU is located in a privacy area. In addition, the non-privacy VCL NALU may further include parameters such as filtering parameters. For details, reference may be made to the description in the AVS 3 standard, and this application does not limit this.
[0220] Exemplarily, the definition of the coding tree in the bitstream encoded according to the coding method of S501 to S508 may be as shown in Table 1 below:
[0221] Table 1 Coding Tree Definition
[0222]
[0223] NumDeltaQp
[0224] It may be referred to as the first identifier, indicating the number of encoded non-privacy CUs in a CU QP group.
[0225] NumDeltaQpPrivacy
[0226] It may be referred to as the second identifier, indicating the number of encoded privacy CUs in a CU QP group.
[0227] For the definitions of other syntax elements in Table 1, reference may be made to the description in the AVS 3 standard, and details are not elaborated here.
[0228] It should be noted that, compared with the existing technology coding tree, NumDeltaQpPrivacy is newly added to the coding tree in Table 1 of this application.
[0229] Exemplarily, the definition of the coding unit in the bitstream encoded according to the coding method of S501 to S508 can be as shown in Table 2 below:
[0230] Table 2 Coding Unit Definition
[0231]
[0232] cu_qp_delta_abs
[0233] Indicates the absolute value of the QP residual of the CU.
[0234] cu_qp_delta_sign
[0235] Indicates the sign of the QP residual of the CU
[0236] NumDeltaQpPrivacy
[0237] Can be referred to as the second identifier, indicating the number of encoded privacy CUs in a CU QP group.
[0238] NumDeltaQp
[0239] Can be referred to as the first identifier, indicating the number of encoded non-privacy CUs in a CU QP group.
[0240] For the definitions of other syntax elements in Table 2, reference can be made to the description in the AVS 3 standard and will not be elaborated here.
[0241] It should be noted that compared with the coding unit of the prior art, NumDeltaQpPrivacy is newly added to the coding unit in Table 2 of this application.
[0242] Exemplarily, the method for determining ctxIndexInc of cu_qp_delta_abs can be as follows:
[0243] If binIndex is 0 and PrivacyLevel is 0, then ctxIndexInc = min(NumDeltaQp, 2);
[0244] Otherwise, if binIndex is 0 and PrivacyLevel is not 0, then ctxIndexInc = min(NumDeltaQpPrivacy, 2);
[0245] Otherwise, ctxIndexInc is equal to 3.
[0246] Among them, for the definitions of binIndex and PrivacyLevel, reference can be made to the description in the AVS 3 standard and will not be elaborated here.
[0247] Figure 6 Schematic diagram of the decoding process of the quantization parameter QP shown exemplarily. In Figure 6 the decoding process of the quantization parameter QP of the non-private CU and the decoding process of the quantization parameter QP of the private CU are described. Figure 6 The decoding process of Figure 5 corresponds to the encoding process of
[0248] S601, Receive the bitstream, which includes the QP residual coding data of the non-private CUs in the CU quantization parameter group of the coding unit.
[0249] Exemplarily, after receiving the bitstream, the decoder can first parse the SPS, PPS, PH and other high-level syntaxes from the NON-VCL NALU. And parse the fourth identifier from the NALU header of the VCL NALU; then determine the private VCL NALU and non-private VCL NALU in the bitstream according to the fourth identifier.
[0250] Exemplarily, a first entropy decoder can be used to parse the Slice / Tile / Patch Header from the non-private VCL NALU.
[0251] Exemplarily, a first entropy decoder can be used to parse the filtering parameters of the coding tree (for example, adaptive loop filter (ALF) parameters, sample adaptive offset (SAO) parameters, etc.) from the non-private VCL NALU.
[0252] Exemplarily, a first entropy decoder can be used to parse the partitioning information from the non-private VCL NALU until the partitioning stops (leaf node (i.e., CU)); then parse a fifth identifier from the non-private VCL NALU to determine whether the CU to be decoded is a non-private CU to be decoded.
[0253] If the CU is in the private area and the current privilege is the high user privilege, switch to the second entropy decoder, parse the information of the private CU from the private VCL NALU, and then execute S606 to S609.
[0254] If the CU is in the private area and the current privilege is the low user privilege, skip the parsing of this CU.
[0255] If the CU is not in the private area, continue to use the first entropy decoder to parse the information of the non-private CU from the non-private VCL NALU, and then execute S602 to S605.
[0256] Exemplarily, the difference between the first entropy decoder and the second entropy decoder lies in that the context models stored in the first entropy decoder and the second entropy decoder are different. Among them, the first entropy decoder corresponds to the first entropy encoder, and the second entropy decoder corresponds to the second entropy encoder.
[0257] S602. Determine the context model corresponding to the QP residual of the non-private CU to be decoded in the CU QP group according to the number of decoded non-private CUs in the CU QP group.
[0258] Exemplarily, if the CU is not located in the privacy area, the information of the non-private CU parsed from the non-private VCL NALU by continuing to use the first entropy decoder can include the first identifier (NumDeltaQp); then, according to the value of the first identifier, the number of decoded non-private CUs in the CU QP group can be determined.
[0259] Among them, the number of decoded non-private CUs in the CU QP group is the value of NumDeltaQp.
[0260] Exemplarily, after determining the context model corresponding to the QP residual of the non-private CU to be decoded, the first entropy decoder can execute the following S603 to S605, which can specifically refer to the description of the above S403 to S405 and will not be elaborated here.
[0261] S603. Entropy-decode the QP residual encoded data of the non-private CU to be decoded according to the context model corresponding to the QP residual of the non-private CU to be decoded, and obtain the QP residual of the non-private CU to be decoded.
[0262] S604. Determine the QP prediction value of the non-private CU to be decoded according to the QP reconstruction value of the decoded non-private CUs in the CU QP group.
[0263] S605. Add the QP prediction value of the non-private CU to be decoded and the QP residual of the non-private CU to be decoded to obtain the QP reconstruction value of the non-private CU to be decoded.
[0264] Exemplarily, after executing S605, the value of the first identifier can be incremented by 1. In this way, when executing S602 for the next non-private CU to be decoded, the number of encoded non-private CUs in the CU QP group can be determined according to the value of the first identifier.
[0265] S606. Determine the context model corresponding to the QP residual of the private CU to be decoded according to the number of decoded private CUs in the CU QP group.
[0266] Exemplarily, if the CU is located in the privacy area and the decoding end has a high user privilege, switch to the second entropy decoder, and parse the information of the privacy CU from the privacy VCL NALU, which may include a second identifier (NumDeltaQpPrivacy); then, according to the value of the second identifier, determine the number of decoded privacy CUs in the CU QP group.
[0267] Among them, the number of decoded privacy CUs in the CU QP group is the value of NumDeltaQpPrivacy.
[0268] Exemplarily, after determining the context model corresponding to the QP residual of the privacy CU to be decoded, the second entropy decoder may execute the following S607 to S609, which can specifically refer to the description of the above S407 to S409 and will not be elaborated here.
[0269] S607: Entropy-decode the QP residual encoded data of the privacy CU to be decoded according to 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.
[0270] S608: Determine the QP prediction value of the privacy CU to be decoded according to the QP reconstruction value of the decoded privacy CUs in the CU QP group.
[0271] 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.
[0272] Exemplarily, 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 according to the value of the second identifier.
[0273] It should be noted that the derivation of the intra-mode and inter-frame motion information, intra-prediction and inter-prediction, and loop filtering in the decoding process of non-privacy CUs are similar to those in the encoding process of non-privacy CUs described above and will not be elaborated here.
[0274] Exemplarily, the decoding process of non-privacy CUs also includes an entropy decoding process, and inverse quantization, inverse transformation, and reconstruction are described.
[0275] Inverse quantization, inverse transformation, and reconstruction:
[0276] If the decoding end has a low user privilege, set the reconstructed pixels in the privacy area to default values.
[0277] Entropy decoding process:
[0278] The first entropy encoder is adopted, and the non-private VCL NALU is entropy decoded to obtain the reconstructed block of the non-private CU; when the decoder has a high user privilege, the second entropy encoder can also be adopted to decode the private VCL NALU to obtain the reconstructed block of the private CU.
[0279] Exemplarily, the specific implementation process for the codec to determine the quantization parameter QP of the CU to be encoded / decoded (including the private CU and the non-private CU) can be as follows:
[0280] Exemplarily, the determined quantization parameter of the CU to be encoded / decoded is QPx (X is Y, Cb, or Cr).
[0281] Step 1: Determine the quantization parameter CurrentQp of the CU to be encoded / decoded, and its value range should be 0 to (63 + 8×(BitDepth–8)).
[0282] — If FixedQP is 0 and CuDeltaQpFlag is 1, and the coordinates of the upper left corner of the CU to be encoded are equal to (CuQpGroupX, CuQpGroupY) (i.e., the coordinates of the upper 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-private CU) PreviousCuQp to the luminance quantization parameter (QP reconstruction value) QPY of the coding unit A (encoded non-private CU) containing the luminance component on the left of the CU to be encoded. Set the PrivacyLevel of the CU to be encoded to 0, and determine whether the coding unit A is available. If the 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 private CU) PreviousCuQpPrivacy to the luminance quantization parameter QPY of the coding unit A (encoded private CU) containing the luminance component on the left of the CU to be encoded. Set the PrivacyLevel of the CU to be encoded to 1 and determine whether the coding unit A is available. If the coding unit A is "unavailable", then the value of PreviousCuQpPrivacy is equal to PatchQp.
[0283] — If the PrivacyLevel of the CU to be encoded is 0, predCuQp is equal to PreviousCuQp; otherwise, predCuQp is equal to PreviousCuQpPrivacy.
[0284] —— If FixedQP is 1 or CuDeltaQpFlag is 0, then CurrentQp = ((PreviousQp + LCuDeltaQp + 64 + 8 * (BitDepth – 8)) % (64 + 8 * (BitDepth – 8)))CurrentQp.
[0285] —— Otherwise, if FixedQP is 0, CuDeltaQpFlag is 1, and the CU to be encoded contains only chrominance components, then CurrentQp is equal to the quantization parameter of the luminance coding unit corresponding to the bottom-right 4×4 sub-block of the CU to be encoded.
[0286] —— Otherwise, if FixedQP is 0, CuDeltaQpFlag is 1, and CuCtp is 0, then CurrentQp is equal to PreviousCuQPpredCuQp.
[0287] —— Otherwise, CurrentQp = ((PreviousCuQPpredCuQp + CuDeltaQp + 64 + 8 * (BitDepth – 8)) % (64 + 8 * (BitDepth – 8))).
[0288] —— 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
[0289] The value of PreviousQp is equal to the quantization parameter QPY of the previous decoded largest coding unit. If the previous decoded largest coding unit is "not available" or FixedQP is equal to 1, then the value of PreviousQp is equal to PatchQp. The previous decoded largest coding unit is "not available" if it does not belong to the same slice as the CU to be encoded.
[0290] Among them, the syntax elements involved in the specific implementation process of the quantization parameter QP can refer to the description in the AVS 3 standard and will not be elaborated here.
[0291] For a terminal device with only low user permissions, since the encoding and decoding of the QP of non-private CUs by the encoding and decoding ends only depend on the QPs of the encoded / decoded non-private CUs, it can be ensured that the QP decoded by the decoding end is the same as the QP encoded by the encoding end. In addition, the encoding and decoding of the QP of non-private CUs by the encoding and decoding ends only depend on the number of QPs of the encoded / decoded non-private CUs. Furthermore, it can be ensured that the context model used in the decoding process of the QP residual of non-private CUs by the decoding end is the same as the context model used in the encoding process of the QP residual of non-private CUs by the encoding end. In this way, it can be ensured that the decoding process of the QP of non-private CUs by the decoding end is the same as the encoding process of the QP of non-private CUs by the encoding end, thereby improving the reconstruction quality of the reconstructed blocks of non-private CUs.
[0292] For a terminal device with high user permissions, the QP decoding of private CUs does not depend on the QP of non-private CUs. In this way, regardless of whether the QP of non-private CUs is lost, it will not affect the decoding of the QP of private CUs. In addition, when the QP of non-private CUs is inaccurate, it will not affect the accuracy of the QP of private CUs.
[0293] In a possible way, the encoding processes of the QP of non-private CUs and the QP of private CUs can be partially decoupled, and the decoding processes of the QP of non-private CUs and the QP of private CUs can be partially decoupled to ensure that the decoding processes of the QP of non-private CUs and the QP of private CUs by the decoding end are the same as the encoding processes of the QP of non-private CUs and the QP of private CUs by the encoding end.
[0294] Figure 7 Schematic diagram of the encoding process of the quantization parameter QP shown for illustration. In Figure 7 the encoding processes of the quantization parameter QP of non-private CUs and the quantization parameter QP of private CUs are described.
[0295] S701. Determine the QP prediction value of the non-private CU to be encoded in the CU QP group according to the reconstructed value of the QP of the encoded non-private CUs in the CU QP group.
[0296] S702. Determine the QP residual of the non-private CU to be encoded according to the original value of the QP of the non-private CU to be encoded and the QP prediction value of the non-private CU to be encoded.
[0297] S703. Determine the context model corresponding to the QP residual of the non-private CU to be encoded according to the number of encoded non-private CUs in the CU QP group.
[0298] S704. Entropy-encode 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.
[0299] Exemplarily, S701 to S704 can refer to the description of the above S501 to S504, and will not be elaborated here.
[0300] S705. Determine the QP prediction value of the privacy CU to be encoded according to the QP reconstruction values of all the encoded CUs in the CU QP group.
[0301] Generally, for a decoding end with a relatively high user privilege, it can decode both non-privacy CUs and privacy CUs. Therefore, in the encoding end of this application, the QP prediction value of the privacy CU to be encoded in the CU QP group is determined according to the QP reconstruction values of all the encoded CUs (including the encoded privacy CUs and the encoded non-privacy CUs) in the CU QP group. In this way, during the decoding process, 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 manner.
[0302] In this case, the prediction value of the QP of the privacy CU to be encoded depends on the encoded non-privacy CUs and / or the encoded privacy CUs. In this way, the information used to determine the prediction value of the privacy CU to be encoded is more comprehensive. Furthermore, the determined prediction value of the QP of the privacy CU can be more accurate, thereby improving the reconstruction quality of the reconstructed block of the privacy CU.
[0303] Exemplarily, when the privacy CU to be encoded is not the first CU in the CU QP group, use the QP reconstruction value of the previous encoded CU (which may be an encoded privacy CU or an encoded non-privacy CU) of the privacy CU to be encoded 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, use the QP reconstruction value of the encoded CU on the left side of the privacy CU to be encoded in the CU QP group (which may be an encoded privacy CU or an encoded non-privacy CU) as the QP prediction value of the privacy CU to be encoded.
[0304] S706. Determine the QP residual of the privacy CU to be encoded according to the QP original value and the QP prediction value of the privacy CU to be encoded.
[0305] Exemplarily, S706 can refer to the description of the above 506, and will not be elaborated here.
[0306] S707. Determine the context model corresponding to the QP residual of the privacy CU to be encoded according to the number of all the encoded CUs in the CU QP group.
[0307] Exemplarily, the encoding end can pre-store multiple context models (which can also be referred to as probability models); each context model can be correspondingly set with a context model index; the third context model index can be determined according to 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, according to the third context model index, the context model corresponding to the QP residual of the to-be-encoded privacy CU is selected from the multiple context models.
[0308] For example, the encoding end stores 4 context models, and the context model indices (which can be represented by ctxIdxInc) of these 4 context models are 0, 1, 2, and 3 respectively. A way to determine the context model index corresponding to the QP residual of the to-be-encoded privacy CU according to the number of encoded CUs in the CU QP group (which can be represented by NumDeltaQpPrivacy) can be: ctxIdxInc = min(NumDeltaQpPrivacy, 2); that is, the minimum value is selected from the number of encoded CUs in the CU QP group and 2 as the third context model index.
[0309] Exemplarily, the bitstream includes a third identifier (which can be NumDeltaQpPrivacy, and the third identifier can indicate the number of encoded CUs in the CU QP group); furthermore, the number of encoded CUs in the CU QP group can be determined according to the value of the third identifier.
[0310] It should be understood that modeling can also be performed during the encoding process. For example, according to the third context model index, a context model corresponding to the QP residual of the to-be-encoded privacy CU can be established, and the present application does not limit this.
[0311] S708, perform entropy encoding on the QP residual of the to-be-encoded privacy CU according to the context model corresponding to the QP residual of the to-be-encoded privacy CU.
[0312] Exemplarily, the absolute value of the QP residual of the to-be-encoded privacy CU can be calculated first; then, the absolute value of the QP residual of the to-be-encoded privacy CU is quantized to obtain a third quantization value. Among them, the third quantization value can include multiple bits, and for the multiple bits of the first quantization value, different context models can be used for entropy encoding.
[0313] Exemplarily, the first bit of the third quantization value can be entropy encoded according to the context model corresponding to the QP residual of the to-be-encoded privacy CU; a specified context model can be used to entropy encode the other bits of the third quantization value to obtain a bitstream.
[0314] Exemplarily, a unary code can be used to perform entropy coding on the QP residual of the privacy CU to be coded according to the context model corresponding to the QP residual of the privacy CU to be coded. It should be understood that the present application does not limit the algorithm used for entropy coding of the QP residual of the privacy CU.
[0315] Exemplarily, 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 coded, the number of coded CUs in the CU QP group can be determined according to the value of the third identifier.
[0316] Exemplarily, the definition of the coding tree in the bitstream obtained by coding according to the coding method of S701 to S708 can be as shown in Table 3 below:
[0317] Table 3 Coding Tree Definition
[0318]
[0319] Among them, the definition of the syntax elements in Table 3 can refer to the description in Table 1 and will not be elaborated here.
[0320] It should be noted that compared with the coding tree in the prior art, the coding tree in Table 3 of the present application newly adds NumDeltaQpPrivacy.
[0321] Exemplarily, the definition of the coding unit in the bitstream obtained by coding according to the coding method of S701 to S708 can be as shown in Table 4 below:
[0322] Table 4 Coding Unit Definition
[0323]
[0324] Among them, the definition of the syntax elements in Table 4 can refer to the description in Table 2 and will not be elaborated here.
[0325] It should be noted that compared with the coding unit in the prior art, the coding unit in Table 4 of the present application newly adds NumDeltaQpPrivacy.
[0326] In addition, Figure 7 The coding process for non-privacy CUs corresponding to the embodiment is similar to the coding process for non-privacy CUs described above and will not be elaborated here.
[0327] Figure 8 It is a schematic diagram of the decoding process of the quantization parameter QP shown exemplarily. In Figure 8 the decoding process of the quantization parameter QP for non-privacy CUs and the decoding process of the quantization parameter QP for privacy CUs are described. Figure 8 The decoding process of Figure 7corresponds to the encoding process.
[0328] S801, receive a bitstream, where the bitstream includes the QP residual encoding data of non-private CUs in the CU QP group.
[0329] S802, determine the context model corresponding to the QP residual of the non-private CU to be decoded in the CU QP group according to the number of decoded non-private CUs in the CU QP group.
[0330] S803, perform entropy decoding on the QP residual encoding data of the non-private CU to be decoded according to the context model corresponding to the QP residual of the non-private CU to be decoded, to obtain the QP residual of the non-private CU to be decoded.
[0331] S804, determine the QP prediction value of the non-private CU to be decoded according to the QP reconstruction value of the decoded non-private CUs in the CU QP group.
[0332] S805, add the QP prediction value of the non-private CU to be decoded and the QP residual of the non-private CU to be decoded to obtain the QP reconstruction value of the non-private CU to be decoded.
[0333] Exemplarily, S801 to S805 can specifically refer to the descriptions of S601 to S605 above, and will not be elaborated here.
[0334] S806, determine the context model corresponding to the QP residual of the private CU to be decoded according to the number of all decoded CUs in the CU QP group.
[0335] Exemplarily, if the CU is located in the privacy area and the decoding end has high user privileges, switch to the second entropy decoder, and parse the information of the private CU from the private VCL NALU, which may include a third identifier (NumDeltaQpPrivacy); then, according to the value of the third identifier, determine the number of decoded private CUs in the CU QP group.
[0336] Among them, the number of decoded private CUs in the CU QP group is the value of NumDeltaQpPrivacy.
[0337] Exemplarily, after determining the context model corresponding to the QP residual of the private CU to be decoded, the second entropy decoder can execute the following S807 to S809, which can specifically refer to the descriptions of S407 to S409 above, and will not be elaborated here.
[0338] S807, perform entropy decoding on the QP residual encoding data of the private CU to be decoded according to the context model corresponding to the QP residual of the private CU to be decoded, to obtain the QP residual of the private CU to be decoded.
[0339] S808. Determine the QP prediction value of the privacy CU to be decoded according to the reconstructed QP values of all decoded CUs in the CU QP group.
[0340] 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 reconstructed QP value of the privacy CU to be decoded.
[0341] Exemplarily, 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 according to the value of the third identifier.
[0342] It should be noted that Figure 8 the decoding process of the non-privacy CUs corresponding to the embodiments is similar to that of the non-privacy CUs in the above Figure 6 embodiments and will not be elaborated here.
[0343] Exemplarily, the specific implementation process for the codec to determine the quantization parameter QP of the CU to be encoded / decoded (including privacy CUs and non-privacy CUs) can be as follows:
[0344] Exemplarily, the determined quantization parameter of the CU to be encoded / decoded is QPx (X is Y, Cb, or Cr).
[0345] Step 1. Determine the quantization parameter CurrentQp of the current coding unit, and its value range should be 0 to (63 + 8 × (BitDepth - 8)).
[0346] If FixedQP is 0 and CuDeltaQpFlag is 1, and the coordinates of the upper left corner of the current coding unit are equal to (CuQpGroupX, CuQpGroupY), initialize the predicted quantization parameter PreviousCuQp to the luminance quantization parameter QPY of the coding unit A containing the luminance component on the left of the current coding unit. Set the PrivacyLevel of the current coding unit to 0 and determine whether the coding unit A is available. If the coding unit A is "not available", the value of PreviousCuQp is equal to PatchQp. Initialize the predicted quantization parameter PreviousCuQpPrivacy to the luminance quantization parameter QPY of the coding unit A containing the luminance component on the left of the current coding unit. Set the PrivacyLevel of the current coding unit to 1 and determine whether the coding unit A is available. If the coding unit A is "not available", the value of PreviousCuQpPrivacy is equal to PatchQp.
[0347] If the PrivacyLevel of the current coding unit is 0, predCuQp is equal to PreviousCuQp; otherwise, predCuQp is equal to PreviousCuQpPrivacy.
[0348] If FixedQP is 1 or CuDeltaQpFlag is 0, then CurrentQp = ((PreviousQp + LCuDeltaQp + 64 + 8 * (BitDepth - 8)) % (64 + 8 * (BitDepth - 8))) CurrentQp.
[0349] Otherwise, if FixedQP is 0 and CuDeltaQpFlag is 1 and the current coding unit contains only chrominance components, then CurrentQp is equal to the quantization parameter of the luminance coding unit corresponding to the 4×4 sub-block in the lower right corner of the current coding unit.
[0350] Otherwise, if FixedQP is 0 and CuDeltaQpFlag is 1 and CuCtp is 0, then CurrentQp is equal to predCuQp.
[0351] Otherwise, CurrentQp = ((predCuQp + CuDeltaQp + 64 + 8 * (BitDepth – 8)) % (64 + 8 * (BitDepth – 8))).
[0352] Set the value of PreviousCuQpPrivacy to CurrentQp. If PrivacyLevel is 0, set the value of PriviousCuQp to CurrentQp.
[0353] The value of PreviousQp is equal to the quantization parameter QPY of the last decoded largest coding unit. If the last decoded largest coding unit is "not available" or FixedQP is equal to 1, then the value of PreviousQp is equal to PatchQp. The last decoded largest coding unit is "not available" if it does not belong to the same slice as the current coding unit.
[0354] It should be noted that in this application, only for CUs with QP residuals and containing luminance (which can be CUs containing luminance and chrominance, with residuals in any component, or if it is a CU containing luminance, with residuals in the luminance component), cu_qp_delta_abs is encoded; and when cu_qp_delta_abs is non-zero, cu_qp_delta_sign is encoded.
[0355] It should also be noted that the QP of the CUs involved in this application can be understood as the CU-level luminance QP.
[0356] It should also be noted that the present application does not limit the encoding order of the QP for the privacy CU and the QP for the non-privacy CU.
[0357] In one example, Figure 9 A schematic block diagram of a device 900 according to an embodiment of the present application is shown. The device 900 may include: a processor 901 and a transceiver / transceiver pin 902. Optionally, it may further include a memory 903.
[0358] Each component of the device 900 is coupled together through a bus 904. Among them, in addition to the data bus, the bus 904 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clear illustration, all kinds of buses are referred to as bus 904 in the figure.
[0359] Optionally, the memory 903 may be used to store the instructions in the foregoing method embodiments. The processor 901 may be used to execute the instructions in the memory 903, control the receiving pin to receive signals, and control the sending pin to send signals.
[0360] The device 900 may be the electronic device or the chip of the electronic device in the foregoing method embodiments.
[0361] Among them, all the relevant contents of each step involved in the foregoing method embodiments can be cited in the function descriptions of the corresponding functional modules, and will not be elaborated here.
[0362] An embodiment of the present application further 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. When the one or more processors execute computer instructions, the steps of the related methods described above are executed to implement the steps of the method in the above embodiments. Among them, the interface circuit is the transceiver / transceiver pin 902.
[0363] This embodiment further provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions run on an electronic device, the electronic device is caused to execute the related method steps to implement the method in the above embodiments.
[0364] This embodiment further provides a computer program product, which includes computer instructions. When the computer instructions are executed by a computer or a processor, the computer is caused to execute the related steps to implement the method in the above embodiments.
[0365] In addition, an embodiment of the present application further provides a device, which may specifically be a chip, a component or a module. The device may include a processor and a memory connected to each other. The memory is used to store computer-executable instructions. When the device runs, the processor may execute the computer-executable instructions stored in the memory so that the chip executes the methods in the above method embodiments.
[0366] Among them, the electronic device, computer-readable storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be elaborated here.
[0367] Through the description of the above embodiments, those skilled in the art can understand that for the convenience and simplicity of description, only the above division of each functional module is used as an example. In actual applications, the above functions can be allocated to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
[0368] In several embodiments provided in the present application, it should be understood that the disclosed device and method can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some interfaces. The indirect coupling or communication connection of the device or unit can be in electrical, mechanical or other forms.
[0369] The units described as separate components may or may not be physically separated. The components displayed as units may be one physical unit or multiple physical units, that is, they may be located in one place, or they may be distributed to multiple different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0370] In addition, in each embodiment of the present application, each functional unit may be integrated in a processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit. The above integrated units can be implemented in the form of hardware or in the form of software functional units.
[0371] Any content of each embodiment of the present application, as well as any content of the same embodiment, can be freely combined. Any combination of the above content is within the scope of the present application.
[0372] When an integrated unit is implemented in the form of 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 solution of the embodiments of the present application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to enable a device (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the methods of the various embodiments of the present application. The aforementioned storage medium includes: USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks, optical discs, and other various media that can store program codes.
[0373] The steps of the methods or algorithms described in combination with the disclosed content of the embodiments of the present application can be implemented in a hardware manner or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, and the software modules can be stored in a 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, mobile hard disks, CD-ROMs, or any other form of storage medium well-known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium 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 be located in an ASIC.
[0374] Those skilled in the art should be able to realize that in the above one or more examples, the functions described in the embodiments of the present application can be implemented by 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 codes on a computer-readable medium. The computer-readable medium includes computer-readable storage media and communication media, where the communication media includes any medium that facilitates the transfer of a computer program from one place to another. The storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.
[0375] The embodiments of the present application have been described above in conjunction with the accompanying drawings. However, the present application is not limited to the above specific embodiments. The above specific embodiments are merely illustrative rather than restrictive. Under the inspiration of the present application, those of ordinary skill in the art can also make many forms without departing from the purpose of the present application and the scope protected by the claims, and all of them fall within the protection scope of the present application.
Claims
1. A method for encoding quantization parameters, characterized in that, the method includes: Determine the QP prediction value of the to-be-encoded non-private CU in the CU QP group according to the QP reconstruction value of the encoded non-private CUs in the CU QP group; Determine the QP residual of the to-be-encoded non-private CU according to the QP original value and the QP prediction value of the to-be-encoded non-private CU; Determine the context model corresponding to the QP residual of the to-be-encoded non-private CU according to the number of encoded non-private CUs in the CU QP group; Perform entropy encoding on the QP residual of the to-be-encoded non-private CU according to the context model corresponding to the QP residual of the to-be-encoded non-private CU.
2. The encoding method according to claim 1, characterized in that, the method further includes: Determine the QP prediction value of the to-be-encoded private CU in the CU QP group according to the QP reconstruction value of the encoded CUs in the CU QP group; Determine the QP residual of the to-be-encoded private CU according to the QP original value and the QP prediction value of the to-be-encoded private CU; Determine the context model corresponding to the QP residual of the to-be-encoded private CU according to the number of encoded CUs in the CU QP group; Perform entropy encoding on the QP residual of the to-be-encoded private CU according to the context model corresponding to the QP residual of the to-be-encoded private CU.
3. The encoding method according to claim 2, characterized in that, the determining the QP prediction value of the to-be-encoded private CU in the CU QP group according to the QP reconstruction value of the encoded CUs in the CU QP group includes: Determine the QP prediction value of the to-be-encoded private CU according to the QP reconstruction value of the encoded private CUs in the CU QP group; the determining the context model corresponding to the QP residual of the to-be-encoded private CU according to the number of encoded CUs in the CU QP group includes: Determine the context model corresponding to the QP residual of the to-be-encoded private CU according to the number of encoded private CUs in the CU QP group.
4. The encoding method according to claim 2, characterized in that, the determining the QP prediction value of the to-be-encoded private CU in the CU QP group according to the QP reconstruction value of the encoded CUs in the CU QP group includes: Determine the QP prediction value of the to-be-encoded private CU according to the QP reconstruction values of all the encoded CUs in the CU QP group; the determining the context model corresponding to the QP residual of the to-be-encoded private CU according to the number of encoded CUs in the CU QP group includes: Determine the context model corresponding to the QP residual of the to-be-encoded private CU according to the number of all the encoded CUs in the CU QP group.
5. The method according to claim 3, characterized in that, the determining the QP prediction value of the to-be-encoded private CU according to the QP reconstruction value of the encoded private CUs in the CU QP group includes: When the privacy CU to be encoded is not the first CU in the CU QP group, use the QP reconstruction value of the previous encoded privacy CU of the privacy CU to be encoded as the QP prediction value of the privacy CU to be encoded.
6. The method according to claim 3 or 5, wherein, determining the QP prediction value of the privacy CU to be encoded according to the QP reconstruction value of the encoded privacy CU in the CU QP group includes: When the privacy CU to be encoded is the first CU in the CU QP group, use the QP reconstruction value of the encoded privacy CU on the left side of the privacy CU to be encoded in the CU QP group as the QP prediction value of the privacy CU to be encoded.
7. The method according to claim 4, wherein, determining the QP prediction value of the privacy CU to be encoded according to the QP reconstruction values of all encoded CUs in the CU QP group includes: When the privacy CU to be encoded is not the first CU in the CU QP group, use the QP reconstruction value of the previous encoded CU of the privacy CU to be encoded as the QP prediction value of the privacy CU to be encoded.
8. The method according to claim 4 or 7, wherein, determining the QP prediction value of the privacy CU to be encoded according to the QP reconstruction values of all encoded CUs in the CU QP group includes: When the privacy CU to be encoded is the first CU in the CU QP group, use the QP reconstruction value of the encoded CU on the left side of the privacy CU to be encoded in the CU QP group as the QP prediction value of the privacy CU to be encoded.
9. The method according to any one of claims 1 to 8, wherein, determining the QP prediction value of the non-privacy CU to be encoded in the CU QP group according to the QP reconstruction value of the encoded non-privacy CU in the CUQP group of coding unit quantization parameters includes: When the non-privacy CU to be encoded is not the first CU in the CU QP group, use the QP reconstruction value of the previous encoded non-privacy CU of the non-privacy CU to be encoded as the QP prediction value of the non-privacy CU to be encoded.
10. The method according to any one of claims 1 to 9, wherein, determining the QP prediction value of the non-privacy CU to be encoded in the CU QP group according to the QP reconstruction value of the encoded non-privacy CU in the CUQP group of coding unit quantization parameters includes: When the non-privacy CU to be encoded is the first CU in the CU QP group, use the QP reconstruction value of the encoded non-privacy CU on the left side of the non-privacy CU to be encoded as the QP prediction value of the non-privacy CU to be encoded.
11. The method according to any one of claims 1 to 10, wherein, the bitstream generated according to the coding method of the quantization parameter includes a first identifier, and the first identifier indicates the number of encoded non-privacy CUs in the CUQP group; After entropy encoding the QP residual of the non-privacy CU to be encoded, increment the value of the first identifier by 1.
12. The method according to claim 3 or 5 or 6 or 9 or 10 or 11, wherein, The bitstream generated according to the encoding method of the quantization parameter includes a second identifier, and the second identifier indicates the number of encoded privacy CUs in the CUQP group; After entropy encoding the QP residue of the to-be-encoded privacy CU, increment the value of the second identifier by 1.
13. The method according to any one of claims 4 or 7 to 11, wherein, The bitstream generated according to the encoding method of the quantization parameter includes a third identifier, and the third identifier indicates the number of all encoded CUs in the CUQP group; After entropy encoding the QP residue of the to-be-encoded non-privacy CU, increment the value of the third identifier by 1; After entropy encoding the QP residue of the to-be-encoded privacy CU, increment the value of the third identifier by 1.
14. A decoding method for quantization parameters, wherein, The method includes: Receiving a bitstream, the bitstream includes the QP residue encoding data of non-privacy CUs in a coding unit quantization parameter CU QP group; Determine the context model corresponding to the QP residue of the to-be-decoded non-privacy CU in the CU QP group according to the number of decoded non-privacy CUs in the CU QP group; Entropy decode the QP residue encoding data of the to-be-decoded non-privacy CU according to the context model corresponding to the QP residue of the to-be-decoded non-privacy CU to obtain the QP residue of the to-be-decoded non-privacy CU; Determine the QP prediction value of the to-be-decoded non-privacy CU according to the QP reconstruction value of the decoded non-privacy CUs in the CU QP group; Add the QP prediction value of the to-be-decoded non-privacy CU and the QP residue of the to-be-decoded non-privacy CU to obtain the QP reconstruction value of the to-be-decoded non-privacy CU.
15. The decoding method according to claim 14, wherein, The bitstream further includes the QP residue encoding data of privacy CUs in the CU QP group, and the method further includes: Determine the context model corresponding to the QP residue of the to-be-decoded privacy CU in the CU QP group according to the number of decoded CUs in the CU QP group; Entropy decode the QP residue encoding data of the to-be-decoded privacy CU according to the context model corresponding to the QP residue of the to-be-decoded privacy CU to obtain the QP residue of the to-be-decoded privacy CU; Determine the QP prediction value of the to-be-decoded privacy CU according to the QP reconstruction value of the decoded CUs in the CU QP group; Add the QP prediction value of the to-be-decoded privacy CU and the QP residue of the to-be-decoded privacy CU to obtain the QP reconstruction value of the to-be-decoded privacy CU.
16. The decoding method according to claim 15, wherein, The step of determining the QP prediction value of the to-be-decoded privacy CU in the CU QP group according to the QP reconstruction value of the decoded CUs in the CU QP group includes: Determine the QP prediction value of the to-be-decoded privacy CU according to the QP reconstruction value of the decoded privacy CUs in the CU QP group; The step of determining the context model corresponding to the QP residue of the to-be-decoded privacy CU according to the number of decoded CUs in the CU QP group includes: Determine the context model corresponding to the QP residual of the to-be-decoded private CU according to the number of decoded private CUs in the CU QP group.
17. The decoding method according to claim 15, wherein, the determining the QP prediction value of the to-be-decoded private CU in the CU QP group according to the QP reconstruction value of the decoded CU in the CU QP group includes: determining the QP prediction value of the to-be-decoded private CU according to the QP reconstruction values of all decoded CUs in the CU QP group; the determining the context model corresponding to the QP residual of the to-be-decoded private CU according to the number of decoded CUs in the CU QP group includes: determining the context model corresponding to the QP residual of the to-be-decoded private CU according to the number of all decoded CUs in the CU QP group.
18. The method according to claim 16, wherein, the determining the QP prediction value of the to-be-decoded private CU according to the QP reconstruction value of the decoded private CU in the CU QP group includes: when the to-be-decoded private CU is not the first CU in the CU QP group, taking the QP reconstruction value of the previous decoded private CU of the to-be-decoded private CU as the QP prediction value of the to-be-decoded private CU.
19. The method according to claim 16 or 18, wherein, the determining the QP prediction value of the to-be-decoded private CU according to the QP reconstruction value of the decoded private CU in the CU QP group includes: when the to-be-decoded private CU is the first CU in the CU QP group, taking the QP reconstruction value of the decoded private CU on the left side of the to-be-decoded private CU in the CU QP group as the QP prediction value of the to-be-decoded private CU.
20. The method according to claim 17, wherein, the determining the QP prediction value of the to-be-decoded private CU according to the QP reconstruction values of all decoded CUs in the CU QP group includes: when the to-be-decoded private CU is not the first CU in the CU QP group, taking the QP reconstruction value of the previous decoded CU of the to-be-decoded private CU as the QP prediction value of the to-be-decoded private CU.
21. The method according to claim 17 or 20, wherein, the determining the QP prediction value of the to-be-decoded private CU according to the QP reconstruction values of all decoded CUs in the CU QP group includes: when the to-be-decoded private CU is the first CU in the CU QP group, taking the QP reconstruction value of the decoded CU on the left side of the to-be-decoded private CU in the CU QP group as the QP prediction value of the to-be-decoded private CU.
22. The method according to any one of claims 14 to 21, wherein, the determining the QP prediction value of the to-be-decoded non-private CU in the CU QP group according to the QP reconstruction value of the decoded non-private CU in the decoding unit quantization parameter CU QP group includes: When the non-private CU to be decoded is not the first CU in the CU QP group, use the QP reconstruction value of the previous decoded non-private CU of the non-private CU to be decoded as the QP prediction value of the non-private CU to be decoded.
23. The method according to any one of claims 14 to 22, wherein, determining the QP prediction value of the non-private CU to be decoded in the CU QP group according to the QP reconstruction value of the decoded non-private CU in the decoding unit quantization parameter CU QP group includes: When the non-private CU to be decoded is the first CU in the CU QP group, use the QP reconstruction value of the decoded non-private CU on the left side of the non-private CU to be decoded as the QP prediction value of the non-private CU to be decoded.
24. The method according to any one of claims 14 to 23, wherein, the bitstream further includes a first identifier, and the method further includes: determine the number of decoded non-private CUs in the CU QP group according to the value of the first identifier; After entropy decoding the QP residual coding data of the non-private CU to be decoded, increment the value of the first identifier by 1.
25. The method according to claim 16 or 18 or 19 or 22 or 23 or 24, wherein, the bitstream further includes a second identifier, and the method further includes: determine the number of decoded private CUs in the CU QP group according to the value of the second identifier; After entropy decoding the QP residual coding data of the private CU to be decoded, increment the value of the second identifier by 1.
26. The method according to claim 17 or any one of claims 20 to 24, wherein, the bitstream further includes a third identifier, and the method further includes: determine the number of all decoded CUs in the CU QP group according to the value of the third identifier; After entropy decoding the QP residual coding data of the non-private CU to be decoded, increment the value of the third identifier by 1; After entropy decoding the QP residual coding data of the private CU to be decoded, increment the value of the third identifier by 1.
27. A bitstream, wherein, the bitstream is generated according to the encoding method described in any one of claims 1 to 13 above.
28. A bitstream, wherein, the bitstream includes the QP residual coding data of the non-private CUs in the encoding unit quantization parameter CU QP group and a first identifier, and the first identifier indicates the number of encoded non-private CUs in the CU QP group.
29. The bitstream according to claim 28, wherein, the bitstream further includes the QP residual coding data of the private CUs in the CU QP group and a second identifier, and the second identifier indicates the number of encoded private CUs in the CU QP group.
30. The bitstream according to claim 28, wherein, the bitstream further includes the QP residual coding data of the private CUs in the CU QP group and a third identifier, and the third identifier indicates the number of all encoded CUs in the CU QP group.
31. An electronic device, wherein, comprising: A memory and a processor, the memory being coupled to the processor; The memory stores program instructions, which when executed by the processor cause the electronic device to perform the method according to any one of claims 1 to 26.
32. A chip, Characterized in that, 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, and when the one or more processors execute computer instructions, the steps of the method according to any one of claims 1 to 26 are performed.
33. A computer-readable storage medium, Characterized in that, the computer-readable storage medium stores a computer program, which when running on a computer or a processor causes the computer or the processor to perform the method according to any one of claims 1 to 26.
34. A computer program product, Characterized in that, the computer program product contains computer instructions, which when executed by a computer or a processor cause the steps of the method according to any one of claims 1 to 26 to be performed.
35. A computer-readable storage medium, Characterized in that, the computer-readable storage medium stores a bitstream according to any one of claims 27 to 30.