Decoding method, encoding method, decoder and encoder

By employing a decoding and encoding method that incorporates geometric division modes and transformation techniques, the compression efficiency of digital video compression standards is improved, addressing the limitations of existing standards in decompression efficiency.

JP2025513052AActive Publication Date: 2025-04-22GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
JP2024560349
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2022-04-12
Publication Date
2025-04-22
Estimated Expiration
2042-04-12

AI Technical Summary

Technical Problem

Existing digital video compression standards struggle to achieve high compression efficiency, particularly in improving decompression efficiency for video blocks.

Method used

The proposed solution involves a decoding method and an encoding method that include performing a first transformation on the first transform coefficient of the current block, making predictions for the current block based on geometric division modes, and obtaining the reconstructed block by combining the predicted block and the residual block.

Benefits of technology

This approach enhances compression efficiency by effectively decoding and encoding video blocks, improving the decompression efficiency through the use of geometric division modes and transformation techniques.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025513052000001_ABST
    Figure 2025513052000001_ABST
Patent Text Reader

Abstract

In an embodiment of the present application, a decoding method, an encoding method, a decoder and an encoder are provided. The decoding method includes: decoding a bitstream to obtain a first transform coefficient of a current block; performing a first transform on the first transform coefficient to obtain a residual block of the current block; performing a first transform on the first transform coefficient to obtain a residual block of the current block; performing a prediction on the current block according to a first prediction mode and a second prediction mode corresponding to a geometric partition mode to obtain a predicted block of the current block; and obtaining a reconstructed block of the current block according to the predicted block of the current block and the residual block of the current block. In the technical solution of the present application, the first transform is performed on the first transform coefficient of the current block, and prediction is performed on the current block according to the first prediction mode and the second prediction mode corresponding to the geometric partition mode, thereby improving the decompression efficiency of the current block.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] TECHNICAL FIELD Embodiments of the present application relate to the technical field of image video coding, and more particularly to a decoding method, an encoding method, a decoder and an encoder. [Background technology]

[0002] Digital video compression technology is a technology that mainly compresses large digital image video data for transmission, storage, etc. With the proliferation of Internet videos and the increasing demand for video clarity, although video decompression technology can be realized with the existing digital video compression standard, a better digital video decompression technology is needed to improve compression efficiency. Summary of the Invention

[0003] SUMMARY OF THE DISCLOSURE The embodiments of the present application provide a decoding method, an encoding method, a decoder and an encoder, thereby improving compression efficiency.

[0004] In a first aspect, the present application provides a decoding method, which includes: decoding a bitstream to obtain a first transform coefficient of a current block, performing a first transform on the first transform coefficient to obtain a residual block of the current block, performing prediction on the current block based on a first prediction mode and a second prediction mode corresponding to a geometric partition mode to obtain a predicted block of the current block, and obtaining a reconstructed block of the current block based on the predicted block of the current block and the residual block of the current block.

[0005] In a second aspect, the present application provides an encoding method, which includes: performing prediction on a current block based on a first prediction mode and a second prediction mode corresponding to a geometric partition mode to obtain a prediction block of the current block, obtaining a residual block of the current block based on the prediction block of the current block, performing a third transform on the residual block of the current block to obtain a third transform coefficient of the current block, and encoding the third transform coefficient.

[0006] In a third aspect, the present application provides a decoding method, which includes: decoding a bitstream to obtain first transform coefficients of a current block, performing a first transform on the first transform coefficients to obtain a residual block of the current block, performing prediction on the current block based on a first intra prediction mode and a second intra prediction mode derived in a prediction mode derivation mode to obtain a predicted block of the current block, and obtaining a reconstructed block of the current block based on the predicted block of the current block and the residual block of the current block.

[0007] In a fourth aspect, the present application provides an encoding method, which includes: performing prediction on a current block based on a first intra prediction mode and a second intra prediction mode derived by a prediction mode derivation mode to obtain a prediction block of the current block, obtaining a residual block of the current block based on the prediction block of the current block, performing a third transform on the residual block of the current block to obtain a third transform coefficient of the current block, and encoding the third transform coefficient.

[0008] In a fifth aspect, the present application provides a decoder, which includes: a decoding unit for decoding a bitstream and obtaining first transform coefficients of a current block, a transform unit for performing a first transform on the first transform coefficients and obtaining a residual block of the current block, a prediction unit for performing prediction on the current block based on a first prediction mode and a second prediction mode corresponding to a geometric partition mode and obtaining a predicted block of the current block, and a reconstruction unit for obtaining a reconstructed block of the current block based on the predicted block of the current block and the residual block of the current block.

[0009] In a sixth aspect, the present application provides an encoder, which includes: a prediction unit for performing prediction on a current block based on a first prediction mode and a second prediction mode corresponding to a geometric partition mode to obtain a prediction block of the current block, a residual unit for obtaining a residual block of the current block based on the prediction block of the current block, a transform unit for performing a third transform on the residual block of the current block to obtain a third transform coefficient of the current block, and an encoding unit for encoding the third transform coefficient.

[0010] In a seventh aspect, the present application provides a decoder, which includes: a decoding unit for decoding a bitstream and obtaining first transform coefficients of a current block, a transform unit for performing a first transform on the first transform coefficients to obtain a residual block of the current block, a prediction unit for performing prediction on the current block based on a first intra prediction mode and a second intra prediction mode derived in a prediction mode derivation mode to obtain a predicted block of the current block, and a reconstruction unit for obtaining a reconstructed block of the current block based on the predicted block of the current block and the residual block of the current block.

[0011] In an eighth aspect, the present application provides an encoder, including: a prediction unit for performing prediction on a current block based on a first intra prediction mode and a second intra prediction mode derived in a prediction mode derivation mode to obtain a prediction block of the current block, a residual unit for obtaining a residual block of the current block based on the prediction block of the current block, a transform unit for performing a third transform on the residual block of the current block to obtain a third transform coefficient of the current block, and an encoding unit for encoding the third transform coefficient.

[0012] The present application provides a decoder in a ninth aspect, the decoder comprising a processor and a computer readable storage medium, the processor configured to execute computer instructions, the computer readable storage medium storing computer instructions which, when read and executed by the processor, realise the decoding method of the first aspect or the third aspect or each embodiment thereof.

[0013] In one embodiment, there are one or more processors and one or more memories.

[0014] In one embodiment, the computer readable storage medium may be integral with the processor or the computer readable storage medium may be separate from the processor.

[0015] In a sixth aspect, the present application provides an encoder, the encoder comprising a processor and a computer readable storage medium, the processor configured to execute computer instructions, the computer readable storage medium storing computer instructions, which, when read and executed by the processor, realise the encoding method of the second or fourth aspect or each embodiment thereof.

[0016] In one embodiment, there are one or more processors and one or more memories.

[0017] In one embodiment, the computer readable storage medium may be integral with the processor or the computer readable storage medium may be separate from the processor.

[0018] In a seventh aspect, the present application provides a computer-readable storage medium having stored thereon computer instructions which, when read and executed by a processor of a computing device, cause the computing device to perform the decoding method according to the first or third aspect or the encoding method according to the second or fourth aspect.

[0019] In an eighth aspect, the present application provides a bitstream, the bitstream being the bitstream according to the first or third aspect or the bitstream according to the second or fourth aspect.

[0020] Based on the above technical proposal, the present application can improve the decompression efficiency of the current block by performing a first transformation on a first transformation coefficient of the current block, and performing prediction on the current block based on a first prediction mode and a second prediction mode corresponding to a geometric partitioning mode. [Brief description of the drawings]

[0021] [Figure 1] FIG. 1 is a block diagram illustrating an encoding framework according to an embodiment of the present application. [Diagram 2] FIG. 2 is a schematic diagram illustrating specific directions of 65 types of angle prediction modes according to an embodiment of the present application. [Diagram 3] 1 is an example of a reference sample of a wide angle prediction mode according to an embodiment of the present application. [Figure 4] FIG. 2 is a schematic diagram of a MIP mode according to an embodiment of the present application; [Diagram 5] FIG. 2 is a schematic diagram illustrating DIMD based prediction mode derivation according to an embodiment of the present application; [Figure 6] FIG. 2 is a schematic diagram illustrating a prediction block derivation based on DIMD according to an embodiment of the present application; [Figure 7] FIG. 2 is a schematic diagram of a template used in a TIMD according to an embodiment of the present application. [Figure 8] 1 is an example of a weight diagram corresponding to 64 weight derivation modes in GPM for a square block according to an embodiment of the present application. [Figure 9] 13 is an example of a division line for a weight derivation mode according to an embodiment of the present application. [Figure 10] 1 is an example of a weight diagram corresponding to 56 types of weight derivation modes in AWP for square blocks according to an embodiment of the present application. [Figure 11] FIG. 1 is a schematic diagram of a GPM or AWP according to an embodiment of the present application. [Figure 12] 1 is an example of a DCT2 type basis image according to an embodiment of the present application. [Figure 13] 1 is an example of an LFNST according to an embodiment of the present application. [Figure 14] 1 is an example of a set of transformation matrices for LFNST according to an embodiment of the present application. [Figure 15] FIG. 1 is a block diagram illustrating a decoding framework according to an embodiment of the present application. [Figure 16] 2 is a flow chart illustrating a decoding method according to an embodiment of the present application; [Figure 17] 2 is a flow chart illustrating an encoding method according to an embodiment of the present application; [Figure 18] 4 is another flow chart illustrating a decoding method according to an embodiment of the present application; [Figure 19] 4 is another flow chart illustrating an encoding method according to an embodiment of the present application; [Figure 20] FIG. 2 is a block diagram illustrating a decoder according to an embodiment of the present application. [Figure 21] FIG. 2 is a block diagram illustrating an encoder according to an embodiment of the present application. [Figure 22] FIG. 2 is another block diagram of a decoder according to an embodiment of the present application; [Diagram 23] FIG. 2 is another block diagram of an encoder according to an embodiment of the present application; [Figure 24] 1 is a block diagram showing an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0022] Hereinafter, technical solutions in the embodiments of the present application will be described with reference to the drawings.

[0023] The solution according to the embodiment of the present application may be applied to the technical field of digital video coding, including, but not limited to, image coding, video coding, hardware video coding, dedicated circuit video coding, and real-time video coding. The solution according to the embodiment of the present application may be combined with an audio video coding standard (AVS), a second generation AVS standard (AVS2), or a third generation AVS standard (AVS3). For example, the solution according to the embodiment of the present application may be combined with, but not limited to, an H.264 / audio video coding (AVC) standard, an H.265 / high efficiency video coding (HEVC) standard, and an H.266 / versatile video coding (VVC) standard. The solution according to the embodiment of the present application may perform lossy compression or lossless compression on an image. The lossless compression may be visually lossless compression or mathematically lossless compression.

[0024] A block-based mixed coding framework is used in video coding standards. Each image (frame) in a video is divided into largest coding units (LCUs) or coding tree units (CTUs) of the same size (e.g., 128×128, 64×64, etc.) and square. Each largest coding unit or coding tree unit can also be divided into rectangular coding units (CUs) based on a rule. The coding units can be further divided into prediction units (PUs), transform units (TUs), etc. The mixed coding framework includes modules such as prediction, transform, quantization, entropy coding, and in loop filter. The prediction module includes intra prediction and inter prediction. The inter prediction includes motion estimation and motion compensation. Since there is a strong correlation between adjacent samples in one image of a video, the video coding technology uses the method of intra prediction to eliminate the spatial redundancy between adjacent samples. Intra prediction only refers to the information of the image of the same one frame to predict the sample information in the current divided block. Since there is a strong similarity between adjacent images in a video, the video coding technology uses the method of inter prediction to eliminate the temporal redundancy between adjacent images, thereby improving the coding efficiency. In inter prediction, by referring to the image information of different frames, the motion estimation can be used to search for the motion vector information that is most matched to the current divided block. Through transformation, the predicted block is transformed into the frequency domain and the energy is redistributed.The combination of transform and quantization can remove information that is difficult for the human eye to perceive, and is used to remove visual redundancy. Entropy coding can remove character redundancy based on the current context model and probability information of the binary bitstream.

[0025] In the process of digital video encoding, an encoder can first read a black-and-white image or a color image from an original video sequence, and then encode the black-and-white image or the color image. Here, the black-and-white image can include samples of a luma component, and the color image can include samples of a chroma component. Optionally, the color image can further include samples of the luma component. The color format of the original video sequence can be a luma-chroma (YCbCr, YUV) format or a red-green-blue (RGB) format, etc. In particular, an encoder reads a black-and-white image or a color image, divides it into blocks, performs intra prediction or inter prediction on a current block to generate a prediction block of the current block, subtracts the prediction block from an original block of the current block to obtain a residual block, transforms and quantizes the residual block to obtain a quantization coefficient matrix, and entropy codes the quantization coefficient matrix to output it to a bitstream. In the process of digital video decoding, a decoding side generates a prediction block of the current block by performing intra prediction or inter prediction on the current block. In addition, the decoding side decodes the bitstream to obtain a quantization coefficient matrix, inverse quantizes and inverse transforms the quantization coefficient matrix to obtain a residual block, and adds the prediction block and the residual block to obtain a reconstructed block. The reconstructed block forms a reconstructed image. The decoding side loop filters the reconstructed image based on the image or block to obtain a decoded image.

[0026] The current block may be a current coding unit (CU) or a current prediction unit (PU), for example.

[0027] In addition, the encoding side also needs to perform a similar process to the decoding side to obtain a decoded image. The decoded image can be a reference image for inter-prediction of a subsequent image. The block partition information, prediction, transform, quantization, entropy coding, loop filtering, and other mode or parameter information determined by the encoding side are output to a bitstream as necessary. The decoding side analyzes and parses existing information to determine the block partition information, prediction, transform, quantization, entropy coding, loop filtering, and other mode or parameter information that is the same as that of the encoding side. This ensures that the decoded image obtained by the encoding side is the same as the decoded image obtained by the decoding side. The decoded image obtained by the encoding side is also usually called a reconstructed image. During prediction, the current block may be divided into prediction units, and during transformation, the current block may be divided into transform units, and the division of the prediction units and transform units may be the same or different. Of course, the above is a basic flow of video coding in a block-based mixed coding framework. As technology develops, some modules in the framework or some steps in the flow may be optimized.This application applies to the basic flow of a video codec in the block-based mixed coding framework.

[0028] For ease of understanding, we first provide a brief overview of the encoding framework of the present application.

[0029] FIG. 1 is a block diagram illustrating an encoding framework 100 according to an embodiment of the present application.

[0030] As shown in Fig. 1, the encoding framework 100 may include an intra prediction unit 180, an inter prediction unit 170, a residual unit 110, a transform and quantization unit 120, an entropy encoding unit 130, an inverse transform and inverse quantization unit 140, and a loop filtering unit 150. Optionally, the encoding framework 100 may further include a decoding image buffer unit 160. The encoding framework 100 is also referred to as a mixed framework encoding mode.

[0031] The intra prediction unit 180 or the inter prediction unit 170 may perform prediction on a block to be coded and output a prediction block. The residual unit 110 may calculate a residual block, i.e., a difference between the prediction block and the block to be coded, based on the prediction block and the block to be coded. The transform and quantization unit 120 is used to perform operations such as transform and quantization on the residual block, thereby removing information that is difficult to detect by the human eye and eliminating visual redundancy. Alternatively, the residual block before being transformed and quantized by the transform and quantization unit 120 may be referred to as a time-domain residual block, and the time-domain residual block after being transformed and quantized by the transform and quantization unit 120 may be referred to as a frequency residual block or a frequency-domain residual block. The entropy encoding unit 130 may receive the transformed and quantized coefficients output by the transform and quantization unit 120 and then output a bitstream based on the transformed and quantized coefficients. For example, the entropy encoding unit 130 can eliminate character redundancy based on a target context model and probability information of a binary bitstream. For example, the entropy encoding unit 130 can be used for context-based adaptive binary arithmetic coding (CABAC). The entropy encoding unit 130 can also be called a header information encoding unit. Optionally, in this application, the block to be coded can also be called an original block or a target block. The prediction block can also be called a predicted image block or an image prediction block, and can also be called a prediction signal or prediction information.The reconstruction block may be called a reconstruction image block or an image reconstruction block, or may be called a reconstruction signal or reconstruction information. Furthermore, on the encoding side, the block to be coded may be called an encoding block or an encoding image block. On the decoding side, the block to be coded may be called a decoding block or a decoding image block. The block to be coded may be a CTU or a CU.

[0032] In the encoding framework 100, a residual block is obtained by calculating a difference between a predicted block and a block to be coded, and the residual block is subjected to processes such as transformation and quantization, and the residual block is transmitted to a decoding side. Accordingly, the decoding side receives and decodes a bitstream, obtains a residual block through steps such as inverse transformation and inverse quantization, and obtains a reconstructed block by adding the residual block to a predicted block obtained by prediction by the decoding side.

[0033] In addition, the inverse transform and inverse quantization unit 140, the loop filtering unit 150, and the decoding image buffer unit 160 in the encoding framework 100 can be used to form a decoder. The intra prediction unit 180 or the inter prediction unit 170 can predict a block to be coded based on an existing reconstructed block, thereby ensuring that the encoding side and the decoding side use a reference frame in the same manner. In other words, the encoder can replicate the processing loop of the decoder, thereby generating the same prediction as the decoding side. Specifically, the quantized transform coefficients are inverse transformed and inverse quantized by the inverse transform and inverse quantization unit 140, and an approximate residual block of the decoding side is replicated. After the prediction block is added to the approximate residual block, the loop filtering unit 150 can smoothly filter out the effects of block-based processing and blocking artifacts caused by quantization. The blocks output from the loop filtering unit 150 may be stored in a decoding image buffer unit 160 for use in predicting subsequent images.

[0034] It should be understood that FIG. 1 is merely an example of the present application and should not be construed as a limitation of the present application.

[0035] For example, the loop filtering unit 150 in the encoding framework 100 may include a deblocking filter (DBF) and a sample adaptive offset (SAO). The role of the DBF is to deblock artifacts, and the role of the SAO is to remove ringing effects. In another embodiment of the present application, a neural-network-based loop filtering algorithm may be used in the encoding framework 100 to improve video compression efficiency. Or, the encoding framework 100 may be a deep learning neural network-based video coding mixed framework. In one embodiment, a convolutional neural network-based model may be used to calculate the result after sample filtering based on the deblocking filter and SAO. The network structure in the luma component of the loop filtering unit 150 and the network structure in the chroma component may be the same or different. Considering that the luma component contains more visual information, the luma component may be used to guide the filtering of the chroma component to improve the reconstruction quality of the chroma component.

[0036] Next, the relationship between intra prediction and inter prediction will be described.

[0037] In inter prediction, inter prediction refers to image information of different frames, and can use motion estimation to search for the most consistent motion vector information for the block to be coded, which is used to remove temporal redundancy. The image used for inter prediction can be a P frame and / or a B frame, where P frame refers to a forward predicted frame and B frame refers to a bidirectional predicted frame.

[0038] In intra prediction, the intra prediction only refers to information of the same image to predict sample information in a block to be coded, which is used to eliminate spatial redundancy. The frame used for intra prediction may be an I frame. For example, according to the coding order from left to right and top to bottom, the block to be coded can be predicted by using the upper left block, the block above, and the block to the left as reference information. The block to be coded is also taken as reference information for the next block. In this way, the entire image can be predicted. If the input digital video has a color format such as YUV4:2:0 format, each of the four pixels of each image frame of the digital video consists of four Y components and two UV components. In the encoding framework, the Y component (i.e., the luma block) and the UV component (i.e., the chroma block) can be encoded respectively. Similarly, the decoding side can decode according to the format.

[0039] In the intra prediction process, the intra prediction performs prediction on a block to be coded using an angular prediction mode and a non-angular prediction mode to obtain a predicted block, and selects an optimal prediction mode for the block to be coded based on rate distortion information calculated from the predicted block and the block to be coded, and transmits the prediction mode to the decoding side through a bitstream. The decoding side analyzes to obtain a prediction mode, predicts to obtain a predicted block of a target decoding block, and overlaps the time domain residual block obtained by transmitting the bitstream to obtain a reconstructed block.

[0040] Through the development of successive digital video coding standards, the non-angular prediction modes have been relatively stable, and include average mode and planar mode. The number of angular prediction modes has increased with the evolution of digital video coding standards. Taking the H series of international digital video coding standards as an example, the H.264 / AVC standard only has eight angular prediction modes and one non-angular prediction mode. H.265 / HEVC has expanded to 33 angular prediction modes and two non-angular prediction modes. In H.266 / VVC, the intra-prediction modes are further expanded to include 67 conventional prediction modes for luminance blocks and a non-conventional prediction mode, i.e., matrix weighted intra-frame prediction (MIP) mode. The 67 conventional prediction modes include planar mode, direct current (DC) mode, and 65 angular prediction modes. The planar mode is usually used to process blocks with gradually changing textures, the DC mode is usually used to process flat areas as the name suggests, and the angular prediction mode is usually used to process blocks with relatively obvious angular textures.

[0041] It should be noted that in this application, the current block used for intra prediction may be a square block or a rectangular block.

[0042] Furthermore, since all intra prediction blocks are square, the probability of using each angle prediction mode is equal. If the length and width of the current block are not equal, for horizontal-class blocks (width is greater than height), the probability of using the upper reference sample is greater than the probability of using the left reference sample, and for vertical-class blocks (height is greater than width), the probability of using the upper reference sample is less than the probability of using the left reference sample. Based on this, the present application introduces a wide angle prediction mode. When predicting a rectangular block, the conventional angle prediction mode is changed to a wide angle prediction mode, and when predicting a rectangular block using the wide angle prediction mode, the prediction angle range of the current block is greater than the prediction angle range when predicting a rectangular block using the conventional angle prediction mode. Optionally, when using the wide angle prediction mode, the signal can still be transmitted using the index of the conventional angle prediction mode, and the decoding side can change the conventional angle prediction mode to the wide angle prediction mode after receiving the signal accordingly, so that the total number of intra prediction modes and the intra mode encoding method do not change, and the intra mode encoding method does not change.

[0043] FIG. 2 is a schematic diagram illustrating specific directions of 65 kinds of angle prediction modes according to an embodiment of the present application.

[0044] As shown in Fig. 2, index 0 indicates planar mode, index 1 indicates DC mode, and indexes -14 to 80 indicate different angle prediction modes. Specifically, indexes 2 to 66 indicate conventional angle prediction modes, and indexes -1 to -14 and indexes 67 to 80 indicate wide angle prediction modes. In other words, the conventional intra prediction modes indicated by indexes 2 to 66 can be used to predict square blocks, and the wide angle prediction modes indicated by indexes -1 to -14 and 67 to 80 can be used to predict rectangular blocks.

[0045] It should be understood that the prediction mode indicated by the index x according to the present application can also be called the prediction mode x. For example, the intra prediction mode indicated by index 2 may also be called the intra prediction mode 2.

[0046] FIG. 3 is an example of a reference sample of the wide-angle prediction mode according to an embodiment of the present application.

