WO2021196231A1 - 变换方法、编码器、解码器以及存储介质 - Google Patents

变换方法、编码器、解码器以及存储介质 Download PDF

Info

Publication number
WO2021196231A1
WO2021196231A1 PCT/CN2020/083367 CN2020083367W WO2021196231A1 WO 2021196231 A1 WO2021196231 A1 WO 2021196231A1 CN 2020083367 W CN2020083367 W CN 2020083367W WO 2021196231 A1 WO2021196231 A1 WO 2021196231A1
Authority
WO
WIPO (PCT)
Prior art keywords
sub
transformation
partition
core
lfnst
Prior art date
Application number
PCT/CN2020/083367
Other languages
English (en)
French (fr)
Inventor
霍俊彦
乔文涵
马彦卓
万帅
杨付正
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Priority to PCT/CN2020/083367 priority Critical patent/WO2021196231A1/zh
Priority to CN202080071780.2A priority patent/CN114556943A/zh
Priority to TW110109410A priority patent/TW202139714A/zh
Publication of WO2021196231A1 publication Critical patent/WO2021196231A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/513Processing of motion vectors

Definitions

  • the embodiments of the present application relate to the field of image processing technologies, and in particular, to a transformation method, an encoder, a decoder, and a storage medium.
  • VVC High Efficiency Video Coding
  • VTM VVC Test Model
  • H.266/VVC has accepted the simplified secondary transform (Reduced Second Transform, RST) technology, and changed its name to Low-Frequency Non-Separable Transform (LFNST) technology.
  • the transformation part in VVC includes primary transformation and secondary transformation.
  • One transformation supports multiple transformation cores, called Multiple Transform Set (MTS) technology
  • MTS Multiple Transform Set
  • the secondary transformation is LFNST, where the secondary transformation indicates whether to use the secondary transformation through lfnst_idx, and which lfnst transformation core is used .
  • the embodiments of the present application provide a transformation method, an encoder, a decoder, and a storage medium, which can simplify the selection process of the transformation core, reduce the complexity of the transformation process, and effectively improve the coding and decoding efficiency.
  • an embodiment of the present application provides a transformation method applied to an encoder, and the method includes:
  • the ISP mode parameter indicates that the current block uses the ISP mode to determine the intra prediction value of the current block, determining the sub-partition of the current block;
  • transformation processing is performed on the residual value.
  • an embodiment of the present application provides a transformation method applied to a decoder, and the method includes:
  • the ISP mode parameter indicates that the current block uses the ISP mode to determine the intra prediction value of the current block, determining the sub-partition of the current block;
  • the transformation processing is performed on the transformation coefficient matrix using the primary transformation core.
  • an embodiment of the present application provides an encoder, the encoder includes: a first determining part, a first transforming part,
  • the first determining part is configured to determine the 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 current block Sub-partition; and determining the residual value of the sub-partition; and when the sub-partition uses one transformation, determining the one-time transformation core used by the sub-partition;
  • the first transformation part is configured to use the primary transformation kernel to perform transformation processing on the residual value.
  • an embodiment of the present application provides an encoder.
  • the encoder includes a first processor and a first memory storing executable instructions of the first processor. When the instructions are executed, the encoder When the first processor is executed, the conversion method as described above is implemented.
  • an embodiment of the present application provides a decoder, which includes: an analysis part, a second determination part, and a second transformation part,
  • the parsing part is configured to analyze the code stream and determine the ISP mode parameters of the current block
  • the second determining part is configured to determine 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 prediction value of the current block;
  • the analyzing part is further configured to analyze the code stream and determine the transformation coefficient matrix of the sub-division;
  • the second determining part is further configured to determine the primary transformation core used by the sub-partition
  • the second transformation part is configured to use the primary transformation core to perform transformation processing on the transformation coefficient matrix.
  • an embodiment of the present application provides a decoder.
  • the decoder includes a second processor and a second memory storing executable instructions of the second processor. When the instructions are executed, the decoder When the second processor is executed, the conversion method as described above is implemented.
  • an embodiment of the present application provides a computer storage medium, the computer storage medium stores a computer program, and when the computer program is executed by the first processor and the second processor, the conversion method as described above is implemented .
  • the embodiments of the present application provide a transformation method, an encoder, a decoder, and a storage medium.
  • the encoder determines the ISP mode parameter 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, Determine the sub-division of the current block; determine the residual value of the sub-division; when the sub-division uses a transformation, determine the primary transformation kernel used by the sub-division; use a transformation kernel to perform transformation processing on the residual value.
  • the decoder parses the code stream and determines 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, the sub-partition of the current block is determined; the code stream is parsed to determine the transformation of the sub-partition Coefficient matrix; determine the primary transformation kernel used by the sub-division; use the primary transformation kernel to perform transformation processing on the transformation coefficient matrix. It can be seen that, in the embodiment of the present application, for the transformation of the ISP partition, the sub-partition after the current block division does not use the secondary transformation.
  • the sub-partition uses the primary transformation core of the primary transformation, and no longer Determined by the size of the sub-region, that is, no longer select a transformation core according to the height and width of the sub-region, but directly set the primary transformation core.
  • the selection process of the transformation core can be simplified, the complexity of the transformation process can be reduced, and the coding and decoding efficiency can be effectively improved.
  • Figure 1 is a schematic diagram of the application of LFNST technology
  • FIG. 2 is a flow chart of the specific process of LFNST
  • Figure 3 is a first schematic diagram of coding block division
  • Figure 4 is a second schematic diagram of coding block division
  • Figure 5 is a third schematic diagram of coding block division
  • Figure 6 is a fourth schematic diagram of coding block division
  • Figure 7 is a schematic diagram of ISP mode conversion selection
  • Figure 8 is the first schematic diagram of the realization of the reverse primary transformation
  • Figure 9 is the second schematic diagram of the realization of the reverse primary transformation
  • Figure 10 is a block diagram of the video encoding system
  • Figure 11 is a block diagram of the composition of a video decoding system
  • Figure 12 is the first schematic diagram of the implementation process of the transformation method
  • Figure 13 is a second schematic diagram of the implementation process of the transformation method
  • FIG. 14 is a schematic diagram of the determination process of the transformation core
  • Figure 15 is the third schematic diagram of the implementation process of the transformation method.
  • Figure 16 is a fourth schematic diagram of the implementation process of the transformation method.
  • Figure 17 is a fifth schematic diagram of the implementation process of the transformation method.
  • Figure 18 is a sixth schematic diagram of the implementation process of the transformation method.
  • Figure 19 is a seventh schematic diagram of the implementation process of the transformation method.
  • FIG. 20 is a schematic diagram of the composition structure of the encoder
  • Figure 21 is a schematic diagram of the composition of the encoder structure 2
  • Figure 22 is a schematic diagram of the structure of the decoder
  • Figure 23 is a second schematic diagram of the structure of the decoder.
  • H.266/VVC accepted the RST technology proposed by LGE in JVET-N0193 and changed its name to LFNST technology.
  • LFNST technology has been continuously optimized following the standard formulation process. The following will describe related technical solutions for the current LFNST technology.
  • the transformation part in VVC includes primary transformation and secondary transformation.
  • One transformation supports multiple transformation cores, called Multiple Transform Set (MTS) technology, the secondary transformation is LFNST, where the secondary transformation indicates whether to use the secondary transformation through lfnst_idx, and which lfnst transformation core is used .
  • MTS Multiple Transform Set
  • Fig. 1 is a schematic diagram of the application of LFNST technology. See Fig. 1, which shows a schematic diagram of the application position of an LFNST technology provided by related technical solutions.
  • the LFNST technology is applied between the primary transformation unit 11 and the quantization unit 12.
  • LFNST technology is applied between the inverse quantization unit 13 and the inverse primary transform unit 14.
  • the positive primary transformation unit 11 performs the first transformation (which can be called “Core Transform” or “primary transformation” or “ Primary transformation”) to obtain the transformation coefficient matrix after the first transformation; then perform LFNST transformation (may be called “Secondary Transform” or “secondary transformation") on the coefficients in the transformation coefficient matrix to obtain LFNST transformation coefficients
  • LFNST transformation may be called “Secondary Transform” or “secondary transformation”
  • the matrix is finally quantized by the quantization unit 12 for the LFNST transform coefficient matrix, and the final quantized value is written into the bitstream.
  • the quantized value of the LFNST transform coefficient matrix can be obtained by parsing the code stream, and the quantized value is inversely quantized by the inverse quantization unit 13 (may be called "Scaling") to obtain the restoration of the LFNST transform coefficient matrix
  • the coefficient matrix can be obtained by performing the reverse LFNST transformation on the restored value; then the coefficient matrix is subjected to the inverse transformation corresponding to the "Core Transform" on the encoder side through the inverse primary transformation unit 14, and finally the residual restored value is obtained. It should be noted that only the "inverse transform” operation on the decoder side is defined in the standard.
  • the "inverse LFNST transform” is also called “LFNST transform” in the standard;
  • the “LFNST transform” on the encoder side can be called “forward LFNST transform”, and the “LFNST transform” on the decoder side can be called “reverse LFNST transform”.
  • the prediction residual of the current transform block can be transformed by a positive primary transformation to obtain primary transformation coefficients, and then part of the primary transformation coefficients can be transformed by matrix multiplication for secondary transformation, resulting in a smaller and more concentrated two.
  • the decoder is subjected to inverse quantization processing.
  • the inverse quantized coefficient is subjected to inverse secondary transformation through matrix multiplication, and then the inverse is reversed.
  • the coefficients after the second transformation are inversely transformed to recover the prediction residuals.
  • the LFNST transformation process can mainly include steps such as configuring core parameters, intra prediction mode mapping, selecting transformation matrix, calculating matrix multiplication, and constructing inverse primary transformation coefficient matrix; after these steps are processed, LFNST is completed Transform.
  • the transformation set needs to be selected first. Since the transformation matrix is related to the directional characteristics of the prediction mode, the transformation set is currently selected according to the intra prediction mode.
  • the value of the intra prediction mode indicator can be determined according to the number of the traditional intra prediction mode, and then the transform set index number can be determined according to the value of the intra prediction mode indicator.
  • Figure 2 is a flow chart of the specific process of LFNST.
  • the specific process of LFNST can be divided into five steps, including configuring core parameters, intra prediction mode mapping, selecting transformation matrix, calculating matrix multiplication, and constructing once The transformation coefficient matrix.
  • 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;
  • selecting transformation matrix this step is used to select
  • the transformation set and transformation matrix can mainly include: selecting a transformation set, selecting a transformation matrix group, and selecting a transformation matrix size.
  • H.266/VVC received 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. Solve the hardware-related problems in the previous algorithm design.
  • the ISP technology is mainly for the luminance coding block, and the minimum size of the applied coding block is 8x4 and 4x8, and the maximum size is 64x64; ISP is disabled when the multi-reference line mode is used.
  • ISP In the division of ISP, for code blocks with sizes of 8x4 and 4x8, ISP divides them into 2 sub-partitions. For coding blocks of other sizes that apply ISP, ISP divides them into 4 sub-partitions. Table 1 shows the number of partitions. Table, as shown in Table 1, when dividing according to the size of the coding block, the coding block with the size of 4x4 is not divided, the coding block with the size of 8x4 and 4x8 can be divided into 2 sub-partitions, and the remaining coding blocks of other sizes can be divided into two sub-partitions. Divided into 4 sub-partitions.
  • Encoding block size Number of sub-partitions 4x4 Not divided 4x8 and 8x4 2 Other size 4
  • Figure 3 is a schematic diagram of coding block division one
  • Figure 4 is a schematic diagram of coding block division two.
  • WxH size that can be obtained after horizontal division
  • Wx( H/2) 2 sub-partitions size that can be obtained after vertical division.
  • Figure 5 is the third schematic diagram of coding block division
  • Figure 6 is the fourth schematic diagram of coding block division.
  • the size that can be obtained after horizontal division is 4 sub-partitions of Wx(H/4); 4 sub-partitions of size (W/4)xH can be obtained after vertical division.
  • the first sub-partition that needs to be processed is the sub-partition containing the upper-left pixel in the CU, and then each sub-partition is processed in the downward direction (horizontal partition) or rightward (vertical partition). 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.
  • DC direct current
  • PLANAR planar
  • the ISP also restricts the size of the sub-partition when predicting. Specifically, the minimum prediction width of the sub-partition is restricted to 4 when the sub-partition is predicted. Therefore, for the sub-partition whose width is less than 4 in the transform size, the predicted size The width in is 4, that is, when predicting the sub-partition after ISP division, the width during prediction and the width for transformation may not be the same.
  • Table 2 is the ISP partition prediction size limit table 1, as shown in Table 2.
  • the transform size of each sub-partition is 2x8, and the size of the sub-partition used for prediction is 4x8;
  • the transformation size of each sub-partition is 4x8;
  • the transform size of each sub-partition is 1xN, and the size of the sub-partition used for prediction is 4xN;
  • the transform size of is 2xN, and the size of the sub-partition used for prediction is 4xN.
  • Partition (WxH) Predicted size of subpartition Transform size of subpartition 4x8 4x8 2x8 4xN(N>8) 4xN 1xN 8xN(N>4) 4xN 2xN
  • the figure is a schematic diagram of the change size and the prediction size.
  • the 8xN (N>4) coding block is coded and divided vertically using ISP, the prediction size is 4xN, and the transformation size is 2xN.
  • the picture shows the second schematic diagram of the change size and the prediction size.
  • the transformation core of the primary transformation is DCT-2; if the secondary transformation LFNST is not used, the primary transformation is used.
  • LFNST secondary transformation can also be used, and if the sub-partition uses the secondary transformation LFNST, the transformation type is no longer selected according to the size of the sub-partition, and It directly uses the transform core for DCT-2 transform processing.
  • Figure 7 is a schematic diagram of the ISP mode transformation selection.
  • VVC if the value of lfnst_idx is 0, that is, the secondary transformation LFNST is not used, then when the primary transformation is used, the primary transformation can be performed according to the size of the sub-partition. If the value of lfnst_idx is 1 or 2, that is, the secondary transformation LFNST is used, then the transformation kernel of the primary transformation is DCT-2. That is to say, the mechanism of ISP mode conversion selection is that when the secondary conversion LFNST is not used, the conversion core is determined based on the size of the sub-partition.
  • the input of the reverse primary transformation 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 of the current coding block nTbW, the height of the current coding block nTbH, and the past
  • the inverse primary transformation coefficient matrix d[x][y] obtained by scanning after the inverse secondary transformation.
  • Fig. 8 is a schematic diagram 1 of the realization of the reverse primary transformation.
  • the process of the reverse primary transformation in the ISP mode mainly includes the following parts: configuring the core parameters; selecting the transformation type; and performing the reverse transformation.
  • ISP determines whether to use ISP mode by the variable intra_subpartitions_mode_flag[x0][y0]. Specifically, if intra_subpartitions_mode_flag[x0][y0] is 1, it can be determined to use the ISP mode, 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.
  • the variable IntraSubPartitionsSplitType specifies the division type of the current coding block.
  • Table 3 shows the definition of IntraSubPartitionsSplitType. As shown in Table 3, when the variable IntraSubPartitionsSplitType is 0, it represents the current coding block. No division is performed, that is, ISP_NO_SPLIT; when the variable IntraSubPartitionsSplitType is 1, it represents the horizontal division of the current code block, that is, ISP_HOR_SPLIT; when the variable IntraSubPartitionsSplitType is 2, it represents the vertical division of the current code block, that is, ISP_VER_SPLIT.
  • IntraSubPartitionsSplitType is as follows:
  • Intra_subpartitions_mode_flag is equal to 0, set IntraSubPartitionsSplitType to 0;
  • IntraSubPartitionsSplitType 1+intra_subpartitions_split_flag; where intra_subpartitions_split_flag is used to characterize the division method, and when the value of intra_subpartitions_split_flag is 0, it indicates horizontal division; when the value of intra_subpartitions_split_flag is 1, it indicates vertical division.
  • the variable NumIntraSubPartitions can be used to specify the number of sub-partitions divided by the current coding block.
  • NumIntraSubPartitions is set equal to 2:
  • nTbW is equal to 4
  • nTbH is equal to 8
  • nTbW is equal to 8
  • nTbW is equal to 4.
  • implicitMtsEnabled is derived as follows:
  • IntraSubPartitionsSplitType is not equal to ISP_NO_SPLIT;
  • cu_sbt_flag is equal to 1 and Max(nTbW, nTbH) is less than or equal to 32;
  • 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;
  • variable non-zero coefficient block size that is, the non-zero width coefficient nonZeroW and the non-zero height coefficient nonZeroH derive the following formula:
  • nonZeroH Min(nTbH, (trTypeVer>0)? 16:32) (4)
  • variable trTypeHor represents the horizontal transformation type
  • variable trTypeVer represents the vertical transformation type.
  • both trTypeHor and trTypeVer are set to 0:
  • cIdx is greater than 0;
  • IntraSubPartitionsSplitType is not equal to ISP_NO_SPLIT and lfnst_idx is not equal to 0;
  • trTypeHor and trTypeVer are determined by cu_sbt_horizontal_flag and cu_sbt_pos_flag in Table 5;
  • trTypeHor and trTypeVer are determined by mts_idx. in Table 4.
  • Table 4 shows the relationship between mtsIdx and trTypeHor and trTypeVer.
  • Table 5 shows the relationship between trTypeHor and trTypeVer and cu_sbt_horizontal_flag and cu_sbt_pos_flag. The details are as follows:
  • Figure 9 is the second schematic diagram of the realization of the reverse primary transformation.
  • the specific process can include the following parts: one-dimensional vertical transformation; calculating the intermediate coefficient value; One-dimensional horizontal transformation and obtaining residual coefficients.
  • nTbW is equal to 1
  • r[x][y] is set equal to e[x][y]
  • x 0...nonZeroW-1
  • y 0...nonZeroH-1
  • the process is mainly to perform one-dimensional reverse primary transformation
  • the input nTbS represents the length of the transformation coefficient
  • nonZeroS represents the length of the non-zero coefficient
  • trType represents the transformation type
  • the transformation type of the primary transformation of the sub-partition is mainly determined by the size of the sub-partition. That is, the width of the current partition is greater than or equal to 4 and less than or equal to 16, then a transformation in the horizontal direction uses DST-7 transformation, otherwise it uses DCT-2 transformation; the height of the current partition is greater than or equal to 4 and less than or equal to 16 , Then one transform in the vertical direction uses DCT-2 transform.
  • the above-mentioned ISP conversion selection method increases the diversity of conversion selection, it also introduces a certain degree of complexity, thereby reducing coding efficiency.
  • the transformation core of the primary transformation needs to be selected according to the size of the sub-partition. It can be seen that based on The size of the transform block is more complicated to select a transform core once, which increases the complexity of the transform process and reduces the coding efficiency.
  • the secondary transform LFNST can be used.
  • DCT2 primary transform core
  • LFNST secondary transform core
  • the coding performance can be effectively improved.
  • the probability of selection when LFNST is 0 is not high.
  • the coding performance improvement brought by the method of selecting the transformation core based on the partition size is limited, and its complexity is also relatively high, especially It is the complexity of the DST-7 transform core.
  • this application proposes a transformation method.
  • the sub-partition after the current block division does not use the secondary transformation.
  • the sub-partition uses the primary transformation core of the primary transformation. Then it is determined by the size of the sub-partition, that is, no longer select a transformation core according to the height and width of the sub-partition, but directly set a transformation core.
  • the encoder directly determines the primary transformation core used by the sub-partitions, and writes the code stream after using the syntax element to indicate the primary transformation core; on the decoding side, the decoder parses the code stream and then follows the instruction once.
  • the syntax element of the transform core determines the primary transform core used by the sub-partition. That is to say, in this application, for the transformation of the ISP partition, when the sub-partition does not use LFNST, the primary transformation core used for a transformation can be directly determined, without the need to perform a transformation based on the height and width of the sub-partition.
  • the selection of the core can simplify the selection process of the conversion core, reduce the complexity of the conversion process, and effectively improve the coding and decoding efficiency.
  • 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; as shown in FIG. 10, this
  • the video encoding system 11 includes a transformation unit 111, a quantization unit 112, a mode selection and encoding control logic unit 113, an intra prediction unit 114, an inter prediction unit 115 (including: motion compensation and motion estimation), an inverse quantization unit 116, and an inverse transform Unit 117, loop filter unit 118, encoding unit 119, and decoded image buffer unit 110; for the input original video signal, a video reconstruction block can be obtained through coding tree unit (CTU) division, and through mode selection and
  • the encoding control logic unit 113 determines the encoding mode, and then, on the residual pixel information obtained after intra-frame or inter-frame prediction, the video reconstruction block is transformed by the transformation unit 111 and the quantization unit 112, including the residual information from the
  • CTU coding tree unit
  • the decoded image buffer unit 110 is used to store reconstructed video reconstruction blocks for prediction reference. As the video image encoding progresses, new reconstructed video reconstruction blocks will be continuously generated, and these reconstructed video reconstruction blocks will all be stored in the decoded image buffer unit 110.
  • 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; as shown in FIG. 11, the video decoding system 12 includes a decoding unit 121 and an inverse transform unit 127 , And the inverse quantization unit 122, the intra prediction unit 123, the motion compensation unit 124, the loop filter unit 125 and the decoded image buffer unit 126; the input video signal is encoded by the video encoding system 11, and the video signal is output Code stream; the code stream is input into the video decoding system 12, and first passes through the decoding unit 121 to obtain the decoded transform coefficients; the transform coefficients are processed by the inverse transform unit 127 and the inverse quantization unit 122 so as to be in the pixel domain Generate a residual block; the intra prediction unit 123 can be used to generate prediction data of the current video decoding block based on the determined intra prediction direction and the data from the previous decoded block of the current frame or picture; the motion
  • the transformation method in the embodiment of the present application can be applied to the transformation unit 111 and the inverse transformation unit 117 as shown in FIG. 10.
  • the transformation method in the embodiment of the present application can also be applied to the part of the inverse transformation unit 127 shown in FIG. 11. That is to say, the transformation method in the embodiment of this application can be applied to both a video encoding system, a video decoding system, or even a video encoding system and a video decoding system at the same time.
  • the embodiment of this application does not make specific details. limited.
  • the “current block” specifically refers to the current encoding block in intra prediction
  • the “current block” specifically refers to Refers to the current decoded block in intra prediction.
  • FIG. 12 is a schematic diagram 1 of the implementation flow of the transformation method.
  • the method for the encoder to perform transformation processing may include the following steps:
  • Step 101 Determine the ISP mode parameters of the current block.
  • Step 102 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.
  • the encoder may first determine the ISP mode parameter of the current block, and after determining the ISP mode parameter, if the ISP mode parameter indicates that the current block uses the ISP mode to determine the intra prediction value of the current block, then The encoder can further determine the sub-partition of the current block.
  • the ISP mode parameter can indicate whether the current block can use the intra sub-partition coding mode, that is, whether the current block can use the ISP mode.
  • the ISP mode parameter can be understood as a flag indicating whether the ISP mode is used.
  • the encoder can use the variable intra_subpartitions_mode_flag as the ISP mode parameter, so that the ISP mode parameter can be set by setting the value of the variable intra_subpartitions_mode_flag.
  • 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.
  • 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 Set to 0.
  • the encoder after the encoder completes the setting of the ISP mode parameters, it can write the ISP mode parameters into the code stream and transmit it to the decoder, so that the decoder can make the code stream after parsing the code stream. Obtain ISP mode parameters.
  • the decoder may continue to determine the sub-partition of the current block.
  • the encoder when determining the sub-partition of the current block, can determine the size and position of the current block according to the split flag, that is, from a code perspective, the pointer variable Point to the correct starting position in the buffer and determine the width and height when writing to the storage space.
  • each image block currently to be encoded may be referred to as a coding block (CB).
  • each coding block may include a first image component, a second image component, and a third image component.
  • the coding block to be predicted may be called a luminance block; or, suppose Prediction of the second image component 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 called a chrominance block.
  • the current block is the coding block for which luminance component prediction is currently performed in the video image, that is, the current block is the luminance block.
  • the encoder may 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.
  • the current block can use the ISP mode.
  • Step 103 Determine the residual value of the sub-partition.
  • the encoder may determine the residual value of the sub-partition.
  • the encoder may perform intra-prediction on the sub-partition to obtain the intra-frame prediction value of each sub-partition; wherein, one sub-partition corresponds to one sub-partition. Intra prediction value.
  • the intra prediction modes include direct current (DC) mode, planar (PLANAR) mode, and angle mode. Wait.
  • DC direct current
  • PLANAR planar
  • angle mode angle mode
  • the encoder may first determine the prediction mode parameter, and then the prediction mode parameter may be used to determine the specific coding mode of the sub-partition of the current block. Which encoding mode.
  • the encoder may first determine the image component 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 predictive encoding on the predicted image components respectively, and calculate the rate-distortion cost result corresponding to each prediction mode in multiple prediction modes; finally, the smallest rate-distortion cost result can be selected from the multiple calculated rate-distortion cost results The cost result, and the prediction mode corresponding to the minimum rate-distortion cost result is determined as the prediction mode parameter of the current block.
  • multiple prediction modes can be used for the sub-partition of the current block to encode the image components to be predicted respectively.
  • the encoder uses multiple prediction modes to respectively encode the current block, it can obtain the rate-distortion cost result corresponding to each prediction mode; then, from the obtained multiple rate-distortion modes The minimum rate-distortion cost result is selected in the cost result, 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 determined prediction mode can be used to determine the sub-partition of the current block. Perform coding, and in this prediction mode, the prediction residual can be made small, and the coding efficiency can be improved.
  • multiple sub-partitions of the current block share the same intra prediction mode.
  • the encoder can perform intra-frame prediction on multiple sub-partitions of the current block through one of the PLANAR, DC, or angular prediction modes.
  • the encoder can perform a difference operation on the actual value and the intra-frame prediction value of the sub-partition to obtain the difference between the two As a result, the prediction difference of the sub-partition, that is, the residual value, can be determined.
  • the encoder 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.
  • the ISP technology limits the size of the sub-partition when predicting, and the minimum prediction width of the sub-partition is required to be 4 when the sub-partition is predicted. Therefore, for the current block, the sub-partition is The size at the time of prediction and the size at the time of transformation are not necessarily the same.
  • the ISP technology since the ISP technology only limits the width of the sub-partition during prediction, and when the ISP technology is applied, the minimum size of the coded block is restricted to 8x4 and 4x8. Therefore, for the sub-partition obtained by horizontal division of the current block, the prediction size and transformation The sizes are all the same, and for vertically divided sub-partitions, there may be cases where the predicted size and the transform size are different.
  • Table 6 shows the ISP partition prediction size limit Table 2.
  • the transform size of the 2 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 2 sub-partitions after the current block with the size of 8x4 is divided are 4x4;
  • the transform size of the 4 sub-partitions after the current block with the size of 4xN (N>8) is 1xN, and the sub-partition
  • the size used for prediction is 4xN;
  • the transform size and prediction size of the 4 sub-partitions after the current block of size Nx4 (N>8) is divided are (N/4)x4;
  • the size of the current block is 8xN (N>4)
  • the transform size of the 4 sub-partitions after block division is 2xN, and the size of the sub-partition used for prediction is 4xN;
  • Step 104 When the sub-partition uses one transformation, determine the one-time transformation core used by the sub-partition.
  • the encoder may first determine the one-time transformation core when the sub-partition undergoes one transformation, that is, determine the transformation type used for the one transformation.
  • the encoder can first determine the transformation type during one transformation, that is, determine the primary transformation core used by the sub-partition.
  • the optional transform cores include DCT-2, DCT-8, and DST-7.
  • the DCT-2 transform core refers to a transform core or a transform matrix of an integer transform designed based on DCT-2.
  • the DST-7 transformation core refers to the transformation core or transformation matrix of the integer transformation based on the DST-7 design;
  • the DCT-8 transformation core refers to the transformation core or transformation matrix of the integer transformation based on the DCT-8 design.
  • Fig. 13 is a second schematic diagram of the implementation process of the transformation method. As shown in Fig. 13, the method for the encoder to determine the primary transformation core used by the sub-partition may include the following steps:
  • Step 104a Determine DCT-2 as a primary transformation core.
  • the encoder when determining the transformation type when the sub-partition uses one transformation, can directly determine DCT-2 as the primary transformation core.
  • the primary transformation core used by the sub-partition is DCT-2.
  • Step 104b When the sub-partition does not use LFNST, the preset transformation core is determined as a primary transformation core; when the sub-partition uses LFNST, DCT-2 is determined as the primary transformation core.
  • the encoder when the encoder determines the transformation type when the sub-partition uses one transformation, if the sub-partition does not use LFNST, the encoder may determine the preset transformation core as a one-time transformation core; if the sub-partition does not use LFNST Using LFNST, the encoder can determine DCT-2 as the primary transform core.
  • the preset transform core is any one of DCT-2, DST-7 or DCT-8.
  • the primary transformation core when the sub-partition uses LFNST and the primary transformation core when the sub-partition does not use LFNST may be different.
  • the encoder can determine the primary transformation core of the sub-partition as DCT-2; when the sub-partition does not use LFNST, the encoder can use DCT-2, DST-7, or DCT-8. Any one of is determined as a transformation core of the sub-partition.
  • Step 104c When the sub-partition does not use LFNST, determine DCT-2 as the primary transformation core; when the sub-partition uses LFNST, determine the preset transformation core as the primary transformation core.
  • the encoder when the encoder determines the transformation type when the sub-partition uses one transformation, if the sub-partition uses LFNST, then the encoder can determine the preset transformation core as a one-time transformation core; if the sub-partition is not Using LFNST, the encoder can determine DCT-2 as the primary transform core.
  • the preset transform core is any one of DCT-2, DST-7 or DCT-8.
  • the primary transformation core when the sub-partition uses LFNST and the primary transformation core when the sub-partition does not use LFNST may be different.
  • the encoder can determine the primary transformation core of the sub-partition as DCT-2; when the sub-partition uses LFNST, the encoder can use DCT-2, DST-7, or DCT-8. Any one of is determined as a transformation core of the sub-partition.
  • Step 104d Determine the target transformation core as a primary transformation core; accordingly, a syntax unit is used to indicate the target transformation core in the code stream.
  • the encoder when determining the transformation type when the sub-partition uses one transformation, may directly determine the target transformation core as the primary transformation core.
  • the target transform core is any one of DCT-2, DST-7 or DCT-8.
  • the primary transformation core used by the sub-partition is the target transformation core. That is, for the two different cases of using LFNST and not using LFNST for sub-partitions, the encoder can set the same primary transformation core.
  • the encoder determines the target transformation core as a primary transformation core, it needs to use a syntax unit syntax element in the code stream to indicate the transformation type of a transformation, that is, use the syntax unit to target the target transformation core. Change the core to indicate.
  • the syntax unit indicating the target transformation core is contained in one or more data units in the following code stream: the data unit containing the current block, and the fragment header information Data unit, image header information data unit, image layer parameter set, sequence layer parameter set.
  • 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 to be a primary transform core; accordingly, two transform cores are used in the code stream.
  • the syntax unit indicates the first transformation core and the second transformation core, respectively.
  • the encoder when the encoder determines the transformation type when the sub-partition uses one transformation, if the sub-partition does not use LFNST, the encoder may determine the first transformation core as a one-time transformation core; if the sub-partition does not use LFNST Using LFNST, the encoder can 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.
  • the encoder can set a different primary transformation core, so that when the sub-partition does not use LFNST, the first transformation core is used for one time. Transformation, when using LFNST, use the second transformation kernel to perform a transformation.
  • Two syntax units syntax element respectively indicate the transformation type of a transformation, that is, one syntax unit is used to indicate the first transformation core, and at the same time, another syntax unit is used to indicate the second transformation core.
  • the syntax units indicating the first transformation core and the second transformation core are included in one or more data units in the following code stream: Data unit, slice header information data unit, image header information data unit, image layer parameter set, sequence layer parameter set.
  • the encoder when the encoder determines the primary transform core used when the sub-partition is transformed once, regardless of whether the sub-partition uses LFNST or not, the encoder can determine the primary transform core in a variety of ways. .
  • the encoder can directly determine DCT-2 as the primary transformation core used when the sub-partition undergoes a change. 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 in one transformation of the sub-partition is DCT-2.
  • the encoder does not need to select a transformation core according to the size of the sub-partition, nor does it need to distinguish a transformation core according to whether the sub-partition uses LFNST, but can directly change the transformation core.
  • the encoder can directly determine the preset transformation core as the one-time transformation core used when the sub-partition makes a change; if the sub-partition uses LFNST , Then the encoder can determine DCT-2 as the primary transform core used when the sub-partition is changed once.
  • the preset transform core is a fixed type preset by the encoder.
  • the preset transform core can be any of DCT-2, DST-7, or DCT-8. one.
  • the encoder when the sub-partition of the current block does not use LFNST, the encoder does not need to select a transformation core according to the size of the sub-partition, but can directly set a transformation core as a preset Transform the core, and at the same time, when the sub-partition uses LFNST, set DCT-2 to determine the primary transform core.
  • the encoder can directly determine the preset transformation core as the one-time transformation core used when the sub-partition undergoes a change; if the sub-partition does not use LFNST , Then the encoder can determine DCT-2 as the primary transform core used when the sub-partition is changed once.
  • the preset transform core is a fixed type preset by the encoder.
  • the preset transform core can be any of DCT-2, DST-7, or DCT-8. one.
  • the encoder does not need to select a transform core according to the size of the sub-partition, but can directly set DCT-2 to determine once The transformation core, and at the same time, when the sub-partition uses LFNST, the primary transformation core is set as the preset transformation core.
  • the encoder can directly use a syntax unit syntax element in the code stream to indicate a transformation core used when the sub-partition undergoes a change. 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 in one transformation of the sub-partition is the same target transformation core.
  • the target transform core can be any one of DCT-2, DST-7 or DCT-8.
  • the encoder does not need to select a transformation core according to the size of the sub-partition, nor does it need to distinguish a transformation core according to whether the sub-partition uses LFNST, but can directly change the transformation core. Indicate through the syntax unit in the code stream.
  • the encoder can use a syntax unit syntax element in the code stream to indicate the transformation core used when the sub-partition undergoes a change; if the sub-partition If LFNST is not used, the encoder can use another syntax unit syntax element in the code stream to indicate the primary transformation core used when the sub-partition undergoes a change.
  • the encoder may use two different syntax units in the code stream to indicate the first target core and the second target core respectively.
  • the first target core and the second target core may be any two of DCT-2, DST-7, or DCT-8.
  • the encoder when the sub-partition of the current block does not use LFNST, the encoder does not need to select a transformation core according to the size of the sub-partition, but can directly pass the first transformation core through the code stream In the case of using LFNST in the sub-partition, the second transformation core can be indicated by another syntax unit in the code stream.
  • the way that the encoder signals syntax elements in the code stream may include: block layer, slice layer, image header, parameter set (sequence layer parameter set, image layer parameter set, APS Etc.), and the override relationship between the signal parameters in different data units, for example, the block layer can override the slice layer, etc., and the override between parameter sets, etc.
  • the primary transform core can be adaptively selected, and then the primary transform core can be used in one or more data units of the block layer.
  • the syntax element syntax element of one or more data units in the block layer of the code stream is parsed, so that the used transformation can be determined nuclear.
  • the encoder when the sub-partition of the current block does not use LFNST, the encoder does not need to select a transformation core according to the size of the sub-partition, but can directly perform a transformation core for the sub-partition. Adaptive settings.
  • the encoder may determine a transformation core by the value of the variable isp_trType.
  • the value of the variable isp_trType can be 0, 1, 2, where, if the value of the variable isp_trType is 0, it means that DCT-2 is used as the primary transformation core; if the variable is The value of isp_trType is 1, which means that DST-7 is used as the primary transformation core; if the value of the variable isp_trType is 2, it means that DCT-8 is used as the primary transformation core.
  • the sub-partition after the current block division does not use the secondary transformation.
  • the sub-partition uses the transformation type of the primary transformation, that is, one-time transformation.
  • the transformation core 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.
  • FIG. 14 is a schematic diagram of the transformation core determination process.
  • VVC in VVC, if the value of lfnst_idx is 0, that is, the sub-partition does not use the secondary transformation LFNST, then When using a transformation, the encoder can directly determine the primary transformation core of the primary transformation of the sub-partition; if the value of lfnst_idx is 1 or 2, that is, the secondary transformation LFNST is used in the sub-partition, then the transformation core of the primary transformation of the sub-partition is DCT- 2.
  • not all sub-partitions of the current block can be transformed using LFNST. Specifically, only when the sub-partitions meet certain preset conditions at the same time, the LFNST transformation can be performed on the sub-partitions.
  • the preset condition 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 sub-partition or current The prediction mode of the coding block is the intra prediction mode; (d) the primary transformation of the sub-partition is two-dimensional forward primary transformation (DCT-2) in both the horizontal and vertical directions, that is, the primary transformation core is DCT-2; (e) When the intra prediction mode of the sub-partition or the coding block where the current block is located is non-MIP mode or the prediction mode of the sub-partition is MIP mode and the width and height of the transform block are both greater than or equal to 16. That is to say, for the sub-partition in the embodiment 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 transformation technology.
  • the transformation method proposed in this application can simplify the method of determining a transformation core when the value of lfnstIdx is equal to 0 for the sub-partitions divided by the ISP. Specifically, in this application, if the sub-partition does not use LFNST, the encoder 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, thus eliminating the need for sub-partitions.
  • the size of the partition selects the processing flow of the sub-partition to transform the core at a time.
  • Step 105 Use a transformation kernel to perform transformation processing on the residual value.
  • the encoder when the sub-partition uses one transformation, after determining the one-time transformation core used by the sub-partition, the encoder can use the one-time transformation core to perform a transformation process on the residual value of the sub-partition.
  • the primary transformation core determined by the encoder can characterize the transformation type of the sub-partition for one transformation, which may include the horizontal transformation type and the vertical transformation when the sub-partition undergoes one transformation. type. Specifically, the horizontal transformation type and the vertical transformation type of the sub-partition for one transformation are the same, that is, the encoder uses the same primary transformation core to perform the horizontal transformation and the vertical transformation on the sub-partition respectively.
  • the encoder may output a transformed transformation coefficient matrix after performing a transformation process on the residual value of the sub-partition using a transformation core.
  • Fig. 15 is the third schematic diagram of the implementation process of the transformation method. As shown in Fig. 15, the method for the encoder to perform transformation processing may further include the following steps:
  • 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.
  • 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 code stream.
  • Step 108 Write the LFNST index number into the code stream.
  • 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 code stream.
  • the encoder can set the value of the LFNST index number to indicate that the sub-partition uses LFNST, and then set the LFNST index number Write to the code stream.
  • the LFNST index number can indicate whether the sub-partition uses the secondary transformation LFNST, and at the same time, it can also indicate the type when the secondary transformation is used, that is, it indicates the LFNST transformation core of the sub-partition. .
  • the LFNST index sequence number can be understood as a flag indicating whether to use LFNST.
  • 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.
  • 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.
  • 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.
  • the LFNST index number (that is, lfnst_idx)
  • the value of the LFNST index number 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 LFNST index number is selected When the value is greater than 0, it indicates that the sub-partition will use LFNST.
  • the encoder when determining the LFNST transform core, 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. , Then you can set the LFNST index number and write it into the code stream.
  • the transformation matrix of LFNST is a plurality of fixed coefficient matrices obtained through training.
  • the LFNST transformation core candidate set includes 2 sets of transformation matrices (also called LFNST transformation cores). After the LFNST transformation core candidate set is determined, it is necessary to A group of LFNST transform cores is selected from the LFNST transform core candidate set, that is, the transform matrix used when determining the sub-partition LFNST.
  • the rate-distortion optimization method can be used to select the transform core used by the sub-partition at this time.
  • a rate-distortion optimization method may be used to calculate the rate-distortion cost (Rate Distortion Cost, RDCost) for each transform core, and then the transform core with the smallest rate-distortion cost may be selected as the transform core used by the sub-partition.
  • RDCost Rate Distortion Cost
  • 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 code stream and transmitted to the decoder side.
  • the LFNST index number which can be represented by lfnst_idx
  • the first group of LFNST transform cores in the LFNST transform core candidate set ie, the first group of transform matrices
  • set lfnst_idx to 1
  • the second group of LFNST transform cores in the LFNST transform core candidate set ie, the second Group transformation matrix
  • the encoder after setting the LFNST index number, the encoder can write the LFNST index number into the code stream for analysis by the decoding end.
  • the encoder can also determine the LFNST transform core used in the sub-partition, and at the same time , You can set the value of the LFNST index number to instruct the sub-partition to use LFNST, and then write the LFNST index number into the code stream.
  • the encoder can use the LFNST transform core to perform secondary transform processing on the transform coefficient matrix after the first transform of the sub-partition. Obtain the LFNST transform coefficient matrix, and finally perform quantization processing on the LFNST transform coefficient matrix, and write the final quantized value into the video bitstream.
  • Fig. 16 is the fourth schematic diagram of the implementation process of the transformation method. As shown in Fig. 16, 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:
  • 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.
  • the encoder may 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 of the current block.
  • the size parameter of the current block may include the height value and the width value of the current block.
  • the maximum transform size supported by the luminance component is 64 ⁇ 64
  • 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 divided horizontally or (and) vertically to meet the requirements of the corresponding direction to transform the size.
  • 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 of the current block and If the width values are all equal to 4, it can be determined that the current block does not use the ISP mode.
  • the encoder can determine that the brightness block uses the ISP mode.
  • Step 1010 When it is determined that the current block uses the ISP mode, determine the sub-partition of the current block.
  • the encoder 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, if it determines 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 instruct the current block to use the ISP mode, and then write the ISP mode parameter into the code stream.
  • the encoder can divide the current block into multiple sub-partitions. Specifically, in this application, according to the size parameter of the current block, the encoder may divide the current block into 2 sub-partitions or 4 sub-partitions of the same size.
  • the encoder may divide the current block into two sub-partitions with the same size.
  • the encoder may divide the current block into two sub-partitions with the same size.
  • the encoder may divide the current block into 4 sub-partitions with the same size.
  • the encoder may divide the current block into 4 sub-partitions with the same size.
  • the encoder when the encoder divides the current block, it can be either horizontally or vertically. In other words, the encoder may horizontally divide the current block into multiple sub-partitions of the same size, or vertically divide the current block into multiple sub-partitions of the same size.
  • the encoder may first determine the partition type of the current block, and then may obtain the sub-partition based on the size parameter and partition type of the current block.
  • the division type may include horizontal division and vertical division.
  • the current block may be divided horizontally or vertically according to the height value and width value of the current block, so as to obtain multiple sub-partitions of the current block.
  • the encoder obtains 2 sub-partitions after horizontally dividing the current block, where each sub-partition The size parameter is 1x8.
  • the encoder obtains 4 sub-partitions after vertical division of the current block, where each sub-partition The size parameter is 4x4.
  • the encoder can 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 to the video code In the stream.
  • Figure 17 is a schematic diagram of the implementation process of the transformation method. As shown in Figure 17, 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 encoder performs transformation processing
  • the method can also include the following steps:
  • 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 code stream.
  • 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, if it is determined that the current block does not use the ISP mode, the encoder can take the ISP mode parameter The value is set to indicate that the current block does not use the ISP mode, and then the ISP mode parameters are written into the code stream.
  • 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, if it determines that the current block does not use the ISP mode, then the encoder can change The value of the ISP mode parameter is set to indicate that the current block does not use the ISP mode, and then the ISP mode parameter is written into the video stream.
  • the ISP mode parameter may indicate whether the current block can use the intra sub-partition coding mode, that is, whether the current block can use the ISP mode.
  • the ISP mode parameter can be understood as a flag indicating whether the ISP mode is used.
  • the encoder can use the variable intra_subpartitions_mode_flag as the ISP mode parameter, so that the ISP mode parameter can be set by setting the value of the variable intra_subpartitions_mode_flag.
  • 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.
  • 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 Set to 0.
  • the encoder after the encoder completes the setting of the ISP mode parameters, it can write the ISP mode parameters into the code stream for analysis by the decoder.
  • This application proposes a transformation method, which is applied to the encoder, and the encoder determines the ISP mode parameter 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, the sub-frame prediction value of the current block is determined. Partition; determine the residual value of the sub-partition; when the sub-partition uses one transformation, determine the one-time transformation kernel used by the sub-partition; use the one-time transformation kernel to transform the residual value. It can be seen that, in the embodiment of the present application, for the transformation of the ISP partition, the sub-partition after the current block division does not use the secondary transformation.
  • the sub-partition uses the primary transformation core of the primary transformation, and no longer Determined by the size of the sub-region, that is, no longer select a transformation core according to the height and width of the sub-region, but directly set the primary transformation core.
  • the selection process of the transformation core can be simplified, the complexity of the transformation process can be reduced, and the coding and decoding efficiency can be effectively improved.
  • FIG. 18 is a schematic diagram of the implementation process of the transformation method.
  • the method for the decoder to perform transformation processing may include the following steps:
  • Step 201 Parse the code stream and determine the ISP mode parameters of the current block.
  • the decoder may first parse the code stream after receiving the code stream of the video, so as to determine the ISP mode parameter corresponding to the current block.
  • the ISP mode parameter can indicate whether the current block can use the intra sub-partition coding mode, that is, whether the current block can use the ISP mode.
  • the ISP mode parameter can be understood as a flag indicating whether the ISP mode is used.
  • the decoder can use the variable intra_subpartitions_mode_flag as the ISP mode parameter, so that the ISP mode parameter can be set by setting the value of the variable intra_subpartitions_mode_flag.
  • the value of the ISP mode parameter is set to indicate that the current block uses the ISP mode.
  • the value of the variable intra_subpartitions_mode_flag can be set to 1.
  • the value of the ISP mode parameter is set to indicate that the current block does not use the ISP mode.
  • the value of the variable intra_subpartitions_mode_flag can be set to 0.
  • the ISP mode parameters can be written into the code stream and transmitted to the decoder, so that the decoder can obtain the ISP after parsing the code stream. Mode parameters.
  • Step 202 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.
  • the decoder after the decoder parses the code stream and determines the ISP mode parameter of the current block, if the ISP mode parameter indicates that the current block uses the ISP mode to determine the intra prediction value of the current block, the decoder can continue to determine the intra prediction value of the current block. The sub-partition of the block is determined.
  • the decoder when determining the sub-partition of the current block, can determine the size and position of the current block according to the split flag, that is, from a code perspective, the pointer variable Point to the correct starting position in the buffer and determine the width and height when writing to the storage space.
  • the current block is the video image
  • the current decoding block to be predicted for the luminance component, that is, the current block is a luminance block.
  • the minimum size of the decoding block is restricted to 8x4 and 4x8, the maximum size is 64x64, and ISP is disabled when the multi-reference line mode is used. Therefore, in this application, if the ISP mode parameter indicates that the current block uses the ISP mode to determine the intra prediction value of the current block, then the size parameter of the current block needs to meet the requirements of the ISP mode.
  • the current block can use the ISP mode.
  • the size parameter of the current block may include the height value and the width value of the current block.
  • the decoder can determine the sub-partition of the current block according to the size parameter of the current block.
  • the decoder can divide the current block into multiple sub-partitions. Specifically, in this application, according to the size parameter of the current block, the decoder may divide the current block into 2 sub-partitions or 4 sub-partitions of the same size.
  • the decoder may divide the current block into 2 sub-partitions of the same size.
  • the decoder may divide the current block into 2 sub-partitions of the same size.
  • the decoder may divide the current block into 4 sub-partitions with the same size.
  • the decoder may divide the current block into 4 sub-partitions with the same size.
  • the decoder when the decoder divides the current block, it can be either horizontally or vertically. That is, the decoder may horizontally divide the current block into multiple sub-partitions of the same size, or vertically divide the current block into multiple sub-partitions of the same size.
  • the decoder may first determine the partition type of the current block, and then may obtain the sub-partition based on the size parameter and partition type of the current block.
  • the division type may include horizontal division and vertical division.
  • the current block may be divided horizontally or vertically according to the height value and width value of the current block, so as to obtain multiple sub-partitions of the current block.
  • Step 203 Analyze the code stream and determine the transformation coefficient matrix of the sub-division.
  • the decoder can also obtain the transform coefficient matrix of the sub-partition after parsing the code stream.
  • the transformation coefficient matrix of the sub-partition is output by the encoder after one transformation is applied to the residual value of the sub-partition.
  • the input includes the transform coefficient matrix of the sub-partition.
  • the input data of the reverse primary transformation may include: current luminance block position (xTbY, yTbY), current The width of the block nTbW, the height of the current block nTbH, the chrominance component cIdx of the current block, and the prediction mode predMode of the current decoding unit.
  • x 0, 1,..., nTbW-1
  • y 0, 1,..., nTbH-1.
  • the decoder after parsing the code stream of the video, the decoder can also obtain the transformation type parameter of the sub-partition.
  • the transformation type parameter may indicate the primary transformation core used when the sub-partition is transformed once, that is, it indicates the transformation type of the sub-partition that is transformed once.
  • the transformation type parameter can be understood as a flag indicating the transformation type.
  • the decoder may determine a transformation core through the value of the variable isp_trType.
  • the value of the variable isp_trType can be 0, 1, 2, where, if the value of the variable isp_trType is 0, it means that DCT-2 is used as the primary transformation core; if the variable is The value of isp_trType is 1, which means that DST-7 is used as the primary transformation core; if the value of the variable isp_trType is 2, it means that DCT-8 is used as the primary transformation core.
  • the decoder can obtain the transformation type when the sub-partition uses one transformation after parsing the code stream, so that the one transformation used by the sub-partition can be determined nuclear.
  • Step 204 When the sub-partition uses one transformation, determine the one-time transformation core used by the sub-partition.
  • the decoder when the sub-partition uses one transformation, can determine the one-time transformation core used by the sub-partition.
  • the decoder can first determine the transformation type during one transformation, that is, determine the primary transformation core used by the sub-partition.
  • the optional transform cores include DCT-2, DCT-8, and DST-7.
  • the DCT-2 transform core refers to a transform core or a transform matrix of an integer transform designed based on DCT-2.
  • the DST-7 transformation core refers to the transformation core or transformation matrix of the integer transformation based on the DST-7 design;
  • the DCT-8 transformation core refers to the transformation core or transformation matrix of the integer transformation based on the DCT-8 design.
  • FIG. 19 is a schematic diagram of the implementation process of the transformation method.
  • the ISP mode parameter indicates that the current block uses the ISP mode to determine the intra prediction value of the current block
  • the current block is determined
  • the method for the decoder to perform transformation processing may further include the following steps:
  • Step 206 Parse the code stream to determine the LFNST index number of the sub-partition.
  • the decoder can also obtain the LFNST index number of the sub-partition by parsing the code stream.
  • the LFNST index number can indicate whether the sub-partition uses the secondary transformation LFNST, and at the same time, it can also indicate the type when the secondary transformation is used, that is, it indicates the LFNST transformation core of the sub-partition. .
  • the LFNST index sequence number can be understood as a flag indicating whether to use LFNST.
  • 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.
  • 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.
  • 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.
  • the decoder when determining the LFNST transform core, 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. , Then you can set the LFNST index number and write it into the code stream.
  • the transformation matrix of LFNST is a plurality of fixed coefficient matrices obtained through training.
  • the LFNST transformation core candidate set includes 2 sets of transformation matrices (also called LFNST transformation cores). After the LFNST transformation core candidate set is determined, it is necessary to A group of LFNST transform cores is selected from the LFNST transform core candidate set, that is, the transform matrix used when determining the sub-partition LFNST.
  • the rate-distortion optimization method can be used to select the transform core used by the sub-partition at this time.
  • a rate-distortion optimization method may be used to calculate the rate-distortion cost (Rate Distortion Cost, RDCost) for each transform core, and then the transform core with the smallest rate-distortion cost may be selected as the transform core used by the sub-partition.
  • RDCost Rate Distortion Cost
  • 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 code stream and transmitted to the decoder side.
  • the LFNST index number which can be represented by lfnst_idx
  • the first group of LFNST transform cores in the LFNST transform core candidate set ie, the first group of transform matrices
  • set lfnst_idx to 1
  • the second group of LFNST transform cores in the LFNST transform core candidate set ie, the second Group transformation matrix
  • the encoder after the encoder completes the setting of the LFNST index number, it can write the LFNST index number into the code stream and transmit it to the decoder.
  • the decoder obtains the LFNST after parsing the code stream. Index number, and determine whether the sub-partition uses LFNST according to the LFNST index number, and when the sub-partition uses LFNST, determine the LFNST transformation core used by the sub-partition.
  • the decoder after the decoder parses the code stream, for the value of the LFNST index number (that is, lfnst_idx), when the value of the LFNST index number is equal to 0, the decoder can determine the LFNST index number Indicate that the sub-partition will not use LFNST; 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 LFNST When the value of the 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.
  • the LFNST index number that is, lfnst_idx
  • the method for the decoder to determine the primary transformation core used by the sub-partition may include the following steps:
  • Step 204a Determine DCT-2 as a primary transformation core.
  • the decoder when determining the transformation type when the sub-partition uses one transformation, may directly determine DCT-2 as the primary transformation core.
  • the primary transformation core used by the sub-partition is DCT-2.
  • Step 204b When the LFNST index number indicates that the sub-partition does not use LFNST, the preset transformation core is determined as a primary transformation core; when the LFNST index number indicates that the sub-partition uses LFNST, DCT-2 is determined as the primary transformation core.
  • the decoder when the decoder determines the transformation type when the sub-partition uses one transformation, if the LFNST index number indicates that the sub-partition does not use LFNST, then the decoder may determine the preset transformation core as a one-time transformation core ; If the LFNST index number indicates that the sub-partition uses LFNST, the decoder can determine DCT-2 as a primary transformation core.
  • the preset transform core is any one of DCT-2, DST-7 or DCT-8.
  • the primary transformation core when the sub-partition uses LFNST and the primary transformation core when the sub-partition does not use LFNST may be different.
  • the decoder can determine the primary transformation core of the sub-partition as DCT-2; when the sub-partition does not use LFNST, the decoder can use DCT-2, DST-7, or DCT-8. Any one of is determined as a transformation core of the sub-partition.
  • Step 204c When the LFNST index number indicates that the sub-partition does not use LFNST, determine DCT-2 as a primary transformation core; when the LFNST index number indicates that the sub-partition uses LFNST, determine the preset transformation core as a primary transformation core.
  • the decoder when the decoder determines the transformation type when the sub-partition uses one transformation, if the LFNST index number indicates that the sub-partition uses LFNST, the decoder may determine the preset transformation core as a one-time transformation core; If the LFNST index number indicates that the sub-partition does not use LFNST, the decoder can determine DCT-2 as a primary transformation core.
  • the preset transform core is any one of DCT-2, DST-7 or DCT-8.
  • the primary transformation core when the sub-partition uses LFNST and the primary transformation core when the sub-partition does not use LFNST may be different.
  • the decoder can determine the primary transformation core of the sub-partition as DCT-2; when the sub-partition uses LFNST, the decoder can select DCT-2, DST-7, or DCT-8. Any one of is determined as a transformation core of the sub-partition.
  • Step 204d If the target transformation core is indicated by a syntax unit in the code stream, the target transformation core is determined as a primary transformation core.
  • the decoder when the decoder determines the transformation type when the sub-partition uses one transformation, if a syntax unit in the code stream indicates the target transformation core, the decoder can determine the target transformation core as a transformation nuclear.
  • the target transform core is any one of DCT-2, DST-7 or DCT-8.
  • the primary transformation core used by the sub-partition is the target transformation core. That is, for the two different cases of using LFNST and not using LFNST for the sub-partition, the decoder can set the same primary transformation core.
  • the decoder determines the target transformation core as a primary transformation core, it needs to use a syntax unit syntax element in the code stream to indicate the transformation type of a transformation, that is, use the syntax unit to target the target transformation. Change the core to indicate.
  • the syntax unit indicating the target transformation core is included in one or more data units in the following code stream: the data unit containing the current block , Slice header information data unit, image header information data unit, image layer parameter set, sequence layer parameter set.
  • the decoder parses the data unit in the code stream that contains 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. , To obtain the value of the grammatical unit to determine the target transformation core.
  • Step 204e If two syntax units in the code stream indicate the first transformation core and the second transformation core respectively, when the LFNST index number indicates that the sub-partition does not use LFNST, the first transformation core is determined as a primary transformation core; when LFNST The index number indicates that when the sub-partition uses LFNST, the second transformation core is determined as a primary transformation core.
  • the decoder determines the transformation type when the sub-partition is used for one transformation, if the LFNST index is If the sequence number indicates that the sub-partition does not use LFNST, the decoder may determine the first transformation core as a primary transformation core; if the LFNST index sequence number indicates that the sub-partition uses LFNST, the decoder may determine the second transformation core as a primary transformation core.
  • the first transform core and the second transform core are any two of DCT-2, DST-7 or DCT-8.
  • the decoder can set a different primary transformation core, so that when the sub-partition does not use LFNST, the first transformation core is used for one time. Transformation, when using LFNST, use the second transformation kernel to perform a transformation.
  • Two syntax units syntax element respectively indicate the transformation type of a transformation, that is, one syntax unit is used to indicate the first transformation core, and at the same time, another syntax unit is used to indicate the second transformation core.
  • the syntax units indicating the first transformation core and the second transformation core are contained in one or more data units in the following code streams: Contains 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 the sequence layer parameter set.
  • the decoder parses the data unit in the code stream that contains 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. To obtain the value of the syntax unit to determine the first transformation core and the second transformation core.
  • the decoder when the decoder determines the primary transformation core used when the sub-partition performs a transformation, regardless of whether the sub-partition uses LFNST or not, the decoder can determine the primary transformation core in a variety of ways. .
  • the decoder can directly determine DCT-2 as the primary transformation core used when the sub-partition undergoes a change. 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 in one transformation of the sub-partition is DCT-2.
  • the decoder does not need to select a transformation core according to the size of the sub-partition, nor does it need to distinguish a transformation core according to whether the sub-partition uses LFNST, but can directly select a transformation core.
  • the decoder can directly determine the preset transformation core as the one-time transformation core used when the sub-partition undergoes a change; if the sub-partition uses LFNST , Then the decoder can determine DCT-2 as the primary transform core used when the sub-partition is changed once.
  • the preset transform core is a fixed type preset by the decoder.
  • the preset transform core can be any of DCT-2, DST-7, or DCT-8. one.
  • the decoder when the sub-partition of the current block does not use LFNST, the decoder does not need to select a transformation core according to the size of the sub-partition, but can directly set a transformation core as a preset Transform the core, and at the same time, when the sub-partition uses LFNST, set DCT-2 to determine the primary transform core.
  • the decoder can directly determine the preset transformation core as the one-time transformation core used when the sub-partition undergoes a change; if the sub-partition does not use LFNST , Then the decoder can determine DCT-2 as the primary transform core used when the sub-partition is changed once.
  • the preset transform core is a fixed type preset by the decoder.
  • the preset transform core can be any of DCT-2, DST-7, or DCT-8. one.
  • the decoder when the sub-partition of the current block does not use LFNST, the decoder does not need to select a transform core according to the size of the sub-partition, but can directly set DCT-2 to determine once The transformation core, and at the same time, when the sub-partition uses LFNST, the primary transformation core is set as the preset transformation core.
  • the decoder can directly use a syntax unit syntax element in the code stream to indicate a transformation core used when the sub-partition undergoes a change. 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 in one transformation of the sub-partition is the same target transformation core.
  • the target transform core can be any one of DCT-2, DST-7 or DCT-8.
  • the decoder does not need to select a transformation core according to the size of the sub-partition, nor does it need to distinguish a transformation core according to whether the sub-partition uses LFNST, but can directly select a transformation core. Indicate through the syntax unit in the code stream.
  • the decoder can use a syntax unit syntax element in the code stream to indicate the transformation core used when the sub-partition undergoes a change; if the sub-partition If LFNST is not used, the decoder can use another syntax unit syntax element in the code stream to indicate the primary transformation core used when the sub-partition undergoes a change.
  • the decoder may indicate the first target core and the second target core with two different syntax units in the code stream.
  • the first target core and the second target core may be any two of DCT-2, DST-7, or DCT-8.
  • the decoder when the sub-partition of the current block does not use LFNST, the decoder does not need to select a transform core according to the size of the sub-partition, but can directly pass the first transform core through the code stream.
  • the second transformation core can be indicated by another syntax unit in the code stream.
  • the way the decoder signals the syntax element in the code stream may include: block layer, slice layer, image header, parameter set (sequence layer parameter set, image layer parameter set, APS Etc.), and the override relationship between the signal parameters in different data units, for example, the block layer can override the slice layer, etc., and the override between parameter sets, etc.
  • the primary transform core can be adaptively selected, and then the primary transform core can be used in one or more data units of the block layer.
  • the syntax element syntax element of one or more data units in the block layer of the code stream is parsed, so that the used transformation can be determined nuclear.
  • the decoder when the sub-partition of the current block does not use LFNST, the decoder does not need to select a transform core according to the size of the sub-partition, but can directly perform a transform core for the sub-partition. Adaptive settings.
  • the decoder may determine the primary transformation core through the value of the variable isp_trType.
  • the value of the variable isp_trType can be 0, 1, 2, where, if the value of the variable isp_trType is 0, it means that DCT-2 is used as the primary transformation core; if the variable is The value of isp_trType is 1, which means that DST-7 is used as the primary transformation core; if the value of the variable isp_trType is 2, it means that DCT-8 is used as the primary transformation core.
  • the sub-partition after the current block division does not use the secondary transformation.
  • the sub-partition uses the transformation type of the primary transformation, that is, one-time transformation.
  • the transformation core 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.
  • the transformation method proposed in this application can simplify the method of determining a transformation core when the value of lfnstIdx is equal to 0 for the sub-partitions divided by the ISP. Specifically, in this 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, thus eliminating the need for sub-partitions.
  • the size of the partition selects the processing flow of the sub-partition to transform the core at a time.
  • Step 205 Use a transformation kernel to perform transformation processing on the transformation coefficient matrix.
  • the decoder can use the primary transformation core to perform transformation processing on the transformation coefficient matrix.
  • the decoder when the decoder uses a transformation core to perform transformation processing on the transformation coefficient matrix, it can use a transformation core to perform a reverse transformation on the transformation coefficient matrix, so as to obtain sub-partitions.
  • the residual value when the decoder uses a transformation core to perform transformation processing on the transformation coefficient matrix, it can use a transformation core to perform a reverse transformation on the transformation coefficient matrix, so as to obtain sub-partitions. The residual value.
  • the primary transformation core determined by the decoder can characterize the transformation type of the sub-partition undergoing reverse primary transformation, which may include the horizontal transformation when the sub-partition undergoes reverse primary transformation.
  • Type and vertical transformation type Specifically, the horizontal transformation type and the vertical transformation type for the sub-partition to perform the reverse primary transformation are the same, that is, the decoder uses the same primary transformation core to perform the horizontal transformation and the vertical transformation on the sub-partition respectively.
  • the decoder may output the residual coefficients of the sub-partition after the first transformation after performing a reverse transformation process on the residual value of the sub-partition using a transformation check.
  • the core parameters can be configured first, and then the transformation type can be performed.
  • the selection of, and then a reverse transformation can be performed based on the transformation type to complete a transformation process.
  • the transformation type of a transformation that is, a transformation kernel
  • the transformation type of a transformation is no longer selected based on the size of the sub-partition, but directly applies to a transformation kernel.
  • the input of the reverse primary transformation includes: the current luminance block position (xTbY, yTbY), the current block width nTbW, the current block height nTbH, the current block chrominance component cIdx, the prediction of the current decoding unit Mode predMode and the reverse primary transformation coefficient matrix d[x][y] obtained by scanning after reverse secondary transformation.
  • x 0, 1,..., nTbW-1
  • y 0, 1,..., nTbH-1.
  • ISP determines whether to use ISP mode by the variable intra_subpartitions_mode_flag[x0][y0]. Specifically, if intra_subpartitions_mode_flag[x0][y0] is 1, it can be determined to use the ISP mode; if intra_subpartitions_mode_flag[x0][y0] is equal to 0, it can be determined not to use the ISP mode, which means that the current decoding unit is not divided.
  • the ISP can divide horizontally or vertically according to the shape.
  • the variable IntraSubPartitionsSplitType specifies the division type of the current luminance decoding block.
  • the variable IntraSubPartitionsSplitType is 0, it means that the current decoding block is not divided, that is, ISP_NO_SPLIT; when the variable IntraSubPartitionsSplitType is 1, it means 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.
  • the variable NumIntraSubPartitions can be used to specify the number of sub-partitions divided by the current decoding block.
  • NumIntraSubPartitions is set equal to 2:
  • nTbW is equal to 4
  • nTbH is equal to 8
  • nTbW is equal to 8
  • nTbW is equal to 4.
  • implicitMtsEnabled is derived as follows:
  • cu_sbt_flag is equal to 1 and Max(nTbW, nTbH) is less than or equal to 32;
  • 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.
  • variable implicitMtsEnabled 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. However, in this application, it is no longer necessary to derive the value of the variable implicitMtsEnabled. Refer to the value of the variable IntraSubPartitionsSplitType.
  • variable non-zero coefficient block size that is, the non-zero width coefficient nonZeroW and the non-zero height coefficient nonZeroH are derived as the above formulas (1) to (4).
  • variable ApplyLfnstFlag is derived as the above formulas (5) and (6).
  • variable trTypeHor represents the horizontal transformation type
  • variable trTypeVer represents the vertical transformation type
  • both trTypeHor and trTypeVer are set to 0:
  • cIdx is greater than 0;
  • IntraSubPartitionsSplitType is not equal to ISP_NO_SPLIT;
  • trTypeHor and trTypeVer are determined by cu_sbt_horizontal_flag and cu_sbt_pos_flag in Table 5;
  • trTypeHor and trTypeVer are determined by mts_idx. in Table 4.
  • 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 trType are determined by 4 mts_idx. decision.
  • the primary transformation core used by the sub-partition is no longer determined according to the size of the sub-partition. It directly sets the primary transformation core suitable for the sub-division, thus eliminating the need for the processing flow of selecting the primary transformation core of the sub-division through the size of the sub-division.
  • one-dimensional vertical transformation, calculating intermediate coefficient values, one-dimensional horizontal transformation, and obtaining residual coefficients can be sequentially performed on the sub-partitions at a time.
  • nTbH is greater than 1
  • nTbW nTbW
  • nTbW is equal to 1
  • r[x][y] is set equal to e[x][y]
  • x 0...nonZeroW-1
  • y 0...nonZeroH-1
  • the process is mainly to perform one-dimensional reverse primary transformation
  • the input nTbS represents the length of the transformation coefficient
  • nonZeroS represents the length of the non-zero coefficient
  • trType represents the type of transformation
  • the decoder determines the LFNST transformation core used by the sub-partition, that is, the decoder obtains the value of the LFNST index number (lfnst_idx) by parsing the code stream; then, according to the value of lfnst_idx, the value of the LFNST
  • the transformation matrix (transformation kernel) indicated by lfnst_idx is selected from the candidate set of transformation cores.
  • the first set of transformation matrices can be used as the LFNST transformation core in the decoding process; when lfnst_idx is 2, the second set of transformation matrices can be used as the LFNST transformation core in the decoding process.
  • This application proposes a transformation method, which is applied to a decoder.
  • the decoder parses the code stream to determine the ISP mode parameter 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, the current block is determined.
  • the sub-division of the block parse the code stream to determine the transformation coefficient matrix of the sub-division; determine the primary transformation core used by the sub-division; use the primary transformation core to perform transformation processing on the transformation coefficient matrix. It can be seen that, in the embodiment of the present application, for the transformation of the ISP partition, the sub-partition after the current block division does not use the secondary transformation.
  • the sub-partition uses the primary transformation core of the primary transformation, and no longer Determined by the size of the sub-region, that is, no longer select a transformation core according to the height and width of the sub-region, but directly set the primary transformation core.
  • the selection process of the transformation core can be simplified, the complexity of the transformation process can be reduced, and the coding and decoding efficiency can be effectively improved.
  • FIG. 20 is a schematic diagram 1 of the composition structure of the encoder.
  • the encoder 300 proposed in this embodiment of the present application may include a first determining part 301.
  • a conversion part 302 a setting part 303,
  • the first determining part 301 is configured to determine the 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 current block And determine the residual value of the sub-division; and when the sub-division uses a transformation, determine the primary transformation core used by the sub-division;
  • the first transformation part 302 is configured to use the primary transformation kernel to perform transformation processing on the residual value.
  • the first determining part 301 is specifically configured to determine the partition type of the current block; obtain the sub-partition based on the size parameter of the current block and the partition type.
  • the size parameter includes a width value and a height value
  • the division type includes a horizontal division and a vertical division
  • the first determining part 301 is also specifically configured as when the width The value is equal to 4 and the height value is equal to 8, or, when the width value is equal to 8 and the height value is equal to 4, the current block is divided horizontally or vertically to obtain 2 sub-partitions; when the width value is equal to 4 and the height value is greater than 8. Or, when the width value is greater than 8 and the height value is equal to 4, the current block is divided horizontally or vertically to obtain 4 sub-partitions.
  • the first determining part 301 is further specifically configured to determine the intra-frame prediction value of the sub-partition; calculate the difference between the true value of the sub-partition and the intra-frame prediction value The residual value between.
  • the first determining part 301 is further specifically configured to determine DCT-2 as the primary transformation core.
  • the first determining part 301 is further specifically configured to determine a preset transformation core as the primary transformation core when the sub-partition does not use LFNST; wherein, the 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.
  • the first determining part 301 is further specifically configured to determine DCT-2 as the primary transformation core when the sub-partition does not use LFNST; when the sub-partition does not use LFNST When LFNST is used, 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.
  • the first determining part 301 is further specifically configured to determine the target transformation core as the primary transformation core; wherein, the target transformation core is DCT-2, DST-7 Or any one of DCT-8; correspondingly, a syntax unit is used to indicate the target transform core in the code stream.
  • the syntax unit is included in one or more data units in the code stream as follows: a data unit containing the current block, a fragment header Information data unit, image header information data unit, image layer parameter set, sequence layer parameter set.
  • the first determining part 301 is further specifically configured to determine the first transformation core as the primary transformation core when the sub-partition does not use 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 ;
  • two syntax units are used to indicate the first transformation core and the second transformation core respectively in the code stream.
  • the syntax unit is included in one or more data units in the code stream as follows: a data unit containing the current block, a fragment header Information data unit, image header information data unit, image layer parameter set, sequence layer parameter set.
  • the setting part 303 is configured to set the value of the LFNST index sequence number to indicate that the sub-partition does not use LFNST when the sub-partition does not use LFNST; The LFNST index number is written into the code stream.
  • the setting part 303 is further configured to determine the LFNST transformation core used by the sub-partition when the sub-partition uses LFNST, and set the value of the LFNST index number to indicate The sub-partition uses LFNST; the LFNST index number is written into the code stream.
  • FIG. 21 is a schematic diagram of the composition structure of the encoder.
  • the encoder 300 proposed in this embodiment of the present application may further include a first processor 304 and 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.
  • the above-mentioned first processor 304 is configured to determine the ISP mode parameter of the current block; when the ISP mode parameter indicates that the current block uses the ISP mode to determine the frame of the current block When predicting the value, determine the sub-partition of the current block; determine the residual value of the sub-partition; when the sub-partition uses a transformation, determine the primary transformation core used by the sub-partition; use the primary transformation core , Transform the residual value.
  • 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.
  • the technical solution of this embodiment is essentially or correct
  • the part that the prior art contributes or all or part of the technical solution can be embodied in the form of a software product.
  • the computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer).
  • the aforementioned storage media include: U disk, mobile hard disk, read only memory (Read Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program codes.
  • the embodiment of the application provides an encoder.
  • the sub-partition after the current block division does not use the secondary transformation.
  • the sub-partition uses the primary transformation core of the primary transformation, and the The size of the partition is determined, that is, the primary transformation core is no longer selected according to the height and width of the sub-region, but the primary transformation core is directly set.
  • the selection process of the transformation core can be simplified, the complexity of the transformation process can be reduced, and the coding and decoding efficiency can be effectively improved.
  • Fig. 22 is a schematic diagram 1 of the structure of the decoder.
  • the decoder 400 proposed in this embodiment of the present application may include a parsing part 401, a second determining part 402, and a second transforming part 403,
  • the parsing part 401 is configured to analyze the code stream and determine the ISP mode parameters of the current block;
  • the second determining part 402 is configured to determine 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 prediction value of the current block;
  • the analyzing part 401 is further configured to analyze the code stream and determine the transformation coefficient matrix of the sub-division;
  • the second determining part 402 is further configured to determine the primary transformation core used by the sub-partition;
  • the second transformation part 403 is configured to use the primary transformation core to perform transformation processing on the transformation coefficient matrix.
  • the second determining part 402 is specifically configured to determine the size parameter and the partition type of the current block; obtain the size parameter and the partition type of the current block based on the Sub-partition.
  • the size parameter includes a width value and a height value
  • the division type includes a horizontal division and a vertical division
  • the second determining part 402 is also specifically configured to be when the width value Is equal to 4 and the height value is equal to 8, or, when the width value is equal to 8 and the height value is equal to 4, the current block is divided horizontally or vertically to obtain 2 sub-partitions; when the width value is equal to 4 and the height value is greater than 8. , Or, when the width value is greater than 8 and the height value is equal to 4, the current block is divided horizontally or vertically to obtain 4 sub-partitions.
  • the parsing part 401 is further configured to determine 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 After the sub-partition of the block, the code stream is parsed to determine the LFNST index number of the sub-partition.
  • the second determining part 402 is further specifically configured to determine DCT-2 as the primary transformation core.
  • the second determining part 402 is further specifically configured to determine the preset transformation core as the primary transformation when the LFNST index number indicates that the sub-partition does not use LFNST 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 Change the core at a time.
  • the second determining part 402 is further specifically configured to determine DCT-2 as the primary transformation core when the LFNST index sequence number indicates that the sub-partition does not use LFNST.
  • the preset transformation core is determined as the primary transformation core; wherein, the preset transformation core is DCT-2, DST-7 or DCT-8 Any one of.
  • the second determining part 402 is further specifically configured to determine the target transformation core as the primary transformation core if a syntax unit in the code stream indicates the target transformation core ;
  • the target transformation core is any one of DCT-2, DST-7 or DCT-8.
  • one of the data unit, the slice header information data unit, the image header information data unit, the image layer parameter set, and the sequence layer parameter set contained in the current block in the code stream is analyzed.
  • a plurality of data units obtain the value of the syntax unit to determine the target transformation core.
  • the second determining part 402 is further specifically configured to indicate the first transform core and the second transform core with two syntax units in the code stream, when the LFNST index When the sequence number indicates that the sub-partition does not use LFNST, the first transformation core is determined to be the primary transformation core; when the LFNST index sequence number indicates that the sub-partition uses LFNST, the second transformation core is determined to be The primary transformation core; wherein the first transformation core and the second transformation core are any two of DCT-2, DST-7, or DCT-8.
  • one of the data unit, the slice header information data unit, the image header information data unit, the image layer parameter set, and the sequence layer parameter set contained in the current block in the code stream is analyzed.
  • a plurality of data units obtain the value of the syntax unit to determine the first transformation core and the second transformation core.
  • the second transformation part 403 is specifically configured to perform a reverse transformation on the transformation coefficient matrix using the primary transformation core to obtain the residual value of the sub-partition.
  • FIG. 23 is a second schematic diagram of the structure of the decoder.
  • the decoder 400 proposed in this embodiment of the present application may further include a second processor 404, and a second memory 405 storing executable instructions of the second processor 404.
  • the above-mentioned second processor 404 is configured to parse the code stream and determine the ISP mode parameter of the current block; when the ISP mode parameter indicates that the current block uses the ISP mode to determine the current block When the intra-frame prediction value of the block, determine the sub-partition of the current block; parse the code stream to determine the transform coefficient matrix of the sub-partition; when the sub-partition uses one transform, determine the one-time transform used by the sub-partition Core; using the primary transformation kernel to perform transformation processing on the transformation coefficient matrix.
  • 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.
  • the technical solution of this embodiment is essentially or correct
  • the part that the prior art contributes or all or part of the technical solution can be embodied in the form of a software product.
  • the computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer).
  • the aforementioned storage media include: U disk, mobile hard disk, read only memory (Read Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program codes.
  • the embodiment of the present application provides a decoder.
  • the sub-partition after the current block partition does not use the secondary transformation.
  • the sub-partition uses the primary transformation core of the primary transformation, and the sub-partition uses the primary transformation core of the primary transformation.
  • the size of the partition is determined, that is, the primary transformation core is no longer selected according to the height and width of the sub-region, but the primary transformation core is directly set.
  • the embodiments of the present application provide a computer-readable storage medium and a computer-readable storage medium, on which a program is stored, and when the program is executed by a processor, the method as described in the above-mentioned embodiment is implemented.
  • the program instructions corresponding to a conversion method in this embodiment can be stored on storage media such as optical disks, hard disks, USB flash drives, etc.
  • storage media such as optical disks, hard disks, USB flash drives, etc.
  • the ISP mode parameter indicates that the current block uses the ISP mode to determine the intra prediction value of the current block, determining the sub-partition of the current block;
  • transformation processing is performed on the residual value.
  • the program instructions corresponding to a conversion method in this embodiment can be stored on storage media such as optical disks, hard disks, USB flash drives, etc.
  • storage media such as optical disks, hard disks, USB flash drives, etc.
  • the ISP mode parameter indicates that the current block uses the ISP mode to determine the intra prediction value of the current block, determining the sub-partition of the current block;
  • the transformation processing is performed on the transformation coefficient matrix using the primary transformation core.
  • this application can be provided as methods, systems, or computer program products. Therefore, this application may adopt the form of hardware embodiments, software embodiments, or embodiments combining software and hardware. Moreover, this 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, optical storage, etc.) containing computer-usable program codes.
  • These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device.
  • the device realizes the functions specified in one or more processes in the schematic diagram and/or one block or more in the block diagram.
  • These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment.
  • the instructions provide steps for implementing functions specified in one or more processes in the schematic diagram and/or one block or more in the block diagram.
  • the embodiments of the present application provide a transformation method, an encoder, a decoder, and a storage medium.
  • the encoder determines the ISP mode parameter 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, Determine the sub-division of the current block; determine the residual value of the sub-division; when the sub-division uses a transformation, determine the primary transformation kernel used by the sub-division; use a transformation kernel to perform transformation processing on the residual value.
  • the decoder parses the code stream and determines 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, the sub-partition of the current block is determined; the code stream is parsed to determine the transformation of the sub-partition Coefficient matrix; determine the primary transformation kernel used by the sub-division; use the primary transformation kernel to perform transformation processing on the transformation coefficient matrix. It can be seen that, in the embodiment of the present application, for the transformation of the ISP partition, the sub-partition after the current block division does not use the secondary transformation.
  • the sub-partition uses the primary transformation core of the primary transformation, and no longer Determined by the size of the sub-region, that is, no longer select a transformation core according to the height and width of the sub-region, but directly set the primary transformation core.
  • the selection process of the transformation core can be simplified, the complexity of the transformation process can be reduced, and the coding and decoding efficiency can be effectively improved.

