Coding method, code stream, encoder, decoder and storage medium

By determining the syntax element identifiers and block quantization parameter information at the encoding and decoding ends and inputting the preset network model for filtering, the problems of high hardware complexity and inflexible selection in the existing technology are solved, and the efficiency and performance of video encoding and decoding are improved.

CN119366182BActive Publication Date: 2025-10-10GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202280097223.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-23
Publication Date
2025-10-10
Estimated Expiration
2042-06-23

AI Technical Summary

Technical Problem

Among existing video coding and decoding technologies, the hardware implementation of the multi-model intra-frame switchable solution is highly complex and has high overhead, while the intra-frame non-switchable solution is not flexible enough in the selection of loop filtering, especially when processing brightness and chrominance color components, resulting in unbalanced performance, resulting in poor coding and decoding effects.

Method used

By determining the syntax element identification information and block quantization parameter information of the components to be filtered in the current frame at the encoding and decoding ends, inputting the preset network model for filtering, removing non-important input elements, and using multi-channel quantization parameters for adaptation, a more flexible network model configuration is achieved.

Benefits of technology

It reduces the computational complexity and time of network model inference, improves encoding and decoding efficiency, and improves the processing effect of brightness and chrominance color components.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119366182B_ABST
    Figure CN119366182B_ABST
Patent Text Reader

Abstract

The application discloses a coding method, a code stream, an encoder, a decoder and a storage medium. The method comprises the following steps: parsing a code stream, determining first syntax element identification information of a to-be-filtered component of a current frame; when the first syntax element identification information indicates that the to-be-filtered component of the current frame is allowed to use a preset network model for filtering, parsing the code stream, and determining second syntax element identification information of the to-be-filtered component of a current block; when the second syntax element identification information indicates that the to-be-filtered component of the current block uses the preset network model for filtering, determining block quantization parameter information of the current block; wherein the block quantization parameter information at least comprises a block quantization parameter value of a first color component and a block quantization parameter value of a second color component; determining a reconstructed value of the to-be-filtered component of the current block, inputting the reconstructed value of the to-be-filtered component of the current block and the block quantization parameter information of the current block into the preset network model, and determining a filtered reconstructed value of the to-be-filtered component of the current block.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of video coding and decoding technology, and in particular to a coding and decoding method, a bit stream, an encoder, a decoder, and a storage medium. Background Art

[0002] In video codec systems, loop filters are used to improve the subjective and objective quality of reconstructed images. Within the loop filtering component, several neural network solutions currently exist, including a multi-model intra-frame switchable solution and a non-intra-frame switchable solution. The former utilizes a larger number of neural network models and can adjust them based on local details. The latter, while only utilizing two neural network models, does not switch models within a frame. If the current frame is an I-frame, only the neural network model corresponding to the I-frame is used; if the current frame is a B-frame, only the neural network model corresponding to the B-frame is used.

[0003] However, when using a multi-model intra-frame switchable scheme for loop filtering, different neural network models can be corresponding to different quantization parameters and color components, which makes the hardware implementation complex and costly. Although the intra-frame non-switchable scheme can reduce complexity and improve model generalization ability, it is affected by the quantization parameters, and the choice during loop filtering is not flexible enough. In particular, for the processing of color components, there may be a problem of good performance of luminance color components but poor performance of chrominance color components during loop filtering, thus failing to achieve good encoding and decoding effects. Summary of the Invention

[0004] The embodiments of the present application provide a coding and decoding method, a code stream, an encoder, a decoder, and a storage medium, which can reduce the computational complexity during model inference, thereby improving coding and decoding efficiency.

[0005] The technical solution of the embodiment of the present application can be implemented as follows:

[0006] In a first aspect, an embodiment of the present application provides a decoding method, applied to a decoder, the method comprising:

[0007] Parse the code stream to determine the first syntax element identification information of the to-be-filtered component of the current frame;

[0008] When the first syntax element identification information indicates that a to-be-filtered component of a partition block in the current frame allows filtering using a preset network model, parsing the bitstream to determine second syntax element identification information of the to-be-filtered component of the current block; wherein the current frame includes at least one partition block, and the current block is any one of the at least one partition block;

[0009] When the second syntax element identification information indicates that the to-be-filtered component of the current block is filtered using a preset network model, determining block quantization parameter information of the current block; wherein the block quantization parameter information includes at least a block quantization parameter value of the first color component and a block quantization parameter value of the second color component;

[0010] Determine the reconstructed value of the component to be filtered of the current block, input the reconstructed value of the component to be filtered of the current block and the block quantization parameter information of the current block into a preset network model, and determine the filtered reconstructed value of the component to be filtered of the current block.

[0011] In a second aspect, an embodiment of the present application provides an encoding method, applied to an encoder, the method comprising:

[0012] Determining first syntax element identification information of a to-be-filtered component of a current frame;

[0013] When the first syntax element identification information indicates that a to-be-filtered component of a partition block exists in the current frame and that filtering using a preset network model is allowed, determining second syntax element identification information of the to-be-filtered component of the current block; wherein the current frame includes at least one partition block, and the current block is any one of the at least one partition block;

[0014] When the second syntax element identification information indicates that the to-be-filtered component of the current block is filtered using a preset network model, determining block quantization parameter information of the current block; wherein the block quantization parameter information includes at least a block quantization parameter value of the first color component and a block quantization parameter value of the second color component;

[0015] Determine the reconstructed value of the component to be filtered of the current block, input the reconstructed value of the component to be filtered of the current block and the block quantization parameter information of the current block into a preset network model, and determine the filtered reconstructed value of the component to be filtered of the current block.

[0016] In a third aspect, an embodiment of the present application provides a code stream, which is generated by bit encoding based on information to be encoded; wherein the information to be encoded includes at least one of the following: first syntax element identification information of the component to be filtered of the current frame, second syntax element identification information of the component to be filtered of the current block, third syntax element identification information of the component to be filtered of the current frame, a residual scaling factor, and an initial residual value of the component to be filtered of at least one partitioned block included in the current frame; wherein the current frame includes at least one partitioned block, and the current block is any one of the at least one partitioned block.

[0017] In a fourth aspect, an embodiment of the present application provides an encoder, comprising a first determining unit and a first filtering unit; wherein,

[0018] A first determining unit is configured to determine first syntax element identification information of a component to be filtered of a current frame; and when the first syntax element identification information indicates that a component to be filtered of a partitioned block in the current frame allows filtering using a preset network model, determine second syntax element identification information of the component to be filtered of the current block; wherein the current frame includes at least one partitioned block, and the current block is any one of the at least one partitioned block; and when the second syntax element identification information indicates that the component to be filtered of the current block uses the preset network model, determine block quantization parameter information of the current block; wherein the block quantization parameter information includes at least a block quantization parameter value of a first color component and a block quantization parameter value of a second color component;

[0019] The first determining unit is further configured to determine a reconstructed value of a to-be-filtered component of the current block,

[0020] The first filtering unit is configured to input the reconstructed value of the component to be filtered of the current block and the block quantization parameter information of the current block into a preset network model to determine the filtered reconstructed value of the component to be filtered of the current block.

[0021] In a fifth aspect, an embodiment of the present application provides an encoder, comprising a first memory and a first processor; wherein,

[0022] a first memory for storing a computer program capable of running on the first processor;

[0023] The first processor is configured to execute the method according to the second aspect when running the computer program.

[0024] In a fifth aspect, an embodiment of the present application provides a decoder, comprising a decoding unit, a second determining unit, and a second filtering unit; wherein,

[0025] The decoding unit is configured to parse a bitstream to determine first syntax element identification information of a component to be filtered of a current frame; and when the first syntax element identification information indicates that a component to be filtered of a partition block in the current frame allows filtering using a preset network model, parse the bitstream to determine second syntax element identification information of the component to be filtered of the current block; wherein the current frame includes at least one partition block, and the current block is any one of the at least one partition block;

[0026] A second determining unit is configured to determine block quantization parameter information of the current block when the second syntax element identification information indicates that the to-be-filtered component of the current block is filtered using a preset network model; wherein the block quantization parameter information includes at least a block quantization parameter value of the first color component and a block quantization parameter value of the second color component;

[0027] The second determining unit is further configured to determine a reconstructed value of the to-be-filtered component of the current block;

[0028] The second filtering unit is configured to input the reconstructed value of the component to be filtered of the current block and the block quantization parameter information of the current block into a preset network model to determine the filtered reconstructed value of the component to be filtered of the current block.

[0029] In a sixth aspect, an embodiment of the present application provides a decoder, the decoder comprising a second memory and a second processor; wherein,

[0030] a second memory for storing a computer program capable of running on the second processor;

[0031] The second processor is configured to execute the method according to the first aspect when running the computer program.

[0032] In a seventh aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed, it implements the method described in the first aspect or the method described in the second aspect.

[0033] An embodiment of the present application provides a coding and decoding method, a code stream, an encoder, a decoder and a storage medium. Whether at the encoding end or the decoding end, first, the first syntax element identification information of the component to be filtered of the current frame is determined; when the first syntax element identification information indicates that the component to be filtered of the partitioned block in the current frame allows filtering using a preset network model, then the second syntax element identification information of the component to be filtered of the current block is determined; wherein, the current frame includes at least one partitioned block, and the current block is any one of the at least one partitioned block; when the second syntax element identification information indicates that the component to be filtered of the current block is filtered using a preset network model, the block quantization parameter information of the current block is determined; wherein the block quantization parameter information includes at least a block quantization parameter value of a first color component and a block quantization parameter value of a second color component; then, the reconstruction value of the component to be filtered of the current block is determined, and the reconstruction value of the component to be filtered of the current block and the block quantization parameter information of the current block are input into the preset network model, and finally, the filtered reconstruction value of the component to be filtered of the current block can be determined. In this way, for the input of the preset network model, since it only includes the reconstructed values ​​and block quantization parameter information of the components to be filtered, the prediction information, division information and other non-important input elements of the color components are removed, the amount of calculation during network model inference can be reduced, which is beneficial to the implementation of the decoding end and reduces the decoding time; in addition, since the input block quantization parameter information includes block quantization parameter values ​​of at least two color components, that is, multi-channel quantization parameters are used as input, the luminance color component and the chrominance color component can have more choices and adaptations; and by introducing new syntax elements, the decoding end does not need to store multiple neural network models to achieve a more flexible configuration, which is beneficial to improving encoding performance and thus improving encoding and decoding efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 It is a schematic diagram of the application of a hybrid coding framework;

[0035] Figure 2 A schematic diagram of the network architecture of a neural network model;

[0036] Figure 3 Schematic diagram of the composition structure of a residual block;

[0037] Figure 4 This is a schematic diagram of the network architecture of another neural network model;

[0038] Figure 5A A schematic block diagram of an encoder according to an embodiment of the present invention;

[0039] Figure 5B A schematic block diagram of a decoder according to an embodiment of the present invention;

[0040] Figure 6 A flowchart of a decoding method provided in an embodiment of the present application;

[0041] Figure 7 A schematic diagram of the network architecture of a neural network model provided in an embodiment of the present application;

[0042] Figure 8 A flowchart of another decoding method provided in an embodiment of the present application;

[0043] Figure 9 A flowchart of another decoding method provided in an embodiment of the present application;

[0044] Figure 10 A schematic diagram of a flow chart of an encoding method provided in an embodiment of the present application;

[0045] Figure 11 A schematic diagram of the structure of an encoder provided in an embodiment of the present application;

[0046] Figure 12 A schematic diagram of the specific hardware structure of an encoder provided in an embodiment of the present application;

[0047] Figure 13 A schematic diagram of the structure of a decoder provided in an embodiment of the present application;

[0048] Figure 14 A schematic diagram of the specific hardware structure of a decoder provided in an embodiment of the present application;

[0049] Figure 15 A schematic diagram of the structure of a coding and decoding system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0050] In order to enable a more detailed understanding of the features and technical contents of the embodiments of the present application, the implementation of the embodiments of the present application is described in detail below with reference to the accompanying drawings. The attached drawings are for reference only and are not used to limit the embodiments of the present application.

[0051] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.

[0052] In the following description, reference is made to "some embodiments," which describe a subset of all possible embodiments. However, it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict. It should also be noted that the terms "first, second, and third" in the embodiments of the present application are only used to distinguish similar objects and do not represent a specific ordering of the objects. It is understood that "first, second, and third" may be interchanged in a specific order or sequential order where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0053] It can be understood that in a video image, a first color component, a second color component, and a third color component are generally used to represent a coding block (CB). Among them, the three color components are a luminance color component and two chrominance color components (a blue chrominance color component and a red chrominance color component). Specifically, the luminance color component is usually represented by the symbol Y, the blue chrominance color component is usually represented by the symbol Cb or U, and the red chrominance color component is usually represented by the symbol Cr or V. In this way, the video image can be represented in the YCbCr format, the YUV format, or even the RGB format, but there is no limitation to this.

[0054] It's also understandable that video compression technology primarily compresses large amounts of digital video data for easier transmission and storage. With the surge in internet video usage and increasing demand for higher-quality video, while existing digital video compression standards can save significant amounts of video data, there's a continued need for better digital video compression technologies to reduce bandwidth and traffic pressures associated with digital video transmission. During video encoding, the encoder reads unequal pixels from raw video sequences in different color formats, including both luminance and chrominance components. This means the encoder reads a black-and-white or color image. The image is then divided into blocks, and the block data is passed to the encoder for encoding.

[0055] At present, common video coding and decoding standards all adopt a block-based hybrid coding framework, such as H.266 / Versatile Video Coding (VVC). Each frame in the video is divided into square maximum coding units (LCU) of the same size (such as 128×128, 64×64, etc.). Each maximum coding unit can be divided into rectangular coding units (CU) according to rules. Coding units may also be divided into prediction units (PU), transform units (TU), etc. Figure 1 As shown, the hybrid coding framework may include modules such as prediction, transform, quantization, entropy coding, and in-loop filtering. The prediction module may include intra-frame prediction and inter-frame prediction, and inter-frame prediction may include motion estimation and motion compensation. Since there is a strong correlation between adjacent pixels within a video frame, intra-frame prediction is used in video coding and decoding technology to eliminate spatial redundancy between adjacent pixels. However, since there is also a strong similarity between adjacent frames in a video image, inter-frame prediction is used in video coding and decoding technology to eliminate temporal redundancy between adjacent frames, thereby improving coding and decoding efficiency.

[0056] The basic process of a video codec is as follows: On the encoder side, a frame is divided into blocks. Intra-frame prediction or inter-frame prediction is used on the current block to generate a prediction block for the current block. The prediction block is subtracted from the original image block to obtain a residual block. The residual block is transformed and quantized to obtain a quantization coefficient matrix. This quantization coefficient matrix is ​​entropy encoded and output to the bitstream. On the decoder side, intra-frame prediction or inter-frame prediction is used on the current block to generate a prediction block for the current block. The bitstream is then parsed to obtain a quantization coefficient matrix. This quantization coefficient matrix is ​​inversely quantized and inversely transformed to obtain a residual block. The prediction block and the residual block are added together to obtain a reconstructed block. The reconstructed blocks form a reconstructed image, which is then subjected to image-based or block-based loop filtering to obtain a decoded image. The encoder side also performs similar operations to the decoder side to obtain a decoded image. The decoded image can serve as a reference frame for inter-frame prediction in subsequent frames. Block division information, prediction, transform, quantization, entropy coding, loop filtering, and other mode or parameter information determined by the encoder are output to the bitstream if necessary. The decoding end determines the same block division information as the encoding end by parsing and analyzing the existing information, as well as the mode information or parameter information such as prediction, transformation, quantization, entropy coding, and loop filtering, thereby ensuring that the decoded image obtained by the encoding end is the same as the decoded image obtained by the decoding end. The decoded image obtained by the encoding end is also usually called a reconstructed image. During prediction, the current block can be divided into prediction units, and during transformation, the current block can be divided into transformation units. The division of prediction units and transformation units can be different. The above is the basic process of the video codec under the block-based hybrid coding framework. With the development of technology, some modules or steps of the framework or process may be optimized. That is to say, the embodiment of the present application is applicable to the basic process of the video codec under the block-based hybrid coding framework, but is not limited to the framework and process. Among them, the current block (current block) can be the current coding unit (CU), the current prediction unit (PU) or the current transformation unit (TU), etc.

[0057] In related technologies, the Joint Video Experts Team (JVET), the international video coding standards organization, has established two exploratory experimental groups: one for neural network coding and one for surpassing VVC, along with several corresponding expert discussion groups. The Beyond VVC Exploration Experiment Group aims to achieve higher coding efficiency based on the latest codec standard, H.266 / VVC, with strict performance and complexity requirements. The coding method studied by this group is closer to VVC and can be considered a traditional coding method. Currently, the algorithm reference model performance of this exploratory experiment has surpassed the coding performance of the latest VVC reference model (VVC Test Model, VTM) by approximately 15%.

[0058] The method studied by the first exploratory group is an intelligent coding method based on neural networks. Deep learning and neural networks are currently hot topics across various industries, especially in computer vision, where deep learning-based methods often have overwhelming advantages. Experts from the JVET standards organization have introduced neural networks to the field of video codecs. Leveraging the powerful learning capabilities of neural networks, neural network-based coding tools often achieve very high coding efficiency. In the early stages of VVC standard development, many manufacturers focused on coding tools based on deep learning, proposing methods including neural network-based intra-frame prediction, neural network-based inter-frame prediction, and neural network-based loop filtering. Among them, the neural network-based loop filtering method has the most outstanding coding performance. After multiple research and exploration meetings, coding performance has reached over 8%. The neural network-based loop filtering scheme studied by the first exploratory group at the JVET meeting has achieved coding performance as high as 12%, almost contributing to half a generation of coding performance.

[0059] The embodiment of the present application is an improvement based on the exploratory experiments of the JVET conference, and proposes a loop filtering enhancement scheme based on a neural network (NN). The following will first introduce the loop filtering scheme based on a neural network in the related art.

[0060] In the related art, exploration of neural network-based loop filtering solutions has primarily focused on two approaches: the first employing a multi-model switchable within a frame, and the second employing a non-switchable model. Regardless of the approach, the neural network architecture remains largely unchanged, and the tool is incorporated into the in-loop filtering of traditional hybrid coding frameworks. Therefore, the fundamental processing unit for both approaches is the coding tree unit (CTU), which is the maximum coding unit size.

[0061] The biggest difference between the first scheme in which multiple models can be switched within a frame and the second scheme in which models cannot be switched within a frame is that the first scheme can switch the neural network model at will when encoding and decoding the current frame, while the second scheme cannot switch the neural network model. In other words, taking the first scheme as an example, when encoding a frame of an image, each coding tree unit has multiple candidate neural network models to choose from. The encoder selects which neural network model to use for the current coding tree unit with the best filtering effect, and then writes the index number of the neural network model into the bitstream. That is, in this scheme, if the coding tree unit needs to be filtered, it is necessary to first transmit a coding tree unit-level usage flag bit, and then transmit the index number of the neural network model. If filtering is not required, it is only necessary to transmit a coding tree unit-level usage flag bit; after parsing the index number, the decoder loads the neural network model corresponding to the index number into the current coding tree unit to filter the current coding tree unit.

[0062] Taking the second scheme as an example, when encoding a frame of image, the available neural network model for each coding tree unit in the current frame is fixed, and each coding tree unit uses the same neural network model, that is, the second scheme does not have a model selection process at the encoding end; the decoding end parses and obtains the usage flag of whether the current coding tree unit uses the neural network-based loop filter. If the usage flag is true, the pre-set model (the same as the encoding end) is used to filter the coding tree unit. If the usage flag is false, no additional operation is performed.

[0063] For the first multi-model intra-frame switchable solution, it has strong flexibility at the coding tree unit level and can adjust the model according to local details, that is, local optimization to achieve a better global effect. Usually, this solution has more neural network models, and different neural network models are trained under different quantization parameters for the JVET general test conditions. At the same time, different coding frame types may also require different neural network models to achieve better results. Taking a filter in the related technology as an example, the filter uses up to 22 neural network models to cover different coding frame types and different quantization parameters, and the model switching is performed at the coding tree unit level. This filter can provide up to 10% more coding performance based on VVC.

[0064] For the second solution in which the model cannot be switched within a frame, although the solution has two neural network models overall, the model is not switched within the frame. The solution makes a judgment at the encoding end. If the current encoding frame type is an I frame, the neural network model corresponding to the I frame is imported, and only the neural network model corresponding to the I frame is used in the current frame; if the current encoding frame type is a B frame, the neural network model corresponding to the B frame is imported, and similarly only the neural network model corresponding to the B frame is used in the current frame. This solution can provide 8.65% encoding performance based on VVC. Although it is slightly lower than the first solution, the overall performance is a coding efficiency that is almost impossible to achieve compared to traditional encoding tools.

[0065] While the first approach offers greater flexibility and higher encoding performance, it suffers from a significant hardware implementation drawback. Hardware experts are concerned about the code for intra-frame model switching. Switching models at the coding tree unit level means, in the worst case, that the decoder must reload the neural network model for each coding tree unit processed. This, in addition to the hardware implementation complexity, creates an additional burden on current high-performance graphics processing units (GPUs). Furthermore, the presence of multiple models requires a large number of parameters to be stored, which is a significant hardware implementation overhead. However, the second approach, a neural network loop filter, further explores the powerful generalization capabilities of deep learning. It uses a variety of information as input, rather than simply reconstructed samples. This increased information provides more information for neural network learning, enhancing model generalization and eliminating many unnecessary redundant parameters. Continuously updated approaches have now emerged that can adapt to different test conditions and quantization parameters using a single, simplified, low-complexity neural network model. Compared to the first approach, this eliminates the overhead of constantly reloading the model and the need for larger storage space to accommodate a large number of parameters.

[0066] The following will introduce the relevant technologies of the neural network architecture of these two solutions.

[0067] See also Figure 2 , which shows a schematic diagram of the network architecture of a neural network model. Figure 2 As shown in , the main structure of the network architecture can be composed of multiple residual blocks (ResBlocks). The composition structure of the residual block is detailed in Figure 3 As shown. Figure 3 In [1], a single residual block consists of multiple convolutional layers (Conv) connected to a convolutional attention mechanism module (CBAM) layer. As an attention mechanism module, CBAM is mainly responsible for further extraction of detail features. In addition, there is a direct skip connection (SkipConnection) structure between the input and output of the residual block. Here, Figure 3The multiple convolutional layers in the network include a first convolutional layer, a second convolutional layer, and a third convolutional layer, and an activation layer is connected after the first convolutional layer. For example, the size of the first convolutional layer is 1×1×k×n, the size of the second convolutional layer is 1×1×n×k, and the size of the third convolutional layer is 3×3×k×k, where k and n are positive integers; the activation layer may include a rectified linear unit (ReLU) function, also known as a linear rectification function, which is an activation function commonly used in current neural network models. ReLU is actually a ramp function that is simple and converges quickly.

[0068] for Figure 2 For example, the network architecture also contains a skip connection structure that connects the input reconstructed YUV information to the output of the pixel shuffle module. The main function of the pixel shuffle is to convert low-resolution feature maps into high-resolution feature maps through convolution and multi-channel reorganization. As an upsampling method, it can effectively amplify the reduced feature maps. In addition, the inputs of the network architecture mainly include reconstructed YUV information (rec_yuv), predicted YUV information (pred_yuv), and YUV information with partitioning information (par_yuv). All inputs undergo simple convolution and activation operations, are concatenated (Cat), and then fed into the main structure, ultimately outputting the filtered component information (output_y). It is worth noting that the processing of YUV information with partitioning information may differ between I-frames and B-frames. I-frames require input of YUV information with partitioning information, while B-frames do not.

