Transformation method, encoder, decoder and storage medium

By directly selecting a transformation core for the sub-partition of the ISP partition in H.266/VVC, the complexity problem of transformation core selection is solved and the coding efficiency is improved.

CN114556943BActive Publication Date: 2024-08-23GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202080071780.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-04-03
Publication Date
2024-08-23
Estimated Expiration
2040-04-03

AI Technical Summary

Technical Problem

The transformation core selection process in H.266/VVC is complex, resulting in reduced coding efficiency. Especially when LFNST is not used, the transformation core needs to be selected based on the size of the sub-partition, which increases the computational complexity.

Method used

During the transformation process of the ISP partition, the transformation kernel is directly selected once for the sub-partition, and the selection is no longer based on the size of the sub-partition. DCT-2 or other preset transformation kernels are uniformly used, which simplifies the selection process of the transformation kernel.

Benefits of technology

The selection process of the transformation kernel is simplified, the complexity of the transformation process is reduced, and the encoding and decoding efficiency is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114556943B
    Figure CN114556943B
Patent Text Reader

Abstract

A transformation method, an encoder, a decoder and a storage medium, wherein the encoder determines the ISP mode parameters of the current block; when the ISP mode parameters indicate that the current block uses the ISP mode to determine the intra-frame prediction value of the current block, the encoder determines the sub-partition of the current block; determines the residual value of the sub-partition; when the sub-partition uses a single transformation, the decoder determines the single transformation kernel used by the sub-partition; and uses the single transformation kernel to transform the residual value. The decoder parses a bit stream to determine the ISP mode parameters of the current block; when the ISP mode parameters indicate that the current block uses the ISP mode to determine the intra-frame prediction value of the current block, the encoder determines the sub-partition of the current block; parses the bit stream to determine the transformation coefficient matrix of the sub-partition; determines the single transformation kernel used by the sub-partition; and uses the single transformation kernel to transform the transformation coefficient matrix.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of image processing technology, and in particular to a transformation method, an encoder, a decoder, and a storage medium. Background Art

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

[0003] At present, the simplified secondary transform (Reduced Second Transform, RST) technology has been accepted in H.266 / VVC and renamed as Low-Frequency Non-Separable Transform (LFNST) technology. Furthermore, the transformation part in VVC includes primary transform and secondary transform. The primary transform supports multiple transform kernels, called the Multiple Transform Set (MTS) technology, and the secondary transform is LFNST, in which the secondary transform indicates whether to use the secondary transform and which lfnst transform kernel to use through lfnst_idx. When determining the transform kernel of the primary transform, when LFNST is not used, it is necessary to select the primary transform kernel based on the size of the transform block. Since the selection process of the transform kernel is more cumbersome, the complexity of the transform process is increased, thereby reducing the coding efficiency. Summary of the invention

[0004] The embodiments of the present application provide a transformation method, an encoder, a decoder, and a storage medium, which can simplify the transformation kernel selection process, reduce the complexity of the transformation process, and effectively improve the encoding and decoding efficiency.

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

[0006] In a first aspect, an embodiment of the present application provides a transformation method, which is applied to an encoder, and the method includes:

[0007] Determine the ISP mode parameters of the current block;

[0008] When the ISP mode parameter indicates that the current block uses the ISP mode to determine the intra prediction value of the current block, determining a sub-partition of the current block;

[0009] determining a residual value for the subpartition;

[0010] When the sub-partition uses a primary transformation, determining a primary transformation kernel used by the sub-partition;

[0011] The residual value is transformed using the primary transformation kernel.

[0012] In a second aspect, an embodiment of the present application provides a transformation method, which is applied to a decoder, and the method includes:

[0013] Parse the bitstream and determine the ISP mode parameters of the current block;

[0014] When the ISP mode parameter indicates that the current block uses the ISP mode to determine the intra prediction value of the current block, determining a sub-partition of the current block;

[0015] Parsing a bitstream to determine a transform coefficient matrix of the sub-partition;

[0016] Determining a primary transformation kernel used by the sub-partition;

[0017] The transformation coefficient matrix is ​​transformed using the primary transformation kernel.

[0018] In a third aspect, an embodiment of the present application provides an encoder, the encoder comprising: a first determining part, a first transforming part,

[0019] The first determining part is configured to determine an ISP mode parameter of the current block; and when the ISP mode parameter indicates that the current block uses the ISP mode to determine the intra prediction value of the current block, determine the sub-partition of the current block; and determine the residual value of the sub-partition; and when the sub-partition uses a single transformation, determine the single transformation kernel used by the sub-partition;

[0020] The first transform part is configured to use the primary transform kernel to perform transform processing on the residual value.

[0021] In a fourth aspect, an embodiment of the present application provides an encoder, comprising a first processor and a first memory storing instructions executable by the first processor, wherein when the instructions are executed, the first processor implements the transformation method as described above.

[0022] In a fifth aspect, an embodiment of the present application provides a decoder, the decoder comprising: a parsing part, a second determining part, a second transforming part,

[0023] The parsing part is configured to parse the bitstream and determine the ISP mode parameters of the current block;

[0024] The second determining part is configured to determine a sub-partition of the current block when the ISP mode parameter indicates that the current block uses the ISP mode to determine the intra-frame prediction value of the current block;

[0025] The parsing part is further configured to parse the bitstream to determine the transform coefficient matrix of the sub-partition;

[0026] The second determining part is further configured to determine a primary transformation core used by the sub-partition;

[0027] The second transformation part is configured to use the primary transformation kernel to perform transformation processing on the transformation coefficient matrix.

[0028] In a sixth aspect, an embodiment of the present application provides a decoder, comprising a second processor and a second memory storing instructions executable by the second processor, wherein when the instructions are executed, the second processor implements the transformation method as described above.

[0029] In a seventh aspect, an embodiment of the present application provides a computer storage medium, wherein the computer storage medium stores a computer program, and when the computer program is executed by a first processor and a second processor, the transformation method as described above is implemented.

[0030] The embodiment of the present application provides a transformation method, an encoder, a decoder and a storage medium, wherein the encoder determines the ISP mode parameters of the current block; when the ISP mode parameters indicate that the current block uses the ISP mode to determine the intra-frame prediction value of the current block, the sub-partition of the current block is determined; the residual value of the sub-partition is determined; when the sub-partition uses a single transformation, the single transformation kernel used by the sub-partition is determined; and the residual value is transformed using the single transformation kernel. The decoder parses the bitstream to determine the ISP mode parameters of the current block; when the ISP mode parameters indicate that the current block uses the ISP mode to determine the intra-frame prediction value of the current block, the sub-partition of the current block is determined; the bitstream is parsed to determine the transformation coefficient matrix of the sub-partition; the single transformation kernel used by the sub-partition is determined; and the transformation coefficient matrix is ​​transformed using the single transformation kernel. It can be seen that in the embodiment of the present application, for the transformation of the ISP partition, when the sub-partition after the current block is divided does not use a secondary transformation and only uses a single transformation, the sub-partition uses a single transformation kernel of a single transformation, which is no longer determined by the size of the sub-partition, that is, the single transformation kernel is no longer selected according to the height and width of the sub-partition, but the single transformation kernel is directly set. This can simplify the transformation kernel selection process, reduce the complexity of the transformation process, and effectively improve the encoding and decoding efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 This is a schematic diagram of the application of LFNST technology;

[0032] Figure 2 This is a flowchart of the specific process of LFNST;

[0033] Figure 3 Schematic diagram of coding block division Figure 1 ;

[0034] Figure 4 Schematic diagram of coding block division Figure 2 ;

[0035] Figure 5 Schematic diagram of coding block division Figure 3 ;

[0036] Figure 6 Schematic diagram of coding block division Figure 4 ;

[0037] Figure 7 Select the schematic diagram for ISP mode change;

[0038] Figure 8 This is a schematic diagram of the implementation of a reverse transformation. Figure 1 ;

[0039] Fig. 9 This is a schematic diagram of the implementation of a reverse transformation. Figure 2 ;

[0040] Fig.10 The block diagram of the video coding system is as follows;

[0041] Fig.11 It is a block diagram of the video decoding system;

[0042] Fig.12 The following is a schematic diagram of the implementation process of the transformation method. Figure 1 ;

[0043] Fig.13 The following is a schematic diagram of the implementation process of the transformation method. Figure 2 ;

[0044] Fig.14 A schematic diagram of the transformation kernel determination process;

[0045] Fig.15 The following is a schematic diagram of the implementation process of the transformation method. Figure 3 ;

[0046] Fig.16 The following is a schematic diagram of the implementation process of the transformation method. Figure 4 ;

[0047] Fig.17The following is a schematic diagram of the implementation process of the transformation method. Figure 5 ;

[0048] Fig.18 The following is a schematic diagram of the implementation process of the transformation method. Figure 6 ;

[0049] Fig.19 The following is a schematic diagram of the implementation process of the transformation method. Figure 7 ;

[0050] Fig. 20 The structure of the encoder is shown in Figure 2. Figure 1 ;

[0051] Fig.21 The structure of the encoder is shown in Figure 2. Figure 2

[0052] Fig. 22 The structure of the decoder is shown in Figure 2. Figure 1 ;

[0053] Fig.23 The structure of the decoder is shown in Figure 2. Figure 2 . DETAILED DESCRIPTION

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

[0055] H.266 / VVC accepted the RST technology proposed by LGE in JVET-N0193 and renamed it LFNST technology. In subsequent meetings, as the standard was formulated, the LFNST technology was continuously optimized. The following is a description of the current technical solutions for the LFNST technology.

[0056] The transformation part in VVC includes primary transformation and secondary transformation. The primary transformation supports multiple transformation cores, which is called Multiple Transform Set (MTS) technology, and the secondary transformation is LFNST, where the secondary transformation indicates whether to use the secondary transformation and which lfnst transformation core to use through lfnst_idx.

[0057] Figure 1 For the application diagram of LFNST technology, see Figure 1 , which shows a schematic diagram of the application location of a LFNST technology provided by a related technical solution. Figure 1As shown, in the intra prediction mode, for the encoder side, the LFNST technology is applied between the forward primary transform unit 11 and the quantization unit 12. For the decoder side, the LFNST technology is applied between the inverse quantization unit 13 and the inverse primary transform unit 14.

[0058] Specifically, on the encoder side, first, the data, such as the prediction residual (which can be represented by residual), is subjected to a first transformation (which can be called "Core Transform" or "primary transform" or "main transform") through the positive primary transform unit 11 to obtain a transform coefficient matrix after the first transformation; then, an LFNST transform (which can be called "Secondary Transform" or "secondary transform") is performed on the coefficients in the transform coefficient matrix to obtain a LFNST transform coefficient matrix, and finally, the LFNST transform coefficient matrix is ​​quantized through the quantization unit 12, and the final quantized value is written into the bitstream.

[0059] On the decoder side, by parsing the bitstream, the quantized value of the LFNST transform coefficient matrix can be obtained, and the quantized value is dequantized by the dequantization unit 13 (which can be called "Scaling") to obtain the recovered value of the LFNST transform coefficient matrix, and the recovered value is subjected to an inverse LFNST transform to obtain the coefficient matrix; then the coefficient matrix is ​​subjected to an inverse transform corresponding to the "CoreTransform" on the encoder side by the inverse transform unit 14, and finally the recovered value of the residual is obtained. It should be noted that the standard only defines the "inverse transform" operation on the decoder side, so the "reverse LFNST transform" is also referred to as the "LFNST transform" in the standard; in order to facilitate the distinction from the transform on the encoder side, the encoder side "LFNST transform" in the embodiment of the present application may be referred to as the "forward LFNST transform", and the decoder side "LFNST transform" may be referred to as the "reverse LFNST transform".

[0060] That is to say, on the encoder side, the prediction residual of the current transform block can obtain the primary transform coefficient through the positive primary transform, and then some of the primary transform coefficients are transformed secondary through matrix multiplication to obtain fewer and more concentrated secondary transform coefficients, which are then quantized; on the decoder side, after parsing the quantization value, it is inverse quantized, the inverse quantized coefficients are inversely transformed secondary through matrix multiplication, and then the coefficients after the inverse secondary transform are inversely transformed primary to restore the prediction residual.

[0061] In LFNST technology, the LFNST transformation process can mainly include the following steps: configuring core parameters, intra-frame prediction mode mapping, selecting transformation matrix, calculating matrix multiplication, and constructing inverse primary transformation coefficient matrix; after these steps are processed, the LFNST transformation is completed. However, in the step of selecting the transformation matrix, it is necessary to first select a transformation set. Since the transformation matrix is ​​related to the directional characteristics of the prediction mode, the transformation set is currently selected based on the intra-frame prediction mode. Among them, for the traditional intra-frame prediction mode, the value of the intra-frame prediction mode indicator can be determined according to the number of the traditional intra-frame prediction mode, and then the transform set index number can be determined according to the value of the intra-frame prediction mode indicator.

[0062] Specifically, Figure 2 This is a flowchart of the specific process of LFNST, such as Figure 2 As shown, the specific process of LFNST can be divided into five steps, including configuring core parameters, intra-frame prediction mode mapping, selecting transformation matrix, calculating matrix multiplication and constructing a transformation coefficient matrix. Among them, for intra-frame prediction mode mapping, this step is used to determine the value of predModeIntra, which can mainly include: non-traditional intra-frame prediction mode mapping and wide-angle mapping; for selecting transformation matrix, this step is used to select transformation set and transformation matrix, which can mainly include: selecting transformation set, selecting transformation matrix group and selecting transformation matrix size.

[0063] H.266 / VVC accepted the Intra Sub-Partitions (ISP) coding mode proposed by HHI in JVET-M0102. The ISP coding mode is an improved version of the Line-Based Intra coding mode, which solves the hardware-related problems in the previous algorithm design.

[0064] Specifically, ISP technology is mainly aimed at brightness coding blocks, and the minimum size of the applied coding blocks is 8x4 and 4x8, and the maximum size is 64x64; ISP is disabled when using multi-reference row mode.

[0065] When performing ISP division, for coding blocks of sizes 8x4 and 4x8, ISP divides them into 2 sub-partitions, and for coding blocks of other sizes to which ISP is applied, ISP divides them into 4 sub-partitions. Table 1 is a table of the number of partitions. As shown in Table 1, when dividing according to the size of the coding block, the coding block of size 4x4 is not divided, the coding blocks of sizes 8x4 and 4x8 can be divided into 2 sub-partitions, and the remaining coding blocks of other sizes can be divided into 4 sub-partitions.

[0066] Encoding block size Number of sub-partitions 4x4 No division 4x8 and 8x4 2 Other sizes 4

[0067] Figure 3 Schematic diagram of coding block division Figure 1 , Figure 4 Schematic diagram of coding block division Figure 2 ,like Figure 3 and Figure 4 As shown, for coding blocks of size (WxH) of 8x4 and 4x8, two sub-partitions of size Wx(H / 2) can be obtained after horizontal division; and two sub-partitions of size (W / 2)xH can be obtained after vertical division.

[0068] Figure 5 Schematic diagram of coding block division Figure 3 , Figure 6 Schematic diagram of coding block division Figure 4 ,like Figure 5 and Figure 6 As shown, for coding blocks of sizes other than 4x4, 8x4 and 4x8, 4 sub-partitions of size Wx(H / 4) can be obtained after horizontal division; and 4 sub-partitions of size (W / 4)xH can be obtained after vertical division.

[0069] When predicting the sub-partitions after ISP division, the reconstructed signal of the previous sub-partition (except the first sub-partition) can be referred to. Specifically, for a sub-partition, the reconstructed signal of the sub-partition can be obtained by adding the residual signal to the prediction signal, wherein the residual signal can be obtained by entropy decoding, inverse quantization, and inverse transformation. In addition, the first sub-partition to be processed is the sub-partition containing the upper left corner pixel in the CU, and then each sub-partition is processed downward (horizontal division) or right (vertical division). All sub-partitions of the ISP share the same intra-frame prediction mode, and the prediction modes used include direct current (DC) mode, planar (PLANAR) mode, and angle mode.

[0070] Furthermore, ISP also limits the size of the sub-partition when predicting. Specifically, the minimum prediction width of the sub-partition when predicting is limited to 4. Therefore, for the sub-partition whose width in the transform size is less than 4, the width in the prediction size is 4, that is, when predicting the sub-partition after ISP division, the width in prediction and the width in transform are not necessarily the same. Table 2 is ISP partition prediction size restriction table 1. As shown in Table 2, for a partition with a size of 4x8, after being vertically divided into 2 sub-partitions, the transform size of each sub-partition is 2x8, and the size of the sub-partition used for prediction is 4x8; for a partition with a size of 4xN (N>8), after being vertically divided into 4 sub-partitions, the transform size of each sub-partition is 1xN, and the size of the sub-partition used for prediction is 4xN; for a partition with a size of 8xN (N>8), after being vertically divided into 4 sub-partitions, the transform size of each sub-partition is 2xN, and the size of the sub-partition used for prediction is 4xN.

