Decoding method, coding method, readable storage medium and electronic equipment

By judging the boundary area of ​​the feature map and the Gaussian distribution variance parameters in the entropy encoding/decoding technology, the encoding and decoding strategies are determined, which solves the problem of noise in the image boundary area and improves the consistency of image quality and user experience.

CN118632033APending Publication Date: 2024-09-10HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310461780.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-03-08
Filing Date
2023-04-23
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

Existing entropy coding/decoding technology easily introduces noise in image processing, affecting image quality, especially at the feature points in the boundary area of ​​the image, resulting in differences between the decoded image and the pre-encoding image, affecting the user experience.

Method used

By judging whether the image data to be decoded is located in the boundary area of ​​the divided area of ​​​​the feature map or whether its Gaussian distribution variance parameter is greater than the threshold, it is decided whether to perform entropy encoding or decoding, avoiding the use of low-accuracy prediction values ​​as reconstruction values, thereby improving image decoding quality.

Benefits of technology

It effectively avoids image quality problems, improves the consistency between decoded images and pre-encoded images, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118632033A
    Figure CN118632033A
Patent Text Reader

Abstract

The invention relates to the technical field of image processing, and relates to a decoding method, a coding method, a readable storage medium and electronic equipment. According to the decoding method provided by the invention, during decoding, when the to-be-decoded image data is located in the preset boundary region in the first region, or the Gaussian distribution variance parameter corresponding to the to-be-decoded image data is greater than the first threshold value, the residual value corresponding to the to-be-decoded image data can be obtained; obtaining image reconstruction data corresponding to the to-be-decoded image data based on the residual value and the predicted value; therefore, for the to-be-decoded image data of the boundary region, the prediction value with low accuracy cannot be directly used as the reconstruction value, and the image quality problem can be effectively avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a decoding method, an encoding method, a readable storage medium and an electronic device. Background Art

[0002] With the development of artificial intelligence technology, entropy coding / decoding technology is increasingly used in the field of image processing. For example, in order to facilitate data transmission, an electronic device can compress an image through entropy coding technology to obtain a compressed code stream with a small amount of data, and can send the compressed code stream to another electronic device. After receiving the compressed code stream, the other electronic device decodes the compressed code stream through entropy decoding technology and restores the compressed code stream to an image.

[0003] At present, the entropy coding / decoding technology used in some solutions generally divides the feature map corresponding to the image into multiple sub-regions for encoding and decoding. However, the entropy coding / decoding technology in the above solutions is likely to cause the decoded image to be different from the image before encoding, for example, striped noise is introduced into the decoded image, affecting the user experience. Summary of the invention

[0004] To solve the above problems, embodiments of the present application provide an encoding method, a decoding method, a readable storage medium and an electronic device.

[0005] In a first aspect, an embodiment of the present application provides a decoding method, which is applied to an electronic device, and the method includes: obtaining image data to be decoded, the image data to be decoded is data in a first area in a feature map of a first image; determining whether the image data to be decoded satisfies a first preset condition or a second preset condition; when the image data to be decoded satisfies the first preset condition or the second preset condition, obtaining first decoded data corresponding to the image data to be decoded; obtaining image reconstruction data corresponding to the image data to be decoded based on the first decoded data; wherein the first preset condition includes that the image data to be decoded is located in a preset boundary area within the first area, the second preset condition includes that a variance parameter of a Gaussian distribution corresponding to the image data to be decoded is greater than a first threshold, and the first decoded data includes residual data corresponding to the image data to be decoded.

[0006] It can be understood that the first area can be any of the multiple areas in the feature of the first image. In the present application, the residual data corresponding to the image data to be decoded can refer to the residual value corresponding to the image data to be decoded.

[0007] Based on the above scheme, when decoding, when the feature point is located at the boundary position in each divided area, the encoding information of the residual value corresponding to the feature point can be directly decoded to obtain the residual value, and the reconstruction value corresponding to the decoded feature point can be obtained based on the residual value and the predicted value. For example, when decoding, it can be first determined whether the feature point is located in the boundary area of ​​each divided area. If it is not located in the boundary area of ​​each divided area, the judgment process of whether to decode is not determined based on the Gaussian distribution variance parameter of the feature point, but the encoding information of the residual value corresponding to the feature point is directly decoded to obtain the residual value, and the reconstruction value corresponding to the decoded feature point is obtained based on the residual value and the predicted value. In this way, for the feature points in the boundary area, the low-accuracy predicted value will not be directly used as the reconstruction value, which can effectively avoid image quality problems.

[0008] In the present application, the first decoded data may be obtained by decoding the encoded code stream.

[0009] In a possible implementation of the first aspect above, it is determined whether the image data to be decoded satisfies a first preset condition or a second preset condition, and when the image data to be decoded satisfies the first preset condition or the second preset condition, first decoded data corresponding to the image data to be decoded is obtained; including: determining whether the image data to be decoded satisfies the first preset condition; when the image data to be decoded satisfies the first preset condition, obtaining the first decoded data corresponding to the image data to be decoded; when the image data to be decoded does not satisfy the first preset condition, determining whether the image data to be decoded satisfies the second preset condition; when the image data to be decoded satisfies the second preset condition, obtaining the first decoded data corresponding to the image data to be decoded.

[0010] It can be understood that in some schemes of the present application, during decoding, it can be first determined whether the feature point is located in the boundary area of ​​the divided area. If it is located in the boundary area of ​​the divided area, it is not determined whether to decode based on the Gaussian distribution variance parameter of the feature point, but the encoding information of the residual value corresponding to the feature point is directly decoded to obtain the residual value, and the reconstruction value corresponding to the decoded feature point is obtained based on the residual value and the predicted value; if it is not located in the boundary area of ​​the divided area, it can be determined whether to decode based on the Gaussian distribution variance parameter of the feature point. In this way, the judgment steps of decoding can be reduced and the decoding process can be simplified.

[0011] In a possible implementation of the first aspect above, it is determined whether the image data to be decoded satisfies a first preset condition or a second preset condition, and when the image data to be decoded satisfies the first preset condition or the second preset condition, first decoded data corresponding to the image data to be decoded is obtained; including: determining whether the image data to be decoded satisfies the second preset condition; when the image data to be decoded satisfies the second preset condition, obtaining the first decoded data corresponding to the image data to be decoded; when the image data to be decoded does not satisfy the second preset condition, determining whether the image data to be decoded satisfies the first preset condition; when the image data to be decoded satisfies the first preset condition, obtaining the first decoded data corresponding to the image data to be decoded.

[0012] It can be understood that in other schemes of the present application, when decoding, it can be first determined whether to perform decoding based on the Gaussian distribution variance parameters of the feature points. When it is determined that decoding is not necessary based on the Gaussian distribution variance parameters of the feature points, it can be further determined whether the feature points are located in the boundary area of ​​the divided area. If they are located in the boundary area of ​​the divided area, the encoding information of the residual value corresponding to the feature points is decoded to obtain the residual value, and the reconstruction value corresponding to the decoded feature points is obtained based on the residual value and the predicted value; if they are not located in the boundary area of ​​the divided area, it is determined that the feature points do not need to be decoded. In this way, for feature points in the boundary area of ​​the divided area, the low-accuracy predicted value will not be directly used as the reconstruction value, which can effectively avoid image quality problems.

[0013] In a possible implementation of the first aspect, image reconstruction data corresponding to the image data to be decoded is obtained based on the first decoded data; including: taking the sum of residual data and prediction data corresponding to the image data to be decoded as the image reconstruction data corresponding to the image data to be decoded.

[0014] In the present application, the prediction data of the image data to be decoded may refer to the prediction value of the image data to be decoded. It can be understood that in some embodiments, the prediction value of the image data to be decoded (e.g., the feature point to be decoded) may be obtained based on the quantized side information of the image to be decoded. In some embodiments, in order to further improve the accuracy of the prediction value, the prediction value may also be obtained based on the quantized side information of the image to be decoded and the relevant features of the decoded feature points that are spatially adjacent to the current feature point to be decoded.

[0015] In the present application, when decoding feature points in the boundary area within the divided area, the sum of the predicted value and the residual value corresponding to the feature point can be used as the reconstructed value corresponding to the decoded feature point based on the obtained prediction value to improve the image decoding quality.

[0016] In a possible implementation of the first aspect above, when the image data to be decoded does not satisfy the first preset condition and does not satisfy the second preset condition, second decoded data corresponding to the image data to be decoded is obtained; and image reconstruction data corresponding to the image data to be decoded is obtained based on the second decoded data.

[0017] In a possible implementation of the first aspect above, the second decoded data includes prediction data corresponding to the image data to be decoded; image reconstruction data corresponding to the image data to be decoded is obtained based on the second decoded data; including: using the prediction data corresponding to the image data to be decoded as the image reconstruction data corresponding to the image data to be decoded.

[0018] It can be understood that in other solutions of the present application, when decoding, after determining that the feature point is not located in the boundary area of ​​the divided area, and determining not to decode the decoded feature point based on the Gaussian distribution variance parameter of the feature point to be decoded, it can be determined that the accuracy of the predicted value corresponding to the feature point is high. Therefore, the predicted value corresponding to the feature point can be directly used as the reconstructed value corresponding to the decoded feature point to ensure image quality.

[0019] In a possible implementation of the first aspect above, the first region is any one of a plurality of divided regions in a feature map of the first image, and the plurality of divided regions are decoded in parallel.

[0020] In the present application, decoding the feature points in multiple divided areas in parallel can effectively improve the decoding efficiency.

[0021] In a possible implementation of the first aspect above, the preset boundary area includes an area that is a preset number of rows away from a boundary line of the first area, and the boundary line includes at least one of a plurality of boundary lines that enclose the first area.

[0022] In the present application, the preset boundary area in each divided area may refer to an area that is a preset number of rows or a preset range away from the boundary line of the divided area. For example, when the divided area is a rectangular area, the boundary area may refer to one or more areas of the upper boundary area where the upper P1 row feature points are located, the lower boundary area where the lower P2 row feature points are located, the left boundary area where the left P3 column feature points are located, and the right boundary area where the right P4 column feature points are located; in some embodiments, the values ​​of P1, P2, P3, and P4 may be equal or unequal, and the values ​​of P1, P2, P3, and P4 may be greater than or equal to 1.

[0023] It can be understood that the divided areas can include any number of boundary lines, and the shape of the boundary lines can be any shape, such as a straight line, a curve, etc. The number of boundary areas can be any number and is not limited here.

[0024] In a possible implementation of the first aspect above, the image data to be decoded is target feature points of the first area.

[0025] It can be understood that in some solutions of the present application, the image data to be decoded can be a feature point.

[0026] In a possible implementation of the first aspect above, the image data to be decoded is a feature block composed of multiple feature points within a first area; when the image data to be decoded meets a first preset condition, first decoded data corresponding to the image data to be decoded is obtained; including: when at least one feature point in the feature block is located in a preset boundary area within the first area, each feature point in the feature block is decoded to obtain the first decoded data corresponding to the image data to be decoded.

[0027] It can be understood that in other solutions of the present application, the image data to be decoded may be a feature block composed of multiple feature points, for example, a PxP sub-block, and when the PxP sub-block is used as a unit, and the sub-block position where the feature point is located is used to determine whether to decode each feature point in the PxP sub-block, in some solutions, when at least one point in the PxP feature block is located in the boundary area, all feature points in the PxP sub-block are decoded. In this way, the judgment process of whether to decode can be effectively accelerated, and the decoding efficiency can be improved.

[0028] In a possible implementation of the first aspect above, the image data to be decoded is a feature block composed of multiple feature points within a first area; when the image data to be decoded meets a first preset condition, first decoded data corresponding to the image data to be decoded is obtained; including: when the first feature point in the feature block is located in a preset boundary area within the first area, the first feature point in the feature block is decoded to obtain the first decoded data corresponding to the image data to be decoded.

[0029] It can be understood that in other schemes of the present application, the method of judging whether to decode each feature point in a PxP sub-block based on the sub-block position where the feature point is located in units of PxP sub-blocks can be that when a feature point in a PxP feature block is located at a region boundary, the feature point in the PxP sub-block is decoded.

[0030] In a possible implementation of the first aspect above, the image data to be decoded is a feature block composed of multiple feature points in a first area; when the image data to be decoded meets the second preset condition, the first decoded data corresponding to the image data to be decoded is obtained; including: when the maximum Gaussian distribution parameter corresponding to each feature point in the feature block is greater than a first threshold, each feature point in the feature block is decoded to obtain the first decoded data corresponding to the image data to be decoded.

[0031] It can be understood that in other solutions of the present application, it can be determined whether to decode each feature point in the PxP sub-block based on the Gaussian distribution variance parameter corresponding to the sub-block where the feature point is located in the PxP sub-block. For example, the maximum value of the Gaussian distribution parameter of the feature point in the PxP block can be obtained, and when the maximum value of the Gaussian distribution parameter of the feature point is greater than the first threshold, each feature point in the PxP sub-block is decoded.

[0032] In a possible implementation of the first aspect above, the image data to be decoded is a feature block composed of multiple feature points in a first area; when the image data to be decoded meets the second preset condition, the first decoded data corresponding to the image data to be decoded is obtained; including: when the average value of the Gaussian distribution parameters corresponding to each feature point in the feature block is greater than the first threshold, each feature point in the feature block is decoded to obtain the first decoded data corresponding to the image data to be decoded.

[0033] It can be understood that in other solutions of the present application, the average value of the Gaussian distribution parameters of the feature points in the PxP block can be obtained, and when the average value of the Gaussian distribution parameters of the feature points is greater than the first threshold, each feature point in the PxP sub-block is decoded.

[0034] In a possible implementation of the first aspect above, when the image data to be decoded meets the first preset condition or the second preset condition, first decoded data corresponding to the image data to be decoded is obtained; including: when the image data to be decoded meets the first preset condition or the second preset condition, setting the identifier corresponding to the image data to be decoded to the first identifier; when it is determined that the identifier corresponding to the image data to be decoded is the first identifier, obtaining the first decoded data corresponding to the image data to be decoded based on the first identifier.

[0035] In the present application, an identifier can be set for each feature point or feature block in the image to be decoded. For example, when the image to be decoded includes 1048*1048 feature points, corresponding identifiers can be set for all 1048*1048 feature points. Setting the identifier can determine whether all the data to be decoded is decoded, and then decode according to the identification results in turn, which is convenient for simplifying the decoding process.

[0036] In the present application, the first identifier and the second identifier can be set in any feasible manner, for example, the first identifier is the number 1, the second identifier is the number 0, etc.

[0037] In the present application, in some embodiments, the identifier corresponding to the data to be decoded can also be directly written into the bitstream during encoding, so that the decoding end will not need to re-determine whether the image data to be decoded needs to obtain the reconstructed value based on the residual value and the predicted value, thereby effectively simplifying the decoding process.

[0038] In a possible implementation of the first aspect above, when the image data to be decoded does not satisfy the first preset condition and does not satisfy the second preset condition, second decoded data corresponding to the image data to be decoded is obtained; including: when the image data to be decoded does not satisfy the first preset condition and does not satisfy the second preset condition, setting the identifier corresponding to the image data to be decoded to the second identifier; when it is determined that the identifier corresponding to the image data to be decoded is the second identifier, obtaining the second decoded data corresponding to the image data to be decoded.

[0039] In a possible implementation of the first aspect above, when the image data to be decoded meets the first preset condition or the second preset condition, first decoded data corresponding to the image data to be decoded is obtained; including: judging whether the image data to be decoded meets the second preset condition; when the image data to be decoded does not meet the second preset condition, setting the identifier corresponding to the image data to be decoded to the second identifier; judging whether the image data to be decoded meets the first preset condition; when the image data to be decoded meets the first preset condition, changing the second identifier to the first identifier; when it is determined that the identifier corresponding to the image data to be decoded is the first identifier, obtaining the first decoded data corresponding to the image data to be decoded.

[0040] In the present application, when decoding, it is possible to first determine whether to perform decoding based on the Gaussian distribution variance parameters of the feature points. When it is determined based on the Gaussian distribution variance parameters of the feature points that decoding is not necessary, a second identifier is set for the feature points, and then it can be further determined whether the feature points are located in the boundary area within the divided area. If they are located in the boundary area within the divided area, the second identifier is modified to the first identifier.

[0041] In a second aspect, an embodiment of the present application provides a coding method, which is applied to an electronic device, and the method includes: obtaining image data to be encoded, the image data to be encoded is data in a first area in a feature map of a first image; judging whether the image data to be encoded satisfies a first preset condition or a second preset condition, and when the image data to be encoded satisfies the first preset condition or the second preset condition, obtaining residual data corresponding to the image data to be encoded; encoding the residual data into a coding stream, the first preset condition includes that the image data to be encoded is located in a preset boundary area within the first area, and the second preset condition includes that a variance parameter of a Gaussian distribution corresponding to the image data to be encoded is greater than a first threshold.

[0042] In the present application, the residual data corresponding to the image data to be encoded may be a residual value corresponding to the image data to be encoded.

[0043] Based on the above scheme, during encoding, when the feature point is located at the boundary position within each divided area, the quantized residual value corresponding to the feature point to be encoded can be obtained, and the quantized residual value can be encoded and written into the encoded bitstream; so that during decoding, the reconstructed value corresponding to the decoded feature point can be obtained based on the residual value and the predicted value, which can effectively avoid image quality problems.

[0044] In a possible implementation of the second aspect above, it is determined whether the image data to be encoded satisfies a first preset condition or a second preset condition, and when the image data to be encoded satisfies the first preset condition or the second preset condition, residual data corresponding to the image data to be encoded is obtained; including: determining whether the image data to be encoded satisfies the first preset condition; when the image data to be encoded satisfies the first preset condition, obtaining the residual data corresponding to the image data to be encoded; when the image data to be encoded does not satisfy the first preset condition, determining whether the image data to be encoded satisfies the second preset condition; when the image data to be encoded satisfies the second preset condition, obtaining the residual data corresponding to the image data to be encoded.