[0069] In summary, for every JVET-required parameter point in each I-frame and B-frame, the first solution has a corresponding neural network model. Furthermore, because the three YUV color components are primarily composed of two channels, luminance and chrominance, the color components differ.

[0070] See also Figure 4 , which shows a schematic diagram of the network architecture of another neural network model. Figure 4 As shown, the network architecture of the first and second schemes is basically the same in terms of main structure. The difference is that the second scheme adds quantization parameter information as an additional input compared to the first scheme. The first scheme mentioned above loads different neural network models according to the quantization parameter information to achieve more flexible processing and more efficient encoding effects, while the second scheme uses quantization parameter information as the network input to improve the generalization ability of the neural network, enabling it to adapt to different quantization parameter conditions and provide good filtering performance.

[0071] from Figure 4 It can be seen that there are two quantization parameters entering the neural network model as input, one is BaseQP and the other is SliceQP. BaseQP here indicates the sequence-level quantization parameter set by the encoder when encoding the video sequence, that is, the quantization parameter point required by the JVET pass test, and is also the parameter used to determine the neural network model in the first solution. SliceQP is the quantization parameter of the current frame. The quantization parameter of the current frame can be different from the sequence-level quantization parameter. This is because in the video encoding process, the quantization conditions of the B frame are different from those of the I frame, and the quantization parameters are different at different time domain levels. Therefore, SliceQP is generally different from BaseQP in the B frame. Therefore, in related technologies, the input of the neural network model of the I frame only requires SliceQP, while the neural network model of the B frame requires both BaseQP and SliceQP as input. In Figure 4 In

[15] , the input of the network architecture mainly includes reconstructed YUV information (rec_yuv), predicted YUV information (pred_yuv), YUV information with partitioning information (par_yuv), as well as BaseQP and SliceQP, and finally outputs the filtered component information (output_yuv).

[0072] In addition, the second solution differs from the first solution in one respect. The output of the model in the first solution generally does not require additional processing. Specifically, if the model output is residual information, it is superimposed with the reconstructed samples of the current coding tree unit and used as the output of the neural network-based loop filter tool. If the model output is a complete reconstructed sample, the model output is the output of the neural network-based loop filter tool. The output of the second solution generally requires scaling. For example, the model outputs residual information of the current coding tree unit. This residual information is scaled and then superimposed with the reconstructed sample information of the current coding tree unit. This scaling factor is obtained by the encoder and written into the code stream for transmission to the decoder.

[0073] In related technologies, it is precisely because the quantization parameters are input as additional information that the reduction in the number of models is achieved and has become a popular solution at the current JVET conference. In addition, the general neural network-based loop filtering solution may not be exactly the same as the two solutions mentioned above. The specific solutions may differ in details, but the main ideas are basically the same. For example, the different details of the second solution can be reflected in the design of the neural network architecture, such as the convolution size of the residual block, the number of convolution layers, and whether the attention mechanism module is included. It can also be reflected in the input of the neural network model, which can even have more additional information, such as the boundary strength value of the deblocking effect filter.

[0074] While both of the aforementioned solutions significantly reduce the implementation complexity of neural network loop filtering while maintaining respectable performance, both single-model and dual-model neural network loop filtering processes both luma and chroma components using a single model. While parameter training can maintain good performance for luma and chroma components, significant room for improvement remains for chroma. In one implementation, a total of four neural network models can be used to improve loop filtering, representing two more than a related technique. The difference lies in the processing of chroma components. Because chroma components have independent neural network models, this solution achieves an average 2-5% higher compression performance for chroma components than the two aforementioned solutions. Without the luma and chroma performance transfer, this solution can achieve an additional 10% higher compression performance for chroma components, demonstrating that the two aforementioned solutions still have room for improvement in this regard. Furthermore, in another implementation, various ablation experiments on the neural network loop filtering technique revealed that the additional input information becomes ineffective when training is prolonged. Therefore, in an embodiment of the present application, the neural network-based loop filtering technology can consider removing input information such as predicted YUV information, YUV information with partitioning information, and boundary strength (Bs), and trimming it into input with only reconstructed YUV information and BaseQP.

[0075] In summary, due to the importance of BaseQP, in a single model solution, the luma and chroma color components cannot be switched freely simultaneously due to time complexity limitations. If a single BaseQP is input into a single network model solution, the decoder must infer reconstructed samples multiple times. This sharp increase in decoder time complexity is still unacceptable in current software and hardware designs and is not conducive to improving encoding performance.

[0076] Based on this, an embodiment of the present application provides a coding and decoding method, whether at the encoding end or the decoding end, first determine the first syntax element identification information of the component to be filtered of the current frame; when the first syntax element identification information indicates that there is a component to be filtered of the partitioned block in the current frame and allows the use of a preset network model for filtering, then determine the second syntax element identification information of the component to be filtered of the current block; wherein, the current frame includes at least one partitioned block, and the current block is any one of the at least one partitioned block; when the second syntax element identification information indicates that the component to be filtered of the current block is filtered using a preset network model, determine the block quantization parameter information of the current block; wherein the block quantization parameter information includes at least the block quantization parameter value of the first color component and the block quantization parameter value of the second color component; then determine the reconstruction value of the component to be filtered of the current block, input the reconstruction value of the component to be filtered of the current block and the block quantization parameter information of the current block into the preset network model, and finally determine the filtered reconstruction value of the component to be filtered of the current block.

[0077] In this way, for the input of the preset network model, since it only includes the reconstructed values ​​and block quantization parameter information of the components to be filtered, the prediction information, division information and other non-important input elements of the color components are removed, the amount of calculation during network model inference can be reduced, which is beneficial to the implementation of the decoding end and reduces the decoding time; in addition, since the input block quantization parameter information includes block quantization parameter values ​​of at least two color components, that is, multi-channel quantization parameters are used as input, the luminance color component and the chrominance color component can have more choices and adaptations; and by introducing new syntax elements, the decoding end does not need to store multiple neural network models to achieve a more flexible configuration, which is beneficial to improving encoding performance and thus improving encoding and decoding efficiency.

[0078] The embodiments of the present application will be described in detail below with reference to the accompanying drawings.

[0079] See also Figure 5A , which shows a schematic block diagram of the composition of an encoder provided by an embodiment of the present application. Figure 5AAs shown, the encoder (specifically, a "video encoder") 100 can include a transform and quantization unit 101, an intra-estimation unit 102, an intra-prediction unit 103, a motion compensation unit 104, a motion estimation unit 105, an inverse transform and inverse quantization unit 106, a filter control analysis unit 107, a filter unit 108, an encoding unit 109, and a decoded picture buffer unit 110, etc., wherein the filter unit 108 can implement deblocking filtering and Sample Adaptive Offset (SAO) filtering, and the encoding unit 109 can implement header information encoding and Context-based Adaptive Binary Arithmetic Coding (CABAC). For an input original video signal, a video coding block can be obtained through Coding Tree Unit (CTU) division, and then the residual pixel information obtained after intra- or inter-prediction is transformed by the transform and quantization unit 101, including transforming the residual information from the pixel domain to the transform domain, and quantizing the obtained transform coefficients to further reduce the bit rate; the intra-estimation unit 102 and the intra-prediction unit 103 are used for intra-prediction of the video coding block; specifically, the intra-estimation unit 102 and the intra-prediction unit 103 are used to determine an intra-prediction mode to be used to encode the video coding block; the motion compensation unit 104 and the motion estimation unit 105 are used to perform inter-prediction encoding of the received video coding block relative to one or more blocks in one or more reference frames to provide temporal prediction information; the motion estimation performed by the motion estimation unit 105 is a process of generating a motion vector that can estimate the motion of the video coding block, and then the motion compensation is performed by the motion compensation unit 104 based on the motion vector determined by the motion estimation unit 105; after the intra-prediction mode is determined, the intra-prediction unit 103 is also used to provide the selected intra-prediction data to the encoding unit 109, and the motion estimation unit 105 also sends the calculated determined motion vector data to the encoding unit 109; in addition, the inverse transform and inverse quantization unit 106 is used for reconstruction of the video coding block, to reconstruct a residual block in the pixel domain, and then the filter control analysis unit 107 and the filter unit 108 remove blockiness artifacts, and then the reconstructed residual block is added to a predictive block in one of the frames of the decoded picture buffer unit 110 to generate a reconstructed video coding block; the encoding unit 109 is used to encode various encoding parameters and quantized transform coefficients, and in the CABAC-based encoding algorithm, the context content can be based on the adjacent coding blocks, which can be used to encode information indicating the determined intra-prediction mode, and output a bitstream of the video signal; and the decoded picture buffer unit 110 is used to store the reconstructed video coding block for predictive reference.As the video image encoding proceeds, new reconstructed video encoding blocks are continuously generated, and these reconstructed video encoding blocks are stored in the decoded image buffer unit 110 .

[0080] See also Figure 5B , which shows a schematic block diagram of a decoder provided by an embodiment of the present application. Figure 5B As shown, the decoder (specifically "video decoder") 200 includes a decoding unit 201, an inverse transform and inverse quantization unit 202, an intra-frame prediction unit 203, a motion compensation unit 204, a filtering unit 205 and a decoded image buffer unit 206, etc., wherein the decoding unit 201 can implement header information decoding and CABAC decoding, and the filtering unit 205 can implement deblocking filtering and SAO filtering. The input video signal is processed by Figure 5A After the encoding process, the code stream of the video signal is output; the code stream is input to the decoder 200, and first passes through the decoding unit 201 to obtain the decoded transform coefficients; the transform coefficients are processed by the inverse transform and inverse quantization unit 202 to generate a residual block in the pixel domain; the intra-frame prediction unit 203 can be used to generate prediction data for the current video decoding block based on the determined intra-frame prediction mode and the data of the previously decoded block from the current frame or picture; the motion compensation unit 204 determines the prediction information for the video decoding block by analyzing the motion vector and other associated syntax elements, and uses the prediction information to A predictive block of the video decoding block being decoded is generated; a decoded video block is formed by summing the residual block from the inverse transform and inverse quantization unit 202 with the corresponding predictive block generated by the intra-frame prediction unit 203 or the motion compensation unit 204; the decoded video signal passes through the filtering unit 205 to remove blocking artifacts, thereby improving video quality; the decoded video block is then stored in the decoded image buffer unit 206, which stores reference images for subsequent intra-frame prediction or motion compensation and is also used for outputting the video signal, thereby obtaining the restored original video signal.

[0081] It should be noted that the method of the embodiment of the present application is mainly used in Figure 5A The filter unit 108 shown is partly Figure 5B The filtering unit 205 shown in FIG. Here, both the filtering unit 108 and the filtering unit 205 refer to the loop filtering portion based on the neural network. In other words, the embodiments of the present application mainly affect the loop filtering portion in the hybrid framework of video coding, and can be applied to both the encoder and the decoder, or even to both the encoder and the decoder simultaneously, but this is not specifically limited here.

[0082] In one embodiment of the present application, see Figure 6, which shows a flowchart of a decoding method provided by an embodiment of the present application. Figure 6 As shown, the method may include:

[0083] S601: Parse the code stream to determine the first syntax element identification information of the to-be-filtered component of the current frame.

[0084] It should be noted that in the implementation of this application, the method is applied to a decoder, and specifically can be applied to a loop filtering method based on a neural network model. More specifically, it can be a loop filtering method obtained based on a neural network model with multiple quantization parameter inputs.

[0085] It should also be noted that, in an embodiment of the present application, the decoder can determine the first syntax element identification information by parsing the bitstream. Here, the first syntax element identification information is a frame-level syntax element, which can be used to indicate whether the to-be-filtered components of the partitioned blocks in the current frame are allowed to be filtered using the preset network model. In addition, the current frame may include at least one partitioned block, and the current block is any one of the at least one partitioned blocks. In other words, the first syntax element identification information can determine whether all to-be-filtered components of the at least one partitioned block included in the current frame are not allowed to be filtered using the preset network model.

[0086] For example, in the embodiment of the present application, the component to be filtered may refer to a color component. The color component may include at least one of the following: a first color component, a second color component, and a third color component. The first color component may be a luminance color component, and the second color component and the third color component may be chrominance color components (for example, the second color component is a blue chrominance color component, and the third color component is a red chrominance color component; or the second color component is a red chrominance color component, and the third color component is a blue chrominance color component).

[0087] For example, if the component to be filtered is a luma color component, the first syntax element identification information may be ph_nnlf_luma_enable_flag; if the component to be filtered is a chroma color component, the first syntax element identification information may be ph_nnlf_chroma_enable_flag. That is, different first syntax element identification information is set for different color components in the current frame. Specifically, after parsing the bitstream, the decoder can determine the first syntax element identification information of the component to be filtered, so as to determine whether there is a partition block in the current frame that allows filtering using a preset network model under the component to be filtered.

[0088] It should be noted that, for the first syntax element identification information, it can be specifically determined by decoding the value of the identification information. In some embodiments, the parsing of the bitstream to determine the first syntax element identification information of the component to be filtered of the current frame may include:

[0089] Parse the code stream to obtain the value of the first syntax element identification information;

[0090] Accordingly, the method may further include:

[0091] If the value of the first syntax element identification information is the first value, determining that the first syntax element identification information indicates that there is a to-be-filtered component of the divided block in the current frame that allows filtering using a preset network model;

[0092] If the value of the first syntax element identification information is the second value, it is determined that the first syntax element identification information indicates that all components to be filtered of at least one partition block included in the current frame are not allowed to be filtered using the preset network model.

[0093] In the embodiment of the present application, the first value and the second value are different, and the first value and the second value can be in parameter form or in digital form. Specifically, the first syntax element identification information can be a parameter written in the profile or a flag value, which is not specifically limited here.

[0094] For example, taking flag as an example, there are two ways to set the flag: an enable flag (enable_flag) and a disable flag (disable_flag). Assuming that the value of the enable flag is a first value and the value of the disable flag is a second value; then for the first value and the second value, the first value can be set to 1 and the second value can be set to 0; or, the first value can also be set to true (true) and the second value can also be set to false (false); however, this embodiment of the application is not specifically limited to this.

[0095] It should also be noted that, for the first syntax element identification information, the decoder first needs to decode and determine the third syntax element identification information of the to-be-filtered component of the current frame, and then determine whether to decode the first syntax element identification information. Therefore, in some embodiments, the parsing of the bitstream to determine the first syntax element identification information of the current frame may include:

[0096] Parsing the code stream to determine the third syntax element identification information of the to-be-filtered component of the current frame;

[0097] When the third syntax element identification information indicates that all to-be-filtered components of at least one partitioned block included in the current frame are not filtered using the preset network model, the bitstream is parsed to determine the first syntax element identification information of the to-be-filtered components of the current frame.

[0098] In an embodiment of the present application, the third syntax element identification information is also a frame-level syntax element, which can be used to indicate whether all components to be filtered of at least one partitioned block included in the current frame are filtered using the preset network model. In other words, the third syntax element identification information can determine whether all components to be filtered of at least one partitioned block included in the current frame are filtered using the preset network model, or whether not all components to be filtered of at least one partitioned block included in the current frame are filtered using the preset network model.

[0099] Exemplarily, if the component to be filtered is a luminance color component, the third syntax element identification information may be ph_nnlf_luma_ctrl_flag; if the component to be filtered is a chrominance color component, the third syntax element identification information may be ph_nnlf_chroma_ctrl_flag. That is, for different color components in the current frame, different third syntax element identification information is set accordingly. Specifically, after parsing the bitstream, the decoder may first determine the third syntax element identification information of the component to be filtered. Only when the third syntax element identification information indicates that the components to be filtered of at least one partitioned block included in the current frame are not all filtered using the preset network model, does the decoder need to decode to obtain the value of the first syntax element identification information.

[0100] In a specific embodiment, parsing the bitstream to determine the third syntax element identification information of the to-be-filtered component of the current frame may include: parsing the bitstream to obtain a value of the third syntax element identification information;

[0101] Accordingly, the method may further include:

[0102] If the value of the third syntax element identification information is the first value, determining that the third syntax element identification information indicates that all to-be-filtered components of at least one partitioned block included in the current frame are filtered using a preset network model;

[0103] If the value of the third syntax element identification information is the second value, it is determined that the third syntax element identification information indicates that not all to-be-filtered components of at least one partitioned block included in the current frame are filtered using the preset network model.

[0104] In an embodiment of the present application, when the third syntax element identification information is a flag, for the first value and the second value, the first value can be set to 1 and the second value can be set to 0; or, the first value can also be set to true and the second value can also be set to false; however, this embodiment of the present application does not make any specific limitations.

[0105] In an embodiment of the present application, the first syntax element identification information and the third syntax element identification information are both frame-level syntax elements. Exemplarily, the third syntax element identification information may also be referred to as a frame-level switch identification bit, and the first syntax element identification information may also be referred to as a frame-level usage identification bit. Wherein, when the frame-level switch identification bit is true, at this time, all the components to be filtered of at least one partitioned block included in the current frame are filtered using a preset network model, then there is no need to parse the code stream, and the frame-level usage identification bit can be directly set to true; only when the frame-level switch identification bit is false, at this time, all the components to be filtered of at least one partitioned block included in the current frame are not filtered using a preset network model, then it is necessary to continue to parse the code stream to determine the frame-level usage identification bit, that is, the first syntax element identification information.

[0106] S602: When the first syntax element identification information indicates that there are to-be-filtered components of the divided blocks in the current frame that allow filtering using a preset network model, parse the bitstream to determine second syntax element identification information of the to-be-filtered components of the current block.

[0107] It should be noted that, in an embodiment of the present application, if the first syntax element identification information is true, then the first syntax element identification information indicates that there is a to-be-filtered component of a partitioned block in the current frame that allows filtering using a preset network model, then it is necessary to continue parsing the code stream to determine the second syntax element identification information of the to-be-filtered component of the current block. In addition, the current block here specifically refers to the partitioned block to be loop filtered, which can be any one of the at least one partitioned block included in the current frame. Here, the current block can be a current coding unit, a current prediction unit, or a current transform unit, or even a current coding tree unit (CTU). The following will be specifically described using the current block as the current coding tree unit as an example.

[0108] It should also be noted that in this embodiment of the present application, the second syntax element identification information is a coding tree unit-level syntax element, which can be used to indicate whether the components to be filtered in the current block are filtered using a preset network model. The second syntax element identification information can also be referred to as a coding tree unit usage flag. In other words, the second syntax element identification information can determine whether the components to be filtered in the current coding tree unit are filtered using a preset network model or whether the components to be filtered in the current coding tree unit are not filtered using a preset network model.

[0109] Exemplarily, if the component to be filtered is a luminance color component, the second syntax element identification information may be ctb_nnlf_luma_flag; if the component to be filtered is a chrominance color component, the second syntax element identification information may be ctb_nnlf_chroma_flag. That is to say, different second syntax element identification information is set for different color components in the current coding tree unit. Specifically, after parsing the bitstream, the decoder may first determine the third syntax element identification information of the component to be filtered. When the third syntax element identification information indicates that the components to be filtered of at least one partitioned block included in the current frame are not all filtered using the preset network model, the decoder also needs to decode to obtain the value of the first syntax element identification information; only when the first syntax element identification information indicates that the components to be filtered of the partitioned blocks in the current frame are allowed to be filtered using the preset network model, the decoder will continue to decode to obtain the value of the second syntax element identification information.

[0110] In a specific embodiment, parsing the bitstream to determine the second syntax element identification information of the to-be-filtered component of the current block may include: parsing the bitstream to obtain a value of the second syntax element identification information.

[0111] Accordingly, the method may further include:

[0112] If the value of the second syntax element identification information is the first value, determining that the second syntax element identification information indicates that the to-be-filtered component of the current block is filtered using a preset network model;

[0113] If the value of the second syntax element identification information is the second value, it is determined that the second syntax element identification information indicates that the to-be-filtered component of the current block is not filtered using the preset network model.

[0114] In the embodiment of the present application, the first value and the second value are different, and the first value and the second value can be in parameter form or in numerical form. Specifically, whether it is the first syntax element identification information, the second syntax element identification information, or the third syntax element identification information, they can all be parameters written in the profile or the value of a flag, and this is not specifically limited here.

[0115] For example, in an embodiment of the present application, when the second syntax element identification information is a flag, for the first value and the second value, the first value can be set to 1 and the second value can be set to 0; or, the first value can also be set to true and the second value can also be set to false; however, the embodiment of the present application does not make specific limitations.

[0116] It should also be noted that, in the embodiment of the present application, the third syntax element identification information can be referred to as a frame-level switch flag, the first syntax element identification information can be referred to as a frame-level usage flag, and the second syntax element identification information can be referred to as a coding tree unit flag. Thus, when the frame-level switch flag is true, all the components to be filtered of at least one partition block included in the current frame are filtered using the preset network model, and then there is no need to parse the bitstream, and the frame-level usage flag and all coding tree unit usage flags in the current frame can be directly set to true; only when the frame-level switch flag is false, all the components to be filtered of at least one partition block included in the current frame are not filtered using the preset network model, then it is necessary to continue parsing the bitstream to determine the frame-level usage flag; and then when the frame-level usage flag is true, continue parsing the bitstream to determine the coding tree unit usage flag of each partition block in the current frame.

[0117] S603: When the second syntax element identification information indicates that the to-be-filtered component of the current block is filtered using a preset network model, determine the block quantization parameter information of the current block; wherein the block quantization parameter information includes at least a block quantization parameter value of the first color component and a block quantization parameter value of the second color component.

[0118] S604: Determine the reconstructed value of the component to be filtered of the current block, input the reconstructed value of the component to be filtered of the current block and the block quantization parameter information of the current block into a preset network model, and determine the filtered reconstructed value of the component to be filtered of the current block.

[0119] In an embodiment of the present application, for the current block, if the decoding determines that the second syntax element identification information indicates that the component to be filtered of the current block is filtered using a preset network model, then it is also necessary to determine the block quantization parameter information of the current block and the reconstruction value of the component to be filtered of the current block, and then input the reconstruction value of the component to be filtered of the current block and the block quantization parameter information of the current block into the preset network model, so that the filtered reconstruction value of the component to be filtered of the current block can be determined.

[0120] In order to provide more information for the luminance color component and the chrominance color component to improve the encoding and decoding performance, the embodiment of the present application requires not only the luminance color component to input a quantization parameter channel, but also the chrominance color component to input a quantization parameter channel; therefore, the block quantization parameter information here may include at least the block quantization parameter value of the luminance color component and the block quantization parameter value of the chrominance color component. Exemplarily, the block quantization parameter value of the first color component may be the block quantization parameter value of the luminance color component (represented by ctb_nnlf_luma_baseqp), and the block quantization parameter value of the second color component may be the block quantization parameter value of the chrominance color component (represented by ctb_nnlf_chroma_baseqp).

[0121] In a possible embodiment, determining the block quantization parameter information of the current block may include:

[0122] Parse the bitstream to determine a first quantization parameter index and a second quantization parameter index of the current block;

[0123] Determining, according to the first quantization parameter index, a block quantization parameter value of a first color component corresponding to the current block from a first quantization parameter candidate set; and

[0124] According to the second quantization parameter index, a block quantization parameter value of the second color component corresponding to the current block is determined from the second quantization parameter candidate set.

[0125] Here, the first quantization parameter candidate set may be composed of candidate quantization parameter values ​​of at least two first color components, and the second quantization parameter candidate set may be composed of candidate quantization parameter values ​​of at least two second color components.

