Method and apparatus for processing video signal using multiple transform cores

By using the transformation nucleus suitable for changing blocks in the video signal processing, the problem of low video signal coding and decoding efficiency in existing technologies has been solved, and a more efficient encoding and decoding process is achieved.

CN119363971APending Publication Date: 2025-01-24VIDACIO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411367717.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2019-03-29
Filing Date
2020-01-13
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

The prior art has low compilation efficiency in the encoding and decoding process of video signals, making it difficult to adapt to the latest developments of various media and data transmission media.

Method used

By using the transform core suitable for changing blocks, the specific steps include obtaining the ISP mode logo in the video signal. If the ISP mode is applied, the sign of the division is obtained. Transform generate residual blocks and reconstruct the current block based on residual blocks.

Benefits of technology

Improved the coding and decoding efficiency of the video signal, and can choose a suitable transformation core according to the characteristics of the current change block, thereby improving the coding performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119363971A_ABST
    Figure CN119363971A_ABST
Patent Text Reader

Abstract

The invention relates to a method and apparatus for processing a video signal using multiple transform cores. Disclosed are a method and an apparatus for processing a video signal by encoding or decoding the video signal. Specifically, the method for processing a video signal comprises the steps of: obtaining, from a video signal, an intra sub-partition (ISP) mode flag indicating whether an ISP mode is applied to a current block; obtaining an ISP partition flag indicating a partition direction of the current block from the video signal when the ISP mode is applied to the current block; dividing the current block into a plurality of transform blocks based on the division direction; generating a residual block of the transform blocks by performing inverse transform on each of the transform blocks; and restoring the current block based on the residual block.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of a patent application with application number 202080007132.0 (PCT / KR2020 / 000638), which was submitted to the China Patent Office on June 18, 2021, with an international application date of January 13, 2020, and the invention name is “Method and device for processing video signals using multi-transform cores”. Technical Field

[0002] The present disclosure relates to a method and apparatus for processing a video signal, and more particularly, to a video signal processing method and apparatus for encoding and decoding a video signal. Background Art

[0003] Compression coding refers to a series of signal processing techniques for sending digitized information through communication lines or storing information in a form suitable for storage media. Objects of compression coding include objects such as voice, video, and text, and in particular, the technology for performing compression coding on images is called video compression. Compression coding of video signals is performed by removing excess information in consideration of spatial correlation, temporal correlation, and random correlation. However, with the recent development of various media and data transmission media, more efficient video signal processing methods and devices are needed. Summary of the invention

[0004] Technical issues

[0005] The purpose of the present disclosure is to improve the coding efficiency of a video signal. Specifically, the purpose of the present disclosure is to improve the coding efficiency by using a transform kernel suitable for a transform block.

[0006] Technical Solution

[0007] In order to solve the above problems, the present disclosure provides the following video signal processing device and video signal processing method.

[0008] According to an embodiment of the present disclosure, a method for processing a video signal is provided, which includes the following steps: obtaining an ISP mode flag indicating whether an intra sub-partitioning (ISP) mode is applied to a current block from a video signal; if the ISP mode is applied to the current block, obtaining an ISP partitioning flag indicating a partitioning direction of the current block from the video signal; based on the partitioning direction, dividing the current block into a plurality of transform blocks; generating a residual block of the transform block by performing an inverse transform on each of the transform blocks; and restoring the current block based on the residual block, wherein the step of generating the residual block may include the following steps: regardless of an intra prediction mode of the current block, based on a width of the current transform block, determining a horizontal transform type applied in a horizontal direction of the current transform block from among a plurality of predefined transform types; regardless of an intra prediction mode of the current block, based on a height of the current transform block, determining a vertical transform type applied in a vertical direction of the current transform block from among a plurality of predefined transform types; and performing an inverse transform on the current transform block using the horizontal transform type and the vertical transform type.

[0009] As an embodiment, the step of determining the horizontal transform type may include the following steps: if the width of the current transform block is less than a first threshold or greater than a second threshold, determining the horizontal transform type to be the first transform type; and if the width of the current transform block is greater than or equal to the first threshold and less than or equal to the second threshold, determining the horizontal transform type to be the second transform type.

[0010] As an embodiment, the step of determining the vertical transformation type may include the following steps: if the height of the current transformation block is less than a first threshold or greater than a second threshold, determining the vertical transformation type to be a first transformation type; and if the height of the current transformation block is greater than or equal to the first threshold and less than or equal to the second threshold, determining the vertical transformation type to be a second transformation type.

[0011] As an embodiment, the first transform type may be defined as a transform kernel based on discrete cosine transform type-2 (DCT-2), and the second transform type may be defined as a transform kernel based on discrete sine transform type-7 (DST-7).

[0012] As an embodiment, the first threshold may be defined based on a minimum size of a transform block of a luminance component.

[0013] As an embodiment, the second threshold may be defined based on a maximum size of a second transform type used in the ISP mode.

[0014] As an embodiment, the first threshold may be defined as 4, and the second threshold may be defined as 16.

[0015] As an embodiment, the horizontal transform type may be determined based on the width of the current transform block regardless of the height of the current transform block, and the vertical transform type may be determined based on the height of the current transform block regardless of the width of the current transform block.

[0016] According to an embodiment of the present disclosure, a device for processing a video signal is provided, which includes a processor, wherein the processor is configured to: obtain an ISP mode flag indicating whether an intra-frame sub-partitioning (ISP) mode is applied to a current block from a video signal; if the ISP mode is applied to the current block, obtain an ISP partitioning flag indicating a partitioning direction of the current block from the video signal; based on the partitioning direction, divide the current block into multiple transform blocks; generate a residual block of the transform block by performing an inverse transform on each of the transform blocks; and reconstruct the current block based on the residual block, wherein the processor is configured to: determine a horizontal transform type applied in a horizontal direction of the current transform block from multiple predefined transform types based on a width of the current transform block regardless of an intra-frame prediction mode of the current block; determine a vertical transform type applied in a vertical direction of the current transform block from multiple predefined transform types based on a height of the current transform block regardless of the intra-frame prediction mode of the current block; and perform an inverse transform on the current transform block using the horizontal transform type and the vertical transform type, thereby generating a residual block.

[0017] As an embodiment, the processor can be configured to: if the width of the current transform block is less than a first threshold or greater than a second threshold, determine that the horizontal transform type is the first transform type; and if the width of the current transform block is greater than or equal to the first threshold and less than or equal to the second threshold, determine that the horizontal transform type is the second transform type.

[0018] As an embodiment, the processor can be configured to: if the height of the current transform block is less than a first threshold or greater than a second threshold, determine the vertical transform type to be the first transform type; and if the height of the current transform block is greater than or equal to the first threshold and less than or equal to the second threshold, determine the vertical transform type to be the second transform type.

[0019] As an embodiment, the first transform type may be defined as a transform kernel based on discrete cosine transform type-2 (DCT-2), and the second transform type may be defined as a transform kernel based on discrete sine transform type-7 (DST-7).

[0020] As an embodiment, the first threshold may be defined based on a minimum transform block size of a luminance component.

[0021] As an embodiment, the second threshold may be defined based on a maximum size of a second transform type used in the ISP mode.

[0022] As an embodiment, the first threshold may be defined as 4, and the second threshold may be defined as 16.

[0023] As an embodiment, the horizontal transform type may be determined based on the width of the current transform block regardless of the height of the current transform block, and the vertical transform type may be determined based on the height of the current transform block regardless of the width of the current transform block.

[0024] According to an embodiment of the present disclosure, a method for processing a video signal is provided, which includes the following steps: encoding an ISP mode flag indicating whether an intra sub-partitioning (ISP) mode is applied to a current block; if the ISP mode is applied to the current block, encoding an ISP partitioning flag indicating a partitioning direction of the current block; based on the partitioning direction, dividing the current block into a plurality of blocks; generating a transform block of the divided block by performing a transform on a residual signal of the divided block; and generating a bit stream by encoding the transform block, wherein the step of generating the transform block may include the following steps: regardless of an intra prediction mode of the current block, based on a width of the current transform block, determining a horizontal transform type applied in a horizontal direction of the current transform block from among a plurality of predefined transform types; regardless of an intra prediction mode of the current block, based on a height of the current transform block, determining a vertical transform type applied in a vertical direction of the current transform block from among a plurality of predefined transform types; and performing a transform on the current transform block using the horizontal transform type and the vertical transform type.

[0025] According to an embodiment of the present disclosure, a non-transitory computer-executable medium is provided, which stores a computer-executable component configured to be executed by one or more processors of a computing device, wherein the computer-executable component can be configured to: obtain an ISP mode flag indicating whether an intra-frame sub-partitioning (ISP) mode is applied to a current block; if the ISP mode is applied to the current block, obtain an ISP partitioning flag indicating a partitioning direction of the current block; based on the partitioning direction, divide the current block into multiple transform blocks; generate a residual block of the transform block by performing an inverse transform on each of the transform blocks; and reconstruct the current block based on the residual block, wherein the computer-executable component can be configured to: determine a horizontal transform type applied in a horizontal direction of the current transform block from among multiple predefined transform types based on a width of the current transform block, regardless of an intra-frame prediction mode of the current block; determine a vertical transform type applied in a vertical direction of the current transform block from among multiple predefined transform types based on a height of the current transform block, regardless of the intra-frame prediction mode of the current block; and perform an inverse transform on the current transform block using the horizontal transform type and the vertical transform type, thereby generating a residual block.

[0026] According to an embodiment of the present disclosure, a method for processing a video signal is provided, which includes the following steps: obtaining a first syntax element indicating whether only a predefined first transform kernel can be used in a current sequence; if it is not the case that only the first transform kernel can be used in the current sequence, obtaining a second syntax element indicating whether a multiple transform selection (MTS) mode can be used in the current sequence, the MTS mode indicating a mode for performing a transform using a specific transform kernel among a plurality of transform kernels; based on the first syntax element and the second syntax element, determining a transform kernel applied in the horizontal and vertical directions of a current block from among the plurality of transform kernels; and obtaining a residual signal of the current block by performing an inverse transform on the current block using the determined transform kernel.

[0027] As an embodiment, in the step of determining the transform kernel, if the first syntax element indicates that only the first transform kernel can be used in the current sequence, the first transform kernel may be determined as the transform kernel applied in the horizontal and vertical directions.

[0028] As an embodiment, in the step of determining the transform kernel, if the second syntax element indicates that the MTS mode can be used in the current sequence, an MTS index can be obtained, which indicates a combination of transform kernels applied in the horizontal and vertical directions of the current block among multiple transform kernels.

[0029] As an embodiment, the step of determining the transform kernel may include the following steps: if the second syntax element indicates that the MTS mode can be used in the current sequence, a variable indicating whether the implicit MTS mode can be used in the current block is inferred to be 0, wherein the implicit MTS mode may represent a mode for determining a combination of transform kernels applied in the horizontal and vertical directions of the current block from among multiple transform kernels based on the width and height of the transform block.

[0030] As an embodiment, the step of determining the transform kernel may include the following steps: if the second syntax element indicates that the MTS mode cannot be used in the current sequence, determining whether an implicit MTS mode can be used in the current block, wherein the implicit MTS mode may represent a mode for determining a combination of transform kernels applied in the horizontal and vertical directions of the current block from among multiple transform kernels based on the width and height of the transform block.

[0031] As an embodiment, the first transform kernel may be defined as a DCT-2 based transform kernel.

[0032] According to an embodiment of the present disclosure, a device for processing a video signal is provided, which includes a processor, wherein the processor can be configured to: obtain a first syntax element indicating whether only a predefined first transform kernel can be used in a current sequence; if it is not the case that only the first transform kernel can be used in the current sequence, obtain a second syntax element indicating whether a multiple transform selection (MTS) mode can be used in the current sequence, the MTS mode indicating a mode for performing a transform using a specific transform kernel among a plurality of transform kernels; based on the first syntax element and the second syntax element, determine a transform kernel applied in the horizontal and vertical directions of a current block from among the plurality of transform kernels; and obtain a residual signal of the current block by performing an inverse transform on the current block using the determined transform kernel.

[0033] As an embodiment, if the first syntax element indicates that only the first transform kernel can be used in the current sequence, the processor may determine the first transform kernel as the transform kernel applied in the horizontal and vertical directions.

[0034] As an embodiment, if the second syntax element indicates that the MTS mode can be used in the current sequence, the processor may obtain an MTS index indicating a combination of transform cores applied in the horizontal and vertical directions of the current block among a plurality of transform cores.

[0035] As an embodiment, if the second syntax element indicates that the MTS mode can be used in the current sequence, the processor may infer a variable indicating whether the implicit MTS mode can be used in the current block to be 0, wherein the implicit MTS mode may represent a mode for determining a combination of transform cores applied in the horizontal and vertical directions of the current block from among multiple transform cores based on the width and height of the transform block.

[0036] As an embodiment, if the second syntax element indicates that the MTS mode cannot be used in the current sequence, the processor may determine whether an implicit MTS mode can be used in the current block, wherein the implicit MTS mode may represent a mode for determining a combination of transform cores applied in the horizontal and vertical directions of the current block from among multiple transform cores based on the width and height of the transform block.

[0037] As an embodiment, the first transform kernel may be defined as a DCT-2 based transform kernel.

[0038] According to an embodiment of the present disclosure, a method for processing a video signal is provided, which includes the following steps: encoding a first syntax element indicating whether only a predefined first transform kernel can be used in a current sequence; if it is not the case that only the first transform kernel can be used in the current sequence, encoding a second syntax element indicating whether a multiple transform selection (MTS) mode can be used in the current sequence, the MTS mode indicating a mode for performing a transform using a specific transform kernel among a plurality of transform kernels; determining a transform kernel applied in a horizontal and vertical direction of a current block from among the plurality of transform kernels based on the first syntax element and the second syntax element; and obtaining a transform block of the current block by performing a transform on a residual signal of the current block using the determined transform kernel.

[0039] According to an embodiment of the present disclosure, a method for processing a video signal is provided, which includes the following steps: if a current block is in an intra-frame prediction mode, identifying whether an intra sub-partitioning (ISP) mode is applied to the current block, the ISP mode indicating a mode for dividing the current block into multiple rectangular transform blocks; if the current block is in an inter-frame prediction mode, identifying whether a sub-block transform (SBT) mode is applied to the current block, the SBT indicating a mode in which transforms are performed only on some of the multiple sub-blocks divided from the current block; if the ISP mode is not applied to the current block, and if the SBT mode is not applied to the current block, performing transform tree partitioning on the current block based on size information of the current block and a maximum transform size; and generating a residual signal of the transform unit by performing transform on the transform unit determined based on the transform tree partitioning.

[0040] As an embodiment, transform tree partitioning may be performed by recursively performing at least one of horizontal partitioning and vertical partitioning on the current block until the width and height of the current block are less than or equal to the maximum transform size.

[0041] As an embodiment, the step of performing transform tree partitioning may further include the following steps: if the SBT mode is applied to the current block, performing transform tree partitioning on the current block based on subblock partitioning information of the current block.

[0042] As an embodiment, the step of performing transform tree splitting may further include the following steps: if the ISP mode is applied to the current block, performing transform tree splitting on the current block based on the ISP splitting type of the current block.

[0043] According to an embodiment of the present disclosure, a device for processing a video signal is provided, comprising a processor, wherein the processor can be configured to: if a current block is in an intra-frame prediction mode, identify whether an intra-frame sub-partitioning (ISP) mode is applied to the current block, the ISP mode indicating a mode for dividing the current block into multiple rectangular transform blocks; if the current block is in an inter-frame prediction mode, identify whether a sub-block transform (SBT) mode is applied to the current block, the SBT indicating a mode in which transformation is performed only on some sub-blocks among multiple sub-blocks divided from the current block; if the ISP mode is not applied to the current block and the SBT mode is not applied to the current block, perform transform tree partitioning on the current block based on size information of the current block and a maximum transform size; and generate a residual signal of the transform unit by performing transformation on the transform unit determined based on the transform tree partitioning.

[0044] As an embodiment, transform tree partitioning may be performed by recursively performing at least one of horizontal partitioning and vertical partitioning on the current block until the width and height of the current block are less than or equal to the maximum transform size.

[0045] As an embodiment, if the SBT mode is applied to the current block, the processor may perform transform tree partitioning on the current block based on sub-block partitioning information of the current block.

[0046] As an embodiment, if the ISP mode is applied to the current block, the processor may perform transform tree partitioning on the current block based on the ISP partitioning type of the current block.

[0047] According to an embodiment of the present disclosure, a method for processing a video signal is provided, which includes the following steps: if a current block is in an intra prediction mode, determining whether an intra sub-partitioning (ISP) mode is applied to the current block, the ISP mode indicating a mode for dividing the current block into multiple rectangular transform blocks; if the current block is in an inter prediction mode, determining whether a sub-block transform (SBT) mode is applied to the current block, the SBT indicating a mode in which transforms are performed only on some of the multiple sub-blocks divided from the current block; if the ISP mode is not applied to the current block and the SBT mode is not applied to the current block, performing transform tree partitioning on the current block based on size information of the current block and a maximum transform size; and generating a residual signal of the transform unit by performing transform on the transform unit determined based on the transform tree partitioning.

[0048] Beneficial Effects

[0049] According to the embodiments of the present disclosure, the coding efficiency of the video signal can be improved. In addition, according to the embodiments of the present disclosure, a transform kernel suitable for the current transform block can be selected. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1is a schematic block diagram of a video signal encoding apparatus according to an embodiment of the present invention.

[0051] Figure 2 is a schematic block diagram of a video signal decoding apparatus according to an embodiment of the present invention.

[0052] Figure 3 An embodiment in which a coding tree unit is divided into coding units in a picture is shown.

[0053] Figure 4 Embodiments of methods for signaling partitioning of quadtrees and multi-type trees are shown.

[0054] Figure 5 and Figure 6 According to an embodiment of the present invention, the intra prediction method is illustrated in more detail.

[0055] Figure 7 An inter-frame prediction method according to an embodiment of the present invention is illustrated.

[0056] Figure 8 is a diagram specifically illustrating a method for transforming a residual signal by an encoder.

[0057] Fig. 9 is a diagram specifically illustrating a method for obtaining a residual signal by inversely transforming a transform coefficient through an encoder and a decoder.

[0058] Fig.10 is a diagram showing basis functions corresponding to respective transform types.

[0059] Fig.11 is a diagram showing the size of a signal for each index of transform types DCT-II, DCT-V, DCT-VIII, DST-I, and DST-VII.

[0060] Fig.12 is a diagram showing the size of a signal for each index of transform types DST-IV, DCT-IV, DST-VII, and DCT-VIII.

[0061] Fig.13 is a diagram illustrating a method of configuring a candidate transform set according to a prediction mode of a current block.

[0062] Fig.14 The horizontal transform kernel and the vertical transform kernel determined according to the set index are shown.

[0063] Fig.15 is a diagram illustrating a method of obtaining information related to transformation according to an embodiment of the present invention.

[0064] Fig.16is a diagram illustrating a method of selecting a transform kernel based on a shape of a block according to an embodiment of the present invention.

[0065] Fig.17 is a diagram illustrating a method of signaling and determining a transform kernel according to an embodiment of the present invention.

[0066] Fig.18 shows a syntax structure for obtaining information related to multiple transform selection and transform skipping according to an embodiment of the present invention, and Fig.19 is a diagram illustrating information related to multiple transform selection and transform skipping according to an embodiment of the present invention.

[0067] Fig. 20 is a diagram illustrating a sub-block transform (SBT) method according to an embodiment of the present invention.

[0068] Fig.21 2 is a diagram illustrating a method of partitioning a block in an intra sub-partitioning encoding mode according to an embodiment of the present invention.

[0069] Fig. 22 2 is a diagram illustrating a method of selecting a transform kernel applied to a split transform unit in case that an intra sub-split mode is applied according to an embodiment of the present invention.

[0070] Fig.23 and 24 is a diagram illustrating a process of obtaining information on whether a non-zero transform coefficient exists in a transform unit syntax structure in a case where SBT is applied according to an embodiment of the present invention.

[0071] Fig.25 is a diagram illustrating a coding unit syntax structure for processing syntax elements related to a coding unit according to an embodiment of the present invention.

[0072] Fig.26 is a diagram illustrating a transform tree syntax structure according to an embodiment of the present invention.

[0073] Fig. 27 is a diagram illustrating a transform tree syntax structure according to another embodiment of the present invention.

[0074] Fig.28 is a diagram illustrating a transform tree syntax structure according to another embodiment of the present invention.

[0075] Fig.29 is a flowchart illustrating a video signal processing method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0076] Considering the functions in the present disclosure, the terms used in this specification may be common terms that are currently widely used, but may be changed according to the intention of those skilled in the art, customs, or the emergence of new technologies. In addition, in some cases, there may be terms arbitrarily selected by the applicant, and in this case, their meanings are described in the corresponding description section of the present disclosure. Therefore, the terms used in this specification should be interpreted based on the substantial meaning of the terms and contents throughout the specification.

[0077] In this specification, some terms may be explained as follows. In some cases, coding may be explained as encoding or decoding. In this specification, a device that generates a video signal bit stream by performing coding (coding) of a video signal is referred to as a coding device or encoder, and a device that performs decoding (decoding) of a video signal bit stream to reconstruct a video signal is referred to as a decoding device or decoder. In addition, in this specification, a video signal processing device is used as a term that includes the concepts of both encoders and decoders. Information is a term that includes all values, parameters, coefficients, elements, etc. In some cases, the meaning is interpreted differently, so the present disclosure is not limited thereto. "Unit" is used as a meaning that refers to a basic unit of image processing or a specific position of a picture, and refers to an image area that includes both luminance components and chrominance components. In addition, "block" refers to an image area that includes a specific component among luminance components and chrominance components (ie, Cb and Cr). However, depending on the embodiment, terms such as "unit", "block", "partition (partition)" and "area" may be used interchangeably. In addition, in this specification, a unit may be used as a concept that includes all of a coding unit, a prediction unit, and a transform unit. A picture indicates a field or a frame, and these terms may be used interchangeably according to an embodiment.

[0078] Figure 1 is a schematic block diagram of a video signal encoding apparatus according to an embodiment of the present invention. Figure 1 , the encoding device 100 of the present disclosure includes a transform unit 110, a quantization unit 115, an inverse quantization unit 120, an inverse transform unit 125, a filtering unit 130, a prediction unit 150 and an entropy coding unit 160.

[0079] The transform unit 110 obtains the value of the transform coefficient by transforming the residual signal, which is the difference between the input video signal and the prediction signal generated by the prediction unit 150. For example, discrete cosine transform (DCT), discrete sine transform (DST) or wavelet transform can be used. DCT and DST perform transformation by dividing the input picture signal into a plurality of blocks. In the transformation, the coding efficiency can vary according to the distribution and characteristics of the values ​​in the transformation area. The quantization unit 115 quantizes the value of the transform coefficient value output from the transform unit 110.

[0080] In order to improve the coding efficiency, instead of the method of coding the picture signal as it is, a method is used to predict the picture using the area that has been encoded by the prediction unit 150, and to obtain the reconstructed picture by adding the residual value between the original picture and the predicted picture to the predicted picture. In order to prevent the mismatch between the encoder and the decoder, when the prediction is performed in the encoder, information that can be used in the decoder should be used. To this end, the encoder performs the process of reconstructing the encoded current block again. The inverse quantization unit 120 inversely quantizes the value of the transform coefficient, and the inverse transform unit 125 reconstructs the residual value using the inversely quantized transform coefficient value. At the same time, the filtering unit 130 performs a filtering operation to improve the quality of the reconstructed picture and improve the coding efficiency. For example, a deblocking filter, a sample adaptive offset (SAO), and an adaptive loop filter may be included. The filtered picture is output or stored in a decoded picture buffer (DPB) 156 to be used as a reference picture.

[0081] In order to improve coding efficiency, the picture signal is not coded as it is, but a method of reconstructing a picture is obtained by predicting the picture via the prediction unit 150 by using the coded area and adding the residual value between the original picture and the predicted picture to the predicted picture. The intra prediction unit 152 performs intra prediction in the current picture, and the inter prediction unit 154 predicts the current picture by using the reference picture stored in the decoded picture buffer 156. The intra prediction unit 152 performs intra prediction from the reconstructed area in the current picture and transmits the intra coding information to the entropy coding unit 160. The inter prediction unit 154 may include a motion estimation unit 154a and a motion compensation unit 154b. The motion estimation unit 154a obtains a motion vector value of the current area by referring to a specific reconstructed area. The motion estimation unit 154a transmits the position information (reference frame, motion vector, etc.) of the reference area to the entropy coding unit 160 so that the position information is included in the bitstream. The motion compensation unit 154b performs inter motion compensation by using the motion vector value transmitted from the motion estimation unit 154a.

