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

By adopting the multi-transform kernel group selection technology in the video coding standard, the problem of incomplete weighted calculation of intra-frame prediction mode in the existing technology is solved, and the compression efficiency and performance of codec are improved.

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

Patent Information

Application Number
PCT/CN2024/084081
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-03-27
Publication Date
2025-10-02

AI Technical Summary

Technical Problem

Existing video coding standards fail to fully consider the weighted calculation of multiple intra-frame prediction modes when processing complex intra-frame prediction modes, resulting in low compression efficiency.

Method used

The multi-transform core group selection technology is adopted to improve the accuracy of transform prediction by determining the transform core group index and transform core of the current block, including determining the transform core group and transform core at the encoding end and the decoding end respectively, and performing transform and transform coefficient processing.

Benefits of technology

The compression efficiency of video codec is improved, and the codec performance is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024084081_02102025_PF_FP_ABST
    Figure CN2024084081_02102025_PF_FP_ABST
Patent Text Reader

Abstract

The present application discloses an encoding method, a decoding method, a code stream, an encoder, a decoder, and a storage medium. The method comprises: determining a transform kernel set index of a current block, and determining a transform kernel set of the current block on the basis of the transform kernel set index of the current block; determining a transform kernel of the current block on the basis of the transform kernel set; and determining a transform coefficient of the current block, transforming the transform coefficient of the current block on the basis of the transform kernel, and determining a residual block of the current block. In this way, the compression efficiency can be improved, and the encoding and decoding performance is further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Coding and decoding method, code stream, encoder, decoder and storage medium Technical Field

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

[0002] As demand for video display quality increases, high-resolution video, such as HD and UHD, has emerged. However, high-resolution video typically contains more information and therefore requires more bandwidth. To reduce bandwidth requirements, video coding standards involving video compression have been introduced.

[0003] In video coding standards, each intra-frame prediction mode corresponds to a transform kernel group, so a texture feature index used to determine the transform kernel group can be derived for each block. However, for more complex intra-frame prediction modes, these modes can perform weighted calculations on the prediction values ​​of two or more intra-frame prediction modes. For blocks requiring weighted prediction values ​​from two or more intra-frame prediction modes, the current transformation process does not fully consider these factors, resulting in low compression efficiency.

[0004] Summary of the Invention

[0005] The present application provides a coding and decoding method, a code stream, an encoder, a decoder and a storage medium, which can improve compression efficiency and thus enhance coding and decoding performance.

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

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

[0008] Determine a transform core group index of the current block, and determine a transform core group of the current block according to the transform core group index of the current block;

[0009] Determine the transformation kernel of the current block according to the transformation kernel group;

[0010] A transform coefficient of the current block is determined, and the transform coefficient of the current block is transformed according to the transform kernel to determine a residual block of the current block.

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

[0012] Determine the transformation kernel group of the current block;

[0013] Determine the transformation kernel of the current block according to the transformation kernel group;

[0014] Determine a residual block of the current block, and transform the residual block of the current block according to the transformation kernel to determine a transformation coefficient of the current block;

[0015] The transform coefficients of the current block are coded and the resulting coded bits are written into the bitstream.

[0016] In a third aspect, an embodiment of the present application provides a code stream, which is generated by bit encoding based on information to be encoded; wherein the information to be encoded includes at least one of the following: a quantization coefficient of a current block, a transform kernel index of the current block, a transform kernel group index of the current block, a minimum sample threshold, a minimum size threshold, a value of a first syntax element, a value of a second syntax element, a value of a third syntax element, a value of a fourth syntax element, a value of a fifth syntax element, a value of a sixth syntax element, and a value of a seventh syntax element;

[0017] Among them, the first syntax element is used to indicate the transform kernel group index of the current block, the second syntax element is used to indicate whether the current block uses the first transform mode and the corresponding transform kernel index, the third syntax element is used to indicate whether the current sequence allows the use of multiple transform kernel group selection technology, the fourth syntax element is used to indicate whether the current image allows the use of multiple transform kernel group selection technology, the fifth syntax element is used to indicate whether the current slice allows the use of multiple transform kernel group selection technology, the sixth syntax element is used to indicate the minimum sample threshold, and the seventh syntax element is used to indicate the minimum size threshold.

[0018] In a fourth aspect, an embodiment of the present application provides an encoder, comprising a first determining unit, a first transforming unit, and an encoding unit, wherein:

[0019] A first determining unit is configured to determine a transform core group of a current block; and further configured to determine a transform core of the current block according to the transform core group;

[0020] a first transform unit configured to determine a residual block of a current block, and transform the residual block of the current block according to a transform kernel to determine a transform coefficient of the current block;

[0021] The encoding unit is configured to perform encoding processing on the transformation coefficients of the current block and write the obtained encoding bits into the bit stream.

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

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

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

[0025] In a sixth aspect, an embodiment of the present application provides a decoder, comprising a second determination unit and a second transformation unit, wherein:

[0026] a second determining unit configured to determine a transform core group index of the current block, and determine a transform core group of the current block according to the transform core group index of the current block; and further configured to determine a transform core of the current block according to the transform core group;

[0027] The second transform unit is configured to determine a transform coefficient of the current block, and transform the transform coefficient of the current block according to the transform kernel to determine a residual block of the current block.

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

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

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

[0031] In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method as described in the first aspect or the method as described in the second aspect.

[0032] In a ninth aspect, an embodiment of the present application provides a computer program product, comprising a computer program or instructions, which, when executed by a processor, implements the method described in the first aspect, or implements the method described in the second aspect.

[0033] The embodiments of the present application provide a coding and decoding method, a code stream, an encoder, a decoder, and a storage medium. At the encoding end, the transform core group of the current block is determined; based on the transform core group, the transform core of the current block is determined; the residual block of the current block is determined, and the residual block of the current block is transformed according to the transform core to determine the transform coefficient of the current block; the transform coefficient of the current block is encoded and processed, and the obtained coded bits are written into the code stream. At the decoding end, the transform core group index of the current block is determined, and the transform core group of the current block is determined according to the transform core group index of the current block; based on the transform core group, the transform core of the current block is determined; the transform coefficient of the current block is determined, and the transform coefficient of the current block is transformed according to the transform core to determine the residual block of the current block. In this way, whether it is the encoding end or the decoding end, the transform core group of the current block is first determined according to the multi-transform core group selection technology, and then the transform core of the current block is determined therefrom. That is to say, for the current block predicted using certain intra-frame prediction modes, when determining the transform kernel of the current block, multiple candidate texture features derived from the multi-transform kernel group selection technology can be used to guide the transform, thereby improving the accuracy of the transform prediction, thereby improving the compression efficiency and further improving the encoding and decoding performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] FIG1 is a flow chart diagram of a hybrid coding framework;

[0035] FIG2 is a schematic diagram of template matching of a current block;

[0036] FIG3 is a schematic diagram of a reference sample of a current block;

[0037] FIG4 is a schematic diagram of multiple reference rows of a current block;

[0038] FIG5 is a schematic diagram of multiple prediction modes corresponding to an intra-frame prediction;

[0039] FIG6 is a second schematic diagram of multiple prediction modes corresponding to an intra-frame prediction;

[0040] FIG7 is a third schematic diagram of multiple prediction modes corresponding to an intra-frame prediction;

[0041] FIG8 is a fourth schematic diagram of multiple prediction modes corresponding to an intra-frame prediction;

[0042] FIG9 is a schematic diagram of encoding of screen content;

[0043] FIG10 is a schematic diagram of a prediction process of a MIP mode;

[0044] FIG11 is a schematic diagram of a template of a current block and a template reference area;

[0045] FIG12 is a schematic diagram of a histogram of gradient and intra prediction mode;

[0046] FIG13 is a schematic diagram of weighted fusion of three intra-frame prediction modes;

[0047] FIG14 is a schematic diagram of the search range of the ITMP mode;

[0048] FIG15 is a schematic diagram of weights of various modes under a GPM mode;

[0049] FIG16A is a typical filter schematic diagram 1;

[0050] FIG16B is a second schematic diagram of a typical filter;

[0051] FIG16C is a third schematic diagram of a typical filter;

[0052] FIG17A is a schematic diagram of a reconstructed sample area for training a filter;

[0053] FIG17B is a second schematic diagram of a reconstructed sample area for training a filter;

[0054] FIG17C is a third schematic diagram of a reconstructed sample region for training a filter;

[0055] FIG18 is a schematic diagram of a DCT transformation;

[0056] FIG19 is a schematic diagram of a base image of a DCT transformation;

[0057] FIG20 is a schematic diagram of a process flow without LFNST transformation;

[0058] FIG21 is a schematic diagram of a process flow with LFNST transformation;

[0059] FIG22 is a detailed flowchart of a LFNST transformation;

[0060] FIG23 is a schematic diagram of a base image of multiple transformation kernel groups;

[0061] FIG24 is a schematic diagram of a base image of NSPT transformation;

[0062] FIG25 is a schematic diagram of a network architecture of a video codec provided in an embodiment of the present application;

[0063] FIG26 is a schematic block diagram of a system composition of an encoder provided in an embodiment of the present application;

[0064] FIG27 is a schematic block diagram of a system composition of a decoder provided in an embodiment of the present application;

[0065] FIG28 is a flowchart diagram 1 of a decoding method provided in an embodiment of the present application;

[0066] FIG29 is a second flow chart of a decoding method provided in an embodiment of the present application;

[0067] FIG30 is a third flow chart of a decoding method provided in an embodiment of the present application;

[0068] FIG31 is a fourth flow chart of a decoding method provided in an embodiment of the present application;

[0069] FIG32 is a fifth flow chart of a decoding method provided in an embodiment of the present application;

[0070] FIG33 is a flowchart diagram 1 of an encoding method provided in an embodiment of the present application;

[0071] FIG34 is a second flow chart of an encoding method provided in an embodiment of the present application;

[0072] FIG35 is a schematic diagram of the structure of an encoder provided in an embodiment of the present application;

[0073] FIG36 is a schematic diagram of a specific hardware structure of an encoder provided in an embodiment of the present application;

[0074] FIG37 is a schematic diagram of the structure of a decoder provided in an embodiment of the present application;

[0075] FIG38 is a schematic diagram of a specific hardware structure of a decoder provided in an embodiment of the present application;

[0076] Figure 39 is a schematic diagram of the composition structure of a coding and decoding system provided in an embodiment of the present application. DETAILED DESCRIPTION

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

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

[0079] In the following description, reference is made to “some embodiments”, which describes a subset of all possible embodiments, but it will be 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.

[0080] It should also be pointed out that the terms "first\second\third" involved in the embodiments of the present application are only used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.

[0081] In video images, a coding block (CB) is generally represented by a first color component, a second color component, and a third color component. These three color components are a luminance component, a blue chrominance component, and a red chrominance component. Specifically, the luminance component is typically represented by the symbol Y, the blue chrominance component is typically represented by the symbols Cb or U, and the red chrominance component is typically represented by the symbols Cr or V. Thus, video images can be represented in either the YCbCr or YUV format.

[0082] Before further explaining the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained first. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations:

[0083] H.265 / High Efficiency Video Coding (HEVC);

[0084] H.266 / Versatile Video Coding (VVC);

[0085] VVC Test Model (VTM), a reference software testing platform for VVC;

[0086] A platform that improves compression performance after VVC (Enhanced Compression Model, ECM);

[0087] Joint Video Experts Team (JVET);

[0088] Coding Unit (CU);

[0089] Coding Tree Unit (CTU);

[0090] Largest Coding Unit (LCU);

[0091] Motion Vector (MV);

[0092] Prediction Unit (PU);

[0093] Transform Unit (TU);

[0094] Fusion technology (Merge);

[0095] Skip technology (Skip);

[0096] Quantization Parameter (QP);

[0097] Merge with Motion Vector Difference (MMVD)

[0098] Motion Vector Prediction (MVP);

[0099] Temporal Motion Vector Prediction (TMVP);

[0100] Discrete Cosine Transform (DCT);

[0101] Discrete Sine Transform (DST);

[0102] Multiple Transform Selection (MTS);

[0103] Low Frequency Non-Separable Transform (LFNST);

[0104] Non-Separable Primary Transform (NSPT);

[0105] Context-based Adaptive Binary Arithmetic Coding (CABAC).

[0106] Currently, common video codec standards all adopt a block-based hybrid coding framework. Each image, sub-image, or frame in a video is divided into square maximum coding units (LCUs) or coding tree units (CTUs) of the same size (e.g., 256×256, 128×128, 64×64, etc.). Each LCU or CTU can be divided into rectangular CUs according to a set of rules. Coding units may also be divided into prediction units (PUs) and transform units (TUs). Specifically, as shown in Figure 1, the hybrid coding framework includes modules such as prediction, transform, quantization, entropy coding, inverse quantization, inverse transform, and in-loop filtering. The prediction module can include intra-frame prediction and inter-frame prediction, and inter-frame prediction can include motion estimation and motion compensation. Because adjacent samples within a video image are highly correlated, intra-frame prediction is used in video coding to eliminate spatial redundancy between adjacent samples. Furthermore, because adjacent images in a video image are highly similar, inter-image prediction is used to eliminate temporal redundancy between them, thereby improving coding efficiency.

[0107] Samples can also be called pixels, and samples have location information and values.

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

[0109] In addition, in the embodiments of the present application, the current block (CB) can be the current coding unit, the current prediction unit, or the current transform unit. Due to the need for parallel processing, the image can be divided into slices, etc. Slices in the same image can be processed in parallel, that is, there is no data dependency between them. "Frame" is a commonly used term, and it can generally be understood that a frame is an image. The frame described in the embodiments of the present application can also be replaced by an image or a slice, etc.

[0110] The following is a detailed introduction to the relevant solutions of prediction technology.

[0111] (1) Inter-frame prediction.

[0112] The Template Matching (TM) method was first used in inter-frame prediction. It exploits the correlation between adjacent samples and uses areas surrounding the current block as templates. When the current block is encoded or decoded, its left and upper sides have already been encoded and decoded according to the coding order. Of course, existing hardware decoder implementations cannot guarantee that the left and upper sides have already been decoded when decoding of the current block begins. This refers to inter-frame blocks. For example, in HEVC, the prediction process for inter-frame coded blocks does not require surrounding reconstructed samples, allowing the prediction process for inter-frame blocks to proceed in parallel. However, intra-frame coded blocks must use reconstructed samples from the left and upper sides as reference samples. Theoretically, the left and upper sides are available, which means that hardware design adjustments can be made to achieve this. In contrast, the right and lower sides are not available under the coding order of current standards such as VVC.

[0113] As shown in Figure 2, the rectangular areas to the left and above the current block are used as templates. The height of the left template portion is generally the same as the height of the current block, and the width of the upper template portion is generally the same as the width of the current block, but they can also be different. The best matching position of the template is found in the reference image to determine the motion information, or motion vector, of the current block. This process can be roughly described as starting from a starting position in a reference image (Ref0) and searching within a certain range around it. Search rules, such as the search range and search step size, can be predefined. At each position, the degree of match between the template corresponding to that position and the templates surrounding the current block is calculated. The degree of match can be measured using distortion metrics such as the sum of absolute differences (SAD), the sum of absolute transformed differences (SATD), and the mean-square error (MSE). SATD generally uses the Hadamard transform. Smaller values ​​of SAD, SATD, and MSE indicate a higher degree of match. The cost is calculated using the predicted block of the template corresponding to the position and the reconstructed blocks of the template surrounding the current block. In addition to searching at the entire sample position, a search can also be performed at sub-sample positions. The motion information of the current block is determined based on the position with the highest degree of match. By leveraging the correlation between adjacent samples, the appropriate motion information for the template may also be appropriate for the current block. Of course, the template matching method may not be applicable to all blocks. Therefore, methods can be used to determine whether the template matching method is used for the current block, such as using a control switch to indicate whether template matching is used for the current block. This template matching method is called decoder-side motion vector derivation (DMVD). Both the encoder and decoder can use the template to search to derive motion information or find better motion information based on the existing motion information. This method does not require the transmission of specific motion vectors or motion vector differences. Instead, both the encoder and decoder perform the same search rules to ensure consistent encoding and decoding. Template matching can improve compression performance, but it requires a "search" on the decoder side, which introduces a certain degree of decoding complexity.

[0114] (2) Intra-frame prediction.

[0115] It can be understood that there is a strong spatial correlation between adjacent parts or adjacent samples within the image. Intra-frame prediction is a prediction method that uses the spatial correlation between the encoded and decoded samples around the current block and the samples within the current block. For example, as shown in Figure 3, the 4×4 white filling samples are the current block, and the grid filling samples in the left column and the upper row of the current block are the reference samples of the current block. Intra-frame prediction uses these reference samples to predict the current block. These reference samples may all be available, that is, all have been encoded and decoded. Some may also be unavailable. For example, if the current block is the leftmost of the entire frame, then the reference sample on the left side of the current block is unavailable. Or when encoding and decoding the current block, the lower left part of the current block has not been encoded and decoded, then the reference sample on the lower left is also unavailable. In the case where reference samples are unavailable, available reference samples or certain values ​​or methods can be used for filling, or no filling can be performed.

[0116] The multiple reference line (MRL) intra prediction method can use more reference samples to improve coding efficiency. As shown in Figure 4, there is a schematic diagram of using four reference rows / columns.

[0117] There are multiple prediction modes for intra-frame prediction, as shown in Figure 5. Here are the nine modes for intra-frame prediction for 4×4 blocks in H.264. Among them, mode 0 (vertical mode) copies the value of the sample above the current block vertically to the current block as the prediction value, mode 1 (horizontal mode) copies the value of the reference sample on the left side horizontally to the current block as the prediction value, mode 2 (DC mode) uses the average of the eight points A to D and I to L as the prediction value for all points, and modes 3 to 8 copy the value of the reference sample to the corresponding position of the current block at a certain angle. Because some positions of the current block cannot correspond exactly to the reference sample, it may be necessary to use the weighted average of the reference samples, or the interpolated sub-samples of the reference samples.

[0118] In addition, there are modes such as PLANE and PLANAR. With technological advancements and the expansion of block sizes, the number of angular prediction modes is also increasing. For example, HEVC uses intra-frame prediction modes including PLANAR, DC, and 33 angular modes, for a total of 35 prediction modes (see Figure 6 for details). VVC uses intra-frame prediction modes including PLANAR, DC, and 65 angular modes, for a total of 67 prediction modes (see Figure 7 for details). Of course, in addition to the 67 modes mentioned above, VVC also provides wide-angle modes for rectangular blocks with a large difference between length and width. These modes, as indicated by the dashed lines in Figure 8, represent the ranges -14 to -1 and 67 to 80 degrees. These modes replace some conventional modes (see Figure 8 for details).

[0119] (3) Intra Block Copy (IBC)

[0120] IBC significantly improves the compression efficiency of screen content coding (SCC), and as a result, it has been adopted for SCC from HEVC to VVC. Screen content, unlike camera-captured content, is computer-generated. Screen content is noise-free and contains text, computer graphics, and has sharp boundaries. Screen content often contains a large amount of repetitive content, as shown in Figure 9.

[0121] In the embodiments of this application, IBC can be considered to apply the inter-frame prediction method to intra-frame prediction. Inter-frame prediction uses a reference block in a reference image, which is not the current image, to generate the prediction block for the current block. IBC, on the other hand, uses a reference block from the coded or reconstructed portion of the current image to generate the prediction block for the current block. IBC is also known as intra picture block compensation or current picture referencing (CPR).

[0122] IBC uses a block vector (BV) to represent the position difference between the current block and the reference block, similar to the MV used in inter-frame prediction. The encoder uses block matching within the search range to determine the best matching block for the current block and encodes the BV. There are various methods for encoding the BV, such as the merge mode, which is similar to inter-frame prediction and will not be discussed here.

[0123] IBC can be considered an intra-frame prediction method, or a different type of prediction method independent of intra-frame and inter-frame prediction. IBC is highly efficient for encoding screen content and can also improve compression efficiency in natural sequences captured by cameras.

[0124] (4) Matrix-based Intra Prediction (MIP)

[0125] For MIP, this is a special intra-frame prediction mode, which may also be called Matrix weighted Intra Prediction in some places.

[0126] As shown in Figure 10, to predict a block of width W and height H, the MIP requires H reconstructed samples in the column to the left of the current block and W reconstructed samples in the row above the current block as input. The MIP generates the prediction block using three steps: (a) reference sample averaging, (b) matrix vector multiplication, and (c) interpolation. Here, the core of the MIP is considered to be matrix multiplication. It can be thought of as a process that uses input samples (reference samples) to generate a prediction block using a matrix multiplication. The MIP provides a variety of matrices, and different prediction methods are reflected in different matrices. Using different matrices for the same input samples will produce different results. The reference sample averaging and interpolation processes are a compromise between performance and complexity. For larger blocks, reference sample averaging can achieve a similar downsampling effect, allowing the input to fit into a smaller matrix, while interpolation achieves an upsampling effect. This eliminates the need to provide MIP matrices for every block size; instead, matrices of one or a few specific sizes are sufficient. As the demand for compression performance increases and hardware capabilities improve, more complex MIPs may appear in the next generation of standards.

[0127] MIP is somewhat similar to PLANAR, but it is obviously more complex and more flexible than PLANAR.

[0128] (5) Template-based Intra Mode Derivation (TIMD).

[0129] As shown in Figure 11, for the current block, an area to the left and above it is used as a template. Except for edge cases, when encoding and decoding the current block, theoretically, reconstructed values ​​can be obtained for the left and above areas of the current block. This is the basis of many template adaptation methods. TIMD uses the diagonally filled area shown in Figure 11 as the template, and the template reference area (the grid-filled area) is the template's reference sample. The decoder can use a specific intra-frame prediction mode to predict on the template and compare the predicted value with the reconstructed value to obtain the cost of the intra-frame prediction mode on the template. Examples include SAD, SATD, and SSE. Since the template and the current block are adjacent and correlated, the performance of a prediction mode on the template can be used to estimate its performance on the current block. TIMD predicts several candidate intra-frame prediction modes on the template, obtains their costs on the template, and selects the one or two intra-frame prediction modes with the lowest costs as the intra-frame prediction mode for the current block.

[0130] Research has found that if the cost difference between two intra-frame prediction modes on a template is small, taking a weighted average of the prediction values ​​of the two intra-frame prediction modes can improve compression performance. The weight of the prediction values ​​of the two prediction modes is related to the aforementioned cost, and in the current version, this weight is inversely proportional to the cost.

[0131] In summary, TIMD uses the prediction performance of intra-frame prediction modes on a template to select the appropriate intra-frame prediction mode, and can weight the two intra-frame prediction modes based on their cost on the template. The advantage of TIMD is that if the current block selects TIMD mode, the decoder does not need to indicate the specific intra-frame prediction mode to be used. Instead, the decoder can derive the selected intra-frame prediction mode through the above process, which saves some overhead.

[0132] (6) Decoder-side Intra Mode Derivation (DIMD)

[0133] DIMD uses reconstructed samples on the left and top sides of the current block to derive the prediction mode, but instead of making predictions on the template, it analyzes the gradient of the reconstructed samples.

[0134] As shown in Figure 12, DIMD analyzes the gradient of black points, such as horizontal gradient and vertical gradient, and adapts an intra-frame prediction mode according to its gradient. The analysis of all points that need to be checked can obtain a result similar to the bar graph below. That is, the statistics of the number of points matched by each intra-frame prediction mode. Of course, the so-called bar graph is just to help understanding, and it can be implemented in a variety of simple forms. The current DIMD selects the two highest intra-frame prediction modes in the histogram, plus the PLANAR mode, and the prediction values ​​of a total of three intra-frame prediction modes are weighted. The weights are related to the results of the analysis. For example, as shown in Figure 13, the three intra-frame prediction modes include M1 mode, M2 mode and PLANAR mode. The prediction values ​​obtained for these three intra-frame prediction modes are set to Pred1, Pred2, and Pred3 respectively, and the weight values ​​of these three intra-frame prediction modes are set to w1, w2, and w3 respectively. The specific calculation formulas are as follows:

[0135] The final prediction block can be shown as follows:

[0136] In summary, DIMD uses gradient analysis of reconstructed samples to select intra prediction modes, and can weight two intra prediction modes plus planar based on the analysis results. The advantage of DIMD is that if DIMD mode is selected for the current block, the decoder does not need to indicate the specific intra prediction mode to be used. Instead, the decoder can derive the selected mode through the above process, which saves a certain amount of overhead.

[0137] (7) Template Matching (TM).

[0138] The template matching method was first used in inter-frame prediction. It exploits the correlation between adjacent samples and uses areas surrounding the current block as templates. When the current block is encoded or decoded, its left and upper sides are already encoded and decoded according to the coding order. However, existing hardware decoder implementations do not guarantee that the left and upper sides have already been decoded when decoding begins. This applies to inter-frame blocks. For example, in HEVC, the prediction process for inter-frame coded blocks does not require surrounding reconstructed samples, allowing prediction to proceed in parallel. However, intra-frame coded blocks require reconstructed samples from the left and upper sides as reference samples. Theoretically, the left and upper sides are available, meaning they can be implemented with appropriate hardware design adjustments. In contrast, the right and lower sides are not available under the coding order of existing standards such as VVC.

[0139] As shown in Figure 2, the rectangular areas to the left and above the current block are used as templates. The height of the left template portion is generally the same as the height of the current block, and the width of the upper template portion is generally the same as the width of the current block, but can also be different. The best matching position of the template is found in the reference image to determine the motion information, or motion vector, of the current block. This process can be roughly described as starting from a starting position in a reference image (Ref0) and searching within a certain range around it. Search rules, such as the search range and search step size, can be predefined. At each position, the degree of match between the template corresponding to that position and the templates surrounding the current block is calculated. The degree of match can be measured using distortion costs, such as SAD or SATD. SATD generally uses transforms such as the Hadamard transform and MSE. Lower values ​​of SAD, SATD, and MSE indicate a higher degree of match. The cost is calculated using the predicted block of the template corresponding to that position and the reconstructed block of the template surrounding the current block. In addition to searching at whole-sample positions, searches can also be performed at sub-sample positions. The motion information of the current block is determined based on the position with the highest degree of match. By utilizing the correlation between adjacent samples, the motion information that is appropriate for the template may also be appropriate for the current block. Of course, the template matching method may not necessarily be applicable to all blocks, so some methods can be used to determine whether the current block uses the above template matching method, such as using a control switch in the current block to indicate whether the template matching method is used. A classic template matching technology is called DMVD (Decoder side Motion Vector Derivation). Both the encoder and decoder can use the template to search to derive motion information or find better motion information based on the original motion information. It does not require the transmission of specific motion vectors or motion vector differences. Instead, both the encoder and decoder perform the same search rules to ensure consistency in encoding and decoding. The template matching method can improve compression performance, but it also requires "searching" in the decoder, which brings a certain degree of decoder complexity.

[0140] (8) Intra Template Matching Prediction (ITMP)

[0141] ITMP can be considered a combination of IBC and TM. As mentioned above, applying TM to inter-frame frames can reduce the overhead of encoding MVs. Similarly, applying TM to IBC can reduce the overhead of encoding BVs. An example is to use the matching block found by TM as the ITMP prediction block for the current block, without encoding BVs.

[0142] Figure 14 shows an example of ITMP. The inverted L-shaped area in the upper left corner of the current block is used as a template. The search is performed within a point-filled search range, which covers the reconstructed area. The point-filled area shown in Figure 14 includes the current CTU (R1), the CTU to the upper left of R2, the CTU above R3, and the CTU to the left of R4. This is just an example; the search range may vary in actual applications. In this example, the best matching block is found in R2.

[0143] (9) Spatial Geometric Partitioning Mode (SGPM).

[0144] The VVC video codec standard has an inter-frame prediction mode called Geometric Partitioning Mode (GPM). The AVS3 video codec standard has an inter-frame prediction mode called Angular Weighted Prediction (AWP). Although these two modes have different names and specific implementations, they share common principles.

[0145] Traditional unidirectional prediction only uses one reference block of the same size as the current block, while traditional bidirectional prediction uses two reference blocks of the same size as the current block. The sample value of each point in the prediction block is the average of the corresponding positions in the two reference blocks, that is, all points in each reference block account for 50%. Bidirectional weighted prediction allows the proportions of the two reference blocks to be different, such as all points in the first reference block account for 75% and all points in the second reference block account for 25%. However, the proportions of all points in the same reference block are the same. Other optimization methods such as decoder-side motion vector refinement (DMVR) and bidirectional optical flow (BIO) will cause some changes in the reference samples or prediction samples, but they are not related to the principles described above. BIO can also be abbreviated as BDOF. GPM or AWP also uses two reference blocks of the same size as the current block, but some sample positions use 100% of the sample values ​​from the first reference block, while others use 100% of the sample values ​​from the second reference block. In the boundary area, or transition zone, sample values ​​from both reference blocks are used in a certain proportion. The weights in the boundary area also transition gradually. The specific distribution of these weights is determined by the GPM or AWP mode. The weight of each sample position is determined based on the GPM or AWP mode. Of course, in some cases, such as very small block sizes, some GPM or AWP modes may not guarantee that some sample positions use 100% of the sample values ​​from the first reference block, while others use 100% of the sample values ​​from the second reference block. Alternatively, GPM or AWP uses two reference blocks of different sizes, each taking a required portion as the reference block. Specifically, the portion with a non-zero weight is used as the reference block, while the portion with a zero weight is discarded.

[0146] Figure 15 shows the weights of the 64 GPM modes in VVC on square blocks. Black indicates a weight of 0% for the position corresponding to the first reference block, white indicates a weight of 100%, and gray areas, depending on the depth of the color, indicate a weight greater than 0% and less than 100% for the position corresponding to the first reference block. The weight for the position corresponding to the second reference block is 100% minus the weight for the position corresponding to the first reference block.

[0147] GPM and AWP use different weighting methods. GPM determines the angle and offset for each mode and then calculates a weight matrix for each mode. AWP first creates a one-dimensional weight line and then uses a method similar to intra-frame angle prediction to fill the entire matrix with this one-dimensional weight line.