[0045] It can be understood that in some schemes of the present application, when encoding, it can be first determined whether the feature point is located in the boundary area of ​​the divided area. If it is located in the boundary area of ​​the divided area, it is not determined whether to encode based on the Gaussian distribution variance parameter of the feature point, but the residual value corresponding to the feature point is directly encoded, and the quantized residual value and the predicted value are written into the encoded bitstream together; if the feature point is not located in the boundary area of ​​the divided area, it can be determined whether to encode based on the Gaussian distribution variance parameter of the feature point. In this way, the judgment steps of encoding can be reduced and the encoding process can be simplified.

[0046] In a possible implementation of the second aspect above, whether the image data to be encoded satisfies a first preset condition or a second preset condition is determined, and when the image data to be encoded satisfies the first preset condition or the second preset condition, residual data corresponding to the image data to be encoded is obtained; including: determining whether the image data to be encoded satisfies the second preset condition; when the image data to be encoded satisfies the second preset condition, obtaining the residual data corresponding to the image data to be encoded; when the image data to be encoded does not satisfy the second preset condition, determining whether the image data to be encoded satisfies the first preset condition; when the image data to be encoded satisfies the first preset condition, obtaining the residual data corresponding to the image data to be encoded.

[0047] It can be understood that in other schemes of the present application, when encoding, it can be first determined whether to perform encoding based on the Gaussian distribution variance parameters of the feature points. When it is determined that encoding is not necessary based on the Gaussian distribution variance parameters of the feature points, it can be further determined whether the feature points are located in the boundary area of ​​the divided area. If they are located in the boundary area of ​​the divided area, the quantized residual value corresponding to the feature points is encoded and written into the encoded bitstream; if they are not located in the boundary area of ​​the divided area, it is determined that the feature points do not need to be encoded. In this way, for feature points in the boundary area of ​​the divided area, the predicted values ​​of the feature points with low accuracy will not be directly written into the encoded bitstream, which can effectively avoid image quality problems.

[0048] In a possible implementation of the second aspect, when the image data to be encoded does not satisfy the first preset condition and does not satisfy the second preset condition, prediction data corresponding to the image data to be encoded is obtained.

[0049] In the present application, the prediction data corresponding to the image data to be encoded may be the prediction value corresponding to the image data to be encoded. In some embodiments, the prediction value of the image data to be encoded (e.g., the feature point to be encoded) may be obtained based on the quantized side information of the image to be encoded. In some embodiments, in order to further improve the accuracy of the prediction value, the prediction value may also be obtained based on the quantized side information of the image to be encoded and the related features of the encoded feature points that are spatially adjacent to the current feature point to be encoded.

[0050] In a possible implementation of the second aspect above, the first region is any one of multiple divided regions in a feature map of the first image, and the multiple divided regions are encoded in parallel.

[0051] In a possible implementation of the second aspect, the preset boundary area includes an area that is a preset number of rows away from a boundary line of the first area, and the boundary line includes at least one of a plurality of boundary lines that enclose the first area.

[0052] In a third aspect, an embodiment of the present application provides a decoding device, comprising: an acquisition unit, used to acquire image data to be decoded, the image data to be decoded being data within a first area within a feature map of a first image; a decoding unit, used to determine whether the image data to be decoded satisfies a first preset condition or a second preset condition, and when the image data to be decoded satisfies the first preset condition or the second preset condition, acquire first decoded data corresponding to the image data to be decoded; a reconstruction unit, used to acquire image reconstruction data corresponding to the image data to be decoded based on the first decoded data; wherein the first preset condition includes that the image data to be decoded is located in a preset boundary area within the first area, the second preset condition includes that a variance parameter of a Gaussian distribution corresponding to the image data to be decoded is greater than a first threshold, and the first decoded data includes residual data corresponding to the image data to be decoded.

[0053] In a fourth aspect, an embodiment of the present application provides an encoding device, comprising: an acquisition unit, used to acquire image data to be encoded, the image data to be encoded is data in a first area within a feature map of a first image; an encoding unit, used to determine whether the image data to be encoded satisfies a first preset condition or a second preset condition, and when the image data to be encoded satisfies the first preset condition or the second preset condition, obtain residual data corresponding to the image data to be encoded, and encode the residual data into an encoding code stream; wherein the first preset condition includes that the image data to be encoded is located in a preset boundary area within the first area, and the second preset condition includes that a variance parameter of a Gaussian distribution corresponding to the image data to be encoded is greater than a first threshold.

[0054] In a fifth aspect, an embodiment of the present application provides an electronic device, which includes the decoding device provided by the third aspect and the encoding device provided by the fourth aspect.

[0055] In a sixth aspect, an embodiment of the present application provides an electronic device, comprising: a memory, in which instructions are stored; a processor, for executing instructions to enable the electronic device to implement any decoding method provided by the first aspect and various possible implementations of the first aspect and / or any encoding method provided by the second aspect and various possible implementations of the second aspect.

[0056] In the seventh aspect, an embodiment of the present application provides a decoding device, which is the decoding device provided by the third aspect and the encoding device provided by the fourth aspect. The decoding device includes: one or more processors and a memory, the memory is used to store program instructions, and when the program instructions are executed by one or more processors, the decoding method provided by the first aspect and various possible implementations of the first aspect and / or any one of the encoding methods provided by the second aspect and various possible implementations of the second aspect are implemented.

[0057] In an eighth aspect, an embodiment of the present application provides a readable storage medium, on which instructions are stored. When the instructions are executed on an electronic device, the electronic device executes the decoding method provided by the first aspect and various possible implementations of the first aspect and / or any one of the encoding methods provided by the second aspect and various possible implementations of the second aspect.

[0058] In a ninth aspect, an embodiment of the present application provides a computer program product, comprising instructions, which, when executed on an electronic device, enables the electronic device to execute a code stream obtained by the decoding method provided by the first aspect and various possible implementations of the first aspect and / or any one of the encoding methods provided by the second aspect and various possible implementations of the second aspect.

[0059] In a tenth aspect, an embodiment of the present application provides a readable storage medium, on which is stored a code stream obtained by any encoding method provided by the above-mentioned second aspect and various possible implementations of the second aspect.

[0060] In the eleventh aspect, an embodiment of the present application provides a device for storing a code stream, comprising at least one storage medium and a communication interface; the communication interface is used to receive or send a code stream; at least one storage medium is used to store a code stream; the code stream is encoded by an encoder according to any one of the encoding methods provided by the second aspect and various possible implementations of the second aspect.

[0061] In a twelfth aspect, an embodiment of the present application provides a method for storing a bit stream, comprising: receiving a bit stream through a communication interface; storing the bit stream in one or more storage media, wherein the bit stream is encoded by an encoder according to any one of the encoding methods provided by the above-mentioned second aspect and various possible implementations of the second aspect.

[0062] In a thirteenth aspect, an embodiment of the present application provides a system for distributing code streams, comprising at least one storage medium and a video stream device; the at least one storage medium is used to store the code stream, and the code stream is encoded by the encoder according to any one of the encoding methods provided by the second aspect and various possible implementations of the second aspect. The video stream device is used to respond to a request from a decoder so that the target code stream in the at least one storage medium can be sent to the decoder.

[0063] In a fourteenth aspect, an embodiment of the present application provides a method for distributing a bitstream, comprising: receiving a first request; selecting a target bitstream from at least one storage medium in response to the first request; sending the target bitstream to a destination device; at least one storage medium is used to store the bitstream, and the bitstream is encoded by an encoder according to any one of the encoding methods provided by the above-mentioned second aspect and various possible implementations of the second aspect.

[0064] In the fifteenth aspect, the embodiment of the present application provides a system for processing a code stream, including an image source device, an encoder device, one or more storage media and a destination device; the image source device is used to provide image data; the encoder device is used to obtain the image data of the image source device through an interface, and encode the image data to obtain one or more code streams, and the code stream is encoded by the encoder according to any one of the encoding methods provided by the second aspect and various possible implementations of the second aspect. The encoder device is used to store one or more code streams in one or more storage media; or the encoder device is used to encapsulate one or more code streams to obtain a transmission code stream; the encoder device is used to transmit the transmission code stream to the destination device through a communication link or a communication network; the destination device is used to decapsulate the transmission code stream to obtain one or more code streams; the destination device is used to decode one or more code streams to obtain decoded data. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] Figure 1 According to some embodiments of the present application, a schematic diagram of an image encoding and decoding method based on deep learning is shown;

[0066] Figure 2A According to some embodiments of the present application, a schematic diagram based on an image coding scheme is shown;

[0067] Figure 2B According to some embodiments of the present application, a schematic diagram of a process based on an image coding scheme is shown;

[0068] Figure 2C According to some embodiments of the present application, a schematic diagram based on an image decoding scheme is shown;

[0069] Figure 2D According to some embodiments of the present application, a schematic diagram of a process based on an image decoding scheme is shown;

[0070] Figure 3A According to some embodiments of the present application, a schematic diagram of spatial adjacent positions and independent block division based on context prediction is shown;

[0071] Figure 3B According to some embodiments of the present application, a schematic diagram of region division is shown;

[0072] Figure 3C According to some embodiments of the present application, a schematic diagram of linear noise introduced by region division and entropy encoding / decoding skipping is shown;

[0073] Figure 3D According to some embodiments of the present application, a schematic diagram of a boundary of a region is shown;

[0074] Figure 3E According to some embodiments of the present application, a schematic diagram of a system architecture of an encoding / decoding method is shown;

[0075] Figure 4A According to some embodiments of the present application, a schematic diagram of a coding scheme flow of Embodiment 1 is shown;

[0076] Figure 4B (1) According to some embodiments of the present application, a schematic diagram of a network structure of a side information extraction module is shown;

[0077] Figure 4B (2) According to some embodiments of the present application, a schematic diagram of a prediction value estimation network is shown;

[0078] Figure 4B (3) According to some embodiments of the present application, a schematic diagram of a probability estimation network structure is shown;

[0079] Figure 4C (1) According to some embodiments of the present application, a schematic diagram of horizontally dividing regions is shown;

[0080] Figure 4C (2) According to some embodiments of the present application, a schematic diagram of vertically dividing regions is shown;

[0081] Figure 4D According to some embodiments of the present application, a schematic diagram of a specific process of encoding feature points in Embodiment 1 is shown;

[0082] Figure 4E According to some embodiments of the present application, a schematic diagram of a decoding solution flow of Embodiment 1 is shown;

[0083] Figure 4F According to some embodiments of the present application, a schematic diagram of a specific process of decoding feature points in Embodiment 1 is shown;

[0084] Figure 4G According to some embodiments of the present application, a schematic diagram of an entropy coding skip determination process is shown;

[0085] Figure 4H According to some embodiments of the present application, a schematic diagram of an entropy decoding skip determination process is shown;

[0086] Figure 5A According to some embodiments of the present application, a schematic diagram of a process of obtaining a coded bit stream according to Embodiment 2 is shown;

[0087] Figure 5B According to some embodiments of the present application, a schematic diagram of a process of obtaining a decoded code stream according to Embodiment 2 is shown;

[0088] Fig. 6A According to some embodiments of the present application, a schematic diagram of a process of obtaining a coded bit stream according to Embodiment 3 is shown;

[0089] Figure 6B According to some embodiments of the present application, one or more regional division schematic diagrams are shown;

[0090] Figure 6C According to some embodiments of the present application, a schematic diagram of a process of obtaining a decoded code stream according to Embodiment 3 is shown;

[0091] Fig. 7A According to some embodiments of the present application, a schematic diagram of a coding scheme flow chart of Embodiment 4 is shown;

[0092] Figure 7BAccording to some embodiments of the present application, a schematic diagram of a specific process of encoding feature points in Embodiment 4 is shown;

[0093] Fig. 8A According to some embodiments of the present application, a schematic diagram of simultaneously adopting vertical and horizontal division is shown;

[0094] Figure 8B According to some embodiments of the present application, a schematic diagram of a process of obtaining a coded bit stream according to Embodiment 5 is shown;

[0095] Figure 8C According to some embodiments of the present application, a schematic diagram of a process of obtaining a decoded code stream according to Embodiment 5 is shown;

[0096] Fig. 9 According to some embodiments of the present application, a schematic diagram of an electronic device 100 is shown. DETAILED DESCRIPTION

[0097] Illustrative embodiments of the present application include, but are not limited to, a decoding method, an encoding method, a readable storage medium, and an electronic device.

[0098] The technical solution of the present application is described below in conjunction with the accompanying drawings.

[0099] Figure 1 A schematic diagram of an image encoding and decoding method based on deep learning is shown, the encoding end electronic device may include a feature extraction module, a feature quantization module and an entropy encoding module, and the decoding end electronic device may include an entropy decoding module, a feature inverse quantization module and a feature decoding module. The image encoding and decoding method may include an encoding process and a decoding process, wherein:

[0100] During the encoding process, the image to be compressed can be input into the feature extraction module. The feature extraction module can extract features from the image to be compressed by using a convolutional neural network or other methods to obtain the extracted three-dimensional feature map, and send the three-dimensional feature map to the feature quantization module. It can be understood that the three-dimensional feature map refers to the three-dimensional data output by each layer of the convolutional neural network in the feature extraction module. The three dimensions are respectively called width, height, and channel, that is, W×H×C. The feature quantization module quantizes the eigenvalues ​​of the floating-point numbers in the three-dimensional feature map by a preset eigenvalue quantization method to obtain the quantized fixed-point eigenvalues, that is, to obtain the three-dimensional feature quantization map. The entropy coding module entropy codes the quantized eigenvalues ​​to obtain the encoded bit stream.

[0101] During the decoding process, when the entropy decoding module receives the entropy coded bit stream, it first performs entropy decoding through the entropy decoding module to obtain the decoded bit stream, and then obtains the three-dimensional feature map through the feature dequantization module; finally, the feature decoding module decodes the feature map into a reconstructed image, thereby achieving the decoding purpose.

[0102] The image encoding method is described in detail below.

[0103] Figure 2A A schematic diagram based on an image coding scheme is shown. The coding scheme may include: at the coding end, the original image is input into a feature extraction module to output a feature map y. The feature map y output by the feature extraction module may be a three-dimensional feature map. The feature map y is then input into a side information extraction network to obtain side information z. It can be understood that the side information is a brief information in the image features, and the side information z is quantized to obtain the quantized side information. Then the quantized side information Input the prediction value estimation network, and output the feature map F through the prediction value estimation network. The feature map F is used to characterize the prediction value corresponding to each feature point. At the same time, the side information Input to the probability distribution estimation network to output the Gaussian distribution variance parameter σ corresponding to each feature point, where the Gaussian distribution variance parameter σ is used to characterize the accuracy of the predicted value. In some embodiments, the probability distribution estimation network and the predicted value estimation network can be fused into one network, and output the Gaussian distribution variance parameter σ of each feature element and the feature map F corresponding to the predicted value.

[0104] When encoding any feature point or feature block, for example, feature point y, the spatially adjacent encoded feature points corresponding to feature point y can be input into the context network to obtain the feature map G corresponding to the encoded feature point. By inputting the feature map F and feature G into the prediction network, a more accurate prediction value μ of feature point y can be obtained. In addition, the feature point y can be subtracted from the predicted value μ to obtain the residual point r corresponding to feature point y, and the residual point r can be quantized to obtain the quantized residual point Then, we can determine whether to entropy encode the quantized residual points according to the size of the Gaussian distribution variance parameter σ. For example, if the Gaussian distribution variance parameter σ corresponding to the feature point y is greater than the preset threshold T, it can be proved that the accuracy of the predicted value of the feature point is low, so the Arithmetic Encoding (AE) module can entropy encode the quantized residual points. If the Gaussian distribution variance parameter σ corresponding to the feature point y is less than or equal to the preset threshold T, it can be proved that the prediction value of the feature point has a high accuracy, so there is no need to quantize the residual point For encoding, the predicted value can be directly written into the encoded bitstream.

[0105] In some embodiments, the process of determining whether to encode each feature point of an image is as follows: Figure 2B As shown, it includes: first obtaining the first feature point (or feature block), when the Gaussian distribution variance parameter σ corresponding to the first feature point is greater than the preset threshold T, that is, when σ>T is satisfied, it can be proved that the accuracy of the predicted value of the feature point is low, so it is necessary to quantize the residual point Perform arithmetic coding and write it into the coded bitstream. When the Gaussian distribution variance parameter σ corresponding to the first feature point is less than or equal to the preset threshold T, the entropy coding process is skipped and the residual corresponding to the feature point is not encoded. Instead of encoding, the next feature point is obtained and the above judgment process is continued to be encoded until the encoding of the last feature point is completed.

[0106] Figure 2C A schematic diagram of an image decoding scheme is shown. The decoding process may include: an arithmetic decoding (AD) module parses the quantized side information from the encoded bit stream The quantized side information Input the probability distribution estimation network to obtain the Gaussian distribution variance parameter σ, and at the same time, the quantized side information Input the prediction value estimation network to obtain the output feature map F.

[0107] When decoding any feature point, such as feature point y, the decoded feature points adjacent to feature point y can be input into the context network to obtain feature G, and the feature map F and feature G can be input into the prediction network to obtain the predicted value μ corresponding to the feature point. Then, it can be determined whether to perform entropy decoding on the quantized residual point according to the size of the Gaussian distribution variance parameter σ. For example, if the Gaussian distribution variance parameter σ corresponding to feature point y is greater than the preset threshold T, it can be proved that the accuracy of the predicted value of the feature point is low, so the quantized residual point needs to be entropy decoded. For example, the encoding information corresponding to the quantized residual point can be decoded to obtain the quantized residual point The image reconstruction module then sums the quantized residual point r with the predicted value μ to obtain the value of the feature point y. If the Gaussian distribution variance parameter σ corresponding to the feature point y is less than or equal to the preset threshold T, it can be proved that the predicted value of the feature point has a high accuracy, so there is no need to reconstruct the quantized residual point y. After decoding, the predicted value μ can be directly used as the reconstructed value of the feature point y.