[0082] The prediction unit 150 includes an intra prediction unit 152 and an inter prediction unit 154. The intra prediction unit 152 performs intra prediction within the current picture, and the inter prediction unit 154 performs inter prediction to predict the current picture by using the reference picture stored in the DBP 156. The intra prediction unit 152 performs intra prediction according to the reconstructed sample in the current picture, and transmits intra coding information to the entropy coding unit 160. The intra coding information may include at least one of an intra prediction mode, a most probable mode (MPM) flag, and an MPM index. The intra coding information may include information about the reference sample. The inter prediction unit 154 may include a motion estimation unit 154a and a motion compensation unit 154b. The motion estimation unit 154a obtains a motion vector value of a current area by referring to a specific area of ​​the reconstructed reference picture. The motion estimation unit 154a transmits a motion information set (reference picture index, motion vector information, etc.) for the reference area to the entropy coding unit 160. The motion compensation unit 154 b performs motion compensation by using the motion vector value transferred from the motion estimation unit 154 a . The inter prediction unit 154 transmits inter encoding information including motion information about the reference region to the entropy coding unit 160 .

[0083] According to another embodiment, the prediction unit 150 may include an intra block copy (BC) prediction unit (not shown). The intra BC prediction unit performs intra BC prediction based on the reconstructed samples in the current picture and transmits intra BC coding information to the entropy coding unit 160. The intra BC prediction unit refers to a specific area in the current picture and obtains a block vector value indicating a reference area for predicting the current area. The intra BC prediction unit may perform intra BC prediction using the obtained block vector value. The intra BC prediction unit transmits the intra BC coding information to the entropy coding unit 160. The intra BC coding information may include block vector information.

[0084] When performing the above-mentioned picture prediction, the transform unit 110 transforms the residual value between the original picture and the predicted picture to obtain a transform coefficient value. In this case, the transform can be performed in units of a specific block within the picture, and the size of the specific block can be changed within a preset range. The quantization unit 115 quantizes the transform coefficient value generated in the transform unit 110 and sends it to the entropy coding unit 160.

[0085] The entropy coding unit 160 performs entropy coding on information indicating quantized transform coefficients, intra-frame coding information, inter-frame coding information, etc. to generate a video signal bit stream. In the entropy coding unit 160, a variable length coding (VLC) scheme, an arithmetic coding scheme, etc. can be used. The variable length coding (VLC) scheme includes transforming input symbols into continuous codewords, and the length of the codeword can be variable. For example, frequently occurring symbols are represented by short codewords, while symbols that rarely occur are represented by long codewords. A context-based adaptive variable length coding (CAVLC) scheme can be used as a variable length coding scheme. Arithmetic coding can transform continuous data symbols into a single prime number, wherein arithmetic coding can obtain the best bit required to represent each symbol. Context-based adaptive binary arithmetic coding (CABAC) can be used as arithmetic coding. For example, the entropy coding unit 160 can binarize the information indicating the quantized transform coefficients. The entropy coding unit 160 can generate a bit stream by arithmetic coding binary information.

[0086] The generated bitstream is encapsulated using a network abstraction layer (NAL) unit as a basic unit. A NAL unit includes an integer number of coded coding tree units. In order to decode the bitstream in a video decoder, first, the bitstream must be separated into NAL units, and then each separated NAL unit must be decoded. At the same time, the information required to decode the video signal bitstream can be sent through a raw byte sequence payload (RBSP) of a high-level set such as a picture parameter set (PPS), a sequence parameter set (SPS), a video parameter set (VPS), etc.

[0087] at the same time, Figure 1 The block diagram of the encoding device 100 according to an embodiment of the present invention is shown, and the blocks shown separately logically distinguish and show the elements of the encoding device 100. Therefore, the elements of the encoding device 100 described above may be installed as one chip or multiple chips depending on the design of the device. According to an embodiment, the operation of each element of the encoding device 100 described above may be performed by a processor (not shown).

[0088] Figure 2 2 is a schematic block diagram of a video signal decoding apparatus 200 according to an embodiment of the present invention. Figure 2 The decoding device 200 of the present invention includes an entropy decoding unit 210, an inverse quantization unit 220, an inverse transform unit 225, a filtering unit 230 and a prediction unit 250.

[0089] The entropy decoding unit 210 performs entropy decoding on the video signal bit stream to extract transform coefficient information, intra-frame coding information, inter-frame coding information, etc. for each region. For example, the entropy decoding unit 210 can obtain a binary code for transform coefficient information for a specific region from the video signal bit stream. The entropy decoding unit 210 obtains a quantized transform coefficient by inversely binarizing the binary code. The inverse quantization unit 220 inversely quantizes the quantized transform coefficient, and the inverse transform unit 225 reconstructs a residual value by using the inversely quantized transform coefficient. The video signal processing device 200 reconstructs the original pixel value by adding the residual value obtained by the inverse transform unit 225 to the predicted value obtained by the prediction unit 250.

[0090] At the same time, the filtering unit 230 performs filtering on the picture to improve the image quality. This may include a deblocking filter for reducing block distortion and / or an adaptive loop filter for removing distortion of the entire picture. The filtered picture is output or stored in the DPB 256 to be used as a reference picture for the next picture.

[0091] The prediction unit 250 includes an intra prediction unit 252 and an inter prediction unit 254. The prediction unit 250 generates a predicted picture by using the encoding type, the transform coefficient of each region, and the intra / inter encoding information decoded by the above-mentioned entropy decoding unit 210. In order to reconstruct the current block in which decoding is performed, the decoded region of the current picture or other pictures including the current block may be used. In reconstruction, only the current picture, that is, the picture (or tile / slice) in which only intra prediction or intra BC prediction is performed is referred to as an intra picture or an I picture (or tile / slice), and the picture (or tile / slice) in which all intra prediction, inter prediction, and intra BC prediction can be performed is referred to as an inter picture (or tile / slice). In order to predict the sample values ​​of each block in an inter-frame picture (or tile / slice), a picture (or tile / slice) using up to one motion vector and a reference picture index is called a predicted picture or a P picture (or tile / slice), and a picture (or tile / slice) using up to two motion vectors and a reference picture index is called a bidirectional predicted picture or a B picture (or tile / slice). In other words, a P picture (or tile / slice) uses up to one motion information set to predict each block, and a B picture (or tile / slice) uses up to two motion information sets to predict each block. Here, a motion information set includes one or more motion vectors and a reference picture index.

[0092] The intra prediction unit 252 generates a prediction block using the intra coding information and the reconstructed samples in the current picture. As described above, the intra coding information may include at least one of an intra prediction mode, a most probable mode (MPM) flag, and an MPM index. The intra prediction unit 252 predicts the sample value of the current block by using the reconstructed samples located to the left and / or above the current block as reference samples. In the present disclosure, the reconstructed samples, the reference samples, and the samples of the current block may represent pixels. Moreover, the sample value may represent a pixel value.

[0093] According to an embodiment, the reference sample may be a sample included in a neighboring block of the current block. For example, the reference sample may be a sample adjacent to the left boundary of the current block and / or the sample may be a sample adjacent to the upper boundary. Moreover, the reference sample may be a sample located on a line within a predetermined distance from the left boundary of the current block and / or a sample located on a line within a predetermined distance from the upper boundary of the current block among the samples of the neighboring blocks of the current block. In this case, the neighboring blocks of the current block may include a left (L) block, an upper (a) block, a lower left (BL) block, an upper right (AR) block, or an upper left (AL) block.

[0094] The inter prediction unit 254 generates a prediction block using the reference picture and inter coding information stored in the DPB 256. The inter coding information may include a motion information set (reference picture index, motion vector information, etc.) for the current block of the reference block. Inter prediction may include L0 prediction, L1 prediction, and bidirectional prediction. L0 prediction means prediction using one reference picture included in the L0 picture list, and L1 prediction means prediction using one reference picture included in the L1 picture list. To this end, a motion information set (e.g., motion vector and reference picture index) may be required. In the bidirectional prediction method, up to two reference areas may be used, and the two reference areas may exist in the same reference picture or may exist in different pictures. That is, in the bidirectional prediction method, up to two motion information sets (e.g., motion vector and reference picture index) may be used, and the two motion vectors may correspond to the same reference picture index or different reference picture indexes. In this case, in terms of time, the reference picture may be displayed (or output) before and after the current picture. According to an embodiment, the two reference areas used in the bidirectional prediction scheme may be areas selected from the picture list L0 and the picture list L1, respectively.

[0095] The inter-frame prediction unit 254 can use the motion vector and the reference picture index to obtain the reference block of the current block. The reference block is in the reference picture corresponding to the reference picture index. Moreover, the sample value of the block specified by the motion vector or its interpolated value can be used as a predictor of the current block. For motion prediction with sub-pel unit pixel accuracy, for example, an 8-tap interpolation filter for luminance signal and a 4-tap interpolation filter for chrominance signal can be used. However, the interpolation filter for motion prediction in sub-pixel units is not limited to this. In this way, the inter-frame prediction unit 254 performs motion compensation to predict the texture of the current unit based on the motion picture previously reconstructed using motion information. In such a case, the inter-frame prediction unit can use a motion information set.

[0096] According to another embodiment, the prediction unit 250 may include an intra BC prediction unit (not shown). The intra BC prediction unit may reconstruct the current region by referring to a specific region in which the reconstructed sample is included in the current picture. The intra BC prediction unit obtains intra BC encoding information of the current region from the entropy decoding unit 210. The intra BC prediction unit obtains a block vector value of the current region indicating the specific region in the current picture. The intra BC prediction unit may perform intra BC prediction by using the obtained block vector value. The intra BC encoding information may include block vector information.

[0097] The reconstructed video picture is generated by adding the prediction value output from the intra prediction unit 252 or the inter prediction unit 254 to the residual value output from the inverse transform unit 225. That is, the video signal decoding apparatus 200 reconstructs the current block using the prediction block generated by the prediction unit 250 and the residual obtained from the inverse transform unit 225.

[0098] at the same time, Figure 2 The block diagram of the decoding device 200 according to an embodiment of the present invention is shown, and the blocks shown separately logically distinguish and show the elements of the decoding device 200. Therefore, the elements of the above-mentioned decoding device 200 may be installed as one chip or multiple chips depending on the design of the device. According to the embodiment, the operation of each element of the above-mentioned decoding device 200 may be performed by a processor (not shown).

[0099] Figure 3An embodiment in which a coding tree unit (CTU) is partitioned into coding units (CU) in a picture is illustrated. In the encoding process of a video signal, a picture may be partitioned into a series of coding tree units (CTUs). A coding tree unit consists of an N×N block of luminance samples and two blocks of chrominance samples corresponding thereto. A coding tree unit may be partitioned into a plurality of coding units. A coding tree unit may not be partitioned and may be a leaf node. In this case, the coding tree unit itself may be a coding unit. A coding unit refers to a basic unit for processing a picture in the processing of the above-mentioned video signal, i.e., intra / inter prediction, transform, quantization and / or entropy coding. The size and shape of a coding unit in a picture may not be constant. A coding unit may have a square or rectangular shape. A rectangular coding unit (or rectangular block) includes a vertical coding unit (or vertical block) and a horizontal coding unit (or horizontal block). In this specification, a vertical block is a block whose height is greater than its width, and a horizontal block is a block whose width is greater than its height. In addition, in this specification, a non-square block may refer to a rectangular block, but the present disclosure is not limited thereto.

[0100] refer to Figure 3 , firstly, the compilation tree unit is split into a quadtree (QT) structure. That is, a node having a size of 2NX2N in the quadtree structure can be split into four nodes having a size of NXN. In this specification, a quadtree may also be referred to as a quadtree. Quadtree splitting may be performed recursively, and not all nodes need to be split at the same depth.

[0101] At the same time, the leaf nodes of the above-mentioned quadtree can be further divided into a multi-type tree (MTT) structure. According to an embodiment of the present invention, in a multi-type tree structure, a node can be divided into a binary or ternary tree structure divided horizontally or vertically. That is, in a multi-type tree structure, there are four segmentation structures, such as vertical binary segmentation, horizontal binary segmentation, vertical ternary segmentation and horizontal ternary segmentation. According to an embodiment of the present invention, in each tree structure, the width and height of the node can have a power of 2. For example, in a binary tree (BT) structure, a node of 2NX2N size can be divided into two NX2N nodes by vertical binary segmentation, and divided into two 2NXN nodes by horizontal binary segmentation. In addition, in a ternary tree (TT) structure, a node of 2NX2N size is divided into (N / 2)X2N, NX2N and (N / 2)X2N nodes by vertical ternary segmentation, and is divided into 2NX(N / 2), 2NXN and 2NX(N / 2) nodes by horizontal binary segmentation. This multi-type tree splitting can be performed recursively.

[0102] The leaf nodes of the multi-type tree can be coding units. If the partitioning for the coding unit is not indicated or the coding unit is not large for the maximum transform length, the coding unit is used as a unit of prediction and transformation without further division. On the other hand, at least one of the following parameters in the above-mentioned quadtree and multi-type tree can be predefined or sent through the RBSP of the high-level set such as PPS, SPS, VPS, etc. 1) CTU size: the root node size of the quadtree, 2) Minimum QT size MinQtSize: the minimum allowed QT leaf node size, 3) Maximum BT size MaxBtSize: the maximum allowed BT root node size, 4) Maximum TT size MaxTtSize: the maximum allowed TT root node size, 5) Maximum MTT depth MaxMttDepth: the maximum allowed depth of the MTT partitioned from the leaf node of the QT, 6) Minimum BT size MinBtSize: the minimum allowed BT leaf node size, 7) Minimum TT size MinTtSize: the minimum allowed TT leaf node size.

[0103] Figure 4 An embodiment of a method for signaling the partitioning of a quadtree and a multi-type tree is shown. Preset flags may be used to signal the partitioning of the quadtree and the multi-type tree. Figure 4 , at least one of the flag “qt_split_flag” indicating whether to split a quadtree node, the flag “mtt_split_flag” indicating whether to split a multi-type tree node, the flag “mtt_split_vertical_flag” indicating the split direction of the multi-type tree node, or the flag “mtt_split_binary_flag” indicating the split type of the multi-type tree node may be used.

[0104] According to an embodiment of the present invention, the coding tree unit is the root node of the quadtree and can be first split into a quadtree structure. In the quadtree structure, a signal "qt_split_flag" is sent for each node "QT_node". If the value of "qt_split_flag" is 1, the node is split into 4 square nodes, and if the value of "qt_split_flag" is 0, the corresponding node becomes a leaf node "QT_leaf_node" of the quadtree.

[0105] Each quad leaf node "QT_leaf_node" can be further split into a multi-type tree structure. In the multi-type tree structure, "mtt_split_flag" is signaled for each node "MTT_node". When the value of "mtt_split_flag" is 1, the corresponding node is split into multiple rectangular nodes, and when the value of "mtt_split_flag" is 0, the corresponding node is a leaf node "MTT_leaf_node" of the multi-type tree. When the multi-type tree node "MTT_node" is split into multiple rectangular nodes (that is, when the value of "mtt_split_flag" is 1), the "mtt_split_vertical_flag" and "mtt_split_binary_flag" of the node "MTT_node" can be additionally signaled. When the value of "mtt_split_vertical_flag" is 1, it indicates the vertical division of the node "MTT_node", and when the value of "mtt_split_vertical_flag" is 0, it indicates the horizontal division of the node "MTT_node". In addition, when the value of "mtt_split_binary_flag" is 1, the node "MTT_node" is divided into 2 rectangular nodes, and when the value of "mtt_split_binary_flag" is 0, the node "MTT_node" is divided into 3 rectangular nodes.

[0106] Picture prediction (motion compensation) for encoding is performed on a coding unit that is no longer divided (ie, a leaf node of a coding unit tree). Hereinafter, a basic unit for performing prediction will be referred to as a "prediction unit" or a "prediction block".

[0107] Hereinafter, the term "unit" used herein may replace a prediction unit, which is a basic unit for performing prediction. However, the present disclosure is not limited thereto, and the "unit" may be understood as broadly covering the concept of a coding unit.

[0108] Figure 5 and Figure 6 The intra prediction method according to an embodiment of the present invention is illustrated in more detail. As described above, the intra prediction unit predicts sample values ​​of the current block by using reconstructed samples located on the left and / or above the current block as reference samples.

[0109] first, Figure 5 An embodiment of a reference sample used for prediction of a current block in an intra prediction mode is shown. According to an embodiment, the reference sample may be a sample adjacent to the left boundary of the current block and / or a sample adjacent to the upper boundary. Figure 5As shown in , when the size of the current block is WXH and samples of a single reference line adjacent to the current block are used for intra prediction, a maximum of 2W+2H+1 adjacent samples located on the left and top of the current block can be used to configure reference samples.

[0110] When at least some samples to be used as reference samples have not been reconstructed, the intra prediction unit may obtain reference samples by performing a reference sample filling process. The intra prediction unit may perform a reference sample filtering process to reduce errors in intra prediction. That is, filtering may be performed on adjacent samples and / or reference samples obtained by the reference sample filling process to obtain filtered reference samples. The intra prediction unit predicts samples of the current block by using the reference samples obtained as above. The intra prediction unit predicts samples of the current block by using unfiltered reference samples or filtered reference samples. In the present disclosure, adjacent samples may include samples on at least one reference line. For example, adjacent samples may include adjacent samples on a line adjacent to a boundary of the current block.

[0111] Next, Figure 6 An embodiment of a prediction mode for intra prediction is shown. For intra prediction, intra prediction mode information indicating an intra prediction direction may be signaled. The intra prediction mode information indicates one of a plurality of intra prediction modes included in an intra prediction mode set. When a current block is an intra prediction block, a decoder receives the intra prediction mode information of the current block from a bitstream. An intra prediction unit of the decoder performs intra prediction on the current block based on the extracted intra prediction mode information.

[0112] According to an embodiment of the present disclosure, the intra-frame prediction mode set may include all intra-frame prediction modes used in intra-frame prediction (e.g., a total of 67 intra-frame prediction modes). More specifically, the intra-frame prediction mode set may include a plane mode, a DC mode, and a plurality of (e.g., 65) angle modes (i.e., directional modes). Each intra-frame prediction mode may be indicated by a preset index (i.e., an intra-frame prediction mode index). For example, Figure 6As shown, intra-frame prediction mode index 0 indicates plane mode, and intra-frame prediction mode index 1 indicates DC mode. In addition, intra-frame prediction mode indexes 2 to 66 may indicate different angle modes, respectively. The angle modes respectively indicate angles that are different from each other within a preset angle range. For example, the angle mode may indicate an angle within an angle range (i.e., a first angle range) between 45 degrees and -135 degrees in a clockwise direction. The angle mode may be defined based on the 12 o'clock direction. In this case, intra-frame prediction mode index 2 indicates a horizontal diagonal (HDIA) mode, intra-frame prediction mode index 18 indicates a horizontal (horizontal, HOR) mode, intra-frame prediction mode index 34 indicates a diagonal (DIA) mode, intra-frame prediction mode index 50 indicates a vertical (VER) mode, and intra-frame prediction mode index 66 indicates a vertical diagonal (VDIA) mode.

[0113] Meanwhile, the preset angle range may be set differently according to the shape of the current block. For example, when the current block is a rectangular block, a wide angle mode indicating an angle greater than 45 degrees or less than -135 degrees in the clockwise direction may be additionally used. When the current block is a horizontal block, the angle mode may indicate an angle within an angle range (i.e., a second angle range) between (45+offset1) degrees and (-135+offset1) degrees clockwise. In this case, angle modes 67 to 76 outside the first angle range may be additionally used. In addition, when the current block is a vertical block, the angle mode may indicate an angle within an angle range (i.e., a third angle range) between (45-offset2) degrees and (-135-offset 2) degrees clockwise. In this case, angle modes -10 to -1 outside the first angle range may be additionally used. According to an embodiment of the present invention, the values ​​of offset1 and offset2 may be determined differently according to the ratio between the width and height of the rectangular block. In addition, offset1 and offset2 may be positive numbers.

[0114] According to another embodiment of the present invention, the plurality of angle modes included in the intra prediction mode set may include a basic angle mode and an extended angle mode. In this case, the extended angle mode may be determined based on the basic angle mode.

[0115] According to an embodiment, the basic angle mode is a mode corresponding to the angle used in the intra-frame prediction of the existing high-efficiency video coding (HEVC) standard, and the extended angle mode may be a mode corresponding to the newly added angle in the intra-frame prediction of the next-generation video codec standard. More specifically, the basic angle mode is an angle mode corresponding to any one of the intra-frame prediction modes {2, 4, 6, ..., 66}, and the extended angle mode is an angle mode corresponding to any one of the intra-frame prediction modes {3, 5, 7, ..., 65}. That is, the extended angle mode may be an angle mode between the basic angle modes within the first angle range. Therefore, the angle indicated by the extended angle mode may be determined based on the angle indicated by the basic angle mode.

[0116] According to another embodiment, the basic angle mode may be a mode corresponding to an angle within a preset first angle range, and the extended angle mode may be a wide angle mode outside the first angle range. That is, the basic angle mode is an angle mode corresponding to any one of the intra prediction modes {2, 3, 4, ..., 66}, and the extended angle mode is an angle mode corresponding to any one of the intra prediction modes among {-10, -9, ..., -1} and {67, 68, ..., 76}. The angle indicated by the extended angle mode may be determined as an angle opposite to the angle indicated by the corresponding basic angle mode. Therefore, the angle indicated by the extended angle mode may be determined based on the angle indicated by the basic angle mode. Meanwhile, the number of extended angle modes is not limited thereto, and additional extended angles may be defined according to the size and / or shape of the current block. For example, the extended angle mode may be defined as an angle mode corresponding to any one of the intra prediction modes {-14, -13, ..., -1} and {67, 68, ..., 80}. Meanwhile, the total number of intra prediction modes included in the intra prediction mode set may vary according to the configuration of the above-mentioned basic angle mode and extended angle mode.

[0117] In the above embodiment, the intervals between the extended angle modes can be set based on the intervals between the corresponding basic angle modes. For example, the intervals between the extended angle modes {3,5,7,…,65} can be determined based on the intervals between the corresponding basic angle modes {2,4,6,…,66}. For example, the intervals between the extended angle modes {-10,-9,…,-1} can be determined based on the intervals between the corresponding opposite side basic angle modes {56,57,…,65}, and the intervals between the extended angle modes {67,68,…,76} can be determined based on the intervals between the corresponding opposite side basic angle modes {3,4,…,12}. The angular intervals between the extended angle modes can be configured to be the same as the angular intervals between the corresponding basic angle modes. In addition, the number of extended angle modes in the intra-frame prediction mode set can be configured to be less than or equal to the number of basic angle modes.

[0118] According to an embodiment of the present invention, an extended angle mode may be signaled based on a basic angle mode. For example, a wide angle mode (i.e., an extended angle mode) may replace at least one angle mode (i.e., a basic angle mode) within a first angle range. The replaced basic angle mode may be an angle mode corresponding to the opposite side of the wide angle mode. That is, the replaced basic angle mode is an angle mode corresponding to an angle in the opposite direction of the angle represented by the wide angle mode or an angle mode corresponding to an angle in the opposite direction that differs by a preset offset index. According to an embodiment of the present invention, the preset offset index is 1. The intra-frame prediction mode index corresponding to the replaced basic angle mode may be mapped back to the wide angle mode to signal the wide angle mode. For example, a wide angle mode {-10, -9, ..., -1} may be signaled by an intra-frame prediction mode index {57, 58, ..., 66}, and a wide angle mode {67, 68, ..., 76} may be signaled by an intra-frame prediction mode index {2, 3, ..., 11}. In this way, since the intra-frame prediction mode index for the basic angle mode signals the extended angle mode, even if the configuration of the angle mode for intra-frame prediction of each block is different, the same set of intra-frame prediction mode indexes can be used to signal the intra-frame prediction mode. Therefore, the signaling overhead caused by the change of the intra-frame prediction mode configuration can be minimized.

[0119] Meanwhile, whether to use the extended angle mode may be determined based on at least one of the shape and size of the current block. According to an embodiment, when the size of the current block is greater than a preset size, the extended angle mode may be used for intra prediction of the current block, otherwise, only the basic angle mode may be used for intra prediction of the current block. According to another embodiment, when the current block is a block other than a square, the extended angle mode may be used for intra prediction of the current block, and when the current block is a square block, only the basic angle mode may be used for intra prediction of the current block.

[0120] In the following, reference Figure 7 An inter-frame prediction method according to an embodiment of the present disclosure is described. In the present disclosure, the inter-frame prediction method may include a general inter-frame prediction method optimized for translational motion and an inter-frame prediction method based on an affine model. In addition, the motion vector may include at least one of a general motion vector for motion compensation according to the general inter-frame prediction method and a control point motion vector for affine compensation.

