Loop filtering method and device

By using neural networks for loop filtering in video coding technology, and combining the pixel matrix of brightness values ​​and quantization step values, the problem of uneven filtering effects on images of different qualities is solved, achieving more efficient video compression and image quality improvement. .

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

Patent Information

Application Number
CN202410825652.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2020-06-10
Filing Date
2020-09-27
Publication Date
2024-09-20

AI Technical Summary

Technical Problem

When existing video coding technology processes reconstructed images of different qualities, it is difficult to achieve a balanced filtering effect, affecting the video compression rate and image quality.

Method used

The loop filtering method based on neural network is used to obtain the pixel matrix of the brightness value and quantization step value of the reconstructed image block, perform filtering network processing, improve the filtering effect, and perform matrix normalization and denormalization when necessary. to optimize computing efficiency.

Benefits of technology

It improves the filtering effect of reconstructed images of different qualities, improves the video compression rate and image quality, and is suitable for video data of various qualities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118678104A
    Figure CN118678104A
Patent Text Reader

Abstract

The invention provides a loop filtering method and device. Relates to the technical field of video or image compression based on artificial intelligence (AI), in particular to the technical field of video compression based on a neural network. The method comprises the following steps: acquiring a first pixel matrix, wherein the value of a pixel point at a corresponding position in the first pixel matrix corresponds to the brightness value of a pixel at a corresponding position in a first image block; obtaining a second pixel matrix, wherein a pixel point at a corresponding position in the second pixel matrix corresponds to a quantization step value corresponding to a brightness value of a pixel at a corresponding position in the first image block; the input pixel matrix is filtered through a filtering network to obtain an output pixel matrix, the filtering network is a neural network which is obtained through training and has a filtering function, the output pixel matrix comprises a third pixel matrix, and the input pixel matrix is at least related to the first pixel matrix and the second pixel matrix. According to the invention, the filtering effect can be improved for reconstructed images with various qualities.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the invention patent application with application number 202011036512.5 submitted to the China Patent Office, application date September 27, 2020, and invention name “Loop Filtering Method and Device”. Technical Field

[0002] The embodiments of the present invention relate to the field of video or image compression technology based on artificial intelligence (AI), and in particular to a loop filtering method and device. Background Art

[0003] Video coding (video encoding and decoding) is widely used in digital video applications such as broadcast digital television, video transmission over the Internet and mobile networks, real-time conversation applications such as video chat and video conferencing, DVD and Blu-ray Discs, video content acquisition and editing systems, and security applications in camcorders.

[0004] Even in the case of short films, large amounts of video data are required to describe them, which can create difficulties when the data is to be sent or otherwise transmitted across networks with limited bandwidth capacity. Therefore, video data is often compressed before being transmitted across modern telecommunications networks. The size of the video can also be an issue when storing the video on a storage device, as memory resources may be limited. Video compression devices typically use software and / or hardware on the source side to encode the video data prior to transmission or storage, thereby reducing the amount of data required to represent the digital video image. The compressed data is then received by a video decompression device on the destination side. With limited network resources and the growing demand for higher video quality, there is a need for improved compression and decompression techniques that can increase compression rates with little to no impact on image quality.

[0005] In recent years, the application of deep learning in the field of image and video coding and decoding has gradually become a trend. In video encoders and video decoders using hybrid architectures, the coding distortions such as block effects and ringing effects in the reconstructed image can be removed by the loop filtering module. In the related art, the filtering function of the loop filtering module is realized by using a neural network, and then the reconstructed image or reconstructed image block information input to the neural network is filtered to obtain a filtered reconstructed image or reconstructed image block. However, this method cannot achieve good filtering effects for input images or image blocks of different qualities. Summary of the invention

[0006] The present application provides a loop filtering method and device, which can improve the filtering effect for reconstructed images of various qualities.

[0007] The above and other objects are achieved by the subject matter of the independent claims. Further implementations are apparent from the dependent claims, the detailed description and the drawings.

[0008] Specific embodiments are outlined in the attached independent claims, further embodiments are outlined in the dependent claims.

[0009] In a first aspect, the present application relates to a loop filtering method. The method is performed by a loop filter in an encoder or a decoder. The method comprises:

[0010] A first pixel matrix is ​​obtained, wherein elements at corresponding positions in the first pixel matrix correspond to (for example, represent) brightness values ​​of pixels at corresponding positions in a first image block, and the first image block is a reconstructed image block or an image block in a reconstructed image; a second pixel matrix is ​​obtained, wherein elements at corresponding positions in the second pixel matrix correspond to (for example, represent) quantization step values ​​corresponding to brightness values ​​of pixels at corresponding positions in the first image block, and the size of the second pixel matrix is ​​equal to the size of the first pixel matrix; an output pixel matrix is ​​obtained by filtering an input pixel matrix through a filtering network, wherein the filtering network is a trained neural network with filtering function, and the output pixel matrix includes a third pixel matrix, wherein elements at corresponding positions in the third pixel matrix correspond to brightness values ​​of pixels at corresponding positions in a second image block or brightness residual values ​​of pixels, and the second image block is an image block obtained after filtering the first image block, wherein the input pixel matrix is ​​at least related to the first pixel matrix and the second pixel matrix.

[0011] An image block (e.g., the first image block) can be understood as a pixel matrix X, and the elements at corresponding positions in the pixel matrix X can be understood as the pixels at corresponding positions in the image block (or pixel values, for example, the pixel values ​​include the brightness value of the pixel or the chromaticity value of the pixel). Exemplarily, the size of the image block is 64×64, indicating that the pixel points of the image block are distributed as 64 rows×64 columns, and x(i,j) represents the pixel point (or pixel value) at the i-th row and j-th column in the image block. Correspondingly, the input pixel matrix A includes 64 rows and 64 columns, with a total of 64×64 elements, and A(i,j) represents the element at the i-th row and j-th column in the pixel matrix A. A(i,j) corresponds to x(i,j) (for example, A(i,j) represents the value of pixel x(i,j)), and the elements at corresponding positions in the input pixel matrix A correspond to (for example, represent) the brightness value of the pixel at the corresponding position in the image block, that is, the value of the element A(i,j) is the brightness value of the pixel x(i,j). Optionally, in another example, the elements at corresponding positions in the input pixel matrix A may also correspond to (for example, represent) other values ​​of the pixels at corresponding positions in the image block, that is, the value of the element A(i,j) may be other values ​​of the pixel x(i,j), such as the quantization step value corresponding to the brightness value of the pixel x(i,j), the chrominance value of the pixel x(i,j), the quantization step value corresponding to the chrominance value of the pixel x(i,j), the brightness residual value of the pixel x(i,j), the chrominance residual value of the pixel x(i,j), etc., and this application does not make specific limitations on this. It should be understood that when the elements at corresponding positions in the input pixel matrix A represent the brightness values ​​of the pixels at corresponding positions in the image block, the input pixel matrix A is an example of the aforementioned first pixel matrix; or, when the elements at corresponding positions in the input pixel matrix A represent the quantization step values ​​corresponding to the brightness values ​​of the pixels at corresponding positions in the image block, the input pixel matrix A is an example of the aforementioned second pixel matrix; it should be understood that when the elements at corresponding positions in the input pixel matrix A represent the chrominance values ​​of the pixels at corresponding positions in the image block, the input pixel matrix A is an example of the fifth pixel matrix; or, when the elements at corresponding positions in the input pixel matrix A represent the quantization step values ​​corresponding to the chrominance values ​​of the pixels at corresponding positions in the image block, the input pixel matrix A is an example of the sixth pixel matrix.

[0012] Similarly, the output pixel matrix B output by the filtering network corresponds to the filtered image block (e.g., the second image block), that is, the element B(i,j) in the output pixel matrix corresponds to the pixel y(i,j) in the filtered image block. In one example, the value of the element B(i,j) can represent the brightness value of the pixel y(i,j). Optionally, in another example, the elements at corresponding positions in the pixel matrix B can also correspond to (e.g., represent) other values ​​of the pixels at corresponding positions in the filtered image block, that is, the value of the element B(i,j) can be other values ​​of the pixel y(i,j), such as the brightness residual value of the pixel y(i,j), the chromaticity value of the pixel y(i,j), the chromaticity residual value of the pixel y(i,j), etc., and this application does not make specific limitations on this. It should be understood that when the elements at corresponding positions in the output pixel matrix B represent the brightness values ​​of the pixels at corresponding positions in the filtered image block, the output pixel matrix B is an example of the third pixel matrix; or, when the elements at corresponding positions in the output pixel matrix B represent the brightness residual values ​​of the pixels at corresponding positions in the filtered image block, the output pixel matrix B is another example of the third pixel matrix; it should be understood that when the elements at corresponding positions in the output pixel matrix B represent the chrominance values ​​of the pixels at corresponding positions in the filtered image block, the output pixel matrix B is an example of the seventh pixel matrix; or, when the elements at corresponding positions in the output pixel matrix B represent the chrominance residual values ​​of the pixels at corresponding positions in the filtered image block, the output pixel matrix B is an example of the eighth pixel matrix.

[0013] The first image block may be an image block in a reconstructed image reconstructed by an encoder or a decoder, or may be a reconstructed image block reconstructed by an encoder or a decoder. The loop filtering method of the embodiment of the present application includes but is not limited to filtering the reconstructed image block. It should be understood that it can also be applied to filtering the reconstructed image, that is, the "reconstructed image block" in the method of the embodiment of the present application is adaptively replaced with the reconstructed image, which will not be repeated here.

[0014] It should be noted that the first image block and the second image block can also adopt the RGB format. In this case, the elements at corresponding positions in the first pixel matrix can correspond to (for example, represent) the R value, G value or B value of the pixel at the corresponding position in the first image block, and the elements at corresponding positions in the second pixel matrix can correspond to (for example, represent) the quantization step value corresponding to the R value, G value or B value of the pixel at the corresponding position in the first image block, or the quantization step value commonly used by the three.

[0015] The present application uses a filtering network to implement filtering and introduces a quantization step value for each pixel of the reconstructed image block, so as to better filter the pixel matrix corresponding to the image block input to the filtering network and improve the filtering effect.

[0016] In a possible implementation, the input pixel matrix includes the first pixel matrix and the second pixel matrix; or, the input pixel matrix is ​​a first preprocessed matrix obtained by preprocessing the first pixel matrix and the second pixel matrix; or, the input pixel matrix includes a normalized matrix of the first pixel matrix and a normalized matrix of the second pixel matrix; or, the input pixel matrix is ​​a second preprocessed matrix obtained by preprocessing the normalized matrix of the first pixel matrix and the normalized matrix of the second pixel matrix. The normalized matrix refers to a matrix obtained by normalizing the values ​​of the elements at the corresponding positions in the corresponding matrix.

[0017] The input pixel matrix is ​​a processing object of the filter network, and the input pixel matrix may include the acquired first pixel matrix and second pixel matrix, that is, the two pixel matrices are directly input into the filter network for filtering processing.

[0018] Before being input into the filter network, the input pixel matrix may also be a pixel matrix obtained by preprocessing and / or normalizing one or more pixel matrices according to the training data form of the filter network during training and the processing capacity of the filter network. The purpose of the normalization process is to adjust the value of the element to a unified value interval, such as [0,1] or [-0.5,0.5], so that the operation efficiency can be improved in the calculation of the filter network. The preprocessing may include matrix addition, matrix multiplication, matrix merging (contact), etc., which can reduce the amount of calculation of the filter network. Therefore, the input pixel matrix may include a normalized matrix of the first pixel matrix and a normalized matrix of the second pixel matrix, that is, the first pixel matrix and the second pixel matrix are normalized respectively, and then the normalized matrices are input into the filter network for processing. Alternatively, the input pixel matrix may be a preprocessed matrix obtained by adding, multiplying or merging the first pixel matrix and the second pixel matrix. Alternatively, the input pixel matrix may be a preprocessed matrix obtained by adding, multiplying or merging the normalized matrix of the first pixel matrix and the normalized matrix of the second pixel matrix.

[0019] Matrix addition means adding the values ​​of the elements in the corresponding positions of two matrices. Matrix multiplication means multiplying the values ​​of the elements in the corresponding positions of two matrices. Matrix merging (contact) means increasing the number of channels of the matrices. For example, if one matrix is ​​a two-dimensional matrix with a size of m×n and the other matrix is ​​also a two-dimensional matrix with a size of m×n, the two matrices are combined to obtain a three-dimensional matrix with a size of m×n×2.

[0020] In a possible implementation manner, the elements at corresponding positions in the third pixel matrix represent brightness values ​​of pixels at corresponding positions in the second image block.

[0021] In one possible implementation, the elements at corresponding positions in the third pixel matrix represent the brightness residual values ​​of the pixels at corresponding positions in the second image block; the method also includes: adding the values ​​of the elements at corresponding positions in the first pixel matrix and the third pixel matrix to obtain a fourth pixel matrix, and the elements at corresponding positions in the fourth pixel matrix correspond to (for example, represent) the brightness values ​​of the pixels at corresponding positions in the second image block.

[0022] According to the training data form of the filter network during training and the processing capability of the filter network, the elements in the third pixel matrix outputted from the filter network can represent two meanings, one of which is the brightness value of the pixel corresponding to the corresponding position in the second image block, that is, the filter network can directly output the third pixel matrix representing the brightness value of the second image block after filtering; the other is the brightness residual value of the pixel corresponding to the position in the second image block, that is, the filter network outputs the third pixel matrix representing the residual value of the brightness of the second image block after filtering, and at this time, the third pixel matrix needs to be further processed to obtain the fourth pixel matrix of the brightness value of the second image block after filtering, and the processing is to add the first pixel matrix representing the brightness value of the unfiltered first image block and the third pixel matrix representing the brightness residual value of the second image block after filtering, so as to obtain the fourth pixel matrix representing the brightness value of the second image block after filtering. In this way, there is no specific limitation on the filter network, which may be that there are more possibilities for the filter network.

[0023] In a possible implementation manner, when the input pixel matrix is ​​a normalized matrix, the method further includes: performing a denormalization process on the values ​​of the elements at corresponding positions in the third pixel matrix.

[0024] In a possible implementation, when the input pixel matrix is ​​normalized, adding the values ​​of the elements at corresponding positions in the first pixel matrix and the third pixel matrix to obtain a fourth pixel matrix includes: adding the values ​​of the elements at corresponding positions in the first pixel matrix and the third pixel matrix that has been denormalized to obtain the fourth pixel matrix.

[0025] As mentioned above, if the matrix is ​​normalized before being input into the filter network, the values ​​of all elements in the matrix are normalized to the same interval, which is to improve the operation efficiency, but the value of the element can no longer represent the meaningful value of the pixel at the corresponding position in the image block. Therefore, in order to adapt to the subsequent image processing process, after the filter network outputs the matrix, the matrix needs to be denormalized to restore the meaning represented by the elements in the matrix.