[0126] It should be noted that in the embodiment of the present application, the first quantization parameter index and the second quantization parameter index are written into the bitstream. In this case, the decoder can obtain the first quantization parameter index by parsing the bitstream; then, based on the first quantization parameter index, it can determine the block quantization parameter value of the first color component from the first quantization parameter candidate set. The decoder can also obtain the second quantization parameter index by parsing the bitstream; then, based on the second quantization parameter index, it can determine the block quantization parameter value of the second color component from the second quantization parameter candidate set.

[0127] In another possible embodiment, determining the block quantization parameter information of the current block may include:

[0128] Parse the code stream to determine a block quantization parameter value of a first color component and a block quantization parameter value of a second color component corresponding to the current block.

[0129] It should be noted that in the embodiment of the present application, the block quantization parameter value of the first color component and the block quantization parameter value of the second color component are written into the bitstream. In this way, the decoder can directly determine the block quantization parameter value of the first color component and the block quantization parameter value of the second color component by parsing the bitstream.

[0130] It should also be noted that, in the embodiment of the present application, for the luma color component, if the value of the second syntax element identification information of the luma color component of the current block is true, then the luma color component of the current block is filtered using a preset network model, and then it is necessary to decode to obtain the block quantization parameter value of the luma color component; for the chroma color component, if the value of the second syntax element identification information of the chroma color component of the current block is true, then the chroma color component of the current block is filtered using a preset network model, and then it is necessary to decode to obtain the block quantization parameter value of the chroma color component. It should be noted that if the value of the second syntax element identification information of the luma color component of the current block is false and the value of the second syntax element identification information of the chroma color component is true, then it is necessary to use the preset network model to filter the chroma color component of the current block. At this time, the input block quantization parameter value still includes the block quantization parameter value of the luma color component and the block quantization parameter value of the chroma color component, and the block quantization parameter value of the luma color component obtained from the bitstream is the default value. On the contrary, if the value of the second syntax element identification information of the chrominance color component of the current block is false and the value of the second syntax element identification information of the luminance color component is true, then the luminance color component of the current block needs to be filtered using the preset network model. At this time, the input block quantization parameter value still includes the block quantization parameter value of the luminance color component and the block quantization parameter value of the chrominance color component, and the block quantization parameter value of the chrominance color component obtained from the bitstream is the default value.

[0131] It is understandable that, during the decoding and reconstruction process, the decoder also needs to determine the reconstructed value of the component to be filtered of the current block. In some embodiments, the determination of the reconstructed value of the component to be filtered of the current block may include:

[0132] Parse the bitstream to determine the reconstructed residual value of the to-be-filtered component of the current block;

[0133] Performing intra-frame or inter-frame prediction on the component to be filtered of the current block to determine a predicted value of the component to be filtered of the current block;

[0134] A reconstructed value of the component to be filtered of the current block is determined according to the reconstructed residual value of the component to be filtered of the current block and the predicted value of the component to be filtered of the current block.

[0135] In a specific embodiment, parsing the bitstream to determine the reconstructed residual value of the component to be filtered of the current block may include: parsing the bitstream to obtain a target residual value of the component to be filtered of the current block; and performing inverse quantization and inverse transformation on the target residual value of the component to be filtered of the current block to obtain the reconstructed residual value of the component to be filtered of the current block.

[0136] In a specific embodiment, determining the reconstructed value of the component to be filtered of the current block based on the reconstructed residual value of the component to be filtered of the current block and the predicted value of the component to be filtered of the current block may include: adding the reconstructed residual value of the component to be filtered of the current block and the predicted value of the component to be filtered of the current block to obtain the reconstructed value of the component to be filtered of the current block.

[0137] Here, for the current block, the reconstructed residual value of the component to be filtered of the current block can be obtained by decoding; then, the component to be filtered of the current block is predicted intra-frame or inter-frame to determine the predicted value of the component to be filtered of the current block; then, the reconstructed residual value of the component to be filtered and the predicted value of the component to be filtered are added together to obtain the reconstructed value of the component to be filtered of the current block, that is, the reconstructed YUV information described above; and then it is used as the input of the preset network model to determine the filtered reconstructed value of the component to be filtered of the current block.

[0138] It should also be noted that after parsing the bitstream and determining the second syntax element identification information of the component to be filtered of the current block, in some embodiments, the method may further include: when the second syntax element identification information indicates that the component to be filtered of the current block is not filtered using a preset network model, directly determining the reconstructed value of the component to be filtered of the current block as the filtered reconstructed value of the component to be filtered of the current block.

[0139] That is to say, after decoding to determine the second syntax element identification information of the current block, if the second syntax element identification information indicates that the component to be filtered of the current block is filtered using a preset network model, then the reconstruction value of the component to be filtered of the current block and the block quantization parameter information can be input into the preset network model, so as to obtain the filtered reconstruction value of the component to be filtered of the current block; if the second syntax element identification information indicates that the component to be filtered of the current block is not filtered using the preset network model, then the reconstruction value of the component to be filtered of the current block can be directly determined as the filtered reconstruction value of the component to be filtered of the current block.

[0140] It should also be noted that, after parsing the bitstream and determining the first syntax element identification information of the to-be-filtered component of the current frame, in some embodiments, the method may further include:

[0141] When the first syntax element identification information indicates that all to-be-filtered components of at least one partitioned block included in the current frame are not allowed to be filtered using the preset network model, setting the values ​​of the second syntax element identification information of the to-be-filtered components of the partitioned block to the second value;

[0142] After determining the reconstructed value of the component to be filtered of the divided block, the reconstructed value of the component to be filtered of the divided block is directly determined as the filtered reconstructed value of the component to be filtered of the divided block.

[0143] That is to say, after decoding to determine the first syntax element identification information of the component to be filtered of the current frame, if the first syntax element identification information indicates that there are components to be filtered in the partitioned blocks in the current frame that are allowed to be filtered using the preset network model, then it is necessary to continue decoding to determine the second syntax element identification information, and then determine the filtered reconstruction value of the component to be filtered of the current block based on the second syntax element identification information; conversely, if the first syntax element identification information indicates that all components to be filtered of at least one partitioned block included in the current frame are not allowed to be filtered using the preset network model, then the value of the second syntax element identification information of the component to be filtered of this at least one partitioned block can be set to the second value; then after determining the reconstruction value of the component to be filtered of each partitioned block, the reconstruction value of the component to be filtered of each partitioned block is directly determined as the filtered reconstruction value of the component to be filtered of the partitioned block; subsequently, other loop filtering methods need to be continued to be executed, and a complete reconstructed image is output after all loop filtering methods are executed.

[0144] It should also be noted that, after parsing the bitstream and determining the third syntax element identification information of the to-be-filtered component of the current frame, in some embodiments, the method may further include:

[0145] When the third syntax element identification information indicates that all to-be-filtered components of at least one divided block included in the current frame are filtered using a preset network model, parsing the bitstream to determine frame quantization parameter information of the current frame; wherein the frame quantization parameter information includes at least a frame quantization parameter value of the first color component and a frame quantization parameter value of the second color component;

[0146] Setting the value of the first syntax element identification information of the to-be-filtered component of the current frame to the first value, setting the values ​​of the second syntax element identification information of the to-be-filtered component of the divided blocks in the current frame to the first value, and determining the block quantization parameter information of the divided blocks according to the frame quantization parameter information of the current frame;

[0147] After determining the reconstructed value of the component to be filtered of the partitioned block, the reconstructed value of the component to be filtered of the partitioned block and the block quantization parameter information of the partitioned block are input into a preset network model to determine the filtered reconstructed value of the component to be filtered of the partitioned block.

[0148] That is to say, after decoding to determine the third syntax element identification information of the to-be-filtered components of the current frame, if the third syntax element identification information indicates that not all of the to-be-filtered components of at least one partitioned block included in the current frame are filtered using the preset network model, then it is necessary to continue decoding to determine the first syntax element identification information and the second syntax element identification information, and then determine the filtered reconstruction value of the to-be-filtered components of the current block based on the two syntax element identification information; conversely, if the third syntax element identification information indicates that all of the to-be-filtered components of at least one partitioned block included in the current frame are filtered using the preset network model, then it is only necessary to decode to determine the frame quantization parameter information of the current frame; then the values ​​of the first syntax element identification information and the second syntax element identification information are both set to the first value, and the block quantization parameter information of all the partitioned blocks included in the current frame is determined based on the frame quantization parameter information of the current frame.

[0149] In an embodiment of the present application, the frame quantization parameter information includes at least a frame quantization parameter value of a first color component and a frame quantization parameter value of a second color component. For example, the first color component is a luminance color component, and the second color component is a chrominance color component. In one possible embodiment, parsing the bitstream to determine the frame quantization parameter information of the current frame may include:

[0150] Parse the code stream to determine the third quantization parameter index and the fourth quantization parameter index of the current frame;

[0151] Determining, according to the third quantization parameter index, a frame quantization parameter value of the first color component corresponding to the current frame from the first quantization parameter candidate set; and

[0152] According to the fourth quantization parameter index, a frame quantization parameter value of the second color component corresponding to the current frame is determined from the second quantization parameter candidate set.

[0153] Here, the first quantization parameter candidate set may be composed of candidate quantization parameter values ​​of at least two first color components, and the second quantization parameter candidate set may be composed of candidate quantization parameter values ​​of at least two second color components. It should be noted that for the same frame, the first quantization parameter candidate set and the second quantization parameter candidate set may be the same; different frames may have different corresponding first quantization parameter candidate sets and different corresponding second quantization parameter candidate sets.

[0154] It should also be noted that in this embodiment of the present application, the third quantization parameter index and the fourth quantization parameter index may be written into the bitstream. In this case, the decoder can obtain the third quantization parameter index by parsing the bitstream; then, based on the third quantization parameter index, it can determine the frame quantization parameter value of the first color component from the first quantization parameter candidate set. The decoder can also obtain the fourth quantization parameter index by parsing the bitstream; then, based on the fourth quantization parameter index, it can determine the frame quantization parameter value of the second color component from the second quantization parameter candidate set. For example, the frame quantization parameter value of the luma color component can be represented by ph_nnlf_luma_baseqp, and the frame quantization parameter value of the chroma color component can be represented by ph_nnlf_chroma_baseqp.

[0155] In another possible embodiment, parsing the bitstream to determine the frame quantization parameter information of the current frame may include:

[0156] Parse the code stream to determine the frame quantization parameter value of the first color component and the frame quantization parameter value of the second color component corresponding to the current frame.

[0157] It should be noted that in the embodiment of the present application, the frame quantization parameter value of the first color component and the frame quantization parameter value of the second color component are written into the bitstream. In this way, the decoder can directly determine the frame quantization parameter value of the first color component and the frame quantization parameter value of the second color component by parsing the bitstream.

[0158] It should also be noted that, in an embodiment of the present application, when decoding determines that all the components to be filtered of at least one divided block included in the current frame are filtered using the preset network model, the frame quantization parameter information of the current frame is determined by parsing the code stream; then the block quantization parameter value of the luminance color component of the current block is assigned to the frame quantization parameter value of the luminance color component, that is, ctb_nnlf_luma_baseqp=ph_nnlf_luma_baseqp, and the block quantization parameter value of the chrominance color component of the current block is assigned to the frame quantization parameter value of the chrominance color component, that is, ctb_nnlf_chroma_baseqp=ph_nnlf_chroma_baseqp.

[0159] It can also be understood that in the embodiments of the present application, new syntax elements are introduced, such as first syntax element identification information, second syntax element identification information, and third syntax element identification information of the component to be filtered. In some embodiments, the component to be filtered includes at least a luma color component and a chroma color component; the method may further include:

[0160] When the color component type of the current frame is a luma color component, determining that the third syntax element identification information is frame-level luma switch identification information of the current frame, the first syntax element identification information is frame-level luma enable identification information of the current frame, and the second syntax element identification information is block-level luma usage identification information of the current block; wherein the frame-level luma switch identification information is used to indicate whether all luma color components of at least one divided block included in the current frame are filtered using a preset network model, the frame-level luma enable identification information is used to indicate whether luma color components of divided blocks in the current frame are allowed to be filtered using the preset network model, and the block-level luma usage identification information is used to indicate whether the luma color component of the current block is filtered using the preset network model;

[0161] When the color component type of the current frame is a chroma color component, the third syntax element identification information is determined to be the frame-level chroma switch identification information of the current frame, the first syntax element identification information is the frame-level chroma enable identification information of the current frame, and the second syntax element identification information is the block-level chroma usage identification information of the current block; wherein, the frame-level chroma switch identification information is used to indicate whether all the chroma color components of at least one partitioned block included in the current frame are filtered using a preset network model, the frame-level chroma enable identification information is used to indicate whether the chroma color components of the partitioned blocks in the current frame are allowed to be filtered using a preset network model, and the block-level chroma usage identification information is used to indicate whether the chroma color components of the current block are filtered using a preset network model.

[0162] Here, for the luminance color component, the frame-level luminance switch identification information can be represented by ph_nnlf_luma_ctrl_flag, the frame-level luminance enable identification information can be represented by ph_nnlf_luma_enable_flag, and the block-level luminance usage identification information can be represented by ctb_nnlf_luma_flag; for the chrominance color component, the frame-level chrominance switch identification information can be represented by ph_nnlf_chroma_ctrl_flag, the frame-level chrominance enable identification information can be represented by ph_nnlf_chroma_enable_flag, and the block-level chrominance usage identification information can be represented by ctb_nnlf_chroma_flag.

[0163] Furthermore, in an embodiment of the present application, a sequence-level syntax element may be provided to determine whether the current sequence allows the use of a neural network-based loop filtering technique. The method may further include:

[0164] Parsing the code stream to determine identification information of the fourth syntax element;

[0165] When the fourth syntax element identification information indicates that the to-be-filtered components of the current sequence are allowed to use the preset network model for filtering, the method further includes the steps of: parsing the code stream; and determining the third syntax element identification information of the to-be-filtered components of the current frame.

[0166] It should be noted that in the embodiments of the present application, the fourth syntax element identification information is a sequence-level syntax element, which can be used to indicate whether the to-be-filtered components of the current sequence are allowed to use the preset network model for filtering. That is, according to different values of the fourth syntax element identification information, it can be determined whether the to-be-filtered components of the current sequence are allowed to use the preset network model for filtering or not.

[0167] It should be further noted that in the embodiments of the present application, the fourth syntax element identification information can be represented by sps_nnlf_enable_flag. If at least one of the luminance color component and the chroma color component of the current sequence is allowed to use the preset network model for filtering, it means that the value of sps_nnlf_enable_flag is true, that is, the to-be-filtered components of the current sequence are allowed to use the preset network model for filtering; if none of the luminance color component and the chroma color component of the current sequence is allowed to use the preset network model for filtering, it means that the value of sps_nnlf_enable_flag is false, that is, the to-be-filtered components of the current sequence are not allowed to use the preset network model for filtering.

[0168] In a specific embodiment, the step of parsing the code stream to determine the fourth syntax element identification information can include the step of: parsing the code stream to obtain the value of the fourth syntax element identification information.

[0169] Correspondingly, the method can further include the steps of:

[0170] If the value of the fourth syntax element identification information is the first value, it is determined that the fourth syntax element identification information indicates that the to-be-filtered components of the current sequence are allowed to use the preset network model for filtering.

[0171] If the value of the fourth syntax element identification information is the second value, it is determined that the fourth syntax element identification information indicates that the to-be-filtered components of the current sequence are not allowed to use the preset network model for filtering.

[0172] In the embodiments of the present application, the first value and the second value are different, and the first value and the second value can be in the form of a parameter or in the form of a number. Specifically, for the fourth syntax element identification information, it can be a parameter written in a profile, or it can be a value of a flag, which is not limited here.

[0173] Exemplarily, in an embodiment of the present application, when the fourth syntax element identification information is a flag, for the first value and the second value, the first value can be set to 1 and the second value can be set to 0; or, the first value can also be set to true and the second value can also be set to false; however, this embodiment of the present application does not make any specific limitations.

[0174] It should also be noted that the fourth syntax element identification information can be called a sequence-level flag. The decoder first decodes to obtain the sequence-level flag. If the value of sps_nnlf_enable_flag is true, it indicates that the current bitstream allows the use of loop filtering technology based on the preset network model, and the subsequent decoding process requires parsing of related syntax elements. Otherwise, it indicates that the current bitstream does not allow the use of loop filtering technology based on the preset network model, and the subsequent decoding process does not require parsing of related syntax elements, and the related syntax elements are defaulted to the initial value or false state.

[0175] Furthermore, in an embodiment of the present application, the preset network model may be a neural network model, and the neural network model includes at least: a convolutional layer, an activation layer, a splicing layer, and a skip connection layer.

[0176] It should be noted that for the preset network model, its input may include: the reconstructed value of the component to be filtered (represented by rec_yuv), the quantization parameter value of the luminance color component (represented by BaseQPluma) and the quantization parameter value of the chrominance color component (represented by BaseQPchroma); its output may be: the reconstructed value of the component to be filtered after filtering (represented by output_yuv). Since the embodiment of the present application removes non-important input elements such as predicted YUV information and YUV information with partitioning information, the computational complexity of network model reasoning can be reduced, which is beneficial to the implementation of the decoding end and reduces the decoding time. In addition, in the embodiment of the present application, the input of the preset network model may also include the quantization parameter (SliceQP) of the current frame, but SliceQP does not need to distinguish between the luminance color component and the chrominance color component.

[0177] It should also be noted that for the preset network model, the main structure of the network is the same as the aforementioned Figure 2 or Figure 4 Similarly, its main structure is also composed of multiple residual blocks, and the composition structure of the residual block can be seen in detail. Figure 3 shown.

[0178] For example, see Figure 7 , which shows a schematic diagram of the network architecture of a neural network model provided by an embodiment of the present application. Figure 7As shown in the figure, at the input end, the reconstructed value of the component to be filtered is processed by the convolution layer and the activation layer, and then the quantization parameter value of the brightness color component and the quantization parameter value of the chrominance color component are spliced, and then the spliced ​​structure is sent to the main structure; and there is also a jump connection structure, which connects the input reconstructed value of the component to be filtered with the output after the Pixel Shuffle module, and finally outputs the filtered reconstructed value of the component to be filtered. Specifically, in Figure 7 In

[15] , the input of the network architecture mainly includes the reconstructed YUV information (rec_yuv), BaseQPluma and BaseQPchroma, and the output of the network architecture is the output filtered component information (output_yuv).

[0179] Thus, the embodiment of the present application proposes a loop filtering technology based on a neural network model with multiple BaseQP inputs. The main idea is to input the luma color component into a single channel of BaseQPluma, while also inputting the chroma color component into a single channel of BaseQPchroma, while keeping the number of models unchanged. In this way, the embodiment of the present application can provide more information for the luma and chroma color components by increasing the amount of inference calculation without increasing the number of models, while also providing more options and adaptation for the luma and chroma color components.

[0180] Furthermore, in some embodiments, the input of the preset network model is the reconstructed value of the component to be filtered of the current block and the block quantization parameter information of the current block. The method may also include: determining that the output of the preset network model is the filtered reconstructed value of the component to be filtered of the current block.

[0181] Furthermore, in some embodiments, the input of the preset network model is the reconstructed value of the component to be filtered of the current block and the block quantization parameter information of the current block, and the output of the preset network model may also be residual information. Figure 8 As shown, the method may further include:

[0182] S801: Determine the reconstructed value of the component to be filtered of the current block, input the reconstructed value of the component to be filtered of the current block and the block quantization parameter information of the current block into a preset network model, and output the first residual value of the component to be filtered of the current block through the preset network model.

[0183] S802: Determine a filtered reconstructed value of the component to be filtered of the current block according to the reconstructed value of the component to be filtered of the current block and a first residual value of the component to be filtered of the current block.

[0184] It should be noted that, in the embodiment of the present application, the output of the preset network model can be directly the filtered reconstructed value of the component to be filtered of the current block, or it can be the first residual value of the component to be filtered of the current block. In the latter case, the decoder also needs to perform an addition operation on the reconstructed value of the component to be filtered of the current block and the first residual value of the component to be filtered of the current block to determine the filtered reconstructed value of the component to be filtered of the current block.

[0185] It should also be noted that, in the embodiment of the present application, a scaling process can be added to the output end of the preset network model, that is, the first residual value of the filter component is scaled using the residual scaling factor. Figure 9 As shown, the method may further include:

[0186] S901: Analyze the code stream and determine the residual scaling factor.

[0187] S902: Scaling the first residual value of the component to be filtered of the current block according to the residual scaling factor to obtain a second residual value of the component to be filtered of the current block.

[0188] S903: Determine a filtered reconstructed value of the component to be filtered of the current block according to the reconstructed value of the component to be filtered of the current block and the second residual value of the component to be filtered of the current block.

[0189] It should be noted that if the output of the preset network model is residual information, then it needs to be superimposed with the reconstructed samples of the current block as the output of the loop filter tool based on the preset network model; if the output of the preset network model is a complete reconstructed sample, then the model output is the output of the loop filter tool based on the preset network model. However, in one possible embodiment, the model output generally also needs to be scaled. Taking the model output as residual information as an example, the preset network model infers and outputs the residual information of the current block. This residual information is scaled and then superimposed with the reconstructed samples of the current block; and this residual scaling factor is obtained by the encoder, which needs to be written into the code stream and transmitted to the decoder so that the decoder can obtain the residual scaling factor through decoding.

[0190] Furthermore, in some embodiments, the method may further include:

[0191] Traversing at least one partitioned block in the current frame, taking each partitioned block as the current block in turn, and repeatedly performing the steps of parsing the bitstream and determining the value of the second syntax element identification information of the to-be-filtered component of the current block, so as to obtain a filtered reconstructed value corresponding to each of the at least one partitioned block;

[0192] A reconstructed image of the current frame is determined according to the filtered reconstruction value corresponding to each of the at least one divided block.

[0193] It should be noted that, for the current frame, the current frame may include at least one partitioned block. These partitioned blocks are then traversed, with each partitioned block used as the current block in turn, and the decoding method process of the embodiment of the present application is repeatedly executed to obtain the filtered reconstruction value corresponding to each partitioned block; based on these obtained filtered reconstruction values, the reconstructed image of the current frame can be determined. Furthermore, it should be noted that the decoder can also continue to traverse other loop filtering tools and output a complete reconstructed image upon completion. The specific process is not closely related to the embodiment of the present application and is therefore not described in detail here.

[0194] Furthermore, in some embodiments, due to the different quality requirements for I-frames and B-frames in video encoding, I-frames often require higher encoding quality to facilitate B-frames as a reference. Therefore, for I-frames and B-frames, the decoding method of the embodiment of the present application only allows B-frames to use different quantization parameters (BaseQPluma and BaseQPchroma) for luminance and chrominance components, while the quantization parameter inputs for luminance and chrominance components of I-frames are consistent. This not only reduces encoding and decoding time, but also saves the bit overhead of quantization parameter transmission on I-frames, further improving compression efficiency.

[0195] Furthermore, in some embodiments, the embodiments of the present application only add one layer of chrominance quantization parameters as an additional input. In addition, quantization parameters for the Cb color component and the Cr color component may be added as additional inputs respectively.

[0196] Furthermore, in some embodiments, the loop filtering enhancement method based on the neural network model proposed in the embodiments of the present application can also be extended to other input parts, such as boundary strength, etc., which is not specifically limited in the embodiments of the present application.