[0047] As shown in FIG. 3, in the wide-angle prediction mode, for a CU of size W×H, the number of reference samples above it is 2W + 1, and the number of reference samples on its left side is 2H + 1. Specifically, as shown in FIG. 3(a), when W > H (for example, an 8×4 CU), in the vicinity of intra prediction mode 2 (greater than intra prediction mode 2), there are cases where the lower right corner point of the CU cannot be indexed to the reference sample, and in the vicinity of intra prediction mode 66 (greater than intra prediction mode 66), there are still points that can be indexed to the reference sample. Therefore, some of the quasi-horizontal angle modes in the vicinity of intra prediction mode 2 (greater than intra prediction mode 2) need to be replaced with some of the quasi-vertical angle modes in the vicinity of intra prediction mode 66 (greater than intra prediction mode 66), thereby expanding the prediction angle range. Similarly, as shown in FIG. 3(b), when W < H (for example, a 4×8 CU), in the vicinity of intra prediction mode 66 (less than intra prediction mode 66), some points may not be indexed to the reference sample, and in the vicinity of intra prediction mode 2 (less than intra prediction mode 2), there are still points that can be indexed to the reference sample. Therefore, some of the quasi-vertical angle modes in the vicinity of intra prediction mode 66 (less than intra prediction mode 66) need to be replaced with some of the smaller quasi-horizontal angle modes in the vicinity of intra prediction mode 2 (less than intra prediction mode 2), thereby expanding the prediction angle range.

[0048] In some cases, the intra prediction mode to be performed may be determined or selected based on the size of the current block. For example, a wide angle prediction mode may be determined or selected based on the size of the current block to perform intra prediction on the current block. For example, if the current block is a rectangular block (width and height are different), intra prediction may be performed on the current block using the wide angle prediction mode. The ratio of the width and height of the current block may be used to determine the angle prediction mode to be replaced in the wide angle prediction mode and the replaced angle prediction mode. For example, when predicting the current block, any intra prediction mode with an angle not exceeding the diagonal of the current block (from the lower left corner to the upper right corner of the current block) may be selected as the replaced angle prediction mode.

[0049] Other intra prediction modes according to the present application will be introduced below.

[0050] (1) Matrix-based Intra Prediction (MIP) mode

[0051] The MIP mode is also called a matrix weighted intra prediction mode. The process according to the MIP mode can be divided into three main steps: a downsampling process, a matrix multiplication process, and an upsampling process. Specifically, first, the downsampling process downsamples spatially adjacent reconstructed samples. Then, the obtained downsampled sample sequence is used as the input vector of the matrix multiplication process, i.e., the output vector of the downsampling process is used as the input vector of the matrix multiplication process, the input vector of the matrix multiplication process is multiplied by a preset matrix, and a bias vector is added to the result, and the calculated sample vector is output. Finally, the output vector of the matrix multiplication process is used as the input vector of the upsampling process to obtain the final prediction block by upsampling.

[0052] FIG. 4 is a schematic diagram of a MIP mode according to an embodiment of the present application.

[0053] As shown in FIG. 4, in the MIP mode, in the downsampling process, the upper adjacent reconstructed samples of the current coding unit are averaged to obtain the downsampled upper adjacent reconstructed sample vector bdry top Then, the left-neighboring reconstructed samples of the current coding unit are averaged to obtain the downsampled left-neighboring reconstructed sample vector bdry left Get. top and bdry left After obtaining the vectors, we apply them to the input vector bdry of the matrix multiplication process. red Specifically, bdry red Top row vector bdry top red , bdry left , A k· bdry red +b k A sample vector can be obtained based on kis a preset matrix, and b k is a preset bias vector, and k is the index of the MIP mode. After obtaining the sample vector, the sample vector is upsampled by linear interpolation to obtain a predicted sample block having a sample number that is consistent with the actual sample number of the coding unit.

[0054] In other words, to predict a block with a width of W and a height of H, MIP requires H reconstructed samples in the left column of the current block and W reconstructed samples in the row above the current block as input. MIP generates a predicted block based on three steps: averaging of reference samples, matrix vector multiplication, and interpolation. The core of MIP is matrix vector multiplication, which can be considered as a process of generating a predicted block using input samples (reference samples) in a matrix vector multiplication manner. Various matrices are provided in MIP, and differences in prediction methods can be reflected in differences in matrices, and when the input sample is the same, different results can be obtained by using different matrices. In addition, the process of averaging and interpolating reference samples is designed with a trade-off between performance and complexity. For blocks with a large size, the averaging of reference samples can achieve an effect that is close to downsampling, so that the input can be adapted to a relatively small matrix. The effect of upsampling can be achieved by interpolation. In this way, it is no longer necessary to provide a MIP matrix for each size of block, and instead, only one or several matrices having a specific size need to be provided. As compression performance needs increase and hardware capabilities improve, more complex MIPs are likely to appear in future standards.

[0055] In the MIP mode, the MIP mode can be simplified from a neural network, for example, the matrix used in the MIP mode can be obtained based on training. Therefore, the MIP mode has a relatively strong generalization ability and a prediction effect that cannot be reached by conventional prediction modes. The MIP mode is a model obtained by performing multiple simplifications of hardware and software complexity for intra prediction models based on neural networks. Based on a large number of training samples, multiple prediction modes can represent multiple models and parameters and better cover the texture of natural sequences.

[0056] MIP mode is somewhat similar to Planar mode, but obviously, MIP mode is more complex and flexible than Planar mode.

[0057] It should be noted that for coding units of different block sizes, the number of MIP modes can be different. For example, for a coding unit of 4×4 size, the MIP mode has 16 prediction modes. For a coding unit of 8×8 size, with a width equal to 4 or a height equal to 4, the MIP mode has 8 prediction modes. For coding units of other sizes, the MIP mode has 6 prediction modes. In addition, the MIP mode has a transpose function. For a prediction mode matching the current size, the MIP mode can try a transpose calculation on the encoder side. Therefore, the MIP mode requires a flag indicating whether the MIP mode is used for the current coding unit. Moreover, if the MIP mode is used for the current coding unit, a transpose flag needs to be transmitted to the decoder.

[0058] (2) Decoder side Intra Mode Derivation (DIMD) mode

[0059] The main point of the DIMD mode is to derive the intra-prediction mode at the decoder side using the same method as the encoder, thereby avoiding transmitting the intra-prediction mode index of the current coding unit in the bitstream and achieving the purpose of saving bit overhead.

[0060] The specific process of DIMD mode can be mainly divided into the following two steps:

[0061] Step 1: Derive the prediction mode.

[0062] FIG. 5 is a schematic diagram illustrating prediction mode derivation based on DIMD according to an embodiment of the present application.

[0063] As shown in (a) of FIG. 5, in DIMD, a prediction mode is derived using samples in a template in a reconstruction region (reconstructed samples on the left and top of a current block). For example, the template may include reconstructed samples of three adjacent rows above the current block, reconstructed samples of three adjacent columns to the left, and the corresponding adjacent reconstructed sample on the top left. Based on this, a plurality of gradient values ​​may be determined in the template according to a window (e.g., the window shown in (b) of FIG. 5 or (c) of FIG. 5). Each gradient value is used to obtain one intra prediction mode (ipm) that matches its gradient direction. Based on this, the encoder may determine the prediction mode corresponding to the largest gradient value and the prediction mode corresponding to the second largest gradient value among the plurality of gradient values ​​as the derived prediction modes. For example, as shown in (b) of FIG. 5, for a block of size 4×4, all samples that need to determine gradient values ​​are analyzed to obtain corresponding histograms of gradients. For example, as shown in (c) of FIG. 5, for blocks of other sizes, all samples that need to determine gradient values ​​are analyzed to obtain corresponding histograms of gradients. Finally, the prediction mode corresponding to the largest gradient in the gradient histogram and the prediction mode corresponding to the second largest gradient are determined as the derived prediction modes.

[0064] Of course, the gradient histogram in this application is merely an example for determining the derived prediction mode, and may be implemented in various simple forms when specifically implemented, and this application is not particularly limited thereto. Furthermore, this application is not limited to a method for statistically calculating the gradient histogram, and for example, the gradient histogram may be statistically calculated using a Sobel operator or other methods.

[0065] Step 2: Derive the prediction block.

[0066] FIG. 6 is a schematic diagram illustrating a prediction block derivation based on DIMD according to an embodiment of the present application.

[0067] As shown in Figure 6, the encoder can weight the prediction values ​​corresponding to three intra prediction modes (planar mode and two intra prediction modes derived based on DIMD). The encoder and decoder obtain the prediction block of the current block using the same prediction block derivation method. Assuming that the prediction mode corresponding to the largest gradient value is prediction mode 1 and the prediction mode corresponding to the second largest gradient value is prediction mode 2, the encoder determines the following two conditions: 1. The gradient value of prediction mode 2 is not 0. 2. Neither prediction mode 1 nor prediction mode 2 is a planar or DC prediction mode.

[0068] If the above two conditions are not met at the same time, only prediction mode 1 is used to calculate the predicted sample value of the current block, that is, the normal prediction process is applied to prediction mode 1. Otherwise, that is, if the above two conditions are met at the same time, a weighted average method is used to derive the predicted block of the current block. The specific method is as follows: the planar mode occupies 1 / 3 of the weight, and the remaining 2 / 3 is the weight of the sum of prediction mode 1 and prediction mode 2. For example, the gradient amplitude value of prediction mode 1 is divided by the sum of the gradient amplitude value of prediction mode 1 and the gradient amplitude value of prediction mode 2, and the result is the weight of prediction mode 1, and the gradient amplitude value of prediction mode 2 is divided by the sum of the gradient amplitude value of prediction mode 1 and the gradient amplitude value of prediction mode 2, and the result is the weight of prediction mode 2. Finally, the predicted blocks obtained based on the above three prediction modes, i.e., prediction block 1, prediction block 2, and prediction block 3 obtained based on planar mode, prediction mode 1, and prediction mode 2, respectively, are weighted averaged to obtain the predicted block of the current coding unit. The decoder also obtains the predicted block in the same steps.

[0069] In other words, the specific weights in step 2 above are calculated as follows: Weight(PLANAR) = 1 / 3; Weight(mode1) = 2 / 3 * (amp1 / (amp1+amp2)); Weight(mode2) = 1 - Weight(PLANAR) - Weight(mode1); mode1 and mode2 respectively represent prediction mode 1 and prediction mode 2, and amp1 and amp2 respectively represent the gradient amplitude value of prediction mode 1 and the gradient amplitude value of prediction mode 2. In the DIMD mode, a flag needs to be transmitted to the decoder, which is used to indicate whether the DIMD mode is used for the current coder unit.

[0070] Of course, the above weighted average method is merely an example of the present application and should not be understood as a limitation of the present application.

[0071] In summary, DIMD allows to select an intra prediction mode using gradient analysis of the reconstructed samples and weight the two intra prediction modes and the planar mode according to the analysis results. The advantage of DIMD is that if a DIMD mode is selected for the current block, there is no need to specifically indicate in the bitstream which intra prediction mode is used, but it is derived by the decoder itself through the above process, thus saving some overhead.

[0072] (3) Template based Intra Mode Derivation (TIMD) prediction mode

[0073] The technical principle of the TIMD mode is relatively similar to that of the DIMD mode described above, and in both cases, the codec performs the same operation to derive the prediction mode, thereby saving the overhead of transmitting the mode index. The TIMD mode can be mainly understood in two parts. First, the cost information of each prediction mode is calculated based on the template, and the prediction mode corresponding to the smallest cost and the prediction mode corresponding to the second smallest cost are selected. The prediction mode corresponding to the smallest cost is marked as prediction mode 1, and the prediction mode corresponding to the second smallest cost is marked as prediction mode 2. If the ratio between the second smallest cost (costMode2) and the smallest cost (costMode1) meets a preset condition such as costMode2<2*costMode1, the prediction block corresponding to prediction mode 1 and the prediction block corresponding to prediction mode 2 are weighted and fused according to the weight corresponding to prediction mode 1 and the weight corresponding to prediction mode 2 to obtain the final prediction block.

[0074] Exemplarily, the weight corresponding to prediction mode 1 and the weight corresponding to prediction mode 2 are determined according to the following manner. weight1 = costMode2 / (costMode1+ costMode2); weight2 = 1 - weight1; weight1 is the weight of the prediction block corresponding to prediction mode 1, and weight2 is the weight of the prediction block corresponding to prediction mode 2. If the ratio between the second smallest cost costMode2 and the smallest cost costMode1 does not satisfy a preset condition, weighted fusion between prediction blocks is not performed, and the prediction block corresponding to prediction mode 1 becomes the prediction block of TIMD.

[0075] In addition, when performing intra prediction on a current block using TIMD mode, if the reconstructed sample template of the current block does not include available neighboring reconstructed samples, the TIMD mode selects the planar mode to perform intra prediction on the current block, i.e., does not perform weighted fusion. Similar to the DIMD mode, the TIMD mode requires a flag to be transmitted to the decoder, which is used to indicate whether the TIMD mode is used for the current coder unit.

[0076] FIG. 7 is a schematic diagram of a template used in a TIMD according to an embodiment of the present application.

[0077] As shown in FIG. 7, if the current block is a coding unit with a width equal to M and a height equal to N, the codec may select a reference template for the current block from a coding unit with a width equal to 2(M+L1)+1 and a height equal to 2(N+L2)+1 to calculate a template for the current block. In this case, if the template for the current block does not include available neighboring reconstructed samples, the TIMD mode selects a planar mode to perform intra prediction for the current block. For example, the available neighboring reconstructed samples may be samples adjacent to the left side and the upper side of the current CU in FIG. 7, i.e., there are no available reconstructed samples in the shaded area. In other words, if there are no available reconstructed samples in the shaded area, the TIMD mode selects a planar mode to perform intra prediction for the current block.

[0078] Except for the boundary case, when coding the current block, theoretically the left and top sides of the current block can obtain reconstructed values, i.e. the template of the current block includes the available neighboring reconstructed samples. In a specific embodiment, the decoder predicts the template using a certain intra prediction mode, and compares the predicted value with the reconstructed value to obtain the cost of the intra prediction mode on the template. For example, Sum of Absolute Differences (SAD), Sum of Absolute Transformed Difference (SATD), Sum of Squared Error (SSE), etc. The template and the current block are adjacent to each other, so the reconstructed samples in the template and the samples in the current block are correlated. Therefore, the behavior of the prediction mode on the template can be used to estimate the behavior of this prediction mode on the current block. In TIMD, several candidate intra prediction modes are used to predict the template to obtain the costs of the candidate intra prediction modes on the template, and the predicted values ​​of one or two intra prediction modes with the lowest cost are taken as the intra prediction values ​​of the current block. If the difference between the two costs corresponding to the two intra prediction modes on the template is not large, the predicted values ​​of the two intra prediction modes can be weighted averaged to improve compression performance. Optionally, the weights of the predicted values ​​of the two prediction modes are related to the costs, for example, the weights are inversely proportional to the costs.

[0079] In summary, in TIMD, it is possible to use the prediction effect of the intra prediction mode on the template to select the intra prediction mode, and weight the two intra prediction modes according to the cost on the template. The advantage of TIMD is that when a TIMD mode is selected for the current block, there is no need to specifically indicate which intra prediction mode is used in the bitstream, but it is derived by the decoder itself through the above process, which can save some overhead.

[0080] Through the brief introduction of the above several intra prediction modes, it can be seen that the technical principles of the DIMD mode and the TIMD mode are similar. Both of them utilize the decoder performing the same operation as the encoder to estimate the prediction mode of the current coding unit. In such prediction modes, if the complexity is acceptable, the transmission of the prediction mode index can be omitted, saving overhead and improving compression efficiency. However, due to the limited information that can be referenced and the fact that it does not do much to improve the prediction quality by itself, the DIMD and TIMD modes are more effective in large areas with consistent texture characteristics. When the texture changes slightly or the template area cannot be covered, the prediction effect of such prediction modes is poor.

[0081] In addition, in both DIMD and TIMD modes, prediction blocks obtained based on multiple conventional prediction modes are fused or weighted. The fusion of prediction blocks can produce effects that cannot be achieved by a single prediction mode. In DIMD mode, planar mode can be introduced as an additional weighted prediction mode to enhance the spatial correlation between adjacent reconstructed samples and predicted samples, and improve the prediction effect of intra prediction. However, since the prediction principle of planar mode is relatively simple, for a prediction block with obvious difference between the upper right corner and the lower left corner, using planar mode as an additional weighted prediction mode may have an adverse effect.

[0082] (4) Geometric partitioning mode (GPM) and angular weighted prediction (AWP).

[0083] In video coding standards, in traditional unidirectional prediction, only one reference block with the same size as the current block is found, and in traditional bidirectional prediction, two reference blocks with the same size as the current block are used, and the sample value of each sample in the prediction block is the average value of the samples at the corresponding positions of the two reference blocks, that is, all samples in each reference block account for 50%. Furthermore, with bidirectional weighted prediction, the proportions of the two reference blocks can be different, for example, all samples in the first reference block account for 75%, all samples in the second reference block account for 25%, but all samples in the same reference block have the same proportion. In addition, some optimization methods, such as decoder side motion vector refinement (DMVR) and bidirectional optical flow (BIO or BDOF), etc., can cause some changes in the reference samples or prediction samples.

[0084] In the case of GPM or AWP, two reference blocks of the same size as the current block are also used, but at some sample positions, the sample values ​​of the corresponding positions in the first reference block are used 100%, at some sample positions, the sample values ​​of the corresponding positions in the second reference block are used 100%, and in the boundary region (or the region called the transition region), the sample values ​​of the corresponding positions in the two reference blocks are used at a certain rate. The weights of the boundary region also change gradually. The specific method of assigning these weights is determined by the weight derivation mode of GPM or AWP. The weight of each sample position is determined based on the weight derivation mode of GPM or AWP.

[0085] Of course, in some cases, such as when the block size is very small, some GPM or AWP modes may not be able to guarantee that some sample positions use 100% of the sample values ​​of the corresponding positions in the first reference block, and some sample pixel positions use 100% of the sample values ​​of the corresponding positions in the second reference block. In this case, it can be understood that GPM or AWP uses two reference blocks with different sizes from the current block, that is, uses a part that it requires as a reference block, in other words, uses the part with a weight that is not 0 as the reference block, and removes the part with a weight that is 0, and the specific implementation is not limited in this application.

[0086] FIG. 8 is an example of a weight diagram corresponding to 64 weight derivation modes in GPM for square blocks according to an embodiment of the present application.

[0087] As shown in Figure 8, in GPM, there are weight diagrams corresponding to 64 types of weight derivation modes for square blocks. Here, for the weight diagrams corresponding to each weight derivation mode, a black area indicates that the weight value of the corresponding position in the first reference block is 0%, a white area indicates that the weight value of the corresponding position in the first reference block is 100%, and a gray area indicates that the weight value of the corresponding position in the first reference block is a weight value greater than 0% and less than 100% depending on the shade of color. The weight value of the corresponding position in the second reference block is the value obtained by subtracting the weight value of the corresponding position in the first reference block from 100%.

[0088] FIG. 9 is an example of a division line in a weight derivation mode according to an embodiment of the present application.

[0089] As shown in FIG. 9, the division line of the weight derivation mode may be a line consisting of points where the weights of the two prediction modes corresponding to the GPM are the same. In other words, in the weight matrix of the GPM, the division line is a line consisting of points where the weights of the two prediction modes corresponding to the GPM are the same. In other words, the division line may be a line consisting of points where the weights of the two prediction modes corresponding to the GPM are the same in the area where the weight changes in the weight matrix of the GPM. In other words, the division line is a line consisting of points where the weight is an intermediate value, or the division line is a line consisting of points corresponding to an intermediate value weight, and the points having an intermediate value weight may be in the middle position of the entire sample, or may not be in the middle position of the entire sample. For example, when the weight is 0 to 8, the intermediate value weight may be 4.

[0090] FIG. 10 is an example of a weight diagram corresponding to 56 types of weight derivation modes in AWP for square blocks according to an embodiment of the present application.

[0091] As shown in Fig. 10, weight diagrams corresponding to 56 kinds of weight derivation modes in AWP for square blocks are shown. Here, for the weight diagrams corresponding to each weight derivation mode, the black area indicates that the weight value of the corresponding position in the first reference block is 0%, the white area indicates that the weight value of the corresponding position in the first reference block is 100%, and the gray area indicates that the weight value of the corresponding position in the first reference block is a weight value that is more than 0% and less than 100% depending on the color shade. The weight value of the corresponding position in the second reference block is a value obtained by subtracting the weight value of the corresponding position in the first reference block from 100%.

[0092] It should be noted that the weight derivation methods of GPM and AWP can be different. For example, in GPM, the angle and offset amount are determined for each weight derivation mode, and then the corresponding weight diagram for each weight derivation mode is calculated. In AWP, a one-dimensional weight line is first determined based on each weight derivation mode, and then the one-dimensional weight line is spread over the entire image using a method similar to intra-angle prediction to obtain a weight diagram corresponding to each weight derivation mode. Of course, in other alternative embodiments, the weight diagram corresponding to each weight derivation mode can also be called a weight matrix.

[0093] Next, we explain the weight derivation method using GPM as an example.

[0094] The encoder can determine a corresponding partition line based on each weight derivation mode, and then determine a corresponding weight matrix based on the partition line. For example, the encoder can use Table 1 to determine an angle index variable angleIdx and a distance index variable distanceIdx corresponding to a weight derivation mode, and determine a weight derivation mode merge_gpm_partition_idx, where the angle index variable angleIdx and the distance index variable distanceIdx are variables for determining a partition line, that is, variables for determining the angle and offset amount of the partition line, respectively. After determining a partition line corresponding to each weight derivation mode, the encoder can determine a weight matrix corresponding to each weight derivation mode based on the partition line corresponding to each weight derivation mode.

[0095] [Table 1]

[0096] As shown in Table 1, the weight derivation mode includes 64 types (for example, the 64 types of modes shown in FIG. 8), and the index (merge_gpm_partition_idx) of these modes ranges from 0 to 63. Each of the 64 types of weight derivation modes can correspond to one angle index variable angleIdx and one distance index variable distanceIdx. That is, each weight derivation mode can correspond to one partition line. Of course, one angle index variable angleIdx or one distance index variable distanceIdx can correspond to one or more weight derivation mode indexes, and Table 1 is merely an example of the present application and should not be understood as a limitation on the present application.

[0097] Since GPM can be used for three components (e.g., Y, Cb, Cr), the process of generating a predicted sample matrix of GPM for one component can be a sub-process, i.e., weighted sample prediction process for GPM. This process can be invoked for three components, only the parameters of the invocation are different, and this application takes the luma component as an example to describe. Exemplarily, the weighted prediction process for GPM can derive a predicted matrix predSamplesL[xL][yL] of the current luma block, where xL=0..cbWidth-1, yL=0..cbHeight-1. Here, nCbW is cbWidth and nCbH is cbHeight.

[0098] The inputs of the weighted prediction process for GPM include the width of the current block, nCbW, the height of the current block, nCbH, two (nCbW) x (nCbH) predicted sample matrices predSamplesLA and predSamplesLB, a GPM "split" angle index variable angleIdx, a GPM distance index variable distanceIdx, and a component index variable cIdx, where e.g., if cIdx is 0, the component index variable represents the luminance component. The output of the weighted prediction process for GPM is the (nCbW) x (nCbH) GPM predicted sample matrix pbSamples[x][y], where x = 0..nCbW-1, y = 0..nCbH-1.