Landscapes

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

Abstract

一种变换方法、编码器、解码器以及存储介质,编码器确定当前块的ISP模式参数;当ISP模式参数指示当前块使用ISP模式确定当前块的帧内预测值时,确定当前块的子分区;确定子分区的残差值;当子分区使用一次变换时,确定子分区使用的一次变换核;使用一次变换核,对残差值进行变换处理。解码器解析码流,确定当前块的ISP模式参数;当ISP模式参数指示当前块使用ISP模式确定当前块的帧内预测值时,确定当前块的子分区;解析码流,确定子分区的变换系数矩阵;确定子分区使用的一次变换核;使用一次变换核,对变换系数矩阵进行变换处理。

Description

变换方法、编码器、解码器以及存储介质 技术领域
本申请实施例涉及图像处理技术领域,尤其涉及一种变换方法、编码器、解码器以及存储介质。
背景技术
随着人们对视频显示质量要求的提高,高清和超高清视频等新视频应用形式应运而生。H.265/高效率视频编码(High Efficiency Video Coding,HEVC)已经无法满足视频应用迅速发展的需求,联合视频研究组(Joint Video Exploration Team,JVET)提出了下一代视频编码标准H.266/多功能视频编码(Versatile Video Coding,VVC),其相应的测试模型为VVC的参考软件测试平台(VVC Test Model,VTM)。
目前,H.266/VVC中已经接受了简化的二次变换(Reduced Second Transform,RST)技术,并更名为低频不可分二次变换(Low-Frequency Non-Separable Transform,LFNST)技术。进一步地,VVC中变换部分包括一次变换和二次变换。一次变换支持多个变换核,称为多变换核集合(Multiple Transform Set,MTS)技术,二次变换为LFNST,其中,二次变换通过lfnst_idx表明是否使用二次变换,以及使用哪一个lfnst变换核。而在对一次变换的变换核进行确定时,在不使用LFNST时,需要基于变换块的尺寸进行一次变换核的选择,由于变换核的选择过程较为繁琐,增加了变换过程的复杂程度,从而降低了编码效率。
发明内容
本申请实施例提供一种变换方法、编码器、解码器以及存储介质,可以简化变换核的选择过程,降低了变换过程的复杂程度,有效地提高了编解码效率。
本申请实施例的技术方案可以如下实现:
第一方面,本申请实施例提供了一种变换方法,应用于编码器,所述方法包括:
确定当前块的ISP模式参数;
当所述ISP模式参数指示所述当前块使用ISP模式确定所述当前块的帧内预测值时,确定所述当前块的子分区;
确定所述子分区的残差值;
当所述子分区使用一次变换时,确定所述子分区使用的一次变换核;
使用所述一次变换核,对所述残差值进行变换处理。
第二方面,本申请实施例提供了一种变换方法,应用于解码器,所述方法包括:
解析码流,确定当前块的ISP模式参数;
当所述ISP模式参数指示所述当前块使用ISP模式确定所述当前块的帧内预测值时,确定所述当前块的子分区;
解析码流,确定所述子分区的变换系数矩阵;
确定所述子分区使用的一次变换核;
使用所述一次变换核,对所述变换系数矩阵进行变换处理。
第三方面,本申请实施例提供了一种编码器,所述编码器包括:第一确定部分,第一变换部分,
所述第一确定部分,配置为确定当前块的ISP模式参数;以及当所述ISP模式参数指示所述当前块使用ISP模式确定所述当前块的帧内预测值时,确定所述当前块的子分区;以及确定所述子分区的残差值;以及当所述子分区使用一次变换时,确定所述子分区使用的一次变换核;
所述第一变换部分,配置为使用所述一次变换核,对所述残差值进行变换处理。
第四方面,本申请实施例提供了一种编码器,所述编码器包括第一处理器、存储有所述第一处理器可执行指令的第一存储器,当所述指令被执行时,所述第一处理器执行时实现如上所述的变换方法。
第五方面,本申请实施例提供了一种解码器,所述解码器包括:解析部分,第二确定部分,第二变换部分,
所述解析部分,配置为解析码流,确定当前块的ISP模式参数;
所述第二确定部分,配置为当所述ISP模式参数指示所述当前块使用ISP模式确定所述当前块的帧内预测值时,确定所述当前块的子分区;
所述解析部分,还配置为解析码流,确定所述子分区的变换系数矩阵;
所述第二确定部分,还配置为确定所述子分区使用的一次变换核;
所述第二变换部分,配置为使用所述一次变换核,对所述变换系数矩阵进行变换处理。
第六方面,本申请实施例提供了一种解码器,所述解码器包括第二处理器、存储有所述第二处理器可执行指令的第二存储器,当所述指令被执行时,所述第二处理器执行时实现如上所述的变换方法。
第七方面,本申请实施例提供了一种计算机存储介质,所述计算机存储介质存储有计算机程序,所述计算机程序被第一处理器和第二处理器执行时,实现如上所述的变换方法。
本申请实施例提供了一种变换方法、编码器、解码器以及存储介质,编码器确定当前块的ISP模式参数;当ISP模式参数指示当前块使用ISP模式确定当前块的帧内预测值时,确定当前块的子分区;确定子分区的残差值;当子分区使用一次变换时,确定子分区使用的一次变换核;使用一次变换核,对残差值进行变换处理。解码器解析码流,确定当前块的ISP模式参数;当ISP模式参数指示当前块使用ISP模式确定当前块的帧内预测值时,确定当前块的子分区;解析码流,确定子分区的变换系数矩阵;确定子分区使用的一次变换核;使用一次变换核,对变换系数矩阵进行变换处理。由此可见,在本申请的实施例中,对于ISP分区的变换,在当前块划分后的子分区不使用二次变换,仅使用一次变换时,子分区使用一次变换的一次变换核,不再由子分区的尺寸决定,即不再根据子分区的高度和宽度对一次变换核进行选择,而是直接对一次变换核进行设置。从而可以简化变换核的选择过程,降低了变换过程的复杂程度,有效地提高了编解码效率。
附图说明
图1为LFNST技术的应用示意图;
图2为LFNST具体过程的流程框图;
图3为编码块划分示意图一;
图4为编码块划分示意图二;
图5为编码块划分示意图三;
图6为编码块划分示意图四;
图7为ISP模式变换选择示意图;
图8为反向一次变换的实现示意图一;
图9为反向一次变换的实现示意图二;
图10为视频编码系统的组成框图;
图11为视频解码系统的组成框图;
图12为变换方法的实现流程示意图一;
图13为变换方法的实现流程示意图二;
图14为变换核确定流程的示意图;
图15为变换方法的实现流程示意图三;
图16为变换方法的实现流程示意图四;
图17为变换方法的实现流程示意图五;
图18为变换方法的实现流程示意图六;
图19为变换方法的实现流程示意图七;
图20为编码器的组成结构示意图一;
图21为编码器的组成结构示意图二
图22为解码器的组成结构示意图一;
图23为解码器的组成结构示意图二。
具体实施方式
为了能够更加详尽地了解本申请实施例的特点与技术内容,下面结合附图对本申请实施例的实现进行详细阐述,所附附图仅供参考说明之用,并非用来限定本申请实施例。
H.266/VVC中接受了由LGE在JVET-N0193中提出的RST技术,并更名为LFNST技术。在之后的会议中,随着标准的制定过程,LFNST技术不断优化。下面将针对目前LFNST技术的相关技术方案描述。
VVC中变换部分包括一次变换和二次变换。一次变换支持多个变换核,称为多变换核集合(Multiple Transform Set,MTS)技术,二次变换为LFNST,其中,二次变换通过lfnst_idx表明是否使用二次变换,以及使用哪一个lfnst变换核。
图1为LFNST技术的应用示意图,参见图1,其示出了相关技术方案提供的一种LFNST技术的应用位置示意图。如图1所示,在帧内预测模式中,对于编码器侧,在正一次变换单元11与量化单元12之间应用有LFNST技术。对于解码器侧,在反量化单元13与反一次变换单元14之间应用有LFNST技术。
具体来说,在编码器侧,首先针对数据,比如预测残差(可以用residual表示)通过正一次变换单元11进行第一次变换(可以称之为“Core Transform”或者“一次变换”或者“主变换”),以得到第一次变换后的变换系数矩阵;然后针对该变换系数矩阵中的系数进行LFNST变换(可以称之为“Secondary Transform”或者“二次变换”),得到LFNST变换系数矩阵,最后针对LFNST变换系数矩阵通过量化单元12进行量化处理,将最终的量化值写入码流(bitstream)。
在解码器侧,通过解析码流,可以获得LFNST变换系数矩阵的量化值,通过反量化单元13对该量化值进行反量化处理(可以称之为“Scaling”),得到LFNST变换系数矩阵的恢复值,对该恢复值进行反向LFNST变换,可以得到系数矩阵;然后再通过反一次变换单元14对系数矩阵进行与编码器侧“Core Transform”对应的反变换,最终得到residual的恢复值。需要注意的是,标准中仅定义了解码器侧的“反变换”操作,因此在标准中针对“反向LFNST变换”也称之为“LFNST变换”;本申请实施例为了便于和编码器侧的变换进行区分,可以将编码器侧“LFNST变换”称为“正向LFNST变换”,将解码器侧“LFNST变换”称为“反向LFNST变换”。
也就是说,在编码器侧,当前变换块的预测残差通过正一次变换,可以得到一次变换系数,然后将部分一次变换系数通过矩阵乘法进行二次变换,得到数量更少且更加集中的二次变换系数,再对其进行量化处理;在解码器侧,则是在解析出量化值之后,对其进行反量化处理,将反量化后的系数通过矩阵乘法进行反二次变换,然后将反二次变换后的系数进行反一次变换,从而恢复出预测残差。
在LFNST技术中,LFNST变换过程主要可以包括:配置核心参数、帧内预测模式映射、选择变换矩阵、计算矩阵乘法和构造反一次变换系数矩阵等步骤;经过这些步骤的处理之后,便完成了LFNST变换。然而,在选择变换矩阵的步骤中,首先需要选择变换集,由于变换矩阵与预测模式的方向特性相关,目前是根据帧内预测模式来选择变换集的。其中,对于传统帧内预测模式,可以根据传统帧内预测模式的编号来确定帧内预测模式指示符的取值,然后根据帧内预测模式指示符的取值来确定变换集索引序号。
具体地,图2为LFNST具体过程的流程框图,如图2所示,LFNST具体过程可以分为五个步骤,包括配置核心参数、帧内预测模式映射、选择变换矩阵、计算矩阵乘法和构造一次变换系数矩阵。其中,对于帧内预测模式映射来说,该步骤用于确定predModeIntra的取值,主要可以包括:非传统帧内预测模式映射和宽角度映射;对于选择变换矩阵来说,该步骤用于选择出变换集以及变换矩阵,主要可以包括:选择变换集、选择变换矩阵组别和选择变换 矩阵尺寸。
H.266/VVC接收了由HHI在JVET-M0102提出的帧内子分区(Intra Sub-Partitions,ISP)编码模式,ISP编码模式是基于行的帧内(Line-Based Intra)编码模式的改进版本,解决了之前算法设计中与硬件相关的问题。
具体地,ISP技术主要针对亮度编码块,且应用的编码块最小尺寸为8x4和4x8,最大尺寸为64x64;使用多参考行模式时禁用ISP。
在进行ISP的划分时,对于尺寸为8x4和4x8的编码块,ISP将其划分为2个子分区,对于应用ISP的其他尺寸的编码块,ISP将其划分为4个子分区,表1为分区数目表,如表1所示,根据编码块的尺寸进行划分时,尺寸为4x4的编码块不进行划分,尺寸为8x4和4x8的编码块可以划分为2个子分区,剩余的其他尺寸的编码块可以划分为4个子分区。
表1
编码块尺寸 子分区数目
4x4 不划分
4x8和8x4 2
其他尺寸 4
图3为编码块划分示意图一,图4为编码块划分示意图二,如图3和图4所示,对于尺寸(WxH)为8x4和4x8的编码块,水平划分后可以获得的尺寸为Wx(H/2)的2个子分区;垂直划分后可以获得尺寸为(W/2)xH的2个子分区。
图5为编码块划分示意图三,图6为编码块划分示意图四,如图5和图6所示,对于4x4、8x4以及4x8以外的、其他尺寸的编码块,水平划分后可以获得的尺寸为Wx(H/4)的4个子分区;垂直划分后可以获得尺寸为(W/4)xH的4个子分区。
在对ISP划分后的子分区进行预测的时候,可以参考上一个子分区的重建信号(第一个子分区除外),具体地,对于一个子分区,可以通过将残差信号与预测信号相加获得该子分区的重建信号,其中,残差信号可以通过熵解码、反量化、反变换得到。此外,需要处理的第一个子分区是包含CU中左上角像素的子分区,然后按照向下(水平划分)或向右(垂直划分)处理各个子分区。ISP的所有子分区共享同一种帧内预测模式,其使用的预测模式包括直流(Direct Current,DC)模式、平面(PLANAR)模式以及角度模式等。
进一步地,ISP也对子分区进行预测时的尺寸进行了限制,具体地,限制子分区进行预测时的最小预测宽度为4,因此,对于变换尺寸中的宽度小于4的子分区,其预测尺寸中的宽度为4,即对ISP划分后的子分区进行预测的时候,预测时的宽度和进行变换的宽度不一定相同,表2为ISP分区预测尺寸限制表一,如表2所示,对于尺寸为4x8的分区,在垂直划分为2个子分区之后,每个子分区的变换尺寸为2x8,而子分区用于预测的尺寸为4x8;对于尺寸为4xN(N>8)的分区,在垂直划分为4个子分区之后,每个子分区的变换尺寸为1xN,而子分区用于预测的尺寸为4xN;对于尺寸为8xN(N>8)的分区,在垂直划分为4个子分区之后,每个子分区的变换尺寸为2xN,而子分区用于预测的尺寸为4xN。
表2
分区(WxH) 子分区的预测尺寸 子分区的变换尺寸
4x8 4x8 2x8
4xN(N>8) 4xN 1xN
8xN(N>4) 4xN 2xN
图为变化尺寸和预测尺寸的示意图一,使用ISP编码并垂直划分的8xN(N>4)的编码块,预测尺寸大小为4xN,变换尺寸大小为2xN。图为变化尺寸和预测尺寸的示意图二,使用ISP编码并垂直划分的4xN(N>8)的编码块,预测尺寸为4xN,子变换块的大小为1xN。
对于ISP分区的变换,在对ISP划分后的子分区进行变换时,如果使用二次变换LFNST,则一次变换的变换核为DCT-2;如果不使用二次变换LFNST,使用一次变换时,其一次变换类型主要是由当前子分区的尺寸决定,即子分区的尺寸可以对一次变换的变换核进行确定。具体地,如果子分区的宽度大于或者等于4,且小于或者等于16,那么可以确定水平方向上的一次变换使用DST-7变换,否则使用DCT-2变换,即trTypeHor=(nTbW>=4&&nTbW<=16)?DST-7:DCT-2;如果当前分区的高度大于或者等于4,且小于或者等于16,那么可以确定垂直方向上的一次变换使用DST-7变换,否则使用DCT-2变换,即trTypeVer=(nTbH>=4&&nTbH<=16)?DST-7:DCT-2。
如果ISP划分后的子分区满足宽度和高度都大于或者等于4,也可以使用LFNST二次变换,并且,如果子分区使用二次变换LFNST的话,则不再根据子分区的尺寸选择变换类型,而是直接使用变换核进行DCT-2变换处理。
图7为ISP模式变换选择示意图,如图7所示,在VVC中,如果lfnst_idx的值为0,即不使用二次变换LFNST,那么在使用一次变换时,可以根据子分区的尺寸对一次变换的变换核进行确定;如果lfnst_idx的值为1或2,即使用二次变换LFNST,那么一次变换的变换核为DCT-2。也就是说,ISP模式变换选择的机制为不使用二次变换LFNST时,基于子分区的尺寸大小确定变换核。
另一方面,在解码端,对于ISP子分区进行反变换的过程,下面将详细介绍VVC8draft中ISP模式的反变换过程。
反向一次变换的输入包括当前编码块的位置(xTbY,yTbY),当前编码块的颜色分量cIdx,当前编码块的预测模式predMode,当前编码块的宽度nTbW,当前编码块的高度nTbH,以及经过反向二次变换后扫描得到的反向一次变换系数矩阵d[x][y]。
反向一次变换的输出:通过反向一次变换获得的残差系数res[x][y],其中x=0……nTbW-1,y=0……nTbH-1。
进一步地,图8为反向一次变换的实现示意图一,如图8所示,ISP模式的反向一次变换的过程分主要包括以下 部分:配置核心参数;选择变换类型;进行反向变换。
在配置核心参数时,ISP由变量intra_subpartitions_mode_flag[x0][y0]决定是否使用ISP模式。具体地,如果intra_subpartitions_mode_flag[x0][y0]为1,便可以确定使用ISP模式,则将当前编码单元划分为NumIntraSubPartitions[x0][y0]个编码块;如果intra_subpartitions_mode_flag[x0][y0]等于0,便可以确定不使用ISP模式,则表示当前编码单元未进行划分。
ISP可以根据当前编码块的形状进行水平或者垂直划分,具体地,变量IntraSubPartitionsSplitType指定当前编码块的划分类型,表3为IntraSubPartitionsSplitType的定义,如表3所示,变量IntraSubPartitionsSplitType为0时,表征当前编码块未进行划分,即ISP_NO_SPLIT;变量IntraSubPartitionsSplitType为1时,表征对当前编码块进行水平划分,即ISP_HOR_SPLIT;变量IntraSubPartitionsSplitType为2时,表征对当前编码块进行垂直划分,即ISP_VER_SPLIT。
表3
IntraSubPartitionsSplitType Name of IntraSubPartitionsSplitType
0 ISP_NO_SPLIT
1 ISP_HOR_SPLIT
2 ISP_VER_SPLIT
其中,IntraSubPartitionsSplitType的推导如下:
如果Intra_subpartitions_mode_flag等于0,则将IntraSubPartitionsSplitType设置为0;
否则,将IntraSubPartitionsSplitType设置为1+intra_subpartitions_split_flag;其中,intra_subpartitions_split_flag用于表征划分方式,当intra_subpartitions_split_flag取值为0时,指示水平划分;当intra_subpartitions_split_flag取值为1时,指示垂直划分。
由于ISP根据当前编码块的尺寸可以将当前编码块划分为2个或4个子分区,因此可以利用变量NumIntraSubPartitions指定当前编码块划分的子分区的数量。在推导NumIntraSubPartitions时,具体地,
如果IntraSubPartitionsSplitType等于ISP_NO_SPLIT,则NumIntraSubPartitions设置为等于1;
否则,如果满足以下条件之一,则将NumIntraSubPartitions设置为等于2:
nTbW等于4,nTbH等于8;
nTbW等于8,nTbW等于4。
否则,将NumIntraSubPartitions设置为等于4。
进一步地,隐性选择变量implicitMtsEnabled推导如下:
如果sps_mts_enabled_flag等于1并且下列条件中的一个或者多个成立,则implicitMtsEnabled设置等于1:
IntraSubPartitionsSplitType不等于ISP_NO_SPLIT;
cu_sbt_flag等于1且Max(nTbW,nTbH)小于等于32;
sps_explicit_mts_intra_enabled_flag等于0且CuPredMode[0][xTbY][yTbY]等于MODE_INTRA且lfnst_idx[x0][y0]等于0且intra_mip_flag[x0][y0]等于0;
进一步地,变量非零系数块尺寸,即非零宽度系数nonZeroW和非零高度系数nonZeroH推导如下公式:
如果ApplyLfnstFlag等于1且nTbW和nTbH同时大于等于4,则,
nonZeroW=(nTbW==4||nTbH==4)?4:8            (1)
nonZeroH=(nTbW==4||nTbH==4)?4:8           (2)
否则,
nonZeroW=Min(nTbW,(trTypeHor>0)?16:32)         (3)
nonZeroH=Min(nTbH,(trTypeVer>0)?16:32)           (4)
其中,变量ApplyLfnstFlag推导如下公式:
如果treeType等于SINGLE_TREE,则:
ApplyLfnstFlag=(lfnst_idx>0&&cIdx==0)?1:0              (5)
否则:
ApplyLfnstFlag=(lfnst_idx>0)?1:0                (6)
在选择变换类型时,变量trTypeHor表示水平变换类型,变量trTypeVer表示垂直变换类型,trTypeHor和trTypeVer的推导如下:
以下任意条件满足则trTypeHor和trTypeVer都设置为0:
cIdx大于0;
IntraSubPartitionsSplitType不等于ISP_NO_SPLIT且lfnst_idx不等于0;
否则,如果变量implicitMtsEnabled等于1,则:
如果cu_sbt_flag等于1,则trTypeHor和trTypeVer由表5中cu_sbt_horizontal_flag和cu_sbt_pos_flag决定;
否则(cu_sbt_flag等于0),trTypeHor和trTypeVer推导如下公式:
trTypeHor=(nTbW>=4&&nTbW<=16)?1:0              (7)
trTypeVer=(nTbH>=4&&nTbH<=16)?1:0            (8)
否则,trTypeHor和trTypeVer由表4中的mts_idx.决定。
表4为mtsIdx与trTypeHor和trTypeVer的关系,表5为trTypeHor和trTypeVer与cu_sbt_horizontal_flag和cu_sbt_pos_flag的关系,具体如下:
表4
MtsIdx 0 1 2 3 4
trTypeHor 0 1 2 1 2
trTypeVer 0 1 1 2 2
表5
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
基于上述图9,图9为反向一次变换的实现示意图二,如图9所示,在进行反向一次变换时,具体过程可以包括以下几个部分:一维垂直变换;计算中间系数值;一维水平变换以及获取残差系数。
对于一维垂直变换,如果nTbH大于1,则调用下述的一维反向一次变换过程,其输入为经过反向二次变换后得到的反向一次变换系数d[x][y],x=0……nonZeroW-1,y=0……nonZeroH-1,变换块高度nTbH和非零高度系数nonZeroH,垂直变换类型trTypeVer;输出为e[x][y],x=0……nonZeroW-1,y=0……nonZeroH-1。
在计算中间系数值时,如果nTbH和nTbW均大于1,中间样本值g[x][y],x=0……nonZeroW-1,y=0……nonZeroH-1导出如下公式:
g[x][y]=Clip3(CoeffMin,CoeffMax,(e[x][y]+64)>>7)           (9)
对于一维水平变换,如果nTbW大于1,调用下述的一维反向一次变换过程,其输入为中间样本值g[x][y],x=0……nonZeroW-1,y=0……nonZeroH-1,变换块宽度nTbW和非零宽度系数nonZeroW,水平变换类型trTypeHor;输出为r[x][y],x=0……nonZeroW-1,y=0……nonZeroH-1。
如果nTbW等于1,则r[x][y]设置等于e[x][y],x=0……nonZeroW-1,y=0……nonZeroH-1
在获取残差系数时,残差系数矩阵res[x][y],x=0……nonZeroW-1,y=0……nonZeroH-1推导如下公式:
bdShift=Max(20-BitDepth,0)           (10)
res[x][y]=(r[x][y]+(1<<(bdShift-1)))>>bdShift           (11)
其中,对于一维反向一次变换过程,该过程主要是进行一维反向一次变换,其输入nTbS表示变换系数的长度,nonZeroS表示非零系数的长度,x[j],j=0……nonZeroS表示未进行一维反向一次变换的系数,trType表示变换类型;输出是经过一维反向一次变换的系数y[i],i=0……nonZeroS。
首先根据变换系数长度nTbS和变换类型trType获得变换矩阵transMatrix,然后根据trType计算y[i],i=0……nonZeroS:
如果trType等于0,则计算方法如下:
Figure PCTCN2020083367-appb-000001
否则(trType等于1或2),计算方法如下:
Figure PCTCN2020083367-appb-000002
对于ISP分区的变换,在ISP划分后的子分区不使用二次变换的情况下,子分区使用一次变换时,子分区一次变换的变换类型主要是由子分区的尺寸决定。即当前分区的宽度大于或者等于4,且小于或者等于16,则水平方向上的一次变换使用DST-7变换,否则使用DCT-2变换;当前分区的高度大于或者等于4,且小于或者等于16,则垂直方向上的一次变换使用DCT-2变换。虽然如上所述的ISP变换选择方式增加了变换选择的多样性,但是同时也引入了一定的复杂度,从而降低了编码效率。
也就是说,对于目前H.266/VVC,如果ISP划分后的子分区不使用二次变换,那么在使用一次变换时,需要根据子分区的尺寸对一次变换的变换核进行选择,可见,基于变换块的尺寸进行一次变换核的选择过程较为繁琐,增加了变换过程的复杂程度,从而降低了编码效率。
进一步地,由于VVC目前接受了对ISP编码块可以使用二次变换LFNST。对于ISP编码块,在使用DCT2(一次变换核)+LFNST(二次变换核)时,编码性能可以有效地提升。在基于率失真代价最小的竞争机制中,LFNST为0时选到的概率不大,此时使用基于分区尺寸选择变换核的方法带来的编码性能提升有限,而其复杂度也比较高,尤其是DST-7变换核的复杂度。
为了克服上述缺陷,本申请提出一种变换方法,对于ISP分区的变换,在当前块划分后的子分区不使用二次变换,仅使用一次变换时,子分区使用一次变换的一次变换核,不再由子分区的尺寸决定,即不再根据子分区的高度和宽度对一次变换核进行选择,而是直接对一次变换核进行设置。具体地,在编码侧,编码器直接对子分区使用的一次变换核进行确定,在利用语法元素对一次变换核进行指示后写入码流;在解码侧,解码器解析码流后根据指示一次变换核的语法元素确定子分区使用的一次变换核。也就是说,在本申请中,对于ISP分区的变换,当子分区不使用LFNST时,可以直接对一次变换使用的一次变换核进行确定,而不需要再根据子分区的高度和宽度对一次变换核进行选择,从而可以简化变换核的选择过程,降低了变换过程的复杂程度,有效地提高了编解码效率。
需要说明的是,在本申请的实施例中,图10为视频编码系统的组成框图;其示出了本申请实施例提供的一种视频编码系统的组成框图示例;如图10所示,该视频编码系统11包括变换单元111、量化单元112、模式选择和编码控制逻辑单元113、帧内预测单元114、帧间预测单元115(包括:运动补偿和运动估计)、反量化单元116、反变换单元117、环路滤波单元118、编码单元119和解码图像缓存单元110;针对输入的原始视频信号,通过编码树块(Coding Tree Unit,CTU)的划分可以得到一个视频重建块,通过模式选择和编码控制逻辑单元113确定编码模式,然后,对经过帧内或帧间预测后得到的残差像素信息,通过变换单元111、量化单元112对该视频重建块进行变换,包括将残 差信息从像素域变换到变换域,并对所得的变换系数进行量化,用以进一步减少比特率;帧内预测单元114用于对该视频重建块进行帧内预测;其中,帧内预测单元114用于确定该视频重建块的最优帧内预测模式(即目标预测模式);帧间预测单元115用于执行所接收的视频重建块相对于一或多个参考帧中的一或多个块的帧间预测编码,以提供时间预测信息;其中吗,运动估计为产生运动向量的过程,所述运动向量可以估计该视频重建块的运动,然后,运动补偿基于由运动估计所确定的运动向量执行运动补偿;在确定帧间预测模式之后,帧间预测单元115还用于将所选择的帧间预测数据提供到编码单元119,而且,将所计算确定的运动向量数据也发送到编码单元119;此外,反量化单元116和反变换单元117用于该视频重建块的重构建,在像素域中重构建残差块,该重构建残差块通过环路滤波单元118去除方块效应伪影,然后,将该重构残差块添加到解码图像缓存单元110的帧中的一个预测性块,用以产生经重构建的视频重建块;编码单元119是用于编码各种编码参数及量化后的变换系数。而解码图像缓存单元110用于存放重构建的视频重建块,用于预测参考。随着视频图像编码的进行,会不断生成新的重构建的视频重建块,这些重构建的视频重建块都会被存放在解码图像缓存单元110中。
图11为视频解码系统的组成框图;其示出了本申请实施例提供的一种视频解码系统的组成框图示例;如图11所示,该视频解码系统12包括解码单元121、反变换单元127,与反量化单元122、帧内预测单元123、运动补偿单元124、环路滤波单元125和解码图像缓存单元126单元;输入的视频信号经过视频编码系统11进行编码处理之后,输出该视频信号的码流;该码流输入视频解码系统12中,首先经过解码单元121,用于得到解码后的变换系数;针对该变换系数通过反变换单元127与反量化单元122进行处理,以便在像素域中产生残差块;帧内预测单元123可用于基于所确定的帧内预测方向和来自当前帧或图片的先前经解码块的数据而产生当前视频解码块的预测数据;运动补偿单元124是通过剖析运动向量和其他关联语法元素来确定用于视频解码块的预测信息,并使用该预测信息以产生正被解码的视频解码块的预测性块;通过对来自反变换单元127与反量化单元122的残差块与由帧内预测单元123或运动补偿单元124产生的对应预测性块进行求和,而形成解码的视频块;该解码的视频信号通过环路滤波单元125以便去除方块效应伪影,可以改善视频质量;然后将经解码的视频块存储于解码图像缓存单元126中,解码图像缓存单元126存储用于后续帧内预测或运动补偿的参考图像,同时也用于视频信号的输出,得到所恢复的原始视频信号。
本申请实施例中的变换方法,可以应用在如图10所示的变换单元111和反变换单元117部分。另外,本申请实施例中的变换方法,还可以应用在如图11所示的反变换单元127部分。也就是说,本申请实施例中的变换方法,既可以应用于视频编码系统,也可以应用于视频解码系统,甚至还可以同时应用于视频编码系统和视频解码系统,但是本申请实施例不作具体限定。还需要说明的是,当该变换方法应用于视频编码系统时,“当前块”具体是指帧内预测中的当前编码块;当该变换方法应用于视频解码系统时,“当前块”具体是指帧内预测中的当前解码块。
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。
本申请的一实施例提出了一种变换方法,应用于编码器,图12为变换方法的实现流程示意图一,如图12所示,编码器进行变换处理的方法可以包括以下步骤:
步骤101、确定当前块的ISP模式参数。
步骤102、当ISP模式参数指示当前块使用ISP模式确定当前块的帧内预测值时,确定当前块的子分区。
在本申请的实施例中,编码器可以先对当前块的ISP模式参数进行确定,并在确定ISP模式参数之后,如果ISP模式参数指示当前块使用ISP模式确定当前块的帧内预测值,那么编码器可以进一步确定当前块的子分区。
需要说明的是,在本申请的实施中,ISP模式参数可以指示当前块是否可以使用帧内子分区编码模式,即指示当前块是否可以使用ISP模式。
可以理解的是,在本申请的实施例中,可以将ISP模式参数理解为一个表明是否使用了ISP模式标志位。具体地,编码器可以将变量intra_subpartitions_mode_flag作为ISP模式参数,从而可以通过对变量intra_subpartitions_mode_flag取值的设置来实现ISP模式参数的设置。
示例性的,在本申请中,如果当前块使用ISP模式,那么编码器可以将ISP模式参数的取值设置为指示当前块使用ISP模式,具体地,编码器可以将变量intra_subpartitions_mode_flag的取值设置为1。
示例性的,在本申请中,如果当前块不使用ISP模式,那么编码器可以将ISP模式参数的取值设置为指示当前块不使用ISP模式,具体地,编码器可以将变量intra_subpartitions_mode_flag的取值设置为0。
进一步地,在本申请的实施例中,编码器在完成对ISP模式参数的设置之后,便可以将ISP模式参数写入码流中,传输至解码器,从而可以使解码器在解析码流之后获得ISP模式参数。
也就是说,在本申请的实施例中,在编码器侧,会针对当前块进行预测编码,在这过程中就可以确定出当前块的ISP模式参数,并将相应的ISP模式参数写入码流,由编码器传输到解码器。
进一步地,编码器在确定当前块的ISP模式参数之后,如果ISP模式参数指示当前块使用ISP模式确定当前块的帧内预测值,那么解码器可以继续对当前块的子分区进行确定。
可以理解的是,在本申请的实施例中,编码器在确定当前块的子分区时,可以根据split flag确定当前块的大小和位置,也就是说,从代码的角度来说,将指针变量指向缓冲区中正确的起始位置、确定写入存储空间时的宽度和高度。
需要说明的是,在本申请的实施例中,视频图像可以划分为多个图像块,每个当前待编码的图像块可以称为编码块(Coding Block,CB)。这里,每个编码块可以包括第一图像分量、第二图像分量和第三图像分量。具体地,在本申请中,假定进行第一图像分量预测,而且第一图像分量为亮度分量,即待预测图像分量为亮度分量,那么可以将待预测的编码块称为亮度块;或者,假定进行第二图像分量预测,而且第二图像分量为色度分量,即待预测图像分量为色度分量,那么可以将待预测的编码块称为色度块。
可以理解的是,在本申请的实施例中,由于ISP技术主要针对亮度编码块,因此,当前块为视频图像中当前待 进行亮度分量预测的编码块,即当前块为亮度块。
需要说明的是,在本申请的实施例中,在应用ISP技术时,限制编码块的最小尺寸为8x4和4x8,最大尺寸为64x64,且使用多参考行模式时禁用ISP。因此,在本申请中,编码器可以先确定当前块的尺寸参数,然后根据尺寸参数确定当前块是否使用ISP模式。
也就是说,在本申请中,只有在当前块为亮度块,且当前块的尺寸参数满足大小要求的条件下,当前块才可以使用ISP模式。
步骤103、确定子分区的残差值。
在本申请的实施例中,编码器在确定当前块的子分区之后,可以对子分区的残差值进行确定。
进一步地,在本申请的实施例中,编码器在对确定当前块的子分区之后,可以对子分区进行帧内预测,获得每一个子分区的帧内预测值;其中,一个子分区对应一个帧内预测值。
需要说明的是,在本申请的实施例中,编码器在对子分区进行帧内预测时,可以使用的帧内预测模式包括直流(Direct Current,DC)模式、平面(PLANAR)模式以及角度模式等。
可以理解的是,在本申请的实施例中,编码器在对子分区进行帧内预测之前,可以先确定预测模式参数,然后可以通过预测模式参数来确定当前块的子分区的编码模式是具体哪一种编码模式。
在本申请的实施例中,进一步地,编码器在确定当前块的子分区的预测模式参数时,可以先确定当前块的子分区的待预测图像分量;然后基于当前块的子分区的参数,利用多种预测模式分别对待预测图像分量进行预测编码,计算多种预测模式下每一种预测模式对应的率失真代价结果;最后便可以从计算得到的多个率失真代价结果中选取最小率失真代价结果,并将最小率失真代价结果对应的预测模式确定为当前块的预测模式参数。
也就是说,在编码器侧,针对当前块的子分区可以采用多种预测模式分别对待预测图像分量进行编码。
进一步地,在本申请的实施例中,编码器在利用多种预测模式分别对当前块进行编码之后,可以得到每一种预测模式对应的率失真代价结果;然后从所得到的多个率失真代价结果中选取最小率失真代价结果,并将该最小率失真代价结果对应的预测模式确定为当前块的子分区的预测模式参数;如此,最终可以使用所确定的预测模式对当前块的子分区进行编码,而且在这种预测模式下,可以使得预测残差小,能够提高编码效率。
需要说明的是,在本申请的实施例中,当前块的多个子分区共享同一种帧内预测模式。也就是说,编码器可以通过PLANAR、DC或者角度预测模式中的一种帧内预测模式对当前块的多个子分区进行帧内预测。
进一步地,在本申请的实施例中,编码器在确定子分区的帧内预测值之后,便可以对子分区的真实值和帧内预测值进行差值运算,获得两者之间的差值结果,从而可以确定出子分区的预测差值,即残差值。
也就是说,在本申请中,编码器计算残差值时,可以计算子分区的真实值与帧内预测值之间的差值,从而获得残差值。
需要说明的是,在本申请的实施例中,ISP技术对子分区进行预测时的尺寸进行了限制,要求子分区进行预测时的最小预测宽度为4,因此,对于当前块来说,子分区进行预测时的尺寸和进行变换时的尺寸不一定相同。
具体地,由于ISP技术仅对子分区预测时的宽度进行限制,且在应用ISP技术时限制编码块的最小尺寸为8x4和4x8,因此,对于当前块水平划分获得的子分区,预测尺寸和变换尺寸均是相同的,而对于垂直划分的子分区,会存在预测尺寸和变换尺寸不同的情况。
表6为ISP分区预测尺寸限制表二,如表6所示,在进行垂直划分之后,尺寸为4x8的当前块划分后的2个子分区的变换尺寸为2x8,而子分区用于预测的尺寸为4x8;尺寸为8x4的当前块划分后的2个子分区的变换尺寸和预测尺寸均为4x4;尺寸为4xN(N>8)的当前块划分后的4个子分区的变换尺寸为1xN,而子分区用于预测的尺寸为4xN;尺寸为Nx4(N>8)的当前块划分后的4个子分区的变换尺寸和预测尺寸均为(N/4)x4;尺寸为8xN(N>4)的当前块划分后的4个子分区的变换尺寸为2xN,而子分区用于预测的尺寸为4xN;尺寸为Nx8(N>8)的当前块划分后的4个子分区的变换尺寸和预测尺寸均为(N/4)x8。
表6
当前块(WxH) 子分区的预测尺寸 子分区的变换尺寸
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
步骤104、当子分区使用一次变换时,确定子分区使用的一次变换核。
在本申请的实施例中,当子分区使用一次变换时,编码器可以先确定出子分区进行一次变换时的一次变换核,即确定出一次变换所使用的变换类型。
可以理解的是,在本申请的实施例中,如果子分区使用一次变换,那么编码器可以先对一次变换时的变换类型进行确定,即确定出子分区使用的一次变换核。
具体地,在数学上共有8种类型的DCT变换,而在HEVC变换编码中只使用了DCT-2变换。进一步地,在VVC中提出了MTS技术,因此可以使用更多类型的变换。其中,对于一次变换,可选的变换核包括DCT-2、DCT-8以及DST-7。
可以理解的是,在本申请的实施例中,DCT-2变换核指的是基于DCT-2设计的整数变换的变换核或变换矩阵。类似的,DST-7变换核指的是基于DST-7设计的整数变换的变换核或变换矩阵;DCT-8变换核指的是基于DCT-8设计的整数变换的变换核或变换矩阵。
图13为变换方法的实现流程示意图二,如图13所示,编码器确定子分区使用的一次变换核的方法可以包括以下步骤:
步骤104a、将DCT-2确定为一次变换核。
在本申请的实施例中,编码器在对子分区使用一次变换时的变换类型进行确定时,可以直接将DCT-2确定为一次变换核。
也就是说,在本申请中,无论子分区是否使用LFNST,子分区使用的一次变换核均为DCT-2。
步骤104b、当子分区不使用LFNST时,将预设变换核确定为一次变换核;当子分区使用LFNST时,将DCT-2确定为一次变换核。
在本申请的实施例中,编码器在对子分区使用一次变换时的变换类型进行确定时,如果子分区不使用LFNST,那么编码器可以将预设变换核确定为一次变换核;如果子分区使用LFNST,那么编码器可以将DCT-2确定为一次变换核。其中,预设变换核为DCT-2、DST-7或DCT-8中的任意一个。
也就是说,在本申请中,子分区使用LFNST时的一次变换核和子分区不使用LFNST的一次变换核可以不相同。具体地,在子分区使用LFNST时,编码器可以将子分区的一次变换核确定为DCT-2;在子分区不使用LFNST时,编码器可以将DCT-2、DST-7或DCT-8中的任意一个确定为子分区的一次变换核。
步骤104c、当子分区不使用LFNST时,将DCT-2确定为一次变换核;当子分区使用LFNST时,将预设变换核确定为一次变换核。
在本申请的实施例中,编码器在对子分区使用一次变换时的变换类型进行确定时,如果子分区使用LFNST,那么编码器可以将预设变换核确定为一次变换核;如果子分区不使用LFNST,那么编码器可以将DCT-2确定为一次变换核。其中,预设变换核为DCT-2、DST-7或DCT-8中的任意一个。
也就是说,在本申请中,子分区使用LFNST时的一次变换核和子分区不使用LFNST的一次变换核可以不相同。具体地,在子分区不使用LFNST时,编码器可以将子分区的一次变换核确定为DCT-2;在子分区使用LFNST时,编码器可以将DCT-2、DST-7或DCT-8中的任意一个确定为子分区的一次变换核。
步骤104d、将目标变换核确定为一次变换核;相应地,在码流中以一个语法单元指示目标变换核。
在本申请的实施例中,编码器在对子分区使用一次变换时的变换类型进行确定时,可以直接将目标变换核确定为一次变换核。其中,目标变换核为DCT-2、DST-7或DCT-8中的任意一个。
也就是说,在本申请中,无论子分区是否使用LFNST,子分区使用的一次变换核均为目标变换核。即对于子分区使用LFNST和不使用LFNST这两种不同情况,编码器可以设置相同的一次变换核。
进一步地,在本申请的实施例中,编码器在将目标变换核确定为一次变换核以后,需要在在码流中以一个语法单元syntax element指示一次变换的变换类型,即利用语法单元对目标变换核进行指示。
需要说明的是,在本申请的实施例中,在码流中,指示目标变换核的语法单元包含在以下码流中的一个或多个数据单元中:包含当前块的数据单元,分片头信息数据单元,图像头信息数据单元,图像层参数集,序列层参数集。
步骤104e、当子分区不使用LFNST时,将第一变换核确定为一次变换核;当子分区使用LFNST时,将第二变换核确定为一次变换核;相应地,在码流中以两个语法单元分别指示第一变换核和第二变换核。
在本申请的实施例中,编码器在对子分区使用一次变换时的变换类型进行确定时,如果子分区不使用LFNST,那么编码器可以将第一变换核确定为一次变换核;如果子分区使用LFNST,那么编码器可以将第二变换核确定为一次变换核。其中,第一变换核和第二变换核为DCT-2、DST-7或DCT-8中的任意两个。
也就是说,在本申请中,对于子分区使用LFNST和不使用LFNST这两种情况,编码器可以设置不同的一次变换核,以使子分区子不使用LFNST时,使用第一变换核进行一次变换,在使用LFNST时,使用第二变换核进行一次变换。
进一步地,在本申请的实施例中,对于子分区使用LFNST和不使用LFNST这两种情况,编码器在将第一变换核或第二变换核确定为一次变换核以后,需要在在码流中以两个语法单元syntax element分别指示一次变换的变换类型,即利用一个语法单元对第一变换核进行指示,同时,利用另一个语法单元对第二变换核进行指示。
需要说明的是,在本申请的实施例中,在码流中,指示第一变换核和第二变换核的语法单元包含在以下码流中的一个或多个数据单元中:包含当前块的数据单元,分片头信息数据单元,图像头信息数据单元,图像层参数集,序列层参数集。
由此可见,在本申请的实施例中,编码器在确定子分区进行一次变换时使用的一次变换核时,无论子分区是否使用LFNST,编码器均可以通过多种方式进行一次变换核的确定。
可以理解的是,在本申请的实施例中,无论子分区是否使用LFNST,编码器都可以直接将DCT-2确定为子分区进行一次变化时所使用的一次变换核。也就是说,对于当前块的任意一个子分区,在该子分区不使用LFNST或使用LFNST时,该子分区一次变换时所使用的一次变换核均为DCT-2。
可见,在本申请中,编码器既不需要再根据子分区的的尺寸进行一次变换核的选择,也不需要根据子分区是否使用LFNST对一次变换核进行区分,而是可以直接将一次变换核设置为DCT-2。
示例性的,在本申请中,当lfnst_idx==0时,直接使用DCT-2;当lfnst_idx==1or2时,直接使用DCT-2。
可以理解的是,在本申请的实施例中,如果子分区不使用LFNST,那么编码器可以直接将预设变换核确定为子分区进行一次变化时所使用的一次变换核;如果子分区使用LFNST,那么编码器可以将DCT-2确定为子分区进行一次变化时所使用的一次变换核。
需要说明的是,在本申请的实施例中,预设变换核为编码器预先设置的一个固定类型,具体地,预设变换核可以为DCT-2、DST-7或DCT-8中的任意一个。
可见,在本申请中,在当前块的子分区不使用LFNST的情况下,编码器不需要再根据子分区的的尺寸进行一次 变换核的选择,而是可以直接将一次变换核设置为预设变换核,同时,在子分区使用LFNST的情况下,将DCT-2设置为确定一次变换核。
示例性的,在本申请中,当lfnst_idx==0时,直接使用DST-7;当lfnst_idx==1or2时,直接使用DCT-2。
可以理解的是,在本申请的实施例中,如果子分区使用LFNST,那么编码器可以直接将预设变换核确定为子分区进行一次变化时所使用的一次变换核;如果子分区不使用LFNST,那么编码器可以将DCT-2确定为子分区进行一次变化时所使用的一次变换核。
需要说明的是,在本申请的实施例中,预设变换核为编码器预先设置的一个固定类型,具体地,预设变换核可以为DCT-2、DST-7或DCT-8中的任意一个。
可见,在本申请中,在当前块的子分区不使用LFNST的情况下,编码器不需要再根据子分区的的尺寸进行一次变换核的选择,而是可以直接将DCT-2设置为确定一次变换核,同时,在子分区使用LFNST的情况下,将一次变换核设置为预设变换核。
示例性的,在本申请中,当lfnst_idx==0时,直接使用DCT-2;当lfnst_idx==1or2时,直接使用DST-7。
可以理解的是,在本申请的实施例中,无论子分区是否使用LFNST,编码器都可以直接在码流中以一个语法单元syntax element指示子分区进行一次变化时所使用的一次变换核。也就是说,对于当前块的任意一个子分区,在该子分区不使用LFNST或使用LFNST时,该子分区一次变换时所使用的一次变换核均为一个相同的目标变换核。其中,目标变换核可以为DCT-2、DST-7或DCT-8中的任意一个。
可见,在本申请中,编码器既不需要再根据子分区的的尺寸进行一次变换核的选择,也不需要根据子分区是否使用LFNST对一次变换核进行区分,而是可以直接将一次变换核通过码流中的语法单元进行指示。
示例性的,在本申请中,当lfnst_idx==0时,使用syntax element指示的目标变换核;当lfnst_idx==1or2时,使用syntax element指示的目标变换核。
可以理解的是,在本申请的实施例中,如果子分区使用LFNST,那么编码器可以在码流中以一个语法单元syntax element指示子分区进行一次变化时所使用的一次变换核;如果子分区不使用LFNST,那么编码器可以在码流中以另一个语法单元syntax element指示子分区进行一次变化时所使用的一次变换核。
具体地,对于子分区使用LFNST和不使用LFNST这两种不同的情况,编码器可以在码流中以两个不同的语法单元分别对第一目标核和第二目标核进行指示。
需要说明的是,在本申请的实施例中,第一目标核和第二目标核可以为DCT-2、DST-7或DCT-8中的任意两个。
可见,在本申请中,在当前块的子分区不使用LFNST的情况下,编码器不需要再根据子分区的的尺寸进行一次变换核的选择,而是可以直接将第一变换核通过码流中的一个语法单元进行指示,同时,在子分区使用LFNST的情况下,可以将第二变换核通过码流中的另一个语法单元进行指示。
示例性的,在本申请中,当lfnst_idx==0时,使用语法单元s0指示的第一变换核;当lfnst_idx==1or2时,使用语法单元s1指示的第二变换核。
需要说明的是,在本申请的实施例中,编码器在码流中signal syntax element的方式可以包括:块层、slice层、图像头、参数集(序列层参数集、图像层参数集,APS等),以及不同数据单元中signal的参数之间的override关系,例如块层可以override slice层等,参数集之间的override等。
进一步地,在本申请的实施例中,从编码器的角度,即编码侧,一次变换核是可以自适应选择的,然后将该一次变换核在块层的一个或者多个数据单元中使用相应的语法单元syntax element进行指示并写入码流;从解码器的角度,即解码侧,解析码流中块层的一个或多个数据单元的语法单元syntax element,从而可以确定所使用的一次变换核。
可见,在本申请中,在当前块的子分区不使用LFNST的情况下,编码器不需要再根据子分区的的尺寸进行一次变换核的选择,而是可以直接针对子分区进行一次变换核的适应性设置。
进一步地,在本申请的实施例中,编码器可以通过变量isp_trType的取值的来确定一次变换核。
需要说明的是,在本申请的实施例中,变量isp_trType的取值可以为0、1、2,其中,如果变量isp_trType的取值为0,则代表采用DCT-2作为一次变换核;如果变量isp_trType的取值为1,则代表采用DST-7作为一次变换核;如果变量isp_trType的取值为2,则代表采用DCT-8作为一次变换核。
由此可见,本申请实施例提出的变换方法,对于ISP分区的变换,在当前块划分后的子分区不使用二次变换,仅使用一次变换时,子分区使用一次变换的变换类型,即一次变换核,不再由子分区的尺寸决定,即不再根据子分区的高度和宽度对一次变换核进行选择,而是直接对一次变换核进行设置。
在本申请的实施例中,进一步地,图14为变换核确定流程的示意图,如图14所示,在VVC中,如果lfnst_idx的值为0,即子分区不使用二次变换LFNST,那么在使用一次变换时,编码器可以直接对子分区一次变换的一次变换核进行确定;如果lfnst_idx的值为1或2,即子分区使用二次变换LFNST,那么子分区一次变换的变换核为DCT-2。
需要说明的是,在本申请的实施例中,并不是任何一个当前块的子分区都可以使用LFNST变换的。具体地,只有子分区同时满足一定的预设条件时,才可以对子分区进行LFNST变换。其中,该预设条件可以包括:(a)子分区的宽度和高度均大于或等于4;(b)子分区的宽度和高度均小于或等于变换块的最大尺寸;(c)子分区或当前所在编码块的预测模式为帧内预测模式;(d)子分区的一次变换在水平方向和垂直方向上均为二维正向一次变换(DCT-2),即一次变换核为DCT-2;(e)当子分区或当前块所在编码块的帧内预测模式为非MIP模式或者子分区的预测模式为MIP模式且变换块的宽度和高度均大于或等于16。也就是说,针对本申请实施例中的子分区,需要同时满足上述的五个条件,才能确定子分区使用LFNST变换技术。
可见,与现有技术相比,本申请提出的变换方法,可以简化ISP划分的子分区在lfnstIdx取值等于0情况下确定一次变换核的方法。具体地,在本申请中,如果子分区不使用LFNST,编码器不再根据子分区的尺寸对子分区使用 的一次变换核进行确定,而是直接设定一次变换核,从而省去了通过子分区的尺寸选择子分区一次变换核的处理流程。
步骤105、使用一次变换核,对残差值进行变换处理。
在本申请的实施例中,当子分区使用一次变换时,编码器在确定子分区使用的一次变换核之后,便可以使用一次变换核,对子分区的残差值进行一次变换处理。
需要说明的是,在本申请的实施例中,编码器所确定的一次变换核,可以表征子分区进行一次变换的变换类型,其中,可以包括子分区进行一次变换时的水平变换类型和垂直变换类型。具体地,子分区进行一次变换的水平变换类型和垂直变换类型是相同的,即编码器采用相同的一次变换核分别对子分区进行水平变换和垂直变换。
进一步地,在本申请的实施例中,编码器在使用一次变换核对子分区的残差值进行一次变换处理之后,可以输出一次变换后的变换系数矩阵。
图15为变换方法的实现流程示意图三,如图15所示,编码器进行变换处理的方法还可以包括以下步骤:
步骤106、当子分区不使用LFNST时,将LFNST索引序号的取值设置为指示子分区不使用LFNST。
步骤107、当子分区使用LFNST时,确定子分区使用的LFNST变换核,将LFNST索引序号的取值设置为指示子分区使用LFNST,并将LFNST索引序号写入码流中。
步骤108、将LFNST索引序号写入码流中。
也就是说,在本申请的实施例中,如果当前块的子分区不使用LFNST,即子分区不进行二次变换,那么编码器可以将LFNST索引序号的取值设置为指示子分区不使用LFNST,然后将LFNST索引序号写入码流中。另一方面,在本申请中,如果当前块的子分区使用LFNST,即子分区进行二次变换,那么编码器可以将LFNST索引序号的取值设置为指示子分区使用LFNST,然后将LFNST索引序号写入码流中。
需要说明的是,在本申请的实施例中,LFNST索引序号可以指示子分区是否使用二次变换LFNST,同时,还可以对使用二次变换时的类型进行指示,即指示子分区的LFNST变换核。
可以理解的是,在本申请的实施例中,可以将LFNST索引序号理解为一个表明是否使用LFNST的标志位。具体地,编码器可以将变量lfnst_idx作为LFNST索引序号,从而可以通过对变量lfnst_idx取值的设置来实现LFNST索引序号的设置。
示例性的,在本申请中,如果子分区使用LFNST,那么编码器可以将LFNST索引序号的取值设置为指示子分区使用LFNST,具体地,编码器可以将变量lfnst_idx的取值设置为1或2。
示例性的,在本申请中,如果子分区不使用LFNST,那么编码器可以将LFNST索引序号的取值设置为指示子分区不使用LFNST,具体地,编码器可以将变量lfnst_idx的取值设置为0。
也就是说,在本申请的实施例中,针对LFNST索引序号(即lfnst_idx)的取值,当LFNST索引序号的取值等于0时,指示子分区将不使用LFNST;而当LFNST索引序号的取值大于0时,指示子分区将使用LFNST。
需要说明的是,在本申请的实施例中,编码器在进行LFNST变换核的确定时,可以先确定出LFNST变换核候选集,然后从LFNST变换核候选集中来确定子分区使用的LFNST变换核,然后可以设置LFNST索引序号并写入码流中。这里,LFNST的变换矩阵是通过训练得到的多个固定系数矩阵,LFNST变换核候选集包括有2组变换矩阵(也可以称之为LFNST变换核),当确定出LFNST变换核候选集之后,需要从LFNST变换核候选集中选取一组LFNST变换核,即确定子分区LFNST时所使用的变换矩阵。
进一步地,在本申请的实施例中,由于LFNST变换核候选集中包括有预设的两个或多个变换核,这时候可以使用率失真优化的方式选择子分区使用的变换核。具体地,可以针对每一种变换核分别使用率失真优化的方式计算率失真代价(Rate Distortion Cost,RDCost),然后选取率失真代价最小的变换核作为子分区使用的变换核。
也就是说,在编码器侧,可以通过RDCost选择出一组LFNST变换核,并将LFNST索引序号(可以用lfnst_idx表示)写入码流中,传输到解码器侧。其中,当选择LFNST变换核候选集中的第一组LFNST变换核(即第一组变换矩阵)时,将lfnst_idx设置为1;当选择LFNST变换核候选集中的第二组LFNST变换核(即第二组变换矩阵)时,将lfnst_idx设置为2。
进一步地,在本申请的实施例中,编码器在完成对LFNST索引序号的设置之后,便可以将LFNST索引序号写入码流中,以供解码端解析。
在本申请的实施例中,进一步地,如果当前块的子分区使用LFNST,那么在使用一次变换核,对残差值进行变换处理之后,编码器还可以确定子分区使用的LFNST变换核,同时,可以将LFNST索引序号的取值设置为指示子分区使用LFNST,然后将LFNST索引序号写入码流中。
需要说明的是,在本申请的实施例中,编码器在确定出子分区使用的LFNST变换核之后,便可以使用LFNST变换核,对子分区一次变换后的变换系数矩阵进行二次变换处理,得到LFNST变换系数矩阵,最后针对LFNST变换系数矩阵进行量化处理,将最终的量化值写入视频码流中。
图16为变换方法的实现流程示意图四,如图16所示,在确定子分区的残差值之前,即步骤103之前,编码器进行变换处理的方法还可以包括以下步骤:
步骤109、确定当前块的尺寸参数,并根据尺寸参数判断当前块是否使用ISP模式。
在本申请的实施例中,编码器可以先确定出当前块的尺寸参数,然后根据当前块的尺寸参数判断当前块是否使用ISP模式。
可以理解的是,在本申请的实施例中,当前块的尺寸参数可以包括当前块的高度值和宽度值。
需要说明的是,在本申请中,由于在VVC中,亮度分量所支持的最大变换尺寸为64×64,色度分量所支持的最大变换尺寸为32×32。如果一个CB的尺寸超过限制,那么该CB会自动进行水平或(和)垂直划分以满足对应方向上变换尺寸的要求。
示例性地,在本申请中,编码器在确定出当前块的尺寸参数之后,即确定出当前块的高度值和宽度值之后,如果当前块的尺寸参数为4x4,即当前块的高度值和宽度值均等于4,那么可以判定当前块不使用ISP模式。
也就是说,在本申请中,对于尺寸参数为4x4以外的亮度块,编码器可以判定该亮度块使用ISP模式。
步骤1010、当判定当前块使用ISP模式时,确定当前块的子分区。
在本申请的实施例中,编码器在确定当前块的尺寸参数,并根据尺寸参数判断当前块是否使用ISP模式之后,如果判定当前块使用ISP模式,那么编码器可以先确定当前块的子分区,同时,编码器可以将ISP模式参数的取值设置为指示当前块使用ISP模式,然后将ISP模式参数写入码流中。
进一步地,在本申请的实施例中,编码器在确定当前块使用ISP模式之后,便可以将当前块划分为多个子分区。具体地,在本申请中,根据当前块的尺寸参数,编码器可以将当前块划分为尺寸相同的2个子分区或4个子分区。
示例性的,在本申请中,如果当前块的尺寸参数为8x4,那么编码器可以将当前块划分为尺寸相同的2个子分区。
示例性的,在本申请中,如果当前块的尺寸参数为4x8,那么编码器可以将当前块划分为尺寸相同的2个子分区。
示例性的,在本申请中,如果当前块的尺寸参数为Nx4(N>8),那么编码器可以将当前块划分为尺寸相同的4个子分区。
示例性的,在本申请中,如果当前块的尺寸参数为4xN(N>8),那么编码器可以将当前块划分为尺寸相同的4个子分区。
可以理解的是,在本申请的实施例中,编码器在对当前块进行划分时,既可以是水平划分,也可以是垂直划分。也就是说,编码器可以将当前块水平划分为尺寸相同的多个子分区,也可以将当前块垂直划分为尺寸相同的多个子分区。
在本申请的实施例中,进一步地,编码器在确定当前块的子分区时,可以先确定当前块的划分类型,然后可以基于当前块的尺寸参数和划分类型获得子分区。
需要说明的是,在本申请的实施例中,划分类型可以包括水平划分和垂直划分。具体地,编码器在基于当前块的尺寸参数和划分类型获得子分区时,可以按照当前块的高度值和宽度值对当前块进行水平划分或垂直划分,从而可以获得当前块的多个子分区。
示例性的,在本申请中,当当前块的尺寸参数为4x8,即宽度值等于4且高度值等于8,编码器在对当前块进行水平划分后,获得2个子分区,其中,每个子分区的尺寸参数为1x8。
示例性的,在本申请中,当当前块的尺寸参数为4x16,即宽度值等于4且高度值等于16,编码器在对当前块进行垂直划分后,获得4个子分区,其中,每个子分区的尺寸参数为4x4。
进一步地,在本申请的实施例中,编码器在判定当前块使用ISP模式之后,还可以将ISP模式参数的取值设置为指示当前块使用ISP模式,然后将ISP模式参数写入至视频码流中。
图17为变换方法的实现流程示意图五,如图17所示,编码器在确定当前块的尺寸参数,并根据尺寸参数判断当前块是否使用ISP模式之后,即步骤109之后,编码器进行变换处理的方法还可以包括以下步骤:
步骤1011、当判定当前块不使用ISP模式时,将ISP模式参数的取值设置为指示当前块不使用ISP模式,并将ISP模式参数写入码流中。
在本申请的实施例中,编码器在确定当前块的尺寸参数,并根据尺寸参数判断当前块是否使用ISP模式之后,如果判定当前块不使用ISP模式,那么编码器可以将ISP模式参数的取值设置为指示当前块不使用ISP模式,然后将ISP模式参数写入码流中。
可以理解的是,在本申请的实施例中,编码器在确定当前块的尺寸参数,并根据尺寸参数判断当前块是否使用ISP模式之后,如果判定当前块不使用ISP模式,那么编码器可以将ISP模式参数的取值设置为指示当前块不使用ISP模式,然后将ISP模式参数写入至视频码流中。
需要说明的是,在本申请的实施例中,ISP模式参数可以指示当前块是否可以使用帧内子分区编码模式,即指示当前块是否可以使用ISP模式。
可以理解的是,在本申请的实施例中,可以将ISP模式参数理解为一个表明是否使用了ISP模式标志位。具体地,编码器可以将变量intra_subpartitions_mode_flag作为ISP模式参数,从而可以通过对变量intra_subpartitions_mode_flag取值的设置来实现ISP模式参数的设置。
示例性的,在本申请中,如果当前块使用ISP模式,那么编码器可以将ISP模式参数的取值设置为指示当前块使用ISP模式,具体地,编码器可以将变量intra_subpartitions_mode_flag的取值设置为1。
示例性的,在本申请中,如果当前块不使用ISP模式,那么编码器可以将ISP模式参数的取值设置为指示当前块不使用ISP模式,具体地,编码器可以将变量intra_subpartitions_mode_flag的取值设置为0。
进一步地,在本申请的实施例中,编码器在完成对ISP模式参数的设置之后,便可以将ISP模式参数写入码流中,以供解码端解析。
本申请提出了一种变换方法,应用于编码器中,编码器确定当前块的ISP模式参数;当ISP模式参数指示当前块使用ISP模式确定当前块的帧内预测值时,确定当前块的子分区;确定子分区的残差值;当子分区使用一次变换时,确定子分区使用的一次变换核;使用一次变换核,对残差值进行变换处理。由此可见,在本申请的实施例中,对于ISP分区的变换,在当前块划分后的子分区不使用二次变换,仅使用一次变换时,子分区使用一次变换的一次变换核,不再由子分区的尺寸决定,即不再根据子分区的高度和宽度对一次变换核进行选择,而是直接对一次变换核进行设置。从而可以简化变换核的选择过程,降低了变换过程的复杂程度,有效地提高了编解码效率。
本申请的另一实施例提出了一种变换方法,应用于解码器,图18为变换方法的实现流程示意图六,如图18所示,解码器进行变换处理的方法可以包括以下步骤:
步骤201、解析码流,确定当前块的ISP模式参数。
在本申请的实施中,解码器可以在接收到视频的码流之后,先解析码流,从而确定当前块对应的ISP模式参数。
需要说明的是,在本申请的实施中,ISP模式参数可以指示当前块是否可以使用帧内子分区编码模式,即指示当前块是否可以使用ISP模式。
可以理解的是,在本申请的实施例中,可以将ISP模式参数理解为一个表明是否使用了ISP模式标志位。具体地,解码器可以将变量intra_subpartitions_mode_flag作为ISP模式参数,从而可以通过对变量intra_subpartitions_mode_flag取值的设置来实现ISP模式参数的设置。
示例性的,在本申请中,如果当前块使用ISP模式,那么ISP模式参数的取值设置为指示当前块使用ISP模式,具体地,可以将变量intra_subpartitions_mode_flag的取值设置为1。
示例性的,在本申请中,如果当前块不使用ISP模式,那么ISP模式参数的取值设置为指示当前块不使用ISP模式,具体地,可以将变量intra_subpartitions_mode_flag的取值设置为0。
进一步地,在本申请的实施例中,在完成对ISP模式参数的设置之后,便可以将ISP模式参数写入码流中,传输至解码器,从而可以使解码器在解析码流之后获得ISP模式参数。
也就是说,在本申请的实施例中,在编码器侧,会针对当前块进行预测编码,在这过程中就可以确定出当前块的ISP模式参数,并将相应的ISP模式参数写入码流,由编码器传输到解码器。
步骤202、当ISP模式参数指示当前块使用ISP模式确定当前块的帧内预测值时,确定当前块的子分区。
在本申请的实施例中,解码器在解析码流,确定当前块的ISP模式参数之后,如果ISP模式参数指示当前块使用ISP模式确定当前块的帧内预测值,那么解码器可以继续对当前块的子分区进行确定。
可以理解的是,在本申请的实施例中,解码器在确定当前块的子分区时,可以根据split flag确定当前块的大小和位置,也就是说,从代码的角度来说,将指针变量指向缓冲区中正确的起始位置、确定写入存储空间时的宽度和高度。
可以理解的是,在本申请的实施例中,由于ISP技术主要针对亮度解码块,因此,如果ISP模式参数指示当前块使用ISP模式确定当前块的帧内预测值,那么当前块为视频图像中当前待进行亮度分量预测的解码块,即当前块为亮度块。
需要说明的是,在本申请的实施例中,在应用ISP技术时,限制解码块的最小尺寸为8x4和4x8,最大尺寸为64x64,且使用多参考行模式时禁用ISP。因此,在本申请中,如果ISP模式参数指示当前块使用ISP模式确定当前块的帧内预测值,那么当前块的尺寸参数需要满足ISP模式的要求。
也就是说,在本申请中,只有在当前块为亮度块,且当前块的尺寸参数满足大小要求的条件下,当前块才可以使用ISP模式。
可以理解的是,在本申请的实施例中,当前块的尺寸参数可以包括当前块的高度值和宽度值。
需要说明的是,在本申请的实施例中,解码器在确定ISP模式参数指示当前块使用ISP模式之后,便可以根据当前块的尺寸参数确定当前块的子分区。
进一步地,在本申请的实施例中,解码器在确定当前块使用ISP模式之后,便可以将当前块划分为多个子分区。具体地,在本申请中,根据当前块的尺寸参数,解码器可以将当前块划分为尺寸相同的2个子分区或4个子分区。
示例性的,在本申请中,如果当前块的尺寸参数为8x4,那么解码器可以将当前块划分为尺寸相同的2个子分区。
示例性的,在本申请中,如果当前块的尺寸参数为4x8,那么解码器可以将当前块划分为尺寸相同的2个子分区。
示例性的,在本申请中,如果当前块的尺寸参数为Nx4(N>8),那么解码器可以将当前块划分为尺寸相同的4个子分区。
示例性的,在本申请中,如果当前块的尺寸参数为4xN(N>8),那么解码器可以将当前块划分为尺寸相同的4个子分区。
可以理解的是,在本申请的实施例中,解码器在对当前块进行划分时,既可以是水平划分,也可以是垂直划分。也就是说,解码器可以将当前块水平划分为尺寸相同的多个子分区,也可以将当前块垂直划分为尺寸相同的多个子分区。
在本申请的实施例中,进一步地,解码器在确定当前块的子分区时,可以先确定当前块的划分类型,然后可以基于当前块的尺寸参数和划分类型获得子分区。
需要说明的是,在本申请的实施例中,划分类型可以包括水平划分和垂直划分。具体地,解码器在基于当前块的尺寸参数和划分类型获得子分区时,可以按照当前块的高度值和宽度值对当前块进行水平划分或垂直划分,从而可以获得当前块的多个子分区。
步骤203、解析码流,确定子分区的变换系数矩阵。
在本申请的实施例中,解码器在对码流进行解析之后,还可以获得子分区的变换系数矩阵。
需要说明的是,在本申请的实施例中,子分区的变换系数矩阵即为编码器在对子分区的残差值使用一次变换之后所输出的。相应地,在解码侧,解码器在对子分区使用一次变换时的输入包括该子分区的变换系数矩阵。
进一步地,在本申请的实施例中,在解码器侧,除了变换系数矩阵d[x][y]以外,反向一次变换的输入数据可以包括:当前亮度块位置(xTbY,yTbY),当前块的宽度nTbW,当前块的高度nTbH,当前块色度分量cIdx,以及当前解码单元的预测模式predMode。其中,x=0,1,…,nTbW-1,y=0,1,…,nTbH-1。
相应地,在本申请中,反向一次变换的输出数据可以包括:通过反向一次变换获得的残差系数res[x][y],其中,x=0,1,…,nTbW-1,y=0,1,…,nTbH-1。
进一步地,在本申请的实施例中,解码器在解析视频的码流之后,还可以获得子分区的变换类型参数。
可以理解的是,在本申请的实施例中,变换类型参数可以指示子分区进行一次变换时所使用的一次变换核,即对子分区进行一次变换的变换类型进行指示。
进一步地,在本申请的实施例中,可以将变换类型参数理解为一个表明变换类型的标志位。具体地,解码器可以通过对变量isp_trType的取值确定一次变换核。
需要说明的是,在本申请的实施例中,变量isp_trType的取值可以为0、1、2,其中,如果变量isp_trType的取值为0,则代表采用DCT-2作为一次变换核;如果变量isp_trType的取值为1,则代表采用DST-7作为一次变换核;如果变量isp_trType的取值为2,则代表采用DCT-8作为一次变换核。
可以理解的是,在本申请的实施例中,如果子分区使用一次变换,那么解码器解析码流后便可以获得子分区使用一次变换时的变换类型,从而可以确定出子分区使用的一次变换核。
步骤204、当子分区使用一次变换时,确定子分区使用的一次变换核。
在本申请的实施例中,当子分区使用一次变换时,解码器可以确定子分区使用的一次变换核。
可以理解的是,在本申请的实施例中,如果子分区使用一次变换,那么解码器可以先对一次变换时的变换类型进行确定,即确定出子分区使用的一次变换核。
具体地,在数学上共有8种类型的DCT变换,而在HEVC变换编码中只使用了DCT-2变换。进一步地,在VVC中提出了MTS技术,因此可以使用更多类型的变换。其中,对于一次变换,可选的变换核包括DCT-2、DCT-8以及DST-7。
可以理解的是,在本申请的实施例中,DCT-2变换核指的是基于DCT-2设计的整数变换的变换核或变换矩阵。类似的,DST-7变换核指的是基于DST-7设计的整数变换的变换核或变换矩阵;DCT-8变换核指的是基于DCT-8设计的整数变换的变换核或变换矩阵。
在本申请的实施例中,进一步地,图19为变换方法的实现流程示意图七,如图19所示,当ISP模式参数指示当前块使用ISP模式确定当前块的帧内预测值时,确定当前块的子分区之后,即步骤102之后,解码器进行变换处理的方法还可以包括以下步骤:
步骤206、解析码流,确定子分区的LFNST索引序号。
在本申请的实施例中,解码器通过解析码流,还可以获得子分区的LFNST索引序号。
需要说明的是,在本申请的实施例中,LFNST索引序号可以指示子分区是否使用二次变换LFNST,同时,还可以对使用二次变换时的类型进行指示,即指示子分区的LFNST变换核。
可以理解的是,在本申请的实施例中,可以将LFNST索引序号理解为一个表明是否使用LFNST的标志位。具体地,解码器可以将变量lfnst_idx作为LFNST索引序号,从而可以通过对变量lfnst_idx取值的设置来实现LFNST索引序号的设置。
示例性的,在本申请中,如果子分区使用LFNST,那么解码器可以将LFNST索引序号的取值设置为指示子分区使用LFNST,具体地,解码器可以将变量lfnst_idx的取值设置为1或2。
示例性的,在本申请中,如果子分区不使用LFNST,那么解码器可以将LFNST索引序号的取值设置为指示子分区不使用LFNST,具体地,解码器可以将变量lfnst_idx的取值设置为0。
需要说明的是,在本申请的实施例中,解码器在进行LFNST变换核的确定时,可以先确定出LFNST变换核候选集,然后从LFNST变换核候选集中来确定子分区使用的LFNST变换核,然后可以设置LFNST索引序号并写入码流中。这里,LFNST的变换矩阵是通过训练得到的多个固定系数矩阵,LFNST变换核候选集包括有2组变换矩阵(也可以称之为LFNST变换核),当确定出LFNST变换核候选集之后,需要从LFNST变换核候选集中选取一组LFNST变换核,即确定子分区LFNST时所使用的变换矩阵。
进一步地,在本申请的实施例中,由于LFNST变换核候选集中包括有预设的两个或多个变换核,这时候可以使用率失真优化的方式选择子分区使用的变换核。具体地,可以针对每一种变换核分别使用率失真优化的方式计算率失真代价(Rate Distortion Cost,RDCost),然后选取率失真代价最小的变换核作为子分区使用的变换核。
也就是说,在编码器侧,可以通过RDCost选择出一组LFNST变换核,并将LFNST索引序号(可以用lfnst_idx表示)写入码流中,传输到解码器侧。其中,当选择LFNST变换核候选集中的第一组LFNST变换核(即第一组变换矩阵)时,将lfnst_idx设置为1;当选择LFNST变换核候选集中的第二组LFNST变换核(即第二组变换矩阵)时,将lfnst_idx设置为2。
进一步地,在本申请的实施例中,编码器在完成对LFNST索引序号的设置之后,便可以将LFNST索引序号写入码流中,传输至解码器,解码器在解析码流之后,获得LFNST索引序号,并根据LFNST索引序号确定子分区是否使用LFNST,并在子分区使用LFNST时,确定子分区使用的LFNST变换核。
也就是说,在本申请的实施例中,解码器在解析码流之后,针对LFNST索引序号(即lfnst_idx)的取值,当LFNST索引序号的取值等于0时,解码器可以确定LFNST索引序号指示子分区将不使用LFNST;当LFNST索引序号的取值等于1时,解码器可以确定LFNST索引序号指示子分区将使用LFNST,且选择LFNST变换核候选集中的第一组LFNST变换核;当LFNST索引序号的取值等于2时,解码器可以确定LFNST索引序号指示子分区将使用LFNST,且选择LFNST变换核候选集中的第二组LFNST变换核。
进一步地,在本申请的实施例中,解码器确定子分区使用的一次变换核的方法可以包括以下步骤:
步骤204a、将DCT-2确定为一次变换核。
在本申请的实施例中,解码器在对子分区使用一次变换时的变换类型进行确定时,可以直接将DCT-2确定为一次变换核。
也就是说,在本申请中,无论子分区是否使用LFNST,子分区使用的一次变换核均为DCT-2。
步骤204b、当LFNST索引序号指示子分区不使用LFNST时,将预设变换核确定为一次变换核;当LFNST索引序号指示子分区使用LFNST时,将DCT-2确定为一次变换核。
在本申请的实施例中,解码器在对子分区使用一次变换时的变换类型进行确定时,如果LFNST索引序号指示子 分区不使用LFNST,那么解码器可以将预设变换核确定为一次变换核;如果LFNST索引序号指示子分区使用LFNST,那么解码器可以将DCT-2确定为一次变换核。其中,预设变换核为DCT-2、DST-7或DCT-8中的任意一个。
也就是说,在本申请中,子分区使用LFNST时的一次变换核和子分区不使用LFNST的一次变换核可以不相同。具体地,在子分区使用LFNST时,解码器可以将子分区的一次变换核确定为DCT-2;在子分区不使用LFNST时,解码器可以将DCT-2、DST-7或DCT-8中的任意一个确定为子分区的一次变换核。
步骤204c、当LFNST索引序号指示子分区不使用LFNST时,将DCT-2确定为一次变换核;当LFNST索引序号指示子分区使用LFNST时,将预设变换核确定为一次变换核。
在本申请的实施例中,解码器在对子分区使用一次变换时的变换类型进行确定时,如果LFNST索引序号指示子分区使用LFNST,那么解码器可以将预设变换核确定为一次变换核;如果LFNST索引序号指示子分区不使用LFNST,那么解码器可以将DCT-2确定为一次变换核。其中,预设变换核为DCT-2、DST-7或DCT-8中的任意一个。
也就是说,在本申请中,子分区使用LFNST时的一次变换核和子分区不使用LFNST的一次变换核可以不相同。具体地,在子分区不使用LFNST时,解码器可以将子分区的一次变换核确定为DCT-2;在子分区使用LFNST时,解码器可以将DCT-2、DST-7或DCT-8中的任意一个确定为子分区的一次变换核。
步骤204d、若码流中以一个语法单元指示目标变换核,则将目标变换核确定为一次变换核。
在本申请的实施例中,解码器在对子分区使用一次变换时的变换类型进行确定时,如果码流中以一个语法单元指示目标变换核,那么解码器可以将目标变换核确定为一次变换核。其中,目标变换核为DCT-2、DST-7或DCT-8中的任意一个。
也就是说,在本申请中,无论子分区是否使用LFNST,子分区使用的一次变换核均为目标变换核。即对于子分区使用LFNST和不使用LFNST这两种不同情况,解码器可以设置相同的一次变换核。
进一步地,在本申请的实施例中,解码器在将目标变换核确定为一次变换核以后,需要在在码流中以一个语法单元syntax element指示一次变换的变换类型,即利用语法单元对目标变换核进行指示。
需要说明的是,在本申请的实施例中,在编码侧,在码流中,指示目标变换核的语法单元包含在以下码流中的一个或多个数据单元中:包含当前块的数据单元,分片头信息数据单元,图像头信息数据单元,图像层参数集,序列层参数集。
相应地,在解码侧,解码器解析码流中的、包含当前块的数据单元,分片头信息数据单元,图像头信息数据单元,图像层参数集,序列层参数集中的一个或多个数据单元,获得语法单元的取值,以确定目标变换核。
步骤204e、若码流中以两个语法单元分别指示第一变换核和第二变换核,则当LFNST索引序号指示子分区不使用LFNST时,将第一变换核确定为一次变换核;当LFNST索引序号指示子分区使用LFNST时,将第二变换核确定为一次变换核。
在本申请的实施例中,如果码流中以两个语法单元分别指示第一变换核和第二变换核,那么解码器在对子分区使用一次变换时的变换类型进行确定时,如果LFNST索引序号指示子分区不使用LFNST,那么解码器可以将第一变换核确定为一次变换核;如果LFNST索引序号指示子分区使用LFNST,那么解码器可以将第二变换核确定为一次变换核。其中,第一变换核和第二变换核为DCT-2、DST-7或DCT-8中的任意两个。
也就是说,在本申请中,对于子分区使用LFNST和不使用LFNST这两种情况,解码器可以设置不同的一次变换核,以使子分区子不使用LFNST时,使用第一变换核进行一次变换,在使用LFNST时,使用第二变换核进行一次变换。
进一步地,在本申请的实施例中,对于子分区使用LFNST和不使用LFNST这两种情况,编码器在将第一变换核或第二变换核确定为一次变换核以后,需要在在码流中以两个语法单元syntax element分别指示一次变换的变换类型,即利用一个语法单元对第一变换核进行指示,同时,利用另一个语法单元对第二变换核进行指示。
需要说明的是,在本申请的实施例中,在编码侧,在码流中,指示第一变换核和第二变换核的语法单元包含在以下码流中的一个或多个数据单元中:包含当前块的数据单元,分片头信息数据单元,图像头信息数据单元,图像层参数集,序列层参数集。
相应地,在解码侧,解码器解析码流中的、包含当前块的数据单元,分片头信息数据单元,图像头信息数据单元,图像层参数集,序列层参数集中的一个或多个数据单元,获得语法单元的取值,以确定第一变换核和第二变换核。
由此可见,在本申请的实施例中,解码器在确定子分区进行一次变换时使用的一次变换核时,无论子分区是否使用LFNST,解码器均可以通过多种方式进行一次变换核的确定。
可以理解的是,在本申请的实施例中,无论子分区是否使用LFNST,解码器都可以直接将DCT-2确定为子分区进行一次变化时所使用的一次变换核。也就是说,对于当前块的任意一个子分区,在该子分区不使用LFNST或使用LFNST时,该子分区一次变换时所使用的一次变换核均为DCT-2。
可见,在本申请中,解码器既不需要再根据子分区的的尺寸进行一次变换核的选择,也不需要根据子分区是否使用LFNST对一次变换核进行区分,而是可以直接将一次变换核设置为DCT-2。
示例性的,在本申请中,当lfnst_idx==0时,直接使用DCT-2;当lfnst_idx==1or2时,直接使用DCT-2。
可以理解的是,在本申请的实施例中,如果子分区不使用LFNST,那么解码器可以直接将预设变换核确定为子分区进行一次变化时所使用的一次变换核;如果子分区使用LFNST,那么解码器可以将DCT-2确定为子分区进行一次变化时所使用的一次变换核。
需要说明的是,在本申请的实施例中,预设变换核为解码器预先设置的一个固定类型,具体地,预设变换核可以为DCT-2、DST-7或DCT-8中的任意一个。
可见,在本申请中,在当前块的子分区不使用LFNST的情况下,解码器不需要再根据子分区的的尺寸进行一次 变换核的选择,而是可以直接将一次变换核设置为预设变换核,同时,在子分区使用LFNST的情况下,将DCT-2设置为确定一次变换核。
示例性的,在本申请中,当lfnst_idx==0时,直接使用DST-7;当lfnst_idx==1or2时,直接使用DCT-2。
可以理解的是,在本申请的实施例中,如果子分区使用LFNST,那么解码器可以直接将预设变换核确定为子分区进行一次变化时所使用的一次变换核;如果子分区不使用LFNST,那么解码器可以将DCT-2确定为子分区进行一次变化时所使用的一次变换核。
需要说明的是,在本申请的实施例中,预设变换核为解码器预先设置的一个固定类型,具体地,预设变换核可以为DCT-2、DST-7或DCT-8中的任意一个。
可见,在本申请中,在当前块的子分区不使用LFNST的情况下,解码器不需要再根据子分区的的尺寸进行一次变换核的选择,而是可以直接将DCT-2设置为确定一次变换核,同时,在子分区使用LFNST的情况下,将一次变换核设置为预设变换核。
示例性的,在本申请中,当lfnst_idx==0时,直接使用DCT-2;当lfnst_idx==1or2时,直接使用DST-7。
可以理解的是,在本申请的实施例中,无论子分区是否使用LFNST,解码器都可以直接在码流中以一个语法单元syntax element指示子分区进行一次变化时所使用的一次变换核。也就是说,对于当前块的任意一个子分区,在该子分区不使用LFNST或使用LFNST时,该子分区一次变换时所使用的一次变换核均为一个相同的目标变换核。其中,目标变换核可以为DCT-2、DST-7或DCT-8中的任意一个。
可见,在本申请中,解码器既不需要再根据子分区的的尺寸进行一次变换核的选择,也不需要根据子分区是否使用LFNST对一次变换核进行区分,而是可以直接将一次变换核通过码流中的语法单元进行指示。
示例性的,在本申请中,当lfnst_idx==0时,使用syntax element指示的目标变换核;当lfnst_idx==1or2时,使用syntax element指示的目标变换核。
可以理解的是,在本申请的实施例中,如果子分区使用LFNST,那么解码器可以在码流中以一个语法单元syntax element指示子分区进行一次变化时所使用的一次变换核;如果子分区不使用LFNST,那么解码器可以在码流中以另一个语法单元syntax element指示子分区进行一次变化时所使用的一次变换核。
具体地,对于子分区使用LFNST和不使用LFNST这两种不同的情况,解码器可以在码流中以两个不同的语法单元分别对第一目标核和第二目标核进行指示。
需要说明的是,在本申请的实施例中,第一目标核和第二目标核可以为DCT-2、DST-7或DCT-8中的任意两个。
可见,在本申请中,在当前块的子分区不使用LFNST的情况下,解码器不需要再根据子分区的的尺寸进行一次变换核的选择,而是可以直接将第一变换核通过码流中的一个语法单元进行指示,同时,在子分区使用LFNST的情况下,可以将第二变换核通过码流中的另一个语法单元进行指示。
示例性的,在本申请中,当lfnst_idx==0时,使用语法单元s0指示的第一变换核;当lfnst_idx==1or2时,使用语法单元s1指示的第二变换核。
需要说明的是,在本申请的实施例中,解码器在码流中signal syntax element的方式可以包括:块层、slice层、图像头、参数集(序列层参数集、图像层参数集,APS等),以及不同数据单元中signal的参数之间的override关系,例如块层可以override slice层等,参数集之间的override等。
进一步地,在本申请的实施例中,从编码器的角度,即编码侧,一次变换核是可以自适应选择的,然后将该一次变换核在块层的一个或者多个数据单元中使用相应的语法单元syntax element进行指示并写入码流;从解码器的角度,即解码侧,解析码流中块层的一个或多个数据单元的语法单元syntax element,从而可以确定所使用的一次变换核。
可见,在本申请中,在当前块的子分区不使用LFNST的情况下,解码器不需要再根据子分区的的尺寸进行一次变换核的选择,而是可以直接针对子分区进行一次变换核的适应性设置。
进一步地,在本申请的实施例中,解码器可以通过变量isp_trType的取值的来确定一次变换核。
需要说明的是,在本申请的实施例中,变量isp_trType的取值可以为0、1、2,其中,如果变量isp_trType的取值为0,则代表采用DCT-2作为一次变换核;如果变量isp_trType的取值为1,则代表采用DST-7作为一次变换核;如果变量isp_trType的取值为2,则代表采用DCT-8作为一次变换核。
由此可见,本申请实施例提出的变换方法,对于ISP分区的变换,在当前块划分后的子分区不使用二次变换,仅使用一次变换时,子分区使用一次变换的变换类型,即一次变换核,不再由子分区的尺寸决定,即不再根据子分区的高度和宽度对一次变换核进行选择,而是直接对一次变换核进行设置。
可见,与现有技术相比,本申请提出的变换方法,可以简化ISP划分的子分区在lfnstIdx取值等于0情况下确定一次变换核的方法。具体地,在本申请中,如果子分区不使用LFNST,解码器不再根据子分区的尺寸对子分区使用的一次变换核进行确定,而是直接设定一次变换核,从而省去了通过子分区的尺寸选择子分区一次变换核的处理流程。
步骤205、使用一次变换核,对变换系数矩阵进行变换处理。
在本申请的实施例中,解码器在确定子分区使用的一次变换核之后,便可以使用一次变换核,对变换系数矩阵进行变换处理。
可以理解的是,在本申请的实施例中,解码器在使用一次变换核,对变换系数矩阵进行变换处理时,可以利用一次变换核对变换系数矩阵进行反向一次变换,从而可以获得子分区的残差值。
需要说明的是,在本申请的实施例中,解码器所确定的一次变换核,可以表征子分区进行反向一次变换的变换类型,其中,可以包括子分区进行反向一次变换时的水平变换类型和垂直变换类型。具体地,子分区进行反向一次变换的水平变换类型和垂直变换类型是相同的,即解码器采用相同的一次变换核分别对子分区进行水平变换和垂直 变换。
进一步地,在本申请的实施例中,解码器在使用一次变换核对子分区的残差值进行反向一次变换处理之后,可以输出一次变换后的子分区的残差系数。
可以理解的是,在本申请的实施例中,通过上述步骤201至步骤206所提出的变换方法,解码器在进行变换处理时,通过解析码流,可以先配置核心参数,然后再进行变换类型的选择,进而可以基于变换类型进行反向一次变换,以完成一次变换处理。其中,在进行变换类型的选择时,如果子分区不使用LFNST,那么一次变换的变换类型,即一次变换核,不再基于子分区的尺寸进行选择,而是直接对一次变换核进行适用性的确定。
具体地,在本申请中,反向一次变换的输入包括:当前亮度块位置(xTbY,yTbY),当前块的宽度nTbW,当前块的高度nTbH,当前块色度分量cIdx,当前解码单元的预测模式predMode以及经过反向二次变换后扫描得到的反向一次变换系数矩阵d[x][y]。其中,x=0,1,…,nTbW-1,y=0,1,…,nTbH-1。
在配置核心参数时,ISP由变量intra_subpartitions_mode_flag[x0][y0]决定是否使用ISP模式。具体地,如果intra_subpartitions_mode_flag[x0][y0]为1,便可以确定使用ISP模式;如果intra_subpartitions_mode_flag[x0][y0]等于0,便可以确定不使用ISP模式,则表示当前解码单元未进行划分。
具体地,ISP可以根据形状进行水平或者垂直划分,变量IntraSubPartitionsSplitType指定当前亮度解码块的划分类型,其中,变量IntraSubPartitionsSplitType为0时,表征当前解码块未进行划分,即ISP_NO_SPLIT;变量IntraSubPartitionsSplitType为1时,表征对当前解码块进行水平划分,即ISP_HOR_SPLIT;变量IntraSubPartitionsSplitType为2时,表征对当前解码块进行垂直划分,即ISP_VER_SPLIT。
由于ISP根据当前解码块的尺寸可以将当前解码块划分为2个或4个子分区,因此可以利用变量NumIntraSubPartitions指定当前解码块划分的子分区的数量。在推导NumIntraSubPartitions时,具体地,
如果IntraSubPartitionsSplitType等于ISP_NO_SPLIT,则NumIntraSubPartitions设置为等于1;
否则,如果满足以下条件之一,则将NumIntraSubPartitions设置为等于2:
nTbW等于4,nTbH等于8;
nTbW等于8,nTbW等于4。
否则,将NumIntraSubPartitions设置为等于4。
进一步地,隐性选择变量implicitMtsEnabled推导如下:
如果sps_mts_enabled_flag等于1并且下列条件中的一个或者多个成立,则implicitMtsEnabled设置等于1:
cu_sbt_flag等于1且Max(nTbW,nTbH)小于等于32;
sps_explicit_mts_intra_enabled_flag等于0且CuPredMode[0][xTbY][yTbY]等于MODE_INTRA且lfnst_idx[x0][y0]等于0且intra_mip_flag[x0][y0]等于0。
可见,现有技术中,在进行变量implicitMtsEnabled的推导时,如果IntraSubPartitionsSplitType不等于ISP_NO_SPLIT,则可以将变量implicitMtsEnabled的取值设置等于1,而在本申请中,推导变量implicitMtsEnabled的取值时不再需要对变量IntraSubPartitionsSplitType的取值进行参考。
进一步地,变量非零系数块尺寸,即非零宽度系数nonZeroW和非零高度系数nonZeroH推导如上述公式(1)至(4)。
其中,变量ApplyLfnstFlag推导如上述公式(5)和(6)。
进一步地,在选择变换类型时,变量trTypeHor表示水平变换类型,变量trTypeVer表示垂直变换类型,trTypeHor和trTypeVer的推导如下:
以下任意条件满足则trTypeHor和trTypeVer都设置为0:
cIdx大于0;
IntraSubPartitionsSplitType不等于ISP_NO_SPLIT;
否则,如果变量implicitMtsEnabled等于1,则:
如果cu_sbt_flag等于1,则trTypeHor和trTypeVer由表5中cu_sbt_horizontal_flag和cu_sbt_pos_flag决定;
否则(cu_sbt_flag等于0),trTypeHor和trTypeVer推导上述公式(7)和(8);
否则,trTypeHor和trTypeVer由表4中的mts_idx.决定。
可见,现有技术中,在进行变量trTypeHor和trTypeVer的推导时,在IntraSubPartitionsSplitType不等于ISP_NO_SPLIT且lfnst_idx不等于0的情况下,会将trTypeHor和trTypeVer都设置为0;在将变量implicitMtsEnabled的取值等于1的情况下,如果cu_sbt_flag等于1,则trTypeHor和trTypeVer由表5中cu_sbt_horizontal_flag和cu_sbt_pos_flag决定;否则(cu_sbt_flag等于0),trTypeHor和trTypeVer推导上述公式(7)和(8);否则,trTypeHor和trTypeVer由表4中的mts_idx.决定。而在本申请中,一方面,推导变量implicitMtsEnabled时不再对变量IntraSubPartitionsSplitType的取值进行参考,即在IntraSubPartitionsSplitType不等于ISP_NO_SPLIT的情况下变量implicitMtsEnabled的取值并不为1,进而在IntraSubPartitionsSplitType不等于ISP_NO_SPLIT的情况下不再需要根据表4、表5以及公式(7)和(8)进行变量trTypeHor和trTypeVer的推导;另一方面,在将trTypeHor和trTypeVer都设置为0的条件中,不再需要对lfnst_idx不等于0的情况进行参考。
可以理解的是,在本申请的实施例中,如果子分区使用ISP模式,那么在子分区不使用LFNST的情况下,不再根据子分区的尺寸对子分区使用的一次变换核进行确定,而是直接设定与子分区相适应的一次变换核,从而省去了通过子分区的尺寸选择子分区一次变换核的处理流程。
进一步地,在进行反向一次变换时,可以一次对子分区依次进行一维垂直变换、计算中间系数值、一维水平变换以及获取残差系数这几个变换过程。
具体地,对于一维垂直变换,如果nTbH大于1,则调用下述的一维反向一次变换过程,其输入为经过反向二次 变换后得到的反向一次变换系数d[x][y],x=0……nonZeroW-1,y=0……nonZeroH-1,变换块高度nTbH和非零高度系数nonZeroH,垂直变换类型trTypeVer;输出为e[x][y],x=0……nonZeroW-1,y=0……nonZeroH-1。
具体地,在计算中间系数值时,如果nTbH和nTbW均大于1,中间样本值g[x][y],x=0……nonZeroW-1,y=0……nonZeroH-1导出如上述公式(9)。
具体地,对于一维水平变换,如果nTbW大于1,调用下述的一维反向一次变换过程,其输入为中间样本值g[x][y],x=0……nonZeroW-1,y=0……nonZeroH-1,变换块宽度nTbW和非零宽度系数nonZeroW,水平变换类型trTypeHor;输出为r[x][y],x=0……nonZeroW-1,y=0……nonZeroH-1。
如果nTbW等于1,则r[x][y]设置等于e[x][y],x=0……nonZeroW-1,y=0……nonZeroH-1
具体地,在获取残差系数时,残差系数矩阵res[x][y],x=0……nonZeroW-1,y=0……nonZeroH-1推导如上述公式(10)和(11)。
具体地,对于一维反向一次变换过程,该过程主要是进行一维反向一次变换,其输入nTbS表示变换系数的长度,nonZeroS表示非零系数的长度,x[j],j=0……nonZeroS表示未进行一维反向一次变换的系数,trType表示变换类型;输出是经过一维反向一次变换的系数y[i],i=0……nonZeroS。
首先根据变换系数长度nTbS和变换类型trType获得变换矩阵transMatrix,然后根据trType计算y[i],i=0……nonZeroS:
如果trType等于0,则计算方法如上述公式(12);否则(trType等于1或2),计算方法如上述公式(13)。
在本申请的实施例中,解码器在确定子分区使用的LFNST变换核之后,即解码器通过解析码流,获得LFNST索引序号(lfnst_idx)的取值;然后可以根据lfnst_idx的取值,从LFNST变换核候选集中选择出lfnst_idx所指示的变换矩阵(变换核)。例如,当lfnst_idx为1时,解码过程中可以使用第一组变换矩阵作为LFNST变换核;当lfnst_idx为2时,解码过程中可以使用第二组变换矩阵作为LFNST变换核。
本申请提出了一种变换方法,应用于解码器,解码器解析码流,确定当前块的ISP模式参数;当ISP模式参数指示当前块使用ISP模式确定当前块的帧内预测值时,确定当前块的子分区;解析码流,确定子分区的变换系数矩阵;确定子分区使用的一次变换核;使用一次变换核,对变换系数矩阵进行变换处理。由此可见,在本申请的实施例中,对于ISP分区的变换,在当前块划分后的子分区不使用二次变换,仅使用一次变换时,子分区使用一次变换的一次变换核,不再由子分区的尺寸决定,即不再根据子分区的高度和宽度对一次变换核进行选择,而是直接对一次变换核进行设置。从而可以简化变换核的选择过程,降低了变换过程的复杂程度,有效地提高了编解码效率。
基于上述实施例,在本申请的再一实施例中,图20为编码器的组成结构示意图一,如图20所示,本申请实施例提出的编码器300可以包括第一确定部分301,第一变换部分302,设置部分303,
所述第一确定部分301,配置为确定当前块的ISP模式参数;以及当所述ISP模式参数指示所述当前块使用ISP模式确定所述当前块的帧内预测值时,确定所述当前块的子分区;以及确定所述子分区的残差值;以及当所述子分区使用一次变换时,确定所述子分区使用的一次变换核;
所述第一变换部分302,配置为使用所述一次变换核,对所述残差值进行变换处理。
进一步地,在本申请的实施例中,所述第一确定部分301,具体配置为确定所述当前块的划分类型;基于所述当前块的尺寸参数和所述划分类型获得所述子分区。
进一步地,在本申请的实施例中,所述尺寸参数包括宽度值和高度值,所述划分类型包括水平划分和垂直划分,,所述第一确定部分301,还具体配置为当所述宽度值等于4且高度值等于8,或者,所述宽度值等于8且高度值等于4时,所述当前块水平划分或垂直划分后获得2个子分区;当所述宽度值等于4且高度值大于8,或者,所述宽度值大于8且高度值等于4时,所述当前块水平划分或垂直划分后获得4个子分区。
进一步地,在本申请的实施例中,所述第一确定部分301,还具体配置为确定所述子分区的帧内预测值;计算所述子分区的真实值与所述帧内预测值之间的所述残差值。
进一步地,在本申请的实施例中,所述第一确定部分301,还具体配置为将DCT-2确定为所述一次变换核。
进一步地,在本申请的实施例中,所述第一确定部分301,还具体配置为当所述子分区不使用LFNST时,将预设变换核确定为所述一次变换核;其中,所述预设变换核为DCT-2、DST-7或DCT-8中的任意一个;当所述子分区使用LFNST时,将DCT-2确定为所述一次变换核。
进一步地,在本申请的实施例中,所述第一确定部分301,还具体配置为当所述子分区不使用LFNST时,将DCT-2确定为所述一次变换核;当所述子分区使用LFNST时,将预设变换核确定为所述一次变换核;其中,所述预设变换核为DCT-2、DST-7或DCT-8中的任意一个。
进一步地,在本申请的实施例中,所述第一确定部分301,还具体配置为将目标变换核确定为所述一次变换核;其中,所述目标变换核为DCT-2、DST-7或DCT-8中的任意一个;相应地,在码流中以一个语法单元指示所述目标变换核。
进一步地,在本申请的实施例中,在所述码流中,所述语法单元包含在以下所述码流中的一个或多个数据单元中:包含所述当前块的数据单元,分片头信息数据单元,图像头信息数据单元,图像层参数集,序列层参数集。
进一步地,在本申请的实施例中,所述第一确定部分301,还具体配置为当所述子分区不使用LFNST时,将第一变换核确定为所述一次变换核;当所述子分区使用LFNST时,将第二变换核确定为所述一次变换核;其中,所述第一变换核和所述第二变换核为DCT-2、DST-7或DCT-8中的任意两个;相应地,在码流中以两个语法单元分别指示所述第一变换核和所述第二变换核。
进一步地,在本申请的实施例中,在所述码流中,所述语法单元包含在以下所述码流中的一个或多个数据单元中:包含所述当前块的数据单元,分片头信息数据单元,图像头信息数据单元,图像层参数集,序列层参数集。
进一步地,在本申请的实施例中,所述设置部分303,配置为当所述子分区不使用LFNST时,将LFNST索引序 号的取值设置为指示所述子分区不使用LFNST;将所述LFNST索引序号写入码流中。
进一步地,在本申请的实施例中,所述设置部分303,还配置为当所述子分区使用LFNST时,确定所述子分区使用的LFNST变换核,将LFNST索引序号的取值设置为指示所述子分区使用LFNST;将所述LFNST索引序号写入码流中。
图21为编码器的组成结构示意图二,如图21所示,本申请实施例提出的编码器300还可以包括第一处理器304、存储有第一处理器304可执行指令的第一存储器305、第一通信接口306,和用于连接第一处理器304、第一存储器305以及第一通信接口306的第一总线307。
进一步地,在本申请的实施例中,上述第一处理器304,用于确定当前块的ISP模式参数;当所述ISP模式参数指示所述当前块使用ISP模式确定所述当前块的帧内预测值时,确定所述当前块的子分区;确定所述子分区的残差值;当所述子分区使用一次变换时,确定所述子分区使用的一次变换核;使用所述一次变换核,对所述残差值进行变换处理。
集成的单元如果以软件功能模块的形式实现并非作为独立的产品进行销售或使用时,可以存储在一个计算机可读取存储介质中,基于这样的理解,本实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或processor(处理器)执行本实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
本申请实施例提供了一种编码器,对于ISP分区的变换,在当前块划分后的子分区不使用二次变换,仅使用一次变换时,子分区使用一次变换的一次变换核,不再由子分区的尺寸决定,即不再根据子分区的高度和宽度对一次变换核进行选择,而是直接对一次变换核进行设置。从而可以简化变换核的选择过程,降低了变换过程的复杂程度,有效地提高了编解码效率。
图22为解码器的组成结构示意图一,如图22所示,本申请实施例提出的解码器400可以包括解析部分401,第二确定部分402,第二变换部分403,
所述解析部分401,配置为解析码流,确定当前块的ISP模式参数;
所述第二确定部分402,配置为当所述ISP模式参数指示所述当前块使用ISP模式确定所述当前块的帧内预测值时,确定所述当前块的子分区;
所述解析部分401,还配置为解析码流,确定所述子分区的变换系数矩阵;
所述第二确定部分402,还配置为确定所述子分区使用的一次变换核;
所述第二变换部分403,配置为使用所述一次变换核,对所述变换系数矩阵进行变换处理。
进一步地,在本申请的实施例中,所述第二确定部分402,具体配置为确定所述当前块的尺寸参数和划分类型;基于所述当前块的尺寸参数和所述划分类型获得所述子分区。
进一步地,在本申请的实施例中,所述尺寸参数包括宽度值和高度值,所述划分类型包括水平划分和垂直划分,所述第二确定部分402,还具体配置为当所述宽度值等于4且高度值等于8,或者,所述宽度值等于8且高度值等于4时,所述当前块水平划分或垂直划分后获得2个子分区;当所述宽度值等于4且高度值大于8,或者,所述宽度值大于8且高度值等于4时,所述当前块水平划分或垂直划分后获得4个子分区。
进一步地,在本申请的实施例中,所述解析部分401,还配置为当所述ISP模式参数指示所述当前块使用ISP模式确定所述当前块的帧内预测值时,确定所述当前块的子分区之后,解析码流,确定所述子分区的LFNST索引序号。
进一步地,在本申请的实施例中,所述第二确定部分402,还具体配置为将DCT-2确定为所述一次变换核。
进一步地,在本申请的实施例中,所述第二确定部分402,还具体配置为当所述LFNST索引序号指示所述子分区不使用LFNST时,将预设变换核确定为所述一次变换核;其中,所述预设变换核为DCT-2、DST-7或DCT-8中的任意一个;当所述LFNST索引序号指示所述子分区使用LFNST时,将DCT-2确定为所述一次变换核。
进一步地,在本申请的实施例中,所述第二确定部分402,还具体配置为当所述LFNST索引序号指示所述子分区不使用LFNST时,将DCT-2确定为所述一次变换核;当所述LFNST索引序号指示所述子分区使用LFNST时,将预设变换核确定为所述一次变换核;其中,所述预设变换核为DCT-2、DST-7或DCT-8中的任意一个。
进一步地,在本申请的实施例中,所述第二确定部分402,还具体配置为若码流中以一个语法单元指示目标变换核,则将所述目标变换核确定为所述一次变换核;其中,所述目标变换核为DCT-2、DST-7或DCT-8中的任意一个。
进一步地,在本申请的实施例中,解析码流中的、包含所述当前块的数据单元,分片头信息数据单元,图像头信息数据单元,图像层参数集,序列层参数集中的一个或多个数据单元,获得所述语法单元的取值,以确定所述目标变换核。
进一步地,在本申请的实施例中,所述第二确定部分402,还具体配置为若码流中以两个语法单元分别指示第一变换核和第二变换核,则当所述LFNST索引序号指示所述子分区不使用LFNST时,将所述第一变换核确定为所述一次变换核;当所述LFNST索引序号指示所述子分区使用LFNST时,将所述第二变换核确定为所述一次变换核;其中,所述第一变换核和所述第二变换核为DCT-2、DST-7或DCT-8中的任意两个。
进一步地,在本申请的实施例中,解析码流中的、包含所述当前块的数据单元,分片头信息数据单元,图像头信息数据单元,图像层参数集,序列层参数集中的一个或多个数据单元,获得所述语法单元的取值,以确定所述第一变换核和所述第二变换核。
进一步地,在本申请的实施例中,所述第二变换部分403,具体配置为利用所述一次变换核对所述变换系数矩阵进行反向一次变换,获得所述子分区的残差值。
图23为解码器的组成结构示意图二,如图23所示,本申请实施例提出的解码器400还可以包括第二处理器404、 存储有第二处理器404可执行指令的第二存储器405、第二通信接口406,和用于连接第二处理器404、第二存储器405以及第二通信接口406的第二总线407。
进一步地,在本申请的实施例中,上述第二处理器404,用于解析码流,确定当前块的ISP模式参数;当所述ISP模式参数指示所述当前块使用ISP模式确定所述当前块的帧内预测值时,确定所述当前块的子分区;解析码流,确定所述子分区的变换系数矩阵;当所述子分区使用一次变换时,确定所述子分区使用的一次变换核;使用所述一次变换核,对所述变换系数矩阵进行变换处理。
集成的单元如果以软件功能模块的形式实现并非作为独立的产品进行销售或使用时,可以存储在一个计算机可读取存储介质中,基于这样的理解,本实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或processor(处理器)执行本实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
本申请实施例提供了一种解码器,对于ISP分区的变换,在当前块划分后的子分区不使用二次变换,仅使用一次变换时,子分区使用一次变换的一次变换核,不再由子分区的尺寸决定,即不再根据子分区的高度和宽度对一次变换核进行选择,而是直接对一次变换核进行设置。从而可以简化变换核的选择过程,降低了变换过程的复杂程度,有效地提高了编解码效率。
本申请实施例提供计算机可读存储介质和计算机可读存储介质,其上存储有程序,该程序被处理器执行时实现如上述实施例所述的方法。
具体来讲,本实施例中的一种变换方法对应的程序指令可以被存储在光盘,硬盘,U盘等存储介质上,当存储介质中的与一种变换方法对应的程序指令被一电子设备读取或被执行时,包括如下步骤:
确定当前块的ISP模式参数;
当所述ISP模式参数指示所述当前块使用ISP模式确定所述当前块的帧内预测值时,确定所述当前块的子分区;
确定所述子分区的残差值;
当所述子分区使用一次变换时,确定所述子分区使用的一次变换核;
使用所述一次变换核,对所述残差值进行变换处理。
具体来讲,本实施例中的一种变换方法对应的程序指令可以被存储在光盘,硬盘,U盘等存储介质上,当存储介质中的与一种变换方法对应的程序指令被一电子设备读取或被执行时,包括如下步骤:
解析码流,确定当前块的ISP模式参数;
当所述ISP模式参数指示所述当前块使用ISP模式确定所述当前块的帧内预测值时,确定所述当前块的子分区;
解析码流,确定所述子分区的变换系数矩阵;
当所述子分区使用一次变换时,确定所述子分区使用的一次变换核;
使用所述一次变换核,对所述变换系数矩阵进行变换处理。
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用硬件实施例、软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的实现流程示意图和/或方框图来描述的。应理解可由计算机程序指令实现流程示意图和/或方框图中的每一流程和/或方框、以及实现流程示意图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在实现流程示意图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在实现流程示意图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在实现流程示意图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
以上所述,仅为本申请的较佳实施例而已,并非用于限定本申请的保护范围。
工业实用性
本申请实施例提供了一种变换方法、编码器、解码器以及存储介质,编码器确定当前块的ISP模式参数;当ISP模式参数指示当前块使用ISP模式确定当前块的帧内预测值时,确定当前块的子分区;确定子分区的残差值;当子分区使用一次变换时,确定子分区使用的一次变换核;使用一次变换核,对残差值进行变换处理。解码器解析码流,确定当前块的ISP模式参数;当ISP模式参数指示当前块使用ISP模式确定当前块的帧内预测值时,确定当前块的子分区;解析码流,确定子分区的变换系数矩阵;确定子分区使用的一次变换核;使用一次变换核,对变换系数矩阵进行变换处理。由此可见,在本申请的实施例中,对于ISP分区的变换,在当前块划分后的子分区不使用二次变换,仅使用一次变换时,子分区使用一次变换的一次变换核,不再由子分区的尺寸决定,即不再根据子分区的高度和宽度对一次变换核进行选择,而是直接对一次变换核进行设置。从而可以简化变换核的选择过程,降低了变换过程的复杂程度,有效地提高了编解码效率。