[0108] In some embodiments, the process of determining whether to decode each feature point of an image is as follows: Figure 2DAs shown, it includes: first obtaining the first feature point (or feature block), when the Gaussian distribution variance parameter σ corresponding to the first feature point is greater than the preset threshold T, that is, when σ>T is satisfied, the quantized residual point corresponding to the feature point is The corresponding encoded information is decoded to obtain the residual feature points And the quantized residual point The value of feature point y is obtained by summing it with the predicted value μ, that is, the reconstructed value corresponding to feature point y. When the Gaussian distribution variance parameter σ corresponding to the first feature point is less than or equal to the preset threshold T, the entropy decoding process is skipped, so that the reconstructed value of the feature point is set to the predicted value μ. The next feature point is obtained, and the above judgment process is continued for decoding until the last feature point is decoded.

[0109] In the above encoding and decoding scheme, if the predicted value μ of the current feature point needs to be obtained, the spatially adjacent encoded feature points corresponding to the feature point need to be input into the context network to obtain the feature map G corresponding to the encoded feature point, and the feature map G and the feature map F containing the preliminary predicted value of the current feature point are input into the prediction network to obtain a more accurate predicted value μ of the feature point. For example, Figure 3A A W×H×C feature map y is shown. Among them, i' and j' represent the coordinate values ​​of the W dimension and the H dimension respectively, non-zero feature points are encoded feature points, and zero feature points represent unencoded feature points. Figure 3A For the feature point 10 shown in , the predicted value depends on the feature point that has been encoded at the left or upper position. For the W×H×C feature map y, since the context network and the prediction network need to be run once for each calculation of the predicted value of a feature point, the predicted value of each feature point in the feature map y will need to be calculated serially for W×H×C times.

[0110] In some embodiments, in order to reduce the serial number and improve the encoding and decoding efficiency, the feature map y can be divided into multiple independent areas (Tiles) for parallel calculation. Figure 3B As shown, the feature map y can be divided into region 1 and region 2. For example, region 1 and region 2 can each include five rows and ten columns. Region 1 and region 2 can obtain the predicted value of the feature point in parallel based on the context network and the prediction network. The number of times the context network and the prediction network need to be run serially for each region point by point calculation is only W×H×C / 2 times, which can reduce the prediction time by half and significantly improve the encoding and decoding efficiency. It can be understood that the region can be a rectangular region, which is used to divide the image into row regions and column regions.

[0111] However, in the above scheme, the method of reducing the number of serializations by dividing the feature map y will result in low prediction accuracy at the borders of some regions. For example, during encoding, the probability distribution network will output the Gaussian distribution variance parameter σ that represents the accuracy of the prediction value based on the quantized side information. For example, in the border region of region 2, such as the region corresponding to the sixth row, when the image texture is simple, the Gaussian distribution variance parameter σ that represents the accuracy of the prediction value output by the probability distribution network will be small, that is, the accuracy of the prediction value is high. At this time, if the Gaussian distribution variance parameter σ is less than or equal to the threshold T, as mentioned above Figure 2D In the scheme shown, during the decoding process, the reconstruction value corresponding to the direct feature point is set as the prediction value μ. However, when region 2 and region 1 are encoded or decoded in parallel, the boundary part of region 2, such as the prediction value of the sixth row, cannot be generated using the feature points of the fifth row, that is, the accuracy of the prediction value μ is not high enough, resulting in a low accuracy of the reconstruction value corresponding to the feature point, which, to a certain extent, leads to poor quality of the reconstructed image. For example, the final reconstructed image is prone to Figure 3C The line-shaped artifacts shown.

[0112] To solve the above problem, the present application provides a coding and decoding method. During coding, when the feature point is located in the boundary area of ​​each divided area, the residual value corresponding to the feature point can be directly entropy coded, and the coding information and the predicted value can be written into the bitstream together. For example, it can be first determined whether the feature point is located in the boundary area of ​​each divided area. If it is located in the boundary area of ​​each divided area, the above method is not performed. Figure 2B The judgment process shown in the figure does not use the Gaussian distribution variance parameter of the feature point to judge whether to perform encoding, but directly performs entropy encoding on the residual value corresponding to the feature point, and writes the encoding information and the prediction value into the bitstream together.

[0113] Correspondingly, during decoding, when the feature point is located at the boundary position within each divided area, decoding can be performed directly based on the encoding information of the residual value corresponding to the feature point to obtain the residual value, and the reconstruction value corresponding to the decoded feature point can be obtained based on the residual value and the predicted value. For example, during decoding, it can be first determined whether the feature point is located in the boundary area within each divided area. If it is located in the boundary area within each divided area, the above-mentioned Figure 2D The judgment process shown does not determine whether to decode based on the Gaussian distribution variance parameter of the feature point, but directly decodes the encoding information of the residual value corresponding to the feature point to obtain the residual value, and obtains the reconstructed value corresponding to the decoded feature point based on the residual value and the predicted value.

[0114] In this way, unlike the previous solution, the predicted value with low accuracy will not be directly used as the reconstruction value, which can effectively avoid image quality problems.

[0115] It can be understood that the boundary area within the divided area may refer to an area that is a preset number of lines or a preset range away from the boundary line of the divided area. Figure 3D As shown, when the divided area is a rectangular area, the boundary area may refer to one or more areas including the upper boundary area a1 where the upper P1 row feature points are located, the lower boundary area a2 where the lower P2 row feature points are located, the left boundary area a3 where the left P3 column feature points are located, and the right boundary area a4 where the right P4 column feature points are located; in some embodiments, the values ​​of P1, P2, P3, and P4 may be equal or unequal, and the values ​​of P1, P2, P3, and P4 may be greater than or equal to 1.

[0116] It can be understood that the divided areas can include any number of boundary lines, and the shape of the boundary lines can be any shape, such as a straight line, a curve, etc. The number of boundary areas can be any number and is not limited here.

[0117] It can be understood that the encoding of the residual value of the feature point mentioned in the present application can also be the encoding of the quantized residual value of the feature point. The encoding information of the residual value corresponding to the feature point is decoded, and the quantized residual value can also be obtained. Obtaining the reconstruction value corresponding to the decoded feature point based on the residual value and the predicted value can refer to obtaining the reconstruction value corresponding to the decoded feature point based on the quantized residual value and the predicted value.

[0118] It is understood that the encoding and decoding method provided in the embodiments of the present application can be used in devices or products containing video encoding and / or decoding functions, such as video processing software and hardware products, such as chips. And products or devices containing such chips, such as mobile phones, computers, tablets and other electronic devices, are not limited here.

[0119] The following first briefly introduces the system architecture application scenario of the encoding / decoding method of the encoding / decoding method in the embodiment of the present application. Figure 3E As shown, after the video capture device of the electronic device at the encoding end captures the video, the video is processed before capture to obtain the processed video. The processed video is encoded to obtain a coded stream, and the coded stream is sent to the receiving module of the electronic device at the decoding end using a sending module. After the decoding end decodes the stream, it is rendered and displayed.

[0120] In some embodiments, the encoding end or the decoding end may also store the bitstream after the video encoding. It is understood that in the embodiments of the present application, the encoding end electronic device and the decoding end electronic device may be the same electronic device or different electronic devices, such as a first electronic device and a second electronic device.

[0121] The encoding-end electronic device and the decoding-end electronic device mentioned in this application are introduced below.

[0122] The electronic device at the encoding end may include a feature extraction module, a side information extraction module, a probability distribution estimation module, a prediction value estimation module, a context network module, a prediction network module, an entropy coding skip determination module, a feature point position determination module and an arithmetic coding module.

[0123] Among them, the feature extraction module can be used to obtain the feature map of the image.

[0124] The side information extraction module can be used to obtain a feature map and output side information according to the feature map.

[0125] The prediction value estimation module may be a prediction value estimation network, which may be used to output a feature map F based on the quantized side information, where the feature map F is used to characterize the prediction value corresponding to each feature point.

[0126] The probability distribution estimation module may be a probability distribution estimation network, which is used to output the Gaussian distribution variance parameter σ corresponding to each feature point based on the quantized side information, wherein the Gaussian distribution variance parameter σ is used to characterize the accuracy of the predicted value. In some embodiments, the probability distribution estimation network and the predicted value estimation network may be fused into one network, and output the Gaussian distribution variance parameter σ of each feature element and the feature map F corresponding to the predicted value.

[0127] The context network module can be used to input the spatially adjacent encoded feature points corresponding to feature point y into the context network when encoding any feature point or feature block, such as feature point y, to obtain a feature map G corresponding to the encoded feature point.

[0128] The prediction network module is used to obtain a more accurate prediction value μ of the feature point y based on the feature map F and the feature G.

[0129] The residual point calculation module is used to obtain the residual point r corresponding to the feature point y by subtracting the feature point y from the predicted value μ, and quantize the residual point r to obtain the quantized residual point

[0130] The entropy coding skipping judgment module is used to determine whether to perform entropy coding on the quantized residual point according to the size of the Gaussian distribution variance parameter σ. For example, if the Gaussian distribution variance parameter σ corresponding to the feature point y is greater than the preset threshold T, it can be proved that the accuracy of the predicted value of the feature point is low, so the quantized residual point needs to be entropy coded. If the Gaussian distribution variance parameter σ corresponding to the feature point y is less than or equal to the preset threshold T, it can be proved that the prediction value of the feature point has a high accuracy, so there is no need to quantize the residual point For encoding, the predicted value can be directly written into the encoded bitstream.

[0131] The feature point position judgment module is used to judge whether the feature point position is located in the boundary area of ​​the divided area of ​​the feature map. When it is determined to be located in the boundary area, it is determined that the residual points of the corresponding feature points need to be encoded; when it is determined that it is not located in the boundary area, it is determined that the entropy coding skip judgment module needs to be used to judge whether the residual points of the feature points need to be encoded.

[0132] The arithmetic coding module is used to encode the residual points of the feature points.

[0133] The decoding-end electronic device may include an arithmetic decoding module, a probability distribution estimation module, a prediction value estimation module, a prediction network module, an image reconstruction module, a feature point position judgment module, and an entropy decoding skip judgment module, etc.

[0134] Arithmetic decoding module, which can be used to parse the quantized side information and quantized residual points from the bitstream And the quantized side information Output to the probability distribution estimation module.

[0135] The probability distribution estimation module may be a probability distribution estimation network, which is used to output the Gaussian distribution variance parameter σ corresponding to each feature point based on the quantized side information, wherein the Gaussian distribution variance parameter σ is used to characterize the accuracy of the predicted value. In some embodiments, the probability distribution estimation network and the predicted value estimation network may be fused into one network, and output the Gaussian distribution variance parameter σ of each feature element and the feature map F corresponding to the predicted value.

[0136] The context network module can be a context network, which can be used to encode any feature point or feature block, such as feature point y. The spatially adjacent encoded feature points corresponding to feature point y can be input into the context network to obtain a feature map G corresponding to the encoded feature point.

[0137] The prediction network module may be a prediction network used to obtain a more accurate prediction value μ of the feature point y based on the feature map F and the feature map G.

[0138] The entropy decoding skipping judgment module is used to determine whether to perform entropy decoding on the quantized residual point according to the size of the Gaussian distribution variance parameter σ. For example, if the Gaussian distribution variance parameter σ corresponding to the feature point y is greater than the preset threshold T, it can be proved that the accuracy of the predicted value of the feature point is low, so decoding is required to obtain the quantized residual point And the quantized residual point The value of the feature point y is obtained by summing it with the predicted value μ. If the Gaussian distribution variance parameter σ corresponding to the feature point y is less than or equal to the preset threshold T, it can be proved that the predicted value of the feature point has a high accuracy, so there is no need to decode to obtain the quantized residual point The predicted value μ can be directly used as the value of the feature point y.

[0139] The feature point position judgment module is used to judge whether the feature point position is located in the boundary area of ​​the divided area of ​​the feature map. When it is determined to be located in the boundary area, it is determined that decoding is required to obtain the residual points of the feature points; when it is determined not to be located in the boundary area, it is determined that entropy decoding is required to skip the judgment module to determine whether to encode the residual points of the feature points.

[0140] The image reconstruction module is used to obtain a reconstructed image based on the values ​​of the feature points.

[0141] The following is a detailed introduction to the encoding and decoding method mentioned in the embodiment of the present application based on the above-mentioned electronic device. The encoding and decoding method mentioned in the embodiment of the present application may include an encoding method and a decoding method. The encoding method of the present application can be performed by an encoding end electronic device, and the decoding method mentioned in the embodiment of the present application can be performed by a decoding end electronic device.

[0142] Embodiment 1:

[0143] Specifically, refer to Figure 4A The encoding method flow chart shown in the figure may include:

[0144] S101: Obtain a feature map y of an image.

[0145] It can be understood that in the embodiment of the present application, the images to be compressed can be respectively input into the feature extraction module to obtain the feature map y of the image to be compressed. In some embodiments, the feature extraction module can obtain the feature map y by stacking multiple layers of convolution and combining a nonlinear mapping activation function. Specifically, the feature extraction module can be implemented using any implementable neural network model or other method, which is not limited here.

[0146] S102: Input the feature map of the image into the edge information extraction module to output the edge information z, and quantize it to obtain the quantized edge information

[0147] In some embodiments, the feature graph y may be input to a side information extraction module, and the side information extraction module may output side information z according to the feature graph y. The side information extraction module may use Figure 4B (1) is implemented as shown in the network, where Figure 4BThe network shown in (1) may include an absolute value (abs) operator, a Conv operator with a convolution kernel of N*3*3 / 1, two Conv operators with convolution kernels of N*5*5 / 2, and two ReLU (rectified linear unit) operators, wherein the abs operator, the Conv operator with a convolution kernel of N*3*3 / 1, the ReLU operator, the Conv operator with a convolution kernel of N*5*5 / 2, the Conv operator with a convolution kernel of N*5*5 / 2, and the ReLU operator may be connected in sequence.

[0148] In some embodiments, the side information z may be quantized to obtain quantized side information

[0149] S103: Based on the quantized side information The feature map F and Gaussian distribution variance parameter σ corresponding to the feature elements in the feature map are obtained.

[0150] In some embodiments, the quantized side information may be Input the prediction value estimation network, and output the feature map F through the prediction value estimation network. The feature map F is used to characterize the prediction value corresponding to each feature point. At the same time, the quantized side information Input into the probability distribution estimation network to output the Gaussian distribution variance parameter σ corresponding to each feature point, where the Gaussian distribution variance parameter σ is used to characterize the accuracy of the predicted value.

[0151] In some embodiments, the quantized side information may be The input is sent to the prediction value estimation module, which uses the quantized side information Output feature map F, the prediction value estimation module can use Figure 4B (2) is implemented by the network shown in Figure 4B The network shown in (2) may include two Conv operators with convolution kernels of N*5*5 / 2, a Conv operator with convolution kernel of N*3*3 / 1, and two ReLU operators, wherein the Conv operator with convolution kernel of N*5*5 / 2, the ReLU operator, the Conv operator with convolution kernel of N*5*5 / 2 and the ReLU operator, and the Conv operator with convolution kernel of N*3*3 / 1 may be connected in sequence.

[0152] In some embodiments, the quantized side information may be The input is sent to the probability distribution estimation module, which uses the side information Output Gaussian distribution variance parameter σ, the probability distribution estimation module can use Figure 4B (3) is implemented by the network shown in Figure 4BThe network shown in (3) may include two Conv operators with convolution kernels of N*5*5 / 2, a Conv operator with a convolution kernel of N*3*3 / 1, and two Leaky ReLU operators, wherein the Conv operator with a convolution kernel of N*5*5 / 2, the Leaky ReLU operator, the Conv operator with a convolution kernel of N*5*5 / 2, the Leaky ReLU operator, and the Conv operator with a convolution kernel of N*3*3 / 1 may be connected in sequence.

[0153] It can be understood that in some embodiments, the probability distribution estimation network and the prediction value estimation network can be integrated into one network, and then the Gaussian distribution variance parameter σ and the feature map F are output.

[0154] S104: Divide the feature map y into multiple regions, and write the division information into the bitstream.

[0155] In some embodiments, there may be multiple ways to divide the feature graph y, such as horizontal division, vertical division, or any other feasible way. Figure 4C (1) shows a way to divide the area horizontally. Figure 4C As shown in (1), the feature map y can be divided into region 0, region 1, and region 2.

[0156] In some embodiments, the partition information may include an index number of each partition area and a height of the area or the number of areas.

[0157] For example, a corresponding index number may be set for each region. For example, when the feature map y is divided into N regions, the index number of the first region may be 0, and the index number of the last region may be N-1.

[0158] In some embodiments, within a region, the samples in the kth row can be processed in parallel with the samples in the k-1th row after only a delay of T samples. The number of points processed in parallel within a region is recorded as numThreads, which corresponds to the number of rows in the region, that is, the height of the region. In some embodiments, when the region is the same width as the feature map y, the value corresponding to the height of the region can be written into the bitstream to know the size of the region. At the same time, the number of regions and the position of the starting point of each region in the feature map y can be obtained based on the ratio of the height of the feature map y to the height of the region.

[0159] In some embodiments, the number of regions N can be written into the bitstream, and the height of the region and the position of the starting point of each region in the feature map y can be obtained based on the ratio of the height of the feature map y to the number of regions N.

[0160] It can be understood that the order of step S104 and the aforementioned steps S102 and S103 can be interchanged at will, and is not limited here.

[0161] S105: Obtaining a coded bitstream based on the position of each feature point in the region and the Gaussian distribution variance parameter σ corresponding to the feature point.

[0162] It can be understood that in the embodiment of the present application, whether to encode the feature points can be determined based on the position of each feature point in the area and the Gaussian distribution variance parameter σ corresponding to the feature point. If it is determined that encoding is required, the residual value corresponding to the feature point is entropy encoded to obtain the encoded data and write it into the encoded bitstream. If encoding is not required, the predicted value corresponding to the feature point is directly written into the encoded bitstream.

[0163] Reference below Figure 4D , the process of determining whether to encode the feature points based on the positions of the feature points in the region and the Gaussian distribution variance parameters σ corresponding to the feature points in step S105 is described in detail.