[0121] Figure 7 The inter-frame prediction method according to an embodiment of the present disclosure is illustrated. As described above, the decoder can refer to the reconstructed samples of another decoded picture to predict the current block. Figure 7, the decoder obtains a reference block 702 within a reference picture 720 based on a motion information set of a current block 701. In this case, the motion information set may include a reference picture index and a motion vector. The reference picture index indicates a reference picture 720 including a reference block for inter prediction of the current block in a reference picture list. According to an embodiment, the reference picture list may include at least one of an L0 picture list or an L1 picture list. The motion vector indicates an offset between a coordinate value of the current block 701 within the current picture 710 and a coordinate value of the reference block 702 within the reference picture 720. The decoder obtains a predictor of the current block 701 based on a sample value of the reference block 702, and reconstructs the current block 701 using the predictor.

[0122] Specifically, the encoder can obtain a reference block by searching for a block similar to the current block in a picture with a higher recovery order. For example, the encoder can search for a reference block having a minimum sum of sample value differences with the current block within a preset search area. In this case, in order to measure the similarity between the samples of the current block and the reference block, at least one of the sum of absolute differences (SAD) and the sum of Hadamard transform differences (SATD) can be used. Here, SAD can be a value obtained by adding all absolute values ​​of the difference between the sample values ​​included in the two blocks. In addition, SATD can be a value obtained by adding all absolute values ​​of Hadamard transform coefficients obtained by Hadamard transforming the difference between the sample values ​​included in the two blocks.

[0123] At the same time, one or more reference areas may be used to predict the current block. As described above, two or more reference areas may be used to perform inter-frame prediction on the current block by a paired prediction method. According to an embodiment, the decoder may obtain two reference blocks based on two motion information sets of the current block. In addition, the decoder may obtain a first predictor and a second predictor of the current block based on sample values ​​of the two obtained reference blocks. In addition, the decoder may reconstruct the current block using the first predictor and the second predictor. For example, the decoder may reconstruct the current block based on the average value of each sample of the first predictor and the second predictor.

[0124] As described above, for motion compensation of the current block, one or more motion information sets may be signaled. In this case, similarities between motion information sets used for motion compensation of each of the multiple blocks may be used. For example, the motion information set used to predict the current block may be derived from a motion information set used to predict one of the other reconstructed samples. To this end, the encoder and decoder may reduce signaling overhead.

[0125] For example, there may be multiple candidate blocks that are likely to be predicted based on a motion information set that is the same as or similar to the motion information set of the current block. The decoder can generate a merge candidate list based on the multiple candidate blocks. Here, the merge candidate list may include candidates corresponding to samples that are likely to have been predicted based on a motion information set related to the motion information set of the current block among samples reconstructed earlier than the current block. The encoder and the decoder can configure the merge candidate list of the current block according to a predetermined rule. Here, the merge candidate lists configured by the encoder and the decoder, respectively, can be the same. For example, the encoder and the decoder can configure the merge candidate list of the current block based on the position of the current block in the current picture. This will be referred to later. Fig. 9 A method for an encoder and a decoder to configure a merge candidate list of a current block is described. In the present disclosure, the position of a specific block indicates a relative position of an upper left sample of the specific block in a picture including the specific block.

[0126] At the same time, in order to improve the coding efficiency, a method of quantizing the transform coefficient value obtained by transforming the residual signal can be used, and the quantized transform coefficient is used instead of coding the above-mentioned residual as it is. As described above, the transform unit can obtain the transform coefficient value by transforming the residual signal. In this case, the residual signal of a specific block can be distributed over the entire area of ​​the current block. Therefore, the energy can be concentrated in the low-frequency area by frequency domain conversion of the residual signal, thereby improving the coding efficiency. In the following, the method of transforming or inverse transforming the residual signal will be described in detail.

[0127] Figure 8 is a diagram specifically illustrating a method for transforming a residual signal by an encoder. As described above, the residual signal in the spatial domain can be transformed into the frequency domain. The encoder can obtain a transform coefficient by transforming the obtained residual signal. First, the encoder can obtain at least one residual block including a residual signal for a current block. The residual block can be a current block or one of the blocks divided from the current block. In the present disclosure, the residual block can be referred to as a residual array or a residual matrix, which includes residual samples of the current block. In the present disclosure, the residual block can represent a transform unit or a block having the same size as a transform block.

[0128] Next, the encoder can transform the residual block by using a transform kernel. The transform kernel used to transform the residual block can be a transform kernel having separable characteristics of vertical transform and horizontal transform. In this case, the transform for the residual block can be performed as a vertical transform and a horizontal transform respectively. For example, the encoder can perform a vertical transform by applying a transform kernel in the vertical direction of the residual block. The encoder can perform a horizontal transform by applying a transform kernel in the horizontal direction of the residual block. In the present disclosure, a transform kernel can be used as a term referring to a parameter set for a transform of a residual signal, such as a transform matrix\transform array, a transform function, and a transform. According to an embodiment, the transform kernel can be any one of a plurality of available kernels. Transform kernels based on different transform types can be used for each of a vertical transform and a horizontal transform.

[0129] The encoder may pass the transform block transformed from the residual block to the quantization unit and quantize the transform block. The transform block may include a plurality of transform coefficients. Specifically, the transform block may include a plurality of transform coefficients arranged in two dimensions. As in the case of the residual block, the size of the transform block may be the same as the size of the current block or the block divided from the current block. The transform coefficients passed to the quantization unit may be represented as quantized values.

[0130] The encoder may perform other transforms before quantizing the transform coefficients. Figure 8 As shown, the above-mentioned transform method may be referred to as a primary transform, and other transforms may be referred to as secondary transforms. For each residual block, a secondary transform is optional. According to an embodiment, the encoder may improve coding efficiency by performing a secondary transform on an area where it is difficult to concentrate energy in a low-frequency area only through a primary transform. For example, a secondary transform may be added to a block where the residual value appears larger in directions other than the horizontal and vertical directions of the residual value. Compared with the residual value of the inter-frame prediction block, the residual value of the intra-frame prediction block has a higher transform probability in directions other than the horizontal or vertical direction. Therefore, the encoder may additionally perform a secondary transform on the residual signal of the intra-frame prediction block. The encoder may omit the secondary transform of the residual signal for the inter-frame prediction block.

[0131] As another example, it can be determined whether to perform the second transform according to the size of the current block or the residual block. In addition, depending on the size of the current block or the residual block, transform kernels with different sizes can be used. For example, an 8X8 second transform can be applied to a block whose shorter of width and height is greater than or equal to a predetermined first length. In addition, a 4X4 second transform can be applied to a block whose shorter of width and height is greater than or equal to a predetermined first length and less than a predetermined second length. In this case, the predetermined first length may be greater than the predetermined second length, but the present disclosure is not limited to this. In addition, unlike the first transform, the second transform can be performed without dividing the second transform into a vertical transform and a horizontal transform. The second transform may be referred to as a "low-frequency non-separable transform (LFNST)".

[0132] In the case of a video signal in a specific area, even if a frequency transform is performed due to a sudden change in brightness, the energy in the high frequency band is not reduced. Therefore, the compression performance due to quantization may be degraded. When a transform is performed on an area where residual values ​​rarely exist, the encoding time and decoding time may be unnecessarily increased. Therefore, the transform of the residual signal of a specific area can be omitted. Whether to perform a transform on the residual signal of a specific area can be determined by a syntax element related to the transform of the specific area. For example, the syntax element may include transform skip information. The transform skip information may be a transform skip flag. If the transform skip information about the residual block indicates a transform skip, the transform of the residual block is not performed. In this case, the encoder may immediately quantize the residual signal on which the transform of the corresponding area is not performed. It can be determined via Figure 1 The transformation unit performs the reference Figure 8 Describes the operation of the encoder.

[0133] The above-mentioned transform-related syntax elements may be information parsed from a video signal bitstream. The decoder may perform entropy decoding on the video signal bitstream to obtain the transform-related syntax elements. The encoder may perform entropy coding on the transform-related syntax elements to generate a video signal bitstream.

[0134] Fig. 9It is a diagram specifically illustrating a method for obtaining a residual signal by inversely transforming a transform coefficient through an encoder and a decoder. For ease of description, the inverse transform operation performed by an inverse transform unit of each of the encoder and the decoder will be described. The inverse transform unit can obtain a residual signal by inversely transforming the inverse quantized transform coefficient. First, the inverse transform unit can detect whether to perform an inverse transform on a specific region from the transform-related syntax element of the region. According to an embodiment, when the transform-related syntax element for a specific transform block indicates a transform skip, the transform of the transform block can be omitted. In this case, the above-mentioned main inverse transform and secondary inverse transform for the transform block can be omitted. The inverse quantized transform coefficient can be used as a residual signal. For example, the decoder can reconstruct the current block by using the inverse quantized transform coefficient as a residual signal.

[0135] According to another embodiment, the transform-related syntax element for a particular transform block may not indicate transform skipping. In this case, the inverse transform unit may determine whether to perform a secondary inverse transform on the secondary transform. For example, when the transform block is a transform block of an intra-frame prediction block, a secondary inverse transform may be performed on the transform block. The secondary transform kernel for the transform block may be determined based on the intra-frame prediction mode corresponding to the transform block. As another example, it may be determined whether to perform a secondary inverse transform based on the size of the transform block. The secondary inverse transform may be performed after inverse quantization and before the primary inverse transform.

[0136] The inverse transform unit may perform a main inverse transform on the inverse quantized transform coefficient or the transform coefficient of the secondary inverse transform. In the case of the main inverse transform, as in the case of the main transform, the vertical transform and the horizontal transform may be performed separately. For example, the inverse transform unit may obtain a residual block by performing a vertical inverse transform and a horizontal inverse transform on the transform block. The inverse transform unit may inverse transform the transform block based on the transform kernel used to transform the transform block. For example, the encoder may explicitly or implicitly signal information indicating a transform kernel applied to the current transform block from a plurality of available transform kernels. The decoder may select a transform kernel to be used for the inverse transform of the transform block from a plurality of available transform kernels using the information of the transform kernel informed by the indication signal. The inverse transform unit may reconstruct the current block by using a residual signal obtained by inverse transforming the transform coefficients.

[0137] At the same time, the distribution of the residual signal of the picture may vary depending on the region. For example, the distribution of the value of the residual signal in a specific region may be different depending on the prediction method. In the case where the same transform kernel is used to perform transforms on multiple different transform regions, the coding efficiency may be different in each transform region depending on the distribution and characteristics of the values ​​in the transform region. Therefore, if the transform kernel used in the transform of a specific transform block is adaptively selected from multiple available transform kernels, the coding efficiency can be further improved. That is, the encoder and the decoder can be configured to further use transform kernels other than the basic transform kernel in the transform of the video signal. The method of adaptively selecting the transform kernel may be referred to as "adaptive multi-core transform (AMT)" or "multi-transform selection (MTS)". The method of adaptively selecting the transform kernel will be described later with reference to the relevant drawings. In the present disclosure, for ease of description, transforms and inverse transforms are collectively referred to as "transforms". In addition, transform kernels and inverse transform kernels are collectively referred to as "transform kernels".

[0138] In the following, reference will be made to Fig.10 A plurality of transform kernels that can be used in the transformation of a video signal are described. According to an embodiment of the present disclosure, the transform kernel may be a kernel derived based on a specific basis function. A plurality of different transform kernels may be obtained based on basis functions that are different from each other. A plurality of transform kernels may be obtained based on basis functions that correspond to different transform types, respectively.

[0139] Fig.10 is a diagram showing basis functions corresponding to various transform types. According to an embodiment, a transform kernel that can be used for transforming a video residual signal may include at least one of a transform kernel based on discrete cosine transform type II (DCT-II), a transform kernel based on discrete cosine transform type V (DCT-V), a transform kernel based on discrete cosine transform type VIII (DCT-VIII), a transform kernel based on discrete sine transform type I (DST-I), and a transform kernel based on discrete sine transform type VII (DST-VII).

[0140] refer to Fig.10, the basis functions corresponding to the above-mentioned transform types DCT-II, DCT-V, DCT-VIII, DST-I and DST-VII can be represented as cosine or sine functions. For example, the basis function corresponding to each of DCT-II, DCT-V and DCT-VIII can be a cosine function, and the basis function corresponding to each of DST-I and DST-VII can be a sine function. In addition, the basis function corresponding to a specific transform type can be represented in the form of a basis function for each frequency bin. For example, the basis function Ti(j) can be the basis function corresponding to the i-th frequency bin. That is, the smaller the value "i", the lower the frequency corresponding to the basis function. In addition, the larger the value "i", the higher the frequency corresponding to the basis function. Fig.10 In the above example, “j” can represent an integer between 0 and N-1.

[0141] The basis function Ti(j) can be represented as a two-dimensional matrix indicating the jth element in the i-th row. In this case, based on Fig. 9 In the transformation type, the transformation using the transformation kernel can have a separable characteristic when performing the transformation. That is, the transformation of the residual signal can be performed separately in the horizontal direction and the vertical direction. For example, the transformation of the residual block X using the transformation matrix T can be expressed as a matrix calculation TXT'. Here, T' represents the transposed matrix of the transformation matrix T.

[0142] pass Fig.10 The values ​​of the transformation matrix calculated by the basis functions shown can be decimals instead of integers. In video encoding devices and decoding devices, it is difficult to implement decimal values ​​in hardware. Therefore, a transformation kernel approximated from an original transformation kernel including decimal values ​​to an integer can be used to encode and decode video signals. An approximate transformation kernel including integer values ​​can be generated by scaling and rounding the original transformation kernel. The integer value included in the approximate transformation kernel can be within the range that the value can be represented by a predetermined number of bits. The predetermined number of bits can be 8 bits or 10 bits. Depending on the approximate value, the orthogonal characteristics of DCT and DST may not be maintained. However, since the resulting loss of coding efficiency is not large, it may be advantageous to approximate the transformation kernel to an integer in terms of hardware implementation.

[0143] Fig.11 is a diagram showing the size of a signal for each index of transform types DCT-II, DCT-V, DCT-VIII, DST-I, and DST-VII. Fig.11 The form of the basis function corresponding to the lowest frequency interval among the basis functions for each frequency interval is shown. Fig.11 , among the basis functions for each frequency interval, the basis function corresponding to the 0th frequency interval is shown. Fig.11In the example, the horizontal axis represents the index j (j=0, 1, ..., N-1) in the basis function, and the vertical axis represents the magnitude of the signal. N represents the number of samples in the specific region to be transformed.

[0144] like Fig.11 As shown, as the index j increases, the size of the signal tends to increase in DST-VII. Therefore, like the residual block of the intra-frame prediction block, DST-VII may be effective for transforming the residual block in which the size of the residual signal increases as the distance from the upper left corner of the residual block increases in the horizontal and vertical directions.

[0145] On the other hand, when the index j increases, in DCT-VIII, the signal size tends to decrease. That is, DCT-VIII satisfies the duality characteristics with DST-VII. Therefore, DCT-VIII may be effective for transforming a residual block in which the size of the residual signal decreases as the distance from the upper left corner of the residual block increases in the horizontal and vertical directions.

[0146] In DST-1, the magnitude of the signal tends to increase as the index j of the basis function increases, and then starts to decrease at a certain index. Therefore, it may be effective for transforming a residual block having a large residual signal magnitude at its center.

[0147] The 0th basis function of DCT-II indicates DC. Therefore, it may be effective for transforming residual blocks having uniform distribution of signal magnitudes.

[0148] DCT-V is similar to DCT-II, but in DCT-V, the signal size when index j is 0 is smaller than the signal size when index j is not 0. That is, if index j is 1, the signal has a straight line curved form.

[0149] At the same time, when using a transform kernel with separable characteristics as described above, the transformation of the residual block can be performed in its horizontal and vertical directions. Specifically, the transformation of the residual block can be performed by two two-dimensional matrix product calculations. The matrix product calculation may involve a predetermined amount of calculation or more. Therefore, when the residual block is transformed using a transform kernel based on DCT-II, a butterfly structure or a combination of a half-butterfly structure and a half-matrix multiplier can be used to reduce the amount of calculation. However, due to its high implementation complexity, it may be difficult to implement DST-VII and DCT-VIII in terms of the amount of calculation. In addition, since the elements of the transform kernel (the matrix elements of the transform kernel) need to be stored in a memory for calculation, the memory capacity for storing the kernel matrix must also be considered in the implementation. Therefore, a transform type with similar characteristics to DST-VII and DCT-VIII and relatively low implementation complexity can be used.

[0150] According to an embodiment, discrete sine transform type IV (DST-IV) and discrete cosine transform type IV (DCT-IV) may replace DST-VII and DCT-VIII, respectively.

[0151] Fig.12 is a diagram showing the size of a signal for each index of transform types DST-IV, DCT-IV, DST-VII, and DCT-VIII. Fig.12 (a) shows the basis functions corresponding to DST-IV and the basis functions corresponding to DCT-IV. DST-IV and DCT-IV of the number of samples N can be derived from DCT-II of the number of samples 2N. That is, the partial butterfly structure of DCT-II of the number of samples 2N includes DCT-IV of the number of samples N. In addition, DST-IV of the number of samples N can be realized by performing a reverse compilation calculation of DCT-IV on the number of samples N and arranging the corresponding basis functions in reverse order.

[0152] like Fig.12 As shown in (b), DST-IV has a signal form similar to DST-VII. Therefore, like the residual block of the intra-frame prediction block, DST-IV may be effective for transforming the residual block in which the size of the residual signal increases as the distance from the upper left corner of the residual block increases in the horizontal and vertical directions. In addition, DCT-IV has a signal form similar to DCT-VIII. Therefore, DCT-IV may be effective for transforming the residual block in which the size of the residual signal is large in a specific boundary and the size of the residual signal decreases when the residual block moves from the corresponding boundary to another boundary.

[0153] In the case where only a transform kernel based on any of the above transform types is used for transforming a video signal, it is difficult to perform adaptive transform according to a pattern of a residual signal, which pattern varies according to the characteristics of an initial signal and a prediction mode. Therefore, an encoder and a decoder according to an embodiment of the present disclosure can improve coding efficiency by using a transform kernel selected for each region from among a plurality of available transform kernels in transforming a residual signal.

[0154] In the existing high-efficiency video coding (HEVC) standard, the residual signal is transformed using the DCT-II-based transform kernel in the above-mentioned transform type, and the transform is performed by limiting the DST-VII-based transform kernel to only intra-frame prediction 4X4 size blocks. As described above, DCT-II may be suitable for the transformation of the residual signal of the inter-frame predicted block, but may not be suitable for the transformation of the residual signal of the intra-frame predicted block. That is, the pattern of the residual signal in the residual block may vary depending on the method of predicting the current block.

[0155] Therefore, at least one selected from a plurality of available transform cores can be used for the transform of a specific transform block. According to an embodiment, the encoder and the decoder may select a transform core for at least one transform region of the current block based on a method for predicting the current block. This method may be referred to as the above-mentioned "adaptive multi-core transform (AMT)". If a transform core determined according to a prediction method for a specific region is used for the transform of the corresponding region, the coding efficiency may be improved compared to the case where a transform core based on DCT-II is used for all regions to perform the transform.

[0156] Fig.13 1 is a diagram illustrating a method for configuring a candidate transform set according to a prediction mode of a current block. According to an embodiment of the present disclosure, an encoder and a decoder may select a transform core for at least one transform region of a current block based on a candidate transform set corresponding to the current block. The candidate transform set may include a plurality of candidate transform cores. In addition, depending on the prediction mode of the current block, the candidate transform set may include candidate transform cores that are different from each other.

[0157] According to an embodiment, the current block may be a block predicted based on any one of a plurality of intra prediction modes. In this case, the pattern of the residual signal of the current block may be different depending on the intra prediction mode used for the prediction of the current block. As described above, the intra prediction mode information may indicate the intra prediction direction. Therefore, depending on the prediction direction indicated by the intra prediction mode information of the current block, the pattern of the residual signal of the current block may be different. Depending on the prediction direction, the encoder and the decoder may use a plurality of candidate transform sets that are different from each other to improve coding efficiency.

[0158] Therefore, the encoder and the decoder can determine the transform core to be used in the transform region of the current block from the candidate transform set corresponding to the intra prediction mode of the current block. For example, the transform core to be used in the transform region can be signaled by indicating a candidate index of any one of a plurality of candidate transform cores included in the candidate transform set. In the case where the candidate transform set corresponding to the intra prediction mode of the current block includes two candidate transform cores, the candidate index indicating the transform core used in the transform region can be represented as 1 bit.

[0159] In addition, different candidate transform sets can be used in the vertical direction and the horizontal direction of the transform region, respectively. Due to the characteristics of the intra-frame prediction method that performs prediction based on directionality, the vertical direction pattern of the residual signal in the prediction region may be different from its horizontal direction pattern. Therefore, the vertical transform kernel and the horizontal transform kernel of the block predicted using a specific intra-frame prediction mode can be obtained from separate candidate transform sets. In the present disclosure, the transform kernel used for the vertical transform in a specific transform region may be referred to as a "vertical transform kernel". In addition, the transform kernel used for the horizontal transform in a specific transform region may be referred to as a "horizontal transform kernel". Fig.13(a) shows the candidate transform sets corresponding to 67 intra prediction mode indices. Fig.13 In (a), "V" (vertical) indicates a candidate transform set for a vertical transform kernel. In addition, "H" (horizontal) indicates a candidate transform set for a horizontal transform kernel.

[0160] Fig.13 (b) shows the candidate transform kernels defined according to the candidate transform sets. According to an embodiment, the first candidate transform set (e.g., Fig.13 The transform set (2) in (b) may include candidate transform kernels based on DST-VII and candidate transform kernels based on DCT-VIII. Fig.13 The transform set 1) in (b) may include candidate transform cores based on DST-VII and candidate transform cores based on DST-I. The third candidate transform set (e.g., Fig.13 The transform set 2) of (b) may include candidate transform kernels based on DST-VII and candidate transform kernels based on DCT-V. Fig.13 It is shown that the candidate transform set includes two candidate transform cores, but the present disclosure is not limited thereto.

[0161] According to another embodiment, the current block may be an inter-frame prediction block. In this case, the transform kernel used in the transform region of the current block may be obtained from a predetermined candidate transform set. For example, the predetermined candidate transform set may be any one of the above-mentioned multiple candidate transform sets. Fig.13 (c) shows the candidate transform set corresponding to the current block when the current block is an inter-frame prediction block. For example, the predetermined candidate transform set corresponding to the inter-frame prediction block may include a candidate transform core based on DCT-VIII and a candidate transform core based on DST-VII. That is, the transform core used in the transform region of the inter-frame prediction block may be one of the candidate transform core based on DCT-VIII and the candidate transform core based on DST-VII.

[0162] According to additional embodiments, the above embodiments may be limitedly applied only to the transform block of the luminance component. In this case, a predetermined basic transform kernel may be used for the transform block of the chrominance component. For example, the basic transform kernel may be a transform kernel based on DCT-II.

[0163] According to additional embodiments, depending on the number of non-zero transform coefficients in the transform region, the encoder may not signal the candidate index. In this case, the decoder may determine the transform kernel by comparing the number of non-zero transform coefficients in the transform region with a predetermined number. For example, if the number of non-zero transform coefficients is 1 or 2, the candidate index may not be signaled. In this case, the inverse transform unit may use a predetermined transform kernel for the corresponding region to perform the transform. The predetermined transform kernel may be a transform kernel based on DST-VII.

[0164] According to an additional embodiment, MTS may be applied only to the luminance component, while DCT-II transform (such as HEVC) may be used for chrominance components. As an embodiment, on / off may be represented by a 1-bit flag to control the MTS in the coding unit, and if the flag indicates off, DCT-II as the basic core may be used as the chrominance component. On the other hand, if the flag indicates on, a signal may be sent to inform the transform candidate index used in a predetermined transform set according to the prediction mode, and the decoder may perform an inverse transform by applying a transform core corresponding to the index. Because different transforms can be applied in the horizontal and vertical directions, it may be indicated to use a total of 2 bits of transform index with 1 bit for each direction. Alternatively, a truncated unary binarization method may be used to indicate a transform index. For example, where two cores of DST-VII and DCT-VIII are available, four transform core combinations applicable to the current block may be defined and may be signaled as follows.

[0165] {Horizontal: DST-VII, Vertical: DST-VII}, 0

[0166] {Horizontal: DCT-VIII, Vertical: DST-VII}, 10

[0167] {Horizontal: DST-VII, Vertical: DCT-VIII}, 110

[0168] {Horizontal: DCT-VIII, Vertical: DCT-VIII}, 111

[0169] According to an embodiment of the present disclosure, due to the high statistical probability of selecting the combination {horizontal: DST-VII, vertical: DST-VII} in MTS, it is expected that the coding efficiency can be improved when the transform kernel is signaled by the above-mentioned truncated unary binarization method, compared with the case where a fixed-length 2-bit signal is used to signal the transform kernel.

