WO2022227062A1 - Encoding and decoding methods, code stream, encoder, decoder, and storage medium - Google Patents

Encoding and decoding methods, code stream, encoder, decoder, and storage medium Download PDF

Info

Publication number
WO2022227062A1
WO2022227062A1 PCT/CN2021/091670 CN2021091670W WO2022227062A1 WO 2022227062 A1 WO2022227062 A1 WO 2022227062A1 CN 2021091670 W CN2021091670 W CN 2021091670W WO 2022227062 A1 WO2022227062 A1 WO 2022227062A1
Authority
WO
WIPO (PCT)
Prior art keywords
weight matrix
value
identification information
syntax element
network model
Prior art date
Application number
PCT/CN2021/091670
Other languages
French (fr)
Chinese (zh)
Inventor
戴震宇
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Priority to PCT/CN2021/091670 priority Critical patent/WO2022227062A1/en
Priority to CN202180090942.1A priority patent/CN116803078A/en
Publication of WO2022227062A1 publication Critical patent/WO2022227062A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/80Details of filtering operations specially adapted for video compression, e.g. for pixel interpolation
    • H04N19/82Details of filtering operations specially adapted for video compression, e.g. for pixel interpolation involving filtering within a prediction loop

Definitions

  • the embodiments of the present application relate to the technical field of image processing, and in particular, to an encoding and decoding method, a code stream, an encoder, a decoder, and a storage medium.
  • the traditional loop filter mainly includes deblocking filter, sample adaptive compensation filter and adaptive correction filter.
  • the high performance-modular intelligent coding test model High Performance-Modular Artificial Intelligence Model, HPM-ModAI
  • HPM-ModAI High Performance-Modular Artificial Intelligence Model
  • AVS3 Third-generation audio and video coding standard
  • CNNLF residual neural network based The loop filter (hereinafter referred to as CNNLF) is used as the baseline scheme of the intelligent loop filter module, and is located between the sample adaptive compensation filter and the adaptive correction filter.
  • the reconstructed pixel value of the current block will be updated to the pixel value processed by CNNLF at this time.
  • the smaller distortion value of the entire block does not mean that the distortion of each pixel value in the block will be smaller, so that the improvement of coding performance is limited.
  • Embodiments of the present application provide an encoding and decoding method, a code stream, an encoder, a decoder, and a storage medium, which can improve encoding performance and further improve encoding and decoding efficiency.
  • an embodiment of the present application provides a decoding method, which is applied to a decoder, and the method includes:
  • At least one syntax element identification information indicates that the current frame or the current block uses the weight matrix for filtering processing, determine the weight matrix network model of the current block, and determine the weight matrix of the current block according to the weight matrix network model;
  • the target reconstructed image block of the current block is determined.
  • an embodiment of the present application provides an encoding method, which is applied to an encoder, and the method includes:
  • the weight matrix is used to determine the target reconstructed image block of the current block.
  • an embodiment of the present application provides a code stream, where the code stream is generated by bit encoding according to the value of at least one syntax element identification information;
  • the at least one syntax element identification information includes at least: first syntax element identification information, first luma syntax element identification information, second luma syntax element identification information, and chroma syntax element identification information;
  • the first syntax element identification information is used to indicate whether the video sequence is filtered using the weight matrix
  • the first luminance syntax element identification information is used to indicate whether the luminance component of the current frame is filtered using the weight matrix
  • the second luminance syntax element identification The information is used to indicate whether the luminance component of the current block is filtered using the weight matrix
  • the chroma syntax element identification information is used to indicate whether the chroma component of the current frame is filtered using the weight matrix
  • the video sequence includes the current frame
  • the current frame includes the current frame. piece.
  • an embodiment of the present application provides an encoder, where the encoder includes a first determining unit and a first filtering unit; wherein,
  • a first determining unit configured to determine the weight matrix network model of the current block, and determine the weight matrix of the current block according to the weight matrix network model; and also configured to determine the value of at least one syntax element identification information;
  • the first filtering unit is configured to use the weight matrix to determine the target reconstructed image block of the current block when the at least one syntax element identification information indicates that the current frame or the current block uses the weight matrix for filtering processing.
  • a first memory for storing a computer program executable on the first processor
  • the first processor is configured to execute the method of the second aspect when running the computer program.
  • an embodiment of the present application provides a decoder, the decoder includes a parsing unit, a second determining unit, and a second filtering unit; wherein,
  • a parsing unit configured to parse the code stream, and determine the value of at least one syntax element identification information
  • a second determining unit configured to determine the weight matrix network model of the current block when the at least one syntax element identification information indicates that the current frame or the current block uses the weight matrix for filtering processing, and determine the weight matrix of the current block according to the weight matrix network model;
  • the second filtering unit is configured to use the weight matrix to determine the target reconstructed image block of the current block.
  • an embodiment of the present application provides a decoder, where the decoder includes a second memory and a second processor; wherein,
  • a second memory for storing a computer program executable on the second processor
  • the second processor is configured to execute the method according to the first aspect when running the computer program.
  • an embodiment of the present application provides a computer storage medium, where the computer storage medium stores a computer program, and when the computer program is executed, the method described in the first aspect or the second aspect is realized. Methods.
  • the embodiments of the present application provide an encoding and decoding method, a code stream, an encoder, a decoder, and a storage medium.
  • the weight matrix network model of the current block is determined, and the weight of the current block is determined according to the weight matrix network model. matrix; determine the value of at least one syntax element identification information; when the at least one syntax element identification information indicates that the current frame or current block uses the weight matrix for filtering, use the weight matrix to determine the target reconstructed image block of the current block.
  • Fig. 1 is the application schematic diagram of a kind of coding framework provided by the related art
  • FIG. 2 is an application schematic diagram of another encoding framework provided by the related art
  • 3A is a schematic diagram of a detailed framework of a video coding system provided by an embodiment of the present application.
  • 3B is a schematic diagram of a detailed framework of a video decoding system provided by an embodiment of the application.
  • FIG. 4 is a schematic flowchart of a decoding method provided by an embodiment of the present application.
  • 5A is a schematic diagram of a network structure composition of a luminance component provided by an embodiment of the present application.
  • FIG. 7 is a schematic diagram of the application of a coding framework provided by an embodiment of the present application.
  • FIG. 8 is a schematic diagram of the composition and structure of a weight matrix network model provided by an embodiment of the present application.
  • FIG. 9 is a schematic diagram of an overall framework of a weight matrix network model provided by an embodiment of the present application.
  • FIG. 10 is a schematic flowchart of an encoding method provided by an embodiment of the present application.
  • FIG. 11 is a schematic diagram of the composition and structure of an encoder provided by an embodiment of the application.
  • FIG. 12 is a schematic diagram of a specific hardware structure of an encoder provided by an embodiment of the application.
  • FIG. 13 is a schematic diagram of the composition and structure of a decoder provided by an embodiment of the present application.
  • FIG. 14 is a schematic diagram of a specific hardware structure of a decoder provided by an embodiment of the present application.
  • a first image component, a second image component, and a third image component are generally used to represent a coding block (Coding Block, CB); wherein, the three image components are a luminance component and a blue chrominance component respectively. and a red chrominance component, specifically, the luminance component is usually represented by the symbol Y, the blue chrominance component is usually represented by the symbol Cb or U, and the red chrominance component is usually represented by the symbol Cr or V; in this way, the video image can use the YCbCr format Representation can also be represented in YUV format.
  • CB coding block
  • the three image components are a luminance component and a blue chrominance component respectively.
  • a red chrominance component specifically, the luminance component is usually represented by the symbol Y, the blue chrominance component is usually represented by the symbol Cb or U, and the red chrominance component is usually represented by the symbol Cr or V; in this way, the video image can use the
  • MPEG Moving Picture Experts Group
  • VVC Very Video Coding
  • VVC's reference software test platform VVC Test Model, VTM
  • Audio Video coding Standard (AVS)
  • HPM High-Performance Model
  • High Performance-Modular Artificial Intelligence Model of AVS High Performance-Modular Artificial Intelligence Model, HPM-ModAI
  • ALF Adaptive loop filter
  • Quantization Parameter (QP) Quantization Parameter
  • Coding Unit Coding Unit
  • the digital video compression technology mainly compresses the huge digital image and video data to facilitate transmission and storage.
  • the existing digital video compression standards can save a lot of video data, it is still necessary to pursue better digital video compression technology to reduce digital video data. Bandwidth and traffic pressure for video transmission.
  • the encoder In the process of digital video encoding, the encoder reads unequal pixels for the original video sequences of different color formats, including luminance components and chrominance components, that is, the encoder reads a black and white or color image. The image is then divided into blocks, and the block data is handed over to the encoder for encoding.
  • the encoder is usually a hybrid frame encoding mode, which can generally include intra-frame prediction and inter-frame prediction, transform/quantization, inverse quantization/inverse transform, For operations such as loop filtering and entropy coding, the specific processing flow can be referred to as shown in FIG. 1 .
  • intra-frame prediction only refers to the information of the same frame image, and predicts the pixel information in the current divided block to eliminate spatial redundancy
  • inter-frame prediction can include motion estimation and motion compensation, which can refer to the image information of different frames, using Motion estimation searches for the motion vector information that best matches the current divided block to eliminate temporal redundancy; transformation converts the predicted image block to the frequency domain, and the energy is redistributed.
  • the traditional loop filtering module mainly includes deblocking filter (hereinafter referred to as DBF), sample adaptive compensation filter (hereinafter referred to as SAO) and adaptive correction filter (hereinafter referred to as SAO) abbreviated as ALF).
  • DBF deblocking filter
  • SAO sample adaptive compensation filter
  • ALF adaptive correction filter
  • the loop filter based on residual neural network hereinafter referred to as CNNLF
  • CNNLF residual neural network
  • the reconstructed pixel value of the current CTU will be updated to the pixel value processed by CNNLF.
  • CNNLF is turned on, indicating that the mean square error of the current CTU after CNNLF processing will become smaller than that of the original CTU before CNNLF; but the smaller distortion of the entire CTU does not mean that the value of each pixel in the CTU is smaller. Distortion will be reduced.
  • the existing solutions lack the optimal selection of each pixel value in the CTU processed by CNNLF, which limits the improvement of coding performance.
  • the embodiment of the present application provides a decoding method.
  • the code stream is parsed to determine the value of at least one syntax element identification information; when the at least one syntax element identification information indicates that the current frame or current block is filtered by using a weight matrix
  • determine the weight matrix network model of the current block and determine the weight matrix of the current block according to the weight matrix network model; use the weight matrix to determine the target reconstructed image block of the current block.
  • the weight matrix network model determines the weight matrix, it can not only realize the weight matrix technology based on deep learning, but also provide pixel-level weighting processing for the use of the output reconstructed image block, but also improve the coding performance, which in turn can improve the coding performance.
  • Decoding efficiency in addition, the present application can also make the output of the neural network loop filter closer to the original image, which can improve the video image quality.
  • the video coding system 10 includes a transform and quantization unit 101, an intra-frame estimation unit 102, an intra-frame prediction unit 103, a motion compensation unit 104, a motion estimation unit 105, an inverse transform and inverse quantization unit 106, a filter Control the analysis unit 107, the filtering unit 108, the encoding unit 109, the decoded image buffering unit 110, etc., wherein the filtering unit 108 can implement DBF filtering/SAO filtering/ALF filtering, and the encoding unit 109 can implement header information encoding and context-based adaptation Binary arithmetic coding (Context-based Adaptive Binary Arithmatic Coding, CABAC).
  • CABAC Context-based Adaptive Binary Arithmatic Coding
  • a video coding block can be obtained by dividing the coding tree unit (Coding Tree Unit, CTU), and then the residual pixel information obtained after intra-frame or inter-frame prediction is transformed and quantized by the quantization unit 101.
  • the video coding block is transformed, including transforming residual information from the pixel domain to the transform domain, and quantizing the resulting transform coefficients to further reduce the bit rate;
  • the intra-frame estimation unit 102 and the intra-frame prediction unit 103 are used for Intra prediction is performed on the video coding block; specifically, the intra prediction unit 102 and the intra prediction unit 103 are used to determine the intra prediction mode to be used to encode the video coding block;
  • the motion compensation unit 104 and the motion estimation unit 105 is used to perform inter-predictive encoding of the received video encoding 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 to generate a motion vector.
  • the motion vector can estimate the motion of the video coding block, and then the motion compensation unit 104 performs motion compensation based on the motion vector determined by the motion estimation unit 105; after determining the intra prediction mode, the intra prediction unit 103 also For providing the selected intra prediction data to the encoding unit 109, and the motion estimation unit 105 also sends the calculated motion vector data to the encoding unit 109; in addition, the inverse transform and inverse quantization unit 106 is used for the video Reconstruction of the coding block, reconstructing the residual block in the pixel domain, the reconstructed residual block removing the blocking artifacts by the filter control analysis unit 107 and the filtering unit 108, and then adding the reconstructed residual block to the decoding A predictive block in the frame of the image buffer unit 110 is used to generate a reconstructed video coding block; the coding unit 109 is used for coding various coding parameters and quantized transform coefficients.
  • the video decoding system 20 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, 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 DBF filtering/SAO filtering/ALF filtering.
  • the decoding unit 201 can implement header information decoding and CABAC decoding
  • the filtering unit 205 can implement DBF filtering/SAO filtering/ALF filtering.
  • the code stream of the video signal is output; the code stream is input into the video decoding system 20, and firstly passes through the decoding unit 201 to obtain the decoded transform coefficient; Inverse transform and inverse quantization unit 202 processes to generate residual blocks in the pixel domain; intra prediction unit 203 may be used to generate based on the determined intra prediction mode and data from previously decoded blocks of the current frame or picture Prediction data for the current video decoding block; motion compensation unit 204 determines prediction information for the video decoding block by parsing the motion vector and other associated syntax elements, and uses the prediction information to generate predictive information for the video decoding block being decoded block; a decoded video block is formed by summing the residual block from inverse transform and inverse quantization unit 202 and the corresponding predictive block produced by intra prediction unit 203 or motion compensation unit 204; the decoded video signal Video quality may be improved by filtering unit 205 in order to remove blocking artifacts; decoded video blocks are then stored in decoded image buffer unit 206, which stores reference
  • the methods provided by the embodiments of the present application may be applied to the filtering unit 108 shown in FIG. 3A (represented by a bold black box), and may also be applied to the filtering unit 205 shown in FIG. 3B . (indicated by a bold black box). That is to say, the methods in the embodiments of the present application can be applied to both a video encoding system (referred to as an "encoder"), a video decoding system (referred to as a “decoder” for short), or even simultaneously. Video encoding system and video decoding system, but no limitation is made here.
  • FIG. 4 shows a schematic flowchart of a decoding method provided by an embodiment of the present application. As shown in Figure 4, the method may include:
  • this embodiment of the present application may divide them into two types of color components, such as luminance component and chrominance component.
  • the current block performs operations such as prediction, inverse transformation and inverse quantization, and loop filtering of luminance components
  • the current block can also be called a luminance block
  • Transform and inverse quantization, loop filtering and other operations then the current block can also be called a chroma block.
  • an embodiment of the present application specifically provides a loop filtering method, and the loop filtering method is applied to the part of the filtering unit 205 as shown in FIG. 3B .
  • the filtering unit 205 may include a deblocking filter (LBF), a sample adaptive compensation filter (SAO), a residual neural network-based loop filter (CNNLF), and an adaptive correction filter (ALF),
  • LLF deblocking filter
  • SAO sample adaptive compensation filter
  • CNLF residual neural network-based loop filter
  • ALF adaptive correction filter
  • CNNLF designs different network structures for the luminance component and the chrominance component, respectively, see FIG. 5A and FIG. 5B for details.
  • the entire network structure can be composed of convolutional layers, activation layers, residual blocks, skip connection layers and other parts.
  • the convolution kernel of the convolution layer can be 3 ⁇ 3, that is, it can be represented by 3 ⁇ 3Conv;
  • the activation layer can be a linear activation function, that is, it can be represented by a linear rectification function (Rectified Linear Unit, ReLU), also known as Modified linear unit is an activation function commonly used in artificial neural networks, usually referring to nonlinear functions represented by ramp functions and their variants.
  • ReLU Modified Linear Unit
  • the network structure of the residual block is shown in the dotted box in Figure 6, which can be composed of a convolution layer (Conv), an activation layer (ReLU), and a jump connection layer.
  • the jump connection layer refers to a global jump connection from input to output included in the network structure, which enables the network to focus on learning residuals and accelerates the convergence process of the network.
  • CNNLF can include two stages of offline training and inference testing.
  • 4 I-frame luminance component models, 4 non-I-frame luminance component models, 4 chrominance U component models, and 4 chrominance V component models can be trained offline, a total of 16 models.
  • a preset image dataset such as DIV2K, which has 1000 high-definition images (2K resolution), of which 800 are for training, 100 for validation, and 100 for testing
  • images are converted from RGB
  • YUV4:2:0 format is used as tag data.
  • the sequence was then encoded using HPM in the All Intra configuration, with traditional filters such as DBF, SAO and ALF turned off, and the quantization step size was set from 27 to 50.
  • the reconstructed sequence obtained by encoding it is divided into 4 intervals according to the range of QP 27 ⁇ 31, 32 ⁇ 37, 38 ⁇ 44, 45 ⁇ 50, and is cut into 128 ⁇ 128 image blocks as training data, and 4 kinds of I Frame luminance component model, 4 chrominance U component models, 4 chrominance V component models.
  • a preset video dataset e.g.
  • HPM-ModAI sets frame-level flags and CTU-level flags in the form of switches for the luminance component to control whether to turn on CNNLF, and sets the frame-level flags in the form of switches for the chroma components to control whether to turn on CNNLF.
  • the flag bit can usually be represented by flag.
  • the CTU level flag is set to control whether CNNLF is turned on. Specifically, the CTU-level flag bit is determined by equation (2).
  • the reconstructed pixel value of the current CTU will be updated to the pixel value processed by CNNLF.
  • the CNNLF flag is turned on, which means that the mean square error of the current CTU after CNNLF processing will be smaller than that of the original CTU before CNNLF, but the smaller distortion of the entire CTU does not mean that each pixel in the CTU The distortion of the value will become smaller, so that the improvement of encoding performance is limited.
  • a first syntax element identification information may be set to indicate whether the current video sequence uses the present application.
  • the code stream is parsed, and the value of the first syntax element identification information is determined; wherein, the first syntax element identification information is used to indicate whether the video sequence is filtered by using the weight matrix.
  • the value of the first syntax element identification information is the first value, it is determined that the first syntax element identification information indicates that the video sequence is filtered by using the weight matrix; or,
  • 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 the video sequence is not filtered using the weight matrix.
  • the first value and the second value are different, and the first value and the second value may be in the form of parameters or in the form of numbers.
  • the first syntax element identification information may be a parameter written in a profile (profile), or may be a value of a flag (flag), which is not limited in this embodiment of the present application.
  • the first value can be set to 1, and the second value can be set to 0; alternatively, the first value can also be set is true, the second value can also be set to false; alternatively, the first value can also be set to 0, and the second value can also be set to 1; alternatively, the first value can also be set to false, and the second value can also be set to true.
  • the first value may be 1, and the second value may be 0, but no limitation is imposed.
  • the video sequence includes at least one frame, and the at least one frame may include the current frame.
  • the embodiment of the present application needs to further determine whether the current frame in the video sequence uses the weight matrix For filtering processing, it is also necessary to set a second syntax element identification information.
  • the parsing the code stream and determining the identification information of at least one syntax element may further include:
  • the code stream is parsed, and the value of the second syntax element identification information is determined; wherein, the second syntax element identification information is used to indicate whether the current frame uses the weight matrix for filtering processing.
  • the parsing the code stream and determining the identification information of at least one syntax element may include:
  • the code stream is parsed to determine the value of the second syntax element identification information.
  • the second syntax element identification information is the first luminance syntax element identification information
  • the first luminance syntax element identification information is used to indicate whether the luminance component of the current frame is filtered using the luminance weight matrix processing
  • the color component type of the current frame is a chroma component
  • the second syntax element identification information is the chroma syntax element identification information
  • the chroma syntax element identification information is used to indicate whether the chroma components of the current frame are processed using a chroma weight matrix. filter processing.
  • the color component types may include luminance components and chrominance components. If the color component type is a luminance component, then the second syntax element identification information may be referred to as the first luminance syntax element identification information at this time, to indicate whether the luminance component of the current frame is filtered using the luminance weight matrix. If the color component type is a luma component, then the second syntax element identification information may be referred to as the first luma syntax element identification information at this time, to indicate whether the luma component of the current frame is filtered using the chrominance weight matrix.
  • the current frame uses the weight matrix for filtering processing, it does not mean that every block in the current frame uses the weight matrix for filtering processing, and may also involve CTU-level syntax element identification information to determine whether the current block uses the weight matrix. filter processing.
  • the following will take the two types of color components, the luminance component and the chrominance component, as examples to describe respectively.
  • the weight matrix network model of the current block is determined when the identification information of at least one syntax element indicates that a weight matrix is used for filtering processing, which may be include:
  • the code stream is parsed, and the value of the second luminance syntax element identification information is determined;
  • a luma weight matrix network model of the current block is determined.
  • the frame-level syntax element may be referred to as the first luma syntax element identification information, represented by luma_frame_weighting_matrix_flag; the CTU-level syntax element may be referred to as the second luma syntax element identification information, represented by luma_ctu_weighting_matrix_flag.
  • the current block is within the current frame.
  • the luminance frame level flag can be used to control whether the luminance component of the current frame is filtered by the luminance weight matrix
  • the luminance CTU level flag can be used to control whether the luminance component of the current block is filtered by the luminance weight matrix.
  • the value of the first luma syntax element identification information is the first value, it is determined that the first luma syntax element identification information indicates that the luma component of the current frame is filtered by using the luma weight matrix; or,
  • the value of the first luma syntax element identification information is the second value, it is determined that the first luma syntax element identification information indicates that the luma component of the current frame is not filtered using the luma weight matrix.
  • the method may also include:
  • the value of the first luminance syntax element identification information is the first value, turn on the luminance frame level flag; or,
  • the luminance frame level flag is turned off.
  • first value and the second value are different, and the first value and the second value may be in the form of parameters or in the form of numbers.
  • first luminance syntax element identification information and the first luminance syntax element identification information may be parameters written in the profile (profile), or may be the value of a flag (flag). This embodiment of the present application There is no restriction on this.
  • the first value may be set to 1, and the second value may be set to 0 ;
  • the first value can also be set to true, and the second value can also be set to false; alternatively, the first value can also be set to 0, and the second value can also be set to 1; alternatively, the first value can also be set to false, the second value can also be set to true.
  • This embodiment of the present application does not make any limitation on this.
  • the luminance frame-level flag bit can be turned on, that is, the frame-level weight matrix module can be turned on. At this time It can be determined that the luminance component of the current frame is filtered using the luminance weight matrix. Otherwise, if the value of the first luminance syntax element identification information is 0, the luminance frame-level flag can be turned off, that is, the frame-level weight matrix module can be turned off. At this time, it can be determined that the luminance component of the current frame does not use the luminance weight matrix for filtering processing. , at this time, the next frame can be obtained from the video sequence, the next frame is determined as the current frame, and then the steps of parsing the code stream and determining the value of the identification information of the first luminance syntax element are continued.
  • the method may further include:
  • the value of the second luma syntax element identification information is the first value, it is determined that the second luma syntax element identification information indicates that the luma component of the current block is filtered by using the luma weight matrix; or,
  • the method may also include:
  • the value of the second luminance syntax element identification information is the first value, turn on the luminance CTU level flag; or,
  • the luma CTU level flag is turned off.
  • first value and the second value are different.
  • the first value may be set to 1, and the second value may be set to 0; alternatively, the first value can also be set to true, and the second value can also be set to false; alternatively, the first value can also be set to 0, and the second value can also be set to 1; alternatively, the first value can also be set to is false, the second value can also be set to true.
  • This embodiment of the present application does not make any limitation on this.
  • the luminance CTU level flag bit means turning on the CTU level weight matrix module. At this time, it can be determined that the luminance component of the current block is filtered by the luminance weight matrix. Otherwise, if the value of the second luminance syntax element identification information is 0, the luminance CTU level flag bit can be turned off, that is, the CTU level weight matrix module can be turned off.
  • the next block can be obtained from the current frame, the next block is determined as the current block, and then continue to perform the steps of parsing the code stream and determining the value of the identification information of the second luminance syntax element, until the current frame includes The chunks are all processed and the next frame is loaded to continue processing.
  • the weight matrix network model of the current block is determined when the identification information of the at least one syntax element indicates that a weight matrix is used for filtering processing , which can include:
  • the chroma weight matrix network model of the current block is determined.
  • the frame-level syntax element may be referred to as chroma syntax element identification information, which is represented by chroma_frame_weighting_matrix_flag.
  • the chroma syntax element identification information indicates that the chroma components of the current frame are filtered using the chroma weight matrix, then the blocks included in the current frame all use chroma by default. If the chroma syntax element identification information indicates that the chroma components of the current frame do not use the chroma weight matrix for filtering, then the blocks included in the current frame do not use the chroma weight matrix for filtering by default. Therefore, it is no longer necessary to set the CTU-level syntax element for the chroma components, and similarly, the CTU-level flag bit does not need to be set.
  • the method may further include: setting a chroma frame level flag.
  • the chrominance frame-level flag can be used to control whether the chrominance components of the current frame are filtered using the chrominance weight matrix.
  • the method may further include:
  • the value of the chroma syntax element identification information is the first value, it is determined that the chroma syntax element identification information indicates that the chroma components of the current frame are filtered using the chroma weight matrix; or,
  • the value of the chroma syntax element identification information is the second value, it is determined that the chroma syntax element identification information indicates that the chroma components of the current frame are not filtered using the chroma weight matrix.
  • the method may also include:
  • the chroma frame-level flag is turned on; or,
  • the chroma frame level flag is turned off.
  • the first value and the second value are different, and the first value and the second value may be in the form of parameters or in the form of numbers.
  • the chroma syntax element identification information may be a parameter written in a profile (profile), or may be a value of a flag (flag), which is not limited in this embodiment of the present application.
  • the first value can be set to 1, and the second value can be set to 0 ;
  • the first value can also be set to true, and the second value can also be set to false; alternatively, the first value can also be set to 0, and the second value can also be set to 1; alternatively, the first value can also be set to false, the second value can also be set to true.
  • This embodiment of the present application does not make any limitation on this.
  • the chroma frame-level flag bit can be turned on, that is, the frame-level weight matrix module can be turned on. At this time It can be determined that the chrominance components of the current frame are filtered using the chrominance weight matrix, and by default, the chrominance components of each block in the current frame are filtered using the chrominance weight matrix. Otherwise, if the value of the chroma syntax element identification information is 0, then the chroma frame-level flag bit can be turned off, that is, the frame-level weight matrix module can be turned off.
  • the next frame can be obtained from the video sequence, the next frame is determined as the current frame, and then the steps of parsing the code stream and determining the value of the chroma syntax element identification information are continued.
  • the determining the luminance weight matrix network model of the current block may include:
  • the color component type of the current block is a luminance component, determining at least one candidate luminance weight matrix network model;
  • the selected candidate luminance weight matrix network model is determined as the luminance weight matrix network model of the current block.
  • the determining the chrominance weight matrix network model of the current block may include:
  • the color component type of the current block is a chrominance component, determining at least one candidate chrominance weight matrix network model;
  • the selected candidate chroma weight matrix network model is determined as the chroma weight matrix network model of the current block.
  • the weight matrix network model of the current block is not only related to the quantization parameter, but also related to the color component type.
  • different color component types correspond to different weight matrix network models.
  • the weight matrix network model may be a luminance weight matrix network model related to the luminance component;
  • the chrominance component the weight matrix
  • the network model may be a chroma weight matrix network model associated with the chroma components.
  • At least one candidate brightness weight matrix network model and at least one candidate brightness weight matrix network model can be trained in advance.
  • Candidate chroma weight matrix network model After the quantization parameter of the current block is determined, the candidate luminance weight matrix network model corresponding to the quantization parameter can be selected from at least one candidate luminance weight matrix network model, that is, the luminance weight matrix network model of the current block; The candidate chrominance weight matrix network model corresponding to the quantization parameter is selected from the at least one candidate chrominance weight matrix network model, that is, the chrominance weight matrix network model of the current block.
  • the method may further include:
  • the training sample is obtained according to at least one quantization parameter
  • At least one candidate luminance weight matrix network model has a correspondence relationship with luminance components and quantization parameters
  • at least one candidate chrominance weight matrix network model has a correspondence relationship with chrominance components and quantization parameters.
  • the preset neural network model may include at least one of the following: at least one convolution layer, at least one activation layer, and a jump connection layer.
  • the preset neural network model can select a multi-layer convolutional neural network, and then use the training samples to perform deep learning to obtain a weight matrix network model, such as a luminance weight matrix network model or a chrominance weight matrix network model.
  • Deep learning is a type of machine learning, and machine learning is the only way to realize artificial intelligence.
  • the concept of deep learning originates from the study of artificial neural networks, and a multilayer perceptron with multiple hidden layers is a deep learning structure.
  • Deep learning can form more abstract high-level representation attribute categories or features by combining low-level features to discover distributed feature representations of data.
  • CNN Convolutional Neural Networks
  • Feedforward Neural Networks Feedforward Neural Networks
  • Learning is one of the representative algorithms.
  • the preset neural network model here can be a convolutional neural network structure.
  • the weight matrix network model can also be regarded as being composed of a multi-layer convolutional neural network.
  • the weight matrix network model may also include at least one of the following: at least one convolution layer, at least one activation layer, and a jump connection layer.
  • the weight matrix can be determined accordingly.
  • the determining the weight matrix of the current block according to the weight matrix network model may include:
  • the neural network loop filter specifically refers to the aforementioned CNNLF. After determining the input reconstructed image block and output reconstructed image block of CNNLF, the output reconstructed image block is used as the input of the weight matrix network model, and the output of the weight matrix network model is the weight matrix of the current block.
  • using the weight matrix to determine the target reconstructed image block of the current block may include: using the weight matrix to perform weighting processing on the input reconstructed image block and the output reconstructed image block to obtain the target reconstructed image block.
  • the output of the neural network loop filter can be made closer to the original image.
  • the weight matrix includes a luminance weight matrix and a chrominance weight matrix; in this way, for the target reconstructed image block, the target reconstructed image block of the luminance component and the chrominance component can also be included.
  • the target reconstructed image patch may include:
  • the luminance weight matrix is determined by using the luminance weight matrix network model
  • the chrominance weight matrix is determined by using the chrominance weight matrix network model.
  • the determining the luminance weight matrix by using the luminance weight matrix network model may include:
  • using the weight matrix to determine the target reconstructed image block of the current block may include:
  • the input luminance reconstructed image block and the output luminance reconstructed image block are weighted by the luminance weight matrix to obtain the target reconstructed image block of the luminance component of the current block.
  • the determining the chrominance weight matrix by using the chrominance weight matrix network model may include:
  • using the weight matrix to determine the target reconstructed image block of the current block may include:
  • the input chrominance reconstructed image block and the output chrominance reconstructed image block are weighted by using the chrominance weight matrix to obtain the target reconstructed image block of the chrominance component of the current block.
  • the input reconstructed image block depending on the type of color components, it may refer to the input luminance reconstructed image block, or it may refer to the input chrominance reconstructed image block; for the output reconstructed image block, according to the different color component types , which can refer to the output luminance reconstructed image block or the output chrominance reconstructed image block.
  • the target reconstructed image block of the luminance component can be obtained by weighted calculation according to the input luminance reconstructed image block and the output luminance reconstructed image block; image block.
  • the input reconstructed image blocks may be obtained through a deblocking filter and a sample adaptive compensation filter. obtained after filtering.
  • the method may further include: after the target reconstructed image block of the current block is determined, using an adaptive correction filter to continue filtering the target reconstructed image block.
  • the input of the adaptive correction filter is the target reconstructed image block; if the current block does not use the weight matrix for filtering, then there is no need to filter the neural network loop at this time.
  • the output of the filter is weighted, that is, the input of the adaptive correction filter is the output reconstructed image block.
  • FIG. 8 shows a schematic diagram of the composition and structure of a weight matrix network model provided by an embodiment of the present application.
  • the weight matrix network model is set in the weight matrix module.
  • the weight matrix network model can be composed of multi-layer convolutional neural networks, and its network structure can be composed of K layers of convolution layers, J layers of activation layers and L layers of jumping layers It consists of a transfer connection layer; wherein, K, J, and L are all integers greater than or equal to 1.
  • the network structure shown in Figure 8 includes five convolutional layers. Except for the third convolutional layer, each convolutional layer is followed by an activation layer.
  • the network structure also includes the second convolutional layer.
  • a skip connection layer that feeds into the output of the third convolutional layer.
  • the activation layer can be a linear activation function or a nonlinear activation function, etc.
  • the input of the network structure is the output reconstructed image block of CNNLF (which can be the output luminance reconstructed image block or the output chrominance reconstructed image block), and the output of the network structure is a weight matrix, which is used to reconstruct the output image block of CNNLF and
  • the input reconstructed image blocks of CNNLF are weighted, as shown in Figure 9, which shows an example of the overall framework of a weight matrix network model.
  • the input reconstructed image block can be obtained after filtering through a deblocking filter (DBF) and a sample adaptive compensation filter (SAO), and the weighted target reconstructed image block is also
  • DPF deblocking filter
  • SAO sample adaptive compensation filter
  • ALF adaptive correction filter
  • the input reconstructed image block in the weighting process can also be extracted from multiple hidden layer feature image blocks of CNNLF and used in the weighting process; in addition, the output reconstructed image block of CNNLF can also be
  • the output image blocks of other efficient neural network filters are not limited in this embodiment of the present application.
  • the decoder obtains and parses the code stream, and when it is parsed into the loop filter module, it is processed according to the preset filter order.
  • the preset filter sequence is DBF filtering---->SAO filtering---->CNNLF filtering---->weight matrix module---->ALF filtering.
  • chroma component determines whether the current frame is processed by the weighting matrix module according to the decoded chroma_frame_weighting_matrix_flag. If chroma_frame_weighting_matrix_flag is "0", skip to (c); otherwise, when chroma_frame_weighting_matrix_flag is "1", use the weight matrix module for the current frame at this time;
  • the output reconstructed image patch of CNNLF is used as the input of the weight matrix network model, and the output of the network model obtains the weight matrix.
  • the output reconstructed image block of CNNLF and the input reconstructed image block of CNNLF are weighted according to the weight matrix to obtain the final output reconstructed image block (ie, the target reconstructed image block described in the foregoing embodiment).
  • the frame-level flag of the luminance component of the neural network-based weighting matrix is luma_frame_weighting_matrix_flag;
  • the CTU-level flag of the luminance component of the neural network-based weighting matrix is luma_ctu_weighting_matrix_flag;
  • the frame-level flag of the chrominance component of the neural network-based weighting matrix is chroma_frame_weighting_matrix_flag.
  • the CNNLF by inputting the reconstructed image blocks of the CNNLF output of HPM-ModAI into the weight matrix network model (multi-layer convolutional neural network), the feature information is extracted and the weight matrix is output, so that the CNNLF can be
  • the weight matrix network model multi-layer convolutional neural network
  • the test sequence required by AVS3 is tested under the intelligent coding general test condition All Intra configuration, and The average changes of BD-rate on the three components of Y, U, and V are -0.36%, -1.26%, and -0.38%, respectively, as shown in Table 3; the test for AVS3 requirements under the general test condition Random Access configuration of intelligent coding The sequence is tested, and the average changes of BD-rate on the three components of Y, U, and V are -0.16%, -1.04%, and -0.79%, respectively, as shown in Table 4.
  • Tables 3 and 4 can illustrate that the method of the embodiment of the present application improves the coding performance.
  • the embodiment of the present application can provide the existing AVS3 intelligent coding reference software HPM- ModAI brings a nice performance gain.
  • This embodiment provides a decoding method, and specifically provides a loop filtering method, which is applied to a decoder.
  • the network model determines the weight matrix of the current block; using the weight matrix, the target reconstructed image block of the current block is determined.
  • the present application can also make the output of the neural network loop filter closer to the original image, which can improve the video image quality.
  • FIG. 10 shows a schematic flowchart of an encoding method provided by an embodiment of the present application. As shown in Figure 10, the method may include:
  • S1001 Determine the weight matrix network model of the current block, and determine the weight matrix of the current block according to the weight matrix network model.
  • each image block to be encoded currently may be called an encoding block.
  • each coding block may include a first image component, a second image component, and a third image component; and the current block is the first image component, the second image component or the third image component loop filtering in the video image currently to be performed The processed encoding block.
  • this embodiment of the present application may divide them into two types of color components, such as luminance component and chrominance component.
  • the current block if the current block performs operations such as prediction, transformation and quantization of luma components, and loop filtering, the current block can also be called a luma block; or, if the current block performs prediction, transformation and quantization of chroma components , loop filtering, etc., then the current block can also be called a chroma block.
  • an embodiment of the present application specifically provides a loop filtering method, and the loop filtering method is applied to the filtering unit 108 as shown in FIG. 3A .
  • the filtering unit 108 may also include a deblocking filter (LBF), a sample adaptive compensation filter (SAO), a residual neural network-based loop filter (CNNLF), and an adaptive correction filter (ALF) , and the loop filtering method described in the embodiment of the present application is specifically applied between CNNLF and ALF, so that each pixel value in the current block after being filtered by CNNLF can be optimally selected.
  • LPF deblocking filter
  • SAO sample adaptive compensation filter
  • CNLF residual neural network-based loop filter
  • ALF adaptive correction filter
  • the loop filtering method mainly introduces a weight matrix network model
  • the weight matrix network model may be a multi-layer convolutional neural network.
  • the weight matrix network model here is also different.
  • the determining the weight matrix network model of the current block may include:
  • the color component type of the current block is a luminance component, determine the luminance weight matrix network model of the current block;
  • the chrominance weight matrix network model of the current block is determined.
  • the weight matrix network model is related to the color component type.
  • the weight matrix network model corresponding to the luminance component may be referred to as a luminance weight matrix network model
  • the weight matrix network model corresponding to the chrominance component may be referred to as a chrominance weight matrix network model.
  • the following will take the two types of color components, the luminance component and the chrominance component, as examples to describe respectively.
  • the determining the luminance weight matrix network model of the current block may include:
  • the color component type of the current block is a luminance component, determining at least one candidate luminance weight matrix network model;
  • the selected candidate luminance weight matrix network model is determined as the luminance weight matrix network model of the current block.
  • the determining the chrominance weight matrix network model of the current block may include:
  • the color component type of the current block is a chrominance component, determining at least one candidate chrominance weight matrix network model;
  • the selected candidate chroma weight matrix network model is determined as the chroma weight matrix network model of the current block.
  • the weight matrix network model of the current block has an associated relationship with the quantization parameter and the color component type.
  • different color component types correspond to different weight matrix network models.
  • the weight matrix network model may be a luminance weight matrix network model related to the luminance component;
  • the weight matrix The network model may be a chroma weight matrix network model associated with the chroma components.
  • At least one candidate luminance weight matrix network model and at least one candidate chroma can be trained in advance. Weight matrix network model.
  • the candidate luminance weight matrix network model corresponding to the quantization parameter can be selected from at least one candidate luminance weight matrix network model, that is, the luminance weight matrix network model of the current block;
  • the candidate chrominance weight matrix network model corresponding to the quantization parameter is selected from the at least one candidate chrominance weight matrix network model, that is, the chrominance weight matrix network model of the current block.
  • the method may further include:
  • the training sample is obtained according to at least one quantization parameter
  • the at least one candidate luminance weight matrix network model has a corresponding relationship with the luminance component and the quantization parameter
  • the at least one candidate chrominance weight matrix network model has a corresponding relationship with the chrominance component and the quantization parameter
  • the preset neural network model may include at least one of the following: at least one convolution layer, at least one activation layer, and a jump connection layer.
  • the preset neural network model can select a multi-layer convolutional neural network, and then use the training samples to perform deep learning to obtain a weight matrix network model, such as a luminance weight matrix network model or a chrominance weight matrix network model.
  • a weight matrix network model such as a luminance weight matrix network model or a chrominance weight matrix network model.
  • the weight matrix network model can also be regarded as composed of multi-layer convolutional neural networks.
  • the weight matrix network model may also include at least one of the following: at least one convolution layer, at least one activation layer, and a jump connection layer.
  • the weight matrix can be determined accordingly.
  • the determining the weight matrix of the current block according to the weight matrix network model may include:
  • the neural network loop filter specifically refers to the aforementioned CNNLF. After determining the input reconstructed image block and output reconstructed image block of CNNLF, the output reconstructed image block is used as the input of the weight matrix network model, and the output of the weight matrix network model is the weight matrix of the current block.
  • the weight matrix includes a luminance weight matrix and a chrominance weight matrix.
  • the determining the weight matrix of the current block according to the weight matrix network model may include:
  • the luminance weight matrix is determined by using the luminance weight matrix network model
  • the chrominance weight matrix is determined by using the chrominance weight matrix network model.
  • the determining the luminance weight matrix by using the luminance weight matrix network model may include:
  • the determining the chrominance weight matrix by using the chrominance weight matrix network model may include:
  • the input reconstructed image block depending on the type of color components, it may refer to the input luminance reconstructed image block, or it may refer to the input chrominance reconstructed image block; for the output reconstructed image block, according to the different color component types , which can refer to the output luminance reconstructed image block or the output chrominance reconstructed image block.
  • the luminance weight matrix can be obtained according to the luminance weight matrix network model and the output luminance reconstructed image block
  • the chrominance weight matrix can be obtained according to the chrominance weight matrix network model and the output chrominance reconstructed image block.
  • S1002 Determine the value of at least one syntax element identification information.
  • step S1001 there is no order between step S1001 and step S1002, and step S1001 may be executed first, and then step S1002 may be executed; or step S1002 may be executed first, and then step S1001 may be executed; even the two may be executed in parallel,
  • step S1001 may be executed first, and then step S1002 may be executed; or step S1002 may be executed first, and then step S1001 may be executed; even the two may be executed in parallel.
  • whether to use the weight matrix for filtering processing may be indicated by at least one syntax element identification information.
  • the encoder after determining the value of the at least one syntax element identification information, the value of the at least one syntax element identification information is written into the code stream for transmission to the decoder, so that the decoder can parse the code stream by parsing the value of the code stream. It can be known whether to use the weight matrix for filtering processing.
  • the determining the value of at least one syntax element identification information may include:
  • the value of the first syntax element identification information is the first value
  • the value of the first syntax element identification information is the second value.
  • the method further includes: encoding the value of the identification information of the first syntax element, and writing the encoded bits into the code stream.
  • first syntax element identification information may be set to indicate whether the current video sequence uses the loop filtering method in this embodiment of the present application (ie, whether the weight matrix module is enabled).
  • the weight matrix module of the video sequence is enabled, that is, it is determined that the video sequence is filtered using the weight matrix, then the value of the first syntax element identification information can be the first value at this time; if the weight of the video sequence is If the matrix module is disabled, that is, it is determined that the video sequence does not use the weight matrix for filtering processing, then at this time, the value of the identification information of the first syntax element may be the second value.
  • first value and the second value are different.
  • the first value can be set to 1, and the second value can be set to 0; alternatively, the first value can also be set is true, the second value can also be set to false; alternatively, the first value can also be set to 0, and the second value can also be set to 1; alternatively, the first value can also be set to false, and the second value can also be set to true.
  • the first value may be 1, and the second value may be 0, but no limitation is imposed.
  • the video sequence includes at least one frame, and the at least one frame may include the current frame.
  • the embodiment of the present application needs to further determine whether the current frame in the video sequence uses the weight matrix
  • it is also necessary to set a second syntax element identification information For filtering processing, it is also necessary to set a second syntax element identification information.
  • the meanings represented by the second syntax element identification information are different according to different types of color components.
  • the color component types may include luminance components and chrominance components. If the color component type is a luminance component, it is assumed that the second syntax element identification information is the first luminance syntax element identification information at this time to indicate whether the luminance component of the current frame is filtered using the luminance weight matrix; if the color component type is a chrominance component , at this time, it is assumed that the second syntax element identification information is the chroma syntax element identification information, so as to indicate whether the chroma components of the current frame are filtered using the chroma weight matrix.
  • the weight matrix is determined to be the luminance weight matrix.
  • the determining the value of the identification information of at least one syntax element may further include:
  • first rate-distortion cost value is less than the second rate-distortion cost value, determine that the value of the first luma syntax element identification information is the first value; or,
  • the value of the first luma syntax element identification information is determined to be the second value.
  • the method further includes: encoding the value of the identification information of the first luma syntax element, and writing the encoded bits into the code stream.
  • the determining the value of the at least one syntax element identification information may further include:
  • the third rate-distortion cost value is less than the fourth rate-distortion cost value, determine that the value of the identification information of the second luma syntax element is the first value; or,
  • the value of the second luma syntax element identification information is determined to be a second value.
  • the method further includes: encoding the value of the identification information of the second luma syntax element, and writing the encoded bits into the code stream.
  • the frame-level syntax element may be referred to as the first luma syntax element identification information
  • the CTU-level syntax element may be referred to as the second luma syntax element identification information.
  • the first luma syntax element identification information and the second luma syntax element identification information are flag information
  • the first luma syntax element identification information can be represented by luma_frame_weighting_matrix_flag
  • the second luma syntax element identification information can be represented by luma_ctu_weighting_matrix_flag.
  • both the value of the identification information of the first luma syntax element and the value of the identification information of the second luma syntax element can be determined by utilizing the distortion cost.
  • the method may further include: performing block division on the current frame, and determining at least one divided block; wherein, the at least one divided block includes the current block;
  • determining the first rate-distortion cost value for filtering the luminance component of the current frame in the video sequence using the luminance weight matrix may include:
  • the calculating the second rate-distortion cost value of the luminance component of the current frame in the video sequence without using the luminance weight matrix for filtering processing may include:
  • the third rate-distortion cost value for filtering the luminance component of each block using the luminance weight matrix can be calculated, and then the first rate-distortion cost value of the current frame can be obtained by cumulative calculation.
  • the distortion value may be determined according to the mean square error.
  • the target reconstructed image block of the luminance component of each block can be obtained; then the average of the target reconstructed image block and the original image block is calculated.
  • the fourth rate-distortion cost value of the luminance component of each block that is not filtered using the luminance weight matrix can also be calculated, and then the second rate-distortion cost value of the current frame can be obtained by cumulative calculation.
  • the distortion value can also be determined according to the mean square error; the mean square error at this time refers to the mean square error value between the output reconstructed image block and the original image block without going through the weight matrix module , and other calculation operations are the same as calculating the first rate-distortion cost value, and will not be described in detail here.
  • the first rate-distortion cost value and the second rate-distortion cost value can be calculated by Compare; if the first rate-distortion cost value is greater than or equal to the second rate-distortion cost value, then it can be determined that the value of the first luminance syntax element identification information is 0, which means that the luminance component of the current frame does not need to use the luminance weight matrix
  • the next frame can be acquired from the video sequence, the next frame is determined as the current frame, and the calculation of the first rate-distortion cost value and the second rate-distortion cost value is continued.
  • the first rate-distortion cost value is less than the second rate-distortion cost value, then it can be determined that the value of the first luminance syntax element identification information is 1, which means that the luminance component of the current frame needs to be filtered using the luminance weight matrix, At this time, it is necessary to continue to judge whether the luminance component of the current block in the current frame is filtered using the luminance weight matrix; that is, compare the third rate distortion cost value with the fourth rate distortion cost value; if the third rate distortion cost value is less than the fourth rate distortion cost value Distortion cost value, then it can be determined that the value of the identification information of the second luma syntax element is 1, which means that the luma component of the current block needs to be filtered using the luma weight matrix; otherwise, if the third rate distortion cost value is greater than or equal to The fourth rate-distortion cost value, then it can be determined that the value of the identification information of the second luma syntax element is 0, which means that the luma component of the current block does not
  • the embodiments of the present application can also set the luminance frame level flag bit and the luminance CTU level flag bit, and determine whether to use the luminance weight matrix for filtering by controlling whether to open the weight matrix module.
  • the method may further include: setting a luminance frame level flag, where the luminance frame level flag is used to control whether the luminance component of the current frame is filtered using the luminance weight matrix;
  • the method may also include:
  • first rate-distortion cost value is less than the second rate-distortion cost value, turn on the luminance frame level flag; or,
  • the luminance frame level flag is turned off.
  • the method may further include: setting a luminance CTU level flag bit, where the luminance CTU level flag bit is used to control whether the luminance component of the current block is filtered using the luminance weight matrix;
  • the method may also include:
  • the luminance CTU level flag is turned off.
  • whether it is the luminance frame level flag or the luminance CTU level flag, whether to enable or not can also be determined according to the rate-distortion cost method.
  • it can be determined according to the magnitude of the calculated rate-distortion cost value.
  • D represents the distortion value reduced after the current frame is processed by the weight matrix module
  • D D out - D rec (D out is the distortion after the weight matrix module processing, D rec is the distortion before the weight matrix module processing)
  • R is the The number of blocks included in the current frame
  • is consistent with the ⁇ of the adaptive correction filter.
  • the weight matrix is determined to be a chrominance weight matrix.
  • the determining the value of the identification information of at least one syntax element may further include:
  • the fifth rate-distortion cost value is less than the sixth rate-distortion cost value, determine that the value of the chroma syntax element identification information is the first value; or,
  • the value of the chroma syntax element identification information is determined to be the second value.
  • the method may further include: encoding the value of the identification information of the chroma syntax element, and writing the encoded bits into the code stream.
  • the frame-level syntax element may be referred to as chroma syntax element identification information. Assuming that the chroma syntax element identification information is flag information, it may be represented by chroma_frame_weighting_matrix_flag.
  • 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 is false; alternatively, the first value can also be set to 0, and the second value can also be set to 1; alternatively, the first value can also be set to false, and the second value can also be set to true.
  • the first value may be 1, and the second value may be 0, but it is not limited in any way.
  • the chroma syntax element identification information indicates that the chroma components of the current frame are filtered using the chroma weight matrix, then the blocks included in the current frame all use the chroma weight matrix by default. Perform filtering; if the chroma syntax element identification information indicates that the chroma components of the current frame do not use the chroma weight matrix for filtering, then the blocks included in the current frame do not use the chroma weight matrix for filtering by default. Therefore, it is no longer necessary to set the CTU-level syntax element for the chroma components, and similarly, the CTU-level flag bit does not need to be set.
  • the method may further include: setting a chroma frame-level flag bit, where the chroma frame-level flag bit is used to control whether the chroma components of the current frame are filtered using a chroma weight matrix;
  • the method may also include:
  • the chroma frame-level flag is turned off.
  • the distortion value can also be determined according to the mean square error, and other calculation operations are the same as calculating the first rate-distortion cost value and The second rate-distortion cost value is the same, and will not be described in detail here.
  • whether the chroma frame-level flag is turned on is the same as the implementation of determining whether the luminance frame-level flag is turned on, and will not be described in detail here.
  • the fifth rate-distortion cost value and the sixth rate-distortion cost value can be calculated by Compare; if the fifth rate-distortion cost value is less than the sixth rate-distortion cost value, then the chroma frame-level flag bit can be turned on, and it can also be determined that the value of the chroma syntax element identification information is 1, which means that the color of the current frame is The chrominance component needs to be filtered using the chrominance weight matrix; after the current frame is processed, continue to load the next frame for processing.
  • the chroma frame-level flag bit can be turned off, and it can also be determined that the value of the chroma syntax element identification information is 0, which means that the current frame
  • the chrominance component does not need to use the chrominance weight matrix for filtering processing.
  • the next frame can be obtained from the video sequence, the next frame can be determined as the current frame, and the next frame can be loaded for processing to determine the next frame.
  • the value of the syntax element identification information is the value of the syntax element identification information.
  • the color component types may include luminance components and chrominance components. If the current frame uses the weight matrix for filtering, it does not mean that every block in the current frame uses the weight matrix for filtering, and may also involve CTU-level syntax element identification information to further determine whether the current block uses the weight matrix for filtering. deal with. The following will take the two types of color components, the luminance component and the chrominance component, as examples to describe respectively.
  • using the weight matrix to determine the target reconstructed image block of the current block may include:
  • the third rate-distortion cost value is less than the fourth rate-distortion cost value, use the luminance weight matrix to determine the target reconstructed image block of the current block.
  • using the weight matrix to determine the target reconstructed image block of the current block may include: :
  • the chrominance weight matrix is used to determine the target reconstructed image block of the current block.
  • the luminance weight matrix can be used to determine The target reconstructed image block of the current block (specifically refers to the target reconstructed image block of the luminance component of the current block).
  • chroma components only one syntax element may be required: a frame-level syntax element.
  • the frame-level syntax element ie, the chroma syntax element identification information
  • the weight matrix is used for filtering processing, and the weight matrix may also be used to determine the target reconstructed image block of the current block (specifically, the target reconstructed image block of the chrominance component of the current block).
  • the determining the target reconstructed image block of the current block by using the weight matrix may include:
  • the input reconstructed image block and the output reconstructed image block are weighted by the weight matrix to obtain the target reconstructed image block.
  • the input and output of CNNLF are weighted by the weight matrix, which can make the output of the neural network loop filter closer to the original image.
  • the weight matrix includes a luminance weight matrix and a chrominance weight matrix; in this way, for the target reconstructed image block, the target reconstructed image block of the luminance component and the chrominance component can also be included.
  • the target reconstructed image patch may include:
  • using the weight matrix to determine the target reconstructed image block of the current block may include:
  • the input luminance reconstructed image block and the output luminance reconstructed image block are weighted by using the luminance weight matrix to obtain the target reconstructed image block of the luminance component of the current block.
  • the determining the chrominance weight matrix using the chrominance weight matrix network model may include:
  • using the weight matrix to determine the target reconstructed image block of the current block may include:
  • the input chrominance reconstructed image block and the output chrominance reconstructed image block are weighted by using the chrominance weight matrix to obtain the target reconstructed image block of the chrominance component of the current block.
  • the input reconstructed image block depending on the type of color components, it may refer to the input luminance reconstructed image block, or it may refer to the input chrominance reconstructed image block; for the output reconstructed image block, according to the different color component types , which can refer to the output luminance reconstructed image block or the output chrominance reconstructed image block.
  • the target reconstructed image block of the luminance component can be obtained by weighted calculation according to the input luminance reconstructed image block and the output luminance reconstructed image block; image block.
  • the input reconstructed image blocks may be obtained through a deblocking filter and a sample adaptive compensation filter. obtained after filtering.
  • the method may further include: after the target reconstructed image block of the current block is determined, using an adaptive correction filter to continue filtering the target reconstructed image block.
  • the input of the adaptive correction filter is the target reconstructed image block; if the current block does not use the weight matrix for filtering, then the output of CNNLF does not need to be weighted at this time. , that is, the input of the adaptive correction filter is the output reconstructed image block.
  • the embodiment of the present application proposes a weight matrix based on deep learning, which is used to weight the output of the neural network loop filter, so that the output of the neural network loop filter is closer to the original image.
  • the network structure corresponding to the weight matrix network model can be selected from a multi-layer convolutional neural network, the input is the output reconstructed image block of the neural network loop filter, and the output is a new reconstructed image block after weighting processing (that is, the foregoing embodiment). the "target reconstructed image patch").
  • the position of the weight matrix module in the encoder/decoder is shown in Figure 7.
  • the Weighting Matrix is the weight matrix module in the figure. The use of the weight matrix module does not depend on the flag bits of DBF, SAO, ALF, and CNNLF, but only in the position It is placed after CNNLF and before ALF.
  • the encoder determines whether the weight matrix based on deep learning is selected.
  • the input reconstructed image block of CNNLF can be marked as I rec
  • the output reconstructed image block of CNNLF can be marked as I rec . It is marked as I net , and I net is used as the input of the weight matrix network model, the output can obtain the weight matrix W, and the final output I out can be obtained by formula (3), as shown below,
  • Iout W* Inet +(1-W)* Irec (3)
  • a frame-level flag bit and a CTU-level flag bit are set for the luminance component to control whether to turn on, and a frame-level flag bit is set for the chrominance component to control whether to turn on.
  • D out is the distortion processed by the weight matrix module
  • D rec is the weight matrix Distortion before module processing
  • R is the number of CTUs in the current frame
  • is consistent with the ⁇ of the adaptive correction filter.
  • the frame-level flag When the frame-level flag is turned on, it can be further decided whether to turn on the weight matrix module for each CTU through the rate-distortion cost method. Specifically, the CTU-level flag bit can be determined by equation (5).
  • the flag bit status of the weight matrix module will be encoded into the code stream for the decoder to read.
  • the input and output of CNNLF will be weighted according to formula (3).
  • the encoder When the encoder enters the loop filter module, it is processed according to the preset filter order.
  • the preset filter sequence is DBF filtering---->SAO filtering---->CNNLF filtering---->weight matrix module---->ALF filtering.
  • the mean square error value between the output reconstructed image block and the original image block is first calculated, and the mean square error value of the current frame is obtained by cumulative calculation. Then, the decision is made through the rate-distortion cost method. If it is determined that the rate-distortion cost value after using the weight matrix module is smaller than the unused weight matrix module, set chroma_frame_weighting_matrix_flag to "1", otherwise set it to "0";
  • the CNNLF by inputting the reconstructed image block of the CNNLF output of HPM-ModAI into the weight matrix network model (multi-layer convolutional neural network), the feature information is extracted and the weight matrix is output, so that the CNNLF can be
  • the weight matrix network model multi-layer convolutional neural network
  • the embodiment of the present application provides a code stream, where the code stream is generated by bit encoding according to the value of at least one syntax element identification information.
  • the at least one syntax element identification information may at least include: first syntax element identification information, first luma syntax element identification information, second luma syntax element identification information, and chroma syntax element identification information.
  • the first syntax element identification information is used to indicate whether the video sequence is filtered using the weight matrix
  • the first luminance syntax element identification information is used to indicate whether the luminance component of the current frame is filtered using the weight matrix
  • the second luminance syntax element identification The information is used to indicate whether the luminance component of the current block is filtered using the weight matrix
  • the chroma syntax element identification information is used to indicate whether the chroma component of the current frame is filtered using the weight matrix
  • the first luma syntax element identification information and the chroma syntax element identification information may be frame-level marks
  • the second luma syntax element identification information may be CTU-level marks.
  • the frame-level flag of the luma component based on the weight matrix of the neural network (that is, the first luma syntax element identification information) is luma_frame_weighting_matrix_flag
  • the CTU-level flag of the luma component based on the weight matrix of the neural network that is, the identification information of the second luma syntax element
  • the chroma component frame-level flag (ie, chroma syntax element identification information) of the neural network-based weighting matrix is chroma_frame_weighting_matrix_flag.
  • This embodiment provides an encoding method, and specifically provides a loop filtering method, which is applied to an encoder.
  • determining the weight matrix network model of the current block and determining the weight matrix of the current block according to the weight matrix network model; determining the value of at least one syntax element identification information; when the at least one syntax element identification information indicates the current frame or the current block, the weight matrix is used During the filtering process, the weight matrix is used to determine the target reconstructed image block of the current block.
  • the weight matrix network model to determine the weight matrix, it can not only realize the weight matrix technology based on deep learning, but also provide pixel-level weighting processing for the use of the output reconstructed image block, but also improve the coding performance, which in turn can improve the coding performance.
  • Decoding efficiency in addition, the present application can also make the output of the neural network loop filter closer to the original image, which can improve the video image quality.
  • FIG. 11 shows a schematic structural diagram of an encoder 110 provided by an embodiment of the present application.
  • the encoder 110 may include: a first determining unit 1101 and a first filtering unit 1102; wherein,
  • the first determining unit 1101 is configured to determine a weight matrix network model of the current block, and determine the weight matrix of the current block according to the weight matrix network model; and is also configured to determine the value of at least one syntax element identification information;
  • the first filtering unit 1102 is configured to use the weight matrix to determine the target reconstructed image block of the current block when the at least one syntax element identification information indicates that the current frame or the current block uses the weight matrix for filtering processing.
  • the first determining unit 1101 is further configured to determine the luminance weight matrix network model of the current block when the color component type of the current block is a luminance component; when the color component type of the current block is a chrominance component, Determines the chroma weight matrix network model for the current block.
  • the first determining unit 1101 is further configured to, when the color component type of the current block is a luminance component, determine at least one candidate luminance weight matrix network model; and determine the quantization parameter of the current block, from at least one The candidate brightness weight matrix network model corresponding to the quantization parameter is selected from the candidate brightness weight matrix network model; and the selected candidate brightness weight matrix network model is determined as the brightness weight matrix network model of the current block.
  • the first determination unit 1101 is further configured to determine at least one candidate chrominance weight matrix network model when the color component type of the current block is a chrominance component; and determine the quantization parameter of the current block, from at least one candidate chrominance weight In the matrix network model, a candidate chrominance weight matrix network model corresponding to the quantization parameter is selected; and the selected candidate chrominance weight matrix network model is determined as the chrominance weight matrix network model of the current block.
  • the encoder 110 may further include a first training unit 1103;
  • the first determining unit 1101 is further configured to determine at least one training sample, wherein the training sample is obtained according to at least one quantization parameter;
  • the first training unit 1103 is configured to use the luminance component of at least one training sample to train the preset neural network model to obtain at least one candidate luminance weight matrix network model; and use the chrominance component of at least one training sample to train the preset neural network model.
  • the model is trained to obtain at least one candidate chrominance weight matrix network model; wherein, at least one candidate brightness weight matrix network model has a corresponding relationship with the brightness component and the quantization parameter, and at least one candidate chrominance weight matrix network model and the chrominance component. and quantization parameters have a corresponding relationship.
  • the preset neural network model includes at least one of the following: at least one convolutional layer, at least one activation layer, and a skip connection layer.
  • the first determining unit 1101 is further configured to determine the value of the first syntax element identification information as the first value if it is determined that the video sequence is filtered using the weight matrix; or, if it is determined that the video sequence does not use The weight matrix is filtered, and the value of the identification information of the first syntax element is determined to be the second value.
  • the encoder 110 may further include an encoding unit 1104, configured to encode the value of the identification information of the first syntax element, and write the encoded bits into the code stream.
  • the first determining unit 1101 is further configured to, when the color component type of the current frame is a luminance component, determine that the weight matrix is a luminance weight matrix; and determine the video A first rate-distortion cost value for the luminance component of the current frame in the sequence to be filtered using the luminance weighting matrix; and a second rate-distortion cost for determining the luminance component of the current frame in the video sequence that is not filtered using the luminance weighting matrix; and if If the first rate-distortion cost value is less than the second rate-distortion cost value, it is determined that the value of the first luminance syntax element identification information is the first value; or, if the first rate-distortion cost value is greater than or equal to the second rate-distortion cost value, Then, it is determined that the value of the identification information of the first luma syntax element is the second value.
  • the encoding unit 1104 is further configured to encode the value of the identification information of the first luma syntax element, and write the encoded bits into the code stream.
  • the encoder 110 may further include a first setting unit 1105 configured to set a luminance frame-level flag, where the luminance frame-level flag is used to control whether the luminance component of the current frame is filtered using a weight matrix deal with;
  • the first determining unit 1101 is further configured to turn on the luminance frame level flag if the first rate-distortion cost value is less than the second rate-distortion cost value; or, if the first rate-distortion cost value is greater than or equal to the second rate-distortion cost value. Distortion cost value, turn off the luminance frame level flag.
  • the first determining unit 1101 is further configured to perform block division on the current frame, and determine at least one divided block; wherein the at least one divided block includes the current block; and separately calculate the luminance component of the at least one divided block using luminance
  • the third rate-distortion cost value of the filtering processing is performed on the weight matrix, and the calculated third rate-distortion cost value is accumulated to obtain the first rate-distortion cost value;
  • the matrix performs filtering processing on the fourth rate-distortion cost value, and accumulates the calculated fourth rate-distortion cost value to obtain the second rate-distortion cost value.
  • the first determining unit 1101 is further configured to, when the first rate-distortion cost value is less than the second rate-distortion cost value, determine a third rate-distortion code for filtering the luminance component of the current block using the luminance weight matrix.
  • the fourth rate-distortion cost value for which the luma component of the current block is not filtered using the luma weight matrix; and if the third rate-distortion cost value is less than the fourth rate-distortion cost value, then determining the second luma syntax element identification information The value of is the first value; or, if the third rate-distortion cost value is greater than or equal to the fourth rate-distortion cost value, the value of the second luma syntax element identification information is determined to be the second value.
  • the encoding unit 1104 is further configured to encode the value of the identification information of the second luma syntax element, and write the encoded bits into the code stream.
  • the first setting unit 1105 is further configured to set the luminance CTU level flag bit, and the luminance CTU level flag bit is used to control whether the luminance component of the current block is filtered using the luminance weight matrix;
  • the first determining unit 1101 is further configured to turn on the luminance CTU level flag if the third rate-distortion cost value is less than the fourth rate-distortion cost value; or, if the third rate-distortion cost value is greater than or equal to the fourth rate-distortion cost value. Distortion cost value, turn off the brightness CTU level flag.
  • the first determining unit 1101 is further configured to use the luminance weight matrix to determine the target reconstructed image block of the current block if the third rate-distortion cost value is less than the fourth rate-distortion cost value.
  • the first determining unit 1101 is further configured to determine that the weight matrix is a chroma weight matrix when the color component type of the current frame is a chroma component; and A fifth rate-distortion cost value for determining the chrominance component of the current frame in the video sequence is filtered using the chrominance weighting matrix; rate-distortion cost value; and if the fifth rate-distortion cost value is less than the sixth rate-distortion cost value, determining that the value of the chroma syntax element identification information is the first value; or, if the fifth rate-distortion cost value is greater than or equal to the sixth rate-distortion cost value If the rate-distortion cost value is 6, it is determined that the value of the chroma syntax element identification information is the second value.
  • the encoding unit 1104 is further configured to encode the value of the identification information of the chroma syntax element, and write the encoded bits into the code stream.
  • the first setting unit 1105 is further configured to set a chroma frame-level flag bit, and the chroma frame-level flag bit is used to control whether the chroma components of the current frame are filtered using a weight matrix;
  • the first determining unit 1101 is further configured to turn on the chroma frame-level flag if the fifth rate-distortion cost value is less than the sixth rate-distortion cost value; or, if the fifth rate-distortion cost value is greater than or equal to the sixth rate-distortion cost value. If the rate-distortion cost value is set, the chroma frame-level flag is turned off.
  • the first value is one and the second value is zero.
  • the first determining unit 1101 is further configured to use the chrominance weight matrix to determine the target reconstructed image block of the current block if the fifth rate-distortion cost value is less than the sixth rate-distortion cost value.
  • the first determining unit 1101 is further configured to determine the input reconstructed image block and the output reconstructed image block of the neural network loop filter; and input the output reconstructed image block into the weight matrix network model to obtain the weight of the current block matrix.
  • the first filtering unit 1102 is specifically configured to use a weight matrix to perform weighting processing on the input reconstructed image block and the output reconstructed image block to obtain the target reconstructed image block.
  • the first determining unit 1101 is further configured to use a luminance weight matrix network model to determine a luminance weight matrix when the color component type of the current block is a luminance component; when the color component type of the current block is a chrominance component , using the chrominance weight matrix network model to determine the chrominance weight matrix.
  • the first determining unit 1101 is further configured to, when the color component type of the current block is a luminance component, determine the input luminance reconstructed image block and the output luminance reconstructed image block of the neural network loop filter; Input the brightness weight matrix network model to the brightness reconstruction image block, and obtain the brightness weight matrix;
  • the first filtering unit 1102 is further configured to perform weighting processing on the input luminance reconstructed image block and the output luminance reconstructed image block by using the luminance weight matrix to obtain the target reconstructed image block of the luminance component of the current block.
  • the first determining unit 1101 is further configured to determine the input chrominance reconstructed image block and the output chrominance reconstructed image block of the neural network loop filter when the color component type of the current block is a chrominance component; and inputting the output chrominance reconstruction image block into the chrominance weight matrix network model to obtain the chrominance weight matrix;
  • the first filtering unit 1102 is further configured to perform weighting processing on the input chrominance reconstructed image block and the output chrominance reconstructed image block by using the chrominance weight matrix to obtain the target reconstructed image block of the chrominance component of the current block.
  • the input reconstructed image block is obtained after filtering through a deblocking filter and a sample adaptive compensation filter.
  • the first filtering unit 1102 is further configured to, after determining the target reconstructed image block of the current block, use an adaptive correction filter to continue filtering the target reconstructed image block.
  • a "unit” may be a part of a circuit, a part of a processor, a part of a program or software, etc., of course, it may also be a module, and it may also be non-modular.
  • each component in this embodiment may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units can be implemented in the form of hardware, or can be implemented in the form of software function modules.
  • the integrated unit is implemented in the form of a software functional module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium.
  • the technical solution of this embodiment is essentially or The part that contributes to the prior art or the whole or part of the technical solution can be embodied in the form of a software product, the computer software product is stored in a storage medium, and includes several instructions for making a computer device (which can be It is a personal computer, a server, or a network device, etc.) or a processor (processor) that executes all or part of the steps of the method described in this embodiment.
  • the aforementioned storage medium includes: U disk, mobile hard disk, read only memory (Read Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program codes.
  • an embodiment of the present application provides a computer storage medium, which is applied to the encoder 110, where the computer storage medium stores a computer program, and when the computer program is executed by the first processor, any one of the foregoing embodiments is implemented.
  • FIG. 12 shows a schematic diagram of a specific hardware structure of the encoder 110 provided by the embodiment of the present application.
  • it may 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 .
  • the first bus system 1204 is used to realize the connection communication between these components.
  • the first bus system 1204 also includes a power bus, a control bus and a status signal bus.
  • the various buses are labeled as the first bus system 1204 in FIG. 12 . in,
  • the first communication interface 1201 is used for receiving and sending signals in the process of sending and receiving information with other external network elements;
  • a first memory 1202 for storing computer programs that can run on the first processor 1203;
  • the first processor 1203 is configured to, when running the computer program, execute:
  • the weight matrix is used to determine the target reconstructed image block of the current block.
  • the first memory 1202 in this embodiment of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories.
  • the non-volatile memory may be a read-only memory (Read-Only Memory, ROM), a programmable read-only memory (Programmable ROM, PROM), an erasable programmable read-only memory (Erasable PROM, EPROM), an electrically programmable read-only memory (Erasable PROM, EPROM). Erase programmable read-only memory (Electrically EPROM, EEPROM) or flash memory.
  • Volatile memory may be Random Access Memory (RAM), which acts as an external cache.
  • RAM Static RAM
  • DRAM Dynamic RAM
  • SDRAM Synchronous DRAM
  • SDRAM double data rate synchronous dynamic random access memory
  • Double Data Rate SDRAM DDRSDRAM
  • enhanced SDRAM ESDRAM
  • synchronous link dynamic random access memory Synchlink DRAM, SLDRAM
  • Direct Rambus RAM Direct Rambus RAM
  • the first processor 1203 may be an integrated circuit chip with signal processing capability. In the implementation process, each step of the above-mentioned method may be completed by an integrated logic circuit of hardware in the first processor 1203 or an instruction in the form of software.
  • the above-mentioned first processor 1203 can be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a ready-made programmable gate array (Field Programmable Gate Array, FPGA) Or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
  • DSP Digital Signal Processor
  • ASIC Application Specific Integrated Circuit
  • FPGA Field Programmable Gate Array
  • the methods, steps, and logic block diagrams disclosed in the embodiments of this application can be implemented or executed.
  • a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the steps of the method disclosed in conjunction with the embodiments of the present application may be directly embodied as executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor.
  • the software modules may be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other storage media mature in the art.
  • 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.
  • the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof.
  • the processing unit can be implemented in one or more Application Specific Integrated Circuits (ASIC), Digital Signal Processing (DSP), Digital Signal Processing Device (DSP Device, DSPD), programmable Logic Device (Programmable Logic Device, PLD), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA), General Purpose Processor, Controller, Microcontroller, Microprocessor, Others for performing the functions described in this application electronic unit or a combination thereof.
  • ASIC Application Specific Integrated Circuits
  • DSP Digital Signal Processing
  • DSP Device Digital Signal Processing Device
  • DSPD Digital Signal Processing Device
  • PLD programmable Logic Device
  • Field-Programmable Gate Array Field-Programmable Gate Array
  • FPGA Field-Programmable Gate Array
  • the techniques described herein may be implemented through modules (eg, procedures, functions, etc.) that perform the functions described herein.
  • Software codes may
  • the first processor 1203 is further configured to execute the method described in any one of the foregoing embodiments when running the computer program.
  • This embodiment provides an encoder, and the encoder may include a first determining unit and a first filtering unit.
  • the encoder may include a first determining unit and a first filtering unit.
  • FIG. 13 shows a schematic structural diagram of a decoder 130 provided by an embodiment of the present application.
  • the decoder 130 may include: a parsing unit 1301, a second determining unit 1302 and a second filtering unit 1303; wherein,
  • a parsing unit 1301, configured to parse the code stream, and determine the value of at least one syntax element identification information
  • the second determining unit 1302 is configured to determine a weight matrix network model of the current block when the at least one syntax element identification information indicates that the current frame or the current block uses the weight matrix for filtering processing, and determine the weight matrix of the current block according to the weight matrix network model ;
  • the second filtering unit 1303 is configured to use the weight matrix to determine the target reconstructed image block of the current block.
  • the parsing unit 1301 is specifically configured to parse the code stream, and determine the value of the first syntax element identification information; and when the first syntax element identification information indicates that the video sequence is filtered using the weight matrix, parse the code stream , determine the value of the second syntax element identification information; wherein, the second syntax element identification information is used to indicate whether the current frame in the video sequence is filtered by using the weight matrix, and the current frame includes the current block.
  • the second determining unit 1302 is further configured to, if the value of the first syntax element identification information is a first value, determine that the first syntax element identification information indicates that the video sequence is filtered by using a weight matrix; or, 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 the video sequence is not filtered using the weight matrix.
  • the second determining unit 1302 is further configured to, when the color component type of the current frame is a luma component, determine that the second syntax element identification information is the first luma syntax element identification information, and the first luma syntax element identification information Used to indicate whether the luminance component of the current frame is filtered using the luminance weight matrix; or, when the color component type of the current frame is a chroma component, determine that the second syntax element identification information is the chroma syntax element identification information, and the chroma syntax The element identification information is used to indicate whether the chroma components of the current frame are filtered using the chroma weight matrix.
  • the parsing unit 1301 is further configured to parse the code stream when the first luminance syntax element identification information indicates that the luminance component of the current frame is filtered using a luminance weight matrix, and determine The value of the second luminance syntax element identification information;
  • the second determining unit 1302 is further configured to determine a luma weight matrix network model of the current block when the second luma syntax element identification information indicates that the luma component of the current block is filtered using the luma weight matrix.
  • the decoder 130 may further include a second setting unit 1304 configured to set the luminance frame level flag bit and the luminance CTU level flag bit; wherein the luminance frame level flag bit is used to control the Whether the luminance component is filtered by the luminance weight matrix, the luminance CTU level flag is used to control whether the luminance component of the current block is filtered by the luminance weight matrix.
  • a second setting unit 1304 configured to set the luminance frame level flag bit and the luminance CTU level flag bit; wherein the luminance frame level flag bit is used to control the Whether the luminance component is filtered by the luminance weight matrix, the luminance CTU level flag is used to control whether the luminance component of the current block is filtered by the luminance weight matrix.
  • the second determining unit 1302 is further configured to turn on the luma frame-level flag if the value of the first luma syntax element identification information is the first value; or, if the first luma syntax element identification information If the value is the second value, the brightness frame level flag is turned off.
  • the second determining unit 1302 is further configured to turn on the luminance CTU level flag if the value of the second luminance syntax element identification information is the first value; or, if the second luminance syntax element identification information If the value is the second value, the brightness CTU level flag is turned off.
  • the second determining unit 1302 is further configured to, if the value of the first luma syntax element identification information is a first value, determine that the first luma syntax element identification information indicates that the luma component of the current frame uses a luma weight matrix Perform filtering processing; or, if the value of the first luma syntax element identification information is the second value, determine that the first luma syntax element identification information indicates that the luma component of the current frame is not filtered using the luma weight matrix.
  • the second determining unit 1302 is further configured to, if the value of the second luma syntax element identification information is the first value, determine that the second luma syntax element identification information indicates that the luma component of the current block uses the luma weight matrix Perform filtering processing; or, if the value of the second luma syntax element identification information is the second value, determine that the second luma syntax element identification information indicates that the luma component of the current block is not filtered using the luma weight matrix.
  • the second determining unit 1302 is further configured to use the chroma weight matrix for filtering processing when the chroma syntax element identification information indicates that the chroma component of the current frame is filtered When , determine the chrominance weight matrix network model of the current block.
  • the second setting unit 1304 is further configured to set a chroma frame-level flag bit, wherein the chroma frame-level flag bit is used to control whether the chroma components of the current frame are filtered using a weight matrix.
  • the second determining unit 1302 is further configured to turn on the chroma frame-level flag if the value of the chroma syntax element identification information is the first value; or, if the value of the chroma syntax element identification information is the first value If the value is the second value, the chroma frame-level flag is turned off.
  • the second determining unit 1302 is further configured to, if the value of the chroma syntax element identification information is the first value, determine that the chroma syntax element identification information indicates that the chroma component of the current frame uses a chroma weight matrix Perform filtering processing; or, if the value of the chroma syntax element identification information is the second value, determine that the chroma syntax element identification information indicates that the chroma components of the current frame are not filtered using the chroma weight matrix.
  • the first value is one and the second value is zero.
  • the second determining unit 1302 is further configured to, when the color component type of the current block is a luminance component, determine at least one candidate luminance weight matrix network model; and determine the quantization parameter of the current block, from at least one The candidate brightness weight matrix network model corresponding to the quantization parameter is selected from the candidate brightness weight matrix network model; and the selected candidate brightness weight matrix network model is determined as the brightness weight matrix network model of the current block.
  • the second determining unit 1302 is further configured to determine at least one candidate chrominance weight matrix network model when the color component type of the current block is a chrominance component; and determine the quantization parameter of the current block, from From at least one candidate chroma weight matrix network model, a candidate chroma weight matrix network model corresponding to the quantization parameter is selected; and the selected candidate chroma weight matrix network model is determined as the chroma weight matrix network model of the current block.
  • the decoder 130 may further include a second training unit 1305;
  • the second determining unit 1302 is further configured to determine at least one training sample, wherein the training sample is obtained according to at least one quantization parameter;
  • the second training unit 1305 is configured to use the luminance component of at least one training sample to train the preset neural network model to obtain at least one candidate luminance weight matrix network model; and use the chrominance component of the at least one training sample to train the preset neural network model
  • the model is trained to obtain at least one candidate chrominance weight matrix network model; wherein, at least one candidate brightness weight matrix network model has a corresponding relationship with the brightness component and the quantization parameter, and at least one candidate chrominance weight matrix network model and the chrominance component. and quantization parameters have a corresponding relationship.
  • the preset neural network model includes at least one of the following: at least one convolutional layer, at least one activation layer, and a skip connection layer.
  • the second determining unit 1302 is further configured to determine the input reconstructed image block and the output reconstructed image block of the neural network loop filter; and input the output reconstructed image block into the weight matrix network model to obtain the weight of the current block matrix.
  • the second filtering unit 1303 is further configured to perform weighting processing on the input reconstructed image block and the output reconstructed image block by using a weight matrix to obtain the target reconstructed image block.
  • the second determining unit 1302 is further configured to use a luminance weight matrix network model to determine a luminance weight matrix when the color component type of the current block is a luminance component; and when the color component type of the current block is a chrominance component When , use the chrominance weight matrix network model to determine the chrominance weight matrix.
  • the second determining unit 1302 is further configured to, when the color component type of the current block is a luminance component, determine the input luminance reconstructed image block and the output luminance reconstructed image block of the neural network loop filter; Input the brightness weight matrix network model to the brightness reconstruction image block, and obtain the brightness weight matrix;
  • the second filtering unit 1303 is further configured to perform weighting processing on the input luminance reconstructed image block and the output luminance reconstructed image block by using the luminance weight matrix to obtain the target reconstructed image block of the luminance component of the current block.
  • the second determining unit 1302 is further configured to determine the input chrominance reconstructed image block and the output chrominance reconstructed image block of the neural network loop filter when the color component type of the current block is a chrominance component; and inputting the output chrominance reconstruction image block into the chrominance weight matrix network model to obtain the chrominance weight matrix;
  • the second filtering unit 1303 is further configured to perform weighting processing on the input chrominance reconstructed image block and the output chrominance reconstructed image block by using the chrominance weight matrix to obtain the target reconstructed image block of the chrominance component of the current block.
  • the input reconstructed image block is obtained after filtering through a deblocking filter and a sample adaptive compensation filter.
  • the second filtering unit 1303 is further configured to, after determining the target reconstructed image block of the current block, continue to perform filtering processing on the target reconstructed image block by using an adaptive correction filter.
  • a "unit” may be a part of a circuit, a part of a processor, a part of a program or software, etc., of course, it may also be a module, and it may also be non-modular.
  • each component in this embodiment may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units can be implemented in the form of hardware, or can be implemented in the form of software function modules.
  • the integrated unit may be stored in a computer-readable storage medium.
  • this embodiment provides a computer storage medium, which is applied to the decoder 130, where the computer storage medium stores a computer program, and when the computer program is executed by the second processor, any one of the foregoing embodiments is implemented the method described.
  • FIG. 14 shows a schematic diagram of a specific hardware structure of the decoder 130 provided by the embodiment of the present application.
  • it may include: a second communication interface 1401 , a second memory 1402 and a second processor 1403 ; various components are coupled together through a second bus system 1404 .
  • the second bus system 1404 is used to realize the connection communication between these components.
  • the second bus system 1404 also includes a power bus, a control bus, and a status signal bus.
  • the various buses are labeled as the second bus system 1404 in FIG. 14 . in,
  • the second communication interface 1401 is used for receiving and sending signals in the process of sending and receiving information with other external network elements;
  • a second memory 1402 for storing computer programs that can run on the second processor 1403;
  • the second processor 1403 is configured to, when running the computer program, execute:
  • At least one syntax element identification information indicates that the current frame or the current block uses the weight matrix for filtering processing, determine the weight matrix network model of the current block, and determine the weight matrix of the current block according to the weight matrix network model;
  • the target reconstructed image block of the current block is determined.
  • the second processor 1403 is further configured to execute the method described in any one of the foregoing embodiments when running the computer program.
  • This embodiment provides a decoder, and the decoder may include a parsing unit, a second determining unit, and a second filtering unit.
  • the decoder may include a parsing unit, a second determining unit, and a second filtering unit.
  • the weight matrix network model of the current block is determined, and the weight matrix of the current block is determined according to the weight matrix network model; the value of the identification information of at least one syntax element is determined; when at least one syntax element The identification information indicates that when the current frame or the current block uses the weight matrix for filtering processing, the weight matrix is used to determine the target reconstructed image block of the current block.
  • the value of at least one syntax element identification information is determined by parsing the code stream; when the at least one syntax element identification information indicates that the current frame or current block uses the weight matrix for filtering processing, the weight matrix network model of the current block is determined , and determine the weight matrix of the current block according to the weight matrix network model; use the weight matrix to determine the target reconstructed image block of the current block.
  • the weight matrix network model to determine the weight matrix, it can not only realize the weight matrix technology based on deep learning, but also provide pixel-level weighting processing for the use of the output reconstructed image block, but also improve the coding performance, which in turn can improve the coding performance.
  • Decoding efficiency in addition, the present application can also make the output of the neural network loop filter closer to the original image, which can improve the video image quality.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

Disclosed in embodiments of the present application are encoding and decoding methods, a code stream, an encoder, a decoder, and a storage medium. The method comprises: parsing the code stream, and determining the value of at least one piece of syntax element identification information; when the at least one piece of syntax element identification information indicates that a current frame or current block uses a weight matrix for filtering processing, determining a weight matrix network model of the current block, and determining a weight matrix of the current block according to the weight matrix network model; and determining a target reconstructed image block of the current block by using the weight matrix. In this way, by using the weight matrix network model, a weight matrix technique based on deep learning can be implemented, and pixel-level weighting processing can be provided for the use of an output reconstructed image block, thereby improving encoding performance and further improving encoding and decoding efficiency.

Description

编解码方法、码流、编码器、解码器以及存储介质Codec method, code stream, encoder, decoder and storage medium 技术领域technical field
本申请实施例涉及图像处理技术领域,尤其涉及一种编解码方法、码流、编码器、解码器以及存储介质。The embodiments of the present application relate to the technical field of image processing, and in particular, to an encoding and decoding method, a code stream, an encoder, a decoder, and a storage medium.
背景技术Background technique
在视频编解码系统中,环路滤波器被使用来提升重建图像的主客观质量。其中,传统的环路滤波器主要包括去块滤波器,样值自适应补偿滤波器和自适应修正滤波器。在第三代音视频编码标准(3rd Audio Video coding Standard,AVS3)的高性能-模块化智能编码测试模型(High Performance-Modular Artificial Intelligence Model,HPM-ModAI)中,还采用了基于残差神经网络的环路滤波器(以下简称为CNNLF)作为智能环路滤波模块的基线方案,并位于样值自适应补偿滤波器和自适应修正滤波器之间。In video codec systems, loop filters are used to improve the subjective and objective quality of reconstructed images. Among them, the traditional loop filter mainly includes deblocking filter, sample adaptive compensation filter and adaptive correction filter. In the high performance-modular intelligent coding test model (High Performance-Modular Artificial Intelligence Model, HPM-ModAI) of the third-generation audio and video coding standard (3rd Audio Video coding Standard, AVS3), a residual neural network based The loop filter (hereinafter referred to as CNNLF) is used as the baseline scheme of the intelligent loop filter module, and is located between the sample adaptive compensation filter and the adaptive correction filter.
在目前AVS3的HPM-ModAI中,当通过率失真代价方式确定当前块使用CNNLF时,这时候当前块的重建像素值将会被更新为经过CNNLF处理后的像素值。然而,整个块的失真值变小并不意味着该块中的每个像素值的失真都会变小,使得编码性能的提升受限。In the current HPM-ModAI of AVS3, when it is determined that the current block uses CNNLF through the rate-distortion cost method, the reconstructed pixel value of the current block will be updated to the pixel value processed by CNNLF at this time. However, the smaller distortion value of the entire block does not mean that the distortion of each pixel value in the block will be smaller, so that the improvement of coding performance is limited.
发明内容SUMMARY OF THE INVENTION
本申请实施例提供一种编解码方法、码流、编码器、解码器以及存储介质,可以提升编码性能,进而能够提高编解码效率。Embodiments of the present application provide an encoding and decoding method, a code stream, an encoder, a decoder, and a storage medium, which can improve encoding performance and further improve encoding and decoding efficiency.
本申请实施例的技术方案可以如下实现:The technical solutions of the embodiments of the present application can be implemented as follows:
第一方面,本申请实施例提供了一种解码方法,应用于解码器,该方法包括:In a first aspect, an embodiment of the present application provides a decoding method, which is applied to a decoder, and the method includes:
解析码流,确定至少一个语法元素标识信息的取值;Parse the code stream, and determine the value of at least one syntax element identification information;
当至少一个语法元素标识信息指示当前帧或当前块使用权重矩阵进行滤波处理时,确定当前块的权重矩阵网络模型,并根据权重矩阵网络模型确定当前块的权重矩阵;When at least one syntax element identification information indicates that the current frame or the current block uses the weight matrix for filtering processing, determine the weight matrix network model of the current block, and determine the weight matrix of the current block according to the weight matrix network model;
利用权重矩阵,确定当前块的目标重建图像块。Using the weight matrix, the target reconstructed image block of the current block is determined.
第二方面,本申请实施例提供了一种编码方法,应用于编码器,该方法包括:In a second aspect, an embodiment of the present application provides an encoding method, which is applied to an encoder, and the method includes:
确定当前块的权重矩阵网络模型,并根据权重矩阵网络模型确定当前块的权重矩阵;Determine the weight matrix network model of the current block, and determine the weight matrix of the current block according to the weight matrix network model;
确定至少一个语法元素标识信息的取值;Determine the value of at least one syntax element identification information;
当至少一个语法元素标识信息指示当前帧或当前块使用权重矩阵进行滤波处理时,利用权重矩阵确定当前块的目标重建图像块。When the at least one syntax element identification information indicates that the current frame or the current block uses the weight matrix for filtering processing, the weight matrix is used to determine the target reconstructed image block of the current block.
第三方面,本申请实施例提供了一种码流,该码流是根据至少一个语法元素标识信息的取值进行比特编码生成的;In a third aspect, an embodiment of the present application provides a code stream, where the code stream is generated by bit encoding according to the value of at least one syntax element identification information;
其中,至少一个语法元素标识信息至少包括:第一语法元素标识信息、第一亮度语法元素标识信息、第二亮度语法元素标识信息和色度语法元素标识信息;Wherein, the at least one syntax element identification information includes at least: first syntax element identification information, first luma syntax element identification information, second luma syntax element identification information, and chroma syntax element identification information;
其中,第一语法元素标识信息用于指示视频序列是否使用权重矩阵进行滤波处理,第一亮度语法元素标识信息用于指示当前帧的亮度分量是否使用权重矩阵进行滤波处理,第二亮度语法元素标识信息用于指示当前块的亮度分量是否使用权重矩阵进行滤波处理,色度语法元素标识信息用于指示当前帧的色度分量是否使用权重矩阵进行滤波处理;视频序列包括当前帧,当前帧包括当前块。Wherein, the first syntax element identification information is used to indicate whether the video sequence is filtered using the weight matrix, the first luminance syntax element identification information is used to indicate whether the luminance component of the current frame is filtered using the weight matrix, and the second luminance syntax element identification The information is used to indicate whether the luminance component of the current block is filtered using the weight matrix, and the chroma syntax element identification information is used to indicate whether the chroma component of the current frame is filtered using the weight matrix; the video sequence includes the current frame, and the current frame includes the current frame. piece.
第四方面,本申请实施例提供了一种编码器,该编码器包括第一确定单元和第一滤波单元;其中,In a fourth aspect, an embodiment of the present application provides an encoder, where the encoder includes a first determining unit and a first filtering unit; wherein,
第一确定单元,配置为确定当前块的权重矩阵网络模型,并根据权重矩阵网络模型确定当前块的权重矩阵;以及还配置为确定至少一个语法元素标识信息的取值;a first determining unit, configured to determine the weight matrix network model of the current block, and determine the weight matrix of the current block according to the weight matrix network model; and also configured to determine the value of at least one syntax element identification information;
第一滤波单元,配置为当至少一个语法元素标识信息指示当前帧或当前块使用权重矩阵进行滤波处理时,利用权重矩阵确定当前块的目标重建图像块。The first filtering unit is configured to use the weight matrix to determine the target reconstructed image block of the current block when the at least one syntax element identification information indicates that the current frame or the current block uses the weight matrix for filtering processing.
第五方面,本申请实施例提供了一种编码器,该编码器包括第一存储器和第一处理器;其中,In a fifth aspect, an embodiment of the present application provides an encoder, where the encoder includes a first memory and a first processor; wherein,
第一存储器,用于存储能够在第一处理器上运行的计算机程序;a first memory for storing a computer program executable on the first processor;
第一处理器,用于在运行所述计算机程序时,执行如第二方面所述的方法。The first processor is configured to execute the method of the second aspect when running the computer program.
第六方面,本申请实施例提供了一种解码器,该解码器包括解析单元、第二确定单元和第二滤波单元;其中,In a sixth aspect, an embodiment of the present application provides a decoder, the decoder includes a parsing unit, a second determining unit, and a second filtering unit; wherein,
解析单元,配置为解析码流,确定至少一个语法元素标识信息的取值;a parsing unit, configured to parse the code stream, and determine the value of at least one syntax element identification information;
第二确定单元,配置为当至少一个语法元素标识信息指示当前帧或当前块使用权重矩阵进行滤波处理时,确定当前块的权重矩阵网络模型,并根据权重矩阵网络模型确定当前块的权重矩阵;a second determining unit, configured to determine the weight matrix network model of the current block when the at least one syntax element identification information indicates that the current frame or the current block uses the weight matrix for filtering processing, and determine the weight matrix of the current block according to the weight matrix network model;
第二滤波单元,配置为利用权重矩阵,确定当前块的目标重建图像块。The second filtering unit is configured to use the weight matrix to determine the target reconstructed image block of the current block.
第七方面,本申请实施例提供了一种解码器,该解码器包括第二存储器和第二处理器;其中,In a seventh aspect, an embodiment of the present application provides a decoder, where the decoder includes a second memory and a second processor; wherein,
第二存储器,用于存储能够在第二处理器上运行的计算机程序;a second memory for storing a computer program executable on the second processor;
第二处理器,用于在运行所述计算机程序时,执行如第一方面所述的方法。The second processor is configured to execute the method according to the first aspect when running the computer program.
第八方面,本申请实施例提供了一种计算机存储介质,该计算机存储介质存储有计算机程序,所述计算机程序被执行时实现如第一方面所述的方法、或者实现如第二方面所述的方法。In an eighth aspect, an embodiment of the present application provides a computer storage medium, where the computer storage medium stores a computer program, and when the computer program is executed, the method described in the first aspect or the second aspect is realized. Methods.
本申请实施例提供了一种编解码方法、码流、编码器、解码器以及存储介质,在编码器侧,通过确定当前块的权重矩阵网络模型,并根据权重矩阵网络模型确定当前块的权重矩阵;确定至少一个语法元素标识信息的取值;当至少一个语法元素标识信息指示当前帧或当前块使用权重矩阵进行滤波处理时,利用权重矩阵确定当前块的目标重建图像块。在解码器侧,通过解析码流,确定至少一个语法元素标识信息的取值;当至少一个语法元素标识信息指示当前帧或当前块使用权重矩阵进行滤波处理时,确定当前块的权重矩阵网络模型,并根据权重矩阵网络模型确定当前块的权重矩阵;利用权重矩阵,确定当前块的目标重建图像块。这样,通过利用权重矩阵网络模型来确定权重矩阵,不仅可以实现基于深度学习的权重矩阵技术,能够为输出重建图像块的使用提供像素级别的加权处理,而且还可以提升编码性能,进而能够提高编解码效率;另外本申请还可以使得神经网络环路滤波器的输出更加接近于原始图像,能够提升视频图像质量。The embodiments of the present application provide an encoding and decoding method, a code stream, an encoder, a decoder, and a storage medium. On the encoder side, the weight matrix network model of the current block is determined, and the weight of the current block is determined according to the weight matrix network model. matrix; determine the value of at least one syntax element identification information; when the at least one syntax element identification information indicates that the current frame or current block uses the weight matrix for filtering, use the weight matrix to determine the target reconstructed image block of the current block. On the decoder side, the value of at least one syntax element identification information is determined by parsing the code stream; when the at least one syntax element identification information indicates that the current frame or current block uses the weight matrix for filtering processing, the weight matrix network model of the current block is determined , and determine the weight matrix of the current block according to the weight matrix network model; use the weight matrix to determine the target reconstructed image block of the current block. In this way, by using the weight matrix network model to determine the weight matrix, it can not only realize the weight matrix technology based on deep learning, but also provide pixel-level weighting processing for the use of the output reconstructed image block, but also improve the coding performance, which in turn can improve the coding performance. Decoding efficiency; in addition, the present application can also make the output of the neural network loop filter closer to the original image, which can improve the video image quality.
附图说明Description of drawings
图1为相关技术提供的一种编码框架的应用示意图;Fig. 1 is the application schematic diagram of a kind of coding framework provided by the related art;
图2为相关技术提供的另一种编码框架的应用示意图;2 is an application schematic diagram of another encoding framework provided by the related art;
图3A为本申请实施例提供的一种视频编码系统的详细框架示意图;3A is a schematic diagram of a detailed framework of a video coding system provided by an embodiment of the present application;
图3B为本申请实施例提供的一种视频解码系统的详细框架示意图;3B is a schematic diagram of a detailed framework of a video decoding system provided by an embodiment of the application;
图4为本申请实施例提供的一种解码方法的流程示意图;4 is a schematic flowchart of a decoding method provided by an embodiment of the present application;
图5A为本申请实施例提供的一种亮度分量的网络结构组成示意图;5A is a schematic diagram of a network structure composition of a luminance component provided by an embodiment of the present application;
图5B为本申请实施例提供的一种色度分量的网络结构组成示意图;5B is a schematic diagram of a network structure composition of a chrominance component provided by an embodiment of the present application;
图6为本申请实施例提供的一种残差块的网络结构组成示意图;FIG. 6 is a schematic diagram of a network structure composition of a residual block provided by an embodiment of the present application;
图7为本申请实施例提供的一种编码框架的应用示意图;FIG. 7 is a schematic diagram of the application of a coding framework provided by an embodiment of the present application;
图8为本申请实施例提供的一种权重矩阵网络模型的组成结构示意图;8 is a schematic diagram of the composition and structure of a weight matrix network model provided by an embodiment of the present application;
图9为本申请实施例提供的一种权重矩阵网络模型的整体框架示意图;9 is a schematic diagram of an overall framework of a weight matrix network model provided by an embodiment of the present application;
图10为本申请实施例提供的一种编码方法的流程示意图;10 is a schematic flowchart of an encoding method provided by an embodiment of the present application;
图11为本申请实施例提供的一种编码器的组成结构示意图;11 is a schematic diagram of the composition and structure of an encoder provided by an embodiment of the application;
图12为本申请实施例提供的一种编码器的具体硬件结构示意图;12 is a schematic diagram of a specific hardware structure of an encoder provided by an embodiment of the application;
图13为本申请实施例提供的一种解码器的组成结构示意图;13 is a schematic diagram of the composition and structure of a decoder provided by an embodiment of the present application;
图14为本申请实施例提供的一种解码器的具体硬件结构示意图。FIG. 14 is a schematic diagram of a specific hardware structure of a decoder provided by an embodiment of the present application.
具体实施方式Detailed ways
为了能够更加详尽地了解本申请实施例的特点与技术内容,下面结合附图对本申请实施例的实现进行详细阐述,所附附图仅供参考说明之用,并非用来限定本申请实施例。In order to have 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 will be described in detail below with reference to the accompanying drawings.
除非另有定义,本文所使用的所有的技术和科学术语与属于本申请的技术领域的技术人员通常理解的含义相同。本文中所使用的术语只是为了描述本申请实施例的目的,不是旨在限制本申请。Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the technical field to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of the present application, and are not intended to limit the present application.
在以下的描述中,涉及到“一些实施例”,其描述了所有可能实施例的子集,但是可以理解,“一些实施例”可以是所有可能实施例的相同子集或不同子集,并且可以在不冲突的情况下相互结合。还需要指出,本申请实施例所涉及的术语“第一\第二\第三”仅是用于区别类似的对象,不代表针对对象的特 定排序,可以理解地,“第一\第二\第三”在允许的情况下可以互换特定的顺序或先后次序,以使这里描述的本申请实施例能够以除了在这里图示或描述的以外的顺序实施。In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is understood that "some embodiments" can be the same or a different subset of all possible embodiments, and Can be combined with each other without conflict. It should also be pointed out that the term "first\second\third" involved in the embodiments of the present application is only used to distinguish similar objects, and does not represent a specific ordering of objects. It is understood that "first\second\" Where permitted, the specific order or sequence may be interchanged so that the embodiments of the present application described herein can be implemented in sequences other than those illustrated or described herein.
在视频图像中,一般采用第一图像分量、第二图像分量和第三图像分量来表征编码块(Coding Block,CB);其中,这三个图像分量分别为一个亮度分量、一个蓝色色度分量和一个红色色度分量,具体地,亮度分量通常使用符号Y表示,蓝色色度分量通常使用符号Cb或者U表示,红色色度分量通常使用符号Cr或者V表示;这样,视频图像可以用YCbCr格式表示,也可以用YUV格式表示。In a video image, a first image component, a second image component, and a third image component are generally used to represent a coding block (Coding Block, CB); wherein, the three image components are a luminance component and a blue chrominance component respectively. and a red chrominance component, specifically, the luminance component is usually represented by the symbol Y, the blue chrominance component is usually represented by the symbol Cb or U, and the red chrominance component is usually represented by the symbol Cr or V; in this way, the video image can use the YCbCr format Representation can also be represented in YUV format.
对本申请实施例进行进一步详细说明之前,先对本申请实施例中涉及的名词和术语进行说明,本申请实施例中涉及的名词和术语适用于如下的解释:Before the embodiments of the present application are described in further detail, the nouns and terms involved in the embodiments of the present application will be described first. The nouns and terms involved in the embodiments of the present application are applicable to the following explanations:
动态图像专家组(Moving Picture Experts Group,MPEG)Moving Picture Experts Group (MPEG)
国际标准化组织(International Standardization Organization,ISO)International Standardization Organization (ISO)
国际电工委员会(International Electrotechnical Commission,IEC)International Electrotechnical Commission (IEC)
联合视频专家组(Joint Video Experts Team,JVET)Joint Video Experts Team (JVET)
开放媒体联盟(Alliance for Open Media,AOM)Alliance for Open Media (AOM)
新一代视频编码标准H.266/多功能视频编码(Versatile Video Coding,VVC)A new generation of video coding standard H.266/Versatile Video Coding (VVC)
VVC的参考软件测试平台(VVC Test Model,VTM)VVC's reference software test platform (VVC Test Model, VTM)
音视频编码标准(Audio Video coding Standard,AVS)Audio Video coding Standard (AVS)
AVS的高性能测试模型(High-Performance Model,HPM)High-Performance Model (HPM) of AVS
AVS的高性能-模块化智能编码测试模型(High Performance-Modular Artificial Intelligence Model,HPM-ModAI)High Performance-Modular Artificial Intelligence Model of AVS (High Performance-Modular Artificial Intelligence Model, HPM-ModAI)
基于残差神经网络的环路滤波器(Convolutional Neural Network based in-Loop Filter,CNNLF)Convolutional Neural Network based in-Loop Filter (CNNLF) based on residual neural network
去块滤波器(DeBlocking Filter,DBF)Deblocking Filter (DBF)
样值自适应补偿(Sample adaptive Offset,SAO)Sample Adaptive Offset (SAO)
自适应修正滤波器(Adaptive loop filter,ALF)Adaptive loop filter (ALF)
量化参数(Quantization Parameter,QP)Quantization Parameter (QP)
编码单元(Coding Unit,CU)Coding unit (Coding Unit, CU)
编码树单元(Coding Tree Unit,CTU)Coding Tree Unit (CTU)
可以理解,数字视频压缩技术主要是将庞大的数字影像视频数据进行压缩,以便于传输以及存储等。随着互联网视频的激增以及人们对视频清晰度的要求越来越高,尽管已有的数字视频压缩标准能够节省不少视频数据,但目前仍然需要追求更好的数字视频压缩技术,以减少数字视频传输的带宽和流量压力。It can be understood that the digital video compression technology mainly compresses the huge digital image and video data to facilitate transmission and storage. With the proliferation of Internet video and people's higher and higher requirements for video definition, although the existing digital video compression standards can save a lot of video data, it is still necessary to pursue better digital video compression technology to reduce digital video data. Bandwidth and traffic pressure for video transmission.
在数字视频编码过程中,编码器对不同颜色格式的原始视频序列读取不相等的像素,包含亮度分量和色度分量,即编码器读取一副黑白或者彩色图像。然后将该图像进行划分成块,将块数据交由编码器进行编码,如今编码器通常为混合框架编码模式,一般可以包含帧内预测与帧间预测、变换/量化、反量化/逆变换、环路滤波及熵编码等操作,处理流程具体可参考图1所示。这里,帧内预测只参考同一帧图像的信息,预测当前划分块内的像素信息,用于消除空间冗余;帧间预测可以包括运动估计和运动补偿,其可参考不同帧的图像信息,利用运动估计搜索最匹配当前划分块的运动矢量信息,用于消除时间冗余;变换将预测后的图像块转换到频率域,能量重新分布,结合量化可以将人眼不敏感的信息去除,用于消除视觉冗余;熵编码可以根据当前上下文模型以及二进制码流的概率信息消除字符冗余;环路滤波则主要对反变换与反量化后的像素进行处理,弥补失真信息,为后续编码像素提供更好的参考。In the process of digital video encoding, the encoder reads unequal pixels for the original video sequences of different color formats, including luminance components and chrominance components, that is, the encoder reads a black and white or color image. The image is then divided into blocks, and the block data is handed over to the encoder for encoding. Nowadays, the encoder is usually a hybrid frame encoding mode, which can generally include intra-frame prediction and inter-frame prediction, transform/quantization, inverse quantization/inverse transform, For operations such as loop filtering and entropy coding, the specific processing flow can be referred to as shown in FIG. 1 . Here, intra-frame prediction only refers to the information of the same frame image, and predicts the pixel information in the current divided block to eliminate spatial redundancy; inter-frame prediction can include motion estimation and motion compensation, which can refer to the image information of different frames, using Motion estimation searches for the motion vector information that best matches the current divided block to eliminate temporal redundancy; transformation converts the predicted image block to the frequency domain, and the energy is redistributed. Combined with quantization, the information that is not sensitive to the human eye can be removed and used for Eliminate visual redundancy; entropy coding can eliminate character redundancy according to the current context model and the probability information of binary code stream; loop filtering mainly processes the pixels after inverse transformation and inverse quantization, compensates for distortion information, and provides subsequent coding pixels. better reference.
对于AVS3而言,在环路滤波部分,传统环路滤波模块主要包含去块滤波器(以下简称为DBF)、样值自适应补偿滤波器(以下简称为SAO)和自适应修正滤波器(以下简称为ALF)。在HPM-ModAI的应用中,还采用了基于残差神经网络的环路滤波器(以下简称为CNNLF)作为智能环路滤波模块的基线方案,并设置于SAO滤波和ALF滤波之间,具体详见图2所示。在编码测试时,按照智能编码通用测试条件,对于全帧内(All Intra)配置,打开ALF,关闭DBF和SAO;对于随机接入(Random Access)和低延迟(Low Delay)配置,打开I帧的DBF,打开ALF,关闭SAO。For AVS3, in the loop filtering part, the traditional loop filtering module mainly includes deblocking filter (hereinafter referred to as DBF), sample adaptive compensation filter (hereinafter referred to as SAO) and adaptive correction filter (hereinafter referred to as SAO) abbreviated as ALF). In the application of HPM-ModAI, the loop filter based on residual neural network (hereinafter referred to as CNNLF) is also used as the baseline scheme of the intelligent loop filter module, and is set between SAO filtering and ALF filtering. See Figure 2. During coding test, according to the general test conditions of intelligent coding, for All Intra configuration, turn on ALF, turn off DBF and SAO; for Random Access and Low Delay configuration, turn on I frame DBF, open ALF, close SAO.
在目前AVS3的HPM-ModAI中,当通过率失真代价方式确定使用CNNLF时,当前CTU的重建像素值将会被更新为经过CNNLF处理后的像素值。这时候打开CNNLF,说明了当前CTU经过CNNLF处理后与原始CTU的均方误差相比未经过CNNLF之前会变小;但是整个CTU的失真变小并不意味着该CTU中的每个像素值的失真都会变小。目前已有的解决方案缺少能够对经过CNNLF处理后的CTU中每个像素值进行最优的选择,使得编码性能的提升受限。In the current HPM-ModAI of AVS3, when it is determined to use CNNLF through the rate-distortion cost method, the reconstructed pixel value of the current CTU will be updated to the pixel value processed by CNNLF. At this time, CNNLF is turned on, indicating that the mean square error of the current CTU after CNNLF processing will become smaller than that of the original CTU before CNNLF; but the smaller distortion of the entire CTU does not mean that the value of each pixel in the CTU is smaller. Distortion will be reduced. The existing solutions lack the optimal selection of each pixel value in the CTU processed by CNNLF, which limits the improvement of coding performance.
本申请实施例提供了一种编码方法,在编码器侧,确定当前块的权重矩阵网络模型,并根据权重矩阵网络模型确定当前块的权重矩阵;确定至少一个语法元素标识信息的取值;当至少一个语法元素标识信息指示当前帧或当前块使用权重矩阵进行滤波处理时,利用权重矩阵确定当前块的目标重建图像块。The embodiment of the present application provides an encoding method. On the encoder side, the weight matrix network model of the current block is determined, and the weight matrix of the current block is determined according to the weight matrix network model; the value of at least one syntax element identification information is determined; The at least one syntax element identification information indicates that when the current frame or the current block uses the weight matrix for filtering processing, the weight matrix is used to determine the target reconstructed image block of the current block.
本申请实施例提供了一种解码方法,在解码器侧,解析码流,确定至少一个语法元素标识信息的取值;当至少一个语法元素标识信息指示当前帧或当前块使用权重矩阵进行滤波处理时,确定当前块的权重矩阵网络模型,并根据权重矩阵网络模型确定当前块的权重矩阵;利用权重矩阵,确定当前块的目标重建图像块。The embodiment of the present application provides a decoding method. On the decoder side, the code stream is parsed to determine the value of at least one syntax element identification information; when the at least one syntax element identification information indicates that the current frame or current block is filtered by using a weight matrix When , determine the weight matrix network model of the current block, and determine the weight matrix of the current block according to the weight matrix network model; use the weight matrix to determine the target reconstructed image block of the current block.
这样,通过利用权重矩阵网络模型来确定权重矩阵,不仅可以实现基于深度学习的权重矩阵技术,能够为输出重建图像块的使用提供像素级别的加权处理,而且还可以提升编码性能,进而能够提高编解码效率;另外本申请还可以使得神经网络环路滤波器的输出更加接近于原始图像,能够提升视频图像质量。In this way, by using the weight matrix network model to determine the weight matrix, it can not only realize the weight matrix technology based on deep learning, but also provide pixel-level weighting processing for the use of the output reconstructed image block, but also improve the coding performance, which in turn can improve the coding performance. Decoding efficiency; in addition, the present application can also make the output of the neural network loop filter closer to the original image, which can improve the video image quality.
下面将结合附图对本申请各实施例进行详细说明。The embodiments of the present application will be described in detail below with reference to the accompanying drawings.
参见图3A,其示出了本申请实施例提供的一种视频编码系统的详细框架示意图。如图3A所示,该视频编码系统10包括变换与量化单元101、帧内估计单元102、帧内预测单元103、运动补偿单元104、运动估计单元105、反变换与反量化单元106、滤波器控制分析单元107、滤波单元108、编码单元109和解码图像缓存单元110等,其中,滤波单元108可以实现DBF滤波/SAO滤波/ALF滤波,编码单元109可以实现头信息编码及基于上下文的自适应二进制算术编码(Context-based Adaptive Binary Arithmatic Coding,CABAC)。针对输入的原始视频信号,通过编码树单元(Coding Tree Unit,CTU)的划分可以得到一个视频编码块,然后对经过帧内或帧间预测后得到的残差像素信息通过变换与量化单元101对该视频编码块进行变换,包括将残差信息从像素域变换到变换域,并对所得的变换系数进行量化,用以进一步减少比特率;帧内估计单元102和帧内预测单元103是用于对该视频编码块进行帧内预测;明确地说,帧内估计单元102和帧内预测单元103用于确定待用以编码该视频编码块的帧内预测模式;运动补偿单元104和运动估计单元105用于执行所接收的视频编码块相对于一或多个参考帧中的一或多个块的帧间预测编码以提供时间预测信息;由运动估计单元105执行的运动估计为产生运动向量的过程,所述运动向量可以估计该视频编码块的运动,然后由运动补偿单元104基于由运动估计单元105所确定的运动向量执行运动补偿;在确定帧内预测模式之后,帧内预测单元103还用于将所选择的帧内预测数据提供到编码单元109,而且运动估计单元105将所计算确定的运动向量数据也发送到编码单元109;此外,反变换与反量化单元106是用于该视频编码块的重构建,在像素域中重构建残差块,该重构建残差块通过滤波器控制分析单元107和滤波单元108去除方块效应伪影,然后将该重构残差块添加到解码图像缓存单元110的帧中的一个预测性块,用以产生经重构建的视频编码块;编码单元109是用于编码各种编码参数及量化后的变换系数,在基于CABAC的编码算法中,上下文内容可基于相邻编码块,可用于编码指示所确定的帧内预测模式的信息,输出该视频信号的码流;而解码图像缓存单元110是用于存放重构建的视频编码块,用于预测参考。随着视频图像编码的进行,会不断生成新的重构建的视频编码块,这些重构建的视频编码块都会被存放在解码图像缓存单元110中。Referring to FIG. 3A , it shows a schematic diagram of a detailed framework of a video coding system provided by an embodiment of the present application. As shown in FIG. 3A, the video coding system 10 includes a transform and quantization unit 101, an intra-frame estimation unit 102, an intra-frame prediction unit 103, a motion compensation unit 104, a motion estimation unit 105, an inverse transform and inverse quantization unit 106, a filter Control the analysis unit 107, the filtering unit 108, the encoding unit 109, the decoded image buffering unit 110, etc., wherein the filtering unit 108 can implement DBF filtering/SAO filtering/ALF filtering, and the encoding unit 109 can implement header information encoding and context-based adaptation Binary arithmetic coding (Context-based Adaptive Binary Arithmatic Coding, CABAC). For the input original video signal, a video coding block can be obtained by dividing the coding tree unit (Coding Tree Unit, CTU), and then the residual pixel information obtained after intra-frame or inter-frame prediction is transformed and quantized by the quantization unit 101. The video coding block is transformed, including transforming residual information from the pixel domain to the transform domain, and quantizing the resulting transform coefficients to further reduce the bit rate; the intra-frame estimation unit 102 and the intra-frame prediction unit 103 are used for Intra prediction is performed on the video coding block; specifically, the intra prediction unit 102 and the intra prediction unit 103 are used to determine the intra prediction mode to be used to encode the video coding block; the motion compensation unit 104 and the motion estimation unit 105 is used to perform inter-predictive encoding of the received video encoding 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 to generate a motion vector. process, the motion vector can estimate the motion of the video coding block, and then the motion compensation unit 104 performs motion compensation based on the motion vector determined by the motion estimation unit 105; after determining the intra prediction mode, the intra prediction unit 103 also For providing the selected intra prediction data to the encoding unit 109, and the motion estimation unit 105 also sends the calculated motion vector data to the encoding unit 109; in addition, the inverse transform and inverse quantization unit 106 is used for the video Reconstruction of the coding block, reconstructing the residual block in the pixel domain, the reconstructed residual block removing the blocking artifacts by the filter control analysis unit 107 and the filtering unit 108, and then adding the reconstructed residual block to the decoding A predictive block in the frame of the image buffer unit 110 is used to generate a reconstructed video coding block; the coding unit 109 is used for coding various coding parameters and quantized transform coefficients. In the CABAC-based coding algorithm, The context content can be based on adjacent coding blocks, and can be used to encode information indicating the determined intra-frame prediction mode, and output a code stream of the video signal; and the decoded image buffer unit 110 is used to store the reconstructed video coding blocks, for Forecast reference. As the video image coding proceeds, new reconstructed video coding blocks are continuously generated, and these reconstructed video coding blocks are all stored in the decoded image buffer unit 110 .
参见图3B,其示出了本申请实施例提供的一种视频解码系统的详细框架示意图。如图3B所示,该视频解码系统20包括解码单元201、反变换与反量化单元202、帧内预测单元203、运动补偿单元204、滤波单元205和解码图像缓存单元206等,其中,解码单元201可以实现头信息解码以及CABAC解码,滤波单元205可以实现DBF滤波/SAO滤波/ALF滤波。输入的视频信号经过图3A的编码处理之后,输出该视频信号的码流;该码流输入视频解码系统20中,首先经过解码单元201,用于得到解码后的变换系数;针对该变换系数通过反变换与反量化单元202进行处理,以便在像素域中产生残差块;帧内预测单元203可用于基于所确定的帧内预测模式和来自当前帧或图片的先前经解码块的数据而产生当前视频解码块的预测数据;运动补偿单元204是通过剖析运动向量和其他关联语法元素来确定用于视频解码块的预测信息,并使用该预测信息以产生正被解码的视频解码块的预测性块;通过对来自反变换与反量化单元202的残差块与由帧内预测单元203或运动补偿单元204产生的对应预测性块进行求和,而形成解码的视频块;该解码的视频信号通过滤波单元205以便去除方块效应伪影,可以改善视频质量;然后将经解码的视频块存储于解码图像缓存单元206中,解码图像缓存单元206存储用于后续帧内预测或运动补偿的参考图像,同时也用于视频信号的输出,即得到了所恢复的原始视频信号。Referring to FIG. 3B , it shows a schematic diagram of a detailed framework of a video decoding system provided by an embodiment of the present application. As shown in FIG. 3B, the video decoding system 20 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, 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 DBF filtering/SAO filtering/ALF filtering. After the input video signal is subjected to the encoding process of FIG. 3A, the code stream of the video signal is output; the code stream is input into the video decoding system 20, and firstly passes through the decoding unit 201 to obtain the decoded transform coefficient; Inverse transform and inverse quantization unit 202 processes to generate residual blocks in the pixel domain; intra prediction unit 203 may be used to generate based on the determined intra prediction mode and data from previously decoded blocks of the current frame or picture Prediction data for the current video decoding block; motion compensation unit 204 determines prediction information for the video decoding block by parsing the motion vector and other associated syntax elements, and uses the prediction information to generate predictive information for the video decoding block being decoded block; a decoded video block is formed by summing the residual block from inverse transform and inverse quantization unit 202 and the corresponding predictive block produced by intra prediction unit 203 or motion compensation unit 204; the decoded video signal Video quality may be improved by filtering unit 205 in order to remove blocking artifacts; decoded video blocks are then stored in decoded image buffer unit 206, which stores reference images for subsequent intra prediction or motion compensation , and is also used for the output of the video signal, that is, the restored original video signal is obtained.
需要说明的是,本申请实施例提供的方法,可以应用在如图3A所示的滤波单元108部分(用黑色加粗方框表示),也可以应用在如图3B所示的滤波单元205部分(用黑色加粗方框表示)。也就是说,本申请实施例中的方法,既可以应用于视频编码系统(简称为“编码器”),也可以应用于视频解码系统(简称为“解码器”),甚至还可以同时应用于视频编码系统和视频解码系统,但是这里不作任何限定。It should be noted that the methods provided by the embodiments of the present application may be applied to the filtering unit 108 shown in FIG. 3A (represented by a bold black box), and may also be applied to the filtering unit 205 shown in FIG. 3B . (indicated by a bold black box). That is to say, the methods in the embodiments of the present application can be applied to both a video encoding system (referred to as an "encoder"), a video decoding system (referred to as a "decoder" for short), or even simultaneously. Video encoding system and video decoding system, but no limitation is made here.
还需要说明的是,当本申请实施例应用于编码器时,“当前块”具体是指视频图像中的当前待编码的块(也可以简称为“编码块”);当本申请实施例应用于解码器时,“当前块”具体是指视频图像中的当前待解码的块(也可以简称为“解码块”)。It should also be noted that when the embodiments of the present application are applied to the encoder, the "current block" specifically refers to the block currently to be encoded in the video image (may also be referred to as "encoding blocks" for short); when the embodiments of the present application apply In the case of a decoder, the "current block" specifically refers to the block to be decoded currently in the video image (it may also be referred to as a "decoded block" for short).
在本申请的一实施例中,参见图4,其示出了本申请实施例提供的一种解码方法的流程示意图。如图4所示,该方法可以包括:In an embodiment of the present application, refer to FIG. 4 , which shows a schematic flowchart of a decoding method provided by an embodiment of the present application. As shown in Figure 4, the method may include:
S401:解析码流,确定至少一个语法元素标识信息的取值。S401: Parse the code stream, and determine the value of at least one syntax element identification information.
需要说明的是,视频图像可以划分为多个图像块,每个当前待解码的图像块可以称为解码块。这里,每个解码块可以包括第一图像分量、第二图像分量和第三图像分量;而当前块为视频图像中当前待进行第一图像分量、第二图像分量或者第三图像分量环路滤波处理的解码块。It should be noted that a video image may be divided into multiple image blocks, and each image block to be decoded currently may be called a decoding block. Here, each decoding block may include a first image component, a second image component, and a third image component; and the current block is the first image component, the second image component, or the third image component loop filtering in the video image currently to be performed Processed decoded blocks.
在这里,针对第一图像分量、第二图像分量和第三图像分量,从颜色划分角度,本申请实施例可以将其划分为亮度分量和色度分量等两种颜色分量类型。在这种情况下,如果当前块进行亮度分量的预测、反变换与反量化、环路滤波等操作,那么当前块也可以称为亮度块;或者,如果当前块进行色度分量的预测、反变换与反量化、环路滤波等操作,那么当前块也可以称为色度块。Here, for the first image component, the second image component, and the third image component, from the perspective of color division, this embodiment of the present application may divide them into two types of color components, such as luminance component and chrominance component. In this case, if the current block performs operations such as prediction, inverse transformation and inverse quantization, and loop filtering of luminance components, the current block can also be called a luminance block; Transform and inverse quantization, loop filtering and other operations, then the current block can also be called a chroma block.
还需要说明的是,在解码器侧,本申请实施例具体提供了一种环路滤波方法,该环路滤波方法应用在如图3B所示的滤波单元205部分。在这里,滤波单元205可以包括去块滤波器(LBF)、样值自适应补偿滤波器(SAO)、基于残差神经网络的环路滤波器(CNNLF)和自适应修正滤波器(ALF),而本申请实施例所述的环路滤波方法具体应用在CNNLF和ALF之间,以便能够对经过CNNLF滤波处理后的当前块中每一个像素值进行最优的选择。It should also be noted that, on the decoder side, an embodiment of the present application specifically provides a loop filtering method, and the loop filtering method is applied to the part of the filtering unit 205 as shown in FIG. 3B . Here, the filtering unit 205 may include a deblocking filter (LBF), a sample adaptive compensation filter (SAO), a residual neural network-based loop filter (CNNLF), and an adaptive correction filter (ALF), The loop filtering method described in the embodiment of the present application is specifically applied between CNNLF and ALF, so that each pixel value in the current block after being filtered by CNNLF can be optimally selected.
可以理解,在一种具体的示例中,CNNLF对于亮度分量和色度分量分别设计了不同的网络结构,具体参见图5A和图5B。It can be understood that, in a specific example, CNNLF designs different network structures for the luminance component and the chrominance component, respectively, see FIG. 5A and FIG. 5B for details.
对于亮度分量,如图5A所示,整个网络结构可以由卷积层、激活层、残差块、跳转连接层等部分组成。这里,卷积层的卷积核可以为3×3,即可以用3×3Conv表示;激活层可以为线性激活函数,即可以用线性整流函数(Rectified Linear Unit,ReLU)表示,又可称为修正线性单元,是一种人工神经网络中常用的激活函数,通常指代以斜坡函数及其变种为代表的非线性函数。残差块(ResBlock)的网络结构如图6中的虚线框所示,可以由卷积层(Conv)、激活层(ReLU)和跳转连接层等组成。在网络结构中,跳转连接层(Concat)是指网络结构中所包括的一条从输入到输出的全局跳转连接,能够使网络能够专注于学习残差,加速了网络的收敛过程。For the luminance component, as shown in Figure 5A, the entire network structure can be composed of convolutional layers, activation layers, residual blocks, skip connection layers and other parts. Here, the convolution kernel of the convolution layer can be 3×3, that is, it can be represented by 3×3Conv; the activation layer can be a linear activation function, that is, it can be represented by a linear rectification function (Rectified Linear Unit, ReLU), also known as Modified linear unit is an activation function commonly used in artificial neural networks, usually referring to nonlinear functions represented by ramp functions and their variants. The network structure of the residual block (ResBlock) is shown in the dotted box in Figure 6, which can be composed of a convolution layer (Conv), an activation layer (ReLU), and a jump connection layer. In the network structure, the jump connection layer (Concat) refers to a global jump connection from input to output included in the network structure, which enables the network to focus on learning residuals and accelerates the convergence process of the network.
对于色度分量,如图5B所示,这里引入了亮度分量作为输入之一来指导色度分量的滤波,整个网络结构可以由卷积层、激活层、残差块、池化层、跳转连接层等部分组成。由于分辨率的不一致性,色度分量首先需要进行上采样。为了避免在上采样过程中引入其他噪声,可以通过直接拷贝邻近像素来完成分辨率的扩大,以得到放大色度帧(Enlarged chroma frame)。另外,在网络结构的末端,还使用了池化层(如2×2AvgPool)来完成色度分量的下采样。具体地,在HPM-ModAI的应用中,亮度分量网络的残差块数量可设置为N=20,色度分量网络的残差块数量可设置为N=10。For the chrominance component, as shown in Figure 5B, the luma component is introduced as one of the inputs to guide the filtering of the chrominance component. The entire network structure can be composed of convolutional layers, activation layers, residual blocks, pooling layers, jumps connection layer and other parts. Due to resolution inconsistencies, the chroma components first need to be upsampled. To avoid introducing additional noise during upsampling, resolution enlargement can be accomplished by directly copying adjacent pixels to obtain an Enlarged chroma frame. In addition, at the end of the network structure, a pooling layer (such as 2×2AvgPool) is also used to complete the downsampling of the chroma components. Specifically, in the application of HPM-ModAI, the number of residual blocks of the luma component network can be set to N=20, and the number of residual blocks of the chroma component network can be set to N=10.
在这里,CNNLF的使用可以包含离线训练和推理测试两个阶段。其中,在离线训练阶段,可以离线的训练了4个I帧亮度分量模型,4个非I帧亮度分量模型,4个色度U分量模型,4个色度V分量模型等共16种模型。具体地,使用预设图像数据集(例如DIV2K,该数据集有1000张高清图(2K分辨率),其中,800张作为训练,100张作为验证,100张作为测试),将图像从RGB转换成YUV4:2:0格式的单帧视频序列,作为标签数据。然后使用HPM在All Intra配置下对序列进行编码,关闭DBF,SAO和ALF等传统滤波器,量化步长设置为27到50。对于编码得到的重建序列,按照QP 27~31、32~37、38~44、45~50为范围划分为4个区间,切割为128×128的图像块作为训练数据,分别训练了4种I帧亮度分量模型,4种色度U分量模型,4种色度V分量模型。进一步地,使用预设视频数据集(例如BVI-DVC),使用HPM-ModAI在Random Access配置下编码,关闭DBF,SAO和ALF等传统滤波器,并打开I帧的CNNLF,收集编码重建的非I帧数据,分别训练了4种非I帧亮度分量模型。Here, the use of CNNLF can include two stages of offline training and inference testing. Among them, in the offline training stage, 4 I-frame luminance component models, 4 non-I-frame luminance component models, 4 chrominance U component models, and 4 chrominance V component models can be trained offline, a total of 16 models. Specifically, using a preset image dataset (such as DIV2K, which has 1000 high-definition images (2K resolution), of which 800 are for training, 100 for validation, and 100 for testing), images are converted from RGB A single-frame video sequence in YUV4:2:0 format is used as tag data. The sequence was then encoded using HPM in the All Intra configuration, with traditional filters such as DBF, SAO and ALF turned off, and the quantization step size was set from 27 to 50. For the reconstructed sequence obtained by encoding, it is divided into 4 intervals according to the range of QP 27~31, 32~37, 38~44, 45~50, and is cut into 128×128 image blocks as training data, and 4 kinds of I Frame luminance component model, 4 chrominance U component models, 4 chrominance V component models. Further, using a preset video dataset (e.g. BVI-DVC), encoding with HPM-ModAI under Random Access configuration, turning off traditional filters such as DBF, SAO and ALF, and turning on CNNLF for I-frames, collecting non-coding reconstructed images. For I-frame data, four non-I-frame luminance component models were trained.
在推理测试阶段,HPM-ModAI为亮度分量设置了开关形式的帧级标志位与CTU级标志位以控制是否打开CNNLF,而为色度分量设置了开关形式的帧级标志位以控制是否打开CNNLF。在这里,标志位通常可以用flag表示。另外,帧级标志位由式(1)确定,其中,D=D net-D rec表示CNNLF处理后减少的失真(D net为滤波后的失真,D rec为滤波前的失真),R表示当前帧的CTU个数,λ与自适应修正滤波器的λ保持一致。当RDcost为负时,打开帧级标志位,否则关闭帧级标志位。 In the inference test phase, HPM-ModAI sets frame-level flags and CTU-level flags in the form of switches for the luminance component to control whether to turn on CNNLF, and sets the frame-level flags in the form of switches for the chroma components to control whether to turn on CNNLF. . Here, the flag bit can usually be represented by flag. In addition, the frame-level flag bit is determined by equation (1), where D=D net -D rec represents the distortion reduced after CNNLF processing (D net is the distortion after filtering, D rec is the distortion before filtering), R represents the current The number of CTUs in the frame, λ is consistent with the λ of the adaptive correction filter. When RDcost is negative, the frame-level flag is turned on, otherwise the frame-level flag is turned off.
RDcost=D+λ*R        (1)RDcost=D+λ*R (1)
当帧级标志位打开时,还需要进一步通过率失真代价方式决策每个CTU是否打开CNNLF。这里,设置了CTU级标志位以控制是否打开CNNLF。具体地,CTU级标志位由式(2)确定。When the frame-level flag is turned on, it is necessary to further decide whether to turn on CNNLF for each CTU by means of rate-distortion cost. Here, the CTU level flag is set to control whether CNNLF is turned on. Specifically, the CTU-level flag bit is determined by equation (2).
RDcost=D         (2)RDcost=D (2)
也就是说,在AVS3的HPM-ModAI中,当通过率失真代价方式确定使用CNNLF时,当前CTU的重建像素值将会被更新为经过CNNLF处理后的像素值。这时候CNNLF标志位打开,则说明当前CTU经过CNNLF处理后与原始CTU的均方误差相比未经过CNNLF之前会变小,但是整个CTU的失真变 小并不意味着该CTU中的每个像素值的失真都会变小,使得编码性能的提升受限。That is to say, in HPM-ModAI of AVS3, when CNNLF is determined to be used by the rate-distortion cost method, the reconstructed pixel value of the current CTU will be updated to the pixel value processed by CNNLF. At this time, the CNNLF flag is turned on, which means that the mean square error of the current CTU after CNNLF processing will be smaller than that of the original CTU before CNNLF, but the smaller distortion of the entire CTU does not mean that each pixel in the CTU The distortion of the value will become smaller, so that the improvement of encoding performance is limited.
为了进一步提升编码性能,本申请实施例提供了一种基于深度学习的权重矩阵的环路滤波方法,用于对CNNLF的输出进行加权,使得CNNLF的输出更加接近于原始图像。如图7所示,在图2的基础上进行优化,与图2相比,环路滤波器除了包括DBF、SAO、CNNLF和ALF之外,还可以包括权重矩阵模块(Weighting Matrix),且权重矩阵模块位于CNNLF滤波和ALF滤波之间。另外,权重矩阵模块的使用不依赖于DBF、SAO、CNNLF和ALF的标志位,只是在位置上置于CNNLF之后,ALF之前。In order to further improve the coding performance, an embodiment of the present application provides a deep learning-based weight matrix in-loop filtering method for weighting the output of the CNNLF, so that the output of the CNNLF is closer to the original image. As shown in Figure 7, optimization is performed on the basis of Figure 2. Compared with Figure 2, in addition to DBF, SAO, CNNLF and ALF, the loop filter can also include a weighting matrix module (Weighting Matrix), and the weights The matrix module is located between CNNLF filtering and ALF filtering. In addition, the use of the weight matrix module does not depend on the flag bits of DBF, SAO, CNNLF and ALF, but only after CNNLF and before ALF in position.
在这里,为了方便解码器能够确定是否使用本申请实施例的环路滤波方法(即权重矩阵模块是否使能),可以设置一个第一语法元素标识信息,以指示当前的视频序列是否使用本申请实施例的环路滤波方法。Here, in order to facilitate the decoder to determine whether to use the loop filtering method of the embodiment of the present application (that is, whether the weight matrix module is enabled), a first syntax element identification information may be set to indicate whether the current video sequence uses the present application. The loop filtering method of an embodiment.
换句话说,对于解码获得的至少一个语法元素的标识信息至少包括有第一语法元素标识信息。在一些实施例中,所述解析码流,确定至少一个语法元素的标识信息的取值,可以包括:In other words, the identification information of the at least one syntax element obtained by decoding at least includes the identification information of the first syntax element. In some embodiments, the parsing the code stream and determining the value of the identification information of at least one syntax element may include:
解析码流,确定第一语法元素标识信息的取值;其中,所述第一语法元素标识信息用于指示视频序列是否使用权重矩阵进行滤波处理。The code stream is parsed, and the value of the first syntax element identification information is determined; wherein, the first syntax element identification information is used to indicate whether the video sequence is filtered by using the weight matrix.
进一步地,在一些实施例中,该方法还可以包括:Further, in some embodiments, the method may also include:
若第一语法元素标识信息的取值为第一值,则确定第一语法元素标识信息指示视频序列使用权重矩阵进行滤波处理;或者,If the value of the first syntax element identification information is the first value, it is determined that the first syntax element identification information indicates that the video sequence is filtered by using the weight matrix; or,
若第一语法元素标识信息的取值为第二值,则确定第一语法元素标识信息指示视频序列不使用权重矩阵进行滤波处理。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 the video sequence is not filtered using the weight matrix.
在这里,第一值和第二值不同,而且第一值和第二值可以是参数形式,也可以是数字形式。具体地,第一语法元素标识信息可以是写入在概述(profile)中的参数,也可以是一个标志(flag)的取值,本申请实施例对此不作任何限定。Here, the first value and the second value are different, and the first value and the second value may be in the form of parameters or in the form of numbers. Specifically, the first syntax element identification information may be a parameter written in a profile (profile), or may be a value of a flag (flag), which is not limited in this embodiment of the present application.
以第一语法元素标识信息为一个flag为例,这时候对于第一值和第二值而言,第一值可以设置为1,第二值可以设置为0;或者,第一值还可以设置为true,第二值还可以设置为false;或者,第一值还可以设置为0,第二值还可以设置为1;或者,第一值还可以设置为false,第二值还可以设置为true。示例性地,对于flag而言,一般情况下,第一值可以为1,第二值可以为0,但是并不作任何限定。Taking the first syntax element identification information as a flag as an example, at this time, 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; alternatively, the first value can also be set is true, the second value can also be set to false; alternatively, the first value can also be set to 0, and the second value can also be set to 1; alternatively, the first value can also be set to false, and the second value can also be set to true. Exemplarily, for flag, in general, the first value may be 1, and the second value may be 0, but no limitation is imposed.
还需要说明的是,视频序列包括至少一个帧,这至少一个帧可以包括有当前帧。在这里,当视频序列使能使用本申请实施例的环路滤波方法时,即确定该视频序列使能权重矩阵模块,那么本申请实施例还需要进一步判断视频序列内的当前帧是否使用权重矩阵进行滤波处理,即还需要设置一个第二语法元素标识信息。It should also be noted that the video sequence includes at least one frame, and the at least one frame may include the current frame. Here, when the video sequence is enabled to use the loop filtering method of the embodiment of the present application, it is determined that the weight matrix module is enabled for the video sequence, then the embodiment of the present application needs to further determine whether the current frame in the video sequence uses the weight matrix For filtering processing, it is also necessary to set a second syntax element identification information.
也就是说,在一些实施例中,所述解析码流,确定至少一个语法元素的标识信息,还可以包括:That is, in some embodiments, the parsing the code stream and determining the identification information of at least one syntax element may further include:
解析码流,确定第二语法元素标识信息的取值;其中,第二语法元素标识信息用于指示当前帧是否使用权重矩阵进行滤波处理。The code stream is parsed, and the value of the second syntax element identification information is determined; wherein, the second syntax element identification information is used to indicate whether the current frame uses the weight matrix for filtering processing.
在一种具体的示例中,所述解析码流,确定至少一个语法元素的标识信息,可以包括:In a specific example, the parsing the code stream and determining the identification information of at least one syntax element may include:
解析码流,确定第一语法元素标识信息的取值;Parse the code stream, and determine the value of the identification information of the first syntax element;
当第一语法元素标识信息指示视频序列使用权重矩阵进行滤波处理时,解析码流,确定第二语法元素标识信息的取值。When the first syntax element identification information indicates that the video sequence is filtered by using the weight matrix, the code stream is parsed to determine the value of the second syntax element identification information.
也就是说,这至少一个语法元素标识信息至少可以包括第一语法元素标识信息和第二语法元素标识信息。这里,对于第二语法元素标识信息而言,根据当前帧的颜色分量类型的不同,第二语法元素标识信息代表的含义不同。另外,不同的颜色分量类型,权重矩阵也是不同的,比如亮度分量对应的权重矩阵可称为亮度权重矩阵,色度分量对应的权重矩阵可称为色度权重矩阵。具体地,在一些实施例中,所述解析码流,确定第二语法元素标识信息,可以包括:That is, the at least one syntax element identification information may include at least the first syntax element identification information and the second syntax element identification information. Here, for the second syntax element identification information, the meanings represented by the second syntax element identification information are different according to different types of color components of the current frame. In addition, different color component types have different weight matrices. For example, a weight matrix corresponding to a luminance component may be called a luminance weight matrix, and a weight matrix corresponding to a chrominance component may be called a chrominance weight matrix. Specifically, in some embodiments, the parsing the code stream and determining the identification information of the second syntax element may include:
当当前帧的颜色分量类型为亮度分量时,确定第二语法元素标识信息为第一亮度语法元素标识信息,第一亮度语法元素标识信息用于指示当前帧的亮度分量是否使用亮度权重矩阵进行滤波处理;或者,When the color component type of the current frame is a luminance component, it is determined that the second syntax element identification information is the first luminance syntax element identification information, and the first luminance syntax element identification information is used to indicate whether the luminance component of the current frame is filtered using the luminance weight matrix processing; or,
当当前帧的颜色分量类型为色度分量时,确定第二语法元素标识信息为色度语法元素标识信息,色度语法元素标识信息用于指示当前帧的色度分量是否使用色度权重矩阵进行滤波处理。When the color component type of the current frame is a chroma component, it is determined that the second syntax element identification information is the chroma syntax element identification information, and the chroma syntax element identification information is used to indicate whether the chroma components of the current frame are processed using a chroma weight matrix. filter processing.
在本申请实施例中,颜色分量类型可以包括亮度分量和色度分量。如果颜色分量类型为亮度分量,那么这时候第二语法元素标识信息可以称为第一亮度语法元素标识信息,以指示当前帧的亮度分量是否使用亮度权重矩阵进行滤波处理。如果颜色分量类型为亮度分量,那么这时候第二语法元素标识信息可以称为第一亮度语法元素标识信息,以指示当前帧的亮度分量是否使用色度权重矩阵进行滤波处理。In this embodiment of the present application, the color component types may include luminance components and chrominance components. If the color component type is a luminance component, then the second syntax element identification information may be referred to as the first luminance syntax element identification information at this time, to indicate whether the luminance component of the current frame is filtered using the luminance weight matrix. If the color component type is a luma component, then the second syntax element identification information may be referred to as the first luma syntax element identification information at this time, to indicate whether the luma component of the current frame is filtered using the chrominance weight matrix.
S402:当至少一个语法元素标识信息指示当前帧或当前块使用权重矩阵进行滤波处理时,确定当前块的权重矩阵网络模型,并根据权重矩阵网络模型确定当前块的权重矩阵。S402: When at least one syntax element identification information indicates that the current frame or the current block uses the weight matrix for filtering processing, determine the weight matrix network model of the current block, and determine the weight matrix of the current block according to the weight matrix network model.
需要说明的是,本申请实施例所述的至少一个语法元素标识信息并不局限于第一语法元素标识信息 和第二语法元素标识信息,甚至还就可以包括其他语法元素标识信息,这里不作任何限定。It should be noted that the at least one syntax element identification information described in the embodiments of the present application is not limited to the first syntax element identification information and the second syntax element identification information, and may even include other syntax element identification information, and no limited.
还需要说明的是,当前帧进行块划分操作后,可以得到至少一个块,这至少一个块中包括有当前块。在这里,如果当前帧使用权重矩阵进行滤波处理,并不代表当前帧内的每一个块都使用权重矩阵进行滤波处理,还可能涉及到CTU级语法元素标识信息,以确定当前块是否使用权重矩阵进行滤波处理。下面将以亮度分量和色度分量这两种颜色分量类型为例分别进行描述。It should also be noted that, after the current frame is divided into blocks, at least one block can be obtained, and the at least one block includes the current block. Here, if the current frame uses the weight matrix for filtering processing, it does not mean that every block in the current frame uses the weight matrix for filtering processing, and may also involve CTU-level syntax element identification information to determine whether the current block uses the weight matrix. filter processing. The following will take the two types of color components, the luminance component and the chrominance component, as examples to describe respectively.
另外,针对不同的颜色分量类型,这里的权重矩阵网络模型也不相同。在本申请实施例中,假定亮度分量对应的权重矩阵网络模型可以称为亮度权重矩阵网络模型,色度分量对应的权重矩阵网络模型可以称为色度权重矩阵网络模型。In addition, for different color component types, the weight matrix network model here is also different. In this embodiment of the present application, it is assumed that the weight matrix network model corresponding to the luminance component may be referred to as a luminance weight matrix network model, and the weight matrix network model corresponding to the chrominance component may be referred to as a chrominance weight matrix network model.
在一种可能的实施方式中,当当前帧的颜色分量类型为亮度分量时,所述当至少一个语法元素的标识信息指示使用权重矩阵进行滤波处理时,确定当前块的权重矩阵网络模型,可以包括:In a possible implementation manner, when the color component type of the current frame is a luminance component, the weight matrix network model of the current block is determined when the identification information of at least one syntax element indicates that a weight matrix is used for filtering processing, which may be include:
当第一亮度语法元素标识信息指示当前帧的亮度分量使用亮度权重矩阵进行滤波处理时,解析码流,确定第二亮度语法元素标识信息的取值;When the first luminance syntax element identification information indicates that the luminance component of the current frame is filtered using the luminance weight matrix, the code stream is parsed, and the value of the second luminance syntax element identification information is determined;
当第二亮度语法元素标识信息指示当前块的亮度分量使用亮度权重矩阵进行滤波处理时,确定当前块的亮度权重矩阵网络模型。When the second luma syntax element identification information indicates that the luma component of the current block is filtered using the luma weight matrix, a luma weight matrix network model of the current block is determined.
需要说明的是,对于亮度分量,这里涉及到两种语法元素:帧级语法元素和CTU级语法元素。其中,帧级语法元素可以称为第一亮度语法元素标识信息,用luma_frame_weighting_matrix_flag表示;CTU级语法元素可以称为第二亮度语法元素标识信息,用luma_ctu_weighting_matrix_flag表示。It should be noted that, for the luma component, two syntax elements are involved here: frame-level syntax elements and CTU-level syntax elements. The frame-level syntax element may be referred to as the first luma syntax element identification information, represented by luma_frame_weighting_matrix_flag; the CTU-level syntax element may be referred to as the second luma syntax element identification information, represented by luma_ctu_weighting_matrix_flag.
还需要说明的是,对于亮度分量,本申请实施例还可以设置亮度帧级标志位和亮度CTU级标志位,通过控制是否打开权重矩阵模块,进而确定是否使用亮度权重矩阵进行滤波处理。因此,在一些实施例中,该方法还可以包括:设置亮度帧级标志位和亮度CTU级标志位。It should also be noted that, for the luminance component, the embodiments of the present application may also set the luminance frame-level flag and the luminance CTU-level flag, and determine whether to use the luminance weight matrix for filtering by controlling whether to open the weight matrix module. Therefore, in some embodiments, the method may further include: setting the luminance frame level flag and the luminance CTU level flag.
在这里,当前块位于当前帧内。其中,亮度帧级标志位可以用于控制当前帧的亮度分量是否使用亮度权重矩阵进行滤波处理,亮度CTU级标志位可以用于控制当前块的亮度分量是否使用亮度权重矩阵进行滤波处理。Here, the current block is within the current frame. Wherein, the luminance frame level flag can be used to control whether the luminance component of the current frame is filtered by the luminance weight matrix, and the luminance CTU level flag can be used to control whether the luminance component of the current block is filtered by the luminance weight matrix.
进一步地,对于第一亮度语法元素标识信息而言,在一些实施例中,该方法还可以包括:Further, for the first luma syntax element identification information, in some embodiments, the method may further include:
若第一亮度语法元素标识信息的取值为第一值,则确定第一亮度语法元素标识信息指示当前帧的亮度分量使用亮度权重矩阵进行滤波处理;或者,If the value of the first luma syntax element identification information is the first value, it is determined that the first luma syntax element identification information indicates that the luma component of the current frame is filtered by using the luma weight matrix; or,
若第一亮度语法元素标识信息的取值为第二值,则确定第一亮度语法元素标识信息指示当前帧的亮度分量不使用亮度权重矩阵进行滤波处理。If the value of the first luma syntax element identification information is the second value, it is determined that the first luma syntax element identification information indicates that the luma component of the current frame is not filtered using the luma weight matrix.
在一些实施例中,该方法还可以包括:In some embodiments, the method may also include:
若第一亮度语法元素标识信息的取值为第一值,则打开亮度帧级标志位;或者,If the value of the first luminance syntax element identification information is the first value, turn on the luminance frame level flag; or,
若第一亮度语法元素标识信息的取值为第二值,则关闭亮度帧级标志位。If the value of the first luminance syntax element identification information is the second value, the luminance frame level flag is turned off.
需要说明的是,第一值和第二值不同,而且第一值和第二值可以是参数形式,也可以是数字形式。具体地,无论是第一亮度语法元素标识信息还是第一亮度语法元素标识信息均可以是写入在概述(profile)中的参数,也可以是一个标志(flag)的取值,本申请实施例对此不作任何限定。It should be noted that the first value and the second value are different, and the first value and the second value may be in the form of parameters or in the form of numbers. Specifically, both the first luminance syntax element identification information and the first luminance syntax element identification information may be parameters written in the profile (profile), or may be the value of a flag (flag). This embodiment of the present application There is no restriction on this.
在本申请实施例中,以第一亮度语法元素标识信息为一flag信息为例,这时候对于第一值和第二值而言,第一值可以设置为1,第二值可以设置为0;或者,第一值还可以设置为true,第二值还可以设置为false;或者,第一值还可以设置为0,第二值还可以设置为1;或者,第一值还可以设置为false,第二值还可以设置为true。本申请实施例对此不作任何限定。In the embodiment of the present application, taking the first luminance syntax element identification information as a flag information as an example, at this time, for the first value and the second value, the first value may be set to 1, and the second value may be set to 0 ; Alternatively, the first value can also be set to true, and the second value can also be set to false; alternatively, the first value can also be set to 0, and the second value can also be set to 1; alternatively, the first value can also be set to false, the second value can also be set to true. This embodiment of the present application does not make any limitation on this.
以第一值为1,第二值为0为例,如果解码获得第一亮度语法元素标识信息的取值为1,那么可以打开亮度帧级标志位,即打开帧级权重矩阵模块,这时候可以确定当前帧的亮度分量使用亮度权重矩阵进行滤波处理。否则,如果第一亮度语法元素标识信息的取值为0,那么可以关闭亮度帧级标志位,即关闭帧级权重矩阵模块,这时候可以确定当前帧的亮度分量不使用亮度权重矩阵进行滤波处理,此时可以从视频序列中获取下一帧,将下一帧确定为当前帧,然后继续执行解析码流,确定第一亮度语法元素标识信息的取值的步骤。Taking the first value of 1 and the second value of 0 as an example, if the value of the first luminance syntax element identification information obtained by decoding is 1, then the luminance frame-level flag bit can be turned on, that is, the frame-level weight matrix module can be turned on. At this time It can be determined that the luminance component of the current frame is filtered using the luminance weight matrix. Otherwise, if the value of the first luminance syntax element identification information is 0, the luminance frame-level flag can be turned off, that is, the frame-level weight matrix module can be turned off. At this time, it can be determined that the luminance component of the current frame does not use the luminance weight matrix for filtering processing. , at this time, the next frame can be obtained from the video sequence, the next frame is determined as the current frame, and then the steps of parsing the code stream and determining the value of the identification information of the first luminance syntax element are continued.
进一步地,对于第二亮度语法元素标识信息而言,在一些实施例中,该方法还可以包括:Further, for the second luma syntax element identification information, in some embodiments, the method may further include:
若第二亮度语法元素标识信息的取值为第一值,则确定第二亮度语法元素标识信息指示当前块的亮度分量使用亮度权重矩阵进行滤波处理;或者,If the value of the second luma syntax element identification information is the first value, it is determined that the second luma syntax element identification information indicates that the luma component of the current block is filtered by using the luma weight matrix; or,
若第二亮度语法元素标识信息的取值为第二值,则确定第二亮度语法元素标识信息指示当前块的亮度分量不使用亮度权重矩阵进行滤波处理。If the value of the second luma syntax element identification information is the second value, it is determined that the second luma syntax element identification information indicates that the luma component of the current block is not filtered using the luma weight matrix.
在一些实施例中,该方法还可以包括:In some embodiments, the method may also include:
若第二亮度语法元素标识信息的取值为第一值,则打开亮度CTU级标志位;或者,If the value of the second luminance syntax element identification information is the first value, turn on the luminance CTU level flag; or,
若第二亮度语法元素标识信息的取值为第二值,则关闭亮度CTU级标志位。If the value of the second luma syntax element identification information is the second value, the luma CTU level flag is turned off.
需要说明的是,第一值和第二值不同。It should be noted that the first value and the second value are different.
在本申请实施例中,以第二亮度语法元素标识信息为另一flag信息为例,这时候对于第一值和第二值而言,第一值可以设置为1,第二值可以设置为0;或者,第一值还可以设置为true,第二值还可以设置为false;或者,第一值还可以设置为0,第二值还可以设置为1;或者,第一值还可以设置为false,第二值还可以设置为true。本申请实施例对此不作任何限定。In the embodiment of the present application, taking the second luminance syntax element identification information as another flag information as an example, at this time, for the first value and the second value, the first value may be set to 1, and the second value may be set to 0; alternatively, the first value can also be set to true, and the second value can also be set to false; alternatively, the first value can also be set to 0, and the second value can also be set to 1; alternatively, the first value can also be set to is false, the second value can also be set to true. This embodiment of the present application does not make any limitation on this.
以第一值为1,第二值为0为例,在解码获得第一亮度语法元素标识信息的取值为1的情况下,如果第二亮度语法元素标识信息的取值为1,那么可以打开亮度CTU级标志位,即打开CTU级权重矩阵模块,这时候可以确定当前块的亮度分量使用亮度权重矩阵进行滤波处理。否则,如果第二亮度语法元素标识信息的取值为0,那么可以关闭亮度CTU级标志位,即关闭该CTU级权重矩阵模块,这时候可以确定当前块的亮度分量不使用亮度权重矩阵进行滤波处理,此时可以从当前帧中获取下一个块,将下一个块确定为当前块,然后继续执行解析码流,确定第二亮度语法元素标识信息的取值的步骤,直至当前帧所包括的块全部处理完成,然后加载下一帧继续处理。Taking the first value of 1 and the second value of 0 as an example, in the case where the value of the first luminance syntax element identification information is 1 by decoding, if the value of the second luminance syntax element identification information is 1, then Turning on the luminance CTU level flag bit means turning on the CTU level weight matrix module. At this time, it can be determined that the luminance component of the current block is filtered by the luminance weight matrix. Otherwise, if the value of the second luminance syntax element identification information is 0, the luminance CTU level flag bit can be turned off, that is, the CTU level weight matrix module can be turned off. At this time, it can be determined that the luminance component of the current block does not use the luminance weight matrix for filtering Processing, at this time, the next block can be obtained from the current frame, the next block is determined as the current block, and then continue to perform the steps of parsing the code stream and determining the value of the identification information of the second luminance syntax element, until the current frame includes The chunks are all processed and the next frame is loaded to continue processing.
在另一种可能的实施方式中,当当前帧的颜色分量类型为色度分量时,所述当至少一个语法元素的标识信息指示使用权重矩阵进行滤波处理时,确定当前块的权重矩阵网络模型,可以包括:In another possible implementation, when the color component type of the current frame is a chrominance component, the weight matrix network model of the current block is determined when the identification information of the at least one syntax element indicates that a weight matrix is used for filtering processing , which can include:
当色度语法元素标识信息指示当前帧的色度分量使用色度权重矩阵进行滤波处理时,确定当前块的色度权重矩阵网络模型。When the chroma syntax element identification information indicates that the chroma components of the current frame are filtered using the chroma weight matrix, the chroma weight matrix network model of the current block is determined.
需要说明的是,对于色度分量,这里涉及到帧级语法元素。其中,帧级语法元素可以称为色度语法元素标识信息,用chroma_frame_weighting_matrix_flag表示。It should be noted that, for chroma components, frame-level syntax elements are involved here. The frame-level syntax element may be referred to as chroma syntax element identification information, which is represented by chroma_frame_weighting_matrix_flag.
还需要说明的是,由于考虑到编码性能和计算复杂度,如果色度语法元素标识信息指示当前帧的色度分量使用色度权重矩阵进行滤波处理,那么当前帧所包括的块都默认使用色度权重矩阵进行滤波处理;如果色度语法元素标识信息指示当前帧的色度分量不使用色度权重矩阵进行滤波处理,那么当前帧所包括的块都默认不使用色度权重矩阵进行滤波处理。因此,对于色度分量不再需要设置CTU级语法元素,同理也不需要设置CTU级标志位。换句话说,对于色度分量,本申请实施例可以只设置帧级标志位。因此,在一些实施例中,该方法还可以包括:设置色度帧级标志位。其中,色度帧级标志位可以用于控制当前帧的色度分量是否使用色度权重矩阵进行滤波处理。It should also be noted that, due to the consideration of coding performance and computational complexity, if the chroma syntax element identification information indicates that the chroma components of the current frame are filtered using the chroma weight matrix, then the blocks included in the current frame all use chroma by default. If the chroma syntax element identification information indicates that the chroma components of the current frame do not use the chroma weight matrix for filtering, then the blocks included in the current frame do not use the chroma weight matrix for filtering by default. Therefore, it is no longer necessary to set the CTU-level syntax element for the chroma components, and similarly, the CTU-level flag bit does not need to be set. In other words, for the chrominance component, only the frame-level flag bit may be set in this embodiment of the present application. Therefore, in some embodiments, the method may further include: setting a chroma frame level flag. The chrominance frame-level flag can be used to control whether the chrominance components of the current frame are filtered using the chrominance weight matrix.
进一步地,对于色度语法元素标识信息而言,在一些实施例中,该方法还可以包括:Further, for the chroma syntax element identification information, in some embodiments, the method may further include:
若色度语法元素标识信息的取值为第一值,则确定色度语法元素标识信息指示当前帧的色度分量使用色度权重矩阵进行滤波处理;或者,If the value of the chroma syntax element identification information is the first value, it is determined that the chroma syntax element identification information indicates that the chroma components of the current frame are filtered using the chroma weight matrix; or,
若色度语法元素标识信息的取值为第二值,则确定色度语法元素标识信息指示当前帧的色度分量不使用色度权重矩阵进行滤波处理。If the value of the chroma syntax element identification information is the second value, it is determined that the chroma syntax element identification information indicates that the chroma components of the current frame are not filtered using the chroma weight matrix.
在一些实施例中,该方法还可以包括:In some embodiments, the method may also include:
若色度语法元素标识信息的取值为第一值,则打开色度帧级标志位;或者,If the value of the chroma syntax element identification information is the first value, the chroma frame-level flag is turned on; or,
若色度语法元素标识信息的取值为第二值,则关闭色度帧级标志位。If the value of the chroma syntax element identification information is the second value, the chroma frame level flag is turned off.
需要说明的是,第一值和第二值不同,而且第一值和第二值可以是参数形式,也可以是数字形式。具体地,色度语法元素标识信息均可以是写入在概述(profile)中的参数,也可以是一个标志(flag)的取值,本申请实施例对此不作任何限定。It should be noted that the first value and the second value are different, and the first value and the second value may be in the form of parameters or in the form of numbers. Specifically, the chroma syntax element identification information may be a parameter written in a profile (profile), or may be a value of a flag (flag), which is not limited in this embodiment of the present application.
在本申请实施例中,以色度语法元素标识信息为又一flag信息为例,这时候对于第一值和第二值而言,第一值可以设置为1,第二值可以设置为0;或者,第一值还可以设置为true,第二值还可以设置为false;或者,第一值还可以设置为0,第二值还可以设置为1;或者,第一值还可以设置为false,第二值还可以设置为true。本申请实施例对此不作任何限定。In the embodiment of the present application, taking the chroma syntax element identification information as another flag information as an example, at this time, 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 ; Alternatively, the first value can also be set to true, and the second value can also be set to false; alternatively, the first value can also be set to 0, and the second value can also be set to 1; alternatively, the first value can also be set to false, the second value can also be set to true. This embodiment of the present application does not make any limitation on this.
以第一值为1,第二值为0为例,如果解码获得色度语法元素标识信息的取值为1,那么可以打开色度帧级标志位,即打开帧级权重矩阵模块,这时候可以确定当前帧的色度分量使用色度权重矩阵进行滤波处理,而且默认当前帧内每一个块的色度分量均使用色度权重矩阵进行滤波处理。否则,如果色度语法元素标识信息的取值为0,那么可以关闭色度帧级标志位,即关闭帧级权重矩阵模块,这时候可以确定当前帧的色度分量不使用色度权重矩阵进行滤波处理,此时可以从视频序列中获取下一帧,将下一帧确定为当前帧,然后继续执行解析码流,确定色度语法元素标识信息的取值的步骤。Taking the first value of 1 and the second value of 0 as an example, if the value of the chroma syntax element identification information obtained by decoding is 1, then the chroma frame-level flag bit can be turned on, that is, the frame-level weight matrix module can be turned on. At this time It can be determined that the chrominance components of the current frame are filtered using the chrominance weight matrix, and by default, the chrominance components of each block in the current frame are filtered using the chrominance weight matrix. Otherwise, if the value of the chroma syntax element identification information is 0, then the chroma frame-level flag bit can be turned off, that is, the frame-level weight matrix module can be turned off. At this time, it can be determined that the chroma components of the current frame do not use the chroma weight matrix. In the filtering process, the next frame can be obtained from the video sequence, the next frame is determined as the current frame, and then the steps of parsing the code stream and determining the value of the chroma syntax element identification information are continued.
还需要说明的是,如果确定出当前块的亮度分量使用色度权重矩阵进行滤波处理,那么还需确定当前块的亮度权重矩阵网络模型。在一些实施例中,所述确定当前块的亮度权重矩阵网络模型,可以包括:It should also be noted that, if it is determined that the luminance component of the current block is filtered using the chrominance weight matrix, then the network model of the luminance weight matrix of the current block needs to be determined. In some embodiments, the determining the luminance weight matrix network model of the current block may include:
在当前块的颜色分量类型为亮度分量的情况下,确定至少一个候选亮度权重矩阵网络模型;In the case that the color component type of the current block is a luminance component, determining at least one candidate luminance weight matrix network model;
确定当前块的量化参数,从至少一个候选亮度权重矩阵网络模型中选取量化参数对应的候选亮度权重矩阵网络模型;Determine the quantization parameter of the current block, and select a candidate brightness weight matrix network model corresponding to the quantization parameter from at least one candidate brightness weight matrix network model;
将所选取的候选亮度权重矩阵网络模型确定为当前块的亮度权重矩阵网络模型。The selected candidate luminance weight matrix network model is determined as the luminance weight matrix network model of the current block.
进一步地,在确定出当前块的色度分量使用权重矩阵进行滤波处理时,这时候需要确定当前块的色度权重矩阵网络模型。在一些实施例中,所述确定当前块的色度权重矩阵网络模型,可以包括:Further, when it is determined that the chrominance components of the current block are filtered by using the weight matrix, the chrominance weight matrix network model of the current block needs to be determined at this time. In some embodiments, the determining the chrominance weight matrix network model of the current block may include:
在当前块的颜色分量类型为色度分量的情况下,确定至少一个候选色度权重矩阵网络模型;In the case that the color component type of the current block is a chrominance component, determining at least one candidate chrominance weight matrix network model;
确定当前块的量化参数,从至少一个候选色度权重矩阵网络模型中选取量化参数对应的候选色度权重矩阵网络模型;Determine the quantization parameter of the current block, and select a candidate chroma weight matrix network model corresponding to the quantization parameter from at least one candidate chroma weight matrix network model;
将所选取的候选色度权重矩阵网络模型确定为当前块的色度权重矩阵网络模型。The selected candidate chroma weight matrix network model is determined as the chroma weight matrix network model of the current block.
需要说明的是,当前块的权重矩阵网络模型不仅和量化参数有关,而且还和颜色分量类型有关。其中,不同的颜色分量类型,对应有不同的权重矩阵网络模型,比如对于亮度分量来说,权重矩阵网络模型可以是与亮度分量相关的亮度权重矩阵网络模型;对于色度分量来说,权重矩阵网络模型可以是与色度分量相关的色度权重矩阵网络模型。It should be noted that the weight matrix network model of the current block is not only related to the quantization parameter, but also related to the color component type. Among them, different color component types correspond to different weight matrix network models. For example, for the luminance component, the weight matrix network model may be a luminance weight matrix network model related to the luminance component; for the chrominance component, the weight matrix The network model may be a chroma weight matrix network model associated with the chroma components.
还需要说明的是,根据不同的量化参数,比如QP的取值为27~31、32~37、38~44、45~50等,预先可以训练出至少一个候选亮度权重矩阵网络模型和至少一个候选色度权重矩阵网络模型。这样,在确定出当前块的量化参数之后,可以从至少一个候选亮度权重矩阵网络模型中选取出该量化参数对应的候选亮度权重矩阵网络模型,即当前块的亮度权重矩阵网络模型;也可以从至少一个候选色度权重矩阵网络模型中选取出该量化参数对应的候选色度权重矩阵网络模型,即当前块的色度权重矩阵网络模型。It should also be noted that, according to different quantization parameters, for example, the value of QP is 27-31, 32-37, 38-44, 45-50, etc., at least one candidate brightness weight matrix network model and at least one candidate brightness weight matrix network model can be trained in advance. Candidate chroma weight matrix network model. In this way, after the quantization parameter of the current block is determined, the candidate luminance weight matrix network model corresponding to the quantization parameter can be selected from at least one candidate luminance weight matrix network model, that is, the luminance weight matrix network model of the current block; The candidate chrominance weight matrix network model corresponding to the quantization parameter is selected from the at least one candidate chrominance weight matrix network model, that is, the chrominance weight matrix network model of the current block.
进一步地,对于至少一个候选亮度权重矩阵网络模型和至少一个候选色度权重矩阵网络模型的模型训练,在一些实施例中,该方法还可以包括:Further, for the model training of at least one candidate luminance weight matrix network model and at least one candidate chrominance weight matrix network model, in some embodiments, the method may further include:
确定至少一个训练样本,其中,训练样本是根据至少一种量化参数得到的;determining at least one training sample, wherein the training sample is obtained according to at least one quantization parameter;
利用至少一个训练样本的亮度分量对预设神经网络模型进行训练,得到至少一个候选亮度权重矩阵网络模型;Use the brightness component of at least one training sample to train the preset neural network model to obtain at least one candidate brightness weight matrix network model;
利用至少一个训练样本的色度分量对预设神经网络模型进行训练,得到至少一个候选色度权重矩阵网络模型;Use the chrominance component of at least one training sample to train the preset neural network model to obtain at least one candidate chrominance weight matrix network model;
其中,至少一个候选亮度权重矩阵网络模型与亮度分量和量化参数之间具有对应关系,至少一个候选色度权重矩阵网络模型与色度分量和量化参数之间具有对应关系。Wherein, at least one candidate luminance weight matrix network model has a correspondence relationship with luminance components and quantization parameters, and at least one candidate chrominance weight matrix network model has a correspondence relationship with chrominance components and quantization parameters.
在本申请实施例中,预设神经网络模型可以包括下述至少之一:至少一个卷积层、至少一个激活层和跳转连接层。In this embodiment of the present application, the preset neural network model may include at least one of the following: at least one convolution layer, at least one activation layer, and a jump connection layer.
也就是说,预设神经网络模型可以选择多层卷积神经网络,然后利用训练样本进行深度学习以得到权重矩阵网络模型,比如亮度权重矩阵网络模型或者色度权重矩阵网络模型。That is to say, the preset neural network model can select a multi-layer convolutional neural network, and then use the training samples to perform deep learning to obtain a weight matrix network model, such as a luminance weight matrix network model or a chrominance weight matrix network model.
需要说明的是,深度学习是机器学习的一种,而机器学习是实现人工智能的必经路径。深度学习的概念源于人工神经网络的研究,含多个隐藏层的多层感知器就是一种深度学习结构。深度学习可以通过组合低层特征形成更加抽象的高层表示属性类别或特征,以发现数据的分布式特征表示。在本申请实施例中,以卷积神经网络(Convolutional Neural Networks,CNN)为例,它是一类包含卷积计算且具有深度结构的前馈神经网络(Feedforward Neural Networks),是深度学习(Deep Learning)的代表算法之一。这里的预设神经网络模型可以是一种卷积神经网络结构。It should be noted that deep learning is a type of machine learning, and machine learning is the only way to realize artificial intelligence. The concept of deep learning originates from the study of artificial neural networks, and a multilayer perceptron with multiple hidden layers is a deep learning structure. Deep learning can form more abstract high-level representation attribute categories or features by combining low-level features to discover distributed feature representations of data. In the embodiments of this application, take Convolutional Neural Networks (CNN) as an example, which is a type of Feedforward Neural Networks (Feedforward Neural Networks) that includes convolutional computation and has a deep structure. Learning) is one of the representative algorithms. The preset neural network model here can be a convolutional neural network structure.
还需要说明的是,在本申请实施例中,无论是亮度权重矩阵网络模型还是色度权重矩阵网络模型,权重矩阵网络模型也可以看作是由多层卷积神经网络组成。具体地,权重矩阵网络模型也可以包括下述至少之一:至少一个卷积层、至少一个激活层和跳转连接层。It should also be noted that, in the embodiments of the present application, whether it is a luminance weight matrix network model or a chrominance weight matrix network model, the weight matrix network model can also be regarded as being composed of a multi-layer convolutional neural network. Specifically, the weight matrix network model may also include at least one of the following: at least one convolution layer, at least one activation layer, and a jump connection layer.
进一步地,在确定出权重矩阵网络模型之后,可以此确定出权重矩阵。在一些实施例中,所述根据权重矩阵网络模型确定当前块的权重矩阵,可以包括:Further, after the weight matrix network model is determined, the weight matrix can be determined accordingly. In some embodiments, the determining the weight matrix of the current block according to the weight matrix network model may include:
确定神经网络环路滤波器的输入重建图像块和输出重建图像块;Determine the input reconstructed image patch and the output reconstructed image patch of the neural network loop filter;
将输出重建图像块输入所述权重矩阵网络模型,得到所述当前块的权重矩阵。Input the output reconstructed image block into the weight matrix network model to obtain the weight matrix of the current block.
这里,神经网络环路滤波器具体是指前述的CNNLF。在确定出CNNLF的输入重建图像块和输出重建图像块之后,将输出重建图像块作为权重矩阵网络模型的输入,而权重矩阵网络模型的输出即为当前块的权重矩阵。Here, the neural network loop filter specifically refers to the aforementioned CNNLF. After determining the input reconstructed image block and output reconstructed image block of CNNLF, the output reconstructed image block is used as the input of the weight matrix network model, and the output of the weight matrix network model is the weight matrix of the current block.
S403:利用权重矩阵,确定当前块的目标重建图像块。S403: Using the weight matrix, determine the target reconstructed image block of the current block.
需要说明的是,在得到权重矩阵后,如果当前块使用权重矩阵进行滤波处理,那么这时候可以对CNNLF的输入和输出进行加权处理。It should be noted that, after obtaining the weight matrix, if the current block uses the weight matrix for filtering, then the input and output of CNNLF can be weighted at this time.
在一些实施例中,所述利用权重矩阵,确定当前块的目标重建图像块,可以包括:利用权重矩阵对输入重建图像块和输出重建图像块进行加权处理,得到所述目标重建图像块。In some embodiments, using the weight matrix to determine the target reconstructed image block of the current block may include: using the weight matrix to perform weighting processing on the input reconstructed image block and the output reconstructed image block to obtain the target reconstructed image block.
在一种具体的示例中,权重矩阵用Weighting Matrix表示,那么对于目标重建图像块而言,目标重建图像块=输出重建图像块×Weighting Matrix+输入重建图像块×(1-Weighting Matrix)。In a specific example, the weight matrix is represented by Weighting Matrix, then for the target reconstructed image block, the target reconstructed image block=output reconstructed image block×Weighting Matrix+input reconstructed image block×(1-Weighting Matrix).
这样,通过权重矩阵对神经网络环路滤波器的输入和输出进行加权,可以使得神经网络环路滤波器 的输出更加接近于原始图像。In this way, by weighting the input and output of the neural network loop filter through the weight matrix, the output of the neural network loop filter can be made closer to the original image.
还需要说明的是,根据颜色分量类型的不同,权重矩阵包括亮度权重矩阵和色度权重矩阵;这样,对于目标重建图像块来说,也可以包括亮度分量的目标重建图像块和色度分量的目标重建图像块。在一些实施例中,所述根据权重矩阵网络模型确定当前块的权重矩阵,可以包括:It should also be noted that, according to the different types of color components, the weight matrix includes a luminance weight matrix and a chrominance weight matrix; in this way, for the target reconstructed image block, the target reconstructed image block of the luminance component and the chrominance component can also be included. The target reconstructed image patch. In some embodiments, the determining the weight matrix of the current block according to the weight matrix network model may include:
当当前块的颜色分量类型为亮度分量时,利用亮度权重矩阵网络模型确定亮度权重矩阵;When the color component type of the current block is a luminance component, the luminance weight matrix is determined by using the luminance weight matrix network model;
当当前块的颜色分量类型为色度分量时,利用色度权重矩阵网络模型确定色度权重矩阵。When the color component type of the current block is a chrominance component, the chrominance weight matrix is determined by using the chrominance weight matrix network model.
在一种具体的示例中,当当前块的颜色分量类型为亮度分量时,所述利用亮度权重矩阵网络模型确定亮度权重矩阵,可以包括:In a specific example, when the color component type of the current block is a luminance component, the determining the luminance weight matrix by using the luminance weight matrix network model may include:
确定神经网络环路滤波器的输入亮度重建图像块和输出亮度重建图像块;Determine the input luminance reconstructed image block and the output luminance reconstructed image block of the neural network loop filter;
将输出亮度重建图像块输入亮度权重矩阵网络模型,得到亮度权重矩阵;Input the output brightness reconstruction image block into the brightness weight matrix network model to obtain the brightness weight matrix;
进一步地,所述利用权重矩阵,确定当前块的目标重建图像块,可以包括:Further, using the weight matrix to determine the target reconstructed image block of the current block may include:
利用亮度权重矩阵对输入亮度重建图像块和输出亮度重建图像块进行加权处理,得到当前块的亮度分量的目标重建图像块。The input luminance reconstructed image block and the output luminance reconstructed image block are weighted by the luminance weight matrix to obtain the target reconstructed image block of the luminance component of the current block.
在另一种具体的示例中,当当前块的颜色分量类型为色度分量时,所述利用色度权重矩阵网络模型确定色度权重矩阵,可以包括:In another specific example, when the color component type of the current block is a chrominance component, the determining the chrominance weight matrix by using the chrominance weight matrix network model may include:
确定神经网络环路滤波器的输入色度重建图像块和输出色度重建图像块;Determine the input chrominance reconstructed image block and the output chrominance reconstructed image block of the neural network loop filter;
将输出色度重建图像块输入色度权重矩阵网络模型,得到色度权重矩阵;Input the output chrominance reconstruction image block into the chrominance weight matrix network model to obtain the chrominance weight matrix;
进一步地,所述利用所述权重矩阵,确定当前块的目标重建图像块,可以包括:Further, using the weight matrix to determine the target reconstructed image block of the current block may include:
利用色度权重矩阵对输入色度重建图像块和输出色度重建图像块进行加权处理,得到当前块的色度分量的目标重建图像块。The input chrominance reconstructed image block and the output chrominance reconstructed image block are weighted by using the chrominance weight matrix to obtain the target reconstructed image block of the chrominance component of the current block.
需要说明的是,对于输入重建图像块,根据颜色分量类型的不同,可以是指输入亮度重建图像块,也可以是指输入色度重建图像块;对于输出重建图像块,根据颜色分量类型的不同,可以是指输出亮度重建图像块,也可以是指输出色度重建图像块。这样,根据输入亮度重建图像块和输出亮度重建图像块可以加权计算得到亮度分量的目标重建图像块;根据输入色度重建图像块和输出色度重建图像块可以加权计算得到色度分量的目标重建图像块。It should be noted that, for the input reconstructed image block, depending on the type of color components, it may refer to the input luminance reconstructed image block, or it may refer to the input chrominance reconstructed image block; for the output reconstructed image block, according to the different color component types , which can refer to the output luminance reconstructed image block or the output chrominance reconstructed image block. In this way, the target reconstructed image block of the luminance component can be obtained by weighted calculation according to the input luminance reconstructed image block and the output luminance reconstructed image block; image block.
还需要说明的是,对于输入重建图像块(包括输入亮度重建图像块或者输入色度重建图像块)来说,这里,输入重建图像块可以是经由去块滤波器和样值自适应补偿滤波器进行滤波处理后得到。It should also be noted that, for input reconstructed image blocks (including input luminance reconstructed image blocks or input chrominance reconstructed image blocks), here, the input reconstructed image blocks may be obtained through a deblocking filter and a sample adaptive compensation filter. obtained after filtering.
除此之外,在一些实施例中,该方法还可以包括:在确定出当前块的目标重建图像块之后,利用自适应修正滤波器继续对目标重建图像块进行滤波处理。Besides, in some embodiments, the method may further include: after the target reconstructed image block of the current block is determined, using an adaptive correction filter to continue filtering the target reconstructed image block.
也就是说,如果当前块使用权重矩阵进行滤波处理,那么自适应修正滤波器的输入是目标重建图像块;如果当前块不使用权重矩阵进行滤波处理,那么这时候不需要对神经网络环路滤波器的输出进行加权,即自适应修正滤波器的输入是输出重建图像块。That is to say, if the current block uses the weight matrix for filtering, the input of the adaptive correction filter is the target reconstructed image block; if the current block does not use the weight matrix for filtering, then there is no need to filter the neural network loop at this time. The output of the filter is weighted, that is, the input of the adaptive correction filter is the output reconstructed image block.
示例性地,参见图8,其示出了本申请实施例提供的一种权重矩阵网络模型的组成结构示意图。如图8所示,权重矩阵网络模型设置在权重矩阵模块中,权重矩阵网络模型可以由多层卷积神经网络组成,其网络结构可以由K层卷积层、J层激活层和L层跳转连接层组成;其中,K、J、L均为大于或等于1的整数。Exemplarily, see FIG. 8 , which shows a schematic diagram of the composition and structure of a weight matrix network model provided by an embodiment of the present application. As shown in Figure 8, the weight matrix network model is set in the weight matrix module. The weight matrix network model can be composed of multi-layer convolutional neural networks, and its network structure can be composed of K layers of convolution layers, J layers of activation layers and L layers of jumping layers It consists of a transfer connection layer; wherein, K, J, and L are all integers greater than or equal to 1.
在一种具体的示例中,K=5,J=4,L=1,但是并不作任何限定。In a specific example, K=5, J=4, L=1, but it does not make any limitation.
具体来讲,图8所示的网络结构包括有5层卷积层,除第三层卷积层外,每层卷积层后有激活层,该网络结构还包含第二层卷积层的输入到第三层卷积层的输出的跳转连接层。需要注意的是,激活层可以是线性激活函数,也可以是非线性激活函数等。Specifically, the network structure shown in Figure 8 includes five convolutional layers. Except for the third convolutional layer, each convolutional layer is followed by an activation layer. The network structure also includes the second convolutional layer. A skip connection layer that feeds into the output of the third convolutional layer. It should be noted that the activation layer can be a linear activation function or a nonlinear activation function, etc.
另外,该网络结构的输入为CNNLF的输出重建图像块(可以是输出亮度重建图像块或输出色度重建图像块),该网络结构的输出为权重矩阵,用于对CNNLF的输出重建图像块和CNNLF的输入重建图像块进行加权处理,具体如图9所示,其示出了一种权重矩阵网络模型的整体框架示例。从图9中可以看出,输入重建图像块可以是经由去块滤波器(DBF)和样值自适应补偿滤波器(SAO)进行滤波处理后得到的,而加权处理后的目标重建图像块还可以输入自适应修正滤波器(ALF)继续进行滤波处理。In addition, the input of the network structure is the output reconstructed image block of CNNLF (which can be the output luminance reconstructed image block or the output chrominance reconstructed image block), and the output of the network structure is a weight matrix, which is used to reconstruct the output image block of CNNLF and The input reconstructed image blocks of CNNLF are weighted, as shown in Figure 9, which shows an example of the overall framework of a weight matrix network model. As can be seen from Figure 9, the input reconstructed image block can be obtained after filtering through a deblocking filter (DBF) and a sample adaptive compensation filter (SAO), and the weighted target reconstructed image block is also The adaptive correction filter (ALF) can be input to continue the filtering process.
还需要注意的是,加权处理中的输入重建图像块,还可以是提取CNNLF的多个隐藏层特征图像块,并将其用于加权处理中;另外,CNNLF的输出重建图像块,还可以是使用其他高效的神经网络滤波器的输出图像块,本申请实施例不作任何限定。It should also be noted that the input reconstructed image block in the weighting process can also be extracted from multiple hidden layer feature image blocks of CNNLF and used in the weighting process; in addition, the output reconstructed image block of CNNLF can also be The output image blocks of other efficient neural network filters are not limited in this embodiment of the present application.
可以理解地,本申请实施例的技术方案作用在解码器的环路滤波模块中,其具体流程如下:It is understandable that the technical solutions of the embodiments of the present application act on the loop filtering module of the decoder, and the specific process is as follows:
解码器获取并解析码流,当解析到环路滤波模块时,按照预设的滤波器顺序进行处理。这里,预设的滤波器顺序为DBF滤波---->SAO滤波---->CNNLF滤波---->权重矩阵模块---->ALF滤波。当进入权重 矩阵模块时,The decoder obtains and parses the code stream, and when it is parsed into the loop filter module, it is processed according to the preset filter order. Here, the preset filter sequence is DBF filtering---->SAO filtering---->CNNLF filtering---->weight matrix module---->ALF filtering. When entering the weight matrix module,
(a)对于亮度分量,根据解码得到的luma_frame_weighting_matrix_flag确定当前帧是否使用权重矩阵模块进行处理。根据解码得到的luma_ctu_weighting_matrix_flag确定当前帧中的各个CTU是否使用权重矩阵模块进行处理。如果luma_frame_weighting_matrix_flag为“0”,则跳至(c)。否则,当luma_frame_weighting_matrix_flag为“1”时,如果luma_ctu_weighting_matrix_flag为“0”,则跳至(c);否则,当luma_ctu_weighting_matrix_flag为“1”时,这时候为当前帧的当前CTU使用权重矩阵模块进行处理;(a) For the luminance component, determine whether the current frame is processed using the weighting matrix module according to the decoded luma_frame_weighting_matrix_flag. Determine whether each CTU in the current frame uses the weighting matrix module for processing according to the decoded luma_ctu_weighting_matrix_flag. If luma_frame_weighting_matrix_flag is "0", skip to (c). Otherwise, when luma_frame_weighting_matrix_flag is "1", if luma_ctu_weighting_matrix_flag is "0", skip to (c); otherwise, when luma_ctu_weighting_matrix_flag is "1", use the weight matrix module for the current CTU of the current frame at this time;
(b)对于色度分量,根据解码得到的chroma_frame_weighting_matrix_flag确定当前帧是否使用权重矩阵模块进行处理。如果chroma_frame_weighting_matrix_flag为“0”,则跳至(c);否则,当chroma_frame_weighting_matrix_flag为“1”时,这时候为当前帧使用权重矩阵模块进行处理;(b) For the chroma component, determine whether the current frame is processed by the weighting matrix module according to the decoded chroma_frame_weighting_matrix_flag. If chroma_frame_weighting_matrix_flag is "0", skip to (c); otherwise, when chroma_frame_weighting_matrix_flag is "1", use the weight matrix module for the current frame at this time;
(c)若当前帧已完成权重矩阵模块的处理,则加载下一帧进行处理,然后跳转至(a)。(c) If the current frame has completed the processing of the weight matrix module, load the next frame for processing, and then jump to (a).
需要注意的,对于权重矩阵模块而言,还需要根据当前块的颜色分量类型和量化参数,选择对应的权重矩阵网络模型。将CNNLF的输出重建图像块作为权重矩阵网络模型的输入,该网络模型的输出得到权重矩阵。将CNNLF的输出重建图像块和CNNLF的输入重建图像块根据权重矩阵进行加权处理,可以得到最终的输出重建图像块(即前述实施例所述的目标重建图像块)。It should be noted that for the weight matrix module, it is also necessary to select the corresponding weight matrix network model according to the color component type and quantization parameters of the current block. The output reconstructed image patch of CNNLF is used as the input of the weight matrix network model, and the output of the network model obtains the weight matrix. The output reconstructed image block of CNNLF and the input reconstructed image block of CNNLF are weighted according to the weight matrix to obtain the final output reconstructed image block (ie, the target reconstructed image block described in the foregoing embodiment).
在实现中,对于亮度分量而言,其语法元素的修改如表1所示。In the implementation, for the luma component, the modification of its syntax elements is shown in Table 1.
表1Table 1
Figure PCTCN2021091670-appb-000001
Figure PCTCN2021091670-appb-000001
在实现中,对于色度分量而言,其语法元素的修改如表2所示。In the implementation, for the chroma components, the modification of its syntax elements is shown in Table 2.
表2Table 2
Figure PCTCN2021091670-appb-000002
Figure PCTCN2021091670-appb-000002
在这里,基于神经网络的权重矩阵的亮度分量帧级标志为luma_frame_weighting_matrix_flag;基于神经网络的权重矩阵的亮度分量CTU级标志为luma_ctu_weighting_matrix_flag;基于神经网络的权重矩阵的色度分量帧级标志为chroma_frame_weighting_matrix_flag。Here, the frame-level flag of the luminance component of the neural network-based weighting matrix is luma_frame_weighting_matrix_flag; the CTU-level flag of the luminance component of the neural network-based weighting matrix is luma_ctu_weighting_matrix_flag; the frame-level flag of the chrominance component of the neural network-based weighting matrix is chroma_frame_weighting_matrix_flag.
简言之,在本申请实施例中,通过将HPM-ModAI的CNNLF的输出重建图像块输入到权重矩阵网络模型(多层卷积神经网络)中,提取特征信息输出权重矩阵,从而可以为CNNLF的使用提供了像素级别的加权处理,使得编码性能提升。In short, in the embodiment of the present application, by inputting the reconstructed image blocks of the CNNLF output of HPM-ModAI into the weight matrix network model (multi-layer convolutional neural network), the feature information is extracted and the weight matrix is output, so that the CNNLF can be The use of provides pixel-level weighting, resulting in improved coding performance.
示例性地,本申请实施例的环路滤波方法在AVS3智能编码参考软件HPM10.0-ModAI5.0上实现后,在智能编码通用测试条件All Intra配置下对AVS3要求的测试序列进行测试,在Y、U、V三个分量上BD-rate平均变化分别为-0.36%、-1.26%、-0.38%,具体如表3所示;在智能编码通用测试条件Random Access配置下对AVS3要求的测试序列进行测试,在Y、U、V三个分量上BD-rate平均变化分别为-0.16%、-1.04%、-0.79%,具体如表4所示。表3和表4这些数据可以说明本申请实施例的方法提升了编码性能,具体来讲,本申请实施例通过引入基于深度学习的权重矩阵技术,可以给已有的AVS3智能编码参考软件HPM-ModAI带来不错的性能增益。Exemplarily, after the loop filtering method of the embodiment of the present application is implemented on the AVS3 intelligent coding reference software HPM10.0-ModAI5.0, the test sequence required by AVS3 is tested under the intelligent coding general test condition All Intra configuration, and The average changes of BD-rate on the three components of Y, U, and V are -0.36%, -1.26%, and -0.38%, respectively, as shown in Table 3; the test for AVS3 requirements under the general test condition Random Access configuration of intelligent coding The sequence is tested, and the average changes of BD-rate on the three components of Y, U, and V are -0.16%, -1.04%, and -0.79%, respectively, as shown in Table 4. The data in Tables 3 and 4 can illustrate that the method of the embodiment of the present application improves the coding performance. Specifically, the embodiment of the present application can provide the existing AVS3 intelligent coding reference software HPM- ModAI brings a nice performance gain.
表3table 3
Figure PCTCN2021091670-appb-000003
Figure PCTCN2021091670-appb-000003
表4Table 4
Figure PCTCN2021091670-appb-000004
Figure PCTCN2021091670-appb-000004
本实施例提供了一种解码方法,具体提供了一种环路滤波方法,应用于解码器。通过解析码流,确定至少一个语法元素标识信息的取值;当至少一个语法元素标识信息指示当前帧或当前块使用权重矩阵进行滤波处理时,确定当前块的权重矩阵网络模型,并根据权重矩阵网络模型确定当前块的权重矩阵;利用权重矩阵,确定当前块的目标重建图像块。这样,通过利用权重矩阵网络模型来确定权重矩阵,不仅可以实现基于深度学习的权重矩阵技术,能够为输出重建图像块的使用提供像素级别的加权处理,而且还可以提升编码性能,进而能够提高编解码效率;同时本申请还可以使得神经网络环路滤波器的输出更加接近于原始图像,能够提升视频图像质量。This embodiment provides a decoding method, and specifically provides a loop filtering method, which is applied to a decoder. Determine the value of at least one syntax element identification information by parsing the code stream; when at least one syntax element identification information indicates that the current frame or the current block uses the weight matrix for filtering processing, determine the weight matrix network model of the current block, and according to the weight matrix The network model determines the weight matrix of the current block; using the weight matrix, the target reconstructed image block of the current block is determined. In this way, by using the weight matrix network model to determine the weight matrix, it can not only realize the weight matrix technology based on deep learning, but also provide pixel-level weighting processing for the use of the output reconstructed image block, but also improve the coding performance, which in turn can improve the coding performance. decoding efficiency; at the same time, the present application can also make the output of the neural network loop filter closer to the original image, which can improve the video image quality.
在本申请的另一实施例中,参见图10,其示出了本申请实施例提供的一种编码方法的流程示意图。如图10所示,该方法可以包括:In another embodiment of the present application, referring to FIG. 10 , it shows a schematic flowchart of an encoding method provided by an embodiment of the present application. As shown in Figure 10, the method may include:
S1001:确定当前块的权重矩阵网络模型,并根据权重矩阵网络模型确定当前块的权重矩阵。S1001: Determine the weight matrix network model of the current block, and determine the weight matrix of the current block according to the weight matrix network model.
需要说明的是,视频图像可以划分为多个图像块,每个当前待编码的图像块可以称为编码块。这里,每个编码块可以包括第一图像分量、第二图像分量和第三图像分量;而当前块为视频图像中当前待进行第一图像分量、第二图像分量或者第三图像分量环路滤波处理的编码块。It should be noted that a video image may be divided into multiple image blocks, and each image block to be encoded currently may be called an encoding block. Here, each coding block may include a first image component, a second image component, and a third image component; and the current block is the first image component, the second image component or the third image component loop filtering in the video image currently to be performed The processed encoding block.
在这里,针对第一图像分量、第二图像分量和第三图像分量,从颜色划分角度,本申请实施例可以将其划分为亮度分量和色度分量等两种颜色分量类型。在这种情况下,如果当前块进行亮度分量的预测、变换与量化、环路滤波等操作,那么当前块也可以称为亮度块;或者,如果当前块进行色度分量的预测、变换与量化、环路滤波等操作,那么当前块也可以称为色度块。Here, for the first image component, the second image component, and the third image component, from the perspective of color division, this embodiment of the present application may divide them into two types of color components, such as luminance component and chrominance component. In this case, if the current block performs operations such as prediction, transformation and quantization of luma components, and loop filtering, the current block can also be called a luma block; or, if the current block performs prediction, transformation and quantization of chroma components , loop filtering, etc., then the current block can also be called a chroma block.
还需要说明的是,在编码器侧,本申请实施例具体提供了一种环路滤波方法,该环路滤波方法应用在如图3A所示的滤波单元108部分。在这里,滤波单元108也可以包括去块滤波器(LBF)、样值自适应补偿滤波器(SAO)、基于残差神经网络的环路滤波器(CNNLF)和自适应修正滤波器(ALF),而本申请实施例所述的环路滤波方法具体应用在CNNLF和ALF之间,以便能够对经过CNNLF滤波处理后的当前块中每一个像素值进行最优的选择。It should also be noted that, on the encoder side, an embodiment of the present application specifically provides a loop filtering method, and the loop filtering method is applied to the filtering unit 108 as shown in FIG. 3A . Here, the filtering unit 108 may also include a deblocking filter (LBF), a sample adaptive compensation filter (SAO), a residual neural network-based loop filter (CNNLF), and an adaptive correction filter (ALF) , and the loop filtering method described in the embodiment of the present application is specifically applied between CNNLF and ALF, so that each pixel value in the current block after being filtered by CNNLF can be optimally selected.
在本申请实施例中,该环路滤波方法主要是引入了权重矩阵网络模型,该权重矩阵网络模型可以是多层卷积神经网络。针对不同的颜色分量类型,这里的权重矩阵网络模型也不相同。在一些实施例中,所述确定当前块的权重矩阵网络模型,可以包括:In the embodiment of the present application, the loop filtering method mainly introduces a weight matrix network model, and the weight matrix network model may be a multi-layer convolutional neural network. For different color component types, the weight matrix network model here is also different. In some embodiments, the determining the weight matrix network model of the current block may include:
当当前块的颜色分量类型为亮度分量时,确定当前块的亮度权重矩阵网络模型;When the color component type of the current block is a luminance component, determine the luminance weight matrix network model of the current block;
当当前块的颜色分量类型为色度分量时,确定当前块的色度权重矩阵网络模型。When the color component type of the current block is a chrominance component, the chrominance weight matrix network model of the current block is determined.
需要说明的是,权重矩阵网络模型与颜色分量类型有关。这里,亮度分量对应的权重矩阵网络模型可以称为亮度权重矩阵网络模型,色度分量对应的权重矩阵网络模型可以称为色度权重矩阵网络模型。下面将以亮度分量和色度分量这两种颜色分量类型为例分别进行描述。It should be noted that the weight matrix network model is related to the color component type. Here, the weight matrix network model corresponding to the luminance component may be referred to as a luminance weight matrix network model, and the weight matrix network model corresponding to the chrominance component may be referred to as a chrominance weight matrix network model. The following will take the two types of color components, the luminance component and the chrominance component, as examples to describe respectively.
在一种可能的实施方式中,所述确定当前块的亮度权重矩阵网络模型,可以包括:In a possible implementation manner, the determining the luminance weight matrix network model of the current block may include:
在当前块的颜色分量类型为亮度分量的情况下,确定至少一个候选亮度权重矩阵网络模型;In the case that the color component type of the current block is a luminance component, determining at least one candidate luminance weight matrix network model;
确定当前块的量化参数,从至少一个候选亮度权重矩阵网络模型中选取所述量化参数对应的候选亮度权重矩阵网络模型;Determine the quantization parameter of the current block, and select a candidate brightness weight matrix network model corresponding to the quantization parameter from at least one candidate brightness weight matrix network model;
将所选取的候选亮度权重矩阵网络模型确定为当前块的亮度权重矩阵网络模型。The selected candidate luminance weight matrix network model is determined as the luminance weight matrix network model of the current block.
在另一种可能的实施方式中,所述确定当前块的色度权重矩阵网络模型,可以包括:In another possible implementation manner, the determining the chrominance weight matrix network model of the current block may include:
在当前块的颜色分量类型为色度分量的情况下,确定至少一个候选色度权重矩阵网络模型;In the case that the color component type of the current block is a chrominance component, determining at least one candidate chrominance weight matrix network model;
确定当前块的量化参数,从至少一个候选色度权重矩阵网络模型中选取量化参数对应的候选色度权重矩阵网络模型;Determine the quantization parameter of the current block, and select a candidate chroma weight matrix network model corresponding to the quantization parameter from at least one candidate chroma weight matrix network model;
将所选取的候选色度权重矩阵网络模型确定为当前块的色度权重矩阵网络模型。The selected candidate chroma weight matrix network model is determined as the chroma weight matrix network model of the current block.
需要说明的是,当前块的权重矩阵网络模型与量化参数以及颜色分量类型均具有关联关系。其中,不同的颜色分量类型,对应有不同的权重矩阵网络模型,比如对于亮度分量来说,权重矩阵网络模型可以是与亮度分量相关的亮度权重矩阵网络模型;对于色度分量来说,权重矩阵网络模型可以是与色度分 量相关的色度权重矩阵网络模型。It should be noted that the weight matrix network model of the current block has an associated relationship with the quantization parameter and the color component type. Among them, different color component types correspond to different weight matrix network models. For example, for the luminance component, the weight matrix network model may be a luminance weight matrix network model related to the luminance component; for the chrominance component, the weight matrix The network model may be a chroma weight matrix network model associated with the chroma components.
进一步地,根据不同的量化参数,比如QP的取值为27~31、32~37、38~44、45~50等,预先可以训练出至少一个候选亮度权重矩阵网络模型和至少一个候选色度权重矩阵网络模型。这样,在确定出当前块的量化参数之后,可以从至少一个候选亮度权重矩阵网络模型中选取出该量化参数对应的候选亮度权重矩阵网络模型,即当前块的亮度权重矩阵网络模型;也可以从至少一个候选色度权重矩阵网络模型中选取出该量化参数对应的候选色度权重矩阵网络模型,即当前块的色度权重矩阵网络模型。Further, according to different quantization parameters, for example, the value of QP is 27-31, 32-37, 38-44, 45-50, etc., at least one candidate luminance weight matrix network model and at least one candidate chroma can be trained in advance. Weight matrix network model. In this way, after the quantization parameter of the current block is determined, the candidate luminance weight matrix network model corresponding to the quantization parameter can be selected from at least one candidate luminance weight matrix network model, that is, the luminance weight matrix network model of the current block; The candidate chrominance weight matrix network model corresponding to the quantization parameter is selected from the at least one candidate chrominance weight matrix network model, that is, the chrominance weight matrix network model of the current block.
还需要说明的是,对于至少一个候选亮度权重矩阵网络模型和至少一个候选色度权重矩阵网络模型的模型训练,在一些实施例中,该方法还可以包括:It should also be noted that, for the model training of at least one candidate luminance weight matrix network model and at least one candidate chrominance weight matrix network model, in some embodiments, the method may further include:
确定至少一个训练样本,其中,所述训练样本是根据至少一种量化参数得到的;determining at least one training sample, wherein the training sample is obtained according to at least one quantization parameter;
利用所述至少一个训练样本的亮度分量对预设神经网络模型进行训练,得到至少一个候选亮度权重矩阵网络模型;Use the brightness component of the at least one training sample to train a preset neural network model to obtain at least one candidate brightness weight matrix network model;
利用所述至少一个训练样本的色度分量对预设神经网络模型进行训练,得到至少一个候选色度权重矩阵网络模型;Use the chrominance component of the at least one training sample to train the preset neural network model to obtain at least one candidate chrominance weight matrix network model;
其中,所述至少一个候选亮度权重矩阵网络模型与亮度分量和量化参数之间具有对应关系,所述至少一个候选色度权重矩阵网络模型与色度分量和量化参数之间具有对应关系。Wherein, the at least one candidate luminance weight matrix network model has a corresponding relationship with the luminance component and the quantization parameter, and the at least one candidate chrominance weight matrix network model has a corresponding relationship with the chrominance component and the quantization parameter.
在本申请实施例中,预设神经网络模型可以包括下述至少之一:至少一个卷积层、至少一个激活层和跳转连接层。In this embodiment of the present application, the preset neural network model may include at least one of the following: at least one convolution layer, at least one activation layer, and a jump connection layer.
也就是说,预设神经网络模型可以选择多层卷积神经网络,然后利用训练样本进行深度学习以得到权重矩阵网络模型,比如亮度权重矩阵网络模型或者色度权重矩阵网络模型。这样,权重矩阵网络模型也可以看作是由多层卷积神经网络组成。具体地,权重矩阵网络模型也可以包括下述至少之一:至少一个卷积层、至少一个激活层和跳转连接层。That is to say, the preset neural network model can select a multi-layer convolutional neural network, and then use the training samples to perform deep learning to obtain a weight matrix network model, such as a luminance weight matrix network model or a chrominance weight matrix network model. In this way, the weight matrix network model can also be regarded as composed of multi-layer convolutional neural networks. Specifically, the weight matrix network model may also include at least one of the following: at least one convolution layer, at least one activation layer, and a jump connection layer.
进一步地,在确定出权重矩阵网络模型之后,可以此确定出权重矩阵。在一些实施例中,所述根据权重矩阵网络模型确定当前块的权重矩阵,可以包括:Further, after the weight matrix network model is determined, the weight matrix can be determined accordingly. In some embodiments, the determining the weight matrix of the current block according to the weight matrix network model may include:
确定神经网络环路滤波器的输入重建图像块和输出重建图像块;Determine the input reconstructed image patch and the output reconstructed image patch of the neural network loop filter;
将输出重建图像块输入权重矩阵网络模型,得到当前块的权重矩阵。Input the output reconstructed image block into the weight matrix network model to get the weight matrix of the current block.
这里,神经网络环路滤波器具体是指前述的CNNLF。在确定出CNNLF的输入重建图像块和输出重建图像块之后,将输出重建图像块作为权重矩阵网络模型的输入,而权重矩阵网络模型的输出即为当前块的权重矩阵。Here, the neural network loop filter specifically refers to the aforementioned CNNLF. After determining the input reconstructed image block and output reconstructed image block of CNNLF, the output reconstructed image block is used as the input of the weight matrix network model, and the output of the weight matrix network model is the weight matrix of the current block.
还需要说明的是,根据颜色分量类型的不同,权重矩阵包括亮度权重矩阵和色度权重矩阵。在一些实施例中,所述根据权重矩阵网络模型确定当前块的权重矩阵,可以包括:It should also be noted that, according to different types of color components, the weight matrix includes a luminance weight matrix and a chrominance weight matrix. In some embodiments, the determining the weight matrix of the current block according to the weight matrix network model may include:
当当前块的颜色分量类型为亮度分量时,利用亮度权重矩阵网络模型确定亮度权重矩阵;When the color component type of the current block is a luminance component, the luminance weight matrix is determined by using the luminance weight matrix network model;
当当前块的颜色分量类型为色度分量时,利用色度权重矩阵网络模型确定色度权重矩阵。When the color component type of the current block is a chrominance component, the chrominance weight matrix is determined by using the chrominance weight matrix network model.
在一种具体的示例中,当当前块的颜色分量类型为亮度分量时,所述利用亮度权重矩阵网络模型确定亮度权重矩阵,可以包括:In a specific example, when the color component type of the current block is a luminance component, the determining the luminance weight matrix by using the luminance weight matrix network model may include:
确定神经网络环路滤波器的输入亮度重建图像块和输出亮度重建图像块;Determine the input luminance reconstructed image block and the output luminance reconstructed image block of the neural network loop filter;
将输出亮度重建图像块输入亮度权重矩阵网络模型,得到亮度权重矩阵。Input the output luminance reconstructed image block into the luminance weight matrix network model to obtain the luminance weight matrix.
在另一种具体的示例中,当当前块的颜色分量类型为色度分量时,所述利用色度权重矩阵网络模型确定色度权重矩阵,可以包括:In another specific example, when the color component type of the current block is a chrominance component, the determining the chrominance weight matrix by using the chrominance weight matrix network model may include:
确定神经网络环路滤波器的输入色度重建图像块和输出色度重建图像块;Determine the input chrominance reconstructed image block and the output chrominance reconstructed image block of the neural network loop filter;
将输出色度重建图像块输入色度权重矩阵网络模型,得到色度权重矩阵。Input the output chrominance reconstruction image block into the chrominance weight matrix network model to obtain the chrominance weight matrix.
需要说明的是,对于输入重建图像块,根据颜色分量类型的不同,可以是指输入亮度重建图像块,也可以是指输入色度重建图像块;对于输出重建图像块,根据颜色分量类型的不同,可以是指输出亮度重建图像块,也可以是指输出色度重建图像块。这样,根据亮度权重矩阵网络模型和输出亮度重建图像块可以得到亮度权重矩阵,根据色度权重矩阵网络模型和输出色度重建图像块可以得到色度权重矩阵。It should be noted that, for the input reconstructed image block, depending on the type of color components, it may refer to the input luminance reconstructed image block, or it may refer to the input chrominance reconstructed image block; for the output reconstructed image block, according to the different color component types , which can refer to the output luminance reconstructed image block or the output chrominance reconstructed image block. In this way, the luminance weight matrix can be obtained according to the luminance weight matrix network model and the output luminance reconstructed image block, and the chrominance weight matrix can be obtained according to the chrominance weight matrix network model and the output chrominance reconstructed image block.
S1002:确定至少一个语法元素标识信息的取值。S1002: Determine the value of at least one syntax element identification information.
需要说明的是,步骤S1001和步骤S1002之间没有先后顺序,可以是先执行步骤S1001,后执行步骤S1002;也可以是先执行步骤S1002,后执行步骤S1001;甚至还可以是两者并行执行,本申请实施例不作任何限定。It should be noted that there is no order between step S1001 and step S1002, and step S1001 may be executed first, and then step S1002 may be executed; or step S1002 may be executed first, and then step S1001 may be executed; even the two may be executed in parallel, The embodiments of the present application do not make any limitation.
还需要说明的是,是否使用权重矩阵进行滤波处理,可以通过至少一个语法元素标识信息进行指示。这样,在编码器中,当确定出这至少一个语法元素标识信息的取值后,将这至少一个语法元素标识信息的取值写入码流以传输到解码器,使得解码器通过解析码流即可获知是否使用权重矩阵进行滤波处理。It should also be noted that whether to use the weight matrix for filtering processing may be indicated by at least one syntax element identification information. In this way, in the encoder, after determining the value of the at least one syntax element identification information, the value of the at least one syntax element identification information is written into the code stream for transmission to the decoder, so that the decoder can parse the code stream by parsing the value of the code stream. It can be known whether to use the weight matrix for filtering processing.
在一些实施例中,所述确定至少一个语法元素标识信息的取值,可以包括:In some embodiments, the determining the value of at least one syntax element identification information may include:
若确定视频序列使用权重矩阵进行滤波处理,则确定第一语法元素标识信息的取值为第一值;或者,If it is determined that the video sequence is filtered by using the weight matrix, then it is determined that the value of the first syntax element identification information is the first value; or,
若确定视频序列不使用权重矩阵进行滤波处理,则确定第一语法元素标识信息的取值为第二值。If it is determined that the video sequence does not use the weight matrix for filtering processing, it is determined that the value of the first syntax element identification information is the second value.
进一步地,该方法还包括:对第一语法元素标识信息的取值进行编码,将编码比特写入码流。Further, the method further includes: encoding the value of the identification information of the first syntax element, and writing the encoded bits into the code stream.
也就是说,首先可以设置一个第一语法元素标识信息,以指示当前的视频序列是否使用本申请实施例的环路滤波方法(即权重矩阵模块是否使能)。在这里,如果该视频序列的权重矩阵模块使能,即确定该视频序列使用权重矩阵进行滤波处理,那么这时候第一语法元素标识信息的取值可以为第一值;如果该视频序列的权重矩阵模块不使能,即确定该视频序列不使用权重矩阵进行滤波处理,那么这时候第一语法元素标识信息的取值可以为第二值。That is, first, first syntax element identification information may be set to indicate whether the current video sequence uses the loop filtering method in this embodiment of the present application (ie, whether the weight matrix module is enabled). Here, if the weight matrix module of the video sequence is enabled, that is, it is determined that the video sequence is filtered using the weight matrix, then the value of the first syntax element identification information can be the first value at this time; if the weight of the video sequence is If the matrix module is disabled, that is, it is determined that the video sequence does not use the weight matrix for filtering processing, then at this time, the value of the identification information of the first syntax element may be the second value.
还需要说明的是,第一值和第二值不同。It should also be noted that the first value and the second value are different.
以第一语法元素标识信息为一个flag为例,这时候对于第一值和第二值而言,第一值可以设置为1,第二值可以设置为0;或者,第一值还可以设置为true,第二值还可以设置为false;或者,第一值还可以设置为0,第二值还可以设置为1;或者,第一值还可以设置为false,第二值还可以设置为true。示例性地,对于flag而言,一般情况下,第一值可以为1,第二值可以为0,但是并不作任何限定。Taking the first syntax element identification information as a flag as an example, at this time, 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; alternatively, the first value can also be set is true, the second value can also be set to false; alternatively, the first value can also be set to 0, and the second value can also be set to 1; alternatively, the first value can also be set to false, and the second value can also be set to true. Exemplarily, for flag, in general, the first value may be 1, and the second value may be 0, but no limitation is imposed.
还需要说明的是,视频序列包括至少一个帧,这至少一个帧可以包括有当前帧。在这里,当视频序列使能使用本申请实施例的环路滤波方法时,即确定该视频序列使能权重矩阵模块,那么本申请实施例还需要进一步判断视频序列内的当前帧是否使用权重矩阵进行滤波处理,即还需要设置一个第二语法元素标识信息。对于第二语法元素标识信息而言,根据颜色分量类型的不同,第二语法元素标识信息代表的含义不同。It should also be noted that the video sequence includes at least one frame, and the at least one frame may include the current frame. Here, when the video sequence is enabled to use the loop filtering method of the embodiment of the present application, it is determined that the weight matrix module is enabled for the video sequence, then the embodiment of the present application needs to further determine whether the current frame in the video sequence uses the weight matrix For filtering processing, it is also necessary to set a second syntax element identification information. For the second syntax element identification information, the meanings represented by the second syntax element identification information are different according to different types of color components.
在本申请实施例中,颜色分量类型可以包括亮度分量和色度分量。如果颜色分量类型为亮度分量,这时候假定第二语法元素标识信息为第一亮度语法元素标识信息,以指示当前帧的亮度分量是否使用亮度权重矩阵进行滤波处理;如果颜色分量类型为色度分量,这时候假定第二语法元素标识信息为色度语法元素标识信息,以指示当前帧的色度分量是否使用色度权重矩阵进行滤波处理。In this embodiment of the present application, the color component types may include luminance components and chrominance components. If the color component type is a luminance component, it is assumed that the second syntax element identification information is the first luminance syntax element identification information at this time to indicate whether the luminance component of the current frame is filtered using the luminance weight matrix; if the color component type is a chrominance component , at this time, it is assumed that the second syntax element identification information is the chroma syntax element identification information, so as to indicate whether the chroma components of the current frame are filtered using the chroma weight matrix.
这样,在确定视频序列使用权重矩阵进行滤波处理之后,当当前帧的颜色分量类型为亮度分量时,确定权重矩阵为亮度权重矩阵。这时候,在一种可能的实施方式中,所述确定至少一个语法元素标识信息的取值,还可以包括:In this way, after it is determined that the video sequence is filtered by using the weight matrix, when the color component type of the current frame is the luminance component, the weight matrix is determined to be the luminance weight matrix. At this time, in a possible implementation manner, the determining the value of the identification information of at least one syntax element may further include:
确定视频序列内当前帧的亮度分量使用亮度权重矩阵进行滤波处理的第一率失真代价值;determining the first rate-distortion cost value of filtering the luminance component of the current frame in the video sequence using the luminance weight matrix;
确定视频序列内当前帧的亮度分量未使用亮度权重矩阵进行滤波处理的第二率失真代价值;determining the second rate-distortion cost value of the luminance component of the current frame in the video sequence that is not filtered using the luminance weight matrix;
若第一率失真代价值小于第二率失真代价值,则确定第一亮度语法元素标识信息的取值为第一值;或者,If the first rate-distortion cost value is less than the second rate-distortion cost value, determine that the value of the first luma syntax element identification information is the first value; or,
若第一率失真代价值大于或等于第二率失真代价值,则确定第一亮度语法元素标识信息的取值为第二值。If the first rate-distortion cost value is greater than or equal to the second rate-distortion cost value, the value of the first luma syntax element identification information is determined to be the second value.
进一步地,该方法还包括:对第一亮度语法元素标识信息的取值进行编码,将编码比特写入码流。Further, the method further includes: encoding the value of the identification information of the first luma syntax element, and writing the encoded bits into the code stream.
需要说明的是,对于亮度分量而言,如果第一亮度语法元素标识信息的取值为第一值,即确定当前帧的亮度分量使用亮度权重矩阵进行滤波处理,那么还需要继续判断当前帧内的当前块的亮度分量是否使用亮度权重矩阵进行滤波处理。因此,在一些实施例中,当第一率失真代价值小于第二率失真代价值时,所述确定至少一个语法元素标识信息的取值,还可以包括:It should be noted that, for the luma component, if the value of the first luma syntax element identification information is the first value, that is, it is determined that the luma component of the current frame is filtered using the luma weight matrix, then it is necessary to continue to judge the current frame. Whether the luma component of the current block is filtered using the luma weight matrix. Therefore, in some embodiments, when the first rate-distortion cost value is less than the second rate-distortion cost value, the determining the value of the at least one syntax element identification information may further include:
确定当前块的亮度分量使用亮度权重矩阵进行滤波处理的第三率失真代价值;以及确定当前块的亮度分量未使用亮度权重矩阵进行滤波处理的第四率失真代价值;Determine the third rate-distortion cost value for the luminance component of the current block to be filtered using the luminance weight matrix; and determine the fourth rate-distortion cost for the luminance component of the current block to be filtered without using the luminance weight matrix;
若第三率失真代价值小于第四率失真代价值,则确定第二亮度语法元素标识信息的取值为第一值;或者,If the third rate-distortion cost value is less than the fourth rate-distortion cost value, determine that the value of the identification information of the second luma syntax element is the first value; or,
若第三率失真代价值大于或等于所述第四率失真代价值,则确定第二亮度语法元素标识信息的取值为第二值。If the third rate-distortion cost value is greater than or equal to the fourth rate-distortion cost value, the value of the second luma syntax element identification information is determined to be a second value.
进一步地,该方法还包括:对第二亮度语法元素标识信息的取值进行编码,将编码比特写入码流。Further, the method further includes: encoding the value of the identification information of the second luma syntax element, and writing the encoded bits into the code stream.
也就是说,对于亮度分量,这里涉及到两种语法元素:帧级语法元素和CTU级语法元素。其中,帧级语法元素可以称为第一亮度语法元素标识信息,CTU级语法元素可以称为第二亮度语法元素标识信息。假定第一亮度语法元素标识信息和第二亮度语法元素标识信息为一flag信息,那么第一亮度语法元素标识信息可以用luma_frame_weighting_matrix_flag表示;第二亮度语法元素标识信息可以用luma_ctu_weighting_matrix_flag表示。在这里,无论是第一亮度语法元素标识信息的取值还是第二亮度语法元素标识信息的取值均可以利用率失真代价方式进行确定。That is, for the luma component, there are two kinds of syntax elements involved here: frame-level syntax elements and CTU-level syntax elements. The frame-level syntax element may be referred to as the first luma syntax element identification information, and the CTU-level syntax element may be referred to as the second luma syntax element identification information. Assuming that the first luma syntax element identification information and the second luma syntax element identification information are flag information, the first luma syntax element identification information can be represented by luma_frame_weighting_matrix_flag; the second luma syntax element identification information can be represented by luma_ctu_weighting_matrix_flag. Here, both the value of the identification information of the first luma syntax element and the value of the identification information of the second luma syntax element can be determined by utilizing the distortion cost.
以第一亮度语法元素标识信息为例,对于当前帧,在一些实施例中,该方法还可以包括:对当前帧进行块划分,确定至少一个划分块;其中,至少一个划分块包括当前块;Taking the identification information of the first luma syntax element as an example, for the current frame, in some embodiments, the method may further include: performing block division on the current frame, and determining at least one divided block; wherein, the at least one divided block includes the current block;
相应地,所述确定视频序列内当前帧的亮度分量使用亮度权重矩阵进行滤波处理的第一率失真代价 值,可以包括:Correspondingly, determining the first rate-distortion cost value for filtering the luminance component of the current frame in the video sequence using the luminance weight matrix may include:
分别计算这至少一个划分块的亮度分量使用亮度权重矩阵进行滤波处理的第三率失真代价值;respectively calculating the third rate-distortion cost value of filtering the luminance component of the at least one divided block using the luminance weight matrix;
对计算得到的第三率失真代价值进行累加计算,得到第一率失真代价值;Accumulate the calculated third rate-distortion cost value to obtain the first rate-distortion cost value;
所述计算视频序列内当前帧的亮度分量未使用亮度权重矩阵进行滤波处理的第二率失真代价值,可以包括:The calculating the second rate-distortion cost value of the luminance component of the current frame in the video sequence without using the luminance weight matrix for filtering processing may include:
分别计算这至少一个划分块的亮度分量未使用亮度权重矩阵进行滤波处理的第四率失真代价值;respectively calculating the fourth rate-distortion cost value of the luminance component of the at least one divided block that is not filtered using the luminance weight matrix;
对计算得到的第四率失真代价值进行累加计算,得到第二率失真代价值。Accumulate the calculated fourth rate-distortion cost value to obtain the second rate-distortion cost value.
也就是说,可以通过计算每一个块的亮度分量使用亮度权重矩阵进行滤波的第三率失真代价值,然后通过累计计算得到当前帧的第一率失真代价值。在一种具体的示例中,在率失真代价值的计算中,失真值可以是根据均方误差确定的。That is to say, the third rate-distortion cost value for filtering the luminance component of each block using the luminance weight matrix can be calculated, and then the first rate-distortion cost value of the current frame can be obtained by cumulative calculation. In a specific example, in the calculation of the rate-distortion cost value, the distortion value may be determined according to the mean square error.
在一种可能的实现方式中,每一个块的亮度分量使用亮度权重矩阵进行滤波后,可以得到每一个块的亮度分量的目标重建图像块;然后计算目标重建图像块与原始图像块的均方误差值,可以得到每一个块的均方误差值;利用率失真代价公式RDcost=D+λ*R可以计算得到每一个块的第三率失真代价值;其中,D为每一个块的均方误差值,R为1,λ与自适应修正滤波器的λ保持一致。最后将每一个块的第三率失真代价值进行累加,可以得到当前帧的第一率失真代价值。In a possible implementation, after the luminance component of each block is filtered by the luminance weight matrix, the target reconstructed image block of the luminance component of each block can be obtained; then the mean square of the target reconstructed image block and the original image block is calculated Error value, the mean square error value of each block can be obtained; the utilization distortion cost formula RDcost=D+λ*R can calculate the third rate distortion cost value of each block; where D is the mean square of each block The error value, R is 1, and λ is consistent with the λ of the adaptive correction filter. Finally, the third rate-distortion cost value of each block is accumulated to obtain the first rate-distortion cost value of the current frame.
在另一种可能的实现方式中,每一个块的亮度分量使用亮度权重矩阵进行滤波后,可以得到每一个块的亮度分量的目标重建图像块;然后计算目标重建图像块与原始图像块的均方误差值,可以得到每一个块的均方误差值,通过累计计算得到当前帧的均方误差值;再利用率失真代价公式RDcost=D+λ*R计算得到第一率失真代价值;其中,这里的D为当前帧的均方误差值,R为当前帧包括的块数量,λ与自适应修正滤波器的λ保持一致。In another possible implementation, after the luminance component of each block is filtered using a luminance weight matrix, the target reconstructed image block of the luminance component of each block can be obtained; then the average of the target reconstructed image block and the original image block is calculated. square error value, the mean square error value of each block can be obtained, and the mean square error value of the current frame can be obtained by cumulative calculation; the reuse rate distortion cost formula RDcost=D+λ*R is calculated to obtain the first rate distortion cost value; where , where D is the mean square error value of the current frame, R is the number of blocks included in the current frame, and λ is consistent with the λ of the adaptive correction filter.
还需要说明的是,还可以通过计算每一个块的亮度分量未使用亮度权重矩阵进行滤波的第四率失真代价值,然后通过累计计算得到当前帧的第二率失真代价值。这里,在率失真代价值的计算中,失真值也可以是根据均方误差确定的;这时候的均方误差是指未经过权重矩阵模块的输出重建图像块与原始图像块的均方误差值,其他计算操作与计算第一率失真代价值相同,这里不再详述。It should also be noted that the fourth rate-distortion cost value of the luminance component of each block that is not filtered using the luminance weight matrix can also be calculated, and then the second rate-distortion cost value of the current frame can be obtained by cumulative calculation. Here, in the calculation of the rate-distortion cost value, the distortion value can also be determined according to the mean square error; the mean square error at this time refers to the mean square error value between the output reconstructed image block and the original image block without going through the weight matrix module , and other calculation operations are the same as calculating the first rate-distortion cost value, and will not be described in detail here.
这样,以第一值为1,第二值为0为例,在得到第一率失真代价值和第二率失真代价值之后,可以通过将第一率失真代价值与第二率失真代价值进行比较;如果第一率失真代价值大于或等于第二率失真代价值,那么可以确定出第一亮度语法元素标识信息的取值为0,意味着当前帧的亮度分量不需要使用亮度权重矩阵进行滤波处理,此时可以从视频序列中获取下一帧,将下一帧确定为当前帧,继续进行第一率失真代价值和第二率失真代价值的计算。否则,如果第一率失真代价值小于第二率失真代价值,那么可以确定出第一亮度语法元素标识信息的取值为1,意味着当前帧的亮度分量需要使用亮度权重矩阵进行滤波处理,此时需要继续判断当前帧内的当前块的亮度分量是否使用亮度权重矩阵进行滤波;即将第三率失真代价值与第四率失真代价值进行比较;如果第三率失真代价值小于第四率失真代价值,那么可以确定出第二亮度语法元素标识信息的取值为1,意味着需要对当前块的亮度分量使用亮度权重矩阵进行滤波处理;否则,如果第三率失真代价值大于或等于第四率失真代价值,那么可以确定出第二亮度语法元素标识信息的取值为0,意味着不需要对当前块的亮度分量使用亮度权重矩阵进行滤波处理,此时可以从当前帧中获取下一个块,将下一个块确定为当前块,继续进行第三率失真代价值和第四率失真代价值的计算。In this way, taking the first value of 1 and the second value of 0 as an example, after obtaining the first rate-distortion cost value and the second rate-distortion cost value, the first rate-distortion cost value and the second rate-distortion cost value can be calculated by Compare; if the first rate-distortion cost value is greater than or equal to the second rate-distortion cost value, then it can be determined that the value of the first luminance syntax element identification information is 0, which means that the luminance component of the current frame does not need to use the luminance weight matrix After filtering, the next frame can be acquired from the video sequence, the next frame is determined as the current frame, and the calculation of the first rate-distortion cost value and the second rate-distortion cost value is continued. Otherwise, if the first rate-distortion cost value is less than the second rate-distortion cost value, then it can be determined that the value of the first luminance syntax element identification information is 1, which means that the luminance component of the current frame needs to be filtered using the luminance weight matrix, At this time, it is necessary to continue to judge whether the luminance component of the current block in the current frame is filtered using the luminance weight matrix; that is, compare the third rate distortion cost value with the fourth rate distortion cost value; if the third rate distortion cost value is less than the fourth rate distortion cost value Distortion cost value, then it can be determined that the value of the identification information of the second luma syntax element is 1, which means that the luma component of the current block needs to be filtered using the luma weight matrix; otherwise, if the third rate distortion cost value is greater than or equal to The fourth rate-distortion cost value, then it can be determined that the value of the identification information of the second luma syntax element is 0, which means that the luma component of the current block does not need to be filtered using the luma weight matrix, which can be obtained from the current frame. In the next block, the next block is determined as the current block, and the calculation of the third rate-distortion cost value and the fourth rate-distortion cost value is continued.
另外,对于亮度分量,本申请实施例还可以设置亮度帧级标志位和亮度CTU级标志位,通过控制是否打开权重矩阵模块,进而确定是否使用亮度权重矩阵进行滤波处理。In addition, for the luminance component, the embodiments of the present application can also set the luminance frame level flag bit and the luminance CTU level flag bit, and determine whether to use the luminance weight matrix for filtering by controlling whether to open the weight matrix module.
对于亮度帧级标志位,在一些实施例中,该方法还可以包括:设置亮度帧级标志位,该亮度帧级标志位用于控制当前帧的亮度分量是否使用亮度权重矩阵进行滤波处理;For the luminance frame level flag, in some embodiments, the method may further include: setting a luminance frame level flag, where the luminance frame level flag is used to control whether the luminance component of the current frame is filtered using the luminance weight matrix;
相应地,该方法还可以包括:Accordingly, the method may also include:
若第一率失真代价值小于第二率失真代价值,则打开亮度帧级标志位;或者,If the first rate-distortion cost value is less than the second rate-distortion cost value, turn on the luminance frame level flag; or,
若第一率失真代价值大于或等于第二率失真代价值,则关闭亮度帧级标志位。If the first rate-distortion cost value is greater than or equal to the second rate-distortion cost value, the luminance frame level flag is turned off.
对于亮度CTU级标志位,在一些实施例中,该方法还可以包括:设置亮度CTU级标志位,该亮度CTU级标志位用于控制当前块的亮度分量是否使用亮度权重矩阵进行滤波处理;For the luminance CTU level flag bit, in some embodiments, the method may further include: setting a luminance CTU level flag bit, where the luminance CTU level flag bit is used to control whether the luminance component of the current block is filtered using the luminance weight matrix;
相应地,该方法还可以包括:Accordingly, the method may also include:
若第三率失真代价值小于第四率失真代价值,则打开亮度CTU级标志位;或者,If the third rate-distortion cost value is less than the fourth rate-distortion cost value, turn on the luminance CTU level flag; or,
若第三率失真代价值大于或等于第四率失真代价值,则关闭亮度CTU级标志位。If the third rate-distortion cost value is greater than or equal to the fourth rate-distortion cost value, the luminance CTU level flag is turned off.
需要说明的是,无论是亮度帧级标志位还是亮度CTU级标志位,也可以根据率失真代价方式来确定是否打开。在这里,一种可能的实现方式中,可以根据计算得到的率失真代价值的大小判断确定。It should be noted that, whether it is the luminance frame level flag or the luminance CTU level flag, whether to enable or not can also be determined according to the rate-distortion cost method. Here, in a possible implementation manner, it can be determined according to the magnitude of the calculated rate-distortion cost value.
在另一种可能的实现方式中,对于亮度帧级标志位,仍然根据RDcost=D+λ*R来确定。这里, D表示当前帧经过权重矩阵模块处理后减少的失真值,D=D out-D rec(D out为权重矩阵模块处理后的失真,D rec为权重矩阵模块处理前的失真),R为当前帧包括的块数量,λ与自适应修正滤波器的λ保持一致。这时候,当RDcost为负值时,打开亮度帧级标志位,即打开帧级权重矩阵模块;否则关闭亮度帧级标志位,即关闭帧级权重矩阵模块。 In another possible implementation manner, for the luminance frame level flag bit, it is still determined according to RDcost=D+λ*R. Here, D represents the distortion value reduced after the current frame is processed by the weight matrix module, D=D out - D rec (D out is the distortion after the weight matrix module processing, D rec is the distortion before the weight matrix module processing), R is the The number of blocks included in the current frame, λ is consistent with the λ of the adaptive correction filter. At this time, when RDcost is a negative value, turn on the luminance frame-level flag, that is, turn on the frame-level weight matrix module; otherwise, turn off the luminance frame-level flag, that is, turn off the frame-level weight matrix module.
当亮度帧级标志位打开时,对于亮度CTU级标志位,可以根据RDcost=D来确定。这里,D表示当前块经过权重矩阵模块处理后减少的失真值,D=D out-D rec(D out为权重矩阵模块处理后的失真,D rec为权重矩阵模块处理前的失真)。 When the luminance frame level flag is turned on, the luminance CTU level flag can be determined according to RDcost=D. Here, D represents the distortion value reduced after the current block is processed by the weight matrix module, D=D out - D rec (D out is the distortion after the weight matrix module processing, D rec is the distortion before the weight matrix module processing).
进一步地,在确定视频序列使用权重矩阵进行滤波处理之后,当当前帧的颜色分量类型为色度分量时,确定权重矩阵为色度权重矩阵。这时候,在另一种可能的实施方式中,所述确定至少一个语法元素标识信息的取值,还可以包括:Further, after it is determined that the video sequence is filtered using the weight matrix, when the color component type of the current frame is a chrominance component, the weight matrix is determined to be a chrominance weight matrix. At this time, in another possible implementation manner, the determining the value of the identification information of at least one syntax element may further include:
确定视频序列内当前帧的色度分量使用色度权重矩阵进行滤波处理的第五率失真代价值;Determine the fifth rate-distortion cost value of filtering the chrominance component of the current frame in the video sequence using the chrominance weight matrix;
确定视频序列内的当前帧的色度分量未使用色度权重矩阵进行滤波处理的第六率失真代价值;determining the sixth rate-distortion cost value of the chrominance component of the current frame in the video sequence that is not filtered using the chrominance weight matrix;
若第五率失真代价值小于第六率失真代价值,则确定色度语法元素标识信息的取值为第一值;或者,If the fifth rate-distortion cost value is less than the sixth rate-distortion cost value, determine that the value of the chroma syntax element identification information is the first value; or,
若第五率失真代价值大于或等于第六率失真代价值,则确定色度语法元素标识信息的取值为第二值。If the fifth rate-distortion cost value is greater than or equal to the sixth rate-distortion cost value, the value of the chroma syntax element identification information is determined to be the second value.
进一步地,该方法还可以包括:对色度语法元素标识信息的取值进行编码,将编码比特写入码流。Further, the method may further include: encoding the value of the identification information of the chroma syntax element, and writing the encoded bits into the code stream.
需要说明的是,对于色度分量,这里涉及到帧级语法元素。其中,帧级语法元素可以称为色度语法元素标识信息,假定色度语法元素标识信息为一flag信息,那么可以用chroma_frame_weighting_matrix_flag表示。It should be noted that, for chroma components, frame-level syntax elements are involved here. The frame-level syntax element may be referred to as chroma syntax element identification information. Assuming that the chroma syntax element identification information is flag information, it may be represented by chroma_frame_weighting_matrix_flag.
还需要说明的是,对于第一值和第二值而言,第一值可以设置为1,第二值可以设置为0;或者,第一值还可以设置为true,第二值还可以设置为false;或者,第一值还可以设置为0,第二值还可以设置为1;或者,第一值还可以设置为false,第二值还可以设置为true。示例性地,一般情况下,第一值可以为1,第二值可以为0,但是并不作任何限定。It should also be noted that, 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 is false; alternatively, the first value can also be set to 0, and the second value can also be set to 1; alternatively, the first value can also be set to false, and the second value can also be set to true. Exemplarily, in general, the first value may be 1, and the second value may be 0, but it is not limited in any way.
进一步地,由于考虑到编码性能和计算复杂度,如果色度语法元素标识信息指示当前帧的色度分量使用色度权重矩阵进行滤波处理,那么当前帧所包括的块都默认使用色度权重矩阵进行滤波处理;如果色度语法元素标识信息指示当前帧的色度分量不使用色度权重矩阵进行滤波处理,那么当前帧所包括的块都默认不使用色度权重矩阵进行滤波处理。因此,对于色度分量不再需要设置CTU级语法元素,同理也不需要设置CTU级标志位。Further, due to the consideration of coding performance and computational complexity, if the chroma syntax element identification information indicates that the chroma components of the current frame are filtered using the chroma weight matrix, then the blocks included in the current frame all use the chroma weight matrix by default. Perform filtering; if the chroma syntax element identification information indicates that the chroma components of the current frame do not use the chroma weight matrix for filtering, then the blocks included in the current frame do not use the chroma weight matrix for filtering by default. Therefore, it is no longer necessary to set the CTU-level syntax element for the chroma components, and similarly, the CTU-level flag bit does not need to be set.
换句话说,对于色度分量,本申请实施例可以只设置帧级标志位。因此,在一些实施例中,该方法还可以包括:设置色度帧级标志位,色度帧级标志位用于控制当前帧的色度分量是否使用色度权重矩阵进行滤波处理;In other words, for the chrominance component, only the frame-level flag bit may be set in this embodiment of the present application. Therefore, in some embodiments, the method may further include: setting a chroma frame-level flag bit, where the chroma frame-level flag bit is used to control whether the chroma components of the current frame are filtered using a chroma weight matrix;
相应地,该方法还可以包括:Accordingly, the method may also include:
若第五率失真代价值小于第六率失真代价值,则打开色度帧级标志位;或者,If the fifth rate-distortion cost value is less than the sixth rate-distortion cost value, turn on the chroma frame-level flag; or,
若第五率失真代价值大于或等于第六率失真代价值,则关闭色度帧级标志位。If the fifth rate-distortion cost value is greater than or equal to the sixth rate-distortion cost value, the chroma frame-level flag is turned off.
需要说明的是,对于第五率失真代价值和第六率失真代价值,在一种具体的示例中,失真值也可以根据均方误差确定,其他计算操作与计算第一率失真代价值和第二率失真代价值相同,这里不再详述。另外,对于色度帧级标志位,其是否打开则与确定亮度帧级标志位是否打开的实现方式相同,这里也不再详述。It should be noted that, for the fifth rate-distortion cost value and the sixth rate-distortion cost value, in a specific example, the distortion value can also be determined according to the mean square error, and other calculation operations are the same as calculating the first rate-distortion cost value and The second rate-distortion cost value is the same, and will not be described in detail here. In addition, whether the chroma frame-level flag is turned on is the same as the implementation of determining whether the luminance frame-level flag is turned on, and will not be described in detail here.
这样,以第一值为1,第二值为0为例,在得到第五率失真代价值和第六率失真代价值之后,可以通过将第五率失真代价值与第六率失真代价值进行比较;如果第五率失真代价值小于第六率失真代价值,那么可以打开色度帧级标志位,而且还可以确定出色度语法元素标识信息的取值为1,意味着当前帧的色度分量需要使用色度权重矩阵进行滤波处理;在当前帧处理完成后,继续加载下一帧进行处理。否则,如果第五率失真代价值大于或等于第六率失真代价值,那么可以关闭色度帧级标志位,而且还可以确定出色度语法元素标识信息的取值为0,意味着当前帧的色度分量不需要使用色度权重矩阵进行滤波处理,此时可以从视频序列中获取下一帧,将下一帧确定为当前帧,继续加载下一帧进行处理,以确定出下一帧的语法元素标识信息的取值。In this way, taking the first value of 1 and the second value of 0 as an example, after obtaining the fifth rate-distortion cost value and the sixth rate-distortion cost value, the fifth rate-distortion cost value and the sixth rate-distortion cost value can be calculated by Compare; if the fifth rate-distortion cost value is less than the sixth rate-distortion cost value, then the chroma frame-level flag bit can be turned on, and it can also be determined that the value of the chroma syntax element identification information is 1, which means that the color of the current frame is The chrominance component needs to be filtered using the chrominance weight matrix; after the current frame is processed, continue to load the next frame for processing. Otherwise, if the fifth rate-distortion cost value is greater than or equal to the sixth rate-distortion cost value, then the chroma frame-level flag bit can be turned off, and it can also be determined that the value of the chroma syntax element identification information is 0, which means that the current frame The chrominance component does not need to use the chrominance weight matrix for filtering processing. At this time, the next frame can be obtained from the video sequence, the next frame can be determined as the current frame, and the next frame can be loaded for processing to determine the next frame. The value of the syntax element identification information.
S1003:当至少一个语法元素标识信息指示当前帧或当前块使用权重矩阵进行滤波处理时,利用权重矩阵确定当前块的目标重建图像块。S1003: When at least one syntax element identification information indicates that the current frame or the current block uses the weight matrix for filtering processing, use the weight matrix to determine the target reconstructed image block of the current block.
需要说明的是,颜色分量类型可以包括亮度分量和色度分量。如果当前帧使用权重矩阵进行滤波处理,并不代表当前帧内的每一个块都使用权重矩阵进行滤波处理,还可能涉及到CTU级语法元素标识信息,以便进一步确定当前块是否使用权重矩阵进行滤波处理。下面将以亮度分量和色度分量这两种颜色分量类型为例分别进行描述。It should be noted that the color component types may include luminance components and chrominance components. If the current frame uses the weight matrix for filtering, it does not mean that every block in the current frame uses the weight matrix for filtering, and may also involve CTU-level syntax element identification information to further determine whether the current block uses the weight matrix for filtering. deal with. The following will take the two types of color components, the luminance component and the chrominance component, as examples to describe respectively.
在一些实施例中,对于亮度分量而言,所述当至少一个语法元素标识信息指示当前帧或当前块使用 权重矩阵进行滤波处理时,利用权重矩阵确定当前块的目标重建图像块,可以包括:In some embodiments, for the luminance component, when the at least one syntax element identification information indicates that the current frame or the current block uses a weight matrix to perform filtering processing, using the weight matrix to determine the target reconstructed image block of the current block may include:
若第三率失真代价值小于第四率失真代价值,则利用亮度权重矩阵确定当前块的目标重建图像块。If the third rate-distortion cost value is less than the fourth rate-distortion cost value, use the luminance weight matrix to determine the target reconstructed image block of the current block.
在一些实施例中,对于色度分量而言,所述当至少一个语法元素标识信息指示当前帧或当前块使用权重矩阵进行滤波处理时,利用权重矩阵确定当前块的目标重建图像块,可以包括:In some embodiments, for the chrominance component, when the at least one syntax element identification information indicates that the current frame or the current block uses a weight matrix for filtering processing, using the weight matrix to determine the target reconstructed image block of the current block may include: :
若第五率失真代价值小于第六率失真代价值,则利用色度权重矩阵确定当前块的目标重建图像块。If the fifth rate-distortion cost value is less than the sixth rate-distortion cost value, the chrominance weight matrix is used to determine the target reconstructed image block of the current block.
需要说明的是,对于亮度分量,需要两种语法元素:帧级语法元素和CTU级语法元素。只有CTU级语法元素(即第二亮度语法元素标识信息)指示当前块使用权重矩阵进行滤波处理时,即第三率失真代价值小于第四率失真代价值,这时候才可以利用亮度权重矩阵确定当前块的目标重建图像块(具体是指当前块的亮度分量的目标重建图像块)。It should be noted that, for the luma component, two kinds of syntax elements are required: frame-level syntax elements and CTU-level syntax elements. Only when the CTU-level syntax element (ie, the second luminance syntax element identification information) indicates that the current block uses the weight matrix for filtering processing, that is, the third rate-distortion cost value is less than the fourth rate-distortion cost value, then the luminance weight matrix can be used to determine The target reconstructed image block of the current block (specifically refers to the target reconstructed image block of the luminance component of the current block).
而对于色度分量,可以仅需要一种语法元素:帧级语法元素。只有帧级语法元素(即色度语法元素标识信息)指示当前帧使用权重矩阵进行滤波处理时,即第五率失真代价值小于第六率失真代价值,这时候默认当前帧内的所有块均使用色度权重矩阵进行滤波处理,此时也可以利用权重矩阵确定当前块的目标重建图像块(具体是指当前块的色度分量的目标重建图像块)。For chroma components, however, only one syntax element may be required: a frame-level syntax element. When only the frame-level syntax element (ie, the chroma syntax element identification information) indicates that the current frame uses the weight matrix for filtering processing, that is, the fifth rate-distortion cost value is less than the sixth rate-distortion cost value, at this time, all blocks in the current frame are defaulted. The chrominance weight matrix is used for filtering processing, and the weight matrix may also be used to determine the target reconstructed image block of the current block (specifically, the target reconstructed image block of the chrominance component of the current block).
进一步地,在一些实施例中,所述利用权重矩阵确定当前块的目标重建图像块,可以包括:Further, in some embodiments, the determining the target reconstructed image block of the current block by using the weight matrix may include:
利用权重矩阵对输入重建图像块和输出重建图像块进行加权处理,得到目标重建图像块。The input reconstructed image block and the output reconstructed image block are weighted by the weight matrix to obtain the target reconstructed image block.
在一种具体的示例中,权重矩阵用Weighting Matrix表示,那么对于目标重建图像块而言,目标重建图像块=输出重建图像块×Weighting Matrix+输入重建图像块×(1-Weighting Matrix)。In a specific example, the weight matrix is represented by Weighting Matrix, then for the target reconstructed image block, the target reconstructed image block=output reconstructed image block×Weighting Matrix+input reconstructed image block×(1-Weighting Matrix).
这样,通过权重矩阵对CNNLF的输入和输出进行加权,可以使得神经网络环路滤波器的输出更加接近于原始图像。In this way, the input and output of CNNLF are weighted by the weight matrix, which can make the output of the neural network loop filter closer to the original image.
还需要说明的是,根据颜色分量类型的不同,权重矩阵包括亮度权重矩阵和色度权重矩阵;这样,对于目标重建图像块来说,也可以包括亮度分量的目标重建图像块和色度分量的目标重建图像块。在一种具体的示例中,对于亮度分量,所述利用亮度权重矩阵网络模型确定亮度权重矩阵,可以包括:It should also be noted that, according to the different types of color components, the weight matrix includes a luminance weight matrix and a chrominance weight matrix; in this way, for the target reconstructed image block, the target reconstructed image block of the luminance component and the chrominance component can also be included. The target reconstructed image patch. In a specific example, for the luminance component, the determining the luminance weight matrix using the luminance weight matrix network model may include:
确定神经网络环路滤波器的输入亮度重建图像块和输出亮度重建图像块;Determine the input luminance reconstructed image block and the output luminance reconstructed image block of the neural network loop filter;
将输出亮度重建图像块输入亮度权重矩阵网络模型,得到亮度权重矩阵;Input the output brightness reconstruction image block into the brightness weight matrix network model to obtain the brightness weight matrix;
进一步地,所述利用权重矩阵,确定当前块的目标重建图像块,可以包括:Further, using the weight matrix to determine the target reconstructed image block of the current block may include:
利用所述亮度权重矩阵对输入亮度重建图像块和输出亮度重建图像块进行加权处理,得到当前块的亮度分量的目标重建图像块。The input luminance reconstructed image block and the output luminance reconstructed image block are weighted by using the luminance weight matrix to obtain the target reconstructed image block of the luminance component of the current block.
在另一种具体的示例中,对于色度分量,所述利用色度权重矩阵网络模型确定色度权重矩阵,可以包括:In another specific example, for the chrominance component, the determining the chrominance weight matrix using the chrominance weight matrix network model may include:
确定神经网络环路滤波器的输入色度重建图像块和输出色度重建图像块;Determine the input chrominance reconstructed image block and the output chrominance reconstructed image block of the neural network loop filter;
将输出色度重建图像块输入色度权重矩阵网络模型,得到色度权重矩阵;Input the output chrominance reconstruction image block into the chrominance weight matrix network model to obtain the chrominance weight matrix;
进一步地,所述利用权重矩阵,确定当前块的目标重建图像块,可以包括:Further, using the weight matrix to determine the target reconstructed image block of the current block may include:
利用色度权重矩阵对输入色度重建图像块和输出色度重建图像块进行加权处理,得到当前块的色度分量的目标重建图像块。The input chrominance reconstructed image block and the output chrominance reconstructed image block are weighted by using the chrominance weight matrix to obtain the target reconstructed image block of the chrominance component of the current block.
需要说明的是,对于输入重建图像块,根据颜色分量类型的不同,可以是指输入亮度重建图像块,也可以是指输入色度重建图像块;对于输出重建图像块,根据颜色分量类型的不同,可以是指输出亮度重建图像块,也可以是指输出色度重建图像块。这样,根据输入亮度重建图像块和输出亮度重建图像块可以加权计算得到亮度分量的目标重建图像块;根据输入色度重建图像块和输出色度重建图像块可以加权计算得到色度分量的目标重建图像块。It should be noted that, for the input reconstructed image block, depending on the type of color components, it may refer to the input luminance reconstructed image block, or it may refer to the input chrominance reconstructed image block; for the output reconstructed image block, according to the different color component types , which can refer to the output luminance reconstructed image block or the output chrominance reconstructed image block. In this way, the target reconstructed image block of the luminance component can be obtained by weighted calculation according to the input luminance reconstructed image block and the output luminance reconstructed image block; image block.
还需要说明的是,对于输入重建图像块(包括输入亮度重建图像块或者输入色度重建图像块)来说,这里,输入重建图像块可以是经由去块滤波器和样值自适应补偿滤波器进行滤波处理后得到。It should also be noted that, for input reconstructed image blocks (including input luminance reconstructed image blocks or input chrominance reconstructed image blocks), here, the input reconstructed image blocks may be obtained through a deblocking filter and a sample adaptive compensation filter. obtained after filtering.
除此之外,在一些实施例中,该方法还可以包括:在确定出当前块的目标重建图像块之后,利用自适应修正滤波器继续对目标重建图像块进行滤波处理。Besides, in some embodiments, the method may further include: after the target reconstructed image block of the current block is determined, using an adaptive correction filter to continue filtering the target reconstructed image block.
也就是说,如果当前块使用权重矩阵进行滤波处理,那么自适应修正滤波器的输入是目标重建图像块;如果当前块不使用权重矩阵进行滤波处理,那么这时候不需要对CNNLF的输出进行加权,即自适应修正滤波器的输入是输出重建图像块。That is to say, if the current block uses the weight matrix for filtering, the input of the adaptive correction filter is the target reconstructed image block; if the current block does not use the weight matrix for filtering, then the output of CNNLF does not need to be weighted at this time. , that is, the input of the adaptive correction filter is the output reconstructed image block.
简言之,本申请实施例提出了一种基于深度学习的权重矩阵,用于对神经网络环路滤波器的输出进行加权,使得神经网络环路滤波器的输出更加接近于原始图像。这里,权重矩阵网络模型对应的网络结构可以选用多层卷积神经网络,输入为神经网络环路滤波器的输出重建图像块,输出为经过加权处理后的新的重建图像块(即前述实施例所述的“目标重建图像块”)。权重矩阵模块位于编码器/解码器中位置如图7所示,Weighting Matrix为图中的权重矩阵模块,该权重矩阵模块的使用不依赖于DBF、SAO、ALF、CNNLF的标志位,只是在位置上置于CNNLF之后,ALF之前。In short, the embodiment of the present application proposes a weight matrix based on deep learning, which is used to weight the output of the neural network loop filter, so that the output of the neural network loop filter is closer to the original image. Here, the network structure corresponding to the weight matrix network model can be selected from a multi-layer convolutional neural network, the input is the output reconstructed image block of the neural network loop filter, and the output is a new reconstructed image block after weighting processing (that is, the foregoing embodiment). the "target reconstructed image patch"). The position of the weight matrix module in the encoder/decoder is shown in Figure 7. The Weighting Matrix is the weight matrix module in the figure. The use of the weight matrix module does not depend on the flag bits of DBF, SAO, ALF, and CNNLF, but only in the position It is placed after CNNLF and before ALF.
另外,基于深度学习的权重矩阵是否被选中可以由编码器决定,在编码器侧,当进入环路滤波模块时,可以将CNNLF的输入重建图像块标记为I rec,将CNNLF的输出重建图像块标记为I net,将I net作为权重矩阵网络模型的输入,输出可以得到权重矩阵W,最终的输出I out可以由式(3)得到,如下所示, In addition, whether the weight matrix based on deep learning is selected can be determined by the encoder. On the encoder side, when entering the loop filtering module, the input reconstructed image block of CNNLF can be marked as I rec , and the output reconstructed image block of CNNLF can be marked as I rec . It is marked as I net , and I net is used as the input of the weight matrix network model, the output can obtain the weight matrix W, and the final output I out can be obtained by formula (3), as shown below,
I out=W*I net+(1-W)*I rec       (3) Iout =W* Inet +(1-W)* Irec (3)
进一步地,本申请实施例为亮度分量设置有帧级标志位与CTU级标志位以控制是否打开,为色度分量设置有帧级标志位以控制是否打开。具体地,帧级标志位可以由式(4)确定,其中,D=D out-D rec表示权重矩阵模块处理后减少的失真(D out为权重矩阵模块处理后的失真,D rec为权重矩阵模块处理前的失真),R为当前帧的CTU个数,λ与自适应修正滤波器的λ保持一致。这时候,当RDcost为负时,打开帧级权重矩阵模块,否则关闭帧级权重矩阵模块。 Further, in the embodiment of the present application, a frame-level flag bit and a CTU-level flag bit are set for the luminance component to control whether to turn on, and a frame-level flag bit is set for the chrominance component to control whether to turn on. Specifically, the frame-level flag bit can be determined by equation (4), where D=D out - D rec represents the distortion reduced after processing by the weight matrix module (D out is the distortion processed by the weight matrix module, D rec is the weight matrix Distortion before module processing), R is the number of CTUs in the current frame, and λ is consistent with the λ of the adaptive correction filter. At this time, when RDcost is negative, the frame-level weight matrix module is turned on, otherwise the frame-level weight matrix module is turned off.
RDcost=D+λ*R          (4)RDcost=D+λ*R (4)
当帧级标志位打开时,还可以进一步通过率失真代价方式决策出每一个CTU是否打开权重矩阵模块。具体地,CTU级标志位可以由式(5)确定。When the frame-level flag is turned on, it can be further decided whether to turn on the weight matrix module for each CTU through the rate-distortion cost method. Specifically, the CTU-level flag bit can be determined by equation (5).
RDcost=D           (5)RDcost=D (5)
在这里,权重矩阵模块的标志位情况将被编入码流供解码器读取。在解码器侧,当解析出权重矩阵模块打开时,这时候将按照式(3)对CNNLF的输入和输出进行加权处理;当解析出权重矩阵模块关闭时,这时候不做加权处理。Here, the flag bit status of the weight matrix module will be encoded into the code stream for the decoder to read. On the decoder side, when the parsed weight matrix module is turned on, the input and output of CNNLF will be weighted according to formula (3).
在一种具体的示例中,本申请实施例的技术方案作用在编码器的环路滤波模块中,其具体流程如下:In a specific example, the technical solutions of the embodiments of the present application act on the loop filtering module of the encoder, and the specific process is as follows:
编码器进入环路滤波模块时,按照预设的滤波器顺序进行处理。这里,预设的滤波器顺序为DBF滤波---->SAO滤波---->CNNLF滤波---->权重矩阵模块---->ALF滤波。当进入权重矩阵模块时,When the encoder enters the loop filter module, it is processed according to the preset filter order. Here, the preset filter sequence is DBF filtering---->SAO filtering---->CNNLF filtering---->weight matrix module---->ALF filtering. When entering the weight matrix module,
(a)首先根据当前块的颜色分量类型和量化参数,选择对应的权重矩阵网络模型。将CNNLF的输出重建图像块作为该权重矩阵网络模型的输入,该权重矩阵网络模型的输出得到权重矩阵。将CNNLF的输出重建图像块和CNNLF的输入重建图像块根据所得到的权重矩阵进行加权处理,可以得到最终的目标重建图像块;(a) First, select the corresponding weight matrix network model according to the color component type and quantization parameter of the current block. The output reconstructed image block of CNNLF is used as the input of the weight matrix network model, and the output of the weight matrix network model obtains the weight matrix. The output reconstructed image block of CNNLF and the input reconstructed image block of CNNLF are weighted according to the obtained weight matrix, and the final target reconstructed image block can be obtained;
(b)对于亮度分量,首先计算输出重建图像块与原始图像块的均方误差值,累计计算得到当前帧的均方误差值。然后通过率失真代价方式进行决策,若确定使用权重矩阵模块后的率失真代价值小于未使用权重矩阵模块,则将luma_frame_weighting_matrix_flag置为“1”,否则置为“0”。若luma_frame_weighting_matrix_flag为“0”,则跳至(d)。否则,进一步根据当前帧中各个CTU的均方误差值,通过率失真代价方式进行决策,若确定使用权重矩阵模块后的率失真代价值小于未使用权重矩阵模块,则将luma_ctu_weighting_matrix_flag置为“1”,否则置为“0”;(b) For the luminance component, first calculate the mean square error value between the output reconstructed image block and the original image block, and accumulate the mean square error value of the current frame. Then, the decision is made by the rate-distortion cost method. If it is determined that the rate-distortion cost value after using the weight matrix module is less than that of the unused weight matrix module, set luma_frame_weighting_matrix_flag to "1", otherwise, set it to "0". If luma_frame_weighting_matrix_flag is "0", go to (d). Otherwise, according to the mean square error value of each CTU in the current frame, the decision is made by the rate-distortion cost method. If it is determined that the rate-distortion cost value after using the weight matrix module is less than the weight matrix module that is not used, then set luma_ctu_weighting_matrix_flag to "1" , otherwise set to "0";
(c)对于色度分量,首先计算输出重建图像块与原始图像块的均方误差值,累计计算得到当前帧的均方误差值。然后通过率失真代价方式进行决策,若确定使用权重矩阵模块后的率失真代价值小于未使用权重矩阵模块,则将chroma_frame_weighting_matrix_flag置为“1”,否则置为“0”;(c) For the chrominance component, the mean square error value between the output reconstructed image block and the original image block is first calculated, and the mean square error value of the current frame is obtained by cumulative calculation. Then, the decision is made through the rate-distortion cost method. If it is determined that the rate-distortion cost value after using the weight matrix module is smaller than the unused weight matrix module, set chroma_frame_weighting_matrix_flag to "1", otherwise set it to "0";
(d)若当前帧已完成权重矩阵模块的决策,则加载下一帧进行处理,然后跳转至(a)。(d) If the current frame has completed the decision of the weight matrix module, load the next frame for processing, and then jump to (a).
在实现中,对于亮度分量而言,其语法元素的修改如表1所示;对于色度分量而言,其语法元素的修改如表2所示。In the implementation, for the luma component, the modification of its syntax elements is shown in Table 1; for the chroma component, the modification of its syntax elements is shown in Table 2.
也就是说,在本申请实施例中,通过将HPM-ModAI的CNNLF的输出重建图像块输入到权重矩阵网络模型(多层卷积神经网络)中,提取特征信息输出权重矩阵,从而可以为CNNLF的使用提供了像素级别的加权处理,使得编码性能提升。That is to say, in the embodiment of the present application, by inputting the reconstructed image block of the CNNLF output of HPM-ModAI into the weight matrix network model (multi-layer convolutional neural network), the feature information is extracted and the weight matrix is output, so that the CNNLF can be The use of provides pixel-level weighting, resulting in improved coding performance.
在本申请的又一实施例中,本申请实施例提供了一种码流,该码流是根据至少一个语法元素标识信息的取值进行比特编码生成的。In another embodiment of the present application, the embodiment of the present application provides a code stream, where the code stream is generated by bit encoding according to the value of at least one syntax element identification information.
在申请实施例中,至少一个语法元素标识信息至少可以包括:第一语法元素标识信息、第一亮度语法元素标识信息、第二亮度语法元素标识信息和色度语法元素标识信息。In the application embodiment, the at least one syntax element identification information may at least include: first syntax element identification information, first luma syntax element identification information, second luma syntax element identification information, and chroma syntax element identification information.
其中,第一语法元素标识信息用于指示视频序列是否使用权重矩阵进行滤波处理,第一亮度语法元素标识信息用于指示当前帧的亮度分量是否使用权重矩阵进行滤波处理,第二亮度语法元素标识信息用于指示当前块的亮度分量是否使用权重矩阵进行滤波处理,色度语法元素标识信息用于指示当前帧的色度分量是否使用权重矩阵进行滤波处理;其中,视频序列可以包括当前帧,当前帧可以包括当前块。Wherein, the first syntax element identification information is used to indicate whether the video sequence is filtered using the weight matrix, the first luminance syntax element identification information is used to indicate whether the luminance component of the current frame is filtered using the weight matrix, and the second luminance syntax element identification The information is used to indicate whether the luminance component of the current block is filtered using the weight matrix, and the chroma syntax element identification information is used to indicate whether the chroma component of the current frame is filtered using the weight matrix; wherein, the video sequence may include the current frame, the current A frame may include the current block.
还需要说明的是,第一亮度语法元素标识信息和色度语法元素标识信息可以为帧级标志,第二亮度语法元素标识信息可以为CTU级标志。在这里,基于神经网络的权重矩阵的亮度分量帧级标志(即第一亮度语法元素标识信息)为luma_frame_weighting_matrix_flag;基于神经网络的权重矩阵的亮度分量CTU级标志(即第二亮度语法元素标识信息)为luma_ctu_weighting_matrix_flag;基于神经网络的权重矩阵的色度分量帧级标志(即色度语法元素标识信息)为chroma_frame_weighting_matrix_flag。It should also be noted that the first luma syntax element identification information and the chroma syntax element identification information may be frame-level marks, and the second luma syntax element identification information may be CTU-level marks. Here, the frame-level flag of the luma component based on the weight matrix of the neural network (that is, the first luma syntax element identification information) is luma_frame_weighting_matrix_flag; the CTU-level flag of the luma component based on the weight matrix of the neural network (that is, the identification information of the second luma syntax element) is luma_ctu_weighting_matrix_flag; the chroma component frame-level flag (ie, chroma syntax element identification information) of the neural network-based weighting matrix is chroma_frame_weighting_matrix_flag.
本实施例提供了一种编码方法,具体提供了一种环路滤波方法,应用于编码器。通过确定当前块的权重矩阵网络模型,并根据权重矩阵网络模型确定当前块的权重矩阵;确定至少一个语法元素标识信息的取值;当至少一个语法元素标识信息指示当前帧或当前块使用权重矩阵进行滤波处理时,利用权重矩阵确定当前块的目标重建图像块。这样,通过利用权重矩阵网络模型来确定权重矩阵,不仅可以实现基于深度学习的权重矩阵技术,能够为输出重建图像块的使用提供像素级别的加权处理,而且还可以提升编码性能,进而能够提高编解码效率;另外本申请还可以使得神经网络环路滤波器的输出更加接近于原始图像,能够提升视频图像质量。This embodiment provides an encoding method, and specifically provides a loop filtering method, which is applied to an encoder. By determining the weight matrix network model of the current block, and determining the weight matrix of the current block according to the weight matrix network model; determining the value of at least one syntax element identification information; when the at least one syntax element identification information indicates the current frame or the current block, the weight matrix is used During the filtering process, the weight matrix is used to determine the target reconstructed image block of the current block. In this way, by using the weight matrix network model to determine the weight matrix, it can not only realize the weight matrix technology based on deep learning, but also provide pixel-level weighting processing for the use of the output reconstructed image block, but also improve the coding performance, which in turn can improve the coding performance. Decoding efficiency; in addition, the present application can also make the output of the neural network loop filter closer to the original image, which can improve the video image quality.
在本申请的再一实施例中,基于前述实施例相同的发明构思,参见图11,其示出了本申请实施例提供的一种编码器110的组成结构示意图。如图11所示,该编码器110可以包括:第一确定单元1101和第一滤波单元1102;其中,In yet another embodiment of the present application, based on the same inventive concept as the foregoing embodiments, see FIG. 11 , which shows a schematic structural diagram of an encoder 110 provided by an embodiment of the present application. As shown in FIG. 11 , the encoder 110 may include: a first determining unit 1101 and a first filtering unit 1102; wherein,
第一确定单元1101,配置为确定当前块的权重矩阵网络模型,并根据权重矩阵网络模型确定当前块的权重矩阵;以及还配置为确定至少一个语法元素标识信息的取值;The first determining unit 1101 is configured to determine a weight matrix network model of the current block, and determine the weight matrix of the current block according to the weight matrix network model; and is also configured to determine the value of at least one syntax element identification information;
第一滤波单元1102,配置为当至少一个语法元素标识信息指示当前帧或当前块使用权重矩阵进行滤波处理时,利用权重矩阵确定当前块的目标重建图像块。The first filtering unit 1102 is configured to use the weight matrix to determine the target reconstructed image block of the current block when the at least one syntax element identification information indicates that the current frame or the current block uses the weight matrix for filtering processing.
在一些实施例中,第一确定单元1101,还配置为当当前块的颜色分量类型为亮度分量时,确定当前块的亮度权重矩阵网络模型;当当前块的颜色分量类型为色度分量时,确定当前块的色度权重矩阵网络模型。In some embodiments, the first determining unit 1101 is further configured to determine the luminance weight matrix network model of the current block when the color component type of the current block is a luminance component; when the color component type of the current block is a chrominance component, Determines the chroma weight matrix network model for the current block.
在一些实施例中,第一确定单元1101,还配置为在当前块的颜色分量类型为亮度分量的情况下,确定至少一个候选亮度权重矩阵网络模型;以及确定当前块的量化参数,从至少一个候选亮度权重矩阵网络模型中选取量化参数对应的候选亮度权重矩阵网络模型;以及将所选取的候选亮度权重矩阵网络模型确定为当前块的亮度权重矩阵网络模型。In some embodiments, the first determining unit 1101 is further configured to, when the color component type of the current block is a luminance component, determine at least one candidate luminance weight matrix network model; and determine the quantization parameter of the current block, from at least one The candidate brightness weight matrix network model corresponding to the quantization parameter is selected from the candidate brightness weight matrix network model; and the selected candidate brightness weight matrix network model is determined as the brightness weight matrix network model of the current block.
第一确定单元1101,还配置为在当前块的颜色分量类型为色度分量的情况下,确定至少一个候选色度权重矩阵网络模型;以及确定当前块的量化参数,从至少一个候选色度权重矩阵网络模型中选取量化参数对应的候选色度权重矩阵网络模型;以及将所选取的候选色度权重矩阵网络模型确定为当前块的色度权重矩阵网络模型。The first determination unit 1101 is further configured to determine at least one candidate chrominance weight matrix network model when the color component type of the current block is a chrominance component; and determine the quantization parameter of the current block, from at least one candidate chrominance weight In the matrix network model, a candidate chrominance weight matrix network model corresponding to the quantization parameter is selected; and the selected candidate chrominance weight matrix network model is determined as the chrominance weight matrix network model of the current block.
在一些实施例中,参见图11,编码器110还可以包括第一训练单元1103;In some embodiments, referring to FIG. 11 , the encoder 110 may further include a first training unit 1103;
第一确定单元1101,还配置为确定至少一个训练样本,其中,训练样本是根据至少一种量化参数得到的;The first determining unit 1101 is further configured to determine at least one training sample, wherein the training sample is obtained according to at least one quantization parameter;
第一训练单元1103,配置为利用至少一个训练样本的亮度分量对预设神经网络模型进行训练,得到至少一个候选亮度权重矩阵网络模型;以及利用至少一个训练样本的色度分量对预设神经网络模型进行训练,得到至少一个候选色度权重矩阵网络模型;其中,至少一个候选亮度权重矩阵网络模型与亮度分量和量化参数之间具有对应关系,至少一个候选色度权重矩阵网络模型与色度分量和量化参数之间具有对应关系。The first training unit 1103 is configured to use the luminance component of at least one training sample to train the preset neural network model to obtain at least one candidate luminance weight matrix network model; and use the chrominance component of at least one training sample to train the preset neural network model. The model is trained to obtain at least one candidate chrominance weight matrix network model; wherein, at least one candidate brightness weight matrix network model has a corresponding relationship with the brightness component and the quantization parameter, and at least one candidate chrominance weight matrix network model and the chrominance component. and quantization parameters have a corresponding relationship.
在一些实施例中,预设神经网络模型包括下述至少之一:至少一个卷积层、至少一个激活层和跳转连接层。In some embodiments, the preset neural network model includes at least one of the following: at least one convolutional layer, at least one activation layer, and a skip connection layer.
在一些实施例中,第一确定单元1101,还配置为若确定视频序列使用权重矩阵进行滤波处理,则确定第一语法元素标识信息的取值为第一值;或者,若确定视频序列不使用权重矩阵进行滤波处理,则确定第一语法元素标识信息的取值为第二值。In some embodiments, the first determining unit 1101 is further configured to determine the value of the first syntax element identification information as the first value if it is determined that the video sequence is filtered using the weight matrix; or, if it is determined that the video sequence does not use The weight matrix is filtered, and the value of the identification information of the first syntax element is determined to be the second value.
在一些实施例中,参见图11,编码器110还可以包括编码单元1104,配置为对第一语法元素标识信息的取值进行编码,将编码比特写入码流。In some embodiments, referring to FIG. 11 , the encoder 110 may further include an encoding unit 1104, configured to encode the value of the identification information of the first syntax element, and write the encoded bits into the code stream.
在一些实施例中,在确定视频序列使用权重矩阵进行滤波处理之后,第一确定单元1101,还配置为当当前帧的颜色分量类型为亮度分量时,确定权重矩阵为亮度权重矩阵;以及确定视频序列内当前帧的亮度分量使用亮度权重矩阵进行滤波处理的第一率失真代价值;以及确定视频序列内当前帧的亮度分量未使用亮度权重矩阵进行滤波处理的第二率失真代价值;以及若第一率失真代价值小于第二率失真代价值,则确定第一亮度语法元素标识信息的取值为第一值;或者,若第一率失真代价值大于或等于第二率失真代价值,则确定第一亮度语法元素标识信息的取值为第二值。In some embodiments, after determining that the video sequence is filtered using the weight matrix, the first determining unit 1101 is further configured to, when the color component type of the current frame is a luminance component, determine that the weight matrix is a luminance weight matrix; and determine the video A first rate-distortion cost value for the luminance component of the current frame in the sequence to be filtered using the luminance weighting matrix; and a second rate-distortion cost for determining the luminance component of the current frame in the video sequence that is not filtered using the luminance weighting matrix; and if If the first rate-distortion cost value is less than the second rate-distortion cost value, it is determined that the value of the first luminance syntax element identification information is the first value; or, if the first rate-distortion cost value is greater than or equal to the second rate-distortion cost value, Then, it is determined that the value of the identification information of the first luma syntax element is the second value.
在一些实施例中,编码单元1104,还配置为对第一亮度语法元素标识信息的取值进行编码,将编码比特写入码流。In some embodiments, the encoding unit 1104 is further configured to encode the value of the identification information of the first luma syntax element, and write the encoded bits into the code stream.
在一些实施例中,参见图11,编码器110还可以包括第一设置单元1105,配置为设置亮度帧级标志位,亮度帧级标志位用于控制当前帧的亮度分量是否使用权重矩阵进行滤波处理;In some embodiments, referring to FIG. 11 , the encoder 110 may further include a first setting unit 1105 configured to set a luminance frame-level flag, where the luminance frame-level flag is used to control whether the luminance component of the current frame is filtered using a weight matrix deal with;
相应地,第一确定单元1101,还配置为若第一率失真代价值小于第二率失真代价值,则打开亮度 帧级标志位;或者,若第一率失真代价值大于或等于第二率失真代价值,则关闭亮度帧级标志位。Correspondingly, the first determining unit 1101 is further configured to turn on the luminance frame level flag if the first rate-distortion cost value is less than the second rate-distortion cost value; or, if the first rate-distortion cost value is greater than or equal to the second rate-distortion cost value. Distortion cost value, turn off the luminance frame level flag.
在一些实施例中,第一确定单元1101,还配置为对当前帧进行块划分,确定至少一个划分块;其中,至少一个划分块包括当前块;以及分别计算至少一个划分块的亮度分量使用亮度权重矩阵进行滤波处理的第三率失真代价值,并对计算得到的第三率失真代价值进行累加计算,得到第一率失真代价值;以及分别计算至少一个划分块的亮度分量未使用亮度权重矩阵进行滤波处理的第四率失真代价值,并对计算得到的第四率失真代价值进行累加计算,得到第二率失真代价值。In some embodiments, the first determining unit 1101 is further configured to perform block division on the current frame, and determine at least one divided block; wherein the at least one divided block includes the current block; and separately calculate the luminance component of the at least one divided block using luminance The third rate-distortion cost value of the filtering processing is performed on the weight matrix, and the calculated third rate-distortion cost value is accumulated to obtain the first rate-distortion cost value; The matrix performs filtering processing on the fourth rate-distortion cost value, and accumulates the calculated fourth rate-distortion cost value to obtain the second rate-distortion cost value.
在一些实施例中,第一确定单元1101,还配置为当第一率失真代价值小于第二率失真代价值时,确定当前块的亮度分量使用亮度权重矩阵进行滤波处理的第三率失真代价值;以及确定当前块的亮度分量未使用亮度权重矩阵进行滤波处理的第四率失真代价值;以及若第三率失真代价值小于第四率失真代价值,则确定第二亮度语法元素标识信息的取值为第一值;或者,若第三率失真代价值大于或等于第四率失真代价值,则确定第二亮度语法元素标识信息的取值为第二值。In some embodiments, the first determining unit 1101 is further configured to, when the first rate-distortion cost value is less than the second rate-distortion cost value, determine a third rate-distortion code for filtering the luminance component of the current block using the luminance weight matrix. and determining the fourth rate-distortion cost value for which the luma component of the current block is not filtered using the luma weight matrix; and if the third rate-distortion cost value is less than the fourth rate-distortion cost value, then determining the second luma syntax element identification information The value of is the first value; or, if the third rate-distortion cost value is greater than or equal to the fourth rate-distortion cost value, the value of the second luma syntax element identification information is determined to be the second value.
在一些实施例中,编码单元1104,还配置为对第二亮度语法元素标识信息的取值进行编码,将编码比特写入码流。In some embodiments, the encoding unit 1104 is further configured to encode the value of the identification information of the second luma syntax element, and write the encoded bits into the code stream.
在一些实施例中,第一设置单元1105,还配置为设置亮度CTU级标志位,亮度CTU级标志位用于控制当前块的亮度分量是否使用亮度权重矩阵进行滤波处理;In some embodiments, the first setting unit 1105 is further configured to set the luminance CTU level flag bit, and the luminance CTU level flag bit is used to control whether the luminance component of the current block is filtered using the luminance weight matrix;
相应地,第一确定单元1101,还配置为若第三率失真代价值小于第四率失真代价值,则打开亮度CTU级标志位;或者,若第三率失真代价值大于或等于第四率失真代价值,则关闭亮度CTU级标志位。Correspondingly, the first determining unit 1101 is further configured to turn on the luminance CTU level flag if the third rate-distortion cost value is less than the fourth rate-distortion cost value; or, if the third rate-distortion cost value is greater than or equal to the fourth rate-distortion cost value. Distortion cost value, turn off the brightness CTU level flag.
在一些实施例中,第一确定单元1101,还配置为若第三率失真代价值小于第四率失真代价值,则利用亮度权重矩阵确定当前块的目标重建图像块。In some embodiments, the first determining unit 1101 is further configured to use the luminance weight matrix to determine the target reconstructed image block of the current block if the third rate-distortion cost value is less than the fourth rate-distortion cost value.
在一些实施例中,在确定视频序列使用权重矩阵进行滤波处理之后,第一确定单元1101,还配置为当当前帧的颜色分量类型为色度分量时,确定权重矩阵为色度权重矩阵;以及确定视频序列内当前帧的色度分量使用色度权重矩阵进行滤波处理的第五率失真代价值;以及确定视频序列内的当前帧的色度分量未使用色度权重矩阵进行滤波处理的第六率失真代价值;以及若第五率失真代价值小于第六率失真代价值,则确定色度语法元素标识信息的取值为第一值;或者,若第五率失真代价值大于或等于第六率失真代价值,则确定色度语法元素标识信息的取值为第二值。In some embodiments, after determining that the video sequence is filtered using the weight matrix, the first determining unit 1101 is further configured to determine that the weight matrix is a chroma weight matrix when the color component type of the current frame is a chroma component; and A fifth rate-distortion cost value for determining the chrominance component of the current frame in the video sequence is filtered using the chrominance weighting matrix; rate-distortion cost value; and if the fifth rate-distortion cost value is less than the sixth rate-distortion cost value, determining that the value of the chroma syntax element identification information is the first value; or, if the fifth rate-distortion cost value is greater than or equal to the sixth rate-distortion cost value If the rate-distortion cost value is 6, it is determined that the value of the chroma syntax element identification information is the second value.
在一些实施例中,编码单元1104,还配置为对色度语法元素标识信息的取值进行编码,将编码比特写入码流。In some embodiments, the encoding unit 1104 is further configured to encode the value of the identification information of the chroma syntax element, and write the encoded bits into the code stream.
在一些实施例中,第一设置单元1105,还配置为设置色度帧级标志位,色度帧级标志位用于控制当前帧的色度分量是否使用权重矩阵进行滤波处理;In some embodiments, the first setting unit 1105 is further configured to set a chroma frame-level flag bit, and the chroma frame-level flag bit is used to control whether the chroma components of the current frame are filtered using a weight matrix;
相应地,第一确定单元1101,还配置为若第五率失真代价值小于第六率失真代价值,则打开色度帧级标志位;或者,若第五率失真代价值大于或等于第六率失真代价值,则关闭色度帧级标志位。Correspondingly, the first determining unit 1101 is further configured to turn on the chroma frame-level flag if the fifth rate-distortion cost value is less than the sixth rate-distortion cost value; or, if the fifth rate-distortion cost value is greater than or equal to the sixth rate-distortion cost value. If the rate-distortion cost value is set, the chroma frame-level flag is turned off.
在一些实施例中,第一值为1,第二值为0。In some embodiments, the first value is one and the second value is zero.
在一些实施例中,第一确定单元1101,还配置为若第五率失真代价值小于第六率失真代价值,则利用色度权重矩阵确定当前块的目标重建图像块。In some embodiments, the first determining unit 1101 is further configured to use the chrominance weight matrix to determine the target reconstructed image block of the current block if the fifth rate-distortion cost value is less than the sixth rate-distortion cost value.
在一些实施例中,第一确定单元1101,还配置为确定神经网络环路滤波器的输入重建图像块和输出重建图像块;以及将输出重建图像块输入权重矩阵网络模型,得到当前块的权重矩阵。In some embodiments, the first determining unit 1101 is further configured to determine the input reconstructed image block and the output reconstructed image block of the neural network loop filter; and input the output reconstructed image block into the weight matrix network model to obtain the weight of the current block matrix.
在一些实施例中,第一滤波单元1102,具体配置为利用权重矩阵对输入重建图像块和输出重建图像块进行加权处理,得到目标重建图像块。In some embodiments, the first filtering unit 1102 is specifically configured to use a weight matrix to perform weighting processing on the input reconstructed image block and the output reconstructed image block to obtain the target reconstructed image block.
在一些实施例中,第一确定单元1101,还配置为当当前块的颜色分量类型为亮度分量时,利用亮度权重矩阵网络模型确定亮度权重矩阵;当当前块的颜色分量类型为色度分量时,利用色度权重矩阵网络模型确定色度权重矩阵。In some embodiments, the first determining unit 1101 is further configured to use a luminance weight matrix network model to determine a luminance weight matrix when the color component type of the current block is a luminance component; when the color component type of the current block is a chrominance component , using the chrominance weight matrix network model to determine the chrominance weight matrix.
在一些实施例中,第一确定单元1101,还配置为当当前块的颜色分量类型为亮度分量时,确定神经网络环路滤波器的输入亮度重建图像块和输出亮度重建图像块;以及将输出亮度重建图像块输入亮度权重矩阵网络模型,得到亮度权重矩阵;In some embodiments, the first determining unit 1101 is further configured to, when the color component type of the current block is a luminance component, determine the input luminance reconstructed image block and the output luminance reconstructed image block of the neural network loop filter; Input the brightness weight matrix network model to the brightness reconstruction image block, and obtain the brightness weight matrix;
第一滤波单元1102,还配置为利用亮度权重矩阵对输入亮度重建图像块和输出亮度重建图像块进行加权处理,得到当前块的亮度分量的目标重建图像块。The first filtering unit 1102 is further configured to perform weighting processing on the input luminance reconstructed image block and the output luminance reconstructed image block by using the luminance weight matrix to obtain the target reconstructed image block of the luminance component of the current block.
在一些实施例中,第一确定单元1101,还配置为当当前块的颜色分量类型为色度分量时,确定神经网络环路滤波器的输入色度重建图像块和输出色度重建图像块;以及将输出色度重建图像块输入色度权重矩阵网络模型,得到色度权重矩阵;In some embodiments, the first determining unit 1101 is further configured to determine the input chrominance reconstructed image block and the output chrominance reconstructed image block of the neural network loop filter when the color component type of the current block is a chrominance component; and inputting the output chrominance reconstruction image block into the chrominance weight matrix network model to obtain the chrominance weight matrix;
第一滤波单元1102,还配置为利用色度权重矩阵对输入色度重建图像块和输出色度重建图像块进行加权处理,得到当前块的色度分量的目标重建图像块。The first filtering unit 1102 is further configured to perform weighting processing on the input chrominance reconstructed image block and the output chrominance reconstructed image block by using the chrominance weight matrix to obtain the target reconstructed image block of the chrominance component of the current block.
在一些实施例中,输入重建图像块是经由去块滤波器和样值自适应补偿滤波器进行滤波处理后得到。In some embodiments, the input reconstructed image block is obtained after filtering through a deblocking filter and a sample adaptive compensation filter.
在一些实施例中,第一滤波单元1102,还配置为在确定出当前块的目标重建图像块之后,利用自适应修正滤波器继续对目标重建图像块进行滤波处理。In some embodiments, the first filtering unit 1102 is further configured to, after determining the target reconstructed image block of the current block, use an adaptive correction filter to continue filtering the target reconstructed image block.
可以理解地,在本申请实施例中,“单元”可以是部分电路、部分处理器、部分程序或软件等等,当然也可以是模块,还可以是非模块化的。而且在本实施例中的各组成部分可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。It can be understood that, in the embodiments of the present application, a "unit" may be a part of a circuit, a part of a processor, a part of a program or software, etc., of course, it may also be a module, and it may also be non-modular. Moreover, each component in this embodiment may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware, or can be implemented in the form of software function modules.
所述集成的单元如果以软件功能模块的形式实现并非作为独立的产品进行销售或使用时,可以存储在一个计算机可读取存储介质中,基于这样的理解,本实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或processor(处理器)执行本实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of 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, the technical solution of this embodiment is essentially or The part that contributes to the prior art or the whole or part of the technical solution can be embodied in the form of a software product, the computer software product is stored in a storage medium, and includes several instructions for making a computer device (which can be It is a personal computer, a server, or a network device, etc.) or a processor (processor) that executes all or part of the steps of the method described in this embodiment. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (Read Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program codes.
因此,本申请实施例提供了一种计算机存储介质,应用于编码器110,该计算机存储介质存储有计算机程序,所述计算机程序被第一处理器执行时实现前述实施例中任一项所述的方法。Therefore, an embodiment of the present application provides a computer storage medium, which is applied to the encoder 110, where the computer storage medium stores a computer program, and when the computer program is executed by the first processor, any one of the foregoing embodiments is implemented. Methods.
基于上述编码器110的组成以及计算机存储介质,参见图12,其示出了本申请实施例提供的编码器110的具体硬件结构示意图。如图12所示,可以包括:第一通信接口1201、第一存储器1202和第一处理器1203;各个组件通过第一总线系统1204耦合在一起。可理解,第一总线系统1204用于实现这些组件之间的连接通信。第一总线系统1204除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图12中将各种总线都标为第一总线系统1204。其中,Based on the composition of the encoder 110 and the computer storage medium described above, see FIG. 12 , which shows a schematic diagram of a specific hardware structure of the encoder 110 provided by the embodiment of the present application. As shown in FIG. 12 , it may 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 these components. In addition to the data bus, the first bus system 1204 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the various buses are labeled as the first bus system 1204 in FIG. 12 . in,
第一通信接口1201,用于在与其他外部网元之间进行收发信息过程中,信号的接收和发送;The first communication interface 1201 is used for receiving and sending signals in the process of sending and receiving information with other external network elements;
第一存储器1202,用于存储能够在第一处理器1203上运行的计算机程序;a first memory 1202 for storing computer programs that can run on the first processor 1203;
第一处理器1203,用于在运行所述计算机程序时,执行:The first processor 1203 is configured to, when running the computer program, execute:
确定当前块的权重矩阵网络模型,并根据权重矩阵网络模型确定当前块的权重矩阵;Determine the weight matrix network model of the current block, and determine the weight matrix of the current block according to the weight matrix network model;
确定至少一个语法元素标识信息的取值;Determine the value of at least one syntax element identification information;
当至少一个语法元素标识信息指示当前帧或当前块使用权重矩阵进行滤波处理时,利用权重矩阵确定当前块的目标重建图像块。When the at least one syntax element identification information indicates that the current frame or the current block uses the weight matrix for filtering processing, the weight matrix is used to determine the target reconstructed image block of the current block.
可以理解,本申请实施例中的第一存储器1202可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDRSDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DRRAM)。本申请描述的系统和方法的第一存储器1202旨在包括但不限于这些和任意其它适合类型的存储器。It can be understood that the first memory 1202 in this embodiment of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Wherein, the non-volatile memory may be a read-only memory (Read-Only Memory, ROM), a programmable read-only memory (Programmable ROM, PROM), an erasable programmable read-only memory (Erasable PROM, EPROM), an electrically programmable read-only memory (Erasable PROM, EPROM). Erase programmable read-only memory (Electrically EPROM, EEPROM) or flash memory. Volatile memory may be Random Access Memory (RAM), which acts as an external cache. By way of illustration and not limitation, many forms of RAM are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (Double Data Rate SDRAM, DDRSDRAM), enhanced synchronous dynamic random access memory (Enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (Synchlink DRAM, SLDRAM) And direct memory bus random access memory (Direct Rambus RAM, DRRAM). The first memory 1202 of the systems and methods described herein is intended to include, but not be limited to, these and any other suitable types of memory.
而第一处理器1203可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过第一处理器1203中的硬件的集成逻辑电路或者软件形式的指令完成。上述的第一处理器1203可以是通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于第一存储器1202,第一处理器1203读取第一存储器1202中的信息,结合其硬件完成上述方法的步骤。The first processor 1203 may be an integrated circuit chip with signal processing capability. In the implementation process, each step of the above-mentioned method may be completed by an integrated logic circuit of hardware in the first processor 1203 or an instruction in the form of software. The above-mentioned first processor 1203 can be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a ready-made programmable gate array (Field Programmable Gate Array, FPGA) Or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The methods, steps, and logic block diagrams disclosed in the embodiments of this application can be implemented or executed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in conjunction with the embodiments of the present application may be directly embodied as executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules may be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other storage media mature in the art. 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.
可以理解的是,本申请描述的这些实施例可以用硬件、软件、固件、中间件、微码或其组合来实现。对于硬件实现,处理单元可以实现在一个或多个专用集成电路(Application Specific Integrated Circuits,ASIC)、数字信号处理器(Digital Signal Processing,DSP)、数字信号处理设备(DSP Device,DSPD)、可编程逻辑设备(Programmable Logic Device,PLD)、现场可编程门阵列(Field-Programmable Gate Array, FPGA)、通用处理器、控制器、微控制器、微处理器、用于执行本申请所述功能的其它电子单元或其组合中。对于软件实现,可通过执行本申请所述功能的模块(例如过程、函数等)来实现本申请所述的技术。软件代码可存储在存储器中并通过处理器执行。存储器可以在处理器中或在处理器外部实现。It will be appreciated that the embodiments described herein may be implemented in 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 (ASIC), Digital Signal Processing (DSP), Digital Signal Processing Device (DSP Device, DSPD), programmable Logic Device (Programmable Logic Device, PLD), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA), General Purpose Processor, Controller, Microcontroller, Microprocessor, Others for performing the functions described in this application electronic unit or a combination thereof. For a software implementation, the techniques described herein may be implemented through modules (eg, procedures, functions, etc.) that perform the functions described herein. Software codes may be stored in memory and executed by a processor. The memory can be implemented in the processor or external to the processor.
可选地,作为另一个实施例,第一处理器1203还配置为在运行所述计算机程序时,执行前述实施例中任一项所述的方法。Optionally, as another embodiment, the first processor 1203 is further configured to execute the method described in any one of the foregoing embodiments when running the computer program.
本实施例提供了一种编码器,该编码器可以包括第一确定单元和第一滤波单元。这样,通过利用权重矩阵网络模型来确定权重矩阵,不仅可以实现基于深度学习的权重矩阵技术,能够为输出重建图像块的使用提供像素级别的加权处理,而且还可以提升编码性能,进而能够提高编解码效率;另外本申请还可以使得神经网络环路滤波器的输出更加接近于原始图像,能够提升视频图像质量。This embodiment provides an encoder, and the encoder may include a first determining unit and a first filtering unit. In this way, by using the weight matrix network model to determine the weight matrix, it can not only realize the weight matrix technology based on deep learning, but also provide pixel-level weighting processing for the use of the output reconstructed image block, but also improve the coding performance, which in turn can improve the coding performance. Decoding efficiency; in addition, the present application can also make the output of the neural network loop filter closer to the original image, which can improve the video image quality.
在本申请的再一实施例中,基于前述实施例相同的发明构思,参见图13,其示出了本申请实施例提供的一种解码器130的组成结构示意图。如图13所示,该解码器130可以包括:解析单元1301、第二确定单元1302和第二滤波单元1303;其中,In yet another embodiment of the present application, based on the same inventive concept as the foregoing embodiments, see FIG. 13 , which shows a schematic structural diagram of a decoder 130 provided by an embodiment of the present application. As shown in FIG. 13 , the decoder 130 may include: a parsing unit 1301, a second determining unit 1302 and a second filtering unit 1303; wherein,
解析单元1301,配置为解析码流,确定至少一个语法元素标识信息的取值;A parsing unit 1301, configured to parse the code stream, and determine the value of at least one syntax element identification information;
第二确定单元1302,配置为当至少一个语法元素标识信息指示当前帧或当前块使用权重矩阵进行滤波处理时,确定当前块的权重矩阵网络模型,并根据权重矩阵网络模型确定当前块的权重矩阵;The second determining unit 1302 is configured to determine a weight matrix network model of the current block when the at least one syntax element identification information indicates that the current frame or the current block uses the weight matrix for filtering processing, and determine the weight matrix of the current block according to the weight matrix network model ;
第二滤波单元1303,配置为利用权重矩阵,确定当前块的目标重建图像块。The second filtering unit 1303 is configured to use the weight matrix to determine the target reconstructed image block of the current block.
在一些实施例中,解析单元1301,具体配置为解析码流,确定第一语法元素标识信息的取值;以及当第一语法元素标识信息指示视频序列使用权重矩阵进行滤波处理时,解析码流,确定第二语法元素标识信息的取值;其中,第二语法元素标识信息用于指示视频序列内的当前帧是否使用权重矩阵进行滤波处理,当前帧包括当前块。In some embodiments, the parsing unit 1301 is specifically configured to parse the code stream, and determine the value of the first syntax element identification information; and when the first syntax element identification information indicates that the video sequence is filtered using the weight matrix, parse the code stream , determine the value of the second syntax element identification information; wherein, the second syntax element identification information is used to indicate whether the current frame in the video sequence is filtered by using the weight matrix, and the current frame includes the current block.
在一些实施例中,第二确定单元1302,还配置为若第一语法元素标识信息的取值为第一值,则确定第一语法元素标识信息指示视频序列使用权重矩阵进行滤波处理;或者,若第一语法元素标识信息的取值为第二值,则确定第一语法元素标识信息指示视频序列不使用权重矩阵进行滤波处理。In some embodiments, the second determining unit 1302 is further configured to, if the value of the first syntax element identification information is a first value, determine that the first syntax element identification information indicates that the video sequence is filtered by using a weight matrix; or, 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 the video sequence is not filtered using the weight matrix.
在一些实施例中,第二确定单元1302,还配置为当当前帧的颜色分量类型为亮度分量时,确定第二语法元素标识信息为第一亮度语法元素标识信息,第一亮度语法元素标识信息用于指示当前帧的亮度分量是否使用亮度权重矩阵进行滤波处理;或者,当当前帧的颜色分量类型为色度分量时,确定第二语法元素标识信息为色度语法元素标识信息,色度语法元素标识信息用于指示当前帧的色度分量是否使用色度权重矩阵进行滤波处理。In some embodiments, the second determining unit 1302 is further configured to, when the color component type of the current frame is a luma component, determine that the second syntax element identification information is the first luma syntax element identification information, and the first luma syntax element identification information Used to indicate whether the luminance component of the current frame is filtered using the luminance weight matrix; or, when the color component type of the current frame is a chroma component, determine that the second syntax element identification information is the chroma syntax element identification information, and the chroma syntax The element identification information is used to indicate whether the chroma components of the current frame are filtered using the chroma weight matrix.
在一些实施例中,当颜色分量类型为亮度分量时,解析单元1301,还配置为当第一亮度语法元素标识信息指示当前帧的亮度分量使用亮度权重矩阵进行滤波处理时,解析码流,确定第二亮度语法元素标识信息的取值;In some embodiments, when the color component type is a luminance component, the parsing unit 1301 is further configured to parse the code stream when the first luminance syntax element identification information indicates that the luminance component of the current frame is filtered using a luminance weight matrix, and determine The value of the second luminance syntax element identification information;
第二确定单元1302,还配置为当第二亮度语法元素标识信息指示当前块的亮度分量使用亮度权重矩阵进行滤波处理时,确定当前块的亮度权重矩阵网络模型。The second determining unit 1302 is further configured to determine a luma weight matrix network model of the current block when the second luma syntax element identification information indicates that the luma component of the current block is filtered using the luma weight matrix.
在一些实施例中,参见图13,解码器130还可以包括第二设置单元1304,配置为设置亮度帧级标志位和亮度CTU级标志位;其中,亮度帧级标志位用于控制当前帧的亮度分量是否使用亮度权重矩阵进行滤波处理,亮度CTU级标志位用于控制当前块的亮度分量是否使用亮度权重矩阵进行滤波处理。In some embodiments, referring to FIG. 13 , the decoder 130 may further include a second setting unit 1304 configured to set the luminance frame level flag bit and the luminance CTU level flag bit; wherein the luminance frame level flag bit is used to control the Whether the luminance component is filtered by the luminance weight matrix, the luminance CTU level flag is used to control whether the luminance component of the current block is filtered by the luminance weight matrix.
在一些实施例中,第二确定单元1302,还配置为若第一亮度语法元素标识信息的取值为第一值,则打开亮度帧级标志位;或者,若第一亮度语法元素标识信息的取值为第二值,则关闭亮度帧级标志位。In some embodiments, the second determining unit 1302 is further configured to turn on the luma frame-level flag if the value of the first luma syntax element identification information is the first value; or, if the first luma syntax element identification information If the value is the second value, the brightness frame level flag is turned off.
在一些实施例中,第二确定单元1302,还配置为若第二亮度语法元素标识信息的取值为第一值,则打开亮度CTU级标志位;或者,若第二亮度语法元素标识信息的取值为第二值,则关闭亮度CTU级标志位。In some embodiments, the second determining unit 1302 is further configured to turn on the luminance CTU level flag if the value of the second luminance syntax element identification information is the first value; or, if the second luminance syntax element identification information If the value is the second value, the brightness CTU level flag is turned off.
在一些实施例中,第二确定单元1302,还配置为若第一亮度语法元素标识信息的取值为第一值,则确定第一亮度语法元素标识信息指示当前帧的亮度分量使用亮度权重矩阵进行滤波处理;或者,若第一亮度语法元素标识信息的取值为第二值,则确定第一亮度语法元素标识信息指示当前帧的亮度分量不使用亮度权重矩阵进行滤波处理。In some embodiments, the second determining unit 1302 is further configured to, if the value of the first luma syntax element identification information is a first value, determine that the first luma syntax element identification information indicates that the luma component of the current frame uses a luma weight matrix Perform filtering processing; or, if the value of the first luma syntax element identification information is the second value, determine that the first luma syntax element identification information indicates that the luma component of the current frame is not filtered using the luma weight matrix.
在一些实施例中,第二确定单元1302,还配置为若第二亮度语法元素标识信息的取值为第一值,则确定第二亮度语法元素标识信息指示当前块的亮度分量使用亮度权重矩阵进行滤波处理;或者,若第二亮度语法元素标识信息的取值为第二值,则确定第二亮度语法元素标识信息指示当前块的亮度分量不使用亮度权重矩阵进行滤波处理。In some embodiments, the second determining unit 1302 is further configured to, if the value of the second luma syntax element identification information is the first value, determine that the second luma syntax element identification information indicates that the luma component of the current block uses the luma weight matrix Perform filtering processing; or, if the value of the second luma syntax element identification information is the second value, determine that the second luma syntax element identification information indicates that the luma component of the current block is not filtered using the luma weight matrix.
在一些实施例中,当当前帧的颜色分量类型为色度分量时,第二确定单元1302,还配置为当色度语法元素标识信息指示当前帧的色度分量使用色度权重矩阵进行滤波处理时,确定当前块的色度权重矩 阵网络模型。In some embodiments, when the color component type of the current frame is a chroma component, the second determining unit 1302 is further configured to use the chroma weight matrix for filtering processing when the chroma syntax element identification information indicates that the chroma component of the current frame is filtered When , determine the chrominance weight matrix network model of the current block.
在一些实施例中,第二设置单元1304,还配置为设置色度帧级标志位;其中,色度帧级标志位用于控制当前帧的色度分量是否使用权重矩阵进行滤波处理。In some embodiments, the second setting unit 1304 is further configured to set a chroma frame-level flag bit, wherein the chroma frame-level flag bit is used to control whether the chroma components of the current frame are filtered using a weight matrix.
在一些实施例中,第二确定单元1302,还配置为若色度语法元素标识信息的取值为第一值,则打开色度帧级标志位;或者,若色度语法元素标识信息的取值为第二值,则关闭色度帧级标志位。In some embodiments, the second determining unit 1302 is further configured to turn on the chroma frame-level flag if the value of the chroma syntax element identification information is the first value; or, if the value of the chroma syntax element identification information is the first value If the value is the second value, the chroma frame-level flag is turned off.
在一些实施例中,第二确定单元1302,还配置为若色度语法元素标识信息的取值为第一值,则确定色度语法元素标识信息指示当前帧的色度分量使用色度权重矩阵进行滤波处理;或者,若色度语法元素标识信息的取值为第二值,则确定色度语法元素标识信息指示当前帧的色度分量不使用色度权重矩阵进行滤波处理。In some embodiments, the second determining unit 1302 is further configured to, if the value of the chroma syntax element identification information is the first value, determine that the chroma syntax element identification information indicates that the chroma component of the current frame uses a chroma weight matrix Perform filtering processing; or, if the value of the chroma syntax element identification information is the second value, determine that the chroma syntax element identification information indicates that the chroma components of the current frame are not filtered using the chroma weight matrix.
在一些实施例中,第一值为1,第二值为0。In some embodiments, the first value is one and the second value is zero.
在一些实施例中,第二确定单元1302,还配置为在当前块的颜色分量类型为亮度分量的情况下,确定至少一个候选亮度权重矩阵网络模型;以及确定当前块的量化参数,从至少一个候选亮度权重矩阵网络模型中选取量化参数对应的候选亮度权重矩阵网络模型;以及将所选取的候选亮度权重矩阵网络模型确定为当前块的亮度权重矩阵网络模型。In some embodiments, the second determining unit 1302 is further configured to, when the color component type of the current block is a luminance component, determine at least one candidate luminance weight matrix network model; and determine the quantization parameter of the current block, from at least one The candidate brightness weight matrix network model corresponding to the quantization parameter is selected from the candidate brightness weight matrix network model; and the selected candidate brightness weight matrix network model is determined as the brightness weight matrix network model of the current block.
在一些实施例中,第二确定单元1302,还配置为在当前块的颜色分量类型为色度分量的情况下,确定至少一个候选色度权重矩阵网络模型;以及确定当前块的量化参数,从至少一个候选色度权重矩阵网络模型中选取量化参数对应的候选色度权重矩阵网络模型;以及将所选取的候选色度权重矩阵网络模型确定为当前块的色度权重矩阵网络模型。In some embodiments, the second determining unit 1302 is further configured to determine at least one candidate chrominance weight matrix network model when the color component type of the current block is a chrominance component; and determine the quantization parameter of the current block, from From at least one candidate chroma weight matrix network model, a candidate chroma weight matrix network model corresponding to the quantization parameter is selected; and the selected candidate chroma weight matrix network model is determined as the chroma weight matrix network model of the current block.
在一些实施例中,参见图13,解码器130还可以包括第二训练单元1305;In some embodiments, referring to FIG. 13 , the decoder 130 may further include a second training unit 1305;
第二确定单元1302,还配置为确定至少一个训练样本,其中,训练样本是根据至少一种量化参数得到的;The second determining unit 1302 is further configured to determine at least one training sample, wherein the training sample is obtained according to at least one quantization parameter;
第二训练单元1305,配置为利用至少一个训练样本的亮度分量对预设神经网络模型进行训练,得到至少一个候选亮度权重矩阵网络模型;以及利用至少一个训练样本的色度分量对预设神经网络模型进行训练,得到至少一个候选色度权重矩阵网络模型;其中,至少一个候选亮度权重矩阵网络模型与亮度分量和量化参数之间具有对应关系,至少一个候选色度权重矩阵网络模型与色度分量和量化参数之间具有对应关系。The second training unit 1305 is configured to use the luminance component of at least one training sample to train the preset neural network model to obtain at least one candidate luminance weight matrix network model; and use the chrominance component of the at least one training sample to train the preset neural network model The model is trained to obtain at least one candidate chrominance weight matrix network model; wherein, at least one candidate brightness weight matrix network model has a corresponding relationship with the brightness component and the quantization parameter, and at least one candidate chrominance weight matrix network model and the chrominance component. and quantization parameters have a corresponding relationship.
在一些实施例中,预设神经网络模型包括下述至少之一:至少一个卷积层、至少一个激活层和跳转连接层。In some embodiments, the preset neural network model includes at least one of the following: at least one convolutional layer, at least one activation layer, and a skip connection layer.
在一些实施例中,第二确定单元1302,还配置为确定神经网络环路滤波器的输入重建图像块和输出重建图像块;以及将输出重建图像块输入权重矩阵网络模型,得到当前块的权重矩阵。In some embodiments, the second determining unit 1302 is further configured to determine the input reconstructed image block and the output reconstructed image block of the neural network loop filter; and input the output reconstructed image block into the weight matrix network model to obtain the weight of the current block matrix.
在一些实施例中,第二滤波单元1303,还配置为利用权重矩阵对输入重建图像块和输出重建图像块进行加权处理,得到目标重建图像块。In some embodiments, the second filtering unit 1303 is further configured to perform weighting processing on the input reconstructed image block and the output reconstructed image block by using a weight matrix to obtain the target reconstructed image block.
在一些实施例中,第二确定单元1302,还配置为当当前块的颜色分量类型为亮度分量时,利用亮度权重矩阵网络模型确定亮度权重矩阵;以及当当前块的颜色分量类型为色度分量时,利用色度权重矩阵网络模型确定色度权重矩阵。In some embodiments, the second determining unit 1302 is further configured to use a luminance weight matrix network model to determine a luminance weight matrix when the color component type of the current block is a luminance component; and when the color component type of the current block is a chrominance component When , use the chrominance weight matrix network model to determine the chrominance weight matrix.
在一些实施例中,第二确定单元1302,还配置为当当前块的颜色分量类型为亮度分量时,确定神经网络环路滤波器的输入亮度重建图像块和输出亮度重建图像块;以及将输出亮度重建图像块输入亮度权重矩阵网络模型,得到亮度权重矩阵;In some embodiments, the second determining unit 1302 is further configured to, when the color component type of the current block is a luminance component, determine the input luminance reconstructed image block and the output luminance reconstructed image block of the neural network loop filter; Input the brightness weight matrix network model to the brightness reconstruction image block, and obtain the brightness weight matrix;
第二滤波单元1303,还配置为利用亮度权重矩阵对输入亮度重建图像块和输出亮度重建图像块进行加权处理,得到当前块的亮度分量的目标重建图像块。The second filtering unit 1303 is further configured to perform weighting processing on the input luminance reconstructed image block and the output luminance reconstructed image block by using the luminance weight matrix to obtain the target reconstructed image block of the luminance component of the current block.
在一些实施例中,第二确定单元1302,还配置为当当前块的颜色分量类型为色度分量时,确定神经网络环路滤波器的输入色度重建图像块和输出色度重建图像块;以及将输出色度重建图像块输入色度权重矩阵网络模型,得到色度权重矩阵;In some embodiments, the second determining unit 1302 is further configured to determine the input chrominance reconstructed image block and the output chrominance reconstructed image block of the neural network loop filter when the color component type of the current block is a chrominance component; and inputting the output chrominance reconstruction image block into the chrominance weight matrix network model to obtain the chrominance weight matrix;
第二滤波单元1303,还配置为利用色度权重矩阵对输入色度重建图像块和输出色度重建图像块进行加权处理,得到当前块的色度分量的目标重建图像块。The second filtering unit 1303 is further configured to perform weighting processing on the input chrominance reconstructed image block and the output chrominance reconstructed image block by using the chrominance weight matrix to obtain the target reconstructed image block of the chrominance component of the current block.
在一些实施例中,输入重建图像块是经由去块滤波器和样值自适应补偿滤波器进行滤波处理后得到。In some embodiments, the input reconstructed image block is obtained after filtering through a deblocking filter and a sample adaptive compensation filter.
在一些实施例中,第二滤波单元1303,还配置为在确定出当前块的目标重建图像块之后,利用自适应修正滤波器继续对目标重建图像块进行滤波处理。In some embodiments, the second filtering unit 1303 is further configured to, after determining the target reconstructed image block of the current block, continue to perform filtering processing on the target reconstructed image block by using an adaptive correction filter.
可以理解地,在本实施例中,“单元”可以是部分电路、部分处理器、部分程序或软件等等,当然也可以是模块,还可以是非模块化的。而且在本实施例中的各组成部分可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。It can be understood that, in this embodiment, a "unit" may be a part of a circuit, a part of a processor, a part of a program or software, etc., of course, it may also be a module, and it may also be non-modular. Moreover, each component in this embodiment may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware, or can be implemented in the form of software function modules.
所述集成的单元如果以软件功能模块的形式实现并非作为独立的产品进行销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本实施例提供了一种计算机存储介质,应用于解码器130,该计算机存储介质存储有计算机程序,所述计算机程序被第二处理器执行时实现前述实施例中任一项所述的方法。If the integrated unit is implemented in the form of a software functional module and is not sold or used as an independent product, it may be stored in a computer-readable storage medium. Based on such understanding, this embodiment provides a computer storage medium, which is applied to the decoder 130, where the computer storage medium stores a computer program, and when the computer program is executed by the second processor, any one of the foregoing embodiments is implemented the method described.
基于上述解码器130的组成以及计算机存储介质,参见图14,其示出了本申请实施例提供的解码器130的具体硬件结构示意图。如图14所示,可以包括:第二通信接口1401、第二存储器1402和第二处理器1403;各个组件通过第二总线系统1404耦合在一起。可理解,第二总线系统1404用于实现这些组件之间的连接通信。第二总线系统1404除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图14中将各种总线都标为第二总线系统1404。其中,Based on the composition of the above-mentioned decoder 130 and the computer storage medium, see FIG. 14 , which shows a schematic diagram of a specific hardware structure of the decoder 130 provided by the embodiment of the present application. As shown in FIG. 14 , it may include: a second communication interface 1401 , a second memory 1402 and a second processor 1403 ; various components are coupled together through a second bus system 1404 . It can be understood that the second bus system 1404 is used to realize the connection 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, the various buses are labeled as the second bus system 1404 in FIG. 14 . in,
第二通信接口1401,用于在与其他外部网元之间进行收发信息过程中,信号的接收和发送;The second communication interface 1401 is used for receiving and sending signals in the process of sending and receiving information with other external network elements;
第二存储器1402,用于存储能够在第二处理器1403上运行的计算机程序;a second memory 1402 for storing computer programs that can run on the second processor 1403;
第二处理器1403,用于在运行所述计算机程序时,执行:The second processor 1403 is configured to, when running the computer program, execute:
解析码流,确定至少一个语法元素标识信息的取值;Parse the code stream, and determine the value of at least one syntax element identification information;
当至少一个语法元素标识信息指示当前帧或当前块使用权重矩阵进行滤波处理时,确定当前块的权重矩阵网络模型,并根据权重矩阵网络模型确定当前块的权重矩阵;When at least one syntax element identification information indicates that the current frame or the current block uses the weight matrix for filtering processing, determine the weight matrix network model of the current block, and determine the weight matrix of the current block according to the weight matrix network model;
利用权重矩阵,确定当前块的目标重建图像块。Using the weight matrix, the target reconstructed image block of the current block is determined.
可选地,作为另一个实施例,第二处理器1403还配置为在运行所述计算机程序时,执行前述实施例中任一项所述的方法。Optionally, as another embodiment, the second processor 1403 is further configured to execute the method described in any one of the foregoing embodiments when running the computer program.
可以理解,第二存储器1402与第一存储器1202的硬件功能类似,第二处理器1403与第一处理器1203的硬件功能类似;这里不再详述。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; details are not described here.
本实施例提供了一种解码器,该解码器可以包括解析单元、第二确定单元和第二滤波单元。这样,通过利用权重矩阵网络模型来确定权重矩阵,不仅可以实现基于深度学习的权重矩阵技术,能够为输出重建图像块的使用提供像素级别的加权处理,而且还可以提升编码性能,进而能够提高编解码效率;另外本申请还可以使得神经网络环路滤波器的输出更加接近于原始图像,能够提升视频图像质量。This embodiment provides a decoder, and the decoder may include a parsing unit, a second determining unit, and a second filtering unit. In this way, by using the weight matrix network model to determine the weight matrix, it can not only realize the weight matrix technology based on deep learning, but also provide pixel-level weighting processing for the use of the output reconstructed image block, but also improve the coding performance, which in turn can improve the coding performance. Decoding efficiency; in addition, the present application can also make the output of the neural network loop filter closer to the original image, which can improve the video image quality.
需要说明的是,在本申请中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。It should be noted that, in this application, the terms "comprising", "comprising" or any other variation thereof are intended to encompass non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements , but also other elements not expressly listed or inherent to such a process, method, article or apparatus. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in a process, method, article or apparatus that includes the element.
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。The above-mentioned serial numbers of the embodiments of the present application are only for description, and do not represent the advantages or disadvantages of the embodiments.
本申请所提供的几个方法实施例中所揭露的方法,在不冲突的情况下可以任意组合,得到新的方法实施例。The methods disclosed in the several method embodiments provided in this application can be arbitrarily combined under the condition of no conflict to obtain new method embodiments.
本申请所提供的几个产品实施例中所揭露的特征,在不冲突的情况下可以任意组合,得到新的产品实施例。The features disclosed in the several product embodiments provided in this application can be combined arbitrarily without conflict to obtain a new product embodiment.
本申请所提供的几个方法或设备实施例中所揭露的特征,在不冲突的情况下可以任意组合,得到新的方法实施例或设备实施例。The features disclosed in several method or device embodiments provided in this application can be combined arbitrarily without conflict to obtain new method embodiments or device embodiments.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above are only specific embodiments of the present application, but the protection scope of the present application is not limited to this. should be covered within the scope of protection of this application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
工业实用性Industrial Applicability
本申请实施例中,在编码器侧,通过确定当前块的权重矩阵网络模型,并根据权重矩阵网络模型确定当前块的权重矩阵;确定至少一个语法元素标识信息的取值;当至少一个语法元素标识信息指示当前帧或当前块使用权重矩阵进行滤波处理时,利用权重矩阵确定当前块的目标重建图像块。在解码器侧,通过解析码流,确定至少一个语法元素标识信息的取值;当至少一个语法元素标识信息指示当前帧或当前块使用权重矩阵进行滤波处理时,确定当前块的权重矩阵网络模型,并根据权重矩阵网络模型确定当前块的权重矩阵;利用权重矩阵,确定当前块的目标重建图像块。这样,通过利用权重矩阵网络模型来确定权重矩阵,不仅可以实现基于深度学习的权重矩阵技术,能够为输出重建图像块的使用提供像素级别的加权处理,而且还可以提升编码性能,进而能够提高编解码效率;另外本申请还可以使得神经网络环路滤波器的输出更加接近于原始图像,能够提升视频图像质量。In this embodiment of the present application, on the encoder side, the weight matrix network model of the current block is determined, and the weight matrix of the current block is determined according to the weight matrix network model; the value of the identification information of at least one syntax element is determined; when at least one syntax element The identification information indicates that when the current frame or the current block uses the weight matrix for filtering processing, the weight matrix is used to determine the target reconstructed image block of the current block. On the decoder side, the value of at least one syntax element identification information is determined by parsing the code stream; when the at least one syntax element identification information indicates that the current frame or current block uses the weight matrix for filtering processing, the weight matrix network model of the current block is determined , and determine the weight matrix of the current block according to the weight matrix network model; use the weight matrix to determine the target reconstructed image block of the current block. In this way, by using the weight matrix network model to determine the weight matrix, it can not only realize the weight matrix technology based on deep learning, but also provide pixel-level weighting processing for the use of the output reconstructed image block, but also improve the coding performance, which in turn can improve the coding performance. Decoding efficiency; in addition, the present application can also make the output of the neural network loop filter closer to the original image, which can improve the video image quality.

Claims (52)

  1. 一种解码方法,应用于解码器,所述方法包括:A decoding method, applied to a decoder, the method comprising:
    解析码流,确定至少一个语法元素标识信息的取值;Parse the code stream, and determine the value of at least one syntax element identification information;
    当所述至少一个语法元素标识信息指示当前帧或当前块使用权重矩阵进行滤波处理时,确定当前块的权重矩阵网络模型,并根据所述权重矩阵网络模型确定所述当前块的权重矩阵;When the at least one syntax element identification information indicates that the current frame or the current block uses the weight matrix for filtering processing, determine the weight matrix network model of the current block, and determine the weight matrix of the current block according to the weight matrix network model;
    利用所述权重矩阵,确定所述当前块的目标重建图像块。Using the weight matrix, a target reconstructed image block of the current block is determined.
  2. 根据权利要求1所述的方法,其中,所述解析码流,确定至少一个语法元素的标识信息的取值,包括:The method according to claim 1, wherein the parsing the code stream and determining the value of the identification information of at least one syntax element comprises:
    解析码流,确定第一语法元素标识信息的取值;Parse the code stream, and determine the value of the identification information of the first syntax element;
    当所述第一语法元素标识信息指示视频序列使用所述权重矩阵进行滤波处理时,解析码流,确定第二语法元素标识信息的取值;其中,所述第二语法元素标识信息用于指示所述视频序列内的当前帧是否使用所述权重矩阵进行滤波处理,所述当前帧包括当前块。When the first syntax element identification information indicates that the video sequence is filtered using the weight matrix, the code stream is parsed to determine the value of the second syntax element identification information; wherein the second syntax element identification information is used to indicate Whether the current frame in the video sequence is filtered using the weight matrix, the current frame includes the current block.
  3. 根据权利要求2所述的方法,其中,所述方法还包括:The method of claim 2, wherein the method further comprises:
    若所述第一语法元素标识信息的取值为第一值,则确定所述第一语法元素标识信息指示所述视频序列使用所述权重矩阵进行滤波处理;或者,If the value of the first syntax element identification information is a first value, it is determined that the first syntax element identification information indicates that the video sequence is filtered by using the weight matrix; or,
    若所述第一语法元素标识信息的取值为第二值,则确定所述第一语法元素标识信息指示所述视频序列不使用所述权重矩阵进行滤波处理。If the value of the first syntax element identification information is a second value, it is determined that the first syntax element identification information indicates that the video sequence does not use the weight matrix for filtering processing.
  4. 根据权利要求2所述的方法,其中,所述解析码流,确定第二语法元素标识信息,包括:The method according to claim 2, wherein the analyzing the code stream and determining the identification information of the second syntax element comprises:
    当所述当前帧的颜色分量类型为亮度分量时,确定所述第二语法元素标识信息为第一亮度语法元素标识信息,所述第一亮度语法元素标识信息用于指示所述当前帧的亮度分量是否使用亮度权重矩阵进行滤波处理;或者,When the color component type of the current frame is a luminance component, it is determined that the second syntax element identification information is first luminance syntax element identification information, and the first luminance syntax element identification information is used to indicate the luminance of the current frame Whether the component is filtered using the luma weight matrix; or,
    当所述当前帧的颜色分量类型为色度分量时,确定所述第二语法元素标识信息为色度语法元素标识信息,所述色度语法元素标识信息用于指示所述当前帧的色度分量是否使用色度权重矩阵进行滤波处理。When the color component type of the current frame is a chroma component, determining that the second syntax element identification information is chroma syntax element identification information, where the chroma syntax element identification information is used to indicate the chroma of the current frame Whether the component is filtered using the chroma weight matrix.
  5. 根据权利要求4所述的方法,其中,当所述当前帧的颜色分量类型为亮度分量时,所述当所述至少一个语法元素的标识信息指示使用权重矩阵进行滤波处理时,确定当前块的权重矩阵网络模型,包括:The method according to claim 4, wherein, when the color component type of the current frame is a luminance component, when the identification information of the at least one syntax element indicates that a weight matrix is used for filtering processing, determining the color component of the current block Weight matrix network model, including:
    当所述第一亮度语法元素标识信息指示所述当前帧的亮度分量使用所述亮度权重矩阵进行滤波处理时,解析码流,确定第二亮度语法元素标识信息的取值;When the first luma syntax element identification information indicates that the luma component of the current frame is filtered by using the luma weight matrix, the code stream is parsed, and the value of the second luma syntax element identification information is determined;
    当所述第二亮度语法元素标识信息指示所述当前块的亮度分量使用所述亮度权重矩阵进行滤波处理时,确定所述当前块的亮度权重矩阵网络模型。When the second luma syntax element identification information indicates that the luma component of the current block is filtered using the luma weight matrix, a luma weight matrix network model of the current block is determined.
  6. 根据权利要求5所述的方法,其中,所述方法还包括:The method of claim 5, wherein the method further comprises:
    若所述第一亮度语法元素标识信息的取值为第一值,则确定所述第一亮度语法元素标识信息指示所述当前帧的亮度分量使用所述亮度权重矩阵进行滤波处理;或者,If the value of the first luma syntax element identification information is a first value, it is determined that the first luma syntax element identification information indicates that the luma component of the current frame is filtered by using the luma weight matrix; or,
    若所述第一亮度语法元素标识信息的取值为第二值,则确定所述第一亮度语法元素标识信息指示所述当前帧的亮度分量不使用所述亮度权重矩阵进行滤波处理。If the value of the first luma syntax element identification information is the second value, it is determined that the first luma syntax element identification information indicates that the luma component of the current frame does not use the luma weight matrix for filtering processing.
  7. 根据权利要求5所述的方法,其中,所述方法还包括:The method of claim 5, wherein the method further comprises:
    若所述第二亮度语法元素标识信息的取值为第一值,则确定所述第二亮度语法元素标识信息指示所述当前块的亮度分量使用所述亮度权重矩阵进行滤波处理;或者,If the value of the second luma syntax element identification information is a first value, it is determined that the second luma syntax element identification information indicates that the luma component of the current block is filtered by using the luma weight matrix; or,
    若所述第二亮度语法元素标识信息的取值为第二值,则确定所述第二亮度语法元素标识信息指示所述当前块的亮度分量不使用所述亮度权重矩阵进行滤波处理。If the value of the second luma syntax element identification information is a second value, it is determined that the second luma syntax element identification information indicates that the luma component of the current block does not use the luma weight matrix for filtering processing.
  8. 根据权利要求4所述的方法,其中,当所述当前帧的颜色分量类型为色度分量时,所述当所述至少一个语法元素的标识信息指示使用权重矩阵进行滤波处理时,确定当前块的权重矩阵网络模型,包括:The method according to claim 4, wherein when the color component type of the current frame is a chrominance component, the current block is determined when the identification information of the at least one syntax element indicates that a weight matrix is used for filtering processing The weight matrix network model, including:
    当所述色度语法元素标识信息指示所述当前帧的色度分量使用所述色度权重矩阵进行滤波处理时,确定所述当前块的色度权重矩阵网络模型。When the chroma syntax element identification information indicates that the chroma components of the current frame are filtered using the chroma weight matrix, a chroma weight matrix network model for the current block is determined.
  9. 根据权利要求8所述的方法,其中,所述方法还包括:The method of claim 8, wherein the method further comprises:
    若所述色度语法元素标识信息的取值为第一值,则确定所述色度语法元素标识信息指示所述当前帧的色度分量使用所述色度权重矩阵进行滤波处理;或者,If the value of the chroma syntax element identification information is the first value, it is determined that the chroma syntax element identification information indicates that the chroma components of the current frame are filtered using the chroma weight matrix; or,
    若所述色度语法元素标识信息的取值为第二值,则确定所述色度语法元素标识信息指示所述当前帧的色度分量不使用所述色度权重矩阵进行滤波处理。If the value of the chroma syntax element identification information is the second value, it is determined that the chroma syntax element identification information indicates that the chroma components of the current frame do not use the chroma weight matrix for filtering processing.
  10. 根据权利要求3、6、7和9中任一项所述的方法,其中,所述第一值为1,所述第二值为0。The method of any one of claims 3, 6, 7 and 9, wherein the first value is one and the second value is zero.
  11. 根据权利要求5所述的方法,其中,所述确定所述当前块的亮度权重矩阵网络模型,包括:The method according to claim 5, wherein the determining the luminance weight matrix network model of the current block comprises:
    在所述当前块的颜色分量类型为亮度分量的情况下,确定至少一个候选亮度权重矩阵网络模型;In the case that the color component type of the current block is a luminance component, determining at least one candidate luminance weight matrix network model;
    确定所述当前块的量化参数,从所述至少一个候选亮度权重矩阵网络模型中选取所述量化参数对应的候选亮度权重矩阵网络模型;Determine the quantization parameter of the current block, and select a candidate brightness weight matrix network model corresponding to the quantization parameter from the at least one candidate brightness weight matrix network model;
    将所选取的候选亮度权重矩阵网络模型确定为所述当前块的亮度权重矩阵网络模型。The selected candidate luminance weight matrix network model is determined as the luminance weight matrix network model of the current block.
  12. 根据权利要求8所述的方法,其中,所述确定所述当前块的色度权重矩阵网络模型,包括:The method according to claim 8, wherein the determining the chrominance weight matrix network model of the current block comprises:
    在所述当前块的颜色分量类型为色度分量的情况下,确定至少一个候选色度权重矩阵网络模型;In the case that the color component type of the current block is a chrominance component, determining at least one candidate chrominance weight matrix network model;
    确定所述当前块的量化参数,从所述至少一个候选色度权重矩阵网络模型中选取所述量化参数对应的候选色度权重矩阵网络模型;determining the quantization parameter of the current block, and selecting a candidate chroma weight matrix network model corresponding to the quantization parameter from the at least one candidate chroma weight matrix network model;
    将所选取的候选色度权重矩阵网络模型确定为所述当前块的色度权重矩阵网络模型。The selected candidate chrominance weight matrix network model is determined as the chrominance weight matrix network model of the current block.
  13. 根据权利要求11或12所述的方法,其中,所述方法还包括:The method of claim 11 or 12, wherein the method further comprises:
    确定至少一个训练样本,其中,所述训练样本是根据至少一种量化参数得到的;determining at least one training sample, wherein the training sample is obtained according to at least one quantization parameter;
    利用所述至少一个训练样本的亮度分量对预设神经网络模型进行训练,得到至少一个候选亮度权重矩阵网络模型;Use the brightness component of the at least one training sample to train a preset neural network model to obtain at least one candidate brightness weight matrix network model;
    利用所述至少一个训练样本的色度分量对预设神经网络模型进行训练,得到至少一个候选色度权重矩阵网络模型;Use the chrominance component of the at least one training sample to train the preset neural network model to obtain at least one candidate chrominance weight matrix network model;
    其中,所述至少一个候选亮度权重矩阵网络模型与亮度分量和量化参数之间具有对应关系,所述至少一个候选色度权重矩阵网络模型与色度分量和量化参数之间具有对应关系。Wherein, the at least one candidate luminance weight matrix network model has a corresponding relationship with the luminance component and the quantization parameter, and the at least one candidate chrominance weight matrix network model has a corresponding relationship with the chrominance component and the quantization parameter.
  14. 根据权利要求13所述的方法,其中,所述预设神经网络模型包括下述至少之一:至少一个卷积层、至少一个激活层和跳转连接层。The method of claim 13, wherein the preset neural network model includes at least one of the following: at least one convolutional layer, at least one activation layer and a skip connection layer.
  15. 根据权利要求1至14任一项所述的方法,其中,所述根据所述权重矩阵网络模型确定所述当前块的权重矩阵,包括:The method according to any one of claims 1 to 14, wherein the determining the weight matrix of the current block according to the weight matrix network model comprises:
    确定神经网络环路滤波器的输入重建图像块和输出重建图像块;Determine the input reconstructed image patch and the output reconstructed image patch of the neural network loop filter;
    将所述输出重建图像块输入所述权重矩阵网络模型,得到所述当前块的权重矩阵。The output reconstructed image block is input into the weight matrix network model to obtain the weight matrix of the current block.
  16. 根据权利要求15所述的方法,其中,所述利用所述权重矩阵,确定所述当前块的目标重建图像块,包括:The method according to claim 15, wherein the determining the target reconstructed image block of the current block by using the weight matrix comprises:
    利用所述权重矩阵对所述输入重建图像块和所述输出重建图像块进行加权处理,得到所述目标重建图像块。The input reconstructed image block and the output reconstructed image block are weighted by using the weight matrix to obtain the target reconstructed image block.
  17. 根据权利要求1所述的方法,其中,所述根据所述权重矩阵网络模型确定所述当前块的权重矩阵,包括:The method according to claim 1, wherein the determining the weight matrix of the current block according to the weight matrix network model comprises:
    当所述当前块的颜色分量类型为亮度分量时,利用亮度权重矩阵网络模型确定亮度权重矩阵;When the color component type of the current block is a luminance component, use a luminance weight matrix network model to determine a luminance weight matrix;
    当所述当前块的颜色分量类型为色度分量时,利用色度权重矩阵网络模型确定色度权重矩阵。When the color component type of the current block is a chrominance component, a chrominance weight matrix is determined by using a chrominance weight matrix network model.
  18. 根据权利要求17所述的方法,其中,当所述当前块的颜色分量类型为亮度分量时,所述利用亮度权重矩阵网络模型确定亮度权重矩阵,包括:The method according to claim 17, wherein, when the color component type of the current block is a luminance component, the determining a luminance weight matrix by using a luminance weight matrix network model comprises:
    确定神经网络环路滤波器的输入亮度重建图像块和输出亮度重建图像块;Determine the input luminance reconstructed image block and the output luminance reconstructed image block of the neural network loop filter;
    将所述输出亮度重建图像块输入所述亮度权重矩阵网络模型,得到所述亮度权重矩阵;Inputting the output brightness reconstructed image block into the brightness weight matrix network model to obtain the brightness weight matrix;
    所述利用所述权重矩阵,确定所述当前块的目标重建图像块,包括:The determining the target reconstructed image block of the current block by using the weight matrix includes:
    利用所述亮度权重矩阵对所述输入亮度重建图像块和所述输出亮度重建图像块进行加权处理,得到所述当前块的亮度分量的目标重建图像块。The input luminance reconstructed image block and the output luminance reconstructed image block are weighted by using the luminance weight matrix to obtain the target reconstructed image block of the luminance component of the current block.
  19. 根据权利要求17所述的方法,其中,当所述当前块的颜色分量类型为色度分量时,所述利用色度权重矩阵网络模型确定色度权重矩阵,包括:The method according to claim 17, wherein, when the color component type of the current block is a chrominance component, the determining a chrominance weight matrix by using a chrominance weight matrix network model comprises:
    确定神经网络环路滤波器的输入色度重建图像块和输出色度重建图像块;Determine the input chrominance reconstructed image block and the output chrominance reconstructed image block of the neural network loop filter;
    将所述输出色度重建图像块输入所述色度权重矩阵网络模型,得到所述色度权重矩阵;Inputting the output chrominance reconstruction image block into the chrominance weight matrix network model to obtain the chrominance weight matrix;
    所述利用所述权重矩阵,确定所述当前块的目标重建图像块,包括:The determining the target reconstructed image block of the current block by using the weight matrix includes:
    利用所述色度权重矩阵对所述输入色度重建图像块和所述输出色度重建图像块进行加权处理,得到所述当前块的色度分量的目标重建图像块。The input chrominance reconstructed image block and the output chrominance reconstructed image block are weighted by using the chrominance weight matrix to obtain the target reconstructed image block of the chrominance component of the current block.
  20. 根据权利要求15所述的方法,其中,所述输入重建图像块是经由去块滤波器和样值自适应补偿滤波器进行滤波处理后得到。The method according to claim 15, wherein the input reconstructed image block is obtained after filtering through a deblocking filter and a sample adaptive compensation filter.
  21. 根据权利要求1至20任一项所述的方法,其中,所述方法还包括:The method according to any one of claims 1 to 20, wherein the method further comprises:
    在确定出所述目标重建图像块之后,利用自适应修正滤波器继续对所述目标重建图像块进行滤波处理。After the target reconstructed image block is determined, the adaptive correction filter is used to continue filtering the target reconstructed image block.
  22. 一种编码方法,应用于编码器,所述方法包括:An encoding method, applied to an encoder, the method comprising:
    确定当前块的权重矩阵网络模型,并根据所述权重矩阵网络模型确定所述当前块的权重矩阵;Determine the weight matrix network model of the current block, and determine the weight matrix of the current block according to the weight matrix network model;
    确定至少一个语法元素标识信息的取值;Determine the value of at least one syntax element identification information;
    当所述至少一个语法元素标识信息指示当前帧或当前块使用权重矩阵进行滤波处理时,利用所述权重矩阵确定所述当前块的目标重建图像块。When the at least one syntax element identification information indicates that the current frame or the current block uses a weight matrix for filtering processing, the weight matrix is used to determine a target reconstructed image block of the current block.
  23. 根据权利要求22所述的方法,其中,所述确定当前块的权重矩阵网络模型,包括:The method according to claim 22, wherein said determining the weight matrix network model of the current block comprises:
    当所述当前块的颜色分量类型为亮度分量时,确定所述当前块的亮度权重矩阵网络模型;When the color component type of the current block is a luminance component, determining a luminance weight matrix network model of the current block;
    当所述当前块的颜色分量类型为色度分量时,确定所述当前块的色度权重矩阵网络模型。When the color component type of the current block is a chrominance component, a chrominance weight matrix network model of the current block is determined.
  24. 根据权利要求23所述的方法,其中,所述确定所述当前块的亮度权重矩阵网络模型,包括:The method according to claim 23, wherein the determining the luminance weight matrix network model of the current block comprises:
    在所述当前块的颜色分量类型为亮度分量的情况下,确定至少一个候选亮度权重矩阵网络模型;In the case that the color component type of the current block is a luminance component, determining at least one candidate luminance weight matrix network model;
    确定所述当前块的量化参数,从所述至少一个候选亮度权重矩阵网络模型中选取所述量化参数对应的候选亮度权重矩阵网络模型;Determine the quantization parameter of the current block, and select a candidate brightness weight matrix network model corresponding to the quantization parameter from the at least one candidate brightness weight matrix network model;
    将所选取的候选亮度权重矩阵网络模型确定为所述当前块的亮度权重矩阵网络模型。The selected candidate luminance weight matrix network model is determined as the luminance weight matrix network model of the current block.
  25. 根据权利要求23所述的方法,其中,所述确定所述当前块的色度权重矩阵网络模型,包括:The method according to claim 23, wherein the determining the chroma weight matrix network model of the current block comprises:
    在所述当前块的颜色分量类型为色度分量的情况下,确定至少一个候选色度权重矩阵网络模型;In the case that the color component type of the current block is a chrominance component, determining at least one candidate chrominance weight matrix network model;
    确定所述当前块的量化参数,从所述至少一个候选色度权重矩阵网络模型中选取所述量化参数对应的候选色度权重矩阵网络模型;determining the quantization parameter of the current block, and selecting a candidate chroma weight matrix network model corresponding to the quantization parameter from the at least one candidate chroma weight matrix network model;
    将所选取的候选色度权重矩阵网络模型确定为所述当前块的色度权重矩阵网络模型。The selected candidate chrominance weight matrix network model is determined as the chrominance weight matrix network model of the current block.
  26. 根据权利要求24或25所述的方法,其中,所述方法还包括:The method of claim 24 or 25, wherein the method further comprises:
    确定至少一个训练样本,其中,所述训练样本是根据至少一种量化参数得到的;determining at least one training sample, wherein the training sample is obtained according to at least one quantization parameter;
    利用所述至少一个训练样本的亮度分量对预设神经网络模型进行训练,得到至少一个候选亮度权重矩阵网络模型;Use the brightness component of the at least one training sample to train a preset neural network model to obtain at least one candidate brightness weight matrix network model;
    利用所述至少一个训练样本的色度分量对预设神经网络模型进行训练,得到至少一个候选色度权重矩阵网络模型;Use the chrominance component of the at least one training sample to train the preset neural network model to obtain at least one candidate chrominance weight matrix network model;
    其中,所述至少一个候选亮度权重矩阵网络模型与亮度分量和量化参数之间具有对应关系,所述至少一个候选色度权重矩阵网络模型与色度分量和量化参数之间具有对应关系。Wherein, the at least one candidate luminance weight matrix network model has a corresponding relationship with the luminance component and the quantization parameter, and the at least one candidate chrominance weight matrix network model has a corresponding relationship with the chrominance component and the quantization parameter.
  27. 根据权利要求26所述的方法,其中,所述预设神经网络模型包括下述至少之一:至少一个卷积层、至少一个激活层和跳转连接层。The method of claim 26, wherein the preset neural network model includes at least one of the following: at least one convolutional layer, at least one activation layer, and a skip connection layer.
  28. 根据权利要求22所述的方法,其中,所述确定至少一个语法元素标识信息的取值,包括:The method according to claim 22, wherein said determining the value of at least one syntax element identification information comprises:
    若确定视频序列使用所述权重矩阵进行滤波处理,则确定第一语法元素标识信息的取值为第一值;或者,If it is determined that the video sequence is filtered using the weight matrix, then the value of the first syntax element identification information is determined to be the first value; or,
    若确定视频序列不使用所述权重矩阵进行滤波处理,则确定第一语法元素标识信息的取值为第二值。If it is determined that the video sequence does not use the weight matrix for filtering processing, it is determined that the value of the first syntax element identification information is the second value.
  29. 根据权利要求28所述的方法,其中,所述方法还包括:The method of claim 28, wherein the method further comprises:
    对所述第一语法元素标识信息的取值进行编码,将编码比特写入码流。The value of the first syntax element identification information is encoded, and the encoded bits are written into the code stream.
  30. 根据权利要求28所述的方法,其中,在确定所述视频序列使用所述权重矩阵进行滤波处理之后,当所述当前帧的颜色分量类型为亮度分量时,确定所述权重矩阵为亮度权重矩阵,所述确定至少一个语法元素标识信息的取值,还包括:The method according to claim 28, wherein after determining that the video sequence is filtered using the weight matrix, when the color component type of the current frame is a luminance component, the weight matrix is determined to be a luminance weight matrix , the determining the value of the identification information of at least one syntax element further includes:
    确定所述视频序列内当前帧的亮度分量使用所述亮度权重矩阵进行滤波处理的第一率失真代价值;determining a first rate-distortion cost of filtering the luminance component of the current frame in the video sequence using the luminance weight matrix;
    确定所述视频序列内当前帧的亮度分量未使用所述亮度权重矩阵进行滤波处理的第二率失真代价值;determining a second rate-distortion cost value for which the luminance component of the current frame in the video sequence is not filtered using the luminance weight matrix;
    若所述第一率失真代价值小于所述第二率失真代价值,则确定第一亮度语法元素标识信息的取值为第一值;或者,If the first rate-distortion cost value is less than the second rate-distortion cost value, determine that the value of the first luma syntax element identification information is a first value; or,
    若所述第一率失真代价值大于或等于所述第二率失真代价值,则确定第一亮度语法元素标识信息的取值为第二值。If the first rate-distortion cost value is greater than or equal to the second rate-distortion cost value, the value of the first luma syntax element identification information is determined to be a second value.
  31. 根据权利要求30所述的方法,其中,所述方法还包括:The method of claim 30, wherein the method further comprises:
    对所述第一亮度语法元素标识信息的取值进行编码,将编码比特写入码流。The value of the first luminance syntax element identification information is encoded, and the encoded bits are written into the code stream.
  32. 根据权利要求30所述的方法,其中,所述方法还包括:The method of claim 30, wherein the method further comprises:
    对所述当前帧进行块划分,确定至少一个划分块;其中,所述至少一个划分块包括当前块;Perform block division on the current frame to determine at least one divided block; wherein, the at least one divided block includes the current block;
    所述确定所述视频序列内当前帧的亮度分量使用所述亮度权重矩阵进行滤波处理的第一率失真代价值,包括:The determining of the first rate-distortion cost of filtering the luminance component of the current frame in the video sequence using the luminance weight matrix includes:
    分别计算所述至少一个划分块的亮度分量使用所述亮度权重矩阵进行滤波处理的第三率失真代价值;respectively calculating a third rate-distortion cost value for filtering the luminance component of the at least one divided block using the luminance weight matrix;
    对计算得到的所述第三率失真代价值进行累加计算,得到所述第一率失真代价值;Accumulating the calculated third rate-distortion cost value to obtain the first rate-distortion cost value;
    所述计算所述视频序列内当前帧的亮度分量未使用所述亮度权重矩阵进行滤波处理的第二率失真代价值,包括:The calculating the second rate-distortion cost value of the luminance component of the current frame in the video sequence without using the luminance weight matrix for filtering processing includes:
    分别计算所述至少一个划分块的亮度分量未使用所述亮度权重矩阵进行滤波处理的第四率失真代价值;respectively calculating the fourth rate-distortion cost value of the luminance component of the at least one divided block that is not filtered using the luminance weight matrix;
    对计算得到的所述第四率失真代价值进行累加计算,得到所述第二率失真代价值。Accumulate the calculated fourth rate-distortion cost value to obtain the second rate-distortion cost value.
  33. 根据权利要求32所述的方法,其中,当所述第一率失真代价值小于所述第二率失真代价值时,所述确定至少一个语法元素标识信息的取值,还包括:The method according to claim 32, wherein, when the first rate-distortion cost value is less than the second rate-distortion cost value, the determining the value of at least one syntax element identification information further comprises:
    确定所述当前块的亮度分量使用所述亮度权重矩阵进行滤波处理的第三率失真代价值;以及确定所述当前块的亮度分量未使用所述亮度权重矩阵进行滤波处理的第四率失真代价值;determining a third rate-distortion cost value for the luminance component of the current block to be filtered using the luminance weight matrix; and determining a fourth rate-distortion cost value for the luminance component of the current block not to be filtered using the luminance weight matrix value;
    若所述第三率失真代价值小于所述第四率失真代价值,则确定第二亮度语法元素标识信息的取值为第一值;或者,If the third rate-distortion cost value is less than the fourth rate-distortion cost value, determine that the value of the second luma syntax element identification information is the first value; or,
    若所述第三率失真代价值大于或等于所述第四率失真代价值,则确定第二亮度语法元素标识信息的取值为第二值。If the third rate-distortion cost value is greater than or equal to the fourth rate-distortion cost value, determining that the value of the second luma syntax element identification information is a second value.
  34. 根据权利要求33所述的方法,其中,所述方法还包括:The method of claim 33, wherein the method further comprises:
    对所述第二亮度语法元素标识信息的取值进行编码,将编码比特写入码流。The value of the second luminance syntax element identification information is encoded, and the encoded bits are written into the code stream.
  35. 根据权利要求33所述的方法,其中,所述当所述至少一个语法元素标识信息指示当前帧或当前块使用权重矩阵进行滤波处理时,利用所述权重矩阵确定所述当前块的目标重建图像块,包括:The method according to claim 33, wherein when the at least one syntax element identification information indicates that the current frame or the current block uses a weight matrix for filtering processing, the weight matrix is used to determine the target reconstructed image of the current block blocks, including:
    若所述第三率失真代价值小于所述第四率失真代价值,则利用所述亮度权重矩阵确定所述当前块的目标重建图像块。If the third rate-distortion cost value is less than the fourth rate-distortion cost value, determining the target reconstructed image block of the current block by using the luminance weight matrix.
  36. 根据权利要求28所述的方法,其中,在确定所述视频序列使用所述权重矩阵进行滤波处理之后,当所述当前帧的颜色分量类型为色度分量时,确定所述权重矩阵为色度权重矩阵,所述确定至少一个语法元素标识信息的取值,还包括:The method according to claim 28, wherein after determining that the video sequence is filtered using the weight matrix, when the color component type of the current frame is a chroma component, the weight matrix is determined to be a chroma component The weight matrix, which determines the value of at least one syntax element identification information, also includes:
    确定所述视频序列内当前帧的色度分量使用所述色度权重矩阵进行滤波处理的第五率失真代价值;determining the fifth rate-distortion cost of filtering the chrominance component of the current frame in the video sequence using the chrominance weight matrix;
    确定所述视频序列内的当前帧的色度分量未使用所述色度权重矩阵进行滤波处理的第六率失真代价值;determining the sixth rate-distortion cost value of the chrominance component of the current frame in the video sequence that is not filtered using the chrominance weight matrix;
    若所述第五率失真代价值小于所述第六率失真代价值,则确定色度语法元素标识信息的取值为第一值;或者,If the fifth rate-distortion cost value is less than the sixth rate-distortion cost value, determine that the value of the chroma syntax element identification information is the first value; or,
    若所述第五率失真代价值大于或等于所述第六率失真代价值,则确定色度语法元素标识信息的取值为第二值。If the fifth rate-distortion cost value is greater than or equal to the sixth rate-distortion cost value, the value of the chroma syntax element identification information is determined to be a second value.
  37. 根据权利要求36所述的方法,其中,所述方法还包括:The method of claim 36, wherein the method further comprises:
    对所述色度语法元素标识信息的取值进行编码,将编码比特写入码流。The value of the chroma syntax element identification information is encoded, and the encoded bits are written into the code stream.
  38. 根据权利要求28、30、33和36中任一项所述的方法,其中,所述第一值为1,所述第二值为0。The method of any of claims 28, 30, 33 and 36, wherein the first value is one and the second value is zero.
  39. 根据权利要求36所述的方法,其中,所述当所述至少一个语法元素标识信息指示当前帧或当前块使用权重矩阵进行滤波处理时,利用所述权重矩阵确定所述当前块的目标重建图像块,包括:The method according to claim 36, wherein, when the at least one syntax element identification information indicates that the current frame or the current block uses a weight matrix for filtering processing, the weight matrix is used to determine the target reconstructed image of the current block blocks, including:
    若所述第五率失真代价值小于所述第六率失真代价值,则利用所述色度权重矩阵确定所述当前块的目标重建图像块。If the fifth rate-distortion cost value is less than the sixth rate-distortion cost value, determining the target reconstructed image block of the current block by using the chrominance weight matrix.
  40. 根据权利要求22至39任一项所述的方法,其中,所述根据所述权重矩阵网络模型确定所述当前块的权重矩阵,包括:The method according to any one of claims 22 to 39, wherein the determining the weight matrix of the current block according to the weight matrix network model comprises:
    确定神经网络环路滤波器的输入重建图像块和输出重建图像块;Determine the input reconstructed image patch and the output reconstructed image patch of the neural network loop filter;
    将所述输出重建图像块输入所述权重矩阵网络模型,得到所述当前块的权重矩阵。The output reconstructed image block is input into the weight matrix network model to obtain the weight matrix of the current block.
  41. 根据权利要求40所述的方法,其中,所述利用所述权重矩阵确定所述当前块的目标重建图像块,包括:The method according to claim 40, wherein the determining the target reconstructed image block of the current block by using the weight matrix comprises:
    利用所述权重矩阵对所述输入重建图像块和所述输出重建图像块进行加权处理,得到所述目标重建图像块。The input reconstructed image block and the output reconstructed image block are weighted by using the weight matrix to obtain the target reconstructed image block.
  42. 根据权利要求22所述的方法,其中,所述根据所述权重矩阵网络模型确定所述当前块的权重矩阵,包括:The method according to claim 22, wherein the determining the weight matrix of the current block according to the weight matrix network model comprises:
    当所述当前块的颜色分量类型为亮度分量时,利用亮度权重矩阵网络模型确定亮度权重矩阵;When the color component type of the current block is a luminance component, use a luminance weight matrix network model to determine a luminance weight matrix;
    当所述当前块的颜色分量类型为色度分量时,利用色度权重矩阵网络模型确定色度权重矩阵。When the color component type of the current block is a chrominance component, a chrominance weight matrix is determined by using a chrominance weight matrix network model.
  43. 根据权利要求42所述的方法,其中,当所述当前块的颜色分量类型为亮度分量时,所述利用亮度权重矩阵网络模型确定亮度权重矩阵,包括:The method according to claim 42, wherein, when the color component type of the current block is a luminance component, the determining a luminance weight matrix by using a luminance weight matrix network model comprises:
    确定神经网络环路滤波器的输入亮度重建图像块和输出亮度重建图像块;Determine the input luminance reconstructed image block and the output luminance reconstructed image block of the neural network loop filter;
    将所述输出亮度重建图像块输入所述亮度权重矩阵网络模型,得到所述亮度权重矩阵;Inputting the output brightness reconstructed image block into the brightness weight matrix network model to obtain the brightness weight matrix;
    所述利用所述权重矩阵,确定所述当前块的目标重建图像块,包括:The determining the target reconstructed image block of the current block by using the weight matrix includes:
    利用所述亮度权重矩阵对所述输入亮度重建图像块和所述输出亮度重建图像块进行加权处理,得到所述当前块的亮度分量的目标重建图像块。The input luminance reconstructed image block and the output luminance reconstructed image block are weighted by using the luminance weight matrix to obtain the target reconstructed image block of the luminance component of the current block.
  44. 根据权利要求42所述的方法,其中,当所述当前块的颜色分量类型为色度分量时,所述利用色度权重矩阵网络模型确定色度权重矩阵,包括:The method according to claim 42, wherein, when the color component type of the current block is a chrominance component, the determining a chrominance weight matrix by using a chrominance weight matrix network model comprises:
    确定神经网络环路滤波器的输入色度重建图像块和输出色度重建图像块;Determine the input chrominance reconstructed image block and the output chrominance reconstructed image block of the neural network loop filter;
    将所述输出色度重建图像块输入所述色度权重矩阵网络模型,得到所述色度权重矩阵;Inputting the output chrominance reconstruction image block into the chrominance weight matrix network model to obtain the chrominance weight matrix;
    所述利用所述权重矩阵,确定所述当前块的目标重建图像块,包括:The determining the target reconstructed image block of the current block by using the weight matrix includes:
    利用所述色度权重矩阵对所述输入色度重建图像块和所述输出色度重建图像块进行加权处理,得到所述当前块的色度分量的目标重建图像块。The input chrominance reconstructed image block and the output chrominance reconstructed image block are weighted by using the chrominance weight matrix to obtain the target reconstructed image block of the chrominance component of the current block.
  45. 根据权利要求40所述的方法,其中,所述输入重建图像块是经由去块滤波器和样值自适应补偿滤波器进行滤波处理后得到。The method of claim 40, wherein the input reconstructed image block is obtained after filtering through a deblocking filter and a sample adaptive compensation filter.
  46. 根据权利要求22至45任一项所述的方法,其中,所述方法还包括:The method of any one of claims 22 to 45, wherein the method further comprises:
    在确定出所述当前块的目标重建图像块之后,利用自适应修正滤波器继续对所述目标重建图像块进行滤波处理。After the target reconstructed image block of the current block is determined, the adaptive correction filter is used to continue filtering the target reconstructed image block.
  47. 一种码流,其中,所述码流是根据至少一个语法元素标识信息的取值进行比特编码生成的;A code stream, wherein the code stream is generated by bit encoding according to the value of at least one syntax element identification information;
    其中,所述至少一个语法元素标识信息至少包括:第一语法元素标识信息、第一亮度语法元素标识信息、第二亮度语法元素标识信息和色度语法元素标识信息;Wherein, the at least one syntax element identification information includes at least: first syntax element identification information, first luma syntax element identification information, second luma syntax element identification information, and chroma syntax element identification information;
    其中,所述第一语法元素标识信息用于指示视频序列是否使用权重矩阵进行滤波处理,所述第一亮度语法元素标识信息用于指示当前帧的亮度分量是否使用权重矩阵进行滤波处理,所述第二亮度语法元素标识信息用于指示当前块的亮度分量是否使用权重矩阵进行滤波处理,所述色度语法元素标识信息用于指示当前帧的色度分量是否使用权重矩阵进行滤波处理;所述视频序列包括所述当前帧,所述当前帧包括所述当前块。Wherein, the first syntax element identification information is used to indicate whether the video sequence is filtered using a weight matrix, the first luminance syntax element identification information is used to indicate whether the luminance component of the current frame is filtered using a weight matrix, the The second luma syntax element identification information is used to indicate whether the luma component of the current block is filtered using the weight matrix, and the chroma syntax element identification information is used to indicate whether the chroma component of the current frame is filtered using the weight matrix; the The video sequence includes the current frame, which includes the current block.
  48. 一种编码器,所述编码器包括第一确定单元和第一滤波单元;其中,An encoder comprising a first determining unit and a first filtering unit; wherein,
    所述第一确定单元,配置为确定当前块的权重矩阵网络模型,并根据所述权重矩阵网络模型确定所述当前块的权重矩阵;以及确定至少一个语法元素标识信息的取值;The first determining unit is configured to determine the weight matrix network model of the current block, and determine the weight matrix of the current block according to the weight matrix network model; and determine the value of at least one syntax element identification information;
    所述第一滤波单元,配置为当所述至少一个语法元素标识信息指示当前帧或当前块使用权重矩阵进行滤波处理时,利用所述权重矩阵确定所述当前块的目标重建图像块。The first filtering unit is configured to use the weight matrix to determine a target reconstructed image block of the current block when the at least one syntax element identification information indicates that the current frame or the current block uses a weight matrix for filtering processing.
  49. 一种编码器,所述编码器包括第一存储器和第一处理器;其中,An encoder comprising a first memory and a first processor; wherein,
    所述第一存储器,用于存储能够在所述第一处理器上运行的计算机程序;the first memory for storing a computer program executable on the first processor;
    所述第一处理器,用于在运行所述计算机程序时,执行如权利要求22至46任一项所述的方法。The first processor is configured to execute the method according to any one of claims 22 to 46 when running the computer program.
  50. 一种解码器,所述解码器包括解析单元、第二确定单元和第二滤波单元;其中,A decoder comprising a parsing unit, a second determining unit and a second filtering unit; wherein,
    所述解析单元,配置为解析码流,确定至少一个语法元素标识信息的取值;The parsing unit is configured to parse the code stream and determine the value of at least one syntax element identification information;
    所述第二确定单元,配置为当所述至少一个语法元素标识信息指示当前帧或当前块使用权重矩阵进行滤波处理时,确定当前块的权重矩阵网络模型,并根据所述权重矩阵网络模型确定所述当前块的权重矩阵;The second determining unit is configured to determine the weight matrix network model of the current block when the at least one syntax element identification information indicates that the current frame or the current block uses the weight matrix for filtering processing, and determine according to the weight matrix network model the weight matrix of the current block;
    所述第二滤波单元,配置为利用所述权重矩阵,确定所述当前块的目标重建图像块。The second filtering unit is configured to use the weight matrix to determine a target reconstructed image block of the current block.
  51. 一种解码器,所述解码器包括第二存储器和第二处理器;其中,A decoder comprising a second memory and a second processor; wherein,
    所述第二存储器,用于存储能够在所述第二处理器上运行的计算机程序;the second memory for storing a computer program executable on the second processor;
    所述第二处理器,用于在运行所述计算机程序时,执行如权利要求1至21任一项所述的方法。The second processor is configured to execute the method according to any one of claims 1 to 21 when running the computer program.
  52. 一种计算机存储介质,其中,所述计算机存储介质存储有计算机程序,所述计算机程序被执行时实现如权利要求1至21任一项所述的方法、或者实现如权利要求22至46任一项所述的方法。A computer storage medium, wherein the computer 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 any one of claims 22 to 46 is realized. method described in item.
PCT/CN2021/091670 2021-04-30 2021-04-30 Encoding and decoding methods, code stream, encoder, decoder, and storage medium WO2022227062A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2021/091670 WO2022227062A1 (en) 2021-04-30 2021-04-30 Encoding and decoding methods, code stream, encoder, decoder, and storage medium
CN202180090942.1A CN116803078A (en) 2021-04-30 2021-04-30 Encoding/decoding method, code stream, encoder, decoder, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/091670 WO2022227062A1 (en) 2021-04-30 2021-04-30 Encoding and decoding methods, code stream, encoder, decoder, and storage medium

Publications (1)

Publication Number Publication Date
WO2022227062A1 true WO2022227062A1 (en) 2022-11-03

Family

ID=83847558

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/091670 WO2022227062A1 (en) 2021-04-30 2021-04-30 Encoding and decoding methods, code stream, encoder, decoder, and storage medium

Country Status (2)

Country Link
CN (1) CN116803078A (en)
WO (1) WO2022227062A1 (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019009491A1 (en) * 2017-07-06 2019-01-10 삼성전자 주식회사 Method and device for encoding or decoding image
CN111372084A (en) * 2020-02-18 2020-07-03 北京大学 Parallel reasoning method and system for neural network coding and decoding tool
US20200288158A1 (en) * 2019-03-05 2020-09-10 Qualcomm Incorporated Prediction-domain filtering for video coding
US20200296364A1 (en) * 2019-03-12 2020-09-17 Qualcomm Incorporated Combined in-loop filters for video coding
CN111711824A (en) * 2020-06-29 2020-09-25 腾讯科技(深圳)有限公司 Loop filtering method, device and equipment in video coding and decoding and storage medium
US20210099710A1 (en) * 2018-04-01 2021-04-01 Lg Electronics Inc. Method for image coding using convolution neural network and apparatus thereof

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019009491A1 (en) * 2017-07-06 2019-01-10 삼성전자 주식회사 Method and device for encoding or decoding image
US20210099710A1 (en) * 2018-04-01 2021-04-01 Lg Electronics Inc. Method for image coding using convolution neural network and apparatus thereof
US20200288158A1 (en) * 2019-03-05 2020-09-10 Qualcomm Incorporated Prediction-domain filtering for video coding
US20200296364A1 (en) * 2019-03-12 2020-09-17 Qualcomm Incorporated Combined in-loop filters for video coding
CN111372084A (en) * 2020-02-18 2020-07-03 北京大学 Parallel reasoning method and system for neural network coding and decoding tool
CN111711824A (en) * 2020-06-29 2020-09-25 腾讯科技(深圳)有限公司 Loop filtering method, device and equipment in video coding and decoding and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
T. TOMA (PANASONIC), T. NISHI (PANASONIC), K. ABE (PANASONIC), R. KANOH (PANASONIC), C. LIM (PANASONIC), J. LI (PANASONIC), R. LIA: "Description of SDR video coding technology proposal by Panasonic", 10. JVET MEETING; 20180410 - 20180420; SAN DIEGO; (THE JOINT VIDEO EXPLORATION TEAM OF ISO/IEC JTC1/SC29/WG11 AND ITU-T SG.16 ), no. JVET-J0020, 2 April 2018 (2018-04-02), pages 1 - 75, XP030151181 *

Also Published As

Publication number Publication date
CN116803078A (en) 2023-09-22

Similar Documents

Publication Publication Date Title
US11589041B2 (en) Method and apparatus of neural network based processing in video coding
CN111711824B (en) Loop filtering method, device and equipment in video coding and decoding and storage medium
WO2020177133A1 (en) Loop filter implementation method and apparatus, and computer storage medium
WO2022052533A1 (en) Encoding method, decoding method, encoder, decoder, and encoding system
WO2021185008A1 (en) Encoding method, decoding method, encoder, decoder, and electronic device
CN113747179B (en) Loop filter implementation method and device and computer storage medium
CN118020297A (en) End-to-end image and video coding method based on hybrid neural network
CN116916036A (en) Video compression method, device and system
WO2020192085A1 (en) Image prediction method, coder, decoder, and storage medium
WO2022116085A1 (en) Encoding method, decoding method, encoder, decoder, and electronic device
WO2022227062A1 (en) Encoding and decoding methods, code stream, encoder, decoder, and storage medium
Santamaria et al. Overfitting multiplier parameters for content-adaptive post-filtering in video coding
WO2022178686A1 (en) Encoding/decoding method, encoding/decoding device, encoding/decoding system, and computer readable storage medium
WO2022257049A1 (en) Encoding method, decoding method, code stream, encoder, decoder and storage medium
WO2022257130A1 (en) Encoding method, decoding method, code stream, encoder, decoder, system and storage medium
WO2023245544A1 (en) Encoding and decoding method, bitstream, encoder, decoder, and storage medium
CN117063467A (en) Block dividing method, encoder, decoder, and computer storage medium
CN112954350A (en) Video post-processing optimization method and device based on frame classification
WO2023130226A1 (en) Filtering method, decoder, encoder and computer-readable storage medium
WO2024016156A1 (en) Filtering method, encoder, decoder, code stream and storage medium
WO2023123398A1 (en) Filtering method, filtering apparatus, and electronic device
Ghassab et al. Video Compression Using Convolutional Neural Networks of Video With Chroma Subsampling
WO2023240618A1 (en) Filter method, decoder, encoder, and computer-readable storage medium
WO2024077573A1 (en) Encoding and decoding methods, encoder, decoder, code stream, and storage medium
WO2023197230A1 (en) Filtering method, encoder, decoder and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21938536

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 202180090942.1

Country of ref document: CN

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21938536

Country of ref document: EP

Kind code of ref document: A1