[0164] S1051: For the current feature point in the area, the feature values ​​of the encoded feature points spatially adjacent to the current feature point are input into the context network and the prediction network to obtain the predicted value of the current feature point.

[0165] In some embodiments, the feature values ​​of the spatially adjacent encoded feature points of the current feature point are converted into Figure 3A The feature values ​​on the upper and left sides of the feature point 10 are input into the context network, and then the feature value g(:, i, j) is output. The feature value g(:, i, j) and the current feature point f(:, i, j) at the corresponding position in the feature graph F in step S103 are input into the prediction network to obtain the predicted value μ(:, i, j) of the current feature point.

[0166] S1052: Calculate the residual value between the feature value of the current feature point and the predicted value, and obtain the quantized value corresponding to the residual value.

[0167] In some embodiments, the residual value r(:, i, j) between the characteristic value y(:, i, j) of the characteristic point and the predicted value μ(:, i, j) is calculated, and then quantized to obtain the quantized residual value

[0168] S1053: Determine whether to perform entropy coding on the feature point based on the position of the feature point in the region and the Gaussian distribution variance parameter σ corresponding to the feature point.

[0169] In some embodiments, the method for determining whether to entropy encode the feature point may be: determining whether the feature point is located in the boundary area of ​​other areas except the first area, and if so, calculating the residual point after quantization of the feature point. Otherwise, the above Figure 2A-2BThe coding skip algorithm mentioned in determines whether entropy coding is performed. It can be understood that the first region is the region where feature points are first decoded from the perspective of coding order. For example, when the feature map is Figure 3B as shown in the horizontal division, the first region is region 1.

[0170] In some embodiments, the inner boundary region of the divided region may refer to a region with a preset number of rows or a preset range from the boundary line of the divided region. For example, as described above Figure 3D as shown, when the divided region is a rectangular region, the boundary region may refer to one or more of the upper boundary region a1 where the top P1 rows of feature points are located, the lower boundary region a2 where the bottom P2 rows of feature points are located, the left boundary region a3 where the left P3 columns of feature points are located, and the right boundary region a4 where the right P4 columns of feature points are located; in some embodiments, the values of P1, P2, P3, and P4 may be equal or unequal, and the values of P1, P2, P3, and P4 may be greater than or equal to 1. It can be understood that the divided region may include any number of boundary lines, the shape of the boundary line may be any shape, such as a straight line, a curve, etc., and the number of boundary regions may be any number, which is not limited herein.

[0171] It can be understood that if the upper boundary region of the region refers to the first P rows on the upper side of the region, then it is determined whether to perform entropy coding on the quantity quantized residual points The method of performing entropy coding can be: for the feature points corresponding to the coordinates (:, i, j): when numThread * k ≤ i < numThread * k + P, at this time, it is determined whether the feature points are located in the upper boundary region of the region, and it is necessary to perform entropy coding on the quantized residual points corresponding to the feature points and the feature value of the feature points is set to where numThread represents the number of rows in a region, k represents the index number of the region, i represents the row number corresponding to the coordinates (:, i, j) in the region, j represents the column number corresponding to the coordinates (:, i, j) in the region, ":" represents any channel, and k > 0.

[0172] In some embodiments, the method of determining whether to perform entropy coding on feature points can also be: determining whether the feature points are located in the upper boundary region of each region. If so, perform entropy coding on the residuals of the feature points; otherwise, execute the coding skip algorithm based on the probability distribution parameters to determine whether to perform entropy coding. In some embodiments, the upper boundary of the region refers to the region of the first P rows on the upper side of the region.

[0173] It can be understood that if the upper boundary region of the region refers to the first P rows on the upper side of the region, which represents the number of rows in a region, k represents the index number of the region, and for the feature points corresponding to the coordinates: when performing entropy coding on the feature residuals, where k ≥ 0.

[0174] In some embodiments, the way to determine whether to perform entropy coding on feature points may also be: to determine whether a feature point is located in the boundary region of each region. If so, perform entropy coding on the residual of any region boundary feature point otherwise, execute the coding skip algorithm based on probability distribution parameters to determine whether to perform entropy coding.

[0175] In some embodiments, the process of the coding skip algorithm based on probability distribution parameters may include:

[0176] For a feature point y, the spatially adjacent encoded feature points corresponding to the feature point y can be input into the context network to obtain the feature map G corresponding to the encoded feature points. By inputting the feature map F and the feature G into the prediction network, a more accurate predicted value μ of the feature point y can be obtained. In addition, the difference between the feature point y and the predicted value μ can be calculated to obtain the residual point r corresponding to the feature point y, and the residual point r is quantized to obtain the quantized residual point Then, it can be determined whether to perform entropy coding on the quantized residual point according to the size of the Gaussian distribution variance parameter σ. For example, if the Gaussian distribution variance parameter σ corresponding to the feature point y is greater than the preset threshold T, it can be proved that the accuracy corresponding to the predicted value of this feature point is relatively low. Therefore, the arithmetic encoding (AE) module can perform entropy coding on the quantized residual point and write it into the encoded bitstream. If the Gaussian distribution variance parameter σ corresponding to the feature point y is less than or equal to the preset threshold T, it can be proved that the accuracy corresponding to the predicted value of this feature point is relatively high. Therefore, there is no need to perform entropy coding on the quantized residual point and the predicted value can be directly written into the encoded bitstream.

[0177] The value of T is any value satisfying 0 < T < 1. For example, the value can be 0.2, 0.3, 0.4, etc., and is not limited here.

[0178] It can be understood that the encoding end can use the following method to obtain the preset threshold of the encoding end and the preset threshold of the decoding end, and can write the preset threshold of the encoding end and the preset threshold of the decoding end into the bitstream.

[0179] In some embodiments, the preset threshold of the encoding end and the preset threshold of the decoding end can be obtained by constructing a threshold candidate list at the encoding end. For example, each threshold in the threshold candidate list can correspond to an index number, such as an integer greater than or equal to 1, or a threshold can correspond to multiple index numbers. Specifically, the index number is written into the bitstream, and it can be saved in a sequence header, a picture header, a slice header, or supplemental enhancement information (SEI) and transmitted to the decoding end. Other methods can also be used, which are not limited here. The way in which the encoding end constructs the candidate list is not limited here.

[0180] In some embodiments, the encoder can obtain the preset threshold of the encoder and the preset threshold of the decoder through the encoder, and the encoder can set different thresholds according to different complexities, and then write the final threshold into the bitstream. Specifically, the threshold is written into the bitstream, and it can be saved in the sequence header, the image header, the slice / strip or the supplementary enhancement information and transmitted to the decoder. Other methods can also be used, which are not limited here.

[0181] In some embodiments, the encoding end may adopt a preset threshold of the encoding end and a preset threshold of the decoding end agreed upon with the decoding end, without writing into the bitstream or transmitting to the decoding end.

[0182] It can be understood that after the encoding end electronic device obtains the encoded code stream, the encoded code stream can be sent to the decoding end. The following is an introduction to the method of decoding by the decoding end electronic device. Figure 4E As shown, the decoding process may include:

[0183] S201: Obtaining threshold information and quantized side information based on the encoded bitstream

[0184] Corresponding to the encoding end, the decoding end can obtain threshold information in the following ways:

[0185] In some embodiments, the index number can be obtained from the bitstream, and the decoder uses the same method as the encoder to construct a threshold candidate list, and then obtains the corresponding threshold according to the correspondence between the preset and the index number in the threshold candidate list. The index number is obtained from the bitstream, that is, the index number is obtained from the sequence header, the picture header, the slice / strip or the SEI.

[0186] In some embodiments, the threshold information may be obtained by directly parsing the bitstream, specifically, the threshold is obtained from a sequence header, a picture header, a slice / strip or a SEI of the bitstream.

[0187] In some embodiments, the fixed threshold may be directly set according to a threshold agreement strategy for decoding.

[0188] In some embodiments, the decoder can obtain quantized side information from the bitstream based on ANS / arithmetic decoding.

[0189] S202: Based on the quantized side information Get the Gaussian distribution variance parameter σ and feature map F.

[0190] In some embodiments, the quantized side information may be Input the prediction value estimation network, and output the feature map F through the prediction value estimation network. The feature map F is used to characterize the prediction value corresponding to each feature point. At the same time, the quantized side information Input into the probability distribution estimation network to output the Gaussian distribution variance parameter σ corresponding to each feature point, where the Gaussian distribution variance parameter σ is used to characterize the accuracy of the predicted value.

[0191] S203: Parsing region division information from the encoded bitstream.

[0192] In some embodiments, the electronic device at the encoding end can parse the region division information in the encoding code stream to obtain information such as the region size and the position of each region in the feature map.

[0193] In some embodiments, when the number of points numThreads processed in parallel in a region is parsed from the encoded bitstream, the number corresponds to the number of rows in the region, that is, the height of the region. In one case, when the region is the same width as the feature map y, the number of regions and the position of the starting point of each region in the feature map y can be obtained based on the ratio of the height of the feature map y to the height of the region.

[0194] In some embodiments, after obtaining the region number information from the encoded bitstream, the region height and the position of each region starting point in the feature graph y can be obtained based on the ratio of the height of the feature graph y to the number of regions.

[0195] S204: Obtain a reconstruction value corresponding to each feature point based on the feature map F, the position of each feature point in the region, and the Gaussian distribution variance parameter σ corresponding to each feature point.

[0196] Reference below Figure 4F , the process of step S204 is described in detail.

[0197] S2041: For a feature point in the region, input its spatially adjacent decoded feature points into the context network and the prediction network to obtain a predicted value of the feature point.

[0198] In some embodiments, the encoded feature points adjacent to the current feature point at the coordinate (:, i, j) position, such as Figure 3A the eigenvalue above and to the left of feature point 10 in Figure 3A , are input into the context network, and then the eigenvalue g(:, i, j) is output. The eigenvalue g(:, i, j) and the current feature point f(:, i, j) at the corresponding position in the feature map F in step S103 are input into the prediction network to obtain the predicted value μ(:, i, j) for estimating the predicted value of the current feature point.

[0199] S2042: Determine the reconstruction value corresponding to each feature point based on the position of the feature point in the region and the Gaussian distribution variance parameter σ corresponding to the feature point.

[0200] It can be understood that based on the position of the feature point in the region and the Gaussian distribution variance parameter σ corresponding to the feature point, it is determined whether to perform entropy decoding on the feature point, that is, whether to perform entropy decoding on the residual value corresponding to the feature point. If necessary, the residual point of the feature point is entropy decoded, and the reconstruction value corresponding to the feature point is set to the sum of the predicted value and the residual point value. If not necessary, the reconstruction value corresponding to the feature point is set to the predicted value.

[0201] In some embodiments, the method for determining whether to perform entropy decoding on a feature point can be: except for the first region, the residual points of the feature points on the upper boundary of other regions are subjected to entropy decoding.

[0202] It can be understood that if the upper boundary region of the region refers to the first P rows on the upper side of the region, then the method for determining whether to perform entropy decoding on the quantized residual point corresponding to the feature point can be: for the feature point corresponding to the coordinate (:, i, j), when numThread * k ≤ i < numThread * k + P, perform entropy decoding to obtain the feature residual value The reconstruction value of the feature point is set to where k > 0. Determine to perform entropy decoding. Otherwise, execute the decoding skip algorithm based on the probability distribution parameter.

[0203] It can be understood that the upper boundary of the region refers to the first P rows on the upper side of the region, numThread represents the number of rows in a region, and k represents the index number of the region.

[0204] In some embodiments, the method for determining whether to perform entropy decoding on a feature point can be: perform entropy decoding on the residual points of the feature points on the upper boundary of any region are subjected to entropy decoding.

[0205] It can be understood that if the upper boundary region of any region refers to the first P rows on the upper side of the region, then it is determined whether to perform entropy decoding on the quantized residual point corresponding to the feature point The method of performing entropy decoding can be as follows: for the feature point corresponding to the coordinate (:, i, j), when numThread*k ≤ i < numThread*k + P, perform entropy decoding to obtain the feature residual value. The reconstructed value of the feature point is set to where k ≥ 0. Determine to perform entropy decoding. Otherwise, execute the decoding skip algorithm based on the probability distribution parameters. It is the same as the decoding skip algorithm based on the probability distribution parameters executed by the above decoding end and will not be elaborated here.

[0206] In some embodiments, the method of determining whether to perform entropy decoding on a feature point can be: when the position of the coordinate (:, i, j) is on the boundary of the region, perform entropy decoding on the feature point to obtain the feature residual value. The reconstructed value of the feature point is set to Otherwise, execute the decoding skip algorithm based on the probability distribution parameters. It is the same as the decoding skip algorithm based on the probability distribution parameters executed by the above decoding end and will not be elaborated here.

[0207] S205: Obtain the reconstructed image based on the reconstructed values corresponding to each feature point.

[0208] In some embodiments, the feature map after entropy decoding can be input into the image reconstruction module to obtain the reconstructed image. Among them, the feature map after entropy decoding can be composed of the reconstructed values corresponding to each feature point.

[0209] In some embodiments, the neural network in the image reconstruction module can adopt any structure, such as a fully connected network, a convolutional neural network, a recurrent neural network, etc., which are not limited here. In some embodiments, the neural network can also adopt a multi-layer deep neural network structure.

[0210] Based on the above solution, during encoding, when the feature point is in the boundary area of each divided region, the above encoding skip judgment algorithm is not executed, but arithmetic coding is performed based on the residual value and the predicted value corresponding to the feature point. Correspondingly, during decoding, when the feature point is at the boundary position of each divided region, the decoding skip judgment algorithm is not executed, but the reconstructed value corresponding to the decoded feature point is directly obtained based on the residual value and the predicted value corresponding to the feature point. In this way, unlike the previous solution, the low-accuracy predicted value will not be directly used as the reconstructed value, effectively avoiding image quality problems.

[0211] In some embodiments, the schematic diagram of the encoding and decoding process of the entire feature map can be as Figure 4G and Figure 4H shown, and the specific solution is as follows:

[0212] Refer to Figure 4GIn the encoding process shown in the figure, the feature map corresponding to the image to be encoded can be divided into regions first to determine whether the first feature point is at the boundary position. On the one hand, when the feature point is at the boundary position of the region, it is determined to perform entropy coding (arithmetic coding / ANS coding) on ​​the feature point, and the feature value of the feature point is set to the sum of the quantized residual value and the predicted value. Perform arithmetic coding and write it into the coded bitstream, then obtain the next feature point to continue the judgment. On the other hand, when the feature point is not at the boundary of the region, the feature point is entropy coded using the skip technology based on probability distribution. Specifically, it can be determined whether to perform entropy coding on the quantized residual point based on the size of the Gaussian distribution variance parameter σ. When the Gaussian distribution variance parameter σ corresponding to the feature point is greater than the preset threshold value T1, it proves that the accuracy of the predicted value of the feature point is low. Therefore, it is necessary to perform arithmetic coding on the quantized residual point and set the characteristic value of the feature point to the quantized residual value. The sum of the predicted value μ and the quantized residual point Perform arithmetic coding and write it into the coded bitstream. When the Gaussian distribution variance parameter σ corresponding to the feature point is less than or equal to the preset threshold T1, the entropy coding process is skipped, the feature value of the feature point is set to the predicted value μ, and the residual point corresponding to the feature point is not Instead of encoding, the predicted value is directly written into the bitstream, and the next feature point is obtained, and the encoding judgment process is continued until the last feature point is encoded.

[0213] Among them, when encoding any feature point, the spatially adjacent encoded feature points corresponding to the feature point y can be input into the context network to obtain the feature map G corresponding to the encoded feature point, and the feature map F and the feature G are input into the prediction network to obtain a more accurate prediction value μ of the feature point y, and then the feature point y is subtracted from the prediction value μ to obtain the residual point r corresponding to the feature point y, and the residual point r is quantized to obtain the quantized residual point

[0214] refer to Figure 4HIn the decoding process shown, it is determined whether the first feature point is at the boundary position according to the number of regions of the feature map parsed from the encoded code stream and the coordinates corresponding to the feature points in the region. On the one hand, when the feature point is at the boundary position of the region, it is determined to perform entropy decoding (arithmetic decoding / ANS decoding) on ​​the feature point, and the reconstructed value of the feature point is set to the sum of the quantized residual value and the predicted value, and then the next feature point is obtained to continue the judgment. On the other hand, when the feature point is not at the boundary position of the region, the feature point is entropy decoded using the skip technology based on the probability distribution. Specifically, it can be determined whether to perform entropy decoding on the quantized residual point based on the size of the Gaussian distribution variance parameter σ. When the Gaussian distribution variance parameter σ corresponding to the feature point is greater than the preset threshold value T1, it proves that the accuracy corresponding to the predicted value of the feature point is low, so it is necessary to perform arithmetic decoding on the feature point, that is, decode the encoding information corresponding to the quantized residual point to obtain the quantized residual point. And the quantized residual point The reconstructed value of the feature point is obtained by summing it with the predicted value μ. When the Gaussian distribution variance parameter σ corresponding to the feature point is less than or equal to the preset threshold value T1, it proves that the predicted value of the feature point has a high accuracy. Then the entropy decoding process can be skipped, and the reconstructed value of the feature point is set to the predicted value μ. The feature point is not entropy decoded, and then the next feature point is obtained, and the above judgment process is continued for decoding until the last feature point is decoded.

[0215] When decoding any feature point, the quantized side information is parsed from the encoded bitstream through the Arithmetic Decoding (AD) module, and then the quantized side information is input into the probability distribution estimation network to obtain the Gaussian distribution variance parameter σ. At the same time, the quantized side information is input into the prediction value estimation network to obtain the output feature map F. When decoding any feature point in the feature map F, the decoded feature points adjacent to the feature point space can be input into the context network to obtain the feature G, and the feature map F and the feature G are input into the prediction network to obtain the prediction value μ corresponding to the feature point.

[0216] Embodiment 2:

[0217] The difference between the encoding method of the second embodiment of the present application and the encoding method of the first embodiment is that the method of obtaining the encoded bit stream based on the position of each feature point in the area and the Gaussian distribution variance parameter σ corresponding to the feature point is different. In the second embodiment of the present application, after determining the skip_mask (skip mask) according to the feature point position and the Gaussian distribution variance parameter σ corresponding to each feature point, the judgment result is stored in the skip_mask map with a binary value identifier of 0 or 1. Among them, 1 can represent that entropy encoding is required, and 0 can represent that entropy encoding is not required. In this way, when encoding, when it is identified that the identifier corresponding to the feature point in the skip_mask map is 1, entropy encoding is performed, and when the identifier is 0, entropy encoding is skipped.

[0218] It can be understood that the method for obtaining the encoded bit stream based on the position of each feature point in the region and the Gaussian distribution variance parameter σ corresponding to the feature point provided in the second embodiment is introduced below. Figure 5A , the steps may include:

[0219] S301: Determine whether to perform entropy coding on the feature point based on the position of the feature point in the region and the Gaussian distribution variance parameter σ corresponding to the feature point, and store identification information corresponding to the judgment result in the skip_mask map.

[0220] In some embodiments, the judgment result can be stored in the skip_mask map with a binary value of 0 or 1. Among them, 1 can represent that entropy coding is required, and 0 can represent that entropy coding is not required. For example, when skip_mask(o,p,q) in the skip_mask map is 1, the characteristic value of the characteristic element (c,i,j) is set to When skip_mask(o,p,q) is 0, the feature residual value of the corresponding area of ​​the feature element is set to 0, and the feature element Set to μ(:,i,j).

[0221] The following describes a method for determining whether to perform entropy coding on feature points.

[0222] In some embodiments, the method for determining whether to perform entropy coding on a feature point may be as follows: taking the feature point as a unit, based on the variance parameter σ(c,i,j) of the Gaussian distribution corresponding to the feature point position and the sub-block where the feature point is located, determine whether to perform entropy coding. For example, when the feature point (c,i,j) is located at the upper boundary of the region, or the variance parameter σ(c,i,j) of the Gaussian distribution is greater than the threshold, perform entropy coding and set skip_mask to 1; otherwise, do not perform entropy coding and set skip_mask to 0. In some embodiments, if the upper boundary of the region refers to the first P rows on the upper side of the region, numThread represents the number of rows in a region, and k represents the index number of the region. For the feature point corresponding to the coordinate (:,i,j), when numThread*k ≤ i < numThread*k + P, where k ≥ 0, P ≥ 1, or the variance parameter σ(c,i,j) of the Gaussian distribution > T1, set skip_mask(c,i,j) = 1. Otherwise, set skip_mask(c,i,j) = 0. In some embodiments, T1 takes any value satisfying 0 < T1 < 1, for example, the value is 0.2, 0.3, 0.4, etc. It can be understood that T1 in the embodiments of the present application can be a preset threshold at the encoding end.

[0223] In some embodiments, the method for determining whether to perform entropy coding on a feature point may be as follows: except for the first region, perform entropy coding on the residuals of the feature points at the upper boundary of other regions Perform entropy coding. The upper boundary of the region refers to the first P rows on the upper side of the region, numThread represents the number of rows in a region, and k represents the index number of the region. For the feature point corresponding to the coordinate (:,i,j), when numThread*k ≤ i < numThread*k + P, where k > 0, P ≥ 1, or the variance parameter σ(c,i,j) of the Gaussian distribution > T1, set skip_mask(c,i,j) = 1; it is determined to perform entropy coding. Otherwise, set skip_mask(c,i,j) = 0. In some embodiments, T1 takes any value satisfying 0 < T1 < 1, for example, the value is 0.2, 0.3, 0.4, etc.

[0224] In some embodiments, the method for determining whether to perform entropy coding on a feature point may be as follows: taking the feature point as a unit, based on the feature point position and the variance within the sub-block, determine whether to perform entropy coding. When the feature point (c,i,j) is located at the boundary of the region, or the variance parameter σ(c,i,j) of the Gaussian distribution corresponding to the sub-block where the feature point is located satisfies σ(c,i,j) > T1, set skip_mask(c,i,j) = 1; it is determined to perform entropy coding. Otherwise, set skip_mask(c,i,j) = 0. In some embodiments, T1 takes any value satisfying 0 < T1 < 1, for example, the value is 0.2, 0.3, 0.4, etc.

[0225] In some embodiments, the method for determining whether to perform entropy coding on feature points may be as follows: Taking a PxP sub-block as a unit, based on the sub-block position where the feature point is located and the variance parameter σ of the Gaussian distribution corresponding to the sub-block where the feature point is located, determine whether to perform entropy coding on PxP. When at least one point in the PxP feature block is located on the upper boundary of the region, perform entropy coding on all feature points in the PxP block, that is, the skip_mask corresponding to PxP is all 1.

[0226] If the upper boundary of the region refers to the first P rows on the upper side of the region, numThread represents the number of rows in a region, and k represents the index number of the region. Calculate the maximum value σ of the variance parameter σ of the Gaussian distribution within the PxP block max , for the PxP feature block starting from the feature point (c, i, j): when numThread*k ≤ i < numThread*k + P, or numThread*k ≤ i + P < numThread*k + P, or σ max > T1, set skip_mask(c, i:i+P, j:j+P) = 1; determine to perform entropy coding. Otherwise, set skip_mask(c, i:i+P, j:j+P) = 0. In some embodiments, T1 takes any value satisfying 0 < T1 < 1, for example, the value is 0.2, 0.3, 0.4, etc.

[0227] In some embodiments, the method for determining whether to perform entropy coding on feature points may be as follows: Taking a PxP sub-block as a unit, based on the sub-block position and the variance within the sub-block, determine whether to perform entropy coding on PxP. When the feature point (c, i, j) in the PxP feature block is located on the upper boundary of the region, perform entropy coding on the feature point (c, i, j), that is, the corresponding skip_mask(c, i, j) is set to 1. Calculate the maximum value σ of the variance parameter σ of the Gaussian distribution within the PxP block max , for the feature point (c, i, j) within PxP, when numThread*k ≤ i < numThread*k + P, or the variance σ max > T1, set skip_mask(c, i, j) = 1; determine to perform entropy coding. Otherwise, set skip_mask(c, i, j) = 0. In some embodiments, T1 takes any value satisfying 0 < f1 < 1, for example, the value is 0.2, 0.3, 0.4, etc.

[0228] In some embodiments, the method for determining whether to perform entropy coding on feature points may be as follows: Taking a PxP sub-block as a unit, based on the sub-block position and the variance within the sub-block, determine whether to perform entropy coding on PxP. Exemplarily, calculate the maximum value σ of the variance parameter σ of the Gaussian distribution within the PxP block max, Denote the starting coordinates of the PxP block as (c, i, j); for the feature point (c, i, j), when numThread*k ≤ i < numThread*k + P, or numThread*k ≤ i + P < numThread*k + P, or the maximum variance σ max > T1, set mask p (c, i′, j′) = 1; determine to perform entropy coding. Otherwise, set mask p (c, i′, j′) = 0. Where i′ = i / P, j′ = j / P, mask p (c, i′, j′) corresponds to the region enclosed by the c-th channel, the i′*P-th row to the i′*P + P-th row, and the j′*P-th column to the j′*P + P-th column on the feature map y.

[0229] Among them, when the dimension of the feature map y is CxHxW, the dimension of mask p is set to Cx(H / P)x(W / P). When converting mask p to skip_mask with the same dimension as the feature map y, set skip_mask[c, i, j] = mask p [c, i / P, j / P].

[0230] In some embodiments, the value of T1 is any number satisfying 0 < T1 < 1, for example, the value is 0.2, 0.3, 0.4, etc.

[0231] In some embodiments, the method for determining whether to perform entropy coding on a feature point can be: based on the PxP sub-block, judge whether to perform entropy coding on PxP based on the sub-block position and the variance within the sub-block. When at least one point in the PxP feature block is located on the upper boundary of the region, perform entropy coding on the PxP block, that is, all skip_mask corresponding to PxP are 1.

[0232] If the upper boundary of the region refers to the first P rows on the upper side of the region, numThread represents the number of rows in a region, and k represents the index number of the region. numThread is an integer multiple of P, calculate the maximum value σ of the Gaussian distribution variance parameter σ within the PxP block max , for the PxP feature block starting from the feature point (c, i, j): when numThread*k ≤ i < numThread*k + P or σ max > T1, set skip_mask(c, i:i + P, j:j + P) = 1; determine to perform entropy coding. Otherwise, set skip_mask(c, i:i + P, j:j + P) = 0. In some embodiments, the value of T1 is any number satisfying 0 < T1 < 1, for example, the value is 0.2, 0.3, 0.4, etc.

[0233] In some embodiments, the way to determine whether to perform entropy coding on feature points may be as follows: taking a PxP sub-block as a unit, based on the sub-block position and the variance within the sub-block, determine whether to perform entropy coding on PxP. Exemplarily, calculate the average value σ of the Gaussian distribution variance parameter σ within the PxP block avg , for the feature point (c, i, j) within PxP. When (c, i, j) is located at the upper boundary of the region, or the average value σ of the Gaussian distribution variance parameter σ avg satisfies σ avg > T1, set skip_mask(c, i, j) = 1; determine to perform entropy coding. Otherwise, set skip_mask(c, i, j) = 0. In some embodiments, the value of T1 is any number that satisfies 0 < T1 < 1, for example, the value is 0.2, 0.3, 0.4, etc.

[0234] It can be understood that when obtaining the thresholds T0 and T1, the same method as in Embodiment 1 can be used to obtain the thresholds T0 and T1, which will not be elaborated here.

[0235] S302: For the current feature point within the region, input the feature values of the already encoded feature points that are spatially adjacent to the current feature point into the context network to obtain the predicted value of the current feature point.

[0236] In some embodiments, input the feature values of the already encoded feature points that are spatially adjacent to the position of the coordinate (:, i, j) into the context network, such as Figure 3A the feature values above and to the left of feature point 10 in, input them into the context network, and then output the feature value g(:, i, j). Input the feature value g(:, i, j) and the feature point f(:, i, j) at the corresponding position on the feature map F into the prediction network to obtain the predicted value estimate of the current feature point μ(:, i, j).

[0237] S303: Calculate the residual value between the feature value and the predicted value of the current feature point, and obtain the quantization value corresponding to the residual value.

[0238] In some embodiments, by calculating the residual value r(:, i, j) between the feature point y(:, i, j) and the predicted value μ(:, i, j), quantize the residual value r(:, i, j) to obtain the quantization value corresponding to the residual value

[0239] S304: Based on the information on the skip_mask map, encode the feature points to obtain the encoded bitstream.

[0240] In some embodiments, when the value on the skip_mask map corresponding to the feature point coordinate (:, i, j) is 1, perform entropy coding on the residual value of the feature point to obtain the encoded data and write it into the encoded bitstream.

[0241] In some embodiments, when the value on the skip_mask map corresponding to the feature point coordinates (:, i, j) is 0, entropy coding is skipped and the predicted value μ(:, i, j) of the feature element is written into the encoded bitstream.

[0242] The difference between the decoding method of the second embodiment of the present application and the first embodiment is that the method of obtaining the decoded code stream based on the position of each feature point in the area and the Gaussian distribution variance parameter σ corresponding to the feature point is different. In the second embodiment of the present application, after judging whether to perform skip_mask based on the position of the feature point and the Gaussian distribution variance parameter σ corresponding to each feature point, the judgment result is stored in the skip_mask map with a binary value of 0 or 1. Among them, 1 can represent that entropy decoding needs to be performed, and 0 can represent that entropy decoding is not required. In this way, when decoding, when it is recognized that the skip mask mark is 1, entropy decoding is performed, and when it is 0, entropy decoding is not skipped.

[0243] It can be understood that the method for obtaining the decoded bit stream based on the position of each feature point in the region and the Gaussian distribution variance parameter σ corresponding to the feature point provided in the second embodiment is introduced below. Figure 5B , the steps may include:

[0244] S401: Determine whether to perform entropy decoding on the feature point based on the position of the feature point in the region and the Gaussian distribution variance parameter σ corresponding to the feature point, and store identification information corresponding to the judgment result in the skip_mask map.

[0245] In some embodiments, the result of the entropy decoding judgment can be stored in the skip_mask map with a binary value of 0 or 1. Among them, 1 can represent that entropy decoding is required. For example, when skip_mask (o, p, q) is 1, the characteristic value of the characteristic element (c, i, j) is set to When skip_mask(o,p,q) is 0, the feature residual value of the corresponding area of ​​the feature element is set to 0, and the feature value of the feature element (c,i,j) is set to μ(:,i,j).

[0246] It can be understood that step S401 is the same as step S301 at the encoding end of the second embodiment, and will not be described in detail here.

[0247] S402: For a current feature point in the region, feature values ​​of decoded feature points spatially adjacent to the current feature point are input into a context network and a prediction network to obtain a prediction value of the current feature point.

[0248] It can be understood that step S402 is the same as step S302 at the encoding end of the second embodiment, and will not be described in detail here.

[0249] S403: Decode the bitstream according to the skip_mask map to obtain the reconstruction value corresponding to the feature point.

[0250] In some embodiments, when the value of the skip_mask map corresponding to the coordinates (:, i, j) of the feature point is 1, the feature residual is obtained by entropy decoding from the bitstream. And the feature points The reconstruction value is set to

[0251] In some embodiments, when the value of the skip_mask map corresponding to the coordinates (:, i, j) of the feature point is 0, entropy decoding is skipped and the feature element The reconstruction value of is set to μ(:,i,j).

[0252] Based on the above scheme, during encoding, the skip_mask (skip mask) is determined according to the feature point position and the Gaussian distribution variance parameter σ corresponding to each feature point. After determining whether to perform entropy encoding on the current feature point, the judgment result is stored in the skip_mask map with a binary value of 0 or 1. During encoding, when the skip mask flag is identified as 1, entropy encoding is performed, and when it is identified as 0, entropy encoding is not skipped. Correspondingly, during decoding, when the skip mask flag is identified as 1, entropy decoding is performed, and when it is identified as 0, entropy decoding is not skipped. In this way, the low-accuracy prediction value will not be directly used as the reconstruction value as in the aforementioned scheme, which can effectively avoid image quality problems.

[0253] Embodiment 3

[0254] The difference between the encoding method of the third embodiment of the present application and the second embodiment is that the method of obtaining the encoded bitstream based on the position of each feature point in the region and the Gaussian distribution variance parameter σ corresponding to the feature point is different. In the third embodiment of the present application, it can be determined whether to perform entropy encoding based on the Gaussian distribution variance parameter σ corresponding to each feature point. For feature points that do not need to be entropy encoded, it is determined whether to perform entropy encoding again based on the coordinate position. For example, the identifier of the feature point in the skip_mask (skip mask) map can be first determined based on the Gaussian distribution variance parameter σ corresponding to each feature point, and then the identifier of the feature point can be modified based on the coordinate position. For example, if the identifier corresponding to a feature point is determined to be 0 based on the Gaussian distribution variance parameter corresponding to the feature point, entropy encoding is skipped, but the feature point is determined to be located in the boundary area of ​​the divided area based on the coordinate position, etc., then the identifier corresponding to the feature point can be changed from 0 to 1, that is, entropy encoding is required.

[0255] It can be understood that the method for obtaining the encoded bit stream based on the position of each feature point in the region and the Gaussian distribution variance parameter σ corresponding to the feature point provided in the third embodiment is introduced below. Fig. 6A , the steps may include:

[0256] S501: Based on the determination result of whether to perform entropy coding on the feature points according to the positions of the feature points in the region and the Gaussian distribution variance parameter σ corresponding to the feature points, store the identification information corresponding to the determination result into the skip_mask map.

[0257] In some embodiments, it is determined whether to perform entropy coding based on the Gaussian distribution variance parameter σ corresponding to the feature points, and the determination result is stored into the skip_mask map using a 0 / 1 binary value identifier. For example, when skip_mask(o,p,q) is 1, entropy coding is performed on the feature residual values of the corresponding region; when skip_mask(o,p,q) is 0, the feature residual values of the corresponding region are set to 0.

[0258] Exemplarily:

[0259] Calculate the maximum value σ of σ within the PxP block max , and the starting coordinates of the PxP block are denoted as (c,i,j); when the variance σ max >T1, set mask p (c,i′,j′) = 1; determine to perform entropy coding. Otherwise, set mask p (c,i′,j′) = 0.

[0260] Where, i′ = i / P, j′ = j / P, and mask p (c,i′,j′) corresponds to the region enclosed by the c-th channel, the i′*P-th row to the i′*P+P-th row, and the j′*P-th column to the j′*P+P-th column on the feature map y.

[0261] It can be understood that when the dimension of the feature map y is CxHxW, the dimension of mask p can be set to Cx(H / P)x(W / P). When converting mask p into skip_mask with the same dimension as the feature map y, set skip_mask[c, i, j]=mask p [c, i / p,j / p]. It can be understood that the value of T1 can be any value satisfying 0<T1<1, such as 0.2, 0.3, 0.4, etc., and is not limited herein.

[0262] It can be understood that when obtaining the value of T1, the same method as in Embodiment 1 can be used to obtain the threshold T1, which will not be elaborated herein.

[0263] S502: For the current feature point in the region, input the feature values of the already encoded feature points adjacent to the current feature point in space into the context network and the prediction network to obtain the predicted value of the current feature point.

[0264] In some embodiments, the spatially adjacent encoded feature point reconstruction values ​​at the coordinate (:, i, j) position can be input into the context network, such as Figure 3A The reconstructed value of the Non-zero kernel elements position shown is input into the context network, and the feature value g(:,i,j) is output. The feature value g(:,i,j) and the feature point f(:,i,j) at the corresponding position on the feature map F of step S503 are input into the prediction network to obtain the predicted value μ(:,i,j) of the current feature point.

[0265] S503: Calculate the residual value between the feature value of the current feature point and the predicted value, and obtain the quantized value corresponding to the residual value.