[0026] In a possible implementation, the method further includes: obtaining a fifth pixel matrix, wherein the elements at corresponding positions in the fifth pixel matrix correspond to (for example, represent) the chromaticity values ​​of the pixels at corresponding positions in the first image block; accordingly, the input pixel matrix is ​​at least related to the first pixel matrix, the second pixel matrix, and the fifth pixel matrix. In a possible implementation, the input pixel matrix includes the first pixel matrix, the second pixel matrix, and the fifth pixel matrix; or, the input pixel matrix includes a first preprocessing matrix obtained by preprocessing the first pixel matrix and the second pixel matrix, and the fifth pixel matrix; or, the input pixel matrix includes a normalized matrix of the first pixel matrix, a normalized matrix of the second pixel matrix, and a normalized matrix of the fifth pixel matrix; or, the input pixel matrix includes a second preprocessing matrix obtained by preprocessing the normalized matrix of the first pixel matrix and the normalized matrix of the second pixel matrix, and a normalized matrix of the fifth pixel matrix.

[0027] In addition to the two pixel matrices representing the brightness value of the pixels in the first image block and the quantization step value corresponding to the brightness value, the present application can also add the chromaticity value representing the pixels in the first image block as a reference factor for filtering in the filtering network. The brightness value and chromaticity value of the pixels in the first image block are correlated, so when filtering, the brightness value and chromaticity value of the pixels can play an auxiliary filtering effect on each other. Therefore, when training the filtering network, the chromaticity matrix of the image block is added to the training data, so that the filtering network can refer to the chromaticity information again when filtering to improve the filtering effect. Therefore, the present application can also add the factor of the fifth pixel matrix representing the chromaticity value of the pixels in the first image block to the input pixel matrix. The specific content and acquisition method of the input pixel matrix can be found in the above description, which will not be repeated here.

[0028] In a possible implementation, the method also includes: obtaining a sixth pixel matrix, the elements at corresponding positions in the sixth pixel matrix correspond to (for example, represent) quantization step values ​​corresponding to the chrominance values ​​of pixels at corresponding positions in the first image block; accordingly, the input pixel matrix is ​​at least related to the first pixel matrix, the second pixel matrix, the fifth pixel matrix and the sixth pixel matrix.

[0029] In addition to the three pixel matrices representing the brightness value of the pixels in the first image block, the quantization step value corresponding to the brightness value, and the chrominance value, the present application can also add the quantization step corresponding to the chrominance value of the pixels in the first image block to the filtering network as a reference factor for filtering. When training the filtering network, the quantization step matrix corresponding to the chrominance value of the image block is added to the training data, so that the filtering network can further refine the filtering function of the neural network based on the quantization step matrix during filtering to achieve a more accurate filtering effect. Therefore, the present application can also add the factor of the sixth pixel matrix of the quantization step value corresponding to the chrominance value of the pixels in the first image block to the input pixel matrix. The specific content and acquisition method of the input pixel matrix can be found in the above description, which will not be repeated here.

[0030] In a possible implementation, the input pixel matrix includes the first pixel matrix, the second pixel matrix, the fifth pixel matrix and the sixth pixel matrix; or, the input pixel matrix includes a first preprocessing matrix obtained by preprocessing the first pixel matrix and the second pixel matrix, the fifth pixel matrix and the sixth pixel matrix; or, the input pixel matrix includes the first pixel matrix, the second pixel matrix and a third preprocessing matrix obtained by preprocessing the fifth pixel matrix and the sixth pixel matrix; or, the input pixel matrix includes the first preprocessing matrix and the third preprocessing matrix; or, the input pixel matrix includes a normalized matrix of the first pixel matrix, the first pixel matrix, and the third preprocessing matrix. The input pixel matrix comprises a normalized matrix of the first pixel matrix and a normalized matrix of the second pixel matrix, a normalized matrix of the fifth pixel matrix and a normalized matrix of the sixth pixel matrix; or, the input pixel matrix comprises a second preprocessed matrix obtained by preprocessing the normalized matrix of the first pixel matrix and the normalized matrix of the second pixel matrix, a normalized matrix of the fifth pixel matrix and a normalized matrix of the sixth pixel matrix; or, the input pixel matrix comprises the normalized matrix of the first pixel matrix, the normalized matrix of the second pixel matrix and a fourth preprocessed matrix obtained by preprocessing the normalized matrix of the fifth pixel matrix and the normalized matrix of the sixth pixel matrix; or, the input pixel matrix comprises the second preprocessed matrix and the fourth preprocessed matrix.

[0031] Similarly, with the chrominance information, the quantization step value corresponding to the chrominance value can be added when training the filter network. Therefore, the present application can also add the sixth pixel matrix factor representing the quantization step value corresponding to the chrominance value of the pixel in the first image block to the input pixel matrix. The specific content and acquisition method of the input pixel matrix can also be referred to the above description, which will not be repeated here.

[0032] In one possible implementation, filtering the input pixel matrix through a filtering network to obtain an output pixel matrix includes: filtering the input pixel matrix through the filtering network to obtain a third pixel matrix and a seventh pixel matrix, wherein the elements at corresponding positions in the seventh pixel matrix correspond to (for example, represent) the chromaticity values ​​of the pixels at corresponding positions in the second image block.

[0033] With the fifth pixel matrix representing the chrominance values ​​of the pixels in the first image block, and even with the sixth pixel matrix representing the quantization step values ​​corresponding to the chrominance values ​​of the pixels in the first image block, the filtering network can be trained to have a seventh pixel matrix whose filtering output is used to represent the chrominance values ​​of the pixels in the second image block after filtering. In this way, the filtering network can filter the brightness component and the chrominance component of the first image block respectively, thereby realizing filtering processing of the first image block in different dimensions.

[0034] In a possible implementation manner, when the input pixel matrix is ​​a normalized matrix, the method further includes: performing a denormalization process on the values ​​of the elements at corresponding positions in the seventh pixel matrix.

[0035] The principle of the denormalization process is similar to the denormalization process of the third pixel matrix described above, and will not be described in detail here.

[0036] In a possible implementation, filtering the input pixel matrix through a filtering network to obtain a third pixel matrix includes: filtering the input pixel matrix through the filtering network to obtain a third pixel matrix and an eighth pixel matrix, wherein the elements at corresponding positions in the eighth pixel matrix correspond to (for example, represent) the chrominance residual values ​​of the pixels at corresponding positions in the second image block; and adding the values ​​of the elements at corresponding positions in the fifth pixel matrix and the eighth pixel matrix to obtain a ninth pixel matrix, wherein the elements at corresponding positions in the ninth pixel matrix correspond to (for example, represent) the chrominance values ​​of the pixels at corresponding positions in the second image block.

[0037] In a possible implementation, when the input pixel matrix is ​​a normalized matrix, the method further includes: performing inverse normalization processing on the values ​​of the elements at corresponding positions in the eighth pixel matrix; accordingly, adding the values ​​of the elements at corresponding positions in the fifth pixel matrix and the eighth pixel matrix to obtain a ninth pixel matrix includes: adding the values ​​of the elements at corresponding positions in the fifth pixel matrix and the inverse normalized eighth pixel matrix to obtain the ninth pixel matrix.

[0038] Similarly, the filtering network can output a third pixel matrix representing the luminance residual value of the second image block, or it can output an eighth pixel matrix representing the chrominance residual value of the second image block. The subsequent processing of outputting the eighth pixel matrix is ​​similar to the subsequent processing of the third pixel matrix, and will not be repeated here.

[0039] In a possible implementation, the preprocessing includes: adding elements at corresponding positions in the two matrices; or merging the two matrices in the depth direction; or multiplying elements at corresponding positions in the two matrices.

[0040] In a possible implementation, the method further includes: obtaining a training matrix set, wherein the training matrix set includes a pre-filtering brightness matrix (i.e., an unfiltered brightness matrix), a quantization step matrix, and a post-filtering brightness matrix (i.e., a filtered brightness matrix) of multiple image blocks, the elements at corresponding positions in the pre-filtering brightness matrix correspond to (for example, represent) the pre-filtering brightness value of the pixel at the corresponding position in the corresponding image block, the elements at corresponding positions in the quantization step matrix correspond to (for example, represent) the quantization step value corresponding to the brightness value of the pixel at the corresponding position in the corresponding image block, and the elements at corresponding positions in the post-filtering brightness matrix correspond to (for example, represent) the post-filtering brightness value of the pixel at the corresponding position in the corresponding image block; and the filtering network is obtained by training according to the training matrix set.

[0041] In one possible implementation, the training matrix set also includes a pre-filtering chromaticity matrix (i.e., an unfiltered chromaticity matrix) and a post-filtering chromaticity matrix (i.e., a filtered chromaticity matrix) of the multiple image blocks, wherein the elements at corresponding positions in the pre-filtering chromaticity matrix correspond to (for example, represent) the pre-filtering chromaticity values ​​of the pixels at corresponding positions in the corresponding image blocks, and the elements at corresponding positions in the post-filtering chromaticity matrix correspond to (for example, represent) the post-filtering chromaticity values ​​of the pixels at corresponding positions in the corresponding image blocks.

[0042] As described above, as a neural network, the filter network's required input, implemented functions, and obtainable outputs are all related to the training data in the training phase. In this application, the training data is the above-mentioned training matrix set.

[0043] In a possible implementation, the filtering network includes at least a convolutional layer and an activation layer.

[0044] In a possible implementation, the depth of the convolution kernel of the convolution layer is 2, 3, 4, 5, 6, 16, 24, 32, 48, 64 or 128; the size of the convolution kernel in the convolution layer is 1×1, 3×3, 5×5 or 7×7. For example, the size of a convolution layer is 3×3×2×10, where 3×3 represents the size of the convolution kernel in the convolution layer; 2 represents the depth of the convolution kernel contained in the convolution layer, and the number of data channels input to the convolution layer is consistent with the depth of the convolution kernel contained in the convolution layer, that is, the number of data channels input to the convolution layer is also 2; 10 represents the number of convolution kernels contained in the convolution layer, and the number of data channels output from the convolution layer is consistent with the number of convolution kernels contained in the convolution layer, that is, the number of data channels output from the convolution layer is also 10.

[0045] In a possible implementation, the filtering network includes a convolutional neural network CNN, a deep neural network DNN, or a recurrent neural network RNN.

[0046] In a second aspect, the present application provides an encoder, comprising a processing circuit, for executing the method according to any one of the above-mentioned first aspects.

[0047] In a third aspect, the present application provides a decoder, comprising a processing circuit, for executing the method described in any one of the first aspects above.

[0048] In a fourth aspect, the present application provides a computer program product, comprising a program code, which, when executed on a computer or a processor, is used to execute any of the methods described in the first aspect above.

[0049] In a fifth aspect, the present application provides an encoder comprising: one or more processors; a non-transitory computer-readable storage medium, coupled to the processor and storing a program executed by the processor, wherein when the program is executed by the processor, the decoder executes the method described in any one of the first aspects above.

[0050] In a sixth aspect, the present application provides a decoder comprising: one or more processors; a non-transitory computer-readable storage medium, coupled to the processor and storing a program executed by the processor, wherein when the program is executed by the processor, the encoder executes the method described in any one of the first aspects above.

[0051] In a seventh aspect, the present application provides a non-transitory computer-readable storage medium, comprising a program code, which, when executed by a computer device, is used to execute the method described in any one of the first aspects above.

[0052] In an eighth aspect, the present invention relates to a decoding device, and the beneficial effects can be found in the description of the first aspect and will not be repeated here. The decoding device has the function of implementing the behavior in the method embodiment of the first aspect. The function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions. In one possible design, the decoding device includes: a reconstruction module for obtaining a first pixel matrix; a quantization module for obtaining a second pixel matrix; and a loop filtering module for implementing the method described in any one of the first aspects. These modules can perform the corresponding functions in the method example of the first aspect, and refer to the detailed description in the method example for details, which will not be repeated here.

[0053] One or more embodiments will be described in detail in the drawings and the following description. Other features, objects, and advantages will be apparent from the description, drawings, and claims. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] The following is an introduction to the drawings used in the embodiments of the present application.

[0055] Figure 1A A block diagram of an example of a video decoding system for implementing an embodiment of the present invention, wherein the system uses a neural network to encode or decode a video image;

[0056] Figure 1B A block diagram of another example of a video decoding system for implementing an embodiment of the present invention, wherein the video encoder and / or the video decoder uses a neural network to encode or decode a video image;

[0057] Figure 2 is a block diagram of an example of a video encoder for implementing an embodiment of the present invention, wherein the video encoder 20 uses a neural network to encode video images;

[0058] Figure 3 is a block diagram of an example of a video decoder for implementing an embodiment of the present invention, wherein the video decoder 30 uses a neural network to decode video images;

[0059] Figure 4 is a schematic block diagram of a video decoding device for implementing an embodiment of the present invention;

[0060] Figure 5 A schematic block diagram of a video decoding device for implementing an embodiment of the present invention

[0061] Figure 6a-6c is a schematic diagram of a matrix of an input filter network of an embodiment of the present application;

[0062] Figure 7a-7eis a schematic diagram of a trained neural network introduced into a loop filtering module provided in an embodiment of the present application;

[0063] Figure 8 is a flow chart showing a process 800 of a loop filtering method according to an embodiment of the present application;

[0064] Figure 9a-9l Several illustrative examples of input pixel matrices for the filter network are shown;

[0065] Fig.10 FIG. 1 is a schematic diagram showing the structure of a decoding device 1000 according to an embodiment of the present application. DETAILED DESCRIPTION

[0066] The embodiments of the present application provide an AI-based video image compression technology, and in particular, provide a neural network-based video compression technology, and specifically provide a neural network-based filtering technology to improve the traditional hybrid video encoding and decoding system.

[0067] Video coding generally refers to processing a sequence of images that form a video or video sequence. In the field of video coding, the terms "picture", "frame" or "image" can be used as synonyms. Video coding (or commonly referred to as coding) includes two parts: video encoding and video decoding. Video coding is performed on the source side and generally includes processing (e.g., compressing) the original video image to reduce the amount of data required to represent the video image (thereby more efficiently storing and / or transmitting). Video decoding is performed on the destination side and generally includes inverse processing relative to the encoder to reconstruct the video image. The "encoding" of the video image (or commonly referred to as the image) involved in the embodiment should be understood as the "encoding" or "decoding" of the video image or video sequence. The encoding part and the decoding part are also collectively referred to as codec (encoding and decoding, CODEC).

[0068] In the case of lossless video coding, the original video image can be reconstructed, that is, the reconstructed video image has the same quality as the original video image (assuming no transmission loss or other data loss during storage or transmission). In the case of lossy video coding, further compression is performed by quantization, etc. to reduce the amount of data required to represent the video image, but the decoder side cannot fully reconstruct the video image, that is, the quality of the reconstructed video image is lower or worse than the quality of the original video image.

