Image coding method based on transform and device therefor

By using LFNST and MTS technologies in video encoding, video data is efficiently encoded, which solves the problem of high-resolution video transmission and storage costs, and achieves more efficient video data compression and transmission.

JP2025013560AActive Publication Date: 2025-01-24LG ELECTRONICS INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2024194935
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2019-10-10
Filing Date
2024-11-07
Publication Date
2025-01-24
Estimated Expiration
2040-10-08

AI Technical Summary

Technical Problem

The prior art is difficult to efficiently compress and transmit high-resolution, high-quality video data, especially virtual reality and augmented reality content, resulting in increased transmission and storage costs.

Method used

Low-frequency non-separable transform (LFNST) and multi-transform selection (MTS) technologies are used to encode video data, secondary transformation is performed through LFNST transformation coefficients to improve encoding efficiency, and appropriate transformation cores are selected through MTS to adapt to different video characteristics.

Benefits of technology

Improves video encoding efficiency, reduces transmission and storage costs, and enhances adaptability to different video characteristics.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025013560000001_ABST
    Figure 2025013560000001_ABST
Patent Text Reader

Abstract

To provide a method and a device that increase the efficiency of second transform through coding of an LFNST index.SOLUTION: An image decoding method includes steps of: deriving residual samples by applying at least one of LFNST and MTS to transform coefficients; and generating a reconstructed picture on the basis of the residual samples. The LFNST is performed on the basis of an LFNST transform set, an LFNST kernel included in the LFNST transform set, and an LFNST index indicating the LFNST kernel. A first bin of a syntax element bin string for the LFNST index is derived on the basis of different context information according to a tree type of a current block, and a second bin of the syntax element bin string is derived on the basis of preconfigured context information.SELECTED DRAWING: Figure 16
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] This document relates to video coding technology, and more particularly to a transform-based video coding method and apparatus in a video coding system. [Background technology]

[0002] Recently, the demand for high-resolution, high-quality images / videos such as 4K or 8K or higher UHD (Ultra High Definition) images / videos is increasing in various fields. As the image / video data has higher resolution and quality, the amount of information or bits transmitted relatively increases compared to existing image / video data, so when image data is transmitted using existing media such as wired or wireless broadband lines or when image / video data is stored using existing storage media, the transmission and storage costs increase.

[0003] In addition, interest and demand for immersive media such as virtual reality (VR), artificial reality (AR) content and holograms has been increasing recently, and the broadcast of images / videos with different image characteristics from real images, such as game images, is increasing.

[0004] Therefore, in order to effectively compress, transmit, store, and play back high-resolution, high-quality image / video information having the above-mentioned various characteristics, a highly efficient image / video compression technology is required. Summary of the Invention [Problem to be solved by the invention]

[0005] The technical problem of this document is to provide a method and apparatus for increasing video coding efficiency.

[0006] Another technical problem of this document is to provide a method and apparatus for improving the efficiency of LFNST index coding.

[0007] Another technical problem of this document is to provide a method and apparatus for improving the efficiency of the secondary transform through coding of the LFNST index. [Means for solving the problem]

[0008] According to an embodiment of the present document, there is provided a video decoding method performed by a decoding device, the method including the steps of: deriving residual samples by applying at least one of LFNST or MTS to transform coefficients; and generating a reconstructed picture based on the residual samples, the LFNST being performed based on an LFNST transform set, LFNST kernels included in the LFNST transform set, and an LFNST index indicating the LFNST kernel, a first bin of a syntax element bin string for the LFNST index being derived based on context information that differs depending on a tree type of the current block, and a second bin of the syntax element bin string being derived based on preset context information.

[0009] The method further includes the steps of deriving context information of a syntax element for the LFNST index, decoding bins of a syntax element bin string for the LFNST index based on the context information, and deriving a value of the syntax element for the LFNST index.

[0010] If the tree type of the current block is single tree, the first bin is derived as first context information, and if the tree type of the current block is not single tree, the first bin is derived as second context information.

[0011] The context information for the second bin is derived as third context information different from the first context information and the second context information.

[0012] The LFNST transform set includes two LFNST kernels, and the value for the syntax element includes one of 0 indicating that the LFNST is not applied to the current block, 1 indicating the first LFNST kernel among the LFNST kernels, or 2 indicating the second LFNST kernel among the LFNST kernels.

[0013] The values ​​for the syntax elements are binarized with a truncated unary code, where value 0 for the syntax element is binarized as "0", value 1 for the syntax element is binarized as "10", and value 2 for the syntax element is binarized as "11".

[0014] According to an embodiment of the present document, there is provided a video encoding method performed by an encoding apparatus, the method including the steps of: deriving transform coefficients for the current block by applying at least one of LFNST or MTS to residual samples; and encoding an LFNST index indicating an LFNST kernel and quantized residual information, the LFNST being performed based on an LFNST transform set and the LFNST kernels included in the LFNST transform set, a first bin of a syntax element bin string for the LFNST index being derived based on context information that differs depending on a tree type of the current block, and a second bin of the syntax element bin string being derived based on preset context information.

[0015] According to another embodiment of the present document, a digital storage medium is provided having stored thereon video data including encoded video information and a bitstream generated by a video encoding method performed by an encoding apparatus.

[0016] According to another embodiment of the present document, a digital storage medium is provided having stored thereon video data including encoded video information and a bitstream that enables a decoding device to perform the video decoding method. Effect of the Invention

[0017] According to the document, it can improve the overall image / video compression efficiency.

[0018] According to this document, the efficiency of LFNST index coding can be improved.

[0019] According to this document, the efficiency of secondary transformation can be improved through coding of LFNST indexes.

[0020] Effects that can be obtained through a specific example of the present specification are not limited to the effects listed above. For example, there may be various technical effects that a person having ordinary skill in the related art can understand or derive from the present specification. Thus, the specific effects of the present specification are not limited to those explicitly described in the present specification, but may include various effects that can be understood or derive from the technical features of the present specification. [Brief description of the drawings]

[0021] [Figure 1] 1 illustrates generally an example of a video / image coding system to which this document can be applied;

[0022] [Diagram 2] 1 is a diagram illustrating the configuration of a video / image encoding device to which this document can be applied.

[0023] [Diagram 3] 1 is a diagram illustrating the configuration of a video / image decoding device to which this document can be applied.

[0024] [Figure 4] 1 illustrates an exemplary structural diagram of a content streaming system to which this document applies.

[0025] [Diagram 5] 1 illustrates a schematic of a multiple conversion technique according to one embodiment of the present document;

[0026] [Figure 6] An intra-directional mode with 65 prediction directions is shown as an example.

[0027] [Figure 7] FIG. 1 is a diagram for explaining a RST according to one embodiment of this document.

[0028] [Figure 8] FIG. 13 is a diagram illustrating a sequence in which output data of a forward linear transform is arranged into a one-dimensional vector, according to an example.

[0029] [Figure 9] FIG. 13 is a diagram illustrating a sequence in which output data of a forward quadratic transform is arranged in a two-dimensional block, according to an example.

[0030] [Figure 10] FIG. 1 illustrates a wide-angle intra-prediction mode according to one embodiment of the present document.

[0031] [Figure 11] FIG. 13 is a diagram showing a block configuration to which LFNST is applied.

[0032] [Figure 12] FIG. 13 is a diagram showing an example of an output data arrangement of a forward LFNST.

[0033] [Figure 13]FIG. 13 is a diagram illustrating zeroing out in a block to which 4×4 LFNST is applied, according to an example.

[0034] [Figure 14] FIG. 13 is a diagram illustrating zeroing out in a block to which 8×8 LFNST is applied, according to an example.

[0035] [Figure 15] FIG. 1 illustrates a block diagram of a CABAC encoding system according to an embodiment.

[0036] [Figure 16] 1 is a flow chart illustrating the operation of a video decoding device according to one embodiment of the present document.

[0037] [Figure 17] 1 is a flow chart illustrating the operation of a video encoding device according to an embodiment of the present document. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0038] This document may have various modifications and may have various embodiments, and a specific embodiment will be illustrated in the drawings and described in detail. However, this is not intended to limit this document to a specific embodiment. The terms used in this specification are merely used to describe a specific embodiment, and are not intended to limit the technical ideas of this document. A singular expression includes a plural expression unless the context clearly indicates otherwise. In this specification, the terms "include" or "have" specify the presence of a feature, number, step, operation, component, part, or combination thereof described in the specification, and should be understood not to preclude the presence or addition of one or more other features, numbers, steps, operations, components, parts, or combinations thereof.

[0039] Meanwhile, each component in the drawings described in this document is illustrated independently for the convenience of explaining the different characteristic functions, and does not mean that each component is realized by separate hardware or software. For example, two or more components among the components may be combined to form one component, or one component may be divided into multiple components. An embodiment in which each component is integrated and / or separated is also included in the scope of the rights of this document as long as it does not deviate from the essence of this document.

[0040] DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings. In the following, the same reference numerals are used for the same components in the drawings, and duplicated descriptions of the same components will be omitted.

[0041] This document relates to video / image coding. For example, the methods / embodiments disclosed in this document may be associated with the Versatile Video Coding (VVC) standard (ITU-T Rec. H.266), a next-generation video / image coding standard beyond VVC, or other video coding related standards (e.g., the High Efficiency Video Coding (HEVC) standard (ITU-T Rec. H.265), the essential video coding (EVC) standard, the AVS2 standard, etc.).

[0042] This document presents various embodiments for video / image coding, which embodiments may also be implemented in combination with each other, unless otherwise stated.

[0043] In this document, video may refer to a collection of a series of images over time. A picture generally refers to a unit that indicates one image at a specific time, and a slice / tile is a unit that constitutes a part of a picture in coding. A slice / tile may include one or more coding tree units (CTUs). One picture may be composed of one or more slices / tiles. One picture may be composed of one or more tile groups. One tile group may include one or more tiles.

[0044] A pixel or a pel may refer to the smallest unit constituting one picture (or image). A term corresponding to a pixel may also be used as a "sample." A sample may generally refer to a pixel or a pixel value, may refer to only a pixel / pixel value of a luma component, or may refer to only a pixel / pixel value of a chroma component. Alternatively, a sample may refer to a pixel value in the spatial domain, or may refer to a transform coefficient in the frequency domain when such a pixel value is transformed into the frequency domain.

[0045] A unit may indicate a basic unit of image processing. A unit may include at least one of a specific region of a picture and information related to the region. One unit may include one luma block and two chroma (e.g., cb, cr) blocks. A unit may be used interchangeably with terms such as block or area depending on the case. In a general case, an M×N block may include a set (or array) of samples or transform coefficients consisting of M columns and N rows.

[0046] In this document, the terms " / " and "," should be interpreted to indicate "and / or." For instance, "A / B" is interpreted as "A and / or B," and "A,B" is interpreted as "A and / or B." Additionally, "A / B / C" means "at least one of A, B, and / or C." Also, "A,B,C" means "at least one of A, B, and / or C." (In this document, the term " / " and "," should be interpreted to indicate "and / or." For instance, the expression "A / B" may mean "A and / or B." Further, "A,B" may mean "A and / or B." Further, "A / B / C" may mean "at least one of A,B,and / or C." Also, "A / B / C" may mean "at least one of A,B,and / or C.")

[0047] Additionally, in this document, the term "or" should be interpreted to indicate "and / or." For example, "A or B" may comprise 1) only A, 2) only B, or 3) both A and B. In other words, the term "or" in this document should be interpreted to indicate "additionally or alternatively."

[0048] In this specification, "at least one of A and B" can mean "only A," "only B," or "both A and B." In addition, in this specification, the expressions "at least one of A or B" and "at least one of A and / or B" can be interpreted as "at least one of A and B."

[0049] In addition, in this specification, "at least one of A, B and C" can mean "only A," "only B," "only C," or "any combination of A, B and C." Furthermore, "at least one of A, B or C" or "at least one of A, B and / or C" can mean "at least one of A, B and C."

[0050] Furthermore, parentheses used in the present specification may mean "for example." Specifically, when "prediction (intra prediction)" is displayed, "intra prediction" is proposed as an example of "prediction." In other words, "prediction" in the present specification is not limited to "intra prediction," and "intra prediction" is proposed as an example of "prediction." Furthermore, when "prediction (i.e., intra prediction)" is displayed, "intra prediction" is proposed as an example of "prediction."

[0051] In this specification, technical features individually described in one drawing may be embodied individually or simultaneously.

[0052] FIG. 1 illustrates a schematic diagram of an example of a video / image coding system to which this document can be applied.

[0053] Referring to Figure 1, the video / image coding system may include a source device and a receiving device. The source device may transmit encoded video / image information or data to the receiving device via a digital storage medium or a network in the form of a file or streaming.

[0054] The source device may include a video source, an encoding device, and a sending unit. The receiving device may include a receiving unit, a decoding device, and a renderer. The encoding device may be referred to as a video / video encoding device, and the decoding device may be referred to as a video / video decoding device. The transmitter may be included in the encoding device. The receiver may be included in the decoding device. The renderer may also include a display unit, which may be a separate device or an external component.

[0055] A video source may acquire video / images through a video / image capture, synthesis, or generation process. A video source may include a video / image capture device and / or a video / image generation device. A video / image capture device may include, for example, one or more cameras, a video / image archive containing previously captured video / images, etc. A video / image generation device may include, for example, a computer, a tablet, a smartphone, etc., and may (electronically) generate video / images. For example, a virtual video / image may be generated via a computer, etc., in which case the video / image capture process may be replaced by a process in which related data is generated.

[0056] An encoding device may encode an input video / image. The encoding device may perform a series of steps such as prediction, transformation, quantization, etc. for compression and coding efficiency. The encoded data (encoded video / image information) may be output in the form of a bitstream.

[0057] The transmitting unit can transmit the encoded video / image information or data output in the form of a bitstream to a receiving unit of a receiving device via a digital storage medium or a network in the form of a file or streaming. The digital storage medium can include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. The transmitting unit can include elements for generating a media file through a predetermined file format and can include elements for transmission via a broadcasting / communication network. The receiving unit can receive / extract the bitstream and transmit it to a decoding device.

[0058] The decoding device can decode the video / image by performing a series of steps such as inverse quantization, inverse transformation, and prediction that correspond to the operations of the encoding device.

[0059] The renderer may render the decoded video / image, and the rendered video / image may be displayed via a display unit.

[0060] 2 is a diagram for briefly explaining the configuration of a video / image encoding device to which this document can be applied. Hereinafter, the video encoding device may include an image encoding device.

[0061] Referring to FIG. 2, the encoding apparatus 200 may include an image partitioner 210, a predictor 220, a residual processor 230, an entropy encoder 240, an adder 250, a filter 260, and a memory 270. The predictor 220 may include an inter predictor 221 and an intra predictor 222. The residual processor 230 may include a transformer 232, a quantizer 233, a dequantizer 234, and an inverse transformer 235. The residual processor 230 may further include a subtractor 231. The adder 250 may be referred to as a reconstructor or a reconstructed block generator. The image division unit 210, the prediction unit 220, the residual processing unit 230, the entropy encoding unit 240, the addition unit 250, and the filtering unit 260 may be configured with one or more hardware components (e.g., an encoder chip set or a processor) according to an embodiment. Also, the memory 270 may include a decoded picture buffer (DPB) and may be configured with a digital storage medium. The hardware components may further include the memory 270 as an internal / external component.

[0062] The image division unit 210 may divide an input image (or picture, frame) input to the encoding device 200 into one or more processing units. As an example, the processing units may be called coding units (CUs). In this case, the coding units may be recursively divided from a coding tree unit (CTU) or a largest coding unit (LCU) according to a quad-tree binary-tree ternary-tree (QTBTTT) structure. For example, one coding unit may be divided into a plurality of coding units of a deeper depth based on a quad-tree structure, a binary tree structure, and / or a ternary structure. In this case, for example, the quad-tree structure may be applied first, and then the binary tree structure and / or the ternary structure may be applied. Alternatively, the binary tree structure may be applied first. The coding procedure according to this document may be performed based on a final coding unit that is not further divided. In this case, the largest coding unit may be used as the final coding unit based on coding efficiency according to image characteristics, or the coding unit may be recursively divided into coding units of lower depths as necessary, and a coding unit of an optimal size may be used as the final coding unit. Here, the coding procedure may include procedures such as prediction, transformation, and restoration, which will be described later. As another example, the processing unit may further include a prediction unit (PU) or a transform unit (TU). In this case, the prediction unit and the transform unit may each be divided or partitioned from the final coding unit described above.The prediction unit is a unit of sample prediction, and the transform unit is a unit for deriving transform coefficients and / or a unit for deriving a residual signal from the transform coefficients.

[0063] The unit may be used interchangeably with terms such as block or area. In general, an M×N block may refer to a set of samples or transform coefficients consisting of M columns and N rows. A sample may generally refer to a pixel or pixel value, or may refer to only a pixel / pixel value of a luma component, or may refer to only a pixel / pixel value of a chroma component. A sample may be used as a term corresponding to a pixel or pel of a picture (or image).

[0064] The subtraction unit 231 may subtract a prediction signal (predicted block, prediction sample, or prediction sample array) output from the prediction unit 220 from an input image signal (original block, original sample, or original sample array) to generate a residual signal (residual block, residual sample, or residual sample array), and the generated residual signal is transmitted to the conversion unit 232. The prediction unit 220 may perform prediction on a block to be processed (hereinafter, referred to as a current block) and generate a predicted block including a prediction sample for the current block. The prediction unit 220 may determine whether intra prediction or inter prediction is applied in units of the current block or CU. The prediction unit may generate various information related to prediction, such as prediction mode information, and transmit the information to the entropy encoding unit 240, as described below in the description of each prediction mode. The prediction information may be encoded by the entropy encoding unit 240 and output in the form of a bitstream.

[0065] The intra prediction unit 222 may predict the current block by referring to samples in the current picture. The referenced samples may be located in the neighborhood of the current block or may be located away from the current block depending on the prediction mode. In the intra prediction, the prediction mode may include a plurality of non-directional modes and a plurality of directional modes. The non-directional modes may include, for example, a DC mode and a planar mode. The directional modes may include, for example, 33 directional prediction modes or 65 directional prediction modes depending on the fineness of the prediction direction. However, this is merely an example, and more or less directional prediction modes may be used depending on the setting. The intra prediction unit 222 may determine the prediction mode to be applied to the current block by using the prediction mode applied to the neighboring block.

[0066] The inter prediction unit 221 may derive a predicted block for a current block based on a reference block (reference sample array) specified by a motion vector on a reference picture. In this case, in order to reduce the amount of motion information transmitted in the inter prediction mode, the motion information may be predicted in units of a block, a sub-block, or a sample based on the correlation of the motion information between a neighboring block and the current block. The motion information may include a motion vector and a reference picture index. The motion information may further include inter prediction direction (L0 prediction, L1 prediction, Bi prediction, etc.) information. In the case of inter prediction, the neighboring block may include a spatial neighboring block present in the current picture and a temporal neighboring block present in the reference picture. The reference picture including the reference block and the reference picture including the temporal neighboring block may be the same or different. The temporal neighboring block may be called a collocated reference block, a collocated CU (colCU), etc., and the reference picture including the temporal neighboring block may be called a collocated picture (colPic). For example, the inter prediction unit 221 may generate information indicating which candidate is used to derive a motion vector and / or a reference picture index of the current block by forming a motion information candidate list based on neighboring blocks. Inter prediction may be performed based on various prediction modes, and for example, in the case of a skip mode and a merge mode, the inter prediction unit 221 may use motion information of neighboring blocks as motion information of the current block. In the case of the skip mode, unlike the merge mode, a residual signal is not transmitted.In the case of motion vector prediction (MVP) mode, the motion vector of the neighboring block can be used as a motion vector predictor, and the motion vector of the current block can be indicated by signaling the motion vector difference.