[0071] Partition (WxH) Estimated size of subpartitions Changing size of subpartitions 4x8 4x8 2x8 4xN(N>8) 4xN 1xN 8xN(N>4) 4xN 2xN

[0072] The figure shows the change size and predicted size. Figure 1 , using ISP coding and vertically divided into 8xN (N>4) coding blocks, the prediction size is 4xN, and the transformation size is 2xN. The figure shows the change size and prediction size Figure 2 , using ISP coding and vertically divided 4xN (N>8) coding blocks, the prediction size is 4xN, and the size of the sub-transform block is 1xN.

[0073] For the transformation of ISP partitions, when transforming the sub-partitions after ISP division, if the secondary transformation LFNST is used, the transformation kernel of the primary transformation is DCT-2; if the secondary transformation LFNST is not used, when the primary transformation is used, the primary transformation type is mainly determined by the size of the current sub-partition, that is, the size of the sub-partition can determine the transformation kernel of the primary transformation. Specifically, if the width of the sub-partition is greater than or equal to 4 and less than or equal to 16, then it can be determined that the primary transformation in the horizontal direction uses DST-7 transformation, otherwise it uses DCT-2 transformation, that is, trTypeHor=(nTbW>=4&&nTbW<=16)? DST-7: DCT-2; if the height of the current partition is greater than or equal to 4 and less than or equal to 16, then it can be determined that the primary transformation in the vertical direction uses DST-7 transformation, otherwise it uses DCT-2 transformation, that is, trTypeVer=(nTbH>=4&&nTbH<=16)? DST-7: DCT-2.

[0074] If the sub-partition after ISP division satisfies that the width and height are both greater than or equal to 4, the LFNST secondary transform can also be used. Moreover, if the sub-partition uses the secondary transform LFNST, the transform type is no longer selected according to the size of the sub-partition, but the transform kernel is directly used for DCT-2 transform processing.

[0075] Figure 7 Select the schematic diagram for ISP mode change, such as Figure 7 As shown in FIG. 1 , in VVC, if the value of lfnst_idx is 0, that is, the secondary transform LFNST is not used, then when the primary transform is used, the transform kernel of the primary transform can be determined according to the size of the sub-partition; if the value of lfnstidx is 1 or 2, that is, the secondary transform LFNST is used, then the transform kernel of the primary transform is DCT-2. In other words, the mechanism of ISP mode transform selection is to determine the transform kernel based on the size of the sub-partition when the secondary transform LFNST is not used.

[0076] On the other hand, at the decoding end, the process of inverse transformation of the ISP sub-partition is described in detail below. The inverse transformation process of the ISP mode in VVC8draft is described in detail below.

[0077] The input of the inverse primary transform includes the position of the current coding block (xTbY, yTbY), the color component cIdx of the current coding block, the prediction mode predMode of the current coding block, the width nTbW of the current coding block, the height nTbH of the current coding block, and the inverse primary transform coefficient matrix d[x][y] obtained by scanning after the inverse secondary transform.

[0078] Output of the inverse primary transform: residual coefficient res[x][y] obtained by the inverse primary transform, where x=0…nTbW-1, y=0…nTbH-1.

[0079] Further, Figure 8 This is a schematic diagram of the implementation of a reverse transformation. Figure 1 ,like Figure 8 As shown, the process of reverse primary transformation of ISP mode mainly includes the following parts: configuring core parameters; selecting transformation type; and performing reverse transformation.

[0080] When configuring core parameters, the variable intra_subpartitions_mode_flag[x0][y0] determines whether to use the ISP mode. Specifically, if intra_subpartitions_mode_flag[x0][y0] is 1, it can be determined that the ISP mode is used, and the current coding unit is divided into NumIntraSubPartitions[x0][y0] coding blocks; if intra_subpartitions_mode_flag[x0][y0] is equal to 0, it can be determined that the ISP mode is not used, which means that the current coding unit is not divided.

[0081] ISP can be divided horizontally or vertically according to the shape of the current coding block. Specifically, the variable IntraSubPartitionsSplitType specifies the division type of the current coding block. Table 3 is the definition of IntraSubPartitionsSplitType. As shown in Table 3, when the variable IntraSubPartitionsSplitType is 0, it indicates that the current coding block is not divided, that is, ISP_NO_SPLIT; when the variable IntraSubPartitionsSplitType is 1, it indicates that the current coding block is horizontally divided, that is, ISP_HOR_SPLIT; when the variable IntraSubPartitionsSplitType is 2, it indicates that the current coding block is vertically divided, that is, ISP_VER_SPLIT.

[0082] IntraSubPartitionsSplitType Name of IntraSubPartitionsSplitType 0 ISP_NO_SPLIT 1 ISP_HOR_SPLIT 2 ISP_VER_SPLIT

[0083] Among them, the derivation of IntraSubPartitionsSplitType is as follows:

[0084] If Intra_subpartitions_mode_flag is equal to 0, set IntraSubPartitionsSplitType to 0;

[0085] Otherwise, IntraSubPartitionsSplitType is set to 1+intra_subpartitions_split_flag; wherein intra_subpartitions_split_flag is used to characterize the division mode, and when the value of intra_subpartitions_split_flag is 0, it indicates horizontal division; and when the value of intra_subpartitions_split_flag is 1, it indicates vertical division.

[0086] Since ISP can divide the current coding block into 2 or 4 sub-partitions according to the size of the current coding block, the variable NumIntraSubPartitions can be used to specify the number of sub-partitions into which the current coding block is divided. When deriving NumIntraSubPartitions, specifically,

[0087] If IntraSubPartitionsSplitType is equal to ISP_NO_SPLIT, then NumIntraSubPartitions is set equal to 1;

[0088] Otherwise, NumIntraSubPartitions is set equal to 2 if one of the following conditions is true:

[0089] nTbW is equal to 4, nTbH is equal to 8;

[0090] nTbW is equal to 8, nTbW is equal to 4.

[0091] Otherwise, set NumIntraSubPartitions equal to 4.

[0092] Furthermore, the implicit selection variable implicitMtsEnabled is derived as follows:

[0093] If the sps_mts_enabled flag is equal to 1 and one or more of the following conditions are true, then implicitMtsEnabled is set equal to 1:

[0094] IntraSubPartitionsSplitType is not equal to ISP_NO_SPLIT;

[0095] cu_sbt_flag is equal to 1 and Max(nTbW, nTbH) is less than or equal to 32;

[0096] sps_explicit_mts_intra_enabled_flag is equal to 0 and CuPredMode[0][xTbY][yTbY] is equal to MODE_INTRA and lfnst_idx[x0][y0] is equal to 0 and intra_mip_flag[x0][y0] is equal to 0;

[0097] Furthermore, the variable non-zero coefficient block size, that is, the non-zero width coefficient nonZeroW and the non-zero height coefficient nonZeroH, is derived as follows:

[0098] If ApplyLfnstFlag is equal to 1 and nTbW and nTbH are both greater than or equal to 4, then,

[0099] nonZeroW=(nTbW==4||nTbH==4)? 4:8 (1)

[0100] nonZeroH=(nTbW==4||nTbH==4)? 4:8 (2)

[0101] otherwise,

[0102] nonZeroW=Min(nTbW, (trTypeHor>0)? 16:32) (3)

[0103] nonZeroH=Min(nTbH, (trTypeVer>0)?16:32) (4)

[0104] Among them, the variable ApplyLfnstFlag is derived from the following formula:

[0105] If treeType is equal to SINGLE_TREE, then:

[0106] ApplyLfnstFlag=(lfnst_idx>0&&cIdx==0)? 1:0 (5)

[0107] otherwise:

[0108] ApplyLfnstFlag=(lfnst_idx>0)? 1:0 (6)

[0109] When selecting the transformation type, the variable trTypeHor represents the horizontal transformation type, and the variable trTypeVer represents the vertical transformation type. The derivation of trTypeHor and trTypeVer is as follows:

[0110] If any of the following conditions are met, trTypeHor and trTypeVer are both set to 0:

[0111] cIdx is greater than 0;

[0112] IntraSubPartitionsSplitType is not equal to ISP_NO_SPLIT and lfnst_idx is not equal to 0;

[0113] Otherwise, if the variable implicitMtsEnabled is equal to 1, then:

[0114] If cu_sbt_flag is equal to 1, trTypeHor and trTypeVer are determined by cu_sbt_horizontal_flag and cu_sbt_pos_flag in Table 5;

[0115] Otherwise (cu_sbt_flag is equal to 0), trTypeHor and trTypeVer are derived as follows:

[0116] trTypeHor=(nTbW>=4&&nTbW<=16)? 1:0 (7)

[0117] trTypeVer=(nTbH>=4&&nTbH<=16)? 1:0 (8)

[0118] Otherwise, trTypeHor and trTypeVer are determined by mrs_idx. in Table 4.

[0119] Table 4 shows the relationship between mtsIdx and trTypeHor and trTypeVer, and Table 5 shows the relationship between trTypeHor and trTypeVer and cu_sbt_horizontal_flag and cu_sbt_pos_flag, as follows:

[0120] MxD 0 1 2 3 4 trTypeHor 0 1 2 1 2 trTypeVer 0 1 1 2 2

[0121] cu_sbt_horizontal_flag cu_sbt_pos_flag trTypeHor trTypeVer 0 0 2 1 0 1 1 1 1 0 1 2 1 1 1 1

[0122] Based on the above Fig. 9 , Fig. 9 This is a schematic diagram of the implementation of a reverse transformation. Figure 2 ,like Fig. 9 As shown, when performing an inverse transformation, the specific process may include the following parts: one-dimensional vertical transformation; calculating intermediate coefficient values; one-dimensional horizontal transformation and obtaining residual coefficients.

[0123] For one-dimensional vertical transformation, if nTbH is greater than 1, the following one-dimensional inverse primary transformation process is called, whose input is the inverse primary transformation coefficient d[x][y] obtained after the inverse secondary transformation, x=0...nonZeroW-1, y=0...nonZeroH-1, transformation block height nTbH and non-zero height coefficient nonZeroH, vertical transformation type trTypeVer; the output is e[x][y], x=0...nonZeroW-1, y=0...nonZeroH-1.

[0124] When calculating the intermediate coefficient value, if nTbH and nTbW are both greater than 1, the intermediate sample value g[x][y], x=0...nonZeroW-1, y=0...nonZeroH-1 derives the following formula:

[0125] g[x][y]=Clip3(CoeffMin, CoeffMax, (e[x][y]+64)>>7) (9)

[0126] For one-dimensional horizontal transformation, if nTbW is greater than 1, the following one-dimensional inverse single transformation process is called, whose input is the intermediate sample value g[x][y], x=0...nonZeroW-1, y=0...noaZeroH-1, transformation block width nTbW and non-zero width coefficient nonZeroW, horizontal transformation type trTypeHor; the output is r[x][y], x=0...nonZeroW-1, y=0...nonZeroH-1.

[0127] If nTbW is equal to 1, then r[x][y] is set equal to e[x][y], x = 0...nonZeroW-1, y = 0...nonZeroH-1

[0128] When obtaining the residual coefficients, the residual coefficient matrix res[x][y], x=0...nonZeroW-1, y=0...nonZeroH-1 is derived as follows:

[0129] bdShift=Max(20-BitDepth, 0) (10)

[0130] res[x][y]=(r[x][y]+(1<<(bdShift-1)))>>bdShift (11)

[0131] Among them, for the one-dimensional inverse primary transform process, the process mainly performs a one-dimensional inverse primary transform, and its input nTbS represents the length of the transform coefficient, nonZeroS represents the length of the non-zero coefficient, x[j], j=0...nonZeroS represents the coefficient that has not undergone one-dimensional inverse primary transform, and trType represents the transform type; the output is the coefficient y[i], i=0...nonZeroS after one-dimensional inverse primary transform.

[0132] First, the transformation matrix transMatrix is ​​obtained according to the transformation coefficient length nTbS and the transformation type trType, and then y[i] is calculated according to trType, i = 0...nonZeroS:

[0133] If trType is equal to 0, the calculation is as follows:

[0134]

[0135] Otherwise (trType is equal to 1 or 2), the calculation method is as follows:

[0136]

[0137] For the transformation of ISP partitions, when the sub-partitions after ISP division do not use secondary transformation and the sub-partitions use primary transformation, the transformation type of the sub-partition primary transformation is mainly determined by the size of the sub-partition. That is, if the width of the current partition is greater than or equal to 4 and less than or equal to 16, the single transformation in the horizontal direction uses DST-7 transformation, otherwise it uses DCT-2 transformation; if the height of the current partition is greater than or equal to 4 and less than or equal to 16, the single transformation in the vertical direction uses DCT-2 transformation. Although the ISP transformation selection method described above increases the diversity of transformation selection, it also introduces a certain degree of complexity, thereby reducing the coding efficiency.

[0138] That is to say, for the current H.266 / VVC, if the sub-partition after ISP division does not use secondary transformation, then when using primary transformation, it is necessary to select the transformation kernel of the primary transformation according to the size of the sub-partition. It can be seen that the selection process of the primary transformation kernel based on the size of the transformation block is more cumbersome, which increases the complexity of the transformation process and thus reduces the coding efficiency.

[0139] Furthermore, since VVC currently accepts the use of secondary transform LFNST for ISP coding blocks. For ISP coding blocks, when DCT2 (primary transform kernel) + LFNST (secondary transform kernel) is used, the coding performance can be effectively improved. In the competition mechanism based on the minimum rate-distortion cost, the probability of selecting LFNST when it is 0 is not high. At this time, the coding performance improvement brought by the method of selecting the transform kernel based on the partition size is limited, and its complexity is also relatively high, especially the complexity of the DST-7 transform kernel.

[0140] In order to overcome the above defects, the present application proposes a transformation method. For the transformation of ISP partitions, when the sub-partition after the current block division does not use secondary transformation and only uses one transformation, the sub-partition uses a primary transformation core of the primary transformation, which is no longer determined by the size of the sub-partition, that is, the primary transformation core is no longer selected according to the height and width of the sub-partition, but the primary transformation core is directly set. Specifically, on the encoding side, the encoder directly determines the primary transformation core used by the sub-partition, and writes the code stream after indicating the primary transformation core using the syntax element; on the decoding side, the decoder parses the code stream and determines the primary transformation core used by the sub-partition according to the syntax element indicating the primary transformation core. That is to say, in the present application, for the transformation of ISP partitions, when the sub-partition does not use LFNST, the primary transformation core used for the primary transformation can be directly determined, without the need to select the primary transformation core according to the height and width of the sub-partition, thereby simplifying the selection process of the transformation core, reducing the complexity of the transformation process, and effectively improving the encoding and decoding efficiency.

