Encoding method, decoding method, encoder, decoder, and storage medium

By determining the intra-frame prediction mode parameters and syntax element information during the decoding process, and accurately selecting the transform parameters, the problem of low accuracy in transform set derivation is solved, thus improving encoding and decoding performance and decoding quality.

WO2025222527A1PCT designated stage Publication Date: 2025-10-30GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/090235
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-04-26
Publication Date
2025-10-30

AI Technical Summary

Technical Problem

In matrix-based intra-prediction modes, when using decoder-side intra-mode derivation techniques for low-frequency indivisible secondary transforms and indivisible primary transforms, the accuracy of the transform set derivation is low, affecting encoding and decoding performance.

Method used

The intra-prediction mode parameters and first syntax element information of the current block are determined by decoding the bitstream. Based on this information, transform parameters are determined to improve the accuracy and flexibility of transform parameters and select transform parameters that are suitable for the characteristics of the current block.

Benefits of technology

It improves encoding and decoding performance, reduces errors and distortions during the decoding process, adapts to different types of image or video content, and improves decoding efficiency and quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024090235_30102025_PF_FP_ABST
    Figure CN2024090235_30102025_PF_FP_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose an encoding method, a decoding method, an encoder, a decoder, and a storage medium. The decoding method comprises: decoding a bitstream, and determining intra prediction mode parameters of a current block and first syntax element information of the current block, wherein the first syntax element information is used for indicating the determination mode of transformation parameters; and on the basis of the first syntax element information, using the intra prediction mode parameters to determine the transformation parameters of the current block. The present application can improve the accuracy of transformation parameters, and increase the flexibility in selecting a transformation set, thereby enhancing encoding and decoding performance.
Need to check novelty before this filing date? Find Prior Art

Description

Encoding / decoding methods, encoders, decoders, and storage media Technical Field

[0001] This application relates to the field of video encoding and decoding technology, and in particular to an encoding and decoding method, encoder, decoder, and storage medium. Background Technology

[0002] As people's demands for video display quality increase, new video application forms such as high-definition and ultra-high-definition video have emerged. H.265 / High Efficiency Video Coding (HEVC) can no longer meet the needs of the rapidly developing video applications. The Joint Video Exploration Team (JVET) proposed the next-generation video coding standard H.266 / Versatile Video Coding (VVC), and its corresponding test model is the VVC Reference Software Test Model (VTM).

[0003] In related technologies, in the matrix-based intra-prediction mode, when using decoder-side intra-mode derivation (DIMD) to perform low-frequency non-separable transform (LFNST) or non-separable primary transform (NSPT) to derive the transform set, the accuracy of the derivation method of the transform set (transform parameters) is low, thus affecting the encoding and decoding performance.

[0004] Summary of the Invention

[0005] This application provides an encoding / decoding method, encoder, decoder, and storage medium, which can improve the accuracy of transform parameters, make the selection of transform sets more flexible, and thus improve encoding / decoding performance.

[0006] The technical solution of this application embodiment can be implemented as follows:

[0007] In a first aspect, embodiments of this application provide a decoding method applied to an encoder, the method comprising:

[0008] Decode the bitstream to determine the intra-prediction mode parameters of the current block and the first syntax element information of the current block; wherein, the first syntax element information is used to indicate the method of determining the transform parameters;

[0009] Based on the first syntax element information, the transformation parameters of the current block are determined using the intra-frame prediction mode parameters.

[0010] Secondly, embodiments of this application provide a decoding method applied to a decoder, the method comprising:

[0011] Determine the intra-prediction mode parameters for the current block;

[0012] The candidate transform parameters for the current block are determined using the intra-frame prediction mode parameters.

[0013] Encode the residual values ​​of the current block corresponding to the candidate transformation parameters to determine the transformation parameters of the current block;

[0014] Based on the transformation parameters of the current block, the first syntax element information is determined, and the first syntax element information is encoded. The resulting encoded bits are written into the bitstream. The first syntax element information is used to indicate the method of determining the transformation parameters.

[0015] Thirdly, embodiments of this application provide a bitstream, which is generated by bit encoding based on information to be encoded; wherein the information to be encoded includes at least one of the following:

[0016] The information comprises a first syntax element, a second syntax element, a third syntax element, and intra-prediction mode parameters; the first syntax element indicates how the transform parameters of the current block are determined; the second syntax element indicates the preset traversal order of the current block; and the third syntax element indicates whether the current block uses transform set derivation.

[0017] Fourthly, embodiments of this application provide an encoder, which includes: a decoding part and a first determining part; wherein,

[0018] The decoding section is configured to decode the bitstream, determine the intra-frame prediction mode parameters of the current block and the first syntax element information of the current block; wherein, the first syntax element information is used to indicate the method of determining the transform parameters;

[0019] The first determining part is configured to determine the transform parameters of the current block based on the first syntax element information and the intra-prediction mode parameters.

[0020] Fifthly, embodiments of this application provide an encoder, which includes a second determining portion and an encoding portion; wherein,

[0021] The second determining part is configured to: determine the intra-prediction mode parameters of the current block; use the intra-prediction mode parameters to determine the candidate transform parameters of the current block; perform encoding decisions on the residual values ​​of the current block corresponding to the candidate transform parameters to determine the transform parameters of the current block; and determine the first syntax element information based on the transform parameters of the current block.

[0022] The encoding part is configured to encode the first syntax element information and write the resulting encoded bits into the code stream; wherein the first syntax element information is used to indicate the method of determining the transformation parameters.

[0023] Sixthly, embodiments of this application provide a decoder, the decoder including a first memory and a first processor, wherein:

[0024] The first memory is configured to store computer programs that can run on the first processor;

[0025] The first processor is configured to perform the method as described in the first aspect when running the computer program.

[0026] In a seventh aspect, embodiments of this application provide a decoder, wherein the encoder includes a second memory and a second processor, wherein:

[0027] The second memory is configured to store computer programs that can run on the second processor;

[0028] The second processor is configured to perform the method described in the second aspect when running the computer program.

[0029] Eighthly, embodiments of this application provide a computer storage medium storing a computer program that, when executed by a first processor, implements the method described in the first aspect, or when executed by a second processor, implements the method described in the second aspect.

[0030] This application provides an encoding / decoding method, encoder, decoder, and storage medium. The decoding method includes: decoding a bitstream; determining intra-frame prediction mode parameters of the current block and first syntax element information of the current block; wherein the first syntax element information is used to indicate the method for determining transform parameters; and determining the transform parameters of the current block based on the first syntax element information and the intra-frame prediction mode parameters. The first syntax element information indicates the method for determining transform parameters, which means that the decoder can more accurately select transform parameters suitable for the features of the current block. Thus, the use of the first syntax element information makes the selection of transform sets more flexible. By improving the accuracy and flexibility of transform parameters, accurate selection of transform parameters can reduce errors and distortions in the decoding process, while flexible selection of transform parameters can better adapt to different types of image or video content, thereby improving encoding / decoding performance. Attached Figure Description

[0031] Figure 1 is a flowchart of a MIP prediction process provided by a related technical solution;

[0032] Figure 2A is a block diagram of a video encoding system provided in an embodiment of this application;

[0033] Figure 2B is a block diagram of a video decoding system provided in an embodiment of this application;

[0034] Figure 3 is a schematic diagram of the application location of LFNST technology provided in an embodiment of this application;

[0035] Figure 4 is a schematic diagram of the application location of NSPT technology provided in an embodiment of this application;

[0036] Figure 5 is a flowchart illustrating a decoding method provided in an embodiment of this application;

[0037] Figure 6 is a schematic flowchart of a MIP prediction process provided in an embodiment of this application;

[0038] Figure 7 is a structural schematic diagram of a reference pixel position provided in an embodiment of this application;

[0039] Figure 8 is a schematic flowchart of a MIP prediction process provided in an embodiment of this application;

[0040] Figure 9 is a schematic diagram of a reference pixel downsampling process provided in an embodiment of this application;

[0041] Figure 10A is a schematic diagram of a buffer filling structure provided by a related technical solution;

[0042] Figure 10B is a schematic diagram of another buffer filling structure provided by the relevant technical solution;

[0043] Figure 11 is a schematic diagram of a structure for generating predicted values ​​provided in an embodiment of this application;

[0044] Figure 12 is a schematic diagram of a structure for filling predictive sampling pixels provided in an embodiment of this application;

[0045] Figure 13 is a schematic diagram of an upsampling-first horizontal interpolation structure provided in an embodiment of this application;

[0046] Figure 14 is a schematic diagram of the distribution of linear interpolation weights provided in an embodiment of this application;

[0047] Figure 15 is a schematic diagram of an upsampling and then vertical interpolation structure provided in an embodiment of this application;

[0048] Figure 16 is a flowchart illustrating an encoding method provided in an embodiment of this application;

[0049] Figure 17A is a schematic diagram of a decoding end implementation provided in an embodiment of this application;

[0050] Figure 17B is a schematic diagram of a decoding end implementation provided in an embodiment of this application;

[0051] Figure 17C is a schematic diagram of a decoding end implementation provided in an embodiment of this application;

[0052] Figure 18 is a schematic diagram of an encoding end implementation provided in an embodiment of this application;

[0053] Figure 19 is a schematic diagram of a decoding end implementation provided in an embodiment of this application;

[0054] Figure 20 is a schematic diagram of the composition structure of a decoder provided in an embodiment of this application;

[0055] Figure 21 is a schematic diagram of the specific hardware structure of a decoder provided in an embodiment of this application;

[0056] Figure 22 is a schematic diagram of the composition structure of an encoder provided in an embodiment of this application;

[0057] Figure 23 is a schematic diagram of the specific hardware structure of an encoder provided in an embodiment of this application;

[0058] Figure 24 is a schematic diagram of the composition structure of an encoding and decoding system provided in an embodiment of this application. Detailed Implementation

[0059] In order to gain a more detailed understanding of the features and technical content of the embodiments of this application, the implementation of the embodiments of this application will be described in detail below with reference to the accompanying drawings. The accompanying drawings are for reference and illustration only and are not intended to limit the embodiments of this application.

[0060] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.

[0061] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0062] It should also be noted that the terms "first, second, and third" used in the embodiments of this application are only used to distinguish similar objects and do not represent a specific order of objects. It is understood that "first, second, and third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.

[0063] In video images, a coding block (CB) is generally represented by a first image component, a second image component, and a third image component. These three image components are a luminance component, a blue chrominance component, and a red chrominance component, respectively. 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. Thus, video images can be represented in YCbCr format or YUV format.

[0064] In the embodiments of this application, the first image component can be a luminance component, the second image component can be a blue chroma component, and the third image component can be a red chroma component, but the embodiments of this application do not impose specific limitations.

[0065] The following section will describe the relevant technical solutions for the current prediction process of MIP technology.

[0066] The input data for MIP prediction mainly includes: the position of the current block (xTbCmp, yTbCmp), the MIP prediction mode applied to the current block (which can be represented by modeId), the height of the current block (represented by nTbH), the width of the current block (represented by nTbW), and a transpose processing indicator flag indicating whether transpose is required (which can be represented by isTransposed).

[0067] The output data of MIP prediction mainly includes the prediction block of the current block, and the prediction value corresponding to the pixel coordinates [x][y] in the prediction block is predSamples[x][y]; where x = 0, 1, ..., nTbW-1; y = 0, 1, ..., nTbH-1.

[0068] Here, as shown in Figure 1, the MIP prediction process can be divided into four steps: configuring core parameters 11, acquiring reference pixels 12, constructing input samples 13, and generating predicted values ​​14. Specifically, for configuring core parameters 11, the current block can be divided into three categories according to the size of the current block within the frame, and the type of the current block is recorded by mipSizeId; moreover, the number of reference sampling points and the number of matrix multiplication output sampling points are different for different types of current blocks. For acquiring reference pixels 12, when predicting the current block, the upper and left blocks of the current block are already encoded blocks. The reference pixels of the MIP technology are the reconstructed values ​​of the pixels in the previous row and the left column of the current block. The process of acquiring the reference pixels adjacent to the upper side (represented by refT) and the reference pixels adjacent to the left side (represented by refL) of the current block is the process of acquiring reference pixels. For constructing input samples 13, this step is used for the input of matrix multiplication and mainly includes: obtaining reference samples 131, constructing a reference sampling buffer 132, and deriving matrix multiplication input samples 133. The process of obtaining reference samples is a downsampling process, and constructing the reference sampling buffer 132 can include buffer filling methods 1321 when transposition is not needed and buffer filling methods 1322 when transposition is needed. For generating predicted values ​​14, this step is used to obtain the MIP predicted value of the current block and mainly includes: constructing a matrix multiplication output sampling block 141, matrix multiplication output sampling embedding 142, matrix multiplication output sampling transposition 143, and generating the final MIP predicted value 144. The process of constructing the matrix multiplication output sampling block 141 can include obtaining the weight matrix 1411, obtaining the shift factor and offset factor 1412, and performing matrix multiplication operations 1413. The process of generating the final MIP predicted value 144 can include generating predicted values ​​that do not require upsampling 1441 and generating predicted values ​​that require upsampling 1442. In this way, after these four steps, the predicted value of at least one pixel in the current block can be obtained.

[0069] The embodiments of this application will now be described in detail with reference to the accompanying drawings.

[0070] Referring to Figure 2A, which shows an example of a block diagram of a video coding system provided in this application embodiment; as shown in Figure 2A, 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 and analysis unit 107, a filtering unit 108, an encoding unit 109, and a decoding image buffer unit 110, etc., wherein the filtering unit 108 can implement deblocking filtering and sample adaptive offset (SAO) filtering, and the encoding unit 109 can implement header information encoding and context-based adaptive binary arithmetic coding (CABAC).For the input raw video signal, a video coding block can be obtained by partitioning it into Coding Tree Units (CTUs). Then, the residual pixel information obtained after intra-frame or inter-frame prediction is transformed by the transform and quantization unit 101, including transforming the residual information from the pixel domain to the transform domain and quantizing the resulting transform coefficients to further reduce the bit rate. The intra-frame estimation unit 102 and the intra-frame prediction unit 103 are used to perform intra-frame prediction on the video coding block. Specifically, the intra-frame estimation unit 102 and the intra-frame prediction unit 103 are used to determine the intra-frame prediction mode to be used to encode the video coding block. The motion compensation unit 104 and the motion estimation unit 105 are used to perform inter-frame prediction coding of the received video coding block relative to one or more blocks in one or more reference frames to provide temporal prediction information. The motion estimation performed by the motion estimation unit 105 is a process of generating motion vectors, which can estimate the motion of the video coding block. Then, the motion compensation unit 104 uses the motion vectors determined by the motion estimation unit 105 to perform the motion estimation. The motion compensation is performed. After determining the intra-prediction mode, the intra-prediction unit 103 is also used to provide the selected intra-prediction data to the coding unit 109, and the motion estimation unit 105 also sends the calculated motion vector data to the coding unit 109. In addition, the inverse transform and inverse quantization unit 106 is used to reconstruct the video coding block, reconstruct the residual block in the pixel domain, and remove the block artifacts by the filter control analysis unit 107 and the filtering unit 108. Then, the reconstructed residual block is added to a predictive block in the frame of the decoding image buffer unit 110 to generate the reconstructed video coding block. The coding unit 109 is used to encode 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-prediction mode and output the bitstream of the video signal. The decoding image buffer unit 110 is used to store the reconstructed video coding block for prediction reference. As video image encoding proceeds, new reconstructed video encoding blocks are continuously generated, and these reconstructed video encoding blocks are stored in the decoding image buffer unit 110.

[0071] Referring to Figure 2B, which shows an example of a block diagram of a video decoding system provided in an embodiment of this application; as shown in Figure 2B, 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, and a decoding image buffer unit 206, etc., wherein the decoding unit 201 can perform header information decoding and CABAC decoding, and the filtering unit 205 can perform deblocking filtering and SAO filtering. After the input video signal undergoes the encoding process shown in Figure 2A, the output video signal bitstream is generated. This bitstream is input into the video decoding system 20, first passing through the decoding unit 201 to obtain the decoded transform coefficients. These transform coefficients are then processed by the inverse transform and inverse quantization unit 202 to generate residual blocks in the pixel domain. The intra-frame prediction unit 203 can generate prediction data for the current video decoding block based on the determined intra-frame prediction mode and data from previously decoded blocks in the current frame or image. The motion compensation unit 204 determines the prediction information for the video decoding block by analyzing motion vectors and other associated syntax elements, and... The prediction information is used to generate a predictive block for the video block being decoded; the decoded video block is formed by summing the residual block from the inverse transform and inverse quantization unit 202 with the corresponding predictive block generated by the intra-frame prediction unit 203 or the motion compensation unit 204; the decoded video signal is passed through the filtering unit 205 to remove block artifacts, which can improve video quality; then the decoded video block is stored in the decoding image buffer unit 206, which stores reference images for subsequent intra-frame prediction or motion compensation, and is also used for the output of the video signal, thus obtaining the recovered original video signal.

[0072] The image prediction method in this embodiment is mainly applied to the intra-prediction unit 103 shown in Figure 2A and the intra-prediction unit 203 shown in Figure 2B. That is, the image prediction method in this embodiment can be applied to both video coding and video decoding systems, and even simultaneously, but this embodiment does not impose specific limitations. It should also be noted that when the image prediction method is applied to the intra-prediction unit 103, "current block" specifically refers to the current coding block in intra-prediction; when the image prediction method is applied to the intra-prediction unit 203, "current block" specifically refers to the current decoding block in intra-prediction.

[0073] The embodiments of this application can be applied to scenarios of low-frequency indivisible quadratic transformation or extended low-frequency indivisible quadratic transformation, or other scenarios that require transformation techniques associated with the coding mode of the coding block. The embodiments of this application are not limited.

[0074] The following will describe the relevant technical solutions for LFNST technology.

[0075] Referring to Figure 3, it shows a schematic diagram of the application location of an LFNST technology provided by the relevant technical solution. As shown in Figure 3, in the intra-frame prediction mode, for the encoder side, LFNST technology is applied between the positive first-order transform unit 21 and the quantization unit 22, and LFNST technology is applied between the inverse quantization unit 23 and the inverse first-order transform unit 24.

[0076] On the encoder side, the data, such as the prediction residual (which can be represented as residual), is first transformed by the positive first-order transform unit 21 (which can be called "Core Transform", "first-order transform" or "main transform") to obtain the transform coefficient matrix after the first transformation (i.e., the second transform coefficients). Then, the coefficients in the transform coefficient matrix are transformed by LFNST (which can be called "Secondary Transform") to obtain the LFNST transform coefficient matrix (i.e., the first transform coefficients). Finally, the LFNST transform coefficient matrix is ​​quantized by the quantization unit 22, and the final quantized coefficients are written into the video bitstream.

[0077] On the decoder side, the quantization coefficients of the LFNST transform coefficient matrix can be obtained by parsing the bitstream. The inverse quantization unit 23 performs inverse quantization on these coefficients (which can be called "scaling") to obtain the recovered values ​​of the LFNST transform coefficient matrix (i.e., the first transform coefficients). Performing an inverse LFNST transform on these recovered values ​​yields the second transform coefficients. Then, the inverse first transform unit 14 performs an inverse transform on the second transform coefficients corresponding to the encoder-side "Core Transform," ultimately obtaining the residual recovered values. It is important to note that the standard only defines the "inverse transform" operation on the decoder side; therefore, the "inverse LFNST transform" is also referred to as the "LFNST transform" in the standard. Here, to distinguish it from the encoder-side transform, the encoder-side "LFNST transform" can be called the "forward LFNST transform," and the decoder-side "LFNST transform" can be called the "inverse LFNST transform."

[0078] In other words, on the encoder side, the prediction residual of the current transform block is transformed into first-order transform coefficients, i.e., second-order transform coefficients, through positive first-order transform. Then, some of the first-order transform coefficients are multiplied by matrix multiplication and multiplied by the transform matrix to perform a second-order transform, resulting in fewer and more concentrated second-order transform coefficients (i.e., first-order transform coefficients). These are then quantized to obtain quantized coefficients. On the decoder side, after parsing the quantized coefficients, they are dequantized. The dequantized first-order transform coefficients are then multiplied by matrix multiplication to perform an inverse second-order transform, and then the inverse second-order transform coefficients are performed an inverse first-order transform to recover the prediction residual.

[0079] In LFNST-related technologies, the LFNST transformation process may include steps such as configuring core parameters, determining the transformation set, selecting and determining the transformation matrix, calculating matrix multiplication, and constructing the inverse first-order transformation coefficient matrix; after these steps, the LFNST transformation is considered complete.

[0080] Referring to Figure 4, it shows a schematic diagram of the application location of an NSPT technology provided by a related technical solution. As shown in Figure 4, for a forward NSPT transform, there are 64 input coefficients and 32 output coefficients. For a reverse NSPT transform, there are 32 input coefficients and 64 output coefficients.

[0081] Specifically, on the encoder side, the data, such as the prediction residual (which can be represented as residual), is first transformed by the forward NSPT to obtain the transform coefficient matrix. The forward NSPT transform coefficient matrix is ​​then quantized by the quantization unit 31, and the final quantized coefficients are entropy encoded and written into the video bitstream.

[0082] On the decoder side, by parsing the bitstream (entropy decoding), the quantization coefficients of the NSPT transform coefficient matrix can be obtained. The quantization coefficients are then dequantized using the dequantization unit 32 (a process that can be called "scaling") to obtain the recovered value of the NSPT transform coefficient matrix. Performing a reverse NSPT transform on this recovered value yields the recovered residual value. It should be noted that the "reverse NSPT transform" is also called the "NSPT transform"; here, to distinguish it from the encoder-side transform, the encoder-side "NSPT transform" can be called the "forward NSPT transform," and the decoder-side "NSPT transform" can be called the "reverse NSPT transform."