[0067] The prediction unit 220 may generate a prediction signal based on various prediction methods described below. For example, the prediction unit may apply intra prediction or inter prediction for prediction of one block, and may simultaneously apply intra prediction and inter prediction. This may be called combined inter and intra prediction (CIIP). The prediction unit may also perform intra block copy (IBC) for prediction of a block. The intra block copy may be used for content image / moving image coding such as games, for example, as in screen content coding (SCC). IBC basically performs prediction within a current picture, but may be performed similarly to inter prediction in that a reference block is derived within the current picture. That is, IBC may use at least one of the inter prediction techniques described in this document.

[0068] The prediction signal generated through the inter prediction unit 221 and / or the intra prediction unit 222 may be used to generate a restored signal or may be used to generate a residual signal. The transform unit 232 may generate transform coefficients by applying a transform technique to the residual signal. For example, the transform technique may include a discrete cosine transform (DCT), a discrete sine transform (DST), a graph-based transform (GBT), or a conditionally non-linear transform (CNT). Here, the GBT refers to a transform obtained from a graph when the relationship information between pixels is expressed as a graph. The CNT refers to a transform obtained based on a prediction signal generated using all previously reconstructed pixels. In addition, the transform process may be applied to pixel blocks having the same square size, or may be applied to non-square variable-size blocks.

[0069] The quantization unit 233 quantizes the transform coefficients and transmits them to the entropy encoding unit 240, which may encode the quantized signal (information on the quantized transform coefficients) and output the quantized signal as a bitstream. The information on the quantized transform coefficients may be referred to as residual information. The quantization unit 233 may rearrange the quantized transform coefficients in a block form into a one-dimensional vector form based on a coefficient scan order, and may generate information on the quantized transform coefficients based on the quantized transform coefficients in the one-dimensional vector form. The entropy encoding unit 240 may perform various encoding methods, such as exponential Golomb, context-adaptive variable length coding (CAVLC), and context-adaptive binary arithmetic coding (CABAC). The entropy encoding unit 240 may also encode information required for video / image restoration (e.g., values ​​of syntax elements, etc.) together with or separately from the quantized transform coefficients. The encoded information (e.g., encoded video / image information) may be transmitted or stored in the form of a bitstream in network abstraction layer (NAL) unit units. The video / image information may further include information on various parameter sets, such as an adaptation parameter set (APS), a picture parameter set (PPS), a sequence parameter set (SPS), or a video parameter set (VPS). The video / image information may further include general constraint information. Signaling / transmitted information and / or syntax elements described later in this document may be encoded through the above-mentioned encoding procedure and included in the bitstream.The bitstream may be transmitted via a network or may be stored in a digital storage medium, where the network may include a broadcasting network and / or a communication network, and the digital storage medium may include various storage media such as a USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. A transmitter (not shown) for transmitting the signal output from the entropy encoding unit 240 and / or a storage unit (not shown) for storing the signal may be configured as an internal / external element of the encoding apparatus 200, or the transmitter may be included in the entropy encoding unit 240.

[0070] The quantized transform coefficients output from the quantizer 233 may be used to generate a prediction signal. For example, a residual signal (residual block or residual sample) may be reconstructed by applying inverse quantization and inverse transform to the quantized transform coefficients via the inverse quantizer 234 and the inverse transformer 235. The adder 250 may generate a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample, or reconstructed sample array) by adding the reconstructed residual signal to the prediction signal output from the predictor 220. If there is no residual for the current block, such as when a skip mode is applied, the predicted block may be used as a reconstructed block. The generated reconstructed signal may be used for intra prediction of the next current block in the current picture, and may also be used for inter prediction of the next picture after filtering as described below.

[0071] Meanwhile, luma mapping with chroma scaling (LMCS) may be applied during picture encoding and / or restoration.

[0072] The filtering unit 260 may apply filtering to the reconstructed signal to improve subjective / objective image quality. For example, the filtering unit 260 may apply various filtering methods to the reconstructed picture to generate a modified reconstructed picture, and may store the modified reconstructed picture in the memory 270, specifically, in the DPB of the memory 270. The various filtering methods may include, for example, deblocking filtering, sample adaptive offset (SAO), an adaptive loop filter, a bilateral filter, etc. The filtering unit 260 may generate various information related to filtering and transmit it to the entropy encoding unit 240, as will be described later in the description of each filtering method. The filtering information may be encoded by the entropy encoding unit 240 and output in the form of a bitstream.

[0073] The modified reconstructed picture transmitted to the memory 270 can be used as a reference picture in the inter predictor 221. When inter prediction is applied through this, the encoding apparatus can avoid prediction mismatch between the encoding apparatus 200 and the decoding apparatus, and can also improve encoding efficiency.

[0074] The DPB of the memory 270 may store the modified reconstructed picture to be used as a reference picture in the inter prediction unit 221. The memory 270 may store motion information of a block from which motion information in the current picture is derived (or encoded) and / or motion information of a block in an already reconstructed picture. The stored motion information may be transmitted to the inter prediction unit 221 to be used as motion information of a spatial neighboring block or motion information of a temporal neighboring block. The memory 270 may store reconstructed samples of reconstructed blocks in the current picture and transmit them to the intra prediction unit 222.

[0075] FIG. 3 is a diagram illustrating the configuration of a video / image decoding device to which this document can be applied.

[0076] Referring to FIG. 3, the decoding device 300 may include an entropy decoder 310, a residual processor 320, a predictor 330, an adder 340, a filter 350, and a memory 360. The predictor 330 may include an inter predictor 332 and an intra predictor 331. The residual processor 320 may include a dequantizer 321 and an inverse transformer 322. The entropy decoding unit 310, the residual processor 320, the predictor 330, the adder 340, and the filter 350 may be configured as one hardware component (e.g., a decoder chipset or processor) according to an embodiment. Also, the memory 360 may include a decoded picture buffer (DPB) and may be configured as a digital storage medium. The hardware components may further include a memory 360 as an internal / external component.

[0077] When a bitstream including video / image information is input, the decoding apparatus 300 can restore an image corresponding to a process in which the video / image information is processed by the encoding apparatus of FIG. 2. For example, the decoding apparatus 300 can derive a unit / block based on block division related information obtained from the bitstream. The decoding apparatus 300 can perform decoding using a processing unit applied in the encoding apparatus. Thus, the processing unit for decoding is, for example, a coding unit, and the coding unit can be divided from a coding tree unit or a maximal coding unit according to a quad tree structure, a binary tree structure, and / or a ternary tree structure. One or more transform units can be derived from the coding unit. And, the restored image signal decoded and output by the decoding apparatus 300 can be reproduced by a reproduction device.

[0078] The decoding apparatus 300 may receive a signal output from the encoding apparatus of FIG. 2 in the form of a bitstream, and the received signal may be decoded via the entropy decoding unit 310. For example, the entropy decoding unit 310 may derive information (e.g., video / image information) required for image restoration (or picture restoration) by parsing the bitstream. The video / image information may further include information on various parameter sets, such as an adaptation parameter set (APS), a picture parameter set (PPS), a sequence parameter set (SPS), or a video parameter set (VPS). In addition, the video / image information may further include general constraint information. The decoding apparatus may decode a picture further based on information on the parameter set and / or the general constraint information. Signaling / received information and / or syntax elements described later in this document may be obtained from the bitstream by being decoded via the decoding procedure. For example, the entropy decoding unit 310 may decode information in a bitstream based on a coding method such as exponential Golomb coding, CAVLC, or CABAC, and output values ​​of syntax elements required for image restoration and quantized values ​​of transform coefficients related to residuals. More specifically, the CABAC entropy decoding method may receive bins corresponding to each syntax element in a bitstream, determine a context model using information on a syntax element to be decoded and decoding information of adjacent and to-be-decoded blocks or information on symbols / bins decoded in a previous step, predict the occurrence probability of bins according to the determined context model, and perform arithmetic decoding of the bins to generate symbols corresponding to the values ​​of each syntax element.In this case, the CABAC entropy decoding method may update the context model using information of the decoded symbol / bin for the context model of the next symbol / bin after determining the context model. Prediction information from the information decoded by the entropy decoding unit 310 may be provided to the prediction unit 330, and information on the residual on which the entropy decoding is performed by the entropy decoding unit 310, i.e., quantized transform coefficients and related parameter information, may be input to the inverse quantization unit 321. In addition, filtering information from the information decoded by the entropy decoding unit 310 may be provided to the filtering unit 350. Meanwhile, a receiving unit (not shown) for receiving a signal output from the encoding device may be further configured as an internal / external element of the decoding device 300, or the receiving unit may be a component of the entropy decoding unit 310. Meanwhile, the decoding device according to the present document may be called a video / image / picture decoding device, and the decoding device may be divided into an information decoder (video / image / picture information decoder) and a sample decoder (video / image / picture sample decoder). The information decoder may include the entropy decoding unit 310, and the sample decoder may include at least one of the inverse quantization unit 321, the inverse transform unit 322, the prediction unit 330, the addition unit 340, the filtering unit 350, and the memory 360.

[0079] The inverse quantization unit 321 may inverse quantize the quantized transform coefficients to output transform coefficients. The inverse quantization unit 321 may rearrange the quantized transform coefficients in a two-dimensional block form. In this case, the rearrangement may be performed based on a coefficient scan order performed in the encoding apparatus. The inverse quantization unit 321 may perform inverse quantization on the quantized transform coefficients using a quantization parameter (e.g., quantization step size information) to obtain transform coefficients.

[0080] The inverse transform unit 322 inversely transforms the transform coefficients to obtain a residual signal (residual block, residual sample array).

[0081] The prediction unit may perform prediction on a current block and generate a predicted block including prediction samples for the current block. The prediction unit may determine whether intra prediction or inter prediction is applied to the current block based on information on the prediction output from the entropy decoding unit 310, and may determine a specific intra / inter prediction mode.

[0082] The predictor may generate a prediction signal based on various prediction methods described below. For example, the predictor may apply intra prediction or inter prediction for prediction of one block, and may simultaneously apply intra prediction and inter prediction. This may be called combined inter and intra prediction (CIIP). The predictor may also perform intra block copy (IBC) for prediction of a block. The intra block copy may be used for content image / moving image coding such as games, for example, as in screen content coding (SCC). IBC basically performs prediction within a current picture, but may be performed similarly to inter prediction in that a reference block is derived within the current picture. That is, IBC may use at least one of the inter prediction techniques described in this document.

[0083] The intra prediction unit 331 may predict a current block by referring to samples in a current picture. The referenced samples may be located in a neighbor of the current block or may be located far away depending on a prediction mode. In intra prediction, prediction modes may include a plurality of non-directional modes and a plurality of directional modes. The intra prediction unit 331 may also determine a prediction mode to be applied to the current block by using a prediction mode applied to a neighboring block.

[0084] The inter prediction unit 332 may derive a predicted block for the current block based on a reference block (reference sample array) identified by a motion vector on a reference picture. In this case, in order to reduce the amount of motion information transmitted in the inter prediction mode, the motion information may be predicted in units of blocks, sub-blocks, or samples based on correlation of motion information between neighboring blocks and the current block. The motion information may include a motion vector and a reference picture index. The motion information may further include inter prediction direction (L0 prediction, L1 prediction, Bi prediction, etc.) information. In the case of inter prediction, the neighboring blocks may include a spatial neighboring block present in the current picture and a temporal neighboring block present in the reference picture. For example, the inter prediction unit 332 may configure a motion information candidate list based on the neighboring blocks, and derive a motion vector and / or a reference picture index for the current block based on the received candidate selection information. Inter prediction may be performed based on various prediction modes, and the information regarding the prediction may include information indicating a mode of inter prediction for the current block.

[0085] The adder 340 may generate a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample array) by adding the acquired residual signal to the prediction signal (predicted block, predicted sample array) output from the prediction unit 330. When there is no residual for the current block, such as when the skip mode is applied, the predicted block may be used as the reconstructed block.

[0086] The adder 340 may be referred to as a reconstruction unit or a reconstruction block generator. The generated reconstruction signal may be used for intra prediction of a next block to be processed in a current picture, may be output after filtering as described below, or may be used for inter prediction of a next picture.

[0087] Meanwhile, luma mapping with chroma scaling (LMCS) can be applied during the picture decoding process.

[0088] The filtering unit 350 may apply filtering to the reconstructed signal to improve subjective / objective image quality. For example, the filtering unit 350 may generate a modified reconstructed picture by applying various filtering methods to the reconstructed picture, and may transmit the modified reconstructed picture to the memory 360, specifically, to the DPB of the memory 360. The various filtering methods may include, for example, deblocking filtering, sample adaptive offset, an adaptive loop filter, a bilateral filter, etc.

[0089] The (modified) reconstructed picture stored in the DPB of the memory 360 may be used as a reference picture in the inter prediction unit 332. The memory 360 may store motion information of a block from which motion information in the current picture is derived (or decoded) and / or motion information of a block in an already reconstructed picture. The stored motion information may be transmitted to the inter prediction unit 332 to be used as motion information of a spatial neighboring block or motion information of a temporal neighboring block. The memory 360 may store reconstructed samples of reconstructed blocks in the current picture and transmit them to the intra prediction unit 331.

[0090] In this specification, the embodiments described for the prediction unit 330, inverse quantization unit 321, inverse transform unit 322, and filtering unit 350 of the decoding device 300 can be applied identically or correspondingly to the prediction unit 220, inverse quantization unit 234, inverse transform unit 235, and filtering unit 260 of the encoding device 200, respectively.

[0091] As described above, prediction is performed to improve compression efficiency when performing video coding. Through this, a predicted block including predicted samples for a current block, which is a block to be coded, can be generated. Here, the predicted block includes predicted samples in a spatial domain (or a pixel domain). The predicted block is derived in the same manner by an encoding device and a decoding device, and the encoding device can improve video coding efficiency by signaling information (residual information) on the residual between the original block and the predicted block, which is not an original sample value of the original block, to a decoding device. The decoding device can derive a residual block including residual samples based on the residual information, combine the residual block with the predicted block to generate a reconstructed block including reconstructed samples, and generate a reconstructed picture including the reconstructed block.

[0092] The residual information may be generated through a transform and quantization procedure. For example, the encoding apparatus may derive a residual block between the original block and the predicted block, perform a transform procedure on the residual samples (residual sample array) included in the residual block to derive transform coefficients, perform a quantization procedure on the transform coefficients to derive quantized transform coefficients, and signal the associated residual information (through a bitstream) to the decoding apparatus. Here, the residual information may include information such as value information, position information, transform technique, transform kernel, and quantization parameter of the quantized transform coefficients. The decoding apparatus may derive a residual sample (or a residual block) by performing an inverse quantization / inverse transform procedure based on the residual information. The decoding apparatus may generate a reconstructed picture based on the predicted block and the residual block. Also, the encoding apparatus may derive a residual block by inverse quantizing / inverse transforming the quantized transform coefficients for reference for inter-prediction of a future picture, and generate a reconstructed picture based on the residual block.

[0093] FIG. 4 exemplarily shows a structural diagram of a content streaming system to which this document applies.

[0094] Furthermore, the content streaming system to which this document applies may include to a large extent encoding servers, streaming servers, web servers, media stores, user devices, and multimedia input devices.

[0095] The encoding server compresses content input from a multimedia input device such as a smartphone, camera, camcorder, etc. into digital data to generate a bitstream and transmits the bitstream to the streaming server. As another example, if a multimedia input device such as a smartphone, camera, camcorder, etc. directly generates a bitstream, the encoding server may be omitted. The bitstream may be generated by an encoding method or a bitstream generation method to which this document is applied, and the streaming server may temporarily store the bitstream during the process of transmitting or receiving the bitstream.

[0096] The streaming server transmits multimedia data to a user device based on a user request via a web server, and the web server acts as a medium to inform the user of available services. When a user requests a desired service from the web server, the web server transmits the request to the streaming server, and the streaming server transmits multimedia data to the user. In this case, the content streaming system may include a separate control server, and in this case, the control server controls commands / responses between devices in the content streaming system.

[0097] The streaming server can receive content from a media repository and / or an encoding server. For example, when the content is received from the encoding server, the content can be received in real time. In this case, the streaming server can store the bitstream for a certain period of time to provide a smooth streaming service.