[0141] It should be noted that, in the embodiments of the present application, Fig.10 is a block diagram of a video encoding system; it shows an example of a block diagram of a video encoding system provided by an embodiment of the present application; Fig.10As shown, the video coding system 11 includes a transform unit 111, a quantization unit 112, a mode selection and coding control logic unit 113, an intra-frame prediction unit 114, an inter-frame prediction unit 115 (including: motion compensation and motion estimation), an inverse quantization unit 116, an inverse transform unit 117, a loop filter unit 118, a coding unit 119 and a decoded image buffer unit 110; for the input original video signal, a coding tree block (Coding Tree A video reconstruction block can be obtained by dividing the video reconstruction block into a video unit (CTU), and the coding mode is determined by the mode selection and coding control logic unit 113. Then, the residual pixel information obtained after intra-frame or inter-frame prediction is transformed by the transformation unit 111 and the quantization unit 112, including transforming the residual information from the pixel domain to the transform domain, and quantizing the obtained transform coefficients to further reduce the bit rate; the intra-frame prediction unit 114 is used to perform intra-frame prediction on the video reconstruction block; wherein the intra-frame prediction unit 114 is used to determine the optimal intra-frame prediction mode (i.e., the target prediction mode) of the video reconstruction block; the inter-frame prediction unit 115 is used to perform inter-frame prediction coding of the received video reconstruction block relative to one or more blocks in one or more reference frames to provide time prediction information; wherein, motion estimation is used to generate motion estimation information. The motion vector process can estimate the motion of the video reconstruction block, and then the motion compensation is performed based on the motion vector determined by the motion estimation; after determining the inter-frame prediction mode, the inter-frame prediction unit 115 is also used to provide the selected inter-frame prediction data to the encoding unit 119, and the calculated motion vector data is also sent to the encoding unit 119; in addition, the inverse quantization unit 116 and the inverse transformation unit 117 are used to reconstruct the video reconstruction block, reconstruct the residual block in the pixel domain, and the reconstructed residual block is removed by the loop filter unit 118. Then, the reconstructed residual block is added to a predictive block in the frame of the decoded image cache unit 110 to generate a reconstructed video reconstruction block; the encoding unit 119 is used to encode various encoding parameters and quantized transform coefficients. The decoded image cache unit 110 is used to store the reconstructed video reconstruction block for prediction reference. As the video image encoding proceeds, new reconstructed video reconstruction blocks will be continuously generated, and these reconstructed video reconstruction blocks will be stored in the decoded image cache unit 110.

[0142] Fig.11 is a block diagram of a video decoding system; it shows an example of a block diagram of a video decoding system provided by an embodiment of the present application; Fig.11As shown, the video decoding system 12 includes a decoding unit 121, an inverse transform unit 127, an inverse quantization unit 122, an intra-frame prediction unit 123, a motion compensation unit 124, a loop filter unit 125 and a decoded image cache unit 126; after the input video signal is encoded by the video encoding system 11, a code stream of the video signal is output; the code stream is input into the video decoding system 12, and first passes through the decoding unit 121 to obtain a decoded transform coefficient; the transform coefficient is processed by the inverse transform unit 127 and the inverse quantization unit 122 to generate a residual block in the pixel domain; the intra-frame prediction unit 123 can be used to generate prediction data of the current video decoding block based on the determined intra-frame prediction direction and data from a previously decoded block of the current frame or picture. ; The motion compensation unit 124 determines prediction information for the video decoding block by analyzing the motion vector and other associated syntax elements, and uses the prediction information to generate a predictive block of the video decoding block being decoded; a decoded video block is formed by summing the residual block from the inverse transform unit 127 and the inverse quantization unit 122 with the corresponding predictive block generated by the intra-frame prediction unit 123 or the motion compensation unit 124; the decoded video signal passes through the loop filter unit 125 to remove block effect artifacts, thereby improving the video quality; the decoded video block is then stored in the decoded image cache unit 126, which stores reference images for subsequent intra-frame prediction or motion compensation, and is also used for the output of the video signal to obtain the restored original video signal.

[0143] The transformation method in the embodiment of the present application can be applied to Fig.10 In addition, the transformation method in the embodiment of the present application can also be applied to the following examples: Fig.11 The inverse transform unit 127 part shown. That is to say, the transform method in the embodiment of the present application can be applied to both the video encoding system and the video decoding system, and can even be applied to both the video encoding system and the video decoding system at the same time, but the embodiment of the present application does not make any specific limitation. It should also be noted that when the transform method is applied to the video encoding system, the "current block" specifically refers to the current encoding block in the intra-frame prediction; when the transform method is applied to the video decoding system, the "current block" specifically refers to the current decoding block in the intra-frame prediction.

[0144] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.

[0145] An embodiment of the present application proposes a transformation method, which is applied to an encoder. Fig.12 The following is a schematic diagram of the implementation process of the transformation method. Figure 1 ,like Fig.12As shown, the method for the encoder to perform transformation processing may include the following steps:

[0146] Step 101: Determine the ISP mode parameters of the current block.

[0147] Step 102: When the ISP mode parameter indicates that the current block uses the ISP mode to determine the intra-frame prediction value of the current block, determine the sub-partition of the current block.

[0148] In an embodiment of the present application, the encoder may first determine the ISP mode parameters of the current block, and after determining the ISP mode parameters, if the ISP mode parameters indicate that the current block uses the ISP mode to determine the intra-frame prediction value of the current block, then the encoder may further determine the sub-partition of the current block.

[0149] It should be noted that, in the implementation of the present application, the ISP mode parameter can indicate whether the current block can use the intra-frame sub-partition coding mode, that is, whether the current block can use the ISP mode.

[0150] It is understandable that, in the embodiment of the present application, the ISP mode parameter can be understood as a flag indicating whether the ISP mode is used. Specifically, the encoder can use the variable intra_subpartitions_mode_flag as the ISP mode parameter, so that the setting of the ISP mode parameter can be achieved by setting the value of the variable intra_subpartitions_mode_flag.

[0151] Exemplarily, in the present application, if the current block uses the ISP mode, the encoder may set the value of the ISP mode parameter to indicate that the current block uses the ISP mode. Specifically, the encoder may set the value of the variable intra_subpartitions_mode_flag to 1.

[0152] Exemplarily, in the present application, if the current block does not use the ISP mode, the encoder may set the value of the ISP mode parameter to indicate that the current block does not use the ISP mode. Specifically, the encoder may set the value of the variable intra_subpartitions_mode_flag to 0.

[0153] Furthermore, in an embodiment of the present application, after the encoder completes the setting of the ISP mode parameters, it can write the ISP mode parameters into the bitstream and transmit it to the decoder, so that the decoder can obtain the ISP mode parameters after parsing the bitstream.

[0154] That is to say, in an embodiment of the present application, on the encoder side, predictive coding will be performed on the current block. During this process, the ISP mode parameters of the current block can be determined, and the corresponding ISP mode parameters are written into the bit stream and transmitted from the encoder to the decoder.

[0155] Further, after the encoder determines the ISP mode parameters of the current block, if the ISP mode parameters indicate that the current block uses the ISP mode to determine the intra-frame prediction value of the current block, the decoder can continue to determine the sub-partitions of the current block.

[0156] It can be understood that in an embodiment of the present application, when the encoder determines the sub-partition of the current block, it can determine the size and position of the current block according to the split flag. That is, from the perspective of the code, the pointer variable is pointed to the correct starting position in the buffer and the width and height when writing to the storage space are determined.

[0157] It should be noted that, in an embodiment of the present application, a video image can be divided into a plurality of image blocks, and each image block currently to be encoded can be referred to as a coding block (Coding Block, CB). Here, each coding block may include a first image component, a second image component, and a third image component. Specifically, in the present application, assuming that a first image component prediction is performed, and the first image component is a luminance component, that is, the image component to be predicted is a luminance component, then the coding block to be predicted can be referred to as a luminance block; or, assuming that a second image component prediction is performed, and the second image component is a chrominance component, that is, the image component to be predicted is a chrominance component, then the coding block to be predicted can be referred to as a chrominance block.

[0158] It can be understood that, in the embodiments of the present application, since the ISP technology is mainly aimed at the luminance coding block, the current block is the coding block for which the luminance component prediction is currently to be performed in the video image, that is, the current block is a luminance block.

[0159] It should be noted that, in the embodiment of the present application, when the ISP technology is applied, the minimum size of the coding block is limited to 8x4 and 4x8, the maximum size is 64x64, and the ISP is disabled when the multi-reference row mode is used. Therefore, in the present application, the encoder can first determine the size parameter of the current block, and then determine whether the current block uses the ISP mode according to the size parameter.

[0160] That is to say, in the present application, the ISP mode can be used for the current block only when the current block is a luminance block and the size parameters of the current block meet the size requirements.

[0161] Step 103: Determine the residual value of the sub-partition.

[0162] In an embodiment of the present application, after determining the sub-partition of the current block, the encoder may determine the residual value of the sub-partition.

[0163] Further, in an embodiment of the present application, after determining the sub-partitions of the current block, the encoder may perform intra-frame prediction on the sub-partitions to obtain an intra-frame prediction value for each sub-partition; wherein one sub-partition corresponds to one intra-frame prediction value.

[0164] It should be noted that, in the embodiment of the present application, when the encoder performs intra-frame prediction on the sub-partition, the intra-frame prediction modes that can be used include direct current (DC) mode, planar (PLANAR) mode and angle mode.

[0165] It can be understood that in an embodiment of the present application, before performing intra-frame prediction on a sub-partition, the encoder may first determine a prediction mode parameter, and then determine the specific encoding mode of the sub-partition of the current block through the prediction mode parameter.

[0166] In an embodiment of the present application, further, when determining the prediction mode parameters of the sub-partition of the current block, the encoder can first determine the image components to be predicted of the sub-partition of the current block; then, based on the parameters of the sub-partition of the current block, use multiple prediction modes to perform prediction encoding on the image components to be predicted, and calculate the rate-distortion cost results corresponding to each prediction mode under the multiple prediction modes; finally, the minimum rate-distortion cost result can be selected from the multiple rate-distortion cost results calculated, and the prediction mode corresponding to the minimum rate-distortion cost result can be determined as the prediction mode parameter of the current block.

[0167] That is, at the encoder side, multiple prediction modes may be used to encode the image components to be predicted respectively for the sub-partitions of the current block.

[0168] Furthermore, in an embodiment of the present application, after the encoder encodes the current block respectively using multiple prediction modes, it can obtain the rate-distortion cost result corresponding to each prediction mode; then, the minimum rate-distortion cost result is selected from the multiple rate-distortion cost results obtained, and the prediction mode corresponding to the minimum rate-distortion cost result is determined as the prediction mode parameter of the sub-partition of the current block; in this way, the sub-partition of the current block can finally be encoded using the determined prediction mode, and under this prediction mode, the prediction residual can be made small, which can improve the coding efficiency.

[0169] It should be noted that in the embodiment of the present application, multiple sub-partitions of the current block share the same intra-frame prediction mode. That is, the encoder can perform intra-frame prediction on multiple sub-partitions of the current block through an intra-frame prediction mode in PLANAR, DC or angular prediction mode.

[0170] Furthermore, in an embodiment of the present application, after determining the intra-frame prediction value of the sub-partition, the encoder can perform a difference operation on the true value and the intra-frame prediction value of the sub-partition to obtain the difference result between the two, thereby determining the prediction difference of the sub-partition, that is, the residual value.

[0171] That is to say, in the present application, when the encoder calculates the residual value, it can calculate the difference between the true value of the sub-partition and the intra-frame prediction value to obtain the residual value.

[0172] It should be noted that, in the embodiment of the present application, the ISP technology limits the size of the sub-partition when predicting, requiring that the minimum prediction width of the sub-partition when predicting is 4. Therefore, for the current block, the size of the sub-partition when predicting and the size when transforming are not necessarily the same.

[0173] Specifically, since the ISP technology only limits the width of the sub-partition prediction, and the minimum size of the coding block is limited to 8x4 and 4x8 when the ISP technology is applied, for the sub-partitions obtained by horizontally dividing the current block, the prediction size and the transform size are the same, while for the sub-partitions divided vertically, there may be a situation where the prediction size and the transform size are different.

[0174] Table 6 is Table 2 of ISP partition prediction size restrictions. As shown in Table 6, after vertical partitioning, the transform size of the two sub-partitions after the current block with a size of 4x8 is divided is 2x8, and the size of the sub-partition used for prediction is 4x8; the transform size and prediction size of the two sub-partitions after the current block with a size of 8x4 is divided are both 4x4; the transform size of the four sub-partitions after the current block with a size of 4xN (N>8) is 1xN, and the size of the sub-partition used for prediction is 4xN; the transform size and prediction size of the four sub-partitions after the current block with a size of Nx4 (N>8) is (N / 4)x4; the transform size of the four sub-partitions after the current block with a size of 8xN (N>4) is 2xN, and the size of the sub-partition used for prediction is 4xN; the transform size and prediction size of the four sub-partitions after the current block with a size of Nx8 (N>8) is (N / 4)x8.

[0175] Current block (WxH) Estimated size of subpartitions Changing size of subpartitions 4x8 4x8 2x8 8x4 4x4 4x4 4xN(N>8) 4xN 1xN Nx4(N>8) (N / 4)x4 (N / 4)x4 8xN(N>4) 4xN 2xN Nx8(N>8) (N / 4)x8 (N / 4)x8

[0176] Step 104: When a sub-partition uses a primary transformation, determine a primary transformation kernel used by the sub-partition.

[0177] In an embodiment of the present application, when a sub-partition uses a single transformation, the encoder may first determine a single transformation kernel when the sub-partition performs the single transformation, that is, determine a transformation type used for the single transformation.

[0178] It can be understood that, in the embodiment of the present application, if the sub-partition uses a single transformation, the encoder may first determine the transformation type during the single transformation, that is, determine the single transformation kernel used by the sub-partition.

[0179] Specifically, there are 8 types of DCT transforms in mathematics, but only DCT-2 transform is used in HEVC transform coding. Furthermore, MTS technology is proposed in VVC, so more types of transforms can be used. Among them, for a transform, the optional transform kernels include DCT-2, DCT-8 and DST-7.

[0180] It is understood that in the embodiments of the present application, the DCT-2 transform core refers to a transform core or transform matrix of an integer transform designed based on DCT-2. Similarly, the DST-7 transform core refers to a transform core or transform matrix of an integer transform designed based on DST-7; and the DCT-8 transform core refers to a transform core or transform matrix of an integer transform designed based on DCT-8.

[0181] Fig.13 The following is a schematic diagram of the implementation process of the transformation method. Figure 2 ,like Fig.13 As shown, the method for the encoder to determine the primary transform kernel used by the sub-partition may include the following steps:

[0182] Step 104a: Determine DCT-2 as a primary transformation kernel.

[0183] In an embodiment of the present application, when the encoder determines the transform type when using a primary transform for a sub-partition, the encoder may directly determine DCT-2 as the primary transform kernel.

[0184] That is, in the present application, no matter whether the sub-partition uses LFNST or not, the primary transform kernel used by the sub-partition is DCT-2.

[0185] Step 104b: When the sub-partition does not use LFNST, the preset transformation kernel is determined as the primary transformation kernel; when the sub-partition uses LFNST, DCT-2 is determined as the primary transformation kernel.

[0186] In an embodiment of the present application, when the encoder determines the transform type when using a primary transform for a sub-partition, if the sub-partition does not use LFNST, the encoder may determine a preset transform kernel as the primary transform kernel; if the sub-partition uses LFNST, the encoder may determine DCT-2 as the primary transform kernel. The preset transform kernel is any one of DCT-2, DST-7, or DCT-8.

[0187] That is to say, in the present application, the primary transform core when the sub-partition uses LFNST and the primary transform core when the sub-partition does not use LFNST may be different. Specifically, when the sub-partition uses LFNST, the encoder may determine the primary transform core of the sub-partition as DCT-2; when the sub-partition does not use LFNST, the encoder may determine any one of DCT-2, DST-7 or DCT-8 as the primary transform core of the sub-partition.

[0188] Step 104c: When the sub-partition does not use LFNST, DCT-2 is determined as the primary transformation kernel; when the sub-partition uses LFNST, a preset transformation kernel is determined as the primary transformation kernel.

[0189] In an embodiment of the present application, when the encoder determines the transform type when using a primary transform for a sub-partition, if the sub-partition uses LFNST, the encoder may determine a preset transform kernel as the primary transform kernel; if the sub-partition does not use LFNST, the encoder may determine DCT-2 as the primary transform kernel. The preset transform kernel is any one of DCT-2, DST-7, or DCT-8.

[0190] That is to say, in the present application, the primary transform core when the sub-partition uses LFNST and the primary transform core when the sub-partition does not use LFNST may be different. Specifically, when the sub-partition does not use LFNST, the encoder may determine the primary transform core of the sub-partition as DCT-2; when the sub-partition uses LFNST, the encoder may determine any one of DCT-2, DST-7 or DCT-8 as the primary transform core of the sub-partition.

[0191] Step 104d: determine the target transformation kernel as a primary transformation kernel; accordingly, indicate the target transformation kernel with a syntax unit in the bitstream.

[0192] In an embodiment of the present application, when the encoder determines the transform type when using a primary transform for a sub-partition, the target transform kernel may be directly determined as a primary transform kernel, wherein the target transform kernel is any one of DCT-2, DST-7 or DCT-8.

[0193] That is to say, in this application, regardless of whether the sub-partition uses LFNST, the primary transformation core used by the sub-partition is the target transformation core. That is, for the two different situations of using LFNST and not using LFNST in the sub-partition, the encoder can set the same primary transformation core.

[0194] Furthermore, in an embodiment of the present application, after the encoder determines the target transform kernel as a primary transform kernel, it is necessary to indicate the transform type of the primary transform with a syntax element in the bitstream, that is, to indicate the target transform kernel with a syntax element.

[0195] It should be noted that, in an embodiment of the present application, in the bitstream, the syntax unit indicating the target transform kernel is included in one or more data units in the following bitstream: a data unit containing the current block, a slice header information data unit, an image header information data unit, an image layer parameter set, and a sequence layer parameter set.

[0196] Step 104e: when the sub-partition does not use LFNST, the first transform core is determined as a primary transform core; when the sub-partition uses LFNST, the second transform core is determined as a primary transform core; accordingly, two syntax units are used in the bitstream to indicate the first transform core and the second transform core respectively.

[0197] In an embodiment of the present application, when the encoder determines the transform type when using a primary transform for a sub-partition, if the sub-partition does not use LFNST, the encoder may determine the first transform core as a primary transform core; if the sub-partition uses LFNST, the encoder may determine the second transform core as a primary transform core. The first transform core and the second transform core are any two of DCT-2, DST-7, or DCT-8.

[0198] That is to say, in the present application, for the two cases where the sub-partition uses LFNST and does not use LFNST, the encoder can set different primary transform cores so that when the sub-partition does not use LFNST, the first transform core is used for a transform, and when LFNST is used, the second transform core is used for a transform.

[0199] Further, in an embodiment of the present application, for the two cases of using LFNST and not using LFNST for sub-partitions, after the encoder determines the first transform core or the second transform core as a primary transform core, it is necessary to indicate the transform type of the primary transform using two syntax elements in the bitstream, that is, use one syntax element to indicate the first transform core, and at the same time, use another syntax element to indicate the second transform core.

[0200] It should be noted that, in an embodiment of the present application, in the bitstream, the syntax unit indicating the first transform core and the second transform core is included in one or more data units in the following bitstream: a data unit containing the current block, a slice header information data unit, an image header information data unit, an image layer parameter set, and a sequence layer parameter set.

[0201] It can be seen that in the embodiment of the present application, when the encoder determines the primary transformation kernel to be used for the primary transformation of the sub-partition, regardless of whether the sub-partition uses LFNST, the encoder can determine the primary transformation kernel in a variety of ways.

[0202] It can be understood that in the embodiment of the present application, regardless of whether the sub-partition uses LFNST, the encoder can directly determine DCT-2 as the primary transform kernel used when the sub-partition is changed once. That is to say, for any sub-partition of the current block, when the sub-partition does not use LFNST or uses LFNST, the primary transform kernel used when the sub-partition is transformed once is DCT-2.

[0203] It can be seen that in the present application, the encoder does not need to select a primary transform kernel according to the size of the sub-partition, nor does it need to distinguish the primary transform kernel according to whether the sub-partition uses LFNST, but can directly set the primary transform kernel to DCT-2.

[0204] Exemplarily, in the present application, when lfnst_idx==0, DCT-2 is directly used; when lfnst_idx==1or2, DCT-2 is directly used.

[0205] It can be understood that in an embodiment of the present application, if the sub-partition does not use LFNST, the encoder can directly determine the preset transform kernel as the primary transform kernel used when the sub-partition is changed once; if the sub-partition uses LFNST, the encoder can determine DCT-2 as the primary transform kernel used when the sub-partition is changed once.

[0206] It should be noted that, in the embodiments of the present application, the preset transform kernel is a fixed type pre-set by the encoder. Specifically, the preset transform kernel may be any one of DCT-2, DST-7 or DCT-8.

[0207] It can be seen that in the present application, when the sub-partition of the current block does not use LFNST, the encoder does not need to select a transform kernel according to the size of the sub-partition, but can directly set the transform kernel to the preset transform kernel. At the same time, when the sub-partition uses LFNST, DCT-2 is set to determine the transform kernel.

[0208] Exemplarily, in the present application, when lfnst_idx==0, DST-7 is directly used; when lfnst_idx==1or2, DCT-2 is directly used.

[0209] It can be understood that in an embodiment of the present application, if the sub-partition uses LFNST, the encoder can directly determine the preset transform kernel as the primary transform kernel used when the sub-partition is changed once; if the sub-partition does not use LFNST, the encoder can determine DCT-2 as the primary transform kernel used when the sub-partition is changed once.

[0210] It should be noted that, in the embodiments of the present application, the preset transform kernel is a fixed type pre-set by the encoder. Specifically, the preset transform kernel may be any one of DCT-2, DST-7 or DCT-8.

[0211] It can be seen that in the present application, when the sub-partition of the current block does not use LFNST, the encoder does not need to select a transform kernel according to the size of the sub-partition, but can directly set DCT-2 to determine the transform kernel. At the same time, when the sub-partition uses LFNST, the transform kernel is set to the preset transform kernel.

[0212] Exemplarily, in the present application, when lfnst_idx==0, DCT-2 is directly used; when lfnst_idx==1or2, DST-7 is directly used.

[0213] It can be understood that in the embodiment of the present application, regardless of whether the sub-partition uses LFNST, the encoder can directly indicate the primary transformation core used when the sub-partition is changed once with a syntax element in the bitstream. That is to say, for any sub-partition of the current block, when the sub-partition does not use LFNST or uses LFNST, the primary transformation core used when the sub-partition is transformed once is the same target transformation core. The target transformation core can be any one of DCT-2, DST-7 or DCT-8.

[0214] It can be seen that in the present application, the encoder does not need to select a transform kernel according to the size of the sub-partition, nor does it need to distinguish the transform kernel according to whether the sub-partition uses LFNST. Instead, the transform kernel can be directly indicated through the syntax unit in the bitstream.

[0215] Exemplarily, in the present application, when lfnst_idx==0, the target transformation core indicated by the syntax element is used; when lfnst_idx==1or2, the target transformation core indicated by the syntax element is used.

[0216] It can be understood that in an embodiment of the present application, if the sub-partition uses LFNST, the encoder can use a syntax element in the code stream to indicate the primary transformation core used when the sub-partition is changed once; if the sub-partition does not use LFNST, the encoder can use another syntax element in the code stream to indicate the primary transformation core used when the sub-partition is changed once.

[0217] Specifically, for two different situations in which the sub-partition uses LFNST and does not use LFNST, the encoder may indicate the first target core and the second target core respectively using two different syntax units in the bitstream.

[0218] It should be noted that, in the embodiments of the present application, the first target kernel and the second target kernel may be any two of DCT-2, DCT-7 or DCT-8.

[0219] It can be seen that in the present application, when the sub-partition of the current block does not use LFNST, the encoder does not need to select a transform kernel according to the size of the sub-partition, but can directly indicate the first transform kernel through a syntax unit in the bitstream. At the same time, when the sub-partition uses LFNST, the second transform kernel can be indicated through another syntax unit in the bitstream.

[0220] Exemplarily, in the present application, when lfnst_idx==0, the first transform core indicated by the syntax unit s0 is used; when ffnst_idx==1or2, the second transform core indicated by the syntax unit s1 is used.

[0221] It should be noted that, in an embodiment of the present application, the encoder may include signal syntax elements in the bitstream in the following ways: block layer, slice layer, picture header, parameter set (sequence layer parameter set, picture layer parameter set, APS, etc.), and the override relationship between signal parameters in different data units, for example, the block layer can override the slice layer, etc., and the override between parameter sets.

[0222] Furthermore, in an embodiment of the present application, from the perspective of the encoder, that is, the encoding side, a primary transform core can be adaptively selected, and then the primary transform core is indicated using a corresponding syntax element in one or more data units of the block layer and written into the bitstream; from the perspective of the decoder, that is, the decoding side, the syntax element of one or more data units of the block layer in the bitstream is parsed, so that the primary transform core used can be determined.

[0223] It can be seen that in the present application, when the sub-partition of the current block does not use LFNST, the encoder does not need to select a transform kernel according to the size of the sub-partition, but can directly perform an adaptive setting of the transform kernel for the sub-partition.

[0224] Furthermore, in an embodiment of the present application, the encoder may determine a transformation kernel by the value of the variable isp_trType.

[0225] It should be noted that, in the embodiments of the present application, the value of the variable isp_trType can be 0, 1, or 2, wherein if the value of the variable isp_trType is 0, it means that DCT-2 is used as the primary transformation kernel; if the value of the variable isp_trType is 1, it means that DST-7 is used as the primary transformation kernel; and if the value of the variable isp_trType is 2, it means that DCT-8 is used as the primary transformation kernel.

[0226] It can be seen that the transformation method proposed in the embodiment of the present application, for the transformation of the ISP partition, does not use secondary transformation for the sub-partition after the current block is divided, and only uses one transformation. The sub-partition uses the transformation type of the single transformation, that is, the single transformation kernel, which is no longer determined by the size of the sub-partition, that is, the single transformation kernel is no longer selected according to the height and width of the sub-partition, but the single transformation kernel is directly set.

[0227] In the embodiments of the present application, further, Fig.14 This is a schematic diagram of the transformation kernel determination process, such as Fig.14 As shown, in VVC, if the value of lfnst_idx is 0, that is, the sub-partition does not use the secondary transform LFNST, then when using the primary transform, the encoder can directly determine the primary transform kernel of the sub-partition primary transform; if the value of lfnstidx is 1 or 2, that is, the sub-partition uses the secondary transform LFNST, then the transform kernel of the sub-partition primary transform is DCT-2.

[0228] It should be noted that, in the embodiments of the present application, not all sub-partitions of the current block can use the LFNST transform. Specifically, only when the sub-partition satisfies certain preset conditions at the same time, the sub-partition can be subjected to the LFNST transform. Among them, the preset conditions may include: (a) the width and height of the sub-partition are both greater than or equal to 4; (b) the width and height of the sub-partition are both less than or equal to the maximum size of the transform block; (c) the prediction mode of the sub-partition or the current coding block is the intra-frame prediction mode; (d) the sub-partition's one-time transform is a two-dimensional forward one-time transform (DCT-2) in both the horizontal and vertical directions, that is, the one-time transform kernel is DCT-2; (e) when the intra-frame prediction mode of the sub-partition or the current block's coding block is a non-MIP mode or the prediction mode of the sub-partition is a MIP mode and the width and height of the transform block are both greater than or equal to 16. In other words, for the sub-partitions in the embodiments of the present application, the above five conditions need to be met at the same time to determine that the sub-partition uses the LFNST transform technology.

[0229] It can be seen that compared with the prior art, the transformation method proposed in the present application can simplify the method of determining the primary transformation kernel of the sub-partition divided by ISP when the value of lfnstIdx is equal to 0. Specifically, in the present application, if the sub-partition does not use LFNST, the encoder no longer determines the primary transformation kernel used by the sub-partition according to the size of the sub-partition, but directly sets the primary transformation kernel, thereby eliminating the processing flow of selecting the primary transformation kernel of the sub-partition according to the size of the sub-partition.

[0230] Step 105: Use a primary transformation kernel to transform the residual value.

[0231] In an embodiment of the present application, when a sub-partition uses a primary transform, after determining the primary transform kernel used by the sub-partition, the encoder can use the primary transform kernel to perform a primary transform process on the residual value of the sub-partition.

[0232] It should be noted that, in the embodiment of the present application, the primary transform kernel determined by the encoder may characterize the transform type of the primary transform of the sub-partition, which may include the horizontal transform type and the vertical transform type when the sub-partition is transformed. Specifically, the horizontal transform type and the vertical transform type of the primary transform of the sub-partition are the same, that is, the encoder uses the same primary transform kernel to perform horizontal transform and vertical transform on the sub-partition respectively.

[0233] Further, in an embodiment of the present application, after the encoder performs a transform process on the residual value of the sub-partition using the primary transform kernel, it can output a transform coefficient matrix after the primary transform.

[0234] Fig.15 The following is a schematic diagram of the implementation process of the transformation method. Figure 3 ,like Fig.15 As shown, the method for the encoder to perform transformation processing may also include the following steps:

[0235] Step 106: When the sub-partition does not use LFNST, the value of the LFNST index number is set to indicate that the sub-partition does not use LFNST.

[0236] Step 107: When the sub-partition uses LFNST, determine the LFNST transformation core used by the sub-partition, set the value of the LFNST index number to indicate that the sub-partition uses LFNST, and write the LFNST index number into the bitstream.

[0237] Step 108: Write the LFNST index number into the bitstream.

[0238] That is, in an embodiment of the present application, if the sub-partition of the current block does not use LFNST, that is, the sub-partition does not perform a secondary transformation, the encoder can set the value of the LFNST index number to indicate that the sub-partition does not use LFNST, and then write the LFNST index number into the bitstream. On the other hand, in the present application, if the sub-partition of the current block uses LFNST, that is, the sub-partition performs a secondary transformation, the encoder can set the value of the LFNST index number to indicate that the sub-partition uses LFNST, and then write the LFNST index number into the bitstream.

[0239] It should be noted that, in the embodiment of the present application, the LFNST index number may indicate whether the sub-partition uses the secondary transform LFNST, and may also indicate the type of secondary transform when used, that is, indicate the LFNST transform core of the sub-partition.

[0240] It is understandable that in the embodiment of the present application, the LFNST index number can be understood as a flag indicating whether to use LFNST. Specifically, the encoder can use the variable lfnst_idx as the LFNST index number, so that the setting of the LFNST index number can be achieved by setting the value of the variable lfnst_idx.

[0241] Exemplarily, in the present application, if the sub-partition uses LFNST, the encoder may set the value of the LFNST index number to indicate that the sub-partition uses LFNST. Specifically, the encoder may set the value of the variable lfnst_idx to 1 or 2.

[0242] Exemplarily, in the present application, if the sub-partition does not use LFNST, the encoder may set the value of the LFNST index number to indicate that the sub-partition does not use LFNST. Specifically, the encoder may set the value of the variable lfnst_idx to 0.

[0243] That is to say, in an embodiment of the present application, for the value of the LFNST index number (ie, lfnst_idx), when the value of the LFNST index number is equal to 0, it indicates that the sub-partition will not use LFNST; and when the value of the LFNST index number is greater than 0, it indicates that the sub-partition will use LFNST.

[0244] It should be noted that in an embodiment of the present application, when the encoder determines the LFNST transform kernel, it can first determine the LFNST transform kernel candidate set, and then determine the LFNST transform kernel used by the sub-partition from the LFNST transform kernel candidate set, and then set the LFNST index number and write it into the bitstream. Here, the LFNST transform matrix is ​​a plurality of fixed coefficient matrices obtained through training, and the LFNST transform kernel candidate set includes 2 groups of transform matrices (also referred to as LFNST transform kernels). After the LFNST transform kernel candidate set is determined, it is necessary to select a group of LFNST transform kernels from the LFNST transform kernel candidate set, that is, to determine the transform matrix used when the sub-partition LFNST is used.

[0245] Further, in an embodiment of the present application, since the LFNST transform core candidate set includes two or more preset transform cores, the transform core used by the sub-partition can be selected in a rate-distortion optimization manner. Specifically, the rate-distortion cost (Rate Distortion Cost, RDCost) can be calculated for each transform core using a rate-distortion optimization method, and then the transform core with the smallest rate-distortion cost is selected as the transform core used by the sub-partition.

[0246] That is to say, on the encoder side, a group of LFNST transform cores can be selected through RDCost, and the LFNST index number (which can be represented by lfnst_idx) is written into the bitstream and transmitted to the decoder side. When the first group of LFNST transform cores (i.e., the first group of transform matrices) in the LFNST transform core candidate set is selected, lfnst_idx is set to 1; when the second group of LFNST transform cores (i.e., the second group of transform matrices) in the LFNST transform core candidate set is selected, lfnst_idx is set to 2.

[0247] Furthermore, in the embodiment of the present application, after the encoder completes setting of the LFNST index number, the encoder may write the LFNST index number into the bitstream for parsing by the decoding end.

[0248] In an embodiment of the present application, further, if the sub-partition of the current block uses LFNST, then after using the primary transform kernel to transform the residual value, the encoder can also determine the LFNST transform kernel used by the sub-partition, and at the same time, the value of the LFNST index number can be set to indicate that the sub-partition uses LFNST, and then the LFNST index number is written into the bitstream.

[0249] It should be noted that in an embodiment of the present application, after the encoder determines the LFNST transform kernel used by the sub-partition, it can use the LFNST transform kernel to perform a secondary transform on the transform coefficient matrix of the sub-partition after the first transform to obtain the LFNST transform coefficient matrix, and finally perform quantization on the LFNST transform coefficient matrix and write the final quantization value into the video bitstream.

[0250] Fig.16 The following is a schematic diagram of the implementation process of the transformation method. Figure 4 ,like Fig.16 As shown, before determining the residual value of the sub-partition, that is, before step 103, the method for the encoder to perform transformation processing may further include the following steps:

[0251] Step 109: Determine the size parameter of the current block, and determine whether the current block uses the ISP mode according to the size parameter.

[0252] In an embodiment of the present application, the encoder may first determine a size parameter of the current block, and then determine whether the current block uses the ISP mode according to the size parameter of the current block.

[0253] It can be understood that, in the embodiment of the present application, the size parameter of the current block may include a height value and a width value of the current block.

[0254] It should be noted that in this application, since in VVC, the maximum transform size supported by the luminance component is 64×64, and the maximum transform size supported by the chrominance component is 32×32. If the size of a CB exceeds the limit, the CB will automatically be split horizontally or (and) vertically to meet the transform size requirements in the corresponding direction.

[0255] Exemplarily, in the present application, after the encoder determines the size parameter of the current block, that is, after determining the height value and width value of the current block, if the size parameter of the current block is 4x4, that is, the height value and width value of the current block are both equal to 4, then it can be determined that the current block does not use the ISP mode.

[0256] That is to say, in the present application, for a luminance block whose size parameter is other than 4x4, the encoder can determine that the luminance block uses the ISP mode.

[0257] Step 1010: When it is determined that the current block uses the ISP mode, determine the sub-partitions of the current block.

[0258] In an embodiment of the present application, after the encoder determines the size parameter of the current block and judges whether the current block uses the ISP mode based on the size parameter, if it is determined that the current block uses the ISP mode, the encoder can first determine the sub-partition of the current block. At the same time, the encoder can set the value of the ISP mode parameter to indicate that the current block uses the ISP mode, and then write the ISP mode parameter into the bitstream.

[0259] Further, in an embodiment of the present application, after determining that the current block uses the ISP mode, the encoder can divide the current block into multiple sub-partitions. Specifically, in the present application, according to the size parameter of the current block, the encoder can divide the current block into 2 sub-partitions or 4 sub-partitions of the same size.

[0260] Exemplarily, in the present application, if the size parameter of the current block is 8x4, the encoder may divide the current block into two sub-partitions of the same size.

[0261] Exemplarily, in the present application, if the size parameter of the current block is 4x8, the encoder may divide the current block into two sub-partitions of the same size.

[0262] Exemplarily, in the present application, if the size parameter of the current block is Nx4 (N>8), the encoder may divide the current block into 4 sub-partitions of the same size.

[0263] Exemplarily, in the present application, if the size parameter of the current block is 4xN (N>8), the encoder may divide the current block into 4 sub-partitions of the same size.

[0264] It is understandable that in the embodiment of the present application, when the encoder divides the current block, it can be either horizontal division or vertical division. That is, the encoder can divide the current block horizontally into multiple sub-partitions of the same size, or can divide the current block vertically into multiple sub-partitions of the same size.

[0265] In an embodiment of the present application, further, when determining the sub-partition of the current block, the encoder may first determine the partition type of the current block, and then obtain the sub-partition based on the size parameter and the partition type of the current block.

[0266] It should be noted that, in an embodiment of the present application, the partition type may include horizontal partition and vertical partition. Specifically, when the encoder obtains the sub-partition based on the size parameter and the partition type of the current block, the current block may be horizontally or vertically partitioned according to the height value and the width value of the current block, thereby obtaining multiple sub-partitions of the current block.

[0267] Exemplarily, in the present application, when the size parameter of the current block is 4x8, that is, the width value is equal to 4 and the height value is equal to 8, the encoder obtains 2 sub-partitions after horizontally dividing the current block, wherein the size parameter of each sub-partition is 1x8.

[0268] Exemplarily, in the present application, when the size parameter of the current block is 4x16, that is, the width value is equal to 4 and the height value is equal to 16, the encoder obtains 4 sub-partitions after vertically dividing the current block, wherein the size parameter of each sub-partition is 4x4.

[0269] Furthermore, in an embodiment of the present application, after determining that the current block uses the ISP mode, the encoder may also set the value of the ISP mode parameter to indicate that the current block uses the ISP mode, and then write the ISP mode parameter into the video bitstream.

[0270] Fig.17 The following is a schematic diagram of the implementation process of the transformation method. Figure 5 ,like Fig.17 As shown, after the encoder determines the size parameter of the current block and determines whether the current block uses the ISP mode according to the size parameter, that is, after step 109, the method for the encoder to perform transformation processing may further include the following steps:

[0271] Step 1011: When it is determined that the current block does not use the ISP mode, the value of the ISP mode parameter is set to indicate that the current block does not use the ISP mode, and the ISP mode parameter is written into the bitstream.

[0272] In an embodiment of the present application, after the encoder determines the size parameter of the current block and determines whether the current block uses the ISP mode based on the size parameter, if it is determined that the current block does not use the ISP mode, the encoder can set the value of the ISP mode parameter to indicate that the current block does not use the ISP mode, and then write the ISP mode parameter into the bitstream.

[0273] It can be understood that in an embodiment of the present application, after the encoder determines the size parameter of the current block and judges whether the current block uses the ISP mode based on the size parameter, if it is determined that the current block does not use the ISP mode, the encoder can set the value of the ISP mode parameter to indicate that the current block does not use the ISP mode, and then write the ISP mode parameter into the video bitstream.

[0274] It should be noted that, in an embodiment of the present application, the ISP mode parameter may indicate whether the current block can use the intra-frame sub-partition coding mode, that is, whether the current block can use the ISP mode.

[0275] It is understandable that, in the embodiment of the present application, the ISP mode parameter can be understood as a flag indicating whether the ISP mode is used. Specifically, the encoder can use the variable intra_subpartitions_mode_flag as the ISP mode parameter, so that the setting of the ISP mode parameter can be achieved by setting the value of the variable intra_subpartitions_mode_flag.

[0276] Exemplarily, in the present application, if the current block uses the ISP mode, the encoder may set the value of the ISP mode parameter to indicate that the current block uses the ISP mode. Specifically, the encoder may set the value of the variable intra_subpartitions_mode_flag to 1.

[0277] Exemplarily, in the present application, if the current block does not use the ISP mode, the encoder may set the value of the ISP mode parameter to indicate that the current block does not use the ISP mode. Specifically, the encoder may set the value of the variable intra_subpartitions_mode_flag to 0.

[0278] Furthermore, in an embodiment of the present application, after the encoder completes the setting of the ISP mode parameters, the ISP mode parameters can be written into the bitstream for parsing by the decoding end.

[0279] The present application proposes a transformation method, which is applied to an encoder, wherein the encoder determines the ISP mode parameters of the current block; when the ISP mode parameters indicate that the current block uses the ISP mode to determine the intra-frame prediction value of the current block, the sub-partition of the current block is determined; the residual value of the sub-partition is determined; when the sub-partition uses a single transformation, the single transformation kernel used by the sub-partition is determined; and the residual value is transformed using the single transformation kernel. It can be seen that in an embodiment of the present application, for the transformation of the ISP partition, when the sub-partition after the current block is divided does not use a secondary transformation and only uses a single transformation, the sub-partition uses a single transformation kernel of a single transformation, which is no longer determined by the size of the sub-partition, that is, the single transformation kernel is no longer selected according to the height and width of the sub-partition, but the single transformation kernel is directly set. This simplifies the transformation kernel selection process, reduces the complexity of the transformation process, and effectively improves the encoding and decoding efficiency.

[0280] Another embodiment of the present application proposes a transformation method, which is applied to a decoder. Fig.18 The following is a schematic diagram of the implementation process of the transformation method. Figure 6 ,like Fig.18 As shown, the method for the decoder to perform transformation processing may include the following steps:

[0281] Step 201: parse the code stream to determine the ISP mode parameters of the current block.

[0282] In the implementation of the present application, after receiving the video bitstream, the decoder may first parse the bitstream to determine the ISP mode parameters corresponding to the current block.

[0283] It should be noted that, in the implementation of the present application, the ISP mode parameter can indicate whether the current block can use the intra-frame sub-partition coding mode, that is, whether the current block can use the ISP mode.

[0284] It is understandable that, in the embodiment of the present application, the ISP mode parameter can be understood as a flag indicating whether the ISP mode is used. Specifically, the decoder can use the variable intra_subpartitions_mode_flag as the ISP mode parameter, so that the setting of the ISP mode parameter can be achieved by setting the value of the variable intra_subpartitions_mode_flag.

[0285] Exemplarily, in the present application, if the current block uses the ISP mode, then the value of the ISP mode parameter is set to indicate that the current block uses the ISP mode. Specifically, the value of the variable intra_subpartitions_mode_flag can be set to 1.

[0286] Exemplarily, in the present application, if the current block does not use the ISP mode, the value of the ISP mode parameter is set to indicate that the current block does not use the ISP mode. Specifically, the value of the variable intra_subpartitions_mode_flag can be set to 0.

[0287] Furthermore, in an embodiment of the present application, after completing the setting of the ISP mode parameters, the ISP mode parameters can be written into the bitstream and transmitted to the decoder, so that the decoder can obtain the ISP mode parameters after parsing the bitstream.

[0288] That is to say, in an embodiment of the present application, on the encoder side, predictive coding will be performed on the current block. During this process, the ISP mode parameters of the current block can be determined, and the corresponding ISP mode parameters are written into the bit stream and transmitted from the encoder to the decoder.

[0289] Step 202: When the ISP mode parameter indicates that the current block uses the ISP mode to determine the intra-frame prediction value of the current block, determine the sub-partition of the current block.

[0290] In an embodiment of the present application, after the decoder parses the bitstream and determines the ISP mode parameters of the current block, if the ISP mode parameters indicate that the current block uses the ISP mode to determine the intra-frame prediction value of the current block, the decoder can continue to determine the sub-partition of the current block.

[0291] It can be understood that in an embodiment of the present application, when the decoder determines the sub-partition of the current block, it can determine the size and position of the current block according to the split flag. That is, from the perspective of the code, the pointer variable is pointed to the correct starting position in the buffer and the width and height when writing to the storage space are determined.

[0292] It can be understood that in the embodiments of the present application, since the ISP technology is mainly aimed at the luminance decoding block, if the ISP mode parameter indicates that the current block uses the ISP mode to determine the intra-frame prediction value of the current block, then the current block is the decoding block in the video image that is currently to be predicted for the luminance component, that is, the current block is a luminance block.

[0293] It should be noted that, in the embodiment of the present application, when the ISP technology is applied, the minimum size of the decoding block is limited to 8x4 and 4x8, the maximum size is 64x64, and the ISP is disabled when the multi-reference row mode is used. Therefore, in the present application, if the ISP mode parameter indicates that the current block uses the ISP mode to determine the intra-frame prediction value of the current block, then the size parameter of the current block needs to meet the requirements of the ISP mode.

[0294] That is to say, in the present application, the ISP mode can be used for the current block only when the current block is a luminance block and the size parameters of the current block meet the size requirements.

[0295] It can be understood that, in the embodiment of the present application, the size parameter of the current block may include a height value and a width value of the current block.

[0296] It should be noted that, in an embodiment of the present application, after the decoder determines that the ISP mode parameter indicates that the current block uses the ISP mode, it can determine the sub-partition of the current block according to the size parameter of the current block.

[0297] Further, in an embodiment of the present application, after determining that the current block uses the ISP mode, the decoder can divide the current block into multiple sub-partitions. Specifically, in the present application, according to the size parameter of the current block, the decoder can divide the current block into 2 sub-partitions or 4 sub-partitions of the same size.

[0298] Exemplarily, in the present application, if the size parameter of the current block is 8x4, the decoder may divide the current block into two sub-partitions of the same size.

[0299] Exemplarily, in the present application, if the size parameter of the current block is 4x8, the decoder may divide the current block into two sub-partitions of the same size.

[0300] Exemplarily, in the present application, if the size parameter of the current block is Nx4 (N>8), the decoder may divide the current block into 4 sub-partitions of the same size.

[0301] Exemplarily, in the present application, if the size parameter of the current block is 4xN (N>8), the decoder may divide the current block into 4 sub-partitions of the same size.

[0302] It is understandable that in the embodiment of the present application, when the decoder divides the current block, it can be either horizontal division or vertical division. That is, the decoder can divide the current block horizontally into multiple sub-partitions of the same size, or can divide the current block vertically into multiple sub-partitions of the same size.

[0303] In an embodiment of the present application, further, when determining the sub-partition of the current block, the decoder may first determine the partition type of the current block, and then obtain the sub-partition based on the size parameter and the partition type of the current block.

[0304] It should be noted that, in an embodiment of the present application, the partition type may include horizontal partition and vertical partition. Specifically, when the decoder obtains the sub-partition based on the size parameter and the partition type of the current block, the current block may be horizontally or vertically divided according to the height value and the width value of the current block, thereby obtaining multiple sub-partitions of the current block.

[0305] Step 203: parse the bitstream to determine the transform coefficient matrix of the sub-partition.

[0306] In the embodiment of the present application, after parsing the code stream, the decoder can also obtain the transformation coefficient matrix of the sub-partition.

[0307] It should be noted that, in the embodiment of the present application, the transform coefficient matrix of the sub-partition is output by the encoder after applying a transform to the residual value of the sub-partition. Accordingly, on the decoding side, the input of the decoder when applying a transform to the sub-partition includes the transform coefficient matrix of the sub-partition.

[0308] Further, in an embodiment of the present application, at the decoder side, in addition to the transform coefficient matrix d[x][y], the input data of the reverse primary transform may include: the current luminance block position (xTbY, yTbY), the width of the current block nTbW, the height of the current block nTbH, the current block chrominance component cIdx, and the prediction mode predMode of the current decoding unit. Where x = 0, 1, ..., nTbW-1, y = 0, 1, ..., nTbH-1.

[0309] Accordingly, in the present application, the output data of the inverse primary transform may include: residual coefficients res[x][y] obtained by the inverse primary transform, where x=0, 1, ..., nTbW-1, y=0, 1, ..., nTbH-1.

[0310] Furthermore, in an embodiment of the present application, after parsing the bitstream of the video, the decoder may also obtain the transform type parameters of the sub-partition.

[0311] It can be understood that, in the embodiment of the present application, the transformation type parameter may indicate a transformation kernel used when a sub-partition is transformed once, that is, indicates a transformation type of a transformation performed on the sub-partition.

[0312] Further, in the embodiment of the present application, the transform type parameter can be understood as a flag indicating the transform type. Specifically, the decoder can determine a transform kernel by taking the value of the variable isp_trType.

[0313] It should be noted that, in the embodiments of the present application, the value of the variable isp_trType can be 0, 1, or 2, wherein if the value of the variable isp_trType is 0, it means that DCT-2 is used as the primary transformation kernel; if the value of the variable isp_trType is 1, it means that DST-7 is used as the primary transformation kernel; and if the value of the variable isp_trType is 2, it means that DCT-8 is used as the primary transformation kernel.

[0314] It can be understood that in the embodiment of the present application, if the sub-partition uses a single transformation, the decoder can obtain the transformation type when the sub-partition uses a single transformation after parsing the bitstream, thereby determining the single transformation core used by the sub-partition.

[0315] Step 204: When a sub-partition uses a primary transformation, determine a primary transformation kernel used by the sub-partition.

[0316] In an embodiment of the present application, when a sub-partition uses a primary transform, the decoder may determine the primary transform kernel used by the sub-partition.

[0317] It can be understood that, in the embodiment of the present application, if the sub-partition uses a single transformation, the decoder may first determine the transformation type during the single transformation, that is, determine the single transformation core used by the sub-partition.

[0318] Specifically, there are 8 types of DCT transforms in mathematics, but only DCT-2 transform is used in HEVC transform coding. Furthermore, MTS technology is proposed in VVC, so more types of transforms can be used. Among them, for a transform, the optional transform kernels include DCT-2, DCT-8 and DST-7.

[0319] It is understood that in the embodiments of the present application, the DCT-2 transform core refers to a transform core or transform matrix of an integer transform designed based on DCT-2. Similarly, the DST-7 transform core refers to a transform core or transform matrix of an integer transform designed based on DST-7; and the DCT-8 transform core refers to a transform core or transform matrix of an integer transform designed based on DCT-8.

[0320] In the embodiments of the present application, further, Fig.19 The following is a schematic diagram of the implementation process of the transformation method. Figure 7 ,like Fig.19 As shown, when the ISP mode parameter indicates that the current block uses the ISP mode to determine the intra-frame prediction value of the current block, after determining the sub-partition of the current block, that is, after step 102, the method for the decoder to perform transformation processing may also include the following steps:

[0321] Step 206: parse the code stream to determine the LFNST index number of the sub-partition.

[0322] In the embodiment of the present application, the decoder can also obtain the LFNST index number of the sub-partition by parsing the bitstream.

[0323] It should be noted that, in the embodiment of the present application, the LFNST index number may indicate whether the sub-partition uses the secondary transform LFNST, and may also indicate the type of secondary transform when used, that is, indicate the LFNST transform core of the sub-partition.

[0324] It is understandable that in the embodiment of the present application, the LFNST index number can be understood as a flag indicating whether LFNST is used. Specifically, the decoder can use the variable lfnst_idx as the LFNST index number, so that the setting of the LFNST index number can be achieved by setting the value of the variable lfnst_idx.

[0325] Exemplarily, in the present application, if the sub-partition uses LFNST, the decoder may set the value of the LFNST index number to indicate that the sub-partition uses LFNST. Specifically, the decoder may set the value of the variable lfnst_idx to 1 or 2.

[0326] Exemplarily, in the present application, if the sub-partition does not use LFNST, the decoder may set the value of the LFNST index number to indicate that the sub-partition does not use LFNST. Specifically, the decoder may set the value of the variable lfnst_idx to 0.

[0327] It should be noted that in an embodiment of the present application, when the decoder determines the LFNST transform core, it can first determine the LFNST transform core candidate set, and then determine the LFNST transform core used by the sub-partition from the LFNST transform core candidate set, and then set the LFNST index number and write it into the bitstream. Here, the LFNST transform matrix is ​​a plurality of fixed coefficient matrices obtained through training, and the LFNST transform core candidate set includes 2 groups of transform matrices (also referred to as LFNST transform cores). After the LFNST transform core candidate set is determined, it is necessary to select a group of LFNST transform cores from the LFNST transform core candidate set, that is, the transform matrix used when determining the sub-partition LFNST.

[0328] Further, in an embodiment of the present application, since the LFNST transform core candidate set includes two or more preset transform cores, the transform core used by the sub-partition can be selected in a rate-distortion optimization manner. Specifically, the rate-distortion cost (Rate Distortion Cost, RDCost) can be calculated for each transform core using a rate-distortion optimization method, and then the transform core with the smallest rate-distortion cost is selected as the transform core used by the sub-partition.

[0329] That is to say, on the encoder side, a group of LFNST transform cores can be selected through RDCost, and the LFNST index number (which can be represented by lfnst_idx) is written into the bitstream and transmitted to the decoder side. When the first group of LFNST transform cores (i.e., the first group of transform matrices) in the LFNST transform core candidate set is selected, lfnst_idx is set to 1; when the second group of LFNST transform cores (i.e., the second group of transform matrices) in the LFNST transform core candidate set is selected, lfnst_idx is set to 2.

[0330] Furthermore, in an embodiment of the present application, after the encoder completes the setting of the LFNST index number, it can write the LFNST index number into the bitstream and transmit it to the decoder. After parsing the bitstream, the decoder obtains the LFNST index number and determines whether the sub-partition uses LFNST according to the LFNST index number, and when the sub-partition uses LFNST, determines the LFNST transform core used by the sub-partition.

[0331] That is to say, in an embodiment of the present application, after parsing the bitstream, the decoder can determine that the LFNST index number (i.e., lfnst_idx) indicates that the sub-partition will not use LFNST when the value of the LFNST index number is equal to 0; when the value of the LFNST index number is equal to 1, the decoder can determine that the LFNST index number indicates that the sub-partition will use LFNST, and select the first group of LFNST transform cores in the LFNST transform core candidate set; when the value of the LFNST index number is equal to 2, the decoder can determine that the LFNST index number indicates that the sub-partition will use LFNST, and select the second group of LFNST transform cores in the LFNST transform core candidate set.

[0332] Further, in an embodiment of the present application, the method for the decoder to determine the primary transformation core used by the sub-partition may include the following steps:

[0333] Step 204a: Determine DCT-2 as a primary transformation kernel.

[0334] In the embodiment of the present application, when the decoder determines the transform type when using a primary transform for a sub-partition, the decoder may directly determine DCT-2 as the primary transform kernel.

[0335] That is, in the present application, no matter whether the sub-partition uses LFNST or not, the primary transform kernel used by the sub-partition is DCT-2.

[0336] Step 204b: when the LFNST index number indicates that the sub-partition does not use LFNST, the preset transform kernel is determined as the primary transform kernel; when the LFNST index number indicates that the sub-partition uses LFNST, DCT-2 is determined as the primary transform kernel.

[0337] In an embodiment of the present application, when the decoder determines the transform type when a sub-partition uses a primary transform, if the LFNST index number indicates that the sub-partition does not use LFNST, the decoder may determine the preset transform core as the primary transform core; if the LFNST index number indicates that the sub-partition uses LFNST, the decoder may determine DCT-2 as the primary transform core. The preset transform core is any one of DCT-2, DST-7 or DCT-8.

[0338] That is, in the present application, the primary transform core when the sub-partition uses LFNST and the primary transform core when the sub-partition does not use LFNST may be different. Specifically, when the sub-partition uses LFNST, the decoder may determine the primary transform core of the sub-partition as DCT-2; when the sub-partition does not use LFNST, the decoder may determine any one of DCT-2, DST-7 or DCT-8 as the primary transform core of the sub-partition.

[0339] Step 204c: when the LFNST index number indicates that the sub-partition does not use LFNST, DCT-2 is determined as the primary transform kernel; when the LFNST index number indicates that the sub-partition uses LFNST, a preset transform kernel is determined as the primary transform kernel.

[0340] In an embodiment of the present application, when the decoder determines the transform type when a sub-partition uses a primary transform, if the LFNST index number indicates that the sub-partition uses LFNST, the decoder may determine the preset transform core as the primary transform core; if the LFNST index number indicates that the sub-partition does not use LFNST, the decoder may determine DCT-2 as the primary transform core. The preset transform core is any one of DCT-2, DST-7 or DCT-8.

[0341] That is to say, in the present application, the primary transform core when the sub-partition uses LFNST and the primary transform core when the sub-partition does not use LFNST may be different. Specifically, when the sub-partition does not use LFNST, the decoder may determine the primary transform core of the sub-partition as DCT-2; when the sub-partition uses LFNST, the decoder may determine any one of DCT-2, DST-7 or DCT-8 as the primary transform core of the sub-partition.

[0342] Step 204d: If the target transformation kernel is indicated by a syntax unit in the bitstream, the target transformation kernel is determined as a primary transformation kernel.

[0343] In an embodiment of the present application, when the decoder determines the transform type when using a primary transform for a sub-partition, if a target transform kernel is indicated by a syntax unit in the bitstream, the decoder may determine the target transform kernel as a primary transform kernel, wherein the target transform kernel is any one of DCT-2, DST-7 or DCT-8.

[0344] That is, in this application, regardless of whether the sub-partition uses LFNST, the primary transformation core used by the sub-partition is the target transformation core. That is, for the two different situations of using LFNST and not using LFNST in the sub-partition, the decoder can set the same primary transformation core.

[0345] Furthermore, in an embodiment of the present application, after determining the target transform core as a primary transform core, the decoder needs to indicate the transform type of the primary transform with a syntax element in the bitstream, that is, to indicate the target transform core with a syntax element.

[0346] It should be noted that, in an embodiment of the present application, on the encoding side, in the bitstream, the syntax unit indicating the target transform kernel is included in one or more data units in the following bitstream: a data unit containing the current block, a slice header information data unit, an image header information data unit, an image layer parameter set, and a sequence layer parameter set.

[0347] Accordingly, on the decoding side, the decoder parses the data unit in the bitstream, including the data unit of the current block, the slice header information data unit, the image header information data unit, the image layer parameter set, and one or more data units in the sequence layer parameter set, and obtains the value of the syntax unit to determine the target transform kernel.

[0348] Step 204e: If the first transform core and the second transform core are indicated by two syntax units in the bitstream respectively, when the LFNST index number indicates that the sub-partition does not use LFNST, the first transform core is determined as a primary transform core; when the LFNST index number indicates that the sub-partition uses LFNST, the second transform core is determined as a primary transform core.

[0349] In an embodiment of the present application, if the code stream indicates a first transform core and a second transform core respectively by two syntax units, when the decoder determines the transform type when a sub-partition uses a single transform, if the LFNST index number indicates that the sub-partition does not use LFNST, the decoder can determine the first transform core as a single transform core; if the LFNST index number indicates that the sub-partition uses LFNST, the decoder can determine the second transform core as a single transform core. The first transform core and the second transform core are any two of DCT-2, DST-7 or DCT-8.

[0350] That is to say, in the present application, for the two cases where the sub-partition uses LFNST and does not use LFNST, the decoder can set different primary transformation cores so that when the sub-partition does not use LFNST, the first transformation core is used for a transformation, and when LFNST is used, the second transformation core is used for a transformation.

[0351] Further, in an embodiment of the present application, for the two cases of using LFNST and not using LFNST for sub-partitions, after the encoder determines the first transform core or the second transform core as a primary transform core, it is necessary to indicate the transform type of the primary transform using two syntax elements in the bitstream, that is, use one syntax element to indicate the first transform core, and at the same time, use another syntax element to indicate the second transform core.

[0352] It should be noted that, in an embodiment of the present application, on the encoding side, in the bitstream, the syntax unit indicating the first transform core and the second transform core is included in one or more data units in the following bitstream: a data unit containing the current block, a slice header information data unit, an image header information data unit, an image layer parameter set, and a sequence layer parameter set.

[0353] Accordingly, on the decoding side, the decoder parses the data unit in the bitstream, including the data unit of the current block, the slice header information data unit, the image header information data unit, the image layer parameter set, and one or more data units in the sequence layer parameter set, and obtains the value of the syntax unit to determine the first transform kernel and the second transform kernel.

[0354] It can be seen that in the embodiment of the present application, when the decoder determines the primary transformation core to be used when performing a primary transformation on a sub-partition, the decoder can determine the primary transformation core in a variety of ways regardless of whether the sub-partition uses LFNST.

[0355] It can be understood that in the embodiment of the present application, regardless of whether the sub-partition uses LFNST, the decoder can directly determine DCT-2 as the primary transform core used when the sub-partition is changed once. That is to say, for any sub-partition of the current block, when the sub-partition does not use LFNST or uses LFNST, the primary transform core used when the sub-partition is transformed once is DCT-2.

[0356] It can be seen that in the present application, the decoder does not need to select a transform kernel according to the size of the sub-partition, nor does it need to distinguish the transform kernel according to whether the sub-partition uses LFNST, but can directly set the transform kernel to DCT-2.

[0357] Exemplarily, in the present application, when lfnst_idx==0, DCT-2 is directly used; when lfnst_idx==1or2, DCT-2 is directly used.

[0358] It can be understood that in an embodiment of the present application, if the sub-partition does not use LFNST, the decoder can directly determine the preset transform core as the primary transform core used when the sub-partition is changed once; if the sub-partition uses LFNST, the decoder can determine DCT-2 as the primary transform core used when the sub-partition is changed once.

[0359] It should be noted that, in the embodiment of the present application, the preset transform core is a fixed type pre-set by the decoder. Specifically, the preset transform core can be any one of DCT-2, DST-7 or DCT-8.

[0360] It can be seen that in the present application, when the sub-partition of the current block does not use LFNST, the decoder no longer needs to select a transform kernel according to the size of the sub-partition, but can directly set the transform kernel to the preset transform kernel. At the same time, when the sub-partition uses LFNST, DCT-2 is set to determine the transform kernel.

[0361] Exemplarily, in the present application, when lfnst_idx==0, DST-7 is directly used; when lfnst_idx==1or2, DCT-2 is directly used.

[0362] It can be understood that in an embodiment of the present application, if the sub-partition uses LFNST, the decoder can directly determine the preset transform core as the primary transform core used when the sub-partition is changed once; if the sub-partition does not use LFNST, the decoder can determine DCT-2 as the primary transform core used when the sub-partition is changed once.

[0363] It should be noted that, in the embodiment of the present application, the preset transform core is a fixed type pre-set by the decoder. Specifically, the preset transform core can be any one of DCT-2, DST-7 or DCT-8.

[0364] It can be seen that in the present application, when the sub-partition of the current block does not use LFNST, the decoder does not need to select a transform kernel according to the size of the sub-partition, but can directly set DCT-2 to determine the transform kernel. At the same time, when the sub-partition uses LFNST, the transform kernel is set to the preset transform kernel.

[0365] Exemplarily, in the present application, when lfnst_idx==0, DCT-2 is directly used; when lfnst_idx==1or2, DST-7 is directly used.

[0366] It can be understood that in the embodiment of the present application, regardless of whether the sub-partition uses LFNST, the decoder can directly indicate the primary transformation core used when the sub-partition is changed once with a syntax element in the bitstream. That is to say, for any sub-partition of the current block, when the sub-partition does not use LFNST or uses LFNST, the primary transformation core used when the sub-partition is transformed once is the same target transformation core. The target transformation core can be any one of DCT-2, DST-7 or DCT-8.

[0367] It can be seen that in the present application, the decoder does not need to select a transform core according to the size of the sub-partition, nor does it need to distinguish the transform core according to whether the sub-partition uses LFNST. Instead, the transform core can be directly indicated through the syntax unit in the bitstream.

[0368] Exemplarily, in the present application, when lfnst_idx==0, the target transformation core indicated by the syntax element is used; when lfnst_idx==1or2, the target transformation core indicated by the syntax element is used.

[0369] It can be understood that in an embodiment of the present application, if the sub-partition uses LFNST, the decoder can use a syntax unit syntax element in the code stream to indicate the primary transformation core used when the sub-partition is changed once; if the sub-partition does not use LFNST, the decoder can use another syntax unit syntax element in the code stream to indicate the primary transformation core used when the sub-partition is changed once.

[0370] Specifically, for two different situations in which the sub-partition uses LFNST and does not use LFNST, the decoder may indicate the first target core and the second target core respectively using two different syntax units in the bitstream.

[0371] It should be noted that, in the embodiments of the present application, the first target kernel and the second target kernel may be any two of DCT-2, DCT-7 or DCT-8.

[0372] It can be seen that in the present application, when the sub-partition of the current block does not use LFNST, the decoder does not need to select a transform kernel according to the size of the sub-partition, but can directly indicate the first transform kernel through a syntax unit in the bitstream. At the same time, when the sub-partition uses LFNST, the second transform kernel can be indicated through another syntax unit in the bitstream.

[0373] Exemplarily, in the present application, when lfnst_idx==0, the first transform core indicated by the syntax unit s0 is used; when ffnst_idx==1or2, the second transform core indicated by the syntax unit s1 is used.

[0374] It should be noted that, in an embodiment of the present application, the signal syntax element method of the decoder in the bitstream may include: block layer, slice layer, picture header, parameter set (sequence layer parameter set, picture layer parameter set, APS, etc.), and the override relationship between signal parameters in different data units, for example, the block layer can override the slice layer, etc., and the override between parameter sets.

[0375] Furthermore, in an embodiment of the present application, from the perspective of the encoder, that is, the encoding side, a primary transform core can be adaptively selected, and then the primary transform core is indicated using a corresponding syntax element in one or more data units of the block layer and written into the bitstream; from the perspective of the decoder, that is, the decoding side, the syntax element of one or more data units of the block layer in the bitstream is parsed, so that the primary transform core used can be determined.

[0376] It can be seen that in the present application, when the sub-partition of the current block does not use LFNST, the decoder does not need to select a transform kernel according to the size of the sub-partition, but can directly perform an adaptive setting of the transform kernel for the sub-partition.

[0377] Furthermore, in an embodiment of the present application, the decoder may determine a transformation core by the value of the variable isp_trType.

[0378] It should be noted that, in the embodiments of the present application, the value of the variable isp_trType can be 0, 1, or 2, wherein if the value of the variable isp_trType is 0, it means that DCT-2 is used as the primary transformation kernel; if the value of the variable isp_trType is 1, it means that DST-7 is used as the primary transformation kernel; and if the value of the variable isp_trType is 2, it means that DCT-8 is used as the primary transformation kernel.

[0379] It can be seen that the transformation method proposed in the embodiment of the present application, for the transformation of the ISP partition, does not use secondary transformation for the sub-partition after the current block is divided, and only uses one transformation. The sub-partition uses the transformation type of the single transformation, that is, the single transformation kernel, which is no longer determined by the size of the sub-partition, that is, the single transformation kernel is no longer selected according to the height and width of the sub-partition, but the single transformation kernel is directly set.

[0380] It can be seen that compared with the prior art, the transformation method proposed in the present application can simplify the method of determining the primary transformation core of the sub-partition divided by ISP when the value of lfnstIdx is equal to 0. Specifically, in the present application, if the sub-partition does not use LFNST, the decoder no longer determines the primary transformation core used by the sub-partition according to the size of the sub-partition, but directly sets the primary transformation core, thereby eliminating the processing flow of selecting the primary transformation core of the sub-partition according to the size of the sub-partition.

[0381] Step 205: Use a primary transformation kernel to transform the transformation coefficient matrix.

[0382] In an embodiment of the present application, after determining the primary transform kernel used by the sub-partition, the decoder can use the primary transform kernel to perform transform processing on the transform coefficient matrix.

[0383] It can be understood that in the embodiment of the present application, when the decoder uses a primary transform kernel to transform the transform coefficient matrix, it can use the primary transform kernel to perform an inverse primary transform on the transform coefficient matrix, so as to obtain the residual value of the sub-partition.

[0384] It should be noted that, in the embodiment of the present application, the primary transform kernel determined by the decoder may characterize the transform type of the sub-partition for the reverse primary transform, which may include the horizontal transform type and the vertical transform type when the sub-partition is reversely transformed. Specifically, the horizontal transform type and the vertical transform type of the sub-partition for the reverse primary transform are the same, that is, the decoder uses the same primary transform kernel to perform horizontal transform and vertical transform on the sub-partition respectively.

[0385] Further, in an embodiment of the present application, after the decoder uses the primary transform core to perform an inverse primary transform process on the residual value of the sub-partition, it can output the residual coefficient of the sub-partition after the primary transform.

[0386] It can be understood that in the embodiment of the present application, through the transformation method proposed in the above steps 201 to 206, when the decoder performs the transformation processing, by parsing the bitstream, the core parameters can be configured first, and then the transformation type can be selected, and then the reverse transformation can be performed based on the transformation type to complete the transformation processing. Wherein, when selecting the transformation type, if the sub-partition does not use LFNST, then the transformation type of the primary transformation, that is, the primary transformation core, is no longer selected based on the size of the sub-partition, but the applicability of the primary transformation core is directly determined.

[0387] Specifically, in the present application, the input of the reverse primary transform includes: the current luminance block position (xTbY, yTbY), the width of the current block nTbW, the height of the current block nTbH, the chrominance component of the current block cIdx, the prediction mode predMode of the current decoding unit, and the reverse primary transform coefficient matrix d[x][y] obtained by scanning after the reverse secondary transform. Among them, x = 0, 1, ..., nTbW-1, y = 0, 1, ..., nTbH-1.

[0388] When configuring the core parameters, the variable intra_subpartitions_mode_flag[x0][y0] determines whether to use the ISP mode. Specifically, if intra_subpartitions_mode_flag[x0][y0] is 1, it can be determined that the ISP mode is used; if intra_subpartitions_mode_flag[x0][y0] is equal to 0, it can be determined that the ISP mode is not used, which means that the current decoding unit is not divided.

[0389] Specifically, ISP can be divided horizontally or vertically according to the shape. The variable IntraSubPartitionsSplitType specifies the division type of the current brightness decoding block. When the variable IntraSubPartitionsSplitType is 0, it indicates that the current decoding block is not divided, that is, ISP_NO_SPLIT; when the variable IntraSubPartitionsSplitType is 1, it indicates that the current decoding block is divided horizontally, that is, ISP_HOR_SPLIT; when the variable IntraSubPartitionsSplitType is 2, it indicates that the current decoding block is divided vertically, that is, ISP_VER_SPLIT.

[0390] Since ISP can divide the current decoding block into 2 or 4 sub-partitions according to the size of the current decoding block, the variable NumIntraSubPartitions can be used to specify the number of sub-partitions into which the current decoding block is divided. When deriving NumIntraSubPartitions, specifically,

[0391] If IntraSubPartitionsSplitType is equal to ISP_NO_SPLIT, then NumIntraSubPartitions is set equal to 1;

[0392] Otherwise, NumIntraSubPartitions is set equal to 2 if one of the following conditions is true:

[0393] nTbW is equal to 4, nTbH is equal to 8;

[0394] nTbW is equal to 8, nTbW is equal to 4.

[0395] Otherwise, set NumIntraSubPartitions equal to 4.

[0396] Furthermore, the implicit selection variable implicitMtsEnabled is derived as follows:

[0397] If sps_mts_enabled_flag is equal to 1 and one or more of the following conditions are true, implicitMtsEnabled is set equal to 1:

[0398] cu_sbt_flag is equal to 1 and Max(nTbW, nTbH) is less than or equal to 32;

[0399] sps_explicit_mts_intra_enabled_flag is equal to 0 and CuPredMode[0][xTbY][yTbY] is equal to MODE_INTRA and lfnst_idx[x0][y0] is equal to 0 and intra_mip_flag[x0][y0] is equal to 0.

[0400] It can be seen that in the prior art, when deriving the variable implicitMtsEnabled, if IntraSubPartitionsSplitType is not equal to ISP_NO_SPLIT, the value of the variable implicitMtsEnabled can be set equal to 1, while in the present application, when deriving the value of the variable implicitMtsEnabled, it is no longer necessary to refer to the value of the variable IntraSubPartitionsSplitType.

[0401] Furthermore, the variable non-zero coefficient block sizes, namely the non-zero width coefficient nonZeroW and the non-zero height coefficient nonZeroH, are derived as shown in the above formulas (1) to (4).

[0402] The variable ApplyLfnstFlag is derived as shown in the above formulas (5) and (6).

[0403] Furthermore, when selecting the transformation type, the variable trTypeHor represents the horizontal transformation type, and the variable trTypeVer represents the vertical transformation type. The derivation of trTypeHor and trTypeVer is as follows:

[0404] If any of the following conditions are met, trTypeHor and trTypeVer are both set to 0:

[0405] cIdx is greater than 0;

[0406] IntraSubPartitionsSplitType is not equal to ISP_NO_SPLIT;

[0407] Otherwise, if the variable implicitMtsEnabled is equal to 1, then:

[0408] If cu_sbt_flag is equal to 1, trTypeHor and trTypeVer are determined by cu_sbt_horizontal_flag and cu_sbt_pos_flag in Table 5;

[0409] Otherwise (cu_sbt_flag is equal to 0), trTypeHor and trTypeVer derive the above formulas (7) and (8);

[0410] Otherwise, trTypeHor and trTypeVer are determined by mts_idx. in Table 4.

[0411] It can be seen that in the prior art, when deriving the variables trTypeHor and trTypeVer, when IntraSubPartitionsSplitType is not equal to ISP_NO_SPLIT and lfnst_idx is not equal to 0, trTypeHor and trTypeVer are both set to 0; when the value of the variable implicitMtsEnabled is equal to 1, if cu_sbt_flag is equal to 1, trTypeHor and trTypeVer are determined by cu_sbt_horizontal_flag and cu_sbt_pos_flag in Table 5; otherwise (cu_sbt_flag is equal to 0), trTypeHor and trTypeVer derive the above formulas (7) and (8); otherwise, trTypeHor and trTypeVer are determined by mrs_idx in Table 4. In the present application, on the one hand, when deriving the variable implicitMtsEnabled, the value of the variable IntraSubPartitionsSplitType is no longer referenced, that is, when IntraSubPartitionsSplitType is not equal to ISP_NO_SPLIT, the value of the variable implicitMtsEnabled is not 1, and further, when IntraSubPartitionsSplitType is not equal to ISP_NO_SPLIT, it is no longer necessary to derive the variables trTypeHor and trTypeVer according to Table 4, Table 5 and formulas (7) and (8); on the other hand, in the condition where both trTypeHor and trTypeVer are set to 0, it is no longer necessary to refer to the case where lfnst_idx is not equal to 0.

[0412] It can be understood that in an embodiment of the present application, if the sub-partition uses the ISP mode, then when the sub-partition does not use LFNST, the primary transformation core used by the sub-partition is no longer determined according to the size of the sub-partition, but the primary transformation core suitable for the sub-partition is directly set, thereby eliminating the processing flow of selecting the primary transformation core of the sub-partition according to the size of the sub-partition.

[0413] Furthermore, when performing an inverse primary transformation, the sub-partitions may be subjected to a one-dimensional vertical transformation, calculation of intermediate coefficient values, a one-dimensional horizontal transformation, and acquisition of residual coefficients in sequence.

[0414] Specifically, for one-dimensional vertical transformation, if nTbH is greater than 1, the following one-dimensional inverse primary transformation process is called, whose input is the inverse primary transformation coefficient d[x][y] obtained after the inverse secondary transformation, x=0...nonZeroW-1, y=0...nonZeroH-1, transformation block height nTbH and non-zero height coefficient nonZeroH, vertical transformation type trTypeVer; the output is e[x][y], x=0...nonZeroW-1, y=0...nonZeroH-1.

[0415] Specifically, when calculating the intermediate coefficient value, if nTbH and nTbW are both greater than 1, the intermediate sample value g[x][y], x=0...nonZeroW-1, y=0...nonZeroH-1 is derived as shown in the above formula (9).

[0416] Specifically, for one-dimensional horizontal transformation, if nTbW is greater than 1, the following one-dimensional inverse single transformation process is called, whose input is the intermediate sample value g[x][y], x=0...nonZeroW-1, y=0...nonZeroH-1, transformation block width nTbW and non-zero width coefficient nonZeroW, horizontal transformation type trTypeHor; the output is r[x][y], x=0...nonZeroW-1, y=0...nonZeroH-1.

[0417] If nTbW is equal to 1, then r[x][y] is set equal to e[x][y], x = 0...nonZeroW-1, y = 0...nonZeroH-1

[0418] Specifically, when obtaining the residual coefficients, the residual coefficient matrix res[x][y], x=0...nonZeroW-1, y=0...nonZeroH-1 is derived as shown in the above formulas (10) and (11).

[0419] Specifically, for the one-dimensional inverse single transform process, the process mainly performs a one-dimensional inverse single transform, and its input nTbS represents the length of the transform coefficient, nonZeroS represents the length of the non-zero coefficient, x[j], j=0...nonZeroS represents the coefficient that has not undergone one-dimensional inverse single transform, trType represents the transform type; the output is the coefficient y[i], i=0...nonZeroS that has undergone one-dimensional inverse single transform.

[0420] First, the transformation matrix transMatrix is ​​obtained according to the transformation coefficient length nTbS and the transformation type trType, and then y[i] is calculated according to trType, i = 0...nonZeroS:

[0421] If trType is equal to 0, the calculation method is the same as the above formula (12); otherwise (trType is equal to 1 or 2), the calculation method is the same as the above formula (13).

[0422] In an embodiment of the present application, after the decoder determines the LFNST transform core used by the sub-partition, that is, the decoder obtains the value of the LFNST index number (lfnst_idx) by parsing the bitstream; then, according to the value of lfnst_idx, the transform matrix (transform core) indicated by lfnst_idx can be selected from the LFNST transform core candidate set. For example, when lfnst_idx is 1, the first group of transform matrices can be used as the LFNST transform core during decoding; when lfnst_idx is 2, the second group of transform matrices can be used as the LFNST transform core during decoding.

[0423] The present application proposes a transformation method, which is applied to a decoder, wherein the decoder parses the bitstream and determines the ISP mode parameters of the current block; when the ISP mode parameters indicate that the current block uses the ISP mode to determine the intra-frame prediction value of the current block, the sub-partition of the current block is determined; the bitstream is parsed to determine the transformation coefficient matrix of the sub-partition; the primary transformation kernel used by the sub-partition is determined; and the transformation coefficient matrix is ​​transformed using the primary transformation kernel. It can be seen that in an embodiment of the present application, for the transformation of the ISP partition, when the sub-partition after the current block is divided does not use a secondary transformation and only uses a single transformation, the sub-partition uses a primary transformation kernel of a single transformation, which is no longer determined by the size of the sub-partition, that is, the primary transformation kernel is no longer selected according to the height and width of the sub-partition, but the primary transformation kernel is directly set. This simplifies the selection process of the transformation kernel, reduces the complexity of the transformation process, and effectively improves the encoding and decoding efficiency.

[0424] Based on the above embodiment, in yet another embodiment of the present application, Fig. 20 The structure of the encoder is shown in Figure 2. Figure 1 ,like Fig. 20 As shown, the encoder 300 proposed in the embodiment of the present application may include a first determining part 301, a first transforming part 302, a setting part 303,

[0425] The first determining part 301 is configured to determine an ISP mode parameter of the current block; and when the ISP mode parameter indicates that the current block uses the ISP mode to determine the intra prediction value of the current block, determine the sub-partition of the current block; and determine the residual value of the sub-partition; and when the sub-partition uses a single transform, determine the single transform kernel used by the sub-partition;

[0426] The first transform part 302 is configured to use the primary transform kernel to perform transform processing on the residual value.

[0427] Further, in an embodiment of the present application, the first determining part 301 is specifically configured to determine a partition type of the current block; and obtain the sub-partition based on a size parameter of the current block and the partition type.

[0428] Further, in an embodiment of the present application, the size parameter includes a width value and a height value, the division type includes horizontal division and vertical division, and the first determination part 301 is further specifically configured to, when the width value is equal to 4 and the height value is equal to 8, or the width value is equal to 8 and the height value is equal to 4, obtain 2 sub-partitions after the current block is horizontally divided or vertically divided; when the width value is equal to 4 and the height value is greater than 8, or the width value is greater than 8 and the height value is equal to 4, obtain 4 sub-partitions after the current block is horizontally divided or vertically divided.

[0429] Further, in an embodiment of the present application, the first determination part 301 is further specifically configured to determine the intra-frame prediction value of the sub-partition; and calculate the residual value between the true value of the sub-partition and the intra-frame prediction value.

[0430] Furthermore, in the embodiment of the present application, the first determining part 301 is further specifically configured to determine DCT-2 as the primary transform kernel.

[0431] Further, in an embodiment of the present application, the first determination part 301 is also specifically configured to, when the sub-partition does not use LFNST, determine the preset transform core as the primary transform core; wherein the preset transform core is any one of DCT-2, DST-7 or DCT-8; when the sub-partition uses LFNST, DCT-2 is determined as the primary transform core.

[0432] Further, in an embodiment of the present application, the first determination part 301 is also specifically configured to determine DCT-2 as the primary transform kernel when the sub-partition does not use LFNST; when the sub-partition uses LFNST, determine the preset transform kernel as the primary transform kernel; wherein the preset transform kernel is any one of DCT-2, DST-7 or DCT-8.

[0433] Furthermore, in an embodiment of the present application, the first determination part 301 is also specifically configured to determine the target transform kernel as the primary transform kernel; wherein the target transform kernel is any one of DCT-2, DST-7 or DCT-8; accordingly, the target transform kernel is indicated by a syntax unit in the bit stream.

[0434] Further, in an embodiment of the present application, in the bitstream, the syntax unit is included in one or more data units in the following bitstream: a data unit containing the current block, a slice header information data unit, an image header information data unit, an image layer parameter set, and a sequence layer parameter set.

[0435] Further, in an embodiment of the present application, the first determination part 301 is further specifically configured to, when the sub-partition does not use LFNST, determine the first transform core as the primary transform core; when the sub-partition uses LFNST, determine the second transform core as the primary transform core; wherein the first transform core and the second transform core are any two of DCT-2, DST-7 or DCT-8; accordingly, the first transform core and the second transform core are indicated respectively by two syntax units in the bitstream.

[0436] Further, in an embodiment of the present application, in the bitstream, the syntax unit is included in one or more data units in the following bitstream: a data unit containing the current block, a slice header information data unit, an image header information data unit, an image layer parameter set, and a sequence layer parameter set.

[0437] Further, in an embodiment of the present application, the setting part 303 is configured to, when the sub-partition does not use LFNST, set the value of the LFNST index number to indicate that the sub-partition does not use LFNST; and write the LFNST index number into the bitstream.

[0438] Further, in an embodiment of the present application, the setting part 303 is also configured to, when the sub-partition uses LFNST, determine the LFNST transformation core used by the sub-partition, set the value of the LFNST index number to indicate that the sub-partition uses LFNST; and write the LFNST index number into the bitstream.

[0439] Fig.21 The structure of the encoder is shown in Figure 2. Figure 2 ,like Fig.21 As shown, the encoder 300 proposed in the embodiment of the present application may also include a first processor 304, a first memory 305 storing executable instructions of the first processor 304, a first communication interface 306, and a first bus 307 for connecting the first processor 304, the first memory 305 and the first communication interface 306.

[0440] Further, in an embodiment of the present application, the above-mentioned first processor 304 is used to determine the ISP mode parameters of the current block; when the ISP mode parameters indicate that the current block uses the ISP mode to determine the intra-frame prediction value of the current block, determine the sub-partition of the current block; determine the residual value of the sub-partition; when the sub-partition uses a single transformation, determine the single transformation kernel used by the sub-partition; and use the single transformation kernel to transform the residual value.

[0441] If the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment is essentially or the part that contributes to the prior art or the whole or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) or a processor to perform all or part of the steps of the method of this embodiment. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.