[0083] In other words, on the encoder side, the prediction residual of the current transform block (i.e., the residual block) is transformed by multiplying it with the transform matrix to obtain transform coefficients, which are then quantized to obtain quantization coefficients. On the decoder side, the quantization coefficients are dequantized to obtain transform coefficients, and then the obtained transform coefficients are inversely transformed to recover the prediction residual.

[0084] In NSPT-related technologies, the NSPT transformation process may include steps such as configuring core parameters, determining the transformation set, determining the transformation matrix, calculating matrix multiplication, and obtaining the coefficient matrix in scan order; after these steps, the NSPT transformation is considered complete.

[0085] In this embodiment, for non-directional intra-frame prediction mode, the "determined transform set" for LFNST / NSPT of the residual can be determined by performing DIMD analysis on the prediction block and then determining the result based on the analysis. However, in current MIP mode, when using DIMD to derive the LFNST / NSPT transform set, the accuracy of the derivation method of the transform set (transform parameters) is low, thus affecting the encoding and decoding performance.

[0086] Based on this, in a first aspect, embodiments of this application provide a decoding method. The main idea of ​​this decoding method is: decoding the bitstream, determining the intra-prediction mode parameters of the current block and the first syntax element information of the current block; wherein, the first syntax element information is used to indicate the method for determining the transform parameters; based on the first syntax element information, the intra-prediction mode parameters are used to determine the transform parameters of the current block. The first syntax element information indicates the method for determining the transform parameters, which means that the decoder can more accurately select transform parameters suitable for the features of the current block. The use of the first syntax element information makes the selection of the transform set more flexible. By improving the accuracy and flexibility of the transform parameters, the overall decoding performance can be improved. Accurate selection of transform parameters can reduce errors and distortions in the decoding process, while flexible selection of transform parameters can better adapt to different types of image or video content, thereby improving the efficiency and quality of decoding.

[0087] In one embodiment of this application, FIG5 is a schematic flowchart of a decoding method provided by an embodiment of this application. As shown in FIG5, the method may include S301 to S302:

[0088] S301. Decode the bitstream and determine the intra-prediction mode parameters of the current block and the first syntax element information of the current block; wherein, the first syntax element information is used to indicate the method of determining the transform parameters.

[0089] It should be noted that this decoding method is applied to the decoder, specifically a method for selecting transform sets based on intra-frame non-directional mode prediction block residuals.

[0090] In this embodiment, during the decoding process, the decoder first obtains the prediction mode parameters of the current block when decoding the bitstream. The prediction mode parameters indicate the encoding mode of the current block and the parameters related to that mode. The prediction modes typically include traditional intra-frame prediction modes and non-traditional intra-frame prediction modes. Traditional intra-frame prediction modes may include DC mode, Planar mode, and Angle prediction mode, etc., while non-traditional intra-frame prediction modes (first type of intra-frame prediction modes) may include MIP mode, CCLM mode, IBC mode, and PLT mode, etc.

[0091] In the embodiments of this application, the intra-frame prediction mode refers to a non-traditional intra-frame prediction mode. Specifically, the intra-frame prediction mode can be understood as a non-angle prediction mode.

[0092] In this embodiment of the application, the first syntax element information is used to indicate the method of determining the transformation parameters. The method of determining the transformation parameters indicated by the first syntax element information includes the following three cases:

[0093] Case 1: The first syntax element information is used to indicate the type of predicted value corresponding to the current block; wherein, the predicted value type includes a first type and / or a second type, the first type indicating that the current block uses a first predicted value to determine the transformation parameters, and the second type indicating that the current block uses a second predicted value to determine the transformation parameters. The second predicted value is obtained by filtering the first predicted value.

[0094] In some embodiments of this application, the filtering process includes upsampling and / or downsampling. Furthermore, the filtering process may also include smoothing filtering, bilateral filtering, mean filtering, Gaussian filtering, median filtering, etc. This application does not limit the scope of the filtering process in any way.

[0095] Case 2: The first syntax element information is used to indicate the first type of the current block; where the first type indicates that the default prediction type of the current block is the first prediction (such as the prediction before sampling).

[0096] Case 3: The first syntax element information is used to indicate the index identifier of the transform parameter corresponding to the current block. For example, assuming the value of the first syntax element information is 0, the index identifier of the transform parameter corresponding to the current block is 0. In this case, the first predicted value corresponding to index identifier 0 is used to determine the transform parameter. Assuming the value of the first syntax element information is 1, the index identifier of the transform parameter corresponding to the current block is 1. In this case, the second predicted value corresponding to index identifier 1 is used to determine the transform parameter.

[0097] In this embodiment of the application, the first syntax element information can be represented as nUseDefaultSample.

[0098] In this embodiment, after learning the prediction mode, the decoder can determine the intra-prediction mode parameters of the current block. The intra-prediction mode parameters are the parameters corresponding to the intra-prediction mode.

[0099] For example, when the intra-prediction mode is MIP mode, the parameters corresponding to the intra-prediction mode are MIP parameters.

[0100] In some embodiments, intra-prediction mode parameters may include: intra-prediction mode index (which can be represented by modeId), current block size, current block type (which can be represented by mipSizeId), etc.; the values ​​of these parameters can be obtained from the decoded bitstream. The MIP parameters may include MIP transpose indicator parameters (which can be represented by isTransposed), MIP mode index number (which can be represented by modeId), current block size, current block type (which can be represented by mipSizeId), etc. For different types of current blocks, the number of reference samples (boundySize reference sample points per side), the number of matrix multiplication input samples inSize, and the number of matrix multiplication output samples (arranged in predSize×predSize) are different.

[0101] In one implementation, determining the category of the current block based on its size may include:

[0102] If the width and height of the current block are both equal to 4, then the value of mipSizeId can be set to 0;

[0103] Conversely, if either the width or height of the current block is 4, or if both the width and height of the current block are 8, then the value of mipSizeId can be set to 1.

[0104] Conversely, if the current block is of a different size, then the value of mipSizeId can be set to 2.

[0105] In another implementation, determining the category of the current block based on its size may include:

[0106] If the width and height of the current block are both equal to 4, then the value of mipSizeId can be set to 0;

[0107] Conversely, if either the width or height of the current block is 4, then the value of mipSizeId can be set to 1;

[0108] Conversely, if the current block is of a different size, then the value of mipSizeId can be set to 2.

[0109] In this way, during the process of using MIP to determine the intra-prediction value, the MIP parameters can also be determined, which makes it easier to determine the LFNST transform kernel (which can be represented as kernel) used in the current block based on the determined MIP parameters.

[0110] The following explanation uses the MIP parameter as an example.

[0111] In some embodiments, the value of isTransposed can be determined by decoding the bitstream. When the value of isTransposed is equal to 1, the sampling point input vector used in MIP mode needs to be transposed. When the value of isTransposed is equal to 0, the sampling point input vector used in MIP mode does not need to be transposed. In other words, the MIP transpose indicator parameter can be used to indicate whether the sampling point input vector used in MIP mode needs to be transposed.

[0112] In some embodiments, the MIP mode index number (which can be represented by modeId) can also be determined by decoding the bitstream. The MIP mode index number can indicate the MIP mode used by the current block, and the MIP mode can indicate the calculation derivation method for determining the intra-prediction value of the current block using MIP. That is, since there can be many different MIP modes, these modes can be distinguished by their MIP mode index numbers; different MIP modes have different MIP mode index numbers. Thus, based on the calculation derivation method for determining the intra-prediction value of the current block using MIP, the specific MIP mode can be determined, and the corresponding MIP mode index number can be obtained. In this embodiment, the MIP mode index number can be 0, 1, 2, 3, 4, or 5.

[0113] In some embodiments, by decoding the bitstream, parameters such as the size, aspect ratio, and type of the current block (which can be represented by mipSizeId) can also be determined. This allows for the subsequent selection of the transform kernel (which can be represented by a kernel, such as the LFNST transform kernel) or scan order parameters for the current block based on the determined MIP parameters, or the determination of the first prediction value for the current block based on the determined MIP parameters, and the selection of the transform kernel or scan order parameters based on the first prediction value.

[0114] S302. Based on the information of the first syntax element, the transform parameters of the current block are determined using the intra-frame prediction mode parameters.

[0115] In this embodiment, the decoder determines the transform parameters (also known as the transform set) of the current block based on the first syntax element information and the intra-frame prediction mode parameters.

[0116] Understandably, on the one hand, the first syntax element information indicates how the transform parameters are determined, meaning the decoder can more accurately select transform parameters suitable for the current block's features. For example, some image blocks may be better suited to high-precision transform parameters, while simpler parameters can be used for others. Accurate selection of transform parameters improves the accuracy and clarity of the decoded image. On the other hand, the use of the first syntax element information makes the selection of transform sets more flexible. This means the decoder can select different transform parameter sets based on the characteristics of different blocks or decoding requirements, thereby adapting to decoding requirements in different scenarios and improving decoding flexibility and adaptability. Furthermore, improving the accuracy and flexibility of transform parameters improves overall decoding performance. Accurate selection of transform parameters reduces errors and distortion during the decoding process, while flexible selection better adapts to different types of image or video content, thereby improving decoding efficiency and quality.

[0117] In some embodiments of this application, the implementation of determining the transform parameters of the current block based on the first syntax element information and using intra-prediction mode parameters in step S302 may include steps S3021 and S3022:

[0118] S3021. Determine the first prediction value and / or the second prediction value of the current block according to the intra-frame prediction mode parameters; wherein the second prediction value is obtained by filtering the first prediction value.

[0119] S3022. Based on the information of the first syntax element, determine the transformation parameters using the first predicted value or the second predicted value.

[0120] Understandably, on the one hand, the second predicted value is obtained by filtering the first predicted value, meaning more information can be utilized in the prediction process. By appropriately utilizing the filtered second predicted value, the information in the image or video data can be used more fully, improving decoding efficiency and quality. On the other hand, selecting appropriate predicted values ​​to determine the transform parameters can optimize computation and resource utilization during the decoding process. For example, choosing either the first predicted value or the filtered second predicted value as the transform parameter based on the actual situation can reduce the computational complexity of the decoder and improve decoding performance.

[0121] It should be noted that the ideas of the embodiments in this application can also be adopted for other non-vector modes, or if filtering is not required in the MIP prediction process. Examples include: Spatial Geometric Partitioning Mode (SGPM), Extrapolation Based Intra Prediction (EIP), Intra Template Matching Prediction (IntraTMP), Intra Block Copy (IBC), Decoder Side Intra Mode Derivation (DIMD), Template-Based Intra Mode Derivation (TIMD), and Matrix-Based Intra Prediction (MIP). It should be understood that for the above prediction modes, the transform parameters are determined by determining the first and / or second predicted values ​​of the current block, which allows for greater flexibility and diversity in the transform parameters, thereby improving encoding and decoding performance.

[0122] The following explanation uses filtering as an example of sampling processing (upsampling processing).

[0123] In this embodiment, for some or all of the predicted values ​​in the first predicted value, the decoder determines the horizontal and vertical gradient statistics of the sampling points corresponding to some or all of the predicted values; based on the horizontal and vertical gradient statistics of the sampling points, it determines a first index set (set1) of the first predicted value. For some or all of the predicted values ​​in the second predicted value, the decoder determines the horizontal and vertical gradient statistics of the sampling points corresponding to some or all of the predicted values; based on the horizontal and vertical gradient statistics of the sampling points, it determines a second index set (set2) of the second predicted value.

[0124] It should be noted that the gradient statistics are the statistical values ​​of the gradient histogram.

[0125] For example, using MIP prediction values, different analysis methods are employed to map the MIP prediction values ​​to traditional intra-prediction modes by calculating the gradient information of the MIP mode prediction values. For instance, the traditional intra-prediction mode is derived from the gradient information, and the transform set and scan order used when performing LFNST are selected based on the derived intra-prediction mode.

[0126] In the embodiments of this application, the first prediction value is the prediction value before sampling, and the second prediction value is the prediction value after sampling.

[0127] The following explanation uses the MIP parameter as an example.

[0128] As shown in Figure 6, the specific prediction process of MIP technology includes S401 to S404:

[0129] S401, core parameter configuration;

[0130] S402, Obtain reference pixels;

[0131] S403, Construct input sampling;

[0132] S404, Generate predicted values.

[0133] For S401, in some embodiments, the MIP core parameters need to be configured before determining the MIP input sampling matrix. Here, the MIP technique divides the current block into three categories based on its width and height, with mipSizeId representing the type of the current block. For different types of current blocks, the number of reference samples (boundySize reference sampling points per side), the number of matrix multiplication input samples inSize, and the number of matrix multiplication output samples (arranged in predSize×predSize) are different.

[0134] Based on the value of mipSizeId, the number of adjacent boundary reference samples (variable is boundarySize) and the size of the MIP prediction block (variable is predSize, the size of the MIP prediction block is predSize × predSize) can be determined according to the look-up table (LUT) shown in Table 1. The number of input samples used in the MIP matrix multiplication process (variable is inSize) can also be calculated. The calculation formula is as follows: inSize=(2×boundarySize)-(mipSizeId==2)? 1:0 (1)

[0135] The operation rules of the operators in equation (1) are the same as those of the operators defined in the ITU-TH.265 standard. For example, “==” is the logical “equal to” operator.

[0136] Table 1

[0137] Thus, according to Table 1, when mipSizeId is 0, boundarySize can be 2 and predSize can be 4; that is, in this case, the reference pixel selects two pixels for each edge, and the matrix multiplication output is a 4×4 MIP prediction block. Alternatively, when mipSizeId is 1, boundarySize can be 4 and predSize can be 4; that is, in this case, the reference pixel selects four pixels for each edge, and the matrix multiplication output is a 4×4 MIP prediction block. Alternatively, when mipSizeId is 2, boundarySize can be 4 and predSize can be 8; that is, in this case, the reference pixel selects four pixels for each edge, and the matrix multiplication output is an 8×8 MIP prediction block.

[0138] Alternatively, the LUT shown in Table 2 can be used based on the value of mipSizeId to determine the values ​​of boundarySize, inSize, and predSize.

[0139] Table 2

[0140] Thus, according to Table 2, when mipSizeId is 0, boundarySize can be 2, inSize can be 4, and predSize can be 4; that is, in this case, the reference pixel selects two pixels for each edge, the number of input sampling points for matrix multiplication is four, and the output of matrix multiplication is a 4×4 MIP prediction block. Alternatively, when mipSizeId is 1, boundarySize can be 4, inSize can be 8, and predSize can be 4; that is, in this case, the reference pixel selects four pixels for each edge, the number of input sampling points for matrix multiplication is eight, and the output of matrix multiplication is a 4×4 MIP prediction block. Alternatively, when mipSizeId is 2, boundarySize can be 4, inSize can be 7, and predSize can be 8; that is, in this case, the reference pixel selects four pixels for each edge, the number of input sampling points for matrix multiplication is seven, and the output of matrix multiplication is an 8×8 MIP prediction block.

[0141] For S402, in some embodiments, when predicting the current block, the upper and left blocks of the current block have already been encoded; the reference pixels for the MIP technique can be the reconstructed values ​​of the reference pixels adjacent to the previous row of the current block and the reconstructed values ​​of the reference pixels adjacent to the left column of the current block. In this case, the reference pixels for the current block can be obtained by acquiring the reference pixels corresponding to the upper edge and the reference pixels corresponding to the left edge of the current block. Figure 7 shows a schematic diagram of the position of a reference pixel provided in an embodiment of this application. In Figure 7, the left adjacent region and the upper adjacent region are all valid regions; the reference pixel corresponding to the upper edge of the current block is a pixel filled with gray, which can be represented by refT; the reference pixel corresponding to the left edge of the current block is a pixel filled with diagonal lines, which can be represented by refL. Therefore, the reference pixels for the current block can include refT and refL, and the adjacent reference sampling set is obtained by filtering refT and refL. It should be noted that for invalid positions (such as image boundaries), the same method as obtaining reference pixels in traditional intra-frame prediction techniques can be used for filling.

[0142] For S403, in some embodiments, the matrix multiplication input sample p is used as the input to the matrix multiplication process, and the matrix multiplication output sample predMip is obtained by multiplying it with the corresponding matrix. As shown in Figure 8, the construction process of p mainly includes:

[0143] S4031. Obtain reference sample (downsampling);

[0144] S4032. Construct a reference sampling buffer;

[0145] S4033, Derive the input sampling for matrix multiplication.

[0146] In some embodiments, for S4031, since the width and height of the current block are greater than the number of input sampling points for matrix multiplication, and in order to use a smaller matrix, the MIP technique also needs to perform downsampling processing on the obtained reference pixels (including refT and refL) to obtain an adjacent reference sampling set. It should be noted that boundarySize reference samples need to be sampled on each reference edge (including the top and left edges) of the current block, and the value of boundarySize is related to the type mipSizeId of the current block.

[0147] Specifically, for a reference pixel refS, the number of reference pixels (i.e., the side length of the current block) is nTbS; the number of reference samples to be downsampled is boundarySize. The sampling rate of each reference edge can be represented by bDwn. Then, in the reference pixel refS, an averaging operation is performed on each bDwn reference pixel, and the average value is used as a sampling point in the reference sampling redS. redS can be calculated according to equation (2). Here, S can be replaced by W and H respectively, where W represents the top edge and H represents the left edge.

[0148] After the downsampling process of equation (2), two parts of reference samples can be obtained: the upper side reference sample redT obtained by downsampling the upper side reference pixel refT of the current block, and the left side reference sample redL obtained by downsampling the left side reference pixel refL of the current block; that is, the downsampled values ​​(a total of boundarySize) obtained after downsampling the upper side reference pixel refT are stored in the one-dimensional array redT, and the downsampled values ​​(a total of boundarySize) obtained after downsampling the left side reference pixel refL are stored in the one-dimensional array redL. As shown in Figure 9, taking the current block of 4×4 as an example, the redL obtained by downsampling the left side includes two reference pixels, namely reference pixel 1 and reference pixel 2; the redT obtained by downsampling the upper side includes two reference pixels, namely reference pixel 3 and reference pixel 4; thus, the adjacent reference sample set of the current block includes four reference pixels.

[0149] In some embodiments, for S4032, a buffer pTemp is constructed using reference samples redT and redL for the construction of subsequent matrix multiplication input samples p. The construction method of buffer pTemp depends on whether the sign bit isTransposed is needed.

[0150] Specifically, after determining the value of the transpose processing indicator flag (isTransposed), assuming the buffer can be represented by pTemp, when isTransposed is 0, all reference pixels redT corresponding to the top edge are stored in pTemp first, and then all reference pixels redL corresponding to the left edge are stored in the next position after all redT is stored; as shown in Figure 10A, taking the current block of 4×4 as an example, redL includes reference pixel 1 and reference pixel 2, and redT includes reference pixel 3 and reference pixel 4; thus, the buffering order in pTemp is reference pixel 3, reference pixel 4, reference pixel 1 and reference pixel 2; since all reference pixels corresponding to the top edge are stored before the reference pixels corresponding to the left edge, no transpose is needed at this time, and the resulting buffer is the input reference sample set.

[0151] When isTransposed is 1, all reference pixels redL corresponding to the left side are stored in pTemp first. Then, in the next position after all redL is stored, all reference pixels redT corresponding to the top side are stored. As shown in Figure 10B, taking the current 4×4 block as an example, redL includes reference pixel 1 and reference pixel 2, and redT includes reference pixel 3 and reference pixel 4. Thus, the cache order in pTemp is reference pixel 1, reference pixel 2, reference pixel 3, and reference pixel 4. Since all reference pixels corresponding to the top side are stored after the reference pixels corresponding to the left side, transposition is required. The transposed buffer is then used as the input reference sample set.

[0152] In some embodiments, for S4033, the matrix multiplication input sample (denoted by P) is the input used for the matrix multiplication process; by multiplying with the corresponding matrix, the matrix multiplication output sample (denoted by predMip) can be obtained. The matrix multiplication input sample P is determined by the buffer (denoted by pTemp), the type of the current block (denoted by mipSizeId), and the bit depth value (denoted by BitDepth) corresponding to the image component to be predicted. The number of input reference samples inSize contained in the matrix multiplication input sample P is only related to the type mipSizeId of the current block. Finally, the x-th input sample value in the input sampling matrix (denoted by P[x]) can be obtained.

[0153] Here, the specific construction process of the input sampling matrix P[x] is as follows.

[0154] When mipSizeId = 0 or 1, the sample value at the zeroth position in pTemp needs to be subtracted by 1 << (BitDepth - 1) to obtain the sample value at the zeroth position in the input sampling matrix, denoted by P[0]. Then, the sample value corresponding to each other position in the input sampling matrix needs to be obtained by subtracting the value at the zeroth position in pTemp from the sample value at the corresponding position, which can be denoted by P[x]. The specific details are as follows.

[0155] When mipSizeId = 2, the sample value corresponding to each other position in the input sampling matrix is ​​obtained by subtracting the sample value corresponding to the zeroth position in pTemp from the sample value of the next position in pTemp; specifically as shown below, p[x] = pTemp[x+1] - pTemp[0] for x = 0,...,inSize-1 (4)

[0156] Thus, taking the current 4×4 block as an example, the buffer pTemp stores four values, but the number of input samples is four. At this time, according to equation (3) or equation (4), the four input sample values ​​can be determined, denoted by p[x], x=0,1,2,3; thus, a 1×4 input sampling matrix is ​​obtained.