Claims (30)

  1. 一种变换方法,应用于编码器,所述方法包括:
    确定当前块的帧内子分区ISP模式参数;
    当所述ISP模式参数指示所述当前块使用ISP模式确定所述当前块的帧内预测值时,确定所述当前块的子分区;
    确定所述子分区的残差值;
    当所述子分区使用一次变换时,确定所述子分区使用的一次变换核;
    使用所述一次变换核,对所述残差值进行变换处理。
  2. 根据权利要求1所述的方法,其中,所述确定所述当前块的子分区,包括:
    确定所述当前块的划分类型;
    基于所述当前块的尺寸参数和所述划分类型获得所述子分区。
  3. 根据权利要求2所述的方法,其中,所述尺寸参数包括宽度值和高度值,所述划分类型包括水平划分和垂直划分,所述基于所述当前块的尺寸参数和所述划分类型获得所述子分区,包括:
    当所述宽度值等于4且高度值等于8,或者,所述宽度值等于8且高度值等于4时,所述当前块水平划分或垂直划分后获得2个子分区;
    当所述宽度值等于4且高度值大于8,或者,所述宽度值大于8且高度值等于4时,所述当前块水平划分或垂直划分后获得4个子分区。
  4. 根据权利要求1所述的方法,其中,所述确定所述子分区的残差值,包括:
    确定所述子分区的帧内预测值;
    计算所述子分区的真实值与所述帧内预测值之间的所述残差值。
  5. 根据权利要求1所述的方法,其中,所述确定所述子分区使用的一次变换核,包括:
    将DCT-2确定为所述一次变换核。
  6. 根据权利要求1所述的方法,其中,所述确定所述子分区使用的一次变换核,包括:
    当所述子分区不使用低频不可分变换LFNST时,将预设变换核确定为所述一次变换核;其中,所述预设变换核为DCT-2、DST-7或DCT-8中的任意一个;
    当所述子分区使用LFNST时,将DCT-2确定为所述一次变换核。
  7. 根据权利要求1所述的方法,其中,所述确定所述子分区使用的一次变换核,包括:
    当所述子分区不使用LFNST时,将DCT-2确定为所述一次变换核;
    当所述子分区使用LFNST时,将预设变换核确定为所述一次变换核;其中,所述预设变换核为DCT-2、DST-7或DCT-8中的任意一个。
  8. 根据权利要求1所述的方法,其中,所述确定所述子分区使用的一次变换核,包括:
    将目标变换核确定为所述一次变换核;其中,所述目标变换核为DCT-2、DST-7或DCT-8中的任意一个;
    相应地,
    在码流中以一个语法单元指示所述目标变换核。
  9. 根据权利要求8所述的方法,其中,所述方法还包括:
    在所述码流中,所述语法单元包含在以下所述码流中的一个或多个数据单元中:包含所述当前块的数据单元,分片头信息数据单元,图像头信息数据单元,图像层参数集,序列层参数集。
  10. 根据权利要求1所述的方法,其中,所述确定所述子分区使用的一次变换核,包括:
    当所述子分区不使用LFNST时,将第一变换核确定为所述一次变换核;
    当所述子分区使用LFNST时,将第二变换核确定为所述一次变换核;其中,所述第一变换核和所述第二变换核为DCT-2、DST-7或DCT-8中的任意两个;
    相应地,
    在码流中以两个语法单元分别指示所述第一变换核和所述第二变换核。
  11. 根据权利要求10所述的方法,其中,所述方法还包括:
    在所述码流中,所述语法单元包含在以下所述码流中的一个或多个数据单元中:包含所述当前块的数据单元,分片头信息数据单元,图像头信息数据单元,图像层参数集,序列层参数集。
  12. 根据权利要求5至11任一项所述的方法,其中,所述方法还包括:
    当所述子分区不使用LFNST时,将LFNST索引序号的取值设置为指示所述子分区不使用LFNST;
    将所述LFNST索引序号写入码流中。
  13. 根据权利要求5至11任一项所述的方法,其中,所述方法还包括:
    当所述子分区使用LFNST时,确定所述子分区使用的LFNST变换核,将LFNST索引序号的取值设置为指示所述子分区使用LFNST;
    将所述LFNST索引序号写入码流中。
  14. 一种变换方法,应用于解码器,所述方法包括:
    解析码流,确定当前块的ISP模式参数;
    当所述ISP模式参数指示所述当前块使用ISP模式确定所述当前块的帧内预测值时,确定所述当前块的子分区;
    解析码流,确定所述子分区的变换系数矩阵;
    当所述子分区使用一次变换时,确定所述子分区使用的一次变换核;
    使用所述一次变换核,对所述变换系数矩阵进行变换处理。
  15. 根据权利要求14所述的方法,其中,所述确定所述当前块的子分区,包括:
    确定所述当前块的尺寸参数和划分类型;
    基于所述当前块的尺寸参数和所述划分类型获得所述子分区。
  16. 根据权利要求14所述的方法,其中,所述尺寸参数包括宽度值和高度值,所述划分类型包括水平划分和垂直划分,所述基于所述当前块的尺寸参数和所述划分类型获得所述子分区,包括:
    当所述宽度值等于4且高度值等于8,或者,所述宽度值等于8且高度值等于4时,所述当前块水平划分或垂直划分后获得2个子分区;
    当所述宽度值等于4且高度值大于8,或者,所述宽度值大于8且高度值等于4时,所述当前块水平划分或垂直划分后获得4个子分区。
  17. 根据权利要求14所述的方法,其中,所述当所述ISP模式参数指示所述当前块使用ISP模式确定所述当前块的帧内预测值时,确定所述当前块的子分区之后,所述方法还包括:
    解析码流,确定所述子分区的LFNST索引序号。
  18. 根据权利要求14所述的方法,其中,所述确定所述子分区使用的一次变换核,包括:
    将DCT-2确定为所述一次变换核。
  19. 根据权利要求17所述的方法,其中,所述确定所述子分区使用的一次变换核,包括:
    当所述LFNST索引序号指示所述子分区不使用LFNST时,将预设变换核确定为所述一次变换核;其中,所述预设变换核为DCT-2、DST-7或DCT-8中的任意一个;
    当所述LFNST索引序号指示所述子分区使用LFNST时,将DCT-2确定为所述一次变换核。
  20. 根据权利要求17所述的方法,其中,所述确定所述子分区使用的一次变换核,包括:
    当所述LFNST索引序号指示所述子分区不使用LFNST时,将DCT-2确定为所述一次变换核;
    当所述LFNST索引序号指示所述子分区使用LFNST时,将预设变换核确定为所述一次变换核;其中,所述预设变换核为DCT-2、DST-7或DCT-8中的任意一个。
  21. 根据权利要求14所述的方法,其中,所述确定所述子分区使用的一次变换核,包括:
    若码流中以一个语法单元指示目标变换核,则将所述目标变换核确定为所述一次变换核;其中,所述目标变换核为DCT-2、DST-7或DCT-8中的任意一个。
  22. 根据权利要求21所述的方法,其中,所述方法还包括:
    解析码流中的、包含所述当前块的数据单元,分片头信息数据单元,图像头信息数据单元,图像层参数集,序列层参数集中的一个或多个数据单元,获得所述语法单元的取值,以确定所述目标变换核。
  23. 根据权利要求17所述的方法,其中,所述确定所述子分区使用的一次变换核,包括:
    若码流中以两个语法单元分别指示第一变换核和第二变换核,则当所述LFNST索引序号指示所述子分区不使用LFNST时,将所述第一变换核确定为所述一次变换核;当所述LFNST索引序号指示所述子分区使用LFNST时,将所述第二变换核确定为所述一次变换核;其中,所述第一变换核和所述第二变换核为DCT-2、DST-7或DCT-8中的任意两个。
  24. 根据权利要求23所述的方法,其中,所述方法还包括:
    解析码流中的、包含所述当前块的数据单元,分片头信息数据单元,图像头信息数据单元,图像层参数集,序列层参数集中的一个或多个数据单元,获得所述语法单元的取值,以确定所述第一变换核和所述第二变换核。
  25. 根据权利要求14所述的方法,其中,所述使用所述一次变换核,对所述变换系数矩阵进行变换处理,包括:
    利用所述一次变换核对所述变换系数矩阵进行反向一次变换,获得所述子分区的残差值。
  26. 一种编码器,所述编码器包括:第一确定部分,第一变换部分,
    所述第一确定部分,配置为确定当前块的ISP模式参数;以及当所述ISP模式参数指示所述当前块使用ISP模式确定所述当前块的帧内预测值时,确定所述当前块的子分区;以及确定所述子分区的残差值;以及当所述子分区使用一次变换时,确定所述子分区使用的一次变换核;
    所述第一变换部分,配置为使用所述一次变换核,对所述残差值进行变换处理。
  27. 一种编码器,所述编码器包括第一处理器、存储有所述第一处理器可执行指令的第一存储器,当所述指令被执行时,所述第一处理器执行时实现如权利要求1-13任一项所述的方法。
  28. 一种解码器,所述解码器包括:解析部分,第二确定部分,第二变换部分,
    所述解析部分,配置为解析码流,确定当前块的ISP模式参数;
    所述第二确定部分,配置为当所述ISP模式参数指示所述当前块使用ISP模式确定所述当前块的帧内预测值时,确定所述当前块的子分区;
    所述解析部分,还配置为解析码流,确定所述子分区的变换系数矩阵;
    所述第二确定部分,还配置为确定所述子分区使用的一次变换核;
    所述第二变换部分,配置为使用所述一次变换核,对所述变换系数矩阵进行变换处理。
  29. 一种解码器,所述解码器包括第二处理器、存储有所述第二处理器可执行指令的第二存储器,当所述指令被执行时,所述第二处理器执行时实现如权利要求14-25任一项所述的方法。
  30. 一种计算机存储介质,其中,所述计算机存储介质存储有计算机程序,所述计算机程序被第一处理器执行时实现如权利要求1-13任一项所述的方法,或者,被第二处理器执行时实现如权利要求14-25任一项所述的方法。