[0148] It should be noted that earlier coding standards only had rectangular division methods, whether it was CU, PU or TU division. GPM and AWP achieved the predicted non-rectangular division effect without division. GPM and AWP use a mask of the weights of two reference blocks, that is, the weight map or weight matrix mentioned above. This mask determines the weights of the two reference blocks when generating the prediction block, or it can be simply understood that part of the position of the prediction block comes from the first reference block and part of the position comes from the second reference block, and the transition area (blending area) is weighted by the corresponding positions of the two reference blocks, so that the transition is smoother. GPM and AWP do not divide the current block into two CUs or PUs according to the dividing line, so the transformation, quantization, inverse transformation, inverse quantization, etc. of the residual after prediction also treat the current block as a whole.

[0149] It should also be noted that GPM is an inter-frame technology in VVC, but it can also use intra-frame prediction. The two prediction modes of GPM can both be inter-frame prediction modes, one can be inter-frame prediction mode and the other can be intra-frame prediction mode, or both can be intra-frame prediction modes.

[0150] The SGPM mode in ECM uses this weight mask or weight matrix in intra-frame prediction. It uses the weight matrix to combine the prediction values ​​of two intra-frame prediction modes into the prediction value of SGPM, which can produce more complex textures than a single prediction mode.

[0151] Because one partition mode and two intra-frame prediction modes are used, the general logic is to write syntax elements indicating these three modes into the bitstream, as shown in Table 1: partition_mode_idx, intra_pred_mode0_idx, and intra_pred_mode1_idx. However, to reduce the overhead of this information, SGPM uses templates around the current block to sort the combinations of the three modes, obtaining a candidate list of combined modes. Only the SGPM candidate indexes need to be written into the bitstream. At the decoder, SGPM constructs the candidate list of combined modes and, based on the SGPM candidate indexes (e.g., sgpm_cand_idx in Table 2), derives one partition mode and two intra-frame prediction modes: partition_mode_idx, intra_pred_mode0_idx, and intra_pred_mode1_idx.

[0152] Table 1

[0153] Table 2

[0154] Here, for sgpm_cand_idx,

[0155] (10) Extrapolation filter based Intra Prediction (EIP)

[0156] ECM includes an EIP mode. Figures 16A, 16B, and 16C illustrate several typical filters for this EIP mode. The sample positions in the grid-filled areas represent the input samples (EIP), while the sample positions in the white-filled areas represent the output samples (EIP). Taking the filter for the first square as an example, the predicted value for the sample in the lower right corner is typically required. The values ​​of the 15 samples to its left, upper left, and upper sides are known, and each grid-filled position in the filter has a preset coefficient. By multiplying the sample value at each input position by the coefficient for the corresponding position, summing up all the multiplication results and normalizing them, we can obtain the predicted value for the position to be predicted.

[0157] The EIP mode may provide a pre-trained filter or a filter trained based on the reconstructed sample area surrounding the current block. Figures 17A, 17B, and 17C illustrate the three types of reconstructed sample areas that can be selected for filter training in the EIP mode. Assuming that the current block and the reconstructed sample area used to train the filter coefficients follow similar patterns, the filter trained using the reconstructed sample area can be applied to the current block.

[0158] Furthermore, the following introduces the transformation technology.

[0159] During encoding, commonly used hybrid coding frameworks first perform prediction, leveraging spatial or temporal correlation to produce an image identical or similar to the current block. While it's possible for the predicted block to be identical to the current block for a given block, this isn't guaranteed to be the case for all blocks in a video, especially in natural video or video captured by a camera. Irregular motion, distortion, occlusion, and brightness changes in video are difficult to fully predict. Therefore, hybrid coding frameworks subtract the predicted image from the original image of the current block to produce a residual image, or, in other words, subtract the predicted block from the current block to produce a residual block. This residual block is typically much simpler than the original image, so prediction can significantly improve compression efficiency. The residual block isn't encoded directly; instead, it's usually first transformed. This transform converts the residual image from the spatial domain to the frequency domain, removing correlation. After the residual image is transformed to the frequency domain, since most of the energy is concentrated in the low-frequency region, the non-zero coefficients are concentrated in the upper left corner. Quantization is then used to further compress the image. Furthermore, since the human eye is less sensitive to high frequencies, a larger quantization step size can be used in high-frequency regions.

[0160] Figure 18 is a schematic diagram of a DCT transform. As shown in Figure 18, after the DCT transform of the original image, only the upper left corner has non-zero coefficients. Of course, this example performs a DCT transform on the entire image. In video codecs, images are processed by dividing them into blocks, so the transform is also performed on a block-by-block basis.

[0161] Transforms are very useful in typical video compression, but not all blocks require transforms. In some cases, transforms can even yield worse compression results than non-transforms. Therefore, in some standards, such as VVC, the encoder can choose whether to use transforms for the current block. DCT-II is the most commonly used transform in video compression standards, and its base image is shown in Figure 19.

[0162] In addition, VVC can also use DCT8 type (DCT-VIII) and DST7 type (DST-VII). The basic formulas of these transforms are shown in Table 3, which shows the basic transform formulas of DCT2, DCT8 and DST7 for N-point input.

[0163] Table 3

[0164] Because images are all two-dimensional, the computational complexity and memory overhead of performing a direct two-dimensional transform were prohibitive for the hardware available at the time. Therefore, the DCT2, DCT8, and DST7 transforms used in the standards were split into two steps: horizontal and vertical one-dimensional transforms. For example, the horizontal transform was performed first, followed by the vertical transform, or the vertical transform was performed first, followed by the horizontal transform.

[0165] (a) Multi-transformation selection MTS.

[0166] VVC supports transform kernels such as DCT2, DCT8, and DST7. The DCT2, DCT8, and DST7 kernels used in VVC are horizontally and numerically separable, allowing independent horizontal and vertical transforms. For a block, the encoder selects the appropriate transform kernel and transmits its index to the bitstream. The decoder then uses the index to determine the inverse transform kernel. Different transform kernels can be selected for the horizontal and vertical directions, such as using DCT8 horizontally and DST7 vertically. This technique is generally referred to as MTS.

[0167] VVC uses a syntax element, mts_idx, to determine the transform kernel of the base transform. As shown in Table 4 below, trTypeHor represents the transform kernel for the horizontal transform, and trTypeVer represents the transform kernel for the vertical transform. A value of 0 for trTypeHor or trTypeVer indicates a DCT2 transform, 1 indicates a DCT7 transform, and 2 indicates a DCT8 transform. If mts_idx is not present, the value of mts_idx is inferred to be 0.

[0168] Table 4

[0169] (2) Low-frequency non-separable transform LFNST.

[0170] The above transformation method is effective for horizontal and vertical textures, but less so for diagonal textures. Indeed, horizontal and vertical textures are the most common, making the above transformation method very useful for improving compression efficiency. As the demand for compression efficiency continues to increase, more efficient processing of diagonal textures could further improve compression efficiency.

[0171] In order to more effectively process the residual of oblique texture, LFNST transform is used in VVC. The above transforms such as DCT2, DCT8, and DST7 are called primary transforms. At the encoding end of VVC, LFNST is used after DCT2 transform and before quantization. At the decoding end of VVC, LFNST is used after inverse quantization and before inverse DCT2 transform. Because it is transformed on the basis of DCT2 (basic transform), LFNST is a secondary transform. Figure 20 is a schematic diagram of the encoding and decoding process without LFNST (secondary transform), and Figure 21 is a schematic diagram of the encoding and decoding process with LFNST (secondary transform). Of course, the encoding end can directly inverse quantize the saved quantization coefficients instead of entropy decoding, because entropy coding is lossless.

[0172] Figure 22 shows a detailed encoding and decoding process involving LFNST (secondary transform). On the encoder side, LFNST performs a secondary transform on the low-frequency coefficients in the upper left corner after the base transform. The base transform decorrelates the image, concentrating energy in the upper left corner. The secondary transform further decorrelates the low-frequency coefficients of the base transform. The result is intuitively shown in Figure 22. On the encoder side, 16 coefficients are input to the 4×4 LFNST, and the output is 8 coefficients. 48 coefficients are input to the 8×8 LFNST, and the output is 8 coefficients for the 8×8 block and 16 coefficients for other blocks. On the decoder side, 8 coefficients are input to the 4×4 inverse LFNST, and the output is 16 coefficients. 8 coefficients are input to the 8×8 block and 16 coefficients for other blocks. The coefficients are input to the 8×8 inverse LFNST, and the output is 48 coefficients.

[0173] Figure 23 shows some base images for LFNST in VVC. Only the two lowest-frequency base images for each kernel in each kernel group are shown in Figure 23. Some obvious diagonal textures can be seen. In addition to kernels optimized for certain diagonal textures, LFNST also has kernels optimized for flat, gradient textures, such as kernel group 0 in VVC.

[0174] LFNST is only applied to intra-coded blocks. Angular prediction tiles the values ​​of reference samples at a specified angle onto the current block as the prediction value. This means that the predicted block will have a distinct directional texture, and the residual of the current block after angular prediction will also statistically exhibit distinct angular characteristics. Therefore, the transform kernel selected by LFNST can be tied to the intra-prediction mode. That is, once the intra-prediction mode is determined, LFNST can only use the set of transform kernels corresponding to that intra-prediction mode.

[0175] Specifically, the LFNST in VVC has a total of 4 groups of transform kernels, and each group can select 2 transform kernels. Table 5 shows the correspondence between intra prediction modes and transform kernel groups. Note that the cross-component prediction modes used for chroma intra prediction are 81 to 83, and there are no such modes for luma intra prediction. The transform kernel of LFNST can be transposed to process more angles with one transform kernel group. For example, modes 13 to 23 and 45 to 55 both correspond to transform kernel group 2, but 13 to 23 is obviously close to the horizontal mode and 45 to 55 is obviously close to the vertical mode.

[0176] Table 5

[0177] VVC's LFNST uses four sets of transform kernels, with the intra-prediction mode specifying which set to use. This leverages the correlation between the intra-prediction mode and the LFNST transform kernel, reducing the transmission of the selected LFNST transform kernel in the bitstream. Whether the current block uses LFNST, and if so, whether to use the first or second set within a set, is determined by the bitstream and certain conditions.

[0178] In the subsequent evolution of ECM technology, LFNST was further expanded. LFNST has more transform kernel groups, 35 in ECM. The correspondence between the transform kernel group index (LFNST set index) and the intra prediction mode (Intra pred.mode) is shown in Table 6. Each transform kernel group is more efficient for textures at the corresponding angle. Here, each transform kernel group can select three transform kernels.

[0179] Table 6

[0180] (3) Non-separable basis transformation NSPT.

[0181] LFNST is a horizontally and vertically inseparable transform. Because it involves a secondary transform, DCT2 can be called the base transform. This approach of performing DCT2 before LFNST is a compromise between performance and complexity. While directly performing the inseparable base transform is more efficient, it also incurs higher complexity, such as increased computational effort and storage space required for the transform kernel.

[0182] In ECM10, some small blocks can use NSPT, while large blocks still use DCT2+LFNST. The sizes of small blocks are 4×4, 4×8, 8×4, 8×8, 4×16, 16×4, 8×16, 16×8, 8×32, and 32×8. In ECM10, NSPT also matches the transform kernel group according to the intra prediction mode. The matching method can refer to the LFNST method. Each transform kernel group has 3 transform kernels to choose from. For example, an 8×8 base image of an NSPT in ECM10 is shown in Figure 24. Figure 24 corresponds to inter-frame angle prediction mode 7. It can be seen that it handles the texture of the corresponding angle better. It should be noted that NSPT is only applied to intra-coded blocks.

[0183] In summary, both NSPT and LFNST process transforms for textures at various angles. They may have multiple transform kernels, and a transform kernel may be specifically optimized for a specific angular texture. Of course, in addition to angular textures, NSPT and LFNST also include transform kernels for gradient textures. In fact, these transform kernels can also be said to be trained KLTs (Karhunen-Loeve Transforms). It can also be summarized that both NSPT and LFNST have multiple transform kernels, each designed for a specific texture, including angular textures, gradient textures, and so on. Of course, gradient textures can be further expanded to include horizontal gradient textures, vertical gradient textures, and diagonal gradient textures. They have multiple transform kernel groups, and each intra-frame prediction mode can correspond to a transform kernel group. Each intra-frame prediction mode actually represents a texture feature. Therefore, the intra-frame prediction mode index is also a texture feature index.

[0184] In VVC and the current ECM, a block (CU or TU) can only derive a single texture feature index for deriving the LFNST / NSPT transform kernel set, thereby deriving a unique LFNST / NSPT transform kernel set. This texture feature can be considered the link for using LFNST / NSPT. For blocks using standard intra prediction modes, namely DC, PLANAR, and various angle modes, this texture feature index is the intra prediction mode used by the current block. However, for special intra prediction modes such as DIMD, TIMD, MIP, EIP, SGPM, ITMP, and IBC, this is not so straightforward. DIMD and TIMD both weight the prediction values ​​of two or more intra prediction modes. SGPM weights the prediction values ​​of two intra prediction modes using a weight matrix. MIP performs prediction based on a matrix operation. EIP uses a filter. ITMP and IBC perform predictions by replicating a reconstructed block. These are not simple texture features like standard intra prediction modes. For example, a block weighted by the prediction values ​​of two or more intra-frame prediction modes indicates that its texture may contain two or more texture features. Its residual after prediction may exhibit texture features of the first prediction mode or the second prediction mode. This shows that for blocks that require weighting of the prediction values ​​of two or more intra-frame prediction modes, the current transformation process does not fully consider the whole process, resulting in low compression efficiency.

[0185] Based on this, an embodiment of the present application provides an encoding method, which determines a transform core group of a current block; determines a transform core of the current block based on the transform core group; determines a residual block of the current block, and transforms the residual block of the current block based on the transform core to determine the transform coefficients of the current block; encodes the transform coefficients of the current block and writes the obtained coded bits into a bitstream. An embodiment of the present application also provides a decoding method, which determines a transform core group index of the current block, and determines a transform core group of the current block based on the transform core group index of the current block; determines a transform core of the current block based on the transform core group; determines the transform coefficients of the current block, and transforms the transform coefficients of the current block based on the transform core to determine the residual block of the current block.

[0186] In this way, both the encoder and decoder can use the multi-transform kernel group selection technique to determine the transform kernel group for the current block, and then determine the transform kernel for the current block from this group. In other words, for a current block predicted using certain intra-frame prediction modes, multiple candidate texture features derived from the multi-transform kernel group selection technique can be used to guide the transform when determining the transform kernel for the current block. This improves the accuracy of the transform prediction, thereby increasing compression efficiency and, ultimately, encoding and decoding performance.

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

[0188] FIG25 is a schematic diagram of a network architecture for video encoding and decoding provided in an embodiment of the present application. As shown in FIG25 , the network architecture includes one or more electronic devices 13 to 1N and a communication network 01, wherein electronic devices 13 to 1N can perform video interaction via the communication network 01. During implementation, the electronic devices can be various types of devices with video encoding and decoding capabilities. For example, the electronic devices can include mobile phones, tablet computers, personal computers, personal digital assistants, navigators, digital phones, video phones, televisions, sensor devices, servers, etc., and the embodiments of the present application do not limit this.

[0189] In an embodiment of the present application, a network architecture of a video encoding and decoding system including a decoding method and an encoding method is provided. The decoder or encoder in the embodiment of the present application can be the aforementioned electronic device. In other words, the electronic device in the embodiment of the present application has video encoding and decoding capabilities, and generally includes a video encoder (i.e., encoder) and a video decoder (i.e., decoder).

[0190] Figure 26 is a schematic block diagram of the system composition of an encoder provided in an embodiment of the present application. As shown in Figure 26, the encoder 100 may include: a segmentation unit 101, a prediction unit 102, a first adder 107, a transform unit 108, a quantization unit 109, an inverse quantization unit 110, an inverse transform unit 111, a second adder 112, a filtering unit 113, a decoded picture buffer (DPB) unit 114, and an entropy coding unit 115. Here, the input of the encoder 100 may be a video consisting of a series of pictures or a static picture, and the output of the encoder 100 may be a bitstream (also referred to as a "codestream") used to represent a compressed version of the input video.

[0191] Among them, the segmentation unit 101 segments the picture in the input video into one or more Coding Tree Units (CTUs). The segmentation unit 101 divides the picture into multiple tiles (or tiles), and can further divide a tile into one or more bricks. Here, a tile or a brick may include one or more complete and / or partial CTUs. In addition, the segmentation unit 101 can form one or more slices, where a slice can include one or more tiles arranged in a grid order in the picture, or one or more tiles covering a rectangular area in the picture. The segmentation unit 101 can also form one or more sub-pictures, where a sub-picture can include one or more slices, tiles or bricks.

[0192] During the encoding process of encoder 100, segmentation unit 101 transmits the CTU to prediction unit 102. Generally, prediction unit 102 may be composed of block segmentation unit 103, motion estimation (ME) unit 104, motion compensation (MC) unit 105, and intra prediction unit 106. Specifically, block segmentation unit 103 iteratively uses quadtree segmentation, binary tree segmentation, and ternary tree segmentation to further divide the input CTU into smaller coding units (CUs). Prediction unit 102 may use ME unit 104 and MC unit 105 to obtain inter-frame prediction blocks for the CU. Intra-frame prediction unit 106 may use various intra-frame prediction modes, including MIP mode, to obtain intra-frame prediction blocks for the CU. In an example, a rate-distortion optimized motion estimation method may be used by ME unit 104 and MC unit 105 to obtain inter-frame prediction blocks, and a rate-distortion optimized mode determination method may be used by intra-frame prediction unit 106 to obtain intra-frame prediction blocks. The prediction unit 102 outputs the prediction block of the CU, and the first adder 107 calculates the difference between the CU in the output of the segmentation unit 101 and the prediction block of the CU, i.e., the residual CU. The transform unit 108 reads the residual CU and performs one or more transform operations on the residual CU to obtain coefficients. The quantization unit 109 quantizes the coefficients and outputs the quantized coefficients (i.e., levels). The inverse quantization unit 110 performs a scaling operation on the quantized coefficients to output reconstructed coefficients. The inverse transform unit 111 performs one or more inverse transforms corresponding to the transform in the transform unit 108 and outputs the reconstructed residual. The second adder 112 calculates the reconstructed CU by adding the reconstructed residual and the prediction block of the CU from the prediction unit 102. The second adder 112 also sends its output to the prediction unit 102 for use as an intra-frame prediction reference. After all CUs in the picture or sub-picture are reconstructed, the filtering unit 113 performs loop filtering on the reconstructed picture or sub-picture. Here, the filtering unit 113 includes one or more filters, such as a deblocking filter, a sample adaptive offset (SAO) filter, an adaptive loop filter (ALF), a luminance mapping and chroma scaling (LMCS) filter, and a neural network-based filter. Alternatively, when the filtering unit 113 determines that the CU is not used as a reference for encoding other CUs, the filtering unit 113 performs loop filtering on one or more target samples in the CU. The output of the filtering unit 113 is a decoded picture or sub-picture, which is cached to the DPB unit 114. The DPB unit 114 outputs the decoded picture or sub-picture according to the timing and control information.Here, the picture stored in the DPB unit 114 can also be used as a reference for the prediction unit 102 to perform inter-frame prediction or intra-frame prediction. Finally, the entropy coding unit 115 converts the parameters necessary for decoding the picture from the encoder 100 (such as control parameters and supplementary information, etc.) into binary form, and writes such binary form into the code stream according to the syntax structure of each data unit, that is, the encoder 100 finally outputs the code stream.

[0193] Furthermore, the encoder 100 can be a device having a first processor and a first memory for recording a computer program. When the first processor reads and executes the computer program, the encoder 100 reads the input video and generates a corresponding bitstream. Alternatively, the encoder 100 can be a computing device having one or more chips. These units implemented as integrated circuits on the chip have similar connection and data exchange functions as the corresponding units in FIG26 .

[0194] Figure 27 is a block diagram of the system components of a decoder provided in an embodiment of the present application. As shown in Figure 27, the decoder 200 may include: a parsing unit 201, a prediction unit 202, an inverse quantization unit 205, an inverse transform unit 206, an adder 207, a filtering unit 208, and a decoded image buffer unit 209. Here, the input of the decoder 200 is a bitstream representing a compressed version of a video or a still image, and the output of the decoder 200 may be a decoded video consisting of a series of images or a decoded still image.

[0195] The input codestream to decoder 200 may be the codestream generated by encoder 100. Parsing unit 201 parses the input codestream and obtains syntax element values ​​from the input codestream. Parsing unit 201 converts the binary representation of the syntax elements into digital values ​​and sends the digital values ​​to units within decoder 200 to obtain one or more decoded pictures. Parsing unit 201 may also parse one or more syntax elements from the input codestream to display decoded pictures.

[0196] During the decoding process in decoder 200, parsing unit 201 transmits the values ​​of syntax elements and one or more variables set or determined based on the values ​​of the syntax elements, used to obtain one or more decoded pictures, to units within decoder 200. Prediction unit 202 determines a prediction block for the current decoding block (e.g., a CU). Prediction unit 202 may include motion compensation unit 203 and intra prediction unit 204. Specifically, when an inter decoding mode is indicated for decoding the current decoding block, prediction unit 202 passes relevant parameters from parsing unit 201 to motion compensation unit 203 to obtain an inter prediction block. When an intra prediction mode (including a MIP mode indicated based on a MIP mode index value) is indicated for decoding the current decoding block, prediction unit 202 passes relevant parameters from parsing unit 201 to intra prediction unit 204 to obtain an intra prediction block. Dequantization unit 205 has the same functionality as dequantization unit 110 in encoder 100. Dequantization unit 205 performs a scaling operation on the quantization coefficients (i.e., levels) from parsing unit 201 to obtain reconstructed coefficients. The inverse transform unit 206 has the same function as the inverse transform unit 111 in the encoder 100. The inverse transform unit 206 performs one or more transform operations (i.e., the inverse of the one or more transform operations performed by the inverse transform unit 111 in the encoder 100) to obtain a reconstructed residual. The adder 207 performs an addition operation on its input (the prediction block from the prediction unit 202 and the reconstructed residual from the inverse transform unit 206) to obtain a reconstructed block of the current decoded block. The reconstructed block is also sent to the prediction unit 202 to be used as a reference for other blocks encoded in the intra prediction mode.

[0197] After all CUs in the picture or sub-picture are reconstructed, the filtering unit 208 performs loop filtering on the reconstructed picture or sub-picture. The filtering unit 208 includes one or more filters, such as a deblocking filter, a sample adaptive offset filter, an adaptive loop filter, a luminance mapping and chrominance scaling filter, and a neural network-based filter. Alternatively, when the filtering unit 208 determines that the reconstructed block is not used as a reference for decoding other blocks, the filtering unit 208 performs loop filtering on one or more target samples in the reconstructed block. Here, the output of the filtering unit 208 is a decoded picture or sub-picture, which is cached to the DPB unit 209. The DPB unit 209 outputs the decoded picture or sub-picture based on timing and control information. The picture stored in the DPB unit 209 can also be used as a reference for inter-frame prediction or intra-frame prediction performed by the prediction unit 202.

[0198] Furthermore, the decoder 200 can be a second memory having a second processor and a computer program. When the first processor reads and runs the computer program, the decoder 200 reads the input code stream and generates a corresponding decoded video. In addition, the decoder 200 can also be a computing device having one or more chips. These units implemented as integrated circuits on the chip have similar connection and data exchange functions as the corresponding units in Figure 27.

[0199] It should also be noted that when the embodiment of the present application is applied to the encoder 100, the "current block" specifically refers to the current block to be encoded in the video image (which can also be simply referred to as the "encoding block"); when the embodiment of the present application is applied to the decoder 200, the "current block" specifically refers to the current block to be decoded in the video image (which can also be simply referred to as the "decoding block").

[0200] In one embodiment of the present application, FIG28 is a flowchart diagram of a decoding method provided by the embodiment of the present application. As shown in FIG28 , the method may include:

[0201] S2801 : Determine a transform core group index of a current block, and determine a transform core group of the current block according to the transform core group index of the current block.

[0202] It should be noted that in the embodiments of the present application, the method is applied to a decoder. Specifically, based on the structure of decoder 200 shown in FIG27 , the decoding method of the embodiments of the present application is primarily applied to intra-predicted blocks. Specifically, when the current block uses intra-prediction mode, the optimization scheme proposed here is mainly for the NSPT and LFNST transforms in intra-prediction mode to improve compression efficiency.

[0203] It should also be noted that in the embodiment of the present application, the method is applicable to the Multiple Transform Set Selection (MTSS) method. Among them, NSPT and LFNST are both transformations that process textures of various angles. They may have multiple transformation kernels, and one transformation kernel may be specially optimized for a certain specific angle texture. Of course, in addition to angle textures, NSPT and LFNST also include transformation kernels for processing gradient textures. In fact, these transformation kernels can also be said to be trained KL transforms (Karhunen-Loeve Transform, KLT). That is to say, NSPT and LFNST both have multiple transformation kernels, each of which is designed for a specific texture. Specific textures include angle textures, gradient textures, etc. In addition, gradient textures can be further expanded to include horizontal gradient textures, vertical gradient textures, oblique gradient textures, etc. Furthermore, the MTSS method is not limited to being used only for inseparable transforms such as NSPT and LFNST. The MTSS method can also be applied to separable transforms optimized for specific textures.

[0204] It should also be noted that, in an embodiment of the present application, the intra-frame prediction block can have multiple transform kernel groups, and each intra-frame prediction mode can correspond to a transform kernel group. In other words, each intra-frame prediction mode actually represents a texture feature. Therefore, the intra-frame prediction mode index is also a texture feature index. For example, DC and PLANAR correspond to gradient texture features, and a certain angle prediction mode corresponds to the texture feature of this angle. On the one hand, the texture feature index can avoid the occurrence of intra-frame prediction mode in "inter-frame", and on the other hand, it is also more conducive to possible expansion. For example, an intra-frame prediction mode can correspond to multiple texture features, such as the DC mode can correspond to horizontal gradient texture, vertical gradient texture, oblique gradient texture, etc.

[0205] In the embodiments of the present application, considering that some intra prediction modes are not simple texture features but may contain two or more texture features, the Multiple Transform Set Selection (MTSS) technique can be used. In MTSS, if the intra prediction mode of the current block is a special intra prediction mode, more than one transform set can be selected.

[0206] In the embodiment of the present application, some additional conditions may be added to determine whether the current block uses the MTSS technology. For example, these conditions may include: the number of samples in the current block, the size of the current block, and the prediction mode of the current block. In other words, in the embodiment of the present application, the number of samples in the current block may be selected to determine whether the current block uses the MTSS technology, and / or the size of the current block may be selected to determine whether the current block uses the MTSS technology, and / or the prediction mode of the current block may be selected to determine whether the current block uses the MTSS technology. No limitation is imposed herein.

[0207] In the embodiment of the present application, when the MTSS technology is used for the current block, the transform core group of the current block may be determined according to the transform core group index of the current block.

[0208] Among them, the increase in the complexity of the decoder caused by MTSS technology is reflected in the difference in parsing syntax elements, and it is generally believed that it has little effect on the complexity of the decoder. However, for the encoder, since the candidates for the transform core group are increased, this will increase the complexity of the encoder. Specifically, a block may choose one from 2 or more LFNST / NSPT transform core groups. However, a block in VVC has only one available transform core group. Therefore, one possible implementation method is to limit the size of the block to which the MTSS technology is applicable, so that the MTSS technology can be disabled at the block size where the MTSS technology requires a lot of additional calculations but the compression efficiency is not significantly improved. In short, the embodiment of the present application can limit the block size to which the MTSS technology is applicable.

[0209] In a possible embodiment, the method may further include: determining the number of samples of the current block; and when the number of samples of the current block is greater than or equal to a minimum sample threshold, performing the step of determining a transform core group index of the current block.

[0210] For example, a threshold for the minimum number of samples for applying the MTSS technology (i.e., the "minimum sample threshold") can be set, represented by MIN_PIX. If the number of samples (width × height) of a block is less than MIN_PIX, the MTSS technology cannot be used for this block. Otherwise, if the number of samples of this block is greater than or equal to MIN_PIX, the MTSS technology can be used for this block. In the embodiment of the present application, the value of MIN_PIX may be 32, 64, 256, etc. For example, the value of MIN_PIX may be equal to 256.

[0211] In another possible embodiment, the method may further include: determining the size of the current block, wherein the size of the current block includes height and width; when the height and width of the current block are both greater than or equal to a minimum size threshold, executing the step of determining the transform core group index of the current block.

[0212] For example, a minimum size threshold (i.e., "minimum size threshold") for applying MTSS technology can be set, represented by MIN_SIZE. If the width or height of a block is less than MIN_SIZE, MTSS technology cannot be used for this block. Otherwise, if the width and height of this block are both greater than or equal to MIN_SIZE, MTSS technology can be used for this block. In the embodiment of the present application, the value of MIN_SIZE may be 8, 16, etc. For example, the value of MIN_PIX may be equal to 8.

[0213] In another possible embodiment, the method may further include: determining a prediction mode of the current block; and when the prediction mode of the current block is one of the first prediction mode set, performing the step of determining a transform core group index of the current block.

[0214] In some embodiments, the first prediction mode set may include at least one of the following prediction modes: DC mode, PLANAR mode, and other prediction modes other than angular prediction mode.

[0215] In some embodiments, the first prediction mode set may include at least one of the following prediction modes: a mode for combined prediction using at least two intra-frame prediction modes, the intra-frame prediction mode including at least one of the following: DC mode, PLANAR mode and angle prediction mode; a mode for prediction by copying intra-frame blocks; a mode for prediction using an interpolation filter; a mode for prediction using matrix operations.

[0216] In some embodiments, the first prediction mode set may include at least one of the following prediction modes: DIMD mode, TIMD mode, SGPM mode, MIP mode, EIP mode, ITMP mode, IBC mode, etc.