[0157] In some embodiments, for S403, firstly, the matrix mWeight, shift factor sW, and offset factor fO corresponding to the matrix are obtained according to the current prediction block's category mipSizeId and MIP prediction mode modeId. Next, the matrix multiplication input samples p, mWeight, sW, and fO are input into the matrix multiplication process to obtain the matrix multiplication output sample predMip. Finally, if the current prediction block's side length nTbS (note: S in nTbS can be replaced by W and H respectively) is greater than the side length predSize of predMip (predSize is only related to the current prediction block's category mipSizeId, as shown in Table 1), an upsampling operation is required to obtain the final prediction value predSamples of the current prediction block; otherwise, predMip is directly used as the final prediction value predSamples of the current prediction block. The generation process of intra-prediction blocks predSamples can be seen in Figure 11. Taking the current block of 4×4 as an example, since the current block and the MIP prediction block have the same size, no filtering is required. The MIP prediction block can be directly set as the intra-prediction block of the current block.

[0158] The following uses the MIP parameter as an example to illustrate the process of determining the first and second predicted values ​​in the aforementioned embodiments.

[0159] In some embodiments, the process of determining the first predicted value and the second predicted value includes S501 to S507:

[0160] S501, construct a matrix multiplication output sampling block by matrix multiplication.

[0161] In some embodiments, the implementation of constructing the matrix multiplication output sampling block by matrix multiplication in S501 includes S5011 to S5013:

[0162] S5011, Obtain the weight matrix.

[0163] In some embodiments, a weight matrix table is pre-established in the encoder or decoder and stored in the encoder or decoder. Thus, based on the current block type mipSizeId and the MIP prediction mode modeId, the weight matrix mWeight[x][y] required for the current block can be determined by looking up the table. The size of the weight matrix mWeight[x][y] depends only on the current block type mipSizeId, as shown in Table 3. In the weight matrix, the number of columns is the number of input samples inSize for matrix multiplication, and the number of rows is the number of output samples predSized × predSized for matrix multiplication.

[0164] Table 3

[0165] S5012, Obtain the shift factor and offset factor.

[0166] In some embodiments, a shift factor table is pre-established in the encoder or decoder, and this shift factor table is also stored in the encoder or decoder. In this application embodiment, the determination of the shift factor sW can include the following three methods:

[0167] In one implementation, as shown in Table 4, the shift factor sW required for matrix multiplication can also be determined by looking up the table based on the current block type mipSizeId and MIP prediction mode modeId.

[0168] Table 4

[0169] In another implementation, as shown in Table 5, the shift factor sW required for matrix multiplication can also be determined by looking up a table based solely on the type mipSizeId of the current block.

[0170] Table 5

[0171] In another implementation, sW can also be set to a fixed constant value. For example, sW can be set to 5 for different types of current blocks and different MIP prediction modes; or, sW can be set to 6 for different types of current blocks and different MIP prediction modes; or, sW can be set to 7 for different types of current blocks and different MIP prediction modes.

[0172] Furthermore, in one embodiment, an offset factor table is pre-established in the encoder or decoder, and this offset factor table is also stored in the encoder or decoder. In this embodiment, the determination of the offset factor fO can also include the following three methods:

[0173] In one implementation, as shown in Table 6, the shift factor fO required for matrix multiplication can also be determined by looking up the table based on the current block type mipSizeId and MIP prediction mode modeId.

[0174] Table 6

[0175] In another implementation, as shown in Table 7, the shift factor fO required for matrix multiplication can also be determined by looking up a table based solely on the type mipSizeId of the current block.

[0176] Table 7

[0177] In another implementation, fO can also be set to a fixed constant value, typically ranging from 0 to 100. For example, fO can be set to 32 for different types of current blocks and different MIP prediction modes; or fO can be set to 46 for different types of current blocks and different MIP prediction modes; or fO can be set to 56 for different types of current blocks and different MIP prediction modes; or fO can be set to 66 for different types of current blocks and different MIP prediction modes.

[0178] S5013, Perform matrix multiplication operations to solve for matrix multiplication and output sampling blocks.

[0179] In some embodiments, after obtaining the current block type mipSizeId and the MIP prediction mode modeId, the weight matrix mWeight[x][y], shift factor sW, and offset factor fO can be determined by looking up a table. This allows the calculation of the MIP prediction block predMip[x][y], and the sampling points in predMip[x][y] can be arranged in matrix form according to predSize × predSize. The first preset calculation model is as follows:

[0180] Among them, [x][y] represents the position coordinates of a pixel point, x represents the horizontal direction, and y represents the vertical direction; inSize represents the number of input samples, and predSize represents the side length of the MIP prediction block predMip. Here, predSize is only related to the current block type mipSizeId; when mipSizeId = 0 or 1, the output MIP prediction block is 4×4, then predSize is equal to 4; when mipSizeId = 2, the output MIP prediction block is 8×8, then predSize is equal to 8. Thus, according to the above formula (5), the temporary prediction value of at least one pixel in the MIP prediction block predMip can be calculated to obtain the MIP prediction block.

[0181] S502. Clamp the output samples of the matrix multiplication.

[0182] In some embodiments, after obtaining the temporary prediction value of at least one pixel in the MIP prediction block, the temporary prediction value of at least one pixel in the MIP prediction block can be clamped. Specifically, if the temporary prediction value of the sampling point in the MIP prediction block is less than 0, it can be set to 0; if the temporary prediction value of the sampling point in the MIP prediction block is greater than (1<<BitDepth)-1, it can be set to (1<<BitDepth)-1; thus, the prediction values of all sampling points in the MIP prediction block can be clamped between 0 and (1<<BitDepth)-1.

[0183] In this way, after the clamping process of the MIP prediction block, the prediction value of at least one pixel in the MIP prediction block can be obtained, and the range of the prediction value is between 0 and (1<<BitDepth)-1; then, according to the sign bit isTransposed of the transpose, it is determined whether transpose processing is required to determine the final MIP prediction block.

[0184] S503. Transpose the output samples of the matrix multiplication.

[0185] In some embodiments, according to the value of the transpose processing indication flag, it is determined whether to perform transpose processing on the MIP prediction block.

[0186] In other words, the transpose processing indicator flag is denoted by `isTransposed`, and the value of `isTransposed` can be used to determine whether the MIP prediction block needs transpose processing. Specifically, on the encoder side, if the first-generation value is less than the second-generation value, then `isTransposed` is set to 1, indicating that the MIP prediction block needs transpose processing; or, if the first-generation value is not less than the second-generation value, then `isTransposed` is set to 0, indicating that the MIP prediction block does not need transpose processing. On the decoder side, the value of the transpose processing indicator flag can be obtained by parsing the bitstream; if `isTransposed` is parsed to 1, then the MIP prediction block needs transpose processing; or, if `isTransposed` is parsed to 0, then the MIP prediction block does not need transpose processing.

[0187] More specifically, when isTransposed is 0, it indicates that the MIP prediction block does not require transposition, and the MIP prediction block can be obtained directly. When isTransposed is 0, it indicates that the MIP prediction block requires transposition, and the following formula can be used for transposition.

[0188] Thus, according to equation (6), after transposing the MIP prediction block, the transposed MIP prediction block can be obtained, and the transposed MIP prediction block can be set as the MIP prediction block. In this way, after obtaining the MIP prediction block, subsequent steps can be performed based on the parameters of the MIP prediction block and the current block, such as performing a first filtering process on the MIP prediction block, so as to finally determine the intra-frame prediction block of the current block.

[0189] S504. Derive the LFNST / NSPT transform set using the predicted values ​​before upsampling.

[0190] In some embodiments, when performing transform quantization on the residual of the current transform block, the prediction of the current transform block has already been completed. At this time, the predicted value can be directly obtained through the position and size of the MIP transform block. The predicted value of the MIP before upsampling (i.e., the first predicted value) is obtained, and the vertical and horizontal gradients of all or part of the predicted pixels are calculated using the Sobel operator. The direction with the largest gradient is mapped to a traditional intra-frame prediction mode, which is used as mode 1 to derive the transform set set1 of LFNST / NSPT (i.e., the first transform set).

[0191] In some embodiments, since the size of the predicted sampling block predMip may not be able to fill the current prediction block, the final predicted value of the MIP may require an upsampling operation. Whether upsampling is performed depends on whether the width and height of the predicted sampling block are the same as those of the current prediction block. The width and height of the predicted sampling block predMip are both predSize (predSize is only related to the class mipSizeId of the current prediction block, as shown in Table 1), the width of the current prediction block is nTbW, and the height of the current prediction block is nTbH.

[0192] In some embodiments, assuming the width and height of the MIP prediction block are both predSize, the width of the current block is nTbW, and the height of the current block is nTbH; then, based on the side length predSize of the MIP prediction block and the width nTbW of the current block, the horizontal upsampling factor (denoted by upHor) can be calculated; similarly, based on the side length predSize of the MIP prediction block and the height nTbH of the current block, the vertical upsampling factor (denoted by upVer) can be calculated; the specific calculation formulas are as follows.

[0193] At this point, the current block can be filled according to the horizontal upsampling factor upHor and the vertical upsampling factor upVer, that is, an upsampling operation is performed. The filling method for the corresponding position is as follows: predSamples[(x+1)×upHor-1][(y+1)×upVer-1]=predMip[x][y] (8)

[0194] Where x = 0, 1, ..., nTbW-1; y = 0, 1, ..., nTbH-1.

[0195] Whether sampling is required depends on whether the size of the MIP prediction block is the same as the size of the current block. In other words, the decision to perform sampling is based on whether the width and height of the MIP prediction block are the same as those of the current block. The horizontal upsampling factor upHor and the vertical upsampling factor upVer reflect whether the width and height of the MIP prediction block are the same as those of the current block. Therefore, it is possible to determine whether sampling is required, such as upsampling, based on the horizontal upsampling factor upHor and the vertical upsampling factor upVer.

[0196] S505, Generate the final predicted value of MIP.

[0197] In some embodiments, the implementation of generating the final predicted value of MIP in S505 includes S5051 and S5052:

[0198] S5051. Generate predicted values ​​that do not require upsampling.

[0199] In the embodiments of this application, the predicted value that does not require upsampling is the first predicted value.

[0200] In this embodiment, when both the horizontal upsampling factor upHor and the vertical upsampling factor upVer are equal to 1, the size of the MIP prediction block is the same as the size of the current block. Substituting upHor = 1 and upVer = 1 into equation (8), we can obtain predSamples[x][y] = predMip[x][y]. In this case, the MIP prediction block predMip[x][y] can be directly used as the intra-frame prediction block predSamples[x][y] of the current block. It should be noted that in the current MIP technology, only 4×4 blocks do not require sampling processing, such as upsampling processing.

[0201] S5052, Generate predicted values ​​that require upsampling.

[0202] In this embodiment of the application, the predicted value that needs to be upsampled is the second predicted value.

[0203] In this embodiment of the application, when both the horizontal upsampling factor upHor and the vertical upsampling factor upVer are greater than 1, the size of the MIP prediction block is different from the size of the current block. At this time, sampling processing is required to obtain the intra-prediction block of the current block.

[0204] Here, the upper side reference pixel refT is first filled into the corresponding position predSamples[x][-1] of the previous row of the current block, and then the left side reference pixel refL is filled into the corresponding position predSamples[-1][y] of the left column of the current block; where x = 0, 1, ..., nTbW-1; y = 0, 1, ..., nTbH-1. At this time, according to equation (8), the MIP prediction block predMip can be filled into the corresponding position ((x+1)×upHor-1, (y+1)×upVer-1) in the current block predSamples. This can be understood as dividing the current block into predSize×predSize sub-blocks and filling the lower right corner of each sub-block, as shown in Figure 12. Taking the current block of 32×32 as an example, the pixels filled by the cross lines are the upper side reference pixels refT, the pixels filled by the diagonal lines are the left side reference pixels refL, and the pixels filled by black are the positions filled by the predicted sampling pixels in the MIP prediction block.

[0205] If the horizontal upsampling factor upHor is greater than 1, then horizontal upsampling is performed first. Specifically, the first predicted value of the horizontal pixel position to be filled in the current block is determined according to the second preset calculation model. The second preset calculation model is shown below.

[0206] Among them, (xHor, yHor)=(m×upHor-1, n×upVer-1), m=0,1,…,predSize-1, n=1,2,…,predSize, dX=1,2,…,upHor-1.

[0207] The horizontal upsampling process is shown in Figure 13. Taking the current 32×32 block as an example, during horizontal upsampling, the reference pixel on the left side and the predicted sampling pixel corresponding to the horizontal position of the MIP prediction block will be used as the reference point for horizontal upsampling, and they will also be filled with black. In Figure 13, all black-filled pixels are reference points for horizontal upsampling. Among them, the predicted value of the gray-filled pixel is obtained by linear interpolation between every two black-filled pixels in the horizontal direction.

[0208] The upsampling method is a linear interpolation upsampling method. The value of each interpolation point (filled with gray pixels) between every two upsampling reference points (pixels filled with black) is obtained by the weighted average of the two upsampling reference points. According to equation (9), the weight of the left upsampling reference point is (upHor-dX) / upHor, and the weight of the right reference point is dX / upHor; where dX represents the distance between the current interpolation point and the left reference point, and dX=1,2,…,upHor-1. That is to say, in the horizontal upsampling process, the weights are all related to the horizontal upsampling factor upHor. As shown in Figure 14, an example of a weight value is given, in which upHor=4.

[0209] Furthermore, if the vertical upsampling factor upVer is greater than 1, vertical upsampling is required, similar to the horizontal upsampling process. Specifically, the first predicted value of the vertical pixel position to be filled in the current block is determined according to the third preset calculation model; the third preset calculation model is shown below.

[0210] Among them, (xVer, yVer)=(m, n×upVer-1), m=0,1,…,predSize-1, n=0,1,…,predSize-1, dY=1,2,…,upVer-1.

[0211] The vertical upsampling process is shown in Figure 15. Taking the current 32×32 block as an example, after completing the horizontal upsampling as shown in Figure 13, the upper side reference pixel and all the filled pixels in the current block will be used as reference points for vertical upsampling, and they will still be filled with black. In Figure 15, all black-filled pixels are reference points for vertical upsampling. The predicted value of the gray-filled pixel is obtained by linear interpolation between every two black-filled pixels in the vertical direction.

[0212] The upsampling method is a linear interpolation upsampling method. The value of each interpolation point (filled with gray) between every two upsampling reference points (pixels filled with black) is obtained by the weighted average of the two upsampling reference points. According to equation (10), the weight of the upper upsampling reference point is (upVer-dY) / upVer, and the weight of the lower reference point is dY / upVer; where dY represents the distance between the current interpolation point and the upper reference point, and dY=1,2,…,upVer-1. That is to say, in the vertical upsampling process, the weights are all related to the vertical upsampling factor upVer.

[0213] S506. Derive the LFNST / NSPT transform set using the upsampled predicted values.

[0214] In some embodiments, when performing transform quantization on the residual of the current transform block, the prediction of the current transform block has already been completed. At this time, the predicted value can be directly obtained through the position and size of the MIP transform block. The predicted value after MIP upsampling (i.e., the second predicted value) is obtained, and the vertical and horizontal gradients of all or part of the predicted pixels are calculated using the Sobel operator. The direction with the largest gradient is mapped to a traditional intra-frame prediction mode, which is used as mode 2 to derive the transform set set2 (i.e., the second transform set) of LFNST / NSPT.

[0215] S507. Decision on which predicted value to use to derive the transformation set.

[0216] In some embodiments, a flag (equivalent to the first syntax element information nUseDefaultSample in the aforementioned embodiments) is used to identify whether the predicted value before or after upsampling is used. A specific embodiment for determining the first syntax element information is as follows: the first syntax element information is a syntax element of the CU layer. When the encoder finds that set1 and set2 are the same, or when cost comparison reveals that using set1 has a lower cost, residual precoding is performed, and element values ​​corresponding to the meaning of set1 (first transform set) are written into the bitstream; otherwise, element values ​​corresponding to the meaning of set2 (second transform set) are written.

[0217] In some embodiments, based on conditional judgment, if a syntax element indicating the selection of the transform set exists, the corresponding bits are read and entropy decoded to obtain the corresponding syntax element. Then, based on this syntax element (i.e., the bitstream identifier, named nUseDefaultSample, representing whether the default derivation transform method is not used, or considered as representing an index number), the predicted values ​​before and after upsampling, isUpSampleFlag, are determined. This value is used to determine whether to derive the transform set using the upsampled predicted values. It can be considered that a value of 0 for nUseDefaultSample corresponds to using the predicted value before upsampling, while a value of 1 corresponds to using the predicted value after upsampling.

[0218] In some embodiments of this application, the method of determining the transformation parameters based on the first syntax element information, specifically in S3022, involves using a first predicted value or a second predicted value to determine the transformation parameters according to the first syntax element information. This can be categorized into the following three cases:

[0219] Case 1: The first syntax element information is used to indicate the predicted value type corresponding to the current block.

[0220] In some embodiments of this application, when the first syntax element information is used to indicate the predicted value type corresponding to the current block, the implementation of S3022 may include: determining the transformation parameters by using a first predicted value or a second predicted value according to the predicted value type indicated by the first syntax element information.

[0221] Understandably, selecting an appropriate predictor value based on the predictor value type indicated by the first syntax element information can improve the accuracy of the transform parameters. Different types of predictor values ​​may correspond to different image or video features; correctly selecting the predictor value type can more accurately capture these features, thereby improving decoding accuracy. On the one hand, the first syntax element information usually indicates that the predictor value type is associated with the characteristics of the image or video data. Therefore, selecting predictor values ​​based on this information can enhance the decoder's adaptability to different scenarios, thereby improving decoding quality and performance.

[0222] In embodiments of this application, the predicted value type includes a first type and a second type. The first type represents a first predicted value without sampling processing, such as a predicted value before upsampling. The second type represents a second predicted value without sampling processing, such as a predicted value after upsampling.

[0223] For example, when the value of the first syntax element information is 0, it means that the transformation parameters of the current block are determined using the first prediction value of the first type of the current block. When the value of the first syntax element information is 1, it means that the transformation parameters of the current block are determined using the second prediction value of the second type of the current block.

[0224] In some embodiments of this application, the transformation parameters include a first transformation set or a second transformation set; determining the transformation parameters by using the first predicted value or the second predicted value according to the predicted value type indicated by the first syntax element information includes:

[0225] If the first syntax element information indicates that the predicted value type is a first type, then the first transformation set of the current block is determined based on the gradient statistics corresponding to some or all of the predicted values ​​in the first predicted value; or,

[0226] If the first syntax element information indicates that the predicted value type is the second type, the second transformation set of the current block is determined based on the gradient statistics corresponding to some or all of the predicted values ​​in the second predicted value.

[0227] In this embodiment, the first transform set can be the LFNST / NSPT transform set derived from the predicted values ​​before upsampling in the aforementioned embodiments, and the second transform set can be the LFNST / NSPT transform set derived from the predicted values ​​after upsampling in the aforementioned embodiments. For example, the first transform set can be represented as Set1, and the second transform set can be represented as Set2.

[0228] It should be noted that the process of determining the first transformation set and the second transformation set can be referred to the description of S501 to S507 in the foregoing embodiments.

[0229] For example, if the value of the first syntax element information is the third value, then the predicted value type of the current block is determined to be the first type; if the value of the first syntax element information is the fourth value, then the predicted value type of the current block is determined to be the second type.

[0230] It should be noted that in the embodiments of this application, the third value and the fourth value are different, and the third value and the fourth value can be in parameter form or in numeric form. Specifically, the relevant syntax element information can be a parameter written in the profile or a value of a flag, which is not specifically limited here.

[0231] For example, for the third and fourth values, the third value can be set to 1 and the fourth value can be set to 0; or, the third value can be set to 0 and the fourth value can be set to 1; or, the third value can be set to true and the fourth value can be set to false; or, the third value can be set to false and the fourth value can be set to true; the third value can be set to true and the fourth value can be set to false, but no specific limitation is made here.

[0232] In this embodiment of the application, taking the flag written in the code stream as an example, assuming that the third value is set to 1 (true) and the fourth value is set to 0 (false), if the value of the first syntax element information is 1 (true), then it can be determined that the predicted value type of the current block is the second type; if the value of the first syntax identifier information is 0 (false), then it can be determined that the predicted value type of the current block is the first type.

[0233] Case 2: The first syntax element information is used to indicate the first type of the current block.

[0234] In some embodiments of this application, where the first syntax element information is used to indicate the first type of the current block, the implementation of S3022 may include:

[0235] Determine the preset flag bit based on the first type indicated by the first syntax element information and the intra-frame prediction mode parameters;

[0236] Based on the preset flag, the transformation parameters are determined using either the first or second predicted value.

[0237] In this embodiment, the preset flag is a flag specified by the encoding / decoding end and does not need to be written into the bitstream or the decoding bitstream.

[0238] In this embodiment, the preset flag can be represented as isUpSampleFlag.

[0239] In this embodiment of the application, the first syntax element information is used to indicate the first type (before sampling) of the current block, for example, the value of the first syntax element information is 0.

[0240] In the embodiments of this application, the first type represents the first predicted value before sampling.

[0241] Furthermore, in the case of the first predicted value before the first type of characterization sampling, the implementation of determining the preset flag bit according to the intra-frame prediction mode parameters has the following implementation methods (1)-(3):

[0242] (1) Intra-frame prediction mode parameters include: shape parameters.

[0243] If the shape parameters indicate that the current block is a square block, the value of the preset flag is set to the value of the first type indicated by the first syntax element information, and the preset flag indicates that the transformation parameters are determined using the first predicted value; or...

[0244] When the shape parameter indicates that the current block is a non-square block, the value of the preset flag is set to the logical NOT value of the first type of the first syntax element information, and the preset flag indicates that the transformation parameters are determined by the second prediction value.

[0245] Understandably, by setting the preset flag value based on the shape parameter indicating whether the current block is square or non-square, shape information can be fully utilized. This processing method allows for the use of different prediction values ​​and transform parameters for blocks of different shapes, improving the decoder's ability to process blocks of different shapes and its decoding performance. Setting the preset flag value based on the shape parameter and selecting an appropriate prediction value can improve decoding accuracy. For square blocks, using the first prediction value may be more suitable, while for non-square blocks, using the second prediction value may be more suitable, thus reducing errors and distortion and improving decoding quality. Adjusting the preset flag and prediction value according to the shape parameter indication can enhance the decoder's adaptability. Using different processing methods for blocks of different shapes can better adapt to different types or characteristics of image or video data, improving the decoder's flexibility and adaptability.

[0246] (2) Intra-frame prediction mode parameters include: size parameters.

[0247] If the size range of the current block indicated by the size parameters does not belong to the preset size range, the value of the preset flag is set to the value of the first type indicated by the first syntax element information. The preset flag indicates that the transformation parameters are determined using the first predicted value; or...

[0248] If the size range of the current block indicated by the size parameter is within the preset size range, the value of the preset flag is set to the logical NOT value of the first type of the first syntax element information, and the preset flag indicates that the transformation parameters are determined by the second prediction value.

[0249] Understandably, on the one hand, by determining whether the current block's size range falls within a preset size range based on size parameters, and adjusting the preset flag value and selecting the prediction value, dynamic adaptability can be achieved. Using different prediction values ​​and transform parameters for blocks of different size ranges can better adapt to image blocks of different sizes, improving decoding performance. On the other hand, setting the preset flag value and selecting an appropriate prediction value based on the size parameter indication can improve decoding accuracy. Using different processing methods for blocks of different sizes can more accurately capture features in image or video data, improving decoding quality. Furthermore, dynamically adjusting the preset flag value and selecting the prediction value to determine transform parameters can enhance the decoder's adaptability. Using different processing methods for blocks of different size ranges can better adapt to different types or features of image or video data, improving the decoder's flexibility and adaptability.

[0250] (3) Intra-frame prediction mode parameters include: shape parameters and size parameters.

[0251] If the shape parameter indicates that the current block is a square block, and the size parameter indicates that the size range of the current block does not fall within the preset size range, the value of the preset flag is set to the value of the first type indicated by the first syntax element information. The preset flag indicates that the transformation parameters are determined using the first predicted value; or...

[0252] If the shape parameter indicates that the current block is a non-square block and the size parameter indicates that the size range of the current block is within the preset size range, the value of the preset flag is set to the logical NOT value of the first type indicated by the first syntax element information, and the preset flag indicates that the transformation parameters are determined by the second prediction value.

[0253] In this embodiment, setting the value of the preset flag to the value of the first type indicated by the first syntax element information can be represented as isUpSampleFlag = nUseDefaultSample. Setting the value of the preset flag to the logical NOT value of the first type indicated by the first syntax element information can be represented as: isUpSampleFlag = ! nUseDefaultSample.

[0254] In some embodiments of this application, determining the transformation parameters based on a preset flag bit and using a first predicted value or a second predicted value may include:

[0255] When a preset flag indicates that the transformation parameters are determined using the first predicted value, the first transformation set of the current block is determined based on the gradient statistics corresponding to some or all of the predicted values ​​in the first predicted value; or,

[0256] When the preset flag indicates that the transformation parameters are determined using the second predicted value, the second transformation set of the current block is determined based on the gradient statistics corresponding to some or all of the predicted values ​​in the second predicted value.

[0257] Case 3: The first syntax element information is used to indicate the index identifier of the transformation parameter corresponding to the current block.

[0258] In some embodiments of this application, the decoding method further includes:

[0259] Based on the first predicted value and / or the second predicted value, determine the candidate transformation set corresponding to the current block;

[0260] Transformation parameters are determined in the candidate transform set based on the index identifier indicated by the first syntax element information.

[0261] Understandably, on the one hand, by using predicted values ​​to determine the candidate transform set, the features and transform requirements of the current block can be predicted more accurately. Selecting appropriate transform parameters from the candidate transform set based on the index identifier indicated by the first syntax element information can improve the accuracy of the transform parameters, thereby improving the precision and quality of decoding. On the other hand, using candidate transform sets and index identifiers can enhance the flexibility of the decoder. Different candidate transform sets may contain different transform parameter options; selecting appropriate transform parameters based on the index identifier indicated by the first syntax element information allows the decoder to adapt to different types or features of image or video data, improving the decoder's adaptability and flexibility. Selecting appropriate transform parameters can optimize resource utilization during the decoding process. The use of candidate transform sets and index identifiers helps the decoder effectively select the optimal transform parameters, reducing unnecessary computation and resource consumption, and improving decoding efficiency.

[0262] In the embodiments of this application, the index identifier can be represented as 0, 1, 3, ... For example, assuming that the candidate transform set includes two transform sets: the first transform set (Set1) and the second transform set (Set2), then an index identifier of 0 indicates that the transform parameters are from the first transform set, and an index identifier of 1 indicates that the transform parameters are from the second transform set.

[0263] In some embodiments of this application, a candidate transformation set corresponding to the current block is determined based on a first predicted value and / or a second predicted value, including at least one of the following:

[0264] Based on the gradient statistics corresponding to the first or second predicted value, a first type of transformation set is determined; the first type of transformation set includes: a first transformation set and a second transformation set;

[0265] Based on the highest N gradient statistics corresponding to the first or second predicted value, a second type of transformation set is determined; the second type of transformation set includes: N-1 third transformation sets and / or N-1 fourth transformation sets; the N-1 third transformation sets are the transformation sets corresponding to gradient statistics other than the highest gradient statistics corresponding to the first predicted value; the N-1 fourth transformation sets are the transformation sets corresponding to gradient statistics other than the highest gradient statistics corresponding to the second predicted value; N is a positive integer greater than 1;

[0266] The third type of transform set is determined based on the gradient statistics of the reconstructed neighboring pixels of the current block;

[0267] Based on the preset prediction mode corresponding to the current block, determine the fourth type of transformation set; among which, the preset prediction mode includes: Planar mode;

[0268] The candidate transform set includes at least one of the second, third, and fourth transform sets, as well as the first transform set.

[0269] In the embodiments of this application, the first type of transform set includes: a first transform set (Set1) and a second transform set (Set2), the second type of transform set includes: N-1 third transform sets (Set3) and / or N-1 fourth transform sets (Set4), the third type of transform set includes at least one fifth transform set (Set5), and the fourth type of transform set includes at least one sixth transform set (Set6).

[0270] It should be noted that when N is 2, the second type of transformation set includes one third transformation set (Set3) and / or one fourth transformation set (Set4). In this case, the third transformation set is the transformation set corresponding to the second highest gradient statistical value corresponding to the first predicted value, and the fourth transformation set is the transformation set corresponding to the second highest gradient statistical value corresponding to the second predicted value.

[0271] In this embodiment, the reconstructed neighboring pixels of the current block are the reconstructed pixels of the upper region, and / or the left region, and / or the upper-left region of the current block. Based on the horizontal and vertical gradient statistics corresponding to the reconstructed neighboring pixels of the current block, a third type of transform set (or, if there is only one, the fifth transform set) is determined.

[0272] In this application embodiment, the preset prediction mode may also include other prediction modes, such as: planar mode, DC mode and intra-frame angle prediction mode, and this application embodiment does not limit them in any way.

[0273] In some embodiments of this application, the decoding method further includes:

[0274] Determine the preset traversal order;

[0275] According to the preset traversal order, at least one type of transformation set in the first type of transformation set, the second type of transformation set, the third type of transformation set, and the fourth type of transformation set is traversed in turn until a preset number of different transformation sets are found, and candidate transformation sets are obtained; wherein, the preset number is at least two.

[0276] Understandably, on the one hand, by presetting the traversal order and requiring the discovery of a predetermined number of different transform sets, the diversity of candidate transform sets can be enhanced. Different categories of transform sets may contain different types of transform parameters. Traversing multiple categories of transform sets allows for a more diverse selection of transform parameters, thereby improving the decoder's adaptability to different scenarios and decoding performance. On the other hand, presetting the traversal order ensures that the decoder comprehensively explores different types of transform sets. This avoids being limited to a single type of transform set and ignoring other potentially more suitable transform parameter options, thus improving the decoder's coverage of the transform parameter space and facilitating the discovery of better transform parameter combinations. Furthermore, presetting the traversal order helps optimize resource utilization during the decoding process. Traversing different categories of transform sets sequentially according to the preset order effectively controls the decoder's search range for transform parameters, reducing unnecessary computation and resource consumption, thereby improving decoding efficiency.

[0277] In this embodiment, the transform sets are classified according to their source. The transform sets in the candidate transform set can be divided into four categories: a first type of transform set, a second type of transform set, a third type of transform set, and a fourth type of transform set. Specifically, the first type of transform set is determined based on a first predicted value and a second predicted value; the second type of transform set is determined based on N gradient statistics corresponding to the first predicted value and / or the second predicted value; the third type of transform set is determined based on the reconstructed neighboring pixels of the current block; and the fourth type of transform set is determined by a preset prediction mode.

[0278] In this embodiment, the preset traversal order can be predefined by both the encoder and decoder, or the encoder can write the preset traversal order into the bitstream after making an encoding decision, and the decoder can determine the preset traversal order by decoding the bitstream. This embodiment does not limit the method of determining the preset traversal order.

[0279] In some embodiments of this application, when the candidate transform set includes at least two different transform sets, if the first transform set in the preset traversal order is the first transform set, then the second transform set in the preset traversal order is the third transform set; or,

[0280] If the first transformation set in the preset traversal order is the second transformation set, then the second transformation set in the preset traversal order is the fourth transformation set; or,

[0281] If the first transformation set in the preset traversal order is a first-type transformation set, then the second transformation set in the preset traversal order is any transformation set in the second-type transformation set that is different from the first transformation set.

[0282] In the embodiments of this application, at least two different transformation sets are a first type of transformation set and a second type of transformation set.

[0283] For example, if the first transformation set in the preset traversal order is the second transformation set (Set2), then the second transformation set is the fourth transformation set (Set4). In this case, the candidate transformation sets include Set2 and Set4. If the first transformation set in the preset traversal order is the first transformation set (Set1), then the second transformation set is the third transformation set (Set3). In this case, the candidate transformation sets include Set1 and Set3. Regardless of whether the first transformation set in the preset traversal order is Set1 or Set2, the second transformation set is either Set3 or Set4, which is different from the first transformation set.

[0284] In some embodiments of this application, the second type of transformation set in the preset traversal order includes: a third transformation set and / or a fourth transformation set.

[0285] In the embodiments of this application, the second type of transform set includes at least one transform set, such as a third transform set, a fourth transform set, or both a third transform set and a fourth transform set. That is, Set3 and Set4 can be selected or both can be used.

[0286] In this embodiment of the application, the preset traversal order includes any of the following:

[0287] In the case of first-type, second-type, third-type, and fourth-type transformation sets, the preset traversal order can be set1 / set2—set2 / set1—set3 / set4—set5—set6; specifically, it can include: set1—set2—set3—set4—set5—set6, or set2—set1—set3—set4—set5—set6, or set1—set2—set3—set5—set6, set1—set2—set4—set5—set6, or set2—set1—set3—set5—set6, or set2—set1—set4—set5—set6.

[0288] The first type of transformation set, the third type of transformation set, the second type of transformation set, and the fourth type of transformation set; in this case, the preset traversal order can be set1 / set2—set2 / set1—set5—set3 / set4—set6.

[0289] The first type of transformation set, the second type of transformation set, the third type of transformation set, and the fourth type of transformation set; in this case, the preset traversal order can be set1 / set2—set3 / set4—set2 / set1—set5—set6.

[0290] The first type of transformation set, the third type of transformation set, the first type of transformation set, the second type of transformation set, and the fourth type of transformation set; in this case, the preset traversal order can be set1 / set2—set5—set2 / set1—set3 / set4—set6.

[0291] The first type of transformation set, the fourth type of transformation set, the third type of transformation set, and the second type of transformation set; in this case, the preset traversal order can be set1 / set2—set2 / set1—set6—set5—set3 / set4.

[0292] The first type of transformation set, the fourth type of transformation set, the second type of transformation set, and the third type of transformation set; in this case, the preset traversal order can be set1 / set2—set2 / set1—set6—set3 / set4—set5.

[0293] The fourth type of transformation set, the first type of transformation set, the second type of transformation set, and the third type of transformation set; in this case, the preset traversal order can be set6—set1 / set2—set2 / set1—set3 / set4—set5.

[0294] The fourth type of transformation set, the first type of transformation set, the third type of transformation set, and the second type of transformation set; in this case, the preset traversal order can be set6—set1 / set2—set2 / set1—set5—set3 / set4.

[0295] The fourth type of transformation set, the first type of transformation set, the second type of transformation set, the first type of transformation set, and the third type of transformation set; in this case, the preset traversal order can be set6—set1 / set2—set3 / set4—set2 / set1—set5.

[0296] The fourth type of transformation set, the first type of transformation set, the third type of transformation set, the first type of transformation set, and the second type of transformation set; in this case, the preset traversal order can be set6—set1 / set2—set5—set2 / set1—set3 / set4.

[0297] It should be noted that the above is merely a simple list, and the embodiments of this application do not limit the traversal order of the first type of transform set, the third type of transform set, the second type of transform set, and the fourth type of transform set, nor the traversal order of multiple transform sets of each type of transform set. That is, the traversal order of multiple transform sets in the candidate transform set can be freely combined, and the embodiments of this application do not limit the preset traversal order.

[0298] In some embodiments of this application, the implementation of determining the preset traversal order may include:

[0299] Decode the bitstream to determine the information of the second syntax element;

[0300] The preset traversal order is determined based on the value of the second syntax element information.

[0301] For example, if the value of the second syntax element information is 0, it means that the preset traversal order is the first type of transformation set, the third type of transformation set, the second type of transformation set, and the fourth type of transformation set. If the value of the second syntax element information is 1, it means that the preset traversal order is the first type of transformation set, the second type of transformation set, the first type of transformation set, the third type of transformation set, and the fourth type of transformation set.

[0302] In some embodiments of this application, the candidate transform set includes at least: a first type of transform set, a second type of transform set, and a third type of transform set; the method further includes:

[0303] If the difference between the highest and second-highest gradient statistics corresponding to the first predicted value is less than a preset threshold, and / or, the difference between the highest and second-highest gradient statistics corresponding to the second predicted value is less than a preset threshold, the second type of transformation set in the preset traversal order takes precedence over the third type of transformation set; or...

[0304] If the difference between the highest and second-highest gradient statistics corresponding to the first predicted value is greater than or equal to a preset threshold, and / or the difference between the highest and second-highest gradient statistics corresponding to the second predicted value is greater than or equal to a preset threshold, the third type of transformation set in the preset traversal order takes precedence over the second type of transformation set; or...

[0305] In the preset traversal order, the first type of transformation set takes precedence over the second and third type of transformation sets.

[0306] For example, with a preset threshold of 5, if the difference between the highest and second-highest gradient statistics corresponding to the first predicted value is less than 5, the preset traversal order can be: set1—set2—set3 / set4—set5—set6. If the difference between the highest and second-highest gradient statistics corresponding to the second predicted value is less than 5, the preset traversal order can be: set2—set1—set3 / set4—set5—set6. If the difference between the highest and second-highest gradient statistics corresponding to the first predicted value is greater than or equal to 5, the preset traversal order can be: set1—set2—set5—set3 / set4—set6. If the difference between the highest and second-highest gradient statistics corresponding to the second predicted value is greater than or equal to 5, the preset traversal order can be: set2—set1—set5—set3 / set4—set6.

[0307] In some embodiments of this application, the decoding method further includes:

[0308] The first syntax element information is decoded using either equal probability decoding or unequal probability decoding.

[0309] In some embodiments of this application, the unequal probability decoding method has a higher priority than the equal probability decoding method.

[0310] In some embodiments of this application, the decoding method further includes:

[0311] Decode the bitstream to determine the third syntax element information;

[0312] If the third syntax element information indicates that the current block uses transform set derivation, the steps of decoding the bitstream and determining the intra-prediction mode parameters and the first syntax element information of the current block are performed; or...

[0313] If the third syntax element information indicates that the current block does not use transform set derivation, the steps of determining the intra-prediction mode parameters of the current block and the first syntax element information of the current block are not performed.

[0314] In some embodiments of this application, the decoding method further includes:

[0315] If the value of the third syntax element is the first value, then the current block is determined to use transform set derivation; or,

[0316] If the value of the third syntax element is the second value, then it is determined that the current block does not use transform set derivation.

[0317] It should be noted that, in the embodiments of this application, the first value and the second value are different, and the first value and the second value can be in parameter form or in numeric form. Specifically, the relevant syntax element information can be a parameter written in the profile or a value of a flag, which is not specifically limited here.

[0318] For example, for the first value and the second value, the first value can be set to 1 and the second value can be set to 0; or, the first value can be set to 0 and the second value can be set to 1; or, the first value can be set to true and the second value can be set to false; or, the first value can be set to false and the second value can be set to true; the first value can be set to true and the second value can be set to false, but no specific limitation is made here.

[0319] In this embodiment of the application, taking the flag written in the code stream as an example, assuming that the first value is set to 1 (true) and the second value is set to 0 (false), if the value of the first syntax element information is 1 (true), then it can be determined that the current block uses transform set derivation; if the value of the first syntax identifier information is 0 (false), then it can be determined that the current block does not use transform set derivation.

[0320] In some embodiments of this application, the third syntax element information is carried in any one of the Sequence Parameter Set (SPS), Picture Parameter Set (PPS), Adaptive Parameter Set (APS), Picture Header (PH), and Slice Header (SH).

[0321] In some embodiments of this application, before determining the candidate transform set corresponding to the current block based on the first predicted value or the second predicted value, the decoding method further includes:

[0322] If the prediction mode of the current block belongs to the preset prediction mode, then, given the first prediction value of the current block, the first prediction value is sampled to obtain the second prediction value.

[0323] In some embodiments of this application, the preset prediction mode includes one or more of the following: Spatial Geometric Partitioning Mode (SGPM), Extrapolation Based Intra Prediction (EIP), Intra Template Matching Prediction (IntraTMP), Intra Block Copy (IBC), Decoder Side Intra Mode Derivation (DIMD), Template-Based Intra Mode Derivation (TIMD), and Matrix-Based Intra Prediction (MIP).

[0324] In some embodiments of this application, the decoding method further includes:

[0325] Based on the transformation parameters, the transformation coefficients of the current block are transformed to determine the target residual value of the current block;

[0326] The reconstruction value of the current block is determined based on the target residual value and the first predicted value of the current block.

[0327] In this embodiment of the application, the transformation coefficients include: quantization coefficients.

[0328] In this embodiment, the decoder dequantizes the quantization coefficients to obtain first transform coefficients; the first transform coefficients are transformed to obtain a first transform coefficient vector; the first transform coefficient vector is transformed using the transform matrix indicated by the transform kernel index parameter to obtain a second transform coefficient vector; the second transform coefficient vector is transformed using the scan order parameter of the transform parameters to obtain the second transform coefficients.

[0329] The second transform coefficients are inversely transformed to obtain the residual value of the current block. After obtaining the residual value and the first predicted value, the decoder can determine the reconstructed value of the current block based on the residual value and the first predicted value.

[0330] For example, after determining the LFNST transform kernel, the transformation matrix selected for the current block can be obtained, and then the prediction difference can be transformed.

[0331] Each set of transform matrices can also contain two sizes of base transform matrices T, such as 16x16 and 16x48. Specifically, for the transform matrices selected for the four TU sizes, a 4x4 TU will use an 8x16 transform matrix derived from the first 8x16 of the 16x16 base transform matrix; a 4xN or Nx4 (N>4) TU will use a 16x16 base transform matrix; an 8x8 TU will use an 8x48 transform matrix derived from the first 8x48 of the 16x48 base transform matrix; and a TU larger than 8x8 will use a 16x48 base transform matrix. It's important to note that currently, H.266 / VVC only stores the transform matrix of the decoder-side LFNST (which can be represented by T). T The transformation matrix used on the encoder side is the transpose of the transformation matrix of LFNST (which can be represented by T).

[0332] It should also be noted that LFNST applies the non-separable transform based on the direct matrix multiplication method. In order to minimize the computational complexity and storage space as much as possible, a simplified non-separable transform technology is used in the LFNST transform. Among them, the main idea of the simplified non-separable transform technology is to map an N-dimensional vector to an R-dimensional vector in different spaces. Here, N / R (R < N) is the scaling factor; at this time, the transform matrix corresponding to the simplified non-separable transform technology is an R×N matrix, as shown below,

[0333] Here, the transform matrices used for the forward LFNST transform and the reverse LFNST transform are transpose relations with each other. As shown in Figure 3, in the calculation process of the forward LFNST transform, after the first-level transform coefficients pass through the transform matrix T, the second-level transform coefficients can be obtained; in the calculation process of the reverse LFNST transform, after the inverse second-level transform coefficients pass through the transpose transform matrix T T After that, the inverse first-level transform coefficients can be obtained. It should be noted that the process for NSPT is similar. As shown in Figure 4, for an 8×8 transform block, the forward NSPT transform is a 64-->32 transform, and for the reverse NSPT transform is a 32-->64 transform; for a 4×4 transform block, both the forward NSPT transform and the reverse NSPT transform are 16-->16 transforms.

[0334] Furthermore, in the LFNST technology, it is possible to decide whether to use a 4×4 non-separable transform or an 8×8 non-separable transform according to the size of the current block; here, the "4×4 non-separable transform" can be collectively referred to as "4×4 LFNST", and the "8×8 non-separable transform" can be collectively referred to as "8×8 LFNST". Among them, assuming that the width of the current block is nTbW and the height is nTbH, then it can be obtained that: if min(nTbW, nTbH) <= 4, then the 4×4 LFNST can be used for the current block; otherwise, the 8×8 LFNST can be used for the current block. It should be noted that the return value of min(A, B) is the smaller value of A and B.

[0335] In one implementation, for 4×4 LFNST, on the encoder side, 16 coefficients will be input, and after the forward LFNST, 16 or 8 coefficients will be output; while on the decoder side, 16 or 8 coefficients will be input, and 16 coefficients will be output; that is to say, the number of inputs and outputs of the encoder and the decoder is exactly opposite.

[0336] Assume that the size of the transform unit (TU) can be expressed as nTbW×nTbH, where the transform unit is a prediction residual block obtained based on the prediction difference. That is, TU can be equal to 4×4, or equal to 4×N or N×4 (N > 4). The following will describe them in detail respectively.

[0337] When TU equals 4×4, for a 4×4 transform block, the transform matrix size used in the forward LFNST is 8×16. All 4×4 first-order transform coefficients in the current transform block are used as inputs, and the output is 4×2 second-order transform coefficients.

[0338] When TU equals 4×N or N×4 (N>4), for a 4×N or N×4 transform block, the transform matrix size used during forward LFNST is 16×16. The first transform coefficients within the first 4×4 sub-block of the current transform block (specifically, the topmost sub-block for a 4×N transform block, and the leftmost sub-block for an N×4 transform block) are used as input, and the output is 4×4 second-order transform coefficients. Here, at the "0" example position, the encoder still sets the transform coefficients to 0.

[0339] In another implementation, for an 8×8 LFNST, 48 coefficients will be input on the encoder side, and after passing through the forward LFNST, 16 or 8 coefficients will be output; while on the decoder side, 16 or 8 coefficients will be input, and 48 coefficients will be output; that is, the encoder and decoder have exactly opposite numbers of input and output.

[0340] When TU equals 8×8, for an 8×8 transform block, during forward LFNST, the transform matrix size used is 8×48. The first transform coefficients of the first three 4×4 sub-blocks (i.e., the three sub-blocks located in the upper left corner) within the current transform block are used as input, and the output is 4×2 second transform coefficients. Here, at the "0" example position, the encoder still sets the transform coefficients to 0.

[0341] When TU is greater than 8×8, for transform blocks larger than 8×8, the transform matrix size used during forward LFNST is 48×16. The first transform coefficients of the first three 4×4 sub-blocks (i.e., the three sub-blocks located in the upper left corner) within the current transform block are used as input, and the output is 4×4 second transform coefficients. Here, at the "0" example position, the encoder still sets the transform coefficients to 0.

[0342] Secondly, embodiments of this application provide an encoding method. The main idea of ​​this encoding method is as follows: determine the intra-prediction mode parameters of the current block; use the intra-prediction mode parameters to determine candidate transform parameters of the current block; perform encoding decisions on the residual values ​​of the current block corresponding to the candidate transform parameters to determine the transform parameters of the current block; determine first syntax element information based on the transform parameters of the current block, and encode the first syntax element information, writing the obtained encoded bits into the bitstream; wherein, the first syntax element information is used to indicate the method of determining the transform parameters. The first syntax element information indicates the method of determining the transform parameters, which means that the encoder can more accurately select transform parameters suitable for the features of the current block. The use of the first syntax element information makes the selection of transform sets more flexible. By improving the accuracy and flexibility of transform parameters, the overall encoding performance can be improved. Accurate selection of transform parameters can reduce errors and distortions in the encoding process, while flexible selection of transform parameters can better adapt to different types of image or video content, thereby improving the efficiency and quality of encoding.

[0343] In one embodiment of this application, FIG16 is a schematic flowchart of an encoding method provided in an embodiment of this application. As shown in FIG16, the method may include S601 to S604:

[0344] S601. Determine the intra-prediction mode parameters for the current block.

[0345] It should be noted that this encoding method is applied to the encoder, specifically a method for selecting transform sets based on intra-frame non-directional mode prediction block residuals.

[0346] In this embodiment, the encoder obtains the prediction mode parameters of the current block. The prediction mode parameters indicate the coding mode of the current block and the parameters related to that mode. The prediction modes typically include traditional intra-frame prediction modes and non-traditional intra-frame prediction modes. Traditional intra-frame prediction modes may include DC mode, Planar mode, and angular prediction mode, etc., while non-traditional intra-frame prediction modes (first type of intra-frame prediction modes) may include MIP mode, CCLM mode, IBC mode, and PLT mode, etc.

[0347] In this embodiment of the application, the first syntax element information is used to indicate the method of determining the transformation parameters. The method of determining the transformation parameters indicated by the first syntax element information includes the following three cases:

[0348] Case 1: The first syntax element information is used to indicate the predicted value type corresponding to the current block; wherein, the predicted value type includes a first type and / or a second type, the first type indicating that the current block uses a first predicted value to determine the transformation parameters, and the second type indicating that the current block uses a second predicted value to determine the transformation parameters. The second predicted value is obtained based on the first predicted value after filtering, and the filtering includes upsampling and / or downsampling.

[0349] Case 2: The first syntax element information is used to indicate the first type of the current block; where the first type indicates that the default prediction type of the current block is the first prediction (such as the prediction before sampling).

[0350] Case 3: The first syntax element information is used to indicate the index identifier of the transform parameter corresponding to the current block. For example, assuming the value of the first syntax element information is 0, the index identifier of the transform parameter corresponding to the current block is 0. In this case, the first predicted value corresponding to index identifier 0 is used to determine the transform parameter. Assuming the value of the first syntax element information is 1, the index identifier of the transform parameter corresponding to the current block is 1. In this case, the second predicted value corresponding to index identifier 1 is used to determine the transform parameter.

[0351] In this embodiment of the application, the first syntax element information can be represented as nUseDefaultSample.

[0352] It should be noted that the description of S301 can be referred to the description of S301 in the foregoing embodiments, and will not be repeated here.

[0353] S602. Use intra-frame prediction mode parameters to determine candidate transform parameters for the current block.

[0354] In this embodiment, the candidate transformation parameters include one or more candidate transformation parameters. Among them, the candidate transformation parameters include the transformation parameters of the current block. The transformation parameters of the current block are the optimal transformation parameters.

[0355] S603. Encode the residual values ​​of the current block corresponding to the candidate transform parameters to determine the transform parameters of the current block.

[0356] In this embodiment, based on the intra-prediction mode parameters of the current block, the residual value of the current block is predicted and encoded using multiple transform parameters from the candidate transform parameters, and the rate-distortion cost results corresponding to the multiple transform parameters are calculated. The minimum rate-distortion cost result is selected from the multiple calculated rate-distortion cost results, and the transform parameter corresponding to the minimum rate-distortion cost result is determined as the optimal transform parameter for the current block.

[0357] S604. Based on the transform parameters of the current block, determine the first syntax element information, encode the first syntax element information, and write the obtained encoded bits into the bitstream; wherein, the first syntax element information is used to indicate the method of determining the transform parameters.

[0358] Understandably, on the one hand, the first syntax element information indicates how the transform parameters are determined, meaning the encoder can more accurately select transform parameters suitable for the features of the current block. For example, some image blocks may be better suited to high-precision transform parameters, while simpler parameters can be used for other blocks. Accurate selection of transform parameters improves the accuracy and clarity of the encoded image. On the other hand, the use of the first syntax element information makes the selection of transform sets more flexible. This means the encoder can select different transform parameter sets based on the characteristics of different blocks or encoding requirements, thereby adapting to encoding requirements in different scenarios and improving the flexibility and adaptability of encoding. Furthermore, improving the accuracy and flexibility of transform parameters improves overall encoding performance. Accurate selection of transform parameters reduces errors and distortions during the encoding process, while flexible selection better adapts to different types of image or video content, thereby improving encoding efficiency and quality.

[0359] In some embodiments of this application, the implementation of determining the candidate transform parameters of the current block using intra-frame prediction mode parameters in S602 may include S6021 to S6022:

[0360] S6021. Determine the first prediction value and / or the second prediction value of the current block based on the intra-frame prediction mode parameters; wherein the second prediction value is obtained by filtering the first prediction value.

[0361] S6022. Use the first predicted value or the second predicted value to determine the candidate transformation parameters.

[0362] Understandably, on the one hand, the second predicted value is obtained by filtering the first predicted value, meaning more information can be utilized in the prediction process. By appropriately utilizing the filtered second predicted value, the information in the image or video data can be used more fully, improving coding efficiency and quality. On the other hand, selecting appropriate predicted values ​​to determine the transform parameters can optimize computation and resource utilization in the coding process. For example, choosing either the first predicted value or the filtered second predicted value as the transform parameter based on the actual situation can reduce the encoder's computational complexity and improve coding performance.

[0363] It should be noted that the descriptions of S6021 and S6022 can be found in the descriptions of S3021 and S3022, and will not be repeated here.

[0364] In some embodiments of this application, the method for determining candidate transformation parameters based on the first syntax element information, specifically in S6022, involves determining the candidate transformation parameters using either a first predicted value or a second predicted value based on the first syntax element information. This can be categorized into the following three cases:

[0365] Case 1: The first syntax element information is used to indicate the predicted value type corresponding to the current block.

[0366] In some embodiments of this application, when the first syntax element information is used to indicate the predicted value type corresponding to the current block, the implementation of S6022 may include: determining candidate transformation parameters by using a first predicted value or a second predicted value according to the predicted value type indicated by the first syntax element information.

[0367] In some embodiments of this application, candidate transformation parameters include a first transformation set and a second transformation set; determining candidate transformation parameters based on the prediction value type corresponding to the current block, using either the first or second prediction value, includes:

[0368] When the predicted value type is the first type, the first transformation set of the current block is determined based on the gradient statistics corresponding to some or all of the predicted values ​​in the first predicted value.

[0369] When the predicted value type is the second type, the second transformation set of the current block is determined based on the gradient statistics corresponding to some or all of the predicted values ​​in the second predicted value.

[0370] In this embodiment of the application, the candidate transform set may include a first transform set Set1 and a second transform set Set2.

[0371] Case 2: The first syntax element information is used to indicate the first type of the current block.

[0372] In some embodiments of this application, when the first syntax element information is used to indicate the first type of the current block, the implementation of S6022 may include: determining a preset flag bit based on the first type of the current block and the intra-frame prediction mode parameters; and determining candidate transform parameters based on the preset flag bit and using a first prediction value or a second prediction value.

[0373] In this embodiment, the preset flag is a flag specified by the encoding / decoding end and does not need to be written into the bitstream or the decoding bitstream.

[0374] In this embodiment, the preset flag can be represented as isUpSampleFlag.

[0375] In some embodiments of this application, candidate transformation parameters include a first transformation set and a second transformation set; determining candidate transformation parameters based on a preset flag bit and using a first predicted value or a second predicted value includes:

[0376] When the preset flag indicates that the transformation parameters are determined by the first predicted value, the first transformation set of the current block is determined according to the gradient statistics corresponding to some or all of the predicted values ​​in the first predicted value.

[0377] When the preset flag indicates that the transformation parameters are determined using the second predicted value, the second transformation set of the current block is determined based on the gradient statistics corresponding to some or all of the predicted values ​​in the second predicted value.

[0378] Furthermore, in the case of the first predicted value before the first type of characterization sampling, the implementation of determining the preset flag bit according to the intra-frame prediction mode parameters has the following implementation methods (1)-(3):

[0379] (1) Intra-frame prediction mode parameters include: shape parameters.

[0380] If the shape parameters indicate that the current block is a square block, the value of the preset flag is set to the value of the first type indicated by the first syntax element information, and the preset flag indicates that the transformation parameters are determined using the first predicted value; or...

[0381] When the shape parameter indicates that the current block is a non-square block, the value of the preset flag is set to the logical NOT value of the first type of the first syntax element information, and the preset flag indicates that the transformation parameters are determined by the second prediction value.

[0382] (2) Intra-frame prediction mode parameters include: size parameters.

[0383] If the size range of the current block indicated by the size parameters does not belong to the preset size range, the value of the preset flag is set to the value of the first type indicated by the first syntax element information. The preset flag indicates that the transformation parameters are determined using the first predicted value; or...

[0384] If the size range of the current block indicated by the size parameter is within the preset size range, the value of the preset flag is set to the logical NOT value of the first type of the first syntax element information, and the preset flag indicates that the transformation parameters are determined by the second prediction value.

[0385] (3) Intra-frame prediction mode parameters include: shape parameters and size parameters.

[0386] If the shape parameter indicates that the current block is a square block, and the size parameter indicates that the size range of the current block does not fall within the preset size range, the value of the preset flag is set to the value of the first type indicated by the first syntax element information. The preset flag indicates that the transformation parameters are determined using the first predicted value; or...

[0387] If the shape parameter indicates that the current block is a non-square block and the size parameter indicates that the size range of the current block is within the preset size range, the value of the preset flag is set to the logical NOT value of the first type indicated by the first syntax element information, and the preset flag indicates that the transformation parameters are determined by the second prediction value.

[0388] In this embodiment, setting the value of the preset flag to the value of the first type indicated by the first syntax element information can be represented as isUpSampleFlag = nUseDefaultSample. Setting the value of the preset flag to the logical NOT value of the first type indicated by the first syntax element information can be represented as: isUpSampleFlag = ! nUseDefaultSample.

[0389] In some embodiments of this application, determining the transformation parameters based on a preset flag bit and using a first predicted value or a second predicted value may include:

[0390] When a preset flag indicates that the transformation parameters are determined using the first predicted value, the first transformation set of the current block is determined based on the gradient statistics corresponding to some or all of the predicted values ​​in the first predicted value; or,

[0391] When the preset flag indicates that the transformation parameters are determined using the second predicted value, the second transformation set of the current block is determined based on the gradient statistics corresponding to some or all of the predicted values ​​in the second predicted value.

[0392] Understandably, on the one hand, by setting the value of the preset flag bit based on the shape parameter indicating whether the current block is square or non-square, shape information can be fully utilized. This approach allows for the use of different prediction values ​​and transform parameters for blocks of different shapes, improving the encoder's ability to handle blocks of different shapes and enhancing encoding performance. Setting the preset flag bit value based on the shape parameter and selecting an appropriate prediction value can improve encoding accuracy. On the other hand, by determining whether the current block's size range falls within a preset size range based on the size parameter, and adjusting the preset flag bit value and selecting a prediction value accordingly, dynamic adaptability can be achieved. Using different prediction values ​​and transform parameters for blocks of different size ranges can better adapt to image blocks of different sizes, improving encoding performance.

[0393] Case 3: The first syntax element information is used to indicate the index identifier of the transformation parameter corresponding to the current block.

[0394] In some embodiments of this application, when the first syntax element information is used to indicate the index identifier of the transform parameters corresponding to the current block, the implementation of S6022 may include: determining the candidate transform set corresponding to the current block based on the first predicted value and / or the second predicted value; the candidate transform set is the candidate transform parameters.

[0395] Understandably, on the one hand, by using predicted values ​​to determine the candidate transform set, the features and transform requirements of the current block can be predicted more accurately. Selecting appropriate transform parameters from the candidate transform set based on the index identifier indicated by the first syntax element information can improve the accuracy of the transform parameters, thereby improving the precision and quality of encoding. On the other hand, using candidate transform sets and index identifiers can enhance the encoder's flexibility. Different candidate transform sets may contain different transform parameter options; selecting appropriate transform parameters based on the index identifier indicated by the first syntax element information allows the encoder to adapt to different types or features of image or video data, improving its adaptability and flexibility. Selecting appropriate transform parameters can optimize resource utilization during the encoding process. The use of candidate transform sets and index identifiers helps the encoder effectively select the optimal transform parameters, reducing unnecessary computation and resource consumption, and improving encoding efficiency.

[0396] In the embodiments of this application, the index identifier can be represented as 0, 1, 3, ... For example, assuming that the candidate transform set includes two transform sets: the first transform set (Set1) and the second transform set (Set2), then an index identifier of 0 indicates that the transform parameters are from the first transform set, and an index identifier of 1 indicates that the transform parameters are from the second transform set.

[0397] In some embodiments of this application, a candidate transformation set corresponding to the current block is determined based on a first predicted value and / or a second predicted value, including at least one of the following:

[0398] Based on the gradient statistics corresponding to the first or second predicted value, a first type of transformation set is determined; the first type of transformation set includes: a first transformation set and a second transformation set;

[0399] Based on the highest N gradient statistics corresponding to the first or second predicted value, a second type of transformation set is determined; the second type of transformation set includes: N-1 third transformation sets and / or N-1 fourth transformation sets; the N-1 third transformation sets are the transformation sets corresponding to gradient statistics other than the highest gradient statistics corresponding to the first predicted value; the N-1 fourth transformation sets are the transformation sets corresponding to gradient statistics other than the highest gradient statistics corresponding to the second predicted value; N is a positive integer greater than 1;

[0400] The third type of transform set is determined based on the gradient statistics of the reconstructed neighboring pixels of the current block;

[0401] Based on the preset prediction mode corresponding to the current block, determine the fourth type of transformation set; among which, the preset prediction mode includes: Planar mode;

[0402] The candidate transform set includes at least one of the second, third, and fourth transform sets, as well as the first transform set.

[0403] In the embodiments of this application, the first type of transform set includes: a first transform set (Set1) and a second transform set (Set2), the second type of transform set includes: N-1 third transform sets (Set3) and / or N-1 fourth transform sets (Set4), the third type of transform set includes at least one fifth transform set (Set5), and the fourth type of transform set includes at least one sixth transform set (Set6).

[0404] It should be noted that when N is 2, the second type of transformation set includes one third transformation set (Set3) and / or one fourth transformation set (Set4). In this case, the third transformation set is the transformation set corresponding to the second highest gradient statistical value corresponding to the first predicted value, and the fourth transformation set is the transformation set corresponding to the second highest gradient statistical value corresponding to the second predicted value.

[0405] In some embodiments of this application, the decoding method further includes:

[0406] Determine the preset traversal order;

[0407] According to the preset traversal order, at least one type of transformation set in the first type of transformation set, the second type of transformation set, the third type of transformation set, and the fourth type of transformation set is traversed in turn until a preset number of different transformation sets are found, and candidate transformation sets are obtained; wherein, the preset number is at least two.

[0408] In this embodiment, the preset traversal order can be predefined by both the encoder and decoder, or the encoder can write the preset traversal order into the bitstream after making an encoding decision, and the decoder can determine the preset traversal order by decoding the bitstream. This embodiment does not limit the method of determining the preset traversal order.

[0409] In some embodiments of this application, when the candidate transform set includes at least two different transform sets, if the first transform set in the preset traversal order is the first transform set, then the second transform set in the preset traversal order is the third transform set; or,

[0410] If the first transformation set in the preset traversal order is the second transformation set, then the second transformation set in the preset traversal order is the fourth transformation set; or,

[0411] If the first transformation set in the preset traversal order is a first-type transformation set, then the second transformation set in the preset traversal order is any transformation set in the second-type transformation set that is different from the first transformation set.

[0412] In the embodiments of this application, at least two different transformation sets are a first type of transformation set and a second type of transformation set.

[0413] In some embodiments of this application, the second type of transformation set in the preset traversal order includes: a third transformation set and / or a fourth transformation set.

[0414] In the embodiments of this application, the second type of transform set includes at least one transform set, such as a third transform set, a fourth transform set, or both a third transform set and a fourth transform set. That is, Set3 and Set4 can be selected or both can be used.

[0415] In this embodiment of the application, the preset traversal order includes any of the following:

[0416] In the case of first-type, second-type, third-type, and fourth-type transformation sets, the preset traversal order can be set1 / set2—set2 / set1—set3 / set4—set5—set6; specifically, it can include: set1—set2—set3—set4—set5—set6, or set2—set1—set3—set4—set5—set6, or set1—set2—set3—set5—set6, set1—set2—set4—set5—set6, or set2—set1—set3—set5—set6, or set2—set1—set4—set5—set6.

[0417] The first type of transformation set, the third type of transformation set, the second type of transformation set, and the fourth type of transformation set; in this case, the preset traversal order can be set1 / set2—set2 / set1—set5—set3 / set4—set6.

[0418] The first type of transformation set, the second type of transformation set, the third type of transformation set, and the fourth type of transformation set; in this case, the preset traversal order can be set1 / set2—set3 / set4—set2 / set1—set5—set6.

[0419] The first type of transformation set, the third type of transformation set, the first type of transformation set, the second type of transformation set, and the fourth type of transformation set; in this case, the preset traversal order can be set1 / set2—set5—set2 / set1—set3 / set4—set6.

[0420] The first type of transformation set, the fourth type of transformation set, the third type of transformation set, and the second type of transformation set; in this case, the preset traversal order can be set1 / set2—set2 / set1—set6—set5—set3 / set4.

[0421] The first type of transformation set, the fourth type of transformation set, the second type of transformation set, and the third type of transformation set; in this case, the preset traversal order can be set1 / set2—set2 / set1—set6—set3 / set4—set5.

[0422] The fourth type of transformation set, the first type of transformation set, the second type of transformation set, and the third type of transformation set; in this case, the preset traversal order can be set6—set1 / set2—set2 / set1—set3 / set4—set5.

[0423] The fourth type of transformation set, the first type of transformation set, the third type of transformation set, and the second type of transformation set; in this case, the preset traversal order can be set6—set1 / set2—set2 / set1—set5—set3 / set4.

[0424] The fourth type of transformation set, the first type of transformation set, the second type of transformation set, the first type of transformation set, and the third type of transformation set; in this case, the preset traversal order can be set6—set1 / set2—set3 / set4—set2 / set1—set5.

[0425] The fourth type of transformation set, the first type of transformation set, the third type of transformation set, the first type of transformation set, and the second type of transformation set; in this case, the preset traversal order can be set6—set1 / set2—set5—set2 / set1—set3 / set4.

[0426] It should be noted that the above is merely a simple list, and the embodiments of this application do not limit the traversal order of the first type of transform set, the third type of transform set, the second type of transform set, and the fourth type of transform set, nor the traversal order of multiple transform sets of each type of transform set. That is, the traversal order of multiple transform sets in the candidate transform set can be freely combined, and the embodiments of this application do not limit the preset traversal order.

[0427] In some embodiments of this application, the encoding method further includes:

[0428] The value of the second syntax element information is determined according to the preset traversal order;

[0429] The information of the first syntax element is encoded, and the resulting encoded bits are written into the bitstream.

[0430] In some embodiments of this application, the candidate transform set includes at least: a first type of transform set, a second type of transform set, and a third type of transform set; the method further includes:

[0431] If the highest and second-highest gradient statistics corresponding to the first predicted value are less than a preset threshold, and / or if the highest and second-highest gradient statistics corresponding to the second predicted value are less than a preset threshold, the second type of transformation set in the preset traversal order takes precedence over the third type of transformation set; or...

[0432] If the highest and second-highest gradient statistics corresponding to the first predicted value are greater than or equal to a preset threshold, and / or if the highest and second-highest gradient statistics corresponding to the second predicted value are greater than or equal to a preset threshold, the third type of transformation set in the preset traversal order takes precedence over the second type of transformation set; or...

[0433] In the preset traversal order, the first type of transformation set takes precedence over the second and third type of transformation sets.

[0434] For example, with a preset threshold of 5, if the difference between the highest and second-highest gradient statistics corresponding to the first predicted value is less than 5, the preset traversal order can be: set1—set2—set3 / set4—set5—set6. If the difference between the highest and second-highest gradient statistics corresponding to the second predicted value is less than 5, the preset traversal order can be: set2—set1—set3 / set4—set5—set6. If the difference between the highest and second-highest gradient statistics corresponding to the first predicted value is greater than or equal to 5, the preset traversal order can be: set1—set2—set5—set3 / set4—set6. If the difference between the highest and second-highest gradient statistics corresponding to the second predicted value is greater than or equal to 5, the preset traversal order can be: set2—set1—set5—set3 / set4—set6.

[0435] In some embodiments of this application, the encoding method further includes:

[0436] The first syntax element information is encoded using either equal probability encoding or unequal probability encoding.

[0437] In some embodiments of this application, unequal probability encoding methods have a higher priority than equal probability encoding methods.

[0438] In some embodiments of this application, the encoding method further includes:

[0439] Determine the value of the third syntax element information;

[0440] The information of the third syntax element is encoded, and the resulting encoded bits are written into the bitstream.

[0441] Determine the values ​​of the third syntax element information, including:

[0442] If the current block uses transform set derivation, set the value of the third syntax element information to the first value; or,

[0443] If the current block does not use transform set derivation, the value of the third syntax element information is set to the second value.

[0444] It should be noted that, in the embodiments of this application, the first value and the second value are different, and the first value and the second value can be in parameter form or in numeric form. Specifically, the relevant syntax element information can be a parameter written in the profile or a value of a flag, which is not specifically limited here.

[0445] In some embodiments of this application, the third syntax element information is carried in any one of the sequence parameter set SPS, image parameter set PPS, slice parameter set APS, image header PH, and slice header SH.

[0446] In some embodiments of this application, before determining the candidate transform set corresponding to the current block based on the first predicted value or the second predicted value, the method further includes:

[0447] If the prediction mode of the current block belongs to the preset prediction mode, then, given the first predicted value of the current block, the first predicted value is filtered to obtain the second predicted value. The filtering process includes upsampling or downsampling.

[0448] In some embodiments of this application, the preset prediction mode includes one or more of the following: SGPM mode, EIP mode, IntraTMP mode, IBC mode, DIMD mode, TIMD mode, and MIP.

[0449] In some embodiments of this application, the encoding method further includes:

[0450] Based on the transformation parameters, the transformation coefficients of the current block are transformed to determine the target residual value of the current block;

[0451] The reconstruction value of the current block is determined based on the target residual value and the first predicted value of the current block.

[0452] In this embodiment of the application, the transformation coefficients include: quantization coefficients.

[0453] In this embodiment, the encoder dequantizes the quantization coefficients to obtain first transform coefficients; the first transform coefficients are transformed to obtain a first transform coefficient vector; the first transform coefficient vector is transformed using the transform matrix indicated by the transform kernel index parameter to obtain a second transform coefficient vector; the second transform coefficient vector is transformed using the scan order parameter of the transform parameters to obtain the second transform coefficients.

[0454] The second transform coefficients are inversely transformed to obtain the residual value of the current block. After obtaining the residual value and the first predicted value, the encoder can determine the reconstructed value of the current block based on the residual value and the first predicted value.

[0455] The encoding and decoding method provided in this application will be explained below in a specific embodiment.

[0456] In one embodiment of this application, an encoding end implementation is provided, as shown in Figure 17A. The decoding method includes: S901, matrix-vector multiplication; S902, MIP prediction upsampling; S903, DIMD derivation. In this embodiment, the transform set is derived using the first prediction value before filtering (e.g., upsampling) of the current block. The transform parameters of the current block, i.e., the first transform set (set1), are determined through intra-frame prediction mode mapping.

[0457] In one embodiment of this application, a decoding implementation is provided, as shown in Figure 17B. The decoding method includes: S901, matrix-vector multiplication; S902, upsampling of MIP prediction values; and S903, DIMD derivation. In this embodiment, the transform set is derived using the second prediction value after filtering (e.g., upsampling) of the current block. The transform parameters of the current block, i.e., the second transform set (set2), are determined through intra-frame prediction mode mapping.

[0458] Referring to Figures 17A and 17B, in one embodiment of this application, a decoding end implementation method is provided, as shown in Figure 17C. By parsing the bitstream, the first syntax element information is determined, and based on the first syntax element information, the first predicted value before filtering (i.e., before upsampling) or the second predicted value after filtering (i.e., after upsampling) is used to derive the transform set.

[0459] In one embodiment of this application, an encoding end implementation is provided, as shown in FIG18. The encoding method includes S701 to S707:

[0460] S701, Matrix Multiplication;

[0461] S702, matrix multiplication output sampling clamp;

[0462] S703, matrix multiplication output sampling transpose;

[0463] S704. Derive the transform set using the predicted values ​​before upsampling;

[0464] S705, Generate the final predicted value of MIP;

[0465] S706. Derive the transform set using the upsampled predicted values;

[0466] S707. Which predicted value to use to derive the transformation set.

[0467] In this embodiment, the encoding method shown in Figure 18 is applied to the encoder. After executing steps S701 to S707, the encoder determines an optimal transform set (equivalent to the transform parameters of the current block in the aforementioned embodiment), determines the first syntax element information based on the transform parameters of the current block, encodes the first syntax element information, and writes the encoded bits into the bitstream. Correspondingly, the decoder determines the first syntax element information by decoding the bitstream. Furthermore, the decoder can determine the method for determining the transform parameters of the current block based on the first syntax element information (e.g., using the prediction value before upsampling or the prediction value after upsampling).

[0468] In one embodiment of this application, a decoding end implementation is provided, as shown in FIG19. The decoding method includes S801 to S807:

[0469] S801, parse the bitstream;

[0470] S802. Determine whether to use the pre-upsampling predicted value to derive the transform set;

[0471] If yes, then execute S806; otherwise, execute S808.

[0472] S803, matrix multiplication;

[0473] S804, matrix multiplication output sampling clamp;

[0474] S805, matrix multiplication output sampling transpose;

[0475] S806. Derive the transform set using the predicted values ​​before upsampling;

[0476] S807, Generate the final predicted value of MIP;

[0477] S808. Derive the transform set using the upsampled predicted values.

[0478] In this embodiment of the application, the decoding method shown in FIG19 is applied to the decoder, which determines the steps to be executed based on the first syntax element information obtained by decoding the code stream in S801.

[0479] In one embodiment of this application, the decoder does not necessarily have to execute S806. If the first syntax element information obtained through the decoded bitstream in S801 indicates that the current block uses the prediction value before upsampling (equivalent to the first prediction value in the aforementioned embodiment) to determine the transform parameters (transform set), then the decoder needs to execute S806. If the first syntax element information obtained through the decoded bitstream in S801 indicates that the current block uses the prediction value after upsampling (equivalent to the second prediction value in the aforementioned embodiment) to determine the transform parameters (transform set), then the decoder does not need to execute S806.

[0480] In one embodiment of this application, the decoder does not necessarily have to execute S804. If the first syntax element information obtained through the decoded bitstream in S801 indicates that the current block uses the prediction value before upsampling (equivalent to the first prediction value in the aforementioned embodiment) to determine the transform parameters (transform set), then the decoder needs to execute S804. If the first syntax element information obtained through the decoded bitstream in S801 indicates that the current block uses the prediction value after upsampling (equivalent to the second prediction value in the aforementioned embodiment) to determine the transform parameters (transform set), then the decoder does not need to execute S804.

[0481] It should be noted that the predicted value derivation transformation set before upsampling is equivalent to the first transformation set in the aforementioned embodiment, and the predicted value derivation transformation set after upsampling is equivalent to the second transformation set in the aforementioned embodiment. The predicted value before upsampling is equivalent to the first predicted value in the aforementioned embodiment, and the predicted value after upsampling is equivalent to the second predicted value in the aforementioned embodiment.

[0482] It should be noted that the relevant steps in S701 to S707 and S801 to S808 can be referred to the description of S501 to S507 in the foregoing embodiments, and will not be repeated here.

[0483] In this embodiment, a flag (first syntax element information) is used to identify the predicted value before upsampling (first predicted value) or the predicted value after upsampling (second predicted value). A specific embodiment for determining the first syntax element information is as follows: the first syntax element information is a syntax element of the CU layer (let its name be nUseDefaultSample). When the encoder finds that set1 (first transform set) and set2 (second transform set) are the same, or when a cost (encoding decision) comparison reveals that the cost of using set1 is smaller, residual precoding is performed, and element values ​​corresponding to the meaning of set1 are written into the bitstream; otherwise, element values ​​corresponding to the meaning of set2 are written.

[0484] In this embodiment, at the decoding end, based on a conditional judgment, if it is determined that there is first syntax element information indicating the selection of the transform set, the corresponding bits are read and entropy decoded to obtain the first syntax element information. Then, based on the first syntax element information, it is determined whether to use the predicted value before or after upsampling.

[0485] It should be noted that the main idea of ​​the encoding / decoding method provided in this application is to derive the LFNST / NSPT transform set using the predicted values ​​before and after upsampling in MIP prediction mode, and adaptively select which predicted value to use. In this way, the predicted values ​​used to derive the LFNST / NSPT transform set in MIP mode using DIMD can be adaptively selected, i.e., the predicted values ​​before or after upsampling. This allows for more accurate mapping of the intra-frame angle pattern using the texture information of the current block, improving encoding / decoding performance without affecting encoding / decoding time.

[0486] In one embodiment of this application, the predicted values ​​before and after upsampling are determined based on the bitstream identifier (let its name be nUseDefaultSample, representing whether the default derivation transformation method is not used, or regarded as representing the index number).

[0487] In one embodiment of this application, the predicted values ​​before and after upsampling can be determined based on the size / shape of the block. Specifically, if the current block is a non-square block, isUpSampleFlag (equivalent to the preset flag in the aforementioned embodiment) is set to !nUseDefaultSample, meaning that the upsampled predicted values ​​are used by default for deriving the transform set; otherwise, if the current block is a square block, isUpSampleFlag is set to nUseDefaultSample, meaning that the unupsampled predicted values ​​are used by default for deriving the transform set. The above process can be expressed as:

[0488] In one embodiment of this application, if the current block is a small block, for example, if the corresponding sizeId is {0, 1}, then isUpSampleFlag is set to !nUseDefaultSample, meaning that the upsampled predicted value is used by default for deriving the transform set. Otherwise, if the current block is not a small block (i.e., if the sizeId corresponding to the current block is not {0, 1}), then isUpSampleFlag is set to nUseDefaultSample, meaning that the unsampled predicted value is used by default for deriving the transform set.

[0489] In one embodiment of this application, if the current block is a non-square block or the corresponding sizeId is {0, 1}, then isUpSampleFlag is set to nUseDefaultSample, that is, the upsampled predicted value is used by default to derive the transform set; otherwise, if the current block is a square block and the corresponding sizeId is not {0, 1}, then isUpSampleFlag is set to nUseDefaultSample, that is, the upsampled predicted value is used by default to derive the transform set.

[0490] In one embodiment of this application, the predicted values ​​before and after upsampling can be determined by combining other patterns in the histogram. Specifically, if the pattern with the highest amplitude and the pattern with the second highest amplitude in the histogram constructed from the predicted values ​​before / after upsampling can each derive a transform set, then a transform set set3 (equivalent to the third transform set in the aforementioned embodiment) corresponding to the second pattern before upsampling and / or a transform set set4 (equivalent to the fourth transform set in the aforementioned embodiment) corresponding to the second pattern after upsampling may be generated.

[0491] In one embodiment of this application, when using the default pre-upsampling set1 (which can also be understood as the first position in the preset traversal order being set1), the second position in the candidate transform set is set3 (which can also be understood as the second position in the preset traversal order being set3). When using the default pre-upsampling set2 (which can also be understood as the first position in the preset traversal order being set2), the second position is set4 (which can also be understood as the second position in the preset traversal order being set4). When using the default set1 or set2 (which can also be understood as the first position in the preset traversal order being the first type of transform), the differences between set3 and set4 are placed in the second position.

[0492] In one embodiment of this application, the decoding end determines whether the mode with the highest amplitude (set1 / set2) or the mode with the second highest amplitude (set3 / set4) is used when nUseDefaultSample is 1 by judging the similarity or difference between set1 and set2. For example, if the default is set1, set3 is placed in the second position; if the default is set2, set4 is placed in the second position. For example, regardless of whether it is set1 or set2, set3 and set4 are checked, and those different from set1 / set2 are placed in the second position. The order of placement can be 3 first and then 4, or according to the default, if set1 is used, set3 is placed in the second position first, and if set2 is used, set4 is placed in the second position first.

[0493] In one embodiment of this application, the predicted values ​​before and after upsampling can be determined by combining the reconstructed pixels of the surrounding area. Gradient-based histogram analysis is performed using the reconstructed pixels of the current block's upper / left / upper left regions to determine a transform set set5 corresponding to a primary direction. The decoder determines whether, when nUseDefaultSample is 1, it is using set1 / set2 corresponding to the mode with the highest amplitude, or set5 corresponding to the mode derived from the periodic region, by judging the similarities and differences between set1 and set2.

[0494] In one embodiment of this application, the predicted values ​​before and after upsampling can be determined by combining a predefined mode. The decoder determines whether, when nUseDefaultSample is 1, it is using set1 / set2 corresponding to the mode with the highest amplitude, or set6 corresponding to the predefined mode, by judging the difference between set1 and set2.

[0495] In one embodiment of this application, multiple extension schemes can be combined to determine whether existing transformation sets are the same in various orders. If they are the same, other transformation sets are added in a predefined order. Before each transformation set is added, it is checked whether it is the same as an existing transformation set.

[0496] In one embodiment of this application, when the current block is a non-square block, the encoder may always disallow the use of the predicted value before upsampling for transform set derivation. For example, if the candidate transform set only includes set2, the first syntax element information may not be transmitted.

[0497] The preferred embodiments of this application have been described in detail above with reference to the accompanying drawings. However, this application is not limited to the specific details of the above embodiments. Within the scope of the technical concept of this application, various simple modifications can be made to the technical solutions of this application, and these simple modifications all fall within the protection scope of this application. For example, the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. To avoid unnecessary repetition, this application will not describe the various possible combinations separately. Furthermore, various different embodiments of this application can also be arbitrarily combined, as long as they do not violate the spirit of this application, they should also be considered as the content disclosed in this application. Moreover, without conflict, the various embodiments and / or the technical features in the various embodiments described in this application can be arbitrarily combined with the prior art, and the resulting technical solutions should also fall within the protection scope of this application.

[0498] It should be understood that in the various method embodiments of this application, the sequence number of each process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0499] In one embodiment of this application, based on the same inventive concept as the foregoing embodiments, a bitstream is provided, wherein the bitstream is generated by bit encoding information to be encoded; wherein the information to be encoded includes at least one of the following:

[0500] The information comprises a first syntax element, a second syntax element, a third syntax element, and intra-prediction mode parameters; the first syntax element indicates how the transform parameters of the current block are determined; the second syntax element indicates the preset traversal order of the current block; and the third syntax element indicates whether the current block uses transform set derivation.

[0501] In another embodiment of this application, based on the same inventive concept as the foregoing embodiments, referring to FIG20, a schematic diagram of the composition structure of a decoder provided in an embodiment of this application is shown. As shown in FIG20, the decoder 1000 includes a decoding part 1001 and a first determining part 1002, wherein:

[0502] The decoding section 1001 is configured to decode the bitstream and determine the intra-frame prediction mode parameters of the current block and the first syntax element information of the current block; wherein, the first syntax element information is used to indicate the method of determining the transform parameters.

[0503] The first determining portion 1002 is configured to determine the transform parameters of the current block based on the first syntax element information and the intra-prediction mode parameters.

[0504] In some embodiments, the first determining portion 1002 is further configured to determine a first predicted value and / or a second predicted value of the current block based on the intra-frame prediction mode parameters; wherein the second predicted value is obtained by filtering the first predicted value.

[0505] In some embodiments, the first syntax element information is used to indicate the predicted value type corresponding to the current block; the first determining portion 1002 is further configured to determine the transformation parameters based on the predicted value type indicated by the first syntax element information, using the first predicted value or the second predicted value.