PCT/CN2020/083367 2020-04-03 2020-04-03 变换方法、编码器、解码器以及存储介质 WO2021196231A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
PCT/CN2020/083367 WO2021196231A1 (zh) 2020-04-03 2020-04-03 变换方法、编码器、解码器以及存储介质
CN202080071780.2A CN114556943A (zh) 2020-04-03 2020-04-03 变换方法、编码器、解码器以及存储介质
TW110109410A TW202139714A (zh) 2020-04-03 2021-03-16 變換方法、編碼器、解碼器以及儲存媒介

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/083367 WO2021196231A1 (zh) 2020-04-03 2020-04-03 变换方法、编码器、解码器以及存储介质

Publications (1)

Publication Number Publication Date
WO2021196231A1 true WO2021196231A1 (zh) 2021-10-07

Family

ID=77927574

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/083367 WO2021196231A1 (zh) 2020-04-03 2020-04-03 变换方法、编码器、解码器以及存储介质

Country Status (3)

Country Link
CN (1) CN114556943A (zh)
TW (1) TW202139714A (zh)
WO (1) WO2021196231A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023197195A1 (zh) * 2022-04-13 2023-10-19 Oppo广东移动通信有限公司 视频编解码方法、编码器、解码器及存储介质

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024007120A1 (zh) * 2022-07-04 2024-01-11 Oppo广东移动通信有限公司 编解码方法、编码器、解码器以及存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150085929A1 (en) * 2013-09-26 2015-03-26 Qualcomm Incorporated Sub-prediction unit (pu) based temporal motion vector prediction in hevc and sub-pu design in 3d-hevc
CN106961606A (zh) * 2017-01-26 2017-07-18 浙江工业大学 基于纹理划分特征的hevc帧内编码模式选择方法
US20190075328A1 (en) * 2016-03-16 2019-03-07 Mediatek Inc. Method and apparatus of video data processing with restricted block size in video coding

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP4216547A1 (en) * 2012-06-29 2023-07-26 Electronics And Telecommunications Research Institute Method for encoding/decoding images
KR102423880B1 (ko) * 2015-10-06 2022-07-21 삼성전자주식회사 인코더의 작동방법과 상기 인코더를 포함하는 시스템 온 칩의 작동 방법
WO2018221554A1 (ja) * 2017-06-01 2018-12-06 パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカ 符号化装置、符号化方法、復号装置及び復号方法
CN112106373A (zh) * 2018-03-28 2020-12-18 韩国电子通信研究院 用于图像编/解码的方法和装置及存储比特流的记录介质
CN111919450B (zh) * 2018-09-02 2022-08-12 Lg电子株式会社 用于编码/解码视频信号的方法及其装置
WO2020050702A1 (ko) * 2018-09-07 2020-03-12 주식회사 윌러스표준기술연구소 다중 변환 커널을 사용하는 비디오 신호 처리 방법 및 장치
CN110636313B (zh) * 2019-09-18 2022-07-15 浙江大华技术股份有限公司 变换、二次变换矩阵训练方法、编码器及相关装置

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150085929A1 (en) * 2013-09-26 2015-03-26 Qualcomm Incorporated Sub-prediction unit (pu) based temporal motion vector prediction in hevc and sub-pu design in 3d-hevc
US20190075328A1 (en) * 2016-03-16 2019-03-07 Mediatek Inc. Method and apparatus of video data processing with restricted block size in video coding
CN106961606A (zh) * 2017-01-26 2017-07-18 浙江工业大学 基于纹理划分特征的hevc帧内编码模式选择方法

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
M. KOO (LGE), M. SALEHIFAR (LGE), J. LIM (LGE), S. KIM (LGE): "CE6: Reduced Secondary Transform (RST) (CE6-3.1)", 14. JVET MEETING; 20190319 - 20190327; GENEVA; (THE JOINT VIDEO EXPLORATION TEAM OF ISO/IEC JTC1/SC29/WG11 AND ITU-T SG.16 ), no. JVET-N0193, 27 March 2019 (2019-03-27), XP030205084 *
S. DE-LUXÁN-HERNÁNDEZ (FRAUNHOFER), V. GEORGE, J. MA, T. NGUYEN, H. SCHWARZ, D. MARPE, T. WIEGAND (HHI): "CE3: Intra Sub-Partitions Coding Mode (Tests 1.1.1 and 1.1.2)", 125. MPEG MEETING; 20190114 - 20190118; MARRAKECH; (MOTION PICTURE EXPERT GROUP OR ISO/IEC JTC1/SC29/WG11), no. m45361, 2 January 2019 (2019-01-02), XP030197783 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023197195A1 (zh) * 2022-04-13 2023-10-19 Oppo广东移动通信有限公司 视频编解码方法、编码器、解码器及存储介质