[0069] Several video coding standards belong to the category of "lossy hybrid video codecs" (i.e., combining spatial and temporal prediction in the pixel domain with 2D transform coding in the transform domain for applying quantization). Each picture in a video sequence is usually divided into a set of non-overlapping blocks, which are usually encoded at the block level. In other words, the encoder usually processes and encodes the video at the block (video block) level, for example, by generating a prediction block through spatial (intra-frame) prediction and temporal (inter-frame) prediction; subtracting the prediction block from the current block (currently processed / to be processed block) to obtain a residual block; transforming the residual block in the transform domain and quantizing the residual block to reduce the amount of data to be transmitted (compressed), while the decoder side applies the inverse processing part relative to the encoder to the encoded or compressed block to reconstruct the current block for representation. In addition, the encoder needs to repeat the processing steps of the decoder so that the encoder and the decoder generate the same predictions (e.g., intra-frame predictions and inter-frame predictions) and / or reconstructed pixels for processing, i.e., encoding subsequent blocks.

[0070] In the following embodiment of the decoding system 10, the encoder 20 and the decoder 30 are based on Figures 1A to 3 Give a description.

[0071] Figure 1A 1 is a schematic block diagram of an exemplary decoding system 10, such as a video decoding system 10 (or simply a decoding system 10) that can utilize the techniques of the present application. The video encoder 20 (or simply encoder 20) and the video decoder 30 (or simply decoder 30) in the video decoding system 10 represent devices that can be used to perform various techniques according to various examples described in the present application.

[0072] like Figure 1A As shown, the decoding system 10 includes a source device 12, which is used to provide encoded image data 21 such as encoded images to a destination device 14 for decoding the encoded image data 21.

[0073] The source device 12 includes an encoder 20 , and may additionally or optionally include an image source 16 , a preprocessor (or a preprocessing unit) 18 such as an image preprocessor, and a communication interface (or a communication unit) 22 .

[0074] The image source 16 may include or may be any type of image capture device for capturing real-world images, etc., and / or any type of image generation device, such as a computer graphics processor for generating computer-animated images or any type of device for acquiring and / or providing real-world images, computer-generated images (e.g., screen content, virtual reality (VR) images, and / or any combination thereof (e.g., augmented reality (AR) images). The image source may be any type of memory or storage that stores any of the above images.

[0075] In order to distinguish the processing performed by the pre-processor (or pre-processing unit) 18 , the image (or image data) 17 may also be referred to as a raw image (or raw image data) 17 .

[0076] The preprocessor 18 is used to receive (raw) image data 17 and preprocess the image data 17 to obtain a preprocessed image (preprocessed image data) 19. For example, the preprocessing performed by the preprocessor 18 may include trimming, color format conversion (e.g., from RGB to YCbCr), color adjustment, or denoising. It is understood that the preprocessing unit 18 may be an optional component.

[0077] The video encoder (or encoder) 20 is used to receive the pre-processed image data 19 and provide the encoded image data 21 (hereinafter referred to as Figure 2 etc. for further description).

[0078] The communication interface 22 in the source device 12 can be used to receive the encoded image data 21 and send the encoded image data 21 (or any other processed version) to another device such as the destination device 14 or any other device through the communication channel 13 for storage or direct reconstruction.

[0079] The destination device 14 includes a decoder 30 and, in addition or alternatively, may include a communication interface (or communication unit) 28 , a post-processor (or post-processing unit) 32 , and a display device 34 .

[0080] The communication interface 28 in the destination device 14 is used to receive the encoded image data 21 (or any other processed version) directly from the source device 12 or from any other source device such as a storage device, for example, the storage device is a encoded image data storage device, and provide the encoded image data 21 to the decoder 30.

[0081] The communication interface 22 and the communication interface 28 can be used to send or receive encoded image data (or encoded data) 21 through a direct communication link between the source device 12 and the destination device 14, such as a direct wired or wireless connection, or through any type of network, such as a wired network, a wireless network or any combination thereof, any type of private network and public network or any type of combination thereof.

[0082] For example, the communication interface 22 may be used to encapsulate the encoded image data 21 into a suitable format such as a message, and / or process the encoded image data using any type of transmission coding or processing for transmission over a communication link or network.

[0083] The communication interface 28 corresponds to the communication interface 22 , for example, and can be used to receive transmission data and process the transmission data using any type of corresponding transmission decoding or processing and / or decapsulation to obtain the encoded image data 21 .

[0084] Both the communication interface 22 and the communication interface 28 can be configured as follows Figure 1A A unidirectional communication interface, or a bidirectional communication interface, indicated by an arrow pointing from the source device 12 to the corresponding communication channel 13 of the destination device 14, and can be used to send and receive messages, etc. to establish a connection, confirm and exchange any other information related to the communication link and / or data transmission such as encoded image data transmission, etc.

[0085] The video decoder (or decoder) 30 is used to receive the encoded image data 21 and provide a decoded image (or decoded image data) 31 (hereinafter referred to as Figure 3 etc. for further description).

[0086] The post-processor 32 is used to post-process the decoded image data 31 (also called reconstructed image data) such as the decoded image to obtain the post-processed image data 33 such as the post-processed image. The post-processing performed by the post-processing unit 32 may include, for example, color format conversion (e.g., from YCbCr to RGB), color adjustment, cropping or resampling, or any other processing for generating the decoded image data 31 for display by the display device 34 or the like.

[0087] The display device 34 is used to receive the post-processed image data 33 to display the image to a user or viewer, etc. The display device 34 can be or include any type of display for displaying the reconstructed image, such as an integrated or external display screen or display. For example, the display screen can include a liquid crystal display (LCD), an organic light emitting diode (OLED) display, a plasma display, a projector, a micro LED display, a liquid crystal on silicon (LCoS), a digital light processor (DLP), or any other type of display screen.

[0088] The decoding system 10 further includes a training engine 25 for training the encoder 20 (especially the loop filter 220 in the encoder 20) or the decoder 30 (especially the loop filter 320 in the decoder 30) to perform filtering processing on the reconstructed image.

[0089] In an embodiment of the present application, the training data includes: a training matrix set, which includes a pre-filtering brightness matrix, a quantization step matrix and a post-filtering brightness matrix of the image block, wherein the pixel points at corresponding positions in the pre-filtering brightness matrix correspond to the pre-filtering brightness values ​​of the pixels at corresponding positions in the corresponding image block, the pixel points at corresponding positions in the quantization step matrix correspond to the quantization step values ​​corresponding to the brightness values ​​of the pixels at corresponding positions in the corresponding image block, and the pixel points at corresponding positions in the post-filtering brightness matrix correspond to the post-filtering brightness values ​​of the pixels at corresponding positions in the corresponding image block.

[0090] For example, multiple matrices in the training matrix set can be Figures 6a to 6c The method shown is input into the training engine 25. Figure 6a As shown, multiple matrices in the training matrix set are directly input into the training engine 25, and the multiple matrices are all two-dimensional matrices. Figure 6b As shown, some or all of the multiple matrices in the training matrix set are selected for merging to obtain a multi-dimensional matrix, and then the multi-dimensional matrix is ​​input into the training engine 25. Figure 6c As shown, part or all of the multiple matrices in the training matrix set are selected for addition (or multiplication) to obtain a two-dimensional matrix, and then the two-dimensional matrix is ​​input into the training engine 25.

[0091] The training data can be stored in a database (not shown), and the training engine 25 obtains a target model (for example, a neural network for loop filtering, etc.) based on the training data. It should be noted that the embodiment of the present application does not limit the source of the training data, for example, the training data can be obtained from the cloud or other places for model training.

[0092] The process of training the target model by the training engine 25 makes the pixels before filtering close to the original pixel values. Each training process can use a small batch size of 64 images and an initial learning rate of 1e-4, following a step size of 10. The training data can be data generated by the encoder under different QP quantization parameter settings. The target model can be used to implement the loop filtering method provided in the embodiment of the present application, that is, the reconstructed image or image block is input into the target model after relevant preprocessing, and the filtered image or image block can be obtained. The target model in the embodiment of the present application can be specifically a filtering network, which will be combined with Figure 7a-7e Describe the target model in detail.

[0093] The target model trained by the training engine 25 can be applied to the decoding system 10, for example, Figure 1AThe source device 12 (e.g., encoder 20) or the destination device 14 (e.g., decoder 30) shown. The training engine 25 can be trained in the cloud to obtain a target model, and then the decoding system 10 downloads and uses the target model from the cloud; or, the training engine 25 can be trained in the cloud to obtain a target model and use the target model, and the decoding system 10 directly obtains the processing result from the cloud. For example, the training engine 25 trains to obtain a target model with a filtering function, and the decoding system 10 downloads the target model from the cloud, and then the loop filter 220 in the encoder 20 or the loop filter 320 in the decoder 30 can filter the input reconstructed image or image block according to the target model to obtain a filtered image or image block. For another example, the training engine 25 trains to obtain a target model with a filtering function, and the decoding system 10 does not need to download the target model from the cloud. The encoder 20 or the decoder 30 transmits the reconstructed image or image block to the cloud, and the cloud performs filtering on the reconstructed image or image block through the target model to obtain a filtered image or image block and transmit it to the encoder 20 or the decoder 30.

[0094] although Figure 1A The source device 12 and the destination device 14 are shown as independent devices, but the device embodiment may also include the source device 12 and the destination device 14 or the functions of the source device 12 and the destination device 14 at the same time, that is, the source device 12 or the corresponding function and the destination device 14 or the corresponding function at the same time. In these embodiments, the source device 12 or the corresponding function and the destination device 14 or the corresponding function can be implemented using the same hardware and / or software or by separate hardware and / or software or any combination thereof.

[0095] According to the description, Figure 1A The presence and (exact) division of different units or functions in the source device 12 and / or the destination device 14 shown may vary depending on the actual device and application, which will be obvious to the skilled person.

[0096] The encoder 20 (eg, video encoder 20) or the decoder 30 (eg, video decoder 30) or both may be configured as follows: Figure 1B The processing circuitry shown may be implemented, for example, one or more microprocessors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), discrete logic, hardware, video encoding dedicated processors, or any combination thereof. The encoder 20 may be implemented by processing circuitry 46 to include reference Figure 2The various modules discussed in encoder 20 and / or any other encoder system or subsystem described herein. Decoder 30 may be implemented by processing circuit 46 to include reference Figure 3 The processing circuit 46 may be used to perform the various operations discussed below. Figure 5 As shown, if part of the technology is implemented in software, the device can store the instructions of the software in a suitable non-transitory computer-readable storage medium and use one or more processors to execute the instructions in hardware to perform the technology of the present invention. One of the video encoder 20 and the video decoder 30 can be integrated into a single device as part of a combined codec (encoder / decoder, CODEC), such as Figure 1B shown.

[0097] Source device 12 and destination device 14 may include any of a variety of devices, including any type of handheld or fixed device, such as a notebook or laptop computer, a mobile phone, a smart phone, a tablet or tablet computer, a camera, a desktop computer, a set-top box, a television, a display device, a digital media player, a video game console, a video streaming device (e.g., a content service server or a content distribution server), a broadcast receiving device, a broadcast transmitting device, etc., and may not use or use any type of operating system. In some cases, source device 12 and destination device 14 may be equipped with components for wireless communication. Therefore, source device 12 and destination device 14 may be wireless communication devices.

[0098] In some cases, Figure 1A The video decoding system 10 shown is merely exemplary, and the techniques provided herein may be applicable to video encoding settings (e.g., video encoding or video decoding) that do not necessarily include any data communication between an encoding device and a decoding device. In other examples, data is retrieved from a local memory, sent over a network, and so on. A video encoding device may encode data and store the data in a memory, and / or a video decoding device may retrieve data from a memory and decode the data. In some examples, encoding and decoding are performed by devices that do not communicate with each other but only encode data to a memory and / or retrieve and decode data from a memory.

[0099] Figure 1B According to an exemplary embodiment, Figure 2 The video encoder 20 and / or Figure 330. The video decoding system 40 may include an imaging device 41, a video encoder 20, a video decoder 30 (and / or a video codec implemented by a processing circuit 46), an antenna 42, one or more processors 43, one or more memory storages 44, and / or a display device 45.

[0100] like Figure 1B As shown, imaging device 41, antenna 42, processing circuit 46, video encoder 20, video decoder 30, processor 43, memory storage 44 and / or display device 45 can communicate with each other. In different examples, video decoding system 40 can include only video encoder 20 or only video decoder 30.

[0101] In some instances, antenna 42 can be used to transmit or receive a coded bit stream of video data. In addition, in some instances, display device 45 can be used to present video data. Processing circuit 46 can include application-specific integrated circuit (ASIC) logic, graphics processor, general processor, etc. Video decoding system 40 can also include optional processor 43, which can similarly include application-specific integrated circuit (ASIC) logic, graphics processor, general processor, etc. In addition, memory storage 44 can be any type of memory, such as volatile memory (e.g., static random access memory (SRAM), dynamic random access memory (DRAM), etc.) or non-volatile memory (e.g., flash memory, etc.). In a non-limiting example, memory storage 44 can be implemented by cache memory. In other instances, processing circuit 46 can include memory (e.g., cache, etc.) for implementing image buffer, etc.

[0102] In some examples, video encoder 20 implemented by logic circuits may include an image buffer (e.g., implemented by processing circuit 46 or memory storage 44) and a graphics processing unit (e.g., implemented by processing circuit 46). The graphics processing unit may be communicatively coupled to the image buffer. The graphics processing unit may include video encoder 20 implemented by processing circuit 46 to implement reference Figure 2 The various modules discussed in connection with the encoder and / or any other encoder system or subsystem described herein. Logic circuits may be used to perform the various operations discussed herein.

[0103] In some examples, video decoder 30 may be implemented in a similar manner by processing circuitry 46 to implement reference Figure 3 The various modules discussed in connection with the video decoder 30 of the present invention and / or any other decoder system or subsystem described herein. In some examples, the video decoder 30 implemented by logic circuitry may include an image buffer (implemented by processing circuitry 46 or memory storage 44) and a graphics processing unit (implemented, for example, by processing circuitry 46). The graphics processing unit may be communicatively coupled to the image buffer. The graphics processing unit may include the video decoder 30 implemented by processing circuitry 46 to implement the video decoder 30 of the present invention. Figure 3 and / or the various modules discussed above for any other decoder system or subsystem described herein.

[0104] In some examples, antenna 42 may be used to receive an encoded bitstream of video data. As discussed, the encoded bitstream may include data related to the encoded video frames discussed herein, indicators, index values, mode selection data, etc., such as data related to the encoded partitions (e.g., transform coefficients or quantized transform coefficients, (as discussed) optional indicators, and / or data defining the encoded partitions). Video decoding system 40 may also include video decoder 30 coupled to antenna 42 and used to decode the encoded bitstream. Display device 45 is used to present the video frames.