[0506] In some embodiments, the transformation parameters include a first transformation set or a second transformation set; the first determining portion 1002 is further configured to determine a first transformation set of the current block based on gradient statistics corresponding to some or all of the predicted values ​​in the first predicted values ​​when the first syntax element information indicates that the predicted value type is a first type; or, to determine a second transformation set of the current block based on gradient statistics corresponding to some or all of the predicted values ​​in the second predicted values ​​when the first syntax element information indicates that the predicted value type is a second type.

[0507] In some embodiments, the first syntax element information is used to indicate a first type of the current block; the first determining portion 1002 is further configured to determine a preset flag bit based on the first type indicated by the first syntax element information and the intra-frame prediction mode parameters; and to determine the transform parameters based on the preset flag bit and using the first prediction value or the second prediction value.

[0508] In some embodiments, the first determining portion 1002 is further configured to, when the preset flag indicates that the transformation parameters are determined using the first predicted values, determine a first transformation set of the current block based on gradient statistics corresponding to some or all of the predicted values ​​in the first predicted values; or, when the preset flag indicates that the transformation parameters are determined using the second predicted values, determine a second transformation set of the current block based on gradient statistics corresponding to some or all of the predicted values ​​in the second predicted values.

[0509] In some embodiments, the intra-frame prediction mode parameters include: shape parameters; the first determining portion 1002 is further configured to, when the shape parameters indicate that the current block is a square block, set the value of the preset flag bit to a value indicating a first type in the first syntax element information, the preset flag bit indicating that the transformation parameters are determined using the first prediction value; or, when the shape parameters indicate that the current block is a non-square block, set the value of the preset flag bit to a logical NOT value indicating a first type in the first syntax element information, the preset flag bit indicating that the transformation parameters are determined using the second prediction value.