Also Published As

Publication number Publication date
CN114556943A (zh) 2022-05-27
TW202139714A (zh) 2021-10-16

Similar Documents

Publication Publication Date Title
TWI703861B (zh) 解碼器的視訊解碼方法及裝置
JP7047119B2 (ja) 変換領域における残差符号予測のための方法および装置
JP2020022171A (ja) イントラ予測方法とそれを利用した符号化器及び復号化器
WO2016206590A1 (en) Method and apparatus for transform coefficient coding of non-square blocks
KR20110123651A (ko) 생략 부호화를 이용한 영상 부호화 및 복호화 장치 및 그 방법
WO2020258010A1 (zh) 图像编解码方法、编码器、解码器以及存储介质
WO2021196231A1 (zh) 变换方法、编码器、解码器以及存储介质
JP2023090929A (ja) ビデオ復号化方法、ビデオ復号化装置及び記憶媒体
WO2021134635A1 (zh) 变换方法、编码器、解码器以及存储介质
JP7461353B2 (ja) 画像符号化/復号化方法、エンコーダ、デコーダ及び記憶媒体
JP7437426B2 (ja) インター予測方法および装置、機器、記憶媒体
JP2024503193A (ja) フレーム内予測方法、装置、及びデコーダとエンコーダ
CN113676732A (zh) 图像分量预测方法、编码器、解码器以及存储介质
JP7467687B2 (ja) 符号化・復号方法及び装置
CN113395520B (zh) 解码预测方法、装置及计算机存储介质
WO2021134327A1 (zh) 变换方法、编码器、解码器以及存储介质
WO2021134303A1 (zh) 变换方法、编码器、解码器以及存储介质
WO2021054885A1 (en) Allowing a matrix based intra prediction block to have multiple transform blocks
KR20220011175A (ko) 화상 복호 장치, 복호 방법, 및 컴퓨터 프로그램
TWI833620B (zh) 圖像編碼裝置、圖像編碼方法、圖像解碼裝置及圖像解碼方法
WO2023231008A1 (zh) 编解码方法、编码器、解码器以及存储介质
WO2023197195A1 (zh) 视频编解码方法、编码器、解码器及存储介质
WO2021134637A1 (zh) 变换方法、编码器、解码器以及存储介质
WO2022140905A1 (zh) 预测方法、编码器、解码器以及存储介质
WO2024007120A1 (zh) 编解码方法、编码器、解码器以及存储介质

Legal Events

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

Ref document number: 20929617

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20929617

Country of ref document: EP

Kind code of ref document: A1