[0217] In an embodiment of the present application, the mode for combining the prediction values ​​of at least two intra-frame prediction modes may specifically be a DIMD mode, a TIMD mode, and an SGPM mode; wherein the intra-frame prediction mode includes but is not limited to a DC mode, a PLANAR mode, and an angle prediction mode, etc.

[0218] In the embodiment of the present application, the mode for predicting the copied intra-frame block may specifically be the ITMP mode and the IBC mode.

[0219] In the embodiment of the present application, the mode for using the extrapolation filter for prediction may specifically be the EIP mode.

[0220] In the embodiment of the present application, the mode for prediction using matrix operations may specifically be a MIP mode.

[0221] That is to say, the modes in the first prediction mode set are relatively complex prediction modes, and their corresponding textures may contain two or more texture features. For example, the DIMD mode and the TIMD mode can both weight the prediction values ​​of two or more intra-frame prediction modes, the SGPM mode weights the prediction values ​​of the two intra-frame prediction modes with a weight matrix, the MIP mode predicts based on a matrix operation, the EIP mode predicts based on an extrapolation filter, and the ITMP mode and the IBC mode predict based on copying a reconstructed reference block. Their texture features are not as simple as those of the DC mode, the PLANAR mode, etc. That is to say, when the prediction mode of the current block is any one of the first prediction mode set, the current block can use the MTSS technology.

[0222] It can be understood that in some embodiments, referring to FIG. 29 , step S2801 may include:

[0223] S2901: Decode the code stream and determine the transform core group index of the current block.

[0224] S2902 : Determine a transform core group of the current block according to the transform core group index of the current block.

[0225] It should be noted that, in an embodiment of the present application, the transform core group index is used to indicate the number of the transform core group of the current block in at least two candidate transform core groups. The transform core group index can be represented by lfnst_feature_idx, or it can also be represented by lfnst_set_idx. Among them, the transform core group index of the current block can be an integer greater than or equal to zero, such as 0, 1, 2, etc. Exemplarily, if the value of lfnst_feature_idx is equal to 0, it indicates that the first candidate transform core group is selected as the transform core group of the current block; if the value of lfnst_feature_idx is equal to 1, it indicates that the second candidate transform core group is selected as the transform core group of the current block.

[0226] In some embodiments, for determining the transform core group index of the current block, the method may further include: decoding the code stream to determine the value of the first syntax element; and determining the transform core group index of the current block according to the value of the first syntax element.

[0227] It should be noted that, in the embodiment of the present application, the transform core group index of the current block may be determined by directly decoding the code stream, or may be determined by decoding the value of the first syntax element.

[0228] It should also be noted that, in an embodiment of the present application, the first syntax element can be represented by lfnst_feature_idx or lfnst_set_idx. The first syntax element can be used to indicate the transform core group index of the current block, specifically the number of the transform core group of the current block in at least two candidate transform core groups. The value of the first syntax element can be an integer greater than or equal to zero, such as 0, 1, 2, etc. Exemplarily, if the value of the first syntax element is equal to 0, it indicates that the first candidate transform core group is selected as the transform core group of the current block; if the value of the first syntax element is equal to 1, it indicates that the second candidate transform core group is selected as the transform core group of the current block; if the value of the first syntax element is equal to 2, it indicates that the third candidate transform core group is selected as the transform core group of the current block.

[0229] In a specific implementation, when the prediction mode of the current block is one of the items in the second prediction mode set, determining the transform core group of the current block according to the transform core group index of the current block may include: if the transform core group index is the i-th value, determining the transform core group of the current block based on the i-th intra-frame prediction mode derived from the prediction mode of the current block, where i is a positive integer.

[0230] The second prediction mode set may include at least one of the following prediction modes: a mode for combined prediction using at least two intra-frame prediction modes, wherein the intra-frame prediction mode includes at least one of the following: a DC mode, a PLANAR mode, and an angular prediction mode.

[0231] In a specific embodiment, the second prediction mode set may include at least one of the following prediction modes: DIMD mode, TIMD mode, and SGPM mode.

[0232] In an embodiment of the present application, MTSS can be applied to DIMD mode, TIMD mode, and SGPM mode. If the transform core group index is a first value, the transform core group of the current block is determined based on the first intra-frame prediction mode derived from the prediction mode of the current block; if the transform core group index is a second value, the transform core group of the current block is determined based on the second intra-frame prediction mode derived from the prediction mode of the current block; if the transform core group index is a third value, the transform core group of the current block is determined based on the third intra-frame prediction mode derived from the prediction mode of the current block, and so on.

[0233] Here, for the transform core group index, the first value may be 0, the second value may be 1, and the third value may be 2. That is, for the prediction mode in the second prediction mode set, after determining the transform core group index of the current block, the corresponding transform core group may be directly determined according to the transform core group index.

[0234] For example, for the DIMD mode, since the DIMD mode itself uses gradient-derived texture features and it can derive multiple intra-frame prediction modes, there is no need for the MTSS technology to additionally use gradient-derived texture features. The corresponding transform core group can be determined according to the transform core group index of the current block.

[0235] For example, for the TIMD mode, since the TIMD mode itself can derive multiple intra-frame prediction modes, there is no need for the MTSS technology to additionally use gradients to derive texture features, and the corresponding transform core group can be determined according to the transform core group index of the current block.

[0236] For example, for the SGPM mode, since the SGPM mode itself can derive a "partitioning" mode and two intra-frame prediction modes, there is no need for the MTSS technology to additionally use gradient-derived texture features. The corresponding transform core group can be determined according to the transform core group index of the current block.

[0237] More specifically, in one possible embodiment, it is as follows:

[0238] For example, for the DIMD mode, assume that the transform core group index corresponding to the first intra-frame prediction mode derived by the DIMD mode is 0, denoted as candFeature0; and the transform core group index corresponding to the second intra-frame prediction mode derived by the DIMD mode is 1, denoted as candFeature1. Thus, if the transform core group index is 0, the transform core group for the current block is determined based on the first intra-frame prediction mode derived by the DIMD mode; if the transform core group index is 1, the transform core group for the current block is determined based on the second intra-frame prediction mode derived by the DIMD mode.

[0239] For example, for the TIMD mode, assume that the transform core group index corresponding to the first intra-frame prediction mode derived by the TIMD mode is 0, denoted as candFeature0; and the transform core group index corresponding to the second intra-frame prediction mode derived by the TIMD mode is 1, denoted as candFeature1. Thus, if the transform core group index is 0, the transform core group for the current block is determined based on the first intra-frame prediction mode derived by the TIMD mode; if the transform core group index is 1, the transform core group for the current block is determined based on the second intra-frame prediction mode derived by the TIMD mode.

[0240] For example, for the SGPM mode, assume that the transform core group index corresponding to the partition mode of the SGPM mode is 0, denoted as candFeature0; and the transform core group index corresponding to the first intra-frame prediction mode derived from the SGPM mode is 1, denoted as candFeature1. Thus, if the transform core group index is 0, the transform core group for the current block is determined based on the partition mode of the SGPM mode; if the transform core group index is 1, the transform core group for the current block is determined based on the first intra-frame prediction mode derived from the SGPM mode.

[0241] In another specific implementation method, when the prediction mode of the current block is one of the items in the third prediction mode set, determining the transform core group of the current block according to the transform core group index of the current block may include: if the transform core group index is a first value, determining the transform core group of the current block based on the first intra-frame prediction mode derived from the prediction mode of the current block; if the transform core group index is a second value, determining the transform core group of the current block based on the PLANAR mode.

[0242] In another specific implementation, when the prediction mode of the current block is one of the items in the third prediction mode set, determining the transform core group of the current block according to the transform core group index of the current block may include: if the transform core group index is a first value, determining the transform core group of the current block based on the first intra-frame prediction mode derived from the prediction mode of the current block; if the transform core group index is a second value, determining the transform core group of the current block based on the second intra-frame prediction mode derived from the prediction mode of the current block.

[0243] The third prediction mode set may include at least one of the following prediction modes: a mode for performing prediction using an extrapolation filter and a mode for performing prediction using a matrix operation.

[0244] In a specific embodiment, the third prediction mode set may include at least one of the following prediction modes: MIP mode and EIP mode.

[0245] In the embodiments of the present application, MTSS can be applied to both the MIP and EIP modes. Since the MIP and EIP modes are widely applicable to blocks with texture gradients, their features are similar to those of the PLANAR mode. Therefore, the PLANAR mode can also be used as a candidate texture feature for both the MIP and EIP modes.

[0246] Here, for the transform core group index, the first value may be 0 and the second value may be 1. That is, for the prediction mode in the third prediction mode set, after determining the transform core group index of the current block, the corresponding transform core group may be directly determined according to the transform core group index.

[0247] For example, when the prediction mode of the current block is MIP mode or EIP mode, it is assumed that the transform core group index corresponding to the first intra-frame prediction mode derived from the MIP mode or EIP mode is 0, denoted as candFeature0; and the transform core group index corresponding to the PLANAR mode is 1, denoted as candFeature1. Thus, if the transform core group index is 0, the transform core group for the current block is determined based on the first intra-frame prediction mode derived from the prediction mode of the current block; if the transform core group index is 1, the transform core group for the current block is determined based on the PLANAR mode.

[0248] It can also be understood that in the embodiment of the present application, for at least two candidate transform core groups of the MTSS technology, the decoding end can also construct a first candidate list. In some embodiments, referring to FIG. 30 , for step S2801, the step can include:

[0249] S3001 , determining a first candidate list for a current block, where the first candidate list indicates at least two candidate transform core groups.

[0250] S3002 : Determine a transform core group for the current block according to the first candidate list and the transform core group index.

[0251] It should be noted that in this embodiment of the present application, when the prediction mode of the current block is any one of the following: DIMD mode, TIMD mode, SGPM mode, MIP mode, EIP mode, ITMP mode, and IBC mode, the first candidate list may include at least two candidate texture feature indexes, or the first candidate list may include at least two transform core groups. Here, each candidate texture feature index corresponds to a transform core group. Therefore, it can be said that the first candidate list indicates at least two candidate transform core groups.

[0252] In some embodiments, determining a first candidate list for the current block may include: determining one or more intra-frame prediction modes derived based on a prediction mode of the current block; determining one or more candidate transform core groups based on the one or more intra-frame prediction modes, and adding the one or more candidate transform core groups to the first candidate list.

[0253] In a possible embodiment, determining a first candidate list for the current block may specifically include: when the prediction mode of the current block is one of the items in the second prediction mode set, determining multiple intra-frame prediction modes derived based on the prediction mode of the current block; determining multiple candidate transform core groups based on the multiple intra-frame prediction modes, and adding the multiple candidate transform core groups to the first candidate list.

[0254] In an embodiment of the present application, the second prediction mode set may include at least one of the following prediction modes: a mode for combined prediction using at least two intra-frame prediction modes, wherein the intra-frame prediction mode includes at least one of the following: a DC mode, a PLANAR mode, and an angular prediction mode; illustratively, the second prediction mode set may include at least one of the following prediction modes: a DIMD mode, a TIMD mode, and a SGPM mode. In other words, the MTSS technology can be applied to the DIMD mode, the TIMD mode, and the SGPM mode. In this case, the gradient-derived texture features may not be additionally used, and the first candidate list may be constructed based solely on one or more intra-frame prediction modes derived from the prediction mode itself.

[0255] For example, for the DIMD mode, since the DIMD mode itself uses gradient-derived texture features and can derive multiple intra-frame prediction modes, there is no need for the MTSS technology to additionally use gradient-derived texture features to construct the first candidate list based on the multiple intra-frame prediction modes derived from the DIMD mode itself.

[0256] For example, for the TIMD mode, since the TIMD mode itself can derive multiple intra-frame prediction modes, there is no need for the MTSS technology to additionally use gradient-derived texture features to construct the first candidate list based on the multiple intra-frame prediction modes derived from the TIMD mode itself.

[0257] For example, for the SGPM mode, since the SGPM mode itself can derive a "partitioning" mode and 2 intra-frame prediction modes, there is no need for the MTSS technology to additionally use gradient-derived texture features. The first candidate list is constructed based on a "partitioning" mode and 2 intra-frame prediction modes derived from the SGPM mode itself.

[0258] In some embodiments, determining a first candidate list for the current block may further include: when the first candidate list is not full, determining a preset texture feature index for the current block; determining one or more candidate transform core groups based on the preset texture feature index, and adding the one or more candidate transform core groups to the first candidate list.

[0259] In an embodiment of the present application, the preset texture feature index may be a PLANAR mode. In a specific embodiment, the method may further include: determining multiple candidate transform core groups according to multiple intra prediction modes and the PLANAR mode, and adding the multiple candidate transform core groups to the first candidate list.

[0260] For example, if the intra-frame prediction mode derived from the DIMD mode, TIMD mode, or SGPM mode includes ITMP or IBC, or EIP or MIP mode, the texture features corresponding to the PLANAR mode can also be used as candidate texture features. Since the DIMD mode, TIMD mode, and SGPM mode can use more than two intra-frame prediction modes for weighting or combination, the intra-frame prediction mode may be ITMP or IBC, or EIP or MIP mode. In this case, the texture features corresponding to the PLANAR mode can also be used as candidate texture features. In short, the first candidate list can be constructed based on multiple intra-frame prediction modes derived from the DIMD mode, TIMD mode, and SGPM mode and the PLANAR mode.

[0261] In another possible embodiment, determining the first candidate list for the current block may specifically include: when the prediction mode of the current block is one of the items in the third prediction mode set, determining an intra-frame prediction mode derived based on the prediction mode of the current block; determining two candidate transform core groups according to the intra-frame prediction mode and the PLANAR mode, and adding the two candidate transform core groups to the first candidate list.

[0262] In an embodiment of the present application, the third prediction mode set may include at least one of the following prediction modes: a mode using an extrapolation filter for prediction and a mode using a matrix operation for prediction. Exemplarily, the third prediction mode set may include at least one of the following prediction modes: a MIP mode and an EIP mode. In other words, the MTSS technology can be applied to the MIP mode and the EIP mode. In this case, the gradient-derived texture features may not be used additionally, and the first candidate list can be constructed based solely on the first intra-frame prediction mode and the PLANAR mode derived from the prediction mode itself.

[0263] In some embodiments, determining a first candidate list for the current block may further include: when the first candidate list is not full, determining candidate samples for deriving texture feature indexes; determining one or more candidate texture feature indexes of the current block based on the candidate samples; determining one or more candidate transform core groups based on the one or more candidate texture feature indexes, and adding the one or more candidate transform core groups to the first candidate list.

[0264] In an embodiment of the present application, when constructing the first candidate list, the MTSS technology may also additionally use gradient-derived texture features. Here, when determining one or more candidate transform kernel groups for the current block based on the candidate samples, one or more candidate texture feature indexes including one or more candidate texture feature indexes may be first determined based on the candidate samples, and then one or more candidate transform kernel groups for the current block may be determined based on the one or more candidate texture feature indexes.

[0265] Typically, one candidate texture feature index corresponds to one candidate transform core group; however, in some cases, multiple similar candidate texture feature indexes may correspond to the same transform core group. For example, multiple intra-frame prediction modes with similar angles correspond to the same transform core group. In an embodiment of the present application, if multiple adjacent intra-frame prediction modes (or candidate texture feature indexes) correspond to one transform core group, then when determining the candidate transform core group, it is necessary to ensure that the candidate texture feature indexes are not determined to be the same transform core group.

[0266] In a possible implementation, for candidate samples, a prediction block of the current block may be determined; and at least part of the samples in the prediction block may be used as candidate samples.

[0267] In the embodiment of the present application, if a certain texture exists in the prediction block, it can be considered that the residual block has a texture with the same characteristics. In this way, the candidate samples used for inter-frame derivation of candidate texture feature indexes can be all samples in the prediction block or part of the samples in the prediction block.

[0268] In another possible implementation, for candidate samples, adjacent samples of a reconstructed area of ​​the current block may be determined; and the adjacent samples of the reconstructed area may be used as candidate samples.

[0269] In the embodiment of the present application, the candidate samples used to derive the candidate texture feature index between frames may be samples from adjacent reconstructed regions of the current block, such as the reconstructed regions to the left and right of the current block. Because the reconstructed regions to the left and above are not the current block but are adjacent to it, for example, if the textures are connected, they can be used to estimate the texture of the current block to a certain extent.

[0270] In yet another possible implementation, more samples may be used. For candidate samples, adjacent samples in the reconstructed area and at least part of the samples in the prediction block may be used as candidate samples.

[0271] In an embodiment of the present application, the candidate samples used for inter-frame derivation of candidate texture feature indexes may also be the predicted block of the current block and the reconstructed areas to the left and above the current block. This way, more samples are used to derive the candidate texture feature indexes, making the derived candidate texture feature indexes more accurate.

[0272] It should also be noted that, in the embodiment of the present application, the number of candidate samples used to derive the candidate texture feature index may be at least one, for example, 1, 2, 3 or more.

[0273] In some embodiments, the method may further include: determining the number of candidate samples according to a size parameter of the current block.

[0274] That is to say, when deriving one or more candidate texture feature indexes based on candidate samples, the number of candidate samples used can be determined by the size parameter of the current block. For example, if the size of the current block is small, then all available samples can be counted; if the size of the current block is large, then the current block can be downsampled and counted, such as counting one sample out of every 2, or 4, or 8 samples in the horizontal and / or vertical directions. Alternatively, if the size of one of the horizontal or vertical directions of the current block is less than or equal to 8, then all available samples in that direction are counted; otherwise, if the size of one of the horizontal or vertical directions of the current block is less than or equal to 16, then one sample out of every 2 samples in that direction is counted; otherwise, one sample out of every 4 samples in that direction is counted, and there is no specific limitation here.

[0275] In some embodiments, determining one or more candidate texture feature indexes of the current block based on the candidate samples may include: determining the horizontal gradient value and the vertical gradient value of the candidate sample; determining the texture feature index and the gradient intensity value corresponding to the candidate sample based on the horizontal gradient value and the vertical gradient value of the candidate sample; determining a texture feature statistics table based on the texture feature index and the gradient intensity value corresponding to the candidate sample; and determining one or more candidate texture feature indexes of the current block based on the texture feature statistics table.

[0276] It should be noted that, in an embodiment of the present application, when determining the texture feature index and gradient intensity value corresponding to the candidate sample based on the horizontal gradient value and vertical gradient value of the candidate sample, it can include: performing angle mapping based on the horizontal gradient value and vertical gradient value of the candidate sample to determine the texture feature index corresponding to the candidate sample; and performing gradient intensity calculation based on the horizontal gradient value and vertical gradient value of the candidate sample to determine the gradient intensity value corresponding to the candidate sample.

[0277] In a specific embodiment, performing angle mapping based on the horizontal gradient value and the vertical gradient value of the candidate sample to determine the texture feature index corresponding to the candidate sample may include: determining the texture feature index corresponding to the candidate sample using a preset lookup table based on the horizontal gradient value and the vertical gradient value of the candidate sample.

[0278] In this embodiment of the present application, the horizontal gradient value of the candidate sample can be expressed as grad x Indicates that the vertical gradient value of the candidate sample can be expressed as grad y In this way, according to grad x and grad y Deriving the texture feature index (or referred to as a “virtual intra prediction mode”) can be achieved by looking up a table.

[0279] For example, if abs(grad x ) is equal to 0 and abs(grad y ) is not equal to 0, then there is horizontal texture, corresponding to intra prediction mode 18 in VVC. y ) is equal to 0 and abs(grad x ) is not equal to 0, then there is vertical texture, corresponding to intra prediction mode 50 in VVC. x ) and abs(grad y ) are not equal to 0, if abs(grad x ) is equal to abs(grad y ), and grad x and grad yThe symbols are the same, corresponding to intra prediction mode 34 in VVC. If abs(grad x ) is equal to 2 times abs(grad y ), and grad x and grad y The symbols are the same, corresponding to intra prediction mode 40 in VVC. In addition, other situations can be determined by looking up the table according to the same principle.

[0280] In a specific embodiment, performing gradient strength calculation based on the horizontal gradient value and the vertical gradient value of the candidate sample to determine the gradient strength value corresponding to the candidate sample may include: performing an addition operation on the absolute value of the horizontal gradient value and the absolute value of the vertical gradient value to determine the gradient strength value corresponding to the candidate sample.

[0281] Here, the gradient strength value corresponding to the candidate sample can be recorded as amp. For example, amp=abs(grad x )+abs(grad y ).

[0282] It should be noted that, in the embodiment of the present application, the horizontal gradient value and the vertical gradient value of the candidate sample can be calculated using the Sobel operator. For example, the Sobel operator is as follows:

[0283] Operator for horizontal gradient value:

[0284] Operator for vertical gradient value:

[0285] So, assuming that the sample value at the sample position (x, y) is P x,y , then the horizontal gradient value grad x And the vertical gradient value grad y The calculation of grad is as follows: x =P x+1,y-1 +2*P x+1,y +P x+1,y+1 -P x-1,y-1 -2*P x-1,y -P x-1,y+1 (5) grad y =P x-1,y+1 +2*P x,y+1 +P x+1,y+1 -P x-1,y-1 -2*P x,y-1 -P x+1,y-1 (6)

[0286] It should also be noted that, in this embodiment of the present application, the candidate samples may be set to exclude the samples in the outermost row, column, and top, bottom, left, and right of the current block. Considering that the Sobel operator uses the samples in the outermost row, column, and top, bottom, left, and right of the current sample, the embodiment of the present application may be set to exclude the gradients of the samples in the outermost row, column, and top, bottom, left, and right of the current block.

[0287] In some embodiments, determining a texture feature statistics table based on the texture feature index and gradient intensity value corresponding to the candidate samples may include: when the number of candidate samples is at least one, determining at least one texture feature index and at least one corresponding gradient intensity value; determining at least one reference texture feature index with mutually different characteristics based on the at least one texture feature index, and accumulating the gradient intensity values ​​belonging to the same reference texture feature index based on the at least one gradient intensity value to determine the gradient intensity cumulative value corresponding to the at least one reference texture feature index; determining a texture feature statistics table based on the at least one reference texture feature index and the gradient intensity cumulative value corresponding to the at least one reference texture feature index.

[0288] That is to say, in an embodiment of the present application, taking at least part of the samples in the prediction block as candidate samples as an example, the gradients of all or part of the samples in the prediction block are calculated. Generally speaking, the horizontal gradient value and the vertical gradient value can be calculated. Here, the Sobel operator can be used to calculate the gradient value. For a certain sample, the texture direction of the sample can be inferred based on its horizontal gradient value and vertical gradient value. For example, if the horizontal gradient value is non-zero and the vertical gradient value is zero, then the texture of the sample is in the vertical direction. Conversely, if the horizontal gradient value is zero and the vertical gradient value is non-zero, then the texture of the sample is in the horizontal direction. For example, if the horizontal gradient value and the vertical gradient value are equal and not zero, then the texture of the sample is 45 degrees. Of course, in the embodiment of the present application, there are many other cases where the horizontal gradient value and the vertical gradient value are not zero, and the texture direction of the sample can be determined based on their ratio. In this way, the gradient intensity value of each sample can be mapped to the corresponding texture feature index. A texture feature statistics table is constructed, and the gradient intensity value of each calculated sample is added to the corresponding texture feature index item in the statistics table to obtain the final texture feature statistics table. Then, one or more candidate texture feature indexes of the current block can be determined based on the texture feature statistics table.

[0289] In some embodiments, determining one or more candidate texture feature indexes for a current block based on a texture feature statistics table may include: sorting the texture feature statistics table from high to low according to gradient intensity accumulation values, determining reference texture feature indexes corresponding to top N gradient intensity accumulation values, and determining the N reference texture feature indexes as the one or more candidate texture feature indexes for the current block, where N is a positive integer.

[0290] That is to say, in the embodiment of the present application, after the texture feature statistics table is constructed, in order to reduce complexity, the texture feature statistics table can also be sorted in descending order according to the accumulated gradient intensity accumulation values, and then only the top N reference texture feature indexes are selected. Here, for complexity considerations, it is also possible to maintain only a candidate texture feature list of length N, which contains one or more candidate texture feature indexes, and the candidate texture feature list is sorted from high to low according to the gradient intensity accumulation value. In addition, in the embodiment of the present application, the value of N can be 2, 3, 4, 5, ..., 10, etc., and there is no specific limitation on the value of N here.

[0291] It can be understood that in the embodiment of the present application, considering that the angles of some adjacent intra-frame prediction modes are very close, in order to exclude intra-frame prediction modes that are too close, the method may also include: pruning the N reference texture feature indexes in the candidate texture feature list to determine one or more candidate texture feature indexes for the current block.

[0292] In some embodiments, pruning N reference texture feature indexes to determine one or more candidate texture feature indexes for the current block may include: determining a first candidate texture feature index based on a reference texture feature index at a first position among the N reference texture feature indexes; when a second condition is satisfied between other reference texture feature indexes other than the first position among the N reference texture feature indexes and the i-th candidate texture feature index, determining an i+1-th candidate texture feature index based on the other reference texture feature indexes to determine one or more candidate texture feature indexes for the current block; wherein i is an integer greater than zero and less than N.

[0293] It should be noted that, in the embodiment of the present application, the second condition may include: the difference between the i-th candidate texture feature index and the i+1-th candidate texture feature index satisfies a preset threshold, i.e., there is a certain difference between two adjacent candidate texture feature indexes. Alternatively, when each candidate texture feature index corresponds to a candidate transform core group, it can also be said that the difference between the i-th candidate transform core group and the i+1-th candidate transform core group satisfies the preset threshold.

[0294] It should also be noted that, in the embodiment of the present application, the N reference texture feature indexes are sorted from high to low according to the accumulated gradient strength values. In this case, determining the first candidate texture feature index based on the reference texture feature index in the first position among the N reference texture feature indexes may include: determining the first candidate texture feature index based on the reference texture feature index with the largest accumulated gradient strength value among the N reference texture feature indexes.

[0295] It should also be noted that, in the embodiment of the present application, the preset threshold can be represented by THR, the i-th candidate texture feature index can be represented by candFeature(i), and the i+1-th candidate texture feature index can be represented by candFeature(i+1). In a specific embodiment, the difference between the i-th candidate texture feature index and the i+1-th candidate texture feature index meets the preset threshold, which can include: candFeature(i+1)+THR<candFeature(i)||candFeature(i+1)-THR> candFeature(i).

[0296] It should also be noted that in the embodiments of the present application, the THR value may be 3, 4, 5, 6, etc. Thus, when the cumulative values ​​of multiple adjacent angles are very high, this pruning method will preferentially select candidate texture feature indices with a certain degree of discrimination. In one possible embodiment, THR is equal to 0 or is not set, that is, only the candidate texture feature indices need to be different. In another possible embodiment, pruning can also be omitted, that is, pruning is not a necessary operation step.

[0297] It is also understandable that in the embodiments of the present application, the above method does not take into account some intra-frame prediction modes derived from the DIMD, TIMD, SGPM, and other modes themselves. Therefore, in some embodiments, the method may further include: determining one or more intra-frame prediction modes derived from the prediction mode of the current block; determining one or more candidate transform core groups based on the one or more intra-frame prediction modes, and adding the one or more candidate transform core groups to the first candidate list.

[0298] In some embodiments, the method further includes: when the first candidate list is not full, determining a preset texture feature index of the current block; determining one or more candidate transform core groups according to the preset texture feature index, and adding the one or more candidate transform core groups to the first candidate list.

[0299] In some embodiments, the method further includes: when the first candidate list is not filled, determining candidate samples for deriving texture feature indexes; determining one or more candidate texture feature indexes of the current block based on the candidate samples; determining one or more candidate transform core groups based on the one or more candidate texture feature indexes, and adding the one or more candidate transform core groups to the first candidate list.

[0300] That is to say, in the embodiment of the present application, some modes derived from the DIMD, TIMD, SGPM and other modes themselves are taken into consideration. For example, DIMD itself will derive one or several intra-frame prediction modes for weighting, and TIMD itself will also derive one or several intra-frame prediction modes for weighting. SGPM not only has two intra-frame prediction modes, but also has a "partitioning" mode that can also find the corresponding intra-frame prediction mode, and the residual often appears in the boundary area of ​​the "partition". Therefore, one possible implementation method is to determine the first candidate list based on the intra-frame prediction mode derived from the DIMD, TIMD, SGPM and other modes themselves and the candidate texture feature index derived by the above method; or another possible implementation method is to determine the first candidate list based on the intra-frame prediction mode derived from the DIMD, TIMD, SGPM and other modes themselves and the default texture feature index.

[0301] In addition, in the embodiment of the present application, since DIMD, TIMD, and SGPM can all derive more than one intra-frame prediction mode, these modes can also give priority to using multiple modes derived by each mode itself to determine the candidate texture feature index. When the modes derived by each mode itself cannot fill all the candidate texture feature indexes, one possible method is to add a default texture feature index. Another possible method is to use the above-mentioned sorted candidate texture feature list of length N to determine the candidate texture feature index.

[0302] For example, when the prediction mode of the current block is the DIMD mode, if it uses the prediction values ​​of multiple intra-frame prediction modes for weighting during prediction, then the multiple intra-frame prediction modes used for weighting can be sequentially tried to be determined as candidate texture feature indexes.

[0303] For example, when the prediction mode of the current block is the TIMD mode, if it uses the prediction values ​​of multiple intra-frame prediction modes for weighting during prediction, then the multiple intra-frame prediction modes used for weighting can be sequentially tried to be determined as candidate texture feature indexes.

[0304] For example, when the prediction mode of the current block is the SGPM mode, the intra-frame prediction mode corresponding to the "partitioning" mode derived therefrom and the two intra-frame prediction modes used for prediction may be sequentially attempted to be determined as candidate texture feature indexes.

[0305] In another possible implementation, for determining the first candidate list of the current block, the method may include: determining a first candidate transformation core group based on the reference texture feature index at the first position in the candidate texture feature list; when the second condition is not satisfied between all reference texture feature indexes except the first position in the candidate texture feature list and the first candidate transformation core group, determining a second candidate transformation core group based on the reference texture feature index at the second position in the candidate texture feature list; and determining the first candidate list based on the first candidate transformation core group and the second candidate transformation core group.