[0170] Fig.14A horizontal transform core and a vertical transform core determined depending on a set index are shown. According to an embodiment of the present disclosure, information indicating a transform core for a residual signal in a specific region among a plurality of available transform cores may be signaled. In this case, information indicating any one of a plurality of available transform cores may be signaled regardless of a prediction mode corresponding to the corresponding region. For example, an encoder may signal transform core information indicating a transform core for a residual signal in a specific region. The decoder may use the signaled transform core information to obtain a transform core for the corresponding region. In this case, the transform core information may include at least one of information indicating a horizontal transform core in the corresponding region or information indicating a vertical transform core in the corresponding region. This method may be referred to as the above-mentioned "Multiple Transform Selection (MTS)".

[0171] The transform core may be indicated by indicating any one of the core indices of a plurality of available transform cores. According to an embodiment, the transform core corresponding to the core index "0" may be a transform core based on DCT-II, the transform core corresponding to the core index "1" may be a transform core based on DST-VII, and the transform core corresponding to the core index "2" may be a transform core based on DCT-VIII.

[0172] According to an embodiment, the transform core information may be a set index indicating a transform core set. The transform core set may indicate a combination of a transform core to be used as a vertical transform core and a transform core to be used as a horizontal transform core. In addition, the set index may indicate a combination of a core index representing a horizontal transform core and a core index representing a vertical transform core. Fig.14 (a), if the transform kernel information about a specific region indicates a set index representing a first transform kernel set (for example, if Fig.14 (a), tu_mts_idx[x0][y0] is 0), the vertical transform core in the corresponding region may be the transform core corresponding to the core index "0". In addition, the horizontal transform core in the corresponding region may be the transform core corresponding to the core index "0".

[0173] in addition, Fig.14 (b) shows the transformation kernel corresponding to the kernel index. Fig.14 (b), the transform core corresponding to the first core index "0" may indicate a transform core based on DCT-II. In addition, the transform core corresponding to the second core index "1" may indicate a transform core based on DST-VII. In addition, the transform core corresponding to the third core index "2" may indicate a transform core based on DCT-VIII.

[0174] According to additional embodiments, the above embodiments may be limitedly applied only to luma blocks. In this case, a predetermined basic transform kernel may be used for chroma components. For example, the basic transform kernel may be a transform kernel based on DCT-II. In addition, the above set index may be signaled in units of transform blocks.

[0175] In addition, the information indicating whether to signal the set index may be signaled by a header of a high level including the current block. Here, the high level may indicate a slice / tile, a picture, or a sequence including the current block. In addition, for each prediction method, the information indicating whether to signal the set index may be signaled by a separate flag. For example, when determining a transform kernel for a block, a flag indicating whether to use a set index may be configured independently for an intra-prediction block and an inter-prediction block, respectively.

[0176] According to an embodiment, if the information indicating whether to signal the set index of the high level including the transform block explicitly indicates that the set index is not to be signaled, the transform core for the corresponding transform block can be determined in different methods. For example, the transform core to be applied to the inverse transform of the current transform block can be determined based on information derived from information other than the set index. Specifically, the decoder can derive information indicating the transform core for the current transform block from the information signaled about the current transform block. That is, information indicating the vertical transform core and information indicating the horizontal transform core to be used for the transform block can be implicitly signaled. According to another embodiment, if the information indicating whether to signal the set index of the high level including the transform block explicitly indicates that the set index is to be signaled, the decoder can obtain the transform core for the transform block based on the signaled set index.

[0177] According to additional embodiments, the encoder may determine whether to signal the set index depending on the number of non-zero transform coefficients in the transform region. In this case, the decoder may determine the transform kernel by comparing the number of non-zero transform coefficients in the transform region with a predetermined number. For example, if the number of non-zero transform coefficients is 2 or less, the set index may not be signaled. In this case, the inverse transform unit may use a predetermined transform kernel for the corresponding region to perform the transform. The predetermined transform kernel may be a transform kernel based on DST-VII.

[0178] Fig.15It is a diagram illustrating a method for obtaining information related to a transform according to an embodiment of the present disclosure. The transform of the residual signal of the current block and the inverse transform of the transform coefficient may be performed on each transform block (or transform unit). The current block may include at least one transform block. That is, the transform block may be the current block itself, or may be a block divided from the current block. If the transform block is the current block itself, the size of the transform block may be the same as the size of the current block. According to an embodiment, the current block may be divided into a plurality of transform blocks based on the size of the current block. For example, if the size of the current block is greater than the maximum transform size, the current block may be divided into a plurality of transform blocks. If the size of the current block is less than or equal to the maximum transform size, the transform block may be the current block itself. As an embodiment, the size of the transform block may be the same as the size of the coding block. That is, the transform block may be divided into the same tree structure as the coding block. However, if the size of the coding block is greater than the maximum transform size, the current block may be divided into a plurality of transform blocks having the maximum transform size.

[0179] In an embodiment, the maximum transform size may be a value indicating the length of one side. For example, the length (or point) of the maximum transform size may be 64. In this case, if the size (width×height) of the current block is 128×32, the current block may be divided into two transform blocks of size 64×32. If the maximum transform size is 32, and if the size of the current block is 32×32, the transform block may not be divided from the current block and may have the same size as the current block.

[0180] If both the width and height of the current block are less than or equal to the maximum transform size, the current block is not divided into a plurality of transform blocks. Therefore, the coordinates of the upper left corner of the current block and the coordinates of the upper left corner of the corresponding transform block are the same. On the other hand, if at least one of the width and height of the current block is greater than the maximum transform size, the current block may be divided into a plurality of transform blocks. Therefore, the coordinates of the upper left corner of the current block may be different from the coordinates of the upper left corner of the corresponding transform block.

[0181] Fig.15 (a) shows the transform unit syntax. The transform unit syntax indicates the process related to transform and inverse transform. The transform unit syntax receives factors such as the coordinates (x0, y0) as the upper left corner of the transform block, tbWidth and tbHeight indicating the size of the transform block in the horizontal and vertical directions, and treeType indicating the tree type.

[0182] According to an embodiment, the information related to the transform may include coding block flag (cbf) information tu_cbf_luma, tu_cbf_cb, and tu_cdf_cr indicating whether the transform block includes at least one non-zero transform coefficient. The cbf information may be obtained according to the components of the transform unit. For example, the information related to the transform may include at least one of cbf information tu_cbf_luma[x0][y0] about the luminance component and cbf information tu_cbf_cb[x0][y0] and tu_cbf_cr[x0][y0] about two chrominance components.

[0183] According to an embodiment, if the cbf information of the transform block indicates that the transform block includes at least one non-zero transform coefficient, inverse quantization and inverse transform for the corresponding transform block may be performed. In this case, the decoder may use information related to residual coding to inverse quantize the quantized transform coefficient. In addition, the decoder may inverse transform the inverse quantized transform coefficient to obtain a residual signal corresponding to the transform block. On the other hand, if the cbf information of the corresponding transform block indicates that the transform block does not include at least one non-zero coefficient, the decoder may not perform inverse quantization and inverse transform on the corresponding transform block. In this case, the decoder may obtain a residual signal without inverse quantization and inverse transform processing on the transform block. For example, when there is no cbf information of the transform block, the cbf information may be regarded as the transform block does not include at least one non-zero coefficient. The encoder may entropy code the cbf information through the above-mentioned entropy coding unit. In addition, the decoder may obtain the cbf information from the bitstream through the above-mentioned entropy decoding unit.

[0184] Encoding may be performed so that the tree structure of the luminance component is the same as or different from the tree structure of the chrominance component. Therefore, cbf information (S1501) may be obtained based on information indicating a tree type (treeType) of a transform block. According to an embodiment, if the treeType of the transform block indicates SINGLE_TREE, the tree structure of the transform block for the luminance component of the current block may be the same as the tree structure of the transform block for the chrominance component of the current block. In this case, cbf information about the luminance component and cbf information about each chrominance component may be obtained. According to another embodiment, if the treeType of the transform block indicates DUAL_TREE_LUMA or DUAL_TREE_CHROMA, the luminance component and the chrominance component of the current block may be respectively divided into transform blocks having structures different from each other. If the treeType of the transform block indicates DUAL_TREE_LUMA, this indicates that the transform block currently being processed is a luminance component block. Therefore, cbf information about the luminance component may be obtained. In addition, if the treeType information of the transform block indicates DUAL_TREE_CHROMA, this indicates that the transform block currently being processed is a chrominance component block. Therefore, cbf information about the chrominance component can be obtained.

[0185] exist Fig.15 In (a), tu_cbf_luma[x0][y0] is an element indicating whether the luma component transform block includes one or more non-zero coefficients, and if the element is 1, it indicates that there are non-zero coefficients in the corresponding transform block, where the position of the upper left luma component sample of the block is (x0, y0) based on the position of the upper left luma component sample of the picture. For example, if tu_cbf_luma[x0][y0] does not exist, the element can be inferred to be 0. If tu_cbf_luma[x0][y0] is 0, it indicates that all coefficients in the corresponding luma transform block are 0, so the decoder can reconstruct the corresponding residual signal for the luma component without additional parsing, inverse quantization, and inverse transform. If tu_cbf_luma[x0][y0] is 1, it indicates that there are one or more non-zero transform coefficients in the corresponding luma transform block, so in the residual_coding syntax structure, parsing and inverse quantization processing of syntax elements related to transform coefficients may be required, and the residual signal can be reconstructed by applying inverse transform to the inverse quantized coefficients. tu_cbf_luma[x0][y0] may be encoded / decoded using a conventional coding engine of CABAC taking context into consideration.

[0186] tu_cbf_cb[x0][y0] is an element indicating whether the chrominance component Cb transform block includes one or more non-zero coefficients, and if the element is 1, it indicates that there are non-zero coefficients in the corresponding transform block where the upper left position is (x0, y0). For example, if tu_cbf_cb[x0][y0] does not exist, the element can be inferred to be 0. If tu_cbf_cb[x0][y0] is 0, it indicates that all coefficients in the corresponding Cb transform block are 0, so the decoder can reconstruct the residual signal for the Cb signal without additional parsing, inverse quantization, and inverse transform. If tu_cbf_cb[x0][y0] is 1, it indicates that there are one or more non-zero transform coefficients in the corresponding Cb transform block, so in the residual_coding syntax structure, parsing and inverse quantization processing of syntax elements related to transform coefficients may be required, and the residual signal can be reconstructed by applying inverse transform to the inverse quantized coefficients. tu_cbf_cb[x0][y0] may be encoded / decoded using a conventional coding engine of CABAC taking context into consideration.

[0187] tu_cbf_cr[x0][y0] is an element indicating whether the chrominance component Cr transform block includes one or more non-zero coefficients, and if the element is 1, it indicates that there are non-zero coefficients in the transform block where the upper left position is (x0, y0). For example, if tu_cbf_cr[x0][y0] does not exist, the element can be inferred to be 0. If tu_cbf_cr[x0][y0] is 0, it indicates that all coefficients in the corresponding Cr transform block are 0, so the decoder can reconstruct the residual signal for the Cr signal without additional parsing, inverse quantization, and inverse transform processing. If tu_cbf_cr[x0][y0] is 1, it indicates that there are one or more non-zero transform coefficients in the corresponding Cr transform block, so in the residual_coding syntax structure, parsing and inverse quantization processing of syntax elements related to the transform coefficients may be required, and the residual signal can be reconstructed by applying an inverse transform to the inverse quantized coefficients. tu_cbf_cr[x0][y0] may be encoded / decoded using a conventional coding engine of CABAC taking into account the context.

[0188] Next, the encoder and the decoder may identify a condition for parsing the MTS information cu_mts_flag indicating whether the MTS method is used in the current transform block (S1502). Hereinafter, the condition for parsing cu_mts_flag will be described. First, it may be determined whether to parse cu_mts_flag based on the high-level MTS information sps_mts_intra_enabled_flag and sps_mts_inter_enabled_flag signaled by the high-level header of the current transform block. The high-level MTS information may be information indicating whether a transform core other than a basic transform core can be used. According to an embodiment, if sps_mts_intra_enabled_flag is 0, it may indicate that there is no cu_mts_flag corresponding to the intra-frame prediction block included in the corresponding SPS. In this case, cu_mts_flag is not parsed. On the other hand, if sps_mts_intra_enabled_flag is 1, it may indicate that there is a cu_mts_flag corresponding to the intra-frame prediction block included in the corresponding SPS. In this case, cu_mts_flag may be signaled and parsed.

[0189] Similarly, if sps_mts_inter_enabled_flag is 0, it may indicate that cu_mts_flag corresponding to the inter-frame prediction block included in the corresponding SPS does not exist. In this case, cu_mts_flag is not parsed. On the other hand, if sps_mts_inter_enabled_flag is 1, it may indicate that cu_mts_flag corresponding to the inter-frame prediction block included in the corresponding SPS exists. In this case, cu_mts_flag may be signaled and parsed. High-level MTS information may be signaled through a high-level syntax such as a header of a sequence, a picture, or a slice / tile.

[0190] In addition, cuPredMode[x0][y0] is a variable indicating the prediction mode of the transform block, wherein the position of the upper left luminance component sample is (x0, y0) relative to the coordinates of the upper left corner of the luminance component of the picture. If cuPredMode[x0][y0] is MODE_INTRA, it indicates that intra prediction is applied to the corresponding block. In addition, in the case of MODE_INTER, this indicates that inter prediction is applied to the corresponding block. That is, in S1502, (CuPredMode[x0][y0]==MODE_INTRA)&&(sps_mts_intra_enabled_flag) checks whether MTS can be applied when intra prediction is applied to the current transform block. In addition, in S1502, (CuPredMode[x0][y0]==MODE_INTER)&&(sps_mts_inter_enabled_flag) checks whether MTS can be applied when inter prediction is applied to the current transform block.

[0191] In addition, whether to parse cu_mts_flag can be determined based on tu_cbf_luma[x0][y0]. This is due to the fact that if tu_cbf_luma[x0][y0] indicates that all coefficients of the luminance component of the corresponding transform block are 0, no inverse transform needs to be performed. According to an additional embodiment, only a DCT-II-based transform kernel may be used in the transform of the chrominance component. In addition, whether to parse cu_mts_flag can be determined based on whether the height tbHeight and the width tbWidth of the transform block are less than or equal to a predetermined length. The above conditions can be summarized as follows.

[0192] Condition i): sps_mts_intra_enabled_flag==1, and CuPredMode[x0][y0]==MODE_INTRA or sps_mts_inter_enabled_flag==1, and CuPredMode[x0][y0]==MODE_INTER,

[0193] Condition ii): tu_cbf_luma[x0][y0]==1

[0194] Condition iii): treeType! =DUAL_TREE_CHROMA,

[0195] Condition iv): tbWidth<=32 and tbHeight<=32.

[0196] If all four conditions above are met, the decoder can parse cu_mts_flag. In addition, the encoder can entropy code cu_mts_flag, which can then be signaled. If cu_mts_flag[x0][y0] is 1, it can indicate that the MTS method is applied to the current transform block. On the other hand, if cu_mts_flag[x0][y0] is 0, it can indicate that the MTS method is not applied to the current transform block. In this case, a basic kernel such as a DCT-II-based transform kernel can be used to perform the inverse transform. If cu_mts_flag[x0][y0] does not exist, cu_mts_flag[x0][y0] can be inferred to be "0".

[0197] According to an embodiment of the present disclosure, a transform core for transforming a transform block may be signaled in stages through a high-level header of a current block and a header of a transform block. First, information indicating whether a transform core other than a basic transform core can be used in a sequence, picture, or slice / tile including the current block may be signaled through a high-level header. In addition, corresponding information may be signaled separately for intra prediction and inter prediction. According to a specific embodiment, sps_mts_intra_enabled_flag and sps_mts_inter_enabled_flag may be signaled through a header of a sequence, picture, or slice / tile. sps_mts_intra_enabled_flag may be information indicating whether a transform core other than a basic transform core can be used in the transform of an intra prediction block. In addition, sps_mts_inter_enabled_flag may be information indicating whether a transform core other than a basic transform core can be used in the transform of an inter prediction block. The basic transform core may be a transform core based on DCT-II.

[0198] That is, if sps_mts_intra_enabled_flag indicates that the use of a transform core other than the basic transform core is not allowed, and if the current block is an intra-frame prediction block, the information related to the transform core of the transform block obtained from the current block may not be further parsed. In this case, the corresponding transform block may be transformed based on the basic transform core. In addition, if sps_mts_inter_enabled_flag indicates that the use of a transform core other than the basic transform core is not allowed, and if the current block is an inter-frame prediction block, the information related to the transform core of the transform block obtained from the current block may not be further parsed. In this case, the corresponding transform block may be transformed based on the basic transform core.

[0199] On the other hand, if the information signaled through the high-level header indicates that a transform core other than the basic transform core can be used, additional information related to the transform core of the corresponding transform block may be signaled through the header of the transform block. For example, in the transform of the transform block, information indicating whether a transform core other than the basic transform core is to be used may be signaled through the header of the corresponding transform block.

[0200] According to an embodiment of the present disclosure, the use of transform kernels other than the basic transform kernel for the transform block may be restricted depending on the size of the corresponding transform block. For example, if the size of the transform block is larger than a predetermined size, the use of transform kernels other than the basic transform kernel may be restricted in the transformation of the corresponding transform block. According to an embodiment, if at least one of the height or width of the transform block is larger than a predetermined length, the use of transform kernels other than the basic transform kernel may not be allowed in the transformation of the corresponding transform block. For example, the predetermined length may be 32. Reference Fig.15 (a) If the width of the transform block is 32 or less, and if the height thereof is 32 or less, cu_mts_flag[x0][y0] signaled through the header of the above transform block may be parsed.

[0201] like Fig.15 As shown in (a), if the above-mentioned cbf information indicates that the transform block includes at least one non-zero transform coefficient, a process (S1503 to S1505) for obtaining a quantized transform coefficient for the corresponding transform block can be performed. In S1503, if tu_cbf_luma[x0][y0]==1, residual coding can be performed on the luminance component of the transform block. That is, a residual coding syntax structure {residual_coding()} receiving a specific input factor can be executed. Specifically, residual_coding() can receive the coordinates (x0, y0) of the upper left sample of the transform block, the value log2(tbWidth) obtained by applying the logarithm of the base 2 to the width of the transform block, and the value log2(tbHeight) obtained by applying the logarithm of the base 2 to the height of the transform block as input factors. In addition, residual_coding() can receive a color index (cdIdx) as an input factor. If the value of cdIdx is '0', it indicates a luma component 'luma', if the value is '1', it indicates a first chroma component 'Cb', and if the value is '2', it indicates a second chroma component 'Cr'.

[0202] In S1504, if tu_cbf_cb[x0][y0]==1, residual coding of the first chroma component can be performed. Specifically, residual_coding() can receive the coordinates (x0, y0) of the upper left sample of the transform block as an input factor. If the color format YCbCr is 4:2:0, the size of the chroma component in the transform block can be half the size of the luminance component block. Therefore, residual_coding() can receive the value log2(tbWidth / 2) obtained by applying the logarithm of the base 2 to the width (tbWidth / 2) of the chroma component block and the value log2(tbHeight / 2) obtained by applying the logarithm of the base 2 to the height (tbHeight / 2) of the chroma component block as input factors. At the same time, if the color format YCbCr is 4:4:4, the size of the chroma component block in the transform block can be the same as the size of the luminance component block. In this case, like residual coding of the luma component, residual_coding() may receive as input factors a value log2(tbWidth) obtained by applying the logarithm with the base 2 to the width of the transform block and a value log2(tbHeight) obtained by applying the logarithm with the base 2 to the height of the transform block.

[0203] In S1505, if tu_cbf_cr[x0][y0]==1, residual coding of the second chroma component can be performed. Specifically, residual_coding() can receive the coordinates (x0, y0) of the upper left sample of the transform block as input factors. If the color format YCbCr is 4:2:0, the size of the chroma component in the transform block can be half the size of the luminance component block. Therefore, residual_coding() can receive the value log2(tbWidth / 2) obtained by applying the logarithm of the base 2 to the width (tbWidth / 2) of the chroma component block and the value log2(tbHeight / 2) obtained by applying the logarithm of the base 2 to the height (tbHeight / 2) of the chroma component block as input factors. At the same time, if the color format YCbCr is 4:4:4, the size of the chroma component block in the transform block can be the same as the size of the luminance component block. In this case, like residual coding for the luma component, residual_coding() may receive as input factors a value log2(tbWidth) obtained by applying the logarithm with the base 2 to the width of the transform block and a value log2(tbHeight) obtained by applying the logarithm with the base 2 to the height of the transform block.

[0204] The decoder can perform inverse quantization and inverse transformation on the corresponding transformed block based on the above information related to the transform. The decoder can obtain the residual signal corresponding to the transformed block by performing inverse quantization and inverse transformation. Specifically, the decoder can Fig.15 The residual coding syntax (residual_coding()) in (b) obtains the residual signal from the quantized transform coefficients of the transform block.

[0205] Fig.15 The residual_coding() in (b) may receive the coordinates of the upper left corner of the transform block obtained from the current block based on the coordinates of the upper left corner of the picture including the current block, a value obtained by applying a logarithm with a base of 2 to the width of the transform block, a value obtained by applying a logarithm with a base of 2 to the height of the transform block, and a color index (cIdx) as factors. In addition, the residual coding syntax structure may include syntax elements related to quantized transform coefficients present in the transform block, and the decoder may obtain a quantized transform coefficient block by parsing the syntax elements related to the quantized transform coefficients included in the residual syntax structure. The inverse transform unit of the decoder may reconstruct a residual signal corresponding to the transform block by performing inverse quantization and inverse transform on the quantized transform coefficient block.

[0206] According to an embodiment, the decoder may determine whether to parse transform_skip_flag of the current transform block (S1506). The condition for parsing transform_skip_flag is as follows.

[0207] Condition i) transform_skip_enabled_flag as a 1-bit flag included in the high-level syntax is 1 (on): transform_skip_enabled_flag may be included in any one of a sequence parameter set (SPS), a picture parameter set (PPS), and a slice header. If transform_skip_enabled_flag is 1, it indicates that transform_skip_flag exists in the residual coding syntax, and if transform_skip_enabled_flag is 0, it indicates that transform_skip_flag does not exist therein.

[0208] Condition ii) The current transform block is not a luma component transform block (cIdx!=0) or MTS is not applied (cu_mts_flag[x0][y0]==0): Transform skipping can be applied to both luma components and chroma components. In the case where MTS is applied to a luma component transform block (cIdx==0&&cu_mts_flag[x0][y0]==1), it is clear that the transform is performed, so there is no need to encode / decode transform_skip_flag[x0][y0][cIdx].

[0209] Condition iii) The width of the transform block is 4 or less (log2TbWidth<=2), and its height is 4 or less (log2TbHeight<=2).

[0210] Whether to parse transform_skip_flag[x0][y0][cIdx] may be determined depending on the above conditions. If transform_skip_flag[x0][y0][cIdx] is 1, the decoder may not perform the transform. If transform_skip_flag[x0][y0][cIdx] is 0, the decoder may consider other syntax elements to determine whether to perform the transform of the current transform block. The decoder may perform the transform by Fig.15 The residual_coding() part omitted in (b) performs the process of parsing and restoring the quantized transform coefficients.

[0211] Next, the decoder may determine whether to parse the set index (mts_idx) (S1507). The conditions for parsing mts_idx are as follows.

[0212] i) cu_mts_flag[x0][y0]==1 and luminance component transform block (cIdx==0)

[0213] ii) If transform_skip_flag[x0][y0] == 0: transform_skip_flag[x0][y0] is 1, indicating that transform skip is applied, so it is not necessary to determine the transform kernel to be used.

[0214] iii) the current transform block is at least part of an intra-frame prediction block (CuPredMode[x0][y0] == MODE_INTRA), there are 3 or more non-zero coefficients in the corresponding block (numSigCoeff>2), or the current transform block is at least part of an inter-frame prediction block (CuPredMode[x0][y0] == MODE_INTER) (here, the variable "numSigCoeff" indicates the number of non-zero coefficients in the transform block).

[0215] Regarding condition iii), if the number of non-zero coefficients present in the transform block is 2 or less (1 or 2), a transform using a predetermined transform kernel can be performed on the current transform block without signaling / parsing mts_idx[x0][y0]. In this case, the predetermined transform kernel may be a transform kernel based on DST-VII, and a transform kernel based on DST-IV may also be used instead of a transform kernel based on DST-VII.

[0216] According to an embodiment of the present disclosure, since the energy distribution of the residual signal has a correlation with the shape of the block, if the transform kernel is adaptively applied in consideration of the shape of the block, the residual signal can be encoded more efficiently.

[0217] Fig.16 is a diagram illustrating a method for selecting a transform kernel based on the shape of a block according to an embodiment of the present disclosure. According to an embodiment of the present disclosure, if the MTS flag (e.g., cu_mts_flag) indicating that the MTS is applied to the current block is 0, the encoder / decoder may select a transform kernel (or transform type) for an intra-frame block according to the shape of the block (or the width / height of the block). If the MTS flag is 0, the MTS index (e.g., mts_idx) indicating a specific transform kernel applied to the current block may not be signaled, and may be inferred to be -1. In an embodiment described later, if the MTS flag is 0, the encoder / decoder may select a transform kernel for an intra-frame prediction block depending on the size or shape of the current block, and may apply DCT-II in the horizontal and vertical directions for an inter-frame prediction block regardless of the shape of the block.