[0442] The embodiment of the present application provides an encoder, for the transformation of ISP partitions, when the sub-partition after the current block is divided does not use secondary transformation and only uses primary transformation, the sub-partition uses a primary transformation kernel of the primary transformation, which is no longer determined by the size of the sub-partition, that is, the primary transformation kernel is no longer selected according to the height and width of the sub-partition, but the primary transformation kernel is directly set. Thereby, the selection process of the transformation kernel can be simplified, the complexity of the transformation process is reduced, and the encoding and decoding efficiency is effectively improved.

[0443] Fig. 22 The structure of the decoder is shown in Figure 2. Figure 1 ,like Fig. 22 As shown, the decoder 400 proposed in the embodiment of the present application may include a parsing part 401, a second determining part 402, a second transforming part 403,

[0444] The parsing part 401 is configured to parse the bitstream and determine the ISP mode parameters of the current block;

[0445] The second determining part 402 is configured to determine a sub-partition of the current block when the ISP mode parameter indicates that the current block uses the ISP mode to determine the intra prediction value of the current block;

[0446] The parsing part 401 is further configured to parse the bitstream to determine the transform coefficient matrix of the sub-partition;

[0447] The second determining part 402 is further configured to determine a primary transformation core used by the sub-partition;

[0448] The second transform part 403 is configured to use the primary transform kernel to perform transform processing on the transform coefficient matrix.