[0306] It should be noted that in an embodiment of the present application, the first candidate transformation core group is determined based on the reference texture feature index in the first position in the candidate texture feature list. Specifically, it can be: the first candidate transformation core group is determined based on the reference texture feature index with the largest gradient intensity accumulated value in the candidate texture feature list.

[0307] It should also be noted that, in the embodiment of the present application, taking the first candidate list indicating two candidate transform core groups as an example, the first candidate transform core group can be represented by candFeature0, and the second candidate transform core group can be represented by candFeature1. For example, the intra-frame prediction mode with the largest cumulative gradient strength value is the first candidate transform core group candFeature0, then when selecting the second candidate transform core group candFeature1, it is required that candFeature1 and candFeature0 have a certain gap, such as candFeature1+THR<candFeature0||candFeature1-THR> If no matching candidate is found after checking all N-1 reference texture feature indices, a second candidate transform core group, candFeature1, can be determined based on the second-ranked reference texture feature index among the N reference texture feature indices. In other words, the candidate transform core groups corresponding to the first two reference texture feature indices with the largest cumulative gradient strength values ​​can be added to the first candidate list.

[0308] In another possible implementation, for determining the first candidate list of the current block, the method may include: determining a first candidate transformation core group based on the reference texture feature index at the first position in the candidate texture feature list; when the second condition is not satisfied between all reference texture feature indexes other than the first position in the candidate texture feature list and the first candidate transformation core group, determining a second candidate transformation core group based on a preset texture feature index; and determining the first candidate list based on the first candidate transformation core group and the second candidate transformation core group.

[0309] It should be noted that in an embodiment of the present application, if no one meets the requirements after checking all N-1 reference texture feature indexes, then the default texture feature index of the current block can also be determined, and then the candidate transform core group corresponding to the reference texture feature index with the largest gradient intensity accumulation value and the default texture feature index is added to the first candidate list.

[0310] In another possible implementation, for determining the first candidate list of the current block, the method may include: determining a first candidate transform core group based on a first intra-frame prediction mode derived from a prediction mode of the current block; determining a second candidate transform core group based on the first reference texture feature index when a second condition is satisfied between the first reference texture feature index in the candidate texture feature list and the first candidate transform core group; and determining the first candidate list based on the first candidate transform core group and the second candidate transform core group.

[0311] It should be noted that in this embodiment of the present application, the first candidate list not only considers the candidate texture feature indexes derived from the horizontal and vertical gradient values ​​of the candidate samples, but also considers the intra-frame prediction mode derived from the prediction mode of the current block itself. The following describes this in detail with several examples.

[0312] Exemplarily, when the prediction mode of the current block is the DIMD mode, the first intra prediction mode derived from the DIMD mode is used as candFeature0.

[0313] Exemplarily, when the prediction mode of the current block is the TIMD mode, the first intra-frame prediction mode derived from the TIMD mode is used as candFeature0.

[0314] Exemplarily, when the prediction mode of the current block is the SGPM mode, the intra-frame prediction mode corresponding to the SGPM "partition" mode is used as candFeature0.

[0315] Then, candFeature1 is determined according to the above method. For example, if a reference texture feature index among the N reference texture feature indexes is tried, starting from the first position, and a reference texture feature index meets the THR restriction, it can be used as candFeature1.

[0316] It should also be noted that in the embodiment of the present application, for modes such as IBC and ITMP, a prediction block or a prediction block plus a template can be used to derive a candidate texture feature index (or intra-frame prediction mode).

[0317] It should also be noted that in an embodiment of the present application, if the candidate samples used by the MTSS technology to derive N reference texture feature indexes are the same as the candidate samples used by the DIMD mode, then the first intra-frame prediction mode derived by DIMD and the first reference texture feature index derived by the MTSS technology are the same.

[0318] S2802: Determine a transformation core of the current block according to the transformation core group.

[0319] It should be noted that after determining the transform core group of the current block, the transform core of the current block can be further determined. In some embodiments, determining the transform core of the current block based on the transform core group may include: determining a transform core index of the current block; and determining the transform core of the current block based on the transform core group and the transform core index.

[0320] It should also be noted that when the first candidate list indicates transform cores included in at least two transform core groups, the method may further include: determining a transform core index of the current block; and determining the transform core of the current block according to the first candidate list and the transform core index.

[0321] In this embodiment of the present application, for the first candidate list, assuming that the first candidate list indicates the transform cores included in two candidate transform core groups, if the first candidate transform core group includes 3 candidate transform cores and the second candidate transform core group includes 2 candidate transform cores, then the first candidate list may indicate 5 candidate transform cores; if the first candidate transform core group includes 3 candidate transform cores and the second candidate transform core group includes 3 candidate transform cores, then the first candidate list may indicate 6 candidate transform cores. In this case, after determining the transform core index of the current block, the transform core of the current block can be determined in the first candidate list based on the transform core index.

[0322] It should also be noted that, in the embodiment of the present application, the transform core index of the current block may be a positive integer, such as 1, 2, 3, 4, 5, 6, etc. The transform core index of the current block may be determined by directly decoding the bitstream, or may be determined by decoding the value of the second syntax element.

[0323] For example, one possible implementation is to decode the bitstream and determine the transform kernel index of the current block. Alternatively, another possible implementation is to decode the bitstream and determine the value of the second syntax element; and when the second syntax element indicates that the current block uses the first transform mode, determine the transform kernel index of the current block based on the value of the second syntax element.

[0324] It should also be noted that, in this embodiment of the present application, the first transform mode may be LFNST / NSPT, and the second syntax element may be represented by lfnst_idx. The second syntax element may be used to indicate whether the current block uses the first transform mode, and the corresponding transform kernel index when the current block uses the first transform mode.

[0325] It should also be noted that, in this embodiment of the present application, if the value of the second syntax element is the third value, it is determined that the current block does not use the first transform mode; if the value of the second syntax element is the fourth value, it is determined that the current block uses the first transform mode and the corresponding transform kernel index. The third value can be set to 0, and the fourth value can be set to a non-zero value, such as 1, 2, 3, 4, 5, 6, etc.

[0326] That is, in this embodiment of the present application, for LFNST / NSPT, the transform core index of the current block can also be represented by lfnst_idx. Wherein, lfnst_idx being 0 indicates that the current block does not use LFNST / NSPT. Each transform core group of LFNST / NSPT in ECM has 3 transform cores, so the value of lfnst_idx is 1, 2, or 3, which means that the current block uses the first transform core, the second transform core, or the third transform core of the selected transform core group of LFNST / NSPT.

[0327] In this embodiment of the present application, if the prediction mode of the current block is a special intra-frame prediction mode, then it has more than one selectable transform core group. For example, if it has two selectable transform core groups, then the possible values ​​of lfnst_idx are 0, 1, 2, 3, 4, 5, and 6. 1, 2, and 3 correspond to the three transform cores of the first transform core group, and 4, 5, and 6 correspond to the three transform cores of the second transform core group.

[0328] In a specific embodiment, the binary symbol correspondence table of lfnst_idx is shown in Table 7.

[0329] Table 7

[0330] The third binary symbol, that is, the binary symbol with BinIdx being 2, can also be understood as selecting the first candidate transformation core group or the second candidate transformation core group.

[0331] It can be understood that in an embodiment of the present application, the transform core group here can be one of the at least two candidate transform core groups indicated by the first candidate list. In addition, in an embodiment of the present application, the transform core group index of the current block can be represented by lfnst_feature_idx, or by lfnst_set_idx. Among them, the transform core group index of the current block can be an integer greater than or equal to zero, such as 0, 1, 2, etc. Exemplarily, if the value of lfnst_feature_idx is equal to 0, it indicates that the first candidate transform core group is selected as the transform core group of the current block; if the value of lfnst_feature_idx is equal to 1, it indicates that the second candidate transform core group is selected as the transform core group of the current block.

[0332] It should be noted that after determining the transform core group of the current block, the transform core of the current block can be determined based on the transform core group. Specifically, this can be done by first determining the transform core index of the current block, and then determining the transform core of the current block based on the transform core group and the transform core index.

[0333] For example, one possible implementation is to decode the bitstream and determine the transform kernel index of the current block. Alternatively, another possible implementation is to decode the bitstream and determine the value of the second syntax element; when the second syntax element indicates that the current block uses the first transform mode, determine the transform kernel index of the current block based on the value of the first syntax element.

[0334] It should also be noted that in an embodiment of the present application, the first transform mode may be LFNST / NSPT, and the first syntax element may be represented by lfnst_idx. The first syntax element may be used to indicate whether the current block uses the first transform mode, and the corresponding transform core index when the current block uses the first transform mode. Exemplarily, in this case, for LFNST / NSPT, the transform core index of the current block may also be represented by lfnst_idx. In VVC, lfnst_idx may have three values, namely 0, 1, and 2. A lfnst_idx of 0 indicates that the current block does not use LFNST. Each transform core group of LFNST in VVC has two transform cores, so a lfnst_idx value of 1 or 2 indicates that the current block uses the first or second transform core of the selected transform core group of LFNST. In existing ECMs, lfnst_idx may have four values, namely 0, 1, 2, and 3. Where lfnst_idx is 0, which means that the current block does not use LFNST / NSPT. Each transform core group of LFNST / NSPT in ECM has 3 transform cores, so the value of lfnst_idx is 1, 2, or 3, which means that the current block uses the first transform core, the second transform core, or the third transform core of the selected transform core group of LFNST / NSPT.

[0335] In a specific embodiment, the binary symbol correspondence table of lfnst_idx is shown in Table 8.

[0336] Table 8

[0337] It should also be noted that in this embodiment of the present application, when decoding the bitstream and determining the transform core group index of the current block, the method may further include: when the current block uses the first transform mode, decoding the bitstream and determining the transform core group index of the current block. In other words, when the current block uses the MTSS technology and lfnst_idx>0, the step of decoding the bitstream and determining the transform core group index of the current block is performed.

[0338] S2803 , determining a transform coefficient of the current block, and transforming the transform coefficient of the current block according to the transform kernel to determine a residual block of the current block.

[0339] It should be noted that, in the embodiment of the present application, determining the transformation coefficient of the current block may include: decoding the code stream to determine the quantization coefficient of the current block; and dequantizing the quantization coefficient of the current block to determine the transformation coefficient of the current block.

[0340] It should also be noted that, in an embodiment of the present application, when transforming the transform coefficients of the current block according to the transform kernel to determine the residual block of the current block, it can include: performing an inseparable basic transform on the transform coefficients of the current block according to the transform kernel to determine the residual block of the current block; or performing a low-frequency inseparable transform on the transform coefficients of the current block according to the transform kernel to determine the transform block of the current block, and performing a discrete cosine transform on the transform block of the current block to determine the residual block of the current block.

[0341] In a specific embodiment, if the size parameter of the current block meets the first condition, an inseparable basic transform is performed on the transform coefficients of the current block according to the transform kernel to determine the residual block of the current block; if the size parameter of the current block meets the second condition, a low-frequency inseparable transform is performed on the transform coefficients of the current block according to the transform kernel to determine the transform block of the current block, and a discrete cosine transform is performed on the transform block of the current block to determine the residual block of the current block.

[0342] Here, the size parameter of the current block satisfies the first condition, including: the size parameter of the current block is relatively small, for example, the size parameter of the current block is less than a certain threshold. In other words, for relatively small blocks, an NSPT transform kernel is used, i.e., an inverse NSPT transform is performed on the transform coefficients of the current block according to the transform kernel to determine a residual block for the current block.

[0343] Here, the size parameter of the current block satisfies the second condition, including: the size parameter of the current block is relatively large, for example, the size parameter of the current block is greater than a certain threshold. In other words, for relatively large blocks, an LFNST transform kernel is used. Specifically, an inverse LFNST transform is performed on the transform coefficients of the current block based on the transform kernel to determine the transform block of the current block; and an inverse DCT2 transform is performed on the transform block of the current block to determine the residual block of the current block.

[0344] It should also be noted that in the embodiments of the present application, the "inverse transformation" of the transform coefficients at the decoding end may also be referred to as "transformation" in the standard text. The "transformation" and "inverse transformation" in this article correspond to two opposite processes. For example, if the "transformation" converts the numerical values ​​in the spatial domain to the coefficients in the frequency domain, then the "inverse transformation" converts the coefficients in the frequency domain to the numerical values ​​in the spatial domain. "Inverse" is relative to "positive", and they are essentially both transformations. It should be noted that if the standard only stipulates decoding, then the "transformation" in the standard text is the decoding part, specifically referring to the "inverse transformation" in this article. The "inverse transformation" of the transform coefficients at the decoding end may also be referred to as "transformation" in the standard text.

[0345] In some embodiments, referring to FIG. 31 , after step S2803, the method may further include:

[0346] S3101, perform intra-frame prediction on the current block to determine a prediction block for the current block.

[0347] S3102 : Determine a reconstructed block of the current block according to the prediction block of the current block and the residual block of the current block.

[0348] It should be noted that in the embodiment of the present application, for step S3101, this step can be operated in parallel with steps S2801 to S2803, or it can be executed before steps S2801 to S2803, or it can be executed after steps S2801 to S2803. The order of the steps is not specifically limited here.

[0349] It should also be noted that, in the embodiment of the present application, after the prediction block of the current block is determined, an addition operation may be performed on the prediction block of the current block and the residual block of the current block to determine the reconstructed block of the current block.

[0350] Simply put, after determining the prediction block, the decoder derives candidate texture feature indices based on the prediction block. The decoder then uses these indices to determine the transform core group for NSPT / LFNST. If a transform core group has multiple selectable transform cores, the decoder determines the transform core by decoding the lfnst_nspt_idx field in the bitstream. The decoding of lfnst_nspt_idx in the bitstream is independent of the process of determining the transform core group. Quantized coefficients are obtained from the bitstream through entropy decoding.

[0351] If it is NSPT transformation, the quantized coefficients are inversely quantized to obtain decoded transform coefficients, the decoded transform coefficients are inversely NSPT transformed to obtain decoded residual blocks, and finally a reconstructed block is obtained based on the decoded residual block and the prediction block.

[0352] If it is LFNST transform, the quantized coefficients are inversely quantized to obtain decoded transform coefficients, the decoded transform coefficients are inversely LFNST transformed, and then inverse DCT2 transformed to obtain a decoded residual block, and finally a reconstructed block is obtained based on the decoded residual block and the prediction block.

[0353] In addition, in some embodiments, referring to FIG. 32 , when the current block does not use the MTSS technology, the method may further include:

[0354] S3201: Determine the texture feature index of the current block.

[0355] S3202: Determine a transformation kernel of the current block according to the texture feature index.

[0356] S3203 : Determine a transformation coefficient of the current block, and transform the transformation coefficient of the current block according to the transformation kernel to determine a residual block of the current block.

[0357] It should be noted that, in an embodiment of the present application, determining the transform core of the current block according to the texture feature index may include: determining the transform core group of the current block according to the texture feature index; decoding the code stream to determine the transform core index of the current block; and determining the transform core of the current block according to the transform core group and the transform core index.

[0358] In some embodiments, the method further includes: when the number of samples of the current block is less than a minimum sample threshold, executing the step of determining a texture feature index of the current block.

[0359] In some embodiments, the size of the current block includes height and width; the method further comprises: when the height or width of the current block is less than a minimum size threshold, performing a step of determining a texture feature index of the current block.

[0360] In some embodiments, the method further comprises: when the prediction mode of the current block is a prediction mode outside the first prediction mode set, performing a step of determining a texture feature index of the current block.

[0361] It should be noted that, in the embodiment of the present application, when the prediction mode of the current block is a prediction mode outside the first prediction mode set, the prediction mode of the current block may be one of the prediction modes in the fourth prediction mode set. The fourth prediction mode set includes at least: a DC mode, a PLANAR mode, and an angular prediction mode.

[0362] It should also be noted that, in the embodiment of the present application, the modes in the fourth prediction mode set are relatively simple prediction modes. For example, a classification can be made, where the DC mode, PLANAR mode, and various angle prediction modes are classified as the fourth prediction mode set, and the DIMD mode, TIMD mode, MIP mode, EIP mode, SGPM mode, ITMP mode, and IBC mode are classified as the first prediction mode set.

[0363] For example, the first prediction mode set may include only one or more of the DIMD mode, TIMD mode, MIP mode, EIP mode, SGPM mode, ITMP mode, and IBC mode. For example, the first prediction mode set includes the DIMD mode, TIMD mode, and SGPM mode. The other modes belong to the fourth prediction mode set. The encoding method of lfnst_idx of the fourth prediction mode set is the same as that of the related art, while the encoding method of lfnst_idx of the first prediction mode set is different from that of the related art.

[0364] For example, each transform kernel group in LFNST / NSPT has three transform kernels. Blocks using the fourth prediction mode set can only select one transform kernel group, while blocks using the first prediction mode set can select two transform kernel groups, each with three transform kernels. If the prediction mode of the current block belongs to the fourth prediction mode set, it can only select one texture feature index, and the possible values ​​of lfnst_idx are 0, 1, 2, or 3. If the prediction mode of the current block belongs to the first prediction mode set, the possible values ​​of lfnst_idx are 0, 1, 2, 3, 4, 5, or 6. 1, 2, and 3 correspond to the three transform kernels in the transform kernel group corresponding to the first texture feature index, and 4, 5, and 6 correspond to the three transform kernels in the transform kernel group corresponding to the second texture feature index. The binary symbol correspondence table for lfnst_idx for blocks using the fourth prediction mode set is shown in Table 8, and the binary symbol correspondence table for lfnst_idx for blocks using the first prediction mode set is shown in Table 7.

[0365] It is also understandable that embodiments of the present application can use a high-level syntax to control the switching of the present technical solution. In some embodiments, the method further includes: decoding the bitstream, determining the value of a third syntax element; and when the third syntax element indicates that the current sequence allows the use of a multi-transform core group selection technique, performing the step of determining a transform core group index for the current block; wherein the current sequence includes the current block.

[0366] In the embodiment of the present application, the third syntax element may be represented by sps_mtss_enabled_flag, and the third syntax element is a syntax element in a sequence parameter set (SPS).

[0367] It should also be noted that, in an embodiment of the present application, if the value of the third syntax element is the fifth value, it is determined that the third syntax element indicates that the current sequence allows the use of MTSS technology; if the value of the third syntax element is the sixth value, it is determined that the third syntax element indicates that the current sequence does not allow the use of MTSS technology.

[0368] In an embodiment of the present application, the fifth value is different from the sixth value, and the fifth value and the sixth value can be in parameter form or in digital form. Specifically, the third syntax element can be a parameter written in the profile or the value of a flag, which is not specifically limited here. Exemplarily, the fifth value can be 1 and the sixth value can be 0; or, the fifth value can be 0 and the sixth value can be 1; or, the fifth value can be true and the sixth value can be false; or, the fifth value can be false and the sixth value can be true. In a specific embodiment, the fifth value is 1 and the sixth value is 0.

[0369] That is to say, the embodiment of the present application can use a high-level syntax to control the switch of the present technical solution. For example, a sequence-level flag is used, such as adding the syntax element sps_mtss_enabled_flag in the sequence parameter set. If the value of sps_mtss_enabled_flag is 1, the current sequence allows the use of MTSS technology; if the value of sps_mtss_enabled_flag is 0, the current sequence does not allow the use of MTSS technology. Among them, when the use of MTSS technology is allowed, more specifically, the method of decoding the texture feature index and LFNST / NSPT transform core index described in the present technical solution at the block level (CU or TU) is allowed; if the current sequence does not allow the use of MTSS technology, more specifically, the method of texture feature index and LFNST / NSPT transform core index described in the present technical solution will not be used at the block level (CU or TU).

[0370] In some embodiments, the method further includes: decoding the code stream to determine the value of a third syntax element; when the third syntax element indicates that the current sequence allows the use of a multi-transform core group selection mode, decoding the code stream to determine the value of a fourth syntax element; when the fourth syntax element indicates that the current image allows the use of a multi-transform core group selection technology, executing the step of determining a transform core group index of the current block.

[0371] In the embodiment of the present application, the current sequence may include a current picture, and the current picture includes a current block. The fourth syntax element may be represented by ph_inter_lfnst_nspt_enabled_flag, and the fourth syntax element is a picture-level syntax element.

[0372] It should also be noted that, in an embodiment of the present application, if the value of the fourth syntax element is the fifth value, it is determined that the fourth syntax element indicates that the current image allows the use of MTSS technology; if the value of the fourth syntax element is the sixth value, it is determined that the fourth syntax element indicates that the current image does not allow the use of MTSS technology.

[0373] In some embodiments, the method further includes: decoding the bitstream and determining the value of a third syntax element; when the third syntax element indicates that the current sequence allows the use of a multi-transform core group selection mode, decoding the bitstream and determining the value of a fifth syntax element; when the fifth syntax element indicates that the current slice allows the use of a multi-transform core group selection technology, performing the step of determining a transform core group index of the current block; wherein the current sequence includes the current slice, and the current slice includes the current block.

[0374] In the embodiment of the present application, the current sequence may include a current slice, and the current slice includes a current block. The fifth syntax element may be represented by sh_inter_lfnst_nspt_enabled_flag, and the fifth syntax element is a slice-level syntax element.

[0375] It should also be noted that, in an embodiment of the present application, if the value of the fifth syntax element is the fifth value, it is determined that the fifth syntax element indicates that the current slice allows the use of MTSS technology; if the value of the fifth syntax element is the sixth value, it is determined that the fifth syntax element indicates that the current slice does not allow the use of MTSS technology.

[0376] In an embodiment of the present application, the fifth value is different from the sixth value, and the fifth value and the sixth value can be in parameter form or in digital form. Specifically, the fourth syntax element or the fifth syntax element can be a parameter written in the profile, or it can be the value of a flag, which is not specifically limited here. Exemplarily, the fifth value can be 1 and the sixth value can be 0; or, the fifth value can be 0 and the sixth value can be 1; or, the fifth value can be true and the sixth value can be false; or, the fifth value can be false and the sixth value can be true. In a specific embodiment, the fifth value is 1 and the sixth value is 0.

[0377] That is, in the embodiment of the present application, in addition to the sequence-level syntax element sps_mtss_enabled_flag, other levels of syntax can also be used to achieve more flexible control, such as a flag in the Picture Parameter Set (PPS), or a flag in the picture header or slice header, etc. For example, first determine in the SPS whether the current sequence can use the MTSS technology. If the current sequence uses the MTSS technology, then set a sh_inter_lfnst_nspt_enabled_flag in the slice header to determine whether the current slice uses the MTSS technology, providing higher flexibility.

[0378] It is also understandable that, for the minimum sample threshold, in one possible implementation, the process may include: decoding the bitstream and determining the minimum sample threshold. Alternatively, in another possible implementation, the process may include: decoding the bitstream and determining the value of a third syntax element; when the third syntax element indicates that the current sequence allows the use of the multi-transform kernel group selection mode, decoding the bitstream and determining the value of a sixth syntax element; and determining the minimum sample threshold based on the value of the sixth syntax element.

[0379] In the embodiment of the present application, the minimum sample threshold may be written directly into the bitstream, or written into the bitstream in the form of a sixth syntax element. In addition, the sixth syntax element may be represented by sps_mtss_min_pix, which may be a sequence-level syntax element.

[0380] When decoding the bitstream, the value of the sixth syntax element can be equal to the minimum sample threshold, or decoding can be performed according to a certain mapping rule. For example, if the minimum sample threshold is 32, the value of the sixth syntax element is determined to be 0; if the minimum sample threshold is 64, the value of the sixth syntax element is determined to be 1; if the minimum sample threshold is 256, the value of the sixth syntax element is determined to be 2. In this way, when the value of the sixth syntax element obtained during decoding is 2, it can be determined that the minimum sample threshold is 256.

[0381] That is, in an embodiment of the present application, a high-level syntax can be used to set a minimum sample threshold for applying MTSS technology, such as sps_mtss_min_pix. When the value of sps_mtss_enabled_flag is 1, the decoder parses sps_mtss_min_pix to determine the minimum sample threshold for applying MTSS technology. Using high-level syntax, a trade-off between coding complexity and compression efficiency can be made based on demand. That is, under this method, the decoder needs to support all possible cases of sps_mtss_min_pix, but the encoder can configure the sps_mtss_min_pix required for encoding the current bitstream. For example, when encoding a bitstream, if better compression efficiency is required but encoding time is not particularly important, a relatively small value, such as 16, can be set for sps_mtss_min_pix. If encoding time is particularly important and a certain degree of compression efficiency can be sacrificed, a relatively large value, such as 256, can be set for sps_mtss_min_pix.

[0382] It is also understandable that, for the minimum size threshold, in one possible implementation, the process may include: decoding the bitstream and determining the minimum size threshold. Alternatively, in another possible implementation, the process may include: decoding the bitstream and determining the value of the third syntax element; when the third syntax element indicates that the current sequence allows the use of the multi-transform core group selection mode, decoding the bitstream and determining the value of the seventh syntax element; and determining the minimum size threshold based on the value of the seventh syntax element.

[0383] In the embodiment of the present application, the minimum size threshold may be written directly into the bitstream, or written into the bitstream in the form of the seventh syntax element. In addition, the seventh syntax element may be represented by sps_mtss_min_size, which may be a sequence-level syntax element.

[0384] When decoding the bitstream, the value of the seventh syntax element can be equal to the minimum size threshold, or decoding can be performed according to a certain mapping rule. For example, if the minimum size threshold is equal to 4, the value of the seventh syntax element is determined to be equal to 0; if the minimum sample threshold is equal to 16, the value of the seventh syntax element is determined to be equal to 1. In this way, when the value of the seventh syntax element obtained during decoding is equal to 1, it can be determined that the minimum size threshold is equal to 16.

[0385] That is, in an embodiment of the present application, a high-level syntax can be used to set a minimum size threshold for applying MTSS technology, such as sps_mtss_min_size. When the value of sps_mtss_enabled_flag is 1, the decoder parses sps_mtss_min_size to determine the minimum size threshold for applying MTSS technology. Using high-level syntax, a trade-off between coding complexity and compression efficiency can be made according to needs. That is, under this method, the decoder needs to support all possible cases of sps_mtss_min_size, but the encoder can configure the sps_mtss_min_size required for encoding the current bitstream. For example, when encoding a bitstream, if better compression efficiency is required but encoding time is not particularly important, a relatively small value, such as 4, can be set for sps_mtss_min_size. If encoding time is particularly important and a certain degree of compression efficiency can be sacrificed, a relatively large value, such as 16, can be set for sps_mtss_min_size.

[0386] An embodiment of the present application provides a decoding method, specifically an intra-frame LFNST / NSPT multi-angle selection scheme. First, the transform core group index of the current block is determined, and the transform core group of the current block is determined based on the transform core group index of the current block; then, based on the transform core group, the transform kernel of the current block is determined; then, the transform coefficient of the current block is determined, and the transform coefficient of the current block is transformed based on the transform kernel to determine the residual block of the current block. In this way, the transform core group of the current block is determined according to the multi-transform core group selection technology, and then the transform kernel of the current block is determined therefrom. In this way, for the current block predicted using certain intra-frame prediction modes, when determining the transform kernel of the current block, multiple candidate texture features derived by the multi-transform core group selection technology can be used to guide the transform, thereby improving the accuracy of the transform prediction, thereby improving the compression efficiency, and further improving the encoding and decoding performance.

[0387] In another embodiment of the present application, FIG33 is a flow chart of a coding method provided in an embodiment of the present application. As shown in FIG33 , the method may include:

[0388] S3301: Determine a transformation core group for the current block.

[0389] It should be noted that in the embodiments of the present application, the method is applied to an encoder. Specifically, based on the structure of encoder 100 shown in FIG26 , the encoding method of the embodiments of the present application is primarily applied to intra-predicted blocks. Specifically, when the current block uses intra-prediction mode, the optimization scheme proposed here is mainly for the NSPT and LFNST transforms in intra-prediction mode to improve compression efficiency.

[0390] It should also be noted that in the embodiment of the present application, the method is applicable to the Multiple Transform Set Selection (MTSS) method. Among them, NSPT and LFNST are both transformations that process textures of various angles. They may have multiple transformation kernels, and one transformation kernel may be specially optimized for a certain specific angle texture. Of course, in addition to angle textures, NSPT and LFNST also include transformation kernels for processing gradient textures. In fact, these transformation kernels can also be said to be trained KL transforms (Karhunen-Loeve Transform, KLT). That is to say, NSPT and LFNST both have multiple transformation kernels, each of which is designed for a specific texture. Specific textures include angle textures, gradient textures, etc. In addition, gradient textures can be further expanded to include horizontal gradient textures, vertical gradient textures, oblique gradient textures, etc. Furthermore, the MTSS method is not limited to being used only for inseparable transforms such as NSPT and LFNST. The MTSS method can also be applied to separable transforms optimized for specific textures.

[0391] It should also be noted that, in an embodiment of the present application, the intra-frame prediction block can have multiple transform kernel groups, and each intra-frame prediction mode can correspond to a transform kernel group. In other words, each intra-frame prediction mode actually represents a texture feature. Therefore, the intra-frame prediction mode index is also a texture feature index. For example, DC and PLANAR correspond to gradient texture features, and a certain angle prediction mode corresponds to the texture feature of this angle. On the one hand, the texture feature index can avoid the occurrence of intra-frame prediction mode in "inter-frame", and on the other hand, it is also more conducive to possible expansion. For example, an intra-frame prediction mode can correspond to multiple texture features, such as the DC mode can correspond to horizontal gradient texture, vertical gradient texture, oblique gradient texture, etc.

[0392] In the embodiments of the present application, considering that some intra prediction modes are not simple texture features but may contain two or more texture features, the Multiple Transform Set Selection (MTSS) technique can be used. In MTSS, if the intra prediction mode of the current block is a special intra prediction mode, more than one transform set can be selected.