[0098] Examples of the user devices include mobile phones, smart phones, laptop computers, digital broadcasting terminals, personal digital assistants (PDAs), portable multimedia players (PMPs), navigation systems, slate PCs, tablet PCs, ultrabooks, wearable devices (e.g., smartwatches, smart glass, head mounted displays (HMDs), digital TVs, desktop computers, digital signage, etc. Each server in the content streaming system may be operated as a distributed server, and in this case, data received by each server may be processed in a distributed manner.

[0099] FIG. 5 illustrates a schematic of the multiple conversion technique according to this document.

[0100] Referring to FIG. 5, the transform unit may correspond to the transform unit in the encoding device of FIG. 2 described above, and the inverse transform unit may correspond to the inverse transform unit in the encoding device of FIG. 2 described above or the inverse transform unit in the decoding device of FIG. 3.

[0101] The transform unit may perform a primary transform based on the residual samples (residual sample array) in the residual block to derive (primary) transform coefficients (S510). Such a primary transform may be called a core transform. Here, the primary transform may be based on Multiple Transform Selection (MTS), and when multiple transforms are applied as the primary transform, it may be called a multiple core transform.

[0102] The multi-kernel transform may refer to a method of transforming by additionally using a Discrete Cosine Transform (DCT) type 2 and a Discrete Sine Transform (DST) type 7, DCT type 8, and / or DST type 1. That is, the multi-kernel transform may refer to a transform method of transforming a residual signal (or a residual block) in a spatial domain into a transform coefficient (or a first transform coefficient) in a frequency domain based on a plurality of transform kernels selected from the DCT type 2, the DST type 7, the DCT type 8, and the DST type 1. Here, the first transform coefficient may be called a temporary transform coefficient from the perspective of a transform unit.

[0103] That is, when the existing transform method is applied, a transform coefficient can be generated by applying a spatial domain to frequency domain transform to the residual signal (or residual block) based on DCT type 2. In contrast, when the multi-kernel transform is applied, a transform coefficient (or primary transform coefficient) can be generated by applying a spatial domain to frequency domain transform to the residual signal (or residual block) based on DCT type 2, DST type 7, DCT type 8, and / or DST type 1, etc. Here, DCT type 2, DST type 7, DCT type 8, DST type 1, etc. can be called a transform type, a transform kernel, or a transform core. Such DCT / DST transform types can be defined based on basis functions.

[0104] When the multi-kernel transform is performed, a vertical transform kernel and a horizontal transform kernel for a current block may be selected from the transform kernels, and a vertical transform for the current block may be performed based on the vertical transform kernel, and a horizontal transform for the current block may be performed based on the horizontal transform kernel. Here, the horizontal transform may indicate a transform for a horizontal component of the current block, and the vertical transform may indicate a transform for a vertical component of the current block. The vertical transform kernel / horizontal transform kernel may be adaptively determined based on a prediction mode and / or a transform index of a current block (CU or sub-block) including a residual block.

[0105] In addition, according to one example, when a first-order transformation is performed by applying MTS, a specific basis function is set to a predetermined value, and when it is a vertical transformation or horizontal transformation, a mapping relationship for the transformation kernel can be set by combining what basis function is applied. For example, when a horizontal transformation kernel is represented by trTypeHor and a vertical transformation kernel is represented by trTypeVer, a trTypeHor or trTypeVer value of 0 can be set to DCT2, a trTypeHor or trTypeVer value of 1 can be set to DST7, and a trTypeHor or trTypeVer value of 2 can be set to DCT8.

[0106] In this case, MTS index information may be encoded and signaled to a decoding device to indicate one of a number of transformation kernel sets. For example, if the MTS index is 0, it may indicate that both the trTypeHor and trTypeVer values ​​are 0, if the MTS index is 1, it may indicate that both the trTypeHor and trTypeVer values ​​are 1, if the MTS index is 2, it may indicate that the trTypeHor value is 2 and the trTypeVer value is 1, if the MTS index is 3, it may indicate that the trTypeHor value is 1 and the trTypeVer value is 2, and if the MTS index is 4, it may indicate that both the trTypeHor and trTypeVer values ​​are 2.

[0107] As an example, a conversion kernel set according to MTS index information is shown in the table below.

[0108] [Table 1]

[0109] The transform unit may perform a secondary transform based on the (primary) transform coefficients to derive modified (secondary) transform coefficients (S520). The primary transform is a transform from a spatial domain to a frequency domain, and the secondary transform refers to a transform into a more compressed representation using a correlation existing between the (primary) transform coefficients. The secondary transform may include a non-separable transform. In this case, the secondary transform may be called a non-separable secondary transform (NSST) or a mode-dependent non-separable secondary transform (MDNSST). The non-separable secondary transform may refer to a transform in which the (primary) transform coefficients derived through the primary transform are secondary transformed based on a non-separable transform matrix to generate modified transform coefficients (or secondary transform coefficients) for a residual signal. Here, the non-separable transform matrix may be used to apply a transform to the (first-order) transform coefficients at once, without separating the vertical transform and the horizontal transform (or independently applying the horizontal-vertical transform). That is, the non-separable second-order transform may indicate a transform method in which, instead of applying the transform coefficients to the (first-order) transform coefficients in the vertical and horizontal directions separately, a two-dimensional signal (transform coefficient) is rearranged to a one-dimensional signal in a specific direction (e.g., row-first direction or column-first direction), and then a modified transform coefficient (or a second-order transform coefficient) is generated based on the non-separable transform matrix. For example, the row-major order is to arrange the first row, the second row, ..., the Nth row in a row for an M×N block, and the column-major order is to arrange the first column, the second column, ..., the Mth column in a row for an M×N block. The non-separable secondary transform may be applied to a top-left region of a block composed of (first-order) transform coefficients (hereinafter, may be referred to as a transform coefficient block).For example, if the width (W) and height (H) of the transform coefficient block are both 8 or more, an 8×8 non-separable secondary transform may be applied to the upper left 8×8 region of the transform coefficient block. Also, if the width (W) and height (H) of the transform coefficient block are both 4 or more, and the width (W) or height (H) of the transform coefficient block is less than 8, a 4×4 non-separable secondary transform may be applied to the upper left min(8,W)×min(8,H) region of the transform coefficient block. However, the embodiment is not limited thereto, and for example, even if only the condition that the width (W) or height (H) of the transform coefficient block is both 4 or more is satisfied, a 4×4 non-separable secondary transform may be applied to the upper left min(8,W)×min(8,H) region of the transform coefficient block.

[0110] Specifically, for example, if a 4×4 input block is used, the non-separable quadratic transform can be performed as follows:

[0111] The 4×4 input block X is denoted as follows:

[0112]

number

[0113] When the X is expressed in vector form, the vector JPEG2025013560000004.jpg13104 is shown as follows.

[0114]

number

[0115] As shown in Equation 2, the vector JPEG2025013560000006.jpg12101 rearranges the two-dimensional block of X in Equation 1 into a one-dimensional vector in row-first order.

[0116] In this case, the second-order non-separable transform can be computed as follows:

[0117]

number

[0118] Where: JPEG2025013560000008.jpg1197 denotes the transform coefficient vector, and T denotes the 16×16 (non-separable) transform matrix.

[0119] The 16×1 transform coefficient vector JPEG2025013560000009.jpg1093 can be derived, JPEG2025013560000010.jpg12107 can be re-organized into 4x4 blocks via the scan order (horizontal, vertical, diagonal, etc.). However, the above calculations are merely examples, and in order to reduce the computational complexity of the non-separable quadratic transform, a Hypercube-Givens Transform (HyGT) or the like can be used to calculate the non-separable quadratic transform.

[0120] Meanwhile, the non-separable secondary transform may be a mode-dependent transform kernel (or transform core, transform type), where the mode may include an intra-prediction mode and / or an inter-prediction mode.

[0121] As described above, the non-separable secondary transform may be performed based on an 8×8 transform or a 4×4 transform determined based on the width (W) and height (H) of the transform coefficient block. The 8×8 transform refers to a transform that may be applied to an 8×8 region contained within the corresponding transform coefficient block when W and H are both greater than or equal to 8, and the corresponding 8×8 region is the upper left 8×8 region within the corresponding transform coefficient block. Similarly, the 4×4 transform refers to a transform that may be applied to a 4×4 region contained within the corresponding transform coefficient block when W and H are both greater than or equal to 4, and the corresponding 4×4 region is the upper left 4×4 region within the corresponding transform coefficient block. For example, the 8×8 transform kernel matrix may be a 64×64 / 16×64 matrix, and the 4×4 transform kernel matrix may be a 16×16 / 8×16 matrix.

[0122] At this time, for mode-based transform kernel selection, two non-separable quadratic transform kernels may be configured per transform set for non-separable quadratic transform for both 8×8 transform and 4×4 transform, and the number of transform sets is four. That is, four transform sets may be configured for 8×8 transform, and four transform sets may be configured for 4×4 transform. In this case, each of the four transform sets for 8×8 transform may include two 8×8 transform kernels, and each of the four transform sets for 4×4 transform may include two 4×4 transform kernels.

[0123] However, the size of the transform, i.e., the size of the region to which the transform is applied, is merely an example and sizes other than 8x8 or 4x4 can be used, the number of sets is n, and the number of transform kernels in each set is k.

[0124] The transform set may be referred to as an NSST set or an LFNST set. The selection of a particular set from the transform set may be performed based on, for example, an intra prediction mode of a current block (CU or sub-block). LFNST (Low-Frequency Non-Separable Transform) is an example of a reduced non-separable transform, which will be described later, and indicates a non-separable transform for low-frequency components.

[0125] For reference, for example, the intra prediction modes may include two non-directional (non-angular) intra prediction modes and 65 directional (angular) intra prediction modes. The non-directional intra prediction modes may include a planar intra prediction mode numbered 0 and a DC intra prediction mode numbered 1, and the directional intra prediction modes may include 65 intra prediction modes numbered 2 to 66. However, this is merely an example, and the present document may be applied to cases where the number of intra prediction modes is different. Meanwhile, in some cases, a 67th intra prediction mode may be further used, and the 67th intra prediction mode may indicate a linear model (LM) mode.

[0126] FIG. 6 exemplarily shows intra-directional modes of 65 prediction directions.

[0127] Referring to FIG. 6, intra prediction modes having horizontal directionality and intra prediction modes having vertical directionality may be distinguished with respect to the 34th intra prediction mode having a right-down diagonal prediction direction. H and V in FIG. 6 respectively mean horizontal directionality and vertical directionality, and the numbers from -32 to 32 indicate a displacement of 1 / 32 units on a sample grid position. This may indicate an offset for a mode index value. The 2nd to 33rd intra prediction modes have horizontal directionality, and the 34th to 66th intra prediction modes have vertical directionality. Meanwhile, the 34th intra prediction mode may be considered to be neither horizontal nor vertical in the strict sense, but may be classified as belonging to horizontal directionality in terms of determining a transform set for a secondary transform. This is because the input data is transposed and used for vertical modes that are symmetric with respect to the 34th intra prediction mode, and the input data alignment method for the horizontal mode is used for the 34th intra prediction mode. Transposing the input data means that rows become columns and columns become rows for 2D block data M×N to form N×M data. The 18th intra prediction mode and the 50th intra prediction mode indicate a horizontal intra prediction mode and a vertical intra prediction mode, respectively, and the 2nd intra prediction mode can be called an upper right diagonal intra prediction mode because it predicts in an upper right direction using a left reference pixel. In the same vein, the 34th intra prediction mode can be called a lower right diagonal intra prediction mode, and the 66th intra prediction mode can be called a lower left diagonal intra prediction mode.

[0128] As an example, the mapping of four transform sets according to intra prediction modes is shown in the following table.

[0129] [Table 2]

[0130] As shown in Table 2, depending on the intra prediction mode, one of four transform sets, i.e., lfnstTrSetIdx can be mapped to one of 0 to 3, i.e., one of four.

[0131] Meanwhile, when it is determined that a specific set is used for non-separable transform, one of k transform kernels in the specific set may be selected through a non-separable secondary transform index. The encoding apparatus may derive a non-separable secondary transform index that indicates a specific transform kernel based on a rate-distortion (RD) check, and may signal the non-separable secondary transform index to a decoding apparatus. The decoding apparatus may select one of k transform kernels in the specific set based on the non-separable secondary transform index. For example, an lfnst index value 0 may indicate a first non-separable secondary transform kernel, an lfnst index value 1 may indicate a second non-separable secondary transform kernel, and an lfnst index value 2 may indicate a third non-separable secondary transform kernel. Alternatively, an lfnst index value 0 may indicate that a first non-separable secondary transform is not applied to a current block, and lfnst index values ​​1 to 3 may indicate the three transform kernels.

[0132] The transform unit may perform the non-separable quadratic transform based on a selected transform kernel to obtain modified (quadrature) transform coefficients. The modified transform coefficients may be derived as quantized transform coefficients through a quantizer as described above, and may be encoded and signaled to a decoding device and transmitted to an inverse quantization / inverse transform unit in the encoding device.

[0133] On the other hand, as described above, when the secondary transform is omitted, the (primary) transform coefficients, which are the output of the primary (separate) transform, can be derived as quantized transform coefficients through a quantization unit as described above, and can be encoded and signaled to a decoding device and transmitted to an inverse quantization / inverse transform unit within the encoding device.

[0134] The inverse transform unit may perform a series of steps in the reverse order of the steps performed by the transform unit described above. The inverse transform unit may receive (dequantized) transform coefficients, perform a secondary (inverse) transform to derive (primary) transform coefficients (S550), and perform a primary (inverse) transform on the (primary) transform coefficients to obtain residual blocks (residual samples) (S560). Here, the primary transform coefficients may be called modified transform coefficients from the inverse transform unit's perspective. As described above, the encoding device and the decoding device may generate a reconstructed block based on the residual block and a predicted block, and generate a reconstructed picture based on the reconstructed block.

[0135] Meanwhile, the decoding apparatus may further include a secondary inverse transform application determining unit (or an element for determining whether to apply the secondary inverse transform) and a secondary inverse transform determining unit (or an element for determining the secondary inverse transform). The secondary inverse transform application determining unit may determine whether to apply the secondary inverse transform. For example, the secondary inverse transform may be NSST, RST or LFNST, and the secondary inverse transform application determining unit may determine whether to apply the secondary inverse transform based on a secondary transform flag parsed from the bitstream. As another example, the secondary inverse transform application determining unit may determine whether to apply the secondary inverse transform based on a transform coefficient of a residual block.

[0136] The secondary inverse transform decision unit may determine a secondary inverse transform. At this time, the secondary inverse transform decision unit may determine a secondary inverse transform to be applied to a current block based on an LFNST (NSST or RST) transform set designated according to an intra prediction mode. In addition, as an embodiment, a secondary transform decision method may be determined depending on a primary transform decision method. Various combinations of a primary transform and a secondary transform may be determined according to an intra prediction mode. In addition, as an example, the secondary inverse transform decision unit may determine an area to which a secondary inverse transform is applied based on a size of a current block.

[0137] Meanwhile, as described above, when the second (inverse) transform is omitted, a residual block (residual sample) can be obtained by receiving (dequantized) transform coefficients and performing the first (separate) inverse transform. As described above, the encoding device and the decoding device can generate a reconstructed block based on the residual block and a predicted block, and generate a reconstructed picture based on the reconstructed block.

[0138] Meanwhile, in this paper, in order to reduce the computational complexity and memory requirements due to non-separable secondary transform, RST (reduced secondary transform) can be applied, in which the size of the transformation matrix (kernel) is reduced based on the concept of NSST.

[0139] Meanwhile, coefficients constituting the transformation kernel, transformation matrix, and transformation kernel matrix described in this document, i.e., kernel coefficients or matrix coefficients, can be expressed in 8 bits. This is one condition for implementation in a decoding device and an encoding device, and it is possible to reduce the memory requirement for storing the transformation kernel with a reasonably acceptable performance degradation compared to the existing 9 bits or 10 bits. In addition, by expressing the kernel matrix in 8 bits, a small multiplier can be used, and it is more compatible with SIMD (Single Instruction Multiple Data) instructions used for optimal software implementation.

[0140] In this specification, RST may refer to a transformation performed on residual samples for a target block based on a transform matrix whose size is reduced by a simplification factor. When performing a simplified transformation, the amount of calculations required during transformation can be reduced due to the reduction in the size of the transform matrix. That is, RST can be used to solve the problem of complexity that occurs during transformation of a large block or non-separable transformation.

[0141] The RST may be called by various terms such as a reduced transform, a reduced secondary transform, a reduction transform, a simplified transform, a simple transform, etc., and the name of the RST is not limited to the listed examples. Alternatively, the RST may be called a Low-Frequency Non-Separable Transform (LFNST) since it is mainly performed in a low-frequency domain including non-zero coefficients in a transform block. The transform index may be named an LFNST index.

[0142] Meanwhile, when the second inverse transform is performed based on the RST, the inverse transform unit 235 of the encoding apparatus 200 and the inverse transform unit 322 of the decoding apparatus 300 may include an inverse RST unit for deriving modified transform coefficients based on the inverse RST for the transform coefficients, and an inverse linear transform unit for deriving residual samples for the target block based on an inverse linear transform for the modified transform coefficients. The inverse linear transform refers to an inverse transform of a linear transform applied to the residual. In this document, deriving transform coefficients based on a transform may refer to deriving transform coefficients by applying the corresponding transform.

[0143] FIG. 7 is a diagram for explaining a RST according to an embodiment of this document.

[0144] In this specification, a "target block" may refer to a current block, a residual block, or a transformed block on which coding is performed.

[0145] In an RST according to an embodiment, an N-dimensional vector may be mapped to an R-dimensional vector located in a different space to determine a reduced transformation matrix, where R is smaller than N. N may represent the square of the length of one side of a block to which a transformation is applied or the total number of transformation coefficients corresponding to a block to which a transformation is applied, and the simplification factor may represent an R / N value. The simplification factor may be referred to by various terms such as a reduced factor, a reduction factor, a simplified factor, and a simple factor. Meanwhile, R may be referred to as a reduced coefficient, but in some cases, the simplification factor may represent R. In addition, in some cases, the simplification factor may represent an N / R value.

[0146] In one embodiment, the simplification factors or simplification coefficients may be signaled via a bitstream, but the embodiment is not limited thereto. For example, predefined values ​​for the simplification factors or simplification coefficients may be stored in each of the encoding apparatus 200 and the decoding apparatus 300, in which case the simplification factors or simplification coefficients are not separately signaled.

[0147] The size of the simplified transformation matrix according to an embodiment is R×N, which is smaller than the size N×N of the normal transformation matrix, and can be defined as Equation 4 below.

[0148]

number

[0149] The matrix T in the Reduced Transform block shown in (a) of Figure 7 may represent the matrix TR×N in Equation 4. When the residual samples for the target block are multiplied by the simplified transform matrix TR×N as shown in (a) of Figure 7, transform coefficients for the target block can be derived.

[0150] In one embodiment, if the size of the block to which the transform is applied is 8×8 and R=16 (i.e., R / N=16 / 64=1 / 4), the RST according to Fig. 7(a) can be expressed by a matrix operation as shown in Equation 5 below. In this case, the memory and multiplication operations can be reduced to approximately 1 / 4 due to the simplification factor.

[0151] In this document, a matrix operation may be understood as an operation in which a matrix is ​​placed to the left of a column vector to multiply the matrix and the column vector to obtain the column vector.

[0152]

number

[0153] In Formula 5, r1 to r 64 may represent a residual sample for the target block, and more specifically, is a transform coefficient generated by applying a linear transform. As a result of the calculation of Equation 5, the transform coefficient c i can be derived, c i The derivation process is as shown in Equation 6.

[0154]

number

[0155] As a result of the calculation of Equation 6, the transform coefficients c1 to c2 for the target block are R That is, when R=16, the transform coefficients c1 to c 16 can be derived. If a regular transform, instead of the RST, is applied and a transform matrix of size 64×64 (N×N) is multiplied to residual samples of size 64×1 (N×1), 64 (N) transform coefficients for the current block are derived, but since the RST is applied, only 16 (R) transform coefficients for the current block are derived. Since the total number of transform coefficients for the current block is reduced from N to R, the amount of data transmitted from the encoding apparatus 200 to the decoding apparatus 300 is reduced, and therefore the transmission efficiency between the encoding apparatus 200 and the decoding apparatus 300 can be increased.

[0156] Considering the size of the transformation matrix, the size of the normal transformation matrix is ​​64x64 (NxN), while the size of the simplified transformation matrix is ​​reduced to 16x64 (RxN), so compared to performing normal transformation, memory usage can be reduced to the ratio R / N when performing RST. Also, compared to the number of multiplications NxN when using the normal transformation matrix, when using the simplified transformation matrix, the number of multiplications can be reduced to the ratio R / N (RxN).

[0157] In one embodiment, the transform unit 232 of the encoding apparatus 200 may derive transform coefficients for the current block by performing a primary transform and an RST-based secondary transform on the residual samples for the current block. Such transform coefficients may be transmitted to an inverse transform unit of the decoding apparatus 300, and the inverse transform unit 322 of the decoding apparatus 300 may derive modified transform coefficients based on an inverse reduced secondary transform (RST) for the transform coefficients, and derive residual samples for the current block based on an inverse primary transform for the modified transform coefficients.

[0158] Inverse RST matrix T according to one embodiment N×R The size of the simplified transformation matrix T R×N It is in a transpose relationship with.

[0159] The matrix T in the Reduced Inv. Transform block shown in (b) of Figure 7 t is the inverse RST matrix T R×N T (The superscript T means transpose.) As shown in FIG. 7(b), the inverse RST matrix T R×N T When the inverse RST matrix T is multiplied, modified transform coefficients for the current block or residual samples for the current block can be derived. R×N T is (T R×N ) T N×R It can also be expressed as:

[0160] More specifically, when the inverse RST is applied as the secondary inverse transform, the inverse RST matrix T R×N TAlternatively, an inverse RST may be applied as an inverse linear transform, in which case the inverse RST matrix T R×N T Once multiplied by, the residual sample for the current block can be derived.

[0161] In one embodiment, when the size of the block to which the inverse transform is applied is 8×8 and R=16 (i.e., R / N=16 / 64=1 / 4), the RST according to (b) of FIG. 7 can be expressed by a matrix operation as shown in Equation 7 below.

[0162]

number

[0163] In Formula 7, c1 to c 16 The result of the operation of Equation 7 is a modified transform coefficient for the target block or a residual sample for the target block, r i can be derived, and r i The derivation process is as shown in Equation 8.

[0164]

number

[0165] As a result of the operation of Equation 8, r1 to r2, which indicate the modified transform coefficients for the target block or the residual samples for the target block, are Ncan be derived. Considering the size of the inverse transformation matrix, the size of the normal inverse transformation matrix is ​​64×64 (N×N), and the size of the simplified inverse transformation matrix is ​​reduced to 64×16 (N×R), so compared to performing normal inverse transformation, memory usage can be reduced to a ratio of R / N when performing inverse RST. Also, compared to the number of multiplication operations N×N when using the normal inverse transformation matrix, the number of multiplication operations can be reduced to a ratio of R / N when using the simplified inverse transformation matrix (N×R).

[0166] Meanwhile, the transform set configuration as shown in Table 2 may be applied to the 8×8 RST. That is, the corresponding 8×8 RST may be applied according to the transform set in Table 2. Since one transform set is composed of two or three transforms (kernels) according to the prediction mode in the screen, it may be configured to select one from up to four transforms including not applying the secondary transform. When the secondary transform is not applied, the transform may be considered to be applied with an identity matrix. When the four transforms are assigned indexes 0, 1, 2, and 3 (for example, the 0th index may be assigned as an identity matrix, i.e., when the secondary transform is not applied), the transform to be applied may be specified by signaling a syntax element called a transform index or an lfnst index for each transform coefficient block. That is, for an 8×8 upper left block, an 8×8 RST may be specified in the RST configuration through the transform index, or an 8×8 lfnst may be specified when LFNST is applied. The 8×8 lfnst and 8×8 RST refer to a transform that can be applied to an 8×8 region contained within a corresponding transform coefficient block when W and H of a target block to be transformed are both greater than or equal to 8, and the corresponding 8×8 region is the upper left 8×8 region within the corresponding transform coefficient block. Similarly, the 4×4 lfnst and 4×4 RST refer to a transform that can be applied to a 4×4 region contained within a corresponding transform coefficient block when W and H of a target block are both greater than or equal to 4, and the corresponding 4×4 region is the upper left 4×4 region within the corresponding transform coefficient block.

[0167] Meanwhile, according to an embodiment of the present document, in the conversion of the encoding process, a maximum 16×48 conversion kernel matrix can be applied by selecting only 48 data, not a 16×64 conversion kernel matrix, for 64 data constituting an 8×8 region. Here, "maximum" means that the maximum value of m is 16 for an m×48 conversion kernel matrix capable of generating m coefficients. That is, when RST is performed by applying an m×48 conversion kernel matrix (m≦16) to an 8×8 region, m coefficients can be generated by receiving 48 data. When m is 16, 16 coefficients are generated by receiving 48 data. That is, when 48 data constitute a 48×1 vector, a 16×1 vector can be generated by multiplying a 16×48 matrix and a 48×1 vector in sequence. In this case, a 48×1 vector can be configured by appropriately arranging 48 data constituting an 8×8 region. For example, a 48×1 vector can be configured based on 48 data constituting a region excluding the lower right 4×4 region of the 8×8 region. In this case, when a matrix operation is performed by applying a maximum 16x48 transformation kernel matrix, 16 modified transformation coefficients are generated, and the 16 modified transformation coefficients can be arranged in the upper left 4x4 area according to the scanning order, and the upper right 4x4 area and the lower left 4x4 area can be filled with 0s.

[0168] A transposed matrix of the above-described transformation kernel matrix can be used for the inverse transformation of the decoding process. That is, when the inverse RST or LFNST is performed as the inverse transformation process performed in the decoding device, the input coefficient data to which the inverse RST is applied is composed of one-dimensional vectors in a predetermined arrangement order, and the modified coefficient vectors obtained by multiplying the one-dimensional vectors by the corresponding inverse RST matrix on the left side can be arranged in two-dimensional blocks in a predetermined arrangement order.

[0169] In summary, when RST or LFNST is applied to an 8×8 region in the transformation process, a matrix operation is performed between 48 transform coefficients in the upper left, upper right, and lower left regions of the 8×8 region, excluding the lower right region, and a 16×48 transform kernel matrix. For the matrix operation, the 48 transform coefficients are input in a one-dimensional array. When such a matrix operation is performed, 16 modified transform coefficients are derived, and the modified transform coefficients may be arranged in the upper left region of the 8×8 region.

[0170] Conversely, when the inverse RST or LFNST is applied to an 8×8 region in the inverse transform process, 16 transform coefficients corresponding to the upper left corner of the 8×8 region among the transform coefficients of the 8×8 region are input in a one-dimensional array form according to the scanning order and may be subjected to a matrix operation with a 48×16 transform kernel matrix. That is, the matrix operation in this case may be expressed as (48×16 matrix)*(16×1 transform coefficient vector)=(48×1 modified transform coefficient vector). Here, an n×1 vector may be interpreted as an n×1 matrix, and therefore may be expressed as an n×1 column vector. Also, * means a matrix multiplication operation. When such a matrix operation is performed, 48 modified transform coefficients may be derived, and the 48 modified transform coefficients may be arranged in the upper left corner, upper right corner, and lower left corner regions excluding the lower right corner region of the 8×8 region.

[0171] Meanwhile, when the secondary inverse transform is performed based on the RST, the inverse transform unit 235 of the encoding apparatus 200 and the inverse transform unit 322 of the decoding apparatus 300 may include an inverse RST unit for deriving modified transform coefficients based on the inverse RST for the transform coefficients, and an inverse linear transform unit for deriving residual samples for the target block based on an inverse linear transform for the modified transform coefficients. The inverse linear transform refers to an inverse transform of a linear transform applied to the residual. In this document, deriving transform coefficients based on a transform may refer to deriving transform coefficients by applying the corresponding transform.

[0172] The detailed non-separable transform, LFNST, is described below in detail: LFNST may include a forward transform by an encoding device and an inverse transform by a decoding device.

[0173] The encoding device takes as input the result (or a part of the result) derived after applying a forward primary (core) transform, and applies a forward secondary transform.

[0174]

number

[0175] In Equation 9, x and y are the input and output of the quadratic transformation, respectively, and G is a matrix indicating the quadratic transformation, and the transform basis vector is composed of column vectors. In the case of backward LFNST, when the dimension of the transform matrix G is expressed as [number of rows × number of columns], in the case of forward LFNST, the transposed matrix G is G. T It becomes dimensional.

[0176] For the reverse LFNST, the dimensions of the matrix G are [48×16], [48×8], [16×16], and [16×8], where the [48×8] and [16×8] matrices are submatrices obtained by sampling 8 transformation basis vectors from the left side of the [48×16] and [16×16] matrices, respectively.

[0177] On the other hand, in the case of forward LFNST, the matrix G T The dimensions of are [16×48], [8×48], [16×16], and [8×16], where the [8×48] and [8×16] matrices are submatrices obtained by sampling the upper eight transformation basis vectors of the [16×48] and [16×16] matrices, respectively.

[0178] Therefore, in the case of forward LFNST, the input x can be a [48×1] vector or a [16×1] vector, and the output y can be a [16×1] vector or a [8×1] vector. Since the output of the forward primary transform in video coding and decoding is two-dimensional (2D) data, in order to configure a [48×1] vector or a [16×1] vector as the input x, the 2D data output from the forward transform must be appropriately arranged to configure a one-dimensional vector.

[0179] Figure 8 is a diagram showing an example of a sequence for arranging output data of a forward linear transform into a one-dimensional vector. The left diagrams of Figures 8(a) and (b) show a sequence for creating a [48x1] vector, and the right diagrams of Figures 8(a) and (b) show a sequence for creating a [16x1] vector. In the case of LFNST, a one-dimensional vector x can be obtained by sequentially arranging 2D data in the sequence shown in Figures 8(a) and (b).

[0180] The arrangement direction of the output data of the forward primary transform may be determined according to the intra prediction mode of the current block. For example, if the intra prediction mode of the current block is horizontal with respect to the diagonal direction, the output data of the forward primary transform may be arranged in the order of (a) of FIG. 8, and if the intra prediction mode of the current block is vertical with respect to the diagonal direction, the output data of the forward primary transform may be arranged in the order of (b) of FIG.

[0181] As an example, an ordering different from that of (a) and (b) of Figure 8 can be applied, and if one wishes to derive the same result (y vector) as when the ordering of (a) and (b) of Figure 8 is applied, the column vectors of matrix G can be rearranged according to the corresponding ordering. That is, the column vectors of G can be rearranged so that each element constituting the x vector is always multiplied by the same transformation basis vector.

[0182] Since the output y derived through Equation 9 is a one-dimensional vector, if a configuration that processes the result of a forward quadratic transform as an input, for example a configuration that performs quantization or residual coding, requires two-dimensional data as input data, the output y vector of Equation 9 must again be appropriately arranged as 2D data.

[0183] FIG. 9 is a diagram illustrating an example of a sequence in which output data of a forward quadratic transform is arranged in a two-dimensional block.

[0184] In the case of LFNST, the output values ​​can be arranged in a 2D block according to a determined scan order. FIG. 9(a) shows that when the output y is a [16×1] vector, the output values ​​are arranged in 16 positions of the 2D block according to a diagonal scan order. FIG. 9(b) shows that when the output y is a [8×1] vector, the output values ​​are arranged in 8 positions of the 2D block according to a diagonal scan order, and the remaining 8 positions are filled with 0. X in FIG. 9(b) indicates that it is filled with 0.

[0185] As another example, since the order in which the output vector y is processed in a configuration that performs quantization or residual coding may be performed in a preset order, the output vector y may not be arranged in a 2D block as shown in Fig. 9. However, in the case of residual coding, data coding may be performed in units of 2D blocks (e.g., 4x4) such as CG (Coefficient Group), and in this case, data may be arranged in a specific order such as the diagonal scan order of Fig. 9.

[0186] Meanwhile, the decoding device can arrange two-dimensional data outputted through an inverse quantization process for inverse transform according to a preset scanning order to form a one-dimensional input vector y. The input vector y can be outputted as an input vector x according to the following equation:

[0187]

number

[0188] For reverse LFNST, the output vector x can be derived by multiplying the input vector y, which is a [16x1] or [8x1] vector, by the G matrix. For reverse LFNST, the output vector x is a [48x1] or [16x1] vector.

[0189] The output vector x is arranged in a two-dimensional block in the order shown in FIG. 8 and arranged as two-dimensional data, and such two-dimensional data becomes the input data (or a part of the input data) of the inverse linear transformation.

[0190] Therefore, the inverse secondary transform is generally the opposite of the forward secondary transform process, and in the case of the inverse transform, unlike the forward transform, the inverse secondary transform is applied first and then the inverse linear transform is applied.

[0191] In the inverse LFNST, one of eight [48x16] matrices or eight [16x16] matrices can be selected as the transformation matrix G. Which of the [48x16] and [16x16] matrices to apply depends on the size and pattern of the block.

[0192] Also, the eight matrices may be derived from four transform sets as shown in Table 2 above, and each transform set may be composed of two matrices. Which transform set of the four transform sets is used is determined according to an intra prediction mode, and more specifically, the transform set is determined based on an intra prediction mode value extended to a wide angle intra prediction mode (Wide Angle Intra Prediction, WAIP). Which matrix is ​​selected from the two matrices constituting the selected transform set is derived through index signaling. More specifically, the transmitted index value may be 0, 1, or 2, where 0 indicates that LFNST is not applied, and 1 and 2 may indicate one of the two transform matrices constituting the transform set selected based on the intra prediction mode value.

[0193] FIG. 10 is a diagram illustrating a wide-angle intra prediction mode according to one embodiment of this document.

[0194] General intra prediction mode values ​​may have values ​​from 0 to 66 and from 81 to 83, and as shown in the figure, intra prediction mode values ​​extended by WAIP may have values ​​from -14 to 83. Values ​​from 81 to 83 indicate CCLM (Cross Composite Linear Model) modes, and values ​​from -14 to -1 and values ​​from 67 to 80 indicate intra prediction mode values ​​extended by applying WAIP.

[0195] When the width of a prediction current block is greater than its height, the upper reference pixel is generally closer to a position inside the block to be predicted. Therefore, predicting in the bottom-left direction is more accurate than predicting in the top-right direction. On the other hand, when the height of a block is greater than its width, the left reference pixel is generally closer to a position inside the block to be predicted. Therefore, predicting in the top-right direction is more accurate than predicting in the bottom-left direction. Therefore, it is advantageous to apply remapping, i.e., mode index conversion, to the index of the wide-angle intra prediction mode.

[0196] When wide-angle intra prediction is applied, information on existing intra prediction may be signaled, and after the information is parsed, the information may be remapped with the index of the wide-angle intra prediction mode. Thus, the total number of intra prediction modes for a particular block (e.g., a non-square block of a particular size) is not changed, i.e., the total number of intra prediction modes is 67, and the intra prediction mode coding for the particular block is not changed.

[0197] Table 3 below shows a process of deriving a modified intra mode by remapping an intra prediction mode to a wide-angle intra prediction mode.

[0198] [Table 3]

[0199] In Table 3, the extended intra prediction mode value is finally stored in the predModeIntra variable, ISP_NO_SPLIT indicates that the CU block is not divided into sub-partitions by the Intra Sub Partitions (ISP) technology currently adopted in the VVC standard, and the cIdx variable values ​​of 0, 1, and 2 indicate the luma, Cb, and Cr components, respectively. The Log2 function shown in Table 3 returns a log value with a base of 2, and the Abs function returns an absolute value.

[0200] A variable predModeIntra indicating an intra prediction mode, the height and width of a transform block, etc. are used as input values ​​of a wide angle intra prediction mode mapping process, and an output value is the modified intra prediction mode predModeIntra. The height and width of a transform block or a coding block may become the height and width of a current block for intra prediction mode remapping. In this case, a variable whRatio reflecting the ratio of width to height may be set to Abs(Log2(nW / nH)).

[0201] For non-square blocks, the intra prediction mode can be modified in two distinct cases.

[0202] First, if all of the following conditions are met: (1) the width of the current block is greater than the height, (2) the intra prediction mode before modification is greater than or equal to 2, and (3) the intra prediction mode is (8+2*whRatio) if the variable whRatio is greater than 1, or 8 if the variable whRatio is less than or equal to 1, and is less than the derived value [predModeIntra is less than (whRatio>1)? (8+2*whRatio):8], the intra prediction mode is set to a value 65 greater than the intra prediction mode [predModeIntra is set equal to (predModeIntra+65)].

[0203] If different from the above, (1) the height of the current block is greater than the width, (2) the intra prediction mode before modification is less than or equal to 66, and (3) the intra prediction mode is greater than the derived value [predModeIntra is greater than (whRatio>1)? (60-2*whRatio):60], then the intra prediction mode is set to a value 67 less than the intra prediction mode [predModeIntra is set equal to (predModeIntra-67)].

[0204] The above-mentioned Table 2 shows how a transform set is selected based on the intra prediction mode value extended by WAIP in LFNST. As shown in FIG. 10, modes 14 to 33 and modes 35 to 80 are symmetrical to each other in terms of prediction direction with mode 34 as the center. For example, mode 14 and mode 54 are symmetrical to each other with respect to the direction corresponding to mode 34 as the center. Therefore, the same transform set is applied to modes located in symmetrical directions, and such symmetry is reflected in Table 2.

[0205] However, it is assumed that the forward LFNST input data for mode 54 is symmetric with the forward LFNST input data for mode 14. For example, for modes 14 and 54, two-dimensional data is rearranged into one-dimensional data in the arrangement orders shown in Figures 8(a) and 8(b), respectively, and it can be seen that the ordering patterns shown in Figures 8(a) and 8(b) are symmetric with respect to the direction indicated by mode 34 (diagonal direction).

[0206] On the other hand, as described above, which of the [48×16] and [16×16] transformation matrices to apply to LFNST is determined based on the size of the block to be transformed.

[0207] Fig. 11 shows block patterns to which LFNST is applied, where (a) shows a 4x4 block, (b) shows 4x8 and 8x4 blocks, (c) shows a 4xN or Nx4 block where N is 16 or more, (d) shows an 8x8 block, and (e) shows an MxN block where M≧8, N≧8, and N>8 or M>8.

[0208] In Figure 11, blocks with thick frames indicate areas to which LFNST is applied. For blocks (a) and (b) in Figure 11, LFNST is applied to the top-left 4x4 area, and for block (c) in Figure 11, LFNST is applied to each of the two adjacent top-left 4x4 areas. Since LFNST is applied in 4x4 area units in (a), (b), and (c) in Figure 11, this type of LFNST is hereinafter referred to as "4x4 LFNST," and a [16x16] or [16x8] matrix can be applied to the corresponding transformation matrix based on the matrix dimension for G in Equation 9 and Equation 10.

[0209] More specifically, a [16×8] matrix is ​​applied to the 4×4 block (4×4TU or 4×4CU) in (a) of Figure 11, and a [16×16] matrix is ​​applied to the blocks in (b) and (c) of Figure 11. This is to match the worst case computational complexity to 8 multiplications per sample.

[0210] For (d) and (e) of Figure 11, LFNST is applied to the upper left 8x8 region, and such LFNST is hereinafter referred to as "8x8LFNST". A [48x16] or [48x8] matrix can be applied to the corresponding transformation matrix. In the case of forward LFNST, a [48x1] vector (x vector in Equation 9) is input as input data, so all sample values ​​in the upper left 8x8 region are not used as input values ​​for forward LFNST. That is, as can be seen in the left order of Figure 8(a) or the left order of Figure 8(b), the bottom-right 4x4 block is left as it is, and a [48x1] vector can be constructed based on samples belonging to the remaining three 4x4 blocks.

[0211] A [48×8] matrix can be applied to the 8×8 block (8×8TU or 8×8CU) in (d) of Figure 11, and a [48×16] matrix can be applied to the 8×8 block in (e) of Figure 11. This is also to match the worst case computational complexity to 8 multiplications per sample.

[0212] Depending on the block, when the corresponding forward LFNST (4 × 4 LFNST or 8 × 8 LFNST) is applied, 8 or 16 output data (the y vector in Equation 9, an [8 × 1] or [16 × 1] vector) are generated. Due to the properties of the matrix GT in forward LFNST, the number of output data may be the same or less than the number of input data.

[0213] FIG. 12 shows an example of the arrangement of output data from a forward LFNST, and illustrates blocks in which the output data from a forward LFNST is arranged depending on the block.

[0214] The shaded area at the top left of the block shown in Figure 12 corresponds to the area where the output data of the forward LFNST is located, the positions marked with 0 indicate samples that are filled with a value of 0, and the remaining area indicates areas that are not changed by the forward LFNST. The output data of the forward linear transform remains unchanged in the areas that are not changed by LFNST.

[0215] As mentioned above, the number of output data varies depending on the block because the dimension of the transformation matrix applied varies. As shown in FIG. 12, the output data of the forward LFNST may not fill the entire upper left 4×4 block. In the cases of (a) and (d) of FIG. 12, a [16×8] matrix and a [48×8] matrix are applied to the block indicated by the thick line or a part of the block, respectively, and an [8×1] vector is generated as the output of the forward LFNST. That is, according to the scan order shown in (b) of FIG. 9, only eight output data are filled as shown in (a) and (d) of FIG. 12, and the remaining eight positions are filled with 0. In the case of the block applied with LFNST in (d) of FIG. 11, the two 4×4 blocks at the upper right and lower left adjacent to the upper left 4×4 block are also filled with 0 values ​​as shown in (d) of FIG. 12.

[0216] As described above, the LFNST index is basically signaled to specify whether LFNST is applied and the transformation matrix to be applied. As shown in Figure 12, when LFNST is applied, the number of output data of the forward LFNST may be equal to or less than the number of input data, so areas filled with 0 values ​​occur as follows:

[0217] 1) As shown in FIG. 12(a), in the upper left corner 4×4 block, the 8th position in the scan order and after, that is, the 9th to 16th samples

