Coding method, decoding method, and apparatus
By configuring the confidence for the predicted value of the image frame, and combining the confidence of the predicted value and the residual for reconstruction, the coding error problem caused by inaccurate predicted values in the existing technology is solved, and the image compression performance is improved.
Patent Information
- Application Number
- PCT/CN2024/084993
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-04-28
- Filing Date
- 2024-03-29
- Publication Date
- 2024-10-31
AI Technical Summary
In existing image compression technology, when moving irregular image areas or occluded areas, inaccurate prediction values lead to large coding errors and reduce compression performance.
During the encoding and decoding process, the confidence is configured for the prediction value of the current frame, and the confidence of the prediction value and the residual is combined to determine the reconstructed frame, thereby reducing coding errors due to low prediction accuracy.
It effectively improves the image compression performance, especially in the case of irregular motion or occluded areas, reducing coding errors and improving the accuracy of image reconstruction.
Smart Images

Figure CN2024084993_31102024_PF_FP_ABST
Abstract
Description
A coding and decoding method and device
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on April 28, 2023, with application number 202310485606.8 and application name “A Coding and Decoding Method and Device”, the entire contents of which are incorporated by reference into this application. Technical Field
[0003] The present application relates to the field of image processing technology, and in particular to a coding and decoding method and device. Background Art
[0004] Image compression refers to a technology that uses image data characteristics such as spatial redundancy, visual redundancy, and statistical redundancy to represent the original image pixel matrix with fewer bits, either losslessly or losslessly, to achieve effective transmission and storage of image information. It plays an important role in the current media era where the types and amounts of image transmission information are increasing.
[0005] Because artificial intelligence (AI) outperforms traditional image algorithms in many fields, such as image recognition and object detection, deep learning has also been applied to image compression. Furthermore, AI image compression algorithms outperform traditional image compression algorithms (such as advanced video coding (AVC) and high-efficiency video coding (HEVC)) in terms of two image compression evaluation metrics: multi-scale structural similarity index (MS-SSIM) and peak signal-to-noise ratio (PSNR).
[0006] A common coding technique in AI image compression algorithms is residual coding. Currently, residual coding is primarily used to encode prediction errors during video encoding. During video encoding, the encoder typically uses motion estimation and motion compensation techniques to predict the current frame and obtain a predicted value for the current frame. The encoder then uses residual coding to encode the difference between the predicted value and the actual value of the current frame (i.e., the prediction error) to obtain a bitstream. This eliminates the need for the encoder to encode the current frame, effectively reducing data redundancy in the bitstream and thus lowering transmission costs.
[0007] However, for image areas with irregular motion or blocked image areas in the current frame, the predicted value of the current frame may be inaccurate or cannot be obtained, resulting in a large coding error and low compression performance.
[0008] Summary of the Invention
[0009] The embodiments of the present application provide a coding and decoding method and apparatus for reducing coding errors caused by low accuracy of predicted content during the coding process, thereby effectively improving compression performance.
[0010] In a first aspect, an embodiment of the present application provides a decoding method, which can be applied to a decoding end or a decoding device, the method comprising: obtaining a code stream comprising encoded data of multiple image frames; decoding the code stream to obtain motion information of a current frame; the current frame is any one of the multiple image frames; obtaining a prediction value of the current frame based on the motion information; decoding the code stream to obtain first feature information; obtaining a residual of the current frame and a confidence level of the prediction value based on the first feature information; obtaining a reconstructed frame of the current frame based on the prediction value, the residual of the current frame, and the confidence level of the prediction value.
[0011] It should be understood that the motion information of the current frame is the motion information between the current frame and the reference frame, and the reference frame is a reconstructed frame of any image frame that precedes the current frame in the decoding order. The reference frame of the current frame is used to obtain the predicted value of the current frame based on the motion information. In other words, at the decoding end, the motion information of the current frame is decoded from the bitstream, and the reconstructed frame of the previously decoded image frame is used as the reference frame of the current frame. The prediction information of the current frame is obtained based on the reference frame of the current frame and the decoded motion information. It should be understood that the predicted value of the current frame includes multiple predicted values corresponding to multiple feature points in the current frame.
[0012] In an embodiment of the present application, the decoding end includes an entropy decoding module, a decoding network, a motion compensation network, and a processing module. When the above method is applied to the decoding end, the entropy decoding module decodes the code stream to obtain motion information of the current frame; the motion compensation network can obtain a predicted value of the current frame based on the motion information; and the entropy decoding module decodes the code stream to obtain first feature information; the decoding network obtains the residual of the current frame and the confidence of the predicted value based on the first feature information; and the processing module obtains a reconstructed frame of the current frame based on the predicted value, the residual of the current frame, and the confidence of the predicted value.
[0013] In the embodiments of the present application, the confidence level of the predicted value is used to characterize the reliability of the predicted value. Therefore, in the above method, by configuring a corresponding confidence level for the predicted value of the current frame, the decoder can determine the reconstructed frame for the current frame by combining the predicted value, the residual of the current frame, and the confidence level of the predicted value. Thus, the confidence level of the predicted value is taken into account during the determination of the reconstructed frame, which can reduce encoding errors caused by low accuracy of the predicted content (i.e., the predicted value) during the encoding process, thereby effectively improving compression performance.
[0014] For example, when a prediction value is inaccurate, by setting the confidence level of the prediction value to a value between 0 and 1, the degree of use of the prediction value in the frame reconstruction process is determined based on the confidence level of the prediction value, thereby reducing the coding error caused by the low accuracy of the prediction value. For another example, when a prediction value cannot be obtained, by setting the confidence level of the prediction value to 0, the prediction value can be not used, that is, the residual of the current frame is not compressed, and the original image of the current frame is compressed, thereby eliminating the coding error caused by the low accuracy of the prediction value. In addition, original image compression can effectively reduce bit consumption compared to residual compression.
[0015] The prediction value of the current frame may include prediction features. It should be understood that the prediction features may be prediction results of the feature domain or the image domain. The "feature domain" may be understood as the feature dimension of the image, and accordingly, the "prediction result of the feature domain" is the prediction value in the feature dimension of the image, that is, the prediction value includes the prediction features corresponding to each feature point in the current frame; the "image domain" may be understood as the pixel dimension of the image, and accordingly, the "prediction result of the feature domain" is the prediction value in the pixel dimension of the image, that is, the prediction value includes the prediction value corresponding to each pixel in the current frame.
[0016] In one possible implementation, when the predicted value is a predicted feature, the confidence of the predicted value includes a confidence matrix, an element in the confidence matrix is used to characterize the confidence of a feature point in the predicted feature, and the elements in the confidence matrix correspond one-to-one to the feature points in the predicted feature; accordingly, based on the predicted value, the residual of the current frame and the confidence of the predicted value, a reconstructed frame of the current frame is obtained, including: multiplying the predicted feature and the confidence matrix to obtain a first matrix; adding the first matrix to the residual of the current frame to obtain the reconstructed feature of the current frame; and inputting the reconstructed feature of the current frame into the reconstruction network to obtain the reconstructed frame of the current frame.
[0017] In the embodiment of the present application, "an element in the confidence matrix is used to characterize the confidence of a feature point in the predicted feature" can be understood as: an element in the confidence matrix is used to characterize the credibility of a feature point in the predicted feature. Correspondingly, "multiplying the predicted feature by the confidence matrix" can be understood as multiplying each feature point in the predicted feature by a weight coefficient (i.e., the confidence of the feature point). In this way, in this implementation, setting a corresponding confidence for each feature point in the predicted feature can reduce the coding error caused by the low prediction accuracy of some feature points, thereby making the final reconstructed frame of the current frame more accurate.
[0018] In one possible implementation, when the above-mentioned prediction value is a prediction feature, the confidence of the prediction value includes a confidence variance matrix; accordingly, based on the prediction value, the residual of the current frame and the confidence of the prediction value, a reconstructed frame of the current frame is obtained, including: calculating the blur kernel of each feature point in the prediction feature according to the confidence variance matrix; blurring each feature point based on the blur kernel of each feature point to obtain a prediction feature after blurring; adding the prediction feature after blurring to the residual of the current frame to obtain a reconstructed feature of the current frame; inputting the reconstructed feature of the current frame into the reconstruction network to obtain a reconstructed frame of the current frame.
[0019] Among them, "blurring each feature point based on the blur kernel of each feature point" can be understood as filtering the image corresponding to the predicted feature to eliminate the noise in the image. The specific operation can be to adjust the pixel value of the feature point with a large difference between the predicted feature and its surroundings to make the pixel value of the feature point approximate to the pixel value of the feature points around it; the blur kernel is a convolution kernel in the filtering process, which can be represented by a matrix. The blur kernel of each feature point is matrix convolved with the matrix corresponding to each feature point in the predicted feature, which can make the image corresponding to the predicted feature blurred.
[0020] In this implementation, a confidence variance is set for each feature point in the predicted features. Based on the confidence variance, a blur kernel is calculated for each feature point in the predicted features. Each feature point is then blurred based on the blur kernel to obtain a blurred predicted feature. The reconstructed frame for the current frame is then determined based on the blurred predicted feature. This eliminates the effects of noise on the predicted features, further reducing coding errors caused by low prediction accuracy for some feature points, ultimately resulting in a more accurate reconstructed frame for the current frame.
[0021] In one possible implementation, when the predicted value is a predicted feature, the confidence of the predicted value includes a first confidence matrix and a second confidence matrix, an element in the first confidence matrix is used to characterize the confidence of a feature point in the predicted feature, and an element in the second confidence matrix is used to characterize the confidence of a feature point in the feature of the reference frame of the current frame; the reference frame is a reconstructed frame of any image frame whose decoding order is before the current frame; accordingly, according to the predicted feature, the residual of the current frame and the confidence of the predicted feature, the reconstructed frame of the current frame is obtained, including: multiplying the first confidence matrix with the predicted feature to obtain a first matrix; multiplying the second confidence matrix with the feature of the reference frame to obtain a second matrix; adding the first matrix, the second matrix, and the residual of the current frame to obtain the reconstructed feature of the current frame; inputting the reconstructed feature of the current frame into the reconstruction network to obtain the reconstructed frame of the current frame.
[0022] Among them, "multiplying the first confidence matrix by the predicted features to obtain a first matrix" can be understood as multiplying each feature point in the predicted features by a weight coefficient (i.e., confidence), and "multiplying the second confidence matrix by the features of the reference frame to obtain a second matrix" can be understood as multiplying each feature point in the features of the reference frame by a weight coefficient (i.e., confidence).
[0023] In this implementation, by setting a first confidence matrix for the predicted features of the current frame and setting a second confidence matrix for the features of the reference frame, the decoding end can combine the first confidence matrix and the second confidence matrix to determine the reconstructed frame of the current frame, thereby eliminating the coding errors caused by the low accuracy of the reference frame or the low accuracy of the predicted features, so that the reconstructed features of the current frame finally obtained are more accurate.
[0024] In a second aspect, an embodiment of the present application further provides an encoding method, which can be applied to an encoding end or an encoding device, and the method includes: acquiring multiple image frames; determining motion information of a current frame; wherein the current frame is any image frame among the multiple image frames; encoding the motion information into a code stream; determining a prediction value of the current frame based on the motion information; obtaining first feature information based on the prediction value of the current frame and the current frame, wherein the first feature information is related to the residual of the current frame and the confidence of the prediction value; encoding the first feature information into the code stream.
[0025] In an embodiment of the present application, the encoding end includes a motion estimation network, an entropy coding module, a motion compensation network, and an encoding network. When the above method is applied to the encoding end, the motion estimation network can determine the motion information of the current frame; the entropy coding module encodes the motion information into the bitstream; and the motion compensation network can obtain a predicted value of the current frame based on the motion information; the encoding network can obtain first feature information based on the predicted value of the current frame and the current frame; and the entropy coding module can encode the first feature information into the bitstream.
[0026] In one possible implementation, the method further includes: obtaining the residual of the current frame and the confidence of the predicted value based on the first feature information; and obtaining a reconstructed frame of the current frame based on the predicted value, the residual of the current frame, and the confidence of the predicted value. Specifically, the encoding end may further include a reconstruction network module, and the encoder may obtain the reconstructed features of the current frame based on the predicted value, the residual of the current frame, and the confidence of the predicted value. The reconstruction network module then inputs the reconstructed features of the current frame into a reconstruction network to obtain a reconstructed frame of the current frame.
[0027] In one possible implementation, when the predicted value is a predicted feature, the confidence of the predicted value includes a confidence matrix, an element in the confidence matrix is used to characterize the confidence of a feature point in the predicted feature, and the elements in the confidence matrix correspond one-to-one to the feature points in the predicted feature; according to the predicted value, the residual of the current frame and the confidence of the predicted value, a reconstructed frame of the current frame is obtained, including: multiplying the predicted feature and the confidence matrix to obtain a first matrix; adding the first matrix to the residual of the current frame to obtain the reconstructed feature of the current frame; and inputting the reconstructed feature of the current frame into the reconstruction network to obtain the reconstructed frame of the current frame.
[0028] In one possible implementation, when the predicted value is a predicted feature, the confidence of the predicted value includes a confidence variance matrix; according to the predicted value, the residual of the current frame and the confidence of the predicted value, a reconstructed frame of the current frame is obtained, including: according to the confidence variance matrix, calculating the blur kernel of each feature point in the predicted feature; based on the blur kernel of each feature point, blurring each feature point to obtain a predicted feature after blurring; adding the predicted feature after blurring to the residual of the current frame to obtain a reconstructed feature of the current frame; inputting the reconstructed feature of the current frame into the reconstruction network to obtain a reconstructed frame of the current frame.
[0029] In a possible implementation, when the predicted value is a predicted feature, the confidence of the predicted value includes a first confidence matrix and a second confidence matrix, an element in the first confidence matrix is used to represent the confidence of a feature point in the predicted value, and an element in the second confidence matrix is used to represent the confidence of a feature point in the feature of the reference frame of the current frame; the reference frame is a reconstructed frame of any image frame whose decoding order is before the current frame; according to the predicted value, the residual of the current frame and the confidence of the predicted value, the reconstructed frame of the current frame is obtained, including: multiplying the first confidence matrix with the predicted feature to obtain a first matrix; multiplying the second confidence matrix with the feature of the reference frame to obtain a second matrix; adding the first matrix, the second matrix, and the residual of the current frame to obtain the reconstructed feature of the current frame; inputting the reconstructed feature of the current frame into the reconstruction network to obtain the reconstructed frame of the current frame.
[0030] In a third aspect, an embodiment of the present application provides a decoding device, comprising: the device includes modules / units for executing the method of the above-mentioned first aspect and any possible implementation method of the first aspect; these modules / units can be implemented by hardware, or corresponding software implementations can be executed by hardware.
[0031] Exemplarily, the decoding device may include:
[0032] An acquisition module, configured to acquire a code stream comprising coded data of a plurality of image frames;
[0033] an entropy decoding module, configured to decode the code stream to obtain motion information of a current frame; the current frame being any one of the multiple image frames;
[0034] A motion compensation network, configured to obtain a prediction value of the current frame based on the motion information;
[0035] The entropy decoding module is further configured to decode the code stream to obtain first feature information;
[0036] A decoding network, configured to obtain a residual of the current frame and a confidence level of the predicted value based on the first feature information;
[0037] A processing module is used to obtain a reconstructed frame of the current frame according to the predicted value, the residual of the current frame and the confidence of the predicted value.
[0038] In a fourth aspect, an embodiment of the present application provides an encoding device, which includes modules / units for executing the method of the above-mentioned second aspect and any possible implementation method of the second aspect; these modules / units can be implemented by hardware, or the corresponding software implementation can be executed by hardware.
[0039] Exemplarily, the encoding device may include:
[0040] An acquisition module, used for acquiring multiple image frames;
[0041] a motion estimation network, configured to determine motion information of a current frame; wherein the current frame is any one of the plurality of image frames;
[0042] An entropy coding module, configured to encode the motion information into a bit stream;
[0043] a motion compensation network, configured to determine a prediction value of the current frame based on the motion information;
[0044] an encoding network, configured to obtain first feature information based on the current frame and the predicted value, where the first feature information is related to a residual of the current frame and a confidence level of the predicted value;
[0045] The entropy coding module is further configured to encode the first feature information into the bit stream.
[0046] In a fifth aspect, an embodiment of the present application provides a code stream, which includes motion information and first feature information of a current frame; wherein the motion information is used to determine a prediction value of the current frame, and the first feature information is related to the residual of the current frame and the confidence of the prediction value.
[0047] In a sixth aspect, an embodiment of the present application provides a decoder, comprising a processing circuit for executing the decoding method as described in the first aspect and any implementation thereof.
[0048] In a seventh aspect, an embodiment of the present application provides an encoder, comprising a processing circuit for executing the encoding method as described in the second aspect and any implementation manner thereof.
[0049] In an eighth aspect, a decoder comprises: one or more processors; a computer-readable storage medium coupled to the one or more processors, the computer-readable storage medium storing a program, wherein when the program is executed by the one or more processors, the decoder performs the decoding method as described in the first aspect and any implementation thereof.
[0050] In the ninth aspect, an embodiment of the present application provides an encoder, comprising: one or more processors; a computer-readable storage medium coupled to the one or more processors, the computer-readable storage medium storing a program, wherein when the program is executed by the one or more processors, the encoder performs the encoding method as described in the second aspect and any implementation thereof.
[0051] In the tenth aspect, an embodiment of the present application provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed on a computer, the computer executes the method described in the first aspect and any implementation thereof, or executes the method described in the second aspect and any implementation thereof.
[0052] In an eleventh aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when executed on a computer, enables the method described in the first aspect, the second aspect, and any implementation thereof to be executed.
[0053] In the twelfth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a code stream containing program code. When the program code is executed by one or more processors, the decoder executes the decoding method described in the first aspect and any possible implementation of the first aspect.
[0054] In a thirteenth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a code stream, and the code stream is generated according to the encoding method described in the second aspect and any possible implementation of the second aspect.
[0055] In a fourteenth aspect, an embodiment of the present application provides a decoding system, which includes at least one memory and a decoder, wherein the at least one memory is used to store a code stream, and the decoder is used to execute the decoding method in the first aspect and any possible implementation of the first aspect.
[0056] In a fifteenth aspect, an embodiment of the present application provides a method for storing a code stream, the method comprising receiving or generating a code stream, and storing the code stream in a storage medium.
[0057] In a possible implementation, the method further includes: performing format conversion processing on the code stream to obtain a format-converted code stream, and storing the format-converted code stream in a storage medium.
[0058] In a sixteenth aspect, an embodiment of the present application provides a method for transmitting a code stream, the method comprising receiving or generating a code stream, transmitting the code stream to a cloud server, or transmitting the code stream to a mobile terminal. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] FIG1 is a schematic diagram of a scene of optical flow mapping;
[0060] Figure 2 is a schematic diagram of the convolution operation of obtaining the most central point by convolving points in the neighborhood;
[0061] FIG3 is a schematic diagram of the architecture of traditional video coding;
[0062] FIG4 is a schematic diagram of the architecture of end-to-end video coding based on deep learning;
[0063] FIG5 is a schematic diagram of a scenario applicable to an embodiment of the present application;
[0064] FIG6A is a schematic diagram of one of the encoding and decoding scenarios in an embodiment of the present application;
[0065] FIG6B is a second schematic diagram of encoding and decoding scenarios in an embodiment of the present application;
[0066] FIG6C is a third schematic diagram of encoding and decoding scenarios in an embodiment of the present application;
[0067] FIG7A is one of the system architecture diagrams provided in an embodiment of the present application;
[0068] FIG7B is a second system architecture diagram provided in an embodiment of the present application;
[0069] FIG8 is a third system architecture diagram provided in an embodiment of the present application;
[0070] FIG9 is a schematic diagram of a flow chart of an encoding method provided in an embodiment of the present application;
[0071] FIG10 is a schematic diagram of a flowchart of a decoding method provided in an embodiment of the present application;
[0072] FIG11 is a schematic diagram of an encoding network and a decoding network provided in an embodiment of the present application;
[0073] FIG12A is a schematic diagram showing the fusion of the prediction features of the current frame and the confidence of the prediction features;
[0074] FIG12B is a schematic diagram of the confidence of the predicted features;
[0075] FIG12C is one of the compression performance comparison diagrams provided in an embodiment of the present application;
[0076] FIG13A is a second schematic diagram of the fusion of the prediction features of the current frame and the confidence of the prediction features;
[0077] FIG13B is a schematic diagram of the confidence variance of the predicted features;
[0078] FIG13C is a second compression performance comparison diagram provided in an embodiment of the present application;
[0079] FIG14 is a third schematic diagram of the fusion of the prediction features of the current frame and the confidence of the prediction features;
[0080] FIG15 is a schematic diagram of the architecture of end-to-end video encoding and decoding provided by an embodiment of the present application;
[0081] FIG16 is a schematic diagram of a network provided in an embodiment of the present application;
[0082] FIG17 is a schematic structural diagram of an encoding device provided in an embodiment of the present application;
[0083] FIG18 is a schematic structural diagram of a decoding device provided in an embodiment of the present application;
[0084] FIG19 is a schematic structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0085] First, to facilitate understanding, the technical terms in the embodiments of the present application are explained accordingly.
[0086] 1. Convolutional neural network (CNN) is a type of feedforward neural network that includes convolution calculations and has a deep structure. It is one of the representative algorithms of deep learning.
[0087] 2. Deformable convolutional networks (DCN) are improved convolutional networks based on standard convolutional neural networks. Generally speaking, traditional convolution operations are to give a fixed-size rectangular sliding window, translate the image left and right, up and down, and then calculate the convolution feature map. Such operations, limited by the spatial structure, have poor rotation invariance and weak translation invariance. In reality, the same object in the image has different sizes, postures, and positions. In the deformable convolutional network, the offset parameters of the learning sampling network are added, so that the sampling position in the sampling network is a free shape (that is, a window deformed according to the shape of the object) instead of the traditional rectangle.
[0088] 3. Rate-distortion (RD), which includes two compression metrics. Compression is a balance between bitrate and distortion: lower bitrates have higher distortion, while higher bitrates have lower distortion.
[0089] 4. Bits per pixel (BPP) is the number of bits used to store each pixel. BPP is used to measure bitrate; a smaller BPP indicates a lower compression bitrate.
[0090] 5. Peak signal to noise ratio (PSNR) is an indicator to measure image distortion. The higher the PSNR, the better the image quality.
[0091] 6. Multi-scale structural similarity index measure (MS-SSIM) is an indicator to measure image distortion. The higher the MS-SSIM, the better the image quality.
[0092] 7. Bjontegaard delta rate (BD-Rate) is a metric used to compare the performance of video encoders. It is often used to compare the encoding effects of different video encoders on the same video sequence and measure the compression performance of the encoder.
[0093] 8. A codec is a device or program that can encode or decode a signal or a data stream. It usually includes an encoder and a decoder.
[0094] 9. Encoder: used to encode signals or digital streams (usually for transmission, storage or encryption) to obtain a code stream.
[0095] 10. Decoder: used to restore the code stream into a signal or digital stream.
[0096] 11. A feature, also known as a feature map, is a set of numerical values obtained by extracting features from an image or video frame. This feature map can be represented by the matrix [c, h, w], where c represents the channel, h represents the image height, and w represents the image width.
[0097] 12. Optical flow is used to characterize the speed and direction of movement of each pixel in two frames of images. Optical flow has two directions in the time dimension: one direction is the optical flow from the previous frame to the next frame, and the other direction is the optical flow from the next frame to the previous frame. A three-dimensional array ([2, h, w]) is usually used to represent optical flow in one direction. The "2" in this three-dimensional array indicates that the image has two channels, one of which represents the image's offset direction and offset size in the x-direction, and the other represents the image's offset direction and offset size in the y-direction. Furthermore, in the x-direction, a positive offset value indicates that the object in the image is moving to the left, while a negative offset value indicates that the object in the image is moving to the right. In the y-direction, a positive offset value indicates that the object in the image is moving upward, while a negative offset value indicates that the object in the image is moving downward. Here, h represents the height of the image, and w represents the width of the image.
[0098] Among them, the reference frame and the current frame are processed by various algorithms, and the optical flow v between the reference frame and the current frame can be obtained. t The optical flow may include feature domain optical flow or image domain optical flow.
[0099] 13. Optical flow mapping (warping) is a way to determine the predicted value of the current frame based on the reference frame and the optical flow between the reference frame and the current frame, usually expressed as Among them, x t-1 represents the reference frame, v t represents optical flow, Represents the predicted value of the current frame.
[0100] Common warping methods include backward warping and forward warping. See Figure 1. (a) in Figure 1 shows a schematic diagram of forward warping, which predicts the features of the next frame (the black dots shown in (b) in Figure 1) based on the optical flow between the previous frame and the frames before and after, as well as the previous frame. (b) in Figure 1 shows a schematic diagram of backward warping, which predicts the features of the previous frame (the white dots shown in (b) in Figure 1) based on the optical flow between the previous frame and the frames before and after, as well as the next frame.
[0101] 14. Feature alignment, also known as motion alignment, is a method for determining the predicted value of the current frame based on a reference frame and the optical flow between the reference frame and the current frame. Specifically, feature alignment determines the predicted features of the current frame in the feature domain based on the features of the reference frame and the optical flow of the feature domain. Common feature alignment operations include warping and DCN. Warping treats features as images for optical flow mapping, while DCN implements feature alignment through convolution.
[0102] The mathematical expression of common convolution can be:
[0103] Among them, n is the size of the convolution kernel, w is the weight of the convolution kernel, F is the input feature map, p is the convolution position, and p k It is an enumeration value relative to the position of p in the convolution kernel.
[0104] The mathematical expression of convolution in DCN can be:
[0105] The mathematical expression of convolution in DCN with mask is:
[0106] Where Δp k is the convolution position relative to p k The offset, m(pk ) represents the position p k The mask value is the value of position p k Thus, by adding an offset Δp to the convolution k , which can make the sampling position of DCN convolution become irregular.
[0107] Figure 2 shows the convolution operation of convolving the points in the neighborhood to get the center point. The black dots in Figure 2 represent the convolution kernel before the change, and the white circles in Figure 2 represent the convolution kernel after the change. Figure 2 (a) shows the sampling method of the common 3x3 convolution kernel, Figure 2 (b) shows the change of the sampling point after adding the offset in the deformable convolution, and Figure 2 (c) and (d) show the special form of the deformable convolution. k If it is regarded as optical flow, DCN can be used to predict the predicted value of the current frame based on the reference frame and optical flow.
[0108] 15. Motion information can be understood as one optical flow or a combination of multiple optical flows.
[0109] 16. Entropy coding, used to compress data to the theoretical entropy size: -log b P s , where b represents the base number for measuring the size of the code stream (usually 2), P s Represents the probability of a data element. For a sequence S = {s0, s1, ..., s n}, and the probability distribution {p0, p1, ..., p n}, the purpose of entropy coding is to compress the sequence S to ∑-log2p i (s i The purpose of entropy decoding is to recover the sequence S based on the probability distribution of each element and the bit stream.
[0110] 17. The feature domain can be understood as the feature dimension of the image. Correspondingly, the "feature domain prediction result" is the predicted value in the feature dimension of the image, that is, the predicted value includes the predicted features corresponding to each feature point in the current frame.
[0111] 18. The image domain can be understood as the pixel dimension of the image. Correspondingly, the "feature domain prediction result" is the prediction value in the pixel dimension of the image, that is, the prediction value includes the prediction value corresponding to each pixel in the current frame.
[0112] The term "at least one" in the embodiments of the present application refers to one or more, and "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.
[0113] Furthermore, unless otherwise specified, ordinal numbers such as "first" and "second" in the embodiments of this application are used to distinguish between multiple objects and are not used to define the priority or importance of multiple objects. For example, the first matrix and the second matrix are only used to distinguish different matrices and do not indicate a difference in priority or importance between the two matrices.
[0114] Figure 3 shows a traditional video coding architecture, which includes a motion estimation module, a motion compensation module, an entropy coding module, a transform module, and an inverse transform module. The encoding process in the traditional video coding architecture is as follows:
[0115] 1) The encoding end converts the current frame x t and reference frame Input motion estimation module to get the current frame x t and reference frame The motion information between t ;
[0116] 2) The encoding end converts the motion information v t Input the motion compensation module to get the predicted value of the current frame
[0117] 3) The encoding end calculates the actual value x of the current frame t and the predicted value of the current frame The residual r of the current frame can be determined t .
[0118] 4) The residual r of the current frame at the encoding end t After transformation and intermediate processing (i.e. Q shown in the figure, such as discrete processing and rounding), the residual to be encoded is obtained
[0119] 5) Coding end pair residual Residual and motion information vt Encode and obtain the code stream.
[0120] As can be seen from the above, the residual coding process of the traditional video coding architecture needs to determine the prediction value of the current frame. If the prediction value of the current frame is inaccurate or cannot be obtained, it will cause a large coding error.
[0121] Because artificial intelligence (AI) outperforms traditional image algorithms in many fields, such as image recognition and object detection, deep learning has also been applied to image compression. Figure 4 shows the architecture of an end-to-end video coding system based on deep learning. This architecture includes a motion estimation network, a video encoder network (MV encoder network), a video decoder network (MV decoder network), a motion compensation network (motion compensation network), a residual encoder network (residual encoder network), a residual decoder network (residual decoder network), and a quantization and bitrate estimation network. These networks are all learnable deep learning modules.
[0122] The encoding process in the end-to-end video encoding architecture is as follows:
[0123] 1) The encoding end converts the current frame x t and reference frame Input motion estimation network to get the current frame x t and reference frame The motion information between t ;
[0124] 2) The encoding end converts the motion information v t Input the video encoder network to get the code stream m of motion information t .
[0125] 3) The code stream m of motion information at the encoding end t Perform intermediate processing (i.e. Q, such as discrete processing, rounding, etc.) to obtain the processed code stream
[0126] 4) The encoding end will process the code stream Input the video decoder network to obtain the decoded motion information
[0127] 5) The encoding end will reference the frame and decoded motion information Input the motion compensation network to get the predicted value of the current frame
[0128] 6) The encoder end calculates the actual value x of the current frame t and the predicted value of the current frame Determine the residual r of the current frame t .
[0129] Specifically, the process satisfies the following formula:
[0130] 7) The encoder converts the residual r of the current frame into t Input the residual coding network to get the residual code stream y t .
[0131] 8) The residual code stream y of the encoding end t Perform intermediate processing (i.e. Q, such as discrete processing, rounding, etc.) to obtain the processed code stream
[0132] 9) The encoding end will process the code stream Input the residual decoding network and obtain the reconstructed frame of the current frame after decoding 506
[0133] Correspondingly, the decoding process in this end-to-end video coding architecture is:
[0134] 1) The decoding end obtains the code stream of motion information and residual bitstream
[0135] 2) The encoding end converts the code stream Input the video decoder network to obtain the decoded motion information
[0136] 3) The decoding end uses the reference frame and decoded motion information Determine the predicted value for the current frame
[0137] 4) The decoding end will stream Input the residual decoding network to get the decoded residual
[0138] 5) The decoding end determines the reconstructed frame of the current frame according to the following formula:
[0139] in, is the reconstructed frame of the previous frame, is the residual after decoding is the predicted value of the current frame
[0140] And, the encoding end converts the code stream of motion information and residual bitstream After inputting into the quantization and bitrate estimation network in the end-to-end video coding architecture, a single loss function is used to balance the distortion and bitrate of the image frame. In this way, the compression performance can be improved by optimizing each network in the architecture (i.e., motion estimation network, video encoder network, video decoder network, motion compensation network, residual coding network, residual decoding network), which has a significant advantage over the traditional video coding framework.
[0141] However, the residual coding process of the end-to-end video coding architecture still needs to determine the prediction value of the current frame. If the prediction value of the current frame is inaccurate or cannot be obtained, it will still cause coding errors, resulting in poor compression performance.
[0142] In summary, in the current video encoding process, for image areas with irregular motion or occluded image areas, the predicted value of the current frame may be inaccurate or unable to be obtained, which will lead to large encoding errors and poor compression performance.
[0143] In view of this, embodiments of the present application provide a coding and decoding method and apparatus for reducing coding errors caused by low prediction accuracy during the encoding process, thereby effectively improving compression performance. In this method, by configuring a corresponding confidence level for the prediction value of the current frame, the decoder can determine the reconstructed frame of the current frame by combining the prediction value, the residual of the current frame, and the confidence level of the prediction value.
[0144] The technical solution provided in this application can be applied to the process of encoding and compressing image, video and other data, such as the data encoding and compression process in video surveillance, live broadcast, terminal recording, storage, transmission, cloud encoding and decoding, cloud transcoding, video stream distribution and other services, and is especially suitable for AI-based compression scenarios.
[0145] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments.
[0146] FIG5 exemplarily provides a schematic diagram of a scenario in which the encoding method and decoding method provided in an embodiment of the present application can be applied. In this scenario, the monitoring device 501 (or the monitoring device 502) encodes the collected video information and uploads the encoded code stream to the cloud server 506; the cloud server 506 can send the code stream to the terminal device 503 (or the terminal device 504, the terminal device 505) after receiving a request to obtain the code stream. The terminal device 503 decodes the obtained code stream to play the video. In addition, the cloud server 506 can also have the ability to decode and / or encode. For example, the cloud server 506 can decode the obtained code stream, then process the video, and then encode the processed video for subsequent transmission to other terminal devices.
[0147] Figure 6A shows one of the schematic diagrams of the encoding and decoding scenarios in the embodiment of the present application. In Figure 6A, after the encoding end inputs multiple image frames into the AI video encoding unit, a code stream can be obtained; further, the encoding end can store or transmit the code stream; and the decoding end inputs the code stream into the AI video decoding unit to obtain multiple decoded image frames. Exemplarily, the schematic diagram of the architecture for storing the code stream is shown in Figure 6B, which is suitable for services such as terminal albums and video surveillance; the schematic diagram of the architecture for transmitting the code stream is shown in Figure 6C, which is suitable for live broadcast services. For example, the cloud server can collect the encoded code stream and distribute the code stream to the user terminal. After the user terminal performs corresponding decoding, the user can watch the corresponding video.
[0148] FIG7A shows one of the system architecture diagrams provided in an embodiment of the present application, which includes an encoding end and a decoding end. The encoding end includes an encoder and an entropy coding module, and the decoding end includes a decoder and an entropy decoding module.
[0149] The encoding operation at the encoding end includes: the encoding end inputs the current frame into the encoder, and the encoder can determine the motion information of the current frame; and the encoder can determine the prediction value of the current frame based on the motion information and the reference frame; the encoder can determine the first feature information to be encoded based on the prediction value of the current frame and the current frame, and the first feature information is related to the residual of the current frame and the confidence of the prediction value of the current frame; further, the motion information and the first feature information are input into the entropy coding module, and the entropy coding module can encode the motion information and the first feature information separately to obtain a bitstream. It should be understood that the entropy coding module can encode the motion information and the first feature information into the same bitstream, or the entropy coding module can encode the motion information and the first feature information into different bitstreams.
[0150] Correspondingly, the decoding operation at the decoding end includes: an entropy decoding module in the decoding end receives a bit stream, and the entropy decoding module decodes the bit stream to obtain motion information; the decoder obtains a predicted value of the current frame based on the motion information; and the entropy decoding module decodes the bit stream to obtain first feature information; the decoder obtains a residual of the current frame and a confidence level of the predicted value of the current frame based on the first feature information; and further, the decoder obtains a reconstructed frame of the current frame based on the predicted value of the current frame, the residual of the current frame, and the confidence level of the predicted value.
[0151] Optionally, in some embodiments, the encoder also needs to perform some operations in the decoder. In this case, the encoder can reuse the decoder in the decoder to perform the following operations: based on the motion information, a prediction value of the current frame can be obtained; based on the first feature information, a residual of the current frame and a confidence level of the prediction value of the current frame can be obtained; and based on the prediction value of the current frame, the residual of the current frame, and the confidence level of the prediction value, a reconstructed frame of the current frame can be obtained.
[0152] FIG7B shows the second system architecture diagram provided by an embodiment of the present application, which includes an encoding end and a decoding end. The encoding end includes an encoder, an entropy encoding module, and a decoder 1, and the decoding end includes a decoder 2 and an entropy decoding module. In this way, when the encoding end determines the reconstructed frame of the current frame, the decoder 1 can be used to perform the following operations: based on the motion information, the predicted value of the current frame can be obtained; and based on the first feature information, the residual of the current frame and the confidence of the predicted value of the current frame can be obtained; based on the predicted value of the current frame, the residual of the current frame and the confidence of the predicted value, the reconstructed frame of the current frame is obtained. In this way, the encoding end does not need to share the same decoder with the decoding end, which can effectively improve the efficiency of the encoding end in determining the reconstructed frame of the current frame.
[0153] Figure 8 shows the third system architecture diagram provided by an embodiment of the present application. The system architecture includes an encoder and a decoder. The encoder includes a motion estimation network, an entropy coding module, a motion compensation network, and an encoding network, while the decoder includes an entropy decoding module, a decoding network, a motion compensation network, and a processing module.
[0154] In Figure 8, the current frame and the reference frame are input into the motion estimation network in the encoding end to obtain the motion information of the current frame; the entropy coding module encodes the motion information into the bitstream; and the motion information is input into the motion compensation network in the encoding end to obtain the prediction value of the current frame; the prediction value of the current frame and the current frame are input into the encoding network in the encoding end to obtain first feature information, which is related to the residual of the current frame and the confidence of the prediction value; the entropy coding module in the encoding end encodes the first feature information into the bitstream.
[0155] The entropy decoding module in the decoding end decodes the bit stream to obtain motion information of the current frame; the motion information is input into the motion compensation network in the decoding end to obtain a predicted value of the current frame; the entropy decoding module in the decoding end decodes the bit stream to obtain first feature information; the first feature information is input into the decoding network in the decoding end to obtain a residual of the current frame and a confidence level of the predicted value; and then the processing module in the decoding end obtains a reconstructed frame of the current frame based on the predicted value, the residual of the current frame, and the confidence level of the predicted value.
[0156] Refer to Figure 9, which is a flow chart of an encoding method provided in an embodiment of the present application. The process shown in Figure 9 can be executed by the encoding end in Figure 8. The encoding end can be a computing device or can be implemented by multiple computing devices. The computing device is a device with encoding function, which can be a server, such as a cloud server; it can also be a terminal device, such as a monitoring device, a terminal device for live broadcast, etc.
[0157] Specifically, the encoding method shown in FIG9 may include the following steps:
[0158] S901: The encoding end obtains multiple image frames.
[0159] In the embodiment of the present application, the above-mentioned multiple image frames can be multiple continuous or discontinuous video frames in a video stream.
[0160] In one possible implementation, the encoding end has an image acquisition function and can directly acquire multiple image frames. In another possible implementation, the encoding end does not have an image acquisition function, and an image acquisition device (e.g., a camera) acquires multiple image frames and then sends the multiple image frames to the encoding end. Correspondingly, the encoding end receives the multiple image frames from the image acquisition device.
[0161] S902: The encoding end determines motion information of the current frame.
[0162] The current frame is any one of the multiple image frames.
[0163] It should be understood that the motion information of the current frame refers to the motion information between the current frame and a reference frame of the current frame, where the reference frame is a reconstructed frame of any image frame that precedes the current frame in the decoding order. The decoding order includes a forward decoding order and a reverse decoding order. For example, in the forward decoding order, the reference frame may be a reconstructed frame of the image frame that is adjacent to the current frame; or in the reverse decoding order, the reference frame may be a reconstructed frame of the image frame that is subsequent to the current frame.
[0164] The motion information can be an optical flow or a combination of multiple optical flows. The optical flow can be an image domain optical flow or a feature domain optical flow. The image domain optical flow is determined based on the pixel positions of the reference frame and the pixel positions of the current frame, while the feature domain optical flow is determined based on the features of the reference frame and the features of the current frame.
[0165] Step S902 can be implemented by a motion estimation network in the encoder. In one possible implementation, a reference frame can be input into a feature extraction network to obtain a first feature map of the reference frame; the current frame can be input into the feature extraction network to obtain a second feature map of the current frame; and the first feature map and the second feature map can be input into a motion estimation network to obtain motion information of the current frame.
[0166] S903: The encoder encodes the motion information into a bitstream.
[0167] Step S903 may be implemented by an entropy coding module in the encoding end, thereby achieving lossless compression of motion information.
[0168] S904: The encoder determines a prediction value of the current frame based on the motion information.
[0169] Step S904 may be implemented by a motion compensation network in the encoding end. In one possible implementation, the motion information and the reference frame are input into the motion compensation network to obtain a prediction value of the current frame.
[0170] The prediction value of the current frame may include prediction features. It should be understood that the prediction features may be prediction results of the feature domain or the image domain. The "feature domain" may be understood as the feature dimension of the image, and accordingly, the "prediction result of the feature domain" is the prediction value in the feature dimension of the image, that is, the prediction value includes the prediction features corresponding to each feature point in the current frame; the "image domain" may be understood as the pixel dimension of the image, and accordingly, the "prediction result of the feature domain" is the prediction value in the pixel dimension of the image, that is, the prediction value includes the prediction value corresponding to each pixel in the current frame.
[0171] For example, the reference frame is X t-1 , the motion information is the reference frame X t-1 With the current frame X t The feature domain optical flow O t , the reference frame X t-1 and feature domain optical flow O t Input the motion estimation network to get the current frame X t Predicted features in the feature domain
[0172] S905: The encoder obtains first feature information based on the prediction value of the current frame and the current frame. The first feature information is related to the residual of the current frame and the confidence of the prediction value.
[0173] Step S905 may be implemented by an encoding network in the encoding end. In one possible implementation, the current frame and the predicted value of the current frame are input into the encoding network to obtain the first feature information.
[0174] S906: The encoder encodes the first feature information into the bitstream.
[0175] In an embodiment of the present application, the code stream of the motion information and the code stream of the first characteristic information may be the same code stream, with a portion of the code stream being the code stream of the motion information and another portion being the code stream of the first characteristic information. Alternatively, the code stream of the motion information and the code stream of the first characteristic information may be different code streams.
[0176] Step S906 may be implemented by an entropy coding module in the encoding end, thereby achieving lossless compression of the first feature information.
[0177] Optionally, after obtaining the code stream, the encoding end may also transmit the code stream to the decoding end.
[0178] Optionally, the encoding end may further perform the following operations:
[0179] S907: The encoder obtains the residual and confidence of the predicted value of the current frame based on the first feature information.
[0180] Step S907 can be implemented by a decoding network. As shown in Figure 8, in one possible implementation, the encoding end and the decoding end share the same decoding network, which transforms the first feature information to obtain the residual error and the confidence level of the predicted value of the current frame. In one possible implementation, the first feature information is input into the decoding network to obtain the residual error and the confidence level of the predicted value of the current frame.
[0181] S908: The encoder obtains a reconstructed frame of the current frame according to the predicted value, the residual of the current frame, and the confidence of the predicted value.
[0182] Step S908 may be implemented by the processing module shown in FIG8 .
[0183] The specific implementation method of the processing module obtaining the reconstructed frame of the current frame according to the predicted value, the residual of the current frame and the confidence of the predicted value is described below.
[0184] Referring to FIG10 , which is a flowchart of a decoding method provided in an embodiment of the present application, the process shown in FIG10 is executed by the decoding end in FIG8 . The decoding end can be a computing device or can be implemented by multiple computing devices. The computing device is a device with decoding function, which can be a server, such as a cloud server; or a terminal device, such as a monitoring device, a terminal device for live broadcasting, etc. Specifically, the decoding method shown in FIG10 may include the following steps:
[0185] S1001: A decoding end obtains a code stream including coded data of multiple image frames.
[0186] In one possible implementation, the encoder and decoder are deployed in the same device, and the decoder can directly obtain the bitstream from the memory of the device. In another possible implementation, the encoder and decoder are deployed in different devices, and the decoder receives the bitstream from the encoder.
[0187] S1002: The decoding end decodes the code stream to obtain motion information of the current frame.
[0188] Here, step S1002 may be implemented by an entropy decoding module in the decoding end.
[0189] S1003: The decoding end obtains a prediction value of the current frame based on the motion information.
[0190] Step S1003 may be implemented by a motion compensation network in the decoding end. In one possible implementation, the decoder may input the code stream into the motion compensation network to obtain a prediction value of the current frame.
[0191] S1004: The decoding end decodes the code stream to obtain first feature information.
[0192] Here, step S1004 may be implemented by an entropy decoding module in the decoding end.
[0193] S1005. The decoding end obtains the residual and the confidence of the predicted value of the current frame according to the first feature information.
[0194] Step S1005 may be implemented by a decoding network in the decoding end. In one possible implementation, the first feature information is input into the decoding network, which transforms the first feature information to obtain the residual of the current frame and the confidence of the predicted value.
[0195] S1006: The decoding end obtains a reconstructed frame of the current frame according to the predicted value, the residual of the current frame, and the confidence of the predicted value.
[0196] Step S1006 can be implemented by a processing module in the decoding end (as shown in FIG8 ). The processing module obtains the reconstructed frame of the current frame based on the predicted value, the residual of the current frame, and the confidence of the predicted value. Please refer to the relevant description below for a specific implementation method.
[0197] The encoding network involved above may be as shown in FIG11( a ), and the decoding network may be as shown in FIG11( b ).
[0198] In Figures 9 and 10, the confidence of the prediction value is taken into account when determining the reconstructed frame, which can reduce the coding error caused by the low accuracy of the prediction content (ie, the prediction value) during the encoding process, thereby effectively improving the compression performance.
[0199] For example, when the prediction value is inaccurate, by setting the confidence of the prediction value to a value between 0 and 1, the degree of use of the prediction value in the process of reconstructing the frame is determined based on the confidence of the prediction value, thereby reducing the coding error caused by the low accuracy of the prediction value.
[0200] For example, when the prediction value cannot be obtained, the confidence of the prediction value can be set to 0, so that the prediction value is not used, that is, the residual of the current frame is not compressed, but the original image of the current frame is compressed, thereby eliminating the coding error caused by the low accuracy of the prediction value. In addition, compared with residual compression, original image compression can effectively reduce bit consumption.
[0201] When the prediction of the current frame is a prediction feature, in an embodiment of the present application, the encoder or decoder obtains a reconstructed frame of the current frame based on the prediction feature, the residual of the current frame, and the confidence of the prediction feature, which may include but is not limited to the following implementations:
[0202] Implementation method 1, please refer to Figure 12A, which is one of the schematic diagrams of the fusion of the prediction features of the current frame and the confidence of the prediction features. The confidence of the above-mentioned prediction features includes a confidence matrix C; wherein, an element in the confidence matrix is used to characterize the confidence of a feature point in the prediction feature, and the elements in the confidence matrix correspond one-to-one to the feature points in the prediction feature. In Figure 12A, after the code stream (i.e., the small square in Figure 12A) is input into the entropy decoding module, the entropy decoding module decodes the code stream to obtain the first feature information; further, the decoding network transforms the first feature information to obtain the confidence matrix C of the prediction feature of the current frame and the residual of the current frame. Then, the processing module combines the confidence matrix C with the predicted features of the current frame Multiply to get the first matrix, and add the first matrix to the residual of the current frame Add together to get the reconstructed features of the current frame The processing module reconstructs the features of the current frame Input into the reconstruction network to obtain the reconstructed frame of the current frame.
[0203] In the embodiment of the present application, "an element in the confidence matrix is used to characterize the confidence of a feature point in the predicted feature" can be understood as: an element in the confidence matrix is used to characterize the credibility of a feature point in the predicted feature. Correspondingly, "multiplying the predicted feature by the confidence matrix" can be understood as multiplying each feature point in the predicted feature by a weight coefficient (i.e., the confidence of the feature point). In this way, by setting a corresponding confidence for each feature point in the predicted feature, the coding error caused by the low prediction accuracy of some feature points can be reduced, thereby making the final reconstructed frame of the current frame more accurate.
[0204] For example, when the image corresponding to the current frame is a three-dimensional matrix, the predicted feature of the current frame can also be a three-dimensional matrix. Assume that the size of the three-dimensional matrix A is M*N*L, that is, the three-dimensional matrix A includes M*N*L elements, and the value of each element is the eigenvalue corresponding to a feature point in the predicted feature. Correspondingly, the confidence matrix C includes M*N*L elements, and the value of each element is the confidence level of the feature point corresponding to the element; and the residual of the current frame It is also represented by a three-dimensional matrix B, which also includes M*N*L elements. The value of each element is the residual of the feature point corresponding to the element. Therefore, the encoder or decoder determines the reconstructed features of the current frame. Satisfy the formula: Reconstructed features of the current frame
[0205] Figure 12B is a schematic diagram of the confidence of the predicted features. Figure 12B (a) shows the previous frame image of the current frame, Figure 12B (b) shows the image of the current frame, and Figure 12B (c) shows a schematic diagram of the confidence of the predicted features of the current frame; wherein, a triangle appears in the black target frame in the image of the current frame, and the triangle does not exist in the previous frame image. Therefore, when the reconstructed frame of the previous frame image is used as the reference frame to determine the predicted features of the current frame, the feature points corresponding to the triangle in the black target frame are predicted to be inaccurate. Therefore, the confidence of the predicted feature points corresponding to the triangle is set to a value close to 0. In Figure 12B (c), the confidence of the predicted feature points corresponding to the triangle is represented by black.
[0206] In order to intuitively understand the improvement effect of compression performance in Implementation 1, Figure 12C shows one of the compression performance comparison diagrams provided by the embodiment of the present application. In Figure 12C, the test sequence of the high efficiency video coding (HEVC) standard is used as a test set to evaluate the compression performance of the embodiment of the present application; wherein, the test sequence of the HEVC standard includes 4K (A1), 4K (A2) 1080p, 832x480, and 720p conference scenes. As shown in Figure 12C, under different test sequences, the luminance signal peak signal-to-noise ratio (Y-PSNR) of the image in the embodiment of the present application is less than the Y-PSNR of the image in the control group, the color difference signal peak signal-to-noise ratio (U-PSNR) of the image in the embodiment of the present application is less than the U-PSNR of the image in the control group, the color difference signal peak signal-to-noise ratio (V-PSNR) of the image in the embodiment of the present application is less than the V-PSNR of the image in the control group, and the YUV-PSNR of the image in the embodiment of the present application is less than the YUV-PSNR of the image in the control group.
[0207] Implementation 2, please refer to FIG13A, FIG13A is a second schematic diagram of the fusion of the prediction feature of the current frame and the confidence of the prediction feature. The confidence of the above-mentioned prediction feature includes a confidence variance matrix; accordingly, in FIG13A, after the bitstream is input into the entropy decoding module, the entropy decoding module decodes the bitstream to obtain the first feature information; further, the decoding network transforms the first feature information to obtain the prediction feature of the current frame The confidence variance matrix C1 and the residual of the current frame The processing module calculates the prediction features based on the confidence variance matrix C1 The processing module performs blur processing on each feature point based on the blur kernel of each feature point to obtain the predicted feature after blur processing; the processing module compares the predicted feature after blur processing with the residual of the current frame Add together to get the reconstructed features of the current frame The processing module reconstructs the features of the current frame Input to the reconstruction network to obtain the reconstructed frame of the current frame.
[0208] Here, "blurring each feature point based on the blur kernel of each feature point" can be understood as filtering the image corresponding to the predicted feature to eliminate noise in the image. The specific operation can be to adjust the pixel values of the feature points where the predicted feature differs significantly from its surroundings so that the pixel values of the feature point are similar to the pixel values of the surrounding feature points. The blur kernel is a convolution kernel in the filtering process and can be represented by a matrix. The blur kernel of each feature point is convolved with the matrix corresponding to each feature point in the predicted feature to blur the image corresponding to the predicted feature. The confidence variance ranges from 0 to infinity. The smaller the confidence variance, the more reliable the predicted feature result. In this way, by setting the confidence variance for each feature point in the predicted feature and calculating the blur kernel for each feature point in the predicted feature based on the confidence variance, each feature point can be blurred based on the blur kernel of each feature point to obtain the blurred predicted feature. The reconstructed frame of the current frame is determined based on the blurred predicted feature. In this way, the influence of noise on the prediction features can be eliminated, and the coding error caused by the low prediction accuracy of some feature points can be further reduced, so that the reconstructed frame of the current frame obtained in the end is more accurate.
[0209] For example, when the image corresponding to the current frame is a three-dimensional matrix, the predicted feature of the current frame can also be a three-dimensional matrix. Assume that the size of the three-dimensional matrix A is M*N*L, that is, the three-dimensional matrix A includes M*N*L elements, and the value of each element is the eigenvalue corresponding to a feature point in the predicted feature. Correspondingly, the confidence variance matrix C1 includes M*N*L elements, and the value of each element is the confidence variance of the feature point corresponding to the element. According to the confidence variance of each feature point, the blur kernel (also a matrix) of the feature point is determined, and the blur kernel matrix is used to blur the matrix A to obtain the blurred matrix A1; and the residual of the current frame It is also represented by a three-dimensional matrix B, which also includes M*N*L elements. The value of each element is the residual of the feature point corresponding to the element. Therefore, the encoder or decoder determines the reconstructed features of the current frame. Satisfy the formula: Reconstructed features of the current frame
[0210] Figure 13B is a schematic diagram of the confidence variance of the predicted features. Figure 13B (a) shows the previous frame image of the current frame, Figure 13B (b) shows the image of the current frame, and Figure 13B (c) shows a schematic diagram of the confidence of the predicted features of the current frame; wherein, a triangle appears in the black target frame in the image of the current frame, and the triangle does not exist in the previous frame image. Therefore, when the reconstructed frame of the previous frame image is used as the reference frame to determine the predicted features of the current frame, the feature points corresponding to the triangle in the black target frame are predicted to be inaccurate. Therefore, the confidence equation of the predicted feature points corresponding to the triangle is set to a value close to 1. In Figure 13B (c), the confidence variance of the predicted feature points corresponding to the triangle is represented by white.
[0211] To intuitively understand the compression performance improvement effect of Implementation 2, Figure 13C shows the second compression performance comparison chart provided by the embodiment of the present application. In Figure 13C, the image compression performance of the embodiment of the present application is evaluated using the test sequences classB, classC, classD, classE, and classF as the test set. These test sequences vary in resolution, content, etc., and compression performance is evaluated based on four dimensions: BPP-save, Y-delta, U-delta, and V-delta.
[0212] Implementation method 3, please refer to Figure 14, which is a third schematic diagram of the fusion of the prediction features of the current frame and the confidence of the prediction features. The confidence of the above-mentioned prediction features includes a first confidence matrix C1 and a second confidence matrix C2, an element in the first confidence matrix C1 is used to represent the confidence of a feature point in the prediction feature, and an element in the second confidence matrix C2 is used to represent the confidence of a feature point in the feature of the reference frame. In Figure 14, after the code stream is input into the entropy decoding module, the entropy decoding module decodes the code stream to obtain the first feature information; further, the decoding network transforms the first feature information to obtain the residual of the current frame. The first confidence matrix C1 and the second confidence matrix C2; accordingly, the processing module multiplies the first confidence matrix C1 with the prediction feature to obtain the first matrix C1 1 ; And the processing module multiplies the second confidence matrix C2 with the features of the reference frame to obtain a second matrix C2 1 ; The processing module converts the first matrix C1 1 , the second matrix C2 1 , and the residual of the current frame Add together to get the reconstructed features of the current frame The processing module reconstructs the features of the current frame Input to the reconstruction network to obtain the reconstructed frame of the current frame.
[0213] Among them, "multiplying the first confidence matrix by the predicted features to obtain a first matrix" can be understood as multiplying each feature point in the predicted features by a weight coefficient (i.e., confidence), and "multiplying the second confidence matrix by the features of the reference frame to obtain a second matrix" can be understood as multiplying each feature point in the features of the reference frame by a weight coefficient (i.e., confidence). Among them, the predicted features of the current frame are obtained after motion alignment of the reference frame and the current frame, and have a higher prediction accuracy for moving areas and predictable image areas; the features of the reference frame are obtained before motion alignment of the reference frame and the current frame, and have a higher prediction accuracy for static image areas. In this way, by setting a first confidence matrix for the predicted features of the current frame and setting a second confidence matrix for the features of the reference frame, the decoding end can combine the first confidence matrix and the second confidence matrix to determine the reconstructed frame of the current frame, thereby eliminating the coding errors caused by the low accuracy of the reference frame or the low accuracy of the predicted features, so that the reconstructed features of the current frame finally obtained are more accurate.
[0214] For ease of understanding, the encoding method and decoding method of the embodiment of the present application are further introduced below in conjunction with Figure 15.
[0215] Figure 15 is a schematic diagram of the architecture of an end-to-end video codec provided by an embodiment of the present application. The architecture includes a feature extraction network, a motion estimation network, a motion coding network, a motion decoding network, a motion compensation network, a residual coding network, a residual decoding network, and a reconstruction network. The encoding end includes a feature extraction network, a motion estimation network, a motion compensation network, a motion coding network, a feature information coding network, and an entropy coding module, and the decoding end includes an entropy decoding module, a motion decoding network, a feature information decoding network, a processing module, and a reconstruction network. In addition, in Figure 15, motion information is introduced using the optical flow of the feature domain as an example, and the predicted features of the current frame are introduced using the prediction results of the feature domain as an example.
[0216] The encoding process in the end-to-end video encoding architecture is as follows:
[0217] 1) Input the current frame and the reference frame into the feature extraction network to obtain the current frame x t Features F t and reference frame characteristics
[0218] 2) Set the current frame x t Features F t and reference frame characteristics Input motion estimation network to obtain the optical flow O between the current frame and the reference frame in the feature domain t ;
[0219] 3) The optical flow O tInput the motion coding network to get the optical flow coding data
[0220] 4) Entropy coding module encodes the optical flow data Encode to the first stream.
[0221] 5) The features of the reference frame and optical flow O t Input the motion compensation network to obtain the predicted features of the current frame
[0222] 6) The feature F of the current frame t and the predicted features of the current frame Input the feature information encoding network to obtain the first feature information y t .
[0223] 7) The entropy coding module converts the first feature information y t Encode into the first code stream.
[0224] 8) The first feature information y t Input the decoding network and get the residual and the confidence matrix C.
[0225] 9) The processing module is based on the residual and the predicted features of the current frame The reconstruction features of the current frame can be determined
[0226] 10) The processing module reconstructs the features of the current frame Input the reconstruction network to get the reconstructed frame of the current frame
[0227] Correspondingly, the decoding process in this end-to-end video coding architecture is:
[0228] 1) The entropy decoding module decodes the first bit stream to obtain the encoded data of the optical flow
[0229] 2) Encoding the optical flow data Input the motion decoding network to obtain the decoded optical flow O t .
[0230] 3) The features of the reference frame And the decoded optical flow O t Input the motion compensation network to obtain the predicted features of the current frame
[0231] 4) The entropy decoding module decodes the first bit stream to obtain the first feature information y t .
[0232] 5) The first feature information y t Input the decoding network and get the residual and the confidence matrix C.
[0233] 6) The processing module is based on the residual and the predicted features of the current frame The reconstruction features of the current frame can be determined
[0234] 7) The processing module reconstructs the features of the current frame Input the reconstruction network to get the reconstructed frame of the current frame
[0235] The network involved in the embodiment of the present application (such as a feature extraction network, a reconstruction network, etc.) may include an upsampling module, a downsampling module, a ResBlock module, etc. Exemplarily, the reconstruction network of the embodiment of the present application may be as shown in FIG16 , where (a) in FIG16 shows a downsampling module in the network, (b) in FIG16 shows a downsampling module in the network, and (c) in FIG16 shows a ResBlock module composed of a convolution (conv) and an activation function (such as relu, leaky_relu, etc.). It should be understood that FIG16 is only an example, and other network structures that can achieve similar functions may also be used in actual applications.
[0236] Based on the same technical concept, embodiments of the present application also provide an encoding device for implementing the functions of the encoding end in the above method embodiments. The device may include modules / units that execute any possible implementation of the above method embodiments; these modules / units may be implemented in hardware, or hardware may execute corresponding software implementations.
[0237] Exemplarily, as shown in Figure 17, the encoding device 1700 includes an acquisition module 1701 for acquiring multiple image frames; a motion estimation network 1702 for determining motion information of a current frame; wherein the current frame is any image frame among the multiple image frames; an entropy coding module 1703 for encoding the motion information into a bitstream; a motion compensation network 1704 for determining a prediction value of the current frame based on the motion information; a coding network 1705 for obtaining first feature information based on the current frame and the prediction value, wherein the first feature information is related to the residual of the current frame and the confidence of the prediction value; the entropy coding module 1703 is also used to encode the first feature information into the bitstream.
[0238] In one possible implementation, the encoding device 1700 further includes a decoding network 1706 and a processing module 1707; the decoding network is used to obtain the residual of the current frame and the confidence of the predicted value based on the first feature information; the processing module 1707 is used to obtain a reconstructed frame of the current frame based on the predicted value, the residual of the current frame, and the confidence of the predicted value.
[0239] In one possible implementation, when the predicted value is a predicted feature, the confidence of the predicted value includes a confidence matrix, an element in the confidence matrix is used to characterize the confidence of a feature point in the predicted feature, and the elements in the confidence matrix correspond one-to-one to the feature points in the predicted feature; the device also includes a reconstruction network 1708, and the processing module 1707 is specifically used to: multiply the predicted feature and the confidence matrix to obtain a first matrix; add the first matrix to the residual of the current frame to obtain the reconstructed feature of the current frame; and input the reconstructed feature of the current frame into the reconstruction network 1708 to obtain a reconstructed frame of the current frame.
[0240] In one possible implementation, when the predicted value is a predicted feature, the confidence of the predicted value includes a confidence variance matrix; the device also includes a reconstruction network 1708, and the processing module 1707 is specifically used to: calculate the blur kernel of each feature point in the predicted feature according to the confidence variance matrix; based on the blur kernel of each feature point, blur each feature point to obtain a predicted feature after blurring; add the predicted feature after blurring to the residual of the current frame to obtain a reconstructed feature of the current frame; input the reconstructed feature of the current frame into the reconstruction network 1708 to obtain a reconstructed frame of the current frame.
[0241] In one possible embodiment, when the predicted value is a predicted feature, the confidence of the predicted value includes a first confidence matrix and a second confidence matrix, an element in the first confidence matrix is used to represent the confidence of a feature point in the predicted value, and an element in the second confidence matrix is used to represent the confidence of a feature point in the feature of the reference frame of the current frame; the reference frame is a reconstructed frame of any image frame whose decoding order is before the current frame; the device also includes a reconstruction network 1708, and the processing module 1707 is specifically used to: multiply the first confidence matrix with the predicted feature to obtain a first matrix; multiply the second confidence matrix with the feature of the reference frame to obtain a second matrix; add the first matrix, the second matrix, and the residual of the current frame to obtain the reconstructed feature of the current frame; input the reconstructed feature of the current frame into the reconstruction network 1708 to obtain the reconstructed frame of the current frame.
[0242] Based on the same technical concept, embodiments of the present application also provide a decoding device. This device is used to implement the functions of the decoding end in the above method embodiments. The device may include modules / units that execute any possible implementation of the above method embodiments; these modules / units may be implemented in hardware, or hardware may execute corresponding software implementations.
[0243] Exemplarily, the decoding device can be as shown in Figure 18, where the decoding device 1800 includes an acquisition module 1801, which is used to acquire a code stream including encoded data of multiple image frames; an entropy decoding module 1802, which is used to decode the code stream to obtain motion information of a current frame; the current frame is any one of the multiple image frames; a motion compensation network 1803, which is used to obtain a prediction value of the current frame based on the motion information; the entropy decoding module is also used to decode the code stream to obtain first feature information; a decoding network 1804, which is used to obtain a residual of the current frame and a confidence level of the prediction value based on the first feature information; and a processing module 1805, which is used to obtain a reconstructed frame of the current frame based on the prediction value, the residual of the current frame, and the confidence level of the prediction value.
[0244] In one possible implementation, when the predicted value is a predicted feature, the confidence of the predicted value includes a confidence matrix, an element in the confidence matrix is used to represent the confidence of a feature point in the predicted feature, and the elements in the confidence matrix correspond one-to-one to the feature points in the predicted feature; the apparatus further includes a reconstruction network 1806, and the processing module 1805 is specifically configured to:
[0245] Multiply the predicted features and the confidence matrix to obtain a first matrix; add the first matrix to the residual of the current frame to obtain the reconstructed features of the current frame; input the reconstructed features of the current frame into the reconstruction network 1806 to obtain the reconstructed frame of the current frame.
[0246] In one possible implementation, when the predicted value is a predicted feature, the confidence of the predicted value includes a confidence variance matrix; the apparatus further includes a reconstruction network 1806, and the processing module 1805 is specifically configured to:
[0247] According to the confidence variance matrix, a blur kernel of each feature point in the predicted feature is calculated; based on the blur kernel of each feature point, each feature point is blurred to obtain a predicted feature after blurring; the predicted feature after blurring is added to the residual of the current frame to obtain a reconstructed feature of the current frame; the reconstructed feature of the current frame is input into the reconstruction network 1806 to obtain a reconstructed frame of the current frame.
[0248] In one possible implementation, when the predicted value is a predicted feature, the confidence of the predicted value includes a first confidence matrix and a second confidence matrix, wherein an element in the first confidence matrix is used to represent the confidence of a feature point in the predicted feature, and an element in the second confidence matrix is used to represent the confidence of a feature point in a feature of a reference frame of the current frame; the reference frame is a reconstructed frame of any image frame whose decoding order is before the current frame; the apparatus further includes a reconstruction network 1806, and the processing module 1805 is specifically used to:
[0249] Multiply the first confidence matrix by the predicted features to obtain a first matrix; multiply the second confidence matrix by the features of the reference frame to obtain a second matrix; add the first matrix, the second matrix, and the residual of the current frame to obtain the reconstructed features of the current frame; input the reconstructed features of the current frame into the reconstruction network 1806 to obtain the reconstructed frame of the current frame.
[0250] The embodiment of the present application further provides a computer device. The computer device includes a processor 1901 as shown in FIG19 , and a memory 1902 connected to the processor 1901 . Furthermore, the computer device may also include a communication interface 1903 and a communication bus 1904 .
[0251] Processor 1901 can be a general-purpose processor, a microprocessor, an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, or one or more integrated circuits for controlling the execution of the program of the present application. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of the present application can be directly implemented as a hardware processor, or can be implemented by a combination of hardware and software modules in the processor.
[0252] Memory 1902 is used to store program instructions and / or data, so that processor 1901 can call the instructions and / or data stored in memory 1902 to implement the above-mentioned functions of processor 1901. Memory 1902 can be read-only memory (ROM) or other types of static storage devices that can store static information and instructions, random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or electrically erasable programmable read-only memory (EEPROM) or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to these. Memory 1902 can exist independently, such as off-chip memory, connected to processor 1901 via communication bus 1904. Memory 1902 can also be integrated with processor 1901. Memory 1902 can include internal memory and external memory (such as a hard disk).
[0253] The communication interface 1903 is used to communicate with other devices, such as a PCI bus interface, a network card, a radio access network (RAN), a wireless local area network (WLAN), etc.
[0254] The communication bus 1904 may include a pathway for transmitting information between the aforementioned components.
[0255] Exemplarily, the computer device may be the encoding end or the decoding end in FIG8 .
[0256] When the computer device is an encoding end, the processor 1901 may call the instructions in the memory 1902 to perform the following steps:
[0257] Acquire multiple image frames; determine motion information of a current frame; wherein the current frame is any image frame among the multiple image frames; encode the motion information into a bitstream; determine a prediction value of the current frame based on the motion information; obtain first feature information based on the prediction value of the current frame and the current frame, the first feature information being related to a residual of the current frame and a confidence level of the prediction value; and encode the first feature information into the bitstream.
[0258] In addition, the above components can also be used to support other processes performed by the encoding end in the above embodiment. The beneficial effects can be referred to the above description and will not be repeated here.
[0259] When the computer device is a decoding end, the processor 1901 may call the instructions in the memory 1902 to perform the following steps:
[0260] Obtain a code stream including coded data of a plurality of image frames; decode the code stream to obtain motion information of a current frame; the current frame is any one of the plurality of image frames; obtain a prediction value of the current frame based on the motion information; decode the code stream to obtain first feature information; obtain a residual of the current frame and a confidence level of the prediction value based on the first feature information; obtain a reconstructed frame of the current frame based on the prediction value, the residual of the current frame, and the confidence level of the prediction value.
[0261] In addition, the above components can also be used to support other processes executed by the decoding end in the above embodiment. The beneficial effects can be referred to the above description and will not be repeated here.
[0262] Based on the above method embodiment, the embodiment of the present application also provides a code stream, which includes motion information and first feature information of a current frame; wherein the motion information is used to determine the prediction value of the current frame, and the first feature information is related to the residual of the current frame and the confidence of the prediction value.
[0263] Based on the same technical concept, an embodiment of the present application further provides a computer-readable storage medium, in which computer-readable instructions are stored. When the computer-readable instructions are run on a computer, the above method embodiment is executed.
[0264] Based on the same technical concept, an embodiment of the present application further provides a computer program product comprising instructions, which enables any of the above method embodiments to be executed when the computer program product is run on a computer.
[0265] Based on the same technical concept, an embodiment of the present application further provides a computer-readable storage medium, in which a code stream is stored. The code stream is generated according to the encoding method shown in the figure above.
[0266] Based on the same technical concept, an embodiment of the present application further provides a computer-readable storage medium, wherein a code stream is stored in the computer-readable storage medium, and the code stream includes program instructions executable by a decoder, and the program instructions enable the decoder to execute the decoding method in the third aspect and any possible implementation of the third aspect.
[0267] Based on the same technical concept, an embodiment of the present application further provides a decoding system, which includes at least one memory and a decoder, wherein the at least one memory is used to store a code stream, and the decoder is used to execute the decoding method shown in FIG11 .
[0268] Based on the same technical concept, an embodiment of the present application further provides a method for storing a code stream, which includes receiving or generating a code stream and storing the code stream in a storage medium.
[0269] In a possible implementation, the method further includes: performing format conversion processing on the code stream to obtain a format-converted code stream, and storing the format-converted code stream in a storage medium.
[0270] Based on the same technical concept, an embodiment of the present application further provides a method for transmitting a code stream, which includes receiving or generating a code stream, transmitting the code stream to a cloud server, or transmitting the code stream to a mobile terminal.
[0271] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0272] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each flow and / or box in the flow chart and / or block diagram, as well as the combination of the flow chart and / or box in the flow chart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for implementing the functions specified in one or more flow charts and / or one or more boxes in the block diagram.
[0273] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0274] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0275] Obviously, those skilled in the art may make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalents, this application is intended to include these modifications and variations.
Claims
1. A decoding method, characterized in that: The method comprises: Acquire a code stream including coded data of a plurality of image frames; Decoding the code stream to obtain motion information of a current frame; the current frame is any one of the multiple image frames; Obtaining a prediction value of the current frame according to the motion information; Decoding the code stream to obtain first feature information; Obtaining, according to the first feature information, a residual of the current frame and a confidence level of the predicted value; A reconstructed frame of the current frame is obtained according to the predicted value, the residual of the current frame and the confidence of the predicted value.
2. The method according to claim 1, characterized in that When the predicted value is a predicted feature, the confidence of the predicted value includes a confidence matrix, an element in the confidence matrix is used to characterize the confidence of a feature point in the predicted feature, and the elements in the confidence matrix correspond one-to-one to the feature points in the predicted feature; Obtaining a reconstructed frame of the current frame according to the predicted value, the residual of the current frame and the confidence of the predicted value, comprising: Multiplying the prediction feature and the confidence matrix to obtain a first matrix; Adding the first matrix to the residual of the current frame to obtain a reconstructed feature of the current frame; The reconstruction features of the current frame are input into a reconstruction network to obtain a reconstructed frame of the current frame.
3. The method according to claim 1, characterized in that When the predicted value is a predicted feature, the confidence of the predicted value includes a confidence variance matrix; Obtaining a reconstructed frame of the current frame according to the predicted value, the residual of the current frame and the confidence of the predicted value, comprising: Calculating a blur kernel for each feature point in the predicted feature according to the confidence variance matrix; Based on the fuzzy kernel of each feature point, fuzzy process each feature point to obtain a prediction feature after fuzzy process; Adding the predicted feature after blurring to the residual of the current frame to obtain a reconstructed feature of the current frame; The reconstruction features of the current frame are input into a reconstruction network to obtain a reconstructed frame of the current frame.
4. The method according to claim 1, characterized in that: When the predicted value is a predicted feature, the confidence of the predicted value includes a first confidence matrix and a second confidence matrix, an element in the first confidence matrix is used to characterize the confidence of a feature point in the predicted feature, and an element in the second confidence matrix is used to characterize the confidence of a feature point in a feature of a reference frame of the current frame; the reference frame is a reconstructed frame of any image frame whose decoding order is before the current frame; Obtaining a reconstructed frame of the current frame according to the predicted feature, the residual of the current frame, and the confidence of the predicted feature, comprising: Multiplying the first confidence matrix with the predicted feature to obtain a first matrix; multiplying the second confidence matrix with the feature of the reference frame to obtain a second matrix; Adding the first matrix, the second matrix, and the residual of the current frame to obtain a reconstructed feature of the current frame; The reconstruction features of the current frame are input into a reconstruction network to obtain a reconstructed frame of the current frame.
5. A coding method, characterized in that: The method comprises: Acquire multiple image frames; Determine motion information of a current frame; wherein the current frame is any image frame among the multiple image frames; Encoding the motion information into a bit stream; Determining a prediction value of the current frame according to the motion information; Obtaining first feature information according to the current frame and the predicted value, where the first feature information is related to the residual of the current frame and the confidence of the predicted value; The first characteristic information is encoded into the bit stream.
6. The method according to claim 5, characterized in that The method further comprises: Obtaining, according to the first feature information, a residual of the current frame and a confidence level of the predicted value; A reconstructed frame of the current frame is obtained according to the predicted value, the residual of the current frame and the confidence of the predicted value.
7. The method according to claim 6, characterized in that When the predicted value is a predicted feature, the confidence of the predicted value includes a confidence matrix, an element in the confidence matrix is used to characterize the confidence of a feature point in the predicted feature, and the elements in the confidence matrix correspond one-to-one to the feature points in the predicted feature; Obtaining a reconstructed frame of the current frame according to the predicted value, the residual of the current frame and the confidence of the predicted value, comprising: Multiplying the prediction feature and the confidence matrix to obtain a first matrix; Adding the first matrix to the residual of the current frame to obtain a reconstructed feature of the current frame; The reconstruction features of the current frame are input into a reconstruction network to obtain a reconstructed frame of the current frame.
8. The method according to claim 6, characterized in that When the predicted value is a predicted feature, the confidence of the predicted value includes a confidence variance matrix; Obtaining a reconstructed frame of the current frame according to the predicted value, the residual of the current frame and the confidence of the predicted value, comprising: Calculating the fuzzy kernel of each feature point in the prediction feature according to the confidence variance matrix; performing fuzzy processing on each feature point based on the fuzzy kernel of each feature point to obtain the prediction feature after fuzzy processing; Adding the predicted feature after blurring to the residual of the current frame to obtain a reconstructed feature of the current frame; The reconstruction features of the current frame are input into a reconstruction network to obtain a reconstructed frame of the current frame.
9. The method according to claim 6, characterized in that When the predicted value is a predicted feature, the confidence of the predicted value includes a first confidence matrix and a second confidence matrix, an element in the first confidence matrix is used to represent the confidence of a feature point in the predicted value, and an element in the second confidence matrix is used to represent the confidence of a feature point in a feature of a reference frame of the current frame; the reference frame is a reconstructed frame of any image frame whose decoding order is before the current frame; Obtaining a reconstructed frame of the current frame according to the predicted value, the residual of the current frame and the confidence of the predicted value, comprising: Multiplying the first confidence matrix with the predicted feature to obtain a first matrix; multiplying the second confidence matrix with the feature of the reference frame to obtain a second matrix; Adding the first matrix, the second matrix, and the residual of the current frame to obtain a reconstructed feature of the current frame; The reconstruction features of the current frame are input into a reconstruction network to obtain a reconstructed frame of the current frame.
10. A decoding device, characterized in that: The device comprises: An acquisition module, used for acquiring a code stream including coded data of a plurality of image frames; An entropy decoding module, used for decoding the code stream to obtain motion information of a current frame; the current frame is any one of the multiple image frames; A motion compensation network, used to obtain a prediction value of the current frame according to the motion information; The entropy decoding module is further used to decode the bit stream to obtain the first feature information; A decoding network, used for obtaining the residual of the current frame and the confidence of the predicted value according to the first feature information; A processing module is used to obtain a reconstructed frame of the current frame according to the predicted value, the residual of the current frame and the confidence of the predicted value.
11. The device according to claim 10, characterized in that When the predicted value is a predicted feature, the confidence of the predicted value includes a confidence matrix, an element in the confidence matrix is used to characterize the confidence of a feature point in the predicted feature, and the elements in the confidence matrix correspond one-to-one to the feature points in the predicted feature; The device also includes a reconstruction network, and the processing module is specifically used for: Multiplying the prediction feature and the confidence matrix to obtain a first matrix; Adding the first matrix to the residual of the current frame to obtain a reconstructed feature of the current frame; The reconstruction features of the current frame are input into the reconstruction network to obtain a reconstructed frame of the current frame.
12. The device according to claim 10, characterized in that When the predicted value is a predicted feature, the confidence of the predicted value includes a confidence variance matrix; The device also includes a reconstruction network, and the processing module is specifically used for: Calculating a blur kernel for each feature point in the predicted feature according to the confidence variance matrix; Based on the blur kernel of each feature point, blurring each feature point to obtain a predicted feature after blurring; adding the predicted feature after blurring to the residual of the current frame to obtain a reconstructed feature of the current frame; The reconstruction features of the current frame are input into the reconstruction network to obtain a reconstructed frame of the current frame.
13. The device according to claim 10, characterized in that When the predicted value is a predicted feature, the confidence of the predicted value includes a first confidence matrix and a second confidence matrix, an element in the first confidence matrix is used to characterize the confidence of a feature point in the predicted feature, and an element in the second confidence matrix is used to characterize the confidence of a feature point in a feature of a reference frame of the current frame; the reference frame is a reconstructed frame of any image frame whose decoding order is before the current frame; The device also includes a reconstruction network, and the processing module is specifically used for: Multiplying the first confidence matrix by the prediction feature to obtain a first matrix; Multiplying the second confidence matrix by the features of the reference frame to obtain a second matrix; Adding the first matrix, the second matrix, and the residual of the current frame to obtain a reconstructed feature of the current frame; The reconstruction features of the current frame are input into the reconstruction network to obtain a reconstructed frame of the current frame.
14. A coding device, characterized in that: The device comprises: An acquisition module, used for acquiring multiple image frames; A motion estimation network, used to determine motion information of a current frame; wherein the current frame is any one of the multiple image frames; An entropy coding module, used for encoding the motion information into a bit stream; A motion compensation network, used to determine a prediction value of the current frame according to the motion information; An encoding network, configured to obtain first feature information according to the current frame and the predicted value, wherein the first feature information is related to a residual of the current frame and a confidence level of the predicted value; The entropy coding module is further used to encode the first feature information into the bit stream.
15. The device according to claim 14, characterized in that The apparatus also includes a decoding network and a processing module; The decoding network is used to obtain the residual of the current frame and the confidence of the predicted value according to the first feature information; The processing module is used to obtain a reconstructed frame of the current frame according to the predicted value, the residual of the current frame and the confidence of the predicted value.
16. The device according to claim 15, characterized in that When the predicted value is a predicted feature, the confidence of the predicted value includes a confidence matrix, an element in the confidence matrix is used to characterize the confidence of a feature point in the predicted feature, and the elements in the confidence matrix correspond one-to-one to the feature points in the predicted feature; The device also includes a reconstruction network, and the processing module is specifically used for: Multiplying the predicted features and the confidence matrix to obtain a first matrix; adding the first matrix to the residual of the current frame to obtain a reconstructed feature of the current frame; The reconstruction features of the current frame are input into the reconstruction network to obtain a reconstructed frame of the current frame.
17. The device according to claim 15, characterized in that When the predicted value is a predicted feature, the confidence of the predicted value includes a confidence variance matrix; The device also includes a reconstruction network, and the processing module is specifically used for: Calculating a blur kernel for each feature point in the predicted feature according to the confidence variance matrix; Based on the fuzzy kernel of each feature point, fuzzy process each feature point to obtain a prediction feature after fuzzy process; Adding the predicted feature after blurring to the residual of the current frame to obtain a reconstructed feature of the current frame; The reconstruction features of the current frame are input into the reconstruction network to obtain a reconstructed frame of the current frame.
18. The device according to claim 15, characterized in that When the predicted value is a predicted feature, the confidence of the predicted value includes a first confidence matrix and a second confidence matrix, an element in the first confidence matrix is used to represent the confidence of a feature point in the predicted value, and an element in the second confidence matrix is used to represent the confidence of a feature point in a feature of a reference frame of the current frame; the reference frame is a reconstructed frame of any image frame whose decoding order is before the current frame; The device also includes a reconstruction network, and the processing module is specifically used for: Multiplying the first confidence matrix by the prediction feature to obtain a first matrix; Multiplying the second confidence matrix by the features of the reference frame to obtain a second matrix; Adding the first matrix, the second matrix, and the residual of the current frame to obtain a reconstructed feature of the current frame; The reconstruction features of the current frame are input into the reconstruction network to obtain a reconstructed frame of the current frame.
19. A code stream, characterized in that: The code stream includes motion information of a current frame and first feature information; wherein the motion information is used to determine a prediction value of the current frame, and the first feature information is related to a residual of the current frame and a confidence level of the prediction value.
20. A decoder, characterized in that: include: one or more processors; A computer-readable storage medium is coupled to the one or more processors, wherein the computer-readable storage medium stores a program, wherein when the program is executed by the one or more processors, the decoder performs the method according to any one of claims 1 to 4.
21. An encoder, characterized in that: include: one or more processors; A computer-readable storage medium, coupled to the one or more processors, wherein the computer-readable storage medium stores a program, wherein when the program is executed by the one or more processors, the encoder performs the method according to any one of claims 5 to 9.
22. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed on a computer, the computer is enabled to execute the method according to any one of claims 1 to 4 or claims 5 to 9.
23. A computer-readable storage medium, characterized in that: The storage medium stores a code stream, which is generated by the method according to any one of claims 5 to 9.
24. A computer-readable storage medium, characterized in that: A code stream containing program codes is stored, and when the program codes are executed by one or more processors, the decoder executes the method according to any one of claims 1 to 4.
25. A computer program product, characterized in that The method comprises a program code, which is used to execute the method according to any one of claims 1 to 4, or the method according to any one of claims 5 to 9 when the program code is executed on a computer or a processor.
Citation Information
Patent Citations
Method and device for controlling error float in image coding and decoding
CN101166281A
Inverse quantization / inverse transform-based lossless compression and decoding method
CN109495745A
Multi-reference inter-frame prediction method and system, equipment and storage medium
CN113938687A
Method and apparatus for image coding / decoding using weighted prediction
KR1020140020340A