[0510] In some embodiments, the intra-frame prediction mode parameters include: a size parameter; the first determining portion 1002 is further configured to, when the size range of the current block indicated by the size parameter does not belong to a preset size range, set the value of the preset flag bit to a value of a first type indicated by the first syntax element information, the preset flag bit indicating that the transformation parameter is determined using the first prediction value; or, when the size range of the current block indicated by the size parameter belongs to the preset size range, set the value of the preset flag bit to a logical NOT value indicating a first type of the first syntax element information, the preset flag bit indicating that the transformation parameter is determined using the second prediction value.

[0511] In some embodiments, the intra-frame prediction mode parameters include: shape parameters and size parameters; the first determining portion 1002 is further configured to, when the shape parameter indicates that the current block is a square block and the size range of the current block indicated by the size parameter does not belong to a preset size range, set the value of the preset flag bit to a value of a first type indicated by the first syntax element information, the preset flag bit indicating that the transformation parameters are determined using the first prediction value; or, when the shape parameter indicates that the current block is a non-square block and the size range of the current block indicated by the size parameter belongs to the preset size range, set the value of the preset flag bit to a logical NOT value of a first type indicated by the first syntax element information, the preset flag bit indicating that the transformation parameters are determined using the second prediction value.

[0512] In some embodiments, the first syntax element information is used to indicate the index identifier of the transform parameter corresponding to the current block; the first determining portion 1002 is further configured to determine a candidate transform set corresponding to the current block based on the first predicted value and / or the second predicted value; and to determine the transform parameter in the candidate transform set according to the index identifier indicated by the first syntax element information.

[0513] In some embodiments, the first determining portion 1002 is further configured to: determine a first type of transform set based on the gradient statistics corresponding to the first predicted value or the second predicted value; the first type of transform set includes: a first transform set and a second transform set; determine a second type of transform set based on the highest N gradient statistics corresponding to the first predicted value or the second predicted value; the second type of transform set includes: N-1 third transform sets and / or N-1 fourth transform sets; the N-1 third transform sets are transform sets corresponding to gradient statistics other than the highest gradient statistics corresponding to the first predicted value; the N-1 fourth transform sets are transform sets corresponding to gradient statistics other than the highest gradient statistics corresponding to the second predicted value; N is a positive integer greater than 1; determine a third type of transform set based on the gradient statistics corresponding to the reconstructed neighboring pixels of the current block; determine a fourth type of transform set based on a preset prediction mode corresponding to the current block; wherein the preset prediction mode includes: a planar mode; the candidate transform set includes at least one of the first type of transform set, the second type of transform set, the third type of transform set, and the fourth type of transform set.

[0514] In some embodiments, the first determining portion 1002 is further configured to determine a preset traversal order; according to the preset traversal order, at least one type of transformation set in the first type of transformation set, the second type of transformation set, the third type of transformation set, and the fourth type of transformation set is traversed sequentially until a preset number of different transformation sets are found, thereby obtaining the candidate transformation set; wherein, the preset number is at least two.

[0515] In some embodiments, when the candidate transform set includes at least two different transform sets, if the first transform set in the preset traversal order is a first transform set, then the second transform set in the preset traversal order is a third transform set; or, if the first transform set in the preset traversal order is a second transform set, then the second transform set in the preset traversal order is a fourth transform set; or, if the first transform set in the preset traversal order is a first type of transform set, then the second transform set in the preset traversal order is any transform set in the second type of transform set that is different from the first transform set.