[0218] 2) As shown in (d) and (e) of FIG. 12, a [16×48] matrix or an [8×48] matrix is ​​applied to two 4×4 blocks adjacent to the upper left 4×4 block or the second and third 4×4 blocks in the scan order.

[0219] Therefore, if non-zero data is found by checking areas 1) and 2), it is certain that LFNST is not applied, so signaling of the corresponding LFNST index can be omitted.

[0220] For example, in the case of LFNST adopted in the VVC standard, signaling of the LFNST index is performed after residual coding, so that the encoding device can know whether non-zero data (significant coefficients) exist at all positions inside a TU or CU block through residual coding. Therefore, the encoding device can determine whether to perform signaling for the LFNST index based on whether non-zero data exists, and the decoding device can determine whether to parse the LFNST index. If non-zero data does not exist in the areas specified in 1) and 2), signaling of the LFNST index is performed.

[0221] Meanwhile, the following simplification methods can be applied to the adopted LFNST:

[0222] (i) As an example, the number of output data items for the forward LFNST can be limited to a maximum of 16.

[0223] In the case of (c) of Figure 11, 4x4 LFNST can be applied to each of the two 4x4 regions adjacent to the upper left corner, and in this case, up to 32 pieces of LFNST output data can be generated. If the number of output data for forward LFNST is limited to a maximum of 16, 4x4 LFNST is applied only to one 4x4 region located at the upper left corner of a 4xN / Nx4 (N≧16) block (TU or CU), and LFNST can be applied only once to all blocks in Figure 11. This simplifies the implementation of video coding.