[0218] In the present disclosure, although the case where MTS is applied is described separately from the case where MTS is not applied based on the MTS flag, the present disclosure is not limited thereto. For example, whether MTS is applied may indicate whether a transform core other than a predefined specific transform core (which may be referred to as a basic transform type, a default transform type, etc.) is used. If MTS is applied, a transform type other than the basic transform type (e.g., any one of a plurality of transform types, or a transform type of a combination of two or more transform types) may be used for the transform, and if MTS is not applied, the basic transform type may be used for the transform. As an example, the basic transform type may be configured (or defined) as DCT-II.

[0219] In an embodiment of the present disclosure, if the intra-frame prediction block is a square block, the encoder / decoder may apply DCT-II in the horizontal direction and in the vertical direction. In addition, if the intra-frame prediction block is a rectangular block (i.e., a non-square block), the encoder / decoder may apply DCT-II in the direction of the longer length, and may apply DST-VII in the direction of the shorter length. In this case, if the shorter length is greater than the maximum transform size of DST-VII, the encoder / decoder may use DCT-II. For example, if the maximum transform size of DST-VII is 16 points (or a length of 32), DCT-II may be applied in the horizontal direction of a 64×16 block, and DST-VII may be applied in its vertical direction. In addition, for a 64×32 block, DCT-II may be applied in both the horizontal and vertical directions.

[0220] In addition, in an embodiment of the present disclosure, in the case where the intra-frame prediction block is a square block, the encoder / decoder can apply DCT-II in the horizontal direction and the vertical direction, and in the case of a rectangular block, the encoder / decoder can apply DCT-II in the longer length direction and use DCT-II or DST-VII in the shorter length direction by signaling a 1-bit flag. However, in the case where the length of the shorter side is greater than the maximum transform size of DST-VII, the encoder / decoder can use DCT-II without signaling a 1-bit flag. For example, if the maximum transform size of DST-VII is 16 points, by parsing the 1-bit flag, DCT-II can be applied in the horizontal direction of 64×16, and DCT-II or DST-VII can be applied in its vertical direction, and for a 64×32 block, DCT-II can be applied in both the horizontal and vertical directions. Although DST-VII can be considered effective considering the characteristics of intra-frame prediction, using DCT-II other than DST-VII may bring a lower rate-distortion cost, so unlike the previous embodiment, in the present embodiment, DCT-II can be further considered for the shorter length direction through 1-bit signaling. That is, if the 1-bit flag is 0, it can indicate that DCT-II is applied in the shorter length direction, and if the 1-bit flag is 1, it can indicate that DST-VII is applied in the shorter length direction. In an embodiment, a conventional coding engine of CABAC using context can be used to encode / decode the 1-bit flag.

[0221] In addition, in an embodiment of the present disclosure, for intra-frame prediction blocks, in the case of square blocks, the encoder / decoder may apply DCT-II in the horizontal and vertical directions, and in the case of rectangular blocks, DCT-II may be applied in the direction of the longer length, and DST-IV or DST-VII may be applied in the direction of the shorter length. However, if the shorter length is greater than the maximum transform size of DST-VII, DCT-II may be applied thereto. As described above, since DST-VII has a high implementation complexity, DST-IV having a pattern of a low-frequency basis function similar thereto may be used, but if DST-VII is replaced by DST-IV for all sizes, the coding efficiency may be reduced. Therefore, DST-IV may be used for a small size of 4 points, while DST-VII may be used for other sizes.

[0222] In addition, in an embodiment of the present disclosure, for an intra-frame prediction block, in the case of a square block, the encoder / decoder may apply DCT-II in the horizontal and vertical directions, and in the case of a rectangular block, may apply DCT-II in the direction of a longer length, and for the direction of a shorter length, the transform kernel is determined depending on the intra-frame prediction mode. For example, if the intra-frame prediction mode is a DC or planar mode (which is a non-directional mode), the encoder / decoder may apply DCT-II in the direction of a shorter length.

[0223] If, for a horizontal rectangle whose horizontal length of the block is greater than its vertical length, the intra-frame prediction mode is a horizontal direction mode (i.e., an intra-frame prediction mode that is greater than or equal to the horizontal diagonal mode and less than or equal to the center diagonal mode), the encoder / decoder may apply DCT-II in the direction of the shorter length (vertical direction). In addition, if the intra-frame prediction mode is a vertical direction mode (i.e., an intra-frame prediction mode that is greater than the center diagonal mode and less than or equal to the vertical diagonal mode), the encoder / decoder may apply DST-VII in the direction of the shorter length. If, for a vertical rectangle whose vertical length of the block is greater than its horizontal length, the intra-frame prediction mode is a horizontal direction mode, the encoder / decoder may apply DST-VII in the direction of the shorter length (horizontal direction), and if the intra-frame prediction mode is a vertical direction mode, the encoder / decoder may apply DCT-II to it.

[0224] According to an embodiment of the present disclosure, whether to apply a shape adaptive transform (SAT) can be signaled from an encoder to a decoder through a high-level syntax, and the shape adaptive transform (SAT) indicates a method for adaptively determining a transform kernel based on the shape of a block in the above-mentioned embodiment. As an embodiment, whether to apply SAT can be signaled through a sequence parameter set (SPS), a picture parameter set (PPS), a slice header, or a tile header. In addition, the syntax element indicating whether SAT is to be applied can be a 1-bit flag. Hereinafter, a method for indicating whether SAT is to be applied in a high-level syntax will be described. In the present disclosure, for ease of explanation, the method of adaptively determining a transform kernel based on the size or shape of a block is referred to as "SAT", but the present disclosure is not limited to this term. For example, SAT can be referred to as "implicit MTS".

[0225] Hereinafter, a syntax signaling method related to whether SAT is to be applied will be described by way of example with reference to Tables 1 to 8. Although the embodiment will be described based on a case where a flag indicating whether SAT is to be applied is included in the SPS, the present disclosure is not limited thereto.

[0226] [Table 1]

[0227]

[0228] Referring to Table 1, in an embodiment of the present disclosure, a syntax element indicating whether SAT is to be applied may be signaled independently of a syntax element indicating whether MTS is applied. That is, as an embodiment, sps_mts_enabled_flag indicating whether MTS can be applied to the current sequence may be signaled, and sps_sat_enabled_flag indicating whether SAT can be applied to the current sequence may be signaled independently of the value of sps_mts_enabled_flag. That is, whether SAT can be applied to the current sequence may be determined depending on the value of sps_sat_enabled_flag, regardless of sps_mts_enabled_flag.

[0229] [Table 2]

[0230]

[0231] Referring to Table 2, in an embodiment of the present disclosure, a syntax element indicating whether SAT is to be applied may be determined depending on a syntax element indicating whether MTS is applied. As an embodiment, sps_mts_enabled_flag indicating whether MTS can be applied to the current sequence may be first signaled, and whether to signal sps_sat_enabled_flag indicating whether SAT can be applied to the current sequence may be determined depending on the value of sps_mts_enabled_flag. For example, if sps_mts_enabled_flag is 1, sps_sat_enabled_flag may not be signaled. In this case, sps_sat_enabled_flag may be configured (or inferred) to be 0 without signaling it, which may indicate that SAT will not be used for all blocks in the current sequence. If sps_mts_enabled_flag is 0, sps_sat_enabled_flag may be signaled, and the decoder may determine whether SAT can be used in the current sequence depending on the value of the signaled sat_enabled_flag.

[0232] [Table 3]

[0233]

[0234] Referring to Table 3, in an embodiment of the present disclosure, a syntax element indicating whether SAT is to be applied may be determined depending on a syntax element indicating whether MTS is applied. As an embodiment, sps_mts_enabled_flag indicating whether MTS can be applied to the current sequence may be first signaled, and whether to signal sps_sat_enabled_flag indicating whether SAT can be applied to the current sequence may be determined depending on the value of sps_mts_enabled_flag. For example, if sps_mts_enabled_flag is 1, sps_sat_enabled_flag may not be signaled. In this case, sps_sat_enabled_flag may be configured (or inferred) to be 1 without signaling it, which may indicate that SAT can be used for all blocks in the current sequence. If sps_mts_enabled_flag is 0, sps_sat_enabled_flag may be signaled, and the decoder may determine whether SAT can be used in the current sequence depending on the value of the signaled sat_enabled_flag.

[0235] [Table 4]

[0236]

[0237] Referring to Table 4, in an embodiment of the present disclosure, whether SAT is to be applied may be determined based on a flag (or syntax element) indicating that only a DCT-II transform core is used in the current sequence. As an embodiment, sps_mts_enabled_flag indicating whether MTS can be applied to the current sequence may be first signaled, and sps_only_dct2_enabled_flag as a flag indicating whether only a DCT-II transform core is used in the current sequence may be signaled based on sps_mts_enabled_flag. For example, if sps_mts_enabled_flag is 0, sps_only_dct2_enabled_flag may be signaled. If sps_only_dct2_enabled_flag is 1, it may indicate that all blocks in the current sequence cannot use SAT, and if sps_only_dct2_enabled_flag is 0, it may indicate that SAT can be used in the current sequence. If sps_mts_enabled_flag is 1, sps_only_dct2_enabled_flag may be configured (or inferred) to 0 without being signaled, and if sps_only_dct2_enabled_flag is configured (or inferred) to 0, it may indicate that SAT can be used in the current sequence.

[0238] [Table 5]

[0239]

[0240] Referring to Table 5, in an embodiment of the present disclosure, whether SAT is to be applied may be determined based on a flag (or syntax element) indicating that only the DCT-II transform core can be used in the current sequence. As an embodiment, sps_only_dct2_enabled_flag may be first signaled, which is a flag indicating whether only the DCT-II transform core will be used in the current sequence. Then, it may be determined based on sps_only_dct2_enabled_flag whether to signal sps_mts_enabled_flag, which is a flag indicating whether MTS can be used in the current sequence. For example, if sps_only_dct2_enabled_flag is 1, sps_mts_enabled_flag may be configured (or inferred) to 0 without signaling it, and sps_sat_enabled_flag, which is a flag indicating whether SAT can be applied to the current sequence, may be configured to 0 without signaling it. If sps_only_dct2_enabled_flag is 0, sps_mts_enabled_flag may be signaled, and thus, sps_sat_enabled_flag may be configured to 1 without being signaled so that the decoder may apply SAT to the current sequence.

[0241] [Table 6]

[0242]

[0243] Referring to Table 6, in an embodiment of the present disclosure, whether SAT is to be applied may be determined based on a flag (or syntax element) indicating that only the DCT-II transform core can be used in the current sequence. As an embodiment, sps_only_dct2_enabled_flag may be first signaled, which is a flag indicating whether only the DCT-II transform core will be used in the current sequence. Then, it may be determined based on sps_only_dct2_enabled_flag whether to signal sps_mts_enabled_flag, which is a flag indicating whether MTS can be applied to the current sequence. For example, if sps_only_dct2_enabled_flag is 1, sps_mts_enabled_flag may be configured (or inferred) to 0 without signaling it, and sps_sat_enabled_flag, which is a flag indicating whether SAT can be applied to the current sequence, may be configured (or inferred) to 0 without signaling it. If sps_only_dct2_enabled_flag is 0, sps_mts_enabled_flag and sps_sat_enabled_flag may be signaled, and whether SAT may be used in the current sequence may be determined depending on the value of the signaled sps_sat_enabled_flag.

[0244] [Table 7]

[0245]

[0246] Referring to Table 7, in an embodiment of the present disclosure, whether SAT is to be applied may be determined based on a flag (or syntax element) indicating that only a DCT-II transform core is used in the current sequence and a flag (or syntax element) indicating whether MTS can be applied to the current sequence. As an embodiment, sps_only_dct2_enabled_flag may be first signaled, which is a flag indicating whether only a DCT-II transform core will be used in the current sequence. Then, it may be determined based on the value of sps_only_dct2_enabled_flag whether sps_mts_enabled_flag is signaled, which is a flag indicating whether MTS can be applied to the current sequence. For example, if sps_only_dct2_enabled_flag is 1, sps_mts_enabled_flag may be configured (or inferred) to 0 without signaling it, and sps_sat_enabled_flag, which is a flag indicating whether SAT can be applied to the current sequence, may be configured (or inferred) to 0 without signaling it.

[0247] In addition, if sps_only_dct2_enabled_flag is 0, sps_mts_enabled_flag may be signaled. In addition, if sps_mts_enabled_flag is 0, whether SAT can be used in the current sequence may be determined depending on the value of the signaled sps_sat_enabled_flag. On the other hand, if sps_mts_enabled_flag is 1, sps_sat_enabled_flag may be configured to 0 without signaling it, which may indicate that SAT cannot be applied to the current sequence.

[0248] According to an embodiment of the present disclosure, if sps_mts_enabled_flag, which is a flag indicating whether MTS can be applied to the current sequence, is 0, the syntax element indicating whether explicit MTS can be used may be inferred to be 0. If the syntax element indicating whether explicit MTS can be used is 0, the MTS index may not be signaled and may be inferred to be 0. If sps_mts_enabled_flag is 1, the syntax element indicating whether explicit MTS can be used may be signaled. If the syntax element indicating whether explicit MTS can be used is 1, the MTS index may be signaled. If the syntax element indicating whether explicit MTS can be used is 0, implicit MTS may be used.

[0249] [Table 8]

[0250]

[0251] Referring to Table 8, in an embodiment of the present disclosure, whether SAT is to be applied may be determined based on a flag (or syntax element) indicating that only a DCT-II transform core is used in the current sequence and a flag (or syntax element) indicating whether MTS can be applied to the current sequence. As an embodiment, sps_only_dct2_enabled_flag may be first signaled, which is a flag indicating whether only a DCT-II transform core will be used in the current sequence. Then, whether to signal sps_mts_enabled_flag, which is a flag indicating whether MTS can be applied to the current sequence, may be determined depending on the value of sps_only_dct2_enabled_flag. For example, if sps_only_dct2_enabled_flag is 1, sps_mts_enabled_flag, which is a flag indicating whether MTS can be applied to the current sequence, may be configured (or inferred) to be 0 without signaling it, and sps_sat_enabled_flag, which is a flag indicating whether SAT can be applied to the current sequence, may be configured (or inferred) to be 0 without signaling it.

[0252] In addition, if sps_only_dct2_enabled_flag is 0, sps_mts_enabled_flag may be signaled. If sps_mts_enabled_flag is 0, whether SAT can be used in the current sequence may be determined depending on the value of the signaled sps_sat_enabled_flag. On the other hand, if sps_mts_enabled_flag is 1, sps_sat_enabled_flag may be configured to 1 without signaling it, which may indicate that SAT can be applied to the current sequence.

[0253] According to an embodiment of the present disclosure, if sps_mts_enabled_flag, which is a flag indicating whether MTS can be applied to the current sequence, is 0, the syntax element indicating whether explicit MTS can be used may be inferred to be 0. If the syntax element indicating whether explicit MTS can be used is 0, the MTS index may not be signaled and may be inferred to be 0. If sps_mts_enabled_flag is 1, the syntax element indicating whether explicit MTS can be used may be signaled. If the syntax element indicating whether explicit MTS can be used is 1, the MTS index may be signaled. If the syntax element indicating whether explicit MTS can be used is 0, implicit MTS may be used.

[0254] Fig.17is a diagram illustrating a method of signaling and determining a transformation kernel according to an embodiment of the present disclosure. Fig.17 , mts_idx[xTbY][yTbY][cIdx] indicates a syntax element (or variable) representing a transform kernel applied to a transform block, wherein the coordinates of the upper left luma component of the transform block are (xTbY, yTbY) relative to the coordinates of the upper left luma component of the picture. cIdx is a variable indicating a color component, and may be configured as 0 in the case of luma component Y, may be configured as 1 in the case of chroma component Cb, and may be configured as 2 in the case of chroma component Cr.

[0255] According to an embodiment of the present disclosure, the transform kernel (or transform type) used in MTS can be configured as {DST-VII, DCT-VIII}. A total of four transform kernel combinations (for example, {horizontal: DST-VII, vertical: DST-VII}, {horizontal: DCT-VIII, vertical: DST-VII}, {horizontal: DST-VII, vertical: DCT-VIII} and {horizontal: DCT-VIII, vertical: DCT-VIII}) can be configured to be applied in the horizontal and vertical directions of the transform block. On the other hand, if MTS is not used, a combination {horizontal: DCT-II, vertical: DCT-II} can be used. In Fig.17 In , trTypeHor and trTypeVer are variables indicating the transform kernel (or transform type) applied in the horizontal direction and the vertical direction, respectively. For example, 0 may indicate DCT-II, 1 may indicate DST-VII, and 2 may indicate DCT-VIII. If tu_mts_flag is not present, mts_idx may be configured (or inferred) to be -1 without signaling it. In this case, the DCT-II kernel may be applied in both the horizontal and vertical directions.

[0256] In an embodiment, a fixed length of 2 bits may be used to signal mts_idx. Fig.17, if mts_idx is 0, it may be signaled by bitstream 00, and in this case, DST-VII may be applied in both horizontal and vertical directions. If mts_idx is 1, it may be signaled by bitstream 01, and in this case, DCT-VIII may be applied in the horizontal direction and DST-VII may be applied in the vertical direction. If mts_idx is 2, it may be signaled by bitstream 10, and in this case, DST-VII may be applied in the horizontal direction and DCT-VIII may be applied in the vertical direction. If mts_idx is 3, it may be signaled by bitstream 11, and in this case, DCT-VIII may be applied in both horizontal and vertical directions.

[0257] In the aforementioned method of determining the transform kernel depending on mts_idx, although an embodiment of configuring the transform kernel set as {DST-VII, DCT-VIII} has been described, the present disclosure is not limited thereto, and even in a transform kernel set including a plurality of arbitrary transform kernels, the transform kernel to be applied in the horizontal and vertical directions can be determined depending on mts_idx as described in i) to v) below.

[0258] i) If mts_idx is -1: horizontal-DCT-II, vertical-DCT-II.

[0259] ii) If mts_idx is 0: horizontal - first candidate in transform set, vertical - first candidate in transform set.

[0260] iii) If mts_idx is 1: horizontally - the second candidate in the transform set, vertically - the first candidate in the transform set.

[0261] iv) If mts_idx is 2: horizontally - the first candidate in the transform set, vertically - the second candidate in the transform set.

[0262] v) If mts_idx is 3: horizontal - second candidate in transform set, vertical - second candidate in transform set.

[0263] In the above Fig.15 In the syntax structure related to the transformation in the , although the method of using different syntax elements to signal MTS and transform skip (TS) has been described, if a single syntax element is used to signal MTS and TS, the syntax parsing efficiency can be improved and the syntax structure can be expressed more concisely. Therefore, the method of using a single syntax element to signal MTS and TS will be described with reference to the following drawings.

[0264] Fig.18A syntax structure for obtaining information related to multiple transform selection and transform skipping according to an embodiment of the present disclosure is shown, and Fig.19 1 is a diagram illustrating information related to multiple transform selection and transform skipping according to an embodiment of the present disclosure. According to an embodiment of the present disclosure, a single syntax element may be used to signal MTS and TS. Fig.18 In the embodiments, the Fig.15 That is, in Fig.18 Syntax elements not described in can be found in Fig.15 Description of the process.

[0265] refer to Fig.18 In S1801, the decoder may check (or determine) whether to parse the syntax element tu_mts_idx[x0][y0], which indicates the transform kernel applied in the horizontal and vertical directions of the current residual signal. The syntax element may include information about whether TS is to be applied, information about whether MTS is to be applied, and information about the transform kernel applied in the horizontal and vertical directions. For example, if the following conditions i), ii), iii), and iv) are all true, tu_mts_idx[x0][y0] may be parsed, and tu_mts_idx[x0][y0] may be encoded / decoded using a conventional coding engine of CABAC using context.

[0266] Condition i): The variable MaxMtsIdx is greater than 0 (MaxMtsIdx>0).

[0267] Here, MaxMtsIdx represents a variable indicating the maximum value of tu_mts_idx and can be Fig.15 (a) is determined by the method described in Fig.19 In (a), MaxMtsIdx can be determined according to whether MTS can be used and whether TS can be used. Fig.19 The second column in (a) indicates whether the current block is encoded by inter-frame prediction and whether MTS can be used in the inter-frame prediction block. If the current block is encoded by inter-frame prediction (i.e., CuPredMode[x0][y0]==MODE_INTER), and if MTS is allowed to be used for inter-frame prediction in SPS (i.e., sps_mts_inter_enabled_flag==1), the value of the second column can be 1. Otherwise, the value of the second column can be 0.

[0268] Fig.19The third column in (a) indicates whether the current block is encoded by intra prediction and whether MTS can be used in the intra prediction block. If the current block is encoded by intra prediction (i.e., CuPredMode==MODE_INTRA), and if MTS is allowed to be used for intra prediction in SPS (i.e., sps_mts_intra_enabled_flag==1), the value of the third column can be 1. Otherwise, the value of the third column can be 0. Fig.19 The fourth column in (a) may indicate whether TS can be applied to the current transform block. If it is indicated that TS can be used in SPS (transform_skip_enabled_flag), and if both the width and height of the current transform block are less than or equal to the maximum transform skip size (i.e., log2TbWidth<=MaxTsSize&&log2TbHeight<=MaxTsSize), the value of the fourth column may be 1. Otherwise, the value of the fourth column may be 0. In this case, if sps_transform_skip_enabled_flag is 1, MaxTsSize indicating the maximum transform skip size may be determined by signaling the value, which may be obtained by subtracting 2 from a value obtained by applying a logarithm with a base of 2 to the maximum transform skip size, and the value of MaxTsSize may be 2 to 5. The value may be obtained by subtracting 2 from a value obtained by applying a logarithm with a base of 2 to the maximum transform skip size. The ...1 to 5. The value of MaxTsSize may be 1 to 5. The value of MaxTsSize may be 1 to 5. The value of MaxTsSize may be 1 to 5. The value of MaxTsSize may be 1 to 5. The value of MaxTsSize may be 1 to 5. The value of MaxT Fig.19 The values ​​of the second, third, and fourth columns in (a) determine the variable MaxMtsIdx.

[0269] Condition ii) The current luma component transform block includes non-zero coefficients (tu_cbf_luma[x0][y0] == 1).

[0270] Referring to condition ii), if the current transform block does not include non-zero coefficients, MTS and TS do not need to be applied. In this case, the decoder can reconstruct the residual signal without performing inverse quantization and inverse transform.

[0271] Condition iii) The coding tree currently being processed is not a tree containing only chroma components (treeType!=DUAL_TREE_CHROMA).

[0272] Reference condition iii), although in the above Fig.15An example in which TS can be applied to both luma components and chroma components has been described in the embodiments, but TS can be applied only to luma components. That is, if MTS and TS can be applied only to luma components, there is no need to signal tu_mts_idx in a coding tree including only chroma components, so if the coding tree currently being processed includes a luma component, that is, if treeType is SINGLE_TREE or DUAL_TREE_LUMA, the decoder can parse tu_mts_idx.

[0273] Condition iv) Both the width and height of the transform block are less than or equal to 32 (tbWidth<=32&&tbHeight<=32).

[0274] In an embodiment, in the absence of tu_mts_idx[x0][y0], if MaxMtsSize is 4, it may be configured to 0, and if MaxMtsSize is 1 or 5, it may be configured to 1. Fig.18 In , since an integrated syntax element is used to signal TS and MTS, Fig.18 The 1-bit flag indicating whether TS is used in the current block may not be parsed in the residual_coding syntax structure in (b).

[0275] refer to Fig.19 (b), in an embodiment of the present disclosure, the encoder may use an integrated syntax element to signal the MTS and TS to the decoder. The decoder may determine the transform kernel based on the corresponding syntax element. Fig.19 In (b), TrHorType and TrVerType represent variables indicating transform kernels applied in the horizontal direction and the vertical direction, respectively. IsTrafoSkip is a variable indicating whether transform skip is applied to the current transform block. As an embodiment, the values ​​of TrHorType, TrVerType and IsTrafoSkip described above may be determined depending on the value of tu_mts_idx[x0][y0].

[0276] In an embodiment, if TrHorType (or TrVerType) is -1 and if IsTrafoSkip is 1, this indicates that a transform skip is applied in the corresponding direction. If TrHorType (or TrVerType) is 0 and IsTrafoSkip is 0, a DCT-II kernel may be applied in the corresponding direction. If TrHorType (or TrVerType) is 1 and IsTrafoSkip is 0, a DCT-VII kernel may be applied in the corresponding direction. If TrHorType (or TrVerType) is 2 and if IsTrafoSkip is 0, a DCT-VIII kernel may be applied in the corresponding direction. The maximum value of tu_mts_idx may be represented as a variable MaxMtsIdx, and the binarization method of tu_mts_idx may vary depending on the value of MaxMtsIdx.