[0266] In some embodiments, the residual value r(:,i,j) between the feature point y(:,i,j) and the predicted value μ(:,i,j) can be calculated, and the quantized value corresponding to the residual value can be obtained after quantization.

[0267] It can be understood that step S501 can be located between or after step S502 and step S503, which is not limited here.

[0268] S504: Determine whether to perform entropy coding on the feature point based on the position of the feature point in the region and the Gaussian distribution variance parameter σ corresponding to the feature point, modify skip_mask, and store identification information corresponding to the determination result of whether to perform entropy coding into the skip_mask map.

[0269] In some embodiments, the judgment result can be stored in the skip_mask map with a binary value of 0 or 1. Among them, 1 can represent that entropy coding is required, and 0 can represent that entropy coding is not required. For example, when skip_mask(o,p,q) is 1, the characteristic value of the characteristic element (c,i,j) is set to When skip_mask(o,p,q) is 0, the feature residual value of the corresponding area of ​​the feature element is set to 0, and the feature value of the feature element (c,i,j) is set to μ(:,i,j).

[0270] The following describes a method for determining whether to perform entropy coding on feature points.

[0271] In some embodiments, the method for determining whether to perform entropy coding on feature points may be as follows: taking each feature point as a unit, based on the variance parameter σ(c,i,j) of the Gaussian distribution corresponding to the position of the feature point and the sub-block where the feature point is located, determine whether to perform entropy coding. When (c,i,j) is located at the upper boundary of the region, determine to perform entropy coding and set skip_mask to 1; otherwise, set skip_mask to maintain its original value.

[0272] In some embodiments, the upper boundary of the region refers to the first P rows on the upper side of the region, numThread represents the number of rows in a region, and k represents the index number of the region. The upper boundary of the region refers to the first P rows on the upper side of the region. When numThread*k ≤ i < numThread*k + P, where k ≥ 0 and P ≥ 1, set skip_mask(c,i,j) = 1 and determine to perform entropy coding; otherwise, set skip_mask(c,i,j) to remain unchanged.

[0273] In some embodiments, the method for determining whether to perform entropy coding on feature points may be as follows: except for the first region, perform entropy coding on the residuals of the feature points on the upper boundaries of other regions The upper boundary of the region refers to the first P rows on the upper side of the region, numThread represents the number of rows in a region, and k represents the index number of the region.

[0274] When numThread*k ≤ i < numThread*k + P, where k > 0 and P ≥ 1, set skip_mask(c,i,j) = 1; determine to perform entropy coding. Otherwise, set skip_mask(c,i,j) to remain unchanged.

[0275] In some embodiments, the method for determining whether to perform entropy coding on feature points may be as follows: taking each feature point as a unit, based on the variance parameter σ(c,i,j) of the Gaussian distribution corresponding to the position of the feature point and the sub-block where the feature point is located, determine whether to perform entropy coding. When (c,i,j) is located at the boundary of the region, set skip_mask(c,i,j) = 1; determine to perform entropy coding. Otherwise, set skip_mask(c,i,j) to remain unchanged.

[0276] In some embodiments, the method for determining whether to perform entropy coding on feature points may be as follows: taking a PxP sub-block as a unit, determining whether to perform entropy coding on PxP based on the Gaussian distribution variance parameter σ(c,i,j) corresponding to the sub-block position where the feature point is located. When at least one point in the PxP feature block is located on the upper boundary of the region, the PxP block is subjected to entropy coding, that is, all skip_mask corresponding to PxP are 1. The upper boundary of the region refers to the first P rows on the upper side of the region, numThread represents the number of rows in a region, and k represents the index number of the region. For a PxP feature block starting from (c,i,j): when numThread*k ≤ i < numThread*k + P, or when numThread*k ≤ i + P < numThread*k + P, it is determined to perform entropy coding, and skip_mask(c,i:i+P,:) = 1 is set.

[0277] In some embodiments, the method for determining whether to perform entropy coding on feature points may be as follows: taking a PxP sub-block as a unit, determining whether to perform entropy coding on PxP based on the Gaussian distribution variance parameter σ(c,i,j) corresponding to the sub-block position where the feature point is located. When the feature point (c,i,j) in the PxP feature block is located on the upper boundary of the region, the feature point (c,i,j) is subjected to entropy coding, and skip_mask(c,i,j) is set to 1. For the feature point (c,i,j) within PxP, when numThread*k ≤ i < numThread*k + P, skip_mask(c,i,j) = 1 is set; it is determined to perform entropy coding. In some embodiments, the value of T1 is any number satisfying 0 < T1 < 1, for example, the values are 0.2, 0.3, 0.4, etc.

[0278] In some embodiments, the method for determining whether to perform entropy coding on feature points may be as follows: taking a PxP sub-block as a unit, determining whether to perform entropy coding on PxP based on the sub-block position. For the feature point (c,i,j) within PxP, the starting coordinates of the PxP block are denoted as (c,i,j); when numThread*k ≤ i < numThread*k + P, or when numThread*k ≤ i + P < numThread*k + P, mask p (c,i′,j′) = 1 is set; it is determined to perform entropy coding. Otherwise, mask p (c,i′,j′) remains unchanged. Wherein, i′ = i / P, j′ = j / P, and mask p (c,i′,j′) corresponds to the region enclosed by the c-th channel, the i′*P-th row to the i′*P + P-th row, and the j′*P-th column to the j′*P + P-th column on the feature map y.

[0279] It can be understood that when the dimension of feature map y is CxHxW, mask p The dimension is Cx(H / P)x(W / P). p When converted to a skip_mask of the same dimension as the feature map y, set skip_mask[c,i,j] = mask p [c,i / P,j / P].

[0280] In some embodiments, the method for determining whether to entropy encode the feature point may be: the upper boundary of the region is set to 1 at the corresponding position of skip_mask, that is, the upper boundary is entropy encoded. The upper boundary of the region refers to the first P rows on the upper side of the region, numThread represents the number of rows in a region, and numThread is an integer multiple of P. k represents the index number of the region.

[0281] For the PxP feature block starting at (c, i, k), the value of skip_mask at the upper boundary position of the region is set to 1: when skip_mask(c, numThread*k: numThread*k + P,:) = 1; k is an integer, it is determined to perform entropy coding.

[0282] In some embodiments, the method of determining whether to entropy encode the feature point may be: the corresponding position of the PxP block that the upper boundary line of the region passes through on the skip_mask map is set to 1, that is, the PxP block containing the upper boundary line of the region is entropy encoded. numThread represents the number of rows in a region. k represents the index number of the region. Figure 6B As shown, the gray block area can be entropy coded. In some embodiments, the value of skip_mask of the area where the upper boundary of the area is located can be set to 1: calculate the index number of the PxP block related to the upper boundary of the area in the vertical direction: Block_index = floor(numThread*k) / P, where k is an integer greater than 0, P is the block size, numThread is the area height, and floor means rounding down to set the value of the PXP block related to the upper boundary of the area at the corresponding position of skip_mask to 1; set skip_mask(c, Block_index*P: Block_index*P+P,:) = 1; k is an integer.

[0283] S505: Encode the feature points based on the information on the skip_mask image to obtain a coded bitstream.

[0284] In some embodiments, when the value of the skip_mask map corresponding to the coordinate (:, i, j) is 1, the feature residual Entropy coding, feature points The eigenvalues ​​of And write the encoded code stream.

[0285] In some embodiments, when the value of the skip_mask map corresponding to the coordinate (:, i, j) is 0, entropy coding is skipped and the feature point The characteristic value of is set to the predicted value μ(:,i,j) and written into the encoded bitstream.

[0286] The difference between the decoding method of the third embodiment of the present application and the second embodiment is that the method of obtaining the decoded code stream based on the position of each feature point in the region and the Gaussian distribution variance parameter σ corresponding to the feature point is different. In the third embodiment of the present application, the skip_mask (skip mask) is determined according to the feature point position and the Gaussian distribution variance parameter σ corresponding to each feature point, and the skip_mask (skip mask) can be modified according to the coordinate position. Finally, the entropy decoding module selects the corresponding symbol for entropy decoding according to the skip_mask. For example, after determining whether to perform entropy decoding on the current feature point, the judgment result is stored in the skip_mask map with a binary value of 0 or 1. Among them, 1 can represent that entropy decoding is required, and 0 can represent that entropy coding is not required. In this way, when decoding, when it is recognized that the skip mask is marked as 1, entropy decoding is performed, and when it is marked as 0, entropy decoding is not skipped.

[0287] It can be understood that the method for obtaining the decoded bit stream based on the position of each feature point in the region and the Gaussian distribution variance parameter σ corresponding to the feature point provided in the third embodiment is introduced below. Figure 6C , the steps may include:

[0288] S601: Determine whether to perform entropy decoding on the feature point based on the position of the feature point in the region and the Gaussian distribution variance parameter σ corresponding to the feature point, and store identification information corresponding to the judgment result in the skip_mask map.

[0289] In some embodiments, whether to perform entropy coding on the feature point is determined based on the position of the feature point in the region and the Gaussian distribution variance parameter σ corresponding to the feature point, and skip_mask is modified, and the identification information corresponding to the result of the determination of whether to perform entropy coding is stored in the skip_mask map. For example, when skip_mask(o,p,q) is 1, the feature residual value of the corresponding region is entropy coded; when skip_mask(o,p,q) is 0, the feature residual value of the corresponding region is set to 0.

[0290] It can be understood that step S601 is the same as step S501 at the encoding end of the third embodiment, and will not be described in detail here.

[0291] S602: For a current feature point in the region, feature values ​​of encoded feature points spatially adjacent to the current feature point are input into a context network and a prediction network to obtain a prediction value of the current feature point.

[0292] In some embodiments, the spatially adjacent encoded feature point reconstruction values ​​at the coordinate (:, i, j) position can be input into the context network, such as Figure 3A The reconstructed value of the non-zero element position shown is input into the context network, and the eigenvalue g(:, i, j) is output. The eigenvalue g(:, i, j) and the feature point f(:, i, j) at the corresponding position on the feature graph F of step S503 are input into the prediction network to obtain the predicted value μ(:, i, j) of the current feature point.

[0293] It can be understood that step S602 is the same as step S502 at the encoding end of the third embodiment, and will not be described in detail here.

[0294] S603: Determine whether to perform entropy decoding on the feature point based on the position of the feature point in the region and the Gaussian distribution variance parameter σ corresponding to the feature point, modify skip_mask, and store identification information corresponding to the determination result of whether to perform entropy decoding into the skip_mask map.

[0295] In some embodiments, the judgment result can be stored in the skip_mask map with a binary value of 0 or 1. Among them, 1 can represent that entropy coding is required, and 0 can represent that entropy coding is not required. For example, when skip_mask(o,p,q) is 1, the characteristic value of the characteristic element (c,i,j) is set to When skip_mask(o,p,q) is 0, the feature residual value of the corresponding area of ​​the feature element is set to 0, and the feature value of the feature element (c,i,j) is set to μ(:,i,j).

[0296] The following describes a method for determining whether to perform entropy decoding on feature points.

[0297] In some embodiments, the method for determining whether to entropy decode the feature point can be: determine whether to entropy decode the PxP based on the position of the sub-block in units of PxP sub-blocks. When at least one point in the PxP feature block is located at the upper boundary of the region, the PxP block is entropy decoded, that is, the skip_mask corresponding to the PxP is 1. The upper boundary of the region refers to the first P rows on the upper side of the region, numThread represents the number of rows in a region, and k represents the index number of the region. When numThread is an integer multiple of P: calculate the maximum value of σ in the PxP block σ max, for the PxP feature block starting from (c, i, j): when numThread*k ≤ i < numThread*k + P or numThread*k ≤ i + P < numThread*k + P, set skip_mask(c, i:i+P, j:k+P) = 1; determine to perform entropy decoding on the feature point. Otherwise, keep skip_mask(c, i:i+P, j:j+P) unchanged.

[0298] In some embodiments, the way to determine whether to perform entropy decoding on the feature point can be: set the corresponding position of the upper boundary of the region in skip_mask to 1, that is, perform entropy decoding on the upper boundary. The upper boundary of the region refers to the first P rows on the upper side of the region, numThread represents the number of rows in a region, and numThread is an integer multiple of P. k represents the index number of the region. Set the value of skip_mask corresponding to the upper boundary position of the region to 1: set skip_mask(c, numThread*k:numThread*k+P, :) = 1; k is an integer. Determine to perform entropy decoding on the feature point.

[0299] In some embodiments, the way to determine whether to perform entropy decoding on the feature point can be: set the corresponding positions of the PxP blocks crossed by the upper boundary line of the region on the skip_mask map to 1, and perform entropy decoding on the PxP blocks containing the upper boundary line of the region. numThread represents the number of rows in a region. k represents the index number of the region. Set the value of skip_mask in the region where the upper boundary is located to 1: calculate the vertical index number of the PxP block related to the upper boundary of the region: Block_index = floor(numThread*k) / P, where k is an integer greater than 0, P is the block size, numThread is the height of the region, and floor represents rounding down. Set the values of the corresponding positions of the PXP block related to the upper boundary of the region in skip_mask to 1: set skip_mask(c, Block_index*P:Block_index*P+P, :) = 1; k is an integer. Determine to perform entropy decoding on the feature point.

[0300] S604: Decode from the bitstream according to the skip_mask map to obtain the reconstructed value corresponding to the feature point.

[0301] In some embodiments, when the value on the skip_mask map corresponding to the coordinates (:, i, j) of the feature point is 1, the feature residual can be entropy decoded from the bitstream The feature point The reconstructed value of is set to

[0302] In some embodiments, when the value of the skip_mask map corresponding to the coordinates (:, i, j) of the feature point is 0, entropy decoding can be skipped and the feature element The reconstructed value of is set to the predicted value μ(:,i,j).

[0303] Based on the above scheme, during encoding, the skip_mask is determined according to the position of the feature point and the Gaussian distribution variance parameter σ corresponding to each feature point, and the skip_mask is modified. After determining whether to perform entropy encoding on the current feature point, the judgment result is stored in the skip_mask map with a binary value of 0 or 1. During encoding, when the skip mask is identified as 1, entropy encoding is performed, and when it is identified as 0, entropy encoding is not skipped. Correspondingly, during decoding, when the skip mask is identified as 1, entropy decoding is performed, and when it is identified as 0, entropy decoding is not skipped. In this way, the low-accuracy prediction value will not be directly used as the reconstruction value as in the aforementioned scheme, which can effectively avoid image quality problems.

[0304] Embodiment 4

[0305] The difference between the encoding method of the fourth embodiment of the present application and the first and second embodiments is that the method of dividing the area is different. In the fourth embodiment of the present application, the area is divided in the vertical direction, and then the samples in the kth column are used for parallel processing with the samples in the k-1th column after being delayed by only T samples based on the context prediction.

[0306] It can be understood that the method for vertically dividing regions provided in the fourth embodiment is introduced below. Fig. 7A , the steps may include:

[0307] S701: Obtain a feature map of an image.

[0308] It can be understood that in the embodiment of the present application, the images to be compressed can be respectively input into the feature extraction module to obtain the feature map y of the image to be compressed. In some embodiments, the feature extraction module can obtain the feature map y by stacking multiple layers of convolution and combining a nonlinear mapping activation function. Specifically, the feature extraction module can be implemented using any implementable neural network model or other method, which is not limited here.

[0309] S702: Input the feature map y of the image into the edge information extraction module to output the edge information z, and quantize it to obtain the quantized edge information

[0310] In some embodiments, the feature graph y can be input to a side information extraction module, and the side information extraction module outputs side information z according to the feature graph y. The side information extraction module can be implemented using the network shown in 4B(1), where Figure 4BThe network shown in (1) may include an abs operator, a Conv operator, and a ReLU operator. The side information z can be understood as a feature map obtained by further extracting the feature map y.

[0311] S703: Based on the quantized side information The probability distribution parameter σ and the feature map F are obtained.

[0312] In some embodiments, the side information z can be input into a probability distribution estimation network, which treats each feature element in the encoded feature map y as Perform probability estimation and obtain characteristic elements The probability distribution of . Assuming the feature point Satisfy the Gaussian distribution of mean μ[x][y][i] and variance σ[x][y][i], where the mean μ[x][y][i] can be used as a feature point For example, this embodiment can use Figure 4B The probability distribution estimation network structure shown in (2) outputs the Gaussian distribution variance parameter σ. Then the quantized side information Input such as Figure 4B The prediction value estimation network shown in (3) can output the feature map F. Figure 4B The network shown in (2) may include a Conv operator and a ReLU operator. Figure 4B The network shown in (3) can include Conv operators and ReLU operators. The feature map F is obtained by quantizing the side information It can be understood that in some embodiments, the probability distribution estimation network and the prediction value estimation network can be integrated into one network, and output the Gaussian distribution variance parameter σ and the feature map F.

[0313] S704: vertically divide the feature map y into multiple regions, and write the region division information into the bitstream.

[0314] In some embodiments, there may be multiple ways to divide the feature graph y, such as horizontal division, vertical division, or any other feasible way. Figure 4C (2) shows a way to divide the area vertically. Figure 4C As shown in (2), the feature map y can be divided vertically into region 0, region 1, and region 2. When context estimation is performed based on the left and upper adjacent pixels, the index number of the first region D can be 0, and the index number of the last region F can be N-1, with a total of N regions, N=3.

[0315] In some embodiments, Figure 3AThe schematic diagram of the region division of the feature map y shown in the figure shows that within a region, the samples in the kth row can be processed in parallel with the samples in the k-1th row after only a delay of T samples. The number of points processed in parallel within a region is recorded as numThreads, and this number corresponds to the number of rows in the region, that is, the height of the region. In some embodiments, when the width of the region is the same as that of the feature map y, the value can be written into the bitstream, and the size of the region can be known. At the same time, the number of regions and the position of the starting point of each region in the feature map y can be obtained based on the ratio of the height of the feature map y to the height of the region. In some embodiments, the number of regions N can be written into the bitstream, and the height of the region and the position of the starting point of each region in the feature map y can be obtained based on the ratio of the height of the feature map y to the number of regions.