[0224] (ii) As an example, zero-out may be additionally applied to areas to which LFNST is not applied. In this document, zero-out may mean filling all position values ​​belonging to a specific area with 0 values. That is, zero-out may also be applied to areas that are not changed by LFNST and retain the result of the forward linear transform. As described above, LFNST is divided into 4x4 LFNST and 8x8 LFNST, and therefore zero-out may be divided into two types ((ii)-(A) and (ii)-(B)) as follows.

[0225] (ii)-(A) When 4×4 LFNST is applied, it is possible to zero out areas to which 4×4 LFNST is not applied. FIG 13 is a diagram illustrating zeroing out in a block to which 4×4 LFNST is applied, according to an example.

[0226] As shown in FIG. 13, for blocks to which 4×4 LFNST is applied, that is, for blocks (a), (b), and (c) in FIG. 12, even areas to which LFNST is not applied can be filled with 0.

[0227] Meanwhile, FIG. 13(d) shows an example in which the maximum number of output data pieces of the forward LFNST is limited to 16, and zero-out is performed on the remaining blocks to which the 4×4 LFNST is not applied.

[0228] (ii)-(B) When 8×8 LFNST is applied, it is possible to zero out areas to which 8×8 LFNST is not applied. FIG 14 is a diagram illustrating zeroing out in a block to which 8×8 LFNST is applied, according to an example.

[0229] As shown in FIG. 14, for blocks to which 8×8 LFNST is applied, that is, for blocks (d) and (e) in FIG. 12, even areas to which LFNST is not applied can be filled with 0.

[0230] (iii) When LFNST is applied due to the zero-out proposed in (ii) above, the area filled with zeros may change. Therefore, the zero-out proposed in (ii) above allows checking whether non-zero data exists in a wider area than in the case of LFNST in FIG. 12.

[0231] For example, when (ii)-(B) is applied, it is possible to check whether non-zero data exists in the areas filled with zero values ​​in (d) and (e) of FIG. 12 as well as in the areas additionally filled with zeros in FIG. 14, and to perform signaling for the LFNST index only if non-zero data does not exist.

[0232] Of course, even when the zero-out proposed in (ii) above is applied, it is possible to check whether non-zero data exists as with the existing LFNST index signaling. That is, LFNST index signaling can be applied by checking whether non-zero data exists for blocks filled with zeros in Figure 12. In this case, zero-out is performed only in the encoding device, and the decoding device can perform LFNST index parsing without assuming the corresponding zero-out, that is, by checking only whether non-zero data exists for only areas explicitly marked with 0 in Figure 12.

[0233] Various embodiments can be derived by applying combinations of the simplification methods ((i), (ii)-(A), (ii)-(B), and (iii)) to the LFNST. Of course, the combinations of the simplification methods are not limited to the following examples, and any combination can be applied to the LFNST.

[0234] Working Example

[0235] -Limit the number of output data for forward LFNST to a maximum of 16 → (i)

[0236] When -4×4LFNST is applied, all areas to which 4×4LFNST is not applied are zeroed out → (ii)-(A)

[0237] When -8×8LFNST is applied, all areas to which 8×8LFNST is not applied are zeroed out → (ii)-(B)

[0238] - For areas filled with existing 0 values ​​and areas filled with 0 by additional zero-out ((ii)-(A), (ii)-(B)), check whether non-zero data exists, and only if non-zero data exists, perform LFNST indexing signaling → (iii)

[0239] In the above embodiment, when LFNST is applied, the area where non-zero output data can exist is limited to the inside of the upper left 4x4 area. More specifically, in the cases of Figures 13(a) and 14(a), the 8th position in the scan order is the last position where non-zero data can exist, and in the cases of Figures 13(b) and 13(d) and Figure 14(b), the 16th position in the scan order (i.e., the bottom rightmost position of the upper left 4x4 block) is the last position where non-zero data can exist.

[0240] Therefore, when LFNST is applied, it is possible to determine whether or not to signal an LFNST index after checking whether non-zero data exists at a position where the residual coding process is not allowed (a position beyond the last position).

[0241] In the case of the zero-out method proposed in (ii), the amount of calculations required when performing the entire transformation process can be reduced because the amount of data that is ultimately generated when both the primary transformation and LFNST are applied is reduced. In other words, when LFNST is applied, zero-out is also applied to the forward primary transformation output data that exists in the area where LFNST is not applied, so there is no need to generate data for the area that will be zero-out when performing the forward primary transformation. Therefore, the amount of calculations required to generate the corresponding data can be reduced. Additional effects of the zero-out method proposed in (ii) can be summarized as follows.

[0242] First, as described above, the amount of computation required to perform the entire transformation process is reduced.

[0243] In particular, when (ii)-(B) is applied, the amount of calculations in the worst case is reduced, making the transform process lighter. To expand on the explanation, a large amount of calculations is generally required to execute a large-size primary transform, and when (ii)-(B) is applied, the number of data derived as the forward LFNST execution result can be reduced to 16 or less, and the effect of reducing the amount of transform calculations increases as the size of the entire block (TU or CU) increases.

[0244] Second, the amount of computation required for the entire conversion process is reduced, thereby reducing the power consumption required to perform the conversion.

[0245] Third, it reduces the latency associated with the conversion process.

[0246] Secondary transforms such as LFNST increase the overall latency associated with transform execution by adding computational complexity to the existing primary transform. In particular, in the case of intra prediction, reconstruction data of adjacent blocks is used in the prediction process, so the increase in latency due to secondary transform during encoding leads to an increase in latency until reconstruction, which can lead to an increase in the overall latency of intra prediction encoding.

[0247] However, by applying the zero-out technique proposed in (ii), the latency of the first transform execution can be significantly reduced when LFNST is applied, so the latency of the entire transform execution can be maintained or reduced, making it easier to implement the encoding device.

[0248] Meanwhile, in the conventional intra prediction, a block to be coded is regarded as one coding unit and coded without division. However, ISP (Intra Sub-Paritions) coding means dividing a block to be coded horizontally or vertically and coding the block as an intra prediction. At this time, coding / decoding is performed in divided block units to generate a restored block, and the restored block can be used as a reference block for the next divided block. As an example, in ISP coding, one coding block can be divided into two or four sub-blocks and coded, and in ISP, one sub-block performs intra prediction by referring to the restored pixel value of the sub-block located to the left or above the adjacent sub-block. Hereinafter, "coding" used can be used as a concept including both coding performed by an encoding device and decoding performed by a decoding device.

[0249] ISP divides a luma intra predicted block into 2 or 4 subpartitions vertically or horizontally depending on the size of the block. For example, the minimum block size for which ISP can be applied is 4x8 or 8x4. If the block size is larger than 4x8 or 8x4, the block is divided into 4 subpartitions.

[0250] When ISP is applied, sub-blocks are coded sequentially, for example, horizontally or vertically, from left to right or from top to bottom, depending on the division form, and after a restoration process is performed through inverse transform and intra prediction for one sub-block, coding for the next sub-block can proceed. For the leftmost or topmost sub-block, restored pixels of the previously coded coding block are referenced as in a conventional intra prediction method. Also, for each side of a subsequent inner sub-block, if it is not adjacent to the previous sub-block, restored pixels of the previously coded adjacent coding block are referenced as in a conventional intra prediction method to derive reference pixels adjacent to the corresponding side.

[0251] In the ISP coding mode, all sub-blocks can be coded in the same intra prediction mode, and a flag indicating whether to use ISP coding and a flag indicating which direction (horizontal or vertical) to divide can be signaled. In this case, the number of sub-blocks can be adjusted to 2 or 4 depending on the block, and if the size (width x height) of one sub-block is less than 16, division into the corresponding sub-block is not allowed, or ISP coding itself can be restricted from being applied.

[0252] Meanwhile, in the case of the ISP prediction mode, one coding unit is divided into two or four partition blocks, i.e., sub-blocks, and predicted, and the same intra-frame prediction mode is applied to the two or four partition blocks.

[0253] As described above, the division direction can be either horizontal (when an M×N coding unit with a horizontal length and a vertical length of M and N is divided horizontally, it is divided into M×(N / 2) blocks when divided into two, and into M×(N / 4) blocks when divided into four) or vertical (when an M×N coding unit is divided vertically, it is divided into (M / 2)×N blocks when divided into two, and into (M / 4)×N blocks when divided into four). When divided horizontally, the partition blocks are coded in the order from top to bottom, and when divided vertically, the partition blocks are coded in the order from left to right. When the partition block is divided horizontally (vertically), it can be predicted by referring to the restored pixel value of the upper (left) partition block.

[0254] A transform can be applied to the residual signal generated by the ISP prediction method in partition block units. In addition to the existing DCT-2, a DST-7 / DCT-8 combination-based Multiple Transform Selection (MTS) technology can be applied to the primary transform (core transform or primary transform) based on the forward direction, and a forward Low Frequency Non-Separable Transform (LFNST) can be applied to the transform coefficients generated by the primary transform to generate final modified transform coefficients.

[0255] That is, LFNST can also be applied to partition blocks divided by applying the ISP prediction mode, and the same intra prediction mode is applied to the divided partition blocks as described above. Therefore, when an LFNST set derived based on the intra prediction mode is selected, the derived LFNST set can be applied to all partition blocks. That is, since the same intra prediction mode is applied to all partition blocks, the same LFNST set can be applied to all partition blocks.

[0256] Meanwhile, as an example, LFNST can be applied only to transform blocks whose horizontal and vertical lengths are both equal to or greater than 4. Therefore, if the horizontal or vertical length of a partition block divided by ISP prediction is less than 4, LFNST is not applied and an LFNST index is not signaled. Also, when LFNST is applied to each partition block, the partition block can be regarded as one transform block. Of course, when ISP prediction is not applied, LFNST can be applied to a coding block.

[0257] The specific process of applying LFNST to each partition block is as follows.

[0258] As an example, after applying forward LFNST to an individual partition block, only up to 16 (8 or 16) coefficients are left in the upper left 4x4 region according to the transform coefficient scanning order, and then zeroing out can be applied to the remaining positions and regions, filling them all with zero values.

[0259] Alternatively, as an example, if the length of one side of a partition block is 4, LFNST is applied only to the top left 4×4 region. If the lengths of all sides of the partition block, i.e., the width and height, are 8 or more, LFNST is applied to the remaining 48 coefficients excluding the bottom right 4×4 region within the top left 8×8 region.

[0260] Alternatively, in one example, in order to achieve worst-case computational complexity of 8 multiplications per sample, only 8 transform coefficients may be output after applying forward LFNST if each partition block is 4×4 or 8×8. That is, if the partition block is 4×4, an 8×16 matrix may be applied to the transform matrix, and if the partition block is 8×8, an 8×48 matrix may be applied to the transform matrix.

[0261] Meanwhile, in the current VVC standard, LFNST index signaling is performed on a coding unit basis. Therefore, in the ISP prediction mode, when LFNST is applied to all partition blocks, the same LFNST index value can be applied to the corresponding partition blocks. That is, when an LFNST index value is transmitted once at the coding unit level, the corresponding LFNST index can be applied to all partition blocks within the coding unit. As described above, the LFNST index value can have values ​​of 0, 1, and 2, where 0 indicates that LFNST is not applied and 1 and 2 indicate two transformation matrices present in one LFNST set when LFNST is applied.

[0262] As described above, the LFNST set is determined by the intra prediction mode. In the case of the ISP prediction mode, all partition blocks in a coding unit are predicted in the same intra prediction mode, and therefore the partition blocks can refer to the same LFNST set.

[0263] As another example, LFNST index signaling is still performed on a coding unit basis, but instead of uniformly determining whether LFNST is applied to all partition blocks in the case of an ISP prediction mode, it may be determined whether to apply the LFNST index value signaled at the coding unit level to each partition block or not to apply LFNST through a separate condition. Here, the separate condition may be signaled in the form of a flag for each partition block through the bitstream, where if the flag value is 1, the LFNST index value signaled at the coding unit level is applied, and if the flag value is 0, LFNST is not applied.

[0264] In the following, we will describe a method for maintaining the worst-case computational complexity when applying LFNST to the ISP mode.

[0265] In ISP mode, when applying LFNST, the application of LFNST can be limited to keep the number of multiplications per sample (or per coefficient, or per position) below a certain value. Depending on the size of the partition block, LFNST can be applied as follows to keep the number of multiplications per sample (or per coefficient, or per position) below 8.

[0266] 1. If the horizontal and vertical lengths of the partition block are both 4 or more, the same method as the worst-case calculation complexity adjustment method for LFNST in the current VVC standard can be applied.

[0267] That is, when the partition block is a 4×4 block, instead of the 16×16 matrix, an 8×16 matrix obtained by sampling the top 8 rows from the 16×16 matrix can be applied in the forward direction, and a 16×8 matrix obtained by sampling the left 8 columns from the 16×16 matrix can be applied in the reverse direction. Also, when the partition block is an 8×8 block, instead of the 16×48 matrix, an 8×48 matrix obtained by sampling the top 8 rows from the 16×48 matrix can be applied in the forward direction, and a 48×8 matrix obtained by sampling the left 8 columns from the 48×16 matrix can be applied in the reverse direction.

[0268] In the case of a 4xN or Nx4 (N>4) block, when performing a forward transform, 16 coefficients generated after applying a 16x16 matrix only to the top left 4x4 block are arranged in the top left 4x4 region, and the other regions can be filled with 0 values. Also, when performing an inverse transform, 16 coefficients located in the top left 4x4 block are arranged in a scanning order to form an input vector, and then multiplied by a 16x16 matrix to generate 16 output data. The generated output data is arranged in the top left 4x4 region, and the remaining regions except the top left 4x4 region can be filled with 0 values.

[0269] In the case of an 8×N or N×8 (N>8) block, when performing a forward transform, 16 coefficients generated after applying a 16×48 matrix only to the ROI region (the remaining region of the top left 8×8 block excluding the bottom right 4×4 block) inside the top left 8×8 block are arranged in the top left 4×4 region, and the remaining regions are all filled with 0 values. Also, when performing an inverse transform, 16 coefficients located in the top left 4×4 block are arranged in a scanning order to form an input vector, and then multiplied by a 48×16 matrix to generate 48 output data. The generated output data is filled in the ROI region, and the remaining regions are all filled with 0 values.

[0270] As another example, in order to maintain the number of multiplications per sample (or per coefficient, position) below a certain value, the number of multiplications per sample (or per coefficient, position) may be maintained below 8 based on the size of the ISP coding unit, not the size of the ISP partition block. If there is only one block that satisfies the condition for applying LFNST among the ISP partition blocks, a complexity calculation for the worst case of LFNST may be applied based on the size of the corresponding coding unit, not the size of the partition block. For example, if a luma coding block for a certain coding unit is divided into four partition blocks of size 4x4 and coded by ISP, and no non-zero transform coefficient exists for two of the partition blocks, the other two partition blocks may be set to generate 16 transform coefficients (based on the encoder), not 8, respectively.

[0271] In the following, a method for signaling the LFNST index in the ISP mode will be considered.

[0272] As mentioned above, the LFNST index can have the values ​​0, 1, and 2, where 0 indicates that LFNST is not applied and 1 and 2 indicate one of two LFNST kernel matrices included in the selected LFNST set. LFNST is applied based on the LFNST kernel matrix selected by the LFNST index. The method in which the LFNST index is transmitted in the current VVC standard is as follows.

[0273] 1. An LFNST index can be transmitted once for each coding unit (CU), and in the case of a dual-tree, separate LFNST indexes can be signaled for luma blocks and chroma blocks.

[0274] 2. If the LFNST index is not signaled, the LFNST index value is inferred to the default value of 0. The cases in which the LFNST index value is inferred to 0 are as follows.

[0275] A. When the mode does not apply transform (e.g. transform skip, BDPCM, lossless coding, etc.)

[0276] B. When the primary transform is not DCT-2 (DST7 or DCT8), i.e., when the horizontal transform or vertical transform is not DCT-2

[0277] C. If the horizontal or vertical length of the luma block of the coding unit exceeds the maximum luma transform size that can be converted, for example, if the maximum luma transform size that can be converted is 64 and the size of the luma block of the coding block is 128x16, LFNST cannot be applied.