[0105] It should be understood that for the examples described with reference to the video encoder 20 in the embodiments of the present application, the video decoder 30 can be used to perform the reverse process. With respect to the signaling syntax elements, the video decoder 30 can be used to receive and parse such syntax elements and decode the related video data accordingly. In some examples, the video encoder 20 can entropy encode the syntax elements into an encoded video bitstream. In such examples, the video decoder 30 can parse such syntax elements and decode the related video data accordingly.

[0106] For ease of description, the embodiments of the present invention are described with reference to the Versatile video coding (VVC) reference software or the High-Efficiency Video Coding (HEVC) developed by the Joint Collaboration Team on Video Coding (JCT-VC) of the ITU-T Video Coding Experts Group (VCEG) and the ISO / IEC Motion Picture Experts Group (MPEG). Those skilled in the art will appreciate that the embodiments of the present invention are not limited to HEVC or VVC.

[0107] Encoders and encoding methods

[0108] Figure 2 FIG. 2 is a schematic block diagram of an example of a video encoder 20 for implementing the technology of the present application. Figure 2 In the example of , the video encoder 20 includes an input terminal (or input interface) 201, a residual calculation unit 204, a transform processing unit 206, a quantization unit 208, an inverse quantization unit 210, an inverse transform processing unit 212, a reconstruction unit 214, a loop filter 220, a decoded picture buffer (DPB) 230, a mode selection unit 260, an entropy coding unit 270, and an output terminal (or output interface) 272. The mode selection unit 260 may include an inter-frame prediction unit 244, an intra-frame prediction unit 254, and a segmentation unit 262. The inter-frame prediction unit 244 may include a motion estimation unit and a motion compensation unit (not shown). Figure 2 The illustrated video encoder 20 may also be referred to as a hybrid video encoder or a hybrid video codec-based video encoder.

[0109] See also Figure 2 The loop filtering module is a trained target model (also called a neural network) that processes an input image or image region or image block to obtain a filtered image or image region or image block. For example, the neural network for loop filtering is used to receive an input image or image region or image block, such as, Figures 6a to 6c The input image data shown in the figure is used to generate a filtered image or image region or image block. Figure 7a-7e Describe the neural network used for loop filtering in detail.