[0197] This embodiment provides a decoding method, which determines first syntax element identification information of a component to be filtered of a current frame by parsing a bitstream; when the first syntax element identification information indicates that there are components to be filtered in divided blocks in the current frame and allow filtering using a preset network model, the bitstream is parsed to determine second syntax element identification information of the component to be filtered of the current block; and when the second syntax element identification information indicates that the components to be filtered of the current block are filtered using a preset network model, the block quantization parameter information of the current block is determined; wherein the block quantization parameter information includes at least a block quantization parameter value of a first color component and a block quantization parameter value of a second color component; and then determines a reconstructed value of the component to be filtered of the current block, inputs the reconstructed value of the component to be filtered of the current block and the block quantization parameter information of the current block into the preset network model, and determines the filtered reconstructed value of the component to be filtered of the current block. In this way, for the input of the preset network model, since it only includes the reconstructed values ​​and block quantization parameter information of the components to be filtered, the prediction information, division information and other non-important input elements of the color components are removed, the amount of calculation during network model inference can be reduced, which is beneficial to the implementation of the decoding end and reduces the decoding time; in addition, since the input block quantization parameter information includes block quantization parameter values ​​of at least two color components, that is, multi-channel quantization parameters are used as input, the luminance color component and the chrominance color component can have more choices and adaptations; and by introducing new syntax elements, the decoding end does not need to store multiple neural network models to achieve a more flexible configuration, which is beneficial to improving encoding performance and thus improving encoding and decoding efficiency.

[0198] In another embodiment of the present application, based on the decoding method described in the above embodiment, see Figure 10 , which shows a schematic flow chart of an encoding method provided by an embodiment of the present application. Figure 10 As shown, the method may include:

[0199] S1001: Determine first syntax element identification information of a to-be-filtered component of a current frame.

[0200] It should be noted that in the implementation of this application, the method is applied to the encoder, and specifically can be applied to a loop filtering method based on a neural network model. More specifically, it can be a loop filtering method obtained based on a neural network model with multiple quantization parameter inputs.

[0201] It should also be noted that, in this embodiment of the present application, the first syntax element identification information is a frame-level syntax element, which can be used to indicate whether the components to be filtered in the partitioned blocks in the current frame are allowed to be filtered using the preset network model. In addition, the current frame may include at least one partitioned block, and the current block is any one of the at least one partitioned block. In other words, the first syntax element identification information can determine whether all the components to be filtered in the at least one partitioned block included in the current frame are not allowed to be filtered using the preset network model.

[0202] For example, in the embodiment of the present application, the component to be filtered may refer to a color component. The color component may include at least one of the following: a first color component, a second color component, and a third color component. The first color component may be a luminance color component, and the second color component and the third color component may be chrominance color components (for example, the second color component is a blue chrominance color component, and the third color component is a red chrominance color component; or the second color component is a red chrominance color component, and the third color component is a blue chrominance color component).

[0203] Furthermore, for the current frame, the frame-level syntax element identification information of the components to be filtered of the current frame may include first syntax element identification information and third syntax element identification information. Before determining the first syntax element identification information, the encoder first needs to determine the third syntax element identification information of the components to be filtered of the current frame. In some embodiments, determining the first syntax element identification information of the components to be filtered of the current frame may include: determining the third syntax element identification information of the components to be filtered of the current frame; and determining the first syntax element identification information of the components to be filtered of the current frame when the third syntax element identification information indicates that the components to be filtered of at least one partitioned block included in the current frame are not all filtered using a preset network model.

[0204] In the embodiments of the present application, the third syntax element identification information is used to indicate whether all the to-be-filtered components of the at least one divided block included in the current frame are filtered by using the preset network model, and the first syntax element identification information is used to indicate whether there is a to-be-filtered component of the divided block in the current frame which is allowed to be filtered by using the preset network model. For example, if the to-be-filtered component is a luminance color component, the first syntax element identification information can be ph_nnlf_luma_enable_flag, and the third syntax element identification information can be ph_nnlf_luma_ctrl_flag; if the to-be-filtered component is a chroma color component, the first syntax element identification information can be ph_nnlf_chroma_enable_flag, and the third syntax element identification information can be ph_nnlf_chroma_ctrl_flag. That is, different first syntax element identification information and third syntax element identification information are set for different color components in the current frame.

[0205] In the embodiments of the present application, whether all the to-be-filtered components of the at least one divided block included in the current frame are filtered by using the preset network model and / or whether there is a to-be-filtered component of the divided block in the current frame which is allowed to be filtered by using the preset network model can be determined by using a distortion mode. For example, the distortion mode can be a rate-distortion cost mode. After the rate-distortion cost values in different cases are calculated, whether all the to-be-filtered components of the at least one divided block included in the current frame are filtered by using the preset network model is determined according to the size of the rate-distortion cost value, that is, the value of the third syntax element identification information is determined; and / or whether there is a to-be-filtered component of the divided block in the current frame which is allowed to be filtered by using the preset network model is determined according to the size of the rate-distortion cost value, that is, the value of the first syntax element identification information is determined.

[0206] In a specific embodiment, the method can further include:

[0207] determining a first rate-distortion cost value that all the to-be-filtered components of the at least one divided block included in the current frame are not filtered by using the preset network model;

[0208] determining a second rate-distortion cost value that all the to-be-filtered components of the at least one divided block included in the current frame are filtered by using the preset network model;

[0209] determining a third rate-distortion cost value that there is a to-be-filtered component of the divided block in the current frame which is allowed to be filtered by using the preset network model;

[0210] The frame-level syntax element identification information of the to-be-filtered component of the current frame is determined according to the first rate-distortion cost value, the second rate-distortion cost value and the third rate-distortion cost value; wherein the frame-level syntax element identification information includes the first syntax element identification information and the third syntax element identification information.

[0211] It should be noted that, in the embodiments of the present application, for at least one division block included in the current frame, under the to-be-filtered component, there can be three cases: all of the at least one division block uses the preset network model for filtering, all of the at least one division block does not use the preset network model for filtering, and there is a part of the division block in the at least one division block that uses the preset network model for filtering.

[0212] In this way, for the above three cases, the rate-distortion cost mode can be used to calculate the first rate-distortion cost value of the to-be-filtered component of the at least one division block that does not use the preset network model for filtering, the second rate-distortion cost value of the to-be-filtered component of the at least one division block that uses the preset network model for filtering, and the third rate-distortion cost value of the to-be-filtered component of the part of the division block in the at least one division block that allows using the preset network model for filtering; and then the value of the first syntax element identification information and the value of the third syntax element identification information are determined according to the sizes of the three rate-distortion cost values.

[0213] In some embodiments, for the third syntax element identification information, the determination of the frame-level syntax element identification information of the to-be-filtered component of the current frame according to the first rate-distortion cost value, the second rate-distortion cost value and the third rate-distortion cost value can include:

[0214] If the second rate-distortion cost value is the smallest among the first rate-distortion cost value, the second rate-distortion cost value and the third rate-distortion cost value, the value of the third syntax element identification information is set to the first value;

[0215] If the first rate-distortion cost value or the third rate-distortion cost value is the smallest among the first rate-distortion cost value, the second rate-distortion cost value and the third rate-distortion cost value, the value of the third syntax element identification information is set to the second value.

[0216] Correspondingly, in some embodiments, the method can further include: encoding the value of the third syntax element identification information, and writing the obtained coded bits into a bitstream.

[0217] It should be noted that, in an embodiment of the present application, if the second rate-distortion cost value is the smallest, this means that all components to be filtered of at least one partitioned block included in the current frame are filtered using the preset network model, then the value of the third syntax element identification information can be set to the first value; otherwise, if the first rate-distortion cost value is the smallest or the third rate-distortion cost value is the smallest, this means that not all components to be filtered of at least one partitioned block included in the current frame are filtered using the preset network model, then the value of the third syntax element identification information can be set to the second value.

[0218] It should also be noted that, in an embodiment of the present application, the encoder may also write the value of the third syntax element identification information into the bitstream, so that a subsequent decoder can determine the third syntax element identification information by parsing the bitstream, and further determine whether all the components to be filtered of at least one partitioned block included in the current frame are filtered using a preset network model.

[0219] In some embodiments, for the first syntax element identification information, determining the frame-level syntax element identification information of the to-be-filtered component of the current frame according to the first rate-distortion cost value, the second rate-distortion cost value, and the third rate-distortion cost value may include:

[0220] If the third rate-distortion cost value is the smallest among the first rate-distortion cost value, the second rate-distortion cost value, and the third rate-distortion cost value, setting the value of the first syntax element identification information to the first value;

[0221] If the first rate-distortion cost value is the smallest among the first rate-distortion cost value, the second rate-distortion cost value, and the third rate-distortion cost value, setting the value of the first syntax element identification information to the second value;

[0222] Accordingly, in some embodiments, the method may further include: encoding the value of the first syntax element identification information, and writing the obtained coded bits into the bitstream.

[0223] It should be noted that, in an embodiment of the present application, if the third rate-distortion cost value is the smallest, this means that the components to be filtered of the partitioned blocks in the current frame are allowed to be filtered using the preset network model, then the value of the first syntax element identification information can be set to the first value; otherwise, if the first rate-distortion cost value is the smallest, this means that all the components to be filtered of at least one partitioned block included in the current frame are not filtered using the preset network model, then the value of the first syntax element identification information can be set to the second value.

[0224] It should be further noted that in the embodiments of the present application, the encoder can also write the value of the first syntax element identification information into the code stream, so that the subsequent decoder can determine the first syntax element identification information by parsing the code stream, and then determine whether the to-be-filtered component of the divided block in the current frame is allowed to use the preset network model for filtering.

[0225] In the embodiments of the present application, the first value and the second value are different, and the first value and the second value can be in the form of a parameter or in the form of a number. Specifically, whether the first syntax element identification information or the third syntax element identification information is a parameter written in a profile or a value of a flag, which is not limited herein.

[0226] Exemplarily, in the embodiments of the present application, when the second syntax element identification information is a flag, for the first value and the second value, the first value can be set as 1, and the second value can be set as 0; or the first value can also be set as true, and the second value can also be set as false; but the embodiments of the present application are not limited in this way.

[0227] It can be understood that in the embodiments of the present application, for the calculation of the first rate-distortion cost value, the determination of the first rate-distortion cost value that the to-be-filtered component of the at least one divided block included in the current frame is not filtered by using the preset network model can include:

[0228] determining the original value of the to-be-filtered component of the at least one divided block included in the current frame, and determining the reconstructed value of the to-be-filtered component of the at least one divided block included in the current frame;

[0229] performing rate-distortion cost calculation according to the original value of the to-be-filtered component of the at least one divided block included in the current frame and the reconstructed value of the to-be-filtered component of the at least one divided block included in the current frame to obtain the first rate-distortion cost value.

[0230] It should be noted that the encoder can first calculate the cost information of the current frame without using the preset network model, i.e., using the reconstructed samples of the current block ready to be used as the input of the preset network model and the original image samples of the current block to calculate the first rate-distortion cost value, which can be denoted as costOrg.

[0231] It should be further noted that for the reconstructed value of the to-be-filtered component of each divided block, in some embodiments, the determination of the reconstructed value of the to-be-filtered component of the at least one divided block included in the current frame can include:

[0232] determining the original image of the to-be-filtered component of the current frame;

[0233] divide the original image to obtain original values of a to-be-filtered component of at least one divided block;

[0234] perform intra or inter prediction on the at least one divided block to determine predicted values of the to-be-filtered component of the at least one divided block;

[0235] obtain initial residual values of the to-be-filtered component of the at least one divided block according to the original values of the to-be-filtered component of the at least one divided block and the predicted values of the to-be-filtered component of the at least one divided block;

[0236] perform transform and quantization processing on the initial residual values of the to-be-filtered component of the at least one divided block respectively to obtain target residual values of the to-be-filtered component of the at least one divided block;

[0237] perform dequantization and inverse transform processing on the target residual values of the to-be-filtered component of the at least one divided block respectively to obtain reconstructed residual values of the to-be-filtered component of the at least one divided block;

[0238] determine reconstructed values of the to-be-filtered component of the at least one divided block according to the predicted values of the to-be-filtered component of the at least one divided block and the reconstructed residual values of the to-be-filtered component of the at least one divided block.

[0239] In the embodiments of the present application, the reconstructed values of the to-be-filtered component of the at least one divided block are determined according to the predicted values of the to-be-filtered component of the at least one divided block and the reconstructed residual values of the to-be-filtered component of the at least one divided block, and specifically, the reconstructed values of the to-be-filtered component of the at least one divided block can be determined by performing addition operation on the predicted values of the to-be-filtered component of the at least one divided block and the reconstructed residual values of the to-be-filtered component of the at least one divided block.

[0240] In the embodiments of the present application, the target residual values are also written into a bitstream, so that a subsequent decoder can obtain the target residual values by decoding, and then obtain the reconstructed residual values by dequantization and inverse transform processing, and further determine the reconstructed values of the to-be-filtered component of the divided block. In some embodiments, the method can further include encoding the target residual values of the to-be-filtered component of the at least one divided block, and writing the obtained encoded bits into the bitstream.

[0241] It should also be noted that, in an embodiment of the present application, for at least one divided block, taking the current block as an example, first determine the predicted value of the component to be filtered of the current block; then, based on the original value of the component to be filtered of the current block and the predicted value of the component to be filtered of the current block, obtain the initial residual value of the component to be filtered of the current block; then transform and quantize the initial residual value of the component to be filtered of the current block to obtain the target residual value of the component to be filtered of the current block; then dequantize and detransform the target residual value of the component to be filtered of the current block to obtain the reconstructed residual value of the component to be filtered of the current block; finally, based on the predicted value of the component to be filtered of the current block and the reconstructed residual value of the component to be filtered of the current block, specifically, perform an addition operation on the predicted value of the component to be filtered of the current block and the reconstructed residual value of the component to be filtered of the current block, so as to determine the reconstructed value of the component to be filtered of the current block.

[0242] It can also be understood that in the embodiment of the present application, for the calculation of the second rate-distortion cost value, determining the second rate-distortion cost value of filtering all to-be-filtered components of at least one divided block included in the current frame using the preset network model may include:

[0243] Determining at least two quantization parameter combinations; wherein each quantization parameter combination includes at least one candidate quantization parameter value for the first color component and one candidate quantization parameter value for the second color component;

[0244] Under each quantization parameter combination, filtering the reconstructed value of the to-be-filtered component of at least one partitioned block included in the current frame based on a preset network model to obtain a filtered reconstructed value of the to-be-filtered component of at least one partitioned block included in the current frame;

[0245] performing rate-distortion cost calculation based on an original value of a to-be-filtered component of at least one partitioned block included in the current frame and a filtered reconstructed value of the to-be-filtered component of at least one partitioned block included in the current frame, to obtain a fourth rate-distortion cost value under each quantization parameter combination;

[0246] A minimum rate-distortion cost value is selected from the obtained fourth rate-distortion cost values, and a second rate-distortion cost value is determined according to the minimum rate-distortion cost value.

[0247] It should be noted that in the embodiment of the present application, taking four quantization parameter combinations as an example, the encoder can try the loop filtering technology based on the preset network model, and traverse these four quantization parameter combinations respectively; use the reconstructed sample YUV of the current block and the quantization parameter input into the loaded preset network model for inference, and the preset network model outputs the reconstructed sample block of the current block. Based on this, the reconstructed samples of the current block after loop filtering based on the preset network model under these four quantization parameter combinations and the original image samples of the current block are calculated to obtain the fourth rate-distortion cost value, which are represented by costFrame1, costFrame2, costFrame3 and costFrame4 respectively; select the minimum rate-distortion cost value from costFrame1, costFrame2, costFrame3 and costFrame4, and use the selected fourth rate-distortion cost value as the final second rate-distortion cost value, represented by costFrameBest.

[0248] Furthermore, in some embodiments, the method may further include: using the quantization parameter combination corresponding to the minimum rate-distortion cost value as frame quantization parameter information of the current frame;

[0249] Accordingly, when the second rate-distortion cost value is the smallest among the first rate-distortion cost value, the second rate-distortion cost value, and the third rate-distortion cost value, the method may further include: after encoding the value of the third syntax element identification information, continuing to encode the frame quantization parameter information of the current frame, and writing the obtained coded bits into the bitstream.

[0250] It should also be noted that in this embodiment of the present application, the minimum rate-distortion cost value is selected from costFrame1, costFrame2, costFrame3, and costFrame4, and the quantization parameter combination corresponding to the selected minimum rate-distortion cost value is used as the frame quantization parameter information of the current frame. In this way, after encoding the value of the third syntax element identification information, the frame quantization parameter information of the current frame can also be encoded and then written into the bitstream.

[0251] Furthermore, in some embodiments, for a quantization parameter combination, determining at least two quantization parameter combinations may include:

[0252] Determine a first quantization parameter candidate set and a second quantization parameter candidate set;

[0253] Traversing the first quantization parameter candidate set and the second quantization parameter candidate set to determine at least two quantization parameter combinations;

[0254] The first quantization parameter candidate set is composed of candidate quantization parameter values ​​of at least two first color components, and the second quantization parameter candidate set is composed of candidate quantization parameter values ​​of at least two second color components.

[0255] It should be noted that in an embodiment of the present application, if there are four quantization parameter combinations, then the first quantization parameter candidate set may include candidate quantization parameters for two luminance color components, and the second quantization parameter candidate set may include candidate quantization parameters for two chrominance color components; four quantization parameter combinations can be obtained by combining the candidate quantization parameters of the two luminance color components and the candidate quantization parameters of the two chrominance color components.

[0256] Furthermore, in some embodiments, encoding the frame quantization parameter information of the current frame and writing the obtained coded bits into the bitstream may further include:

[0257] Determining a frame quantization parameter value of a first color component and a frame quantization parameter value of a second color component according to the frame quantization parameter information of the current frame;

[0258] Determining a third quantization parameter index according to the first quantization parameter candidate set and the frame quantization parameter value of the first color component;

[0259] Determining a fourth quantization parameter index according to the second quantization parameter candidate set and the frame quantization parameter value of the second color component;

[0260] The third quantization parameter index and the fourth quantization parameter index are encoded, and the obtained encoded bits are written into a bitstream.

[0261] It should also be noted that, in an embodiment of the present application, the third quantization parameter index is used to indicate the index number of the frame quantization parameter value of the first color component in the first quantization parameter candidate set, and the fourth quantization parameter index is used to indicate the index number of the frame quantization parameter value of the second color component in the second quantization parameter candidate set.

[0262] In this way, after determining the third quantization parameter index and the fourth quantization parameter index based on the first quantization parameter candidate set and the second quantization parameter candidate set, the third quantization parameter index and the fourth quantization parameter index need to be written into the bitstream; thus, there is no need to perform rate-distortion cost calculation in the decoder. The third quantization parameter index and the fourth quantization parameter index can be obtained by parsing the bitstream, and the frame quantization parameter information of the current frame, i.e., the frame quantization parameter value of the first color component and the frame quantization parameter value of the second color component, can be determined. For example, the frame quantization parameter value of the luma color component can be represented by ph_nnlf_luma_baseqp, and the frame quantization parameter value of the chroma color component can be represented by ph_nnlf_chroma_baseqp.

[0263] It should also be noted that, in the embodiment of the present application, for the same frame, the first quantization parameter candidate set can be the same, and the second quantization parameter candidate set can be the same; while different frames may have different corresponding first quantization parameter candidate sets, and different frames may have different corresponding second quantization parameter candidate sets.

[0264] S1002: When the first syntax element identification information indicates that there are to-be-filtered components of the divided blocks in the current frame that allow filtering using a preset network model, determine second syntax element identification information of the to-be-filtered components of the current block.

[0265] It should be noted that, in an embodiment of the present application, if the first syntax element identification information is true, then the first syntax element identification information indicates that there is a to-be-filtered component of a partition block in the current frame that allows filtering using a preset network model, then the encoder also needs to determine the second syntax element identification information of the to-be-filtered component of the current block. In addition, the current frame includes at least one partition block, where the current block specifically refers to the partition block currently to be loop filtered, which can be any one of the at least one partition block included in the current frame. Here, the current block can be a current coding unit, a current prediction unit, or a current transform unit, or even a current coding tree unit, etc. The current coding tree unit will be used as an example for a specific description.

[0266] It should also be noted that in this embodiment of the present application, the second syntax element identification information is a coding tree unit-level syntax element, which can be used to indicate whether the components to be filtered in the current block are filtered using a preset network model. The second syntax element identification information can also be referred to as a coding tree unit usage flag. In other words, the second syntax element identification information can determine whether the components to be filtered in the current coding tree unit are filtered using a preset network model or whether the components to be filtered in the current coding tree unit are not filtered using a preset network model.

[0267] Exemplarily, if the component to be filtered is a luminance color component, the second syntax element identification information may be ctb_nnlf_luma_flag; if the component to be filtered is a chrominance color component, the second syntax element identification information may be ctb_nnlf_chroma_flag. That is to say, for different color components in the current coding tree unit, different second syntax element identification information is set accordingly. Specifically, the encoder may first determine the third syntax element identification information of the component to be filtered. When the third syntax element identification information indicates that the components to be filtered of at least one partitioned block included in the current frame are not all filtered using the preset network model, the encoder also needs to continue to determine the value of the first syntax element identification information; only when the first syntax element identification information indicates that the components to be filtered of the partitioned blocks in the current frame are allowed to be filtered using the preset network model, the encoder will continue to determine the value of the second syntax element identification information.

[0268] In a specific embodiment, the method may further include:

[0269] Determining, based on a current block in a current frame, an original value of a component to be filtered of the current block and a reconstructed value of the component to be filtered of the current block;

[0270] Under at least two quantization parameter combinations, filtering the reconstructed value of the to-be-filtered component of the current block based on a preset network model to obtain at least two filtered reconstructed values ​​of the to-be-filtered component of the current block;

[0271] performing a rate-distortion cost calculation based on the original value of the to-be-filtered component of the current block and the reconstructed value of the to-be-filtered component of the current block to obtain a fifth rate-distortion cost value;

[0272] performing rate-distortion cost calculations based on the original value of the to-be-filtered component of the current block and the filtered reconstructed values ​​of at least two to-be-filtered components of the current block, respectively, to obtain at least two sixth rate-distortion cost values;

[0273] Second syntax element identification information of the to-be-filtered component of the current block is determined according to the fifth rate-distortion cost value and at least two sixth rate-distortion cost values.

[0274] It should be noted that in the embodiments of the present application, for the current block, the encoder attempts to encode the optimization selection at the tree unit level. Wherein, for the to-be-filtered component, not only the fifth rate-distortion cost value of the reconstructed sample and the original sample of the current block in the case of not using the loop filtering based on the preset network model needs to be calculated, which can be expressed as costCTUorg, but also the fifth rate-distortion cost value of the reconstructed sample and the original sample of the current block in the case of using the loop filtering based on the preset network model in various combinations of BaseQPluma and BaseQPchroma needs to be calculated, which can be expressed as costCTUnn1, costCTUnn2, costCTUnn3 and costCTUnn4 respectively; and then the value of the second syntax element identification information is determined by the size of the rate-distortion cost values of costCTUorg, costCTUnn1, costCTUnn2, costCTUnn3 and costCTUnn4.

[0275] Further, in some embodiments, for the third syntax element identification information, the determining of the second syntax element identification information of the to-be-filtered component of the current block according to the fifth rate-distortion cost value and the at least two sixth rate-distortion cost values can include:

[0276] selecting the minimum rate-distortion cost value from the fifth rate-distortion cost value and the at least two sixth rate-distortion cost values;

[0277] if the minimum rate-distortion cost value is one of the sixth rate-distortion cost values, setting the value of the second syntax element identification information as the first value;

[0278] if the minimum rate-distortion cost value is the fifth rate-distortion cost value, setting the value of the second syntax element identification information as the second value.

[0279] Correspondingly, in some embodiments, the method can further include: encoding the value of the second syntax element identification information, and writing the obtained encoded bits into the bitstream.

[0280] It should be noted that in the embodiments of the present application, if the minimum is the fifth rate-distortion cost value, it means that the to-be-filtered component of the current block does not use the preset network model for filtering, and then the value of the second syntax element identification information can be set as the second value; otherwise, if the minimum is a sixth rate-distortion cost value, it means that the to-be-filtered component of the current block uses the preset network model for filtering, and then the value of the second syntax element identification information can be set as the first value.

[0281] It should also be noted that, in an embodiment of the present application, the encoder may also write the value of the second syntax element identification information into the bitstream, so that a subsequent decoder can determine the second syntax element identification information by parsing the bitstream, and further determine whether the current block in the current frame is filtered using a preset network model.

[0282] In the embodiment of the present application, the first value and the second value are different, and the first value and the second value can be in parameter form or in digital form. Specifically, the second syntax element identification information can be a parameter written in the profile or a flag value, which is not specifically limited here.

[0283] For example, in an embodiment of the present application, when the second syntax element identification information is a flag, for the first value and the second value, the first value can be set to 1 and the second value can be set to 0; or, the first value can also be set to true and the second value can also be set to false; however, the embodiment of the present application does not make specific limitations.

[0284] S1003: When the second syntax element identification information indicates that the to-be-filtered component of the current block is filtered using a preset network model, determine the block quantization parameter information of the current block; wherein the block quantization parameter information includes at least the block quantization parameter value of the first color component and the block quantization parameter value of the second color component.

[0285] S1004: Determine the reconstructed value of the component to be filtered of the current block, input the reconstructed value of the component to be filtered of the current block and the block quantization parameter information of the current block into a preset network model, and determine the filtered reconstructed value of the component to be filtered of the current block.

[0286] It should be noted that, in the embodiment of the present application, when the second syntax element identification information indicates that the to-be-filtered component of the current block is filtered using a preset network model, for the block quantization parameter information of the current block, the method may further include:

[0287] When the minimum rate-distortion cost value is one of the sixth rate-distortion cost values, the quantization parameter combination corresponding to the minimum rate-distortion cost value is used as the block quantization parameter information of the current block;

[0288] Correspondingly, the method may further include: after encoding the value of the second syntax element identification information, continuing to encode the block quantization parameter information of the current block, and writing the obtained coded bits into the bitstream.

[0289] Here, the minimum rate-distortion cost value is selected from costCTUorg, costCTUnn1, costCTUnn2, costCTUnn3, and costCTUnn4, and the BaseQPluma and BaseQPchroma corresponding to the selected minimum rate-distortion cost value are combined as the block quantization parameter information for the current block. In this way, after encoding the value of the second syntax element identification information, the block quantization parameter information for the current block can be further encoded and then written into the bitstream.

[0290] In a specific embodiment, the method of encoding the block quantization parameter information of the current block and writing the obtained coded bits into the bitstream may further include:

[0291] Determining a block quantization parameter value of a first color component and a block quantization parameter value of a second color component according to block quantization parameter information of a current block;

[0292] Determine a first quantization parameter index according to the first quantization parameter candidate set and the block quantization parameter value of the first color component; wherein the first quantization parameter index is used to indicate the index number of the block quantization parameter value of the first color component in the first quantization parameter candidate set;

[0293] Determine a second quantization parameter index according to the second quantization parameter candidate set and the block quantization parameter value of the second color component; wherein the second quantization parameter index is used to indicate the index number of the block quantization parameter value of the second color component in the second quantization parameter candidate set;

[0294] The first quantization parameter index and the second quantization parameter index are encoded, and the obtained encoded bits are written into a bitstream.

[0295] It should be noted that, in an embodiment of the present application, the first quantization parameter candidate set may include candidate quantization parameters for at least two luminance color components, and the second quantization parameter candidate set may include candidate quantization parameters for at least two chrominance color components. For example, if the candidate quantization parameters for two luminance color components and the candidate quantization parameters for two chrominance color components are used, four quantization parameter combinations can be obtained. In addition, for the same frame, the first quantization parameter candidate set can be the same, and the second quantization parameter candidate set can be the same; while different frames can have different corresponding first quantization parameter candidate sets, and different frames can have different corresponding second quantization parameter candidate sets.

[0296] In this way, for the block quantization parameter of the current block, after determining the first quantization parameter index and the second quantization parameter index based on the first quantization parameter candidate set and the second quantization parameter candidate set, the first quantization parameter index and the second quantization parameter index need to be written into the bitstream; thus, there is no need to perform rate-distortion cost calculation in the decoder. The first quantization parameter index and the second quantization parameter index can be obtained by parsing the bitstream, and the frame quantization parameter information of the current frame, i.e., the frame quantization parameter value of the first color component and the frame quantization parameter value of the second color component, can be determined. For example, the block quantization parameter value of the luma color component can be represented by ctb_nnlf_luma_baseqp, and the block quantization parameter value of the chroma color component can be represented by ctb_nnlf_chroma_baseqp.

[0297] It can also be understood that in the embodiments of the present application, new syntax elements are introduced, such as first syntax element identification information, second syntax element identification information, and third syntax element identification information of the component to be filtered. In some embodiments, the component to be filtered includes at least a luma color component and a chroma color component; the method may further include:

[0298] When the color component type of the current frame is a luma color component, determining that the third syntax element identification information is frame-level luma switch identification information of the current frame, the first syntax element identification information is frame-level luma enable identification information of the current frame, and the second syntax element identification information is block-level luma usage identification information of the current block; wherein the frame-level luma switch identification information is used to indicate whether all luma color components of at least one divided block included in the current frame are filtered using a preset network model, the frame-level luma enable identification information is used to indicate whether luma color components of divided blocks in the current frame are allowed to be filtered using the preset network model, and the block-level luma usage identification information is used to indicate whether the luma color component of the current block is filtered using the preset network model;

[0299] When the color component type of the current frame is a chroma color component, the third syntax element identification information is determined to be the frame-level chroma switch identification information of the current frame, the first syntax element identification information is the frame-level chroma enable identification information of the current frame, and the second syntax element identification information is the block-level chroma usage identification information of the current block; wherein, the frame-level chroma switch identification information is used to indicate whether all the chroma color components of at least one partitioned block included in the current frame are filtered using a preset network model, the frame-level chroma enable identification information is used to indicate whether the chroma color components of the partitioned blocks in the current frame are allowed to be filtered using a preset network model, and the block-level chroma usage identification information is used to indicate whether the chroma color components of the current block are filtered using a preset network model.

[0300] Here, for the luminance color component, the frame-level luminance switch identification information can be represented by ph_nnlf_luma_ctrl_flag, the frame-level luminance enable identification information can be represented by ph_nnlf_luma_enable_flag, and the block-level luminance usage identification information can be represented by ctb_nnlf_luma_flag; for the chrominance color component, the frame-level chrominance switch identification information can be represented by ph_nnlf_chroma_ctrl_flag, the frame-level chrominance enable identification information can be represented by ph_nnlf_chroma_enable_flag, and the block-level chrominance usage identification information can be represented by ctb_nnlf_chroma_flag.

[0301] Furthermore, in an embodiment of the present application, a sequence-level syntax element may be provided to determine whether the current sequence allows the use of a neural network-based loop filtering technique. The method may further include:

[0302] Determining fourth syntax element identification information;

[0303] When the fourth syntax element identification information indicates that the to-be-filtered component of the current sequence allows filtering using a preset network model, the step of determining the third syntax element identification information of the to-be-filtered component of the current frame is performed; wherein the current sequence includes the current frame.

[0304] It should be noted that, in an embodiment of the present application, the fourth syntax element identification information is a sequence-level syntax element, which can be used to indicate whether the components to be filtered of the current sequence are allowed to be filtered using a preset network model. The fourth syntax element identification information can be represented by sps_nnlf_enable_flag. If at least one of the luminance color component and the chrominance color component of the current sequence is allowed to be filtered using a preset network model, then it means that the value of sps_nnlf_enable_flag is true, that is, the components to be filtered of the current sequence are allowed to be filtered using a preset network model; if the luminance color component and the chrominance color component of the current sequence are not allowed to be filtered using a preset network model, then it means that the value of sps_nnlf_enable_flag is false, that is, the components to be filtered of the current sequence are not allowed to be filtered using a preset network model.

[0305] In a specific embodiment, determining the fourth syntax element identification information may include:

[0306] Determine whether the to-be-filtered component of the current sequence is allowed to be filtered using a preset network model;

[0307] If the to-be-filtered component of the current sequence allows filtering using a preset network model, setting the value of the fourth syntax element identification information to the first value;

[0308] If the to-be-filtered component of the current sequence does not allow filtering using the preset network model, setting the value of the fourth syntax element identification information to the second value;

[0309] Correspondingly, the method further includes: encoding the value of the fourth syntax element identification information, and writing the obtained coded bits into the bitstream.

[0310] In the embodiment of the present application, the first value and the second value are different, and the first value and the second value can be in parameter form or in numerical form. For example, when the fourth syntax element identification information is a flag, for the first value and the second value, the first value can be set to 1 and the second value can be set to 0; or the first value can be set to true and the second value can be set to false; however, this embodiment of the present application is not specifically limited to this.

[0311] It should also be noted that the fourth syntax element identification information can be called a sequence-level flag. In the encoder, if this sequence-level flag is true, neural network-based loop filtering technology is allowed; if this sequence-level flag is false, neural network-based loop filtering technology is not allowed. The sequence-level flag needs to be written into the bitstream when encoding the video sequence.

[0312] Furthermore, in an embodiment of the present application, the preset network model is a neural network model, and the neural network model includes at least: a convolutional layer, an activation layer, a splicing layer and a skip connection layer.

[0313] It should be noted that for the preset network model, Figure 7 As shown, its input may include: the reconstructed value of the component to be filtered (represented by rec_yuv), the quantization parameter value of the luminance color component (represented by BaseQPluma) and the quantization parameter value of the chrominance color component (represented by BaseQPchroma); its output may be: the reconstructed value of the component to be filtered (represented by output_yuv). Since the embodiment of the present application removes non-important input elements such as predicted YUV information and YUV information with partitioning information, the amount of computation for network model inference can be reduced, which is beneficial to the implementation of the decoding end and reduces the decoding time. In addition, it should be noted that in the embodiment of the present application, the input of the preset network model may also include the quantization parameter (SliceQP) of the current frame, but SliceQP does not need to distinguish between the luminance color component and the chrominance color component ( Figure 7 not shown).

[0314] Thus, the embodiment of the present application proposes a loop filtering technology based on a neural network model with multiple BaseQP inputs. The main idea is to input the luma color component into a single channel of BaseQPluma, while also inputting the chroma color component into a single channel of BaseQPchroma, while keeping the number of models unchanged. In this way, the embodiment of the present application can provide more information for the luma and chroma color components by increasing the amount of inference calculation without increasing the number of models, while also providing more options and adaptation for the luma and chroma color components.

[0315] Furthermore, in some embodiments, the input of the preset network model is the reconstructed value of the component to be filtered of the current block and the block quantization parameter information of the current block. The method may also include: determining that the output of the preset network model is the filtered reconstructed value of the component to be filtered of the current block.

[0316] Furthermore, in some embodiments, the input of the preset network model is the reconstructed value of the component to be filtered of the current block and the block quantization parameter information of the current block, and the output of the preset network model may also be residual information. The method may further include: determining that the output of the preset network model is the first residual value of the component to be filtered of the current block;

[0317] Accordingly, for S1004, the determination of the filtered reconstructed value of the component to be filtered of the current block may include: after obtaining the first residual value of the component to be filtered of the current block through a preset network model, determining the filtered reconstructed value of the component to be filtered of the current block according to the reconstructed value of the component to be filtered of the current block and the first residual value of the component to be filtered of the current block.

[0318] It should be noted that, in the embodiment of the present application, the output of the preset network model can be directly the filtered reconstructed value of the component to be filtered of the current block, or it can be the first residual value of the component to be filtered of the current block. In the latter case, the encoder also needs to perform an addition operation on the reconstructed value of the component to be filtered of the current block and the first residual value of the component to be filtered of the current block to determine the filtered reconstructed value of the component to be filtered of the current block.

[0319] It should also be noted that, in the embodiment of the present application, a scaling process may be added to the output end of the preset network model, that is, the first residual value of the component to be filtered is scaled using a residual scaling factor. Therefore, in some embodiments, the method may further include:

[0320] Determine the residual scaling factor;

[0321] Accordingly, for S1004, determining the filtered reconstructed value of the to-be-filtered component of the current block may include:

[0322] Scaling the first residual value of the component to be filtered of the current block according to the residual scaling factor to obtain a second residual value of the component to be filtered of the current block;

[0323] A filtered reconstructed value of the component to be filtered of the current block is determined according to the reconstructed value of the component to be filtered of the current block and the second residual value of the component to be filtered of the current block.

[0324] Furthermore, in some embodiments, the method may further include: encoding the residual scaling factor, and writing the obtained encoded bits into the bitstream.

[0325] It should be noted that if the output of the preset network model is residual information, then it needs to be superimposed with the reconstructed samples of the current block as the output of the loop filter tool based on the preset network model; if the output of the preset network model is a complete reconstructed sample, then the model output is the output of the loop filter tool based on the preset network model. However, in one possible embodiment, the model output generally also needs to be scaled. Taking the model output as residual information as an example, the preset network model infers and outputs the residual information of the current block, which is scaled and then superimposed with the reconstructed samples of the current block; and this residual scaling factor can be obtained by the encoder, which needs to be written into the code stream and transmitted to the decoder so that the subsequent decoder can obtain the residual scaling factor through decoding.

[0326] Furthermore, in some embodiments, the method may further include:

[0327] Traversing at least one partitioned block in the current frame, taking each partitioned block as the current block in turn, and repeatedly performing the step of determining the value of the second syntax element identification information of the to-be-filtered component of the current block to obtain a filtered reconstructed value corresponding to each of the at least one partitioned block;

[0328] A reconstructed image of the current frame is determined according to the filtered reconstruction value corresponding to each of the at least one divided block.

[0329] It should be noted that, for the current frame, the current frame may include at least one partitioned block. These partitioned blocks are then traversed, with each partitioned block being used as the current block in turn, and the encoding method process of the embodiment of the present application is repeatedly executed to obtain the filtered reconstruction value corresponding to each partitioned block; based on these obtained filtered reconstruction values, the reconstructed image of the current frame can be determined. Furthermore, it should be noted that the encoder can also continue to traverse other loop filtering tools and output a complete reconstructed image upon completion. The specific process is not closely related to the embodiment of the present application and is therefore not described in detail here.

[0330] Further, in some embodiments, due to the different quality requirements of I frames and B frames in video coding, I frames often require higher coding quality to facilitate B frames as reference. Therefore, in the I frames and B frames, the decoding method of the embodiments of the present application only allows B frames to use different quantization parameters of the luminance component (BaseQPluma and BaseQPchroma) as input, while the quantization parameters of the luminance component of the I frames are consistent. In this way, not only the coding time is reduced, but also the bit overhead of quantization parameter transmission on the I frames is saved, further improving the compression efficiency.

[0331] Further, in some embodiments, the embodiments of the present application only add one layer of chrominance quantization parameters as additional input, and in addition, the Cb color component and Cr color component can also be added as additional input.

[0332] Further, in some embodiments, the loop filtering enhancement method based on the neural network model proposed by the embodiments of the present application can also be extended to other input parts, such as boundary strength, etc., which are not limited in the embodiments of the present application.

[0333] The embodiment provides an encoding method, which comprises the following steps: determining first syntax element identification information of a to-be-filtered component of a current frame; when the first syntax element identification information indicates that the to-be-filtered component of the current frame allows using a preset network model for filtering, determining second syntax element identification information of the to-be-filtered component of a current block; wherein the current frame comprises at least one division block, and the current block is any one of the at least one division block; when the second syntax element identification information indicates that the to-be-filtered component of the current block uses the preset network model for filtering, determining block quantization parameter information of the current block; wherein the block quantization parameter information at least comprises a block quantization parameter value of a first color component and a block quantization parameter value of a second color component; determining a reconstructed value of the to-be-filtered component of the current block, inputting the reconstructed value of the to-be-filtered component of the current block and the block quantization parameter information of the current block into the preset network model, and determining a filtered reconstructed value of the to-be-filtered component of the current block. In this way, for the input of the preset network model, since only the reconstructed value of the to-be-filtered component and the block quantization parameter information are included, the non-important input elements such as the prediction information and the division information of the color component are removed, the calculation amount during the inference of the network model can be reduced, and the realization of the decoding end and the decoding time can be reduced; in addition, since the input block quantization parameter information at least comprises the block quantization parameter values of two color components, that is, the multi-channel quantization parameters are used as input, the luminance color component and the chrominance color component can have more choices and adaptation; and by introducing new syntax elements, the decoding end does not need to store multiple neural network models to achieve more flexible configuration, which is beneficial to improving the encoding performance, and further can improve the coding efficiency.

[0334] In another embodiment of the present application, based on the decoding method and encoding method described in the aforementioned embodiment, the embodiment of the present application proposes a neural network-based loop filtering technology with multiple BaseQP inputs. The main idea is that the luminance color component inputs a channel of BaseQPluma, and the chrominance color component also inputs a channel of BaseQPchroma, while keeping the number of models unchanged. Without increasing the number of models, the embodiment of the present application can provide more information for the luminance color component and the chrominance color component by increasing the amount of inference calculation, and the encoding end also has more options.

[0335] For example, Figure 7 The network architecture diagram of a neural network model with multiple BaseQP inputs provided by an embodiment of the present application is shown. Specifically, the preset network model is based on Figure 7 Taking the neural network model shown in Figure 1 as an example, the encoder can provide multiple candidate combinations of BaseQPluma and BaseQPchroma. The coding tree unit (CTU) or coding unit (CU) inputs each candidate into the current neural network model, infers and calculates the filtered reconstructed sample block, and obtains the corresponding rate-distortion cost. The reconstructed sample block corresponding to the candidate combination with the lowest rate-distortion cost is selected as the output sample of the current filtering technique. The BaseQPluma and BaseQPchroma candidate combination corresponding to this lowest rate-distortion cost is recorded and written into the bitstream via quantization parameter indexing or direct binarization for transmission to the decoder. The decoder parses the bitstream to obtain the neural network-based loop filtering indicator for the current CTU or coding unit, and parses and calculates the aforementioned candidate combinations of BaseQPluma and BaseQPchroma. If neural network-based loop filtering is used, the final candidate combination of BaseQPluma and BaseQPchroma is determined as the quantization parameter for the current CTU or coding unit and inputs it into the neural network model. The reconstructed sample output from the neural network model is obtained as the output sample of the current filtering technique.

[0336] In a specific embodiment, for the encoding end, the specific process is as follows:

[0337] The encoder traverses the intra-frame or inter-frame prediction to obtain the prediction block of each coding unit. The residual of the coding unit can be obtained by subtracting the original image block from the prediction block. The residual obtains the frequency domain residual coefficient through various transformation modes, which is then quantized and inversely quantized. After inverse transformation, the distortion residual information (i.e., the reconstructed residual value described in the aforementioned embodiment) is obtained. The distortion residual information is superimposed on the prediction block to obtain the reconstructed block. After the image is encoded, the loop filtering module filters the image with the coding tree unit level as the basic unit. The technical solution of the embodiment of the present application is applied here. Obtain the flag that allows the use of loop filtering based on the neural network model, i.e., sps_nnlf_enable_flag. If the flag is true, the loop filtering technology based on the neural network model is allowed; if the flag is false, the loop filtering technology based on the neural network model is not allowed. The flag that allows the use of the sequence level can be written into the bitstream when encoding the video sequence.

[0338] Step 1: If the flag indicating the use of loop filtering based on the neural network model is true, the encoder attempts the loop filtering technology based on the neural network model, i.e., executes step 2. If the flag indicating the use of loop filtering based on the neural network model is false, the encoder does not attempt the loop filtering technology based on the neural network model, i.e., skips step 2 and directly executes step 3.

[0339] Step 2: Initialize the neural network-based loop filtering technology and load the neural network model applicable to the current frame.

[0340] First round:

[0341] The encoder calculates the cost information of not using the loop filtering technology based on the neural network model. That is, it uses the reconstructed samples of the coding tree unit to be used as the input of the neural network model and the original image samples of the coding tree unit to calculate the rate-distortion cost value, which is recorded as costOrg;

[0342] Second round:

[0343] The encoding end tries the loop filtering technology based on the neural network model, traversing two luminance quantization parameter candidates and two chrominance quantization parameter candidates respectively, and uses the reconstructed sample YUV and quantization parameters of the current coding tree unit to input into the loaded neural network model for inference. The neural network model outputs the reconstructed sample block of the current coding tree unit. The rate-distortion cost value is calculated for the reconstructed samples of the coding tree unit after loop filtering based on the neural network model under various quantization parameter combinations and the original image samples of the coding tree unit, which are recorded as costFrame1, costFrame2, costFrame3 and costFrame4 respectively. The minimum cost combination is selected as the optimal output of the second round, the cost value is marked as costFrameBest, and the corresponding luminance quantization parameter and chrominance quantization parameter are recorded;

[0344] Round 3:

[0345] The encoder attempts to optimize the selection at the coding tree unit level. In the second round, the encoder attempts to use the neural network model-based loop filtering by default for all coding tree units in the current frame. The luminance and chrominance color components are each controlled by a frame-level switch flag, while the coding tree unit level does not require a transmission flag. This round attempts to use a combination of flags at the coding tree unit level, and each color component can be controlled individually. The encoder traverses the coding tree units and calculates the rate-distortion cost of the reconstructed samples without the neural network model-based loop filtering and the original samples of the current coding tree unit, denoted as costCTUorg. The encoder also calculates the rate-distortion cost of the reconstructed samples using the neural network model-based loop filtering for various combinations of BaseQPluma and BaseQPchroma and the original samples of the current coding tree unit, denoted as costCTUnn1, costCTUnn2, costCTUnn3, and costCTUnn4, respectively.

[0346] For the luminance color component, if the costCTUorg of the current luminance color component is smaller than the costCTUnn of any luminance color component, the usage flag (ctb_nnlf_luma_flag) of the neural network model loop filter at the coding tree unit level of the luminance color component is set to false; otherwise, the ctb_nnlf_luma_flag is set to true, and the quantization parameter index of the current BaseQPluma is recorded at the same time.

[0347] For the chroma color component, if the costCTUorg of the current chroma color component is smaller than the costCTUnn of any chroma color component, the usage flag (ctb_nnlf_chroma_flag) of the neural network model loop filter at the coding tree unit level of the chroma color component is set to false; otherwise, the ctb_nnlf_chroma_flag is set to true, and the quantization parameter index of the current BaseQPchroma is recorded at the same time.

[0348] If all coding tree units in the current frame have been traversed, the rate-distortion cost of the reconstructed sample of the current frame and the original image sample is calculated, which is recorded as costCTUBest;