[0278] In the case of a dual tree, it is determined whether the maximum luma transform size is exceeded for each of the coding unit for the luma component and the coding unit for the chroma component. That is, it is checked whether the maximum luma transform size that can be transformed is exceeded for the luma block, and it is checked whether the horizontal / vertical length of the corresponding luma block for the color format and the maximum luma transform size that can be transformed are exceeded for the chroma block. For example, if the color format is 4:2:0, the horizontal / vertical length of the corresponding luma block is twice that of the corresponding chroma block, and the transform size of the corresponding luma block is twice that of the corresponding chroma block. As another example, if the color format is 4:4:4, the horizontal / vertical length and transform size of the corresponding luma block are the same as those of the corresponding chroma block.

[0279] A 64-length transform or a 32-length transform refers to a transform applied horizontally or vertically having a length of 64 or 32, respectively, and the "transform size" may refer to the corresponding length of 64 or 32.

[0280] In the case of a single tree, after checking whether the horizontal or vertical length of the luma block exceeds the maximum luma transform block size that can be transformed, if it does, the LFNST index signaling can be omitted.

[0281] D. The LFNST index can be transmitted only if the width and height of the coding unit are both 4 or greater.

[0282] In the case of a dual tree, the LFNST index can be signaled only when the width and height of the corresponding component (i.e., luma or chroma component) are both 4 or more.

[0283] In the case of a single tree, the LFNST index can be signaled when the width and height of the luma component are both 4 or more.

[0284] E. If the position of the last non-zero coefficient is not the DC position (upper left corner of the block), and if it is a dual tree type luma block, an LFNST index is sent if the position of the last non-zero coefficient is not the DC position. If it is a dual tree type chroma block, an LNFST index is sent if either the position of the last non-zero coefficient for Cb or the position of the last non-zero coefficient for Cr is not the DC position.

[0285] In the case of the single tree type, the LFNST index is transmitted when the position of the last non-zero coefficient of any one of the luma, Cb, and Cr components is not the DC position.

[0286] Here, when a coded block flag (CBF) value indicating whether a transform coefficient exists for a transform block is 0, the position of the last non-zero coefficient for the transform block is not checked to determine whether LFNST index signaling is required. That is, when the CBF value is 0, no transform is applied to the block, so the position of the last non-zero coefficient is not considered when checking the condition for LFNST index signaling.

[0287] For example, 1) in the case of a dual tree type and a luma component, if the corresponding CBF value is 0, no LFNST index is signaled; 2) in the case of a dual tree type and a chroma component, if the CBF value for Cb is 0 and the CBF value for Cr is 1, only the position of the last non-zero coefficient for Cr is checked and the corresponding LFNST index is transmitted; and 3) in the case of a single tree type, the position of the last non-zero coefficient is checked only for components whose CBF values ​​for all of luma, Cb, and Cr are 1.

[0288] F. If it is confirmed that a transform coefficient exists at a position where an LFNST transform coefficient cannot exist, LFNST index signaling can be omitted. In the case of 4×4 transform blocks and 8×8 transform blocks, the LFNST transform coefficient can exist at 8 positions from the DC position according to the transform coefficient scanning order in the VVC standard, and the remaining positions are all filled with 0. In addition, in the case of blocks other than 4×4 transform blocks and 8×8 transform blocks, the LFNST transform coefficient can exist at 16 positions from the DC position according to the transform coefficient scanning order in the VVC standard, and the remaining positions are all filled with 0.

[0289] Therefore, if a non-zero transform coefficient exists in the area where the zero value should be filled after residual coding, the LFNST index signaling can be omitted.

[0290] Meanwhile, the ISP mode may be applied only to the luma block, or may be applied to both the luma block and the chroma block. As described above, when ISP prediction is applied, a corresponding coding unit is predicted by dividing it into two or four partition blocks, and a transform may be applied to each of the corresponding partition blocks. Therefore, when determining a condition for signaling an LFNST index in units of coding units, the fact that LFNST may be applied to each of the corresponding partition blocks should be taken into consideration. In addition, when the ISP prediction mode is applied only to a specific component (e.g., a luma block), the LFNST index should be signaled taking into consideration the fact that only the corresponding component is divided into partition blocks. Possible LFNST index signaling methods in the ISP mode are summarized as follows.

[0291] 1. An LFNST index can be transmitted once for each coding unit (CU), and in the case of a dual-tree, separate LFNST indexes can be signaled for luma blocks and chroma blocks.

[0292] 2. If the LFNST index is not signaled, the LFNST index value is inferred to the default value of 0. The cases in which the LFNST index value is inferred to 0 are as follows.

[0293] A. When the mode does not apply transform (e.g. transform skip, BDPCM, lossless coding, etc.)

[0294] B. If the horizontal or vertical length of the luma block of the coding unit exceeds the maximum luma transform size that can be converted, for example, if the maximum luma transform size that can be converted is 64 and the size of the luma block of the coding block is 128x16, LFNST cannot be applied.

[0295] Alternatively, whether to signal the LFNST index may be determined based on the size of the partition block instead of the coding unit. That is, if the horizontal or vertical length of the partition block for the corresponding luma block exceeds the maximum luma transform size that can be transformed, the LFNST index signaling may be omitted and the LFNST index value may be inferred to be 0.

[0296] In the case of a dual tree, it is determined whether the maximum transform block size is exceeded for each of the coding unit or partition block for the luma component and the coding unit or partition block for the chroma component. That is, the horizontal and vertical lengths of the coding unit or partition block for luma are compared with the maximum luma transform size, and if any one of them is larger than the maximum luma transform size, LFNST is not applied. In the case of the coding unit or partition block for chroma, the horizontal / vertical lengths of the corresponding luma block for the color format are compared with the maximum luma transform size that can be transformed. For example, if the color format is 4:2:0, the horizontal / vertical lengths of the corresponding luma block are each twice as long as the corresponding chroma block, and the transform size of the corresponding luma block is twice as long as the corresponding chroma block. As another example, if the color format is 4:4:4, the horizontal / vertical lengths and transform size of the corresponding luma block are the same as the corresponding chroma block.

[0297] In the case of a single tree, after checking whether the horizontal or vertical length of the luma block (coding unit or partition block) exceeds the maximum luma transform block size that can be transformed, if it does, the LFNST index signaling can be omitted.

[0298] C. If LFNST included in the current VVC standard is applied, the LFNST index can be sent only when the width and length of the partition block are both 4 or more.

[0299] If LFNST for 2xM (1xM) or Mx2 (Mx1) blocks is applied in addition to the LFNST currently included in the VVC standard, an LFNST index can be transmitted only when the partition block size is greater than or equal to 2xM (1xM) or Mx2 (Mx1) blocks. Here, PxQ blocks being greater than or equal to RxS blocks means that P≧R and Q≧S.

[0300] To summarize, an LFNST index can be sent only if the partition block is greater than or equal to the minimum size for which LFNST is applicable. In the case of a dual tree, an LFNST index can be signaled only if the partition block for the luma or chroma component is greater than or equal to the minimum size for which LFNST is applicable. In the case of a single tree, an LFNST index can be signaled only if the partition block for the luma component is greater than or equal to the minimum size for which LFNST is applicable.

[0301] In this document, an M×N block larger than or equal to a K×L block means that M is larger than or equal to K and N is larger than or equal to L. An M×N block larger than a K×L block means that M is larger than or equal to K, N is larger than or equal to L, and M is larger than K or N is larger than L. An M×N block smaller than or equal to a K×L block means that M is smaller than or equal to K and N is smaller than or equal to L, and an M×N block smaller than a K×L block means that M is smaller than or equal to K, N is smaller than or equal to L, and M is smaller than K or N is smaller than L.

[0302] D. If the position of the last non-zero coefficient is not the DC position (the upper left corner of the block), in the case of a dual tree type luma block, the LFNST index can be transmitted when the position of the last non-zero coefficient in any one of the partition blocks is not the DC position. In the case of a dual tree type chroma block, the LNFST index can be transmitted when any one of the positions of the last non-zero coefficient in all partition blocks for Cb (when ISP mode is not applied to the chroma component, the number of partition blocks is considered to be one) and the position of the last non-zero coefficient in all partition blocks for Cr (when ISP mode is not applied to the chroma component, the number of partition blocks is considered to be one) is not the DC position.

[0303] In the case of a single tree type, if the position of the last non-zero coefficient of any one of all partition blocks for the luma component, Cb component, or Cr component is not the DC position, the corresponding LFNST index can be transmitted.

[0304] Here, when a coded block flag (CBF) value indicating the presence or absence of a transform coefficient for each partition block is 0, the position of the last non-zero coefficient for the partition block is not checked to determine whether LFNST index signaling is required. That is, when the CBF value is 0, no transform is applied to the block, so the position of the last non-zero coefficient for the partition block is not considered when checking the condition for LFNST index signaling.

[0305] For example, 1) in the case of a dual tree type and a luma component, when the corresponding CBF value for each partition block is 0, the corresponding partition block is excluded when determining whether to signal the LFNST index; 2) in the case of a dual tree type and a chroma component, when the CBF value for Cb is 0 and the CBF value for Cr is 1 for each partition block, only the position of the last non-zero coefficient for Cr is checked to determine whether to signal the corresponding LFNST index; and 3) in the case of a single tree type, for all partition blocks of the luma component, Cb component, and Cr component, the position of the last non-zero coefficient is checked only for blocks with a CBF value of 1 to determine whether to signal the LFNST index.

[0306] In the ISP mode, the image information may be configured so as not to check the position of the last non-zero coefficient, and an embodiment thereof will be described below.

[0307] In the case of ISP mode, the check on the position of the last non-zero coefficient for both luma blocks and chroma blocks can be omitted and LFNST index signaling can be accepted. That is, even if the position of the last non-zero coefficient for all partition blocks is the DC position or the corresponding CBF value is 0, the corresponding LFNST index signaling can be accepted.

[0308] ii. In the ISP mode, a check on the position of the last non-zero coefficient may be omitted only for the luma block, and a check on the position of the last non-zero coefficient may be performed in the above-mentioned manner in the case of a chroma block. For example, in the case of a dual tree type and a luma block, a check on the position of the last non-zero coefficient may be omitted and LFNST index signaling may be permitted, and in the case of a dual tree type and a chroma block, a check on the presence of a DC position for the position of the last non-zero coefficient may be performed in the above-mentioned manner to determine whether or not to signal the corresponding LFNST index.

[0309] iii. In the case of ISP mode and single tree type, the above method i or method ii can be applied. That is, in the case of ISP mode and single tree type, when method i is applied, a check on the position of the last non-zero coefficient for both luma block and chroma block can be omitted to allow LFNST index signaling. Alternatively, by applying method ii, a check on the position of the last non-zero coefficient for partition block for luma component can be omitted, and for partition block for chroma component (when ISP is not applied to chroma component, the number of partition blocks can be considered to be 1), a check on the position of the last non-zero coefficient can be performed in the above-mentioned method to determine whether to signal the corresponding LFNST index.

[0310] E. If it is confirmed that a transform coefficient exists in a position where an LFNST transform coefficient is not allowed for even one partition block among all partition blocks, the LFNST index signaling can be omitted.

[0311] For example, in the case of a 4×4 partition block and an 8×8 partition block, the transform coefficient scanning order in the VVC standard allows LFNST transform coefficients to exist at 8 positions from the DC position, and the remaining positions are all filled with 0. Also, in the case of a block that is larger than or equal to 4×4 and is not a 4×4 partition block or an 8×8 partition block, the transform coefficient scanning order in the VVC standard allows LFNST transform coefficients to exist at 16 positions from the DC position, and the remaining positions are all filled with 0.

[0312] Therefore, if a non-zero transform coefficient exists in the area where the zero value should be filled after performing residual coding, the LFNST index signaling can be omitted.

[0313] Meanwhile, in the case of ISP mode, the current VVC standard checks the length conditions for the horizontal and vertical directions independently and applies DST-7 instead of DCT-2 without signaling for the MTS index. It is determined whether the horizontal or vertical length is greater than or equal to 4 and less than or equal to 16, and the primary transform kernel is determined according to the determination result. Therefore, in the case of ISP mode and LFNST can be applied, the following transform combination configurations are possible.

[0314] 1. If the LFNST index is 0 (including the case where the LFNST index is inferred to be 0), the primary transformation decision condition for the ISP currently included in the VVC standard can be followed. That is, it is checked whether the length condition (greater than or equal to 4, and less than or equal to 16) is satisfied independently for the horizontal and vertical directions, and if it is satisfied, DST-7 is applied instead of DCT-2 for the primary transformation, and if it is not satisfied, DCT-2 is applied.

[0315] 2. When the LFNST index is greater than 0, the following two configurations are possible for the linear transformation:

[0316] A. DCT-2 can be applied to both the horizontal and vertical directions.

[0317] B. It can follow the primary transformation decision condition for ISP currently included in the VVC standard, i.e., it checks whether the length condition (greater than or equal to 4, and less than or equal to 16) is satisfied independently for the horizontal and vertical directions, and if so, applies DST-7 instead of DCT-2, and if not, applies DCT-2.

[0318] In the ISP mode, the video information can be configured so that the LFNST index is transmitted for each partition block, not for each coding unit. In this case, it can be determined whether to signal the LFNST index by regarding that there is only one partition block within the unit in which the LFNST index is transmitted in the above-mentioned LFNST index signaling method.

[0319] Meanwhile, the signaling order of the LFNST index and the MTS index will be considered below.

[0320] As an example, the LFNST index signaled in residual coding may be coded next to the coding position for the last non-zero coefficient position, and the MTS index may be coded immediately after the LFNST index. In such a configuration, the LFNST index may be signaled for each transform unit. Alternatively, even if not signaled in residual coding, the LFNST index may be coded next to the coding position for the last significant coefficient position, and the MTS index may be coded next to the LFNST index.

[0321] The syntax of the residual coding according to an example is as follows:

[0322] [Table 4-1]

[0323] [Table 4-2]

[0324] The meanings of the main variables shown in Table 4 are as follows:

[0325] 1. cbWidth, cbHeight: Width and height of the current coding block

[0326] 2. log2TbWidth, log2TbHeight: Base-2 log value for the width and height of the current transform block. Zero-out is reflected and it can be reduced to the upper left corner area where non-zero coefficients can exist.

[0327] 3. sps_lfnst_enabled_flag: A flag indicating whether LFNST is applicable (enabled). If the flag value is 0, it indicates that LFNST is not applicable, and if the flag value is 1, it indicates that LFNST is applicable. This is defined in the Sequence Parameter Set (SPS).

[0328] 4. CuPredMode[chType][x0][y0]: Prediction mode corresponding to the variable chType and the (x0, y0) position. chType can have values ​​of 0 and 1, where 0 indicates the luma component and 1 indicates the chroma component. The (x0, y0) position indicates a position on the picture, and the CuPredMode[chType][x0][y0] value can be MODE_INTRA (intra prediction) or MODE_INTER (inter prediction).

[0329] 5. IntraSubPartitionsSplit[x0][y0]: The content for the (x0, y0) position is the same as 4. It indicates what type of ISP split is applied at the (x0, y0) position, and ISP_NO_SPLIT indicates that the coding unit corresponding to the (x0, y0) position is not split into partition blocks.

[0330] 6. intra_mip_flag[x0][y0]: The contents for the (x0, y0) position are the same as in 4 above. intra_mip_flag is a flag indicating whether MIP (Matrix-based Intra Prediction) prediction mode is applied. If the flag value is 0, it indicates that MIP is not applicable, and if the flag value is 1, it indicates that MIP is applied.

[0331] 7. cIdx: A value of 0 indicates luma, and values ​​of 1 and 2 indicate the chroma components Cb and Cr, respectively.

[0332] 8. treeType: Refers to single-tree and dual-tree (SINGLE_TREE: single tree, DUAL_TREE_LUMA: dual tree for luma component, DUAL_TREE_CHROMA: dual tree for chroma component)

[0333] 9. tu_cbf_cb[x0][y0]: The contents for the (x0, y0) position are the same as in 4. Indicates the CBF (Coded Block Flag) for the Cb component. When the value is 0, it means that a non-zero coefficient does not exist in the transform unit corresponding to the Cb component, and when the value is 1, it indicates that a non-zero coefficient exists in the transform unit corresponding to the Cb component.

[0334] 10. lastSubBlock: Indicates the position in the scan order of the sub-block (Coefficient Group (CG)) in which the last non-zero coefficient is located. 0 indicates a sub-block containing DC components, and if it is greater than 0, it is not a sub-block containing DC components.

[0335] 11. lastScanPos: Indicates the position of the last valid coefficient in the scan order within a subblock. If a subblock consists of 16 positions, the possible values ​​are 0 to 15.

[0336] 12. lfnst_idx[x0][y0]: LFNST index syntax element to be parsed. If not parsed, it is inferred to 0. That is, the default value is set to 0, which indicates that LFNST is not applied.

[0337] 13. LastSignificantCoeffX, LastSignificantCoeffY: Indicates the x and y coordinates where the last significant coefficient is located in the transform block. The x coordinate starts from 0 and increases from left to right, and the y coordinate starts from 0 and increases from top to bottom. If the values ​​of the two variables are all 0, it means that the last significant coefficient is located at DC.

[0338] 14. cu_sbt_flag: A flag indicating whether the SubBlock Transform (SBT) currently included in the VVC standard is applicable. If the flag value is 0, it indicates that the SBT is not applicable, and if the flag value is 1, it indicates that the SBT is applied.

[0339] 15. sps_explicit_mts_inter_enabled_flag, sps_explicit_mts_intra_enabled_flag: Flags indicating whether explicit MTS has been applied to inter CUs and intra CUs, respectively. If the corresponding flag value is 0, it indicates that MTS is not applicable to inter CUs or intra CUs, and if the flag value is 1, it indicates that MTS is applicable.

[0340] 16. tu_mts_idx[x0][y0]: MTS index syntax element to be parsed. If not parsed, it is inferred to a value of 0. That is, the default value is set to 0, which indicates that DCT-2 is applied to all horizontal and vertical directions.

[0341] As shown in Table 4, in the case of a single tree, whether to signal an LFNST index can be determined based only on the last significant coefficient position condition for luma. That is, if the last significant coefficient position is not DC and the last significant coefficient exists in the top left sub-block (CG), for example, a 4x4 block, the LFNST index is signaled. In this case, in the case of a 4x4 transform block and an 8x8 transform block, the LFNST index is signaled only if the last significant coefficient exists in positions 0 to 7 in the top left sub-block.

[0342] In the case of a dual tree, the LFNST index is signaled independently for luma and chroma, and for chroma, the LFNST index can be signaled by applying the last significant coefficient position condition only to the Cb component.The corresponding condition is not checked for the Cr component, and if the CBF value for Cb is 0, the LFNST index can be signaled by applying the last significant coefficient position condition to the Cr component.

[0343] In Table 4, "Min(log2TbWidth, log2TbHeight) >= 2" can be expressed as "Min(tbWidth, tbHeight) >= 4", and "Min(log2TbWidth, log2TbHeight) >= 4" can be expressed as "Min(tbWidth, tbHeight) >= 16".

[0344] In Table 4, log2ZoTbWidth and log2ZoTbHeight refer to the base-2 log values ​​of the width and height, respectively, for the top-left region where the last significant coefficient can reside due to zeroing out.

[0345] As shown in Table 4, the log2ZoTbWidth and log2ZoTbHeight values ​​can be updated in two places: first before the MTS index or LFNST index value is parsed, and second after parsing the MTS index.