[0516] In some embodiments, the second type of transformation set in the preset traversal order includes: a third transformation set and / or a fourth transformation set.

[0517] In some embodiments, the preset traversal order includes any one of the following: the first type of transformation set, the second type of transformation set, the third type of transformation set, and the fourth type of transformation set; the first type of transformation set, the third type of transformation set, the second type of transformation set, and the fourth type of transformation set; the first type of transformation set, the second type of transformation set, the first type of transformation set, the third type of transformation set, and the fourth type of transformation set; the first type of transformation set, the third type of transformation set, the first type of transformation set, the second type of transformation set, and the fourth type of transformation set; the first type of transformation set, the fourth type of transformation set, and the third type of transformation set. Transform set and second type of transform set; first type of transform set, fourth type of transform set, second type of transform set and third type of transform set; fourth type of transform set, first type of transform set, second type of transform set and third type of transform set; fourth type of transform set, first type of transform set, third type of transform set and second type of transform set; fourth type of transform set, first type of transform set, second type of transform set, first type of transform set and third type of transform set; fourth type of transform set, first type of transform set, third type of transform set, first type of transform set and second type of transform set.

[0518] In some embodiments, the decoding section 1001 is further configured to decode the bitstream and determine the second syntax element information.

[0519] In some embodiments, the first determining portion 1002 is further configured to determine the preset traversal order based on the value of the second syntax element information.

[0520] In some embodiments, the candidate transform set includes at least: a first type of transform set, a second type of transform set, and a third type of transform set; the first determining portion 1002 is further configured to: when the highest gradient statistics and the second highest gradient statistics corresponding to the first predicted value are less than a preset threshold, and / or when the highest gradient statistics and the second highest gradient statistics corresponding to the second predicted value are less than the preset threshold, the second type of transform set in the preset traversal order takes precedence over the third type of transform set; or, when the highest gradient statistics and the second highest gradient statistics corresponding to the first predicted value are greater than or equal to the preset threshold, and / or when the highest gradient statistics and the second highest gradient statistics corresponding to the second predicted value are greater than or equal to the preset threshold, the third type of transform set in the preset traversal order takes precedence over the second type of transform set; or, the first type of transform set in the preset traversal order takes precedence over the second type of transform set and the third type of transform set.

[0521] In some embodiments, the preset prediction mode includes: Planar mode.

[0522] In some embodiments, the decoding section 1001 is further configured to decode the first syntax element information using an equal probability decoding method or an unequal probability decoding method.

[0523] In some embodiments, the unequal probability decoding method has a higher priority than the equal probability decoding method.

[0524] In some embodiments, the decoding section 1001 is further configured to decode the bitstream and determine the third syntax element information.

[0525] In some embodiments, the first determining portion 1002 is further configured to, when the third syntax element information indicates that the current block uses transform set derivation, execute the decoded bitstream to determine the intra-prediction mode parameters of the current block and the first syntax element information of the current block; or, when the third syntax element information indicates that the current block does not use transform set derivation, not execute the decoded bitstream to determine the intra-prediction mode parameters of the current block and the first syntax element information of the current block.

[0526] In some embodiments, the first determining portion 1002 is further configured to determine that the current block uses transform set derivation if the value of the third syntax element information is a first value; or, if the value of the third syntax element information is a second value, determine that the current block does not use transform set derivation.

[0527] In some embodiments, the third syntax element information is carried in any one of the sequence parameter set SPS, image parameter set PPS, slice parameter set APS, image header PH, and slice header SH.

[0528] In some embodiments, the second predicted value is obtained by filtering the first predicted value; the first determining portion 1002 is further configured to, if the prediction mode of the current block belongs to a preset prediction mode, filter the first predicted value to obtain the second predicted value when the first predicted value of the current block is determined. The filtering process includes upsampling or downsampling.

[0529] In some embodiments, the filtering process includes upsampling and / or downsampling.

[0530] In some embodiments, the preset prediction mode includes one or more of the following: SGPM mode, EIP mode, IntraTMP mode, IBC mode, DIMD mode, TIMD mode, and MIP.

[0531] In some embodiments, the first determining portion 1002 is further configured to perform transformation processing on the transformation coefficients of the current block based on the transformation parameters to determine the target residual value of the current block; and to determine the reconstructed value of the current block based on the target residual value and the first predicted value of the current block.

[0532] Understandably, in the embodiments of this application, "part" can refer to a portion of circuitry, a portion of processor, a portion of program or software, etc., and can also be a module or a non-modular component. Furthermore, the components in this embodiment can be integrated into a single processing unit, or each unit can exist physically separately, or two or more units can be integrated into a single unit. The integrated unit can be implemented in hardware or as a software functional module.

[0533] If the integrated unit is implemented as a software functional module and 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, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the method described in this embodiment. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0534] Therefore, this application provides a computer-readable storage medium applied to a decoder 1000, the computer-readable storage medium storing a computer program that, when executed by a first processor, implements the method described in any of the foregoing embodiments.

[0535] Based on the composition of the decoder 1000 and the computer-readable storage medium described above, refer to Figure 21, which shows a schematic diagram of the specific hardware structure of the decoder 1000 provided in this embodiment of the application. As shown in Figure 21, the decoder 1000 may include: a first communication interface 1101, a first memory 1102, and a first processor 1103; the various components are coupled together through a first bus system 1104. It is understood that the first bus system 1104 is used to realize the connection and communication between these components. In addition to the data bus, the first bus system 1104 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, all buses are labeled as the first bus system 1104 in Figure 21.

[0536] in,

[0537] The first communication interface 1101 is used for receiving and sending signals during the process of sending and receiving information with other external network elements;

[0538] The first memory 1102 is used to store computer programs that can run on the first processor 1103;

[0539] The first processor 1103 is configured to, when running the computer program, perform:

[0540] Decode the bitstream to determine the intra-prediction mode parameters of the current block and the first syntax element information of the current block; wherein, the first syntax element information is used to indicate the method of determining the transform parameters;

[0541] Based on the first syntax element information, the transformation parameters of the current block are determined using the intra-frame prediction mode parameters.

[0542] It is understood that the first memory 1102 in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The first memory 1102 of the system and method described in this application is intended to include, but is not limited to, these and any other suitable types of memory.

[0543] The first processor 1103 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the first processor 1103 or by instructions in software form. The first processor 1103 may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules may reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in the first memory 1102. The first processor 1103 reads the information in the first memory 1102 and completes the steps of the above method in conjunction with its hardware.

[0544] It is understood that the embodiments described in this application can be implemented using 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 (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in this application, or combinations thereof. For software implementation, the technology described in this application can be implemented through modules (e.g., procedures, functions, etc.) that perform the functions described in this application. Software code can be stored in memory and executed by a processor. The memory can be implemented in the processor or external to the processor.

[0545] Alternatively, as another embodiment, the first processor 1103 is further configured to execute the method described in any of the foregoing embodiments when running the computer program.

[0546] In another embodiment of this application, based on the same inventive concept as the foregoing embodiments, referring to FIG22, a schematic diagram of the composition structure of an encoder provided in an embodiment of this application is shown. As shown in FIG22, the encoder 2000 may include a second determining part 2001 and an encoding part 2002; wherein,

[0547] The second determining part 2001 is configured to: determine the intra-prediction mode parameters of the current block; use the intra-prediction mode parameters to determine the candidate transform parameters of the current block; perform encoding decisions on the residual values ​​of the current block corresponding to the candidate transform parameters to determine the transform parameters of the current block; and determine the first syntax element information based on the transform parameters of the current block.

[0548] The encoding section 2002 is configured to encode the first syntax element information and write the resulting encoded bits into the code stream; wherein the first syntax element information is used to indicate the method of determining the transformation parameters.

[0549] In some embodiments, the second determining portion 2001 is further configured to determine a first predicted value and / or a second predicted value of the current block based on the intra-frame prediction mode parameters; and to determine the candidate transform parameters using the first predicted value or the second predicted value.

[0550] In some embodiments, the first syntax element information is used to indicate the predicted value type corresponding to the current block; the second determining part 2001 is further configured to determine the candidate transformation parameters based on the predicted value type corresponding to the current block, using the first predicted value or the second predicted value.

[0551] In some embodiments, the candidate transformation parameters include a first transformation set and a second transformation set; the second determining part 2001 is further configured to, when the predicted value type is a first type, determine the first transformation set of the current block based on the gradient statistics corresponding to some or all of the predicted values ​​in the first predicted value; and when the predicted value type is a second type, determine the second transformation set of the current block based on the gradient statistics corresponding to some or all of the predicted values ​​in the second predicted value.

[0552] In some embodiments, the first syntax element information is used to indicate a first type of the current block; the second determination part 2001 is further configured to determine a preset flag bit based on the first type of the current block and the intra-prediction mode parameters; and determine the candidate transform parameters based on the preset flag bit and using the first prediction value or the second prediction value.

[0553] In some embodiments, the candidate transformation parameters include a first transformation set and a second transformation set; the second determining part 2001 is further configured to, when the preset flag indicates that the transformation parameters are determined using the first predicted value, determine the first transformation set of the current block based on the gradient statistics corresponding to some or all of the predicted values ​​in the first predicted value; and when the preset flag indicates that the transformation parameters are determined using the second predicted value, determine the second transformation set of the current block based on the gradient statistics corresponding to some or all of the predicted values ​​in the second predicted value.

[0554] In some embodiments, the intra-frame prediction mode parameters include: shape parameters; the second determining portion 2001 is further configured to, when the shape parameters indicate that the current block is a square block, set the value of the preset flag bit to a value of the first type, the preset flag bit indicating that the transformation parameters are determined using the first prediction value; or, when the shape parameters indicate that the current block is a non-square block, set the value of the preset flag bit to a logical NOT value of the first type, the preset flag bit indicating that the transformation parameters are determined using the second prediction value.

[0555] In some embodiments, the intra-frame prediction mode parameters include: a size parameter; the second determining portion 2001 is further configured to, when the size range of the current block indicated by the size parameter does not belong to a preset size range, set the value of the preset flag bit to a value of the first type, the preset flag bit indicating that the transformation parameter is determined using the first prediction value; or, when the size range of the current block indicated by the size parameter belongs to the preset size range, set the value of the preset flag bit to a logical NOT value of the first type, the preset flag bit indicating that the transformation parameter is determined using the second prediction value.

[0556] In some embodiments, the intra-frame prediction mode parameters include: shape parameters and size parameters; the second determining portion 2001 is further configured to, when the shape parameter indicates that the current block is a square block and the size range of the current block indicated by the size parameter does not belong to a preset size range, set the value of the preset flag bit to a value of the first type, the preset flag bit indicating that the transformation parameters are determined using the first prediction value; or, when the shape parameter indicates that the current block is a non-square block and the size range of the current block indicated by the size parameter belongs to the preset size range, set the value of the preset flag bit to a logical NOT value of the first type, the preset flag bit indicating that the transformation parameters are determined using the second prediction value.

[0557] In some embodiments, the first syntax element information is used to indicate the index identifier of the transform parameter corresponding to the current block; the second determining part 2001 is further configured to determine the candidate transform set corresponding to the current block based on the first predicted value and / or the second predicted value; the candidate transform set is the candidate transform parameter.

[0558] In some embodiments, the second determining portion 2001 is further configured to: determine a first type of transform set based on the gradient statistics corresponding to the first predicted value or the second predicted value; the first type of transform set includes: a first transform set and a second transform set; determine a second type of transform set based on the highest N gradient statistics corresponding to the first predicted value or the second predicted value; the second type of transform set includes: N-1 third transform sets and / or N-1 fourth transform sets; the N-1 third transform sets are transform sets corresponding to gradient statistics other than the highest gradient statistics corresponding to the first predicted value; the N-1 fourth transform sets are transform sets corresponding to gradient statistics other than the highest gradient statistics corresponding to the second predicted value; N is a positive integer greater than 1; determine a third type of transform set based on the gradient statistics corresponding to the reconstructed neighboring pixels of the current block; determine a fourth type of transform set based on a preset prediction mode corresponding to the current block; wherein the preset prediction mode includes: a planar mode; the candidate transform set includes at least one of the first type of transform set, the second type of transform set, the third type of transform set, and the fourth type of transform set.

[0559] In some embodiments, the second determining part 2001 is further configured to determine a preset traversal order; according to the preset traversal order, traverse at least one type of transformation set in the first type of transformation set, the second type of transformation set, the third type of transformation set and the fourth type of transformation set in sequence until a preset number of different transformation sets are found, thereby obtaining the candidate transformation set; wherein, the preset number is at least two.

[0560] In some embodiments, when the candidate transform set includes at least two different transform sets, if the first transform set in the preset traversal order is a first transform set, then the second transform set in the preset traversal order is a third transform set; or, if the first transform set in the preset traversal order is a second transform set, then the second transform set in the preset traversal order is a fourth transform set; or, if the first transform set in the preset traversal order is a first type of transform set, then the second transform set in the preset traversal order is any transform set in the second type of transform set that is different from the first transform set.

[0561] In some embodiments, the second type of transformation set in the preset traversal order includes: a third transformation set and / or a fourth transformation set.

[0562] In some embodiments, the preset traversal order includes any one of the following: the first type of transformation set, the second type of transformation set, the third type of transformation set, and the fourth type of transformation set; the first type of transformation set, the third type of transformation set, the second type of transformation set, and the fourth type of transformation set; the first type of transformation set, the second type of transformation set, the first type of transformation set, the third type of transformation set, and the fourth type of transformation set; the first type of transformation set, the third type of transformation set, the first type of transformation set, the second type of transformation set, and the fourth type of transformation set; the first type of transformation set, the fourth type of transformation set, and the third type of transformation set. Transform set and second type of transform set; first type of transform set, fourth type of transform set, second type of transform set and third type of transform set; fourth type of transform set, first type of transform set, second type of transform set and third type of transform set; fourth type of transform set, first type of transform set, third type of transform set and second type of transform set; fourth type of transform set, first type of transform set, second type of transform set, first type of transform set and third type of transform set; fourth type of transform set, first type of transform set, third type of transform set, first type of transform set and second type of transform set.

[0563] In some embodiments, the second determining portion 2001 is further configured to determine the value of the second syntax element information according to the preset traversal order.

[0564] In some embodiments, the encoding portion 2002 is further configured to encode the first syntax element information and write the resulting encoded bits into the bitstream.

[0565] In some embodiments, the candidate transform set includes at least: a first type of transform set, a second type of transform set, and a third type of transform set; the second determining portion 2001 is further configured to: when the highest gradient statistics and the second highest gradient statistics corresponding to the first predicted value are less than a preset threshold, and / or when the highest gradient statistics and the second highest gradient statistics corresponding to the second predicted value are less than the preset threshold, the second type of transform set in the preset traversal order takes precedence over the third type of transform set; or, when the highest gradient statistics and the second highest gradient statistics corresponding to the first predicted value are greater than or equal to the preset threshold, and / or when the highest gradient statistics and the second highest gradient statistics corresponding to the second predicted value are greater than or equal to the preset threshold, the third type of transform set in the preset traversal order takes precedence over the second type of transform set; or, the first type of transform set in the preset traversal order takes precedence over the second type of transform set and the third type of transform set.

[0566] In some embodiments, the preset prediction mode includes: Planar mode.

[0567] In some embodiments, the encoding portion 2002 is further configured to encode the first syntax element information using an equal probability encoding method or an unequal probability encoding method.

[0568] In some embodiments, the unequal probability encoding method has a higher priority than the equal probability encoding method.

[0569] In some embodiments, the second determining portion 2001 is further configured to determine the value of the third syntax element information.

[0570] In some embodiments, the encoding portion 2002 is further configured to encode the third syntax element information and write the resulting encoded bits into the bitstream.

[0571] In some embodiments, the second determining portion 2001 is further configured to set the value of the third syntax element information to a first value when the current block uses transform set derivation; or to set the value of the third syntax element information to a second value when the current block does not use transform set derivation.

[0572] In some embodiments, the third syntax element information is carried in any one of the sequence parameter set SPS, image parameter set PPS, slice parameter set APS, image header PH, and slice header SH.

[0573] In some embodiments, the second predicted value is obtained by filtering the first predicted value; the second determining part 2001 is further configured to, if the prediction mode of the current block belongs to a preset prediction mode, then, upon determining the first predicted value of the current block, perform filtering on the first predicted value to obtain the second predicted value. The filtering process includes upsampling or downsampling.

[0574] In some embodiments, the filtering process includes upsampling and / or downsampling.

[0575] In some embodiments, the preset prediction mode includes one or more of the following: SGPM mode, EIP mode, IntraTMP mode, IBC mode, DIMD mode, TIMD mode, and MIP mode.

[0576] In some embodiments, the second determining portion 2001 is further configured to perform transformation processing on the transformation coefficients of the current block based on the transformation parameters to determine the target residual value of the current block; and to determine the reconstruction value of the current block based on the target residual value and the first predicted value of the current block.

[0577] Understandably, in this embodiment, "part" can refer to a portion of circuitry, a portion of processor, a portion of program or software, etc., and can also be a module or a non-modular component. Furthermore, the components in this embodiment can be integrated into a single processing unit, or each unit can exist physically separately, or two or more units can be integrated into a single unit. The integrated unit can be implemented in hardware or as a software functional module.

[0578] If the integrated unit is implemented as a software functional module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, this embodiment provides a computer-readable storage medium applied to an encoder 2000, which stores a computer program that, when executed by a second processor, implements the method described in any of the foregoing embodiments.

[0579] Based on the composition of the encoder 2000 described above and the computer-readable storage medium, refer to Figure 23, which shows a schematic diagram of the specific hardware structure of the encoder 2000 provided in this embodiment of the application. As shown in Figure 23, the encoder 2000 may include: a second communication interface 2101, a second memory 2102, and a second processor 2103; the various components are coupled together through a second bus system 2104. It is understood that the second bus system 2104 is used to realize the connection and communication between these components. In addition to a data bus, the second bus system 2104 also includes a power bus, a control bus, and a status signal bus. However, for clarity, all buses are labeled as the second bus system 2104 in Figure 23.

[0580] The second communication interface 2101 is used for receiving and sending signals during the process of sending and receiving information with other external network elements;

[0581] The second memory 2102 is used to store computer programs that can run on the second processor 2103;

[0582] The second processor 2103 is configured to, when running the computer program, perform:

[0583] Determine the intra-prediction mode parameters for the current block;

[0584] The candidate transform parameters for the current block are determined using the intra-frame prediction mode parameters.

[0585] Encode the residual values ​​of the current block corresponding to the candidate transformation parameters to determine the transformation parameters of the current block;

[0586] Based on the transformation parameters of the current block, the first syntax element information is determined, and the first syntax element information is encoded. The resulting encoded bits are written into the bitstream. The first syntax element information is used to indicate the method of determining the transformation parameters.

[0587] Alternatively, as another embodiment, the second processor 2103 is also configured to perform the method described in any of the foregoing embodiments when running the computer program.

[0588] It is understood that the second memory 2102 has similar hardware functions to the first memory 1102, and the second processor 2103 has similar hardware functions to the first processor 1103; details will not be elaborated here.

[0589] In another embodiment of this application, referring to FIG24, a schematic diagram of the composition structure of an encoding / decoding system provided in an embodiment of this application is shown. As shown in FIG24, the encoding / decoding system 3000 may include a decoder 3001 and an encoder 3002.

[0590] In this embodiment, decoder 3001 may be any of the decoders described in the foregoing embodiments, and encoder 3002 may be any of the encoders described in the foregoing embodiments.

[0591] It should be noted that, in this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0592] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

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

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

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

[0596] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of protection of the described embodiments of this application. Industrial applicability

[0597] In this embodiment, the intra-prediction mode parameters and the first syntax element information of the current block are determined by decoding the bitstream. The first syntax element information indicates the method for determining the transform parameters. Based on the first syntax element information, the intra-prediction mode parameters are used to determine the transform parameters of the current block. The first syntax element information indicates the method for determining the transform parameters, meaning the decoder can more accurately select transform parameters suitable for the characteristics of the current block. Thus, the use of the first syntax element information makes the selection of the transform set more flexible. By improving the accuracy and flexibility of the transform parameters, accurate selection can reduce errors and distortion during decoding, while flexible selection can better adapt to different types of image or video content, thereby improving encoding and decoding performance.

Claims

1. A decoding method applied to a decoder, the method comprising: Decode the bitstream to determine the intra-prediction mode parameters of the current block and the first syntax element information of the current block; wherein, the first syntax element information is used to indicate the method of determining the transform parameters; Based on the first syntax element information, the transformation parameters of the current block are determined using the intra-frame prediction mode parameters.

2. The method according to claim 1, wherein, The step of determining the transform parameters of the current block based on the first syntax element information and the intra-prediction mode parameters includes: Based on the intra-frame prediction mode parameters, determine the first prediction value and / or the second prediction value of the current block; Based on the first syntax element information, the transformation parameters are determined using either the first predicted value or the second predicted value.

3. The method according to claim 2, wherein, The first syntax element information is used to indicate the predicted value type corresponding to the current block; The step of determining the transformation parameters based on the first grammar element information and using the first predicted value or the second predicted value includes: Based on the predicted value type indicated by the first syntax element information, the transformation parameters are determined using either the first predicted value or the second predicted value.

4. The method according to claim 3, wherein, The transformation parameters include a first transformation set or a second transformation set; determining the transformation parameters by using the first predicted value or the second predicted value according to the predicted value type indicated by the first syntax element information includes: If the first syntax element information indicates that the predicted value type is a first type, then the first transformation set of the current block is determined based on the gradient statistics corresponding to some or all of the predicted values ​​in the first predicted values; or, When the first syntax element information indicates that the predicted value type is the second type, the second transformation set of the current block is determined based on the gradient statistics corresponding to some or all of the predicted values ​​in the second predicted value.