[0349] Traverse each color component. If the value of costOrg is the smallest, set the frame-level switch flag of the neural network model loop filter corresponding to the color component to false and write it into the bitstream. If the value of costFrameBest is the smallest, set the frame-level switch flag (ph_nnlf_luma_ctrl_flag / ph_nnlf_chroma_ctrl_flag) of the neural network model loop filter corresponding to the color component to true, and write the recorded optimal quantization parameter combination of BaseQPluma and BaseQPchroma into the bitstream. If the value of costCTUBest is the smallest, set the frame-level usage flag of the neural network model loop filter corresponding to the color component to true and the frame-level switch flag to false. At the same time, write the coding tree unit-level usage flag and the optimal quantization parameter combination of BaseQPluma and BaseQPchroma decided in the third round into the bitstream.

[0350] Step 3: The encoder continues to try other loop filtering tools and outputs a complete reconstructed image after completion. The specific process is not related to the technical solution of the embodiment of the present application and is therefore not described in detail here.

[0351] In another specific embodiment, for the decoding end, the specific process is as follows:

[0352] The decoding end parses the sequence-level flag. If sps_nnlf_enable_flag is true, it indicates that the current bitstream allows the use of loop filtering technology based on the neural network model, and the subsequent decoding process needs to parse the relevant syntax elements. Otherwise, it indicates that the current bitstream does not allow the use of loop filtering technology based on the neural network model, and the subsequent decoding process does not need to parse the relevant syntax elements. The relevant syntax elements are defaulted to the initial value or to the false state.

[0353] Step 1. The decoder parses the syntax elements of the current frame and obtains the frame-level switch flag and the frame-level usage flag based on the neural network model. If the frame-level flag is not all negative, execute step 2; otherwise, skip step 2 and execute step 3.

[0354] Step 2. If the frame-level switch flag is true, it means that all coding tree units under the current color component are filtered using the loop filtering technology based on the neural network model, that is, the coding tree unit level usage flag of all coding tree units in the current frame under the color component is automatically set to true; otherwise, it means that some coding tree units under the current color component use the loop filtering technology based on the neural network model, and some coding tree units do not use the loop filtering technology based on the neural network model. Therefore, if the frame-level switch flag is false, it is necessary to further analyze the coding tree unit level usage flag (ctb_nnlf_luma_flag / ctb_nnlf_chroma_flag) of all coding tree units in the current frame under the color component. Among them:

[0355] If ph_nnlf_luma_ctrl_flag or ph_nnlf_chroma_ctrl_flag is true, the BaseQPluma value (ph_nnlf_luma_baseqp) and BaseQPchroma (ph_nnlf_chroma_baseqp) of the current frame are parsed and applied as input quantization parameter information to all coding tree units of the corresponding color component of the current frame. In addition, ph_nnlf_luma_enable_flag or ph_nnlf_chroma_enable_flag and the ctb_nnlf_luma_flag or ctb_nnlf_chroma_flag flags used by all coding tree units in the current frame must be set to true. Otherwise, ph_nnlf_luma_enable_flag / ph_nnlf_chroma_enable_flag are parsed.

[0356] If both ph_nnlf_luma_enable_flag and ph_nnlf_chroma_enable_flag are false, all coding tree units in the current frame use the flag bit set to false; otherwise, parse the BaseQPluma (ctb_nnlf_luma_baseqp) or BaseQPchroma (ctb_nnlf_chroma_baseqp) of the current coding tree unit, and all coding tree units of the corresponding color components use the flag bit.

[0357] If the coding tree unit level usage flags for all color components of the current coding tree unit are not all false, the current coding tree unit is filtered using a neural network model-based loop filtering technique. The reconstructed YUV samples and quantization parameter information (BaseQPluma and BaseQPchroma) of the current coding tree unit are used as input. The neural network model performs inference and obtains the reconstructed YUV samples of the current coding tree unit after loop filtering based on the neural network model.

[0358] According to the coding tree unit usage identification bit of each color component of the current coding tree unit, the reconstructed sample is selected as the output of the loop filtering technology based on the neural network model. If the coding tree unit usage identification bit of the corresponding color component is true, the reconstructed sample after the loop filtering based on the neural network model of the above-mentioned corresponding color component is used as the output; otherwise, the reconstructed sample that has not undergone the loop filtering based on the neural network model is used as the output of the color component.

[0359] After traversing all coding tree units of the current frame, the loop filtering module based on the neural network model ends.

[0360] Step 3: The decoding end continues to traverse other loop filtering tools and outputs a complete reconstructed image after completion. The specific process is not related to the technical solution of the embodiment of the present application and is therefore not described in detail here.

[0361] In another specific embodiment, a brief description of the parsing process at the decoding end is shown in Table 1, wherein bold fonts indicate grammatical elements that need to be parsed.

[0362] Table 1

[0363]

[0364]

[0365] Although the residual scaling part is not described in detail in all the above embodiments, it does not mean that the residual scaling technology cannot be used in the embodiments of the present application. The residual scaling technology is used on the output of the neural network model, specifically by scaling the residual obtained by subtracting the reconstructed sample output by the neural network from the original reconstructed sample. The details are not elaborated here.

[0366] In another embodiment of the present application, the embodiment of the present application provides a code stream, which is generated by bit encoding based on information to be encoded; wherein the information to be encoded may include at least one of the following: first syntax element identification information of the component to be filtered of the current frame, second syntax element identification information of the component to be filtered of the current block, third syntax element identification information of the component to be filtered of the current frame, a residual scaling factor, and an initial residual value of the component to be filtered of at least one partitioned block included in the current frame; wherein the current frame includes at least one partitioned block, and the current block is any one of the at least one partitioned block.

[0367] In the embodiments of the present application, the specific implementation of the aforementioned embodiments is described in detail through the above embodiments. According to the technical solutions of the aforementioned embodiments, it can be seen that the embodiments of the present application propose a new neural network loop filter model, which uses multi-channel quantization parameters as input to improve coding performance and introduce new syntax elements. In this way, while maintaining only one model or fewer models, the channels of important input elements are increased, so that the luminance color component and the chrominance color component have more choices and adaptations. Through the rate-distortion optimization calculation at the encoding end, the decoding end does not need to store multiple neural network models to achieve a more flexible configuration, which is beneficial to improving coding performance; at the same time, the present technical solution also removes non-important input elements such as prediction information YUV and partitioning information YUV, reducing the amount of calculation for network model inference, which is beneficial to the implementation of the decoding end and reducing decoding time.

[0368] In another embodiment of the present application, based on the same inventive concept as the above embodiment, see Figure 11 , which shows a schematic diagram of the structure of an encoder provided by an embodiment of the present application. Figure 11 As shown, the encoder 100 may include: a first determining unit 1101 and a first filtering unit 1102; wherein,

[0369] A first determining unit 1101 is configured to determine first syntax element identification information of a component to be filtered of a current frame; and when the first syntax element identification information indicates that a component to be filtered of a partitioned block in the current frame allows filtering using a preset network model, determine second syntax element identification information of the component to be filtered of the current block; wherein the current frame includes at least one partitioned block, and the current block is any one of the at least one partitioned block; and when the second syntax element identification information indicates that the component to be filtered of the current block uses a preset network model to filter, determine block quantization parameter information of the current block; wherein the block quantization parameter information includes at least a block quantization parameter value of a first color component and a block quantization parameter value of a second color component;

[0370] The first determining unit 1101 is further configured to determine a reconstructed value of a to-be-filtered component of the current block,

[0371] The first filtering unit 1102 is configured to input the reconstructed value of the component to be filtered of the current block and the block quantization parameter information of the current block into a preset network model to determine the filtered reconstructed value of the component to be filtered of the current block.

[0372] In some embodiments, the first determination unit 1101 is further configured to determine the third syntax element identification information of the component to be filtered of the current frame; and when the third syntax element identification information indicates that the component to be filtered of at least one partitioned block included in the current frame is not all filtered using a preset network model, determine the first syntax element identification information of the component to be filtered of the current frame.

[0373] In some embodiments, the first determination unit 1101 is further configured to determine a first rate-distortion cost value when all components to be filtered of at least one partitioned block included in the current frame are not filtered using a preset network model; determine a second rate-distortion cost value when all components to be filtered of at least one partitioned block included in the current frame are filtered using a preset network model; determine a third rate-distortion cost value when components to be filtered of the partitioned blocks in the current frame are allowed to be filtered using a preset network model; and determine frame-level syntax element identification information of the components to be filtered of the current frame based on the first rate-distortion cost value, the second rate-distortion cost value, and the third rate-distortion cost value; wherein the frame-level syntax element identification information includes first syntax element identification information and third syntax element identification information.

[0374] In some embodiments, see Figure 11 , the encoder 100 may further include a first setting unit 1103 and an encoding unit 1104; wherein,

[0375] The first setting unit 1103 is configured to set the value of the third syntax element identification information to the first value if the second rate-distortion cost value is the smallest among the first rate-distortion cost value, the second rate-distortion cost value, and the third rate-distortion cost value; and set the value of the third syntax element identification information to the second value if the first rate-distortion cost value is the smallest or the third rate-distortion cost value is the smallest among the first rate-distortion cost value, the second rate-distortion cost value, and the third rate-distortion cost value;

[0376] The encoding unit 1104 is configured to encode the value of the third syntax element identification information and write the obtained coded bits into the bitstream.

[0377] In some embodiments, the first setting unit 1103 is further configured to set the value of the first syntax element identification information to the first value if the third rate distortion cost value is the smallest among the first rate distortion cost value, the second rate distortion cost value, and the third rate distortion cost value; and set the value of the first syntax element identification information to the second value if the first rate distortion cost value is the smallest among the first rate distortion cost value, the second rate distortion cost value, and the third rate distortion cost value; and the encoding unit 1104 is further configured to encode the value of the first syntax element identification information and write the obtained encoded bits into the bitstream.

[0378] In some embodiments, the first determination unit 1101 is further configured to determine the original value of the component to be filtered of at least one partitioned block included in the current frame, and determine the reconstructed value of the component to be filtered of at least one partitioned block included in the current frame; and perform rate-distortion cost calculation based on the original value of the component to be filtered of at least one partitioned block included in the current frame and the reconstructed value of the component to be filtered of at least one partitioned block included in the current frame to obtain a first rate-distortion cost value.

[0379] In some embodiments, the first determination unit 1101 is further configured to determine the original image of the component to be filtered of the current frame; divide the original image to obtain the original value of the component to be filtered of at least one divided block; perform intra-frame or inter-frame prediction on at least one divided block to determine the predicted value of the component to be filtered of at least one divided block; obtain the initial residual value of the component to be filtered of at least one divided block based on the original value of the component to be filtered of at least one divided block and the predicted value of the component to be filtered of at least one divided block; transform and quantize the initial residual value of the component to be filtered of at least one divided block respectively to obtain the target residual value of the component to be filtered of at least one divided block; perform inverse quantization and inverse transformation on the target residual value of the component to be filtered of at least one divided block respectively to obtain the reconstructed residual value of the component to be filtered of at least one divided block; and determine the reconstructed value of the component to be filtered of at least one divided block based on the predicted value of the component to be filtered of at least one divided block and the reconstructed residual value of the component to be filtered of at least one divided block.

[0380] In some embodiments, the encoding unit 1104 is further configured to encode the target residual value of the to-be-filtered component of at least one divided block, and write the obtained coded bits into the bitstream.

[0381] In some embodiments, the first determining unit 1101 is further configured to determine at least two quantization parameter combinations, wherein each quantization parameter combination comprises at least a candidate quantization parameter value of a first color component and a candidate quantization parameter value of a second color component, and under each quantization parameter combination, filter the reconstructed value of the to-be-filtered component of the at least one partition block included in the current frame based on a preset network model to obtain a filtered reconstructed value of the to-be-filtered component of the at least one partition block included in the current frame, and perform rate-distortion cost calculation on the original value of the to-be-filtered component of the at least one partition block included in the current frame and the filtered reconstructed value of the to-be-filtered component of the at least one partition block included in the current frame to obtain a fourth rate-distortion cost value under each quantization parameter combination, and select a minimum rate-distortion cost value from the obtained fourth rate-distortion cost values, and determine a second rate-distortion cost value according to the minimum rate-distortion cost value.

[0382] In some embodiments, the first determining unit 1101 is further configured to determine a quantization parameter combination corresponding to the minimum rate-distortion cost value as the frame quantization parameter information of the current frame.

[0383] The encoding unit 1104 is further configured to, in a case where the second rate-distortion cost value is smaller than the third rate-distortion cost value, continue to encode the frame quantization parameter information of the current frame after encoding the value of the third syntax element identification information, and write the obtained encoding bits into the bitstream.

[0384] In some embodiments, the first determining unit 1101 is further configured to determine a first quantization parameter candidate set and a second quantization parameter candidate set, and traverse the first quantization parameter candidate set and the second quantization parameter candidate set to determine at least two quantization parameter combinations, wherein the first quantization parameter candidate set is composed of candidate quantization parameter values of at least two first color components, and the second quantization parameter candidate set is composed of candidate quantization parameter values of at least two second color components.

[0385] In some embodiments, the first determining unit 1101 is further configured to determine a frame quantization parameter value of a first color component and a frame quantization parameter value of a second color component according to the frame quantization parameter information of the current frame, determine a third quantization parameter index according to the first quantization parameter candidate set and the frame quantization parameter value of the first color component, wherein the third quantization parameter index is used to indicate an index sequence number of the frame quantization parameter value of the first color component in the first quantization parameter candidate set, determine a fourth quantization parameter index according to the second quantization parameter candidate set and the frame quantization parameter value of the second color component, wherein the fourth quantization parameter index is used to indicate an index sequence number of the frame quantization parameter value of the second color component in the second quantization parameter candidate set, and the encoding unit 1104 is further configured to encode the third quantization parameter index and the fourth quantization parameter index, and write the obtained encoding bits into the bitstream.

[0386] In some embodiments, the first determination unit 1101 is further configured to determine, based on the current block in the current frame, the original value of the component to be filtered of the current block and the reconstructed value of the component to be filtered of the current block; filter the reconstructed value of the component to be filtered of the current block based on a preset network model under at least two combinations of quantization parameters to obtain at least two filtered reconstructed values ​​of the component to be filtered of the current block; perform rate-distortion cost calculation based on the original value of the component to be filtered of the current block and the reconstructed value of the component to be filtered of the current block to obtain a fifth rate-distortion cost value; perform rate-distortion cost calculation based on the original value of the component to be filtered of the current block and the filtered reconstructed values ​​of the at least two components to be filtered of the current block, respectively, to obtain at least two sixth rate-distortion cost values; and determine the second syntax element identification information of the component to be filtered of the current block based on the fifth rate-distortion cost value and the at least two sixth rate-distortion cost values.

[0387] In some embodiments, the first determining unit 1101 is further configured to select a minimum rate distortion cost value from the fifth rate distortion cost value and at least two sixth rate distortion cost values; if the minimum rate distortion cost value is one of the sixth rate distortion cost values, setting the value of the second syntax element identification information to the first value; if the minimum rate distortion cost value is the fifth rate distortion cost value, setting the value of the second syntax element identification information to the second value; and the encoding unit 1104 is further configured to encode the value of the second syntax element identification information and write the obtained coded bits into the bitstream.

[0388] In some embodiments, the first determining unit 1101 is further configured to, when the minimum rate-distortion cost value is one of the sixth rate-distortion cost values, use the quantization parameter combination corresponding to the minimum rate-distortion cost value as the block quantization parameter information of the current block;

[0389] The encoding unit 1104 is further configured to, after encoding the value of the second syntax element identification information, continue to encode the block quantization parameter information of the current block, and write the obtained coded bits into the bitstream.

[0390] In some embodiments, the first determination unit 1101 is further configured to determine the block quantization parameter value of the first color component and the block quantization parameter value of the second color component based on the block quantization parameter information of the current block; determine the first quantization parameter index based on the first quantization parameter candidate set and the block quantization parameter value of the first color component; wherein the first quantization parameter index is used to indicate the index number of the block quantization parameter value of the first color component in the first quantization parameter candidate set; determine the second quantization parameter index based on the second quantization parameter candidate set and the block quantization parameter value of the second color component; wherein the second quantization parameter index is used to indicate the index number of the block quantization parameter value of the second color component in the second quantization parameter candidate set; the encoding unit 1104 is further configured to encode the first quantization parameter index and the second quantization parameter index, and write the obtained encoded bits into the bitstream.

[0391] In some embodiments, the components to be filtered include at least a luminance color component and a chrominance color component; accordingly, the first determination unit 1101 is further configured to determine, when the color component type of the current frame is a luminance color component, that the third syntax element identification information is the frame-level luminance switch identification information of the current frame, the first syntax element identification information is the frame-level luminance enable identification information of the current frame, and the second syntax element identification information is the block-level luminance usage identification information of the current block; wherein, the frame-level luminance switch identification information is used to indicate whether all luminance color components of at least one partitioned block included in the current frame are filtered using a preset network model, the frame-level luminance enable identification information is used to indicate whether there are luminance color components of partitioned blocks in the current frame that are allowed to be filtered using a preset network model, and the block-level luminance usage identification information is used to indicate Whether the luminance color component of the current block is filtered using a preset network model; when the color component type of the current frame is a chrominance color component, the third syntax element identification information is determined to be the frame-level chrominance switch identification information of the current frame, the first syntax element identification information is the frame-level chrominance enable identification information of the current frame, and the second syntax element identification information is the block-level chrominance usage identification information of the current block; wherein, the frame-level chrominance switch identification information is used to indicate whether all the chrominance color components of at least one partitioned block included in the current frame are filtered using a preset network model, the frame-level chrominance enable identification information is used to indicate whether the chrominance color components of the partitioned blocks in the current frame are allowed to be filtered using a preset network model, and the block-level chrominance usage identification information is used to indicate whether the chrominance color components of the current block are filtered using a preset network model.

[0392] In some embodiments, the first determination unit 1101 is further configured to determine fourth grammatical element identification information; and when the fourth grammatical element identification information indicates that the to-be-filtered component of the current sequence allows filtering using a preset network model, execute the step of determining the third grammatical element identification information of the to-be-filtered component of the current frame; wherein the current sequence includes the current frame.

[0393] In some embodiments, the first determination unit 1101 is further configured to determine whether the to-be-filtered component of the current sequence is allowed to be filtered using a preset network model; if the to-be-filtered component of the current sequence is allowed to be filtered using a preset network model, the value of the fourth syntax element identification information is set to a first value; if the to-be-filtered component of the current sequence is not allowed to be filtered using a preset network model, the value of the fourth syntax element identification information is set to a second value; the encoding unit 1104 is further configured to encode the value of the fourth syntax element identification information and write the obtained coded bits into the bitstream.

[0394] In some embodiments, the preset network model is a neural network model, and the neural network model includes at least: a convolutional layer, an activation layer, a splicing layer, and a skip connection layer.

[0395] In some embodiments, the input of the preset network model is the reconstructed value of the component to be filtered of the current block and the block quantization parameter information. Accordingly, the first filtering unit 1102 is also configured to determine that the output of the preset network model is the filtered reconstructed value of the component to be filtered of the current block.

[0396] In some embodiments, the input of the preset network model is the reconstructed value of the component to be filtered of the current block and the block quantization parameter information of the current block. Accordingly, the first filtering unit 1102 is also configured to determine that the output of the preset network model is the first residual value of the component to be filtered of the current block; and determine the filtered reconstructed value of the component to be filtered of the current block based on the reconstructed value of the component to be filtered of the current block and the first residual value of the component to be filtered of the current block.

[0397] In some embodiments, the first determination unit 1101 is further configured to determine a residual scaling factor; scale the first residual value of the component to be filtered of the current block according to the residual scaling factor to obtain a second residual value of the component to be filtered of the current block; and determine the filtered reconstructed value of the component to be filtered of the current block based on the reconstructed value of the component to be filtered of the current block and the second residual value of the component to be filtered of the current block.

[0398] In some embodiments, the encoding unit 1104 is further configured to encode the residual scaling factor and write the obtained coded bits into the bitstream.

[0399] It is understandable that in the embodiments of the present application, a "unit" can be a portion of a circuit, a portion of a processor, a portion of a program or software, etc., and of course it can also be a module, or it can be non-modular. Moreover, the various components in this embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into a single unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional modules.

[0400] The integrated unit, if implemented in the form of a software function module and not sold or used as an independent product, can be stored in a computer readable storage medium based on such understanding. The technical solutions of the embodiments essentially or the part of the prior art that contributes to the technical solutions or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the method described in the embodiments. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.

[0401] Therefore, the embodiments of the present application provide a computer readable storage medium applied to the encoder 100, and the computer readable storage medium stores a computer program. The computer program is executed by the first processor to implement the method of any one of the preceding embodiments.

[0402] Based on the composition of the encoder 100 and the computer readable storage medium, refer to Figure 12 which shows a specific hardware structure schematic diagram of the encoder 100 provided by the embodiments of the present application. As Figure 12 indicated, the encoder 100 can include a first communication interface 1201, a first memory 1202, and a first processor 1203; each component is coupled together through a first bus system 1204. It can be understood that the first bus system 1204 is used to realize the connection communication between the components. The first bus system 1204 includes a data bus, a power bus, a control bus, and a state signal bus. However, for the purpose of clear illustration, all kinds of buses are marked as the first bus system 1204 in Figure 12 . Among them,

[0403] The first communication interface 1201 is used for receiving and sending signals in the information receiving and sending process between other external network elements;

[0404] The first memory 1202 is used for storing a computer program capable of running on the first processor 1203;

[0405] The first processor 1203 is used for executing the following steps when running the computer program:

[0406] determining the first syntax element identification information of the to-be-filtered component of the current frame;

[0407] When the first syntax element identification information indicates that a to-be-filtered component of a partition block exists in the current frame and that filtering using a preset network model is allowed, determining second syntax element identification information of the to-be-filtered component of the current block; wherein the current frame includes at least one partition block, and the current block is any one of the at least one partition block;

[0408] When the second syntax element identification information indicates that the to-be-filtered component of the current block is filtered using a preset network model, determining block quantization parameter information of the current block; wherein the block quantization parameter information includes at least a block quantization parameter value of the first color component and a block quantization parameter value of the second color component;

[0409] Determine the reconstructed value of the component to be filtered of the current block, input the reconstructed value of the component to be filtered of the current block and the block quantization parameter information of the current block into a preset network model, and determine the filtered reconstructed value of the component to be filtered of the current block.

[0410] It is understood that the first memory 1202 in the embodiment of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct RAM bus random access memory (DRRAM). The first memory 1202 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0411] The first processor 1203 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by hardware integrated logic circuits or software instructions in the first processor 1203. The above-mentioned first processor 1203 can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The various methods, steps, and logic block diagrams disclosed in the embodiments of this application can be implemented or executed. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this application can be directly implemented and executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium mature in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in the first memory 1202 , and the first processor 1203 reads the information in the first memory 1202 and completes the steps of the above method in combination with its hardware.

[0412] It is understood that these embodiments described in the present application can be implemented with hardware, software, firmware, middleware, microcode or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application specific integrated circuits (Application Specific Integrated Circuits, ASIC), digital signal processors (Digital Signal Processing, DSP), digital signal processing equipment (DSP Device, DSPD), programmable logic device (Programmable Logic Device, PLD), field programmable gate array (Field-Programmable Gate Array, FPGA), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing functions described in the present application or a combination thereof. For software implementation, the technology described in the present application can be realized by the module (such as process, function etc.) that performs functions described in the present application. The software code can be stored in a memory and executed by a processor. The memory can be implemented in a processor or outside a processor.