[0346] The first update occurs before the MTS index (tu_mts_idx[x0][y0]) value is parsed, so log2ZoTbWidth and log2ZoTbHeight can be set regardless of the MTS index value.

[0347] After the MTS index is parsed, log2ZoTbWidth and log2ZoTbHeight are set if the MTS index value is greater than 0 (in the case of DST-7 / DCT-8 combination). When DST-7 / DCT-8 is applied independently to the horizontal and vertical directions in the first transformation, up to 16 effective coefficients can exist per row or column in each direction. That is, after applying a DST-7 / DCT-8 with a length of 32 or more, up to 16 transform coefficients can be derived per row or column from the left or top. Therefore, when DST-7 / DCT-8 is applied to both the horizontal and vertical directions for a 2D block, effective coefficients can only exist up to the top left 16x16 region.

[0348] Also, currently, when DCT-2 is applied independently to the horizontal and vertical directions in a primary transform, up to 32 effective coefficients can exist for each row or column in each direction. That is, when a DCT-2 with a length of 64 or more is applied, up to 32 transform coefficients can be derived for each row or column from the left or top. Therefore, when DCT-2 is applied to both the horizontal and vertical directions for a 2D block, effective coefficients can only exist up to the top left 32x32 region.

[0349] Also, when DST-7 / DCT-8 is applied to one side of the horizontal direction and DCT-2 is applied to the other side of the vertical direction, there can be 16 significant coefficients in the former direction and 32 significant coefficients in the latter direction. For example, in a 64x8 transform block, when DCT-2 is applied to the horizontal direction and DST-7 is applied to the vertical direction (which can occur when implicit MTS is applied), there can be significant coefficients in the upper left 32x8 region at most.

[0350] If log2ZoTbWidth and log2ZoTbHeight are updated in two places as in Table 4, i.e., before MTS index parsing, the range of last_sig_coeff_x_prefix and last_sig_coeff_y_prefix can be determined by log2ZoTbWidth and log2ZoTbHeight as shown in the table below.

[0351] [Table 5]

[0352] In such a case, the maximum values ​​of last_sig_coeff_x_prefix and last_sig_coeff_y_prefix can be set by reflecting the log2ZoTbWidth and log2ZoTbHeight values ​​in the binarization process for last_sig_coeff_x_prefix and last_sig_coeff_y_prefix.

[0353] [Table 6]

[0354] Meanwhile, as an example, in the case where the ISP mode is selected and LFNST is applied, the spec text can be configured as shown in Table 7 when the signaling in Table 4 is applied. Compared to Table 4, the condition in which the LFNST index is signaled only when the ISP mode is not selected (IntraSubPartitionsSplit[x0][y0]==ISP_NO_SPLIT in Table 4) has been deleted.

[0355] In the case of a single tree, if the LFNST index sent in the case of luma (cIdx=0) is reused in the case of chroma, the LFNST index sent for the first ISP partition block in which a significant coefficient exists can be applied to the chroma transform block. Or, even in the case of a single tree, the LFNST index can be signaled separately from the luma component for the case of a chroma component. The variables listed in Table 7 are explained in Table 4.

[0356] [Table 7]

[0357] Meanwhile, according to one example, the LFNST index and / or the MTS index may be signaled at a coding unit level. As described above, the LFNST index may have three values, 0, 1, and 2, where 0 indicates that LFNST is not applied, and 1 and 2 indicate the first and second candidates, respectively, of the two LFNST kernel candidates included in the selected LFNST set. The LFNST index is coded via truncated unary binarization, and the values ​​0, 1, and 2 may be coded with bin strings 0, 10, and 11, respectively.

[0358] According to one example, LFNST can be applied only when DCT-2 is applied to both the horizontal and vertical directions in the primary transform. Therefore, if the MTS index is signaled after the LFNST index signaling, the MTS index can be signaled only if the LFNST index value is 0, and if the LFNST index is not 0, the primary transform can be performed by applying DCT-2 to both the horizontal and vertical directions without signaling the MTS index.

[0359] The MTS index value may have values ​​of 0, 1, 2, 3, and 4, where 0, 1, 2, 3, and 4 may indicate that DCT-2 / DCT-2, DST-7 / DST-7, DCT-8 / DST-7, DST-7 / DCT-8, and DCT-8 / DCT-8 are applied to the horizontal and vertical directions, respectively. Also, the MTS index may be coded via truncated unary binarization, where the 0, 1, 2, 3, and 4 values ​​may be coded with bin strings 0, 10, 110, 1110, and 1111, respectively.

[0360] The LFNST index and the MTS index can be signaled at the coding unit level, and the MTS index can be coded following the LFNST index at the coding unit level. The coding unit syntax table for this is as follows.

[0361] [Table 8]

[0362] The variables LfnstDcOnly and LfnstZeroOutSigCoeffFlag in Table 8 may be set as shown in Table 9 below.

[0363] The variable LfnstDcOnly is set to 1 if all the last significant coefficients for a transform block whose CBF (Coded Block Flag, which is 1 if there is at least one significant coefficient in the block and 0 otherwise) value is 1 are located at the DC position (top left position), and is set to 0 otherwise. More specifically, in the case of dual tree luma, the position of the last significant coefficient is checked for one luma transform block, and in the case of dual tree chroma, the position of the last significant coefficient is checked for both the transform block for Cb and the transform block for Cr. In the case of a single tree, the position of the last significant coefficient can be checked for the transform blocks for luma, Cb, and Cr.

[0364] The variable LfnstZeroOutSigCoeffFlag is 0 if there is a valid coefficient in a position that will be zeroed out when LFNST is applied, and is 1 otherwise.

[0365] In Table 8 and the following tables, lfnst_idx[x0][y0] indicates the LFNST index for the corresponding coding unit, and tu_mts_idx[x0][y0] indicates the MTS index for the corresponding coding unit.

[0366] As shown in Table 8, the condition for signaling lfnst_idx[x0][y0] may include a condition for checking whether the transform_skip_flag[x0][y0] value is 0 (!transform_skip_flag[x0][y0]), in which case the condition for checking whether the existing tu_mts_idx[x0][y0] value is 0 (i.e., checking whether it is DCT-2 for both the horizontal and vertical directions) may be omitted.

[0367] transform_skip_flag[x0][y0] indicates whether the coding unit is coded in a transform skip mode in which transform is omitted, and the flag is signaled before the MTS index and the LFNST index. That is, since lfnst_idx[x0][y0] is signaled before signaling the tu_mtx_idx[x0][y0] value, only the condition for the transform_skip_flag[x0][y0] value can be checked.

[0368] As shown in Table 8, when coding tu_mts_idx[x0][y0], various conditions are checked and, as previously described, tu_mts_idx[x0][y0] is signaled only if the value of lfnst_idx[x0][y0] is 0.

[0369] In addition, tu_cbf_luma[x0][y0] is a flag indicating whether or not a significant coefficient exists for the luma component, and cbWidth and cbHeight indicate the width and height of a coding unit for the luma component, respectively.

[0370] According to Table 8, when the width and height of the coding unit for the luma component are both less than or equal to 32, tu_mts_idx[x0][y0] is signaled, that is, whether MTS is applicable is determined by the width and height of the coding unit for the luma component.

[0371] As another example, when transform block tiling occurs (e.g., when the maximum transform size is set to 32, a 64x64 coding unit is divided into four 32x32 transform blocks for coding), the MTS index may be signaled based on the size of each transform block. For example, when the width and height of a transform block are both less than or equal to 32, the same MTS index value may be applied to all transform blocks in a coding unit, and the same first-order transform may be applied. In addition, when transform block tiling occurs, the tu_cbf_luma[x0][y0] value in Table 8 is the CBF value for the top left transform block, or may be set to 1 for all transform blocks if the corresponding CBF value of even one transform block is 1.

[0372] Also, according to Table 8, even in the case of ISP mode (IntraSubPartitionsSplitType!=ISP_NO_SPLIT), lfnst_idx[x0][y0] can be configured to be signaled, and the same LFNST index value can be applied to all ISP partition blocks.

[0373] On the other hand, tu_mts_idx[x0][y0] can only be signaled in non-ISP mode (IntraSubPartitionsSplit[x0][y0]==ISP_NO_SPLIT).

[0374] If the MTS index is signaled immediately after the LFNST index as in Table 8, information on the first transform cannot be known when performing residual coding. That is, the MTS index is signaled after the residual coding. Therefore, the part in the residual coding part where only 16 coefficients are left for the DST-7 or DCT-8 of length 32 and zero-out is performed can be changed as shown in Table 9 below.

[0375] [Table 9-1]

[0376] [Table 9-2]

[0377] In the process of determining log2ZoTbWidth and log2ZoTbHeight as shown in Table 9 (where log2ZoTbWidth and log2ZoTbHeight respectively indicate the base-2 log values ​​of the width and height for the upper left region remaining after zero-out is performed), the part checking the tu_mts_idx[x0][y0] value can be omitted.

[0378] The binarization for last_sig_coeff_x_prefix and last_sig_coeff_y_prefix in Table 9 can be determined based on log2ZoTbWidth and log2ZoTbHeight as in Table 6.

[0379] In addition, as shown in Table 9, when determining log2ZoTbWidth and log2ZoTbHeight in residual coding, a condition for checking sps_mts_enable_flag can be added.

[0380] For example, if information on the last significant coefficient position for a luma transform block is recorded during the residual coding process, the MTS index can be signaled as shown in Table 10.

[0381] [Table 10]

[0382] In Table 10, LumaLastSignificantCoeffX and LumaLastSignificantCoeffY respectively indicate the X and Y coordinates of the last significant coefficient position for a luma transform block. A condition that LumaLastSignificantCoeffX and LumaLastSignificantCoeffY should all be less than 16 has been added to Table 10. If any one of the two is 16 or greater, this means that DCT-2 is applied to both the horizontal and vertical directions. This means that signaling for tu_mts_idx[x0][y0] is omitted and DCT-2 is applied to all the horizontal and vertical directions.

[0383] LumaLastSignificantCoeffX and LumaLastSignificantCoeffY being all less than 16 means that the last significant coefficient is in the upper left 16x16 region, and indicates that there is a possibility that zeroing out has been applied, leaving only 16 transform coefficients from the leftmost or topmost side, when a 32-length DST-7 or DCT-8 is applied in the current VVC standard. Therefore, tu_mts_idx[x0][y0] can be signaled to indicate the transform kernel used for the primary transform.

[0384] Meanwhile, in another example, the coding unit syntax table, the transform unit syntax table, and the residual coding syntax table are as shown in the following tables. According to Table 11, the MTS index is moved from the transform unit level to the coding unit level syntax and is signaled after the LFNST index signaling. Also, when ISP is applied to a coding unit, the restriction condition that does not allow LFNST is removed. When ISP is applied to a coding unit, the restriction condition that does not allow LFNST is removed, so that LFNST can be applied to all intra prediction blocks. Also, the MTS index and the LFNST index are all conditionally signaled at the end of the coding unit level.

[0385] [Table 11]

[0386] [Table 12]

[0387] [Table 13]

[0388] In Table 11, MtsZeroOutSigCoeffFlag is initially set to 1, and this value can be changed by residual coding in Table 13. The variable MtsZeroOutSigCoeffFlag changes its value from 1 to 0 if there is a valid coefficient in the area that should be filled with 0 by zeroing out (LastSignificantCoeffX>15||LastSignificantCoeffY>15), in which case, as in Table 11, the MTS index is not signaled.

[0389] Meanwhile, as shown in Table 11, mts_idx[x0][y0] coding can be omitted when tu_cbf_luma[x0][y0] is 0. That is, when the CBF value of the luma component is 0, no transform is applied, so there is no need to signal the MTS index, and therefore MTS index coding can be omitted.

[0390] According to an example, the technical feature may be embodied in other conditional syntax. For example, after MTS is performed, a variable indicating whether a valid coefficient exists in a region excluding the DC region of the current block may be derived, and if the variable indicates that a valid coefficient exists in a region excluding the DC region, an MTS index may be signaled. That is, the presence of a valid coefficient in a region excluding the DC region of the current block indicates that the tu_cbf_luma[x0][y0] value is 1, and in this case, an MTS index may be signaled.

[0391] The variable may be represented as MtsDcOnly, which may be initially set to 1 at a coding unit level and then changed to 0 when a residual coding level indicates that a valid coefficient exists in an area excluding a DC area of ​​a current block. When the variable MtsDcOnly is 0, video information may be configured such that an MTS index is signaled.

[0392] If tu_cbf_luma[x0][y0] is 0, the residual coding syntax is not invoked at the transform unit level in Table 12, so the variable MtsDcOnly maintains its initial value of 1. In this case, the video information can be configured such that the MTS index is not signaled because the variable MtsDcOnly was not changed to 0. That is, the MTS index is not parsed or signaled.

[0393] Meanwhile, the decoding apparatus may determine the color index (cIdx) of the transform coefficient to derive the variable MtsZeroOutSigCoeffFlag in Table 13. A color index (cIdx) of 0 indicates a luma component.

[0394] As an example, since MTS can be applied only to the luma component of the current block, the decoding device can determine whether the color index is luma when deriving the variable MtsZeroOutSigCoeffFlag, which determines whether or not to parse the MTS index (ifcIdx==0, MtsZeroOutSigCoeffFlag=0).

[0395] The variable MtsZeroOutSigCoeffFlag indicates whether zero-out is performed when MTS is applied, and indicates whether a transform coefficient exists in an area other than the top left corner area where the last valid coefficient can exist due to zero-out after MTS is performed, i.e., the top left 16x16 area. The variable MtsZeroOutSigCoeffFlag is initially set to 1 at the coding unit level as shown in Table 11 (MtsZeroOutSigCoeffFlag=1), and if a transform coefficient exists in an area other than the 16x16 area, its value can be changed from 1 to 0 at the residual coding level as shown in Table 13 (MtsZeroOutSigCoeffFlag=0). If the value of the variable MtsZeroOutSigCoeffFlag is 0, the MTS index is not signaled.

[0396] As shown in Table 13, at the residual coding level, a non-zero-out area in which non-zero transform coefficients can exist can be set depending on whether zero-out associated with MTS is performed, and in this case, if the color index (cIdx) is 0, the non-zero-out area can be set to the upper left 16x16 area of ​​the current block.

[0397] In this way, when deriving a variable that determines whether or not an MTS index can be parsed, it is determined whether the color component is luma or chroma. However, since LFNST can be applied to both the luma component and chroma component of the current block, the color component is not determined when deriving a variable that determines whether or not an LFNST index can be parsed.

[0398] For example, Table 11 shows a variable LfnstZeroOutSigCoeffFlag that can indicate that zero-out has been performed when LFNST is applied. The variable LfnstZeroOutSigCoeffFlag indicates whether a valid coefficient exists in a second region excluding a first region at the upper left corner of the current block, and this value may be initially set to 1, and if a valid coefficient exists in the second region, the value may be changed to 0. An LFNST index can be parsed only if the initially set value of the variable LfnstZeroOutSigCoeffFlag is maintained at 1. When determining and deriving whether the variable LfnstZeroOutSigCoeffFlag value is 1, the color index of the current block is not determined because LFNST can be applied to both the luma component and the chroma component of the current block.

[0399] FIG. 15 shows a block diagram of a CABAC encoding system according to one embodiment, which illustrates a block diagram of CABAC (context-adaptive biary arithmetic coding) for encoding a single syntax element.

[0400] First, in the CABAC encoding process, if an input signal is a syntax element that is not a binary value, the input signal is converted to a binary value through binarization. If the input signal is already a binary value, it is bypassed, i.e., input to the encoding engine, without binarization. Here, each binary digit 0 or 1 constituting a binary value is called a bin. For example, if the binary string after binarization is 110, each of 1, 1, and 0 is called a bin. The bin(s) for one syntax element can indicate the value of the corresponding syntax element.

[0401] The binarized bins are input to a regular encoding engine or a bypass encoding engine.

[0402] The regular coding engine assigns a context model that reflects a probability value to a corresponding bin and codes the corresponding bin based on the assigned context model. The regular coding engine can update the probability model for each bin after coding for the bin. A bin coded in this way is called a context-coded bin.

[0403] The bypass coding engine omits the steps of estimating the probability of an input bin and updating the probability model applied to the corresponding bin after coding. It improves coding speed by coding the input bin by applying a uniform probability distribution instead of assigning a context. A bin coded in this way is called a bypass bin.

[0404] Entropy coding can switch the coding path by determining whether to perform coding through a regular coding engine or a bypass coding engine. Entropy decoding performs the same process as coding in the reverse order.

[0405] When a truncated unary code is applied to the binarization method for an LFNST index, the LFNST index consists of a maximum of two bins, and the binary codes for the possible LFNST index values ​​of 0, 1, and 2 are assigned 0, 10, and 11, respectively.

[0406] As an example, a context-based CABAC coding (regular coding) may be applied to the first bin of the LFNST index, and a bypass coding (bypass coding) may be applied to the second bin.

[0407] According to another example, context-based CABAC coding may be applied to both the first and second bins of the LFNST index. The allocation of ctxInc of the LFNST index according to the context-coded bins may be expressed in the following table.

[0408] [Table 14]

[0409] As shown in Table 14, for the first bin (binIdx=0), in the case of a single tree, context 0 can be applied, and if not, context 1 can be applied. Also, as shown in Table 14, for the second bin (binIdx=1), context 2 can be applied. That is, two contexts can be assigned to the first bin, and one context can be assigned to the second bin, and each context can be distinguished by the ctxInc value (0, 1, 2).

[0410] Here, the single tree means that the luma component and the chroma component are coded in the same coding structure. After a coding unit is divided in the same coding structure, if the size of the coding unit is below a certain threshold and the luma component and the chroma component are coded in separate tree structures, the coding unit can be regarded as a dual tree and the context of the first bin can be determined. That is, the first context can be assigned as shown in Table 14.

[0411] Alternatively, if the value of the variable treeType is assigned as SINGLE_TREE for the first bin, you can code it using context 0, otherwise use context 1.

[0412] As an example, when only the first (or second) candidate of two LFNST kernel candidates is tried during the encoding process, the LFNST index has two fixed bin values ​​for the corresponding candidate (when only the first candidate is tried, it can be coded as 10, and when only the second candidate is tried, it can be coded as 11). In this case, when the second bin is coded in a bypass manner, even though the second bin is a fixed value (0 or 1), a fixed amount of bits is generated for the second bin, so the coding cost for the second bin can be significantly increased. When the second bin is coded in a non-bypass context manner, the probability of the corresponding fixed value (0 or 1) occurring for the second bin is updated to 100% when only one fixed LFNST kernel candidate is tried, so the coding cost can be significantly reduced. In summary, by coding both bins for LFNST index coding in the context manner, the loss in coding efficiency can be minimized and the encoding complexity can be reduced compared to applying only one fixed LFNST kernel candidate during the encoding process and applying both candidates, thereby providing substantial freedom in finding a performance-complexity trade-off during the encoding process.

[0413] The following drawings are created to explain a specific example of the present specification. The names of specific devices and names of specific signals / messages / fields described in the drawings are presented for illustrative purposes only, and the technical features of the present specification are not limited to the specific names used in the following drawings.

[0414] FIG. 16 is a flow diagram illustrating the operation of a video decoding device according to one embodiment of this document.