[0099] The predicted sample matrix pbSamples[x][y] can be derived in the following way: Illustratively, we can first derive the variables nW, nH, shift1, offset1, displacementX, displacementY, partFlip, and shiftHor in the following manner: nW = ( cIdx = = 0 ) ? nCbW : nCbW * SubWidthC. nH = ( cIdx = = 0 ) ? nCbH : nCbH * SubHeightC. shift1 = Max( 5, 17 - BitDepth ), where BitDepth is the bit depth of the coding. offset1 = 1 << ( shift1 - 1 ). displacementX = angleIdx. displacementY = (angleIdx + 8) % 32. partFlip = ( angleIdx >= 13 && angleIdx <= 27 ) ? 0 : 1. shiftHor = ( angleIdx % 16 = = 8 | | ( angleIdx % 16 != 0 && nH >= nW ) ) ? 0 : 1. Then we can derive the variables offsetX and offsetY in the following way: If the value of shiftHor is 0, offsetX = ( -nW ) >> 1; offsetY = ( ( -nH ) >> 1 ) + ( angleIdx < 16 ? ( distanceIdx * nH ) >> 3 : -( ( distanceIdx * nH ) >> 3 ) ); If not (i.e., the value of shiftHor is 1), offsetX = ( ( -nW ) >> 1 ) + ( angleIdx < 16 ? ( distanceIdx * nW ) >> 3 : -( ( distanceIdx * nW ) >> 3 ); offsetY = ( -nH ) >> 1. Then, we can derive the prediction sample matrix pbSamples[ x ][ y ] in the following way, where x = 0..nCbW - 1, y = 0..nCbH - 1), The variables xL and yL are derived in the following way: xL = ( cIdx = = 0 ) ? x : x * SubWidthC; yL = ( cIdx = = 0 ) ? y : y * SubHeightC; weightIdx = ( ( ( xL + offsetX ) << 1 ) + 1 ) * disLut[ displacementX ] + ( ( ( yL + offsetY ) << 1 ) + 1 ) * disLut[ displacementY ]; We can determine disLut[ displacementX ] through Table 2: [Table 2] weightIdxL = partFlip ? 32 + weightIdx : 32 - weightIdx; wValue = Clip3( 0, 8, ( weightIdxL + 4 ) >> 3 ); pbSamples[ x ][ y ] = Clip3( 0, ( 1 << BitDepth ) - 1, ( predSamplesLA[ x ][ y ] * wValue + predSamplesLB[ x ][ y ] * ( 8 - wValue ) + offset1 ) >> shift1 ).

[0100] Here, pbSamples[x][y] represents the predicted sample at (x,y), wValue represents the weight of the predicted value predSamplesLA[x][y] of the prediction matrix of one prediction mode at (x,y), and (8-wValue) represents the weight of the predicted value predSamplesLB[x][y] of the prediction matrix of another prediction mode at (x,y).

[0101] In addition, for one weight derivation mode, one weight value wValue can be derived for each point using it, and then one predicted value pbSamples[x][y] of GPM can be calculated. In this method, the weight wValue does not need to be in the form of a matrix, but it can be understood that if the wValue of each position is stored in a matrix, it becomes a weight matrix. The principle of calculating and weighting each weight for each point to obtain a predicted value of GPM is the same as the principle of calculating all weights and weighting them uniformly to obtain a predicted sample matrix of GPM. The reason why "weight matrix" is used in many descriptions in this specification is that the description is easier to understand and a more intuitive drawing can be obtained using a weight matrix, and in fact it can be described with weights for each position. For example, the weight matrix derivation mode can also be called a weight derivation mode, but this application does not specifically limit it.

[0102] In addition, the division of CU, PU, ​​and TU all belongs to the division method based on rectangle. However, GPM and AWP realize the effect of non-rectangular division of prediction without division. In GPM and AWP, a mask of the weights of two reference blocks, that is, the above-mentioned weight diagram or weight matrix, is used. This mask determines the weights of the two reference blocks when generating a prediction block, or it can be easily understood that a part of the position of the prediction block is obtained based on the first reference block and another part is obtained based on the second reference block, and the transition area is obtained by weighting the corresponding positions of the two reference blocks, thereby making the transition smoother. In GPM and AWP, since the current block is not divided into two CUs or PUs, the current block is also treated as a whole in the transformation, quantization, inverse transformation, inverse quantization, etc. of the residual after prediction.

[0103] In addition, in GPM, two inter prediction blocks can be combined using a weight matrix. In the present application, this is extended to combining two arbitrary prediction blocks. For example, two inter prediction blocks, or two intra prediction blocks, or one inter prediction block and one intra prediction block can be combined. Furthermore, in screen content coding, a prediction block of an intra block copy (IBC) mode or a prediction block of a palette mode can be used as one or two of the prediction blocks. For convenience of explanation, in the present application, intra mode, inter mode, IBC mode, and palette mode are collectively referred to as prediction modes. It can be understood that the prediction mode can be used to generate information of one prediction block of a current block based on the prediction mode. Exemplarily, in intra prediction, the prediction mode may be an intra prediction mode such as a DC mode, a planar mode, or various types of intra angle prediction modes. Of course, some or some auxiliary information, such as an optimization method of an intra reference sample, an optimization method (e.g., filtering) after generating a rudimentary prediction block, etc., can be superimposed. Exemplarily, in inter prediction, the prediction mode may be a merge mode, a merge with motion vector difference (MMVD) mode, or an advanced motion vector prediction mode (AMVP). Exemplarily, the prediction mode may be unidirectional prediction, bidirectional prediction, or multi-hypothesis prediction. Furthermore, if unidirectional prediction is used in the inter prediction mode and one piece of motion information can be determined, a prediction block can be determined based on the motion information. If bidirectional prediction is used in the inter prediction mode and two pieces of motion information can be determined, a prediction block can be determined based on the motion information.

[0104] FIG. 11 is a schematic diagram of a GPM or AWP according to an embodiment of the present application.

[0105] As shown in Figure 11, the information that needs to be determined in the GPM can be expressed as one weight derivation mode and two prediction modes. The weight derivation mode is used to determine a weight matrix or weight, and determines one prediction block or prediction value by each of the two prediction modes. The weight derivation mode is also called a partition mode or a weight matrix derivation mode. The two prediction modes may be the same or different prediction modes, including but not limited to intra prediction mode, inter prediction mode, IBC mode, and palette mode.

[0106] The following describes the content of the transform of the residual block.

[0107] When encoding, a prediction is first performed on the current block, and the prediction can use spatial or temporal correlation to obtain an image that is the same or similar to the current block. For one block, the predicted block and the current block may be exactly the same, but it is difficult to guarantee that all blocks in a video will be like this. In particular, in natural videos or videos captured by a camera, the texture of the image is complex, there are factors such as the presence of noise in the image, and so the predicted block and the current block are usually similar but different. In addition, there are irregular movements in the video, twist deformation, occlusion, brightness changes, and so on, so it is difficult to predict the current block perfectly. Therefore, in a hybrid coding framework, a predicted image is subtracted from the original image of the current block to obtain a residual image, or in other words, a predicted block is subtracted from the current block to obtain a residual block. Since the residual block is usually much simpler than the original image, the compression efficiency can be greatly improved through prediction. Instead of directly encoding the residual block, a transform is usually performed first. The transform is to convert the residual image from the spatial domain to the frequency domain and remove the correlation of the residual image. After the residual image is transformed into the frequency domain, the energy is often concentrated in the low frequency region, so the non-zero coefficients after the transformation are often concentrated in the upper left corner. Quantization is then used to further compress it. Also, a larger quantization step size can be used in the high frequency region because the human eye is less sensitive to high frequencies.

[0108] Image transformation technology is to transform an original image so that the original image can be represented by an orthogonal function or an orthogonal matrix, and this transformation is two-dimensional linear reversible. In general, the original image is called a spatial domain image, the transformed image is called a transform domain image (also called a frequency domain image), and the transform domain image can be inversely transformed into a spatial domain image. After undergoing image transformation, on the one hand, it can more effectively reflect the characteristics of the image itself, and on the other hand, it can concentrate energy on a small amount of data, which is more favorable for image storage, transmission and processing.

[0109] In the field of image video coding, an encoder can transform a residual block after obtaining the residual block. The transform method includes, but is not limited to, a discrete cosine transform (DCT) and a discrete sine transform (DST). Since the DCT has a strong energy concentration characteristic, after the original image undergoes the DCT transform, non-zero coefficients exist only in some areas (for example, the upper left corner area). Of course, in video coding, an image is divided into blocks and processed, so the transform is also performed based on the blocks. The DCT that can be used in video coding includes, but is not limited to, DCT2 and DCT8 types, and the DST that can be used in video coding includes, but is not limited to, DST7 type. Here, the DCT2 type is a transform that is often used in video compression standards, and the DCT8 type and the DST7 type can be used in VVC. It should be noted that although the transform is very useful for normal video compression, it is not necessary to transform all blocks, and in some cases, a better compression effect can be obtained by not transforming rather than transforming, so the encoder can select whether to use the transform for the current block.

[0110] When an encoder transforms a current block in a current image, it can transform a residual block of the current block using basis functions or basis images. A basis image is an image representation form of a basis function.

[0111] FIG. 12 is an example of a DCT2 type basis image according to an embodiment of the present application.

[0112] As shown in Fig. 12, the DCT2 type basis image may be a basis image consisting of 8x8 small blocks based on basis functions, and each small block consists of 8x8 elements (sub-blocks). In a specific embodiment, a basis image consisting of 8x8 small blocks can be used to transform a block of 8x8 size, and an 8x8 transformation coefficient matrix is ​​obtained.

[0113] As described above, in VVC, besides the base transform of the residual block can be performed using DCT2, the base transform of the residual block can be performed using DCT8 and DST7, that is, the multiple transform selection (MTS) technique in VVC can be used. The transform type corresponding to the basis function used in the base transform is also called the transform kernel type used in the base transform. When performing the base transform, the encoder can improve the compression performance by selecting the optimal transform kernel type based on different residual distribution characteristics. The base transform is also called the core transform. In MTS, the transform kernel type can be selected through several syntax elements. Below, the MTS for selecting the transform kernel type through the syntax elements is shown in conjunction with Table 3.

[0114] [Table 3]

[0115] As shown in Table 3, if the value of MTS_CU_flag is 0, the transformation kernel types of the horizontal and vertical basic transformations all use DCT2. If the value of MTS_CU_flag is 1, and the value of MTS_Hor_flag is 0 and the value of MTS_Ver_flag is 0, the transformation kernel type of the horizontal direction is DST7, and the transformation kernel type of the vertical direction is DST7.

[0116] The VVC standard also allows the syntax of MTS to be rewritten, or in other words simplified, so that VVC also allows the transformation kernel type of a basic transformation to be determined using one syntax element mts_idx.

[0117] [Table 4]

[0118] As shown in Table 4, trTypeHor indicates the transformation kernel type of the horizontal transform, trTypeVer indicates the transformation kernel type of the vertical transform, and trTypeHor and trTypeVer of 0 indicate DCT2 type transformation, 1 indicates DST7 type transformation, and 2 indicates DCT8 type transformation.

[0119] Since there is a certain correlation between the distribution of residuals and intra-prediction modes, this correlation can also be utilized in the base transform. One method is to classify the transform kernel types of MTS based on the intra-prediction modes. An example of the classification is shown in the table below.

[0120] [Table 5]

[0121] As shown in Table 5, if the intra prediction mode index is 0 or 1, a transform kernel type set with an MTS index of 0 is selected, the mode with an index of 0 in VVC is Planar, and the mode with an index of 1 in VVC is DC, and both DC and Planar generate flat predicted values. If the intra prediction mode index is 2 to 12, a transform kernel type set with an MTS index of 1 is selected. According to the diagram of intra prediction modes, the angles of 2 to 12 are all oriented in the lower left direction.

[0122] In addition, each transform kernel type set may have one transform kernel type selection for horizontal transform and vertical transform, and may have multiple transform kernel type selections for horizontal transform and vertical transform, that is, a transform kernel type set may be further subdivided after being selected based on the intra-prediction mode, and the transform kernel type may be further selected based on, for example, flags or block size information, which will not be described here. The main point is that the basic transform may select a transform kernel type set based on the intra-prediction mode. In such a method of selecting a transform kernel type set for the basic transform based on the intra-prediction mode, it may be possible to obtain a more detailed grouping of basic transforms in the future, and the present application does not specifically limit this.

[0123] In addition, in the present application, the transformation kernel type related to the main transformation is also referred to as a term having a similar or identical meaning, such as a transformation matrix, a transformation type, or a transformation kernel, and the transformation kernel type set related to the main transformation is also referred to as a term having a similar or identical meaning, such as a transformation matrix set, a transformation type set, or a transformation kernel set, and the present application does not specifically limit this. That is, the selection of the transformation kernel type or transformation kernel type set related to the present application is also referred to as the selection of the transformation matrix or transformation matrix set, the selection of the transformation type or transformation type set, or the selection of the transformation kernel or transformation kernel set. The transformation kernel type or transformation type may include DCT2, DCT8, DST7, etc., and may also include DCT5, DST4, DST1, or Identity Transform (IDTR), etc.

[0124] Also, for blocks of different sizes, transform kernel types of corresponding sizes can be used, which are not described in this application.

[0125] It should be noted that all images are two-dimensional, and the computational complexity and memory overhead required for direct two-dimensional transformation cannot be undertaken by hardware conditions, so the above-mentioned DCT2, DCT8, and DST7 transformations are all divided into horizontal and vertical one-dimensional transformations, that is, performed in two steps. For example, the horizontal transformation is performed first and then the vertical transformation, or the vertical transformation is performed first and then the horizontal transformation. The above transformation methods are relatively effective for horizontal and vertical textures, but are relatively less effective for diagonal textures. Since horizontal and vertical textures are the most common, the above transformation methods are very useful for improving compression efficiency. However, with the development of technology, processing only the residuals of horizontal and vertical textures can no longer meet the needs of compression efficiency.

[0126] Based on this, the present application introduces the concept of secondary transform, ie, the encoder can perform a secondary transform based on the primary transform, thereby improving the compression efficiency.

[0127] Exemplarily, the primary transform can be used to process horizontal and vertical textures, also called base transform, including but not limited to the above-mentioned DCT2, DCT8, and DST7 type transforms. The secondary transform is used to process diagonal textures. The secondary transform can include but not limited to the low frequency non-separable transform (LFNST). At the encoding end, the secondary transform is performed after the primary transform and before quantization. At the decoding end, the secondary transform is performed after inverse quantization and before the inverse primary transform.

[0128] FIG. 13 is an example of an LFNST according to an embodiment of the present application.

[0129] As shown in FIG. 13, on the encoding side, LFNST performs a secondary transform on the low-frequency coefficients in the upper left corner after the base transform. The primary transform removes correlation from the image, concentrating the energy in the upper left corner. Then, the secondary transform removes correlation again from the low-frequency coefficients after the primary transform. On the encoding side, when 16 coefficients are input to a 4×4 LFNST, 8 coefficients are output; when 64 coefficients are input to an 8×8 LFNST, 16 coefficients are output; on the decoding side, when 8 coefficients are input to a 4×4 inverse LFNST, 16 coefficients are output; when 16 coefficients are input to an 8×8 inverse LFNST, 64 coefficients are output.

[0130] When the encoder performs a secondary transform on the current block in the current image, it may transform the residual block of the current block using a transformation matrix in the selected transformation matrix set. For example, the secondary transform is an LFNST, and the transformation matrix may indicate a matrix for transforming a certain diagonal texture, and the transformation matrix set may include matrices for transforming several similar diagonal textures.

[0131] FIG. 14 is an example of a set of transformation matrices for LFNST according to an embodiment of the present application.

[0132] As shown in (a) to (d) of Fig. 14, LFNST can have four sets of transformation matrices, and transformation matrices in the same set have similar diagonal textures. For example, the transformation matrix set shown in (a) of Fig. 14 can be a transformation matrix set with index 0, the transformation matrix set shown in (b) of Fig. 14 can be a transformation matrix set with index 1, the transformation matrix set shown in (c) of Fig. 14 can be a transformation matrix set with index 2, and the transformation matrix set shown in (d) of Fig. 14 can be a transformation matrix set with index 3.

[0133] As can be understood, in this application, a transformation matrix related to a secondary transformation is also referred to as a term having a similar or identical meaning, such as a transformation kernel, a transformation kernel type, or a basis function, and a transformation matrix set related to a secondary transformation is also referred to as a term having a similar or identical meaning, such as a transformation kernel set, a transformation kernel type set, or a basis function set, and is not particularly limited in this application. That is, the selection of a transformation matrix or a transformation matrix set in this application is also referred to as the selection of a transformation kernel type or a transformation kernel type set, the selection of a transformation type or a transformation type set, or the selection of a transformation kernel or a transformation kernel set.

[0134] Below we describe a correlation scheme for applying LFNST to intra-encoded blocks.

[0135] In intra prediction, a prediction is made for a current block using reconstructed samples around the current block as a reference. Currently, since video is generally encoded from left to right and top to bottom, the reference samples available for the current block are usually on the left and top. In angular prediction, the reference samples are arranged in the current block according to a predetermined angle to be used as a predicted value, which means that the predicted block has a clear directional texture, and the residual after the current block undergoes angular prediction shows statistically clear angular characteristics. Therefore, the transformation matrix selected for LFNST can be associated with the intra prediction mode, i.e., after the intra prediction mode is determined, LFNST can use a set of transformation matrices whose texture direction matches the angular characteristics of the intra prediction mode.

[0136] For illustrative purposes, assume that there are a total of four sets of transform matrices for LFNST, with two transform matrices per set. Table 6 shows the correspondence between intra prediction modes and transform matrix sets.

[0137] [Table 6]

[0138] As shown in Table 6, intra prediction modes 0-81 can be associated with four sets of transform matrix indices.

[0139] It should be noted that the cross-component prediction modes used for chroma intra prediction are 81 to 83, but these modes are not available for luma intra prediction. By performing a transposition on the transformation matrices of LFNST, more angles can be processed with one transformation matrix set. For example, both intra prediction modes 13 to 23 and intra prediction modes 45 to 55 correspond to transformation matrix set 2, but intra prediction modes 13 to 23 are obviously closer to horizontal modes, and intra prediction modes 45 to 55 are obviously closer to vertical modes, and they need to be adapted by transposition after the transformation corresponding to intra prediction modes 45 to 55 or after the inverse transformation.

[0140] In a specific embodiment, since there are a total of four sets of transform matrices for LFNST, the encoding side can determine which set of transform matrices to use in LFNST based on the intra prediction mode used for the current block, and further determine the transform matrix to be used among the determined set of transform matrices. In other words, by utilizing the correlation between the intra prediction mode and the transform matrix set of LFNST, the transmission in the bitstream of selecting the transform matrix for LFNST can be reduced. Whether to use LFNST for the current block, and if LFNST is used, whether to use the first transform matrix or the second transform matrix of the transform matrix set can be determined according to the bitstream and several conditions.

[0141] Of course, considering that there are 67 types of normal intra prediction modes and LFNST has only four sets of transformation matrices, multiple near angle prediction modes can only correspond to one set of LFNST transformation matrices. This is the result of considering the trade-off between performance and complexity. This is because each transformation matrix requires memory space to store the coefficients of the transformation matrix. As the demand for compression efficiency increases and the capabilities of hardware improve, LFNST can also be designed to be more complex. For example, a larger transformation matrix is ​​used, more transformation matrix sets are used, and more transformation matrices are used for each transformation matrix set. Illustratively, Table 7 shows another correspondence between intra prediction modes and transformation matrix sets.

[0142] [Table 7]

[0143] As shown in Table 7, 35 transformation matrix sets are used, and three transformation matrices are used in each transformation matrix set. The correspondence between the transformation matrix sets and the intra prediction modes can be realized as follows: the intra prediction modes 0 to 34 correspond to the transformation matrix sets 0 to 34 in the forward direction, that is, the larger the prediction mode number, the larger the index of the transformation matrix set; the intra prediction modes 35 to 67 correspond to the transformation matrix sets 2 to 33 in the backward direction due to transposition, that is, the larger the prediction mode number, the smaller the index of the transformation matrix set; the remaining prediction modes can be unified to the transformation matrix set with index 2. That is, if the transposition is not taken into account, one intra prediction mode corresponds to one transformation matrix set. With such a design, a more suitable LFNST transformation matrix can be obtained for the corresponding residual for each intra prediction mode, and the compression performance is also improved.

[0144] Of course, in theory it is possible to achieve one-to-one in the wide-angle mode as well, but the cost performance of such a design is relatively low, and this application does not specifically address this.

[0145] Also, in the case of LFNST, in order to adapt the MIP to a transformation matrix set, the present application may make the transformation matrix set adapted to the planar mode the transformation matrix set adapted to the MIP.

[0146] It should be noted that LFNST is merely one example of a quadratic transform and should not be understood as a limitation of quadratic transforms, for example, LFNST is a non-separable quadratic transform, and in other alternative embodiments, a separable quadratic transform may be used to improve compression efficiency of diagonal texture residuals.

[0147] FIG. 15 is a block diagram illustrating a decoding framework 200 according to an embodiment of the present application.

[0148] As shown in FIG. 15, the decoding framework 200 may include an entropy decoding unit 210, an inverse transform and inverse quantization unit 220, a residual unit 230, an intra prediction unit 240, an inter prediction unit 250, a loop filtering unit 260, and a decoding image buffer unit 270.

[0149] The entropy decoding unit 210 receives and decodes a bitstream to obtain a prediction block and a frequency-domain residual block. The frequency-domain residual block is subjected to steps such as inverse transformation and inverse quantization by the inverse transformation and inverse quantization unit 220 to obtain a time-domain residual block. The residual unit 230 adds a prediction block obtained by prediction by the intra prediction unit 240 or the inter prediction unit 250 to a time-domain residual block obtained after inverse transformation and inverse quantization by the inverse transformation and inverse quantization unit 220 to obtain a reconstructed block.

[0150] 16 is a flow chart illustrating a decoding method 310 according to an embodiment of the present application. As can be understood, the decoding method 310 can be performed by a decoder. For example, the decoding method 310 is applied to the decoding framework 200 shown in FIG. 15. For ease of explanation, the following description will be given taking the decoder as an example.

[0151] As shown in FIG. 16, the decoding method 310 may include some or all of the following: S311: The decoder decodes the bitstream to obtain the first transform coefficient of the current block. S312: The decoder performs a first transform on the first transform coefficients to obtain a residual block of the current block. S313: The decoder performs prediction on the current block based on the first prediction mode and the second prediction mode corresponding to the geometric partition mode, to obtain a prediction block of the current block. S314: The decoder obtains a reconstructed block of the current block based on the predicted block of the current block and the residual block of the current block.

[0152] In this embodiment, the decoder can perform a first transformation on a first transformation coefficient of the current block and at the same time perform prediction on the current block based on a first prediction mode and a second prediction mode corresponding to a geometric partitioning mode, which can improve the decompression efficiency of the current block.

[0153] Of course, in other alternative embodiments, a secondary transformation can be introduced in addition to the first transformation, and the method of matching the geometric division mode with the first transformation can also be applied to the method of matching the geometric division mode with the secondary transformation. For example, the secondary transformation can be the LFNST described above, i.e., the method of matching the geometric division mode with the first transformation can also be applied to the method of matching the geometric division mode with the LFNST. As another example, LFNST is a non-separable secondary transformation, and in other alternative embodiments, the geometric division mode can also be applied to a separable secondary transformation, i.e., the method of matching the geometric division mode with the first transformation can also be applied to the method of matching the geometric division mode with the non-separable secondary transformation.