[0413] Optionally, as another embodiment, the first processor 1203 is further configured to execute the method described in any one of the aforementioned embodiments when running the computer program.

[0414] This embodiment provides an encoder that can use multiple quantization parameter inputs to preset network model loop filtering technology, wherein, for the input of the preset network model, since it only includes the reconstructed value and block quantization parameter information of the component to be filtered, the prediction information, division information and other non-important input elements of the color component are removed, the amount of calculation during network model inference can be reduced, which is beneficial to the implementation of the decoding end and reduces the decoding time; in addition, since the input block quantization parameter information includes block quantization parameter values ​​of at least two color components, that is, multi-channel quantization parameters are used as input, the luminance color component and the chrominance color component can have more choices and adaptations; and by introducing new syntax elements, the decoding end does not need to store multiple neural network models to achieve a more flexible configuration, which is beneficial to improving encoding performance and further improving encoding and decoding efficiency.

[0415] Based on the same inventive concept as the above embodiments, see Figure 13 , which shows a schematic diagram of the structure of a decoder provided by an embodiment of the present application. Figure 13 As shown, the decoder 200 may include: a decoding unit 1301, a second determining unit 1302 and a second filtering unit 1303; wherein,

[0416] The decoding unit 1301 is configured to parse a bitstream to determine first syntax element identification information of a component to be filtered of a current frame; and when the first syntax element identification information indicates that a component to be filtered of a partition block in the current frame allows filtering using a preset network model, parse the bitstream to determine second syntax element identification information of the component to be filtered of the current block; wherein the current frame includes at least one partition block, and the current block is any one of the at least one partition block;

[0417] The second determining unit 1302 is configured to determine block quantization parameter information of the current block when the second syntax element identification information indicates that the to-be-filtered component of the current block is filtered using a preset network model; wherein the block quantization parameter information includes at least a block quantization parameter value of the first color component and a block quantization parameter value of the second color component;

[0418] The second determining unit 1302 is further configured to determine a reconstructed value of a to-be-filtered component of the current block;

[0419] The second filtering unit 1303 is configured to input the reconstructed value of the component to be filtered of the current block and the block quantization parameter information of the current block into a preset network model to determine the filtered reconstructed value of the component to be filtered of the current block.

[0420] In some embodiments, the decoding unit 1301 is further configured to parse the code stream to determine the first quantization parameter index and the second quantization parameter index of the current block;

[0421] The second determination unit 1302 is further configured to determine, from the first quantization parameter candidate set, a block quantization parameter value of the first color component corresponding to the current block based on the first quantization parameter index; and to determine, from the second quantization parameter candidate set, a block quantization parameter value of the second color component corresponding to the current block based on the second quantization parameter index; wherein the first quantization parameter candidate set is composed of at least two candidate quantization parameter values ​​of the first color component, and the second quantization parameter candidate set is composed of at least two candidate quantization parameter values ​​of the second color component.

[0422] In some embodiments, the decoding unit 1301 is further configured to parse the code stream to determine a block quantization parameter value of the first color component and a block quantization parameter value of the second color component corresponding to the current block.

[0423] In some embodiments, the decoding unit 1301 is further configured to parse the code stream to determine the reconstructed residual value of the to-be-filtered component of the current block;

[0424] The second determination unit 1302 is further configured to perform intra-frame or inter-frame prediction on the component to be filtered of the current block to determine the predicted value of the component to be filtered of the current block; and determine the reconstructed value of the component to be filtered of the current block based on the reconstructed residual value of the component to be filtered of the current block and the predicted value of the component to be filtered of the current block.

[0425] In some embodiments, the second determining unit 1302 is further configured to perform addition calculation on the reconstructed residual value of the component to be filtered of the current block and the predicted value of the component to be filtered of the current block to obtain the reconstructed value of the component to be filtered of the current block.

[0426] In some embodiments, the decoding unit 1301 is further configured to parse the bitstream to obtain the value of the second syntax element identification information;

[0427] The second determination unit 1302 is further configured to, if the value of the second syntax element identification information is the first value, determine that the second syntax element identification information indicates that the to-be-filtered component of the current block is filtered using a preset network model; if the value of the second syntax element identification information is the second value, determine that the second syntax element identification information indicates that the to-be-filtered component of the current block is not filtered using the preset network model.

[0428] In some embodiments, the second determination unit 1302 is further configured to directly determine the reconstructed value of the component to be filtered of the current block as the filtered reconstructed value of the component to be filtered of the current block when the second syntax element identification information indicates that the component to be filtered of the current block is not filtered using a preset network model.

[0429] In some embodiments, the decoding unit 1301 is further configured to parse the bitstream to obtain a value of the first syntax element identification information.

[0430] The second determining unit 1302 is further configured to determine, if the value of the first syntax element identification information is a first value, that the first syntax element identification information indicates that the to-be-filtered components of the at least one divided block in the current frame are all allowed to use the preset network model for filtering; and determine, if the value of the first syntax element identification information is a second value, that the first syntax element identification information indicates that the to-be-filtered components of the at least one divided block included in the current frame are all disallowed to use the preset network model for filtering.

[0431] In some embodiments, referring to Figure 13 The decoder 200 can further include a second setting unit 1304 configured to, when the first syntax element identification information indicates that the to-be-filtered components of the at least one divided block included in the current frame are all disallowed to use the preset network model for filtering, set the values of the second syntax element identification information of the to-be-filtered components of the divided block to the second value; and after determining the reconstructed values of the to-be-filtered components of the divided block, directly determine the reconstructed values of the to-be-filtered components of the divided block as the filtered reconstructed values of the to-be-filtered components of the divided block.

[0432] In some embodiments, the decoding unit 1301 is further configured to parse the bitstream to determine third syntax element identification information of the to-be-filtered components of the current frame; and when the third syntax element identification information indicates that the to-be-filtered components of the at least one divided block included in the current frame are not all filtered using the preset network model, parse the bitstream to determine the first syntax element identification information of the to-be-filtered components of the current frame.

[0433] In some embodiments, the decoding unit 1301 is further configured to parse the bitstream to obtain a value of the third syntax element identification information.

[0434] The second determining unit 1302 is further configured to determine, if the value of the third syntax element identification information is a first value, that the third syntax element identification information indicates that the to-be-filtered components of the at least one divided block included in the current frame are all filtered using the preset network model; and determine, if the value of the third syntax element identification information is a second value, that the third syntax element identification information indicates that the to-be-filtered components of the at least one divided block included in the current frame are not all filtered using the preset network model.

[0435] In some embodiments, the decoding unit 1301 is further configured to, when the third syntax element identification information indicates that the to-be-filtered components of the at least one divided block included in the current frame are all filtered using the preset network model, parse the bitstream to determine frame quantization parameter information of the current frame; wherein the frame quantization parameter information at least includes a frame quantization parameter value of a first color component and a frame quantization parameter value of a second color component.

[0436] The second setting unit 1304 is further configured to set the value of the first syntax element identification information of the to-be-filtered component of the current frame to the first value, set the values ​​of the second syntax element identification information of the to-be-filtered component of the partitioned blocks in the current frame to the first value, and determine the block quantization parameter information of the partitioned blocks according to the frame quantization parameter information of the current frame;

[0437] The second filtering unit 1303 is also configured to input the reconstructed value of the component to be filtered of the divided block and the block quantization parameter information of the divided block into a preset network model after determining the reconstructed value of the component to be filtered of the divided block, and determine the filtered reconstructed value of the component to be filtered of the divided block.

[0438] In some embodiments, the decoding unit 1301 is further configured to parse the code stream to determine the third quantization parameter index and the fourth quantization parameter index of the current frame;

[0439] The second determination unit 1302 is further configured to determine the frame quantization parameter value of the first color component corresponding to the current frame from the first quantization parameter candidate set according to the third quantization parameter index; and to determine the frame quantization parameter value of the second color component corresponding to the current frame from the second quantization parameter candidate set according to the fourth quantization parameter index; wherein the first quantization parameter candidate set is composed of at least two candidate quantization parameter values ​​of the first color component, and the second quantization parameter candidate set is composed of at least two candidate quantization parameter values ​​of the second color component.

[0440] In some embodiments, the components to be filtered include at least a luminance color component and a chrominance color component; accordingly, the second determination unit 1302 is further configured to determine, when the color component type of the current frame is a luminance color component, that the third syntax element identification information is the frame-level luminance switch identification information of the current frame, the first syntax element identification information is the frame-level luminance enable identification information of the current frame, and the second syntax element identification information is the block-level luminance usage identification information of the current block; wherein, the frame-level luminance switch identification information is used to indicate whether all luminance color components of at least one partitioned block included in the current frame are filtered using a preset network model, the frame-level luminance enable identification information is used to indicate whether there are luminance color components of partitioned blocks in the current frame that are allowed to be filtered using a preset network model, and the block-level luminance usage identification information is used to indicate Whether the luminance color component of the current block is filtered using a preset network model; when the color component type of the current frame is a chrominance color component, the third syntax element identification information is determined to be the frame-level chrominance switch identification information of the current frame, the first syntax element identification information is the frame-level chrominance enable identification information of the current frame, and the second syntax element identification information is the block-level chrominance usage identification information of the current block; wherein, the frame-level chrominance switch identification information is used to indicate whether all the chrominance color components of at least one partitioned block included in the current frame are filtered using a preset network model, the frame-level chrominance enable identification information is used to indicate whether the chrominance color components of the partitioned blocks in the current frame are allowed to be filtered using a preset network model, and the block-level chrominance usage identification information is used to indicate whether the chrominance color components of the current block are filtered using a preset network model.

[0441] In some embodiments, the decoding unit 1301 is further configured to parse the bitstream to determine fourth syntax element identification information; and when the fourth syntax element identification information indicates that the to-be-filtered component of the current sequence allows filtering using a preset network model, perform the step of parsing the bitstream to determine the third syntax element identification information of the to-be-filtered component of the current frame; wherein the current sequence includes the current frame.

[0442] In some embodiments, the decoding unit 1301 is further configured to parse the bitstream to obtain the value of the fourth syntax element identification information;

[0443] The second determination unit 1302 is further configured to, if the value of the fourth grammatical element identification information is the first value, determine that the fourth grammatical element identification information indicates that the to-be-filtered component of the current sequence is allowed to be filtered using the preset network model; if the value of the fourth grammatical element identification information is the second value, determine that the fourth grammatical element identification information indicates that the to-be-filtered component of the current sequence is not allowed to be filtered using the preset network model.

[0444] In some embodiments, the preset network model is a neural network model, and the neural network model includes at least: a convolutional layer, an activation layer, a splicing layer, and a skip connection layer.

[0445] In some embodiments, the input of the preset network model is the reconstructed value of the component to be filtered of the current block and the block quantization parameter information. Accordingly, the second filtering unit 1303 is also configured to determine that the output of the preset network model is the filtered reconstructed value of the component to be filtered of the current block.

[0446] In some embodiments, the input of the preset network model is the reconstructed value of the component to be filtered of the current block and the block quantization parameter information of the current block. Accordingly, the second filtering unit 1303 is also configured to determine that the output of the preset network model is the first residual value of the component to be filtered of the current block; and determine the filtered reconstructed value of the component to be filtered of the current block based on the reconstructed value of the component to be filtered of the current block and the first residual value of the component to be filtered of the current block.

[0447] In some embodiments, the decoding unit 1301 is further configured to parse the code stream and determine the residual scaling factor;

[0448] The second determination unit 1302 is further configured to scale the first residual value of the component to be filtered of the current block according to the residual scaling factor to obtain the second residual value of the component to be filtered of the current block; and determine the filtered reconstructed value of the component to be filtered of the current block according to the reconstructed value of the component to be filtered of the current block and the second residual value of the component to be filtered of the current block.

[0449] In some embodiments, the second determination unit 1302 is further configured to traverse at least one partition block in the current frame, take each partition block as the current block in turn, repeatedly perform the steps of parsing the code stream, and determine the value of the second syntax element identification information of the to-be-filtered component of the current block to obtain the post-filtering reconstruction value corresponding to each of the at least one partition block; and determine the reconstructed image of the current frame according to the post-filtering reconstruction value corresponding to each of the at least one partition block.

[0450] It is understood that in this embodiment, a "unit" can be a portion of a circuit, a portion of a processor, a portion of a program or software, etc., and can also be a module or a non-modular system. Furthermore, the various components in this embodiment can be integrated into a single processing unit, or each unit can exist physically separately, or two or more units can be integrated into a single unit. The aforementioned integrated units can be implemented in the form of hardware or software functional modules.

[0451] If the integrated unit is implemented as a software functional module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, this embodiment provides a computer-readable storage medium, which is applied to the decoder 200 and stores a computer program. When the computer program is executed by the second processor, it implements any of the methods in the aforementioned embodiments.

[0452] Based on the above-mentioned components of the decoder 200 and the computer-readable storage medium, see Figure 14 , which shows a schematic diagram of the specific hardware structure of the decoder 200 provided in the embodiment of the present application. Figure 14 As shown, the decoder 200 may include: a second communication interface 1401, a second memory 1402, and a second processor 1403; each component is coupled together via a second bus system 1404. It is understood that the second bus system 1404 is used to achieve connection and communication between these components. In addition to the data bus, the second bus system 1404 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, Figure 14 In FIG, various buses are labeled as a second bus system 1404.

[0453] The second communication interface 1401 is used to receive and send signals when sending and receiving information with other external network elements;

[0454] The second memory 1402 is used to store computer programs that can be run on the second processor 1403;

[0455] The second processor 1403 is configured to, when running the computer program, execute:

[0456] Parse the code stream to determine the first syntax element identification information of the to-be-filtered component of the current frame;

[0457] When the first syntax element identification information indicates that a to-be-filtered component of a partition block in the current frame allows filtering using a preset network model, parsing the bitstream to determine second syntax element identification information of the to-be-filtered component of the current block; wherein the current frame includes at least one partition block, and the current block is any one of the at least one partition block;

[0458] When the second syntax element identification information indicates that the to-be-filtered component of the current block is filtered using a preset network model, determining block quantization parameter information of the current block; wherein the block quantization parameter information includes at least a block quantization parameter value of the first color component and a block quantization parameter value of the second color component;

[0459] Determine the reconstructed value of the component to be filtered of the current block, input the reconstructed value of the component to be filtered of the current block and the block quantization parameter information of the current block into a preset network model, and determine the filtered reconstructed value of the component to be filtered of the current block.

[0460] Optionally, as another embodiment, the second processor 1403 is further configured to execute any one of the methods described in the foregoing embodiments when running the computer program.

[0461] It can be understood that the hardware functions of the second memory 1402 and the first memory 1202 are similar, and the hardware functions of the second processor 1403 and the first processor 1203 are similar; they will not be described in detail here.

[0462] This embodiment provides a decoder that can use a preset network model loop filtering technology with multiple quantization parameters as input. For the input of the preset network model, since it only includes the reconstructed value and block quantization parameter information of the component to be filtered, the prediction information, division information and other non-important input elements of the color component are removed, which can reduce the amount of calculation during network model inference, which is beneficial to the implementation of the decoding end and reduces the decoding time. In addition, since the input block quantization parameter information includes block quantization parameter values ​​of at least two color components, that is, multi-channel quantization parameters are used as input, the luminance color component and the chrominance color component can have more choices and adaptations. Moreover, by introducing new syntax elements, the decoding end does not need to store multiple neural network models to achieve a more flexible configuration, which is beneficial to improving encoding performance and further improving encoding and decoding efficiency.

[0463] In yet another embodiment of the present application, see Figure 15 , which shows a schematic diagram of the composition structure of a coding and decoding system provided by an embodiment of the present application. Figure 15 As shown, the encoding and decoding system 150 may include an encoder 1501 and a decoder 1502. The encoder 1501 may be any one of the encoders in the foregoing embodiments, and the decoder 1502 may be any one of the decoders in the foregoing embodiments.

[0464] In an embodiment of the present application, in the encoding and decoding system 150, both the encoder 1501 and the decoder 1502 can use multiple quantization parameter input preset network model loop filtering technology, wherein, for the input of the preset network model, since it only includes the reconstructed value and block quantization parameter information of the component to be filtered, the prediction information, division information and other non-important input elements of the color component are removed, the amount of calculation during network model inference can be reduced, which is beneficial to the implementation of the decoding end and reduces the decoding time; in addition, since the input block quantization parameter information includes block quantization parameter values ​​of at least two color components, that is, multi-channel quantization parameters are used as input, the luminance color component and the chrominance color component can have more choices and adaptations; and by introducing new syntax elements, the decoding end does not need to store multiple neural network models to achieve a more flexible configuration, which is beneficial to improving encoding performance, and thus can also improve encoding and decoding efficiency.

[0465] It should be noted that, in this application, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.

[0466] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0467] The methods disclosed in the several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.

[0468] The features disclosed in the several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.

[0469] The features disclosed in the several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.

[0470] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

[0471] Industrial Applicability

[0472] In an embodiment of the present application, whether at the encoding end or the decoding end, the first syntax element identification information of the component to be filtered of the current frame is first determined; when the first syntax element identification information indicates that there is a component to be filtered of the partitioned block in the current frame and allows the preset network model to be used for filtering, the second syntax element identification information of the component to be filtered of the current block is then determined; wherein, the current frame includes at least one partitioned block, and the current block is any one of the at least one partitioned block; when the second syntax element identification information indicates that the component to be filtered of the current block is filtered using the preset network model, the block quantization parameter information of the current block is determined; wherein the block quantization parameter information includes at least the block quantization parameter value of the first color component and the block quantization parameter value of the second color component; then the reconstruction value of the component to be filtered of the current block is determined, and the reconstruction value of the component to be filtered of the current block and the block quantization parameter information of the current block are input into the preset network model, and finally the filtered reconstruction value of the component to be filtered of the current block can be determined. In this way, for the input of the preset network model, since it only includes the reconstructed values ​​and block quantization parameter information of the components to be filtered, the prediction information, division information and other non-important input elements of the color components are removed, the amount of calculation during network model inference can be reduced, which is beneficial to the implementation of the decoding end and reduces the decoding time; in addition, since the input block quantization parameter information includes block quantization parameter values ​​of at least two color components, that is, multi-channel quantization parameters are used as input, the luminance color component and the chrominance color component can have more choices and adaptations; and by introducing new syntax elements, the decoding end does not need to store multiple neural network models to achieve a more flexible configuration, which is beneficial to improving encoding performance and thus improving encoding and decoding efficiency.

Claims

1. A decoding method, applied to a decoder, comprising: Parse the code stream to determine the first syntax element identification information of the to-be-filtered component of the current frame; When the first syntax element identification information indicates that a to-be-filtered component of a partition block in the current frame allows filtering using a preset network model, parsing the bitstream to determine second syntax element identification information of the to-be-filtered component of the current block; wherein the current frame includes at least one partition block, and the current block is any one of the at least one partition block; When the second syntax element identification information indicates that the to-be-filtered component of the current block is filtered using a preset network model, determining block quantization parameter information of the current block; wherein the block quantization parameter information includes at least a block quantization parameter value of a first color component and a block quantization parameter value of a second color component; Determine the reconstructed value of the component to be filtered of the current block, input the reconstructed value of the component to be filtered of the current block and the block quantization parameter information of the current block into the preset network model, and determine the filtered reconstructed value of the component to be filtered of the current block.

2. The method according to claim 1, wherein The determining the block quantization parameter information of the current block includes: Parsing a bitstream to determine a first quantization parameter index and a second quantization parameter index of the current block; Determining, according to the first quantization parameter index, a block quantization parameter value of the first color component corresponding to the current block from a first quantization parameter candidate set; and Determining, according to the second quantization parameter index, a block quantization parameter value of the second color component corresponding to the current block from a second quantization parameter candidate set; The first quantization parameter candidate set is composed of candidate quantization parameter values ​​of at least two first color components, and the second quantization parameter candidate set is composed of candidate quantization parameter values ​​of at least two second color components.

3. The method according to claim 1, wherein The determining the block quantization parameter information of the current block includes: Parse the code stream to determine a block quantization parameter value of the first color component and a block quantization parameter value of the second color component corresponding to the current block.

4. The method according to claim 1, wherein The determining of the reconstructed value of the to-be-filtered component of the current block includes: Parsing the bitstream to determine a reconstructed residual value of a to-be-filtered component of the current block; Performing intra-frame or inter-frame prediction on the component to be filtered of the current block to determine a predicted value of the component to be filtered of the current block; Determine a reconstructed value of the component to be filtered of the current block according to the reconstructed residual value of the component to be filtered of the current block and the predicted value of the component to be filtered of the current block.

5. The method according to claim 4, wherein The determining, according to the reconstructed residual value of the component to be filtered of the current block and the predicted value of the component to be filtered of the current block, a reconstructed value of the component to be filtered of the current block, comprises: Adding the reconstructed residual value of the component to be filtered of the current block and the predicted value of the component to be filtered of the current block is performed to obtain a reconstructed value of the component to be filtered of the current block.

6. The method according to claim 1, wherein The parsing of the code stream to determine the second syntax element identification information of the to-be-filtered component of the current block includes: Parsing the code stream to obtain the value of the second syntax element identification information; Accordingly, the method further comprises: If the value of the second syntax element identification information is the first value, determining that the second syntax element identification information indicates that the to-be-filtered component of the current block is filtered using the preset network model; If the value of the second syntax element identification information is the second value, it is determined that the second syntax element identification information indicates that the to-be-filtered component of the current block is not filtered using the preset network model.

7. The method according to claim 6, wherein: After parsing the code stream and determining the second syntax element identification information of the to-be-filtered component of the current block, the method further includes: When the second syntax element identification information indicates that the component to be filtered of the current block is not filtered using a preset network model, the reconstructed value of the component to be filtered of the current block is directly determined as the filtered reconstructed value of the component to be filtered of the current block.

8. The method according to claim 1, wherein The parsing of the code stream to determine the first syntax element identification information of the to-be-filtered component of the current frame includes: Parsing the bitstream to obtain the value of the first syntax element identification information; Accordingly, the method further comprises: If the value of the first syntax element identification information is the first value, determining that the first syntax element identification information indicates that there is a to-be-filtered component of the partitioned block in the current frame and that filtering is allowed to be performed using the preset network model; If the value of the first syntax element identification information is the second value, it is determined that the first syntax element identification information indicates that all to-be-filtered components of at least one partitioned block included in the current frame are not allowed to be filtered using the preset network model.

9. The method according to claim 8, wherein After parsing the code stream and determining the first syntax element identification information of the to-be-filtered component of the current frame, the method further includes: When the first syntax element identification information indicates that all to-be-filtered components of at least one partitioned block included in the current frame are not allowed to be filtered using the preset network model, setting the values ​​of the second syntax element identification information of the to-be-filtered components of the partitioned block to the second value; After determining the reconstructed value of the component to be filtered of the partitioned block, the reconstructed value of the component to be filtered of the partitioned block is directly determined as the filtered reconstructed value of the component to be filtered of the partitioned block.

10. The method according to claim 1, wherein The parsing of the code stream to determine the first syntax element identification information of the current frame includes: Parsing the bitstream to determine third syntax element identification information of the to-be-filtered component of the current frame; When the third syntax element identification information indicates that not all to-be-filtered components of at least one partitioned block included in the current frame are filtered using the preset network model, the bitstream is parsed to determine the first syntax element identification information of the to-be-filtered components of the current frame.