[0316] It can be understood that the order of step S704 and the aforementioned steps S702 and S703 can be interchanged at will, and is not limited here.

[0317] S705: Obtain a coded bitstream based on the position of each feature point in the region and the Gaussian distribution variance parameter σ corresponding to the feature point.

[0318] Reference below Figure 7B , the process of step S705 is described in detail.

[0319] S7051: Determine whether to perform entropy coding on the feature point based on the position of the feature point in the region and the Gaussian distribution variance parameter σ corresponding to the feature point, and store the identification information corresponding to the judgment result in the skip_mask map.

[0320] In some embodiments, it is possible to determine whether to perform entropy coding based on the position of the feature point in the region and the Gaussian distribution variance parameter σ corresponding to the feature point, and then store the determination result in the skip_mask map with a 0 / 1 binary value identifier. When skip_mask(o,p,q) is 1, entropy coding is performed on the feature residual value of the corresponding region; when skip_mask(o,p,q) is 0, the feature residual value of the corresponding region is set to 0.

[0321] This step is similar to the encoding end in the second embodiment, and the determination condition "upper boundary" is adaptively changed to "left boundary".

[0322] For example:

[0323] In some embodiments, the method for determining whether to perform entropy coding on feature points may be as follows: Based on the feature point position and the variance within the sub-block for each feature point, determine whether to perform entropy coding. When (c, i, j) is located at the left boundary of the region, or the variance σ(c, i, j) is greater than the threshold, perform entropy coding and set skip_mask to 1; otherwise, do not perform entropy coding and set the corresponding skip_mask to 0. When numThread*k ≤ i < numThread*k + P, where k ≥ 0, P ≥ 1, or σ(c, i, j) > T1, skip_mask(c, i, j) = 1; it is determined to perform entropy coding.

[0324] Otherwise, skip_mask(c, i, j) = 0.

[0325] T1 takes any value that satisfies 0 < T1 < 1, such as 0.2, 0.3, 0.4, etc.

[0326] In some embodiments, the method for determining whether to perform entropy coding on feature points may be as follows: Except for the first region, perform entropy coding on the residuals r^(:, i, j) of the feature points at the left boundary of other regions.

[0327] When numThread*k ≤ i < numThread*k + P, where k > 0, P ≥ 1, or σ(c, i, j) > T1, set skip_mask(c, i, j) = 1; it is determined to perform entropy coding. Otherwise, set skip_mask(c, i, j) = 0. In some embodiments, T1 takes any value that satisfies 0 < T1 < 1, such as 0.2, 0.3, 0.4, etc.

[0328] S7052: For the current feature point within the region, input the feature values of the already encoded feature points that are spatially adjacent to the current feature point into the context network and the prediction network to obtain the predicted value of the current feature point.

[0329] In some embodiments, input the reconstructed values of the already encoded feature points that are spatially adjacent to the position of the coordinate (:, i, j) into the context network, such as Figure 3A the reconstructed values at the Non-zero kernel elements position as shown, input them into the context network, and output the feature value g(:, i, j). Input the feature value g(:, i, j) and the feature point f(:, i, j) at the corresponding position on the feature map F described in step S303 into the prediction network to obtain the predicted value estimate of the current feature point μ(:, i, j).

[0330] S7053: Calculate the residual value between the feature value and the predicted value of the current feature point, and obtain the quantization value corresponding to the residual value.

[0331] In some embodiments, by calculating the residual value r(:, i, j) of the feature point y(:, i, j) and the predicted value μ(:, i, j), and obtaining the quantization value corresponding to the residual value

[0332] S7054: Based on the information on the skip_mask map, encode the feature points to obtain an encoded bitstream.

[0333] In some embodiments, when the value on the skip_mask map corresponding to the coordinates(:, i, j) of the feature point is 1, perform entropy coding on the feature residual and set the feature value of the feature point to and write it into the encoded bitstream.

[0334] In some embodiments, when the value on the skip_mask map corresponding to the coordinates(:, i, j) of the feature point is 0, skip the entropy coding, set the feature value of the feature element to the predicted value μ(:, i, j), and write it into the encoded bitstream.

[0335] It can be understood that the operation steps at the decoding end can refer to Embodiment 1 or 2 and will not be elaborated here.

[0336] Embodiment 5

[0337] In some embodiments, when the region can also be divided in both the vertical and horizontal directions simultaneously, Fig. 8A as shown. Other steps are the same as those in Embodiments 1, 2, and 3, and are adaptively modified based on the judgment conditions of the coordinate positions. The predicted value is calculated starting from the top-left vertex within the region, and the "upper boundary" in the judgment condition is changed to "upper boundary or left boundary", and the first region in the upper left corner is Region 0. The bitrate transmits information related to the width and height of the region, such as directly encoding and transmitting the width and height of the region w_region, h_region; optionally, transmit the number of times of region division in the horizontal and vertical directions h_num, w_num.

[0338] The determination condition for the coordinate point (c, i, j) to be located at the "upper boundary or left boundary" is h_region * k ≤ i < h_region * k + P or w_region * n ≤ j < w_region * n + P, where k represents the index number of the region in the vertical direction and n represents the index number of the region in the horizontal direction.

[0339] The difference between the encoding method in the fifth embodiment of this application and the third embodiment lies in that the judgment conditions for determining the encoded bitstream are different based on the positions of the feature points in the region and the Gaussian distribution variance parameter σ corresponding to the feature points. In the fifth embodiment of this application, the predicted value is calculated starting from the upper left vertex in the region, and the "upper boundary" in the judgment condition is changed to the "upper boundary or left boundary", and the first region in the upper left corner is region 0. Information related to the width and height of the region is transmitted in the bit rate, for example, directly encoding and transmitting the width and height of the region, w_region, h_region; optionally, transmitting the number of times of region division in the horizontal and vertical directions, h_num, w_num. In some embodiments, the determination condition for the coordinate point (c, i, j) to be located at the "upper boundary or left boundary" is h_region * k ≤ i < h_region * k + P or w_region * n ≤ j < w_region * n + P, where k represents the index number of the region in the vertical direction, and n represents the index number of the region in the horizontal direction.

[0340] It can be understood that the following introduces the judgment conditions for determining the encoded bitstream based on the positions of the feature points in the region and the Gaussian distribution variance parameter σ corresponding to the feature points provided in the fifth embodiment, as Figure 8B , the steps may include:

[0341] S801: Based on the position of the feature point in the region and the Gaussian distribution variance parameter σ corresponding to the feature point, determine the judgment result of whether to perform entropy coding on the feature point, and store the identification information corresponding to the judgment result into the skip_mask graph.

[0342] In some embodiments, it may be determined whether to perform entropy coding based on the Gaussian distribution variance parameter σ corresponding to the feature point. The judgment result is identified by a 0 / 1 binary value and stored in the skip_mask graph. When skip_mask(o, p, q) is 1, entropy coding is performed on the feature residual value of the corresponding region; when skip_mask(o, p, q) is 0, the feature residual value of the corresponding region is set to 0.

[0343] S802: For the current feature point in the region, input the feature values of the already encoded feature points that are spatially adjacent to the current feature point into the context network and the prediction network to obtain the predicted value of the current feature point.

[0344] In some embodiments, the reconstructed values of the already encoded feature points that are spatially adjacent to the position of the coordinate (:, i, j) may be input into the context network, such as Figure 3A the reconstructed values at the Non-zero kernel elements position shown, are input into the context network, and the feature value g(:, i, j) is output. The feature value g(:, i, j) and the feature point f(:, i, k) at the corresponding position on the feature map F in step S503 are input into the prediction network to obtain the predicted value to estimate the predicted value μ(:, i, j) of the current feature point.

[0345] S803: Calculate the residual value between the eigenvalue of the current feature point and the predicted value, and obtain the quantization value corresponding to the residual value.

[0346] In some embodiments, the residual value r(:, i, j) between the feature point y(:, i, j) and the predicted value μ(:, i, j) can be calculated, and after quantization, the quantization value corresponding to the residual value can be obtained.

[0347] It can be understood that step S901 can be located in the middle or after S902 and S903, without limitation.

[0348] S804: Determine whether to perform entropy coding on the feature point based on the position of the feature point in the region and the Gaussian distribution variance parameter σ corresponding to the feature point, modify the skip_mask, and store the identification information corresponding to the determination result of whether to perform entropy coding into the skip_mask map.

[0349] The method for determining whether to perform entropy coding on the feature point is introduced below.

[0350] This step is similar to the encoding end of Embodiment 3, and the adaptability changes the determination condition "upper boundary" to "upper boundary or left boundary". For example:

[0351] In some embodiments, the method for determining whether to perform entropy decoding on the feature point can be: based on the PxP sub-block, determine whether to perform entropy coding on PxP based on the sub-block position. When at least one point in the PxP feature block is located on the upper boundary or the left boundary of the region, the PxP block performs entropy coding, that is, the skip_mask corresponding to PxP is all 1. The upper boundary of the region refers to the first P rows on the upper side of the region, h_region represents the number of rows in a region, w_region represents the number of columns in a region, and k represents the index number of the region. Calculate the maximum value σ of σ within the PxP block. max , for the PxP feature block starting from (c, i, j): when h_region * k ≤ i < h_region * k + P, or h_region * k ≤ i + P < h_region * k + P, or w_region * n ≤ j < w_region * n + P, or w_region * n ≤ j + P < w_region * n + P, set skip_mask(c, i:i+P, j:j+P) = 1; otherwise, set skip_mask(c, i:i+P, j:j+P) to remain unchanged.

[0352] In some embodiments, the method for determining whether to perform entropy decoding on the feature point can be: the upper boundary of the region or the left boundary of the region is set to 1 at the corresponding position of skip_mask, and the upper boundary and the left boundary are entropy encoded. The upper boundary of the region refers to the first P rows on the upper side of the region, and the upper boundary of the region refers to the first P columns on the left side of the region. h_region represents the number of rows in a region, w_region represents the number of columns in a region, and h_region and w_region are integer multiples of P. k and n represent the index number of the region. Set the skip_mask value corresponding to the upper boundary and left boundary position of the region to 1: set skip_mask(c,h_region*k:h_region*k+P,:)=1; k is an integer. Set skip_mask(c,:,w 区域 *n:w 区域 *n+P)=1; n is an integer.

[0353] S805: Encode the feature points based on the information on the skip_mask image to obtain a coded bitstream.

[0354] In some embodiments, when the value of the skip_mask map corresponding to the coordinates (:, i, j) of the feature point is 1, the feature residual Entropy coding, feature points The eigenvalues ​​of And write the encoded code stream.

[0355] In some embodiments, when the value of the skip_mask map corresponding to the coordinates (:, i, j) of the feature point is 0, entropy coding is skipped and the feature element The eigenvalues ​​of are set to μ(:,i,j) and written into the encoded bitstream.

[0356] The following is an introduction to the judgment condition for determining the decoding code stream based on the position of each feature point in the region and the Gaussian distribution variance parameter σ corresponding to the feature point provided in the fifth embodiment. Figure 8C , the steps may include:

[0357] S901: Determine a judgment result of whether to perform entropy decoding on a feature point based on the position of the feature point in the region and the Gaussian distribution variance parameter σ corresponding to the feature point, and store identification information corresponding to the judgment result into a skip_mask map.

[0358] In some embodiments, it is determined whether to perform entropy coding on a feature point based on the position of the feature point in the region and the Gaussian distribution variance parameter σ corresponding to the feature point, the skip_mask is modified, and the identification information corresponding to the determination result of whether to perform entropy coding is stored in the skip_mask map. For example, when skip_mask(o,p,q) is 1, entropy coding is performed on the feature residual value of the corresponding region; when skip_mask(o,p,q) is 0, the feature residual value of the corresponding region is set to 0.

[0359] It can be understood that step S901 is the same as step S801 of the encoding end in Embodiment 5 of the present invention, and will not be elaborated here.

[0360] S902: For the current feature point in the region, the feature values of the encoded feature points adjacent to the current feature point in space are input into the context network and the prediction network to obtain the predicted value of the current feature point.

[0361] It can be understood that step S902 is the same as step S802 of the encoding end in the fifth embodiment of the present invention, and will not be elaborated here.

[0362] S903: Based on the position of the feature point in the region and the Gaussian distribution variance parameter σ corresponding to the feature point, it is determined whether to perform entropy decoding on the feature point, the skip_mask is modified, and the identification information corresponding to the determination result of whether to perform entropy decoding is stored in the skip_mask map.

[0363] The method for determining whether to perform entropy decoding on the feature point will be introduced below.

[0364] In some embodiments, the method for determining whether to perform entropy decoding on a feature point may be: judging whether to perform entropy decoding on PxP based on the sub-block position in units of PxP sub-blocks. When at least one point in the PxP feature block is located on the upper boundary or the left boundary of the region, the PxP block performs entropy decoding, that is, the skip_mask corresponding to PxP is all 1. The upper boundary of the region refers to the first P rows on the upper side of the region, numThread represents the number of rows in a region, and k represents the index number of the region. Calculate the maximum value σ of σ in the PxP block max , for the PxP feature block starting from (c,i,j): when h_region*k ≤ i < h_region*k + P, or h_region*k ≤ i + P < h_region*k + P, or w_region*n ≤ j < w_region*n + P, or w_region*n ≤ j + P < w_region*n + P, set skip_mask(c,i:i+P,j:j+P) = 1; otherwise, set skip_mask(c,i:i+P,k:k+P) to remain unchanged.

[0365] In some embodiments, the method for determining whether to perform entropy decoding on the feature point can be: the upper boundary of the region or the left boundary of the region is set to 1 at the corresponding position of skip_mask, and the upper boundary and the left boundary are entropy decoded. The upper boundary of the region refers to the first P rows on the upper side of the region, and the upper boundary of the region refers to the first P columns on the left side of the region. h_region represents the number of rows in a region, w_region represents the number of columns in a region, and h_region and w_region are integer multiples of P. k and n represent the index number of the region. Set the skip_mask value corresponding to the upper boundary and left boundary position of the region to 1: set skip_mask(c,h_region*k:h_region*k+P,:)=1; k is an integer. Set skip_mask(c,:,w 区域 *n:w 区域 *n+P)=1; n is an integer.

[0366] S904: Decode the bitstream according to the skip_mask map to obtain the reconstruction value corresponding to the feature point.

[0367] In some embodiments, when the value of the skip_mask map corresponding to the coordinates (:, i, j) of the feature point is 1, the feature residual is obtained by entropy decoding from the bitstream. Feature Points The reconstruction value is set to

[0368] In some embodiments, when the value of the skip_mask map corresponding to the coordinates (:, i, j) of the feature point is 0, entropy decoding is skipped and the feature element The reconstruction value of is set to μ(:,i,j).

[0369] Based on the above scheme, during encoding, the skip_mask is determined according to the position of the feature point and the Gaussian distribution variance parameter σ corresponding to each feature point, and the skip_mask is modified. After determining whether to perform entropy encoding on the current feature point, the judgment result is stored in the skip_mask map with a binary value of 0 or 1. During encoding, when the skip mask is identified as 1, entropy encoding is performed, and when it is identified as 0, entropy encoding is not skipped. Correspondingly, during decoding, when the skip mask is identified as 1, entropy decoding is performed, and when it is identified as 0, entropy decoding is not skipped. In this way, the low-accuracy prediction value will not be directly used as the reconstruction value as in the aforementioned scheme, which can effectively avoid image quality problems.

[0370] based on Figures 1 to 9 In the embodiment shown, the present application provides a coding or decoding method, which is based on the entropy coding and decoding skipping decision algorithm of the location information of the feature points and the probability distribution parameters:

[0371] In some embodiments, when a feature point is located at a specific position of the region, entropy coding and decoding is performed on the feature point; otherwise, entropy coding and decoding based on probability distribution skips determining whether to perform entropy coding and decoding on the feature point.

[0372] In some embodiments, when the feature point is located at a specific position of the region or the probability distribution parameter meets certain conditions, entropy coding and decoding are performed on the feature point; otherwise, entropy coding and decoding of the feature point is skipped.

[0373] It can be understood that the specific position may include: upper border, lower border, left border, right border, upper / lower / left / right border.

[0374] It can be understood that the specific position may also include: the upper boundary of the area refers to the first row on the upper side, the lower boundary of the area refers to the last row on the lower side, the left boundary of the area refers to the first column on the left side of the area, and the right boundary of the area refers to the last column on the right side of the area.

[0375] Exemplarily, the upper boundary of the region refers to the first P rows on the upper side of the region; the lower boundary of the region refers to the last P rows on the lower side of the region; the left boundary of the region refers to the first P columns on the left side of the region; and the right boundary of the region refers to the last P columns on the right side of the region.

[0376] By not executing the encoding skip algorithm or the decoding skip algorithm based on the probability distribution parameters at the region boundary, the generation of line-shaped artifacts is avoided.

[0377] An embodiment of the present application provides a coding method, which includes: obtaining image data to be encoded, where the image data to be encoded is image data in a first image area; determining a coding method for the image data to be encoded based on a position of the image data to be encoded in the first image area; and encoding the image data to be encoded based on the determined coding method.

[0378] An embodiment of the present application provides a decoding method, which includes: obtaining image data to be decoded, where the image data to be decoded is image data in a first image area; determining a decoding method for the image data to be decoded based on a position of the image data to be decoded in a second image area; and decoding the image data to be decoded based on the determined decoding method.

[0379] It can be understood that in some embodiments of the present application, when encoding or decoding, the feature point can also be replaced by a feature block composed of multiple feature points for encoding and decoding, which is not limited here.

[0380] Through the encoding method and decoding method provided by the embodiments of the present application, when encoding or decoding, when the feature point is located in the boundary area within each divided area, the encoding skip judgment algorithm or the decoding skip algorithm is not executed. Instead, arithmetic coding is performed based on the residual value and the predicted value corresponding to the feature point during encoding, and the reconstructed value corresponding to the decoded feature point is directly obtained based on the residual value and the predicted value corresponding to the feature point during decoding, thereby effectively avoiding image quality problems such as artifacts in the image to be encoded or decoded.