[0277] In an embodiment, if MaxMtsIdx is 1 (i.e., in the case where only TS is allowed), whether TS is applied can be indicated by 1-bit signaling. If tu_mts_idx is 0 (i.e., the bit value is 0), TS can be applied to the current luminance component transform block, and if tu_mts_idx is 1 (i.e., the bit value is 1), DCT-II can be applied in both the horizontal and vertical directions of the current luminance component transform block. If MaxMtsIdx is 4 (i.e., in the case where TS is not allowed and MTS is allowed), the first bit in the bitstream can indicate whether MTS is applied to the corresponding luminance transform block, and the second, third and fourth bits of the bitstream can indicate the transform kernel applied to the case where MTS is used. If tu_mts_idx is 0 (e.g., bitstream 0), the DCT-II kernel can be applied in both the horizontal and vertical directions of the current transform block. If tu_mts_idx is 1 (e.g., bitstream 10), the DST-VII kernel can be applied to both the horizontal and vertical directions of the current transform block. If tu_mts_idx is 2 (e.g., bitstream 110), DCT-VIII may be applied in the horizontal direction of the current transform block, and DST-VII may be applied in its vertical direction. If tu_mts_idx is 3 (e.g., bitstream 1110), DST-VII may be applied in the horizontal direction of the current transform block, and DCT-VIII may be applied in its vertical direction. If tu_mts_idx is 4 (e.g., bitstream 1111), DCT-VIII may be applied in both the horizontal and vertical directions of the current transform block.

[0278] In an embodiment, if MaxMtsIdx is 5 (if both TS and MTS are allowed), the first bit of the bitstream may indicate whether TS is applied to the corresponding luminance transform block. In this case, the second bit of the bitstream may indicate whether MTS is applied to the corresponding luminance transform block, and the third, fourth, and fifth bits of the bitstream may indicate the transform kernel applied to the case where MTS is used. If tu_mts_idx is 0 (e.g., bitstream 0), TS may be applied to the current transform block. If tu_tms_idx is 1 (e.g., bitstream 10), DCT-II may be applied in both the horizontal and vertical directions of the current transform block. If tu_mts_idx is 2 (e.g., bitstream 110), DST-VII may be applied in both the horizontal and vertical directions of the current transform block. If tu_mts_idx is 3 (e.g., bitstream 1110), DCT-VIII may be applied in the horizontal direction of the current transform block, and DST-VII may be applied in its vertical direction. If tu_mts_idx is 4 (e.g., bitstream 11110), DST-VII may be applied in the horizontal direction of the current transform block, and DCT-VIII may be applied in its vertical direction. If tu_mts_idx is 5 (e.g., bitstream 11111), DCT-VIII may be applied in both the horizontal and vertical directions of the current transform block.

[0279] Although the above embodiment describes an example in which a transform core applied when using MTS is signaled by using a truncated unary binarization method of 1 bit or 3 bits, the signaling may be performed using a fixed 2 bits. In addition, although the case in which the transform core candidates constituting the transform core set are DST-VII and DCT-VIII is described as an example in the above embodiment, the present disclosure is not limited thereto, and even in a transform core set including two arbitrary transform cores, the transform core applied in the horizontal and vertical directions may be determined depending on the value of the bit stream indicating the transform core, as shown in the following cases i) to v).

[0280] i) Bitstream "0": horizontal-DCT-II, vertical-DCT-II

[0281] ii) Bitstream "10": horizontal - first candidate in transform set, vertical - first candidate in transform set

[0282] iii) Bitstream "110": Horizontal - second candidate in transform set, vertical - first candidate in transform set

[0283] iv) Bitstream "1110": first candidate in horizontal transform set, second candidate in vertical transform set

[0284] v) Bitstream "1111": second candidate in horizontal transform set, second candidate in vertical transform set

[0285] The residual signal of the inter-frame prediction block may tend to be concentrated at a specific position of the block. For example, there may be a pattern in which the residual signal has higher energy at the boundary of the residual signal block, and in which the residual signal has lower energy at the center and opposite boundary of the block. If the residual signal of the inter-frame prediction block is transformed using such a pattern, the coding efficiency of the inter-frame prediction can be improved. This will be described with reference to the following drawings.

[0286] Fig. 20 is a diagram illustrating a sub-block transform (SBT) method according to an embodiment of the present disclosure. If SBT is applied, the encoder / decoder may perform transform coding by dividing the current coding unit (or coding block) into multiple transform units (or transform blocks). As an embodiment, the encoder / decoder may perform transform coding by dividing the current coding unit into two transform units having a size of 1:1 or 1:3. In this case, it is possible to perform transform only on one transform unit, assuming that the residual signal is concentrated on one transform unit among the two divided transform units, and assuming that the remaining one transform unit does not have a residual signal. Fig. 20 In (a), (b), (c) and (d), the area indicated as A (i.e., the shaded area) indicates the area where the transformation of the transform unit is performed. Fig.15 and 18 The signaling of the syntax elements (tu_cbf_luma, tu_cbf_cb, and tu_cbf_cr) of the non-zero transform coefficient information described in the transform block determines whether there is a non-zero coefficient in the corresponding area of ​​the transform block. The area other than area A is a transform unit area assumed to have no residual signal, so its transform and inverse quantization processing can be omitted, and tu_cbf_luma, tu_cbf_cb, and tu_cbf_cr can be configured (or inferred) to 0 without signaling it.

[0287] refer to Fig. 20(a), if the coding unit has a size of W×H, the encoder / decoder can divide the coding unit in the vertical direction to obtain two transform units with a size of (W / 2)×H. Alternatively, if the 1-bit flag indicating the division of {1 / 4, 3 / 4} is 1, the coding unit can be divided into two transform units with sizes of (W / 4)×H and (3W / 4)×H. In the above two cases, the transformation can be performed on the left transform unit, and DCT-VIII can be applied in the horizontal direction, and DST-VII can be applied in the vertical direction. For example, if the width or height of the corresponding transform unit is greater than the maximum size of the DST-VII / DCT-VIII kernel allowed in SBT, DCT-II can be applied in the corresponding direction. For example, the maximum size of the DST-VII / DCT-VIII kernel allowed in SBT may be 32 points (or length).

[0288] refer to Fig. 20 (b), if the size of the coding unit is W×H, the encoder / decoder may divide the coding unit into two transform units of size (W / 2)×H in its vertical direction. Alternatively, if the 1-bit flag indicating the division of {1 / 4, 3 / 4} is 1, the coding unit may be divided into two transform units of size (3W / 4)×H and (W / 4)×H. In both cases above, the transform may be performed on the right transform unit, and DST-VII may be applied in both the horizontal and vertical directions. As an example, if the width or height of the corresponding transform unit is greater than the maximum size of the DST-VII / DCT-VIII kernel allowed in SBT, DCT-II may be applied in the corresponding direction. As an example, the maximum size of the DST-VII / DCT-VIII kernel allowed in SBT may be 32 points.

[0289] refer to Fig. 20 (c), if the size of the coding unit is W×H, the encoder / decoder may divide the coding unit into two transform units of size W×(H / 2) in its horizontal direction. Alternatively, if the 1-bit flag indicating the division of {1 / 4, 3 / 4} is 1, the coding unit may be divided into two transform units of size W×(H / 4) and W×(3H / 4). In the above two cases, the transformation may be performed on the upper transform unit, and DST-VII may be applied in the horizontal direction, and DCT-VIII may be applied in the vertical direction. As an example, if the width or height of the corresponding transform unit is greater than the maximum size of the DST-VII / DCT-VIII kernel allowed in SBT, DCT-II may be applied in the corresponding direction. For example, the maximum size of the DST-VII / DCT-VIII kernel allowed in SBT may be 32 points.

[0290] refer to Fig. 20 (d), if the size of the coding unit is W×H, the encoder / decoder can divide the coding unit into two transform units of size W×(H / 2) in the horizontal direction. Alternatively, if the 1-bit flag indicating the division of {1 / 4, 3 / 4} is 1, the coding unit can be divided into two transform units of size W×(3H / 4) and W×(H / 4). In the above two cases, the transform can be performed on the lower transform unit, and DST-VII can be applied in both the horizontal and vertical directions. As an example, if the width or height of the corresponding transform unit is greater than the maximum size of the DST-VII / DCT-VIII kernel allowed in SBT, DCT-II can be applied in the corresponding direction. For example, the maximum size of the DST-VII / DCT-VIII kernel allowed in SBT may be 32 points.

[0291] In an embodiment, SBT may be applied to an inter-frame prediction block, wherein cu_cbf, which is a syntax element indicating whether a syntax structure related to a transform (e.g., a transform tree syntax structure) exists, is 1, and whether SBT is applied may be signaled at the coding unit level. If SBT is applied at the coding unit level, a 1-bit flag indicating a division of {1 / 4, 3 / 4} or a division of 1 / 2 may be signaled. In addition, a 1-bit flag indicating a horizontal direction division or a vertical direction division may be signaled. In addition, a 1-bit flag may be further indicated, which indicates the transform unit to be transformed among the two divided transform units.

[0292] If SBT is applied, the transform kernel is determined depending on the location of the transform unit, so it can be omitted in Fig.15 The MTS flag and / or MTS index are signaled in the transform unit syntax structure in the SBT. Depending on the position of the corresponding transform unit and / or the width and height of the corresponding transform unit, the transform kernel applied to the transform unit to be transformed in the SBT can be selected as any one of DST-VII / DCT-VIII / DCT-II, and whether to apply TS can be selected in the same way. Fig.18 TS can be used in the transform unit syntax structure of Fig.19 (a) is true), then MaxMtsIdx may be determined to be 1, and whether TS is applied may be indicated by 1-bit signaling. Fig.18 TS cannot be used in the transform unit syntax structure in {For example, if Fig.19 (a), the fourth condition is false}, then MaxMtsIdx may be determined to be 0, and the MTS index syntax element may not be signaled.

[0293] As the size of the transform kernel increases, the energy compression performance is significantly improved, and therefore, as the size of the transform block increases, the coding efficiency is more likely to be improved by applying any one of DST-VII, DCT-VIII, and DCT-II transforms than when TS is applied. Therefore, in an embodiment, if the size of the transform block is greater than or equal to a predetermined specific size, the MTS index syntax element may not be signaled regardless of whether TS can be used.

[0294] In an embodiment, whether SBT can be used may be included in any one of a sequence parameter set (SPS), a picture parameter set (PPS), a slice header, a tile block group header, and a tile header, and then a 1-bit flag may be used to signal. In the present disclosure, the flag may be referred to as "sps_sbt_enabled_flag". Hereinafter, an embodiment of a method for signaling syntax related to SBT at the SPS level will be described by way of example with reference to Tables 9 to 11. Although in an embodiment of the present disclosure, the description will be based on the signaling method at the SPS level, the present disclosure is not limited thereto, and the signaling structure described below may be applied in the same manner to the case where signaling is performed at any level in the high-level syntax.

[0295] [Table 9]

[0296]

[0297] Referring to Table 9, in an embodiment of the present disclosure, the encoder / decoder may determine whether the SBT can be used in the current sequence by signaling sps_sbt_enabled_flag, which is a 1-bit flag indicating whether the SBT can be used in the current sequence.

[0298] [Table 10]

[0299]

[0300] Referring to Table 10, in an embodiment of the present disclosure, the encoder / decoder may determine whether SBT can be used depending on whether cores other than DCT-II can be used in the current sequence. In Table 10, sps_dct2_only_enabled_flag is a flag (or syntax element) indicating that only DCT-II transform cores can be used in the current sequence. Whether to signal sps_sbt_enabled_flag may be determined depending on sps_dct2_only_enabled_flag. For example, if sps_dct2_only_enabled_flag is 0, the decoder may parse sps_sbt_enabled_flag, which is a 1-bit flag indicating whether SBT can be used in the current sequence. The decoder may determine whether SBT can be used in the current sequence depending on the value of sps_sbt_enabled_flag. If sps_dct2_only_enabled_flag is 1, sps_sbt_enabled_flag may not be signaled and may be configured (or inferred) to be 0, and SBT may not be used in the current sequence.

[0301] [Table 11]

[0302]

[0303] Referring to Table 11, in an embodiment of the present disclosure, the encoder / decoder may determine whether a core other than DCT-II can be used in the current sequence depending on whether SBT can be used in the current sequence. As an embodiment, sps_sbt_enabled_flag may be first signaled, which is a 1-bit flag indicating whether SBT can be used in the current sequence. If sps_sbt_enabled_flag is 1, sps_sbt_dct2_enabled_flag may be signaled, which is a 1-bit flag indicating that only DCT-II is allowed to be used as a transform core used when SBT is applied. That is, if sps_sbt_dct2_enabled_flag is 1, when SBT is applied, the coding unit may be divided into two transform units, and DCT-II may be applied in both the horizontal and vertical directions of the transform unit. If sps_sbt_enabled_flag is 0, sps_sbt_dct2_enabled_flag may be configured to 0.

[0304] The encoder / decoder can reconstruct blocks in units of transform units, and in the case of intra prediction, the encoder / decoder can use the reconstructed samples around the current block as reference samples to generate a prediction block for the current block. In the case of intra prediction, the prediction error tends to increase as the distance from the reference sample increases. Therefore, if the transform unit is divided into small blocks relative to the current coding unit, and if recovery is performed sequentially in units of the divided small blocks, the prediction error, that is, the residual signal, can be reduced, and the coding efficiency can be improved. The intra sub-partitioning (ISP) coding mode is a method of performing prediction and recovery by dividing the block into multiple partitioning units when intra prediction is selected for the current coding unit.

[0305] Fig.21 It is a diagram illustrating a method of dividing a block in an intra-frame sub-division coding mode according to an embodiment of the present disclosure. According to an embodiment of the present disclosure, the current coding block can be divided in the horizontal or vertical direction. As an embodiment, the number of divided transform units may vary depending on the size of the coding unit. For example, if the size of the coding unit is 4×4, the ISP coding mode may not be applied to it. A coding unit of size 4×8 or 8×4 may be divided into two transform units. A coding unit having a size different from that may be divided into four transform units. The size of the coding unit to which the ISP coding mode can be applied may be determined so that the width or height of the coding unit is less than or equal to the maximum size of the luminance component transform block (condition A) and the product of the width and height of the coding unit is greater than the square of the minimum size of the luminance component transform block (condition B). In this case, the maximum size of the luminance component transform block may be 64, and the minimum size of the luminance component transform block may be 4. The size of the coding unit satisfying condition A may be classified into the following conditions i), ii) and iii).

[0306] Condition i) The width of the coding unit is less than or equal to the maximum size of the luma component transform block, and the height of the coding unit is greater than the maximum size of the luma component transform block.

[0307] Condition ii) The width of the coding unit is larger than the maximum size of the luma component transform block, and the height of the coding unit is smaller than or equal to the maximum size of the luma component transform block.

[0308] Condition iii) The width and height of the coding unit are both less than or equal to the maximum size of the luma component transform block.

[0309] In the case of condition i) among the above conditions i), ii) and iii), the coding unit can be divided into multiple transform units, wherein the width of the transform unit is the same as the width of the coding unit, and the height of the transform unit is the same as the maximum size of the luminance component transform block, without separate signaling. In the case of condition ii), the coding unit can be divided into multiple transform units, wherein the width of the transform unit is the same as the maximum size of the luminance component transform block, and the height of the transform unit is the same as the height of the coding unit, without separate signaling. That is, in the case of conditions i) and ii), since the division of the transform block is performed using the size of the coding unit and the maximum size of the luminance component transform block without signaling, the ISP coding mode requiring signaling may not be used. Therefore, condition A can be determined as a case where the width and height of the coding unit are both less than or equal to the maximum size of the luminance component transform block.

[0310] Fig.21 (a) shows a method of splitting a transform unit, which can be applied to a 4×8 or 8×4 coding unit. As an embodiment, if horizontal splitting is indicated for a coding unit of size W×H, the coding unit can be split into two transform units of size W×(H / 2), and if vertical splitting is indicated, the coding unit can be split into two transform units of size (W / 2)×H. A 1-bit flag can indicate whether the split is horizontal splitting or vertical splitting.

[0311] Fig.21 (b) shows a method of splitting a transform unit, which can be applied to a coding unit having a size other than 4×8 and 8×4. As an embodiment, if horizontal splitting is indicated for a coding unit of size W×H, the coding unit can be split into four transform units of size W×(H / 4), and if vertical splitting is indicated, the coding unit can be split into four transform units of size (W / 4)×H. A 1-bit flag can indicate whether the split is horizontal splitting or vertical splitting.

[0312] Fig. 22 1 is a diagram illustrating a method of selecting a transform kernel to be applied to a split transform unit in the case where an intra sub-partitioning (ISP) mode is applied according to an embodiment of the present disclosure. According to an embodiment of the present disclosure, if ISP is applied, the transform kernel applied to each transform unit may be determined depending on the size of the transform block and the intra prediction mode. Fig. 22 In , predModeIntra is a variable indicating the intra prediction mode used in the current coding unit, and trTypeHor and trTypeVer are variables indicating the transform kernels applied in the horizontal and vertical directions, respectively. Fig. 22In the description, it is assumed that 67 intra prediction modes are used, but the present disclosure is not limited thereto, and the embodiment can be applied to the embodiments already referred to in the same manner. Figure 6 The case of the wide angle mode in addition to the 67 intra prediction modes described above.

[0313] According to an embodiment of the present disclosure, the intra prediction mode may include two non-directional prediction modes (INTRA_PLANAR and INTRA_DC) and 65 directional prediction modes (INTRA_ANGULAR2, INTRA_ANGULAR3, ..., and INTRA_ANGULAR66), and the variables trTypeHor and trTypeVer may be determined according to the respective prediction modes. Here, trTypeHor and trTypeVer represent the transform kernel (or transform type) applied in the horizontal direction and the vertical direction, respectively. If the value of trTypeHor or trTypeVer is 0, it may indicate that the DCT-II transform kernel is applied in the corresponding direction, and if the value is 1, it may indicate that DST-VII is applied to the corresponding direction.

[0314] In an embodiment, if the width of the transform block is less than the minimum size of the transform block for the luminance component or greater than the maximum size of the DST-VII used in the ISP, DCT-II may be applied in the horizontal direction. In addition, if the height of the transform block is less than the minimum size of the transform block for the luminance component or greater than the maximum size of the DST-VII used in the ISP, DCT-II may be applied in the vertical direction. As an example, the minimum size of the transform block for the luminance component may be defined as 4, and the maximum size of the DST-VII may be defined as 16. The minimum size of the transform block may be referred to as a "first threshold", and the maximum size of the DST-VII may be referred to as a "second threshold".

[0315] In addition, in an embodiment, the encoder / decoder may apply DST-VII in both the horizontal and vertical directions in the non-directional prediction mode. In addition, the encoder / decoder may apply DST-VII in the horizontal direction and DCT-II in the vertical direction under the horizontal and directional modes (INTRA_ANGULAR2, INTRA_ANGULAR3, ..., INTRA_ANGULAR32 and INTRA_ANGULAR33). The encoder / decoder may apply DCT-II in the horizontal direction and DST-VII in the vertical direction under the vertical and directional modes (INTRA_ANGULAR34, INTRA_ANGULAR35, ..., INTRA_ANGULAR65 and INTRA_ANGULAR66).

[0316] In an embodiment, if the current coding unit is encoded by intra prediction, a 1-bit flag indicating whether ISP is applied in the coding unit level may be signaled. If ISP is applied to the current coding unit, a 1-bit flag indicating horizontal splitting or vertical splitting may be signaled. If ISP is applied to the current block, the transform kernel applied to each split transform unit may be determined depending on the intra prediction mode and the size of the transform unit without signaling, so it may be possible to Fig.15 The MTS flag and / or MTS index are not signaled in the transform unit syntax structure. In addition, since TS is not used in ISP coding mode, the transform skip flag may not be signaled. Fig.18 The MTS index may not be signaled in the transform unit syntax structure.

[0317] like Fig. 22 As described, if ISP is applied to the current block, the transform core applied to each transform block can be determined based on the intra-frame prediction mode without signaling. At the same time, this may increase the complexity of implementing the hardware decoder. The encoding of the intra-frame prediction mode and the recovery of the transform coefficients can be performed simultaneously in the existing hardware decoder pipeline structure, but when the ISP mode is applied, the recovery of the transform coefficients can only be performed when the encoding of the intra-frame prediction mode is completed, resulting in a delay corresponding thereto. Therefore, in the following, a method for determining the transform core applied to each transform block not based on the intra-frame prediction mode in the ISP encoding mode will be described.

[0318] In an embodiment of the present disclosure, the encoder / decoder may compare the width or height of the transform block with a predefined specific threshold value to determine the transform kernel (or transform type) of the block to which the ISP mode is applied. Since the DST-VII kernel effectively expresses the characteristics of the residual signal when intra-frame prediction is used, DST-VII can be applied in the horizontal direction when the width of the transform block is less than or equal to a specific threshold value, and DCT-II can be applied in the horizontal direction when the width of the transform block is greater than the threshold value. Here, the specific threshold value may be defined as the same value as the above-mentioned second threshold value (i.e., the maximum size of DST-VII used in ISP). If the height of the transform block is less than or equal to the threshold value, DST-VII can be applied in the vertical direction, and if its height is greater than the threshold value, DCT-II can be applied in the vertical direction. In this case, the threshold value may be defined as any value of 32 or less. As described above, as an embodiment, if the width of the transform block is less than the minimum size of the transform block for the luminance component (i.e., the first threshold value) or greater than the maximum size of DST-VII used in ISP, DCT-II can be applied in the horizontal direction. In addition, if the height of the transform block is less than the minimum size of the transform block for the luminance component or greater than the maximum size of DST-VII used in the ISP, DCT-II may be applied in the vertical direction. As an example, the minimum size of the transform block for the luminance component may be defined as 4, while the maximum size of DST-VII may be defined as 16.

[0319] In addition, in an embodiment of the present disclosure, DST-VII may be applied in both the horizontal and vertical directions of a square block in which the width and height of the transform block are both less than or equal to a threshold value, and DCT-II may be applied in both the horizontal and vertical directions of a square block in which the width and height are both greater than the threshold value. If the shorter side of the rectangular block is less than or equal to the threshold value, DST-VII may be applied in the corresponding direction, and if the shorter side of the rectangular block is greater than the threshold value, DCT-II may be applied therein. DCT-II may be applied to the longer side of the rectangular block in the corresponding direction.

[0320] In addition, in the embodiments of the present disclosure, by using Fig.15 and 18 The MTS-related syntax elements described in determine the transform kernel to be applied to each transform unit. Fig.18The transform unit syntax structure in the TU may signal the MTS index even when the ISP is used in the current coding unit. If the MTS index is signaled for each transform unit, the signaling overhead may be increased. Therefore, in the processing order, the MTS index may be signaled only in the first transform unit where there are non-zero transform coefficients for the luminance component transform block (i.e., tu_cbf_luma==1), and the signaled MTS is shared by all transform units. In this case, for example, it may also be signaled whether TS is applied.

[0321] In an embodiment, whether the ISP encoding mode can be used may be included in any one of a sequence parameter set (SPS), a picture parameter set (PPS), a slice header, a tile group header, and a tile header, and may be signaled by a 1-bit flag, and the flag may be referred to as "sps_isp_enabled_flag" in the present disclosure. Hereinafter, an embodiment of a method for signaling syntax related to the ISP encoding mode at the SPS level will be described with reference to Tables 12 to 14. Although in an embodiment of the present disclosure, a signaling method based on the SPS level will be described, the present disclosure is not limited thereto, and the signaling structure described below may be applied in the same manner to the case where signaling is performed at any level in the high-level syntax.

[0322] [Table 12]

[0323]

[0324] Referring to Table 12, in an embodiment of the present disclosure, the encoder / decoder may determine whether to use the ISP encoding mode in the current sequence by signaling sps_isp_enabled_flag, which is a 1-bit flag indicating whether ISP encoding can be used in the current sequence.

[0325] [Table 13]

[0326]

[0327] Referring to Table 13, in an embodiment of the present disclosure, the encoder / decoder may determine whether to use the ISP coding mode depending on whether cores other than DCT-II can be used in the current sequence. In Table 12, sps_dct2_only_enabled_flag is a flag (or syntax element) indicating that only the DCT-II transform core can be used in the current sequence. Depending on sps_dct2_only_enabled_flag, it can be determined whether to signal sps_isp_enabled_flag, which is a flag (or syntax element) indicating whether the ISP coding mode can be used in the current sequence. For example, if sps_dct2_only_enabled_flag is 0, the decoder may parse sps_isp_enabled_flag, which is a 1-bit flag indicating whether the ISP coding mode can be used in the current sequence. The decoder may determine whether the ISP coding mode can be used in the current sequence depending on the value of sps_isp_enabled_flag. If sps_dct2_only_enabled_flag is 1, sps_isp_enabled_flag may not be signaled and may be configured (or inferred) to be 0, and ISP coding mode may not be used in the current sequence.