[0415] Each step disclosed in Fig. 16 is based on a part of the contents detailed in Fig. 5 to Fig. 15. Therefore, the description of the specific contents overlapping with the contents detailed in Fig. 3, and Fig. 5 to Fig. 15 will be omitted or simplified.

[0416] The decoding apparatus 300 according to an embodiment may receive information on an intra-prediction mode, residual information, and an LFNST index from a bitstream (S1610).

[0417] Such information is received in syntax information, which in turn is received in a binarized bin string containing 0's and 1's.

[0418] The decoding apparatus can derive binarization information for the syntax element of the LFNST index by generating a candidate set of binarized values ​​that the syntax element of the received transform index can have, and in this embodiment, the syntax element of the LFNST index can be binarized in a truncated unary code format.

[0419] The "transform index" syntax element according to this embodiment indicates whether LFNST is applied and which one of the LFNST kernels is included in the LFNST transform set. If the LFNST transform set includes two LFNST kernels, the value of the "LFNST index" syntax element will be three.

[0420] That is, according to one embodiment, the syntax element value for the LFNST index may include 0 indicating a case where LFNST is not applied to the current block, 1 indicating the first LFNST kernel among the LFNST kernels, or 2 indicating the second LFNST kernel among the LFNST kernels.

[0421] In this case, the syntax element values ​​for the three LFNST indexes can be coded as 0, 10, and 11 using the truncated unary code method. That is, the value 0 for the syntax element can be binarized as '0', the value 1 for the syntax element can be binarized as '10', and the value 2 for the syntax element can be binarized as '11'.

[0422] In addition, the decoding apparatus can perform residual coding based on the received residual information to derive transform coefficients (S1620).

[0423] The decoding apparatus 300 may decode information on quantized transform coefficients for a current block from a bitstream, and may derive quantized transform coefficients for a target block based on the information on the quantized transform coefficients for the current block. The information on the quantized transform coefficients for the target block may be included in a sequence parameter set (SPS) or a slice header, and may include at least one of information on whether a simplified transform (RST) is applied, information on a simplification factor, information on a minimum transform size for applying the simplified transform, information on a maximum transform size for applying the simplified transform, a simplified inverse transform size, and information on a transform index indicating any one of transform kernel matrices included in a transform set.

[0424] The decoding apparatus 300 may derive transform coefficients by performing inverse quantization on residual information for a current block, i.e., quantized transform coefficients, and may arrange the derived transform coefficients in a predetermined scanning order.

[0425] Specifically, the derived transform coefficients may be arranged in a reverse diagonal scan order in units of 4x4 blocks, and the transform coefficients in the 4x4 blocks may also be arranged in a reverse diagonal scan order, i.e., the transform coefficients on which inverse quantization has been performed may be arranged in a reverse scan order applied in a video codec such as VVC or HEVC.

[0426] The transform coefficients derived based on the residual information may be the inversely quantized transform coefficients as described above, or may be the quantized transform coefficients, that is, the transform coefficients may be data that can be checked to see if they are non-zero in the current block, regardless of whether they are quantized or not.

[0427] A decoding device can apply an inverse transform to the quantized transform coefficients to derive residual samples.

[0428] As described above, the decoding device can derive residual samples by applying the non-separable transform LFNST or the separable transform MTS, and such transforms can be performed based on an LFNST kernel, i.e., an LFNST index indicating an LFNST matrix and an MTS index indicating an MTS kernel, respectively.

[0429] Meanwhile, the decoding apparatus may derive context information for the first bin of the LFNST index according to the tree type of the current block, and derive pre-defined context information for the second bin (S1630).

[0430] Depending on the tree type of the current block, the context information for the first bin may be derived as different values. For example, if the tree type of the current block is a single tree, the first bin may be derived as the first context information, and if the tree type of the current block is not a single tree, the first bin may be derived as the second context information.

[0431] Meanwhile, the context information for the second bin can be derived as a preset value regardless of the tree type of the current block. That is, according to one example, the bin string of the LFNST index can be decoded based on a non-bypass context model for both bins.

[0432] The decoding device decodes the bins of the syntax element bin string based on the context information, and can derive the value of the syntax element for the LFNST index applied to the current block from among the binary-coded values ​​that the syntax elements of the LFNST index may have through context information-based decoding (S1640).

[0433] In summary, the decoding device receives the binarized bin string in a truncated unary code format and decodes the syntax elements of the LFNST index based on the context information.

[0434] That is, it can be determined whether one of LFNST indexes 0, 1, or 2 is applied to the current block.

[0435] The decoding apparatus 300 may determine an LFNST transform set based on a mapping relationship according to an intra-prediction mode applied to the current block, and may apply LFNST based on the LFNST transform set, the LFNST kernels included in the LFNST transform set, and the LFNST index to derive modified transform coefficients (S1650).

[0436] Thereafter, the decoding apparatus may derive residual samples for the current block based on an inverse linear transform on the modified transform coefficients (S1660), and generate a reconstructed picture based on the residual samples (S1670).

[0437] The following drawings are created to explain a specific example of the present specification. The names of specific devices and names of specific signals / messages / fields described in the drawings are presented for illustrative purposes only, and the technical features of the present specification are not limited to the specific names used in the following drawings.

[0438] FIG. 17 is a flow diagram illustrating the operation of a video encoding device according to one embodiment of this document.

[0439] Each step disclosed in Fig. 17 is based on a part of the contents detailed in Fig. 5 to Fig. 15. Therefore, the description of the specific contents overlapping with the contents detailed in Fig. 2 and Fig. 5 to Fig. 15 will be omitted or simplified.

[0440] The encoding apparatus 200 according to an embodiment may derive a prediction sample for a current block based on an intra-prediction mode applied to the current block (S1710).

[0441] The encoding apparatus 200 may derive a residual sample for the current block based on the predicted sample (S1720).

[0442] The encoding apparatus 200 may derive transform coefficients for a current block by applying at least one of LFNST and MTS to the residual samples, and may arrange the transform coefficients according to a predetermined scanning order.

[0443] The encoding apparatus may derive transform coefficients for the current block based on a linear transform for the residual samples (S1730).

[0444] The primary transform may be performed via multiple transform kernels, such as MTS, where the transform kernel may be selected based on the intra prediction mode.

[0445] After deriving transform coefficients by applying MTS, the encoding apparatus may zero out the remaining area of ​​the current block excluding a specific area at the top left corner of the current block, for example, a 16×16 area.

[0446] In addition, the encoding apparatus 200 may determine whether to perform a secondary transform or a non-separable transform, specifically, LFNST, on transform coefficients for the current block, and may derive modified transform coefficients by applying LFNST to the transform coefficients. Specifically, the encoding apparatus may derive modified transform coefficients by applying LFNST based on an LFNST transform set and an LFNST kernel included in the LFNST transform set (S1740).

[0447] Unlike a linear transform that separates the coefficients to be transformed in the vertical or horizontal direction, LFNST is a non-separable transform that applies transform without separating the coefficients in a specific direction. This type of non-separable transform is a low-frequency non-separable transform that applies transform only to the low-frequency region, not to the entire target block to be transformed.

[0448] The encoding device may encode at least one of an LFNST index pointing to an LFNST kernel or an MTS index pointing to an MTS kernel.

[0449] First, the encoding apparatus may derive a value of a syntax element for the LFNST index, and binarize the syntax element value for the LFNST index (S1750).

[0450] The LFNST index syntax element according to this embodiment indicates whether LFNST is applied and which one of the LFNST kernels is included in the LFNST transform set. If the LFNST transform set includes two LFNST kernels, the value of the LFNST index syntax element will be three.

[0451] According to one embodiment, the syntax element value for the LFNST index can be derived as 0 indicating a case where LFNST is not applied to the current block, 1 indicating the first LFNST kernel among the LFNST kernels, or 2 indicating the second LFNST kernel among the LFNST kernels.

[0452] The encoding device can binarize the syntax element values ​​for the three transform indexes to 0, 10, and 11 using a truncated unary code method. That is, the value 0 for the syntax element can be binarized to "0", the value 1 for the syntax element can be binarized to "10", and the value 2 for the syntax element can be binarized to "11", and the encoding device can binarize the syntax elements for the derived transform indexes to any one of "0", "10", and "11".

[0453] The encoding apparatus may derive context information for the first bin of the LFNST index according to the tree type of the current block, derive preset context information for the second bin, and encode the bin of the syntax element bin string based on the context information (S1760).

[0454] Depending on the tree type of the current block, the context information for the first bin may be derived as different values. For example, if the tree type of the current block is a single tree, the first bin may be derived as the first context information, and if the tree type of the current block is not a single tree, the first bin may be derived as the second context information.

[0455] Meanwhile, the context information for the second bin can be derived as one value regardless of the tree type of the current block, that is, according to one example, the bin string of the LFNST index can be encoded based on a non-bypass context model for both bins.

[0456] In summary, the encoding device binarizes the bin string of the LFNST index in a truncated unary code manner, and encodes syntax elements of the LFNST index for the corresponding binarized value based on different context information.

[0457] The encoding device may configure and output video information such that at least one of an LFNST index and an MTS index is signaled at a coding unit level and the MTS index is signaled immediately after the signaling of the LFNST index, and may output the quantized residual information after encoding (S1770).

[0458] In addition, the encoding device may perform quantization based on the transform coefficients for the current block or the modified transform coefficients to derive quantized transform coefficients, and encode and output image information including information about the quantized transform coefficients.

[0459] The encoding apparatus may generate residual information including information on the quantized transform coefficients. The residual information may include the transform-related information / syntax elements described in detail. The encoding apparatus may encode image / video information including the residual information and output the encoded image / video information in the form of a bitstream.

[0460] More specifically, the encoding apparatus may generate information about the quantized transform coefficients and encode the generated information about the quantized transform coefficients.

[0461] In this document, at least one of quantization / dequantization and / or transform / inverse transform may be omitted. If the quantization / dequantization is omitted, the quantized transform coefficients may be referred to as transform coefficients. If the transform / inverse transform is omitted, the transform coefficients may be referred to as coefficients or residual coefficients, or may still be referred to as transform coefficients for uniformity of expression.

[0462] Also, in this document, the quantized transform coefficients and the transform coefficients may be referred to as transform coefficients and scaled transform coefficients, respectively. In this case, the residual information may include information on the transform coefficient(s), and the information on the transform coefficient(s) may be signaled via a residual coding syntax. Transform coefficients may be derived based on the residual information (or information on the transform coefficient(s)), and scaled transform coefficients may be derived through an inverse transform (scaling) on ​​the transform coefficients. Residual samples may be derived based on an inverse transform (transform) on the scaled transform coefficients. This may be similarly applied / expressed in other parts of this document.

[0463] In the above embodiments, the method is described based on a flow chart with a series of steps or blocks, but this document is not limited to the order of steps, and a step can occur in a different order or simultaneously with different steps than those described above. Also, those skilled in the art will understand that the steps shown in the flow chart are not exclusive, and other steps can be included, or one or more steps of the flow chart can be deleted without affecting the scope of this document.

[0464] The method according to the present document described above may be embodied in software form, and the encoding device and / or decoding device according to the present document may be included in a device that performs video processing, such as a TV, a computer, a smartphone, a set-top box, or a display device.

[0465] In this document, when the embodiments are implemented in software, the methods described above may be implemented with modules (processes, functions, etc.) that perform the functions described above. The modules may be stored in a memory and executed by a processor. The memory may be internal or external to the processor and may be coupled to the processor in various well-known ways. The processor may include an application-specific integrated circuit (ASIC), other chipsets, logic circuits, and / or data processing devices. The memory may include read-only memory (ROM), random access memory (RAM), flash memory, memory cards, storage media, and / or other storage devices. That is, the embodiments described in this document may be implemented and executed on a processor, microprocessor, controller, or chip. For example, the functional units illustrated in each drawing may be implemented and executed on a computer, processor, microprocessor, controller, or chip.

[0466] In addition, the decoding device and encoding device to which this document is applied may be included in a multimedia broadcast transmitting / receiving device, a mobile communication terminal, a home cinema video device, a digital cinema video device, a surveillance camera, a video interactive device, a real-time communication device such as video communication, a mobile streaming device, a storage medium, a camcorder, a custom video (VoD) service providing device, an over-the-top video (OTT) device, an internet streaming service providing device, a three-dimensional (3D) video device, an image telephone video device, and a medical video device, and may be used to process a video signal or a data signal. For example, an over-the-top video (OTT) device may include a game console, a Blu-ray player, an internet-connected TV, a home theater system, a smartphone, a tablet PC, a digital video recorder (DVR), and the like.

[0467] In addition, the processing method to which this document is applied may be produced in the form of a program executed by a computer, and may be stored in a computer-readable recording medium. In addition, multimedia data having a data structure according to this document may also be stored in a computer-readable recording medium. The computer-readable recording medium includes all kinds of storage devices and distributed storage devices in which computer-readable data is stored. The computer-readable recording medium may include, for example, a Blu-ray Disc (BD), a Universal Serial Bus (USB), a ROM, a PROM, an EPROM, an EEPROM, a RAM, a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device. In addition, the computer-readable recording medium may include a medium embodied in the form of a carrier wave (e.g., transmission via the Internet). In addition, a bitstream generated by the encoding method may be stored in a computer-readable recording medium or transmitted via a wired or wireless communication network. In addition, the embodiments of this document may be embodied in a computer program product by a program code, and the program code may be executed by a computer according to the embodiments of this document. The program code may be stored on a computer-readable carrier.

[0468] The claims described herein may be combined in various ways. For example, the technical features of the method claims herein may be combined and embodied in an apparatus, and the technical features of the apparatus claims herein may be combined and embodied in a method. Also, the technical features of the method claims herein and the technical features of the apparatus claims herein may be combined and embodied in an apparatus, and the technical features of the method claims herein and the technical features of the apparatus claims herein may be combined and embodied in a method.

Claims

1. In a video decoding device, Memory, at least one processor coupled to the memory; The at least one processor Receive residual information from the bitstream; deriving transform coefficients for a current block based on the residual information; applying at least one of a low frequency non-separable transform (LFNST) or an inverse linear transform to the transform coefficients to derive residual samples; configured to generate a reconstructed picture based on the residual samples; A context increment for a first bin of an LFNST index associated with an LFNST kernel for the LFNST is derived based on whether a tree type of the current block is a single tree; The context increment for the first bin of the LFNST index is derived as a first value that is 0 based on the tree type of the current block being the single tree, and the context increment for the first bin of the LFNST index is derived as a second value that is 1 based on the tree type of the current block not being the single tree; A context increment for a second bin of the LFNST index is derived as a third value, which is 2; determining whether to parse a multiple transform selection (MTS) index associated with an MTS kernel for the inverse linear transform based on a first variable; the first variable is set to an initial value of 1 in the coding unit syntax; If at least one non-zero transform coefficient is present in an area other than a top left 16×16 area in the current block, and the color index of the current block is a luma component, the first variable is changed to 0 in a residual coding syntax; The LFNST index and the MTS index are set in the coding unit syntax, After the LFNST index is parsed, the MTS index is parsed based on the first variable being 1.

2. 2. The video decoding apparatus of claim 1, wherein the at least one processor is further configured to derive a value of the LFNST index by decoding a bin string of the LFNST index based on the context increment for the first bin and the second bin of the LFNST index.

3. The LFNST transform set includes two LFNST kernels: The image decoding apparatus of claim 2, wherein the value of the LFNST index includes any one of 0, which corresponds to a case where the LFNST is not applied to the current block, 1, which corresponds to a first LFNST kernel of the two LFNST kernels, and 2, which corresponds to a second LFNST kernel of the two LFNST kernels.

4. The value of the LFNST index is binarized as a truncated unary code; The video decoding apparatus of claim 3, wherein the LFNST index having a value of 0 is binarized as "0", the LFNST index having a value of 1 is binarized as "10", and the LFNST index having a value of 2 is binarized as "11".

5. In a video encoding device, Memory, at least one processor coupled to the memory; The at least one processor Derive a predicted sample for the current block; deriving a residual sample for the current block based on the predicted sample; applying at least one of a low frequency non-separable transform (LFNST) or a linear transform to the residual samples to derive transform coefficients for the current block; and encoding an LFNST index associated with an LFNST kernel for the LFNST and a multiple transform selection (MTS) index associated with an MTS kernel for the primary transform; A context increment for the first bin of the LFNST index is derived based on whether the tree type of the current block is a single tree; The context increment for the first bin of the LFNST index is derived as a first value that is 0 based on the tree type of the current block being the single tree, and the context increment for the first bin of the LFNST index is derived as a second value that is 1 based on the tree type of the current block not being the single tree; A context increment for a second bin of the LFNST index is derived as a third value, which is 2; Whether to encode the MTS index is determined based on a first variable; the first variable is set to an initial value of 1 in the coding unit syntax; If at least one non-zero transform coefficient is present in an area other than a top left 16×16 area in the current block, and the color index of the current block is a luma component, the first variable is changed to 0 in a residual coding syntax; The LFNST index and the MTS index are set in the coding unit syntax, After the LFNST index is encoded, the MTS index is encoded based on the first variable being 1.

6. The at least one processor Deriving a value for the LFNST index; Derive the context increment for the first bin and the second bin of the LFNST index; The video encoding apparatus of claim 5 , further configured to encode a bin string of the LFNST index based on the context increment.

7. The LFNST transform set includes two LFNST kernels: The video encoding apparatus of claim 6, wherein the value of the LFNST index includes any one of 0, which corresponds to a case where the LFNST is not applied to the current block, 1, which corresponds to a first LFNST kernel of the two LFNST kernels, and 2, which corresponds to a second LFNST kernel of the two LFNST kernels.

8. The value of the LFNST index is binarized as a truncated unary code; 8. The video encoding apparatus of claim 7, wherein the LFNST index having a value of 0 is binarized as "0", the LFNST index having a value of 1 is binarized as "10", and the LFNST index having a value of 2 is binarized as "11".

9. 1. An apparatus for transmitting data for video information, comprising: at least one processor configured to obtain a bitstream of the video information including a low frequency non-separable transform (LFNST) index and residual information, the bitstream being generated by: deriving predictive samples for a current block; deriving residual samples for the current block based on the predictive samples; applying at least one of an LFNST or a linear transform to the residual samples to derive transform coefficients for the current block; and encoding the LFNST index associated with an LFNST kernel for the LFNST and an MTS index associated with an MTS kernel for the linear transform; a transmitter configured to transmit the data including the bitstream of the video information; A context increment for the first bin of the LFNST index is derived based on whether the tree type of the current block is a single tree; The context increment for the first bin of the LFNST index is derived as a first value that is 0 based on the tree type of the current block being the single tree, and the context increment for the first bin of the LFNST index is derived as a second value that is 1 based on the tree type of the current block not being the single tree; A context increment for a second bin of the LFNST index is derived as a third value, which is 2; Whether to encode the MTS index is determined based on a first variable; the first variable is set to an initial value of 1 in the coding unit syntax; If at least one non-zero transform coefficient is present in an area other than a top left 16×16 area in the current block, and the color index of the current block is a luma component, the first variable is changed to 0 in a residual coding syntax; The LFNST index and the MTS index are set in the coding unit syntax, After the LFNST index is encoded, the MTS index is encoded based on the first variable being one.