[0449] Further, in an embodiment of the present application, the second determining part 402 is specifically configured to determine the size parameter and the partition type of the current block; and obtain the sub-partition based on the size parameter and the partition type of the current block.

[0450] Further, in an embodiment of the present application, the size parameter includes a width value and a height value, the division type includes horizontal division and vertical division, and the second determination part 402 is further specifically configured to, when the width value is equal to 4 and the height value is equal to 8, or the width value is equal to 8 and the height value is equal to 4, obtain 2 sub-partitions after the current block is horizontally divided or vertically divided; when the width value is equal to 4 and the height value is greater than 8, or the width value is greater than 8 and the height value is equal to 4, obtain 4 sub-partitions after the current block is horizontally divided or vertically divided.

[0451] Furthermore, in an embodiment of the present application, the parsing part 401 is also configured to parse the bitstream and determine the LFNST index number of the sub-partition after determining the sub-partition of the current block when the ISP mode parameter indicates that the current block uses the ISP mode to determine the intra-frame prediction value of the current block.

[0452] Furthermore, in the embodiment of the present application, the second determining part 402 is further specifically configured to determine DCT-2 as the primary transformation kernel.

[0453] Further, in an embodiment of the present application, the second determination part 402 is also specifically configured to determine the preset transform core as the primary transform core when the LFNST index number indicates that the sub-partition does not use LFNST; wherein the preset transform core is any one of DCT-2, DST-7 or DCT-8; when the LFNST index number indicates that the sub-partition uses LFNST, DCT-2 is determined as the primary transform core.