[0328] [Table 14]

[0329]

[0330]

[0331] Referring to Table 14, in an embodiment of the present disclosure, the encoder / decoder may determine whether a core other than DCT-II can be used in the current sequence depending on whether the ISP coding mode can be used in the current sequence. As an embodiment, sps_isp_enabled_flag may be first signaled, which is a 1-bit flag indicating whether SBT can be used in the current sequence. If sps_isp_enabled_flag is 1, sps_isp_dct2_enabled_flag may be signaled, which is a 1-bit flag indicating that only DCT-II is allowed for the transform core used when the ISP coding mode is applied. That is, when sps_isp_dct2_enabled_flag is 1, when the ISP coding mode is applied, the coding unit may be divided into multiple transform units, and DCT-II may be applied in both the horizontal and vertical directions of the transform unit. If sps_isp_enabled_flag is 0, sps_isp_dct2_enabled_flag may be configured to 0.

[0332] Fig.23 and 24 is a diagram illustrating a process of obtaining information on whether there is a non-zero transform coefficient in a transform unit syntax structure in a case where SBT is applied according to an embodiment of the present disclosure.

[0333] exist Fig.23 In, the transform unit syntax structure includes syntax elements related to the transform unit and its processing process, and can receive the following as factors: (x0, y0) as the coordinates of the upper left corner of the current transform unit, tbWidth as the width of the transform block, tbHeight as the height of the transform block, treeType indicating the type of the coding tree currently being processed, and subTuIndx indicating the index of the transform unit processed in the transform tree. Since there is a correlation between the luminance component and the chrominance component, the luminance component and the chrominance component can be encoded in the same coding tree structure, but in order to improve the coding efficiency, the luminance component and the chrominance component can be encoded in different coding tree structures. The variable treeType can represent the type of the coding tree currently being processed, and if treeType is SINGLE_TREE, it can indicate that the coding tree currently being processed is a single tree, where the luminance component and the chrominance component have the same structure, and the corresponding tree can include all luminance components Y and chrominance components Cb and Cr.

[0334] In addition, if treeType is DUAL_TREE_LUMA, it can indicate that when the luminance component and the chrominance component are encoded in different coding tree structures, the currently processed coding tree is the luminance component coding tree, and the corresponding coding tree may include only the luminance component Y. If treeType is DUAL_TREE_CHROMA, it can indicate that when the luminance component and the chrominance component are encoded in different coding tree structures, the currently processed coding tree is the chrominance component coding tree, and the corresponding coding tree includes only the chrominance components Cb and Cr.

[0335] exist Fig.23 In the first conditional statement of step S2301 in , the decoder can identify whether the currently processed tree includes a luma component in order to parse tu_cbf_luma. That is, if treeType is SINGLE_TREE or DUAL_TREE_LUMA, the corresponding coding tree may include a luma component, and if treeType is DUAL_TREE_CHROMA, the corresponding coding tree may not include a luma component. Therefore, if treeType is DUAL_TREE_CHROMA, the decoder may not execute the content of the conditional statement in step S2301. If the current coding tree includes a luma component, the decoder identifies the condition for parsing tu_cbf_luma in the second conditional statement of step S2301. Here, IntraSubPartitionsSplitType represents a variable related to the intra sub-partitioning (ISP) technology for dividing the coding unit for intra prediction into NumIntraSubPartitions transform units.

[0336] The encoder / decoder may signal and parse whether ISP is applied to the current coding unit for intra prediction and the syntax elements for the partitioning method in the coding unit syntax (which is a syntax structure related to the coding unit). Therefore, a variable IntraSubPartitionsSplitType indicating the partition type of the transform unit in the ISP and a variable NumIntraSubPartitions indicating the number of partitioned transform units may be configured. If ISP is not applied to the corresponding coding unit, the variable IntraSubPartitionsSplitType may be configured to ISP_NO_SPLIT, and if ISP is applied to the corresponding coding unit, the variable IntraSubPartitionsSplitType may be configured to a value other than ISP_NO_SPLIT.

[0337] The cases where the second conditional statement is true in step S2301 can be classified into the following cases i), ii), iii) and iv).

[0338] i) ISP is not applied to the current coding unit (IntraSubPartitionsSplitType==ISP_NO_SPLIT), and SBT is not applied to the current coding unit (cu_sbt_flag==0).

[0339] That is, neither ISP nor SBT is applied to the current coding unit, and the transform unit is not divided by signaling and parsing explicit syntax elements. In this case, tu_cbf_luma can be parsed.

[0340] ii) ISP is not applied to the current coding unit (IntraSubPartitionsSplitType==ISP_NO_SPLIT), SBT is applied to the current coding unit (cu_sbt_flag==1), and the currently processed TU is the transform unit at the position where the residual signal exists in the SBT {(subTuIndex==0&&!cu_sbt_pos_flag)||(subTuIndex==1&&cu_sbt_pos_flag)}.

[0341] That is, if SBT is applied to the current coding unit, tu_cbf_luma can be signaled and parsed only for the transform unit at the position where the residual signal exists. In addition, for the transform unit at the position where the residual signal does not exist, the encoder / decoder can configure tu_cbf_luma to 0 without signaling and parsing it. If cu_sbt_pos_flag is 1, for the first transform unit (subTuIndex==0) of the two transform units divided by SBT, tu_cbf_luma, tu_cbf_cb, and tu_cbf_cr are all configured to 0 without signaling and parsing it. If cu_sbt_pos_flag is 0, for the second transform unit (subTuIndex==1) of the two transform units divided by SBT, tu_cbf_luma, tu_cbf_cb, and tu_cbf_cr can be configured to 0 without signaling and parsing it. Therefore, if SBT is applied to the current block, the transform unit at the position where the residual signal exists can be represented as ((subTuIndex==0&&!cu_sbt_pos_flag)||(subTuIndex==1&&cu_sbt_pos_flag)), and in this case, tu_cbf_luma can be signaled and parsed.

[0342] In an embodiment, if ISP is not applied to the current coding unit (IntraSubPartitionsSplitType==ISP_NO_SPLIT), if SBT is applied to the current coding unit (cu_sbt_flag==1), and if the currently processed transform unit is a transform unit at a position where no residual signal exists in the SBT (i.e., (subTuIndex==0&&cu_sbt_pos_flag)||(subTuIndex==1&&!cu_sbt_pos_flag)), tu_cbf_luma can be configured (or inferred) to be 0 without signaling and parsing it.

[0343] iii) ISP is applied to the current compilation unit (IntraSubPartitionsSplitType!=ISP_NO_SPLIT), and the currently processed transform unit is not the last one of the transform units split by ISP (subTuIndex <NumIntraSubPartitions-1)。

[0344] iv) ISP is applied to the current compilation unit (IntraSubPartitionsSplitType!=ISP_NO_SPLIT), and tu_cbf_luma is configured without signaling and the resolved condition is false (InferTuCbfLuma==0).

[0345] That is, when the transform unit is divided by ISP, for at least one or more transform units in NumIntraSubPartitions transform units, tu_cbf_luma must be 1. Therefore, if the current transform unit is the last transform unit (subTuIndex == NumIntraSubPartitions-1) divided by ISP, and if the tu_cbf_luma values ​​of the previous (NumIntraSubPartitions-1) transform units are all 0, it is obvious that the tu_cbf_luma of the current transform unit is 1, so the encoder / decoder can configure tu_cbf_luma to 1 without signaling and parsing it.

[0346] In the first conditional statement of step S2302, the decoder identifies whether the currently processed tree includes chroma components in order to parse tu_cbf_cb and tu_cbf_cr. That is, if treeType is SINGLE_TREE, or if treeType is DUAL_TREE_CHROMA, the corresponding coding tree includes chroma components; and if treeType is DUAL_TREE_LUMA, the corresponding coding tree does not include chroma components. Therefore, if treeType is DUAL_TREE_LUMA, the first conditional statement in step S2302 is false, and the content of the conditional statement is not executed. If, in step S2301, the current coding tree includes chroma components in the first conditional statement, the conditions for parsing tu_cbf_cb and tu_cbf_cr are identified in the second conditional statement of step S2302.

[0347] The cases where the second conditional statement is true in step S2302 can be classified into the following cases i), ii) and iii).

[0348] i) ISP is not applied to the current coding unit (IntraSubPartitionsSplitType==ISP_NO_SPLIT), and SBT is not applied to the current coding unit (cu_sbt_flag==0).

[0349] That is, neither ISP nor SBT is applied to the current coding unit, and the transform unit is not divided by signaling and parsing explicit syntax elements. In this case, the decoder can parse tu_cbf_cb and tu_cbf_cr.

[0350] ii) ISP is not applied to the current coding unit (IntraSubPartitionsSplitType==ISP_NO_SPLIT), SBT is applied to the current coding unit (cu_sbt_flag==1), and the currently processed transform unit is the transform unit at the position where the residual signal exists in the SBT {(subTuIndex==0&&!cu_sbt_pos_flag)||(subTuIndex==1&&cu_sbt_pos_flag)}.

[0351] That is, if SBT is applied to the current coding unit, tu_cbf_cb and tu_cbf_cr can be signaled and parsed only for the transform unit at the position where the residual signal exists. In addition, for the transform unit at the position where the residual signal does not exist, the encoder / decoder can configure tu_cbf_cb and tu_cbf_cr to 0 without signaling and parsing them. If cu_sbt_pos_flag is 1, for the first transform unit (subTuIndex==0) of the two transform units divided by SBT, tu_cbf_luma, tu_cbf_cb, and tu_cbf_cr are all configured to 0 without signaling and parsing them. If cu_sbt_pos_flag is 0, for the second transform unit (subTuIndex==1) of the two transform units divided by SBT, tu_cbf_luma, tu_cbf_cb, and tu_cbf_cr can be configured to 0 without signaling and parsing them. Therefore, if SBT is applied to the current block, the transform unit at the position where the residual signal exists can be represented as ((subTuIndex==0&&!cu_sbt_pos_flag)||(subTuIndex==1&&cu_sbt_pos_flag)), and in this case, tu_cbf_cb and tu_cbf_cr can be signaled and parsed.

[0352] In an embodiment, if ISP is not applied to the current coding unit (IntraSubPartitionsSplitType==ISP_NO_SPLIT), if SBT is applied to the current coding unit (cu_sbt_flag==1), and if the currently processed TU is a transform unit at a position where there is no residual signal in the SBT {(subTuIndex==0&&cu_sbt_pos_flag)||(subTuIndex==1&&!cu_sbt_pos_flag)}, tu_cbf_cb and tu_cbf_cr can be configured to 0 without signaling and parsing them.

[0353] iii) ISP is applied to the current compilation unit (IntraSubPartitionsSplitType!=ISP_NO_SPLIT), and the currently processed transform unit is the last one of the transform units split by ISP (subTuIndex==NumIntraSubPartitions-1).

[0354] That is, if the ISP is applied to the current block, the luminance component transform block can be divided into multiple transform blocks smaller than the size of the coding block. Additionally, the chrominance component transform block may not be divided and may be included in the last transform unit divided by the ISP. Therefore, if subTuIndex < NumIntraSubPartitions - 1, the corresponding transform unit does not include the residual signal for the chrominance component, so tu_cbf_cb and tu_cbf_cr can be configured to 0 without signaling and parsing them.

[0355] The values of tu_cbf_luma, tu_cbf_cb, and tu_cbf_cr can be configured according to the above method, and if the cbf of each color component is not 0, parsing at the transform coefficient level can be performed in the residual_coding syntax structure.

[0356] Fig.24 Another embodiment of processing tu_cbf_luma, tu_cbf_cb, and tu_cbf_cr in the transform unit syntax structure when the SBT is applied to the current coding unit is shown. Hereinafter, the differences from the method Fig.23 described with reference to Fig.23 will be mainly described, and the description Fig.24 made with reference to can be applied in the same way to the content omitted from the description

[0357] In an embodiment of the present disclosure, when the SBT is applied to the current block, if tu_cbf_luma is 0 for the transform unit at the position where there is a residual signal, there may be no coding gain obtained by dividing the transform unit into multiple parts. Therefore, when the SBT is applied, the encoder / decoder allows the SBT only when tu_cbf_luma of the transform unit with a residual signal is 1. In this case, if the SBT is applied to the current block, tu_cbf_luma at the position where there is a residual signal can be configured to 1 without signaling and parsing, and tu_cbf_luma at the position where there is no residual signal can be configured (or inferred) to 0 without signaling and parsing.

[0358] If the current coding tree includes a luminance component in the first conditional statement of step S2401, the decoder identifies the condition for parsing tu_cbf_luma in the second conditional statement of step S2401. The cases where the second conditional statement is true can be classified into the following cases i), ii), and iii).

[0359] i) ISP is not applied to the current coding unit (IntraSubPartitionsSplitType==ISP_NO_SPLIT), and SBT is not applied to the current coding unit (cu_sbt_flag==0).

[0360] That is, neither ISP nor SBT is applied to the current coding unit, and the transform unit is not divided by signaling and parsing explicit syntax elements. In this case, tu_cbf_luma can be parsed.

[0361] ii) ISP is applied to the current compilation unit (IntraSubPartitionsSplitType!=ISP_NO_SPLIT), and the currently processed transform unit is not the last transform unit split by ISP (subTuIndex <NumIntraSubPartitions-1)。

[0362] iii) Apply ISP to the current compilation unit (IntraSubPartitionsSplitType!=ISP_NO_SPLIT), and configure the condition of tu_cbf_luma to be false (InferTuCbfLuma==0) without signaling and parsing.

[0363] When the transform unit is divided by the ISP, for at least one or more transform units in the NumIntraSubPartitions transform units, tu_cbf_luma must be 1. Therefore, if the current transform unit is the last transform unit divided by the ISP (subTuIndex == NumIntraSubPartitions-1), and if the tu_cbf_luma values ​​of the previous (NumIntraSubPartitions-1) transform units are all 0, it is obvious that the value of tu_cbf_luma for the current transform unit is 1, so the encoder / decoder can configure tu_cbf_luma to 1 without signaling and parsing it.

[0364] If ISP is not applied to the current coding unit (IntraSubPartitionsSplitType==ISP_NO_SPLIT) in the second conditional statement of step S2401, and if SBT is applied to the current coding unit (cu_sbt_flag==1), the encoder / decoder can configure tu_cbf_luma according to the following i) to iv) without parsing and signaling it.

[0365] i)subTuIndex==0&&cu_sbt_pos_flag

[0366] In this case, tu_cbf_luma may be inferred to be 0. That is, since the first transform unit split by the currently processed SBT is at a position where there is no residual signal, tu_cbf_luma may be configured to be 0 without signaling and parsing it.

[0367] ii)subTuIndex==0&&! cu_sbt_pos_flag

[0368] In this case, tu_cbf_luma may be inferred to be 1. That is, since the first transform unit divided by the currently processed SBT is at a location where a residual signal exists, tu_cbf_luma may be configured to be 1 without signaling and parsing it.

[0369] iii)subTuIndex==1&&cu_sbt_pos_flag

[0370] In this case, tu_cbf_luma may be inferred to be 1. That is, since the second transform unit divided by the currently processed SBT is at a location where a residual signal exists, tu_cbf_luma may be configured to be 1 without signaling and parsing it.

[0371] iv)subTuIndex==1&&! cu_sbt_pos_flag

[0372] In this case, tu_cbf_luma may be inferred to be 0. That is, since the second transform unit divided by the currently processed SBT is at a position where there is no residual signal, tu_cbf_luma may be configured to be 0 without signaling and parsing it.

[0373] Fig.25 1 is a diagram illustrating a coding unit syntax structure for processing syntax elements related to a coding unit according to an embodiment of the present disclosure. The coding unit syntax structure may receive as input: the coordinates (x0, y0) of the upper left corner of the current coding unit as the coordinates of the upper left corner of the current picture, cbWidth as the width of the current coding unit, cbHeight as the height of the current coding unit, and treeType as a variable indicating the type of the coding tree currently being processed.

[0374] In an embodiment, based on the characteristic that there is a high correlation between the luminance component and the chrominance component, if the luminance component and the chrominance component are encoded in the same coding tree structure, the image can be efficiently encoded. If treeType is SINGLE_TREE, it can be indicated that the luminance component and the chrominance component have been encoded in the same coding tree structure, and the currently processed coding unit may include a coding block (CB) for the luminance component and a coding block for the chrominance component. On the other hand, if the luminance component and the chrominance component are encoded in different coding tree structures in a slice / tile that only allows intra-frame prediction, the coding efficiency can be improved.

[0375] If the tree type is DUAL_TREE_LUMA indicating the tree type of the luma component in the dual tree, it may indicate that in the case where the luma component and the chroma component are encoded in different coding tree structures from each other, the currently processed coding tree is a coding tree for the luma component, and the currently processed coding unit in the coding tree may include only the luma component. That is, the current coding unit may include only the coding block for the luma component.

[0376] If the tree type is a tree type DUAL_TREE_CHROMA indicating a chroma component in a dual tree, it may indicate that in the case where a luma component and a chroma component are encoded in different coding tree structures from each other, the currently processed coding tree is a coding tree for the chroma component, and the currently processed coding unit in the coding tree may include only the chroma component. That is, the current coding unit may include only the coding blocks for the chroma component.

[0377] refer to Fig.25 , in the coding unit syntax structure, the encoder / decoder can signal and parse the syntax elements indicating whether the prediction method of the current coding unit is intra-frame prediction, inter-frame prediction, or intra-frame block copy (IBC) prediction. The prediction method can be determined based on the syntax elements signaled and parsed in the coding unit level. The value of the variable CuPredMode[x0][y0] can be determined according to the prediction method, and if CuPredMode[x0][y0] is MODE_INTRA, the prediction method of the current coding unit can be intra-frame prediction. If CuPredMode[x0][y0] is MODE_INTER, the prediction method of the current coding unit can be inter-frame prediction. If CuPredMode[x0][y0] is MODE_IBC, the prediction method of the current coding unit can be intra-frame block copy prediction.

[0378] The encoder / decoder can signal and parse the syntax elements related to the prediction method according to the value of CuPredMode[x0][y0] in the coding unit syntax structure to obtain the information required for prediction.

[0379] In step S2501, if the prediction method of the current coding unit (or coding block) is intra prediction (CuPredMode[x0][y0]==MODE_INTRA), pcm-flag may be signaled and parsed, which is a 1-bit flag indicating whether a pulse code modulation (PCM) mode as one of the intra prediction methods is applied. If it is indicated that PCM can be used in the SPS as a high level (i.e., sps_pcm_enabled_flag==1), and if the size of the current coding unit satisfies a specific condition, the encoder / decoder may apply the PCM mode to the current coding unit.

[0380] In an embodiment, the size condition in which the PCM mode can be applied may be defined as the following: the width of the block is greater than or equal to MinIpcmCbSizeY and less than or equal to MaxIpcmCbSizeY, and the height of the block is greater than or equal to MinIpcmCbSizeY and less than or equal to MaxIpcmCbSizeY, such as Fig.25 As shown. pcm_flag can be signaled and parsed only when the PCM mode can be applied, and the encoder / decoder can determine whether to apply the PCM mode to the current coding unit based on pcm_flag. If pcm_flag is 1, the PCM mode can be applied to the current coding unit, and the encoder / decoder can encode the pixel sample using a predetermined number of bits without prediction and transformation.

[0381] On the other hand, if pcm_flag is 0, it may indicate that intra prediction using a non-directional or directional intra prediction mode, etc., is applied to the current coding unit. If intra prediction is applied, the encoder / decoder may use the reconstructed samples around the current block as reference samples. In addition, in an embodiment of the present disclosure, multiple reconstructed reference sample lines around the current block may be used. For example, the reference sample line used in the intra prediction of the current block may be indicated in the form of an index. The encoder / decoder may signal and parse the syntax element intra_luma_ref_idx indicating the reference sample line to determine the reference sample line index used in the prediction of the current block.

[0382] In an embodiment, the use of the above-mentioned multiple reference sample lines may be limited to the top coding unit in the CTU (i.e., the coding unit having the same y coordinate value of the top left corner as the y coordinate value of the top left corner of the CTU). This can be identified by performing a modulo operation on the y coordinate y0 of the current coding unit and CtbSizeY as a variable representing the size of the luma coding block. That is, if y0%CtbSizeY is 0, it may indicate that the current coding unit is one of the top coding units in the CTU. In this case, the intra_luma_ref_idx syntax element may not be signaled, and the decoder may configure (or infer) the value of the corresponding syntax element to 0 without parsing it.

[0383] In addition, according to an embodiment of the present disclosure, in order to improve the performance of intra-frame prediction and reduce the residual signal, the current block can be divided into multiple sub-blocks to perform prediction and transformation. Since the reconstructed samples around the current block are used as reference samples to perform intra-frame prediction, the accuracy of the prediction may tend to decrease as the distance from the reference sample increases, and the energy of the residual signal may tend to increase. Therefore, if the current block is divided into multiple sub-blocks and prediction and transformation are performed at the sub-block level, the coding efficiency can be improved. Intra-frame prediction based on such sub-block division can be referred to as "intra-frame sub-division (ISP) mode".

[0384] In step S2502, the decoder may parse a flag (or syntax element) indicating whether to apply the ISP to the current coding unit. Fig.25In the code, a flag indicating whether ISP is applied to the current coding unit may be referred to as an "ISP mode flag (intra_subpartitions_mode_flag) (or ISP flag)". If the ISP mode flag is 1, it may indicate that ISP can be applied to the current block. The conditions under which ISP can be applied may be defined (or configured) as the case where the reference sample line index is 0 (i.e., intra_luma_ref_idx[x0][y0] == 0), the width of the current coding block is less than or equal to the maximum size of the luminance transform block (MaxTbSizeY) (i.e., cbWidth<=MaxTbSizeY), and the height of the current coding block is less than or equal to the maximum size of the luminance transform block (i.e., cbHeight<=MaxTbSizeY). In addition, the minimum number of samples of the current coding block may be considered. If the number of samples of the current coding block (cbWidth*cbHeight) is greater than the square of MinTbSizeY representing the minimum size of the luminance transform block, the encoder / decoder may apply ISP. If all the above conditions are met, the encoder / decoder can apply ISP to the current luma coding block, and can signal and parse the ISP mode flag to indicate whether ISP is applied to the current block. If ISP cannot be applied, the ISP mode flag may not be signaled and parsed, and the decoder may configure (or infer) its value to 0.

[0385] In step S2502, if the ISP is applied to the current block, a syntax element indicating a partitioning method for the sub-block may be signaled and parsed. If the ISP mode flag is 1, this may indicate that the ISP is applied to the current luma coding block, and the encoder / decoder may determine the partitioning method for the sub-block by signaling and parsing the ISP partition flag (intra_subpartitions_split_flag). In an embodiment, the operation of identifying the condition for the block size (i.e., cbWidth<=MaxTbSizeY&&cbHeight<=MaxTbSizeY) in step S2502 may be omitted. This is due to the fact that whether the ISP is applied to the current block may be recognized by only identifying the ISP mode flag. Therefore, according to another embodiment of the present disclosure, the conditional statement identified in step S2502 to parse the ISP partition flag may be expressed as if (intra_subpartitions_mode_flag[x0][y0]==1).

[0386] In an embodiment, the encoder / decoder may configure (determine or derive) a variable ISP split type (IntraSubPartitionsSplitType) indicating a split for a sub-block based on the ISP mode flag and the ISP split flag. If the ISP mode flag is 0, the ISP split flag may not be signaled and parsed, and the decoder may configure it to 0. In this case, the ISP split type may be configured as ISP_NO_SPLIT, which is a value indicating that ISP is not applied. On the other hand, if the ISP mode flag is 1, the ISP split flag may be signaled and parsed. If the ISP split flag is 0, the ISP split type may be configured as ISP_HOR_SPLIT, which is a value indicating horizontal split; and if the ISP split flag is 1, the ISP split type may be configured as ISP_VER_SPLIT, which is a value indicating vertical split.

[0387] The decoder may parse syntax elements related to the intra prediction mode after parsing syntax elements related to the ISP, thereby determining a prediction mode to be applied to the current block.

[0388] In step S2503, if CuPredMode[x0][y0] is not MODE_INTRA, and if treeType is not DUAL_TREE_CHROMA, CuPredMode[x0][y0] as the prediction mode of the current coding unit can be MODE_INTER or MODE_IBC, and the decoder can parse the syntax elements related thereto.

[0389] In step S2504, the decoder may parse and process syntax elements related to the residual signal. If PCM is applied to the current block, prediction and transformation are not performed. Therefore, if pcm_flag[x0][y0] is 1, parsing and processing of syntax elements related to the residual signal may not be performed in step S2504. That is, parsing and processing of syntax elements related to the residual signal may be performed only when PCM is not applied to the current block.