[0154] In addition, the geometric partition mode may be used for intra prediction or inter prediction. In other words, the prediction modes corresponding to the geometric partition mode (i.e., the first prediction mode and the second prediction mode) may be either intra prediction modes or either inter prediction modes, or may include both intra prediction modes and inter prediction modes at the same time. In other words, in the geometric partition mode, two arbitrary prediction blocks can be combined using a weight matrix. For example, two inter prediction blocks, or two intra prediction blocks, or one inter prediction block and one intra prediction block can be combined. Furthermore, in the screen content coding, a prediction block of an intra block copy (IBC) mode or a prediction block of a palette mode can be used as one or two of the prediction blocks. For convenience of explanation, the intra mode, inter mode, IBC mode, and palette mode are collectively referred to as prediction modes in this application. It can be understood that the prediction mode can be used to generate information of one prediction block of the current block based on the codec. Exemplarily, in intra prediction, the prediction mode may be an intra prediction mode such as a DC mode, a planar mode, or various kinds of intra angle prediction modes. Of course, some or some auxiliary information such as an optimization method of an intra reference sample, an optimization method after generating a basic prediction block (e.g., filtering), etc. may be superimposed. Exemplarily, in inter prediction, the prediction mode may be a merge mode, a merge with motion vector difference (MMVD) mode, or an advanced motion vector prediction mode (Advanced Motion Vector Prediction, AMVP). Exemplarily, the prediction mode may be a unidirectional prediction, a bidirectional prediction, or a multi-hypothesis prediction. Furthermore, if the inter prediction mode uses unidirectional prediction and one motion information can be determined, the prediction block can be determined based on the motion information.In the inter prediction mode, bidirectional prediction is used, and if two pieces of motion information can be determined, a prediction block can be determined based on the motion information.

[0155] Of course, the scheme provided in this application is similarly applicable to any prediction mode that performs weighted prediction based on multiple prediction modes, such as AWP, and this application is not specifically limited thereto.

[0156] In some embodiments, S312 is Decoding the bitstream to obtain a first flag and a second flag; performing a first transform on the first transform coefficients to obtain a residual block when the first flag indicates that a geometric partitioning mode is permitted to be used to perform prediction on the block in the current sequence and the second flag indicates that a first transform is permitted to be used to perform transformation on the block in the current sequence; may include.

[0157] Illustratively, the current sequence is the image sequence that includes the current block.

[0158] Illustratively, the first flag is used to control whether or not to use the geometric partitioning mode for the current sequence.

[0159] Illustratively, when the value of the first flag is a first value, the first flag indicates that the geometric partition mode is permitted to be used to perform prediction on a block in a current sequence. When the value of the first flag is a second value, the first flag indicates that the geometric partition mode is not permitted to be used to perform prediction on a block in a current sequence. In one embodiment, the first value is 0 and the second value is 1, and in another embodiment, the first value is 1 and the second value is 0. Of course, the first value or the second value may be other values.

[0160] Illustratively, the second flag is used to control whether or not to use the first transform for the current sequence.

[0161] Illustratively, when the value of the second flag is a third value, the second flag indicates that the first transform is permitted to be used to perform a transform on a block in the current sequence. When the value of the second flag is a fourth value, the second flag indicates that the first transform is not permitted to be used to perform a transform on a block in the current sequence. In one embodiment, the third value is 0 and the fourth value is 1, and in another embodiment, the third value is 1 and the fourth value is 0. Of course, the third value or the fourth value may be other values.

[0162] For example, if the first flag is denoted as sps_gpm_enabled_flag and the second flag is denoted as sps_mts_enabled_flag, when the values ​​of both sps_gpm_enabled_flag and sps_mts_enabled_flag are both 1, a first transform is performed on the first transform coefficient to obtain a residual block.

[0163] For example, if the first flag indicates that the use of a geometric partitioning mode to perform prediction on a block in the current sequence is not permitted, and / or the second flag indicates that the use of a first transform to perform a transform on a block in the current sequence is not permitted, the first transform is not performed on the first transform coefficients, in other words, another type of transform can be performed directly on the first transform coefficients to obtain residual values ​​of the current block.

[0164] Of course, in other alternative embodiments, the first flag and / or the second flag may be replaced with a flag at a level such as a picture, a slice, a largest coding unit (LCU), a coding tree unit (CTU), a coding unit (CU), a prediction unit (PU), or a transform unit (TU). Alternatively, a flag at a level such as a picture, a slice, an LCU, a CTU, a CU, a PU, or a TU may be added regarding whether to use the geometric partition mode or the first transform based on the first flag and the second flag. The embodiment of the present application is not limited thereto.

[0165] In some embodiments, S312 is If the first flag indicates that a geometric partition mode is allowed to be used to perform prediction on a block in a current sequence and the second flag indicates that a first transform is allowed to be used to perform transformation on a block in a current sequence, decoding the bitstream to obtain a third flag; performing a first transform on the first transform coefficients to obtain a residual block if the third flag indicates that both the geometric partitioning mode and the first transform are allowed to be used for the block in the current sequence; may include.

[0166] Illustratively, a third flag is used to control whether both the geometric division mode and the first transformation can be used.

[0167] Illustratively, when the value of the third flag is a fifth value, the third flag indicates that both the geometric partition mode and the first transformation are permitted to be used for the block in the current sequence. When the value of the third flag is a sixth value, the third flag indicates that both the geometric partition mode and the first transformation are not permitted to be used for the block in the current sequence. In one embodiment, the fifth value is 0 and the sixth value is 1, and in another embodiment, the fifth value is 1 and the sixth value is 0. Of course, the fifth value or the sixth value may be other values.

[0168] Illustratively, the first flag is denoted as sps_gpm_enabled_flag, the second flag is denoted as sps_mts_enabled_flag, and the third flag is denoted as sps_gpm_mts_enabled_flag. When the values ​​of both sps_gpm_enabled_flag and sps_mts_enabled_flag are 1, it is determined whether sps_gpm_mts_enabled_flag is 1. When sps_gpm_mts_enabled_flag is 1, a first transform is performed on the first transform coefficient to obtain a residual block.

[0169] Of course, in other alternative embodiments, the third flag may be replaced with a flag at a level such as a picture, a slice, a largest coding unit (LCU), a coding tree unit (CTU), a coding unit (CU), a prediction unit (PU), or a transform unit (TU). Alternatively, flag information at a level such as a picture, a slice, an LCU, a CTU, a CU, a PU, or a TU may be added regarding whether to use the geometric partition mode or the first transform based on the third flag. The embodiment of the present application is not limited thereto.

[0170] In some embodiments, S312 is If the first flag indicates that the geometric partitioning mode is permitted to be used to perform prediction on the block in the current sequence and the second flag indicates that the first transform is permitted to be used to perform transformation on the block in the current sequence, the decoder may perform the first transform on the first transform coefficients to obtain a residual block when the height and / or width of the current block is greater than or equal to a first threshold.

[0171] As an example, the first flag is denoted as sps_gpm_enabled_flag, the second flag is denoted as sps_mts_enabled_flag, and the third flag is denoted as sps_gpm_mts_enabled_flag. If the values ​​of both sps_gpm_enabled_flag and sps_mts_enabled_flag are 1, the decoder determines the height and / or width of the current block, and if the height and / or width of the current block is greater than or equal to a first threshold, performs a first transform on the first transform coefficients to obtain a residual block.

[0172] Illustratively, the first threshold may be 4, 8, 16, 32, 64, or other value.

[0173] In some embodiments, the method 310 may further include, prior to S312, determining, by the decoder, a set of transform kernel types to be used for the first transform.

[0174] In addition, in the geometric partition mode, two kinds of prediction modes (i.e., a first prediction mode and a second prediction mode) are combined to predict the current block. A prediction block obtained by performing prediction on the current block using different prediction modes may have different texture characteristics. Therefore, when the geometric partition mode is selected for the current block, the first prediction mode may cause the prediction block of the current block to show one texture characteristic, and the second prediction mode may cause the prediction block of the current block to show another texture characteristic. In other words, after predicting the current block, from a statistical point of view, the residual block of the current block also shows two texture characteristics. That is, the residual block of the current block does not necessarily match the rules that can be reflected in a certain prediction mode. Therefore, for the geometric partition mode, the decoder needs to determine a transform kernel type set that matches the characteristics before performing the first transform on the first transform coefficients. However, since the transform kernel type set used for the first transform is usually a transform kernel type set defined based on a single intra prediction mode, it is necessary to further improve the related scheme for determining the transform kernel type set used for the first transform for the geometric partition mode, and each embodiment will be described below by way of example.

[0175] In some embodiments, the transformation kernel type set used for the first transformation is the same as the transformation kernel type set that is compatible with the planar or DC mode.

[0176] Exemplarily, when the decoder side checks the prediction mode of the current block, if the geometric partition mode is used for the current block, the decoder classifies the geometric partition mode and the planar mode (or DC mode) into one type, and determines the transform kernel type set used for the first transform based on the planar mode (or DC mode). Alternatively, when the decoder side checks the prediction mode of the current block, if the geometric partition mode is used for the current block, the encoder may return the planar mode (or DC mode) as the prediction mode of the current block, and based on this, the decoder may determine the transform kernel type set compatible with the planar mode (or DC mode) as the transform kernel type set used for the first transform. Alternatively, when the decoder side checks the prediction mode of the current block, if the geometric partition mode is used for the current block, the decoder may consider that the transform kernel type set used for the first transform for the current block may be the transform kernel type set compatible with the planar mode (or DC mode).

[0177] In this embodiment, since both the planar mode (or DC mode) and the geometric partitioning mode can represent various texture characteristics, by determining a transformation kernel type set suitable for the planar mode or DC mode as the transformation kernel type set used for the first transformation, not only can the current block be decoded based on the geometric partitioning mode and the first transformation, but also it can be ensured that the texture characteristics of the transformation kernel type set used for the first transformation are as similar as possible to the texture characteristics of the residual block of the current block, thereby improving the decompression efficiency.

[0178] For example, when the prediction modes corresponding to the geometric partitioning mode (i.e., the first prediction mode and the second prediction mode) are both intra prediction modes, or when the geometric partitioning mode is used for intra prediction, the decoder determines that the transform kernel type set used for the first transform is the same as the transform kernel type set compatible with the planar mode or the DC mode.

[0179] For example, when the decoder checks the prediction mode of the current block, if the geometric partition mode is used for the current block and the two prediction modes corresponding to the geometric partition mode are both intra prediction modes, the decoder classifies the geometric partition mode and the planar mode (or DC mode) into one type and determines the transformation kernel type set to be used for the first transformation based on the planar mode (or DC mode). Alternatively, when the decoder checks the prediction mode of the current block, if the geometric partition mode is used for the current block and the two prediction modes corresponding to the geometric partition mode are both intra prediction modes, the encoder may return the planar mode (or DC mode) as the prediction mode of the current block, and based on this, the decoder may determine the transformation kernel type set that matches the planar mode (or DC mode) as the transformation kernel type set to be used for the first transformation. Alternatively, when the decoder side checks the prediction mode of the current block, if a geometric partitioning mode is used for the current block and the two prediction modes corresponding to the geometric partitioning mode are both intra prediction modes, the decoder may assume that the transform kernel type set used for the first transform for the current block may be a transform kernel type set compatible with the planar mode (or DC mode).

[0180] Illustratively, when the prediction modes corresponding to the geometric partitioning mode (i.e., the first prediction mode and the second prediction mode) are both inter prediction modes, or when the geometric partitioning mode is used for inter prediction, the decoder determines that the transform kernel type set used for the first transform is the same as the transform kernel type set compatible with the planar mode or DC mode.

[0181] Exemplarily, when the decoder checks the prediction mode of the current block, if the geometric partition mode is used for the current block and the two prediction modes corresponding to the geometric partition mode are both inter prediction modes, the decoder classifies the geometric partition mode and the planar mode (or DC mode) into one type and determines the transformation kernel type set used for the first transformation based on the planar mode (or DC mode). Alternatively, when the decoder checks the prediction mode of the current block, if the geometric partition mode is used for the current block and the two prediction modes corresponding to the geometric partition mode are both inter prediction modes, the encoder may return the planar mode (or DC mode) as the prediction mode of the current block, and based on this, the decoder may determine the transformation kernel type set compatible with the planar mode (or DC mode) as the transformation kernel type set used for the first transformation. Alternatively, when the decoder checks the prediction mode of the current block, if the geometric partition mode is used for the current block and the two prediction modes corresponding to the geometric partition mode are both inter prediction modes, the decoder may consider that the transformation kernel type set used for the first transformation for the current block may be the transformation kernel type set compatible with the planar mode (or DC mode).

[0182] In some embodiments, the decoder first determines a dividing line consisting of points where the weight of the first prediction mode and the weight of the second prediction mode are the same, then determines an angle index of the dividing line, and then determines a transform kernel type set to be used for the first transform based on the angle index.

[0183] Exemplarily, when the prediction modes corresponding to the geometric partition mode (i.e., the first prediction mode and the second prediction mode) are both intra prediction modes, or when the geometric partition mode is used for intra prediction, the decoder first determines a division line consisting of points where the weight of the first prediction mode and the weight of the second prediction mode are the same, then determines an angle index of the division line, and then determines a transform kernel type set to be used for the first transform based on the angle index. For example, the decoder determines a transform kernel type set that is compatible with the prediction mode (e.g., the intra prediction mode) corresponding to the angle index as a transform kernel type set to be used for the first transform.

[0184] Exemplarily, when the prediction modes corresponding to the GPM geometric partition mode (i.e., the first prediction mode and the second prediction mode) are both inter prediction modes, or when the geometric partition mode is used for inter prediction, the decoder first determines a partition line consisting of points where the weight of the first prediction mode and the weight of the second prediction mode are the same, then determines an angle index of the partition line, and then determines a transform kernel type set to be used for the first transform based on the angle index. For example, the decoder determines a transform kernel type set that is compatible with the prediction mode (e.g., intra prediction mode) corresponding to the angle index as a transform kernel type set to be used for the first transform.

[0185] Exemplarily, when predicting using a geometric partition mode for a current block, the decoder may classify the geometric partition mode and the intra prediction mode corresponding to the partition line into one type based on the partition line of the geometric partition mode when selecting a transform kernel type set to be used for the first transform, that is, may determine the transform kernel type set to be used for the first transform based on the angle index. Specifically, the angle index (angleIdx) of the partition line is determined based on the weight derivation mode used for the geometric partition mode, and then the transform kernel type set that matches the intra prediction mode corresponding to the angle index is determined as the transform kernel type set to be used for the first transform. Alternatively, when the decoder side checks the prediction mode of the current block, if the geometric partition mode is used for the current block, the encoder may return the intra prediction mode corresponding to the partition line as the prediction mode of the current block, and based on this, the decoder may determine the transform kernel type set that matches the intra prediction mode corresponding to the partition line as the transform kernel type set to be used for the first transform. Alternatively, when the decoder side checks the prediction mode of the current block, if a geometric partitioning mode is used for the current block, the decoder may assume that the transform kernel type set used for the first transform for the current block may be a transform kernel type set that is compatible with the intra prediction mode corresponding to the partition line.

[0186] In this embodiment, the partition line or angle index can not only represent the characteristics of the geometric partitioning mode, but also represent the texture characteristics of the residual block of the current block to a certain extent. Therefore, by associating the angle index with the intra prediction mode, not only can the current block be decoded based on the geometric partitioning mode and the first transform, but also ensures that the texture characteristics of the transform kernel type set used for the first transform are as similar as possible to the texture characteristics of the residual block of the current block, thereby improving decompression efficiency.

[0187] As can be understood, the above-mentioned dividing line may be for a weight derivation mode, a weight matrix, or a weight matrix derivation mode, the specific content of which may refer to the description and related content of FIG. 8 or FIG. 9, and will not be described here to avoid duplication.

[0188] Illustratively, the decoder may determine a set of transform kernel types to be used for the first transform based on the first mapping relationship and the angle index. The first mapping relationship includes a correspondence relationship between at least one index and at least one intra-prediction mode, and the at least one index includes an angle index. Of course, the first mapping relationship may be implemented in a table format or in other formats, such as an array format, and the present application is not specifically limited thereto.

[0189] Exemplarily, the first mapping relationship can be realized as Table 8 below.

[0190] [Table 8]

[0191] As shown in Table 8, the first mapping relationship may include 32 indexes and intra-prediction modes corresponding to each index.

[0192] Note that the indexes in Table 8 may include angleIdx shown in Table 1, and may of course include indexes other than angleIdx shown in Table 1. For example, some indexes correspond to 0. This is because these indexes are not used in the geometric partitioning mode, that is, they are indexes not included in Table 1. Note that if some indexes change in a version, for example, if more indexes are used in the future, or if the intra angle prediction mode is changed, for example, if there are more intra angle prediction modes in the future, the correspondence relationship table shown in Table 8 may also be changed accordingly, and is not particularly limited in the present application.

[0193] In this embodiment, the decoder may determine the transformation kernel type set used for the first transformation based only on the angle index of the division line. In another alternative embodiment, the decoder may determine the transformation kernel type set used for the first transformation based only on the distance index of the division line. For example, the decoder may determine the transformation kernel type set used for the first transformation to be a transformation kernel type set that matches the prediction mode (e.g., intra prediction mode) corresponding to the distance index of the division line. Alternatively, the decoder may determine the transformation kernel type set used for the first transformation based on the division line (i.e., the angle index of the division line and the distance index of the division line). For example, the decoder may determine the transformation kernel type set used for the first transformation to be a transformation kernel type set that matches the prediction mode (e.g., intra prediction mode) corresponding to the division line (i.e., the angle index of the division line and the distance index of the division line). This application does not particularly limit this.

[0194] In some embodiments, the decoder first determines a weight derivation mode to be used for the geometric partitioning mode, and then determines a transform kernel type set that matches the intra-prediction mode corresponding to the weight derivation mode as the transform kernel type set to be used for the first transform.

[0195] Exemplarily, when the prediction modes corresponding to the geometric partitioning mode (i.e., the first prediction mode and the second prediction mode) are both intra prediction modes, or when the geometric partitioning mode is used for intra prediction, the decoder first determines a weight derivation mode to be used for the geometric partitioning mode, and then determines a transform kernel type set that is compatible with the intra prediction mode corresponding to the weight derivation mode as a transform kernel type set to be used for the first transform.

[0196] Exemplarily, when the prediction modes corresponding to the geometric partitioning mode (i.e., the first prediction mode and the second prediction mode) are both inter prediction modes, or when the geometric partitioning mode is used for inter prediction, the decoder first determines a weight derivation mode to be used for the geometric partitioning mode, and then determines a transform kernel type set that is compatible with the intra prediction mode corresponding to the weight derivation mode as a transform kernel type set to be used for the first transform.

[0197] For example, when the decoder checks the prediction mode of the current block, if the geometric partition mode is used for the current block, the decoder classifies the intra prediction mode corresponding to the geometric partition mode and the weight derivation mode into one type, and determines the transform kernel type set used for the first transform based on the intra prediction mode corresponding to the weight derivation mode. Alternatively, when the decoder checks the prediction mode of the current block, if the geometric partition mode is used for the current block, the encoder may return the intra prediction mode corresponding to the weight derivation mode as the prediction mode of the current block, and based on this, the decoder may determine the transform kernel type set that is compatible with the intra prediction mode that corresponds to the weight derivation mode as the transform kernel type set used for the first transform. Alternatively, when the decoder checks the prediction mode of the current block, if the geometric partition mode is used for the current block, the decoder may consider that the transform kernel type set used for the first transform for the current block may be the transform kernel type set that is compatible with the intra prediction mode that corresponds to the weight derivation mode.

[0198] In this embodiment, the weight derivation mode can not only represent the characteristics of the geometric partitioning mode, but also represent the texture characteristics of the residual block of the current block to a certain extent. Therefore, by associating the weight derivation mode with the intra prediction mode, not only can the current block be decoded based on the geometric partitioning mode and the first transform, but also it can ensure that the texture characteristics of the transform kernel type set used for the first transform are as similar as possible to the texture characteristics of the residual block of the current block, thereby improving the decompression efficiency.

[0199] Illustratively, the decoder may determine, based on the second mapping relationship, a transform kernel type set that is compatible with an intra-prediction mode corresponding to a weight derivation mode used for the geometric partitioning mode as a transform kernel type set used for the first transform. The second mapping relationship includes a correspondence relationship between at least one weight derivation mode and at least one intra-prediction mode, and the at least one weight derivation mode includes a weight derivation mode used for the geometric partitioning mode.

[0200] Of course, the second mapping relationship may be implemented in a table format or in other formats such as an array format, and the present application is not specifically limited thereto.

[0201] The above-mentioned weight derivation mode can also be called weight matrix or weight matrix derivation mode, and its specific content can be referred to the description of FIG. 8, Table 1 and related content, and will not be described further here to avoid duplication.

[0202] In some embodiments, the first prediction mode is a first intra prediction mode and the second prediction mode is a second intra prediction mode. The decoder determines a third intra prediction mode based on the first intra prediction mode and the second intra prediction mode. The transform kernel type set used for the first transform is the same as the transform kernel type set compatible with the third intra prediction mode.

[0203] Illustratively, the decoder may determine a transform kernel type set compatible with the third intra-prediction mode as the transform kernel type set to be used for the first transform.

[0204] Exemplarily, when the decoder checks the prediction mode of the current block, if the geometric partition mode is used for the current block, the decoder may determine the third intra prediction mode based on the first intra prediction mode and the second intra prediction mode, and classify the geometric partition mode and the third intra prediction mode into one type, and based on this, the decoder may determine the transform kernel type set used for the first transform based on the third intra prediction mode. Alternatively, when the decoder checks the prediction mode of the current block, if the geometric partition mode is used for the current block, the encoder may return the third intra prediction mode as the prediction mode of the current block, and based on this, the decoder may determine the transform kernel type set compatible with the third intra prediction mode as the transform kernel type set used for the first transform. Alternatively, when the decoder checks the prediction mode of the current block, if the geometric partition mode is used for the current block, the decoder may consider the transform kernel type set used for the first transform of the current block to be the transform kernel type set compatible with the third intra prediction mode.

[0205] Of course, in other alternative embodiments, the decoder need not explicitly determine the third intra-prediction mode and then determine the transform kernel type set to be used for the first transform based on the third intra-prediction mode, but instead directly use the transform kernel type set that is compatible with the third intra-prediction mode as the transform kernel type set to be used for the first transform.

[0206] In some embodiments, the decoder determines a default prediction mode among the first intra prediction mode and the second intra prediction mode as the third intra prediction mode. Or, the decoder determines an intra prediction mode among the first intra prediction mode and the second intra prediction mode that corresponds to a weight derivation mode used for the geometric partition mode as the third intra prediction mode. Or, the decoder determines the third intra prediction mode based on a weight of the first intra prediction mode and / or a weight of the second intra prediction mode. Or, the decoder determines the third intra prediction mode based on a type of the first intra prediction mode and a type of the second intra prediction mode. Or, the decoder determines the third intra prediction mode based on a prediction angle of the first intra prediction mode and a prediction angle of the second intra prediction mode.