[0454] Further, in an embodiment of the present application, the second determination part 402 is also specifically configured to determine DCT-2 as the primary transform core when the LFNST index number indicates that the sub-partition does not use LFNST; when the LFNST index number indicates that the sub-partition uses LFNST, determine the preset transform core as the primary transform core; wherein the preset transform core is any one of DCT-2, DST-7 or DCT-8.

[0455] Furthermore, in an embodiment of the present application, the second determination part 402 is also specifically configured to determine the target transform core as the primary transform core if a syntax unit is used in the bit stream to indicate the target transform core; wherein the target transform core is any one of DCT-2, DST-7 or DCT-8.

[0456] Furthermore, in an embodiment of the present application, the data unit containing the current block, the slice header information data unit, the image header information data unit, the image layer parameter set, and one or more data units in the sequence layer parameter set in the code stream are parsed to obtain the value of the syntax unit to determine the target transform kernel.

[0457] Further, in an embodiment of the present application, the second determination part 402 is also specifically configured to, if the first transform core and the second transform core are respectively indicated by two syntax units in the code stream, then when the LFNST index number indicates that the sub-partition does not use LFNST, the first transform core is determined as the primary transform core; when the LFNST index number indicates that the sub-partition uses LFNST, the second transform core is determined as the primary transform core; wherein the first transform core and the second transform core are any two of DCT-2, DST-7 or DCT-8.