[0110] The residual calculation unit 204, the transform processing unit 206, the quantization unit 208 and the mode selection unit 260 constitute the forward signal path of the encoder 20, while the inverse quantization unit 210, the inverse transform processing unit 212, the reconstruction unit 214, the buffer 216, the loop filter 220, the decoded picture buffer (DPB) 230, the inter-frame prediction unit 244 and the intra-frame prediction unit 254 constitute the backward signal path of the encoder, wherein the backward signal path of the encoder 20 corresponds to the signal path of the decoder (see Figure 3 The inverse quantization unit 210, the inverse transform processing unit 212, the reconstruction unit 214, the loop filter 220, the decoded image buffer 230, the inter-frame prediction unit 244 and the intra-frame prediction unit 254 also constitute a “built-in decoder” of the video encoder 20.

[0111] Quantification

[0112] The quantization unit 208 is used to quantize the transform coefficient 207 by, for example, scalar quantization or vector quantization to obtain a quantized transform coefficient 209 . The quantized transform coefficient 209 may also be referred to as a quantized residual coefficient 209 .

[0113] The quantization process may reduce the bit depth associated with some or all of the transform coefficients 207. For example, an n-bit transform coefficient may be rounded down to an m-bit transform coefficient during quantization, where n is greater than m. The degree of quantization may be modified by adjusting a quantization parameter (QP). For example, for scalar quantization, different degrees of scaling may be applied to achieve finer or coarser quantization. A smaller quantization step size corresponds to a finer quantization, while a larger quantization step size corresponds to a coarser quantization. A suitable quantization step size may be indicated by a quantization parameter (QP). For example, a quantization parameter may be an index of a predefined set of suitable quantization step sizes. For example, a smaller quantization parameter may correspond to fine quantization (a smaller quantization step size), a larger quantization parameter may correspond to coarse quantization (a larger quantization step size), and vice versa. Quantization may include dividing by a quantization step size, while a corresponding or inverse dequantization performed by an inverse quantization unit 210 or the like may include multiplying by a quantization step size. Embodiments according to some standards, such as HEVC, may be used to determine a quantization step size using a quantization parameter. In general, the quantization step size may be calculated using a fixed-point approximation of an equation containing division according to the quantization parameter. Other scaling factors may be introduced for quantization and dequantization to recover the norm of the residual block that may be modified due to the scaling used in the fixed-point approximation of the equations for the quantization step size and the quantization parameter. In one exemplary implementation, the scaling of the inverse transform and dequantization may be combined. Alternatively, a custom quantization table may be used and indicated from the encoder to the decoder in the bitstream, etc. Quantization is a lossy operation, where the larger the quantization step size, the greater the loss.

[0114] In one embodiment, the video encoder 20 (correspondingly, the quantization unit 208) may be configured to output a quantization parameter (QP), for example, directly output or output after being encoded or compressed by the entropy coding unit 270, for example, so that the video decoder 30 may receive and use the quantization parameter for decoding.

[0115] Dequantization

[0116] The inverse quantization unit 210 is used to perform inverse quantization of the quantization unit 208 on the quantized coefficients to obtain dequantized coefficients 211, for example, performing an inverse quantization scheme of the quantization scheme performed by the quantization unit 208 according to or using the same quantization step size as the quantization unit 208. The dequantized coefficients 211 may also be referred to as dequantized residual coefficients 211, corresponding to the transform coefficients 207, but due to the loss caused by quantization, the dequantized coefficients 211 are usually not completely the same as the transform coefficients.

[0117] reconstruction

[0118] The reconstruction unit 214 (e.g., the summer 214) is used to add the transform block 213 (i.e., the reconstructed residual block 213) to the prediction block 265 to obtain the reconstructed block 215 in the pixel domain, for example, by adding the pixel point values ​​of the reconstructed residual block 213 and the pixel point values ​​of the prediction block 265.

[0119] Filtering

[0120] The loop filter unit 220 (or simply "loop filter" 220) is used to filter the reconstruction block 215 to obtain the filter block 221, or is generally used to filter the reconstructed pixel points to obtain the filtered pixel point value. For example, the loop filter unit is used to smoothly perform pixel conversion or improve video quality. The loop filter unit 220 may include one or more loop filters, such as a deblocking filter, a sample-adaptive offset (SAO) filter, or one or more other filters, such as an adaptive loop filter (ALF), a noise suppression filter (NSF), or any combination. For example, the loop filter unit 220 may include a deblocking filter, an SAO filter, and an ALF filter. The order of the filtering process may be a deblocking filter, an SAO filter, and an ALF filter. For another example, a process called luma mapping with chromascaling (LMCS) (i.e., an adaptive in-loop shaper) is added. This process is performed before deblocking. For another example, the deblocking filtering process may also be applied to internal sub-block edges, such as affine sub-block edges, ATMVP sub-block edges, sub-block transform (SBT) edges, and intra sub-partition (ISP) edges. Figure 2 2. Although shown as a loop filter in FIG. 2, in other configurations, the loop filter unit 220 may be implemented as a post-loop filter. The filter block 221 may also be referred to as a filter reconstruction block 221.

[0121] In one embodiment, the video encoder 20 (correspondingly, the loop filter unit 220) may be used to output loop filter parameters (e.g., SAO filter parameters, ALF filter parameters, or LMCS parameters), for example, directly or after being entropy encoded by the entropy encoding unit 270, such that the decoder 30 may receive and use the same or different loop filter parameters for decoding.

[0122] Decoder and decoding method

[0123] Figure 3 An exemplary video decoder 30 for implementing the technology of the present application is shown. The video decoder 30 is used to receive the encoded image data 21 (e.g., the encoded bit stream 21) encoded by the encoder 20, for example, to obtain a decoded image 331. The encoded image data or bit stream includes information for decoding the encoded image data, such as data representing image blocks of an encoded video slice (and / or a coding block group or coding block) and related syntax elements.

[0124] exist Figure 3 In the example of FIG. 3 , decoder 30 includes an entropy decoding unit 304, an inverse quantization unit 310, an inverse transform processing unit 312, a reconstruction unit 314 (e.g., a summer 314), a loop filter 320, a decoded picture buffer (DBP) 330, a mode application unit 360, an inter-frame prediction unit 344, and an intra-frame prediction unit 354. Inter-frame prediction unit 344 may be or include a motion compensation unit. In some examples, video decoder 30 may perform substantially the same as reference Figure 2 The decoding process of the video encoder 100 is the reverse of the encoding process described above.

[0125] See also Figure 3 The loop filtering module is a trained target model (also called a neural network) that processes an input image or image region or image block to generate a filtered image or image region or image block. For example, the neural network for loop filtering is used to receive an input image or image region or image block, such as, Figures 6a to 6c The input image data shown in the figure is used to generate a filtered image or image region or image block. Figure 7a-7e Describe the neural network used for loop filtering in detail.

[0126] As described for encoder 20, inverse quantization unit 210, inverse transform processing unit 212, reconstruction unit 214, loop filter 220, decoded picture buffer DPB 230, inter prediction unit 344, and intra prediction unit 354 also constitute a “built-in decoder” of video encoder 20. Accordingly, inverse quantization unit 310 may be functionally identical to inverse quantization unit 110, inverse transform processing unit 312 may be functionally identical to inverse transform processing unit 122, reconstruction unit 314 may be functionally identical to reconstruction unit 214, loop filter 320 may be functionally identical to loop filter 220, and decoded picture buffer 330 may be functionally identical to decoded picture buffer 230. Therefore, the explanation of the corresponding units and functions of video encoder 20 applies accordingly to the corresponding units and functions of video decoder 30.

[0127] Dequantization

[0128] The inverse quantization unit 310 may be configured to receive a quantization parameter (QP) (or generally information related to inverse quantization) and a quantization coefficient from the encoded image data 21 (e.g., parsed and / or decoded by the entropy decoding unit 304), and inverse quantize the decoded quantization coefficient 309 based on the quantization parameter to obtain an inverse quantization coefficient 311, which may also be referred to as a transform coefficient 311. The inverse quantization process may include using the quantization parameter calculated by the video encoder 20 for each video block in the video slice to determine a degree of quantization, and also determine a degree of inverse quantization that needs to be performed.

[0129] reconstruction

[0130] The reconstruction unit 314 (eg, the summer 314 ) is used to add the reconstructed residual block 313 to the prediction block 365 to obtain the reconstructed block 315 in the pixel domain, for example, by adding the pixel point values ​​of the reconstructed residual block 313 and the pixel point values ​​of the prediction block 365 .

[0131] Filtering

[0132] The loop filter unit 320 (in or after the encoding loop) is used to filter the reconstruction block 315 to obtain a filter block 321, so as to smoothly perform pixel conversion or improve video quality, etc. The loop filter unit 320 may include one or more loop filters, such as a deblocking filter, a sample-adaptive offset (SAO) filter, or one or more other filters, such as an adaptive loop filter (ALF), a noise suppression filter (NSF), or any combination. For example, the loop filter unit 220 may include a deblocking filter, an SAO filter, and an ALF filter. The order of the filtering process may be a deblocking filter, an SAO filter, and an ALF filter. For another example, a process called luma mapping with chromascaling (LMCS) (i.e., an adaptive in-loop shaper) is added. This process is performed before deblocking. For another example, the deblocking filtering process may also be applied to internal sub-block edges, such as affine sub-block edges, ATMVP sub-block edges, sub-block transform (SBT) edges, and intra sub-partition (ISP) edges. Figure 3 3. Although shown as a loop filter in FIG. 3, in other configurations, the loop filter unit 320 may be implemented as a post-loop filter.

[0133] The decoder 30 is used to output the decoded image 311 through the output terminal 312, etc., to display it to the user or for the user to view it.

[0134] Although the above embodiments mainly describe video coding and decoding, it should be noted that the embodiments of the decoding system 10, the encoder 20 and the decoder 30 and other embodiments described herein can also be used for still image processing or coding and decoding, that is, the processing or coding and decoding of a single image in video coding and decoding that is independent of any previous or consecutive images. In general, if the image processing is limited to a single image 17, the inter-frame prediction unit 244 (encoder) and the inter-frame prediction unit 344 (decoder) may not be available. All other functions (also called tools or techniques) of the video encoder 20 and the video decoder 30 can also be used for still image processing, such as residual calculation 204 / 304, transformation 206, quantization 208, inverse quantization 210 / 310, (inverse) transformation 212 / 312, segmentation 262 / 362, intra-frame prediction 254 / 354 and / or loop filtering 220 / 320, entropy coding 270 and entropy decoding 304.

[0135] Figure 4 Schematic diagram of a video decoding device 400 provided in an embodiment of the present invention. The video decoding device 400 is suitable for implementing the disclosed embodiments described herein. In one embodiment, the video decoding device 400 may be a decoder, such as Figure 1A The video decoder 30 in the embodiment may also be an encoder, for example Figure 1A The video encoder 20 in.

[0136] The video decoding device 400 includes: an input port 410 (or input port 410) and a receiving unit (Rx) 420 for receiving data; a processor, a logic unit or a central processing unit (CPU) 430 for processing data; for example, the processor 430 here can be a neural network processor 430; a transmitter unit (Tx) 440 and an output port 450 (or output port 450) for transmitting data; and a memory 460 for storing data. The video decoding device 400 may also include an optical-to-electrical (OE) component and an electrical-to-optical (EO) component coupled to the input port 410, the receiving unit 420, the transmitting unit 440 and the output port 450 for the output or output of optical or electrical signals.

[0137] The processor 430 is implemented by hardware and software. The processor 430 can be implemented as one or more processor chips, cores (e.g., multi-core processors), FPGAs, ASICs, and DSPs. The processor 430 communicates with the input port 410, the receiving unit 420, the sending unit 440, the output port 450, and the memory 460. The processor 430 includes a decoding module 470 (e.g., a decoding module 470 based on neural networks (NN)). The decoding module 470 implements the embodiments disclosed above. For example, the decoding module 470 performs, processes, prepares, or provides various encoding operations. Therefore, the decoding module 470 provides substantial improvements to the functions of the video decoding device 400 and affects the switching of the video decoding device 400 to different states. Alternatively, the decoding module 470 is implemented with instructions stored in the memory 460 and executed by the processor 430.

[0138] The memory 460 includes one or more disks, tape drives, and solid-state hard disks, and can be used as an overflow data storage device for storing such programs when such programs are selected for execution, and for storing instructions and data read during program execution. The memory 460 can be volatile and / or non-volatile, and can be a read-only memory (ROM), a random access memory (RAM), a ternary content-addressable memory (TCAM), and / or a static random-access memory (SRAM).

[0139] Figure 5 A simplified block diagram of an apparatus 500 is provided for an exemplary embodiment, and the apparatus 500 may be used as Figure 1A Either or both of the source device 12 and the destination device 14 in .

[0140] The processor 502 in the device 500 may be a central processing unit. Alternatively, the processor 502 may be any other type of device or devices that are currently available or will be developed in the future and are capable of manipulating or processing information. Although a single processor such as the processor 502 shown in the figure may be used to implement the disclosed implementation, using more than one processor is faster and more efficient.

[0141] In one implementation, the memory 504 in the apparatus 500 may be a read-only memory (ROM) device or a random access memory (RAM) device. Any other suitable type of storage device may be used as the memory 504. The memory 504 may include code and data 506 accessed by the processor 502 via a bus 512. The memory 504 may also include an operating system 508 and an application 510, which includes at least one program that allows the processor 502 to perform the methods described herein. For example, the application 510 may include applications 1 to N, and also include a video decoding application that performs the methods described herein.

[0142] The apparatus 500 may also include one or more output devices, such as a display 518. In one example, the display 518 may be a touch-sensitive display that combines a display with a touch-sensitive element that may be used to sense touch input. The display 518 may be coupled to the processor 502 via the bus 512.

[0143] Although bus 512 in device 500 is described herein as a single bus, bus 512 may include multiple buses. In addition, auxiliary storage may be directly coupled to other components of device 500 or accessed through a network, and may include a single integrated unit such as a memory card or multiple units such as multiple memory cards. Therefore, device 500 may have a variety of configurations.

[0144] Since the embodiments of the present application involve the application of neural networks, in order to facilitate understanding, some nouns or terms used in the embodiments of the present application are explained below, and these nouns or terms are also considered as part of the content of the invention.

[0145] (1) Neural Network

[0146] A neural network (NN) is a machine learning model. A neural network can be composed of neural units. A neural unit can refer to an operation unit with xs and intercept 1 as input. The output of the operation unit can be:

[0147]

[0148] Where s=1, 2, ...n, n is a natural number greater than 1, Ws is the weight of xs, and b is the bias of the neural unit. f is the activation function of the neural unit, which is used to introduce nonlinear characteristics into the neural network to convert the input signal in the neural unit into the output signal. The output signal of the activation function can be used as the input of the next convolution layer. The activation function can be a sigmoid function. A neural network is a network formed by connecting many of the above-mentioned single neural units together, that is, the output of one neural unit can be the input of another neural unit. The input of each neural unit can be connected to the local receptive field of the previous layer to extract the characteristics of the local receptive field. The local receptive field can be an area composed of several neural units.

[0149] (2) Deep Neural Networks

[0150] A deep neural network (DNN), also known as a multi-layer neural network, can be understood as a neural network with many hidden layers. There is no special metric for "many" here. From the position of different layers of DNN, the neural network inside DNN can be divided into three categories: input layer, hidden layer, and output layer. Generally speaking, the first layer is the input layer, the last layer is the output layer, and the layers in between are all hidden layers. The layers are fully connected, that is, any neuron in the i-th layer must be connected to any neuron in the i+1-th layer. Although DNN looks complicated, the work of each layer is actually not complicated. Simply put, it is the following linear relationship expression: in, is the input vector, is the output vector, is the offset vector, W is the weight matrix (also called coefficient), and α() is the activation function. Each layer is just an input vector After such a simple operation, the output vector Since DNN has many layers, the coefficient W and the offset vector The definition of these parameters in DNN is as follows: Taking coefficient W as an example: Assume that in a three-layer DNN, the linear coefficient from the 4th neuron in the second layer to the 2nd neuron in the third layer is defined as The superscript 3 represents the layer number of the coefficient W, while the subscripts correspond to the output third layer index 2 and the input second layer index 4. In summary, the coefficients from the kth neuron in the L-1th layer to the jth neuron in the Lth layer are defined as It should be noted that the input layer does not have a W parameter. In a deep neural network, more hidden layers allow the network to better describe complex situations in the real world. Theoretically, the more parameters a model has, the higher its complexity and the greater its "capacity", which means it can complete more complex learning tasks. Training a deep neural network is the process of learning the weight matrix, and its ultimate goal is to obtain the weight matrix of all layers of the trained deep neural network (the weight matrix formed by many layers of vector W).

[0151] (3) Convolutional Neural Network

[0152] A convolutional neural network (CNN) is a deep neural network with a convolutional structure. It is a deep learning architecture. A deep learning architecture refers to multiple levels of learning at different levels of abstraction through machine learning algorithms. As a deep learning architecture, CNN is a feed-forward artificial neural network in which each neuron can respond to the image input into it. A convolutional neural network contains a feature extractor consisting of a convolutional layer and a pooling layer. The feature extractor can be regarded as a filter, and the convolution process can be regarded as using a trainable filter to convolve an input image or convolution feature plane (feature map).

[0153] A convolutional layer is a layer of neurons in a convolutional neural network that performs convolution on the input signal. A convolutional layer can include many convolution operators, also known as kernels. In image processing, the convolution operator is essentially a weight matrix, which is usually predefined. During the convolution operation on the image, the weight matrix is ​​usually processed horizontally on the input image one pixel after another (or two pixels after two pixels... depending on the value of the stride) to complete the work of extracting specific features from the image. The size of the weight matrix should be related to the size of the image. It should be noted that the depth dimension of the weight matrix is ​​the same as the depth dimension of the input image. During the convolution operation, the weight matrix will extend to the entire depth of the input image. Therefore, convolution with a single weight matrix will produce a convolution output with a single depth dimension, but in most cases, instead of using a single weight matrix, multiple weight matrices of the same size (rows × columns) are applied, that is, multiple isotype matrices. The output of each weight matrix is ​​stacked to form the depth dimension of the convolution image, where the dimension can be understood as being determined by the "multiple" mentioned above. Different weight matrices can be used to extract different features in the image, for example, one weight matrix is ​​used to extract image edge information, another weight matrix is ​​used to extract specific colors of the image, and another weight matrix is ​​used to blur unnecessary noise points in the image. The multiple weight matrices have the same size (rows × columns), and the size of the feature maps extracted by the multiple weight matrices of the same size is also the same. The extracted multiple feature maps of the same size are then merged to form the output of the convolution operation. The weight values ​​in these weight matrices need to be obtained through a lot of training in practical applications. The weight matrices formed by the weight values ​​obtained through training can be used to extract information from the input image, so that the convolutional neural network can make correct predictions. When the convolutional neural network has multiple convolutional layers, the initial convolutional layer often extracts more general features, which can also be called low-level features; as the depth of the convolutional neural network deepens, the features extracted by the later convolutional layers become more and more complex, such as high-level semantic features. Features with higher semantics are more suitable for the problem to be solved.

[0154] Since it is often necessary to reduce the number of training parameters, it is often necessary to periodically introduce a pooling layer after the convolution layer. It can be a convolution layer followed by a pooling layer, or multiple convolution layers followed by one or more pooling layers. In the image processing process, the only purpose of the pooling layer is to reduce the spatial size of the image. The pooling layer can include an average pooling operator and / or a maximum pooling operator to sample the input image to obtain an image of smaller size. The average pooling operator can calculate the pixel values ​​in the image within a specific range to produce an average value as the result of average pooling. The maximum pooling operator can take the pixel with the largest value in the range as the result of maximum pooling within a specific range. In addition, just as the size of the weight matrix used in the convolution layer should be related to the image size, the operator in the pooling layer should also be related to the image size. The size of the image output after processing by the pooling layer can be smaller than the size of the image input to the pooling layer. Each pixel in the image output by the pooling layer represents the average value or maximum value of the corresponding sub-region of the image input to the pooling layer.

[0155] After being processed by the convolution layer / pooling layer, the convolution neural network is not sufficient to output the required output information. Because as mentioned above, the convolution layer / pooling layer will only extract features and reduce the parameters brought by the input image. However, in order to generate the final output information (the required class information or other related information), the convolution neural network needs to use the neural network layer to generate one or a group of outputs of the required number of classes. Therefore, the neural network layer may include multiple hidden layers, and the parameters contained in the multiple hidden layers can be pre-trained according to the relevant training data of the specific task type. For example, the task type may include image recognition, image classification, image super-resolution reconstruction, etc.

[0156] Optionally, after the multiple hidden layers in the neural network layer, an output layer of the entire convolutional neural network is also included. The output layer has a loss function similar to the classification cross entropy, which is specifically used to calculate the prediction error. Once the forward propagation of the entire convolutional neural network is completed, the back propagation will begin to update the weight values ​​and biases of the aforementioned layers to reduce the loss of the convolutional neural network and the error between the result output by the convolutional neural network through the output layer and the ideal result.

[0157] (4) Recurrent Neural Network

[0158] Recurrent neural networks (RNN) are used to process sequence data. In the traditional neural network model, from the input layer to the hidden layer and then to the output layer, the layers are fully connected, and the nodes within each layer are disconnected. Although this ordinary neural network has solved many difficult problems, it is still powerless for many problems. For example, if you want to predict the next word in a sentence, you generally need to use the previous word, because the previous and next words in a sentence are not independent. The reason why RNN is called a recurrent neural network is that the current output of a sequence is also related to the previous output. The specific manifestation is that the network will remember the previous information and apply it to the calculation of the current output, that is, the nodes between the hidden layers are no longer disconnected but connected, and the input of the hidden layer includes not only the output of the input layer but also the output of the hidden layer at the previous moment. In theory, RNN can process sequence data of any length. The training of RNN is the same as the training of traditional CNN or DNN. The same error back propagation algorithm is used, but there is a difference: that is, if the RNN is expanded, the parameters, such as W, are shared; this is not the case with the traditional neural network mentioned above. And when using the gradient descent algorithm, the output of each step depends not only on the network at the current step, but also on the state of the network at the previous steps. This learning algorithm is called the Back Propagation Through Time (BPTT).

[0159] Since we already have convolutional neural networks, why do we need recurrent neural networks? The reason is simple. In convolutional neural networks, there is a premise that: elements are independent of each other, and input and output are also independent, such as cats and dogs. But in the real world, many elements are interconnected, such as the change of stocks over time, or someone said: I like to travel, and my favorite place is Yunnan. I must go there if I have the chance in the future. Fill in the blank here, humans should know to fill in "Yunnan". Because humans will make inferences based on the content of the context, but how can machines do this? RNN came into being. RNN aims to give machines the ability to remember like humans. Therefore, the output of RNN needs to rely on current input information and historical memory information. ×

[0160] (5) Loss Function

[0161] In the process of training a deep neural network, because we hope that the output of the deep neural network is as close as possible to the value we really want to predict, we can compare the predicted value of the current network with the target value we really want, and then update the weight vector of each layer of the neural network according to the difference between the two (of course, there is usually an initialization process before the first update, that is, pre-configuring parameters for each layer in the deep neural network). For example, if the predicted value of the network is high, adjust the weight vector to make it predict a lower value, and keep adjusting until the deep neural network can predict the target value we really want or a value very close to the target value we really want. Therefore, it is necessary to pre-define "how to compare the difference between the predicted value and the target value", which is the loss function or objective function, which are important equations used to measure the difference between the predicted value and the target value. Among them, taking the loss function as an example, the higher the output value (loss) of the loss function, the greater the difference, so the training of the deep neural network becomes a process of minimizing this loss as much as possible.

[0162] (6) Back propagation algorithm

[0163] Convolutional neural networks can use the error back propagation (BP) algorithm to correct the size of the parameters in the initial super-resolution model during the training process, so that the reconstruction error loss of the super-resolution model becomes smaller and smaller. Specifically, the forward transmission of the input signal to the output will generate error loss, and the error loss information is back-propagated to update the parameters in the initial super-resolution model, so that the error loss converges. The back propagation algorithm is a back propagation movement dominated by error loss, aiming to obtain the optimal parameters of the super-resolution model, such as the weight matrix.

[0164] (7) Generative Adversarial Networks

[0165] Generative adversarial networks (GAN) are a type of deep learning model. The model includes at least two modules: one is the generative model and the other is the discriminative model. These two modules learn from each other through competition to produce better output. Both the generative model and the discriminative model can be neural networks, specifically deep neural networks or convolutional neural networks. The basic principle of GAN is as follows: Taking the GAN that generates images as an example, suppose there are two networks, G (Generator) and D (Discriminator), where G is a network that generates images. It receives a random noise z and generates images through this noise, denoted as G(z); D is a discriminative network that is used to determine whether a picture is "real". Its input parameter is x, which represents a picture. The output D(x) represents the probability that x is a real picture. If it is 1, it means that it is 100% a real picture, and if it is 0, it means that it cannot be a real picture. In the process of training the generative adversarial network, the goal of the generative network G is to generate realistic images as much as possible to deceive the discriminative network D, while the goal of the discriminative network D is to distinguish the images generated by G from the real images as much as possible. In this way, G and D constitute a dynamic "game" process, which is also the "adversary" in the "generative adversarial network". The final result of the game is that, under ideal conditions, G can generate images G(z) that are "real" enough, while D has difficulty determining whether the images generated by G are real, that is, D(G(z)) = 0.5. In this way, an excellent generative model G is obtained, which can be used to generate images.

[0166] The following will be combined Figure 7a-7e The target model (also called neural network) used for loop filtering is described in detail. Figure 7a-7e An exemplary architecture of a target model (eg, a neural network for filtering, referred to as a filtering network) is shown.

[0167] like Figure 7aAs shown, the first pixel matrix (the values ​​of the pixels at the corresponding positions in the first pixel matrix correspond to the brightness values ​​of the pixels at the corresponding positions in the reconstructed first image block) and the second pixel matrix (the pixels at the corresponding positions in the second pixel matrix correspond to the quantization step values ​​corresponding to the brightness values ​​of the pixels at the corresponding positions in the first image block) are input into the filtering network. The filtering network processes the first pixel matrix through a 3×3 convolution layer (3×3Conv) and an activation layer (Relu), processes the second pixel matrix through another 3×3 convolution layer and another activation layer, and then merges (concat) the two matrices obtained after the above processing, and then passes through a block processing layer (Res-Block), ..., a block processing layer, a 3×3 convolution layer, an activation layer, and a 3×3 convolution layer to obtain a residual matrix, in which the pixels at the corresponding positions in the residual matrix correspond to the chrominance residual values ​​of the pixels at the corresponding positions in the second image block after filtering. The pixel values ​​at the corresponding positions of the first pixel matrix and the residual matrix are added to obtain a third pixel matrix, in which the pixels at the corresponding positions in the third pixel matrix correspond to the brightness values ​​of the pixels at the corresponding positions in the second image block.

[0168] like Figure 7b As shown, the block processing layer may include a 3×3 convolution layer, an activation layer, and a 3×3 convolution layer. After the input matrix is ​​processed by these three layers, the processed matrix and the pixel values ​​at the corresponding positions of the initial input matrix are added to obtain the final output matrix. Figure 7c As shown, the block processing layer may include a 3×3 convolution layer, an activation layer, a 3×3 convolution layer and an activation layer. After the input matrix is ​​processed by the 3×3 convolution layer, the activation layer and the 3×3 convolution layer, the processed matrix is ​​added to the pixel values ​​of the corresponding positions of the initial input matrix, and finally the final output matrix is ​​obtained through an activation layer.

[0169] like Figure 7d As shown, before inputting the matrix into the filter network, the pixel values ​​at the corresponding positions in the first pixel matrix (the values ​​of the pixel points at the corresponding positions in the first pixel matrix correspond to the brightness values ​​of the pixels at the corresponding positions in the first image block obtained by reconstruction) and the second pixel matrix (the pixel points at the corresponding positions in the second pixel matrix correspond to the quantization step values ​​corresponding to the brightness values ​​of the pixels at the corresponding positions in the first image block) are first added or multiplied to obtain the input pixel matrix. Then the input pixel matrix is ​​input into the filter network. The filter network processes the input pixel matrix through a 3×3 convolution layer, an activation layer, a block processing layer, ..., a block processing layer, a 3×3 convolution layer, an activation layer, and a 3×3 convolution layer to obtain a third pixel matrix, and the pixel points at the corresponding positions in the third pixel matrix correspond to the brightness values ​​of the pixels at the corresponding positions in the second image block.

[0170] like Figure 7eAs shown, the first pixel matrix (the values ​​of the pixel points at the corresponding positions in the first pixel matrix correspond to the brightness values ​​of the pixels at the corresponding positions in the first image block obtained by reconstruction) is input into the filtering network, and the pixel matrix obtained by multiplying the pixel values ​​at the corresponding positions in the first pixel matrix and the second pixel matrix (the pixel points at the corresponding positions in the second pixel matrix correspond to the quantization step values ​​corresponding to the brightness values ​​of the pixels at the corresponding positions in the first image block) is also input into the filtering network. The filtering network processes one of the inputs through a 3×3 convolution layer and an activation layer, and processes the other input through another 3×3 convolution layer and another activation layer, and then merges (concat) the two matrices obtained after the above processing, and then passes through a block processing layer, ..., a block processing layer, a 3×3 convolution layer, an activation layer, and a 3×3 convolution layer to obtain a residual matrix, and the pixel points at the corresponding positions in the residual matrix correspond to the chrominance residual values ​​of the pixels at the corresponding positions in the second image block after filtering. The pixel values ​​at the corresponding positions of the first pixel matrix and the residual matrix are added to obtain a third pixel matrix, and the pixel points at the corresponding positions in the third pixel matrix correspond to the brightness values ​​of the pixels at the corresponding positions in the second image block.

[0171] It should be noted that if Figure 7a-7e The convolutional neural networks shown are only several examples of convolutional neural networks. In specific applications, convolutional neural networks can also exist in the form of other network models, and this application does not make specific limitations on this.

[0172] Figure 8 800 is a flowchart showing a process 800 of a loop filtering method according to an embodiment of the present application. The process 800 may be performed by the video encoder 20 or the video decoder 30, and specifically, may be performed by the loop filter 220, 320 of the video encoder 20 or the video decoder 30. The process 800 is described as a series of steps or operations, and it should be understood that the process 800 may be performed in various orders and / or may occur simultaneously, not limited to Figure 8 Assuming that a video data stream having a plurality of video frames is using a video encoder or a video decoder, a process 800 including the following steps is executed to filter a reconstructed image or image block. The process 800 may include:

[0173] Step 801: Obtain a first pixel matrix, where elements at corresponding positions in the first pixel matrix correspond to brightness values ​​of pixels at corresponding positions in a first image block, and the first image block is a reconstructed image block or an image block in a reconstructed image.

[0174] An image block (for example, the first image block) may be a reconstructed image obtained by dequantizing and reconstructing the encoding result of the image in the encoder, or an image block in the reconstructed image, or a reconstructed image block obtained by dequantizing and reconstructing the encoding result of the image block.

[0175] An image block (e.g., the first image block) can be understood as a pixel matrix X, and the elements at corresponding positions in the pixel matrix X can be understood as the pixels at corresponding positions in the image block (or pixel values, for example, the pixel values ​​include the brightness value of the pixel or the chromaticity value of the pixel). Exemplarily, the size of the image block is 64×64, indicating that the pixel points of the image block are distributed as 64 rows×64 columns, and x(i,j) represents the pixel point (or pixel value) at the i-th row and j-th column in the image block. Correspondingly, the input pixel matrix A includes 64 rows and 64 columns, with a total of 64×64 elements, and A(i,j) represents the element at the i-th row and j-th column in the pixel matrix A. A(i,j) and x(i,j) correspond (for example, A(i,j) represents the value of the pixel point x(i,j)), and the elements at corresponding positions in the input pixel matrix A correspond to (for example, represent) the brightness value of the pixel point at the corresponding position in the image block, that is, the value of the element A(i,j) is the brightness value of the pixel point x(i,j). Optionally, in another example, the elements at corresponding positions in the input pixel matrix A may also correspond to (for example, represent) other values ​​of the pixels at corresponding positions in the image block, that is, the value of the element A(i,j) may be other values ​​of the pixel point x(i,j), such as the quantization step value corresponding to the brightness value of the pixel point x(i,j) (as described in step 802), or the chrominance value of the pixel point x(i,j) (as described below), or the quantization step value corresponding to the chrominance value of the pixel point x(i,j) (as described below), or the brightness residual value of the pixel point x(i,j) (as described below), or the chrominance residual value of the pixel point x(i,j) (as described below), etc., and the present application does not make any specific limitations on this. It should be understood that when the elements at corresponding positions in the input pixel matrix A represent the brightness values ​​of the pixels at corresponding positions in the image block, the input pixel matrix A is an example of the aforementioned first pixel matrix; or, when the elements at corresponding positions in the input pixel matrix A represent the quantization step values ​​corresponding to the brightness values ​​of the pixels at corresponding positions in the image block, the input pixel matrix A is an example of the second pixel matrix below; it should be understood that when the elements at corresponding positions in the input pixel matrix A represent the chrominance values ​​of the pixels at corresponding positions in the image block, the input pixel matrix A is an example of the fifth pixel matrix below; or, when the elements at corresponding positions in the input pixel matrix A represent the quantization step values ​​corresponding to the chrominance values ​​of the pixels at corresponding positions in the image block, the input pixel matrix A is an example of the sixth pixel matrix below.

[0176] The first image block may be an image block in a reconstructed image reconstructed by an encoder or a decoder, or may be a reconstructed image block reconstructed by an encoder or a decoder. The loop filtering method of the embodiment of the present application includes but is not limited to filtering the reconstructed image block. It should be understood that it can also be applied to filtering the reconstructed image, that is, the "reconstructed image block" in the method of the embodiment of the present application is adaptively replaced with the reconstructed image, which will not be repeated here.

[0177] It should be noted that the first image block and the second image block in step 803 may also adopt the RGB format. In this case, the elements at corresponding positions in the first pixel matrix may correspond to (for example, represent) the R value, G value or B value of the pixel at the corresponding position in the first image block, and the elements at corresponding positions in the second pixel matrix may correspond to (for example, represent) the quantization step value corresponding to the R value, G value or B value of the pixel at the corresponding position in the first image block, or the quantization step value commonly used by the three.

[0178] Step 802: Obtain a second pixel matrix, where elements at corresponding positions in the second pixel matrix correspond to quantization step values ​​corresponding to brightness values ​​of pixels at corresponding positions in the first image block, and the size of the second pixel matrix is ​​equal to the size of the first pixel matrix.

[0179] The process of encoding the first image block by the encoder includes a quantization operation on the residual information, which involves a quantization step value, and each pixel in the first image block corresponds to a quantization step value. The elements in the second pixel matrix are used to characterize the aforementioned quantization step value. The present application uses a filtering network to implement filtering while introducing a quantization step value for each pixel of the reconstructed image block, so that the pixel matrix corresponding to the image block of the input filtering network can be better filtered and processed to improve the filtering effect.

[0180] Step 803: filter the input pixel matrix through a filtering network to obtain an output pixel matrix, where the filtering network is a trained neural network with filtering function, and the output pixel matrix includes a third pixel matrix, and elements at corresponding positions in the third pixel matrix correspond to brightness values ​​of pixels at corresponding positions in the second image block or brightness residual values ​​of pixels, and the second image block is an image block obtained after filtering the first image block, wherein the input pixel matrix is ​​at least related to the first pixel matrix and the second pixel matrix.

[0181] In a possible implementation, the input pixel matrix includes the first pixel matrix and the second pixel matrix; or, the input pixel matrix is ​​a first preprocessed matrix obtained by preprocessing the first pixel matrix and the second pixel matrix; or, the input pixel matrix includes a normalized matrix of the first pixel matrix and a normalized matrix of the second pixel matrix; or, the input pixel matrix is ​​a second preprocessed matrix obtained by preprocessing the normalized matrix of the first pixel matrix and the normalized matrix of the second pixel matrix. The normalized matrix refers to a matrix obtained by normalizing the values ​​of the elements at the corresponding positions in the corresponding matrix.

[0182] The input pixel matrix is ​​a processing object of the filter network, and the input pixel matrix may include the acquired first pixel matrix and second pixel matrix, that is, the two pixel matrices are directly input into the filter network for filtering processing.

[0183] Before being input into the filter network, the input pixel matrix may also be a pixel matrix obtained by preprocessing and / or normalizing one or more pixel matrices according to the training data form of the filter network during training and the processing capacity of the filter network. The purpose of the normalization process is to adjust the value of the element to a unified value interval, such as [0,1] or [-0.5,0.5], so that the operation efficiency can be improved in the calculation of the filter network. The preprocessing may include matrix addition, matrix multiplication, matrix merging (contact), etc., which can reduce the amount of calculation of the filter network. Therefore, the input pixel matrix may include a normalized matrix of the first pixel matrix and a normalized matrix of the second pixel matrix, that is, the first pixel matrix and the second pixel matrix are normalized respectively, and then the normalized matrices are input into the filter network for processing. Alternatively, the input pixel matrix may be a preprocessed matrix obtained by adding, multiplying or merging the first pixel matrix and the second pixel matrix. Alternatively, the input pixel matrix may be a preprocessed matrix obtained by adding, multiplying or merging the normalized matrix of the first pixel matrix and the normalized matrix of the second pixel matrix.

[0184] Matrix addition means adding the values ​​of the elements in the corresponding positions of two matrices. Matrix multiplication means multiplying the values ​​of the elements in the corresponding positions of two matrices. Matrix merging (contact) means increasing the number of channels of the matrices. For example, if one matrix is ​​a two-dimensional matrix with a size of m×n and the other matrix is ​​also a two-dimensional matrix with a size of m×n, the two matrices are combined to obtain a three-dimensional matrix with a size of m×n×2.

[0185] As described in step 801, the output pixel matrix B output by the filtering network corresponds to the filtered image block (e.g., the second image block), that is, the element B(i, j) in the output pixel matrix corresponds to the pixel y(i, j) in the filtered image block. In one example, the value of the element B(i, j) can represent the brightness value of the pixel y(i, j). Optionally, in another example, the elements at corresponding positions in the pixel matrix B can also correspond to (e.g., represent) other values ​​of the pixels at corresponding positions in the filtered image block, that is, the value of the element B(i, j) can be other values ​​of the pixel point y(i, j), such as the brightness residual value of the pixel point y(i, j), the chromaticity value of the pixel point y(i, j), the chromaticity residual value of the pixel point y(i, j), etc., and this application does not make specific limitations on this. It should be understood that when the elements at corresponding positions in the output pixel matrix B represent the brightness values ​​of the pixels at corresponding positions in the filtered image block, the output pixel matrix B is an example of the third pixel matrix; or, when the elements at corresponding positions in the output pixel matrix B represent the brightness residual values ​​of the pixels at corresponding positions in the filtered image block, the output pixel matrix B is another example of the third pixel matrix; it should be understood that when the elements at corresponding positions in the output pixel matrix B represent the chrominance values ​​of the pixels at corresponding positions in the filtered image block, the output pixel matrix B is an example of the seventh pixel matrix; or, when the elements at corresponding positions in the output pixel matrix B represent the chrominance residual values ​​of the pixels at corresponding positions in the filtered image block, the output pixel matrix B is an example of the eighth pixel matrix.

[0186] When acquiring the first pixel matrix and the second pixel matrix, the input pixel matrix may include the first pixel matrix and the second pixel matrix, such as Figure 9a As shown; or, the input pixel matrix can be a matrix obtained based on at least the first pixel matrix and the second pixel matrix, such as Figure 9b , 9c Or as shown in 9d.

[0187] In a possible implementation, if the first pixel matrix and the second pixel matrix are normalized at the input stage of the filter network, for example, the value range of each pixel in the first pixel matrix is ​​0-255, these values ​​can be normalized to 0 to 1 or -0.5 to 0.5, that is, the input pixel matrix is ​​a normalized matrix. Then, at the output stage of the filter network, the third pixel matrix needs to be denormalized, for example, the values ​​of the elements in the third pixel matrix are denormalized to between 0 and 255.

[0188] On the basis of the above-mentioned first pixel matrix and second pixel matrix, a fifth pixel matrix can also be obtained (elements at corresponding positions in the fifth pixel matrix correspond to chromaticity values ​​of pixels at corresponding positions in the first image block). In this case, the input pixel matrix may include the first pixel matrix, the second pixel matrix and the fifth pixel matrix, such as Fig.9e As shown; or, the input pixel matrix may include a first preprocessing matrix and a fifth pixel matrix obtained by preprocessing the first pixel matrix and the second pixel matrix, as shown Figure 9g shown.

[0189] On the basis of the above-mentioned first pixel matrix, second pixel matrix and fifth pixel matrix, a sixth pixel matrix can also be obtained (elements at corresponding positions in the sixth pixel matrix correspond to quantization step values ​​corresponding to chrominance values ​​of pixels at corresponding positions in the first image block). In this case, the input pixel matrix may include the first pixel matrix, the second pixel matrix, the fifth pixel matrix and the sixth pixel matrix, such as Figure 9f As shown; or, the input pixel matrix may include a first preprocessing matrix and a third preprocessing matrix obtained by preprocessing the fifth pixel matrix and the sixth pixel matrix, as shown Figure 9h As shown; alternatively, the input matrix may include a first preprocessing matrix, a fifth pixel matrix, and a sixth pixel matrix; alternatively, the input pixel matrix may include a first pixel matrix, a second pixel matrix, and a third preprocessing matrix.

[0190] Similarly, if in the input stage of the filtering network, the first pixel matrix, the second pixel matrix, the fifth pixel matrix, and the sixth pixel matrix are normalized, for example, the value range of each element in the first pixel matrix is ​​0 to 255, these values ​​can be normalized to 0 to 1 or -0.5 to 0.5, that is, the input pixel matrix is ​​a normalized matrix, then in the output stage of the filtering network, the output pixel matrix needs to be denormalized, for example, the values ​​of the elements in the seventh pixel matrix are denormalized to between 0 and 255.

[0191] Figure 9a-9l Several illustrative examples of input pixel matrices to the filtering network are shown.

[0192] like Figure 9a As shown, the first pixel matrix and the second pixel matrix are directly input into the filtering network. For example, the first pixel matrix is ​​N×M, and the elements at corresponding positions correspond to the brightness values ​​of the pixels at corresponding positions in the first image block, and the second pixel matrix is ​​N×M, and the elements at corresponding positions correspond to the quantization step values ​​corresponding to the brightness values ​​of the pixels at corresponding positions in the first image block. At this time, the input pixel matrix includes the first pixel matrix and the second pixel matrix.

[0193] like Figure 9bAs shown, the first pixel matrix and the second pixel matrix are added and then input into the filtering network. For example, the first pixel matrix is ​​N×M, and the elements at the corresponding positions correspond to the brightness values ​​of the pixels at the corresponding positions in the first image block, and the second pixel matrix is ​​N×M, and the elements at the corresponding positions correspond to the quantization step values ​​corresponding to the brightness values ​​of the pixels at the corresponding positions in the first image block. The values ​​of the elements at the corresponding positions in the first pixel matrix and the second pixel matrix are added to obtain a first preprocessing matrix of N×M. At this time, the input pixel matrix is ​​the first preprocessing matrix. The input pixel matrix is ​​input into the filtering network to perform filtering operations, and the output third pixel matrix is ​​N×M, and the elements at the corresponding positions in the third pixel matrix can correspond to the brightness values ​​or brightness residual values ​​of the pixels at the corresponding positions in the second image block.

[0194] like Fig.9c As shown, the first pixel matrix and the second pixel matrix are merged and input into the filtering network. For example, the first pixel matrix is ​​N×M, and the elements at the corresponding positions correspond to the brightness values ​​of the pixels at the corresponding positions in the first image block. The second pixel matrix is ​​N×M, and the elements at the corresponding positions correspond to the quantization step values ​​corresponding to the brightness values ​​of the pixels at the corresponding positions in the first image block. The first pixel matrix and the second pixel matrix are merged to obtain a first preprocessing matrix of N×M×2. At this time, the input pixel matrix is ​​the first preprocessing matrix. The input pixel matrix is ​​input into the filtering network to perform filtering operations, and the output third pixel matrix is ​​N×M. The elements at the corresponding positions in the third pixel matrix can correspond to the brightness values ​​or brightness residual values ​​of the pixels at the corresponding positions in the second image block.

[0195] like Figure 9d As shown, the first pixel matrix and the second pixel matrix are multiplied and then input into the filtering network. For example, the first pixel matrix is ​​N×M, and the elements at the corresponding positions correspond to the brightness values ​​of the pixels at the corresponding positions in the first image block. The second pixel matrix is ​​N×M, and the elements at the corresponding positions correspond to the quantization step values ​​corresponding to the brightness values ​​of the pixels at the corresponding positions in the first image block. The pixel values ​​at the corresponding positions in the first pixel matrix and the second pixel matrix are multiplied to obtain a first preprocessing matrix of N×M. At this time, the input pixel matrix is ​​the first preprocessing matrix. The input pixel matrix is ​​input into the filtering network to perform filtering operations, and the output third pixel matrix is ​​N×M. The elements at the corresponding positions in the third pixel matrix can correspond to the brightness values ​​or brightness residual values ​​of the pixels at the corresponding positions in the second image block.

[0196] like Fig.9eAs shown, the first pixel matrix, the second pixel matrix and the fifth pixel matrix are directly input into the filtering network. For example, the first pixel matrix is ​​N×M, and the elements at the corresponding positions correspond to the brightness values ​​of the pixels at the corresponding positions in the first image block, the second pixel matrix is ​​N×M, and the elements at the corresponding positions correspond to the quantization step values ​​corresponding to the brightness values ​​of the pixels at the corresponding positions in the first image block, and the fifth pixel matrix is ​​N×M, and the elements at the corresponding positions correspond to the chrominance values ​​of the pixels at the corresponding positions in the first image block. At this time, the input pixel matrix includes the first pixel matrix, the second pixel matrix and the fifth pixel matrix. The first pixel matrix, the second pixel matrix and the fifth pixel matrix are input into the filtering network to perform filtering operations, and the third pixel matrix is ​​output as N×M, and the elements at the corresponding positions in the third pixel matrix correspond to the brightness values ​​or brightness residual values ​​of the pixels at the corresponding positions in the second image block. Optionally, the seventh pixel matrix or the eighth pixel matrix can also be output, and the elements at the corresponding positions in the seventh pixel matrix correspond to the chrominance values ​​of the pixels at the corresponding positions in the second image block, and the elements at the corresponding positions in the eighth pixel matrix correspond to the chrominance residual values ​​of the pixels at the corresponding positions in the second image block.

[0197] like Figure 9f As shown, the first pixel matrix and the second pixel matrix are merged and input into the filtering network, and the fifth pixel matrix is ​​directly input into the filtering network. For example, the first pixel matrix is ​​N×M, and the elements at the corresponding positions correspond to the brightness values ​​of the pixels at the corresponding positions in the first image block, and the second pixel matrix is ​​N×M, and the elements at the corresponding positions correspond to the quantization step values ​​corresponding to the brightness values ​​of the pixels at the corresponding positions in the first image block. The first pixel matrix and the second pixel matrix are merged to obtain a first preprocessing matrix of N×M×2. At this time, the input pixel matrix includes the first preprocessing matrix and the fifth pixel matrix. The input pixel matrix is ​​input into the filtering network to perform the filtering operation, and the output third pixel matrix is ​​N×M, and the elements at the corresponding positions in the third pixel matrix can correspond to the brightness values ​​or brightness residual values ​​of the pixels at the corresponding positions in the second image block. Optionally, the seventh pixel matrix or the eighth pixel matrix can also be output, and the elements at the corresponding positions in the seventh pixel matrix correspond to the chrominance values ​​of the pixels at the corresponding positions in the second image block, and the elements at the corresponding positions in the eighth pixel matrix correspond to the chrominance residual values ​​of the pixels at the corresponding positions in the second image block.

[0198] like Figure 9gAs shown, the first pixel matrix, the second pixel matrix, the fifth pixel matrix and the sixth pixel matrix are directly input into the filtering network. For example, the first pixel matrix is ​​N×M, and the elements at the corresponding positions correspond to the brightness values ​​of the pixels at the corresponding positions in the first image block, the second pixel matrix is ​​N×M, and the elements at the corresponding positions correspond to the quantization step values ​​corresponding to the brightness values ​​of the pixels at the corresponding positions in the first image block, the fifth pixel matrix is ​​N×M, and the elements at the corresponding positions correspond to the chrominance values ​​of the pixels at the corresponding positions in the first image block, and the sixth pixel matrix is ​​N×M, and the elements at the corresponding positions correspond to the quantization step values ​​corresponding to the chrominance values ​​of the pixels at the corresponding positions in the first image block. At this time, the input pixel matrix includes the first pixel matrix, the second pixel matrix, the fifth pixel matrix and the sixth pixel matrix. The first pixel matrix, the second pixel matrix, the fifth pixel matrix and the sixth pixel matrix are input into the filtering network to perform filtering operations, and the third pixel matrix is ​​output as N×M, and the elements at the corresponding positions in the third pixel matrix correspond to the brightness values ​​or brightness residual values ​​of the pixels at the corresponding positions in the second image block. Optionally, a seventh pixel matrix or an eighth pixel matrix may also be output, wherein the elements at corresponding positions in the seventh pixel matrix correspond to the chromaticity values ​​of the pixels at corresponding positions in the second image block, and the elements at corresponding positions in the eighth pixel matrix correspond to the chromaticity residual values ​​of the pixels at corresponding positions in the second image block. Optionally, a seventh pixel matrix or an eighth pixel matrix may also be output, wherein the elements at corresponding positions in the seventh pixel matrix correspond to the chromaticity values ​​of the pixels at corresponding positions in the second image block, and the elements at corresponding positions in the eighth pixel matrix correspond to the chromaticity residual values ​​of the pixels at corresponding positions in the second image block.

[0199] like Figure 9hAs shown, the first pixel matrix and the second pixel matrix are merged and input into the filter network, and the fifth pixel matrix and the sixth pixel matrix are merged and input into the filter network. For example, the first pixel matrix is ​​N×M, and the elements at the corresponding positions correspond to the brightness values ​​of the pixels at the corresponding positions in the first image block, the second pixel matrix is ​​N×M, and the elements at the corresponding positions correspond to the quantization step values ​​corresponding to the brightness values ​​of the pixels at the corresponding positions in the first image block, the fifth pixel matrix is ​​N×M, and the elements at the corresponding positions correspond to the chrominance values ​​of the pixels at the corresponding positions in the first image block, and the sixth pixel matrix is ​​N×M, and the elements at the corresponding positions correspond to the quantization step values ​​corresponding to the chrominance values ​​of the pixels at the corresponding positions in the first image block. The first pixel matrix and the second pixel matrix are merged to obtain a first preprocessing matrix of N×M×2, and the fifth pixel matrix and the sixth pixel matrix are merged to obtain a third preprocessing matrix of N×M×2. At this time, the input pixel matrix includes the first preprocessing matrix and the third preprocessing matrix. The input pixel matrix is ​​input into the filtering network to perform filtering operations, and a third pixel matrix of N×M is output, and the elements at corresponding positions in the third pixel matrix may correspond to the brightness values ​​or brightness residual values ​​of the pixels at corresponding positions in the second image block. Optionally, a seventh pixel matrix or an eighth pixel matrix may also be output, and the elements at corresponding positions in the seventh pixel matrix correspond to the chrominance values ​​of the pixels at corresponding positions in the second image block, and the elements at corresponding positions in the eighth pixel matrix correspond to the chrominance residual values ​​of the pixels at corresponding positions in the second image block.

[0200] like Figure 9i As shown, the normalized matrix of the first pixel matrix and the normalized matrix of the second pixel matrix are directly input into the filtering network. For example, the normalized matrix of the first pixel matrix is ​​N×M, and the elements at corresponding positions correspond to the normalized values ​​of the brightness values ​​of the pixels at corresponding positions in the first image block, and the normalized matrix of the second pixel matrix is ​​N×M, and the elements at corresponding positions correspond to the normalized values ​​of the quantization step values ​​corresponding to the brightness values ​​of the pixels at corresponding positions in the first image block. At this time, the input pixel matrix includes the normalized matrix of the first pixel matrix and the normalized matrix of the second pixel matrix.

[0201] like Figure 9jAs shown, the normalized matrix of the first pixel matrix and the normalized matrix of the second pixel matrix are added and then input into the filtering network. For example, the normalized matrix of the first pixel matrix is ​​N×M, and the elements at the corresponding positions correspond to the normalized values ​​of the brightness values ​​of the pixels at the corresponding positions in the first image block, and the normalized matrix of the second pixel matrix is ​​N×M, and the elements at the corresponding positions correspond to the normalized values ​​of the quantization step values ​​corresponding to the brightness values ​​of the pixels at the corresponding positions in the first image block. The values ​​of the elements at the corresponding positions in the normalized matrix of the first pixel matrix and the normalized matrix of the second pixel matrix are added to obtain a second preprocessing matrix of N×M. At this time, the input pixel matrix is ​​the second preprocessing matrix. The input pixel matrix is ​​input into the filtering network to perform filtering operations, and the output third pixel matrix is ​​N×M, and the elements at the corresponding positions in the third pixel matrix can correspond to the brightness values ​​of the pixels at the corresponding positions in the second image block or the normalized values ​​of the brightness residual values, and need to be denormalized to correspond to the brightness values ​​or brightness residual values ​​of the pixels at the corresponding positions in the second image block.

[0202] like Figure 9kAs shown, the normalized matrix of the first pixel matrix, the normalized matrix of the second pixel matrix, the normalized matrix of the fifth pixel matrix, and the normalized matrix of the sixth pixel matrix are directly input into the filtering network. For example, the normalized matrix of the first pixel matrix is ​​N×M, and the elements at the corresponding positions correspond to the normalized values ​​of the brightness values ​​of the pixels at the corresponding positions in the first image block, the normalized matrix of the second pixel matrix is ​​N×M, and the elements at the corresponding positions correspond to the normalized values ​​of the quantization step values ​​corresponding to the brightness values ​​of the pixels at the corresponding positions in the first image block, the normalized matrix of the fifth pixel matrix is ​​N×M, and the elements at the corresponding positions correspond to the normalized values ​​of the chrominance values ​​of the pixels at the corresponding positions in the first image block, and the normalized matrix of the sixth pixel matrix is ​​N×M, and the elements at the corresponding positions correspond to the normalized values ​​of the quantization step values ​​corresponding to the chrominance values ​​of the pixels at the corresponding positions in the first image block. At this time, the input pixel matrix includes the normalized matrix of the first pixel matrix, the normalized matrix of the second pixel matrix, the normalized matrix of the fifth pixel matrix, and the normalized matrix of the sixth pixel matrix. The normalized matrix of the first pixel matrix, the normalized matrix of the second pixel matrix, the normalized matrix of the fifth pixel matrix, and the normalized matrix of the sixth pixel matrix are input into the filtering network to perform filtering operations, and the third pixel matrix is ​​output as N×M, and the elements at corresponding positions in the third pixel matrix correspond to the normalized values ​​of the brightness values ​​or brightness residual values ​​of the pixels at corresponding positions in the second image block, and need to be denormalized to correspond to the brightness values ​​or brightness residual values ​​of the pixels at corresponding positions in the second image block. Optionally, the seventh pixel matrix or the eighth pixel matrix can also be output, and the elements at corresponding positions in the seventh pixel matrix correspond to the normalized values ​​of the chrominance values ​​of the pixels at corresponding positions in the second image block, and the elements at corresponding positions in the eighth pixel matrix correspond to the normalized values ​​of the chrominance residual values ​​of the pixels at corresponding positions in the second image block.

[0203] like Figure 9lAs shown, the normalized matrix of the first pixel matrix and the normalized matrix of the second pixel matrix are merged and input into the filter network, and the normalized matrix of the fifth pixel matrix and the normalized matrix of the sixth pixel matrix are merged and input into the filter network. For example, the normalized matrix of the first pixel matrix is ​​N×M, and the elements at corresponding positions correspond to the normalized values ​​of the brightness values ​​of the pixels at corresponding positions in the first image block, the normalized matrix of the second pixel matrix is ​​N×M, and the elements at corresponding positions correspond to the normalized values ​​of the quantization step values ​​corresponding to the brightness values ​​of the pixels at corresponding positions in the first image block, the normalized matrix of the fifth pixel matrix is ​​N×M, and the elements at corresponding positions correspond to the normalized values ​​of the chrominance values ​​of the pixels at corresponding positions in the first image block, and the normalized matrix of the sixth pixel matrix is ​​N×M, and the elements at corresponding positions correspond to the normalized values ​​of the quantization step values ​​corresponding to the chrominance values ​​of the pixels at corresponding positions in the first image block. The normalized matrix of the first pixel matrix and the normalized matrix of the second pixel matrix are combined to obtain a second preprocessing matrix of N×M×2, and the normalized matrix of the fifth pixel matrix and the normalized matrix of the sixth pixel matrix are combined to obtain a fourth preprocessing matrix of N×M×2. At this time, the input pixel matrix includes the second preprocessing matrix and the fourth preprocessing matrix. The input pixel matrix is ​​input into the filtering network to perform the filtering operation, and the output third pixel matrix is ​​N×M, and the elements at the corresponding positions in the third pixel matrix can correspond to the normalized values ​​of the brightness values ​​or brightness residual values ​​of the pixels at the corresponding positions in the second image block, and need to be denormalized to correspond to the brightness values ​​or brightness residual values ​​of the pixels at the corresponding positions in the second image block. Optionally, the seventh pixel matrix or the eighth pixel matrix can also be output, and the elements at the corresponding positions in the seventh pixel matrix correspond to the normalized values ​​of the chrominance values ​​of the pixels at the corresponding positions in the second image block, and the elements at the corresponding positions in the eighth pixel matrix correspond to the normalized values ​​of the chrominance residual values ​​of the pixels at the corresponding positions in the second image block.

[0204] It should be noted that Figure 9a-9l An example of data input to the filter network is shown exemplarily. The present application does not specifically limit the data input to the filter network, nor does it specifically limit the preprocessing performed before entering the filter network. The preprocessing of the two pixel matrices also includes addition and multiplication, etc. In addition, the above-mentioned preprocessing method for the pixel matrix is ​​also implemented by the filter network.

[0205] This application uses a filtering network to implement filtering and introduces a quantization step value for each pixel of the reconstructed image block, so as to better guide the filtering of the pixel matrix input to the filtering network and improve the filtering effect for reconstructed images of various qualities.

[0206] Fig.101 is a schematic diagram showing the structure of a decoding device 1000 according to an embodiment of the present application. The decoding device 1000 may correspond to the video encoder 20 or the video decoder 30. The decoding device 1000 includes a reconstruction module 1001, a quantization / dequantization module 1002, and a loop filtering module 1003, wherein the reconstruction module 1001 is used to obtain a first pixel matrix; the quantization / dequantization module 1002 is used to obtain a second pixel matrix; the loop filtering module 1003 is used to implement Figure 8 In one example, the reconstruction module 1001 may correspond to Figure 2 The reconstruction unit 214 in, or corresponding to Figure 3 In one example, the quantization / dequantization module 1002 may correspond to Figure 2 quantization unit 208 in, or corresponding to Figure 3 In an example, the inverse quantization unit 310 in the loop filter module 1003 may correspond to Figure 2 The loop filter module 220 in, or corresponding to Figure 3 In the loop filter module 320.

[0207] Those skilled in the art will appreciate that the functions described in conjunction with the various illustrative logic blocks, modules, and algorithm steps disclosed herein can be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions described in the various illustrative logic blocks, modules, and steps can be stored or transmitted as one or more instructions or codes on a computer-readable medium and executed by a hardware-based processing unit. Computer-readable media may include computer-readable storage media, which corresponds to tangible media, such as data storage media, or includes any communication media that facilitates the transfer of computer programs from one place to another (e.g., according to a communication protocol). In this manner, computer-readable media may generally correspond to (1) non-temporary tangible computer-readable storage media, or (2) communication media, such as signals or carrier waves. Data storage media may be any available media that can be accessed by one or more computers or one or more processors to retrieve instructions, codes, and / or data structures for implementing the techniques described in this application. A computer program product may include computer-readable media.

[0208] As an example and not limitation, such computer-readable storage media may include RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage, flash memory, or any other medium that can be used to store the desired program code in the form of instructions or data structures and can be accessed by a computer. Also, any connection is properly referred to as a computer-readable medium. For example, if instructions are transmitted from a website, server or other remote source using a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio and microwave are included in the definition of media. However, it should be understood that the computer-readable storage media and data storage media do not include connections, carrier waves, signals or other temporary media, but are actually directed to non-temporary tangible storage media. As used herein, disks and optical disks include compact disks (CDs), laser optical disks, optical optical disks, digital versatile disks (DVDs), and Blu-ray disks, where disks typically reproduce data magnetically, while optical disks reproduce data optically using lasers. Combinations of the above should also be included within the scope of computer-readable media.

[0209] Instructions may be executed by one or more processors, such as one or more digital signal processors (DSPs), general purpose microprocessors, application specific integrated circuits (ASICs), field programmable logic arrays (FPGAs), or other equivalent integrated or discrete logic circuits. Thus, the term "processor" as used herein may refer to any of the aforementioned structures or any other structures suitable for implementing the techniques described herein. Additionally, in some aspects, the functions described by the various illustrative logic blocks, modules, and steps described herein may be provided within dedicated hardware and / or software modules configured for encoding and decoding, or incorporated in a combined codec. Moreover, the techniques may be fully implemented in one or more circuits or logic elements.

[0210] The techniques of the present application may be implemented in a variety of devices or apparatuses, including a wireless handset, an integrated circuit (IC), or a set of ICs (e.g., a chipset). Various components, modules, or units are described in this application to emphasize functional aspects of devices for performing the disclosed techniques, but do not necessarily need to be implemented by different hardware units. In fact, as described above, the various units may be combined in a codec hardware unit in conjunction with appropriate software and / or firmware, or provided by interoperating hardware units (including one or more processors as described above).

[0211] The above is only an exemplary embodiment of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A loop filtering method, It is characterized in that include: Acquire a first pixel matrix, where the first pixel matrix corresponds to a brightness value of a first image block, and the first image block is a reconstructed image block or an image block in a reconstructed image; Acquire a second pixel matrix, where the second pixel matrix corresponds to a quantization step value corresponding to the brightness value of the first image block, and a size of the second pixel matrix is ​​equal to a size of the first pixel matrix; An output pixel matrix is ​​obtained by filtering an input pixel matrix through a filtering network, wherein the filtering network is a neural network with a filtering function obtained by training according to a training matrix set, and the output pixel matrix includes a third pixel matrix, and the third pixel matrix corresponds to a brightness value or a brightness residual value of a second image block, and the second image block is an image block obtained after filtering the first image block, wherein the input pixel matrix is ​​at least related to the first pixel matrix and the second pixel matrix, and the training matrix set includes a brightness matrix before filtering, a quantization step matrix, and a brightness matrix after filtering of multiple image blocks, wherein the brightness matrix before filtering corresponds to the brightness value of the corresponding image block before filtering, the quantization step matrix corresponds to the quantization step value corresponding to the brightness value of the corresponding image block, and the brightness matrix after filtering corresponds to the brightness value of the corresponding image block after filtering.

2. The method according to claim 1, It is characterized in that The input pixel matrix includes the first pixel matrix and the second pixel matrix; or, The input pixel matrix is ​​a first preprocessing matrix obtained by preprocessing the first pixel matrix and the second pixel matrix; or, The input pixel matrix includes a normalized matrix of the first pixel matrix and a normalized matrix of the second pixel matrix; or, The input pixel matrix is ​​a second preprocessed matrix obtained by preprocessing a normalized matrix of the first pixel matrix and a normalized matrix of the second pixel matrix.

3. The method according to claim 1 or 2, It is characterized in that When the third pixel matrix corresponds to the brightness residual value of the second image block, the method further includes: The first pixel matrix and the third pixel matrix are added to obtain a fourth pixel matrix, where the fourth pixel matrix corresponds to brightness values ​​of pixels of the second image block.

4. The method according to any one of claims 1 to 3, It is characterized in that When the input pixel matrix is ​​a normalized matrix, the method further includes: Performing an inverse normalization process on the third pixel matrix.

5. The method according to claim 3, It is characterized in that When the input pixel matrix is ​​normalized, the adding the first pixel matrix and the third pixel matrix to obtain a fourth pixel matrix includes: The fourth pixel matrix is ​​obtained by adding the first pixel matrix and the third pixel matrix that has been subjected to inverse normalization processing.

6. The method according to any one of claims 1 to 5, It is characterized in that The method further comprises: Acquire a fifth pixel matrix, where the fifth pixel matrix corresponds to the chrominance values ​​of the first image block; Accordingly, the input pixel matrix is ​​at least related to the first pixel matrix, the second pixel matrix and the fifth pixel matrix.

7. The method according to claim 6, It is characterized in that The input pixel matrix includes the first pixel matrix, the second pixel matrix and the fifth pixel matrix; or, The input pixel matrix includes a first preprocessing matrix and the fifth pixel matrix obtained by preprocessing the first pixel matrix and the second pixel matrix; or, The input pixel matrix includes a normalized matrix of the first pixel matrix, a normalized matrix of the second pixel matrix, and a normalized matrix of the fifth pixel matrix; or, The input pixel matrix includes a second preprocessing matrix obtained by preprocessing the normalized matrix of the first pixel matrix and the normalized matrix of the second pixel matrix, and a normalized matrix of the fifth pixel matrix.

8. The method according to claim 6 or 7, It is characterized in that The method further comprises: Acquire a sixth pixel matrix, where the sixth pixel matrix corresponds to a quantization step value corresponding to the chrominance value of the first image block; Accordingly, the input pixel matrix is ​​at least related to the first pixel matrix, the second pixel matrix, the fifth pixel matrix and the sixth pixel matrix.

9. The method according to claim 8, It is characterized in that The input pixel matrix includes the first pixel matrix, the second pixel matrix, the fifth pixel matrix and the sixth pixel matrix; or, The input pixel matrix includes a first preprocessing matrix obtained by preprocessing the first pixel matrix and the second pixel matrix, the fifth pixel matrix and the sixth pixel matrix; or, The input pixel matrix includes the first pixel matrix, the second pixel matrix, and a third preprocessing matrix obtained by preprocessing the fifth pixel matrix and the sixth pixel matrix; or, The input pixel matrix includes the first pre-processing matrix and the third pre-processing matrix; or, The input pixel matrix includes a normalized matrix of the first pixel matrix, a normalized matrix of the second pixel matrix, a normalized matrix of the fifth pixel matrix, and a normalized matrix of the sixth pixel matrix; or, The input pixel matrix includes a second preprocessing matrix obtained by preprocessing the normalized matrix of the first pixel matrix and the normalized matrix of the second pixel matrix, a normalized matrix of the fifth pixel matrix, and a normalized matrix of the sixth pixel matrix; or, The input pixel matrix includes a normalized matrix of the first pixel matrix, a normalized matrix of the second pixel matrix, and a fourth preprocessed matrix obtained by preprocessing the normalized matrix of the fifth pixel matrix and the normalized matrix of the sixth pixel matrix; or, The input pixel matrix includes the second pre-processing matrix and the fourth pre-processing matrix.

10. The method according to any one of claims 6 to 9, It is characterized in that The filtering process of the input pixel matrix through the filtering network to obtain the output pixel matrix includes: The input pixel matrix is ​​filtered by the filtering network to obtain the output pixel matrix, wherein the output pixel matrix includes the third pixel matrix and the seventh pixel matrix, and the seventh pixel matrix corresponds to the chromaticity values ​​of the pixels of the second image block.

11. The method according to claim 10, It is characterized in that When the input pixel matrix is ​​a normalized matrix, the method further includes: The seventh pixel matrix is ​​subjected to an inverse normalization process.

12. The method according to any one of claims 6 to 9, It is characterized in that The filtering process of the input pixel matrix through the filtering network to obtain the output pixel matrix includes: Performing filtering processing on the input pixel matrix through the filtering network to obtain the output pixel matrix, the output pixel matrix includes the third pixel matrix and an eighth pixel matrix, and the eighth pixel matrix corresponds to the chroma residual value of the second image block; The fifth pixel matrix and the eighth pixel matrix are added to obtain a ninth pixel matrix, and the ninth pixel matrix corresponds to the chromaticity values ​​of the second image block.

13. The method according to claim 12, It is characterized in that When the input pixel matrix is ​​a normalized matrix, the method further includes: Performing a denormalization process on the eighth pixel matrix; Correspondingly, the adding the fifth pixel matrix and the eighth pixel matrix to obtain a ninth pixel matrix includes: The ninth pixel matrix is ​​obtained by adding the fifth pixel matrix and the inverse normalized eighth pixel matrix.

14. The method according to any one of claims 2, 7 or 9, It is characterized in that The preprocessing includes: adding two matrices; or merging two matrices; or multiplying two matrices.

15. The method according to any one of claims 1 to 14, It is characterized in that The training matrix set also includes a pre-filtering chromaticity matrix and a post-filtering chromaticity matrix of the multiple image blocks, wherein the pre-filtering chromaticity matrix corresponds to the pre-filtering chromaticity value of the corresponding image block, and the post-filtering chromaticity matrix corresponds to the post-filtering chromaticity value of the corresponding image block.

16. The method according to any one of claims 1 to 15, It is characterized in that The filtering network includes at least a convolutional layer and an activation layer.

17. The method according to claim 16, It is characterized in that The depth of the convolution kernel of the convolution layer is 2, 3, 4, 5, 6, 16, 24, 32, 48, 64 or 128; the size of the convolution kernel in the convolution layer is 1×1, 3×3, 5×5 or 7×7.

18. The method according to any one of claims 1 to 17, It is characterized in that The filtering network includes a convolutional neural network (CNN), a deep neural network (DNN), or a recurrent neural network (RNN).

19. An encoder, It is characterized in that Comprising a processing circuit for executing the method of any one of claims 1 to 18.

20. A decoder, It is characterized in that Comprising a processing circuit for executing the method of any one of claims 1 to 18.

21. A computer program product, It is characterized in that The method comprises a program code for executing the method according to any one of claims 1 to 18 when the program code is executed on a computer or a processor.

22. An encoder, It is characterized in that include: one or more processors; A non-transitory computer-readable storage medium, coupled to the processor and storing a program executed by the processor, wherein the program, when executed by the processor, causes the decoder to perform the method of any one of claims 1 to 18.

23. A decoder, It is characterized in that include: one or more processors; A non-transitory computer-readable storage medium, coupled to the processor and storing a program executed by the processor, wherein the program, when executed by the processor, causes the encoder to perform the method of any one of claims 1 to 18.

24. A non-transitory computer-readable storage medium, It is characterized in that The method comprises a program code which, when executed by a computer device, is used to perform the method according to any one of claims 1 to 18.