[0207] Exemplarily, when the decoder checks the prediction mode of the current block, if the geometric partition mode is used for the current block, the transform kernel type set to be used for the first transform may be determined based on the first intra prediction mode and the second intra prediction mode when selecting the transform kernel type set to be used for the first transform. In one embodiment, the transform kernel type set may be determined using the first intra prediction mode in any case, i.e., the transform kernel type set that is compatible with the first intra prediction mode in any case is determined as the transform kernel type set to be used for the first transform; or the transform kernel type set may be determined using the second intra prediction mode in any case, i.e., the transform kernel type set that is compatible with the second intra prediction mode in any case is determined as the transform kernel type set to be used for the first transform. As another embodiment, the transform kernel type set may be determined using a first intra prediction mode in some cases, i.e., a transform kernel type set suitable for the first intra prediction mode may be determined as a transform kernel type set used for the first transformation; or the transform kernel type set may be determined using a second intra prediction mode in some cases, i.e., a transform kernel type set suitable for the second intra prediction mode may be determined as a transform kernel type set used for the first transformation; or the transform kernel type set may be determined using a planar mode or a DC mode in some cases, i.e., a transform kernel type set suitable for the planar mode or a DC mode may be determined as a transform kernel type set used for the first transformation. The term "determining using a certain prediction mode" means that the geometric partition mode and a certain prediction mode are classified into one type, and the decoder can determine the transform kernel type set used for the first transformation based on the certain prediction mode. Or, when the decoder checks the prediction mode of the current block, if the geometric partition mode is used for the current block, the decoder can return a certain prediction mode, and the decoder can determine the transform kernel type set used for the first transformation based on the certain prediction mode.Alternatively, when the decoder checks the prediction mode of the current block, if a geometric partitioning mode is used for the current block, the decoder may assume that the transform kernel type set used for the first transform for the current block may be a transform kernel type set that is compatible with a certain prediction mode.

[0208] For example, when the decoder determines an intra prediction mode among the first intra prediction mode and the second intra prediction mode that corresponds to a weight derivation mode used for the geometric partitioning mode as a third intra prediction mode, the decoder may determine the intra prediction mode corresponding to the weight derivation mode used for the geometric partitioning mode as the third intra prediction mode based on the third mapping relationship.

[0209] The third mapping relationship includes a weight derivation mode corresponding to the first intra prediction mode and a weight derivation mode corresponding to the second intra prediction mode, and the weight derivation mode corresponding to the first intra prediction mode includes a weight derivation mode used for the geometric partition mode, or the weight derivation mode corresponding to the second intra prediction mode includes a weight derivation mode used for the geometric partition mode. In other words, based on the third mapping relationship, if the weight derivation mode corresponding to the first intra prediction mode includes a weight derivation mode used for the geometric partition mode, the first intra prediction mode is determined as the third intra prediction mode. If the weight derivation mode corresponding to the second intra prediction mode includes a weight derivation mode used for the geometric partition mode, the second intra prediction mode is determined as the third intra prediction mode. Alternatively, the third mapping relationship can be used to specify a weight derivation mode corresponding to the first prediction mode and a weight derivation mode corresponding to the second prediction mode. In one specific embodiment, the third mapping relationship may include only a weight derivation mode corresponding to the first intra prediction mode and a weight derivation mode corresponding to the second intra prediction mode, and in another specific embodiment, the third mapping relationship may also include a weight derivation mode corresponding to an intra prediction mode other than the first intra prediction mode and the second intra prediction mode.

[0210] Of course, the third mapping relationship may be implemented in a table format or in other formats such as an array format, and the present application is not specifically limited thereto.

[0211] In some embodiments, the decoder may determine the third intra-prediction mode based on the weight of the first intra-prediction mode or the weight of the second intra-prediction mode used in the default position.

[0212] Illustratively, the third intra prediction mode is associated with the weight of the first intra prediction mode or the weight of the second intra prediction mode used in the default position.

[0213] Exemplarily, the weight of the first intra prediction mode used at the default position may be a weight used when predicting a point at the default position of the current block using the first intra prediction mode. Similarly, the weight of the second intra prediction mode used at the default position may be a weight used when predicting a point at the default position of the current block using the second intra prediction mode. For example, in conjunction with the above-mentioned contents related to the geometric partition mode, the weight of the first intra prediction mode used at the default position may be a wValue calculated at the default position, and the weight of the second intra prediction mode used at the default position may be an 8-wValue calculated at the default position.

[0214] In some embodiments, when the decoder determines a third intra prediction mode based on the weight of the first intra prediction mode and / or the weight of the second intra prediction mode, the decoder may determine the intra prediction mode among the first intra prediction mode and the second intra prediction mode that has the greatest weight at the default position as the third intra prediction mode.

[0215] Illustratively, when the weight of the first intra prediction mode used at the default position is greater than the weight of the second intra prediction mode used at the default position, the decoder can determine the first intra prediction mode as the third intra prediction mode, or directly determine the transform kernel type set that matches the first intra prediction mode as the transform kernel type set used for the first transform. When the weight of the second intra prediction mode used at the default position is greater than the weight of the first intra prediction mode used at the default position, the decoder can determine the second intra prediction mode as the third intra prediction mode, or directly determine the transform kernel type set that matches the second intra prediction mode as the transform kernel type set used for the first transform.

[0216] Of course, in other alternative embodiments, the third intra prediction mode may be determined based only on the weight of the first intra prediction mode or the weight of the second intra prediction mode.For example, if the weight of the first intra prediction mode is greater than a certain threshold, the first intra prediction mode can be determined as the third intra prediction mode, otherwise the second intra prediction mode can be determined as the third intra prediction mode.For example, if the weight of the second intra prediction mode is greater than a certain threshold, the second intra prediction mode can be determined as the third intra prediction mode, otherwise the first intra prediction mode can be determined as the third intra prediction mode.

[0217] Of course, in other alternative embodiments, the weight of the first intra prediction mode may be the weight of the first intra prediction mode calculated for the weight matrix used in the geometric partition mode, and similarly, the weight of the second intra prediction mode may be the weight of the second intra prediction mode calculated for the weight matrix used in the geometric partition mode. In other words, the decoder can determine the third intra prediction mode based on the weight of the first intra prediction mode and / or the weight of the second intra prediction mode by first calculating the weight value of each point and then calculating the weight value of all points for each of the first intra prediction mode and / or the second intra prediction mode. In one embodiment, if the weight of the first intra prediction mode is greater than a threshold, the first intra prediction mode can be determined as the third intra prediction mode, and otherwise the second intra prediction mode can be determined as the third intra prediction mode. As another embodiment, the intra prediction mode having the largest weight among the first intra prediction mode and the second intra prediction mode may be determined as the third intra prediction mode.

[0218] In some embodiments, the default position is the center position.

[0219] Of course, in other alternative embodiments, the default location may be other locations, such as the top left, top right, bottom left, bottom right, etc.

[0220] In some embodiments, when determining the third intra prediction mode based on the weight of the first intra prediction mode or the weight of the second intra prediction mode used at the default position, the decoder may first determine a division line consisting of points where the weight of the first prediction mode and the weight of the second prediction mode are the same, and then determine the third intra prediction mode based on the division line. For example, the decoder may determine the third intra prediction mode based on an angle index and / or a distance index of the division line.

[0221] For example, when the decoder determines an intra prediction mode among the first intra prediction mode and the second intra prediction mode that corresponds to the angular index of the division line as the third intra prediction mode, the decoder may determine the intra prediction mode that corresponds to the angular index of the division line as the third intra prediction mode based on the fourth mapping relationship.

[0222] The fourth mapping relationship includes an angle index corresponding to the first intra prediction mode and an angle index corresponding to the second intra prediction mode, and the angle index corresponding to the first intra prediction mode includes an angle index used for the division line, or the angle index corresponding to the second intra prediction mode includes an angle index used for the division line. In other words, based on the fourth mapping relationship, if the angle index corresponding to the first intra prediction mode includes an angle index of the division line, determine the first intra prediction mode as the third intra prediction mode. If the angle index corresponding to the second intra prediction mode includes an angle index of the division line, determine the second intra prediction mode as the third intra prediction mode. Alternatively, the fourth mapping relationship can be used to define the angle index corresponding to the first prediction mode and the angle index corresponding to the second prediction mode. In one specific embodiment, the fourth mapping relationship may include only an angular index corresponding to the first intra prediction mode and an angular index corresponding to the second intra prediction mode, and in another specific embodiment, the fourth mapping relationship may also include an angular index corresponding to an intra prediction mode other than the first intra prediction mode and the second intra prediction mode.

[0223] Of course, the fourth mapping relationship may be implemented in a table format or in other formats such as an array format, and the present application is not specifically limited thereto.

[0224] For example, when the decoder determines an intra prediction mode among the first intra prediction mode and the second intra prediction mode that corresponds to a distance index used for the division line as a third intra prediction mode, the decoder may determine the intra prediction mode corresponding to the distance index used for the division line as the third intra prediction mode based on the fifth mapping relationship.

[0225] The fifth mapping relationship includes a distance index corresponding to the first intra prediction mode and a distance index corresponding to the second intra prediction mode, and the distance index corresponding to the first intra prediction mode includes a distance index used for the division line, or the distance index corresponding to the second intra prediction mode includes a distance index used for the division line. In other words, based on the fifth mapping relationship, if the distance index corresponding to the first intra prediction mode includes a distance index used for the division line, determine the first intra prediction mode as the third intra prediction mode. If the distance index corresponding to the second intra prediction mode includes a distance index used for the division line, determine the second intra prediction mode as the third intra prediction mode. Alternatively, the fifth mapping relationship can be used to define a distance index corresponding to the first prediction mode and a distance index corresponding to the second prediction mode. In one specific embodiment, the fifth mapping relationship may include only a distance index corresponding to the first intra prediction mode and a distance index corresponding to the second intra prediction mode, and in another specific embodiment, the fifth mapping relationship may also include a distance index corresponding to an intra prediction mode other than the first intra prediction mode and the second intra prediction mode.

[0226] Of course, the fifth mapping relationship may be realized in the form of a table or in other forms such as an array form, and the present application is not specifically limited thereto.

[0227] In some embodiments, when the decoder determines the third intra prediction mode based on the type of the first intra prediction mode and the type of the second intra prediction mode, if the first intra prediction mode and the second intra prediction mode include an angular prediction mode and a non-angular prediction mode, the decoder determines the angular prediction mode as the third intra prediction mode.

[0228] Exemplarily, when the decoder determines the third intra prediction mode based on the type of the first intra prediction mode and the type of the second intra prediction mode, the priority of the angular prediction mode as the third intra prediction mode is higher than the priority of the non-angular prediction mode as the third intra prediction mode. For example, if the first intra prediction mode is an angular prediction mode and the second intra prediction mode is a non-angular prediction mode (e.g., a planar mode or a DC mode), the decoder determines the first intra prediction mode (i.e., the angular prediction mode) as the third intra prediction mode.

[0229] In some embodiments, when the decoder determines the third intra prediction mode based on the prediction angle of the first intra prediction mode and the prediction angle of the second intra prediction mode, if the prediction angle of the first intra prediction mode approaches the prediction angle of the second intra prediction mode, the decoder may determine the first intra prediction mode, the second intra prediction mode, or an intra prediction mode whose prediction angle is between the prediction angle of the first intra prediction mode and the prediction angle of the second intra prediction mode as the third intra prediction mode. If the difference between the prediction angle of the first intra prediction mode and the prediction angle of the second intra prediction mode is large, the decoder may determine the planar mode or the DC mode as the third intra prediction mode.

[0230] In some embodiments, when the absolute value of the difference between the prediction angle of the first intra prediction mode and the prediction angle of the second intra prediction mode is less than or equal to a second threshold, the intra prediction mode corresponding to the first prediction angle is determined as the third intra prediction mode. The first prediction angle is determined based on the prediction angle of the first intra prediction mode and the prediction angle of the second intra prediction mode. When the absolute value of the difference between the prediction angle of the first intra prediction mode and the prediction angle of the second intra prediction mode is greater than the second threshold, the planar mode or the DC mode is determined as the third intra prediction mode.

[0231] In some embodiments, the decoder determines a transform kernel type set that is compatible with the geometric partitioning mode as the transform kernel type set to be used for the first transform.

[0232] Exemplarily, when the prediction modes corresponding to the geometric partitioning mode (i.e., the first prediction mode and the second prediction mode) are both intra prediction modes, or when the geometric partitioning mode is used for intra prediction, the decoder determines a transform kernel type set that is compatible with the geometric partitioning mode as a transform kernel type set to be used for the first transform.

[0233] Exemplarily, when the prediction modes corresponding to the geometric partitioning mode (i.e., the first prediction mode and the second prediction mode) are both inter prediction modes, or when the geometric partitioning mode is used for inter prediction, the decoder determines a transform kernel type set that is compatible with the geometric partitioning mode as the transform kernel type set to be used for the first transform.

[0234] Illustratively, the decoder may define a set of transformation kernel types adapted or dedicated to the geometric partitioning mode.

[0235] In some embodiments, the first transform is used to process the horizontal and vertical textures in the current block.

[0236] In some embodiments, S312 is performing a second transform on the first transform coefficients to obtain second transform coefficients; performing a first transform on the second transform coefficients to obtain a residual block of the current block; may include.

[0237] In some embodiments, the second transform is used to process the diagonal texture in the current block.

[0238] In the above, the decoding method according to an embodiment of the present application has been described in detail from the perspective of a decoder, and below, with reference to FIG. 17, the encoding method according to an embodiment of the present application will be described from the perspective of an encoder.

[0239] 17 is a flowchart illustrating an encoding method 410 according to an embodiment of the present application. It should be understood that the encoding method 410 may be performed by an encoder, for example, applied to the encoding framework 100 shown in FIG. For convenience of explanation, an encoder will be taken as an example.

[0240] As shown in FIG. 17, the encoding method 410 may include the following: S411: Predict a current block according to a first prediction mode and a second prediction mode corresponding to a geometric partition mode, and obtain a predicted block of the current block. S412: Obtain a residual block of the current block based on the predicted block of the current block. S413: Perform a third transform on the residual block of the current block to obtain third transform coefficients of the current block. S414: Encode the third transform coefficient.

[0241] In some embodiments, S414 may include encoding the first flag, the second flag, and the third transform coefficient. The first flag indicates that a geometric partitioning mode is permitted to be used to perform prediction on blocks in the current sequence, and the second flag indicates that a third transform is permitted to be used to perform transformation on blocks in the current sequence.

[0242] In some embodiments, S414 may include encoding the first flag, the second flag, the third transform coefficient, and the third flag. The third flag indicates that both the geometric partitioning mode and the third transform are permitted to be used for blocks in the current sequence.

[0243] In some embodiments, S413 may include performing a third transform on the residual block of the current block when the height and / or width of the current block is greater than or equal to the first threshold to obtain third transform coefficients.

[0244] In some embodiments, before S414, the method 410 may further include determining a transformation kernel type set used for the third transformation. In some embodiments, the transformation kernel type set used for the third transformation is the same as the transformation kernel type set compatible with the planar mode or the DC mode.

[0245] In some embodiments, determining the transformation kernel type set to be used for the third transformation comprises: determining a dividing line consisting of points where the weight of the first prediction mode and the weight of the second prediction mode are equal; determining an angle index of the parting line; determining a transformation kernel type set to be used for the third transformation based on the angle index; Includes.

[0246] In some embodiments, determining the transformation kernel type set to be used for the third transformation comprises: determining a weight derivation mode to be used for the geometric partitioning mode; determining a transform kernel type set that is compatible with an intra prediction mode corresponding to the weight derivation mode as a transform kernel type set to be used for a third transform; Includes.

[0247] In some embodiments, the first prediction mode is a first intra-prediction mode and the second prediction mode is a second intra-prediction mode. Determining a transform kernel type set used for the third transform includes determining a third intra-prediction mode based on the first intra-prediction mode and the second intra-prediction mode. The transform kernel type set used for the third transform is the same as the transform kernel type set compatible with the third intra-prediction mode.

[0248] In some embodiments, determining the third intra-prediction mode based on the first intra-prediction mode and the second intra-prediction mode comprises: determining a default prediction mode among the first intra prediction mode and the second intra prediction mode as the third intra prediction mode; or determining, as a third intra prediction mode, an intra prediction mode corresponding to a weight derivation mode used in the geometric partition mode among the first intra prediction mode and the second intra prediction mode; or determining a third intra-prediction mode based on the weight of the first intra-prediction mode and / or the weight of the second intra-prediction mode; or determining a third intra-prediction mode based on the type of the first intra-prediction mode and the type of the second intra-prediction mode; or determining a third intra prediction mode based on a prediction angle of the first intra prediction mode and a prediction angle of the second intra prediction mode; Includes.

[0249] In some embodiments, determining the third intra prediction mode based on the weight of the first intra prediction mode and / or the weight of the second intra prediction mode includes determining the third intra prediction mode based on the weight of the first intra prediction mode or the weight of the second intra prediction mode used in a default position.

[0250] In some embodiments, determining the third intra prediction mode based on the weight of the first intra prediction mode or the weight of the second intra prediction mode used at the default position includes determining the intra prediction mode among the first intra prediction mode and the second intra prediction mode that has the largest weight at the default position as the third intra prediction mode.

[0251] In some embodiments, the default position is the center position.

[0252] In some embodiments, determining the third intra prediction mode based on the type of the first intra prediction mode and the type of the second intra prediction mode includes determining an angular prediction mode as the third intra prediction mode when the first intra prediction mode and the second intra prediction mode include an angular prediction mode and a non-angular prediction mode.

[0253] In some embodiments, determining the third intra prediction mode based on a prediction angle of the first intra prediction mode and a prediction angle of the second intra prediction mode comprises: determining an intra prediction mode corresponding to the first prediction angle as a third intra prediction mode when an absolute value of a difference between a prediction angle of the first intra prediction mode and a prediction angle of the second intra prediction mode is equal to or less than a second threshold, where the first prediction angle is determined based on the prediction angle of the first intra prediction mode and the prediction angle of the second intra prediction mode; When an absolute value of a difference between a prediction angle of the first intra prediction mode and a prediction angle of the second intra prediction mode is greater than a second threshold, determining a planar mode or a DC mode as a third intra prediction mode; Includes.

[0254] In some embodiments, determining the transformation kernel type set to be used for the third transformation includes determining a transformation kernel type set that is compatible with the geometric partitioning mode as the transformation kernel type set to be used for the third transformation.

[0255] In some embodiments, a third transform is used to process the horizontal and vertical textures in the current block.

[0256] In some embodiments, S414 may include performing a fourth transform on the third transform coefficients to obtain fourth transform coefficients, and encoding the fourth transform coefficients.

[0257] In some embodiments, a fourth transform is used to process the diagonal texture in the current block.

[0258] It should be understood that the first transform on the decoding side is the inverse transform of the third transform on the encoding side, and the second transform on the decoding side is the inverse transform of the fourth transform on the encoding side. For example, the third transform is the above-mentioned base transform or main transform, and the fourth transform is the above-mentioned secondary transform, and accordingly, the first transform can be the inverse transform (or inverse transform) of the base transform or main transform, and the second transform can be the inverse transform (or inverse transform) of the secondary transform. For example, the first transform can be the inverse (inverse) DCT2 type, the inverse (inverse) DCT8 type, or the inverse (inverse) DST7 type, etc., and the second transform can be the inverse (inverse) LFNST, and accordingly, the third transform can be the DCT2 type, the DCT8 type, or the DST7 type, etc., and the fourth transform can be the LFNST.

[0259] The encoding method can be understood as the reverse process of the decoding method. Therefore, the specific method of the encoding method 410 can refer to the relevant content of the decoding method 310, and for ease of explanation, this specification will not describe it again.

[0260] 18 is a flowchart illustrating a decoding method 320 according to an embodiment of the present application. It should be understood that the decoding method 320 may be performed by a decoder, for example, in the decoding framework 200 shown in FIG. 15. For convenience of explanation, a decoder is taken as an example.

[0261] As shown in FIG. 18, the decoding method 320 may include some or all of the following: S321: The decoder decodes the bitstream to obtain the first transform coefficient of the current block. S322: The decoder performs a first transform on the first transform coefficients to obtain a residual block of the current block. S323: The decoder performs prediction on the current block based on the first intra prediction mode and the second intra prediction mode derived in the prediction mode derivation mode to obtain a prediction block of the current block. S324: The decoder obtains a reconstructed block of the current block based on the predicted block of the current block and the residual block of the current block.

[0262] In this embodiment, the decoder can perform a first transformation on a first transformation coefficient of the current block and predict the current block based on the first intra prediction mode and the second intra prediction mode derived in the prediction mode derivation mode, thereby improving the decompression efficiency of the current block.

[0263] Of course, in other alternative embodiments, a secondary transform may be introduced in addition to the first transform, and the method of matching the prediction mode derivation mode with the first transform may also be applied to the method of matching the prediction mode derivation mode with the secondary transform. For example, the secondary transform may be the LFNST described above, i.e., the method of matching the prediction mode derivation mode with the first transform may also be applied to the method of matching the prediction mode derivation mode with the LFNST. As another example, LFNST is a non-separable secondary transform, and in other alternative embodiments, the prediction mode derivation mode may also be applied to a separable secondary transform, i.e., the method of matching the prediction mode derivation mode with the first transform may also be applied to the matching of the prediction mode derivation mode with a non-separable secondary transform.

[0264] In some embodiments, the prediction mode derivation mode may include a DIMD mode or a TIMD mode.

[0265] In some embodiments, S322 is Decoding the bitstream to obtain a first flag and a second flag; If the first flag indicates that a prediction mode derivation mode is allowed to be used to perform prediction on the block in the current sequence and the second flag indicates that a first transform is allowed to be used to perform transform on the block in the current sequence, performing a first transform on the first transform coefficients to obtain a residual block of the current block; may include.

[0266] Illustratively, the current sequence is the image sequence that includes the current block.

[0267] Illustratively, the first flag is used to control whether the prediction mode derivation mode is used for the current sequence.

[0268] Exemplarily, when the value of the first flag is a first value, the first flag indicates that the prediction mode derivation mode is permitted to be used to perform prediction on a block in a current sequence. When the value of the first flag is a second value, the first flag indicates that the prediction mode derivation mode is not permitted to be used to perform prediction on a block in a current sequence. In one embodiment, the first value is 0 and the second value is 1, and in another embodiment, the first value is 1 and the second value is 0. Of course, the first value or the second value may be other values.

[0269] Illustratively, the second flag is used to control whether or not to use the first transform for the current sequence.

[0270] Illustratively, when the value of the second flag is a third value, the second flag indicates that the first transform is permitted to be used to perform a transform on a block in the current sequence. When the value of the second flag is a fourth value, the second flag indicates that the first transform is not permitted to be used to perform a transform on a block in the current sequence. In one embodiment, the third value is 0 and the fourth value is 1, and in another embodiment, the third value is 1 and the fourth value is 0. Of course, the third value or the fourth value may be other values.

[0271] For example, if the first flag is denoted as sps_timd / dimd_enabled_flag and the second flag is denoted as sps_mts_enabled_flag, when the values ​​of both sps_timd / dimd_enabled_flag and sps_mts_enabled_flag are both 1, a first transform is performed on the first transform coefficient to obtain a residual block of the current block.

[0272] For example, if the first flag indicates that it is not permitted to use the prediction mode derivation mode to perform prediction on a block in the current sequence and / or the second flag indicates that it is not permitted to use the first transform to perform a transform on a block in the current sequence, the first transform is not performed on the first transform coefficients, in other words, another type of transform can be performed directly on the first transform coefficients to obtain residual values ​​of the current block.

[0273] Of course, in other alternative embodiments, the first flag and / or the second flag may be replaced with a flag at a level such as a picture, a slice, a largest coding unit (LCU), a coding tree unit (CTU), a coding unit (CU), a prediction unit (PU), or a transform unit (TU). Alternatively, a flag at a level such as a picture, a slice, an LCU, a CTU, a CU, a PU, or a TU may be added regarding whether to use a prediction mode derivation mode or to use a first transform based on the first flag and the second flag. The embodiment of the present application is not limited thereto.