[0458] Furthermore, in an embodiment of the present application, one or more data units in the code stream, including a data unit of the current block, a slice header information data unit, an image header information data unit, an image layer parameter set, and a sequence layer parameter set, are parsed to obtain the value of the syntax unit to determine the first transform kernel and the second transform kernel.

[0459] Further, in an embodiment of the present application, the second transform part 403 is specifically configured to use the primary transform kernel to perform an inverse primary transform on the transform coefficient matrix to obtain the residual value of the sub-partition.

[0460] Fig.23 The structure of the decoder is shown in Figure 2. Figure 2 ,like Fig.23As shown, the decoder 400 proposed in the embodiment of the present application may also include a second processor 404, a second memory 405 storing executable instructions of the second processor 404, a second communication interface 406, and a second bus 407 for connecting the second processor 404, the second memory 405 and the second communication interface 406.

[0461] Further, in an embodiment of the present application, the above-mentioned second processor 404 is used to parse the bitstream and determine the ISP mode parameters of the current block; when the ISP mode parameters indicate that the current block uses the ISP mode to determine the intra-frame prediction value of the current block, determine the sub-partition of the current block; parse the bitstream and determine the transformation coefficient matrix of the sub-partition; when the sub-partition uses a single transformation, determine the single transformation kernel used by the sub-partition; and use the single transformation kernel to transform the transformation coefficient matrix.