[0393] In the embodiment of the present application, some additional conditions may be added to determine whether the current block uses the MTSS technology. For example, these conditions may include: the number of samples in the current block, the size of the current block, and the prediction mode of the current block. In other words, in the embodiment of the present application, the number of samples in the current block may be selected to determine whether the current block uses the MTSS technology, and / or the size of the current block may be selected to determine whether the current block uses the MTSS technology, and / or the prediction mode of the current block may be selected to determine whether the current block uses the MTSS technology. No limitation is imposed herein.

[0394] In the embodiment of the present application, the MTSS technology increases the complexity of the encoder due to the increase in candidates for the transform core group. Specifically, a block may select one from two or more LFNST / NSPT transform core groups. However, a block in VVC has only one available transform core group. Therefore, one possible implementation method is to limit the size of the block to which the MTSS technology is applicable, so that the MTSS technology can be disabled at the block size where the MTSS technology requires a lot of additional calculations but does not significantly improve the compression efficiency. In short, the embodiment of the present application can limit the block size to which the MTSS technology is applicable.

[0395] In a possible embodiment, the method may further include: determining the number of samples of the current block; and when the number of samples of the current block is greater than or equal to a minimum sample threshold, executing the step of determining a transform core group of the current block.

[0396] For example, a threshold for the minimum number of samples for applying the MTSS technology (i.e., the "minimum sample threshold") can be set, represented by MIN_PIX. If the number of samples (width × height) of a block is less than MIN_PIX, the MTSS technology cannot be used for this block. Otherwise, if the number of samples of this block is greater than or equal to MIN_PIX, the MTSS technology can be used for this block. In the embodiment of the present application, the value of MIN_PIX may be 32, 64, 256, etc. For example, the value of MIN_PIX may be equal to 256.

[0397] In another possible embodiment, the method may further include: determining the size of the current block, wherein the size of the current block includes height and width; when the height and width of the current block are both greater than or equal to a minimum size threshold, executing the step of determining a transform core group for the current block.

[0398] For example, a minimum size threshold (i.e., "minimum size threshold") for applying MTSS technology can be set, represented by MIN_SIZE. If the width or height of a block is less than MIN_SIZE, MTSS technology cannot be used for this block. Otherwise, if the width and height of this block are both greater than or equal to MIN_SIZE, MTSS technology can be used for this block. In the embodiment of the present application, the value of MIN_SIZE may be 8, 16, etc. For example, the value of MIN_PIX may be equal to 8.

[0399] In another possible embodiment, the method may further include: determining a prediction mode of the current block; and when the prediction mode of the current block is one of the first prediction mode set, performing the step of determining a transform core group of the current block.

[0400] In some embodiments, the first prediction mode set may include at least one of the following prediction modes: DC mode, PLANAR mode, and other prediction modes other than angular prediction mode.

[0401] In some embodiments, the first prediction mode set may include at least one of the following prediction modes: a mode for combined prediction using at least two intra-frame prediction modes, the intra-frame prediction mode including at least one of the following: DC mode, PLANAR mode and angle prediction mode; a mode for prediction by copying intra-frame blocks; a mode for prediction using an interpolation filter; a mode for prediction using matrix operations.

[0402] In some embodiments, the first prediction mode set may include at least one of the following prediction modes: DIMD mode, TIMD mode, SGPM mode, MIP mode, EIP mode, ITMP mode, IBC mode, etc.

[0403] In an embodiment of the present application, the mode for combining the prediction values ​​of at least two intra-frame prediction modes may specifically be a DIMD mode, a TIMD mode, and an SGPM mode; wherein the intra-frame prediction mode includes but is not limited to a DC mode, a PLANAR mode, and an angle prediction mode, etc.

[0404] In the embodiment of the present application, the mode for predicting the copied intra-frame block may specifically be the ITMP mode and the IBC mode.

[0405] In the embodiment of the present application, the mode for using the extrapolation filter for prediction may specifically be the EIP mode.

[0406] In the embodiment of the present application, the mode for prediction using matrix operations may specifically be a MIP mode.

[0407] That is to say, the modes in the first prediction mode set are relatively complex prediction modes, and their corresponding textures may contain two or more texture features. For example, the DIMD mode and the TIMD mode can both weight the prediction values ​​of two or more intra-frame prediction modes, the SGPM mode weights the prediction values ​​of the two intra-frame prediction modes with a weight matrix, the MIP mode predicts based on a matrix operation, the EIP mode predicts based on an extrapolation filter, and the ITMP mode and the IBC mode predict based on copying a reconstructed reference block. Their texture features are not as simple as those of the DC mode, the PLANAR mode, etc. That is to say, when the prediction mode of the current block is any one of the first prediction mode set, the current block can use the MTSS technology.

[0408] It is understandable that in embodiments of the present application, when determining whether the MTSS technology is used for the current block, it is first necessary to determine the transform core group for the current block. In some embodiments, determining the transform core group for the current block may include: calculating the encoding cost for the current block based on at least two candidate transform core groups, determining cost results corresponding to each of the at least two candidate transform core groups; determining the minimum cost result among the cost results corresponding to the at least two candidate transform core groups, and determining the candidate transform core group corresponding to the minimum cost result as the transform core group for the current block.

[0409] In a possible embodiment, the method further includes: determining a transform core group index of the current block; encoding the transform core group index of the current block, and writing the obtained encoding bits into a bitstream.

[0410] In another possible embodiment, the method further includes: determining a transform core group index of the current block; determining a value of a first syntax element based on the transform core group index of the current block; encoding the value of the first syntax element and writing the obtained coded bits into a bitstream.

[0411] It should be noted that, in an embodiment of the present application, the transform core group index can be used to indicate the number of the transform core group of the current block in at least two candidate transform core groups, and the transform core group index can be represented by lfnst_feature_idx, or it can also be represented by lfnst_set_idx. Among them, the transform core group index of the current block can be an integer greater than or equal to zero, such as 0, 1, 2, etc. Exemplarily, if the value of lfnst_feature_idx is equal to 0, it indicates that the first candidate transform core group is selected as the transform core group of the current block; if the value of lfnst_feature_idx is equal to 1, it indicates that the second candidate transform core group is selected as the transform core group of the current block.

[0412] It should also be noted that, in the embodiment of the present application, the transform core group index of the current block can be directly written into the bitstream, or can be represented by the first syntax element and then the value of the first syntax element is written into the bitstream.

[0413] It should also be noted that, in an embodiment of the present application, the first syntax element can be represented by lfnst_feature_idx or lfnst_set_idx. The first syntax element can be used to indicate the transform core group index of the current block, specifically the number of the transform core group of the current block in at least two candidate transform core groups. The value of the first syntax element can be an integer greater than or equal to zero, such as 0, 1, 2, etc. Exemplarily, if the value of the first syntax element is equal to 0, it indicates that the first candidate transform core group is selected as the transform core group of the current block; if the value of the first syntax element is equal to 1, it indicates that the second candidate transform core group is selected as the transform core group of the current block; if the value of the first syntax element is equal to 2, it indicates that the third candidate transform core group is selected as the transform core group of the current block.

[0414] In a specific implementation, when the prediction mode of the current block is one of the items in the second prediction mode set, determining the transform core group of the current block according to the transform core group index of the current block may include: if the transform core group index is the i-th value, determining the transform core group of the current block based on the i-th intra-frame prediction mode derived from the prediction mode of the current block, where i is a positive integer.

[0415] The second prediction mode set may include at least one of the following prediction modes: a mode for combined prediction using at least two intra-frame prediction modes, wherein the intra-frame prediction mode includes at least one of the following: a DC mode, a PLANAR mode, and an angular prediction mode.

[0416] In a specific embodiment, the second prediction mode set may include at least one of the following prediction modes: DIMD mode, TIMD mode, and SGPM mode.

[0417] In an embodiment of the present application, MTSS can be applied to DIMD mode, TIMD mode, and SGPM mode. If the transform core group index is a first value, the transform core group of the current block is determined based on the first intra-frame prediction mode derived from the prediction mode of the current block; if the transform core group index is a second value, the transform core group of the current block is determined based on the second intra-frame prediction mode derived from the prediction mode of the current block; if the transform core group index is a third value, the transform core group of the current block is determined based on the third intra-frame prediction mode derived from the prediction mode of the current block, and so on.

[0418] Here, for the transform core group index, the first value may be 0, the second value may be 1, and the third value may be 2. That is, for the prediction mode in the second prediction mode set, after determining the transform core group index of the current block, the corresponding transform core group may be directly determined according to the transform core group index.

[0419] For example, for the DIMD mode, since the DIMD mode itself uses gradient-derived texture features and it can derive multiple intra-frame prediction modes, there is no need for the MTSS technology to additionally use gradient-derived texture features. The corresponding transform core group can be determined according to the transform core group index of the current block.

[0420] For example, for the TIMD mode, since the TIMD mode itself can derive multiple intra-frame prediction modes, there is no need for the MTSS technology to additionally use gradients to derive texture features, and the corresponding transform core group can be determined according to the transform core group index of the current block.

[0421] For example, for the SGPM mode, since the SGPM mode itself can derive a "partitioning" mode and two intra-frame prediction modes, there is no need for the MTSS technology to additionally use gradient-derived texture features. The corresponding transform core group can be determined according to the transform core group index of the current block.

[0422] More specifically, in one possible embodiment, it is as follows:

[0423] For example, for the DIMD mode, assume that the transform core group index corresponding to the first intra-frame prediction mode derived by the DIMD mode is 0, denoted as candFeature0; and the transform core group index corresponding to the second intra-frame prediction mode derived by the DIMD mode is 1, denoted as candFeature1. Thus, if the transform core group index is 0, the transform core group for the current block is determined based on the first intra-frame prediction mode derived by the DIMD mode; if the transform core group index is 1, the transform core group for the current block is determined based on the second intra-frame prediction mode derived by the DIMD mode.

[0424] For example, for the TIMD mode, assume that the transform core group index corresponding to the first intra-frame prediction mode derived by the TIMD mode is 0, denoted as candFeature0; and the transform core group index corresponding to the second intra-frame prediction mode derived by the TIMD mode is 1, denoted as candFeature1. Thus, if the transform core group index is 0, the transform core group for the current block is determined based on the first intra-frame prediction mode derived by the TIMD mode; if the transform core group index is 1, the transform core group for the current block is determined based on the second intra-frame prediction mode derived by the TIMD mode.

[0425] For example, for the SGPM mode, assume that the transform core group index corresponding to the partition mode of the SGPM mode is 0, denoted as candFeature0; and the transform core group index corresponding to the first intra-frame prediction mode derived from the SGPM mode is 1, denoted as candFeature1. Thus, if the transform core group index is 0, the transform core group for the current block is determined based on the partition mode of the SGPM mode; if the transform core group index is 1, the transform core group for the current block is determined based on the first intra-frame prediction mode derived from the SGPM mode.

[0426] In another specific implementation method, when the prediction mode of the current block is one of the items in the third prediction mode set, determining the transform core group of the current block according to the transform core group index of the current block may include: if the transform core group index is a first value, determining the transform core group of the current block based on the first intra-frame prediction mode derived from the prediction mode of the current block; if the transform core group index is a second value, determining the transform core group of the current block based on the PLANAR mode.

[0427] In another specific implementation, when the prediction mode of the current block is one of the items in the third prediction mode set, determining the transform core group of the current block according to the transform core group index of the current block may include: if the transform core group index is a first value, determining the transform core group of the current block based on the first intra-frame prediction mode derived from the prediction mode of the current block; if the transform core group index is a second value, determining the transform core group of the current block based on the second intra-frame prediction mode derived from the prediction mode of the current block.

[0428] The third prediction mode set may include at least one of the following prediction modes: a mode for performing prediction using an extrapolation filter and a mode for performing prediction using a matrix operation.

[0429] In a specific embodiment, the third prediction mode set may include at least one of the following prediction modes: MIP mode and EIP mode.

[0430] In the embodiments of the present application, MTSS can be applied to both the MIP and EIP modes. Since the MIP and EIP modes are widely applicable to blocks with texture gradients, their features are similar to those of the PLANAR mode. Therefore, the PLANAR mode can also be used as a candidate texture feature for both the MIP and EIP modes.

[0431] Here, for the transform core group index, the first value may be 0 and the second value may be 1. That is, for the prediction mode in the third prediction mode set, after determining the transform core group index of the current block, the corresponding transform core group may be directly determined according to the transform core group index.

[0432] For example, when the prediction mode of the current block is MIP mode or EIP mode, it is assumed that the transform core group index corresponding to the first intra-frame prediction mode derived from the MIP mode or EIP mode is 0, denoted as candFeature0; and the transform core group index corresponding to the PLANAR mode is 1, denoted as candFeature1. Thus, if the transform core group index is 0, the transform core group for the current block is determined based on the first intra-frame prediction mode derived from the prediction mode of the current block; if the transform core group index is 1, the transform core group for the current block is determined based on the PLANAR mode.

[0433] It is also understandable that in the embodiments of the present application, for at least two candidate transform core groups of the MTSS technology, the encoder may further construct a first candidate list. In some embodiments, step S3301 may further include: determining a first candidate list for the current block, the first candidate list indicating at least two candidate transform core groups; and determining a transform core group for the current block based on the first candidate list and the transform core group index.

[0434] It should be noted that in this embodiment of the present application, when the prediction mode of the current block is any one of the following: DIMD mode, TIMD mode, SGPM mode, MIP mode, EIP mode, ITMP mode, and IBC mode, the first candidate list may include at least two candidate texture feature indexes, or the first candidate list may include at least two transform core groups. Here, each candidate texture feature index corresponds to a transform core group. Therefore, it can be said that the first candidate list indicates at least two candidate transform core groups.

[0435] In some embodiments, determining a first candidate list for the current block may include: determining one or more intra-frame prediction modes derived based on a prediction mode of the current block; determining one or more candidate transform core groups based on the one or more intra-frame prediction modes, and adding the one or more candidate transform core groups to the first candidate list.

[0436] In a possible embodiment, determining a first candidate list for the current block may specifically include: when the prediction mode of the current block is one of the items in the second prediction mode set, determining multiple intra-frame prediction modes derived based on the prediction mode of the current block; determining multiple candidate transform core groups based on the multiple intra-frame prediction modes, and adding the multiple candidate transform core groups to the first candidate list.

[0437] In an embodiment of the present application, the second prediction mode set may include at least one of the following prediction modes: a mode for combined prediction using at least two intra-frame prediction modes, wherein the intra-frame prediction mode includes at least one of the following: a DC mode, a PLANAR mode, and an angular prediction mode; illustratively, the second prediction mode set may include at least one of the following prediction modes: a DIMD mode, a TIMD mode, and a SGPM mode. In other words, the MTSS technology can be applied to the DIMD mode, the TIMD mode, and the SGPM mode. In this case, the gradient-derived texture features may not be additionally used, and the first candidate list may be constructed based solely on one or more intra-frame prediction modes derived from the prediction mode itself.

[0438] For example, for the DIMD mode, since the DIMD mode itself uses gradient-derived texture features and can derive multiple intra-frame prediction modes, there is no need for the MTSS technology to additionally use gradient-derived texture features to construct the first candidate list based on the multiple intra-frame prediction modes derived from the DIMD mode itself.

[0439] For example, for the TIMD mode, since the TIMD mode itself can derive multiple intra-frame prediction modes, there is no need for the MTSS technology to additionally use gradient-derived texture features to construct the first candidate list based on the multiple intra-frame prediction modes derived from the TIMD mode itself.

[0440] For example, for the SGPM mode, since the SGPM mode itself can derive a "partitioning" mode and 2 intra-frame prediction modes, there is no need for the MTSS technology to additionally use gradient-derived texture features. The first candidate list is constructed based on a "partitioning" mode and 2 intra-frame prediction modes derived from the SGPM mode itself.

[0441] In some embodiments, determining a first candidate list for the current block may further include: when the first candidate list is not full, determining a preset texture feature index for the current block; determining one or more candidate transform core groups based on the preset texture feature index, and adding the one or more candidate transform core groups to the first candidate list.

[0442] In an embodiment of the present application, the preset texture feature index may be a PLANAR mode. In a specific embodiment, the method may further include: determining multiple candidate transform core groups according to multiple intra prediction modes and the PLANAR mode, and adding the multiple candidate transform core groups to the first candidate list.

[0443] For example, if the intra-frame prediction mode derived from the DIMD mode, TIMD mode, or SGPM mode includes ITMP or IBC, or EIP or MIP mode, the texture features corresponding to the PLANAR mode can also be used as candidate texture features. Since the DIMD mode, TIMD mode, and SGPM mode can use more than two intra-frame prediction modes for weighting or combination, the intra-frame prediction mode may be ITMP or IBC, or EIP or MIP mode. In this case, the texture features corresponding to the PLANAR mode can also be used as candidate texture features. In short, the first candidate list can be constructed based on multiple intra-frame prediction modes derived from the DIMD mode, TIMD mode, and SGPM mode and the PLANAR mode.

[0444] In another possible embodiment, determining the first candidate list for the current block may specifically include: when the prediction mode of the current block is one of the items in the third prediction mode set, determining an intra-frame prediction mode derived based on the prediction mode of the current block; determining two candidate transform core groups according to the intra-frame prediction mode and the PLANAR mode, and adding the two candidate transform core groups to the first candidate list.

[0445] In an embodiment of the present application, the third prediction mode set may include at least one of the following prediction modes: a mode using an extrapolation filter for prediction and a mode using a matrix operation for prediction. Exemplarily, the third prediction mode set may include at least one of the following prediction modes: a MIP mode and an EIP mode. In other words, the MTSS technology can be applied to the MIP mode and the EIP mode. In this case, the gradient-derived texture features may not be used additionally, and the first candidate list can be constructed based solely on the first intra-frame prediction mode and the PLANAR mode derived from the prediction mode itself.

[0446] In some embodiments, determining a first candidate list for the current block may further include: when the first candidate list is not full, determining candidate samples for deriving texture feature indexes; determining one or more candidate texture feature indexes of the current block based on the candidate samples; determining one or more candidate transform core groups based on the one or more candidate texture feature indexes, and adding the one or more candidate transform core groups to the first candidate list.

[0447] In an embodiment of the present application, when constructing the first candidate list, the MTSS technology may also additionally use gradient-derived texture features. Here, when determining one or more candidate transform kernel groups for the current block based on the candidate samples, one or more candidate texture feature indexes including one or more candidate texture feature indexes may be first determined based on the candidate samples, and then one or more candidate transform kernel groups for the current block may be determined based on the one or more candidate texture feature indexes.

[0448] Typically, one candidate texture feature index corresponds to one candidate transform core group; however, in some cases, multiple similar candidate texture feature indexes may correspond to the same transform core group. For example, multiple intra-frame prediction modes with similar angles correspond to the same transform core group. In an embodiment of the present application, if multiple adjacent intra-frame prediction modes (or candidate texture feature indexes) correspond to one transform core group, then when determining the candidate transform core group, it is necessary to ensure that the candidate texture feature indexes are not determined to be the same transform core group.

[0449] In a possible implementation, for candidate samples, a prediction block of the current block may be determined; and at least part of the samples in the prediction block may be used as candidate samples.

[0450] In the embodiment of the present application, if a certain texture exists in the prediction block, it can be considered that the residual block has a texture with the same characteristics. In this way, the candidate samples used for inter-frame derivation of candidate texture feature indexes can be all samples in the prediction block or part of the samples in the prediction block.

[0451] In another possible implementation, for candidate samples, adjacent samples of a reconstructed area of ​​the current block may be determined; and the adjacent samples of the reconstructed area may be used as candidate samples.

[0452] In the embodiment of the present application, the candidate samples used to derive the candidate texture feature index between frames may be samples from adjacent reconstructed regions of the current block, such as the reconstructed regions to the left and right of the current block. Because the reconstructed regions to the left and above are not the current block but are adjacent to it, for example, if the textures are connected, they can be used to estimate the texture of the current block to a certain extent.

[0453] In yet another possible implementation, more samples may be used. For candidate samples, adjacent samples in the reconstructed area and at least part of the samples in the prediction block may be used as candidate samples.

[0454] In an embodiment of the present application, the candidate samples used for inter-frame derivation of candidate texture feature indexes may also be the predicted block of the current block and the reconstructed areas to the left and above the current block. This way, more samples are used to derive the candidate texture feature indexes, making the derived candidate texture feature indexes more accurate.

[0455] It should also be noted that, in the embodiment of the present application, the number of candidate samples used to derive the candidate texture feature index may be at least one, for example, 1, 2, 3 or more.

[0456] In some embodiments, the method may further include: determining the number of candidate samples according to a size parameter of the current block.

[0457] That is to say, when deriving one or more candidate texture feature indexes based on candidate samples, the number of candidate samples used can be determined by the size parameter of the current block. For example, if the size of the current block is small, then all available samples can be counted; if the size of the current block is large, then the current block can be downsampled and counted, such as counting one sample out of every 2, or 4, or 8 samples in the horizontal and / or vertical directions. Alternatively, if the size of one of the horizontal or vertical directions of the current block is less than or equal to 8, then all available samples in that direction are counted; otherwise, if the size of one of the horizontal or vertical directions of the current block is less than or equal to 16, then one sample out of every 2 samples in that direction is counted; otherwise, one sample out of every 4 samples in that direction is counted, and there is no specific limitation here.

[0458] In some embodiments, determining one or more candidate texture feature indexes of the current block based on the candidate samples may include: determining the horizontal gradient value and the vertical gradient value of the candidate sample; determining the texture feature index and the gradient intensity value corresponding to the candidate sample based on the horizontal gradient value and the vertical gradient value of the candidate sample; determining a texture feature statistics table based on the texture feature index and the gradient intensity value corresponding to the candidate sample; and determining one or more candidate texture feature indexes of the current block based on the texture feature statistics table.

[0459] It should be noted that, in an embodiment of the present application, when determining the texture feature index and gradient intensity value corresponding to the candidate sample based on the horizontal gradient value and vertical gradient value of the candidate sample, it can include: performing angle mapping based on the horizontal gradient value and vertical gradient value of the candidate sample to determine the texture feature index corresponding to the candidate sample; and performing gradient intensity calculation based on the horizontal gradient value and vertical gradient value of the candidate sample to determine the gradient intensity value corresponding to the candidate sample.

[0460] In a specific embodiment, performing angle mapping based on the horizontal gradient value and the vertical gradient value of the candidate sample to determine the texture feature index corresponding to the candidate sample may include: determining the texture feature index corresponding to the candidate sample using a preset lookup table based on the horizontal gradient value and the vertical gradient value of the candidate sample.

[0461] In this embodiment of the present application, the horizontal gradient value of the candidate sample can be expressed as grad x Indicates that the vertical gradient value of the candidate sample can be expressed as grad y In this way, according to grad x and grad y Deriving the texture feature index (or referred to as a “virtual intra prediction mode”) can be achieved by looking up a table.

[0462] For example, if abs(grad x ) is equal to 0 and abs(grad y ) is not equal to 0, then there is horizontal texture, corresponding to intra prediction mode 18 in VVC. y ) is equal to 0 and abs(grad x ) is not equal to 0, then there is vertical texture, corresponding to intra prediction mode 50 in VVC. x ) and abs(grad y ) are not equal to 0, if abs(grad x ) is equal to abs(grad y ), and grad x and grad y The symbols are the same, corresponding to intra prediction mode 34 in VVC. If abs(grad x ) is equal to 2 times abs(grad y ), and grad x and grad y The symbols are the same, corresponding to intra prediction mode 40 in VVC. In addition, other situations can be determined by looking up the table according to the same principle.

[0463] In a specific embodiment, performing gradient strength calculation based on the horizontal gradient value and the vertical gradient value of the candidate sample to determine the gradient strength value corresponding to the candidate sample may include: performing an addition operation on the absolute value of the horizontal gradient value and the absolute value of the vertical gradient value to determine the gradient strength value corresponding to the candidate sample.

[0464] Here, the gradient strength value corresponding to the candidate sample can be recorded as amp. For example, amp=abs(grad x )+abs(grad y ).

[0465] It should be noted that, in the embodiment of the present application, the horizontal gradient value and the vertical gradient value of the candidate sample can be calculated using the Sobel operator. For example, the Sobel operator is as follows:

[0466] Operator for horizontal gradient value:

[0467] Operator for vertical gradient value:

[0468] So, assuming that the sample value at the sample position (x, y) is P x,y , then the horizontal gradient value grad x And the vertical gradient value grad yThe calculation of grad is as follows: x =P x+1,y-1 +2*P x+1,y +P x+1,y+1 -P x-1,y-1 -2*P x-1,y -P x-1,y+1 (7) grad y =P x-1,y+1 +2*P x,y+1 +P x+1,y+1 -P x-1,y-1 -2*P x,y-1 -P x+1,y-1 (8)

[0469] It should also be noted that, in this embodiment of the present application, the candidate samples may be set to exclude the samples in the outermost row, column, and top, bottom, left, and right of the current block. Considering that the Sobel operator uses the samples in the outermost row, column, and top, bottom, left, and right of the current sample, the embodiment of the present application may be set to exclude the gradients of the samples in the outermost row, column, and top, bottom, left, and right of the current block.

[0470] In some embodiments, determining a texture feature statistics table based on the texture feature index and gradient intensity value corresponding to the candidate samples may include: when the number of candidate samples is at least one, determining at least one texture feature index and at least one corresponding gradient intensity value; determining at least one reference texture feature index with mutually different characteristics based on the at least one texture feature index, and accumulating the gradient intensity values ​​belonging to the same reference texture feature index based on the at least one gradient intensity value to determine the gradient intensity cumulative value corresponding to the at least one reference texture feature index; determining a texture feature statistics table based on the at least one reference texture feature index and the gradient intensity cumulative value corresponding to the at least one reference texture feature index.

[0471] That is to say, in an embodiment of the present application, taking at least part of the samples in the prediction block as candidate samples as an example, the gradients of all or part of the samples in the prediction block are calculated. Generally speaking, the horizontal gradient value and the vertical gradient value can be calculated. Here, the Sobel operator can be used to calculate the gradient value. For a certain sample, the texture direction of the sample can be inferred based on its horizontal gradient value and vertical gradient value. For example, if the horizontal gradient value is non-zero and the vertical gradient value is zero, then the texture of the sample is in the vertical direction. Conversely, if the horizontal gradient value is zero and the vertical gradient value is non-zero, then the texture of the sample is in the horizontal direction. For example, if the horizontal gradient value and the vertical gradient value are equal and not zero, then the texture of the sample is 45 degrees. Of course, in the embodiment of the present application, there are many other cases where the horizontal gradient value and the vertical gradient value are not zero, and the texture direction of the sample can be determined based on their ratio. In this way, the gradient intensity value of each sample can be mapped to the corresponding texture feature index. A texture feature statistics table is constructed, and the gradient intensity value of each calculated sample is added to the corresponding texture feature index item in the statistics table to obtain the final texture feature statistics table. Then, one or more candidate texture feature indexes of the current block can be determined based on the texture feature statistics table.

[0472] In some embodiments, determining one or more candidate texture feature indexes for a current block based on a texture feature statistics table may include: sorting the texture feature statistics table from high to low according to gradient intensity accumulation values, determining reference texture feature indexes corresponding to top N gradient intensity accumulation values, and determining the N reference texture feature indexes as the one or more candidate texture feature indexes for the current block, where N is a positive integer.

[0473] That is to say, in the embodiment of the present application, after the texture feature statistics table is constructed, in order to reduce complexity, the texture feature statistics table can also be sorted in descending order according to the accumulated gradient intensity accumulation values, and then only the top N reference texture feature indexes are selected. Here, for complexity considerations, it is also possible to maintain only a candidate texture feature list of length N, which contains one or more candidate texture feature indexes, and the candidate texture feature list is sorted from high to low according to the gradient intensity accumulation value. In addition, in the embodiment of the present application, the value of N can be 2, 3, 4, 5, ..., 10, etc., and there is no specific limitation on the value of N here.

[0474] It can be understood that in the embodiment of the present application, considering that the angles of some adjacent intra-frame prediction modes are very close, in order to exclude intra-frame prediction modes that are too close, the method may also include: pruning the N reference texture feature indexes in the candidate texture feature list to determine one or more candidate texture feature indexes for the current block.

[0475] In some embodiments, pruning N reference texture feature indexes to determine one or more candidate texture feature indexes for the current block may include: determining a first candidate texture feature index based on a reference texture feature index at a first position among the N reference texture feature indexes; when a second condition is satisfied between other reference texture feature indexes other than the first position among the N reference texture feature indexes and the i-th candidate texture feature index, determining an i+1-th candidate texture feature index based on the other reference texture feature indexes to determine one or more candidate texture feature indexes for the current block; wherein i is an integer greater than zero and less than N.

[0476] It should be noted that, in the embodiment of the present application, the second condition may include: the difference between the i-th candidate texture feature index and the i+1-th candidate texture feature index satisfies a preset threshold, i.e., there is a certain difference between two adjacent candidate texture feature indexes. Alternatively, when each candidate texture feature index corresponds to a candidate transform core group, it can also be said that the difference between the i-th candidate transform core group and the i+1-th candidate transform core group satisfies the preset threshold.

[0477] It should also be noted that, in the embodiment of the present application, the N reference texture feature indexes are sorted from high to low according to the accumulated gradient strength values. In this case, determining the first candidate texture feature index based on the reference texture feature index in the first position among the N reference texture feature indexes may include: determining the first candidate texture feature index based on the reference texture feature index with the largest accumulated gradient strength value among the N reference texture feature indexes.

[0478] It should also be noted that, in the embodiment of the present application, the preset threshold can be represented by THR, the i-th candidate texture feature index can be represented by candFeature(i), and the i+1-th candidate texture feature index can be represented by candFeature(i+1). In a specific embodiment, the difference between the i-th candidate texture feature index and the i+1-th candidate texture feature index meets the preset threshold, which can include: candFeature(i+1)+THR<candFeature(i)||candFeature(i+1)-THR> candFeature(i).