[0381] Fig. 9 According to some embodiments of the present application, a schematic diagram of the structure of an electronic device 100 mentioned in the embodiments of the present application is shown. Fig. 9 As shown, the electronic device may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, a subscriber identification module (SIM) card interface 195, an event camera, and the like. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0382] It is to be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0383] The processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a memory, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and / or a neural-network processing unit (neural-network processing unit, NPU), etc. Among them, different processing units can be independent devices or integrated in one or more processors. Among them, the controller can be the nerve center and command center of the electronic device. The controller can generate an operation control signal according to the instruction opcode and the timing signal to complete the control of fetching and executing instructions.

[0384] The charging management module 140 is used to receive charging input from the charger. The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The wireless communication function of the electronic device can be implemented by antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modulation and demodulation processor and baseband processor. The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied in electronic devices. The wireless communication module 160 can provide solutions for wireless communications including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication technology (NFC), infrared technology (IR), etc. applied in electronic devices.

[0385] The electronic device implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0386] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0387] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos can be stored in the external memory card.

[0388] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0389] The electronic device can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0390] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.

[0391] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The electronic device can listen to music or listen to a hands-free call through the speaker 170A.

[0392] The receiver 170B, also called a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device receives a call or voice message, the voice can be received by placing the receiver 170B close to the human ear.

[0393] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to the microphone 170C to input the sound signal into the microphone 170C. The electronic device can be provided with at least one microphone 170C. In other embodiments, the electronic device can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device can also be provided with three, four or more microphones 170C to realize the collection of sound signals, noise reduction, identification of sound sources, and directional recording function, etc.

[0394] The earphone interface 170D is used to connect a wired earphone and can be a USB interface 130 or a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0395] The various embodiments of the mechanism disclosed in the present application can be implemented in hardware, software, firmware or a combination of these implementation methods. The embodiments of the present application can be implemented as a computer program or program code executed on a programmable system, which includes at least one processor, a storage system (including volatile and non-volatile memory and / or storage elements), at least one input device and at least one output device.

[0396] Program code can be applied to input instructions to perform the functions described in this application and generate output information. The output information can be applied to one or more output devices in a known manner. For the purposes of this application, a processing system includes any system having a processor such as, for example, a digital signal processor (DSP), a microcontroller, an application specific integrated circuit, or a microprocessor.

[0397] Program code can be implemented with high-level programming language or object-oriented programming language to communicate with the processing system. When necessary, program code can also be implemented with assembly language or machine language. In fact, the mechanism described in this application is not limited to the scope of any specific programming language. In either case, the language can be a compiled language or an interpreted language.

[0398] In some cases, the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments may also be implemented as instructions carried or stored on one or more temporary or non-temporary machine-readable (e.g., computer-readable) storage media, which may be read and executed by one or more processors. For example, instructions may be distributed over a network or through other computer-readable media. Therefore, machine-readable media may include any mechanism for storing or transmitting information in a machine (e.g., computer) readable form, including, but not limited to, floppy disks, optical disks, optical disks, read-only memories (CD-ROMs), magneto-optical disks, read-only memories (ROMs), random access memories (RAMs), erasable programmable read-only memories (EPROMs), electrically erasable programmable read-only memories (EEPROMs), magnetic or optical cards, flash memory, or a tangible machine-readable memory for transmitting information (e.g., carrier waves, infrared signals, digital signals, etc.) using the Internet in electrical, optical, acoustic, or other forms of propagation signals. Therefore, machine-readable media include any type of machine-readable media suitable for storing or transmitting electronic instructions or information in a machine (e.g., computer) readable form.

[0399] In the accompanying drawings, some structural or method features may be shown in a specific arrangement and / or order. However, it should be understood that such a specific arrangement and / or order may not be required. Instead, in some embodiments, these features may be arranged in a manner and / or order different from that shown in the illustrative drawings. In addition, the inclusion of structural or method features in a particular figure does not mean that such features are required in all embodiments, and in some embodiments, these features may not be included or may be combined with other features.

[0400] It should be noted that the units / modules mentioned in the various device embodiments of the present application are all logical units / modules. Physically, a logical unit / module can be a physical unit / module, or a part of a physical unit / module, or can be implemented as a combination of multiple physical units / modules. The physical implementation method of these logical units / modules themselves is not the most important. The combination of functions implemented by these logical units / modules is the key to solving the technical problems proposed by the present application. In addition, in order to highlight the innovative part of the present application, the above-mentioned device embodiments of the present application do not introduce units / modules that are not closely related to solving the technical problems proposed by the present application, which does not mean that there are no other units / modules in the above-mentioned device embodiments.

[0401] It should be noted that in the examples and description of this patent, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "includes" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "includes one" do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0402] Although the present application has been illustrated and described with reference to certain preferred embodiments thereof, it will be apparent to those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the present application.

Claims

1. A decoding method, characterized in that: For an electronic device, the method comprises: Acquire image data to be decoded, where the image data to be decoded is data in a first region in a feature map of a first image; Determining whether the image data to be decoded meets a first preset condition or a second preset condition; When the image data to be decoded meets the first preset condition or the second preset condition, obtaining first decoded data corresponding to the image data to be decoded; Acquire image reconstruction data corresponding to the image data to be decoded based on the first decoded data; Among them, the first preset condition includes that the image data to be decoded is located in a preset boundary area within the first area, the second preset condition includes that the Gaussian distribution variance parameter corresponding to the image data to be decoded is greater than a first threshold, and the first decoded data includes residual data corresponding to the image data to be decoded.

2. The decoding method according to claim 1, characterized in that: The step of determining whether the image data to be decoded satisfies a first preset condition or a second preset condition, and obtaining first decoded data corresponding to the image data to be decoded when the image data to be decoded satisfies the first preset condition or the second preset condition; comprises: Determining whether the image data to be decoded meets the first preset condition; When the image data to be decoded meets the first preset condition, acquiring the first decoded data corresponding to the image data to be decoded; When the image data to be decoded does not meet the first preset condition, determining whether the image data to be decoded meets the second preset condition; When the image data to be decoded meets the second preset condition, the first decoded data corresponding to the image data to be decoded is obtained.

3. The decoding method according to claim 1, characterized in that: The step of determining whether the image data to be decoded satisfies a first preset condition or a second preset condition, and obtaining first decoded data corresponding to the image data to be decoded when the image data to be decoded satisfies the first preset condition or the second preset condition; comprises: Determining whether the image data to be decoded meets the second preset condition; When the image data to be decoded meets the second preset condition, acquiring the first decoded data corresponding to the image data to be decoded; When the image data to be decoded does not satisfy the second preset condition, determining whether the image data to be decoded satisfies the first preset condition; When the image data to be decoded meets the first preset condition, the first decoded data corresponding to the image data to be decoded is obtained.

4. The decoding method according to any one of claims 1 to 3, characterized in that: The step of obtaining image reconstruction data corresponding to the image data to be decoded based on the first decoded data comprises: The sum of the residual data and the prediction data corresponding to the image data to be decoded is used as the image reconstruction data corresponding to the image data to be decoded.

5. The decoding method according to any one of claims 1 to 4, characterized in that: When the image data to be decoded does not satisfy the first preset condition and does not satisfy the second preset condition, obtaining second decoded data corresponding to the image data to be decoded; The image reconstruction data corresponding to the image data to be decoded is obtained based on the second decoded data.

6. The decoding method according to claim 5, characterized in that: The second decoded data includes prediction data corresponding to the image data to be decoded; The step of obtaining the image reconstruction data corresponding to the image data to be decoded based on the second decoded data comprises: The prediction data corresponding to the image data to be decoded is used as the image reconstruction data corresponding to the image data to be decoded.

7. The decoding method according to any one of claims 1 to 6, characterized in that: The first region is any one of a plurality of divided regions in a feature map of the first image, and the plurality of divided regions are decoded in parallel.

8. The decoding method according to claim 7, characterized in that: The preset boundary area includes an area that is a preset number of lines away from a boundary line of the first area, and the boundary line includes at least one of a plurality of boundary lines that enclose the first area.

9. The decoding method according to any one of claims 1 to 8, characterized in that: The image data to be decoded is the target feature points of the first area.

10. The decoding method according to any one of claims 1 to 8, characterized in that: The image data to be decoded is a feature block composed of a plurality of feature points in the first area; When the image data to be decoded meets the first preset condition, obtaining the first decoded data corresponding to the image data to be decoded; comprising: When at least one feature point in the feature block is located in a preset boundary area within the first area, each feature point in the feature block is decoded to obtain the first decoded data corresponding to the image data to be decoded.

11. The decoding method according to any one of claims 1 to 8, characterized in that: The image data to be decoded is a feature block composed of a plurality of feature points in the first area; When the image data to be decoded meets the first preset condition, obtaining the first decoded data corresponding to the image data to be decoded; comprising: When the first feature point in the feature block is located in a preset boundary area within the first area, the first feature point in the feature block is decoded to obtain the first decoded data corresponding to the image data to be decoded.

12. The decoding method according to any one of claims 1 to 8, characterized in that: The image data to be decoded is a feature block composed of a plurality of feature points in the first area; When the image data to be decoded meets the second preset condition, acquiring the first decoded data corresponding to the image data to be decoded; comprising: When the maximum Gaussian distribution parameter corresponding to each feature point in the feature block is greater than the first threshold, each feature point in the feature block is decoded to obtain the first decoded data corresponding to the image data to be decoded.

13. The decoding method according to any one of claims 1 to 8, characterized in that: The image data to be decoded is a feature block composed of a plurality of feature points in the first area; When the image data to be decoded meets the second preset condition, acquiring the first decoded data corresponding to the image data to be decoded; comprising: When the average value of the Gaussian distribution parameters corresponding to each feature point in the feature block is greater than the first threshold, each feature point in the feature block is decoded to obtain the first decoded data corresponding to the image data to be decoded.

14. The decoding method according to any one of claims 1 to 4, characterized in that: The step of obtaining first decoded data corresponding to the image data to be decoded when the image data to be decoded satisfies the first preset condition or the second preset condition comprises: When the image data to be decoded meets the first preset condition or the second preset condition, setting the identifier corresponding to the image data to be decoded to the first identifier; When it is determined that the identifier corresponding to the image data to be decoded is the first identifier, the first decoded data corresponding to the image data to be decoded is acquired.

15. The decoding method according to claim 14, characterized in that: When the image data to be decoded does not satisfy the first preset condition and does not satisfy the second preset condition, obtaining second decoded data corresponding to the image data to be decoded; comprising: When the image data to be decoded does not satisfy the first preset condition and does not satisfy the second preset condition, setting the identifier corresponding to the image data to be decoded to the second identifier; When it is determined that the identifier corresponding to the image data to be decoded is the second identifier, the second decoded data corresponding to the image data to be decoded is acquired.

16. The decoding method according to any one of claims 1 to 4, characterized in that: The step of obtaining first decoded data corresponding to the image data to be decoded when the image data to be decoded satisfies the first preset condition or the second preset condition comprises: Determining whether the image data to be decoded meets the second preset condition; When the image data to be decoded does not meet the second preset condition, setting the identifier corresponding to the image data to be decoded to the second identifier; Determining whether the image data to be decoded meets the first preset condition; When the image data to be decoded meets the first preset condition, changing the second identifier to the first identifier; When it is determined that the identifier corresponding to the image data to be decoded is the first identifier, the first decoded data corresponding to the image data to be decoded is acquired.

17. A coding method, characterized in that: For an electronic device, the method comprises: Acquire image data to be encoded, where the image data to be encoded is data in a first region in a feature map of a first image; Determine whether the image data to be encoded meets a first preset condition or a second preset condition, and when the image data to be encoded meets the first preset condition or the second preset condition, obtain residual data corresponding to the image data to be encoded; Encoding the residual data into a bitstream; The first preset condition includes that the image data to be encoded is located in a preset boundary area within the first area, and the second preset condition includes that a Gaussian distribution variance parameter corresponding to the image data to be encoded is greater than a first threshold.

18. The encoding method according to claim 17, characterized in that: The step of determining whether the image data to be encoded satisfies a first preset condition or a second preset condition, and obtaining residual data corresponding to the image data to be encoded when the image data to be encoded satisfies the first preset condition or the second preset condition; comprises: Determining whether the image data to be encoded meets the first preset condition; When the image data to be encoded meets the first preset condition, obtaining the residual data corresponding to the image data to be encoded; When the image data to be encoded does not meet the first preset condition, determining whether the image data to be encoded meets the second preset condition; When the image data to be encoded meets the second preset condition, the residual data corresponding to the image data to be encoded is obtained.

19. The encoding method according to claim 17, characterized in that: The step of determining whether the image data to be encoded satisfies a first preset condition or a second preset condition, and obtaining residual data corresponding to the image data to be encoded when the image data to be encoded satisfies the first preset condition or the second preset condition; comprises: Determining whether the image data to be encoded meets the second preset condition; When the image data to be encoded meets the second preset condition, obtaining the residual data corresponding to the image data to be encoded; When the image data to be encoded does not meet the second preset condition, determining whether the image data to be encoded meets the first preset condition; When the image data to be encoded meets the first preset condition, the residual data corresponding to the image data to be encoded is obtained.

20. The encoding method according to any one of claims 17 to 19, characterized in that: When the image data to be encoded does not satisfy the first preset condition and does not satisfy the second preset condition, prediction data corresponding to the image data to be encoded is obtained.

21. The encoding method according to any one of claims 17 to 20, characterized in that: The first region is any one of a plurality of divided regions in a feature map of the first image, and the plurality of divided regions are encoded in parallel.

22. The encoding method according to claim 21, characterized in that The preset boundary area includes an area that is a preset number of lines away from a boundary line of the first area, and the boundary line includes at least one of a plurality of boundary lines that enclose the first area.

23. A decoding device, characterized in that: include: An acquisition unit, configured to acquire image data to be decoded, wherein the image data to be decoded is data in a first region in a feature map of a first image; a decoding unit, configured to determine whether the image data to be decoded satisfies a first preset condition or a second preset condition, and when the image data to be decoded satisfies the first preset condition or the second preset condition, obtain first decoded data corresponding to the image data to be decoded; a reconstruction unit, configured to obtain image reconstruction data corresponding to the image data to be decoded based on the first decoded data; Among them, the first preset condition includes that the image data to be decoded is located in a preset boundary area within the first area, the second preset condition includes that the Gaussian distribution variance parameter corresponding to the image data to be decoded is greater than a first threshold, and the first decoded data includes residual data corresponding to the image data to be decoded.

24. A coding device, characterized in that: include: An acquisition unit, configured to acquire image data to be encoded, wherein the image data to be encoded is data in a first region in a feature map of a first image; an encoding unit, configured to determine whether the image data to be encoded satisfies a first preset condition or a second preset condition, and when the image data to be encoded satisfies the first preset condition or the second preset condition, obtain residual data corresponding to the image data to be encoded, and encode the residual data into a bitstream; The first preset condition includes that the image data to be encoded is located in a preset boundary area within the first area, and the second preset condition includes that a Gaussian distribution variance parameter corresponding to the image data to be encoded is greater than a first threshold.

25. An electronic device, characterized in that: It includes the decoding device described in claim 23 and / or the encoding device described in claim 24.

26. An electronic device, characterized in that: including a memory for storing instructions; A processor, configured to execute the instructions so that the electronic device implements the decoding method described in any one of claims 1-16 and / or the encoding method described in any one of claims 17-22.

27. A decoding device, the decoding device being an encoding device or a decoding device, the decoding device comprising: One or more processors and a memory, wherein the memory is used to store program instructions, and when the program instructions are executed by the one or more processors, the decoding method described in any one of claims 1-16 and / or the encoding method described in any one of claims 17-22 are implemented.

28. A readable storage medium, characterized in that: The readable medium stores instructions, which, when executed on an electronic device, enable the electronic device to execute the decoding method described in any one of claims 1-16 and / or the encoding method described in any one of claims 17-22.

29. A computer program product, characterized in that The method comprises instructions which, when executed on an electronic device, enable the electronic device to execute the decoding method described in any one of claims 1 to 16 and / or the encoding method described in any one of claims 17 to 22.

30. A readable storage medium, characterized in that: The readable medium stores a code stream encoded according to any one of the encoding methods of claims 17-22.

31. A device for storing a code stream, characterized in that: comprising at least one storage medium and a communication interface; The communication interface is used to receive or send code streams; The at least one storage medium is used to store the code stream; The code stream is obtained by encoding by an encoder according to any encoding method in claims 17-22.

32. A method for storing a code stream, characterized in that: include: Receiving a code stream via a communication interface; The code stream is stored in one or more storage media, and the code stream is an encoder Obtained by encoding according to any one of the encoding methods of claims 17-22.

33. A system for distributing code streams, characterized in that: including at least one storage medium and a video streaming device; The at least one storage medium is used to store a code stream, and the code stream is an encoder Obtained by encoding according to any one of the encoding methods of claims 17-22; The video stream device is used to respond to a request of a decoder so that the target code stream in the at least one storage medium can be sent to the decoder.

34. A method for distributing code streams, characterized in that: include: receiving a first request; In response to the first request, selecting a target bitstream from at least one storage medium; Sending the target code stream to a destination device; The at least one storage medium is used to store a code stream, and the code stream is an encoder Obtained by encoding according to any one of the encoding methods of claims 17-22.

35. A system for processing a code stream, characterized in that: It includes an image source device, an encoder device, one or more storage media and a destination device; The image source device is used to provide image data; The encoder device is used to obtain the image data of the image source device through an interface, and encode the image data to obtain one or more code streams, wherein the code streams are encoded by the encoder according to any one of the encoding methods of claims 17-22; The encoder device is used to store the one or more code streams in one or more storage media; or The encoder device is used to encapsulate the one or more code streams to obtain a transmission code stream; The encoder device is used to transmit the transmission code stream to the destination device through a communication link or a communication network; The destination device is used to decapsulate the transport code stream to obtain the one or more code streams; The destination device is used to decode the one or more code streams to obtain decoded data.