5. The method according to claim 2, wherein, The first syntax element information is used to indicate the first type of the current block; The step of determining the transform parameters of the current block based on the first syntax element information and the intra-prediction mode parameters includes: Based on the first type indicated by the first syntax element information and the intra-frame prediction mode parameters, a preset flag is determined; The transformation parameters are determined based on the preset flag bit and using either the first predicted value or the second predicted value.

6. The method according to claim 5, wherein, The step of determining the transformation parameters based on the preset flag bit and using the first predicted value or the second predicted value includes: When the preset flag indicates that the transformation parameters are determined using the first predicted value, the first transformation set of the current block is determined based on the gradient statistics corresponding to some or all of the predicted values ​​in the first predicted value; or, When the preset flag indicates that the transformation parameters are determined using the second predicted value, the second transformation set of the current block is determined based on the gradient statistics corresponding to some or all of the predicted values ​​in the second predicted value.

7. The method according to claim 5 or 6, wherein, The intra-frame prediction mode parameters include: shape parameters; determining the preset flag bit based on the first type indicated by the first syntax element information and the intra-frame prediction mode parameters includes: When the shape parameter indicates that the current block is a square block, the value of the preset flag is set to the value of the first type indicated by the first syntax element information, and the preset flag indicates that the transformation parameter is determined using the first predicted value; or... When the shape parameter indicates that the current block is a non-square block, the value of the preset flag is set to the logical NOT value of the first type indicated by the first syntax element information, and the preset flag indicates that the transformation parameter is determined using the second prediction value.

8. The method according to claim 5 or 6, wherein, The intra-frame prediction mode parameters include: size parameters; determining the preset flag bit based on the first type indicated by the first syntax element information and the intra-frame prediction mode parameters includes: If the size range of the current block indicated by the size parameter does not belong to a preset size range, the value of the preset flag bit is set to a value of the first type indicated by the first syntax element information, and the preset flag bit indicates that the transformation parameter is determined using the first predicted value; or... If the size range of the current block indicated by the size parameter belongs to the preset size range, the value of the preset flag bit is set to the logical NOT value of the first type of the first syntax element information, and the preset flag bit indicates that the transformation parameter is determined using the second prediction value.

9. The method according to claim 5 or 6, wherein, The intra-frame prediction mode parameters include: shape parameters and size parameters; determining the preset flag bit based on the first type indicated by the first syntax element information and the intra-frame prediction mode parameters includes: If the shape parameter indicates that the current block is a square block, and the size parameter indicates that the size range of the current block does not belong to a preset size range, then the value of the preset flag is set to the value of the first type indicated by the first syntax element information. A preset flag indicates that the transformation parameters are determined using the first predicted value; or... When the shape parameter indicates that the current block is a non-square block, and the size parameter indicates that the size range of the current block belongs to the preset size range, the value of the preset flag is set to the logical NOT value of the first type indicated by the first syntax element information, and the preset flag indicates that the transformation parameter is determined using the second prediction value.

10. The method according to claim 2, wherein, The first syntax element information is used to indicate the index identifier of the transformation parameter corresponding to the current block; the method further includes: Based on the first predicted value and / or the second predicted value, determine the candidate transformation set corresponding to the current block; The transformation parameters are determined in the candidate transformation set based on the index identifier indicated by the first syntax element information.

11. The method according to claim 10, wherein, The step of determining the candidate transformation set corresponding to the current block based on the first predicted value and / or the second predicted value includes at least one of the following: The first type of transformation set is determined based on the gradient statistics corresponding to the first or second predicted value; The first type of transform set includes: a first transform set and a second transform set; Based on the highest N gradient statistics corresponding to the first or second predicted value, a second type of transformation set is determined; the second type of transformation set includes: N-1 third transformation sets and / or N-1 fourth transformation sets; the N-1 third transformation sets are transformation sets corresponding to gradient statistics other than the highest gradient statistics corresponding to the first predicted value; the N-1 fourth transformation sets are transformation sets corresponding to gradient statistics other than the highest gradient statistics corresponding to the second predicted value; N is a positive integer greater than 1; The third type of transform set is determined based on the gradient statistics of the reconstructed neighboring pixels of the current block; The fourth type of transformation set is determined based on the preset prediction mode corresponding to the current block; The candidate transform set includes at least one of the first type of transform set, the second type of transform set, the third type of transform set, and the fourth type of transform set.

12. The method according to claim 10 or 11, wherein, The method further includes: Determine the preset traversal order; According to a preset traversal order, at least one type of transformation set in the first type of transformation set, the second type of transformation set, the third type of transformation set, and the fourth type of transformation set is traversed sequentially until a preset number of different transformation sets are found, thereby obtaining the candidate transformation set; wherein, the preset number is at least two.

13. The method according to claim 12, wherein, If the candidate transform set includes at least two different transform sets, and the first transform set in the preset traversal order is the first transform set, then the second transform set in the preset traversal order is the third transform set; or, If the first transformation set in the preset traversal order is the second transformation set, then the second transformation set in the preset traversal order is the fourth transformation set; or, If the first transformation set in the preset traversal order is the first type of transformation set, then the second transformation set in the preset traversal order is any transformation set in the second type of transformation set that is different from the first transformation set.

14. The method according to claim 12, wherein, The second type of transformation set in the preset traversal order includes: the third transformation set and / or the fourth transformation set.

15. The method according to claim 12, wherein, The preset traversal order includes any of the following: The first type of transform set, the second type of transform set, the third type of transform set, and the fourth type of transform set; The first type of transform set, the third type of transform set, the second type of transform set, and the fourth type of transform set; The first type of transform set, the second type of transform set, the third type of transform set, and the fourth type of transform set; The first type of transform set, the third type of transform set, the first type of transform set, the second type of transform set, and the fourth type of transform set; The first type of transform set, the fourth type of transform set, the third type of transform set, and the second type of transform set; The first type of transform set, the fourth type of transform set, the second type of transform set, and the third type of transform set; The fourth type of transform set, the first type of transform set, the second type of transform set, and the third type of transform set; The fourth type of transform set, the first type of transform set, the third type of transform set, and the second type of transform set; The fourth type of transform set, the first type of transform set, the second type of transform set, the first type of transform set, and the third type of transform set; The fourth type of transform set, the first type of transform set, the third type of transform set, the first type of transform set, and the second type of transform set.

16. The method according to any one of claims 12 to 15, wherein, Determining the preset traversal order includes: Decode the bitstream to determine the information of the second syntax element; The preset traversal order is determined based on the value of the second syntax element information.

17. The method according to claim 12, wherein, The candidate transform set includes at least: a first type of transform set, a second type of transform set, and a third type of transform set; the method further includes: If the difference between the highest and second-highest gradient statistics corresponding to the first predicted value is less than a preset threshold, and / or if the difference between the highest and second-highest gradient statistics corresponding to the second predicted value is less than the preset threshold, the second type of transformation set in the preset traversal order takes precedence over the third type of transformation set; or... If the difference between the highest and second-highest gradient statistics corresponding to the first predicted value is greater than or equal to a preset threshold, and / or the difference between the highest and second-highest gradient statistics corresponding to the second predicted value is greater than or equal to the preset threshold, the third type of transformation set in the preset traversal order takes precedence over the second type of transformation set; or... In the preset traversal order, the first type of transformation set takes precedence over the second type of transformation set and the third type of transformation set.

18. The method according to any one of claims 11 to 17, wherein, The preset prediction modes include: Planar mode.

19. The method according to any one of claims 1 to 18, wherein, The method further includes: The first syntax element information is decoded using either equal probability decoding or unequal probability decoding.

20. The method according to claim 19, wherein, The unequal probability decoding method has a higher priority than the equal probability decoding method.

21. The method according to any one of claims 1 to 20, wherein, The method further includes: Decode the bitstream to determine the third syntax element information; If the third syntax element information indicates that the current block uses transform set derivation, the steps of executing the decoded bitstream to determine the intra-frame prediction mode parameters of the current block and the first syntax element information of the current block are performed; or, If the third syntax element information indicates that the current block does not use transform set derivation, the decoding bitstream is not executed, and the steps of determining the intra-prediction mode parameters of the current block and the first syntax element information of the current block are not performed.

22. The method according to claim 21, wherein, The method further includes: If the value of the third syntax element information is the first value, then it is determined that the current block uses transform set derivation; or, If the value of the third syntax element information is the second value, then it is determined that the current block does not use transform set derivation.

23. The method according to claim 21 or 22, wherein, The third syntax element information is carried in any one of the sequence parameter set SPS, image parameter set PPS, slice parameter set APS, image header PH, and slice header SH.

24. The method according to claim 2 or 10, wherein, The method further includes: If the prediction mode of the current block belongs to the preset prediction mode, then, given the first prediction value of the current block, the first prediction value is filtered to obtain the second prediction value.

25. The method according to claim 24, wherein, The filtering process includes upsampling and / or downsampling.

26. The method according to claim 2, wherein, The preset prediction modes include one or more of the following: SGPM mode, EIP mode, IntraTMP mode, IBC mode, DIMD mode, TIMD mode, and MIP.

27. The method according to any one of claims 1 to 26, wherein, The method further includes: Based on the transformation parameters, the transformation coefficients of the current block are transformed to determine the target residual value of the current block; The reconstruction value of the current block is determined based on the target residual value and the first predicted value of the current block.

28. An encoding method applied to an encoder, the method comprising: Determine the intra-prediction mode parameters for the current block; The candidate transform parameters for the current block are determined using the intra-frame prediction mode parameters. Encode the residual values ​​of the current block corresponding to the candidate transformation parameters to determine the transformation parameters of the current block; Based on the transformation parameters of the current block, the first syntax element information is determined, and the first syntax element information is encoded. The resulting encoded bits are written into the bitstream. The first syntax element information is used to indicate the method of determining the transformation parameters.

29. The method according to claim 28, wherein, The step of determining the candidate transform parameters for the current block using the intra-frame prediction mode parameters includes: Based on the intra-frame prediction mode parameters, determine the first prediction value and / or the second prediction value of the current block; The candidate transformation parameters are determined using either the first predicted value or the second predicted value.

30. The method according to claim 29, wherein, The first syntax element information is used to indicate the predicted value type corresponding to the current block; The step of determining the candidate transformation parameters using the first predicted value or the second predicted value includes: Based on the predicted value type corresponding to the current block, the candidate transformation parameters are determined using either the first or the second predicted value.

31. The method according to claim 30, wherein, The candidate transformation parameters include a first transformation set and a second transformation set; determining the candidate transformation parameters based on the prediction value type corresponding to the current block, using either the first or second prediction value, includes: When the predicted value type is the first type, the first transformation set of the current block is determined based on the gradient statistics corresponding to some or all of the predicted values ​​in the first predicted value. When the predicted value type is the second type, the gradient statistics are based on some or all of the predicted values ​​in the second predicted value. The value is calculated to determine the second transformation set of the current block.

32. The method according to claim 29, wherein, The first syntax element information is used to indicate the first type of the current block; The step of determining the candidate transformation parameters using the first predicted value or the second predicted value includes: Determine a preset flag bit based on the first type of the current block and the intra-frame prediction mode parameters; Based on the preset flag, the candidate transformation parameters are determined using either the first predicted value or the second predicted value.

33. The method according to claim 32, wherein, The candidate transformation parameters include a first transformation set and a second transformation set; determining the candidate transformation parameters based on the preset flag bit and using the first predicted value or the second predicted value includes: When the preset flag indicates that the transformation parameters are determined using the first predicted value, the first transformation set of the current block is determined based on the gradient statistics corresponding to some or all of the predicted values ​​in the first predicted value. When the preset flag indicates that the transformation parameters are determined using the second predicted value, the second transformation set of the current block is determined based on the gradient statistics corresponding to some or all of the predicted values ​​in the second predicted value.

34. The method according to claim 32 or 33, wherein, The intra-frame prediction mode parameters include: shape parameters; determining the preset flag bit based on the first type of the current block and the intra-frame prediction mode parameters includes: If the shape parameter indicates that the current block is a square block, the value of the preset flag is set to a value of the first type, and the preset flag indicates that the candidate transformation parameter is determined using the first predicted value; or... When the shape parameter indicates that the current block is a non-square block, the value of the preset flag bit is set to the logical NOT value of the first type, and the preset flag bit indicates that the candidate transformation parameter is determined using the second prediction value.

35. The method according to claim 32 or 33, wherein, The intra-frame prediction mode parameters include: size parameters; determining the preset flag bit based on the first type of the current block and the intra-frame prediction mode parameters includes: If the size range of the current block indicated by the size parameter does not belong to a preset size range, the value of the preset flag bit is set to a value of the first type, and the preset flag bit indicates that the candidate transformation parameter is determined using the first predicted value; or... If the size range of the current block indicated by the size parameter belongs to the preset size range, the value of the preset flag bit is set to the logical NOT value of the first type, and the preset flag bit indicates that the candidate transformation parameter is determined using the second prediction value.

36. The method according to claim 32 or 33, wherein, The intra-frame prediction mode parameters include: shape parameters and size parameters; determining the preset flag bit based on the first type of the current block and the intra-frame prediction mode parameters includes: If the shape parameter indicates that the current block is a square block, and the size parameter indicates that the size range of the current block does not belong to a preset size range, then the value of the preset flag bit is set to a value of the first type, and the preset flag bit indicates that the candidate transformation parameter is determined using the first predicted value; or... When the shape parameter indicates that the current block is a non-square block, and the size parameter indicates that the size range of the current block belongs to the preset size range, the value of the preset flag bit is set to the logical NOT value of the first type, and the preset flag bit indicates that the candidate transformation parameter is determined using the second prediction value.

37. The method according to claim 29, wherein, The first syntax element information is used to indicate the index identifier of the transformation parameter corresponding to the current block; the method further includes: Based on the first predicted value and / or the second predicted value, a candidate transformation set corresponding to the current block is determined; the candidate transformation set is the candidate transformation parameters.

38. The method according to claim 37, wherein, The step of determining the candidate transformation set corresponding to the current block based on the first predicted value and / or the second predicted value includes at least one of the following: The first type of transformation set is determined based on the gradient statistics corresponding to the first or second predicted value; The first type of transform set includes: a first transform set and a second transform set; Based on the highest N gradient statistics corresponding to the first or second predicted value, a second type of transformation set is determined; the second type of transformation set includes: N-1 third transformation sets and / or N-1 fourth transformation sets; the N-1 third transformation sets are transformation sets corresponding to gradient statistics other than the highest gradient statistics corresponding to the first predicted value; the N-1 fourth transformation sets are transformation sets corresponding to gradient statistics other than the highest gradient statistics corresponding to the second predicted value; N is a positive integer greater than 1; The third type of transform set is determined based on the gradient statistics of the reconstructed neighboring pixels of the current block; The fourth type of transformation set is determined based on the preset prediction mode corresponding to the current block; The candidate transform set includes at least one of the first type of transform set, the second type of transform set, the third type of transform set, and the fourth type of transform set.

39. The method according to claim 37 or 38, wherein, The method further includes: Determine the preset traversal order; According to a preset traversal order, at least one type of transformation set in the first type of transformation set, the second type of transformation set, the third type of transformation set, and the fourth type of transformation set is traversed sequentially until a preset number of different transformation sets are found, thereby obtaining the candidate transformation set; wherein, the preset number is at least two.

40. The method according to claim 39, wherein, If the candidate transform set includes at least two different transform sets, and the first transform set in the preset traversal order is the first transform set, then the second transform set in the preset traversal order is the third transform set; or, If the first transformation set in the preset traversal order is the second transformation set, then the second transformation set in the preset traversal order is the fourth transformation set; or, If the first transformation set in the preset traversal order is the first type of transformation set, then the second transformation set in the preset traversal order is any transformation set in the second type of transformation set that is different from the first transformation set.

41. The method according to claim 39, wherein, The second type of transformation set in the preset traversal order includes: the third transformation set and / or the fourth transformation set.

42. The method according to claim 39, wherein, The preset traversal order includes any of the following: The first type of transform set, the second type of transform set, the third type of transform set, and the fourth type of transform set; The first type of transform set, the third type of transform set, the second type of transform set, and the fourth type of transform set; The first type of transform set, the second type of transform set, the third type of transform set, and the fourth type of transform set; The first type of transform set, the third type of transform set, the first type of transform set, the second type of transform set, and the fourth type of transform set; The first type of transform set, the fourth type of transform set, the third type of transform set, and the second type of transform set; The first type of transform set, the fourth type of transform set, the second type of transform set, and the third type of transform set; The fourth type of transform set, the first type of transform set, the second type of transform set, and the third type of transform set; The fourth type of transform set, the first type of transform set, the third type of transform set, and the second type of transform set; The fourth type of transform set, the first type of transform set, the second type of transform set, the first type of transform set, and the third type of transform set; The fourth type of transform set, the first type of transform set, the third type of transform set, the first type of transform set, and the second type of transform set.

43. The method according to any one of claims 39 to 42, wherein, The method further includes: The value of the second syntax element information is determined according to the preset traversal order; The first syntax element information is encoded, and the resulting encoded bits are written into the bitstream.

44. The method according to claim 39, wherein, The candidate transform set includes at least: a first type of transform set, a second type of transform set, and a third type of transform set; the method further includes: If the highest and second-highest gradient statistics corresponding to the first predicted value are less than a preset threshold, and / or if the highest and second-highest gradient statistics corresponding to the second predicted value are less than the preset threshold, the second type of transformation set in the preset traversal order takes precedence over the third type of transformation set; or... If the highest and second-highest gradient statistics corresponding to the first predicted value are greater than or equal to a preset threshold, and / or the highest and second-highest gradient statistics corresponding to the second predicted value are greater than or equal to the preset threshold, the third type of transform set in the preset traversal order takes precedence over the second type of transform set; or... In the preset traversal order, the first type of transformation set takes precedence over the second type of transformation set and the third type of transformation set.

45. The method according to any one of claims 39 to 44, wherein, The preset prediction modes include: Planar mode.

46. ​​The method according to any one of claims 28 to 45, wherein, The method further includes: The first syntax element information is encoded using either equal probability encoding or unequal probability encoding.

47. The method according to claim 46, wherein, The unequal probability encoding method has a higher priority than the equal probability encoding method.

48. The method according to any one of claims 28 to 47, wherein, The method further includes: Determine the value of the third syntax element information; The information of the third syntax element is encoded, and the resulting encoded bits are written into the bitstream; Determining the value of the third syntax element information includes: When the current block is derived using a transform set, the value of the third syntax element information is set to the first value; or, If the current block does not use transform set derivation, the value of the third syntax element information is set to the second value.

49. The method according to claim 48, wherein, The third syntax element information is carried in any one of the sequence parameter set SPS, image parameter set PPS, slice parameter set APS, image header PH, and slice header SH.

50. The method according to claim 29 or 37, wherein, The method further includes: If the prediction mode of the current block belongs to the preset prediction mode, then, given the first prediction value of the current block, the first prediction value is filtered to obtain the second prediction value.

51. The method according to claim 29 or 37, wherein, The filtering process includes upsampling and / or downsampling.

52. The method according to claim 51, wherein, The preset prediction modes include one or more of the following: SGPM mode, EIP mode, IntraTMP mode, IBC mode, DIMD mode, TIMD mode, and MIP mode.

53. The method according to any one of claims 28 to 52, wherein, The method further includes: Based on the transformation parameters, the transformation coefficients of the current block are transformed to determine the target residual value of the current block; The reconstruction value of the current block is determined based on the target residual value and the first predicted value of the current block.

54. The method according to any one of claims 37 to 53, wherein, The method further includes: If the number of transform sets in the candidate transform set is 1, then it is determined that the first syntax element information will not be encoded; or, If all transformation sets in the candidate transform set are the same, it is determined that the first syntax element information will not be encoded.

55. A bitstream, said bitstream being generated by bit encoding based on information to be encoded; wherein, The information to be encoded includes at least one of the following: The information comprises a first syntax element, a second syntax element, a third syntax element, and intra-prediction mode parameters; the first syntax element indicates how the transform parameters of the current block are determined; the second syntax element indicates the preset traversal order of the current block; and the third syntax element indicates whether the current block uses transform set derivation.

56. A decoder, the decoder comprising: The decoding part and the first determining part; wherein, The decoding section is configured to decode the bitstream, determine the intra-frame prediction mode parameters of the current block and the first syntax element information of the current block; wherein, the first syntax element information is used to indicate the method of determining the transform parameters; The first determining part is configured to determine the transform parameters of the current block based on the first syntax element information and the intra-prediction mode parameters.

57. An encoder, the encoder comprising: The second determining part and the coding part; wherein, The second determining part is configured to: determine the intra-prediction mode parameters of the current block; use the intra-prediction mode parameters to determine the candidate transform parameters of the current block; perform encoding decisions on the residual values ​​of the current block corresponding to the candidate transform parameters to determine the transform parameters of the current block; and determine the first syntax element information based on the transform parameters of the current block. The encoding part is configured to encode the first syntax element information and write the resulting encoded bits into the code stream; wherein the first syntax element information is used to indicate the method of determining the transformation parameters.

58. A decoder, the decoder comprising a first memory and a first processor, wherein: The first memory is configured to store computer programs that can run on the first processor; The first processor is configured to perform the method as described in any one of claims 1 to 27 when running the computer program.

59. An encoder, the encoder comprising a second memory and a second processor, wherein: The second memory is configured to store computer programs that can run on the second processor; The second processor is configured to perform the method as described in any one of claims 28 to 54 when running the computer program.

60. A computer-readable storage medium, wherein, The computer-readable storage medium stores a computer program that, when executed by a first processor, implements the method as described in any one of claims 1 to 27, or when executed by a second processor, implements the method as described in any one of claims 28 to 54.

Citation Information

Patent Citations

  • Method and apparatus for video coding

    CN113615182A

  • Intra-frame coding method, intra-frame decoding method and device

    CN116980623A

  • Multiple transform selection-based image coding method and device therefor

    WO2020050651A1

  • Video encoding and decoding method, encoder, decoder and storage medium

    WO2023197195A1

  • Decoding method, encoding method, decoder, and encoder

    WO2024007116A1