[0479] It should also be noted that in the embodiments of the present application, the THR value may be 3, 4, 5, 6, etc. Thus, when the cumulative values ​​of multiple adjacent angles are very high, this pruning method will preferentially select candidate texture feature indices with a certain degree of discrimination. In one possible embodiment, THR is equal to 0 or is not set, that is, only the candidate texture feature indices need to be different. In another possible embodiment, pruning can also be omitted, that is, pruning is not a necessary operation step.

[0480] It is also understandable that in the embodiments of the present application, the above method does not take into account some intra-frame prediction modes derived from the DIMD, TIMD, SGPM, and other modes themselves. Therefore, in some embodiments, the method may further include: determining one or more intra-frame prediction modes derived from the prediction mode of the current block; determining one or more candidate transform core groups based on the one or more intra-frame prediction modes, and adding the one or more candidate transform core groups to the first candidate list.

[0481] In some embodiments, the method further includes: when the first candidate list is not full, determining a preset texture feature index of the current block; determining one or more candidate transform core groups according to the preset texture feature index, and adding the one or more candidate transform core groups to the first candidate list.

[0482] In some embodiments, the method further includes: when the first candidate list is not filled, determining candidate samples for deriving texture feature indexes; determining one or more candidate texture feature indexes of the current block based on the candidate samples; determining one or more candidate transform core groups based on the one or more candidate texture feature indexes, and adding the one or more candidate transform core groups to the first candidate list.

[0483] That is to say, in the embodiment of the present application, some modes derived from the DIMD, TIMD, SGPM and other modes themselves are taken into consideration. For example, DIMD itself will derive one or several intra-frame prediction modes for weighting, and TIMD itself will also derive one or several intra-frame prediction modes for weighting. SGPM not only has two intra-frame prediction modes, but also has a "partitioning" mode that can also find the corresponding intra-frame prediction mode, and the residual often appears in the boundary area of ​​the "partition". Therefore, one possible implementation method is to determine the first candidate list based on the intra-frame prediction mode derived from the DIMD, TIMD, SGPM and other modes themselves and the candidate texture feature index derived by the above method; or another possible implementation method is to determine the first candidate list based on the intra-frame prediction mode derived from the DIMD, TIMD, SGPM and other modes themselves and the default texture feature index.

[0484] In addition, in the embodiment of the present application, since DIMD, TIMD, and SGPM can all derive more than one intra-frame prediction mode, these modes can also give priority to using multiple modes derived by each mode itself to determine the candidate texture feature index. When the modes derived by each mode itself cannot fill all the candidate texture feature indexes, one possible method is to add a default texture feature index. Another possible method is to use the above-mentioned sorted candidate texture feature list of length N to determine the candidate texture feature index.

[0485] For example, when the prediction mode of the current block is the DIMD mode, if it uses the prediction values ​​of multiple intra-frame prediction modes for weighting during prediction, then the multiple intra-frame prediction modes used for weighting can be sequentially tried to be determined as candidate texture feature indexes.

[0486] For example, when the prediction mode of the current block is the TIMD mode, if it uses the prediction values ​​of multiple intra-frame prediction modes for weighting during prediction, then the multiple intra-frame prediction modes used for weighting can be sequentially tried to be determined as candidate texture feature indexes.

[0487] For example, when the prediction mode of the current block is the SGPM mode, the intra-frame prediction mode corresponding to the "partitioning" mode derived therefrom and the two intra-frame prediction modes used for prediction may be sequentially attempted to be determined as candidate texture feature indexes.

[0488] In another possible implementation, for determining the first candidate list of the current block, the method may include: determining a first candidate transformation core group based on the reference texture feature index at the first position in the candidate texture feature list; when the second condition is not satisfied between all reference texture feature indexes except the first position in the candidate texture feature list and the first candidate transformation core group, determining a second candidate transformation core group based on the reference texture feature index at the second position in the candidate texture feature list; and determining the first candidate list based on the first candidate transformation core group and the second candidate transformation core group.

[0489] It should be noted that in an embodiment of the present application, the first candidate transformation core group is determined based on the reference texture feature index in the first position in the candidate texture feature list. Specifically, it can be: the first candidate transformation core group is determined based on the reference texture feature index with the largest gradient intensity accumulated value in the candidate texture feature list.

[0490] It should also be noted that, in the embodiment of the present application, taking the first candidate list indicating two candidate transform core groups as an example, the first candidate transform core group can be represented by candFeature0, and the second candidate transform core group can be represented by candFeature1. For example, the intra-frame prediction mode with the largest cumulative gradient strength value is the first candidate transform core group candFeature0, then when selecting the second candidate transform core group candFeature1, it is required that candFeature1 and candFeature0 have a certain gap, such as candFeature1+THR<candFeature0||candFeature1-THR> If no matching candidate is found after checking all N-1 reference texture feature indices, a second candidate transform core group, candFeature1, can be determined based on the second-ranked reference texture feature index among the N reference texture feature indices. In other words, the candidate transform core groups corresponding to the first two reference texture feature indices with the largest cumulative gradient strength values ​​can be added to the first candidate list.

[0491] In another possible implementation, for determining the first candidate list of the current block, the method may include: determining a first candidate transformation core group based on the reference texture feature index at the first position in the candidate texture feature list; when the second condition is not satisfied between all reference texture feature indexes other than the first position in the candidate texture feature list and the first candidate transformation core group, determining a second candidate transformation core group based on a preset texture feature index; and determining the first candidate list based on the first candidate transformation core group and the second candidate transformation core group.

[0492] It should be noted that in an embodiment of the present application, if no one meets the requirements after checking all N-1 reference texture feature indexes, then the default texture feature index of the current block can also be determined, and then the candidate transform core group corresponding to the reference texture feature index with the largest gradient intensity accumulation value and the default texture feature index is added to the first candidate list.

[0493] In another possible implementation, for determining the first candidate list of the current block, the method may include: determining a first candidate transform core group based on a first intra-frame prediction mode derived from a prediction mode of the current block; determining a second candidate transform core group based on the first reference texture feature index when a second condition is satisfied between the first reference texture feature index in the candidate texture feature list and the first candidate transform core group; and determining the first candidate list based on the first candidate transform core group and the second candidate transform core group.

[0494] It should be noted that in this embodiment of the present application, the first candidate list not only considers the candidate texture feature indexes derived from the horizontal and vertical gradient values ​​of the candidate samples, but also considers the intra-frame prediction mode derived from the prediction mode of the current block itself. The following describes this in detail with several examples.

[0495] Exemplarily, when the prediction mode of the current block is the DIMD mode, the first intra prediction mode derived from the DIMD mode is used as candFeature0.

[0496] Exemplarily, when the prediction mode of the current block is the TIMD mode, the first intra-frame prediction mode derived from the TIMD mode is used as candFeature0.

[0497] Exemplarily, when the prediction mode of the current block is the SGPM mode, the intra-frame prediction mode corresponding to the SGPM "partition" mode is used as candFeature0.

[0498] Then, candFeature1 is determined according to the above method. For example, if a reference texture feature index among the N reference texture feature indexes is tried, starting from the first position, and a reference texture feature index meets the THR restriction, it can be used as candFeature1.

[0499] It should also be noted that in the embodiment of the present application, for modes such as IBC and ITMP, a prediction block or a prediction block plus a template can be used to derive a candidate texture feature index (or intra-frame prediction mode).

[0500] It should also be noted that in an embodiment of the present application, if the candidate samples used by the MTSS technology to derive N reference texture feature indexes are the same as the candidate samples used by the DIMD mode, then the first intra-frame prediction mode derived by DIMD and the first reference texture feature index derived by the MTSS technology are the same.

[0501] S3302: Determine a transformation core of the current block according to the transformation core group.

[0502] It should be noted that after determining the transform core group for the current block, the transform core for the current block can be further determined. In some embodiments, the method may include: determining at least two candidate transform cores included in the transform core group; performing encoding cost calculation on the current block based on the at least two candidate transform cores to determine cost results corresponding to the at least two candidate transform cores; determining the minimum cost result among the cost results corresponding to the at least two candidate transform cores, and determining the candidate transform core corresponding to the minimum cost result as the transform core for the current block.

[0503] It should also be noted that, when the first candidate list indicates the transformation cores included in at least two transformation core groups, the method may further include: determining the at least two candidate transformation cores indicated by the first candidate list; performing encoding cost calculation on the current block based on the at least two candidate transformation cores, and determining the cost results corresponding to each of the at least two candidate transformation cores; determining the minimum cost result among the cost results corresponding to each of the at least two candidate transformation cores, and determining the candidate transformation core corresponding to the minimum cost result as the transformation core of the current block.

[0504] In the embodiment of the present application, the cost calculation here can be determined based on the cost result of Rate Distortion Optimization (RDO), or based on the cost result of Sum of Absolute Difference (SAD), or even based on the cost result of Sum of Absolute Transformed Difference (SATD), but no limitation is made here.

[0505] In a specific embodiment, encoding cost calculation is performed on the current block based on at least two candidate transform kernels to determine the cost results corresponding to each of the at least two candidate transform kernels, which may include: transforming and quantizing the residual block of the current block based on the first candidate transform kernel to determine the first candidate quantization coefficient of the current block, and performing entropy coding on the first candidate quantization coefficient to determine the first generation value of the first candidate transform kernel; inverse quantizing and inverse transforming the first candidate quantization coefficient to determine the first candidate residual block of the current block, and determining the first candidate prediction block of the current block based on the first candidate residual block; performing cost calculation based on the first candidate prediction block and the original image of the current block to determine the second generation value of the first candidate transform kernel; determining the cost result corresponding to the first candidate transform kernel based on the first generation value and the second generation value of the first candidate transform kernel; wherein the first candidate transform kernel is any one of the at least two candidate transform kernels.

[0506] In this embodiment of the present application, the transform core index of the current block can be used to indicate the number of the transform core of the current block in the transform core group or the first candidate list of the current block. The transform core index of the current block can be a positive integer, such as 1, 2, 3, 4, 5, 6, etc. The transform core index can be written directly into the bitstream or written into the bitstream via the value of the second syntax element.

[0507] In a possible implementation, a transform core index of a current block is determined; the transform core index of the current block is coded, and the obtained coded bits are written into a bitstream.

[0508] In another possible implementation, a value of a second syntax element is determined; wherein the second syntax element is used to indicate whether the current block uses the first transform mode and the corresponding transform kernel index used; the value of the second syntax element is encoded, and the obtained encoded bits are written into the bitstream.

[0509] It should also be noted that in this embodiment of the present application, the first transform mode can be LFNST / NSPT, and the second syntax element can be represented by lfnst_idx. The second syntax element can be used to indicate whether the current block uses the first transform mode, and the corresponding transform kernel index when the current block uses the first transform mode. In this case, the value of the second syntax element can be 0, 1, 2, 3, 4, 5, 6, etc.

[0510] In a specific embodiment, if the value of the second syntax element is a third value, it is determined that the current block does not use the first transform mode; if the value of the second syntax element is a fourth value, it is determined that the current block uses the first transform mode and the corresponding transform kernel index. The third value can be set to 0, and the fourth value can be set to a non-zero value, such as 1, 2, 3, 4, 5, 6, etc.

[0511] That is, in this embodiment of the present application, for LFNST / NSPT, the transform core index of the current block can also be represented by lfnst_idx. Wherein, lfnst_idx being 0 indicates that the current block does not use LFNST / NSPT. Each transform core group of LFNST / NSPT in ECM has 3 transform cores, so the value of lfnst_idx is 1, 2, or 3, which means that the current block uses the first transform core, the second transform core, or the third transform core of the selected transform core group of LFNST / NSPT.

[0512] In this embodiment of the present application, if the prediction mode of the current block is a special intra-frame prediction mode, then it has more than one selectable transform core group. For example, if it has two selectable transform core groups, then the possible values ​​of lfnst_idx are 0, 1, 2, 3, 4, 5, and 6. 1, 2, and 3 correspond to the three transform cores of the first transform core group, and 4, 5, and 6 correspond to the three transform cores of the second transform core group.

[0513] In a specific embodiment, the binary symbol correspondence table of lfnst_idx is shown in the aforementioned Table 7. The third binary symbol, ie, the binary symbol with BinIdx being 2, can also be understood as selecting the first candidate transform core group or the second candidate transform core group.

[0514] It can be understood that in an embodiment of the present application, the transform core group here can be one of the at least two candidate transform core groups indicated by the first candidate list. In addition, in an embodiment of the present application, the transform core group index of the current block can be represented by lfnst_feature_idx, or by lfnst_set_idx. Among them, the transform core group index of the current block can be an integer greater than or equal to zero, such as 0, 1, 2, etc. Exemplarily, if the value of lfnst_feature_idx is equal to 0, it indicates that the first candidate transform core group is selected as the transform core group of the current block; if the value of lfnst_feature_idx is equal to 1, it indicates that the second candidate transform core group is selected as the transform core group of the current block.

[0515] It should be noted that after determining the transform core group of the current block, determining the transform core of the current block can include: determining at least two candidate transform cores included in the transform core group; performing encoding cost calculation on the current block based on the at least two candidate transform cores, and determining the cost results corresponding to the at least two candidate transform cores; determining the minimum cost result among the cost results corresponding to the at least two candidate transform cores, and determining the candidate transform core corresponding to the minimum cost result as the transform core of the current block.

[0516] In a specific embodiment, encoding cost calculation is performed on the current block based on at least two candidate transform kernels to determine the cost results corresponding to each of the at least two candidate transform kernels, which may include: transforming and quantizing the residual block of the current block based on the first candidate transform kernel to determine the first candidate quantization coefficient of the current block, and performing entropy coding on the first candidate quantization coefficient to determine the first generation value of the first candidate transform kernel; inverse quantizing and inverse transforming the first candidate quantization coefficient to determine the first candidate residual block of the current block, and determining the first candidate prediction block of the current block based on the first candidate residual block; performing cost calculation based on the first candidate prediction block and the original image of the current block to determine the second generation value of the first candidate transform kernel; determining the cost result corresponding to the first candidate transform kernel based on the first generation value and the second generation value of the first candidate transform kernel; wherein the first candidate transform kernel is any one of the at least two candidate transform kernels.

[0517] In this embodiment of the present application, the transform core index of the current block can be used to indicate the number of the transform core of the current block in the transform core group of the current block. The transform core index of the current block can be a positive integer, such as 1, 2, 3, etc. The transform core index can be written directly into the bitstream or written into the bitstream via the value of the second syntax element.

[0518] In a possible implementation, a transform core index of a current block is determined; the transform core index of the current block is coded, and the obtained coded bits are written into a bitstream.

[0519] In another possible implementation, a value of a second syntax element is determined; wherein the second syntax element is used to indicate whether the current block uses the first transform mode and the corresponding transform kernel index used; the value of the second syntax element is encoded, and the obtained encoded bits are written into the bitstream.

[0520] It should also be noted that in this embodiment of the present application, the first transform mode can be LFNST / NSPT, and the second syntax element can be represented by lfnst_idx. The second syntax element can be used to indicate whether the current block uses the first transform mode, and the corresponding transform kernel index when the current block uses the first transform mode. In this case, the value of the second syntax element can be 0, 1, 2, 3, etc.

[0521] Exemplarily, in this case, for LFNST / NSPT, the transform core index of the current block can also be represented by lfnst_idx. In VVC, lfnst_idx can have three values: 0, 1, and 2. A lfnst_idx of 0 indicates that the current block does not use LFNST. Each transform core group of LFNST in VVC has two transform cores, so a lfnst_idx value of 1 or 2 indicates that the current block uses the first or second transform core of the selected transform core group of LFNST. In existing ECM, lfnst_idx can have four values: 0, 1, 2, and 3. A lfnst_idx of 0 indicates that the current block does not use LFNST / NSPT. Each transform core group of LFNST / NSPT in ECM has three transform cores, so a lfnst_idx value of 1, 2, or 3 indicates that the current block uses the first, second, or third transform core of the selected transform core group of LFNST / NSPT.

[0522] In a specific embodiment, the binary symbol correspondence table of lfnst_idx is shown in Table 8 above.

[0523] It should also be noted that, in this embodiment of the present application, when encoding the transform core group index of the current block, the method may further include: when the current block uses the first transform mode, encoding the transform core group index of the current block, and writing the resulting coded bits into the bitstream. In other words, when the current block uses the MTSS technology and lfnst_idx>0, the step of encoding the transform core group index of the current block and writing the resulting coded bits into the bitstream is performed.

[0524] S3303 : Determine a residual block of the current block, and transform the residual block of the current block according to the transformation kernel to determine a transformation coefficient of the current block.

[0525] S3304: Encode the transform coefficients of the current block and write the obtained coded bits into the bitstream.

[0526] It should be noted that, in an embodiment of the present application, when encoding the transform coefficients of the current block, the method may include: quantizing the transform coefficients of the current block to determine the quantization coefficients of the current block; encoding the quantization coefficients of the current block and writing the obtained coded bits into the bitstream.

[0527] It should also be noted that in the embodiments of this application, the "transformation" of the residual block by the encoder can also be called a "forward transform," specifically referring to the transformation from the spatial domain to the frequency domain to remove residual correlation. It should be noted that if the standard only specifies decoding, then the "transformation" in the standard text refers to the decoding part, specifically referring to the "inverse transform" in this article.

[0528] It should also be noted that, in the embodiment of the present application, referring to FIG. 34 , for step S3303, the method may include:

[0529] S3401: Perform intra-frame prediction on the current block to determine a prediction block for the current block.

[0530] S3402 : Determine a residual block of the current block according to the initial block of the current block and the predicted block of the current block.

[0531] S3403 , transforming the residual block of the current block according to the transformation kernel to determine the transformation coefficient of the current block.

[0532] It should be noted that in the embodiment of the present application, steps S3401 to S3402 can be operated in parallel with steps S3301 to S3302, or can be executed before steps S3301 to S3302, or can be executed after steps S3301 to S3303. The order of the steps is not specifically limited here.

[0533] It should also be noted that, in the embodiment of the present application, after determining the prediction block of the current block, a subtraction operation may be performed on the initial block of the current block and the prediction block of the current block to determine the residual block of the current block.

[0534] It should also be noted that, in an embodiment of the present application, when transforming the residual block of the current block according to the transform kernel to determine the transform coefficient of the current block, it can include: performing an inseparable basic transform on the residual block of the current block according to the transform kernel to determine the transform coefficient of the current block; or performing a discrete cosine transform on the residual block of the current block to determine the transform block of the current block; and performing a low-frequency inseparable transform on the transform block of the current block according to the transform kernel to determine the transform coefficient of the current block.

[0535] In a specific embodiment, if the size parameter of the current block meets the first condition, an inseparable basic transform is performed on the residual block of the current block according to the transform kernel to determine the transform coefficient of the current block; if the size parameter of the current block meets the second condition, a discrete cosine transform is performed on the residual block of the current block to determine the transform block of the current block; and a low-frequency inseparable transform is performed on the transform block of the current block according to the transform kernel to determine the transform coefficient of the current block.

[0536] Here, the size parameter of the current block satisfies the first condition, including: the size parameter of the current block is relatively small, for example, the size parameter of the current block is less than a certain threshold. In other words, for relatively small blocks, an NSPT transform kernel is used. That is, an NSPT transform is performed on the residual block of the current block according to the transform kernel to determine the transform coefficients of the current block.

[0537] Here, the size parameter of the current block satisfies the second condition, including: the size parameter of the current block is relatively large, for example, the size parameter of the current block is greater than a certain threshold. In other words, for relatively large blocks, the LFNST transform kernel is used. Specifically, a basic DCT2 transform is first performed on the residual block of the current block, and then an LFNST transform is performed on the transform block of the current block based on the transform kernel to determine the transform coefficients of the current block.

[0538] In simple terms, after determining the prediction block, the encoder derives the candidate texture feature index based on the prediction block, and then determines the transform kernel group for NSPT / LFNST based on the candidate texture feature index. If a transform kernel group has multiple transform kernels to choose from, the encoder tries each transform kernel in the transform kernel group.

[0539] If the NSPT transform is used, the residual block can be forward transformed using NSPT to obtain transform coefficients, the transform coefficients are quantized to obtain quantized coefficients, and then the quantized coefficients are entropy encoded. Entropy encoding can be used to determine the overhead cost in the bitstream for this transform kernel. The quantized coefficients are inversely quantized to obtain decoded transform coefficients, and the decoded transform coefficients are inversely NSPT transformed to obtain the decoded residual block. The decoded transform coefficients may be different from the original transform coefficients because quantization is lossy. Similarly, the decoded residual block may also be different from the original residual block. A reconstructed block is obtained based on the decoded residual block and the prediction block. The distortion cost can be determined based on the reconstructed block and the original image of the current block. The cost of encoding using the current NSPT transform kernel is the sum of the overhead cost and the distortion cost. The costs of several transform kernels are compared, and the smallest one is selected as the optimal NSPT for the current block.

[0540] If the LFNST transform is used, the residual block can be forward transformed using DCT2, then forward transformed using LFNST to obtain transform coefficients. These transform coefficients are quantized to obtain quantized coefficients, and then entropy encoded. Entropy encoding can be used to determine the overhead cost in the bitstream for this transform kernel. The quantized coefficients are then inversely quantized to obtain decoded transform coefficients. These decoded transform coefficients are then subjected to an inverse LFNST transform and then an inverse DCT2 transform to obtain the decoded residual block. The decoded transform coefficients may differ from the original transform coefficients because quantization is lossy. Similarly, the decoded residual block may also differ from the original residual block. The decoded residual block and the prediction block are used to obtain a reconstructed block. The distortion cost can be determined based on the reconstructed block and the original image of the current block. The cost of encoding using the current NSPT transform kernel is the sum of the overhead cost and the distortion cost. The costs of several transform kernels are compared, and the one with the smallest cost is selected as the optimal NSPT for the current block.

[0541] In addition, in some embodiments, when the current block does not use MTSS technology, the method may also include: determining the texture feature index of the current block; determining the transformation kernel of the current block based on the texture feature index; determining the transformation coefficient of the current block, and transforming the transformation coefficient of the current block based on the transformation kernel to determine the residual block of the current block.

[0542] It should be noted that, in the embodiment of the present application, determining the transformation kernel of the current block according to the texture feature index may include: determining the transformation kernel group of the current block according to the texture feature index; and determining the transformation kernel of the current block according to the transformation kernel group.

[0543] In some embodiments, the method further includes: when the number of samples of the current block is less than a minimum sample threshold, executing the step of determining a texture feature index of the current block.

[0544] In some embodiments, the size of the current block includes height and width; the method further comprises: when the height or width of the current block is less than a minimum size threshold, performing a step of determining a texture feature index of the current block.

[0545] In some embodiments, the method further comprises: when the prediction mode of the current block is a prediction mode outside the first prediction mode set, performing a step of determining a texture feature index of the current block.

[0546] It should be noted that, in the embodiment of the present application, when the prediction mode of the current block is a prediction mode outside the first prediction mode set, the prediction mode of the current block may be one of the prediction modes in the fourth prediction mode set. The fourth prediction mode set includes at least: a DC mode, a PLANAR mode, and an angular prediction mode.

[0547] It should also be noted that, in the embodiment of the present application, the modes in the fourth prediction mode set are relatively simple prediction modes. For example, a classification can be made, where the DC mode, PLANAR mode, and various angle prediction modes are classified as the fourth prediction mode set, and the DIMD mode, TIMD mode, MIP mode, EIP mode, SGPM mode, ITMP mode, and IBC mode are classified as the first prediction mode set.

[0548] For example, the first prediction mode set may include only one or more of the DIMD mode, TIMD mode, MIP mode, EIP mode, SGPM mode, ITMP mode, and IBC mode. For example, the first prediction mode set includes the DIMD mode, TIMD mode, and SGPM mode. The other modes belong to the fourth prediction mode set. The encoding method of lfnst_idx of the fourth prediction mode set is the same as that of the related art, while the encoding method of lfnst_idx of the first prediction mode set is different from that of the related art.

[0549] For example, each transform core group in LFNST / NSPT has three transform cores. Blocks using the fourth prediction mode set can only select one transform core group, while blocks using the first prediction mode set can select two transform core groups, each with three transform cores. If the prediction mode of the current block belongs to the fourth prediction mode set, it can only select one texture feature index, and the possible values ​​of lfnst_idx are 0, 1, 2, or 3. If the prediction mode of the current block belongs to the first prediction mode set, the possible values ​​of lfnst_idx are 0, 1, 2, 3, 4, 5, or 6. 1, 2, and 3 correspond to the three transform cores of the transform core group corresponding to the first texture feature index, and 4, 5, and 6 correspond to the three transform cores of the transform core group corresponding to the second texture feature index. The binary symbol correspondence table for lfnst_idx for blocks using the fourth prediction mode set is shown in Table 8, and the binary symbol correspondence table for lfnst_idx for blocks using the first prediction mode set is shown in Table 7.

[0550] It is also understandable that embodiments of the present application may use a high-level syntax to control the switching of the present technical solution. In some embodiments, the method further includes: determining a value of a third syntax element; encoding the value of the third syntax element, and writing the obtained coded bits into the bitstream.

[0551] In the embodiment of the present application, the third syntax element is used to indicate whether the current sequence allows the use of the multi-transform core group selection technology. In addition, the third syntax element can be represented by sps_mtss_enabled_flag, and the third syntax element is a syntax element in the sequence parameter set (SPS).

[0552] In an embodiment of the present application, if the current sequence allows the use of MTSS technology, the value of the third syntax element is determined to be the fifth value; if the current sequence does not allow the use of MTSS technology, the value of the third syntax element is determined to be the sixth value.

[0553] Furthermore, in some embodiments, the method further includes: when the current sequence allows the use of the MTSS technology, executing the step of determining a transformation core group of the current block, wherein the current sequence includes the current block.

[0554] It should be noted that in the embodiment of the present application, the fifth value is different from the sixth value, and the fifth value and the sixth value can be in parameter form or in digital form. Specifically, the third syntax element can be a parameter written in the profile or the value of a flag, which is not specifically limited here. Exemplarily, the fifth value can be 1 and the sixth value can be 0; or, the fifth value can be 0 and the sixth value can be 1; or, the fifth value can be true and the sixth value can be false; or, the fifth value can be false and the sixth value can be true. In a specific embodiment, the fifth value is 1 and the sixth value is 0.

[0555] That is to say, the embodiment of the present application can use a high-level syntax to control the switch of the present technical solution. For example, a sequence-level flag is used, such as adding the syntax element sps_mtss_enabled_flag in the sequence parameter set. If the value of sps_mtss_enabled_flag is 1, the current sequence allows the use of MTSS technology; if the value of sps_mtss_enabled_flag is 0, the current sequence does not allow the use of MTSS technology. Among them, when the use of MTSS technology is allowed, more specifically, the method of decoding the texture feature index and LFNST / NSPT transform core index described in the present technical solution at the block level (CU or TU) is allowed; if the current sequence does not allow the use of MTSS technology, more specifically, the method of texture feature index and LFNST / NSPT transform core index described in the present technical solution will not be used at the block level (CU or TU).

[0556] In some embodiments, the method further includes: determining a value of a third syntax element and a value of a fourth syntax element; wherein the third syntax element is used to indicate whether the current sequence allows the use of a multi-transform kernel group selection technique, and the fourth syntax element is used to indicate whether the current image allows the use of a multi-transform kernel group selection technique; encoding the values ​​of the third syntax element and the fourth syntax element, and writing the obtained encoded bits into the bitstream.

[0557] Furthermore, in some embodiments, the method further includes: when the current sequence allows the use of MTSS technology, determining whether the current image allows the use of MTSS technology; when the current image allows the use of MTSS technology, executing the step of determining the transformation core group of the current block.

[0558] In the embodiment of the present application, the current sequence may include a current picture, and the current picture includes a current block. The fourth syntax element may be represented by ph_inter_lfnst_nspt_enabled_flag, and the fourth syntax element is a picture-level syntax element.

[0559] In an embodiment of the present application, if the current image allows the use of MTSS technology, the value of the fourth syntax element is determined to be the fifth value; if the current image does not allow the use of MTSS technology, the value of the fourth syntax element is determined to be the sixth value.

[0560] In some embodiments, the method further includes: determining a value of a third syntax element and a value of a fifth syntax element; wherein the third syntax element is used to indicate whether the current sequence allows the use of the multi-transform core group selection technology, and the fifth syntax element is used to indicate whether the current slice allows the use of the multi-transform core group selection technology; encoding the values ​​of the third syntax element and the values ​​of the fifth syntax element, and writing the obtained coded bits into the bitstream.

[0561] Furthermore, in some embodiments, the method further includes: when the current sequence allows the use of MTSS technology, determining whether the current slice allows the use of MTSS technology; when the current slice allows the use of MTSS technology, executing the step of determining the transformation core group of the current block.

[0562] In the embodiment of the present application, the current sequence may include a current slice, and the current slice includes a current block. The fifth syntax element may be represented by sh_inter_lfnst_nspt_enabled_flag, and the fifth syntax element is a slice-level syntax element.

[0563] It should also be noted that in the embodiment of the present application, if the current slice allows the use of MTSS technology, the value of the fifth syntax element is determined to be the fifth value; if the current slice does not allow the use of MTSS technology, the value of the fifth syntax element is determined to be the sixth value.

[0564] In an embodiment of the present application, the fifth value is different from the sixth value, and the fifth value and the sixth value can be in parameter form or in digital form. Specifically, the fourth syntax element or the fifth syntax element can be a parameter written in the profile, or it can be the value of a flag, which is not specifically limited here. Exemplarily, the fifth value can be 1 and the sixth value can be 0; or, the fifth value can be 0 and the sixth value can be 1; or, the fifth value can be true and the sixth value can be false; or, the fifth value can be false and the sixth value can be true. In a specific embodiment, the fifth value is 1 and the sixth value is 0.