11. The method according to claim 10, wherein: The parsing of the code stream to determine the third syntax element identification information of the to-be-filtered component of the current frame includes: Parsing the code stream to obtain the value of the third syntax element identification information; Accordingly, the method further comprises: If the value of the third syntax element identification information is the first value, determining that the third syntax element identification information indicates that all to-be-filtered components of at least one partitioned block included in the current frame are filtered using the preset network model; If the value of the third syntax element identification information is the second value, it is determined that the third syntax element identification information indicates that not all to-be-filtered components of at least one partitioned block included in the current frame are filtered using the preset network model.

12. The method according to claim 10, wherein: After parsing the code stream and determining the third syntax element identification information of the to-be-filtered component of the current frame, the method further includes: When the third syntax element identification information indicates that all to-be-filtered components of at least one partitioned block included in the current frame are filtered using the preset network model, parsing the bitstream to determine frame quantization parameter information of the current frame; wherein the frame quantization parameter information includes at least a frame quantization parameter value of a first color component and a frame quantization parameter value of a second color component; Setting the value of the first syntax element identification information of the to-be-filtered component of the current frame to the first value, setting the values ​​of the second syntax element identification information of the to-be-filtered component of the divided blocks in the current frame to the first value, and determining the block quantization parameter information of the divided blocks according to the frame quantization parameter information of the current frame; After determining the reconstructed value of the component to be filtered of the partitioned block, the reconstructed value of the component to be filtered of the partitioned block and the block quantization parameter information of the partitioned block are input into the preset network model to determine the filtered reconstructed value of the component to be filtered of the partitioned block.

13. The method according to claim 12, wherein: The parsing of the code stream to determine the frame quantization parameter information of the current frame includes: Parsing the bitstream to determine a third quantization parameter index and a fourth quantization parameter index of the current frame; Determining, according to the third quantization parameter index, a frame quantization parameter value of the first color component corresponding to the current frame from a first quantization parameter candidate set; and Determining, according to the fourth quantization parameter index, a frame quantization parameter value of the second color component corresponding to the current frame from a second quantization parameter candidate set; The first quantization parameter candidate set is composed of candidate quantization parameter values ​​of at least two first color components, and the second quantization parameter candidate set is composed of candidate quantization parameter values ​​of at least two second color components.

14. The method according to claim 10, wherein: The components to be filtered include at least a luminance color component and a chrominance color component; the method further includes: When the color component type of the current frame is a luma color component, determining that the third syntax element identification information is frame-level luma switch identification information of the current frame, the first syntax element identification information is frame-level luma enable identification information of the current frame, and the second syntax element identification information is block-level luma usage identification information of the current block; wherein the frame-level luma switch identification information is used to indicate whether all luma color components of at least one divided block included in the current frame are filtered using the preset network model, the frame-level luma enable identification information is used to indicate whether luma color components of divided blocks in the current frame are allowed to be filtered using the preset network model, and the block-level luma usage identification information is used to indicate whether the luma color component of the current block is filtered using the preset network model; When the color component type of the current frame is a chroma color component, the third syntax element identification information is determined to be the frame-level chroma switch identification information of the current frame, the first syntax element identification information is the frame-level chroma enable identification information of the current frame, and the second syntax element identification information is the block-level chroma usage identification information of the current block; wherein, the frame-level chroma switch identification information is used to indicate whether all the chroma color components of at least one partitioned block included in the current frame are filtered using the preset network model, the frame-level chroma enable identification information is used to indicate whether the chroma color components of the partitioned blocks in the current frame are allowed to be filtered using the preset network model, and the block-level chroma usage identification information is used to indicate whether the chroma color components of the current block are filtered using the preset network model.

15. The method according to claim 10, wherein The method further comprises: Parsing the code stream to determine identification information of the fourth syntax element; When the fourth syntax element identification information indicates that the to-be-filtered component of the current sequence allows filtering using the preset network model, performing the step of parsing the code stream to determine the third syntax element identification information of the to-be-filtered component of the current frame; wherein the current sequence includes the current frame.

16. The method according to claim 15, wherein The parsing of the code stream to determine the fourth syntax element identification information includes: Parsing the code stream to obtain the value of the fourth syntax element identification information; Accordingly, the method further comprises: If the value of the fourth syntax element identification information is the first value, determining that the fourth syntax element identification information indicates that the to-be-filtered component of the current sequence allows filtering using the preset network model; If the value of the fourth syntax element identification information is the second value, it is determined that the fourth syntax element identification information indicates that the to-be-filtered component of the current sequence is not allowed to be filtered using the preset network model.

17. The method according to claim 1, wherein The preset network model is a neural network model, and the neural network model at least includes: a convolution layer, an activation layer, a splicing layer and a skip connection layer.

18. The method according to any one of claims 1 to 17, wherein: The input of the preset network model is the reconstructed value of the to-be-filtered component of the current block and the block quantization parameter information of the current block, and the method further includes: An output of the preset network model is determined to be a filtered reconstructed value of the to-be-filtered component of the current block.

19. The method according to any one of claims 1 to 17, wherein: The input of the preset network model is the reconstructed value of the to-be-filtered component of the current block and the block quantization parameter information of the current block, and the method further includes: Determine that the output of the preset network model is a first residual value of the to-be-filtered component of the current block; Accordingly, determining the filtered reconstructed value of the to-be-filtered component of the current block includes: After obtaining the first residual value of the component to be filtered of the current block through the preset network model, the filtered reconstructed value of the component to be filtered of the current block is determined according to the reconstructed value of the component to be filtered of the current block and the first residual value of the component to be filtered of the current block.

20. The method according to claim 19, wherein The method further comprises: Parse the code stream and determine the residual scaling factor; Accordingly, determining the filtered reconstructed value of the to-be-filtered component of the current block includes: Scaling the first residual value of the component to be filtered of the current block according to the residual scaling factor to obtain a second residual value of the component to be filtered of the current block; Determine a filtered reconstructed value of the component to be filtered of the current block according to the reconstructed value of the component to be filtered of the current block and the second residual value of the component to be filtered of the current block.

21. The method according to claim 1, wherein The method further comprises: Traversing at least one partitioned block in the current frame, taking each partitioned block as the current block in turn, and repeatedly performing the steps of parsing the bitstream and determining the second syntax element identification information of the to-be-filtered component of the current block, so as to obtain a filtered reconstructed value corresponding to each of the at least one partitioned block; The reconstructed image of the current frame is determined according to the filtered reconstruction value corresponding to each of the at least one divided block.

22. A coding method, applied to an encoder, comprising: Determining first syntax element identification information of a to-be-filtered component of a current frame; When the first syntax element identification information indicates that a to-be-filtered component of a partition block exists in the current frame and that filtering using a preset network model is allowed, determining second syntax element identification information of the to-be-filtered component of the current block; wherein the current frame includes at least one partition block, and the current block is any one of the at least one partition block; When the second syntax element identification information indicates that the to-be-filtered component of the current block is filtered using a preset network model, determining block quantization parameter information of the current block; wherein the block quantization parameter information includes at least a block quantization parameter value of a first color component and a block quantization parameter value of a second color component; Determine the reconstructed value of the component to be filtered of the current block, input the reconstructed value of the component to be filtered of the current block and the block quantization parameter information of the current block into the preset network model, and determine the filtered reconstructed value of the component to be filtered of the current block.

23. The method according to claim 22, wherein The determining the first syntax element identification information of the to-be-filtered component of the current frame includes: Determining third syntax element identification information of the to-be-filtered component of the current frame; When the third syntax element identification information indicates that not all components to be filtered of at least one partitioned block included in the current frame are filtered using the preset network model, first syntax element identification information of the components to be filtered of the current frame is determined.

24. The method according to claim 23, wherein The method further comprises: Determining a first rate-distortion cost value when all to-be-filtered components of at least one divided block included in the current frame are not filtered using the preset network model; Determine a second rate-distortion cost value of filtering all to-be-filtered components of at least one divided block included in the current frame using the preset network model; Determine a third rate-distortion cost value that allows filtering of a to-be-filtered component of a divided block in the current frame using the preset network model; Determine, based on the first rate-distortion cost value, the second rate-distortion cost value, and the third rate-distortion cost value, frame-level syntax element identification information of the to-be-filtered component of the current frame; wherein the frame-level syntax element identification information includes the first syntax element identification information and the third syntax element identification information.

25. The method according to claim 24, wherein The determining, according to the first rate-distortion cost value, the second rate-distortion cost value, and the third rate-distortion cost value, the frame-level syntax element identification information of the to-be-filtered component of the current frame includes: If the second rate-distortion cost value is the smallest among the first rate-distortion cost value, the second rate-distortion cost value, and the third rate-distortion cost value, setting the value of the third syntax element identification information to the first value; If the first rate-distortion cost value, the second rate-distortion cost value, and the third rate-distortion cost value are the smallest or the third rate-distortion cost value is the smallest, setting the value of the third syntax element identification information to the second value; Accordingly, the method further comprises: The value of the third syntax element identification information is encoded, and the obtained encoded bits are written into a bitstream.

26. The method according to claim 24, wherein The determining, according to the first rate-distortion cost value, the second rate-distortion cost value, and the third rate-distortion cost value, the frame-level syntax element identification information of the to-be-filtered component of the current frame includes: If the third rate-distortion cost value is the smallest among the first rate-distortion cost value, the second rate-distortion cost value, and the third rate-distortion cost value, setting the value of the first syntax element identification information to a first value; If the first rate-distortion cost value is the smallest among the first rate-distortion cost value, the second rate-distortion cost value, and the third rate-distortion cost value, setting the value of the first syntax element identification information to a second value; Accordingly, the method further comprises: The value of the first syntax element identification information is encoded, and the obtained encoded bits are written into a bitstream.

27. The method according to claim 24, wherein The determining a first rate-distortion cost value when all to-be-filtered components of at least one divided block included in the current frame are not filtered using the preset network model includes: Determining an original value of a to-be-filtered component of at least one partitioned block included in the current frame, and determining a reconstructed value of a to-be-filtered component of at least one partitioned block included in the current frame; A rate-distortion cost is calculated based on an original value of a to-be-filtered component of at least one partitioned block included in the current frame and a reconstructed value of a to-be-filtered component of at least one partitioned block included in the current frame to obtain the first rate-distortion cost value.

28. The method according to claim 27, wherein The determining of a reconstructed value of a to-be-filtered component of at least one partitioned block included in the current frame comprises: Determining the original image of the component to be filtered of the current frame; Dividing the original image to obtain an original value of a to-be-filtered component of at least one divided block; Performing intra-frame or inter-frame prediction on the at least one partition block to determine a prediction value of a to-be-filtered component of the at least one partition block; Obtaining an initial residual value of the component to be filtered of the at least one partitioned block according to the original value of the component to be filtered of the at least one partitioned block and the predicted value of the component to be filtered of the at least one partitioned block; Performing transformation and quantization processing on the initial residual value of the to-be-filtered component of the at least one partitioned block respectively to obtain a target residual value of the to-be-filtered component of the at least one partitioned block; Performing inverse quantization and inverse transformation processing on the target residual value of the component to be filtered of the at least one partition block, respectively, to obtain a reconstructed residual value of the component to be filtered of the at least one partition block; The reconstructed value of the component to be filtered of the at least one partition block is determined according to the predicted value of the component to be filtered of the at least one partition block and the reconstructed residual value of the component to be filtered of the at least one partition block.

29. The method according to claim 28, wherein The method further comprises: The target residual value of the to-be-filtered component of the at least one divided block is encoded, and the obtained encoded bits are written into a bitstream.

30. The method of claim 25, wherein: The determining a second rate-distortion cost value of filtering all to-be-filtered components of at least one divided block included in the current frame using the preset network model includes: Determining at least two quantization parameter combinations; wherein each quantization parameter combination includes at least one candidate quantization parameter value for the first color component and one candidate quantization parameter value for the second color component; Under each quantization parameter combination, filtering the reconstructed value of the to-be-filtered component of at least one partitioned block included in the current frame based on the preset network model to obtain a filtered reconstructed value of the to-be-filtered component of at least one partitioned block included in the current frame; performing rate-distortion cost calculation based on an original value of a to-be-filtered component of at least one partitioned block included in the current frame and a filtered reconstructed value of the to-be-filtered component of at least one partitioned block included in the current frame, to obtain a fourth rate-distortion cost value under each quantization parameter combination; A minimum rate-distortion cost value is selected from the obtained fourth rate-distortion cost values, and the second rate-distortion cost value is determined according to the minimum rate-distortion cost value.

31. The method according to claim 30, wherein The method further comprises: using the quantization parameter combination corresponding to the minimum rate-distortion cost value as the frame quantization parameter information of the current frame; Accordingly, when the second rate-distortion cost value is the smallest among the first rate-distortion cost value, the second rate-distortion cost value, and the third rate-distortion cost value, the method further includes: After encoding the value of the third syntax element identification information, continue encoding the frame quantization parameter information of the current frame, and write the obtained coded bits into the bitstream.

32. The method according to claim 31, wherein The determining of at least two quantization parameter combinations includes: Determine a first quantization parameter candidate set and a second quantization parameter candidate set; Traversing the first quantization parameter candidate set and the second quantization parameter candidate set to determine the at least two quantization parameter combinations; The first quantization parameter candidate set is composed of candidate quantization parameter values ​​of at least two first color components, and the second quantization parameter candidate set is composed of candidate quantization parameter values ​​of at least two second color components.

33. The method according to claim 32, wherein The encoding of the frame quantization parameter information of the current frame and writing the obtained coded bits into the bitstream further includes: Determining a frame quantization parameter value of a first color component and a frame quantization parameter value of a second color component according to the frame quantization parameter information of the current frame; Determining a third quantization parameter index according to the first quantization parameter candidate set and the frame quantization parameter value of the first color component; wherein the third quantization parameter index is used to indicate the index number of the frame quantization parameter value of the first color component in the first quantization parameter candidate set; Determining a fourth quantization parameter index according to the second quantization parameter candidate set and the frame quantization parameter value of the second color component; wherein the fourth quantization parameter index is used to indicate the index number of the frame quantization parameter value of the second color component in the second quantization parameter candidate set; The third quantization parameter index and the fourth quantization parameter index are encoded, and the obtained encoded bits are written into a bitstream.

34. The method of claim 30, wherein: The method further comprises: Determining, based on a current block in the current frame, an original value of a to-be-filtered component of the current block and a reconstructed value of the to-be-filtered component of the current block; Under the at least two quantization parameter combinations, filtering the reconstructed values ​​of the to-be-filtered components of the current block based on the preset network model to obtain at least two filtered reconstructed values ​​of the to-be-filtered components of the current block; performing rate-distortion cost calculation according to the original value of the to-be-filtered component of the current block and the reconstructed value of the to-be-filtered component of the current block to obtain a fifth rate-distortion cost value; performing rate-distortion cost calculations based on the original value of the to-be-filtered component of the current block and at least two filtered reconstructed values ​​of the to-be-filtered components of the current block, respectively, to obtain at least two sixth rate-distortion cost values; Determine second syntax element identification information of the to-be-filtered component of the current block according to the fifth rate-distortion cost value and the at least two sixth rate-distortion cost values.

35. The method according to claim 34, wherein The determining, according to the fifth rate-distortion cost value and the at least two sixth rate-distortion cost values, second syntax element identification information of the to-be-filtered component of the current block includes: Selecting a minimum rate-distortion cost value from the fifth rate-distortion cost value and the at least two sixth rate-distortion cost values; If the minimum rate-distortion cost value is one of the sixth rate-distortion cost values, setting the value of the second syntax element identification information to the first value; If the minimum rate-distortion cost value is the fifth rate-distortion cost value, setting the value of the second syntax element identification information to a second value; Accordingly, the method further comprises: The value of the second syntax element identification information is encoded, and the obtained encoded bits are written into a bitstream.

36. The method according to claim 35, wherein When the second syntax element identification information indicates that the to-be-filtered component of the current block is filtered using a preset network model, determining the block quantization parameter information of the current block includes: When the minimum rate-distortion cost value is one of the sixth rate-distortion cost values, using the quantization parameter combination corresponding to the minimum rate-distortion cost value as the block quantization parameter information of the current block; Accordingly, the method further comprises: After encoding the value of the second syntax element identification information, continue encoding the block quantization parameter information of the current block, and write the obtained coded bits into the bitstream.

37. The method according to claim 36, wherein The encoding of the block quantization parameter information of the current block and writing the obtained coded bits into the bitstream further includes: Determining a block quantization parameter value of a first color component and a block quantization parameter value of a second color component according to the block quantization parameter information of the current block; Determine a first quantization parameter index according to a first quantization parameter candidate set and a block quantization parameter value of the first color component; wherein the first quantization parameter index is used to indicate an index number of the block quantization parameter value of the first color component in the first quantization parameter candidate set; Determining a second quantization parameter index according to a second quantization parameter candidate set and a block quantization parameter value of the second color component; wherein the second quantization parameter index is used to indicate an index number of the block quantization parameter value of the second color component in the second quantization parameter candidate set; The first quantization parameter index and the second quantization parameter index are encoded, and the obtained encoded bits are written into a bitstream.

38. The method of claim 23, wherein: The components to be filtered include at least a luminance color component and a chrominance color component; the method further includes: When the color component type of the current frame is a luma color component, determining that the third syntax element identification information is frame-level luma switch identification information of the current frame, the first syntax element identification information is frame-level luma enable identification information of the current frame, and the second syntax element identification information is block-level luma usage identification information of the current block; wherein the frame-level luma switch identification information is used to indicate whether all luma color components of at least one divided block included in the current frame are filtered using the preset network model, the frame-level luma enable identification information is used to indicate whether luma color components of divided blocks in the current frame are allowed to be filtered using the preset network model, and the block-level luma usage identification information is used to indicate whether the luma color component of the current block is filtered using the preset network model; When the color component type of the current frame is a chroma color component, the third syntax element identification information is determined to be the frame-level chroma switch identification information of the current frame, the first syntax element identification information is the frame-level chroma enable identification information of the current frame, and the second syntax element identification information is the block-level chroma usage identification information of the current block; wherein, the frame-level chroma switch identification information is used to indicate whether all the chroma color components of at least one partitioned block included in the current frame are filtered using the preset network model, the frame-level chroma enable identification information is used to indicate whether the chroma color components of the partitioned blocks in the current frame are allowed to be filtered using the preset network model, and the block-level chroma usage identification information is used to indicate whether the chroma color components of the current block are filtered using the preset network model.

39. The method of claim 23, wherein: The method further comprises: Determining fourth syntax element identification information; When the fourth syntax element identification information indicates that the to-be-filtered component of the current sequence allows filtering using the preset network model, the step of determining the third syntax element identification information of the to-be-filtered component of the current frame is performed; wherein the current sequence includes the current frame.

40. The method of claim 39, wherein The determining the fourth syntax element identification information includes: Determining whether the to-be-filtered component of the current sequence is allowed to be filtered using the preset network model; If the to-be-filtered component of the current sequence allows filtering using the preset network model, setting the value of the fourth syntax element identification information to the first value; If the to-be-filtered component of the current sequence does not allow filtering using the preset network model, setting the value of the fourth syntax element identification information to a second value; Accordingly, the method further comprises: The value of the fourth syntax element identification information is encoded, and the obtained encoded bits are written into a bitstream.

41. The method of claim 22, wherein: The preset network model is a neural network model, and the neural network model at least includes: a convolution layer, an activation layer, a splicing layer and a skip connection layer.

42. The method according to any one of claims 22 to 41, wherein The input of the preset network model is the reconstructed value of the to-be-filtered component of the current block and the block quantization parameter information of the current block, and the method further includes: An output of the preset network model is determined to be a filtered reconstructed value of the to-be-filtered component of the current block.

43. The method according to any one of claims 22 to 41, wherein The input of the preset network model is the reconstructed value of the to-be-filtered component of the current block and the block quantization parameter information of the current block, and the method further includes: Determine that the output of the preset network model is a first residual value of the to-be-filtered component of the current block; Accordingly, determining the filtered reconstructed value of the to-be-filtered component of the current block includes: After obtaining the first residual value of the component to be filtered of the current block through the preset network model, the filtered reconstructed value of the component to be filtered of the current block is determined according to the reconstructed value of the component to be filtered of the current block and the first residual value of the component to be filtered of the current block.

44. The method according to claim 43, wherein The method further comprises: Determine the residual scaling factor; Accordingly, determining the filtered reconstructed value of the to-be-filtered component of the current block includes: Scaling the first residual value of the component to be filtered of the current block according to the residual scaling factor to obtain a second residual value of the component to be filtered of the current block; Determine a filtered reconstructed value of the component to be filtered of the current block according to the reconstructed value of the component to be filtered of the current block and the second residual value of the component to be filtered of the current block.

45. The method of claim 44, wherein: The method further comprises: The residual scaling factor is encoded, and the obtained encoded bits are written into a bitstream.

46. ​​A method for transmitting a code stream, characterized in that: Execute the encoding method according to any one of claims 22 to 45 to generate a code stream; and transmit the code stream.

47. An encoder, comprising a first determining unit and a first filtering unit; wherein: The first determining unit is configured to determine first syntax element identification information of a component to be filtered of a current frame; and when the first syntax element identification information indicates that a component to be filtered of a partition block in the current frame allows filtering using a preset network model, determine second syntax element identification information of the component to be filtered of the current block; wherein the current frame includes at least one partition block, and the current block is any one of the at least one partition block; and when the second syntax element identification information indicates that the component to be filtered of the current block uses a preset network model to filter, determine block quantization parameter information of the current block; wherein the block quantization parameter information includes at least a block quantization parameter value of a first color component and a block quantization parameter value of a second color component; The first determining unit is further configured to determine a reconstructed value of the to-be-filtered component of the current block, The first filtering unit is configured to input the reconstructed value of the component to be filtered of the current block and the block quantization parameter information of the current block into the preset network model to determine the filtered reconstructed value of the component to be filtered of the current block.

48. An encoder comprising a first memory and a first processor; wherein: The first memory is used to store a computer program that can be run on the first processor; The first processor is configured to execute the method according to any one of claims 22 to 45 when running the computer program.

49. A decoder comprising a decoding unit, a second determining unit, and a second filtering unit; wherein: The decoding unit is configured to parse a bitstream to determine first syntax element identification information of a component to be filtered of a current frame; and when the first syntax element identification information indicates that a component to be filtered of a partition block in the current frame allows filtering using a preset network model, parse the bitstream to determine second syntax element identification information of the component to be filtered of the current block; wherein the current frame includes at least one partition block, and the current block is any one of the at least one partition block; The second determining unit is configured to determine block quantization parameter information of the current block when the second syntax element identification information indicates that the to-be-filtered component of the current block is filtered using a preset network model; wherein the block quantization parameter information includes at least a block quantization parameter value of the first color component and a block quantization parameter value of the second color component; The second determining unit is further configured to determine a reconstructed value of the to-be-filtered component of the current block; The second filtering unit is configured to input the reconstructed value of the component to be filtered of the current block and the block quantization parameter information of the current block into the preset network model to determine the filtered reconstructed value of the component to be filtered of the current block.

50. A decoder comprising a second memory and a second processor; wherein: The second memory is used to store a computer program that can be run on the second processor; The second processor is configured to execute the method according to any one of claims 1 to 21 when running the computer program.

51. A computer-readable storage medium, wherein: The computer-readable storage medium stores a computer program, and when the computer program is executed, the method according to any one of claims 1 to 21 or the method according to any one of claims 22 to 45 is implemented.

Citation Information

Patent Citations

  • Loop filtering method and device

    CN112544081A

  • Multiple neural network models for filtering during video coding

    US20220103864A1