[0462] If the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment is essentially or the part that contributes to the prior art or the whole or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) or a processor to perform all or part of the steps of the method of this embodiment. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.

[0463] The embodiment of the present application provides a decoder, for the transformation of ISP partitions, when the sub-partition after the current block division does not use secondary transformation and only uses primary transformation, the sub-partition uses the primary transformation core of the primary transformation, which is no longer determined by the size of the sub-partition, that is, the primary transformation core is no longer selected according to the height and width of the sub-partition, but the primary transformation core is directly set. Thereby, the selection process of the transformation core can be simplified, the complexity of the transformation process is reduced, and the encoding and decoding efficiency is effectively improved.

[0464] The embodiments of the present application provide a computer-readable storage medium and a computer-readable storage medium, on which a program is stored. When the program is executed by a processor, the method described in the above embodiments is implemented.

[0465] Specifically, the program instructions corresponding to a transformation method in this embodiment can be stored in a storage medium such as a CD, a hard disk, a USB flash drive, etc. When the program instructions corresponding to a transformation method in the storage medium are read or executed by an electronic device, the following steps are included:

[0466] Determine the ISP mode parameters of the current block;

[0467] When the ISP mode parameter indicates that the current block uses the ISP mode to determine the intra prediction value of the current block, determining a sub-partition of the current block;

[0468] determining a residual value for the subpartition;

[0469] When the sub-partition uses a primary transformation, determining a primary transformation kernel used by the sub-partition;

[0470] The residual value is transformed using the primary transformation kernel.

[0471] Specifically, the program instructions corresponding to a transformation method in this embodiment can be stored in a storage medium such as a CD, a hard disk, a USB flash drive, etc. When the program instructions corresponding to a transformation method in the storage medium are read or executed by an electronic device, the following steps are included:

[0472] Parse the bitstream and determine the ISP mode parameters of the current block;

[0473] When the ISP mode parameter indicates that the current block uses the ISP mode to determine the intra prediction value of the current block, determining a sub-partition of the current block;

[0474] Parsing a bitstream to determine a transform coefficient matrix of the sub-partition;

[0475] When the sub-partition uses a primary transformation, determining a primary transformation kernel used by the sub-partition;

[0476] The transformation coefficient matrix is ​​transformed using the primary transformation kernel.

[0477] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of hardware embodiments, software embodiments, or embodiments in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) that contain computer-usable program code.

[0478] The present application is described with reference to implementation flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0479] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which is implemented in the implementation flow diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0480] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for executing the steps in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0481] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application.

[0482] Industrial Applicability

[0483] The embodiment of the present application provides a transformation method, an encoder, a decoder and a storage medium, wherein the encoder determines the ISP mode parameters of the current block; when the ISP mode parameters indicate that the current block uses the ISP mode to determine the intra-frame prediction value of the current block, the sub-partition of the current block is determined; the residual value of the sub-partition is determined; when the sub-partition uses a single transformation, the single transformation kernel used by the sub-partition is determined; and the residual value is transformed using the single transformation kernel. The decoder parses the bitstream to determine the ISP mode parameters of the current block; when the ISP mode parameters indicate that the current block uses the ISP mode to determine the intra-frame prediction value of the current block, the sub-partition of the current block is determined; the bitstream is parsed to determine the transformation coefficient matrix of the sub-partition; the single transformation kernel used by the sub-partition is determined; and the transformation coefficient matrix is ​​transformed using the single transformation kernel. It can be seen that in the embodiment of the present application, for the transformation of the ISP partition, when the sub-partition after the current block is divided does not use a secondary transformation and only uses a single transformation, the sub-partition uses a single transformation kernel of a single transformation, which is no longer determined by the size of the sub-partition, that is, the single transformation kernel is no longer selected according to the height and width of the sub-partition, but the single transformation kernel is directly set. This can simplify the transformation kernel selection process, reduce the complexity of the transformation process, and effectively improve the encoding and decoding efficiency.

Claims

1. A transformation method, applied to an encoder, the method include: Determine the intra-sub-partition ISP mode parameters of the current block; When the ISP mode parameter indicates that the current block uses the ISP mode to determine the intra prediction value of the current block, determining a sub-partition of the current block; determining a residual value for the subpartition; When the sub-partition uses a primary transformation, determining a primary transformation kernel used by the sub-partition; Using the primary transformation kernel, transforming the residual value; The step of determining a primary transformation core used by the sub-partition includes: When the sub-partition does not use the low frequency non-separable transform LFNST, a preset transform core is determined as the primary transform core; wherein the preset transform core is any one of DCT-2, DST-7 or DCT-8; When the sub-partition uses LFNST, DCT-2 is determined as the primary transform kernel.

2. The method according to claim 1, in, The determining of the sub-partition of the current block comprises: Determining a partition type of the current block; The sub-partition is obtained based on a size parameter of the current block and the partition type.

3. The method according to claim 2, in, The size parameter includes a width value and a height value, the partition type includes horizontal partition and vertical partition, and obtaining the sub-partition based on the size parameter of the current block and the partition type includes: When the width value is equal to 4 and the height value is equal to 8, or the width value is equal to 8 and the height value is equal to 4, two sub-partitions are obtained after the current block is horizontally divided or vertically divided; When the width value is equal to 4 and the height value is greater than 8, or the width value is greater than 8 and the height value is equal to 4, 4 sub-partitions are obtained after the current block is horizontally divided or vertically divided.

4. The method according to claim 1, in, The determining the residual value of the sub-partition includes: determining an intra prediction value for the subpartition; The residual value between the true value of the sub-partition and the intra-frame prediction value is calculated.

5. The method according to claim 1, in, The determining of a primary transformation core used by the sub-partition comprises: DCT-2 is determined as the primary transform kernel.

6. The method according to claim 1, in, The determining of a primary transformation core used by the sub-partition comprises: When the sub-partition does not use LFNST, DCT-2 is determined as the primary transformation kernel; When the sub-partition uses LFNST, a preset transformation core is determined as the primary transformation core; wherein the preset transformation core is any one of DCT-2, DST-7 or DCT-8.

7. The method according to claim 1, in, The determining of a primary transformation core used by the sub-partition comprises: Determine the target transformation kernel as the primary transformation kernel; wherein the target transformation kernel is any one of DCT-2, DST-7 or DCT-8; Accordingly, The target transform kernel is indicated by a syntax unit in the code stream.

8. The method according to claim 7, in, The method further comprises: In the bitstream, the syntax unit is included in one or more of the following data units in the bitstream: a data unit including the current block, a slice header information data unit, a picture header information data unit, a picture layer parameter set, and a sequence layer parameter set.

9. The method according to claim 1, in, The determining of a primary transformation core used by the sub-partition comprises: When the sub-partition does not use LFNST, determining the first transformation core as the primary transformation core; When the sub-partition uses LFNST, the second transform core is determined as the primary transform core; wherein the first transform core and the second transform core are any two of DCT-2, DST-7 or DCT-8; Accordingly, The first transform kernel and the second transform kernel are indicated by two syntax units in the code stream respectively.

10. The method according to claim 9, in, The method further comprises: In the bitstream, the syntax unit is included in one or more of the following data units in the bitstream: a data unit including the current block, a slice header information data unit, a picture header information data unit, a picture layer parameter set, and a sequence layer parameter set.

11. The method according to any one of claims 5 to 10, in, The method further comprises: When the sub-partition does not use LFNST, the value of the LFNST index number is set to indicate that the sub-partition does not use LFNST; The LFNST index number is written into the bitstream.

12. The method according to any one of claims 5 to 10, in, The method further comprises: When the sub-partition uses LFNST, determine the LFNST transformation core used by the sub-partition, and set the value of the LFNST index number to indicate that the sub-partition uses LFNST; The LFNST index number is written into the bitstream.

13. A transformation method, applied to a decoder, the method include: Parse the bitstream and determine the ISP mode parameters of the current block; When the ISP mode parameter indicates that the current block uses the ISP mode to determine the intra prediction value of the current block, determining a sub-partition of the current block; Parsing a bitstream to determine a transform coefficient matrix of the sub-partition; Parsing the bitstream to determine the LFNST index number of the sub-partition; When the sub-partition uses a primary transformation, determining a primary transformation kernel used by the sub-partition; Using the primary transformation kernel, performing transformation processing on the transformation coefficient matrix; The step of determining a primary transformation core used by the sub-partition includes: When the LFNST index number indicates that the sub-partition does not use LFNST, a preset transformation core is determined as the primary transformation core; wherein the preset transformation core is any one of DCT-2, DST-7 or DCT-8; When the LFNST index number indicates that the sub-partition uses LFNST, DCT-2 is determined as the primary transform kernel.

14. The method according to claim 13, in, The determining of the sub-partition of the current block comprises: Determining a size parameter and a partition type of the current block; The sub-partition is obtained based on a size parameter of the current block and the partition type.

15. The method according to claim 14, in, The size parameter includes a width value and a height value, the partition type includes horizontal partition and vertical partition, and obtaining the sub-partition based on the size parameter of the current block and the partition type includes: When the width value is equal to 4 and the height value is equal to 8, or the width value is equal to 8 and the height value is equal to 4, two sub-partitions are obtained after the current block is horizontally divided or vertically divided; When the width value is equal to 4 and the height value is greater than 8, or the width value is greater than 8 and the height value is equal to 4, 4 sub-partitions are obtained after the current block is horizontally divided or vertically divided.

16. The method according to claim 13, in, The determining of a primary transformation core used by the sub-partition comprises: DCT-2 is determined as the primary transform kernel.

17. The method according to claim 13, in, The determining of a primary transformation core used by the sub-partition comprises: When the LFNST index number indicates that the sub-partition does not use LFNST, determining DCT-2 as the primary transform kernel; When the LFNST index number indicates that the sub-partition uses LFNST, a preset transformation core is determined as the primary transformation core; wherein the preset transformation core is any one of DCT-2, DST-7 or DCT-8.

18. The method according to claim 13, in, The determining of a primary transformation core used by the sub-partition comprises: If a target transform kernel is indicated by a syntax unit in the bitstream, the target transform kernel is determined as the primary transform kernel; wherein the target transform kernel is any one of DCT-2, DST-7 or DCT-8.

19. The method according to claim 18, in, The method further comprises: Parse the data unit containing the current block, the slice header information data unit, the image header information data unit, the image layer parameter set, and one or more data units in the sequence layer parameter set in the code stream to obtain the value of the syntax unit to determine the target transform kernel.

20. The method according to claim 13, in, The determining of a primary transformation core used by the sub-partition comprises: If two syntax units are used in the bitstream to respectively indicate a first transform core and a second transform core, when the LFNST index number indicates that the sub-partition does not use LFNST, the first transform core is determined as the primary transform core; when the LFNST index number indicates that the sub-partition uses LFNST, the second transform core is determined as the primary transform core; wherein the first transform core and the second transform core are any two of DCT-2, DST-7 or DCT-8.

21. The method according to claim 20, in, The method further comprises: Parse the data unit containing the current block, the slice header information data unit, the image header information data unit, the image layer parameter set, and one or more data units in the sequence layer parameter set in the code stream to obtain the value of the syntax unit to determine the first transform kernel and the second transform kernel.

22. The method according to claim 13, in, The using the primary transformation kernel to transform the transformation coefficient matrix includes: The transform coefficient matrix is ​​inversely transformed using the primary transform kernel to obtain residual values ​​of the sub-partitions.

23. An encoder, the encoder include: a first determination part, a first transformation part, The first determining part is configured to determine the ISP mode parameters of the current block; and when the ISP mode parameter indicates that the current block uses the ISP mode to determine an intra prediction value of the current block, determining a sub-partition of the current block; and determining a residual value for the sub-partition; and when the sub-partition uses a primary transformation, determining a primary transformation kernel used by the sub-partition; The first transform part is configured to use the primary transform kernel to perform transform processing on the residual value; The first determination part is specifically configured to determine a preset transformation core as the primary transformation core when the sub-partition does not use the low-frequency non-separable transform LFNST; wherein the preset transformation core is any one of DCT-2, DST-7 or DCT-8; when the sub-partition uses LFNST, DCT-2 is determined as the primary transformation core.

24. An encoder, comprising a first processor and a first memory storing instructions executable by the first processor, wherein when the instructions are executed, the first processor implements the method according to any one of claims 1 to 12.

25. A decoder, the decoder include: Analytical part, second determination part, second transformation part, The parsing part is configured to parse the bitstream and determine the ISP mode parameters of the current block; The second determining part is configured to determine a sub-partition of the current block when the ISP mode parameter indicates that the current block uses the ISP mode to determine the intra-frame prediction value of the current block; The parsing part is further configured to parse the bitstream to determine the transform coefficient matrix of the sub-partition; The parsing part is further configured to parse the bitstream and determine the LFNST index number of the sub-partition; The second determining part is further configured to determine a primary transformation core used by the sub-partition; The second transform section is configured to use the primary transform kernel to perform a transform process on the transform coefficient matrix; The second determination part is specifically configured to determine the preset transformation core as the primary transformation core when the LFNST index number indicates that the sub-partition does not use LFNST; wherein the preset transformation core is any one of DCT-2, DST-7 or DCT-8; when the LFNST index number indicates that the sub-partition uses LFNST, DCT-2 is determined as the primary transformation core.

26. A decoder, comprising a second processor and a second memory storing instructions executable by the second processor, wherein when the instructions are executed, the second processor implements the method according to any one of claims 13 to 22.

27. A computer storage medium, in, The computer storage medium stores a computer program, which implements the method according to any one of claims 1 to 12 when executed by a first processor, or implements the method according to any one of claims 13 to 22 when executed by a second processor.