[0274] In some embodiments, S322 is If the first flag indicates that a prediction mode derivation mode is allowed to be used to perform prediction on a block in a current sequence, and the second flag indicates that a first transform is allowed to be used to perform transform on a block in a current sequence, decoding the bitstream to obtain a third flag; If the third flag indicates that both the prediction mode derivation mode and the first transform are allowed to be used for the block in the current sequence, performing a first transform on the first transform coefficients to obtain a residual block of the current block; may include.

[0275] Illustratively, the third flag is used to control whether both the prediction mode derivation mode and the first transform can be used.

[0276] Illustratively, when the value of the third flag is a fifth value, the third flag indicates that both the prediction mode derivation mode and the first transform are permitted to be used for the block in the current sequence. When the value of the third flag is a sixth value, the third flag indicates that both the prediction mode derivation mode and the first transform are not permitted to be used for the block in the current sequence. In one embodiment, the fifth value is 0 and the sixth value is 1, and in another embodiment, the fifth value is 1 and the sixth value is 0. Of course, the fifth value or the sixth value may be other values.

[0277] Exemplarily, the first flag is denoted as sps_timd / dimd_enabled_flag, the second flag is denoted as sps_mts_enabled_flag, and the third flag is denoted as sps_timd / dimd_lfnst_enabled_flag. If the values ​​of both sps_timd / dimd_enabled_flag and sps_mts_enabled_flag are 1, it is determined whether sps_timd / dimd_lfnst_enabled_flag is 1, and if sps_timd / dimd_lfnst_enabled_flag is 1, a first transformation is performed on the first transform coefficient to obtain a residual block of the current block.

[0278] Of course, in other alternative embodiments, the third flag may be replaced with a flag at a level such as a picture, a slice, a largest coding unit (LCU), a coding tree unit (CTU), a coding unit (CU), a prediction unit (PU), or a transform unit (TU). Alternatively, flag information at a level such as a picture, a slice, an LCU, a CTU, a CU, a PU, or a TU may be added regarding whether to use a prediction mode derivation mode or to use a first transform based on the third flag. The embodiment of the present application is not limited thereto.

[0279] In some embodiments, S322 is The method may include, when the first flag indicates that the prediction mode derivation mode is permitted to be used to perform prediction on a block in the current sequence and the second flag indicates that the first transform is permitted to be used to perform a transform on a block in the current sequence, performing a first transform on the first transform coefficients by the decoder when a height and / or width of the current block is greater than or equal to a first threshold to obtain a residual block of the current block.

[0280] For example, the first flag is denoted as sps_timd / dimd_enabled_flag, the second flag is denoted as sps_mts_enabled_flag, and the third flag is denoted as sps_timd / dimd_lfnst_enabled_flag. If the values ​​of both sps_timd / dimd_enabled_flag and sps_mts_enabled_flag are 1, the decoder determines the height and / or width of the current block, and if the height and / or width of the current block is greater than or equal to a first threshold, performs a first transform on the first transform coefficients to obtain a residual block of the current block.

[0281] Illustratively, the first threshold may be 4, 8, 16, 32, 64, or other value.

[0282] In some embodiments, prior to S322, the method 320 may further include determining, by the decoder, a set of transform kernel types to be used for the first transform.

[0283] In addition, in the prediction mode derivation mode, two kinds of prediction modes (i.e., a first intra prediction mode and a second intra prediction mode) are combined to predict the current block. A prediction block obtained by performing prediction on the current block using different intra prediction modes may have different texture characteristics. Therefore, when a prediction mode derivation mode is selected for the current block, the first intra prediction mode may cause the prediction block of the current block to show one texture characteristic, and the second intra prediction mode may cause the prediction block of the current block to show another texture characteristic. In other words, after predicting the current block, from a statistical point of view, the residual block of the current block also shows two texture characteristics. That is, the residual block of the current block does not necessarily conform to a rule that can be reflected in a certain prediction mode. Therefore, for the prediction mode derivation mode, the decoder needs to determine a transform kernel type set that is compatible with the characteristics before performing a first transform on the first transform coefficient. However, since the transform kernel type set used for the first transform is usually a transform kernel type set defined based on a single intra-prediction mode, it is necessary to further improve the related scheme for determining the transform kernel type set used for the first transform for the prediction mode derivation mode, and each embodiment thereof is illustratively described below.

[0284] In some embodiments, the transformation kernel type set used for the first transformation is the same as the transformation kernel type set that is compatible with the planar or DC mode.

[0285] Exemplarily, when the decoder side checks the prediction mode of the current block, if the prediction mode derivation mode is used for the current block, the decoder classifies the prediction mode derivation mode and the planar mode (or DC mode) into one type, and determines the transformation kernel type set used for the first transformation based on the planar mode (or DC mode). Alternatively, when the decoder side checks the prediction mode of the current block, if the prediction mode derivation mode is used for the current block, the encoder may return the planar mode (or DC mode) as the prediction mode of the current block, and based on this, the decoder may determine the transformation kernel type set compatible with the planar mode (or DC mode) as the transformation kernel type set used for the first transformation. Alternatively, when the decoder side checks the prediction mode of the current block, if the prediction mode derivation mode is used for the current block, the decoder may consider that the transformation kernel type set used for the first transformation for the current block may be the transformation kernel type set compatible with the planar mode (or DC mode).

[0286] In this embodiment, since both the planar mode (or DC mode) and the prediction mode derivation mode can represent various texture characteristics, by determining a transformation kernel type set compatible with the planar mode or DC mode as the transformation kernel type set used for the first transformation, not only can the current block be decoded based on the prediction mode derivation mode and the first transformation, but also it is ensured that the texture characteristics of the transformation kernel type set used for the first transformation are as similar as possible to the texture characteristics of the residual block of the current block, thereby improving decompression efficiency.

[0287] In some embodiments, the decoder determines a third intra-prediction mode based on the first intra-prediction mode and the second intra-prediction mode, and the transform kernel type set used for the first transform is the same as the transform kernel type set compatible with the third intra-prediction mode.

[0288] Illustratively, the decoder may determine a transform kernel type set compatible with the third intra-prediction mode as the transform kernel type set to be used for the first transform.

[0289] Exemplarily, when the decoder side checks the prediction mode of the current block, if the prediction mode derivation mode is used for the current block, the decoder may determine a third intra prediction mode based on the first intra prediction mode and the second intra prediction mode, and classify the prediction mode derivation mode and the third intra prediction mode into one type, and based on this, the decoder may determine a transform kernel type set used for the first transform based on the third intra prediction mode. Alternatively, when the decoder side checks the prediction mode of the current block, if the prediction mode derivation mode is used for the current block, the encoder may return the third intra prediction mode as the prediction mode of the current block, and based on this, the decoder may determine a transform kernel type set compatible with the third intra prediction mode as a transform kernel type set used for the first transform. Alternatively, when the decoder side checks the prediction mode of the current block, if the prediction mode derivation mode is used for the current block, the decoder may consider that the transform kernel type set used for the first transform of the current block may be a transform kernel type set compatible with the third intra prediction mode.

[0290] Of course, in other alternative embodiments, the decoder need not explicitly determine the third intra-prediction mode and then determine the transform kernel type set to be used for the first transform based on the third intra-prediction mode, but instead directly use the transform kernel type set that is compatible with the third intra-prediction mode as the transform kernel type set to be used for the first transform.

[0291] In some embodiments, the decoder determines a default prediction mode among the first intra prediction mode and the second intra prediction mode as the third intra prediction mode. Or, the decoder determines the third intra prediction mode based on a weight of the first intra prediction mode and / or a weight of the second intra prediction mode. Or, the decoder determines the third intra prediction mode based on a type of the first intra prediction mode and a type of the second intra prediction mode. Or, the decoder determines the third intra prediction mode based on a prediction angle of the first intra prediction mode and a prediction angle of the second intra prediction mode.

[0292] Exemplarily, when the decoder checks the prediction mode of the current block, if the prediction mode derivation mode is used for the current block, the transform kernel type set to be used for the first transform may be determined based on the first intra prediction mode and the second intra prediction mode when selecting the transform kernel type set to be used for the first transform. In one embodiment, the transform kernel type set may be determined using the first intra prediction mode in any case, i.e., the transform kernel type set compatible with the first intra prediction mode in any case is determined as the transform kernel type set to be used for the first transform; or the transform kernel type set may be determined using the second intra prediction mode in any case, i.e., the transform kernel type set compatible with the second intra prediction mode in any case is determined as the transform kernel type set to be used for the first transform. As another embodiment, the transform kernel type set may be determined using a first intra prediction mode in some cases, i.e., a transform kernel type set suitable for the first intra prediction mode may be determined as a transform kernel type set used for the first transformation; or the transform kernel type set may be determined using a second intra prediction mode in some cases, i.e., a transform kernel type set suitable for the second intra prediction mode may be determined as a transform kernel type set used for the first transformation; or the transform kernel type set may be determined using a planar mode or a DC mode in some cases, i.e., a transform kernel type set suitable for the planar mode or a DC mode may be determined as a transform kernel type set used for the first transformation. The determination using a certain prediction mode means that a prediction mode derivation mode and a certain prediction mode are classified into one type, and based on this, the decoder can determine a transform kernel type set used for the first transformation based on the certain prediction mode. Or, when the decoder checks the prediction mode of the current block, if a prediction mode derivation mode is used for the current block, a certain prediction mode may be returned, and based on this, the decoder can determine a transform kernel type set used for the first transformation based on the certain prediction mode.Alternatively, when the decoder checks the prediction mode of the current block, if a prediction mode derivation mode is used for the current block, the decoder may assume that the transform kernel type set used for the first transform for the current block may be a transform kernel type set that is compatible with a certain prediction mode.

[0293] In some embodiments, when the decoder determines the third intra prediction mode based on the weight of the first intra prediction mode and / or the weight of the second intra prediction mode, the decoder may determine the intra prediction mode with the greatest weight among the first intra prediction mode and the second intra prediction mode as the third intra prediction mode.

[0294] Illustratively, when the decoder determines the third intra prediction mode based on the weight of the first intra prediction mode and / or the weight of the second intra prediction mode, the priority of the intra prediction mode with a larger weight is higher than the priority of the intra prediction mode with a smaller weight. For example, if the weight of the first intra prediction mode is greater than the weight of the second intra prediction mode, the decoder determines the first intra prediction mode as the third intra prediction mode, and if the weight of the second intra prediction mode is greater than the weight of the first intra prediction mode, the decoder determines the second intra prediction mode as the third intra prediction mode.

[0295] In some embodiments, when the decoder determines the third intra prediction mode based on the type of the first intra prediction mode and the type of the second intra prediction mode, if the first intra prediction mode and the second intra prediction mode include an angular prediction mode and a non-angular prediction mode, the decoder determines the angular prediction mode as the third intra prediction mode.

[0296] Exemplarily, when the decoder determines the third intra prediction mode based on the type of the first intra prediction mode and the type of the second intra prediction mode, the priority of the angular prediction mode as the third intra prediction mode is higher than the priority of the non-angular prediction mode as the third intra prediction mode. For example, if the first intra prediction mode is an angular prediction mode and the second intra prediction mode is a non-angular prediction mode (e.g., a planar mode or a DC mode), the decoder determines the first intra prediction mode (i.e., the angular prediction mode) as the third intra prediction mode.

[0297] In some embodiments, when the absolute value of the difference between the prediction angle of the first intra prediction mode and the prediction angle of the second intra prediction mode is less than or equal to a second threshold, the intra prediction mode corresponding to the first prediction angle is determined as the third intra prediction mode. The first prediction angle is determined based on the prediction angle of the first intra prediction mode and the prediction angle of the second intra prediction mode. When the absolute value of the difference between the prediction angle of the first intra prediction mode and the prediction angle of the second intra prediction mode is greater than the second threshold, the planar mode or the DC mode is determined as the third intra prediction mode.

[0298] Exemplarily, when the decoder determines the third intra prediction mode based on the prediction angle of the first intra prediction mode and the prediction angle of the second intra prediction mode, if the prediction angle of the first intra prediction mode and the prediction angle of the second intra prediction mode are relatively close, the decoder may determine the first intra prediction mode, the second intra prediction mode, or an intra prediction mode whose prediction angle is between the prediction angle of the first intra prediction mode and the prediction angle of the second intra prediction mode as the third intra prediction mode. For example, if the difference between the prediction angle of the first intra prediction mode and the prediction angle of the second intra prediction mode is large, the decoder may determine the planar mode or the DC mode as the third intra prediction mode.

[0299] In some embodiments, the decoder determines a transform kernel type set that is compatible with the prediction mode derivation mode as the transform kernel type set to be used for the first transform.

[0300] Illustratively, the decoder may define a set of transform kernel types adapted or dedicated to the prediction mode derivation mode.

[0301] In some embodiments, the first transform is used to process the horizontal and vertical textures in the current block.

[0302] In some embodiments, S322 is performing a second transform on the first transform coefficients to obtain second transform coefficients; performing a first transform on the second transform coefficients to obtain a residual block of the current block; may include.

[0303] In some embodiments, the second transform is used to process the diagonal texture in the current block.

[0304] Having described above in detail the decoding method according to an embodiment of the present application from the decoder's perspective, the encoding method according to an embodiment of the present application will now be described from the encoder's perspective with reference to FIG.

[0305] 19 is a flowchart illustrating an encoding method 420 according to an embodiment of the present application. It should be understood that the encoding method 420 may be performed by an encoder, for example, in the encoding framework 100 shown in FIG. For convenience of explanation, an encoder is taken as an example.

[0306] As shown in FIG. 19, the encoding method 420 may include the following: S421: Prediction is performed on a current block based on the first intra prediction mode and the second intra prediction mode derived by the prediction mode derivation mode to obtain a predicted block of the current block. S422: Obtain a residual block of the current block based on the predicted block of the current block. S423: Perform a third transform on the residual block of the current block to obtain third transform coefficients of the current block. S424: Encode the third transform coefficient.

[0307] In some embodiments, the prediction mode derivation mode may include a DIMD mode or a TIMD mode.

[0308] In some embodiments, S424 may include encoding the first flag, the second flag, and the third transform coefficient. The first flag indicates that a prediction mode derivation mode is allowed to be used to perform a prediction on a block in the current sequence, and the second flag indicates that a third transform is allowed to be used to perform a transform on a block in the current sequence.

[0309] In some embodiments, S424 may include encoding the first flag, the second flag, the third transform coefficient, and the third flag. The third flag indicates that both the prediction mode derivation mode and the third transform are allowed to be used for blocks in the current sequence.

[0310] In some embodiments, S423 may include performing a third transform on the residual block of the current block when the height and / or width of the current block is greater than or equal to the first threshold to obtain third transform coefficients.

[0311] In some embodiments, prior to S423, the method 420 may further include determining a transformation kernel type set to be used for the third transformation.

[0312] In some embodiments, the transformation kernel type set used for the third transformation is the same as the transformation kernel type set that is compatible with the planar or DC mode.

[0313] In some embodiments, determining the transform kernel type set to be used for the third transform includes determining a third intra prediction mode based on the first intra prediction mode and the second intra prediction mode. The transform kernel type set used for the third transform is the same as the transform kernel type set compatible with the third intra-prediction mode.

[0314] In some embodiments, determining the third intra-prediction mode based on the first intra-prediction mode and the second intra-prediction mode comprises: determining a default prediction mode among the first intra prediction mode and the second intra prediction mode as the third intra prediction mode; or determining a third intra-prediction mode based on the weight of the first intra-prediction mode and / or the weight of the second intra-prediction mode; or determining a third intra-prediction mode based on the type of the first intra-prediction mode and the type of the second intra-prediction mode; or determining a third intra prediction mode based on a prediction angle of the first intra prediction mode and a prediction angle of the second intra prediction mode; Includes.

[0315] In some embodiments, determining the third intra-prediction mode based on the weight of the first intra-prediction mode and / or the weight of the second intra-prediction mode comprises: determining, from among the first intra prediction mode and the second intra prediction mode, the intra prediction mode having the largest weight as the third intra prediction mode.

[0316] In some embodiments, determining the third intra-prediction mode based on the type of the first intra-prediction mode and the type of the second intra-prediction mode comprises: and when the first intra prediction mode and the second intra prediction mode include an angular prediction mode and a non-angular prediction mode, determining the angular prediction mode as the third intra prediction mode.

[0317] In some embodiments, determining the third intra prediction mode based on a prediction angle of the first intra prediction mode and a prediction angle of the second intra prediction mode comprises: determining an intra prediction mode corresponding to the first prediction angle as a third intra prediction mode when an absolute value of a difference between a prediction angle of the first intra prediction mode and a prediction angle of the second intra prediction mode is equal to or less than a second threshold, where the first prediction angle is determined based on the prediction angle of the first intra prediction mode and the prediction angle of the second intra prediction mode; When an absolute value of a difference between a prediction angle of the first intra prediction mode and a prediction angle of the second intra prediction mode is greater than a second threshold, determining a planar mode or a DC mode as a third intra prediction mode; Includes.

[0318] In some embodiments, determining the transformation kernel type set to be used for the third transformation includes determining a transformation kernel type set that is compatible with the prediction mode derivation mode as the transformation kernel type set to be used for the third transformation.

[0319] In some embodiments, a third transform is used to process the horizontal and vertical textures in the current block.

[0320] In some embodiments, S424 is performing a fourth transform on the third transform coefficients to obtain fourth transform coefficients; encoding a fourth transform coefficient; and may include.

[0321] In some embodiments, a fourth transform is used to process the diagonal texture in the current block.

[0322] It should be understood that the first transform on the decoding side is the inverse transform of the third transform on the encoding side, and the second transform on the decoding side is the inverse transform of the fourth transform on the encoding side. For example, the third transform is the above-mentioned base transform or main transform, and the fourth transform is the above-mentioned secondary transform, and accordingly, the first transform can be the inverse transform (or inverse transform) of the base transform or main transform, and the second transform can be the inverse transform (or inverse transform) of the secondary transform. For example, the first transform can be the inverse (inverse) DCT2 type, the inverse (inverse) DCT8 type, or the inverse (inverse) DST7 type, etc., and the second transform can be the inverse (inverse) LFNST, and accordingly, the third transform can be the DCT2 type, the DCT8 type, or the DST7 type, etc., and the fourth transform can be the LFNST.

[0323] It should be noted that the encoding method can be understood as the reverse process of the decoding method. Therefore, for a specific scheme of the encoding method 420, please refer to the related content of the decoding method 320, and for convenience of explanation, it will not be described in detail in this application.

[0324] Although the preferred embodiments of the present application have been described in detail above with reference to the accompanying drawings, the present application is not limited to the detailed contents of the above embodiments, and various simple modifications can be made to the technical solutions of the present application within the scope of the technical ideas of the present application, and all such simple modifications fall within the scope of protection of the present application. For example, the specific technical features described in the above specific embodiments may be combined by any suitable means if there is no contradiction, and various possible combinations are not described again in this application to avoid unnecessary duplication. In addition, for example, any combination between various different embodiments of the present application should be considered as disclosed in the present application as long as it does not contradict the ideas of the present application. It should be understood that in various method embodiments of the present application, the magnitude of the sequence numbers of each of the above processes does not mean the order of execution. The order of execution of each process should be determined by its function and internal logic, and should not constitute any restriction on the implementation process of the embodiments of the present application.

[0325] The method embodiment of the present application has been described in detail above, and the apparatus embodiment of the present application will now be described in detail with reference to Figures 20 to 24.

[0326] FIG. 20 is a block diagram illustrating a decoder 510 according to an embodiment of the present application.

[0327] As shown in FIG. 20, the decoder 510 may include a decoding unit 511, a transform unit 512, a prediction unit 513, and a reconstruction unit 514. The decoding unit 511 is configured to decode a bitstream and obtain a first transform coefficient of a current block. The transform unit 512 is configured to perform a first transform on the first transform coefficient to obtain a residual block of the current block. The prediction unit 513 is configured to perform a prediction on the current block based on a first prediction mode and a second prediction mode corresponding to a geometric partition mode, and obtain a predicted block of the current block. The reconstruction unit 514 is configured to obtain a reconstructed block of the current block based on the predicted block of the current block and the residual block of the current block.

[0328] In some embodiments, the transform unit 512 is specifically configured to: decode a bitstream to obtain a first flag and a second flag; if the first flag indicates that a geometric partitioning mode is allowed to be used to perform prediction on a block in a current sequence, and the second flag indicates that a first transform is allowed to be used to perform a transform on a block in a current sequence, perform a first transform on a first transform coefficient to obtain a residual block.

[0329] In some embodiments, the transform unit 512 is specifically configured to: decode the bitstream and obtain a third flag if the first flag indicates that the geometric partition mode is permitted to be used to perform prediction on the block in the current sequence and the second flag indicates that the first transform is permitted to be used to perform transformation on the block in the current sequence; perform the first transform on the first transform coefficients and obtain a residual block if the third flag indicates that both the geometric partition mode and the first transform are permitted to be used on the block in the current sequence.

[0330] In some embodiments, the transform unit 512 is specifically configured to: if the first flag indicates that a geometric partitioning mode is allowed to be used to perform prediction on a block in a current sequence, and the second flag indicates that a first transform is allowed to be used to perform transformation on a block in a current sequence, when the height and / or width of the current block is equal to or greater than a first threshold, perform a first transform on the first transform coefficients to obtain a residual block.

[0331] In some embodiments, the transform unit 512 is configured to determine a transform kernel type set to be used for the first transform before being configured to perform a first transform on the first transform coefficients to obtain a residual block of the current block.

[0332] In some embodiments, the transformation kernel type set used for the first transformation is the same as the transformation kernel type set that is compatible with the planar or DC mode.

[0333] In some embodiments, the transform unit 512 is specifically configured to: determine a division line consisting of points where the weight of the first prediction mode and the weight of the second prediction mode are the same; determine an angle index of the division line; and determine a transform kernel type set used for the first transform based on the angle index.

[0334] In some embodiments, the transform unit 512 is specifically configured to: determine a weight derivation mode to be used for a geometric partitioning mode; determine a transform kernel type set that is compatible with an intra-prediction mode corresponding to the weight derivation mode as a transform kernel type set to be used for the first transform.

[0335] In some embodiments, the first prediction mode is a first intra prediction mode, and the second prediction mode is a second intra prediction mode. The transform unit 512 is specifically configured to determine a third intra prediction mode based on the first intra prediction mode and the second intra prediction mode. The transform kernel type set used for the first transform is the same as the transform kernel type set compatible with the third intra prediction mode.

[0336] In some embodiments, the conversion unit 512 is specifically configured to: determine a default prediction mode among the first intra prediction mode and the second intra prediction mode as the third intra prediction mode;or determine an intra prediction mode among the first intra prediction mode and the second intra prediction mode that corresponds to a weight derivation mode used for the geometric partition mode as the third intra prediction mode;or determine the third intra prediction mode based on the weight of the first intra prediction mode and / or the weight of the second intra prediction mode;or determine the third intra prediction mode based on the type of the first intra prediction mode and the type of the second intra prediction mode;or determine the third intra prediction mode based on the prediction angle of the first intra prediction mode and the prediction angle of the second intra prediction mode.

[0337] In some embodiments, the conversion unit 512 is specifically configured to determine the third intra-prediction mode based on the weight of the first intra-prediction mode or the weight of the second intra-prediction mode used at the default position.