[0565] That is, in the embodiment of the present application, in addition to the sequence-level syntax element sps_mtss_enabled_flag, other levels of syntax can also be used to achieve more flexible control, such as a flag in the Picture Parameter Set (PPS), or a flag in the picture header or slice header, etc. For example, first determine in the SPS whether the current sequence can use the MTSS technology. If the current sequence uses the MTSS technology, then set a sh_inter_lfnst_nspt_enabled_flag in the slice header to determine whether the current slice uses the MTSS technology, providing higher flexibility.

[0566] It is also understandable that, for the minimum sample threshold, in one possible implementation, the method may include: determining the minimum sample threshold; encoding the minimum sample threshold, and writing the resulting coded bits into the bitstream. Alternatively, in another possible implementation, the method may include: determining the value of a sixth syntax element when the current sequence allows the use of a multi-transform kernel group selection technique; wherein the sixth syntax element is used to indicate the minimum sample threshold; encoding the value of the sixth syntax element, and writing the resulting coded bits into the bitstream.

[0567] In the embodiment of the present application, the minimum sample threshold may be written directly into the bitstream, or written into the bitstream in the form of a sixth syntax element. In addition, the sixth syntax element may be represented by sps_mtss_min_pix, which may be a sequence-level syntax element.

[0568] When written into the bitstream as the sixth syntax element, the value of the sixth syntax element can be equal to the minimum sample threshold, or it can be encoded according to a certain mapping rule. For example, if the minimum sample threshold is 32, the value of the sixth syntax element is determined to be 0; if the minimum sample threshold is 64, the value of the sixth syntax element is determined to be 1; if the minimum sample threshold is 256, the value of the sixth syntax element is determined to be 2. In this way, after the value of the sixth syntax element is written into the bitstream, if the subsequent decoding end obtains the value of the sixth syntax element equal to 2 during decoding, it can be determined that the minimum sample threshold is 256.

[0569] That is, in an embodiment of the present application, a high-level syntax can be used to set a minimum sample threshold for applying MTSS technology, such as sps_mtss_min_pix. When the value of sps_mtss_enabled_flag is 1, the encoder encodes sps_mtss_min_pix to determine the minimum sample threshold for applying MTSS technology. Using high-level syntax, a trade-off between coding complexity and compression efficiency can be made based on demand. That is, under this method, the encoder needs to support all possible cases of sps_mtss_min_pix, but the encoder can configure the sps_mtss_min_pix required to encode the current bitstream. For example, when encoding a bitstream, if better compression efficiency is required but encoding time is not particularly important, a relatively small value, such as 16, can be set for sps_mtss_min_pix. If encoding time is particularly important and a certain degree of compression efficiency can be sacrificed, a relatively large value, such as 256, can be set for sps_mtss_min_pix.

[0570] It is also understandable that, for the minimum size threshold, in one possible implementation, the method may include: determining the minimum size threshold; encoding the minimum size threshold, and writing the resulting coded bits into the bitstream. Alternatively, in another possible implementation, the method may include: determining the value of the seventh syntax element when the current sequence allows the use of the multi-transform kernel group selection technique; wherein the seventh syntax element is used to indicate the minimum size threshold; encoding the value of the seventh syntax element, and writing the resulting coded bits into the bitstream.

[0571] In the embodiment of the present application, the minimum size threshold may be written directly into the bitstream, or written into the bitstream in the form of the seventh syntax element. In addition, the seventh syntax element may be represented by sps_mtss_min_size, which may be a sequence-level syntax element.

[0572] When writing the seventh syntax element into the bitstream, the value of the seventh syntax element can be equal to the minimum size threshold, or it can be encoded according to a certain mapping rule. For example, if the minimum size threshold is equal to 4, the value of the seventh syntax element is determined to be equal to 0; if the minimum sample threshold is equal to 16, the value of the seventh syntax element is determined to be equal to 1. In this way, after the value of the seventh syntax element is written into the bitstream, if the subsequent decoding end obtains the value of the seventh syntax element equal to 1 during decoding, it can be determined that the minimum size threshold is equal to 16.

[0573] That is, in an embodiment of the present application, a high-level syntax can be used to set a minimum size threshold for applying MTSS technology, such as sps_mtss_min_size. When the value of sps_mtss_enabled_flag is 1, the encoder encodes sps_mtss_min_size to determine the minimum size threshold for applying MTSS technology. Using high-level syntax, a trade-off between coding complexity and compression efficiency can be made according to needs. That is, under this method, the encoder needs to support all possible cases of sps_mtss_min_size, but the encoder can configure the sps_mtss_min_size required for encoding the current bitstream. For example, when encoding a bitstream, if better compression efficiency is required but encoding time is not particularly important, a relatively small value, such as 4, can be set for sps_mtss_min_size. If encoding time is particularly important and a certain degree of compression efficiency can be sacrificed, a relatively large value, such as 16, can be set for sps_mtss_min_size.

[0574] In another embodiment of the present application, the embodiment of the present application provides a code stream, wherein the code stream is generated by bit encoding based on information to be encoded; wherein the information to be encoded includes at least one of the following: a quantization coefficient of a current block, a transform core index of the current block, a transform core group index of the current block, a minimum sample threshold, a minimum size threshold, a value of a first syntax element, a value of a second syntax element, a value of a third syntax element, a value of a fourth syntax element, a value of a fifth syntax element, a value of a sixth syntax element, and a value of a seventh syntax element.

[0575] In an embodiment of the present application, the first syntax element is used to indicate the transform kernel group index of the current block, the second syntax element is used to indicate whether the current block uses the first transform mode and the corresponding transform kernel index, the third syntax element is used to indicate whether the current sequence allows the use of multiple transform kernel group selection techniques, the fourth syntax element is used to indicate whether the current image allows the use of multiple transform kernel group selection techniques, the fifth syntax element is used to indicate whether the current slice allows the use of multiple transform kernel group selection techniques, the sixth syntax element is used to indicate the minimum sample threshold, and the seventh syntax element is used to indicate the minimum size threshold. For example, taking the second syntax element as an example, if the value of the second syntax element is 0, it is determined that the current block does not use the first transform mode; if the value of the second syntax element is non-zero, it is determined that the current block uses the first transform mode and the corresponding transform kernel index. For example, if the value of the second syntax element is 1, it is determined that the current block uses the first transform kernel; if the value of the second syntax element is 2, it is determined that the current block uses the second transform kernel; if the value of the second syntax element is 4, it is determined that the current block uses the fourth transform kernel, and so on, without any limitation here.

[0576] The embodiment of the present application provides a coding method, specifically an intra-frame LFNST / NSPT multi-angle selection scheme. First, the transform kernel group of the current block is determined; then, based on the transform kernel group, the transform kernel of the current block is determined; then, the residual block of the current block is determined, and the residual block of the current block is transformed according to the transform kernel to determine the transform coefficient of the current block; finally, the transform coefficient of the current block is encoded, and the obtained coded bits are written into the bitstream. In this way, the transform kernel group of the current block is determined according to the multi-transform kernel group selection technology, and then the transform kernel of the current block is determined therefrom. In this way, for the current block predicted using certain intra-frame prediction modes, when determining the transform kernel of the current block, multiple candidate texture features derived by the multi-transform kernel group selection technology can be used to guide the transform, thereby improving the accuracy of the transform prediction, thereby improving the compression efficiency, and further improving the encoding and decoding performance.

[0577] In another embodiment of the present application, based on the encoding and decoding method described in the aforementioned embodiment, in VVC and ECM, the LFNST / NSPT transform core index can be represented by the syntax element lfnst_idx. In VVC, lfnst_idx can have three values, namely 0, 1, and 2. Among them, lfnst_idx is 0, which means that the current block does not use LFNST. Each transform core group of LFNST in VVC has 2 transform cores, so the value of lfnst_idx is 1 or 2, which means that the current block uses the first transform core or the second transform core of the selected transform core group of LFNST. In the current ECM, lfnst_idx can have four values, namely 0, 1, 2, and 3. Where lfnst_idx is 0, which means that the current block does not use LFNST / NSPT. Each transform core group of LFNST / NSPT in ECM has 3 transform cores, so the value of lfnst_idx is 1, 2, or 3, which means that the current block uses the first transform core, the second transform core, or the third transform core of the selected transform core group of LFNST / NSPT.

[0578] In MTSS, if the intra prediction mode of the current block is a special intra prediction mode, it can select more than one transform kernel group. For example, it can select two transform kernel groups. These special intra prediction modes include but are not limited to DIMD, TIMD, MIP, EIP, SGPM, ITMP, and IBC.

[0579] In a specific embodiment, a classification is made here: DC, PLANAR, and various angle prediction modes are classified into the first intra-frame prediction mode set (equivalent to the "fourth prediction mode set" of the aforementioned embodiment), and DIMD, TIMD, MIP, EIP, SGPM, ITMP, IBC, etc. are classified into the second intra-frame prediction mode set (equivalent to the "first prediction mode set" of the aforementioned embodiment).

[0580] Each transform kernel group in LFNST / NSPT has three transform kernels. Blocks using the first intra-frame prediction mode set can only select one transform kernel group, while blocks using the second intra-frame prediction mode set can select two transform kernel groups, each with three transform kernels. If the prediction mode of the current block belongs to the first intra-frame prediction mode set, it can only select one texture feature, so the possible values ​​of lfnst_idx are 0, 1, 2, and 3. If the prediction mode of the current block belongs to the second intra-frame prediction mode set, the possible values ​​of lfnst_idx are 0, 1, 2, 3, 4, 5, and 6. Among them, 1, 2, and 3 correspond to the three transform kernels of the transform kernel group corresponding to the first texture feature index, and 4, 5, and 6 correspond to the three transform kernels of the transform kernel group corresponding to the second texture feature index.

[0581] In the embodiment of the present application, the binary symbol correspondence table of lfnst_idx of the block using the first intra prediction mode set is shown in the aforementioned Table 8, and the binary symbol correspondence table of lfnst_idx of the block using the second intra prediction mode set is shown in the aforementioned Table 7. Among them, the third binary symbol, that is, the binary symbol with BinIdx being 2, can also be understood as selecting the first candidate texture feature index or the second candidate texture feature index, or selecting the first candidate transform kernel group or the second candidate transform kernel group.

[0582] In another specific embodiment, the second intra-frame prediction mode set may include only one or more of DIMD, TIMD, MIP, EIP, SGPM, ITMP, and IBC. For example, the second intra-frame prediction mode set includes DIMD, TIMD, and SGPM. The other modes belong to the first intra-frame prediction mode set. The lfnst_idx encoding method of the first intra-frame prediction mode set is the same as that of the related art, while the lfnst_idx encoding method of the second intra-frame prediction mode set is different from that of the related art.

[0583] It should also be noted that in the embodiment of the present application, a dedicated syntax element, such as lfnst_feature_idx, can also be set. The possible values ​​of lfnst_feature_idx are 0 or 1, indicating which candidate texture feature is selected, or which candidate transform core group is selected. If the intra prediction mode of the current block belongs to the second intra prediction mode set and lfnst_idx>0, lfnst_feature_idx is parsed, and the result is equivalent to the above embodiment. Alternatively, this syntax element can also be called lfnst_set_idx, that is, the candidate transform core group index.

[0584] It can be understood that for the derivation of candidate texture feature indexes, the MTSS technology can use the reconstructed areas on the left and above the current block to derive candidate texture feature indexes, which is similar to the existing approach of DIMD. Because the reconstructed areas on the left and above are not the current block but are adjacent to the current block, for example, when the textures are connected, they can be used to estimate the texture of the current block to a certain extent. Another possibility is to use the prediction block of the current block to derive the candidate texture feature index, and another possibility is to use the prediction block of the current block and the reconstructed areas on the left and above the current block at the same time, so that more samples can be used to derive the candidate texture feature index.

[0585] In the embodiment of the present application, the candidate texture feature indexes (or candidate texture features) here can also be directly referred to as candidate transformation kernel groups.

[0586] One derivation method is to calculate the gradients of all or part of the samples in the selected area. Generally, horizontal and vertical gradients can be calculated, and the Sobel operator can be used to calculate the gradients. For a particular sample, the texture direction is inferred based on its horizontal and vertical gradients. For example, if the horizontal gradient is non-zero and the vertical gradient is zero, the texture at that point is vertical. Conversely, if the horizontal gradient is zero and the vertical gradient is non-zero, the texture at that point is horizontal. For example, if the horizontal and vertical gradients are equal and non-zero, the texture at that point is 45 degrees. Of course, there are many other cases where both the horizontal and vertical gradients are non-zero, and the texture direction of the sample can be determined based on their ratio. This allows the gradient to be mapped to the corresponding intra-prediction mode. A statistical table of intra-prediction modes is constructed, and the gradient strength of each calculated sample is accumulated in the corresponding intra-prediction mode entry in the statistical table. After the gradient statistics are completed, the intra-prediction modes are sorted in descending order of accumulated gradient strength. For complexity considerations, you can only maintain a list of length N, where the length of N can be 2, 3, 4, 5...10, etc.

[0587] In one possible implementation, an example of a Sobel operator is as follows.

[0588] Horizontal gradient operator:

[0589] Operator for vertical gradient:

[0590] Assume that the sample value of the prediction block is P at the sample position (x, y) x,y , then the horizontal gradient grad x vertical gradient grad y The calculation is as follows: grad x =P x+1,y-1 +2*P x+1,y +P x+1,y+1 -P x-1,y-1 -2*P x-1,y -P x-1,y+1 (9) grad y =P x-1,y+1 +2*P x,y+1 +P x+1,y+1 -P x-1,y-1 -2*P x,y-1 -P x+1,y-1 (10)

[0591] An example of the gradient strength being denoted as amp is amp=abs(grad x )+abs(grad y ).

[0592] According to grad x and grad y The virtual intra prediction mode can be derived by looking up a table. For example, if abs(grad x ) is equal to 0 and abs(grad y ) is not equal to 0, there is horizontal texture, corresponding to intra prediction mode 18 in VVC. If abs(grad y ) is equal to 0 and abs(grad x ) is not equal to 0, there is vertical texture, corresponding to intra prediction mode 50 in VVC. If abs(grad x ) and abs(grad y ) are not equal to 0: If abs(grad x ) is equal to abs(grad y ), and grad x and grad y The same sign corresponds to intra prediction mode 34 in VVC; if abs(grad x ) is equal to 2 times abs(grad y ), and grad x and grad y The symbols are the same, corresponding to intra prediction mode 40 in VVC.

[0593] Other cases can be determined by looking up the table according to the same principle. DIMD also needs to perform similar statistical analysis to derive the intra-frame prediction mode. In terms of implementation, some logic can be reused with DIMD.

[0594] According to the above method, a list of intra-frame prediction modes with a length of N and sorted can be obtained. Then a list of candidate texture features is generated. An optional operation is to prune the N intra-frame prediction modes, or to exclude intra-frame prediction modes that are too close. Taking the intra-frame prediction mode in VVC as an example, the angles of some adjacent intra-frame prediction modes are very close. If two candidate texture features select two very close angles, their difference is not obvious. Therefore, a threshold can be set, which represents the gap between the two intra-frame prediction modes. For example, the intra-frame prediction mode with the largest cumulative gradient intensity value is the first candidate texture feature candFeature0, then when selecting the second candidate texture feature candFeature1, there needs to be a certain gap between candFeature1 and candFeature0, such as candFeature1+THR<candFeature0||candFeature1-THR> candFeature0. If all N-1 intra-frame prediction modes are checked and still no one meets the requirements, one possible method is to go back and set the second intra-frame prediction mode in the sorted intra-frame prediction mode list of length N to candFeature1. One possible method is to add a default texture feature index. The THR may be 3, 4, 5, 6, etc. For the case where the cumulative values ​​of multiple adjacent angles are very high, this method will give priority to angles with a certain degree of distinction. A possible embodiment is that the value of THR is equal to 0, or THR is not set, that is, as long as they are different, it is fine.

[0595] The above method does not take into account some of the modes derived from the DIMD, TIMD, SGPM and other modes themselves. For example, DIMD itself will derive one or several intra-frame prediction modes for weighting, and TIMD itself will also derive one or several intra-frame prediction modes for weighting. SGPM not only has two intra-frame prediction modes, but also a "partition" mode that can find the corresponding intra-frame prediction mode, and the residual often appears in the boundary area of ​​the "partition". One possible method is to determine the candidate texture feature index based on the modes derived from the DIMD, TIMD, SGPM and other modes themselves and the modes derived by the above method.

[0596] In a specific embodiment, as follows:

[0597] For DIMD mode, the first intra prediction mode derived by DIMD is used as candFeature0.

[0598] For TIMD mode, the first intra prediction mode derived by TIMD is used as candFeature0.

[0599] For SGPM mode, the intra prediction mode corresponding to the SGPM "split" mode is used as candFeature0.

[0600] Then, candFeature1 is determined according to the above method. That is, the intra-frame prediction modes in the sorted intra-frame prediction mode list of length N are tried, starting from the first intra-frame prediction mode. If an intra-frame prediction mode meets the THR restriction, it is used as candFeature1.

[0601] For IBC, ITMP, etc., the prediction block, or the prediction block plus the template can be used to derive the candidate texture feature index.

[0602] If the samples used by the MTSS technique to derive the list of N sorted intra-frame prediction modes are the same as the samples used by DIMD, then the first intra-frame prediction mode derived by DIMD is the same as the first intra-frame prediction mode derived by MTSS.

[0603] In another specific embodiment, as follows:

[0604] Since DIMD, TIMD, and SGPM can all derive more than one intra-frame prediction mode, these modes can also give priority to using multiple modes derived by each mode to determine the candidate texture feature index. When the modes derived by each mode itself cannot fill all the candidate texture feature indexes, one possible method is to add a default texture feature index. Another possible method is to use the above-mentioned sorted intra-frame prediction mode list of length N to determine the candidate texture feature index.

[0605] For example, for the DIMD mode, if it uses the prediction values ​​of multiple intra-frame prediction modes for weighting during prediction, then the multiple intra-frame prediction modes used for weighting can be sequentially tried to be determined as candidate texture feature indexes.

[0606] For example, for the TIMD mode, if it uses the prediction values ​​of multiple intra-frame prediction modes for weighting during prediction, then the multiple intra-frame prediction modes used for weighting can be sequentially tried to be determined as candidate texture feature indexes.

[0607] For example, for the SGPM mode, the intra-frame prediction mode corresponding to the "partition" mode derived therefrom and the two intra-frame prediction modes used for prediction may be sequentially attempted to be determined as candidate texture feature indexes.

[0608] In another specific embodiment, as follows:

[0609] For MIP and EIP modes, the texture features derived using gradients can be derived using the texture feature derivation method described in MTSS. The samples used can be predicted samples (the value of the predicted sample is the predicted value), reconstructed samples around the current block, or a combination of predicted and reconstructed samples. For ease of description, texture features derived using gradients are called derived texture features.

[0610] Exemplarily, for the MIP mode and the EIP mode, the first derived texture feature is used as its candFeature0, and the second derived texture feature is used as its candFeature1.

[0611] The MIP mode and EIP mode can be widely used in blocks with texture gradients, and their features are similar to those of the PLANAR mode. Therefore, the PLANAR mode can also be used as a candidate texture feature for the MIP mode and EIP mode.

[0612] For example, for MIP mode and EIP mode, the first derived texture feature is used as its candFeature0, and for PLANAR mode, the first derived texture feature is used as its candFeature1.

[0613] Of course, MTSS technology may not use additional gradient-derived texture features. In other words, using gradient-derived texture features is not a necessary condition for selecting the MTSS multi-transform kernel group.

[0614] In another specific embodiment, as follows:

[0615] MTSS technology is only applied to DIMD, TIMD, and SGPM modes.

[0616] For the DIMD mode, since the DIMD mode itself uses gradient-derived texture features and can derive multiple intra-frame prediction modes, there is no need for the MTSS technology to additionally use gradient-derived texture features.

[0617] For the TIMD mode, since the TIMD mode itself can derive multiple intra-frame prediction modes, there is no need for the MTSS technology to additionally use gradients to derive texture features.

[0618] For the SGPM mode, since the SGPM mode itself can derive a "partition" mode and two intra-frame prediction modes, there is no need for the MTSS technology to additionally use gradients to derive texture features.

[0619] More specifically, a possible embodiment is as follows:

[0620] For the DIMD mode, the first intra-frame prediction mode derived from the DIMD mode is used as candFeature0, and the second intra-frame prediction mode derived from the DIMD mode is used as candFeature1.

[0621] For the TIMD mode, the first intra-frame prediction mode derived from the TIMD mode is used as candFeature0, and the second intra-frame prediction mode derived from the TIMD mode is used as candFeature0.

[0622] For the SGPM mode, the intra-frame prediction mode corresponding to the "split" mode of the SGPM mode is used as candFeature0, and the first intra-frame prediction mode derived from the SGPM mode is used as candFeature0.

[0623] Of course, if MTSS can be applied to EIP mode and MIP mode, since EIP mode and MIP mode themselves use gradient to derive texture features, MTSS technology can only add a texture feature corresponding to the PLANAR mode, so it does not need to use additional gradient to derive texture features.

[0624] In addition, if the intra-frame prediction mode derived by DIMD, TIMD, or SGPM includes ITMP or IBC, or EIP or MIP mode, the texture features corresponding to the PLANAR mode can also be used as candidate texture features. Since DIMD, TIMD, and SGPM can use more than two intra-frame prediction modes for weighting or combination, the intra-frame prediction mode may be ITMP or IBC, or EIP or MIP mode. In this case, the texture features corresponding to the PLANAR mode can be used as candidate texture features.

[0625] It should also be noted that the existing ECM LFNST / NSPT has many transform core groups, so that adjacent intra-frame prediction modes correspond to different transform core groups. A compromise solution in subsequent standards is to appropriately reduce the number of transform core groups so that multiple intra-frame prediction modes correspond to one transform core group. This is similar to the use of 4 transform core groups in VVC, and multiple intra-frame prediction modes of similar angles correspond to the same transform core group. The number of transform core groups in subsequent standards may be 4 or other, such as 8, 12, etc. For the embodiments of the present application, if multiple adjacent intra-frame prediction modes correspond to one transform core group, then when determining the candidate texture features, it is necessary to ensure that each candidate texture feature is not determined to be the same transform core group.

[0626] That is to say, the texture feature index described in this article is used to determine the transformation kernel group. The texture feature index is used for ease of understanding, and the transformation kernel group can also be used directly to replace the texture feature index.

[0627] It should also be noted that the number of samples for which gradients are calculated can be determined by the size of the current block. Because the Sobel operator uses samples in the upper, lower, left, and right rows and columns surrounding the current sample, it is possible to exclude the gradients of the outermost samples in the upper, lower, left, and right rows and columns of the current block. If the current block size is small, statistics can be calculated for all samples for which gradients can be calculated. If the current block size is large, statistics can be calculated for downsampling, for example, counting one sample out of every two, four, or eight samples in the horizontal and / or vertical directions.

[0628] For example, if the horizontal or vertical size of the current block is less than or equal to 8, gradient statistics are performed on all available samples in that direction. Otherwise, if the horizontal or vertical size of the current block is less than or equal to 16, gradient statistics are performed on one of every two samples in that direction. Otherwise, gradient statistics are performed on one of every four samples in that direction.

[0629] It should also be noted that the size of the blocks to which the MTSS technology is applicable can also be restricted. Specifically, the increase in the complexity of the decoder caused by the MTSS technology is reflected in the difference in parsing syntax elements, which is generally believed to have little effect on the complexity of the decoder. However, for the encoder, this will increase the complexity of the encoder due to the increase in candidates for the transform core group. Specifically, a block may choose one from two or more LFNST / NSPT transform core groups. However, a block of VVC has only one available transform core group. Therefore, one solution is to limit the size of the blocks to which the MTSS technology is applicable, so that the MTSS technology can be disabled at block sizes where the MTSS technology requires a lot of additional calculations but the compression efficiency improvement is not obvious.

[0630] For example, a minimum sample threshold for applying MTSS can be set, called MIN_PIX. If the number of samples (width multiplied by height) of a block is less than MIN_PIX, MTSS cannot be used for this block. Otherwise, if the number of samples of this block is greater than or equal to MIN_PIX, MTSS can be used for this block. MIN_PIX can be set to 32, 64, 256, etc.

[0631] For example, a minimum size threshold for applying MTSS technology can be set, called MIN_SIZE. If the width or height of a block is less than MIN_SIZE, MTSS technology cannot be used for this block. Otherwise, if the width and height of the block are both greater than or equal to MIN_SIZE, MTSS technology can be used for this block. The value of MIN_SIZE may be 8, etc.

[0632] It should also be noted that a high-level syntax can be used to control the switch of the present technical solution. Exemplarily, a sequence-level syntax element flag is used, for example, the syntax element sps_mtss_enabled_flag is added to the sequence parameter set (SPS). If the value of sps_mtss_enabled_flag is 1, the current sequence allows the use of MTSS technology, more specifically, it allows the encoding and decoding of the texture feature index and LFNST / NSPT transform core index described in the present technical solution at the block level (CU or TU). If the value of sps_mtss_enabled_flag is 0, the current sequence does not allow the use of MTSS technology, more specifically, the texture feature index and LFNST / NSPT transform core index described in the present technical solution will not be used at the block level (CU or TU).

[0633] Of course, other levels of syntax can also be used to achieve more flexible control, such as flags in the Picture Parameter Set (PPS), or flags in the picture header or slice header. For example, first determine in the SPS whether the current sequence can use this technical solution. If the current sequence uses this technical solution, then set a sh_inter_lfnst_nspt_enabled_flag in the slice header to determine whether the current slice uses this technical solution, providing greater flexibility.

[0634] It should also be noted that embodiments of the present application can use a high-level syntax to set a minimum sample threshold for applying MTSS technology, such as sps_mtss_min_pix. When the value of sps_mtss_enabled_flag is 1, the decoder parses sps_mtss_min_pix to determine the minimum sample threshold for applying MTSS technology. Using high-level syntax, a trade-off between coding complexity and compression efficiency can be made based on demand. In other words, under this method, the decoder needs to support all possible cases of sps_mtss_min_pix, but the encoder can configure the sps_mtss_min_pix required to encode the current bitstream. For example, when encoding a bitstream, if better compression efficiency is required but encoding time is not particularly important, a relatively small value, such as 16, can be set for sps_mtss_min_pix. If encoding time is particularly important and a certain degree of compression efficiency can be sacrificed, a relatively large value, such as 256, can be set for sps_mtss_min_pix.

[0635] Similarly, the embodiments of the present application can also use a high-level syntax to set a minimum size threshold for applying MTSS technology, such as sps_mtss_min_size. When the value of sps_mtss_enabled_flag is 1, the decoder parses sps_mtss_min_size to determine the minimum size threshold for applying MTSS technology. Using high-level syntax, a trade-off can be made between coding complexity and compression efficiency according to needs. That is, under this method, the decoder needs to support all possible cases of sps_mtss_min_size, but the encoder can configure the sps_mtss_min_size required to encode the current code stream. For example, when encoding a code stream, if better compression efficiency is required but encoding time is not particularly important, a relatively small value such as 4 can be set for sps_mtss_min_size. If encoding time is particularly important and a certain degree of compression efficiency can be lost, a relatively large value such as 16 can be set for sps_mtss_min_size.

[0636] In the embodiments of the present application, the specific implementation of the aforementioned embodiments is described in detail through the above embodiments. It can be seen that, according to the technical solutions of the aforementioned embodiments, special processing of the MIP mode and the EIP mode is implemented; in some cases, the PLANAR mode is used as a candidate texture feature; the MTSS technology may not additionally use gradient-derived texture features; and there are restrictions on block size. In this way, for blocks predicted using certain special intra-frame prediction modes in intra-frame coding, their predicted residual texture features are not as clear as those of ordinary intra-frame prediction modes. Using the MTSS technology to derive multiple candidate texture features to guide the transformation can improve compression efficiency and thus improve encoding and decoding performance.

[0637] In yet another embodiment of the present application, based on the same inventive concept as the aforementioned embodiment, FIG35 is a schematic diagram of the composition structure of an encoder provided in an embodiment of the present application. As shown in FIG35 , the encoder 350 may include a first determination unit 3501, a first transformation unit 3502, and an encoding unit 3503, wherein:

[0638] A first determining unit 3501 is configured to determine a transform core group of a current block; and further configured to determine a transform core of the current block according to the transform core group;

[0639] a first transform unit 3502 configured to determine a residual block of a current block, and transform the residual block of the current block according to a transform kernel to determine a transform coefficient of the current block;

[0640] The encoding unit 3503 is configured to perform encoding processing on the transform coefficients of the current block and write the obtained encoding bits into the bitstream.

[0641] In some embodiments, the first determination unit 3501 is further configured to perform encoding cost calculation on the current block based on at least two candidate transform core groups, and determine the cost results corresponding to each of the at least two candidate transform core groups; determine the minimum cost result among the cost results corresponding to each of the at least two candidate transform core groups, and determine the candidate transform core group corresponding to the minimum cost result as the transform core group of the current block.

[0642] In some embodiments, the first determination unit 3501 is further configured to determine the transform core group index of the current block; wherein the transform core group index is used to indicate the number of the transform core group of the current block in at least two candidate transform core groups; the encoding unit 3503 is further configured to encode the transform core group index of the current block and write the obtained encoded bits into the bitstream.

[0643] In some embodiments, the first determination unit 3501 is further configured to determine the value of the first syntax element based on the transform core group index of the current block; the encoding unit 3503 is further configured to encode the value of the first syntax element and write the obtained encoded bits into the bitstream.

[0644] In some embodiments, the first determining unit 3501 is further configured to determine the number of samples of the current block; when the number of samples of the current block is greater than or equal to the minimum sample threshold, perform the step of determining the transformation core group of the current block.

[0645] In some embodiments, the first determination unit 3501 is further configured to determine the size of the current block, where the size of the current block includes height and width; when the height and width of the current block are both greater than or equal to the minimum size threshold, the step of determining the transformation core group of the current block is executed.