[0390] In step S2504, if the current block is not predicted as intra mode (CuPredMode[x0][y0]!=MODE_INTRA) and the mode is not skip mode or merge mode (merge_flag[x0][y0]==0), the decoder can parse cu_cbf, which is a flag (or syntax element) indicating whether there is a transform tree syntax as a syntax structure related to the residual signal relative to the current coding unit.

[0391] At the same time, in the case of inter-frame prediction, the residual signal can be concentrated and distributed in any side area of ​​the block, and using this characteristic, if the block is divided into two areas and only one area is transformed and quantized, the residual signal can be effectively compressed in the inter-frame prediction block. This technology can be called "sub-block transform (SBT)". The conditions for applying SBT can be defined as follows.

[0392] Condition i) Inter prediction is applied to the current coding unit (CuPredMode[x0][y0] == MODE_INTER).

[0393] Condition ii) indicates that SBT can be used in a higher level including the current coding unit (sps_sbt_enabled_flag==1).

[0394] In condition ii), sps_sbt_enabled_flag, which is a 1-bit flag indicating whether SBT can be applied to a high level, may be signaled, and the decoder may determine whether SBT can be applied to a current sequence by parsing the sps_sbt_enabled_flag.

[0395] Condition iii) Combined intra-inter prediction (CIIP) is not applied (ciip_flag[x0][y0] == 0).

[0396] CIIP is a special prediction method in the merge mode, and means a mode of merging a prediction block obtained by merging a candidate and a prediction block obtained by intra prediction, thereby generating a prediction block for the current block. In this case, since the residual signal has a characteristic of not being concentrated in any side area of ​​the block, even if SBT is applied to the block to which CIIP is applied, the encoding efficiency cannot be improved. Therefore, SBT may not be applied to the block to which CIIP is applied.

[0397] Condition iv) The width of the current block is less than or equal to the maximum size to which SBT can be applied (MaxSbtSize), and the height of the current block is less than or equal to the maximum size to which SBT can be applied (cbWidth<=MaxSbtSize&&cbHeight<=MaxSbtSize).

[0398] If SBT is indicated in a high level (sps_sbt_enabled_flag==1) in condition iv), information about the maximum size of a block to which SBT can be applied may be signaled and parsed, and MaxSbtSize may be determined based on the information about the maximum size of a block to which SBT can be applied.

[0399] In addition, in an embodiment of the present disclosure, the encoder / decoder may further identify the following conditions in order to determine whether the SBT can be applied to the current coding unit.

[0400] Condition a)allowSbtVerH=cbWidth>=8

[0401] In condition a), allowSbtVerH is a variable indicating whether vertical 1 / 2 splitting is feasible. If the width of the current block is 8 or more, allowSbtVerH can be configured to be true. If vertical 1 / 2 splitting is applied, the current coding unit can be divided into two transform units of size (cbWidth / 2)×cbHeight.

[0402] Condition b)allowSbtVerQ=cbWidth>=16

[0403] In condition b), allowSbtVerQ is a variable indicating whether vertical 1 / 4 split is feasible. If the width of the current block is 16 or more, allowSbtVerQ can be configured to be true. If vertical 1 / 4 split is applied, the current coding unit can be divided into two transform units of size (cbWidth / 4)×cbHeight and (3*cbWidth / 4)×cbHeight.

[0404] Condition c)allowSbtHorH=cbHeight>=8

[0405] In condition c), allowSbtHorH is a variable indicating whether horizontal 1 / 2 splitting is feasible. If the height of the current block is 8 or higher, allowSbtHorH can be configured to be true. If horizontal 1 / 2 splitting is applied, the current coding unit can be divided into two transform units of size cbWidth×(cbHeight / 2).

[0406] Condition d)allowSbtHorQ=cbHieght>=16

[0407] In condition d), allowSbtHorQ is a variable indicating whether horizontal 1 / 4 splitting is feasible. If the height of the current block is 16 or more, allowSbtHorQ can be configured to be true. If horizontal 1 / 4 splitting is applied, the current coding unit can be divided into two transform units of size cbWidth×(cbHeight / 4) and cbWidth×(3*cbHeight / 4).

[0408] If all of the above conditions i), ii), iii) and iv) are true, and if at least one of the four variables configured in conditions a), b), c) and d) is true, the encoder / decoder may apply SBT to the current coding unit. Whether to apply SBT may be determined by signaling and parsing cu_sbt_flag as a 1-bit flag. If cu_sbt_flag is 1, it may indicate that SBT is applied to the current coding unit, and the encoder / decoder may use additional syntax elements related to SBT to determine the partitioning method.

[0409] In addition, in an embodiment of the present disclosure, if SBT is applied to the current block (ie, cu_sbt_flag==1), and if both 1 / 2 partition and 1 / 4 partition are possible ({allowSbtVerH||allowSbtHorH)&&(allowSbtVerQ||allowSbtHorQ)}, cu_sbt_quad_flag may be signaled and parsed, which is a 1-bit flag indicating whether 1 / 4 partition is possible. The decoder may determine 1 / 2 partition or 1 / 4 partition by parsing cu_sbt_quad_flag. In addition, if both horizontal and vertical splitting are feasible (e.g., (cu_sbt_quad_flag&&allowSbtVerQ&&allowSbtHorQ)||(!cu_sbt_quad_flag&&allowSbtVerH&&allowSbtHorH)}, the decoder can parse cu_sbt_horizontal_flag, which is a 1-bit flag indicating whether horizontal splitting is feasible. In addition, the decoder can parse cu_sbt_pos_flag as a 1-bit flag to determine the transform unit in which the residual signal may exist from the two transform units divided by SBT.

[0410] The decoder may perform partitioning of the transform unit and parsing and processing of syntax elements related to the residual signal in the transform tree syntax structure based on ISP partitioning information, SBT partitioning information, cu_cbf, etc.

[0411] Fig.26is a diagram illustrating a transform tree syntax structure according to an embodiment of the present disclosure. The decoder can process the transform tree partitioning through the transform tree syntax structure, and can perform parsing and processing of syntax elements related to the residual signal in the transform unit (or transform block) corresponding to the leaf node of the transform tree. The transform tree can receive the following as input: (x0, y0) as the coordinates of the upper left corner of the split node, tbWidth as the width of the split node, tbHeight as the height of the split node, and treeType as a variable indicating the type of the coding tree currently being processed. If the transform tree syntax is called first, (x0, y0) may be the same as the coordinates of the upper left corner of the coding unit, and tbWidth, tbHeight, and treeType may be the same as the width, height, and treeType of the coding unit, respectively. The case of splitting the root node of the transform tree having the same size as the coding unit can be classified into the following three cases.

[0412] i) The size of the root node and the split node is larger than the maximum size of the luma transform block (MaxTbSizeY) (tbWidth>MaxTbSizeY||tbHeight>MaxTbSizeY).

[0413] Here, MaxTbSizeY is a variable representing the maximum size of the luma transform block, and may be determined depending on the predefined maximum size of the transform kernel. As the maximum size of the transform kernel increases, energy compression generally increases, thereby improving coding efficiency. However, since the pipeline buffers of the hardware encoder and decoder can be determined depending on the maximum size of the transform kernel, the maximum size of the transform kernel may be determined in consideration of complexity and coding efficiency. MaxTbSizeY may be configured by the encoder and decoder to be the same fixed constant value, or may be configured according to a syntax element signaled at a high level.

[0414] If the width (tbWidth) or height (tbHeight) of the root node and the intermediate nodes of the transform tree is greater than MaxTbSizeY, the encoder / decoder may not explicitly signal and parse the split method, and may split the transform tree until the width and height of the split nodes are less than or equal to MaxTbSizeY. Here, MaxTbSizeY represents the maximum transform size. For example, if MaxTbSizeY is 64 for a root node of 128×128 (the same size as a coding unit), the transform tree can be split into four nodes of size 64×64, and the leaf nodes of size 64×64 may become transform units without further splitting. As another example, if MaxTbSizeY is 64 for a root node of 128×64, the transform tree can be split into two nodes of size 64×64, and the leaf nodes of size 64×64 may become transform units without further splitting. If the width or height of the root node and the intermediate nodes of the transform tree is greater than MaxTbSizeY, the decoder can recursively call the transform tree to split the transform tree, and if the width and height of the root node and the intermediate nodes of the transform tree are both less than or equal to MaxTbSizeY, the corresponding nodes can become transform units that do not require further division, and the syntax elements related to the residual signal in the transform unit syntax structure can be parsed and processed.

[0415] ii) Apply SBT to the current compilation unit (cu_sbt_flag==1).

[0416] Unlike the above case i), if SBT is applied, the method of partitioning the transform tree may be determined by signaling of an explicit syntax element in a coding unit level.

[0417] iii) Apply ISP to the current compilation unit (IntraSubPartitionsSplitType!=ISP_NO_SPLIT).

[0418] Unlike the above case i), if ISP is applied, the method of splitting the transform tree can be determined by signaling an explicit syntax element in the coding unit level. If the ISP split type is ISP_HOR_SPLIT, horizontal splitting by ISP can be indicated, and if the ISP split type is ISP_VER_SPLIT, vertical splitting by ISP can be indicated.

[0419] In the above cases i), ii) and iii), they can be classified into: case i) where the partitioning of the transform tree is performed without signaling of explicit syntax elements; and cases ii) and iii) where the partitioning method is indicated by signaling of explicit syntax elements. Fig.26 The transform tree syntax structure shown in can perform all transform tree partitions described in the above cases i), ii) and iii), and Fig.26 The transformation tree syntax structure in can be expressed as shown in the following Table 15.

[0420] [Table 15]

[0421]

[0422]

[0423] In step S2601, if the ISP split type is ISP_NO_SPLIT, implicit splitting may be performed based on information about a node size and a maximum size of a transform block for a luma component.

[0424] In step S2602, if the ISP split type is not ISP_NO_SPLIT and if cu_sbt_flag is 1, the encoder / decoder may split the transform tree based on syntax elements related to the SBT signaled and parsed in the coding unit. In step S2603, if the ISP split type is not ISP_NO_SPLIT and if cu_sbt_flag is 0, the encoder / decoder may perform horizontal splitting or vertical splitting based on the ISP split type.

[0425] In the above Fig.25 In the compilation unit syntax structure described in , if SBT is applied to the current block (i.e., cu_sbt_flag==1), the ISP mode flag and the ISP split flag, which are syntax elements related to ISP, may not be signaled and parsed, and the ISP split type may be configured as ISP_NO_SPLIT. Therefore, even if Fig.26 In the transform tree syntax structure of , SBT is applied to the current block. There is also a problem that because the ISP split type is ISP_NO_SPLIT, the split of the transform tree is performed based on the size of the node and the maximum size of the luma transform block instead of by SBT. This is problematic for both the encoder and the decoder. That is, in Fig.26 In the transform tree syntax structure, even if cu_sbt_flag is 1, there is a problem that the transform tree is always split based on the information about the node size in the first branch and the maximum size of the luminance transform block, and step S2602 of splitting the transform tree by SBT cannot be performed because the value of the variable ISP split type is ISP_NO_SPLIT.

[0426] Fig. 27 is a diagram illustrating a transformation tree syntax structure according to another embodiment of the present disclosure. Fig.26 The problem in the transformation tree syntax structure can be Fig. 27 The transformation tree syntax structure in is shown in Table 16 below.

[0427] [Table 16]

[0428]

[0429] exist Fig. 27 In the transform tree syntax structure shown, first, in step S2701, if the ISP split type is ISP_NO_SPLIT and if SBT is not applied to the current block (cu_sbt_flag==0), implicit splitting can be performed based on information about the node size and the maximum size of the luminance transform block. Next, in step S2702, if the ISP split type is ISP_NO_SPLIT and if cu_sbt_flag is 1, the transform tree can be split based on syntax elements related to the SBT signaled and parsed in the coding unit. Next, in steps S2703 and S2704, if the ISP split type is not ISP_NO_SPLIT and if cu_sbt_flag is 0, horizontal splitting or vertical splitting by ISP can be performed based on the ISP split type.

[0430] Different from Fig.26 In the transform tree syntax structure, when the condition for dividing the transform tree is checked according to the size of the node and the maximum size of the luma transform block, by checking both the ISP information and the SBT information, if the SBT is applied to the current block, the transform tree may not be divided in the first branch, and the transform tree may be divided according to the SBT information in the second branch. Accordingly, according to Fig. 27 The encoder and decoder of the transform tree syntax structure in can perform all of the following partitions: partition based on the size of the node and the maximum size of the luma transform block, partition by SBT information, and partition by ISP information.

[0431] Fig.28 is a diagram illustrating a transformation tree syntax structure according to another embodiment of the present disclosure. Fig.26 The problem in the transformation tree syntax structure can be Fig.28 The transformation tree syntax structure in is represented as shown in Table 17 below.

[0432] [Table 17]

[0433]

[0434] exist Fig.28In the transform tree syntax structure shown, first, in step S2801, if SBT is applied to the current block (cu_sbt_flag==1), the transform tree can be divided based on the syntax elements related to the SBT signaled and parsed in the coding unit. Next, in step S2802, if cu_sbt_flag is 0 and if the ISP split type is ISP_NO_SPLIT, implicit splitting can be performed based on information about the node size and maximum size of the luma transform block. Next, in steps S2803 and S2804, if cu_sbt_flag is 0 and if the ISP split type is not ISP_NO_SPLIT, horizontal splitting or vertical splitting by ISP can be performed based on the ISP split type.

[0435] Different from Fig.26 The transform tree syntax structure in the cu_sbt_flag structure is configured to prioritize the conditions for the division of the SBT. If the SBT is applied to the current block, the transform tree can be divided based on the SBT information. In addition, if the SBT is not applied to the current block (cu_sbt_flag==0), implicit division based on information about the node size and the maximum size of the luma transform block and division by the ISP can be performed according to the ISP division type variable.

[0436] Fig.29 is a flowchart illustrating a video signal processing method according to an embodiment of the present disclosure. Fig.29 Although the description will be made based on a decoder for the sake of convenience, the present disclosure is not limited thereto, and the video signal processing method according to the present embodiment may be applied to an encoder in substantially the same manner.

[0437] The decoder obtains an intra sub-partitioning (ISP) mode flag indicating whether an ISP mode is applied to a current block from a video signal (S2901).

[0438] If the ISP mode is applied to the current block, the decoder obtains an ISP division flag indicating a division direction of the current block from the video signal (S2902).

[0439] The decoder divides the current block into a plurality of transform blocks based on the division direction (S2903).

[0440] The decoder generates a residual block of the transform block by performing inverse transform on each transform block (S2904).

[0441] The decoder reconstructs the current block based on the residual block (S2905).

[0442] As described above, the step of generating a residual block may include the following steps: determining a horizontal transform type applied in a horizontal direction of the current transform block from among a plurality of predefined transform types based on the width of the current transform block, regardless of an intra-prediction mode of the current block; determining a vertical transform type applied in a vertical direction of the current transform block from among a plurality of predefined transform types based on the height of the current transform block, regardless of the intra-prediction mode of the current block; and performing an inverse transform on the current transform block using the horizontal transform type and the vertical transform type.

[0443] In addition, as described above, the step of determining the horizontal transform type can be performed as follows: if the width of the current transform block is less than the first threshold or greater than the second threshold, the horizontal transform type is determined to be the first transform type, and if the width of the current transform block is greater than or equal to the first threshold and less than or equal to the second threshold, the horizontal transform type is determined to be the second transform type.

[0444] In addition, as described above, the step of determining the vertical transformation type can be performed as follows: if the height of the current transformation block is less than the first threshold or greater than the second threshold, the vertical transformation type is determined to be the first transformation type, and if the height of the current transformation block is greater than or equal to the first threshold and less than or equal to the second threshold, the vertical transformation type is determined to be the second transformation type.

[0445] In addition, as described above, the first transform type may be defined as a transform kernel based on discrete cosine transform type 2 (DCT-2), and the second transform type may be defined as a transform kernel based on discrete sine transform type 7 (DST-7).

[0446] In addition, as described above, the first threshold may be defined based on the minimum size of the transform block of the luminance component.

[0447] In addition, as described above, the second threshold may be defined based on a maximum size of the second transform type used in the ISP mode.

[0448] In addition, as described above, the first threshold value may be defined as 4, and the second threshold value may be defined as 16.

[0449] In addition, as described above, the horizontal transform type may be determined based on the width of the current transform block regardless of the height of the current transform block, and the vertical transform type may be determined based on the height of the current transform block regardless of the width of the current transform block.

[0450] The above-mentioned embodiments of the present invention may be implemented by various means. For example, the embodiments of the present invention may be implemented by hardware, firmware, software or a combination thereof.

[0451] For the case of implementation through hardware, the method according to the embodiment of the present invention can be implemented by one or more of an application specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a processor, a controller, a microcontroller, a microprocessor, etc.

[0452] In the case of implementation by firmware or software, the method according to the embodiment of the present invention can be implemented in the form of a module, process or function that performs the above functions or operations. The software code can be stored in a memory and driven by a processor. The memory can be located inside or outside the processor and can exchange data with the processor in various known ways.

[0453] Certain embodiments may also be implemented in the form of a recording medium including computer executable instructions, such as a program module executed by a computer. Computer readable media may be any available media that can be accessed by a computer, and may include all volatile, non-volatile, removable and non-removable media. In addition, computer readable media may include computer storage media and communication media. Computer storage media include all volatile, non-volatile, removable and non-removable media implemented in any method or technology for storing information such as computer readable instructions, data structures, program modules or other data. Typically, communication media include computer readable instructions, other data (such as data structures or program modules) or other transmission mechanisms of modulated data signals, and include any information transmission media.

[0454] The above description of the present invention is for illustrative purposes only, and it will be understood that those skilled in the art to which the present invention belongs can change the present invention without changing the technical ideas or basic features of the present invention, and the present invention can be easily modified in other specific forms. Therefore, the above embodiments are illustrative and are not limited in all aspects. For example, each component described as a single entity can be distributed and implemented, and similarly, the components described as distributed can also be implemented in an associated manner.

[0455] The scope of the present invention is defined by the appended claims rather than the detailed description above, and all changes or modifications derived from the meaning and scope of the appended claims and their equivalents should be construed as being included in the scope of the present invention.

[0456] Industrial Applicability

[0457] As described above, the preferred embodiments of the present disclosure have been disclosed for illustrative purposes, and those skilled in the art may perform improvements, modifications, substitutions or additions to the preferred embodiments in various other embodiments without departing from the technical spirit and scope disclosed in the appended claims.

Claims

1. A video signal decoding device comprising a processor, in, The processor is configured to: When the intra sub-partition ISP mode is applied to a current block, the current block is divided into a plurality of transform blocks, wherein the plurality of transform blocks are segmented based on a segmentation type, Wherein, whether the segmentation type is horizontal or vertical is indicated by the ISP segmentation flag, determining a horizontal transform kernel applied to a current transform block among the plurality of transform blocks, determining a vertical transform kernel applied to the current transform block, reconstructing the current block based on at least one of the horizontal transform kernel and / or the vertical transform kernel, When the width of the current transform block is less than a first threshold or greater than a second threshold, the horizontal transform kernel is determined to be a transform kernel based on discrete cosine transform type-2DCT-2, When the width of the current transform block is greater than or equal to the first threshold and less than or equal to the second threshold, the horizontal transform kernel is determined to be a transform kernel based on discrete sine transform type-7 DST-7, When the height of the current transform block is less than the first threshold or greater than the second threshold, the vertical transform kernel is determined to be the transform kernel based on the DCT-2, and When the height of the current transform block is greater than or equal to the first threshold and less than or equal to the second threshold, the vertical transform kernel is determined to be the transform kernel based on the DST-7.

2. The video signal decoding device according to claim 1, in, Whether the ISP mode is applied to the current block is indicated by an ISP mode flag.

3. The video signal decoding device according to claim 1, in, The horizontal transform kernel and the vertical transform kernel are determined regardless of an intra prediction mode of the current block.

4. The video signal decoding device according to claim 1, in, The first threshold is defined as 4, and the second threshold is defined as 16.

5. The video signal decoding device according to claim 1, in, determining the horizontal transform kernel based on the width of the current transform block regardless of the height of the current transform block, and Wherein, the vertical transform kernel is determined based on the height of the current transform block regardless of the width of the current transform block.

6. A video signal encoding device comprising a processor, in, The processor is configured to: A bit stream to be decoded by a decoder is obtained using a decoding method, the decoding method comprising: When the intra sub-partition ISP mode is applied to a current block, the current block is divided into a plurality of transform blocks, wherein the plurality of transform blocks are segmented based on a segmentation type, Wherein, whether the segmentation type is horizontal or vertical is indicated by the ISP segmentation flag, determining a horizontal transform kernel applied to a current transform block among the plurality of transform blocks; determining a vertical transform kernel applied to the current transform block; and reconstructing the current block based on at least one of the horizontal transform kernel and / or the vertical transform kernel, When the width of the current transform block is less than a first threshold or greater than a second threshold, the horizontal transform kernel is determined to be a transform kernel based on discrete cosine transform type-2DCT-2, When the width of the current transform block is greater than or equal to the first threshold and less than or equal to the second threshold, the horizontal transform kernel is determined to be a transform kernel based on discrete sine transform type-7 DST-7, When the height of the current transform block is less than the first threshold or greater than the second threshold, the vertical transform kernel is determined to be the transform kernel based on the DCT-2, and When the height of the current transform block is greater than or equal to the first threshold and less than or equal to the second threshold, the vertical transform kernel is determined to be the transform kernel based on the DST-7.

7. The video signal encoding device according to claim 6, in, The intra-sub-partition ISP mode is applied to the current block.

8. The video signal encoding device according to claim 6, in, Whether the ISP mode is applied to the current block is indicated by an ISP mode flag.

9. The video signal encoding device according to claim 6, in, The first threshold is defined as 4, and the second threshold is defined as 16.

10. The video signal encoding device according to claim 6, in, determining the horizontal transform kernel based on the width of the current transform block regardless of the height of the current transform block, and Wherein, the vertical transform kernel is determined based on the height of the current transform block regardless of the width of the current transform block.

11. A method for obtaining a bit stream, the method comprising: When the intra sub-partition ISP mode is applied to a current block, the current block is divided into a plurality of transform blocks, wherein the plurality of transform blocks are segmented based on a segmentation type, Wherein, whether the segmentation type is horizontal or vertical is indicated by the ISP segmentation flag, determining a horizontal transform kernel applied to a current transform block among the plurality of transform blocks; determining a vertical transform kernel applied to the current transform block; and obtaining the bitstream including information related to segmenting the current block, When the width of the current transform block is less than a first threshold or greater than a second threshold, the horizontal transform kernel is determined to be a transform kernel based on discrete cosine transform type-2DCT-2, When the width of the current transform block is greater than or equal to the first threshold and less than or equal to the second threshold, the horizontal transform kernel is determined to be a transform kernel based on discrete sine transform type-7 DST-7, When the height of the current transform block is less than the first threshold or greater than the second threshold, the vertical transform kernel is determined to be the transform kernel based on the DCT-2, and When the height of the current transform block is greater than or equal to the first threshold and less than or equal to the second threshold, the vertical transform kernel is determined to be the transform kernel based on the DST-7.

12. The method according to claim 11, in, The intra-sub-partition ISP mode is applied to the current block.

13. The method according to claim 11, in, Whether the ISP mode is applied to the current block is indicated by an ISP mode flag.

14. The method according to claim 11, in, The first threshold is defined as 4, and the second threshold is defined as 16.

15. The method according to claim 11, in, determining the horizontal transform kernel based on the width of the current transform block regardless of the height of the current transform block, and Wherein, the vertical transform kernel is determined based on the height of the current transform block regardless of the width of the current transform block.

16. A video signal processing method, the method comprising: When the intra sub-partition ISP mode is applied to a current block, the current block is divided into a plurality of transform blocks, wherein the plurality of transform blocks are segmented based on a segmentation type, Wherein, whether the segmentation type is horizontal or vertical is indicated by the ISP segmentation flag, determining a horizontal transform kernel applied to a current transform block among the plurality of transform blocks; determining a vertical transform kernel applied to the current transform block; and reconstructing the current block based on at least one of the horizontal transform kernel and / or the vertical transform kernel, When the width of the current transform block is less than a first threshold or greater than a second threshold, the horizontal transform kernel is determined to be a transform kernel based on discrete cosine transform type-2DCT-2, When the width of the current transform block is greater than or equal to the first threshold and less than or equal to the second threshold, the horizontal transform kernel is determined to be a transform kernel based on discrete sine transform type-7 DST-7, When the height of the current transform block is less than the first threshold or greater than the second threshold, the vertical transform kernel is determined to be the transform kernel based on the DCT-2, and When the height of the current transform block is greater than or equal to the first threshold and less than or equal to the second threshold, the vertical transform kernel is determined to be the transform kernel based on the DST-7.