[0338] In some embodiments, the conversion unit 512 is specifically configured to determine the intra prediction mode among the first intra prediction mode and the second intra prediction mode that has the largest weight at the default position as the third intra prediction mode.

[0339] In some embodiments, the default position is the center position.

[0340] In some embodiments, the conversion unit 512 is specifically configured to determine the angular prediction mode as the third intra prediction mode when the first intra prediction mode and the second intra prediction mode include an angular prediction mode and a non-angular prediction mode.

[0341] In some embodiments, the conversion unit 512 is specifically configured to perform the following: when the absolute value of the difference between the prediction angle of the first intra prediction mode and the prediction angle of the second intra prediction mode is less than or equal to a second threshold, determine the intra prediction mode corresponding to the first prediction angle as the third intra prediction mode, and the first prediction angle is determined according to the prediction angle of the first intra prediction mode and the prediction angle of the second intra prediction mode; when the absolute value of the difference between the prediction angle of the first intra prediction mode and the prediction angle of the second intra prediction mode is greater than the second threshold, determine the planar mode or the DC mode as the third intra prediction mode.

[0342] In some embodiments, the transformation unit 512 is specifically configured to determine a transformation kernel type set that is compatible with the geometric partitioning mode as the transformation kernel type set to be used for the first transformation.

[0343] In some embodiments, the first transform is used to process the horizontal and vertical textures in the current block.

[0344] In some embodiments, the transform unit 512 is specifically configured to perform the following: perform a second transform on the first transform coefficients to obtain second transform coefficients; perform a first transform on the second transform coefficients to obtain a residual block of the current block.

[0345] In some embodiments, the second transform is used to process the diagonal texture in the current block.

[0346] FIG. 21 is a block diagram illustrating an encoder 610 according to an embodiment of the present application.

[0347] As shown in FIG. 21, the encoder 610 may include a prediction unit 611, a residual unit 612, a transformation unit 613, and an encoding unit 614. The prediction unit 611 is configured to perform prediction on a current block based on a first prediction mode and a second prediction mode corresponding to a geometric partition mode, to obtain a prediction block of the current block. The residual unit 612 is configured to obtain a residual block of the current block based on the prediction block of the current block. The transformation unit 613 is configured to perform a third transformation on the residual block of the current block, to obtain a third transformation coefficient of the current block. The encoding unit 614 is configured to encode the third transformation coefficient.

[0348] In some embodiments, the encoding unit 614 is specifically configured to encode a first flag, a second flag, and a third transform coefficient, where the first flag indicates that a geometric partitioning mode is permitted to be used to perform prediction on a block in the current sequence, and the second flag indicates that a third transform is permitted to be used to perform transformation on a block in the current sequence.

[0349] In some embodiments, the encoding unit 614 is specifically configured to encode a first flag, a second flag, a third transform coefficient, and a third flag, the third flag indicating that both the geometric partition mode and the third transform are allowed to be used for a block in the current sequence.

[0350] In some embodiments, the transform unit 613 is specifically configured to perform a third transform on the residual block of the current block to obtain third transform coefficients when the height and / or width of the current block is greater than or equal to the first threshold.

[0351] In some embodiments, the transform unit 613 is further configured to determine a set of transform kernel types to be used for the third transform, prior to encoding the third transform coefficients.

[0352] In some embodiments, the transformation kernel type set used for the third transformation is the same as the transformation kernel type set that is compatible with the planar or DC mode.

[0353] In some embodiments, the transform unit 613 is specifically configured to: determine a division line consisting of points where the weight of the first prediction mode and the weight of the second prediction mode are the same; determine an angle index of the division line; and determine a transform kernel type set used for the third transform based on the angle index.

[0354] In some embodiments, the transform unit 613 is specifically configured to: determine a weight derivation mode to be used for the geometric partitioning mode; determine a transform kernel type set that is compatible with an intra-prediction mode corresponding to the weight derivation mode as a transform kernel type set to be used for the third transform.

[0355] In some embodiments, the first prediction mode is a first intra prediction mode, and the second prediction mode is a second intra prediction mode. The transform unit 613 is specifically configured to determine a third intra prediction mode based on the first intra prediction mode and the second intra prediction mode. The transform kernel type set used for the third transform is the same as the transform kernel type set compatible with the third intra prediction mode.

[0356] In some embodiments, the conversion unit 613 is specifically configured to: determine a default prediction mode among the first intra prediction mode and the second intra prediction mode as the third intra prediction mode;or determine an intra prediction mode among the first intra prediction mode and the second intra prediction mode that corresponds to a weight derivation mode used for the geometric partition mode as the third intra prediction mode;or determine the third intra prediction mode based on the weight of the first intra prediction mode and / or the weight of the second intra prediction mode;or determine the third intra prediction mode based on the type of the first intra prediction mode and the type of the second intra prediction mode;or determine the third intra prediction mode based on the prediction angle of the first intra prediction mode and the prediction angle of the second intra prediction mode.

[0357] In some embodiments, the conversion unit 613 is specifically configured to determine the third intra-prediction mode based on the weight of the first intra-prediction mode or the weight of the second intra-prediction mode used at the default position.

[0358] In some embodiments, the conversion unit 613 is specifically configured to determine the intra prediction mode among the first intra prediction mode and the second intra prediction mode that has the largest weight at the default position as the third intra prediction mode.

[0359] In some embodiments, the default position is the center position.

[0360] In some embodiments, the conversion unit 613 is specifically configured to determine the angular prediction mode as the third intra prediction mode when the first intra prediction mode and the second intra prediction mode include an angular prediction mode and a non-angular prediction mode.

[0361] In some embodiments, determining the third intra prediction mode based on a prediction angle of the first intra prediction mode and a prediction angle of the second intra prediction mode comprises: determining an intra prediction mode corresponding to the first prediction angle as a third intra prediction mode when an absolute value of a difference between a prediction angle of the first intra prediction mode and a prediction angle of the second intra prediction mode is equal to or less than a second threshold, where the first prediction angle is determined based on the prediction angle of the first intra prediction mode and the prediction angle of the second intra prediction mode; When an absolute value of a difference between a prediction angle of the first intra prediction mode and a prediction angle of the second intra prediction mode is greater than a second threshold, determining a planar mode or a DC mode as a third intra prediction mode; Includes.

[0362] In some embodiments, the transformation unit 613 is specifically configured to determine a transformation kernel type set that is compatible with the geometric partitioning mode as the transformation kernel type set to be used for the third transformation.

[0363] In some embodiments, a third transform is used to process the horizontal and vertical textures in the current block.

[0364] In some embodiments, the encoding unit 614 is specifically configured to perform the following: perform a fourth transform on the third transform coefficient to obtain a fourth transform coefficient; and encode the fourth transform coefficient.

[0365] In some embodiments, a fourth transform is used to process the diagonal texture in the current block.

[0366] FIG. 22 is a block diagram illustrating a decoder 520 according to an embodiment of the present application.

[0367] As shown in FIG. 20, the decoder 520 may include a decoding unit 521, a transform unit 522, a prediction unit 523, and a reconstruction unit 524. The decoding unit 521 is configured to decode a bitstream and obtain a first transform coefficient of a current block. The transform unit 522 is configured to perform a first transform on the first transform coefficient to obtain a residual block of the current block. The prediction unit 523 is configured to perform a prediction on the current block based on the first intra prediction mode and the second intra prediction mode derived in the prediction mode derivation mode to obtain a predicted block of the current block. The reconstruction unit 524 is configured to obtain a reconstructed block of the current block based on the predicted block of the current block and the residual block of the current block.

[0368] In some embodiments, the prediction mode derivation mode may include a DIMD mode or a TIMD mode.

[0369] In some embodiments, the transform unit 522 is specifically configured to: decode a bitstream to obtain a first flag and a second flag; if the first flag indicates that a prediction mode derivation mode is allowed to be used to perform prediction on a block in a current sequence, and the second flag indicates that a first transform is allowed to be used to perform transform on a block in a current sequence, perform a first transform on a first transform coefficient to obtain a residual block of a current block.

[0370] In some embodiments, the transform unit 522 is specifically configured to: decode the bitstream and obtain a third flag if the first flag indicates that the prediction mode derivation mode is allowed to be used to perform prediction on the block in the current sequence and the second flag indicates that the first transform is allowed to be used to perform transform on the block in the current sequence; perform a first transform on the first transform coefficients and obtain a residual block of the current block if the third flag indicates that both the prediction mode derivation mode and the first transform are allowed to be used on the block in the current sequence.

[0371] In some embodiments, the transform unit 522 is specifically configured to, when the first flag indicates that the prediction mode derivation mode is permitted to be used to perform prediction on a block in the current sequence and the second flag indicates that the first transform is permitted to be used to perform a transform on a block in the current sequence, perform a first transform on the first transform coefficients to obtain a residual block of the current block when the height and / or width of the current block is greater than or equal to a first threshold.

[0372] In some embodiments, before the transform unit 522 is configured to perform a first transform on the first transform coefficients to obtain a residual block of the current block, it is further configured to determine a transform kernel type set to be used for the first transform.

[0373] In some embodiments, the transformation kernel type set used for the first transformation is the same as the transformation kernel type set that is compatible with the planar or DC mode.

[0374] In some embodiments, the transform unit 522 is specifically configured to determine a third intra-prediction mode based on the first intra-prediction mode and the second intra-prediction mode, and the transform kernel type set used for the first transform is the same as the transform kernel type set compatible with the third intra-prediction mode.

[0375] In some embodiments, the conversion unit 522 is specifically configured to: determine a default prediction mode among the first intra prediction mode and the second intra prediction mode as the third intra prediction mode; or determine the third intra prediction mode based on a weight of the first intra prediction mode and / or a weight of the second intra prediction mode; or determine the third intra prediction mode based on a type of the first intra prediction mode and a type of the second intra prediction mode; or determine the third intra prediction mode based on a prediction angle of the first intra prediction mode and a prediction angle of the second intra prediction mode.

[0376] In some embodiments, the conversion unit 522 is specifically configured to determine the intra prediction mode with the greatest weight among the first intra prediction mode and the second intra prediction mode as the third intra prediction mode.

[0377] In some embodiments, the conversion unit 522 is specifically configured to determine the angular prediction mode as the third intra prediction mode when the first intra prediction mode and the second intra prediction mode include an angular prediction mode and a non-angular prediction mode.

[0378] In some embodiments, the conversion unit 522 is specifically configured to perform the following: when the absolute value of the difference between the prediction angle of the first intra prediction mode and the prediction angle of the second intra prediction mode is less than or equal to a second threshold, determine the intra prediction mode corresponding to the first prediction angle as the third intra prediction mode, and the first prediction angle is determined according to the prediction angle of the first intra prediction mode and the prediction angle of the second intra prediction mode; when the absolute value of the difference between the prediction angle of the first intra prediction mode and the prediction angle of the second intra prediction mode is greater than the second threshold, determine the planar mode or the DC mode as the third intra prediction mode.

[0379] In some embodiments, the transform unit 522 is specifically configured to determine a transform kernel type set that is compatible with the prediction mode derivation mode as the transform kernel type set to be used for the first transform.

[0380] In some embodiments, the first transform is used to process the horizontal and vertical textures in the current block.

[0381] In some embodiments, the transform unit 522 is specifically configured to perform the following: perform a second transform on the first transform coefficients to obtain second transform coefficients; perform a first transform on the second transform coefficients to obtain a residual block of the current block.

[0382] In some embodiments, the second transform is used to process the diagonal texture in the current block.

[0383] FIG. 23 is a block diagram illustrating an encoder 620 according to an embodiment of the present application.

[0384] As shown in FIG. 23, the encoder 620 may include a prediction unit 621, a residual unit 622, a transformation unit 623, and an encoding unit 624. The prediction unit 621 is configured to perform prediction on the current block based on the first intra prediction mode and the second intra prediction mode derived in the prediction mode derivation mode, to obtain a prediction block of the current block. The residual unit 622 is configured to obtain a residual block of the current block based on the prediction block of the current block. The transformation unit 623 is configured to perform a third transformation on the residual block of the current block, to obtain a third transformation coefficient of the current block. The encoding unit 624 is configured to encode the third transformation coefficient.

[0385] In some embodiments, the prediction mode derivation mode may include a DIMD mode or a TIMD mode.

[0386] In some embodiments, the encoding unit 624 is specifically configured to encode a first flag, a second flag, and a third transform coefficient, where the first flag indicates that a prediction mode derivation mode is allowed to be used to perform prediction on a block in a current sequence, and the second flag indicates that a third transform is allowed to be used to perform transformation on a block in a current sequence.

[0387] In some embodiments, the encoding unit 624 is specifically configured to encode the first flag, the second flag, the third transform coefficient, and a third flag, where the third flag indicates that both the prediction mode derivation mode and the third transform are allowed to be used for the block in the current sequence.

[0388] In some embodiments, the transform unit 623 is specifically configured to perform a third transform on the residual block of the current block to obtain third transform coefficients when the height and / or width of the current block is greater than or equal to the first threshold.

[0389] In some embodiments, the transform unit 623 is configured to perform a third transform on the residual block of the current block and determine a transform kernel type set to be used for the third transform before obtaining the third transform coefficients of the current block.

[0390] In some embodiments, the transformation kernel type set used for the third transformation is the same as the transformation kernel type set that is compatible with the planar or DC mode.

[0391] In some embodiments, the transform unit 623 is specifically configured to determine a third intra-prediction mode based on the first intra-prediction mode and the second intra-prediction mode, and the transform kernel type set used for the third transform is the same as the transform kernel type set compatible with the third intra-prediction mode.

[0392] In some embodiments, the conversion unit 623 is specifically configured to: determine a default prediction mode among the first intra prediction mode and the second intra prediction mode as the third intra prediction mode; or determine the third intra prediction mode based on a weight of the first intra prediction mode and / or a weight of the second intra prediction mode; or determine the third intra prediction mode based on a type of the first intra prediction mode and a type of the second intra prediction mode; or determine the third intra prediction mode based on a prediction angle of the first intra prediction mode and a prediction angle of the second intra prediction mode.

[0393] In some embodiments, the conversion unit 623 is specifically configured to determine the intra prediction mode with the greatest weight among the first intra prediction mode and the second intra prediction mode as the third intra prediction mode.

[0394] In some embodiments, the conversion unit 623 is specifically configured to determine the angular prediction mode as the third intra prediction mode when the first intra prediction mode and the second intra prediction mode include an angular prediction mode and a non-angular prediction mode.

[0395] In some embodiments, the conversion unit 623 is specifically configured to perform the following: when the absolute value of the difference between the prediction angle of the first intra prediction mode and the prediction angle of the second intra prediction mode is less than or equal to a second threshold, determine the intra prediction mode corresponding to the first prediction angle as the third intra prediction mode, and the first prediction angle is determined according to the prediction angle of the first intra prediction mode and the prediction angle of the second intra prediction mode; when the absolute value of the difference between the prediction angle of the first intra prediction mode and the prediction angle of the second intra prediction mode is greater than the second threshold, determine the planar mode or the DC mode as the third intra prediction mode.

[0396] In some embodiments, the transform unit 623 is specifically configured to determine a transform kernel type set that is compatible with the prediction mode derivation mode as the transform kernel type set to be used for the third transform.

[0397] In some embodiments, a third transform is used to process the horizontal and vertical textures in the current block.

[0398] In some embodiments, the encoding unit 624 is specifically configured to perform the following: perform a fourth transform on the third transform coefficient to obtain a fourth transform coefficient; and encode the fourth transform coefficient.

[0399] In some embodiments, a fourth transform is used to process the diagonal texture in the current block.

[0400] It should be noted that the device embodiment and the method embodiment may correspond to each other, and similar descriptions may refer to the method embodiment. In order to avoid repetition, the description is omitted here. Specifically, the decoder 510 shown in FIG. 20 may correspond to an entity that executes the method 310 in the embodiment of the present application. In addition, the above and other operations and / or functions of each unit in the decoder 510 are respectively used to realize the corresponding process in each method such as the method 310. Similarly, the encoder 610 shown in FIG. 21 may correspond to an entity that executes the method 410 in the embodiment of the present application. That is, the above and other operations and / or functions of each unit in the encoder 610 are respectively used to realize the corresponding process in each method such as the method 410. The decoder 520 shown in FIG. 22 may correspond to a body that executes the method 320 in the embodiment of the present application, and the above and other operations and / or functions of each unit in the decoder 520 are respectively used to realize the corresponding process in each method such as the method 320. Similarly, the encoder 620 shown in FIG. 23 may correspond to a main body that performs the method 420 in an embodiment of the present application, i.e., the above-mentioned and other operations and / or functions of each unit of the encoder 620 are each used to realize a corresponding process in each method, such as the method 420.

[0401] In addition, each unit in the decoder 510, the encoder 610, the decoder 520, or the encoder 620 according to the embodiment of the present application may be integrated into one or several other units, or some of the units may be further divided into several smaller units in terms of function, thereby realizing the same operation without affecting the realization of the technical effect of the embodiment of the present application. The above units are divided based on logic functions. In actual applications, the function of one unit may be realized by several units, or the functions of several units may be realized by one unit. In other embodiments of the present application, the decoder 510, the encoder 610, the decoder 520, or the encoder 620 may include other units, and in actual applications, these functions may be realized by the cooperation of other units, or may be realized by the cooperation of several units. According to another embodiment of the present application, a decoder 510, an encoder 610, a decoder 520, or an encoder 620 according to an embodiment of the present application can be constructed by executing a computer program (including program code) capable of executing each step of a corresponding method on a general-purpose computing device such as a general-purpose computer having processing elements and storage elements such as a central processing unit (CPU), a random access memory (RAM), and a read-only memory (ROM), thereby realizing an encoding method or a decoding method according to an embodiment of the present application. The computer program can be recorded in, for example, a computer-readable storage medium, and can be installed in an electronic device via the computer-readable storage medium and operated therein to realize a corresponding method in an embodiment of the present application.

[0402] In other words, the above-mentioned units may be realized in a hardware form, may be realized by instructions in a software form, or may be realized by a combination of hardware and software. Specifically, each step of the method embodiment in the embodiment of the present application can be completed by an integrated logic circuit of hardware in a processor and / or instructions in a software form. The steps of the method disclosed in the embodiment of the present application can be directly performed and completed by a hardware decoding processor, or can be performed and completed by a combination of hardware and software in a decoding processor. Alternatively, the software can be located in a mature storage medium in the technical field, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory. The processor reads the information in the memory and uses the hardware of the processor to complete the steps of the above-mentioned method embodiment.

[0403] FIG. 24 is a block diagram showing an electronic device 700 according to an embodiment of the present application.

[0404] As shown in FIG. 24, the electronic device 700 includes at least a processor 710 and a computer-readable storage medium 720. The processor 710 and the computer-readable storage medium 720 may be connected by a bus or other methods. The computer-readable storage medium 720 is used to store a computer program 721 including computer instructions. The processor 710 is used to execute the computer instructions stored in the computer-readable storage medium 720. The processor 710 is a calculation core and a control core of the electronic device 700, and is suitable for implementing one or more computer instructions, specifically, for implementing a process of a corresponding method or a corresponding function by loading and executing one or more computer instructions.

[0405] By way of example, the processor 710 may also be referred to as a central processing unit (CPU), which may include, but is not limited to, a general purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, or the like.