[0646] In some embodiments, the first determination unit 3501 is further configured to determine a prediction mode of the current block; when the prediction mode of the current block is one of the items in the first prediction mode set, the step of determining the transform core group of the current block is performed; wherein the first prediction mode set includes at least one of the following prediction modes: DC mode, PLANAR mode and other prediction modes other than the angle prediction mode.

[0647] In some embodiments, the first prediction mode set includes at least one of the following prediction modes: a mode for combined prediction using at least two intra-frame prediction modes, the intra-frame prediction mode including at least one of the following: DC mode, PLANAR mode and angular prediction mode; a mode for prediction by copying intra-frame blocks; a mode for prediction using an interpolation filter; a mode for prediction using matrix operations.

[0648] In some embodiments, the first prediction mode set includes at least one of the following prediction modes: DIMD mode, TIMD mode, SGPM mode, MIP mode, EIP mode, ITMP mode, and IBC mode.

[0649] In some embodiments, when the prediction mode of the current block is one of the items in the second prediction mode set, the first determination unit 3501 is further configured to determine the transform core group of the current block based on the i-th intra-frame prediction mode derived from the prediction mode of the current block if the transform core group index is the i-th value, where i is a positive integer; wherein the second prediction mode set includes at least one of the following prediction modes: a mode for combined prediction using at least two intra-frame prediction modes, and the intra-frame prediction mode includes at least one of the following: DC mode, PLANAR mode, and angular prediction mode.

[0650] In some embodiments, when the prediction mode of the current block is one of the items in the third prediction mode set, the first determination unit 3501 is further configured to determine the transform core group of the current block based on the first intra-frame prediction mode derived from the prediction mode of the current block if the transform core group index is a first value; and determine the transform core group of the current block based on the PLANAR mode if the transform core group index is a second value; wherein the third prediction mode set includes at least one of the following prediction modes: a mode for prediction using an interpolation filter and a mode for prediction using matrix operations.

[0651] In some embodiments, the first determining unit 3501 is further configured to determine a first candidate list for the current block, the first candidate list indicating at least two candidate transform core groups; and determine the transform core group of the current block according to the first candidate list and the transform core group index.

[0652] In some embodiments, the first determination unit 3501 is further configured to determine one or more intra-frame prediction modes derived based on the prediction mode of the current block; and determine one or more candidate transform core groups based on the one or more intra-frame prediction modes, and add the one or more candidate transform core groups to the first candidate list.

[0653] In some embodiments, the first determination unit 3501 is further configured to determine a preset texture feature index of the current block when the first candidate list is not filled; and determine one or more candidate transform core groups based on the preset texture feature index, and add the one or more candidate transform core groups to the first candidate list.

[0654] In some embodiments, the first determination unit 3501 is further configured to, when the prediction mode of the current block is one of the items in the second prediction mode set, determine multiple intra-frame prediction modes derived based on the prediction mode of the current block; and determine multiple candidate transform core groups based on the multiple intra-frame prediction modes, and add the multiple candidate transform core groups to the first candidate list; wherein the second prediction mode set includes at least one of the following prediction modes: a mode for combined prediction using at least two intra-frame prediction modes, and the intra-frame prediction mode includes at least one of the following: DC mode, PLANAR mode and angular prediction mode.

[0655] In some embodiments, the first determining unit 3501 is further configured to determine a plurality of candidate transform core groups according to a plurality of intra prediction modes and a PLANAR mode, and add the plurality of candidate transform core groups to the first candidate list.

[0656] In some embodiments, the first determination unit 3501 is further configured to determine an intra-frame prediction mode derived based on the prediction mode of the current block when the prediction mode of the current block is one of the items in the third prediction mode set; and determine two candidate transform core groups based on the intra-frame prediction mode and the PLANAR mode, and add the two candidate transform core groups to the first candidate list; wherein the third prediction mode set includes at least one of the following prediction modes: a mode for prediction using an interpolation filter and a mode for prediction using matrix operations.

[0657] In some embodiments, the first determination unit 3501 is further configured to determine candidate samples for deriving texture feature indexes when the first candidate list is not filled; determine one or more candidate texture feature indexes of the current block based on the candidate samples; and determine one or more candidate transform core groups based on the one or more candidate texture feature indexes, and add the one or more candidate transform core groups to the first candidate list.

[0658] In some embodiments, the first determination unit 3501 is further configured to determine the horizontal gradient value and the vertical gradient value of the candidate sample; determine the texture feature index and the gradient intensity value corresponding to the candidate sample based on the horizontal gradient value and the vertical gradient value of the candidate sample; determine the texture feature statistics table based on the texture...

Claims

1. A decoding method, applied to a decoder, comprising: Determining a transform core group index of a current block, and determining a transform core group of the current block according to the transform core group index of the current block; determining a transform kernel of the current block according to the transform kernel group; A transformation coefficient of the current block is determined, and the transformation coefficient of the current block is transformed according to the transformation kernel to determine a residual block of the current block.

2. The method according to claim 1, wherein The determining of the transform core group index of the current block includes: The code stream is decoded to determine a transform core group index of the current block.

3. The method according to claim 1, wherein The determining of the transform core group index of the current block includes: Decoding the code stream and determining the value of the first syntax element; Determine a transform core group index of the current block according to a value of the first syntax element.

4. The method according to claim 1, wherein The method further comprises: Determining the number of samples of the current block; When the number of samples of the current block is greater than or equal to the minimum sample threshold, the step of determining the transform core group index of the current block is performed.

5. The method according to claim 1, wherein The method further comprises: Determine a size of the current block, wherein the size of the current block includes a height and a width; When the height and width of the current block are both greater than or equal to the minimum size threshold, the step of determining the transform core group index of the current block is performed.

6. The method according to claim 1, wherein The method further comprises: determining a prediction mode for the current block; When the prediction mode of the current block is one of the first prediction mode set, performing the step of determining the transform core group index of the current block; The first prediction mode set includes at least one of the following prediction modes: DC mode, PLANAR mode and other prediction modes other than angular prediction mode.

7. The method according to claim 6, wherein: The first prediction mode set includes at least one of the following prediction modes: A mode for combined prediction using at least two intra-frame prediction modes, wherein the intra-frame prediction mode includes at least one of the following: DC mode, PLANAR mode, and angular prediction mode; Mode for copying intra blocks for prediction; Mode for prediction using extrapolation filters; Mode for making predictions using matrix operations.

8. The method according to claim 6, wherein: The first prediction mode set includes at least one of the following prediction modes: DIMD mode, TIMD mode, SGPM mode, MIP mode, EIP mode, ITMP mode, and IBC mode.

9. The method according to claim 6, wherein: When the prediction mode of the current block is one of the items in the second prediction mode set, determining the transform core group of the current block according to the transform core group index of the current block includes: If the transform core group index is an i-th value, determining a transform core group for the current block based on an i-th intra prediction mode derived from the prediction mode of the current block, where i is a positive integer; The second prediction mode set includes at least one of the following prediction modes: a mode for combined prediction using at least two intra-frame prediction modes, and the intra-frame prediction mode includes at least one of the following: DC mode, PLANAR mode and angular prediction mode.

10. The method according to claim 6, wherein: When the prediction mode of the current block is one of the items in the third prediction mode set, determining the transform core group of the current block according to the transform core group index of the current block includes: If the transform core group index is a first value, determining a transform core group for the current block based on a first intra prediction mode derived from the prediction mode of the current block; If the transform core group index is the second value, determining the transform core group of the current block based on the PLANAR mode; The third prediction mode set includes at least one of the following prediction modes: a mode for performing prediction using an extrapolation filter and a mode for performing prediction using a matrix operation.

11. The method according to claim 6, wherein: The determining the transform core group of the current block according to the transform core group index of the current block includes: determining a first candidate list for the current block, the first candidate list indicating at least two candidate transform core groups; A transform core group for the current block is determined according to the first candidate list and the transform core group index.

12. The method according to claim 11, wherein Determining a first candidate list for the current block includes: determining one or more intra prediction modes derived based on a prediction mode of the current block; One or more candidate transform core groups are determined according to the one or more intra prediction modes, and the one or more candidate transform core groups are added to the first candidate list.

13. The method according to claim 12, wherein: The method further comprises: When the first candidate list is not filled, determining a preset texture feature index of the current block; One or more candidate transform kernel groups are determined according to the preset texture feature index, and the one or more candidate transform kernel groups are added to the first candidate list.

14. The method according to claim 11, wherein Determining a first candidate list for the current block includes: When the prediction mode of the current block is one of the second prediction mode set, determining a plurality of intra prediction modes derived based on the prediction mode of the current block; determining a plurality of candidate transform core groups according to the plurality of intra prediction modes, and adding the plurality of candidate transform core groups to the first candidate list; The second prediction mode set includes at least one of the following prediction modes: a mode for combined prediction using at least two intra-frame prediction modes, and the intra-frame prediction mode includes at least one of the following: DC mode, PLANAR mode and angular prediction mode.

15. The method according to claim 14, wherein The method further comprises: A plurality of candidate transform core groups are determined according to the plurality of intra prediction modes and the PLANAR mode, and the plurality of candidate transform core groups are added to the first candidate list.

16. The method according to claim 11, wherein Determining a first candidate list for the current block includes: When the prediction mode of the current block is one of the third prediction mode set, determining an intra prediction mode derived based on the prediction mode of the current block; determining two candidate transform core groups according to the intra prediction mode and the PLANAR mode, and adding the two candidate transform core groups to the first candidate list; The third prediction mode set includes at least one of the following prediction modes: a mode for performing prediction using an extrapolation filter and a mode for performing prediction using a matrix operation.

17. The method according to claim 11, wherein The method further comprises: When the first candidate list is not filled, determining candidate samples for deriving texture feature indexes; Determining one or more candidate texture feature indexes of the current block according to the candidate samples; One or more candidate transform kernel groups are determined according to the one or more candidate texture feature indices, and the one or more candidate transform kernel groups are added to the first candidate list.

18. The method according to claim 17, wherein The determining, based on the candidate samples, one or more candidate texture feature indexes of the current block includes: Determining a horizontal gradient value and a vertical gradient value of the candidate sample; Determining a texture feature index and a gradient intensity value corresponding to the candidate sample according to the horizontal gradient value and the vertical gradient value of the candidate sample; Determine a texture feature statistics table according to the texture feature index and gradient intensity value corresponding to the candidate sample; One or more candidate texture feature indexes of the current block are determined according to the texture feature statistics table.

19. The method according to claim 18, wherein The determining of a texture feature statistics table according to the texture feature index and the gradient intensity value corresponding to the candidate sample includes: When the number of the candidate samples is at least one, determining at least one texture feature index and at least one corresponding gradient intensity value; Determining at least one reference texture feature index having mutually different characteristics based on the at least one texture feature index, and accumulating gradient intensity values ​​belonging to the same reference texture feature index based on the at least one gradient intensity value to determine a gradient intensity accumulation value corresponding to the at least one reference texture feature index; The texture feature statistics table is determined according to the at least one reference texture feature index and the gradient intensity accumulation value corresponding to the at least one reference texture feature index.

20. The method according to claim 19, wherein The determining, according to the texture feature statistics table, one or more candidate texture feature indexes of the current block includes: Sorting the texture feature statistics table from high to low according to the gradient intensity accumulation values, and determining the reference texture feature indexes corresponding to the top N gradient intensity accumulation values; wherein N is a positive integer; The N reference texture feature indexes are determined as one or more candidate texture feature indexes of the current block.

21. The method according to claim 20, wherein The method further comprises: The N reference texture feature indexes are pruned to determine one or more candidate texture feature indexes for the current block.

22. The method according to claim 11, wherein When the first candidate list indicates the transform cores included in the at least two transform core groups, the method further includes: Determining a transform kernel index of the current block; A transform core of the current block is determined according to the first candidate list and the transform core index.

23. The method according to claim 1, wherein The determining, according to the transformation core group, a transformation core of the current block includes: Determining a transform kernel index of the current block; A transform core of the current block is determined according to the transform core group and the transform core index.

24. The method according to claim 22 or 23, wherein The determining of the transform core index of the current block includes: The code stream is decoded to determine a transform kernel index of the current block.

25. The method according to claim 22 or 23, wherein The determining of the transform core index of the current block includes: Decoding the code stream and determining a value of the second syntax element; When the second syntax element indicates that the current block uses the first transform mode, a transform core index of the current block is determined according to a value of the second syntax element.

26. The method according to any one of claims 1 to 25, wherein The determining of the transform coefficient of the current block includes: Decoding a code stream to determine a quantization coefficient of the current block; Dequantizing the quantized coefficients of the current block to determine the transform coefficients of the current block.

27. The method according to any one of claims 1 to 25, wherein The transforming the transform coefficients of the current block according to the transform kernel to determine the residual block of the current block includes: performing a non-separable basic transform on the transform coefficients of the current block according to the transform kernel to determine a residual block of the current block; or Performing a low-frequency inseparable transform on the transform coefficients of the current block according to the transform kernel to determine a transform block of the current block, and performing a discrete cosine transform on the transform block of the current block to determine a residual block of the current block.

28. The method according to any one of claims 1 to 25, wherein The method further comprises: Performing intra-frame prediction on the current block to determine a prediction block of the current block; A reconstructed block of the current block is determined according to the prediction block of the current block and the residual block of the current block.

29. The method according to any one of claims 1 to 25, wherein The method further comprises: Decoding the code stream and determining a value of the third syntax element; When the third syntax element indicates that the current sequence allows the use of a multi-transform core group selection technology, the step of determining the transform core group index of the current block is performed; wherein the current sequence includes the current block.

30. The method according to any one of claims 1 to 25, wherein The method further comprises: Decoding the code stream and determining a value of the third syntax element; When the third syntax element indicates that the current sequence allows the use of the multi-transform core group selection mode, decoding the code stream and determining the value of the fourth syntax element; When the fourth syntax element indicates that the current image allows the use of a multi-transform core group selection technology, the step of determining the transform core group index of the current block is performed; wherein the current sequence includes the current image, and the current image includes the current block.

31. The method according to any one of claims 1 to 25, wherein The method further comprises: Decoding the code stream and determining a value of the third syntax element; When the third syntax element indicates that the current sequence allows the use of the multi-transform core group selection mode, decoding the code stream and determining the value of the fifth syntax element; When the fifth syntax element indicates that the current slice allows the use of a multi-transform core group selection technology, the step of determining the transform core group index of the current block is performed; wherein the current sequence includes the current slice, and the current slice includes the current block.

32. The method of claim 4, wherein: The method further comprises: Decode the code stream and determine the minimum sample threshold.

33. The method according to claim 4, wherein The method further comprises: Decoding the code stream and determining a value of the third syntax element; When the third syntax element indicates that the current sequence allows the use of the multi-transform core group selection mode, decoding the code stream and determining the value of the sixth syntax element; The minimum sample threshold is determined according to a value of the sixth syntax element.

34. The method according to claim 5, wherein The method further comprises: The code stream is decoded to determine the minimum size threshold.

35. The method according to claim 5, wherein The method further comprises: Decoding the code stream and determining a value of the third syntax element; When the third syntax element indicates that the current sequence allows the use of the multi-transform core group selection mode, decoding the bitstream and determining the value of the seventh syntax element; The minimum size threshold is determined according to the value of the seventh syntax element.

36. A coding method, applied to an encoder, comprising: Determine the transformation kernel group of the current block; determining a transform kernel of the current block according to the transform kernel group; determining a residual block of the current block, and transforming the residual block of the current block according to the transform kernel to determine a transform coefficient of the current block; The transform coefficients of the current block are coded, and the obtained coded bits are written into a bitstream.

37. The method according to claim 36, wherein The determining of the transformation core group of the current block includes: performing coding cost calculation on the current block according to at least two candidate transform core groups, and determining cost results corresponding to each of the at least two candidate transform core groups; A minimum cost result is determined among the cost results corresponding to the at least two candidate transform core groups, and the candidate transform core group corresponding to the minimum cost result is determined as the transform core group of the current block.

38. The method of claim 37, wherein: The method further comprises: Determining a transform core group index of the current block; wherein the transform core group index is used to indicate the number of the transform core group of the current block in the at least two candidate transform core groups; The transform core group index of the current block is coded, and the obtained coded bits are written into a bitstream.

39. The method according to claim 38, wherein The encoding process is performed on the transform core group index of the current block, and the obtained encoding bits are written into a bitstream, including: Determining a value of a first syntax element according to the transform core group index of the current block; The value of the first syntax element is coded, and the obtained coded bits are written into a bitstream.

40. The method of claim 36, wherein The method further comprises: Determining the number of samples of the current block; When the number of samples of the current block is greater than or equal to the minimum sample threshold, the step of determining the transformation core group of the current block is performed.

41. The method of claim 36, wherein: The method further comprises: Determine a size of the current block, wherein the size of the current block includes a height and a width; When the height and width of the current block are both greater than or equal to the minimum size threshold, the step of determining the transformation core group of the current block is performed.

42. The method of claim 36, wherein: The method further comprises: determining a prediction mode for the current block; When the prediction mode of the current block is one of the first prediction mode set, performing the step of determining the transform core group of the current block; The first prediction mode set includes at least one of the following prediction modes: DC mode, PLANAR mode and other prediction modes other than angular prediction mode.

43. The method according to claim 42, wherein The first prediction mode set includes at least one of the following prediction modes: A mode for combined prediction using at least two intra prediction modes, wherein the intra prediction modes include at least one of the following: a DC mode, a PLANAR mode, and an angular prediction mode; Mode for copying intra blocks for prediction; Mode for prediction using extrapolation filters; Mode for making predictions using matrix operations.

44. The method of claim 42, wherein: The first prediction mode set includes at least one of the following prediction modes: DIMD mode, TIMD mode, SGPM mode, MIP mode, EIP mode, ITMP mode and IBC mode.

45. The method of claim 42, wherein When the prediction mode of the current block is one of the items in the second prediction mode set, determining the transform core group of the current block according to the transform core group index of the current block includes: If the transform core group index is an i-th value, determining a transform core group for the current block based on an i-th intra prediction mode derived from the prediction mode of the current block, where i is a positive integer; The second prediction mode set includes at least one of the following prediction modes: a mode for combined prediction using at least two intra-frame prediction modes, and the intra-frame prediction mode includes at least one of the following: DC mode, PLANAR mode and angular prediction mode.

46. ​​The method of claim 42, wherein When the prediction mode of the current block is one of the items in the third prediction mode set, determining the transform core group of the current block according to the transform core group index of the current block includes: If the transform core group index is a first value, determining a transform core group for the current block based on a first intra prediction mode derived from the prediction mode of the current block; If the transform core group index is the second value, determining the transform core group of the current block based on the PLANAR mode; The third prediction mode set includes at least one of the following prediction modes: a mode using an extrapolation filter for prediction and a mode using Mode for making predictions using matrix operations.

47. The method of claim 42, wherein The determining the transform core group of the current block according to the transform core group index of the current block includes: determining a first candidate list for the current block, the first candidate list indicating at least two candidate transform core groups; A transform core group for the current block is determined according to the first candidate list and the transform core group index.

48. The method of claim 47, wherein Determining a first candidate list for the current block includes: determining one or more intra prediction modes derived based on a prediction mode of the current block; One or more candidate transform core groups are determined according to the one or more intra prediction modes, and the one or more candidate transform core groups are added to the first candidate list.

49. The method according to claim 48, wherein The method further comprises: When the first candidate list is not filled, determining a preset texture feature index of the current block; One or more candidate transform kernel groups are determined according to the preset texture feature index, and the one or more candidate transform kernel groups are added to the first candidate list.

50. The method of claim 47, wherein Determining a first candidate list for the current block includes: When the prediction mode of the current block is one of the second prediction mode set, determining a plurality of intra prediction modes derived based on the prediction mode of the current block; determining a plurality of candidate transform core groups according to the plurality of intra prediction modes, and adding the plurality of candidate transform core groups to the first candidate list; The second prediction mode set includes at least one of the following prediction modes: a mode for combined prediction using at least two intra-frame prediction modes, and the intra-frame prediction mode includes at least one of the following: DC mode, PLANAR mode and angular prediction mode.

51. The method of claim 50, wherein: The method further comprises: A plurality of candidate transform core groups are determined according to the plurality of intra prediction modes and the PLANAR mode, and the plurality of candidate transform core groups are added to the first candidate list.

52. The method of claim 47, wherein: Determining a first candidate list for the current block includes: When the prediction mode of the current block is one of the third prediction mode set, determining an intra prediction mode derived based on the prediction mode of the current block; determining two candidate transform core groups according to the intra prediction mode and the PLANAR mode, and adding the two candidate transform core groups to the first candidate list; The third prediction mode set includes at least one of the following prediction modes: a mode for performing prediction using an extrapolation filter and a mode for performing prediction using a matrix operation.

53. The method of claim 47, wherein: The method further comprises: When the first candidate list is not filled, determining candidate samples for deriving texture feature indexes; Determining one or more candidate texture feature indexes of the current block according to the candidate samples; One or more candidate transform kernel groups are determined according to the one or more candidate texture feature indices, and the one or more candidate transform kernel groups are added to the first candidate list.

54. The method of claim 53, wherein: The determining, based on the candidate samples, one or more candidate texture feature indexes of the current block includes: Determining a horizontal gradient value and a vertical gradient value of the candidate sample; Determining a texture feature index and a gradient intensity value corresponding to the candidate sample according to the horizontal gradient value and the vertical gradient value of the candidate sample; Determine a texture feature statistics table according to the texture feature index and gradient intensity value corresponding to the candidate sample; One or more candidate texture feature indexes of the current block are determined according to the texture feature statistics table.

55. The method of claim 54, wherein The determining of a texture feature statistics table according to the texture feature index and the gradient intensity value corresponding to the candidate sample includes: When the number of the candidate samples is at least one, determining at least one texture feature index and at least one corresponding gradient intensity value; Determining at least one reference texture feature index having mutually different characteristics based on the at least one texture feature index, and accumulating gradient intensity values ​​belonging to the same reference texture feature index based on the at least one gradient intensity value to determine a gradient intensity accumulation value corresponding to the at least one reference texture feature index; The texture feature statistics table is determined according to the at least one reference texture feature index and the gradient intensity accumulation value corresponding to the at least one reference texture feature index.

56. The method of claim 55, wherein: The determining, according to the texture feature statistics table, one or more candidate texture feature indexes of the current block includes: Sorting the texture feature statistics table from high to low according to the gradient intensity accumulation values, and determining the reference texture feature indexes corresponding to the top N gradient intensity accumulation values; wherein N is a positive integer; The N reference texture feature indexes are determined as one or more candidate texture feature indexes of the current block.

57. The method of claim 56, wherein The method further comprises: The N reference texture feature indexes are pruned to determine one or more candidate texture feature indexes for the current block.

58. The method of claim 47, wherein When the first candidate list indicates the transform cores included in the at least two transform core groups, the method further includes: determining at least two candidate transform kernels indicated by the first candidate list; performing encoding cost calculation on the current block according to the at least two candidate transform kernels, and determining cost results corresponding to the at least two candidate transform kernels; A minimum cost result is determined among the cost results corresponding to the at least two candidate transform cores, and the candidate transform core corresponding to the minimum cost result is determined as the transform core of the current block.

59. The method of claim 58, wherein The determining, according to the transformation core group, a transformation core of the current block includes: determining at least two candidate transform kernels included in the transform kernel group; performing encoding cost calculation on the current block according to the at least two candidate transform kernels, and determining cost results corresponding to the at least two candidate transform kernels; A minimum cost result is determined among the cost results corresponding to the at least two candidate transform cores, and the candidate transform core corresponding to the minimum cost result is determined as the transform core of the current block.

60. The method according to claim 58 or 59, wherein The method further comprises: Determining a transform core index of the current block; wherein the transform core index is used to indicate the number of the transform core of the current block in the first candidate list or the transform core group of the current block; The transform core index of the current block is coded, and the obtained coded bits are written into a bitstream.

61. The method according to claim 58 or 59, wherein The method further comprises: Determining a value of a second syntax element; wherein the second syntax element is used to indicate whether the current block uses the first transform mode and a corresponding transform core index used, and the transform core index is used to indicate the number of the transform core of the current block in the first candidate list or the transform core group of the current block; The value of the first syntax element is coded, and the obtained coded bits are written into a bitstream.

62. The method according to any one of claims 36 to 61, wherein The determining of the residual block of the current block includes: Performing intra-frame prediction on the current block to determine a prediction block of the current block; A residual block of the current block is determined according to the initial block of the current block and the prediction block of the current block.

63. The method according to any one of claims 36 to 61, wherein The transforming the residual block of the current block according to the transform kernel to determine the transform coefficient of the current block includes: performing a non-separable basic transform on the residual block of the current block according to the transform kernel to determine a transform coefficient of the current block; or Performing discrete cosine transform on the residual block of the current block to determine a transform block of the current block, and performing low-frequency inseparable transform on the transform block of the current block according to the transform kernel to determine a transform coefficient of the current block.

64. The method according to any one of claims 36 to 61, wherein The encoding process is performed on the transform coefficients of the current block, and the obtained encoding bits are written into a bitstream, including: quantizing the transform coefficients of the current block to determine the quantization coefficients of the current block; The quantized coefficients of the current block are coded, and the obtained coded bits are written into a bitstream.

65. The method according to any one of claims 36 to 61, wherein The method further comprises: Determining a value of a third syntax element; wherein the third syntax element is used to indicate whether a current sequence allows the use of a multi-transform core group selection technology, the current sequence including the current block; Perform encoding processing on the value of the third syntax element, and write the obtained encoding bits into a bitstream.

66. The method of any one of claims 36 to 61, wherein The method further comprises: Determining a value of a third syntax element and a value of a fourth syntax element; wherein the third syntax element is used to indicate whether a current sequence allows the use of a multi-transform kernel group selection technique, and the fourth syntax element is used to indicate whether a current picture allows the use of a multi-transform kernel group selection technique, the current sequence includes the current picture, and the current picture includes the current block; Perform encoding processing on the value of the third syntax element and the value of the fourth syntax element, and write the obtained encoding bits into a bitstream.

67. The method according to any one of claims 36 to 61, wherein The method further comprises: Determine the value of the third syntax element and the value of the fifth syntax element; wherein the third syntax element is used to indicate whether the current sequence The multi-transform kernel group selection technology is allowed to be used, and the fifth syntax element is used to indicate whether the current slice allows the use of the multi-transform kernel group selection technology, the current sequence includes the current slice, and the current slice includes the current block; Perform encoding processing on the value of the third syntax element and the value of the fifth syntax element, and write the obtained encoding bits into a bitstream.

68. The method of claim 40, wherein The method further comprises: The minimum sample threshold is coded, and the obtained coded bits are written into a bitstream.

69. The method of claim 40, wherein The method further comprises: When the current sequence allows the use of the multi-transform kernel group selection technology, determining a value of a sixth syntax element; wherein the sixth syntax element is used to indicate the minimum sample threshold; Perform encoding processing on the value of the sixth syntax element, and write the obtained encoding bits into a bitstream.

70. The method of claim 41, wherein The method further comprises: The minimum size threshold is coded, and the obtained coded bits are written into a bitstream.

71. The method of claim 41, wherein The method further comprises: When the current sequence allows the use of the multi-transform kernel group selection technology, determining a value of a seventh syntax element; wherein the seventh syntax element is used to indicate the minimum size threshold; Perform encoding processing on the value of the seventh syntax element, and write the obtained encoding bits into a bitstream.

72. A code stream, wherein The code stream is generated by bit encoding according to information to be encoded; wherein the information to be encoded includes at least one of the following: a quantization coefficient of a current block, a transform kernel index of the current block, a transform kernel group index of the current block, a minimum sample threshold, a minimum size threshold, a value of a first syntax element, a value of a second syntax element, a value of a third syntax element, a value of a fourth syntax element, a value of a fifth syntax element, a value of a sixth syntax element, and a value of a seventh syntax element; The first syntax element is used to indicate the transform kernel group index of the current block, the second syntax element is used to indicate whether the current block uses the first transform mode and the corresponding transform kernel index, the third syntax element is used to indicate whether the current sequence allows the use of multiple transform kernel group selection technology, the fourth syntax element is used to indicate whether the current image allows the use of multiple transform kernel group selection technology, the fifth syntax element is used to indicate whether the current slice allows the use of multiple transform kernel group selection technology, the sixth syntax element is used to indicate the minimum sample threshold, and the seventh syntax element is used to indicate the minimum size threshold.

73. An encoder, comprising a first determining unit, a first transforming unit, and an encoding unit, wherein: The first determining unit is configured to determine a transform core group of a current block; and further configured to determine a transform core of the current block according to the transform core group; The first transform unit is configured to determine a residual block of the current block, and transform the residual block of the current block according to the transform kernel to determine a transform coefficient of the current block; The encoding unit is configured to perform encoding processing on the transformation coefficients of the current block and write the obtained encoding bits into a bit stream.

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

75. A decoder comprising a second determining unit and a second transforming unit, wherein: The second determining unit is configured to determine a transform core group index of a current block, and determine a transform core group of the current block according to the transform core group index of the current block; and further configured to determine a transform core of the current block according to the transform core group; The second transform unit is configured to determine a transform coefficient of the current block, and transform the transform coefficient of the current block according to the transform kernel to determine a residual block of the current block.

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

77. A computer-readable storage medium having a computer program stored thereon, wherein: When the computer program is executed by a processor, the computer program implements the method according to any one of claims 1 to 35 or the method according to any one of claims 36 to 71.

78. A computer program product comprising a computer program or instructions, wherein: When the computer program or instruction is executed by a processor, the method according to any one of claims 1 to 35 or the method according to any one of claims 36 to 71 is implemented.

Citation Information

Patent Citations

  • Image encoding and decoding method, device and system and storage medium

    CN109922340A

  • Intra sharpening and / or de-ringing filter for video coding based on a bit stream flag

    CN112262579A

  • Secondary transform for inter-intra joint prediction mode

    CN116547966A

  • Adaptive multi-transform set selection

    CN116868567A

  • Non-separable primary transform-based image encoding / decoding method and device, and recording medium for storing bitstream

    WO2023059056A1