[0406] By way of example, the computer-readable storage medium 720 may be a high-speed RAM memory or a non-volatile memory, such as at least one magnetic disk storage device. Alternatively, the computer-readable storage medium 720 may be at least one computer-readable storage medium remote from the processor 710. Specifically, the computer-readable storage medium 720 includes, but is not limited to, a volatile memory and / or a non-volatile memory. The non-volatile memory may be a ROM, a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a RAM that functions as an external high-speed cache. By way of illustrative, but non-limiting example, various RAMs are available, such as static random access memory (static RAM, SRAM), dynamic random access memory (dynamic RAM, DRAM), synchronous dynamic random access memory (synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (double data rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (synch link DRAM, SLDRAM), and direct rambus random access memory (direct rambus RAM, DRRAM).

[0407] In one embodiment, the electronic device 700 may be an encoder or encoding framework according to an embodiment of the present application. The computer-readable storage medium 720 stores a first computer instruction. The processor 710 loads and executes the first computer instruction stored in the computer-readable storage medium 720 to realize a corresponding step in the encoding method according to an embodiment of the present application. In other words, the first computer instruction in the computer-readable storage medium 720 is loaded and executed by the processor 710 to perform the corresponding step. To avoid repetition, the description will be omitted here.

[0408] In one embodiment, the electronic device 700 may be a decoder or a decoding framework according to an embodiment of the present application. The computer-readable storage medium 720 stores second computer instructions. The processor 710 loads and executes the second computer instructions stored in the computer-readable storage medium 720 to realize the corresponding steps in the decoding method according to an embodiment of the present application. In other words, the second computer instructions in the computer-readable storage medium 720 are loaded and executed by the processor 710 to perform the corresponding steps. To avoid repetition, the description is omitted here.

[0409] According to another aspect of the present application, in an embodiment of the present application, there is provided a coding system, the coding system including an encoder and a decoder according to the above.

[0410] According to another aspect of the present application, in an embodiment of the present application, a computer-readable storage medium (Memory) is provided. The computer-readable storage medium is a storage device in the electronic device 700, and is used to store programs and data. For example, it may be a computer-readable storage medium 720. As can be understood, the computer-readable storage medium 720 here may include a built-in storage medium in the electronic device 700, and of course, may include an extended storage medium supported by the electronic device 700. The computer-readable storage medium provides a storage space in which the operating system of the electronic device 700 is stored. Furthermore, the storage space stores one or more computer instructions suitable for being loaded and executed by the processor 710, and these computer instructions may be one or more computer programs 721 (including program code).

[0411] According to another aspect of the present application, a computer program product or computer program is provided, which includes computer instructions, which are stored in a computer-readable storage medium, for example, the computer instructions may be a computer program 721. In this case, the data processing device 700 may be a computer, and the processor 710 reads the computer instructions from the computer-readable storage medium 720, and the processor 710 executes the computer instructions to cause the computer to perform the encoding method or the decoding method according to the various selectable schemes.

[0412] In other words, when implemented by software, all or part of the above embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed by a computer, all or part of the process described in the embodiments of the present application is executed, or all or part of the function described in the embodiments of the present application is realized. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optic, digital subscriber line (DSL), etc.) or wireless (e.g., infrared, radio, microwave, etc.).

[0413] It is obvious to those skilled in the art that the present application can be realized by electronic hardware or a combination of computer software and electronic hardware in combination with each exemplary unit and process step described in the embodiments disclosed herein. Whether these functions are performed by hardware or software is determined by the specific application of the technical solution and the design constraints. Those skilled in the art can realize the described functions using different methods for each specific application, but these realizations should not be considered as going beyond the scope of the present application.

[0414] Finally, the above content is only a specific embodiment of the present application, and the protection scope of the present application is not limited thereto. Any modifications or replacements that a person skilled in the art can easily think of within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be determined by the protection scope of the claims.

Claims

1. A decoding method comprising the steps of: Decoding the bitstream to obtain a first transform coefficient of a current block; performing a first transform on the first transform coefficients to obtain a residual block of the current block; performing prediction on the current block based on a first prediction mode and a second prediction mode corresponding to a geometric partition mode to obtain a prediction block of the current block; Obtaining a reconstructed block of the current block according to a predicted block of the current block and a residual block of the current block; Including, 4. A decoding method comprising:

2. The step of performing a first transform on the first transform coefficients to obtain a residual block of the current block includes: decoding the bitstream to obtain a first flag and a second flag; performing the first transform on the first transform coefficients to obtain the residual block if the first flag indicates that the geometric partitioning mode is permitted to be used to perform prediction on a block in a current sequence and the second flag indicates that the first transform is permitted to be used to perform a transform on a block in the current sequence; Including, 2. The method of claim 1 .

3. The step of performing a first transform on the first transform coefficients to obtain a residual block of the current block includes: decoding the bitstream to obtain a third flag if the first flag indicates that using the geometric partitioning mode to perform prediction on a block in the current sequence and the second flag indicates that using the first transform to perform transformation on a block in the current sequence is permitted; if the third flag indicates that both the geometric partitioning mode and the first transform are permitted to be used for a block in the current sequence, performing the first transform on the first transform coefficients to obtain the residual block; Including, 3. The method of claim 2 .

4. The step of performing a first transform on the first transform coefficients to obtain a residual block of the current block includes: performing the first transform on the first transform coefficients to obtain the residual block when the height and / or width of the current block is greater than or equal to a first threshold, if the first flag indicates that using the geometric partitioning mode is permitted to perform prediction on the block in the current sequence and the second flag indicates that using the first transform is permitted to perform transformation on the block in the current sequence.

3. The method of claim 2 .

5. Prior to performing a first transform on the first transform coefficients to obtain a residual block of the current block, the method further comprises: determining a set of transformation kernel types to be used for the first transformation; The method according to any one of claims 1 to 4.

6. the transformation kernel type set used for the first transformation is the same as the transformation kernel type set suitable for planar mode or DC mode; 6. The method of claim 5 .

7. Determining a set of transformation kernel types to be used for the first transformation, determining a division line consisting of points where the weight of the first prediction mode and the weight of the second prediction mode are equal; determining an angular index of said parting line; determining a set of transformation kernel types to be used for the first transformation based on the angle index; Including, 6. The method of claim 5 .

8. Determining a set of transformation kernel types to be used for the first transformation, determining a weight derivation mode to be used for said geometric partitioning mode; determining a transform kernel type set that is compatible with an intra-prediction mode corresponding to the weight derivation mode as a transform kernel type set to be used for the first transform; Including, 6. The method of claim 5 .

9. the first prediction mode is a first intra prediction mode, and the second prediction mode is a second intra prediction mode, and determining a set of transform kernel types to be used for the first transform includes: determining a third intra prediction mode based on the first intra prediction mode and the second intra prediction mode; a transform kernel type set used for the first transform is the same as a transform kernel type set compatible with the third intra-prediction mode; 6. The method of claim 5 .

10. Determining a third intra prediction mode based on the first intra prediction mode and the second intra prediction mode includes: determining a default prediction mode among the first intra prediction mode and the second intra prediction mode as the third intra prediction mode; or determining, as the third intra prediction mode, an intra prediction mode corresponding to a weight derivation mode used for the geometric partition mode, among the first intra prediction mode and the second intra prediction mode; or determining the third intra prediction mode based on a weight of the first intra prediction mode and / or a weight of the second intra prediction mode; or determining the third intra-prediction mode based on a type of the first intra-prediction mode and a type of the second intra-prediction mode; or determining the third intra prediction mode based on a prediction angle of the first intra prediction mode and a prediction angle of the second intra prediction mode; Including, 10. The method of claim 9.

11. Determining the third intra prediction mode based on a weight of the first intra prediction mode and / or a weight of the second intra prediction mode includes: determining the third intra prediction mode based on a weight of the first intra prediction mode or a weight of the second intra prediction mode used at a default position; 11. The method of claim 10.

12. Determining the third intra prediction mode based on a weight of the first intra prediction mode or a weight of the second intra prediction mode used at a default position, determining, as the third intra prediction mode, an intra prediction mode having a largest weight at the default position among the first intra prediction mode and the second intra prediction mode; 12. The method of claim 11 .

13. The default position is a center position.

13. The method according to claim 11 or 12.

14. Determining the third intra prediction mode based on the type of the first intra prediction mode and the type of the second intra prediction mode includes: and determining the angular prediction mode as the third intra prediction mode when the first intra prediction mode and the second intra prediction mode include an angular prediction mode and a non-angular prediction mode.

11. The method of claim 10.

15. Determining the third intra prediction mode based on a prediction angle of the first intra prediction mode and a prediction angle of the second intra prediction mode includes: determining, when an absolute value of a difference between a prediction angle of the first intra prediction mode and a prediction angle of the second intra prediction mode is equal to or smaller than a second threshold, an intra prediction mode corresponding to a first prediction angle as the third intra prediction mode, wherein the first prediction angle is determined based on the prediction angle of the first intra prediction mode and the prediction angle of the second intra prediction mode; determining a planar mode or a DC mode as the third intra prediction mode when an absolute value of a difference between a prediction angle of the first intra prediction mode and a prediction angle of the second intra prediction mode is greater than the second threshold; Including, 11. The method of claim 10.

16. Determining a set of transformation kernel types to be used for the first transformation, determining a transformation kernel type set that is compatible with the geometric partitioning mode as a transformation kernel type set to be used for the first transformation; 6. The method of claim 5 .

17. the first transform is used to process horizontal and vertical textures in the current block; 17. The method according to any one of claims 1 to 16.

18. The step of performing a first transform on the first transform coefficients to obtain a residual block of the current block includes: performing a second transform on the first transform coefficients to obtain second transform coefficients; performing the first transform on the second transform coefficients to obtain a residual block of the current block; Including, 18. The method according to any one of claims 1 to 17.

19. the second transform is used to process diagonal textures in the current block; 20. The method of claim 18 .

20. 1. A method of encoding, comprising: performing prediction on a current block according to a first prediction mode and a second prediction mode corresponding to a geometric partition mode to obtain a prediction block of the current block; obtaining a residual block of the current block according to a predicted block of the current block; performing a third transform on a residual block of the current block to obtain third transform coefficients of the current block; encoding the third transform coefficients; Including, 13. An encoding method comprising:

21. The encoding of the third transform coefficients includes: encoding the first flag, the second flag, and the third transform coefficient; the first flag indicates that the geometric partitioning mode is permitted to be used to perform prediction on a block in a current sequence, and the second flag indicates that the third transform is permitted to be used to perform a transform on a block in the current sequence.

21. The method of claim 20.

22. The encoding of the first flag, the second flag, and the third transform coefficient includes: encoding the first flag, the second flag, the third transform coefficient, and a third flag; the third flag indicates that both the geometric partitioning mode and the third transform are permitted to be used for blocks in the current sequence.

22. The method of claim 21 .

23. The above-mentioned, performing a third transform on a residual block of the current block to obtain a third transform coefficient of the current block, performing the third transform on a residual block of the current block when a height and / or a width of the current block is equal to or greater than a first threshold to obtain the third transform coefficients; 22. The method of claim 21 .

24. Before performing a third transform on the residual block of the current block to obtain a third transform coefficient of the current block, the method further comprises: determining a set of transformation kernel types to be used for the third transformation; 24. The method according to any one of claims 20 to 23.

25. the transformation kernel type set used for the third transformation is the same as the transformation kernel type set suitable for planar mode or DC mode; 25. The method of claim 24.

26. Determining a set of transformation kernel types to be used for the third transformation, determining a division line consisting of points where the weight of the first prediction mode and the weight of the second prediction mode are equal; determining an angular index of said parting line; determining a set of transformation kernel types to be used for the third transformation based on the angle index; Including, 25. The method of claim 24.

27. Determining a set of transformation kernel types to be used for the third transformation, determining a weight derivation mode to be used for said geometric partitioning mode; determining a transform kernel type set that is compatible with an intra-prediction mode corresponding to the weight derivation mode as a transform kernel type set to be used for the third transform; Including, 25. The method of claim 24.

28. the first prediction mode is a first intra prediction mode, the second prediction mode is a second intra prediction mode, and determining a set of transform kernel types to be used for the third transform includes: determining a third intra prediction mode based on the first intra prediction mode and the second intra prediction mode; a transform kernel type set used for the third transform is the same as a transform kernel type set compatible with the third intra-prediction mode; 25. The method of claim 24.

29. Determining a third intra prediction mode based on the first intra prediction mode and the second intra prediction mode includes: determining a default prediction mode among the first intra prediction mode and the second intra prediction mode as the third intra prediction mode; or determining, as the third intra prediction mode, an intra prediction mode corresponding to a weight derivation mode used for the geometric partition mode, among the first intra prediction mode and the second intra prediction mode; or determining the third intra prediction mode based on a weight of the first intra prediction mode and / or a weight of the second intra prediction mode; or determining the third intra-prediction mode based on a type of the first intra-prediction mode and a type of the second intra-prediction mode; or determining the third intra prediction mode based on a prediction angle of the first intra prediction mode and a prediction angle of the second intra prediction mode; Including, 29. The method of claim 28.

30. Determining the third intra prediction mode based on a weight of the first intra prediction mode and / or a weight of the second intra prediction mode includes: determining the third intra prediction mode based on a weight of the first intra prediction mode or a weight of the second intra prediction mode used at a default position; 30. The method of claim 29.

31. Determining the third intra prediction mode based on a weight of the first intra prediction mode or a weight of the second intra prediction mode used at a default position, determining, as the third intra prediction mode, an intra prediction mode having a largest weight at the default position among the first intra prediction mode and the second intra prediction mode; 31. The method of claim 30.

32. The default position is a center position.

32. The method according to claim 30 or 31.

33. Determining the third intra prediction mode based on the type of the first intra prediction mode and the type of the second intra prediction mode includes: and determining the angular prediction mode as the third intra prediction mode when the first intra prediction mode and the second intra prediction mode include an angular prediction mode and a non-angular prediction mode.

30. The method of claim 29.

34. Determining the third intra prediction mode based on a prediction angle of the first intra prediction mode and a prediction angle of the second intra prediction mode includes: determining, when an absolute value of a difference between a prediction angle of the first intra prediction mode and a prediction angle of the second intra prediction mode is equal to or smaller than a second threshold, an intra prediction mode corresponding to a first prediction angle as the third intra prediction mode, wherein the first prediction angle is determined based on the prediction angle of the first intra prediction mode and the prediction angle of the second intra prediction mode; determining a planar mode or a DC mode as the third intra prediction mode when an absolute value of a difference between a prediction angle of the first intra prediction mode and a prediction angle of the second intra prediction mode is greater than the second threshold; Including, 30. The method of claim 29.

35. Determining a set of transformation kernel types to be used for the third transformation, determining a transformation kernel type set that is compatible with the geometric partitioning mode as a transformation kernel type set to be used for the third transformation; 25. The method of claim 24.

36. the third transform is used to process horizontal and vertical textures in the current block; 36. The method according to any one of claims 20 to 35.

37. The encoding of the third transform coefficients includes: performing a fourth transform on the third transform coefficients to obtain fourth transform coefficients; encoding the fourth transform coefficient; Including, 37. The method according to any one of claims 20 to 36.

38. the fourth transform is used to process diagonal textures in the current block; 38. The method of claim 37.

39. A decoder comprising: a decoding unit for decoding the bitstream to obtain a first transform coefficient of a current block; a transform unit for performing a first transform on the first transform coefficients to obtain a residual block of the current block; a prediction unit for performing prediction on the current block according to a first prediction mode and a second prediction mode corresponding to a geometric partition mode, and obtaining a prediction block of the current block; a reconstruction unit for obtaining a reconstruction block of the current block according to a prediction block of the current block and a residual block of the current block; Including, A decoder characterized by:

40. An encoder comprising: a prediction unit for performing prediction on a current block according to a first prediction mode and a second prediction mode corresponding to a geometric partition mode, and obtaining a prediction block of the current block; a residual unit for obtaining a residual block of the current block according to a prediction block of the current block; a transform unit for performing a third transform on a residual block of the current block to obtain third transform coefficients of the current block; an encoding unit for encoding the third transform coefficients; Including, An encoder characterized by:

41. A decoding method comprising the steps of: Decoding the bitstream to obtain a first transform coefficient of a current block; performing a first transform on the first transform coefficients to obtain a residual block of the current block; performing prediction on the current block based on a first intra prediction mode and a second intra prediction mode derived by a prediction mode derivation mode to obtain a predicted block of the current block; Obtaining a reconstructed block of the current block according to a predicted block of the current block and a residual block of the current block; Including, 4. A decoding method comprising:

42. The prediction mode derivation mode includes a decoder-side intra mode derivation mode or a template-based intra mode derivation mode.

42. The method of claim 41 .

43. The step of performing a first transform on the first transform coefficients to obtain a residual block of the current block includes: decoding the bitstream to obtain a first flag and a second flag; performing the first transform on the first transform coefficients to obtain a residual block of the current block when the first flag indicates that using the prediction mode derivation mode is permitted to perform prediction on a block in a current sequence and the second flag indicates that using the first transform is permitted to perform a transform on the block in the current sequence; Including, 43. The method according to claim 41 or 42.

44. The step of performing a first transform on the first transform coefficients to obtain a residual block of the current block includes: If the first flag indicates that the prediction mode derivation mode is allowed to be used to perform a prediction on a block in the current sequence and the second flag indicates that the first transform is allowed to be used to perform a transform on a block in the current sequence, decoding the bitstream to obtain a third flag; performing the first transform on the first transform coefficients to obtain a residual block of the current block if the third flag indicates that both the prediction mode derivation mode and the first transform are allowed to be used for a block in the current sequence; and Including, 44. The method of claim 43.

45. The step of performing a first transform on the first transform coefficients to obtain a residual block of the current block includes: performing the first transform on the first transform coefficients to obtain a residual block of the current block when a height and / or a width of the current block is greater than or equal to a first threshold, if the first flag indicates that using the prediction mode derivation mode is permitted to perform prediction for a block in the current sequence and the second flag indicates that using the first transform is permitted to perform a transform for a block in the current sequence.

44. The method of claim 43.

46. Prior to performing a first transform on the first transform coefficients to obtain a residual block of the current block, the method further comprises: determining a set of transformation kernel types to be used for the first transformation; 46. ​​The method according to any one of claims 41 to 45.

47. the transformation kernel type set used for the first transformation is the same as the transformation kernel type set suitable for planar mode or DC mode; 47. The method of claim 46.

48. Determining a set of transformation kernel types to be used for the first transformation, determining a third intra prediction mode based on the first intra prediction mode and the second intra prediction mode; a transform kernel type set used for the first transform is the same as a transform kernel type set compatible with the third intra-prediction mode; 47. The method of claim 46.

49. Determining a third intra prediction mode based on the first intra prediction mode and the second intra prediction mode includes: determining a default prediction mode among the first intra prediction mode and the second intra prediction mode as the third intra prediction mode; or determining the third intra prediction mode based on a weight of the first intra prediction mode and / or a weight of the second intra prediction mode; or determining the third intra-prediction mode based on a type of the first intra-prediction mode and a type of the second intra-prediction mode; or determining the third intra prediction mode based on a prediction angle of the first intra prediction mode and a prediction angle of the second intra prediction mode; Including, 49. The method of claim 48.

50. Determining the third intra prediction mode based on a weight of the first intra prediction mode and / or a weight of the second intra prediction mode includes: determining an intra prediction mode having a largest weight among the first intra prediction mode and the second intra prediction mode as the third intra prediction mode; 50. The method of claim 49.

51. Determining the third intra prediction mode based on the type of the first intra prediction mode and the type of the second intra prediction mode includes: and determining the angular prediction mode as the third intra prediction mode when the first intra prediction mode and the second intra prediction mode include an angular prediction mode and a non-angular prediction mode.

50. The method of claim 49.

52. Determining the third intra prediction mode based on a prediction angle of the first intra prediction mode and a prediction angle of the second intra prediction mode includes: determining, when an absolute value of a difference between a prediction angle of the first intra prediction mode and a prediction angle of the second intra prediction mode is equal to or smaller than a second threshold, an intra prediction mode corresponding to a first prediction angle as the third intra prediction mode, wherein the first prediction angle is determined based on the prediction angle of the first intra prediction mode and the prediction angle of the second intra prediction mode; determining a planar mode or a DC mode as the third intra prediction mode when an absolute value of a difference between a prediction angle of the first intra prediction mode and a prediction angle of the second intra prediction mode is greater than the second threshold; Including, 50. The method of claim 49.

53. Determining a set of transformation kernel types to be used for the first transformation, determining a transformation kernel type set that is compatible with the prediction mode derivation mode as a transformation kernel type set to be used for the first transformation; 47. The method of claim 46.

54. the first transform is used to process horizontal and vertical textures in the current block; 54. The method according to any one of claims 41 to 53.

55. The step of performing a first transform on the first transform coefficients to obtain a residual block of the current block includes: performing a second transform on the first transform coefficients to obtain second transform coefficients; performing the first transform on the second transform coefficients to obtain a residual block of the current block; Including, 55. The method according to any one of claims 41 to 54.

56. the second transform is used to process diagonal textures in the current block; 56. The method of claim 55.

57. 1. A method of encoding, comprising: performing prediction on a current block based on the first intra prediction mode and the second intra prediction mode derived by the prediction mode derivation mode to obtain a predicted block of the current block; obtaining a residual block of the current block according to a predicted block of the current block; performing a third transform on a residual block of the current block to obtain third transform coefficients of the current block; encoding the third transform coefficients; Including, 13. An encoding method comprising:

58. The prediction mode derivation mode includes a decoder-side intra mode derivation mode or a template-based intra mode derivation mode.

58. The method of claim 57.

59. The encoding of the third transform coefficients includes: encoding the first flag, the second flag, and the third transform coefficient; the first flag indicates that the prediction mode derivation mode is permitted to be used to perform a prediction for a block in a current sequence, and the second flag indicates that the third transform is permitted to be used to perform a transform for a block in the current sequence.

59. The method of claim 57 or 58.

60. The encoding of the first flag, the second flag, and the third transform coefficient includes: encoding the first flag, the second flag, the third transform coefficient, and a third flag; the third flag indicates that both the prediction mode derivation mode and the third transform are permitted to be used for a block in the current sequence.

60. The method of claim 59.

61. The encoding of the third transform coefficients includes: performing the third transform on a residual block of the current block when a height and / or a width of the current block is equal to or greater than a first threshold to obtain the third transform coefficients; 61. The method according to any one of claims 57 to 60.

62. Before performing a third transform on the residual block of the current block to obtain a third transform coefficient of the current block, the method further comprises: determining a set of transformation kernel types to be used for the third transformation; 62. The method according to any one of claims 57 to 61.

63. the transformation kernel type set used for the third transformation is the same as the transformation kernel type set suitable for planar mode or DC mode; 63. The method of claim 62.

64. Determining a set of transformation kernel types to be used for the third transformation, determining a third intra prediction mode based on the first intra prediction mode and the second intra prediction mode; a transform kernel type set used for the third transform is the same as a transform kernel type set compatible with the third intra-prediction mode; 63. The method of claim 62.

65. Determining a third intra prediction mode based on the first intra prediction mode and the second intra prediction mode includes: determining a default prediction mode among the first intra prediction mode and the second intra prediction mode as the third intra prediction mode; or determining the third intra prediction mode based on a weight of the first intra prediction mode and / or a weight of the second intra prediction mode; or determining the third intra-prediction mode based on a type of the first intra-prediction mode and a type of the second intra-prediction mode; or determining the third intra prediction mode based on a prediction angle of the first intra prediction mode and a prediction angle of the second intra prediction mode; Including, 65. The method of claim 64.

66. Determining the third intra prediction mode based on a weight of the first intra prediction mode and / or a weight of the second intra prediction mode includes: determining an intra prediction mode having a largest weight among the first intra prediction mode and the second intra prediction mode as the third intra prediction mode; 66. The method of claim 65.

67. Determining the third intra prediction mode based on the type of the first intra prediction mode and the type of the second intra prediction mode includes: and determining the angular prediction mode as the third intra prediction mode when the first intra prediction mode and the second intra prediction mode include an angular prediction mode and a non-angular prediction mode.

66. The method of claim 65.

68. Determining the third intra prediction mode based on a prediction angle of the first intra prediction mode and a prediction angle of the second intra prediction mode includes: determining, when an absolute value of a difference between a prediction angle of the first intra prediction mode and a prediction angle of the second intra prediction mode is equal to or smaller than a second threshold, an intra prediction mode corresponding to a first prediction angle as the third intra prediction mode, wherein the first prediction angle is determined based on the prediction angle of the first intra prediction mode and the prediction angle of the second intra prediction mode; determining a planar mode or a DC mode as the third intra prediction mode when an absolute value of a difference between a prediction angle of the first intra prediction mode and a prediction angle of the second intra prediction mode is greater than the second threshold; Including, 66. The method of claim 65.

69. Determining a set of transformation kernel types to be used for the third transformation, determining a transformation kernel type set that is compatible with the prediction mode derivation mode as a transformation kernel type set to be used for the third transformation; 63. The method of claim 62.

70. the third transform is used to process horizontal and vertical textures in the current block; 70. The method according to any one of claims 57 to 69.

71. The encoding of the third transform coefficients includes: performing a fourth transform on the third transform coefficients to obtain fourth transform coefficients; encoding the fourth transform coefficient; Including, 71. The method according to any one of claims 57 to 70.

72. the fourth transform is used to process diagonal textures in the current block; 72. The method of claim 71 .

73. A decoder comprising: a decoding unit for decoding the bitstream to obtain a first transform coefficient of a current block; a transform unit for performing a first transform on the first transform coefficients to obtain a residual block of the current block; a prediction unit for performing prediction on the current block based on a first intra prediction mode and a second intra prediction mode derived by a prediction mode derivation mode to obtain a prediction block of the current block; a reconstruction unit for obtaining a reconstruction block of the current block according to a prediction block of the current block and a residual block of the current block; Including, A decoder characterized by:

74. An encoder comprising: a prediction unit for performing prediction on a current block based on a first intra prediction mode and a second intra prediction mode derived by a prediction mode derivation mode to obtain a prediction block of the current block; a residual unit for obtaining a residual block of the current block according to a prediction block of the current block; a transform unit for performing a third transform on a residual block of the current block to obtain third transform coefficients of the current block; an encoding unit for encoding the third transform coefficients; Including, An encoder characterized by:

75. An electronic device including a processor and a computer-readable storage medium, the processor is configured to execute a computer program; The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the method according to any one of claims 1 to 19, the method according to any one of claims 20 to 38, the method according to any one of claims 41 to 56, or the method according to any one of claims 57 to 72 is realized.

1. An electronic device comprising:

76. A computer-readable storage medium storing a computer program, The computer program causes a computer to carry out the method according to any one of claims 1 to 19, the method according to any one of claims 20 to 38, the method according to any one of claims 41 to 56, or the method according to any one of claims 57 to 72. A computer-readable storage medium comprising:

77. A computer program product comprising computer programs / instructions, When the computer program / instructions are executed by a processor, the method according to any one of claims 1 to 19, the method according to any one of claims 20 to 38, the method according to any one of claims 41 to 56 or the method according to any one of claims 57 to 72 is realized.

23. A computer program product comprising:

78. A bitstream comprising: The bitstream is a bitstream in the method according to any one of claims 1 to 19 or in the method according to any one of claims 41 to 56, or the bitstream is a bitstream generated by the method according to any one of claims 20 to 38 or in the method according to any one of claims 57 to 72. A bitstream comprising:

Citation Information

Patent Citations

  • Moving image decoding device and moving image coding device

    JP2025010550A

  • Encoding device, decoding device, encoding method, and decoding method

    WO2020009086A1