Decoders, encoders, and data transmission devices.

VN10063109BActive Publication Date: 2026-11-19NOKIA TECHNOLOGIES OY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
VN1202402974
Authority / Receiving Office
VN · VN
Patent Type
Patents
Current Assignee / Owner
Priority Date
2019-04-16
Filing Date
2020-04-16
Publication Date
2026-11-19
Estimated Expiration
2040-04-16

AI Technical Summary

Technical Problem

The increasing demand for high-resolution, high-quality video data, particularly in fields like VR and AR, necessitates highly efficient image/video compression technologies to reduce storage and transmission costs while maintaining optimal coding efficiency.

Method used

A transformation method and apparatus for intra prediction-based video coding, specifically using a transformation index for matrix-based intra prediction (MIP) blocks, which includes binarizing and coding the transform index, signaling, and deriving the transformation index, minimizing interference with Low Frequency Non-Separable Transform (LFNST) to achieve optimal coding efficiency.

Benefits of technology

This approach enhances overall image/video compression efficiency, reduces complexity, and maintains optimal coding efficiency even when both MIP and LFNST are applied, thereby addressing the challenges of high-resolution video data transmission and storage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure VN1202402974_0
    Figure VN1202402974_0
Patent Text Reader

Abstract

The invention relates to a method for decoding images comprising the following steps: acquiring information relating to the prediction and residual information for the current block; deriving the transformation coefficients for the current block on the basis of the residual information; and generating residual patterns of the current block on the basis of the transformation coefficients, where the residual information includes low-frequency non-separable transform (LFNST) information indicating the low-frequency non-separable transform for the current block on the basis of matrix-based intra-prediction (MIP) flags. The invention also relates to an image encoding method, a non-temporal computer-readable storage medium, and a method for transmitting image data.
Need to check novelty before this filing date? Find Prior Art

Description

Transformation in intra prediction-based image coding

[0001] This article is about image coding technology, and more specifically, about transforms in intra prediction-based image coding.

[0002] Demand for high-resolution, high-quality video, such as 4K or 8K Ultra High Definition (UHD) video, is growing across a variety of fields. As video data becomes higher-resolution and higher-quality, the amount of information or bits transmitted increases relative to conventional video data. Therefore, when transmitting video data using existing media, such as wired or wireless broadband lines, or storing video data using existing storage media, transmission and storage costs increase.

[0003] In addition, interest in and demand for immersive media such as VR (Virtual Reality), AR (Artificial Reality) content and holograms have been increasing recently, and broadcasting of images / videos with different image characteristics from reality images, such as game images, is increasing.

[0004] Accordingly, a highly efficient image / video compression technology is required to effectively compress, transmit, store, and play high-resolution, high-quality image / video information having various characteristics as described above.

[0005] According to one embodiment of the present document, a method and device for improving image / video coding efficiency are provided.

[0006] According to one embodiment of the present document, a method and device for transformation in intra prediction-based image coding are provided.

[0007] According to one embodiment of the present document, a method and device for transforming a block using a transformation index when matrix-based intra prediction (MIP) is applied to the block are provided.

[0008] According to one embodiment of the present document, a method and device for binarizing or coding a transform index for a block to which MIP is applied are provided.

[0009] According to one embodiment of the present document, a method and apparatus for signaling a transform index for a block to which MIP is applied are provided.

[0010] According to one embodiment of the present document, a method and apparatus for deriving a transformation index for a block to which MIP is applied are provided.

[0011] According to one embodiment of the present document, a method and apparatus for signaling a transform index for a block to which MIP is not applied are provided.

[0012] According to one embodiment of the present document, a method of video / image decoding performed by a decoding device is provided.

[0013] According to one embodiment of the present document, a decoding device for performing video / image decoding is provided.

[0014] According to one embodiment of the present document, a video / image encoding method performed by an encoding device is provided.

[0015] According to one embodiment of the present document, an encoding device for performing video / image encoding is provided.

[0016] According to one embodiment of the present document, a computer-readable digital storage medium is provided storing encoded video / video information generated according to a video / video encoding method disclosed in at least one of the embodiments of the present document.

[0017] According to one embodiment of the present document, there is provided a computer-readable digital storage medium storing encoded information or encoded video / image information that causes a decoding device to perform a video / image decoding method disclosed in at least one of the embodiments of the present document.

[0018] According to this document, the overall image / video compression efficiency can be improved.

[0019] According to this document, the transformation index for a block to which MIP (Matrix based Intra Prediction) is applied can be efficiently signaled.

[0020] According to this document, the transformation index for a block to which MIP is applied can be efficiently coded.

[0021] According to this document, the transformation index for a block to which MIP is applied can be derived without separately signaling it.

[0022] According to this paper, when both MIP and LFNST (Low Frequency Non-Separable Transform) are applied, interference between them can be minimized, optimal coding efficiency can be maintained, and complexity can be reduced.

[0023] The specific effects obtained through the specific examples in this document are not limited to the effects listed above. For example, a person with ordinary skill in the relevant technical field may understand or derive various technical effects from this document. Accordingly, the specific effects of this document are not limited to those explicitly described in this document, but may include various effects that can be understood or derived from the technical features of this document.

[0024] Figure 1 schematically illustrates an example of a video / image coding system to which this document can be applied.

[0025] Figure 2 is a drawing schematically illustrating the configuration of a video / image encoding device to which this document can be applied.

[0026] Figure 3 is a drawing schematically illustrating the configuration of a video / image decoding device to which this document can be applied.

[0027] Figure 4 illustrates an example of context-adaptive binary arithmetic coding (CABAC) for encoding syntax elements.

[0028] Figure 5 schematically illustrates a multi-transformation technique according to one embodiment of the present document.

[0029] Figure 6 illustrates intra-directional modes of 65 prediction directions.

[0030] FIG. 7 and FIG. 8 are drawings for explaining RST according to one embodiment of the present document.

[0031] Figure 9 is a diagram showing the scanning order for a block.

[0032] Figure 10 is a diagram for explaining MIP for an 8x8 block.

[0033] Figure 11 is a flowchart illustrating how MIP and LFNST are applied.

[0034] FIG. 12 and FIG. 13 schematically illustrate an example of a video / image encoding method and related components according to an embodiment(s) of the present document.

[0035] FIG. 14 and FIG. 15 schematically illustrate an example of a video / image decoding method and related components according to an embodiment(s) of the present document.

[0036] Figure 16 illustrates an example of a content streaming system to which the embodiments disclosed in this document can be applied.

[0037] This document may have various modifications and embodiments, and thus specific embodiments are illustrated and described in detail in the drawings. However, this is not intended to limit this document to specific embodiments. The terminology used herein is only used to describe specific embodiments and is not intended to limit the technical idea of ​​this document. The singular expression includes plural expressions unless the context clearly indicates otherwise. It should be understood that the terms "comprises" or "has" in this specification specify the presence of a feature, number, step, operation, component, part, or combination thereof described in the specification, but do not exclude in advance the possibility of the presence or addition of one or more other features, numbers, steps, operations, components, parts, or combinations thereof.

[0038] Meanwhile, each component in the drawings described in this document is depicted independently for the convenience of explaining their distinct functions. This does not imply that each component is implemented using separate hardware or software. For example, two or more components may be combined to form a single component, or a single component may be divided into multiple components. Embodiments in which each component is integrated and / or separated are also included within the scope of this document, as long as they do not deviate from the essence of this document.

[0039] In this document, " / " and "," are interpreted as "and / or." For example, "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 terms " / " 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.")

[0040] Additionally, in this document, "or" is interpreted as "and / or." For example, "A or B" can mean 1) only "A," 2) only "B," or 3) both "A and B." In other words, "or" in this document can mean "additionally or alternatively." (Furthermore, in the document, the term "or" should be interpreted to indicate "and / or." For instance, the expression "A or B" may comprise 1) only A, 2) only B, and / or 3) both A and B. In other words, the term "or" in this document should be interpreted to indicate "additionally or alternatively.")

[0041] In this specification, "at least one of A and B" may mean "only A", "only B" or "both A and B". Additionally, in this specification, the expressions "at least one of A or B" or "at least one of A and / or B" may be interpreted identically to "at least one of A and B".

[0042] Additionally, 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.” Additionally, “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.”

[0043] This document relates to video / image coding. For example, the method / embodiment disclosed in this document may be related to the Versatile Video Coding (VVC) standard (ITU-T Rec. H.266), the next-generation video / image coding standard after 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.).

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

[0045] A pixel or pel can mean the smallest unit that constitutes a picture (or image). Additionally, the term "sample" can be used as a counterpart to a pixel. A sample can generally represent a pixel or a pixel value, and can represent only the pixel / pixel value of the luma component, or only the pixel / pixel value of the chroma component. Alternatively, a sample can mean a pixel value in the spatial domain, or when such a pixel value is converted to the frequency domain, it can mean a transform coefficient in the frequency domain.

[0046] A unit may represent 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. In some cases, the term "unit" may be used interchangeably with terms such as "block" or "area." In general, an MxN block may include a set (or array) of samples (or sample array) or transform coefficients consisting of M columns and N rows.

[0047] Additionally, parentheses used herein may mean "for example." Specifically, when "prediction (intra-prediction)" is indicated, "intra-prediction" may be suggested as an example of "prediction." In other words, "prediction" in this specification is not limited to "intra-prediction," and "intra-prediction" may be suggested as an example of "prediction." Furthermore, even when "prediction (i.e., intra-prediction)" is indicated, "intra-prediction" may be suggested as an example of "prediction."

[0048] Technical features individually described in a single drawing in this specification may be implemented individually or simultaneously.

[0049] This document presents various embodiments of video / image coding, and unless otherwise stated, the embodiments may be performed in combination with each other.

[0050] Hereinafter, with reference to the attached drawings, a preferred embodiment of the present document will be described in more detail. Hereinafter, identical components in the drawings will be designated by the same reference numerals, and redundant descriptions of identical components will be omitted.

[0051] Figure 1 schematically illustrates an example of a video / image coding system to which this document can be applied.

[0052] Referring to FIG. 1, a 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.

[0053] The source device may include a video source, an encoding device, and a transmitter. The receiving device may include a receiver, 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 include a display unit, and the display unit may be configured as a separate device or an external component.

[0054] A video source may obtain video / images through a process of capturing, synthesizing, or generating video / images. The 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 through a computer, etc., in which case the video / image capture process may be replaced by a process of generating related data.

[0055] An encoding device can encode input video / images. The encoding device can perform a series of procedures, such as prediction, transformation, and quantization, to improve compression and coding efficiency. The encoded data (encoded video / image information) can be output in the form of a bitstream.

[0056] The transmission unit can transmit encoded video / image information or data output in the form of a bitstream to the receiving unit of a receiving device via a digital storage medium or 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 transmission unit can include an element for generating a media file using a predetermined file format and an element for transmission via a broadcasting / communication network. The receiving unit can receive / extract the bitstream and transmit it to a decoding device.

[0057] The decoding device can decode the video / image by performing a series of procedures such as inverse quantization, inverse transformation, and prediction corresponding to the operation of the encoding device.

[0058] The renderer can render decoded video / images. The rendered video / images can be displayed through the display unit.

[0059] Figure 2 is a drawing schematically illustrating the configuration of a video / image encoding device to which this document may be applied. The term "video encoding device" hereinafter may include an image encoding device.

[0060] Referring to FIG. 2, the encoding device (200) may be configured to include an image partitioner (210), a prediction unit (predictor) 220, a residual processor (residual processor) 230, an entropy encoder (entropy encoder) 240, an adder (adder) 250, a filter (filter) 260, and a memory (memory) 270. The prediction unit (220) may include an inter prediction unit (221) and an intra prediction unit (222). The residual processor (230) may include a transformer (transformer) 232, a quantizer (quantizer) 233, a dequantizer (dequantizer) 234, and an inverse transformer (inverse transformer) 235. The residual processing unit (230) may further include a subtractor (231). The addition unit (250) may be called a reconstructor or a recontructed block generator. The image segmentation 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) described above may be configured by one or more hardware components (e.g., an encoder chipset or a processor) according to an embodiment. In addition, the memory (270) may include a decoded picture buffer (DPB) and may be configured by a digital storage medium. The hardware component may further include the memory (270) as an internal / external component.

[0061] The image segmentation unit (210) can segment an input image (or picture, frame) input to the encoding device (200) into one or more processing units. For example, the processing unit may be called a coding unit (CU). In this case, the coding unit may be recursively segmented from a coding tree unit (CTU) or a largest coding unit (LCU) according to a QTBTTT (Quad-tree binary-tree ternary-tree) structure. For example, one coding unit may be segmented into a plurality of coding units of 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 the binary tree structure and / or the ternary structure may be applied later. Alternatively, the binary tree structure may be applied first. The coding procedure according to the present document may be performed based on the final coding unit that is no longer segmented. In this case, based on coding efficiency according to image characteristics, etc., the maximum coding unit can be used as the final coding unit, or, if necessary, the coding unit can be recursively divided into coding units of lower depths, and the coding unit of the optimal size can be used as the final coding unit. Here, the coding procedure may include procedures such as prediction, transformation, and restoration described below. As another example, the processing unit may further include a prediction unit (PU) or a transformation unit (TU). In this case, the prediction unit and the transformation unit may each be divided or partitioned from the final coding unit described above.The above prediction unit may be a unit of sample prediction, and the above transformation unit may be a unit for deriving a transformation coefficient and / or a unit for deriving a residual signal from a transformation coefficient.

[0062] The term "unit" may be used interchangeably with terms such as "block" or "area" depending on the case. In general, an MxN block can represent a set of samples or transform coefficients consisting of M columns and N rows. A sample can generally represent a pixel or a pixel value, and can represent only the pixel / pixel value of the luminance component, or only the pixel / pixel value of the chroma component. A sample can be used as a term corresponding to a pixel or pel in a picture (or image).

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

[0064] The intra prediction unit (222) can predict the current block by referring to samples within the current picture. The referenced samples may be located in the neighborhood of the current block or may be located away from it depending on the prediction mode. In intra prediction, the prediction modes may include multiple non-directional modes and multiple 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 degree of detail in the prediction direction. However, this is merely an example, and a greater or lesser number of directional prediction modes may be used depending on the settings. The intra prediction unit (222) may also determine the prediction mode applied to the current block by using the prediction mode applied to the neighboring blocks.

[0065] The inter prediction unit (221) can derive a predicted block for the current block based on a reference block (reference sample array) specified by a motion vector on a reference picture. At this time, in order to reduce the amount of motion information transmitted in the inter prediction mode, the motion information can be predicted in units of blocks, sub-blocks, or samples based on the correlation of the motion information between the neighboring blocks and the current block. The motion information can include a motion vector and a reference picture index. The motion information can further include information on the inter prediction direction (L0 prediction, L1 prediction, Bi prediction, etc.). In the case of inter prediction, the neighboring block can include a spatial neighboring block existing in the current picture and a temporal neighboring block existing 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 above temporal neighboring blocks may be called collocated reference blocks, collocated CUs (colCUs), etc., and the reference pictures including the temporal neighboring blocks may be called collocated pictures (colPic). For example, the inter prediction unit (221) may construct a motion information candidate list based on the neighboring blocks, and generate information indicating which candidate is used to derive the motion vector and / or reference picture index of the current block. Inter prediction may be performed based on various prediction modes, and for example, in the case of skip mode and merge mode, the inter prediction unit (221) may use the motion information of the neighboring blocks as the motion information of the current block. In the case of skip mode, unlike the merge mode, a residual signal may not be transmitted.In the motion vector prediction (MVP) mode, the motion vector of the surrounding blocks is used as a motion vector predictor, and the motion vector of the current block can be indicated by signaling the motion vector difference.

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

[0067] The prediction signal generated through the inter prediction unit (221) and / or the intra prediction unit (222) can be used to generate a reconstructed signal or a residual signal. The transform unit (232) can apply a transform technique to the residual signal to generate transform coefficients. For example, the transform technique can include a Discrete Cosine Transform (DCT), a Discrete Sine Transform (DST), a Graph-Based Transform (GBT), or a Conditionally Non-linear Transform (CNT). Here, GBT refers to a transform obtained from a graph when the relationship information between pixels is expressed as a graph. CNT refers to a transform obtained based on generating a prediction signal using all previously reconstructed pixels. In addition, the transform process can be applied to a pixel block having a square equal size, or can be applied to a block of a non-square variable size.

[0068] The quantization unit (233) quantizes the transform coefficients and transmits them to the entropy encoding unit (240), and the entropy encoding unit (240) can encode the quantized signal (information about the quantized transform coefficients) and output it as a bitstream. The information about the quantized transform coefficients may be called residual information. The quantization unit (233) can rearrange the quantized transform coefficients in a block form into a one-dimensional vector form based on a coefficient scan order, and can also generate information about the quantized transform coefficients based on the quantized transform coefficients in the one-dimensional vector form. The entropy encoding unit (240) can perform various encoding methods, such as, for example, exponential Golomb, context-adaptive variable length coding (CAVLC), context-adaptive binary arithmetic coding (CABAC), etc. The entropy encoding unit (240) may encode, together or separately, information necessary for video / image restoration (e.g., values ​​of syntax elements, etc.) in addition to 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 the form of a network abstraction layer (NAL) unit. 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 signaling / transmitted information and / or syntax elements described later in this document may be encoded through the above-described encoding procedure and included in the bitstream.The above bitstream may be transmitted through a network or stored in a digital storage medium. Here, the network may include a broadcasting network and / or a communication network, and the digital storage medium may include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. The signal output from the entropy encoding unit (240) may be configured as an internal / external element of the encoding device (200) by a transmitting unit (not shown) and / or a storing unit (not shown), or the transmitting unit may be included in the entropy encoding unit (240).

[0069] The quantized transform coefficients output from the quantization unit (233) can be used to generate a prediction signal. For example, by applying inverse quantization and inverse transformation to the quantized transform coefficients through the inverse quantization unit (234) and the inverse transform unit (235), a residual signal (residual block or residual samples) can be reconstructed. The addition unit (250) can add the reconstructed residual signal to the prediction signal output from the prediction unit (220), thereby generating a reconstructed signal (reconstructed picture, reconstructed block, reconstructed samples, or reconstructed sample array). When there is no residual for the target block to be processed, such as when skip mode is applied, the predicted block can be used as the reconstructed block. The generated reconstructed signal can be used for intra prediction of the next target block to be processed within the current picture, and can also be used for inter prediction of the next picture after filtering as described below.

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

[0071] The filtering unit (260) can improve subjective / objective picture quality by applying filtering to the restoration signal. For example, the filtering unit (260) can apply various filtering methods to the restoration picture to generate a modified restoration picture, and store the modified restoration 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) can generate various information regarding filtering and transmit the information to the entropy encoding unit (290), as described later in the description of each filtering method. The information regarding filtering may be encoded by the entropy encoding unit (290) and output in the form of a bitstream.

[0072] The modified restored picture transmitted to the memory (270) can be used as a reference picture in the inter prediction unit (280). Through this, when inter prediction is applied, the encoding device can avoid prediction mismatch between the encoding device (200) and the decoding device, and can also improve encoding efficiency.

[0073] The DPB of the memory (270) can store the modified restored picture to be used as a reference picture in the inter prediction unit (221). The memory (270) can store motion information of a block from which motion information is derived (or encoded) within the current picture and / or motion information of blocks within a picture that has already been restored. The stored motion information can be transferred 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) can store restored samples of restored blocks within the current picture and transfer them to the intra prediction unit (222).

[0074] Figure 3 is a drawing schematically illustrating the configuration of a video / image decoding device to which this document can be applied.

[0075] Referring to FIG. 3, the decoding device (300) may be configured to 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-prediction unit (331) and an intra-prediction unit (332). The residual processor (320) may include a dequantizer (321) and an inverse transformer (321). The entropy decoding unit (310), residual processing unit (320), prediction unit (330), addition unit (340), and filtering unit (350) described above may be configured by a single hardware component (e.g., decoder chipset or processor) depending on the embodiment. In addition, the memory (360) may include a decoded picture buffer (DPB) and may be configured by a digital storage medium. The hardware component may further include the memory (360) as an internal / external component.

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

[0077] The decoding device (300) can receive a signal output from the encoding device of FIG. 2 in the form of a bitstream, and the received signal can be decoded through the entropy decoding unit (310). For example, the entropy decoding unit (310) can parse the bitstream to derive information (e.g., video / image information) necessary for image restoration (or picture restoration). 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 device can decode the picture further based on the information on the parameter set and / or the general constraint information. The signaling / received information and / or syntax elements described later in this document can be decoded and obtained from the bitstream through the decoding procedure. For example, the entropy decoding unit (310) can decode information in a bitstream based on a coding method such as exponential Golomb coding, CAVLC, or CABAC, and output the values ​​of syntax elements required for image restoration and the quantized values ​​of transform coefficients for residuals. More specifically, the CABAC entropy decoding method receives a bin corresponding to each syntax element in the bitstream, determines a context model using information of the syntax element to be decoded and decoding information of the surrounding and decoding target blocks or information of symbols / bins decoded in the previous step, and predicts the occurrence probability of the bin according to the determined context model to perform arithmetic decoding of the bin to generate a symbol corresponding to the value of each syntax element.At this time, the CABAC entropy decoding method can update the context model using the information of the decoded symbol / bin for the context model of the next symbol / bin after determining the context model. Information about prediction among the information decoded by the entropy decoding unit (310) is provided to the prediction unit (330), and information about the residual on which entropy decoding is performed by the entropy decoding unit (310), that is, quantized transform coefficients and related parameter information, can be input to the inverse quantization unit (321). In addition, information about filtering among the information decoded by the entropy decoding unit (310) can be provided to the filtering unit (350). Meanwhile, a receiving unit (not shown) that receives a signal output from an 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 / video / picture decoding device, and the decoding device may be divided into an information decoder (video / video / picture information decoder) and a sample decoder (video / video / 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 transformation unit (322), the prediction unit (330), the addition unit (340), the filtering unit (350), and the memory (360).

[0078] The inverse quantization unit (321) can inverse quantize the quantized transform coefficients and output the transform coefficients. The inverse quantization unit (321) can rearrange the quantized transform coefficients into a two-dimensional block form. In this case, the rearrangement can be performed based on the coefficient scanning order performed in the encoding device. The inverse quantization unit (321) can perform inverse quantization on the quantized transform coefficients using quantization parameters (e.g., quantization step size information) and obtain transform coefficients.

[0079] In the inverse transform unit (322), the transform coefficients are inversely transformed to obtain a residual signal (residual block, residual sample array).

[0080] The prediction unit can perform a prediction on the current block and generate a predicted block containing prediction samples for the current block. Based on the information regarding the prediction output from the entropy decoding unit (310), the prediction unit can determine whether intra-prediction or inter-prediction is applied to the current block, and can determine a specific intra / inter-prediction mode.

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

[0082] The intra prediction unit (332) can predict the current block by referring to samples within the current picture. The referenced samples may be located in the neighborhood of the current block or may be located away from it, depending on the prediction mode. In intra prediction, the prediction modes may include multiple non-directional modes and multiple directional modes. The intra prediction unit (332) can also determine the prediction mode applied to the current block by using the prediction mode applied to the neighboring blocks.

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

[0084] The addition unit (340) can generate a restoration signal (restored picture, restoration block, restoration sample array) by adding the acquired residual signal to the prediction signal (predicted block, prediction sample array) output from the prediction unit (330). In cases where there is no residual for the block to be processed, such as when skip mode is applied, the predicted block can be used as the restoration block.

[0085] The addition unit (340) may be referred to as a restoration unit or restoration block generation unit. The generated restoration signal may be used for intra prediction of the next processing target block within the current picture, may be output after filtering as described below, or may be used for inter prediction of the next picture.

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

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

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

[0089] In this specification, the embodiments described in the prediction unit (330), inverse quantization unit (321), inverse transformation unit (322), and filtering unit (350) of the decoding device (300) can be applied to the prediction unit (220), inverse quantization unit (234), inverse transformation unit (235), and filtering unit (260) of the encoding device (200) in the same manner or correspondingly.

[0090] As described above, prediction is performed to increase compression efficiency when performing video coding. Through this, a predicted block including prediction samples for a current block, which is a coding target block, can be generated. Here, the predicted block includes prediction samples in a spatial domain (or pixel domain). The predicted block is derived identically from an encoding device and a decoding device, and the encoding device can increase video coding efficiency by signaling information (residual information) about the residual between the original block and the predicted block, rather than the original sample value of the original block itself, to a decoding device. The decoding device can derive a residual block including residual samples based on the residual information, and generate a reconstructed block including reconstructed samples by combining the residual block and the predicted block, and can generate a reconstructed picture including the reconstructed blocks.

[0091] The residual information may be generated through a transformation and quantization procedure. For example, the encoding device may derive a residual block between the original block and the predicted block, perform a transformation procedure on residual samples (a residual sample array) included in the residual block to derive transform coefficients, and perform a quantization procedure on the transform coefficients to derive quantized transform coefficients, thereby signaling the related residual information to a decoding device (via a bitstream). Here, the residual information may include information such as value information, position information, a transformation technique, a transformation kernel, and quantization parameters of the quantized transform coefficients. The decoding device may perform an inverse quantization / inverse transformation procedure based on the residual information to derive residual samples (or residual blocks). The decoding device may generate a reconstructed picture based on the predicted block and the residual block. The encoding device can also inversely quantize / inversely transform the quantized transform coefficients to derive a residual block for reference in inter prediction of a subsequent picture, and generate a restored picture based on the residual block.

[0092] Meanwhile, for example, an encoding device can derive a bitstream by encoding values ​​of syntax elements or quantized values ​​of transform coefficients for residuals based on various coding methods such as exponential Golomb, context-adaptive variable length coding (CAVLC), or context-adaptive binary arithmetic coding (CABAC). In addition, a decoding device can derive values ​​of syntax elements necessary for image restoration or quantized values ​​of transform coefficients for residuals by decoding a bitstream based on various coding methods such as exponential Golomb coding, CAVLC, or CABAC.

[0093] For example, the coding methods described above can be performed as described below.

[0094] Figure 4 illustrates an example of context-adaptive binary arithmetic coding (CABAC) for encoding syntax elements.

[0095] For example, in the coding process of CABAC, if the input signal is a syntax element rather than a binary value, the encoding device can convert the input signal into a binary value by binarizing the value of the input signal. In addition, if the input signal is already a binary value (i.e., if the value of the input signal is a binary value), the input signal can be used as is without binarization. Here, each binary digit 0 or 1 constituting the binary value can be referred to as a bin. For example, if the binary string after binarization is 110, each of 1, 1, and 0 can be represented as one bin. The bin(s) for one syntax element can represent the value of the syntax element. This binarization can be based on various binarization methods such as the Truncated Rice binarization process or the Fixed-length binarization process, and the binarization method for the target syntax element can be defined in advance. The above binarization procedure can be performed by a binarization unit within an entropy encoding unit.

[0096] Thereafter, the binarized bins of the syntax elements can be input to a regular coding engine or a bypass coding engine. The regular coding engine of the encoding device can assign a context model that reflects a probability value to the bin and encode the bin based on the assigned context model. The regular coding engine of the encoding device can update the context model for the bin after performing coding on each bin. A bin coded as described above can be referred to as a context-coded bin.

[0097] Meanwhile, when the binarized bins of the syntax elements are input to the bypass coding engine, they can be coded as follows. For example, the bypass coding engine of the encoding device can omit the procedure of estimating the probability for the input bin and the procedure of updating the probability model applied to the bin after coding. When bypass coding is applied, the encoding device can code the input bin by applying a uniform probability distribution instead of assigning a context model, thereby improving the encoding speed. The bins coded as described above can be referred to as bypass bins.

[0098] Entropy decoding can be described as a process that performs the same process as the entropy encoding described above in reverse order.

[0099] A decoding device (entropy decoding unit) can decode encoded image / video information. The image / video information may include partitioning-related information, prediction-related information (e.g., inter / intra prediction distinction information, intra-prediction mode information, inter-prediction mode information, etc.), residual information, or in-loop filtering-related information, or may include various syntax elements related thereto. The entropy coding may be performed on a syntax element basis.

[0100] The decoding device can perform binarization on target syntax elements. Here, the binarization can be based on various binarization methods, such as the Truncated Rice binarization process or the Fixed-length binarization process, and the binarization method for the target syntax elements can be predefined. The decoding device can derive available empty strings (empty string candidates) for available values ​​of the target syntax elements through the binarization process. The binarization process can be performed by a binarization unit within an entropy decoding unit.

[0101] The decoding device can sequentially decode or parse each bin for the target syntax elements from the input bit(s) in the bitstream, and compare the derived bin string with the available bin strings for the corresponding syntax elements. If the derived bin string is equal to one of the available bin strings, the value corresponding to the bin string is derived as the value of the corresponding syntax element. If not, the next bit in the bitstream can be further parsed and the above-described procedure can be performed again. Through this process, it is possible to signal specific information (or specific syntax elements) using variable-length bits without using start bits or end bits in the bitstream. This allows relatively fewer bits to be allocated to low values, thereby improving overall coding efficiency.

[0102] The decoding device can decode each bin in the bin string from the bitstream based on a context model or bypass based on an entropy coding technique such as CABAC or CAVLC.

[0103] When a syntax element is decoded based on a context model, a decoding device can receive a bin corresponding to the syntax element through a bitstream, determine a context model using the syntax element and decoding information of a block to be decoded or a surrounding block or information of a symbol / bin decoded in a previous step, and predict an occurrence probability of the received bin according to the determined context model to perform arithmetic decoding of the bin to derive a value of the syntax element. Thereafter, a context model of a bin to be decoded next can be updated based on the determined context model.

[0104] A context model can be assigned and updated for each bin that is context-coded (regularly coded), and the context model can be indicated based on a context index (ctxIdx: context index) or a context index increment (ctxInc: context index increment). ctxIdx can be derived based on ctxInc. Specifically, for example, ctxIdx representing a context model for each of the regularly coded bins can be derived as the sum of ctxInc and a context index offset (ctxIdxOffset: context index offset). For example, the ctxInc can be derived differently for each bin. The ctxIdxOffset can be represented by the lowest value of the ctxIdx. The ctxIdxOffset can be a value that is generally used to distinguish from context models for other syntax elements, and a context model for a syntax element can be distinguished or derived based on ctxInc.

[0105] In the entropy encoding process, it can be determined whether encoding will be performed through a regular coding engine or a bypass coding engine, and the coding path can be switched accordingly. Entropy decoding can perform the same process as entropy encoding in reverse order.

[0106] Meanwhile, for example, when a syntax element is bypass-decoded, the decoding device can receive a bin corresponding to the syntax element through the bitstream and decode the input bin by applying a uniform probability distribution. In this case, the decoding device can omit the procedure of deriving a context model of the syntax element and the procedure of updating the context model applied to the bin after decoding.

[0107] Figure 5 schematically illustrates a multiple transformation technique according to this document.

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

[0109] The transformation unit can derive (primary) transformation coefficients by performing a primary transformation based on residual samples (residual sample array) within the residual block (S510). This primary transformation may be referred to as a core transformation. Here, the primary transformation may be based on multiple transform selection (MTS), and when multiple transformations are applied as the primary transformation, it may be referred to as a multiple core transformation.

[0110] For example, the multi-core transform may indicate a method of converting by additionally using Discrete Cosine Transform (DCT) Type 2 (DCT-II), Discrete Sine Transform (DST) Type 7 (DST-VII), DCT Type 8 (DCT-VIII) and / or DST Type 1 (DST-I). That is, the multi-core transform may indicate a transform method of converting a residual signal (or residual block) of a spatial domain into transform coefficients (or primary transform coefficients) of a frequency domain based on a plurality of transform kernels selected from among the DCT Type 2, the DST Type 7, the DCT Type 8 and the DST Type 1. Here, the primary transform coefficients may be called temporary transform coefficients in the transform unit.

[0111] In other words, when the conventional transform method is applied, a transformation from the spatial domain to the frequency domain may be applied to the residual signal (or residual block) based on DCT type 2, so that transform coefficients may be generated. However, in contrast, when the multi-core transform is applied, a transformation from the spatial domain to the frequency domain may be applied to the residual signal (or residual block) based on DCT type 2, DST type 7, DCT type 8, and / or DST type 1, so that transform coefficients (or primary transform coefficients) may be generated. Here, DCT type 2, DST type 7, DCT type 8, and DST type 1, etc. may be referred to as a transform type, a transform kernel, or a transform core. These DCT / DST transform types may be defined based on basis functions.

[0112] When the above multi-core transform is performed, a vertical transform kernel and / or a horizontal transform kernel for a target block may be selected from among the transform kernels, and a vertical transform may be performed for the target block based on the vertical transform kernel, and a horizontal transform may be performed for the target block based on the horizontal transform kernel. Here, the horizontal transform may represent a transform for horizontal components of the target block, and the vertical transform may represent a transform for vertical components of the target block. The vertical transform kernel / horizontal transform kernel may be adaptively determined based on a prediction mode and / or a transform index of a target block (CU or sub-block) including a residual block.

[0113] Or, for example, when performing a first transformation by applying MTS, specific basis functions can be set to predetermined values, and a mapping relationship for the transformation kernel can be set by combining which basis functions are applied when performing a vertical transformation or a horizontal transformation. For example, when a horizontal transformation kernel is represented as trTypeHor and a vertical transformation kernel is represented as trTypeVer, a trTypeHor or trTypeVer with a value of 0 can be set to DCT2, a trTypeHor or trTypeVer with a value of 1 can be set to DST7, and a trTypeHor or trTypeVer with a value of 2 can be set to DCT8.

[0114] Alternatively, for example, an MTS index may be encoded to indicate one of a plurality of transform kernel sets, and the MTS index information may be signaled to a decoding device. Here, the MTS index may be represented by a tu_mts_idx syntax element or an mts_idx syntax element. For example, an MTS index of 0 may indicate that both trTypeHor and trTypeVer values ​​are 0, an MTS index of 1 may indicate that both trTypeHor and trTypeVer values ​​are 1, an MTS index of 2 may indicate that the trTypeHor value is 2 and the trTypeVer value is 1, an MTS index of 3 may indicate that the trTypeHor value is 1 and the trTypeVer value is 2, and an MTS index of 4 may indicate that both trTypeHor and trTypeVer values ​​are 2. For example, the set of transformation kernels according to the MTS index can be represented as in the following table.

[0115]

[0116] The transformation unit can perform a secondary transformation based on the (primary) transformation coefficients to derive modified (secondary) transformation coefficients (S520). The primary transformation is a transformation from the spatial domain to the frequency domain, and the secondary transformation can be expressed as a transformation into a more compact representation by utilizing the correlation existing between the (primary) transformation coefficients.

[0117] For example, 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 represent a transform that generates modified transform coefficients (or secondary transform coefficients) for the residual signal by performing a secondary transform on the (primary) transform coefficients derived through the primary transform based on a non-separable transform matrix. Here, the vertical transform and the horizontal transform may be applied at once to the (primary) transform coefficients based on the non-separable transform matrix, without separately applying the vertical transform and the horizontal transform (or independently applying the horizontal transform and the vertical transform).

[0118] In other words, the non-separable secondary transform may refer to a transform method that rearranges two-dimensional signals (transform coefficients) into one-dimensional signals in a specific predetermined direction (e.g., row-first direction or column-first direction) without separating the vertical and horizontal components of the (first) transform coefficients, and then generates modified transform coefficients (or second-order transform coefficients) based on the non-separable transform matrix.

[0119] For example, the row-major direction (or order) may indicate that MxN blocks are arranged in a line according to the order of the 1st row, 2nd row, ..., Nth row, and the column-major direction (or order) may indicate that MxN blocks are arranged in a line according to the order of the 1st column, 2nd column, ..., Mth column. Here, M and N may represent the width (W) and height (H) of the block, respectively, and both may be positive integers.

[0120] For example, the non-separable secondary transform can be applied to the top-left region of a block composed of (primary) transform coefficients (hereinafter, transform coefficient block). For example, if both the width (W) and the height (H) of the transform coefficient block are 8 or greater, an 8x8 non-separable secondary transform can be applied to the top-left 8x8 region of the transform coefficient block. In addition, if both the width (W) and the height (H) of the transform coefficient block are 4 or greater, and either the width (W) or the height (H) of the transform coefficient block is less than 8, a 4x4 non-separable secondary transform can be applied to the top-left min(8, W) x 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 both the width (W) or the height (H) of the transform coefficient block is 4 or greater is satisfied, a 4x4 non-separable second-order transform may be applied to the upper left min(8, W) x min(8, H) region of the transform coefficient block.

[0121] For example, when a 4x4 input block is used, the non-separable second-order transform can be performed as follows.

[0122] The above 4x4 input block X can be represented as follows.

[0123]

[0124] For example, the vector form of the above X can be represented as follows.

[0125]

[0126] Referring to mathematical equation 2, can represent a vector X, and can be represented by rearranging the two-dimensional blocks of X in mathematical expression 1 into a one-dimensional vector in row-first order.

[0127] In this case, the second-order non-separable transformation can be calculated as follows.

[0128]

[0129] Here, can represent a transformation coefficient vector, and T can represent a 16x16 (non-separable) transformation matrix.

[0130] Based on the above mathematical formula 3, a size of 16x1 can be derived, and the above can be reorganized into 4x4 blocks through a scan order (horizontal, vertical, or diagonal, etc.). However, the above-described calculation is only an example, and in order to reduce the computational complexity of the non-separable second-order transform, the Hypercube-Givens Transform (HyGT) or the like can be used to calculate the non-separable second-order transform.

[0131] Meanwhile, the non-separable second-order transform may be selected based on a mode-dependent transformation kernel (or transformation core, transformation type). Here, the mode may include an intra-prediction mode and / or an inter-prediction mode.

[0132] For example, as described above, the non-separable second transform may be performed based on an 8x8 transform or a 4x4 transform determined based on the width (W) and height (H) of the transform coefficient block. For example, an 8x8 transform may represent a transform that can be applied to an 8x8 region included inside a transform coefficient block when both W and H are greater than or equal to 8, and the 8x8 region may be an upper left 8x8 region inside the transform coefficient block. Similarly, a 4x4 transform may represent a transform that can be applied to a 4x4 region included inside a transform coefficient block when both W and H are greater than or equal to 4, and the 4x4 region may be an upper left 4x4 region inside the transform coefficient block. For example, an 8x8 transformation kernel matrix can be a 64x64 / 16x64 matrix, and a 4x4 transformation kernel matrix can be a 16x16 / 8x16 matrix.

[0133] At this time, for mode-based transform kernel selection, two non-separable second-order transform kernels can be configured per transform set for both the 8x8 transform and the 4x4 transform, and the transform sets can be four. That is, four transform sets can be configured for the 8x8 transform, and four transform sets can be configured for the 4x4 transform. In this case, each of the four transform sets for the 8x8 transform can include two 8x8 transform kernels, and each of the four transform sets for the 4x4 transform can include two 4x4 transform kernels.

[0134] However, the size of the transformation, the number of sets, and the number of transformation kernels within the set may be other than 8x8 or 4x4, for example, or n sets may be configured, and k transformation kernels may be included within each set. Here, n and k may each be a positive integer.

[0135] For example, the above transformation set may be referred to as an NSST set, and the transformation kernel within the NSST set may be referred to as an NSST kernel. For example, the selection of a particular set among the above transformation sets may be performed based on the intra prediction mode of the target block (CU or sub-block).

[0136] For example, an intra prediction mode may include two non-directinoal or non-angular intra prediction modes and 65 directional or 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 only an example, and the embodiments according to the present document may also be applied to cases where the number of intra prediction modes is different. Meanwhile, in some cases, an intra prediction mode numbered 67 may be further used, and the 67 intra prediction mode may represent a linear model (LM) mode.

[0137] Figure 6 illustrates intra-directional modes of 65 prediction directions.

[0138] Referring to Fig. 6, intra prediction modes with horizontal directionality and intra prediction modes with vertical directionality can be distinguished, centered on the 34th intra prediction mode having an upward left diagonal prediction direction. H and V in Fig. 5 may represent horizontal directionality and vertical directionality, respectively, and numbers from -32 to 32 may represent a displacement of 1 / 32 units on the sample grid position. This may represent an offset for the mode index value.

[0139] For example, intra prediction modes 2 to 33 can have horizontal directionality, and intra prediction modes 34 to 66 can have vertical directionality. Meanwhile, intra prediction mode 34 can be considered neither horizontal nor vertical, strictly speaking, but can be classified as belonging to horizontal directionality from the perspective of determining the transformation set of the secondary transformation. This is because the input data is transposed and used for the vertical direction mode that is symmetrical around intra prediction mode 34, and the input data alignment method for the horizontal direction mode is used for intra prediction mode 34. Here, transposing the input data can mean that rows become columns and columns become rows for 2D block data MxN, thereby configuring NxM data.

[0140] In addition, the 18th intra prediction mode and the 50th intra prediction mode can represent a horizontal intra prediction mode and a vertical intra prediction mode, respectively, and the 2nd intra prediction mode can be called a right-upward diagonal intra prediction mode because it predicts in the right-upward direction with the left reference pixel, and in the same context, the 34th intra prediction mode can be called a right-downward diagonal intra prediction mode, and the 66th intra prediction mode can be called a left-downward diagonal intra prediction mode.

[0141] Meanwhile, if it is determined that a specific set is to be used for the non-separable transform, one of the k transform kernels within the specific set may be selected through a non-separable secondary transform index. For example, the encoding device may derive a non-separable secondary transform index indicating a specific transform kernel based on a rate-distortion (RD) check, and signal the non-separable secondary transform index to a decoding device. For example, the decoding device may select one of the k transform kernels within the specific set based on the non-separable secondary transform index. For example, an NSST index having a value of 0 may indicate a first non-separable secondary transform kernel, an NSST index having a value of 1 may indicate a second non-separable secondary transform kernel, and an NSST index having a value of 2 may indicate a third non-separable secondary transform kernel. Alternatively, an NSST index having a value of 0 may indicate that the first non-separable secondary transform is not applied to the target block, and an NSST index having a value of 1 to 3 may indicate the three transform kernels.

[0142] The transform unit can perform the non-separable second-order transform based on the selected transform kernels and obtain modified (second-order) transform coefficients. The modified transform coefficients can be derived as quantized transform coefficients through the quantization unit as described above, and can be encoded and transmitted to the decoding device and the inverse quantization / inverse transform unit within the signaling and encoding device.

[0143] Meanwhile, when the secondary transformation is omitted as described above, the (primary) transformation coefficients, which are the output of the primary (separation) transformation, can be derived as quantized transformation coefficients through the quantization unit as described above, and can be encoded and transmitted to the decoding device and the inverse quantization / inverse transformation unit in the signaling and encoding device.

[0144] Referring back to FIG. 5, the inverse transform unit can perform a series of procedures in the reverse order of the procedures performed in the above-described transform unit. The inverse transform unit can receive (inverse quantized) 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 a residual block (residual samples) (S560). Here, the primary transform coefficients may be referred to as modified transform coefficients on the inverse transform unit side. As described above, the encoding device and / or the decoding device can generate a reconstructed block based on the residual block and the predicted block, and can generate a reconstructed picture based on the same.

[0145] Meanwhile, the decoding device may further include a second inverse transform application determination unit (or an element that determines whether to apply the second inverse transform) and a second inverse transform determination unit (or an element that determines the second inverse transform). For example, the second inverse transform application determination unit may determine whether to apply the second inverse transform. For example, the second inverse transform may be NSST or RST, and the second inverse transform application determination unit may determine whether to apply the second inverse transform based on a second transform flag parsed or obtained from the bitstream. Alternatively, for example, the second inverse transform application determination unit may determine whether to apply the second inverse transform based on a transform coefficient of a residual block.

[0146] The secondary inverse transform decision unit can determine the secondary inverse transform. At this time, the secondary inverse transform decision unit can determine the secondary inverse transform to be applied to the current block based on the NSST (or RST) transform set specified according to the intra prediction mode. Alternatively, the secondary transform decision method may be determined depending on the primary transform decision method. Alternatively, various combinations of the primary and secondary transforms may be determined according to the intra prediction mode. For example, the secondary inverse transform decision unit may determine the area to which the secondary inverse transform is applied based on the size of the current block.

[0147] Meanwhile, as described above, when the second (inverse) transformation is omitted, the (inverse quantized) transformation coefficients can be received and the first (separate) inverse transformation can be performed to obtain a residual block (residual samples). As described above, the encoding device and / or the decoding device can generate a restoration block based on the residual block and the predicted block, and can generate a restoration picture based on the same.

[0148] Meanwhile, in this paper, in order to reduce the amount of computation and memory required for non-separable secondary transforms, the reduced secondary transform (RST) with a reduced size of the transformation matrix (kernel) can be applied in the concept of NSST.

[0149] In this document, RST may refer to a (simplified) transformation performed on residual samples of a target block based on a transformation matrix whose size is reduced according to a simplification factor. This reduction in the size of the transformation matrix can reduce the amount of computation required during the transformation. In other words, RST can be used to address computational complexity issues that arise when transforming large blocks or performing non-separable transformations.

[0150] For example, RST can be referred to by various terms such as reduced transform, reduced secondary transform, reduction transform, simplified transform, or simple transform, and the names by which RST can be referred to are not limited to the examples listed. Alternatively, RST can be called LFNST (Low-Frequency Non-Separable Transform) because it is mainly performed in the low-frequency region containing non-zero coefficients in the transform block.

[0151] Meanwhile, when the secondary inverse transform is performed based on RST, the inverse transform unit (235) of the encoding device (200) and the inverse transform unit (322) of the decoding device (300) may include an inverse RST unit that derives modified transform coefficients based on the inverse RST for transform coefficients, and an inverse first transform unit that derives residual samples for the target block based on the inverse first transform for the modified transform coefficients. The inverse first transform means the inverse transform of the first transform applied to the residual. In this document, deriving transform coefficients based on transform may mean deriving transform coefficients by applying the transform.

[0152] FIG. 7 and FIG. 8 are drawings for explaining RST according to one embodiment of the present document.

[0153] For example, Fig. 7 may be a diagram illustrating the application of a forward reduced transform, and Fig. 8 may be a diagram illustrating the application of an inverse reduced transform. In this document, a target block may represent a current block, a residual block, or a transform block on which coding is performed.

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

[0155] For example, the simplification factor or reduced coefficient may be signaled via the bitstream, but is not limited thereto. For example, predefined values ​​for the simplification factor or reduced coefficient may be stored in each encoding device (200) and decoding device (300), in which case the simplification factor or reduced coefficient may not be signaled separately.

[0156] For example, the size (RxN) of the simplified transformation matrix can be smaller than the size (NxN) of the normal transformation matrix, and can be defined as follows:

[0157]

[0158] For example, the matrix T in the reduced transform block illustrated in Fig. 7 is the matrix T of Equation 4 RxNcan be represented. As shown in Fig. 7, a simplified transformation matrix T for residual samples for the target block RxN When multiplied, the transformation coefficients for the target block can be derived.

[0159] For example, if the size of the block to which the transformation is applied is 8x8 and R is 16 (i.e., R / N = 16 / 64 = 1 / 4), the RST according to Fig. 7 can be expressed as a matrix operation as in mathematical expression 5 below. In this case, the memory and multiplication operations can be reduced to approximately 1 / 4 due to the simplification factor.

[0160] In this document, matrix operations can be understood as operations that place a matrix on the left side of a column vector and multiply the matrix and the column vector to obtain a column vector.

[0161]

[0162] In mathematical expression 5, r1 to r 64 may represent residual samples for the target block. Or, for example, they may be transform coefficients generated by applying a first transform. Based on the operation result of Equation 5, the transform coefficients c for the target block i can be derived.

[0163] For example, if R is 16, the transformation coefficients for the target block are c1 to c 16This can be derived. If a regular transformation instead of RST were applied and a transformation matrix of size 64x64 (NxN) were multiplied by residual samples of size 64x1 (Nx1), 64 (N) transformation coefficients for the target block would have been derived, but since RST was applied, only 16 (R) transformation coefficients for the target block are derived. Since the total number of transformation coefficients for the target block is reduced from N to R, the amount of data transmitted from the encoding device (200) to the decoding device (300) is reduced, so that the transmission efficiency between the encoding device (200) and the decoding device (300) can be increased.

[0164] Considering the size of the transformation matrix, the size of a normal transformation matrix is ​​64x64 (NxN), but the size of a simplified transformation matrix is ​​reduced to 16x64 (RxN), so compared to performing a normal transformation, the memory usage when performing RST can be reduced by the R / N ratio. In addition, compared to the number of NxN multiplication operations when using a normal transformation matrix, the number of multiplication operations can be reduced by the R / N ratio (RxN) when using a simplified transformation matrix.

[0165] In one embodiment, the transform unit (232) of the encoding device (200) can derive transform coefficients for the target block by performing a primary transform and a secondary transform based on an RST on residual samples for the target block. These transform coefficients can be transmitted to the inverse transform unit of the decoding device (300), and the inverse transform unit (322) of the decoding device (300) can derive modified transform coefficients based on an inverse RST (reduced secondary transform) on the transform coefficients, and derive residual samples for the target block based on an inverse primary transform on the modified transform coefficients.

[0166] Inverse RST matrix T according to one embodiment NxRThe size of is NxR, which is smaller than the size of the normal inverse transformation matrix NxN, and is the simplified transformation matrix T shown in mathematical expression 4. RxN and can be in a transpose relationship.

[0167] Matrix T within the reduced inverse transform block shown in Fig. 8 t is the inverse RST matrix T RxN T can represent. Here, the superscript T can represent the transpose. As in Fig. 8, the inverse RST matrix T for the transform coefficients for the target block RxN T When multiplied, modified transform coefficients for the target block or residual samples for the target block can be derived. Inverse RST matrix T RxN T is (T RxN ) T NxR It can also be expressed as

[0168] More specifically, when the inverse RST is applied as a second-order inverse transform, the inverse RST matrix T is applied to the transform coefficients for the target block. RxN T When the transform coefficients for the target block are multiplied, the modified transform coefficients for the target block can be derived. Meanwhile, the inverse RST can be applied as the inverse first-order transform, in which case the inverse RST matrix T is applied to the transform coefficients for the target block. RxN T When multiplied, residual samples for the target block can be derived.

[0169] In one embodiment, when the size of the block to which the inverse transformation is applied is 8x8 and R is 16 (i.e., R / N = 16 / 64 = 1 / 4), the RST according to FIG. 8 can be expressed by a matrix operation as in mathematical expression 6 below.

[0170]

[0171] In mathematical expression 6, c1 to c 16 can represent the transform coefficients for the target block. Based on the operation result of mathematical expression 6, r represents the modified transform coefficients for the target block or the residual samples for the target block. j can be derived. That is, r1 to r representing modified transform coefficients for the target block or residual samples for the target block. N This can be derived.

[0172] Considering the size of the inverse transform matrix, the size of the normal inverse transform matrix is ​​64x64 (NxN), but the size of the simplified inverse transform matrix is ​​reduced to 64x16 (NxR), so the memory usage can be reduced by the R / N ratio when performing the inverse RST compared to performing the normal inverse transform. In addition, compared to the number of NxN multiplication operations when using the normal inverse transform matrix, the number of multiplication operations can be reduced by the R / N ratio (NxR) when using the simplified inverse transform matrix.

[0173] Meanwhile, a transform set can also be configured and applied to the 8x8 RST. That is, the 8x8 RST can be applied depending on the transform set. Since one transform set consists of two or three transform kernels depending on the prediction mode within the screen, it can be configured to select one of up to four transforms, including cases where the secondary transform is not applied. When the secondary transform is not applied, the transform can be regarded as the one to which the identity matrix is ​​applied. When indices of 0, 1, 2, or 3 are assigned to each of the four transforms (for example, index 0 can be assigned to the identity matrix, that is, the case where the secondary transform is not applied), the transform to be applied can be specified by signaling a syntax element called the NSST index for each transform coefficient block. That is, the 8x8 NSST can be specified for the 8x8 upper-left block through the NSST index, and the 8x8 RST can be specified in the RST configuration. 8x8 NSST and 8x8 RST may represent a transform that can be applied to an 8x8 region included in a transform coefficient block when both W and H of the target block to be transformed are greater than or equal to 8, and the 8x8 region may be the upper left 8x8 region within the transform coefficient block. Similarly, 4x4 NSST and 4x4 RST may represent a transform that can be applied to a 4x4 region included in a transform coefficient block when both W and H of the target block are greater than or equal to 4, and the 4x4 region may be the upper left 4x4 region within the transform coefficient block.

[0174] Figure 9 is a diagram showing the scanning order for a block.

[0175] For example, if a forward 8x8 RST such as Equation 4 is applied, 16 valid transform coefficients can be generated, and the 64 input data constituting the 8x8 region can be seen as reduced to 16 output data, and from a two-dimensional region perspective, only 1 / 4 of the region can be filled with valid transform coefficients. Therefore, for example, the 16 output data obtained by applying the forward 8x8 RST can be filled in the upper left region of Fig. 9.

[0176] In Fig. 9, the upper left 4x4 area can be a Region Of Interest (ROI) area where valid transform coefficients are filled, and the remaining areas can be left blank. For example, the blank area can be filled with a default value of 0. If a non-zero valid transform coefficient is found outside the ROI area, the 8x8 RST has not been applied, so the NSST index coding can be omitted. However, conversely, if no non-zero transform coefficient is found outside the ROI area (when the 8x8 RST is applied and the non-ROI area is filled with 0), there is a possibility that the 8x8 RST has been applied, so the NSST index can be coded. For example, such conditional NSST index coding can be performed after the residual coding process because the presence or absence of a non-zero transform coefficient must be checked.

[0177] For example, when the forward scan order is numbered from 1, scanning can be performed for the 17th to 64th coefficients in the forward scan order. Or, for example, the direction of the arrow in Fig. 9 can indicate a reverse scan, and can indicate a reverse scan from the 64th to the 17th. For example, the scanned area can be an empty area, and a valid transformation coefficient other than 0 outside the empty area or the ROI area can be checked based on the scan.

[0178] As described above, residual samples can be derived as quantized transform coefficients through a transform and quantization process. The quantized transform coefficients may also be referred to as transform coefficients. In this case, the transform coefficients within a block can be signaled in the form of residual information. The residual information may include syntax or syntax elements related to residual coding. For example, an encoding device may encode residual information and output it in the form of a bitstream, and a decoding device may decode the residual information from the bitstream to derive residual (quantized) transform coefficients. The residual information may include syntax elements indicating, as described below, whether a transform has been applied to a corresponding block, the location of the last valid transform coefficient within the block, whether a valid transform coefficient exists within a subblock, or the size / sign of the valid transform coefficient.

[0179] Meanwhile, for example, the prediction unit within the encoding device of FIG. 2 or the prediction unit within the decoding device of FIG. 3 can perform intra prediction. Intra prediction is described in more detail as follows.

[0180] Intra prediction may refer to a prediction that generates prediction samples for a current block based on reference samples within a picture to which the current block belongs (hereinafter, referred to as the current picture). When intra prediction is applied to a current block, peripheral reference samples to be used for intra prediction of the current block may be derived. The peripheral reference samples of the current block may include a total of 2 x nH samples adjacent to a left boundary and a bottom-left neighboring sample of a current block of a size nW x nH, a total of 2 x nW samples adjacent to a top boundary and a top-right neighboring sample of the current block, and one sample adjacent to the top-left neighboring sample of the current block. Alternatively, the peripheral reference samples of the current block may include upper peripheral samples of multiple columns and left peripheral samples of multiple rows. Additionally, the surrounding reference samples of the current block may include a total of nH samples adjacent to the right boundary of the current block of size nWxnH, a total of nW samples adjacent to the bottom boundary of the current block, and one sample adjacent to the bottom-right of the current block.

[0181] However, some of the surrounding reference samples of the current block may not yet be decoded or available. In this case, the decoder can construct the surrounding reference samples to be used for prediction by substituting the unavailable samples with available samples. Alternatively, the decoder can construct the surrounding reference samples to be used for prediction by interpolating the available samples.

[0182] When neighboring reference samples are derived, (i) a prediction sample can be derived based on an average or interpolation of neighboring reference samples of the current block, and (ii) the prediction sample can also be derived based on a reference sample existing in a specific (prediction) direction with respect to the prediction sample among the neighboring reference samples of the current block. The case (i) can be called a non-directional mode or a non-angular mode, and the case (ii) can be called a directional mode or an angular mode.

[0183] In addition, the prediction sample may be generated by interpolating the second neighboring sample and the first neighboring sample, which are located in the opposite direction of the prediction direction of the intra prediction mode of the current block based on the prediction sample of the current block among the neighboring reference samples. The above-described case may be called linear interpolation intra prediction (LIP). In addition, chroma prediction samples may be generated based on luma samples using a linear model. This case may be called LM (linear model) mode. In addition, the temporary prediction sample of the current block may be derived based on the filtered neighboring reference samples, and the prediction sample of the current block may be derived by weighting the temporary prediction sample with at least one reference sample derived according to the intra prediction mode among the existing neighboring reference samples, i.e., the unfiltered neighboring reference samples. The above-described case may be called PDPC (Position dependent intra prediction). In addition, intra prediction coding can be performed by selecting a reference sample line with the highest prediction accuracy among the surrounding multiple reference sample lines of the current block, deriving a prediction sample using the reference sample located in the prediction direction in the corresponding line, and instructing (signaling) the reference sample line used at this time to a decoding device. The above-described case may be called multi-reference line (MRL) intra prediction or MRL-based intra prediction. In addition, the current block may be divided into vertical or horizontal subpartitions and intra prediction may be performed based on the same intra prediction mode, and surrounding reference samples may be derived and used for each subpartition.That is, in this case, the intra prediction mode for the current block is applied equally to the subpartitions, but by deriving and utilizing surrounding reference samples for each subpartition, the intra prediction performance can be improved in some cases. This prediction method may be called intra subpartitions (ISP) or ISP-based intra prediction.

[0184] The intra prediction methods described above may be referred to as intra prediction types, distinguished from intra prediction modes. The intra prediction types may be referred to by various terms, such as intra prediction techniques or additional intra prediction modes. For example, the intra prediction types (or additional intra prediction modes, etc.) may include at least one of the above-described LIP, PDPC, MRL, and ISP. A general intra prediction method excluding specific intra prediction types such as the LIP, PDPC, MRL, or ISP may be referred to as a normal intra prediction type. The normal intra prediction type may be generally applied when the above-described specific intra prediction types are not applied, and prediction may be performed based on the above-described intra prediction modes. Meanwhile, post-processing filtering may be performed on the derived prediction samples, if necessary.

[0185] In other words, the intra prediction procedure may include an intra prediction mode / type determination step, a surrounding reference sample derivation step, and an intra prediction mode / type-based prediction sample derivation step. Additionally, a post-processing filtering step may be performed on the derived prediction samples, if necessary.

[0186] Meanwhile, among the intra prediction types described above, the ISP can divide the current block horizontally or vertically and perform intra prediction on each divided block. That is, the ISP can derive sub-blocks by dividing the current block horizontally or vertically, and perform intra prediction on each of the sub-blocks. In this case, encoding / decoding can be performed on each divided sub-block to generate a reconstructed block, and the reconstructed block can be used as a reference block for the next divided sub-block. Here, the sub-block may also be called an intra sub-partition.

[0187] For example, when ISP is applied, the current block can be divided into two or four sub-partitions vertically or horizontally based on the size of the current block.

[0188] For example, for the application of ISP, a flag indicating whether the ISP is applied can be transmitted in units of blocks, and when the ISP is applied to the current block, a flag indicating whether the split type is horizontal or vertical, i.e., whether the split direction is horizontal or vertical, can be encoded / decoded. The flag indicating whether the ISP is applied can be called an ISP flag, and the ISP flag can be represented by the intra_subpartitions_mode_flag syntax element. In addition, the flag indicating the split type can be called an ISP split flag, and the ISP split flag can be represented by the intra_subpartitions_split_flag syntax element.

[0189] For example, the information indicating that the current block is not subject to ISP by the ISP flag or the ISP split flag (IntraSubPartitionsSplitType == ISP_NO_SPLIT), information indicating that it is split horizontally (IntraSubPartitionsSplitType == ISP_HOR_SPLIT), or information indicating that it is split vertically (IntraSubPartitionsSplitType == ISP_VER_SPLIT) may be indicated. For example, the ISP flag or the ISP split flag may also be referred to as ISP-related information regarding subpartitioning of a block.

[0190] Meanwhile, in addition to the intra prediction types described above, affine linear weighted intra prediction (ALWIP) may be used. The ALWIP may also be called linear weighted intra prediction (LWIP), matrix weighted intra prediction (MWIP), or matrix-based intra prediction (MIP). When the ALWIP is applied to the current block, prediction samples for the current block may be derived by i) performing a matrix-vector-multiplication procedure using surrounding reference samples on which an averaging procedure has been performed, ii) performing a matrix-vector-multiplication procedure, and iii) further performing a horizontal / vertical interpolation procedure as necessary.

[0191] The intra prediction modes used for the above ALWIP may be configured differently from the intra prediction modes used in the above-described LIP, PDPC, MRL, or ISP intra prediction, or normal intra prediction. The intra prediction mode for the ALWIP may be referred to as the ALWIP mode. For example, the matrix and offset used in the matrix vector multiplication may be set differently depending on the intra prediction mode for the ALWIP. Here, the matrix may be referred to as an (affine) weight matrix, and the offset may be referred to as an (affine) offset vector or an (affine) bias vector. In this document, the intra prediction mode for ALWIP may also be referred to as an ALWIP mode, an ALWIP intra prediction mode, an LWIP mode, an LWIP intra prediction mode, an MWIP mode, an MWIP intra prediction mode, an MIP mode, or an MIP intra prediction mode. A specific ALWIP method will be described later.

[0192] Figure 10 is a diagram for explaining MIP for an 8x8 block.

[0193] To predict samples of a rectangular block of width W and height H, MIP can use samples around the left boundary of the block and samples around the upper boundary. Here, the samples around the left boundary can represent samples located on a line adjacent to the left boundary of the block and can represent reconstructed samples. The samples around the upper boundary can represent samples located on a line adjacent to the upper boundary of the block and can represent reconstructed samples.

[0194] For example, if restored samples are not available, restored samples can be generated or derived and used as in conventional intra prediction.

[0195] The prediction signal (or prediction samples) can be generated based on an averaging process, a matrix vector multiplication process, and a (linear) interpolation process.

[0196] For example, the averaging process may be a process of extracting samples outside the boundary through averaging. For example, the extracted samples may be 4 samples when the width W and height H are both 4, and 8 samples in other cases. For example, in Fig. 10, bdry left and bdry top can represent the extracted left samples and upper samples, respectively.

[0197] For example, the matrix vector multiplication process may be a process of performing matrix vector multiplication with averaged samples as input. Or, an offset may be added subsequently. For example, in FIG. 10, A k can represent a matrix, and b k can represent an offset, and bdry red may be a reduced signal for samples extracted through the averaging process. Or bdry red is bdry left and bdry top may be reduced information about the original block. The result is a reduced prediction signal (pred) for a set of subsampled samples within the original block. red ) may be.

[0198] For example, the (linear) interpolation process may be a process in which prediction signals are generated at remaining locations from prediction signals for a set subsampled by linear interpolation. Here, linear interpolation may represent a single linear interpolation in each direction. For example, the reduced prediction signal (pred) shown in gray within the block in Fig. 10 red ) and the surrounding boundary samples, and linear interpolation can be performed based on these samples, thereby deriving all predicted samples within the block.

[0199] For example, the matrices required to generate a prediction signal (or prediction block, prediction samples) (A in Fig. 10) k ) and offset vectors (b in Fig. 10 k ) can be taken from three sets of matrices (S0, S1, and S2). For example, set S0 has 18 matrices (A0 i , i=0, 1, ..., 17) and 18 offset vectors (b0 i , i=0, 1, ..., 17). Here, each of the 18 matrices can have 16 rows and 4 columns, and each of the 18 offset vectors can have a size of 16. The matrices and offset vectors of the set S0 can be used in a block of size 4x4. For example, the set S1 can be composed of 10 matrices (A1 i , i=0, 1, ..., 9) and 10 offset vectors (b1 i , i=0, 1, ..., 9). Here, each of the 10 matrices can have 16 rows and 8 columns, and each of the 10 offset vectors can have a size of 16. The matrices and offset vectors of the set S1 can be used in blocks of size 4x8, 8x4, or 8x8. For example, the set S2 can be composed of 6 matrices (A2 i , i=0, 1, ..., 5) and six offset vectors (b2i , i=0, 1, ..., 5). Here, each of the six matrices can have 64 rows and 8 columns, and each of the six offset vectors can have a size of 64. The matrices and offset vectors of the set S2 can be used for all remaining blocks.

[0200] Meanwhile, one embodiment of the present document can signal LFNST index information for a block to which MIP is applied. Alternatively, an encoding device can generate a bitstream by encoding LFNST index information for transformation of a block to which MIP is applied, and a decoding device can parse or decode the bitstream to obtain LFNST index information for transformation of a block to which MIP is applied.

[0201] For example, LFNST index information may be information for distinguishing the number of transformations that constitute the LFNST transformation set. For example, the optimal LFNST kernel may be selected for a block on which intra prediction with MIP is performed based on the LFNST index information. For example, the LFNST index information may be represented by the st_idx syntax element or the lfnst_idx syntax element.

[0202] For example, LFNST index information (or st_idx syntax element) can be included in the syntax as shown in the following tables.

[0203]

[0204]

[0205]

[0206]

[0207] Tables 2 to 5 above may represent one syntax or information in succession.

[0208] For example, the information or semantics indicated by the intra_mip_flag syntax element, the intra_mip_mpm_flag syntax element, the intra_mip_mpm_idx syntax element, the intra_mip_mpm_remainder syntax element, or the st_idx syntax element in Tables 2 to 5 above may be as shown in the following table.

[0209]

[0210] For example, the intra_mip_flag syntax element may indicate information about whether MIP is applied to luma samples or the current block. Or, for example, the intra_mip_mpm_flag syntax element, the intra_mip_mpm_idx syntax element, or the intra_mip_mpm_remainder syntax element may indicate information about an intra prediction mode to be applied to the current block when MIP is applied. Or, for example, the st_idx syntax element may indicate information about a transformation kernel (LFNST kernel) to be applied to the LFNST for the current block. That is, the st_idx syntax element may be information indicating one of the transformation kernels in the LFNST transformation set. Here, the st_idx syntax element may also be indicated by the lfnst_idx syntax element or LFNST index information.

[0211] Figure 11 is a flowchart illustrating how MIP and LFNST are applied.

[0212] Meanwhile, another embodiment of the present document may not signal LFNST index information for a block to which MIP is applied. Alternatively, the encoding device may generate a bitstream by encoding image information excluding LFNST index information for transformation of the block to which MIP is applied, and the decoding device may parse or decode the bitstream and perform a transformation process of the block without LFNST index information for transformation of the block to which MIP is applied.

[0213] For example, if LFNST index information is not signaled, the LFNST index information can be derived as a default value. For example, the LFNST index information derived as a default value can be 0. For example, LFNST index information with a value of 0 can indicate that LFNST is not applied to the corresponding block. In this case, by not transmitting the LFNST index information, the amount of bits for coding the LFNST index information can be reduced. In addition, complexity can be reduced by preventing MIP and LFNST from being applied simultaneously, and thus, latency can be reduced.

[0214] Referring to FIG. 11, first, it can be determined whether MIP is applied to the corresponding block. That is, it can be determined whether the value of the intra_mip_flag syntax element is 1 or 0 (S1100). For example, if the value of the intra_mip_flag syntax element is 1, it can be viewed as true or yes, indicating that MIP is applied to the corresponding block. Accordingly, MIP prediction can be performed on the corresponding block (S1110). That is, a prediction block for the corresponding block can be derived by performing MIP prediction. Thereafter, an inverse primary transform procedure can be performed (S1120), and an intra reconstruction procedure can be performed (S1130). In other words, an inverse primary transform can be performed on transform coefficients obtained from a bitstream to derive a residual block, and a reconstruction block can be generated based on the prediction block according to the MIP prediction and the residual block. That is, LFNST index information for blocks to which MIP is applied may not be included. Or, LFNST may not be applied to blocks to which MIP is applied.

[0215] Or, for example, if the value of the intra_mip_flag syntax element is 0, it can be viewed as false or no, indicating that MIP is not applied to the block. That is, conventional intra prediction can be applied to the block (S1140). That is, conventional intra prediction can be performed to derive a prediction block for the block. Thereafter, it can be determined whether LFNST is applied to the block based on LFNST index information of the block. In other words, it can be determined whether the value of the st_idx syntax element is greater than 0 (S1150). For example, if the value of the st_idx syntax element is greater than 0, an inverse LFNST transform procedure can be performed using the transform kernel indicated by the st_idx syntax element (S1160). Or, if the value of the st_idx syntax element is not greater than 0, this can indicate that LFNST is not applied to the block, and the inverse LFNST transform procedure may not be performed. Thereafter, an inverse primary transform procedure may be performed (S1120), and an intra reconstruction procedure may be performed (S1130). In other words, an inverse primary transform may be performed on transform coefficients obtained from a bitstream to derive a residual block, and a reconstruction block may be generated based on a prediction block according to the conventional intra prediction and the residual block.

[0216] In summary, when MIP is applied, a MIP prediction block can be generated without decoding LFNST index information, and the final intra restoration signal can be generated by applying an inverse first-order transform to the received coefficients.

[0217] On the other hand, if MIP is not applied, the LFNST index information is decoded, and if the flag (or LFNST index information or st_idx syntax element) value is greater than 0, the inverse LFNST transform and inverse first-order transform can be applied to the received coefficients to generate the final intra restoration signal.

[0218] For example, for the above-described procedure, LFNST index information (or st_idx syntax element) may be included in the syntax or image information and signaled based on information on whether MIP is applied (or intra_mip_flag syntax element). Alternatively, LFNST index information (or st_idx syntax element) may be selectively configured / parsed / signaled / transmitted / received with reference to information on whether MIP is applied (or intra_mip_flag syntax element). For example, LFNST index information may be represented by st_idx syntax element or lfnst_idx syntax element.

[0219] For example, LFNST index information (or st_idx syntax element) may be included as shown in Table 7.

[0220]

[0221] For example, referring to Table 7, the st_idx syntax element can be included based on the intra_mip_flag syntax element. In other words, the st_idx syntax element can be included if the value of the intra_mip_flag syntax element is 0 (!intra_mip_flag).

[0222] Or, for example, LFNST index information (or lfnst_idx syntax element) may be included as in Table 8.

[0223]

[0224] For example, referring to Table 8, the lfnst_idx syntax element can be included based on the intra_mip_flag syntax element. In other words, the lfnst_idx syntax element can be included if the value of the intra_mip_flag syntax element is 0 (!intra_mip_flag).

[0225] For example, referring to Table 7 or Table 8, the st_idx syntax element or the lfnst_idx syntax element may also be included based on ISP (Intra Sub-Partitions) related information regarding sub-partitioning of a block. For example, the ISP related information may include an ISP flag or an ISP split flag, which may indicate whether sub-partitioning is performed on the block. For example, information regarding whether sub-partitioning is performed may be indicated by IntraSubPartitionsSplitType, and ISP_NO_SPLIT may indicate that sub-partitioning is not performed, ISP_HOR_SPLIT may indicate that sub-partitioning is performed in a horizontal direction, and ISP_VER_SPLIT may indicate that sub-partitioning is performed in a vertical direction.

[0226] The above residual related information includes the LFNST index information based on the MIP flag and the ISP related information.

[0227] Meanwhile, another embodiment of the present document can derive LFNST index information for a block to which MIP is applied without separately signaling it. Alternatively, an encoding device can generate a bitstream by encoding image information excluding LFNST index information for transformation of a block to which MIP is applied, and a decoding device can parse or decode the bitstream, derive and obtain LFNST index information for transformation of a block to which MIP is applied, and perform a transformation process of the block based on the LFNST index information.

[0228] That is, while the LFNST index information for the block may not be decoded, the indices that distinguish the transformations that make up the LFNST transformation set can be determined through the derivation process. Alternatively, the derivation process may determine that a separate optimized transformation kernel is to be used for the block to which MIP is applied. In this case, the optimal LFNST kernel can be selected for the block to which MIP is applied, while reducing the bit amount required for coding it.

[0229] For example, LFNST index information can be derived based on at least one of reference line index information for intra prediction, intra prediction mode information, block size information, or information on whether MIP is applied.

[0230] Meanwhile, another embodiment of the present document can binarize LFNST index information for a block to which MIP is applied to signal. For example, the number of applicable LFNST transformations may vary depending on whether MIP is applied to the current block, and for this purpose, the binarization method for the LFNST index information can be selectively switched.

[0231] For example, a single LFNST kernel can be used for a MIP-applied block, and this kernel can be one of the LFNST kernels applied to non-MIP-applied blocks. Alternatively, instead of using the previously used LFNST kernel for a MIP-applied block, a separate kernel optimized for MIP-applied blocks can be defined and used.

[0232] In this case, since a reduced number of LFNST kernels are used for blocks to which MIP is applied compared to blocks to which it is not applied, the overhead for signaling LFNST index information can be reduced, and the complexity can be reduced.

[0233] For example, the LFNST index information can be binarized using the following table.

[0234]

[0235] Referring to Table 9, for example, the st_idx syntax element can be binarized to TR (Truncated Rice) if MIP is not applied to the corresponding block, if intra_mip_flag[][]==false, or if the value of the intra_mip_flag syntax element is 0. For example, in this case, the input parameter cMax can have a value of 2, and cRiceParam can have a value of 0.

[0236] Or, for example, the st_idx syntax element can be binarized to FL (Fixed-Length) if MIP is applied to the block, if intra_mip_flag[][]==true, or if the value of the intra_mip_flag syntax element is 1. For example, in this case, the input parameter cMax can have the value 1.

[0237] Here, the st_idx syntax element can represent LFNST index information and can also be represented by the lfnst_idx syntax element.

[0238] Meanwhile, another embodiment of the present document can signal LFNST related information for a block to which MIP is applied.

[0239] For example, LFNST index information may include a single syntax element, and may indicate whether LFNST is applied based on a single syntax element and the type of transformation kernel used for LFNST. In this case, the LFNST index information may be indicated by, for example, the st_idx syntax element or the lfnst_idx syntax element.

[0240] Or, for example, the LFNST index information may include one or more syntax elements, and may indicate information on whether LFNST is applied and information on the type of transformation kernel used for LFNST based on the one or more syntax elements. For example, the LFNST index information may include two syntax elements. In this case, the LFNST index information may include a syntax element indicating information on whether LFNST is applied and a syntax element indicating information on the type of transformation kernel used for LFNST. For example, the information on whether LFNST is applied may be indicated by an LFNST flag, and may be indicated by an st_flag syntax element or an lfnst_flag syntax element. Alternatively, for example, information about the type of transformation kernel used for LFNST may be represented as a transformation kernel index flag, and may be represented by a st_idx_flag syntax element, an st_kernel_flag syntax element, an lfnst_idx_flag syntax element, or an lfnst_kernel_flag syntax element. For example, if the LFNST index information includes one or more syntax elements as described above, the LFNST index information may also be referred to as LFNST-related information.

[0241] For example, LFNST related information (e.g., st_flag syntax element or st_idx_flag syntax element) may be included as shown in Table 10.

[0242]

[0243] Meanwhile, a block to which MIP is applied may use a different number of LFNST transforms (kernels) than a block to which MIP is not applied. For example, a block to which MIP is applied may use only one LFNST transform kernel. For example, the one LFNST transform kernel may be one of the LFNST kernels applied to a block to which MIP is not applied. Alternatively, instead of using the LFNST kernel previously used for a block to which MIP is applied, a separate kernel optimized for the block to which MIP is applied may be defined and used.

[0244] In this case, among the LFNST-related information, information about the type of transformation kernel used for LFNST (e.g., transformation kernel index flag) can be selectively signaled depending on whether MIP is applied, and the LFNST-related information at this time can be included, for example, as shown in Table 11.

[0245]

[0246] In other words, referring to Table 11, information about the type of transform kernel used for LFNST (or the st_idx_flag syntax element) can be included based on information about whether MIP is applied to the corresponding block (or the intra_mip_flag syntax element). Or, for example, the st_idx_flag syntax element can signal (!intra_mip_flag) if MIP is not applied to the corresponding block.

[0247] For example, the information or semantics indicated by the st_flag syntax element or the st_idx_flag syntax element in Table 10 or Table 11 above may be as shown in the following table.

[0248]

[0249] For example, the st_flag syntax element can indicate whether a quadratic transformation is applied. For example, if the value of the st_flag syntax element is 0, it can indicate that a quadratic transformation is not applied, and if it is 1, it can indicate that a quadratic transformation is applied. For example, the st_idx_flag syntax element can indicate information about which quadratic transformation kernel is applied among two candidate kernels in the selected transformation set.

[0250] For example, information related to LFNST can be converted using a binarization method as shown in the following table.

[0251]

[0252] Referring to Table 13, for example, the st_flag syntax element can be binarized to FL. For example, in this case, the input parameter cMax can have a value of 1. Or, for example, the st_idx_flag syntax element can be binarized to FL. For example, in this case, the input parameter cMax can have a value of 1.

[0253] For example, referring to Table 10 or Table 11, the descriptor of the st_flag syntax element or the st_idx_flag syntax element may be ae(v), where ae(v) may represent context-adaptive arithmetic entropy-coding. Alternatively, the syntax element whose descriptor is ae(v) may be a context-adaptive arithmetic entropy-coded syntax element. That is, LFNST-related information (e.g., the st_flag syntax element or the st_idx_flag syntax element) may have context-adaptive arithmetic entropy coding applied to it. Alternatively, the LFNST-related information (e.g., the st_flag syntax element or the st_idx_flag syntax element) may be information or syntax element to which context-adaptive arithmetic entropy coding is applied. Alternatively, LFNST-related information (e.g., bins of an empty string of a st_flag syntax element or a st_idx_flag syntax element) can be encoded / decoded based on the aforementioned CABAC, etc. Here, context-adaptive arithmetic entropy coding may also be referred to as context model-based coding, context coding, or regular coding.

[0254] For example, the context index increment (ctxInc: context index increment) of LFNST-related information (e.g., st_flag syntax element or st_idx_flag syntax element) or ctxInc according to the empty position of the st_flag syntax element or st_idx_flag syntax element can be assigned or determined as shown in Table 14. Or, a context model can be selected according to the empty position of the st_flag syntax element or st_idx_flag syntax element as shown in Table 14. Or, a context model can be selected based on ctxInc according to the empty position of the st_flag syntax element or st_idx_flag syntax element that is assigned or determined as shown in Table 14.

[0255]

[0256] Referring to Table 14, for example, the st_flag syntax element (the bin or the first bin of the empty string) can use two context models (or ctxIdx), and the context model can be selected based on ctxInc, which has a value of 0 or 1. Or, for example, the st_idx_flag syntax element (the bin or the first bin of the empty string) can be coded by applying bypass coding. Or, it can be coded by applying a uniform probability distribution.

[0257] For example, the ctxInc of the st_flag syntax element (the empty string or the first empty string) can be determined based on Table 15 below.

[0258]

[0259] Referring to Table 15, for example, the ctxInc of the st_flag syntax element (the empty string or the first empty string) can be determined based on the MTS index (or the tu_mts_idx syntax element) or the tree type information (treeType). For example, ctxInc can be derived as 1 if the value of the MTS index is 0 and the tree type is not a single tree. Alternatively, ctxInc can be derived as 0 if the value of the MTS index is not 0 or the tree type is a single tree.

[0260] In this case, since a reduced number of LFNST kernels are used for blocks to which MIP is applied compared to blocks to which it is not applied, the overhead for signaling LFNST index information can be reduced, and the complexity can be reduced.

[0261] Meanwhile, another embodiment of the present document can derive and use an LFNST kernel for a block to which MIP is applied. That is, information about the LFNST kernel can be derived without separately signaling it. Alternatively, an encoding device can generate a bitstream by encoding image information excluding LFNST index information for transformation of a block to which MIP is applied or information about (the type of) a transformation kernel used for LFNST, and a decoding device can parse or decode the bitstream, derive and obtain LFNST index information for transformation of a block to which MIP is applied or information about a transformation kernel used for LFNST, and perform a transformation process of the block based on the LFNST.

[0262] That is, while the LFNST index information or the information about the transformation kernel used for LFNST may not be decoded for the block in question, the indices that distinguish the transformations that make up the LFNST transformation set may be determined through the derivation process. Alternatively, the derivation process may determine that a separate optimized transformation kernel is to be used for the block to which MIP is applied. In this case, it is possible to select the optimal LFNST kernel for the block to which MIP is applied while reducing the bit amount required for coding it.

[0263] For example, information about LFNST index information or a transformation kernel used for LFNST can be derived based on at least one of reference line index information for intra prediction, intra prediction mode information, block size information, or information about whether MIP is applied.

[0264] In the embodiments of the present document described above, FL (Fixed-Length) binarization can indicate a method of binarizing to a fixed length, such as a specific number of bits, and the specific number of bits can be predefined or can be indicated based on cMax. TU (Truncated Unary) binarization can indicate a method of binarizing to a variable length by using as many 1s as the number of symbols to be expressed and one 0, and not adding 0s when the number of symbols to be expressed is equal to the maximum length, and the maximum length can be indicated based on cMax. TR (Truncated Rice) binarization can indicate a method of binarizing in a form that connects a prefix and a sufix, such as TU + FL, and uses maximum length and shift information, but can be the same as TU if the shift information has a value of 0. Here, the maximum length can be indicated based on cMax, and the shift information can be indicated based on cRiceParam.

[0265] FIG. 12 and FIG. 13 schematically illustrate an example of a video / image encoding method and related components according to an embodiment(s) of the present document.

[0266] The method disclosed in FIG. 12 can be performed by the encoding device disclosed in FIG. 2 or FIG. 13. Specifically, for example, S1200 to S1220 of FIG. 12 can be performed by the prediction unit (220) of the encoding device of FIG. 13, S1230 to S1240 of FIG. 12 can be performed by the residual processing unit (230) of the encoding device of FIG. 13, and S1250 of FIG. 12 can be performed by the entropy encoding unit (240) of the encoding device of FIG. 13. In addition, although not shown in FIG. 12, prediction samples or prediction-related information can be derived by the prediction unit (220) of the encoding device in FIG. 13, residual information can be derived from original samples or prediction samples by the residual processing unit (230) of the encoding device, and a bitstream can be generated from the residual information or prediction-related information by the entropy encoding unit (240) of the encoding device. The method disclosed in FIG. 12 may include the embodiments described above in this document.

[0267] Referring to FIG. 12, the encoding device can determine an intra-prediction mode and an intra-prediction type for the current block (S1200), and generate prediction-related information for the current block based on the intra-prediction mode and the intra-prediction type (S1210). For example, the prediction-related information can include intra-prediction mode information and / or intra-prediction type information.

[0268] For example, the encoding device can determine the intra prediction type for the current block by considering the RD (rate distortion) cost. The intra prediction type information can indicate whether to apply the normal intra prediction type that uses a reference line adjacent to the current block, the MRL (Multi-Reference Line) that uses a reference line that is not adjacent to the current block, the ISP (Intra Sub-Partitions) that performs sub-partitioning for the current block, or the MIP (Matrix based Intra Prediction) that uses a matrix.

[0269] For example, the intra prediction type information (or prediction-related information) may include a MIP flag indicating whether MIP is applied to the current block. Or, for example, the intra prediction type information (or prediction-related information) may include ISP (Intra Sub-Partitions)-related information regarding sub-partitioning of ISP to the current block. For example, the ISP-related information may include an ISP flag indicating whether ISP is applied to the current block or an ISP split flag indicating a splitting direction. Or, for example, the intra prediction type information may include the MIP flag and the ISP-related information. For example, the MIP flag may indicate an intra_mip_flag syntax element. Or, for example, the ISP flag may indicate an intra_subpartitions_mode_flag syntax element, and the ISP split flag may indicate an intra_subpartitions_split_flag syntax element.

[0270] In addition, for example, the encoding device can determine an intra prediction mode for the current block, and generate intra prediction information for the current block based on the intra prediction mode. For example, the encoding device can determine the intra prediction mode by considering the RD cost. The intra prediction mode information can indicate an intra prediction mode to be applied to the current block among the intra prediction modes. For example, the intra prediction modes can include intra prediction modes 0 to 66. For example, intra prediction mode 0 can indicate a planar mode, and intra prediction mode 1 can indicate a DC mode. In addition, intra prediction modes 2 to 66 can be indicated as directional or angular intra prediction modes, and can indicate a direction to be referenced. Alternatively, intra prediction modes 0 and 1 can be indicated as non-directional or non-angular intra prediction modes. A detailed description thereof has been described above with reference to FIG. 5.

[0271] The encoding device can derive prediction samples of the current block based on the intra prediction mode and the intra prediction type (S1220). Alternatively, for example, the encoding device can generate the prediction samples based on the intra prediction mode and / or the intra prediction type.

[0272] The encoding device may generate residual samples of the current block based on the predicted samples (S1230). For example, the encoding device may generate the residual samples based on original samples (e.g., an input video signal) and the predicted samples. Alternatively, for example, the encoding device may generate the residual samples based on the difference between the original samples and the predicted samples.

[0273] The encoding device can generate residual-related information for the current block based on residual samples (S1240). For example, the encoding device can derive temporary transform coefficients for the current block based on residual samples, derive transform coefficients for the current block from the temporary transform coefficients, and generate the residual-related information based on the transform coefficients. For example, when a secondary transform is not performed, the temporary transform coefficients may be identical to the transform coefficients and may be used as the transform coefficients.

[0274] For example, the encoding device can perform a primary transform based on the residual samples to derive transform coefficients. Alternatively, for example, the encoding device can perform a primary transform based on the residual samples to derive temporary transform coefficients, and can also derive transform coefficients by applying LFNST to the temporary transform coefficients. For example, when the LFNST is applied, the encoding device can generate the LFNST index information. That is, the LFNST index information can be generated based on the transform kernel used to derive the transform coefficients.

[0275] For example, an encoding device may perform quantization based on transform coefficients to derive quantized transform coefficients. Furthermore, the encoding device may generate information about the quantized transform coefficients based on the quantized transform coefficients. Furthermore, the residual-related information may include information about the quantized transform coefficients.

[0276] The encoding device can encode prediction-related information and residual-related information (S1250). For example, the residual-related information may include information about (quantized) transform coefficients as described above. Furthermore, for example, the residual-related information may include the LFNST index information. Alternatively, for example, the residual-related information may not include the LFNST index information.

[0277] For example, the residual-related information may include LFNST index information indicating information about non-separable transform for low-frequency transform coefficients of the current block based on the MIP flag. Or, for example, the residual-related information may include LFNST index information based on the MIP flag or the size of the current block. Or, for example, the residual-related information may include LFNST index information based on the MIP flag or information about the current block. Here, the information about the current block may include at least one of the size of the current block, tree structure information indicating a single tree or a dual tree, an LFNST availability flag, or ISP-related information. For example, the MIP flag may be one of a plurality of conditions for determining whether the residual-related information includes LFNST index information, and in addition to the MIP flag, the residual-related information may also include LFNST index information based on other conditions such as the size of the current block. However, the following description will focus on the MIP flag. Here, the LFNST index information may be represented as transformation index information. Alternatively, the LFNST index information may be represented as the st_idx syntax element or the lfnst_idx syntax element.

[0278] For example, the residual-related information may include the LFNST index information based on the MIP flag indicating that the MIP is not applied. Or, for example, the residual-related information may not include the LFNST index information based on the MIP flag indicating that the MIP is applied. That is, when the MIP flag indicates that the MIP is applied to the current block (e.g., when the value of the intra_mip_flag syntax element is 1), the residual-related information may not include the LFNST index information, and when the MIP flag indicates that the MIP is not applied to the current block (e.g., when the value of the intra_mip_flag syntax element is 0), the residual-related information may include the LFNST index information.

[0279] Alternatively, for example, the residual-related information may include the LFNST index information based on the MIP flag and the ISP-related information. For example, if the MIP flag indicates that MIP is not applied to the current block (for example, if the value of the intra_mip_flag syntax element is 0), the residual-related information may include the LFNST index information by referring to the ISP-related information (IntraSubPartitionsSplitType). Here, IntraSubPartitionsSplitType may indicate that ISP is not applied (ISP_NO_SPLIT), applied in the horizontal direction (ISP_HOR_SPLIT), or applied in the vertical direction (ISP_VER_SPLIT), which may be derived based on the ISP flag or the ISP split flag.

[0280] For example, the LFNST index information may be derived or derived and used based on the MIP flag indicating that the MIP is applied to the current block, in which case the residual-related information may not include the LFNST index information. That is, the encoding device may not signal the LFNST index information. For example, the LFNST index information may be derived or derived and used based on at least one of reference line index information for the current block, intra prediction mode information of the current block, size information of the current block, and the MIP flag.

[0281] Alternatively, for example, the LFNST index information may include an LFNST flag indicating whether a non-separable transform is applied to the low-frequency transform coefficients of the current block and / or a transform kernel index flag indicating a transform kernel applied to the current block among transform kernel candidates. That is, the LFNST index information may indicate information about a non-separable transform for the low-frequency transform coefficients of the current block based on one syntax element or one piece of information, but may also be indicated based on two syntax elements or two pieces of information. For example, the LFNST flag may be indicated by an st_flag syntax element or an lfnst_flag syntax element, and the transform kernel index flag may be indicated by an st_idx_flag syntax element, an st_kernel_flag syntax element, an lfnst_idx_flag syntax element, or an lfnst_kernel_flag syntax element. Here, the transformation kernel index flag may be included in the LFNST index information based on the LFNST flag indicating that the non-separable transformation is applied and the MIP flag indicating that the MIP is not applied. That is, when the LFNST flag indicates that the non-separable transformation is applied and the MIP flag indicates that the MIP is applied, the LFNST index information may include the transformation kernel index flag.

[0282] For example, the LFNST flag and the transform kernel index flag may be derived or derived and used based on the MIP flag indicating that the MIP is applied to the current block, in which case the residual-related information may not include the LFNST flag and the transform kernel index flag. That is, the encoding device may not signal the LFNST flag and the transform kernel index flag. For example, the LFNST flag and the transform kernel index flag may be derived or derived and used based on at least one of reference line index information for the current block, intra prediction mode information of the current block, size information of the current block, and the MIP flag.

[0283] For example, when the residual related information includes the LFNST index information, the LFNST index information can be represented through binarization. For example, based on the MIP flag indicating that the MIP is not applied, the LFNST index information (e.g., the st_idx syntax element or the lfnst_idx syntax element) can be represented through TR (Truncated Rice) based binarization, and based on the MIP flag indicating that the MIP is applied, the LFNST index information (e.g., the st_idx syntax element or the lfnst_idx syntax element) can be represented through FL (Fixed Length) based binarization. That is, when the MIP flag indicates that MIP is not applied to the current block (e.g., when the intra_mip_flag syntax element is 0 or false), the LFNST index information (e.g., the st_idx syntax element or the lfnst_idx syntax element) can be represented through TR-based binarization, and when the MIP flag indicates that MIP is applied to the current block (e.g., when the intra_mip_flag syntax element is 1 or true), the LFNST index information (e.g., the st_idx syntax element or the lfnst_idx syntax element) can be represented through FL-based binarization.

[0284] Or, for example, if the residual related information includes the LFNST index information, and the LFNST index information includes the LFNST flag and the transformation kernel index flag, the LFNST flag and the transformation kernel index flag may be represented through FL (Fixed Length) based binarization.

[0285] For example, the LFNST index information can be represented as an empty string (of bins) through binarization as described above, and this can be coded to generate a bit, a bit string, or a bitstream.

[0286] For example, the (first) bin of the empty string of the LFNST flag may be coded based on context coding, and the context coding may be performed based on the value of the context index increment / decrease with respect to the LFNST flag. Here, the context coding may be called regular coding as coding performed based on a context model. In addition, the context model may be represented by a context index (ctxIdx), and the context index may be represented based on a context index increment / decrease (ctxInc) and a context index offset (ctxIdxOffset). For example, the value of the context index increment / decrease may be represented as one of candidates including 0 and 1. For example, the value of the context index increment / decrease may be determined based on an MTS index (e.g., an mts_idx syntax element or a tu_mts_idx syntax element) indicating a transform kernel set to be used for the current block among transform kernel sets and tree type information indicating a partition structure of the current block. Here, the tree type information can indicate a single tree indicating that the partition structures of the luma component and chroma component of the current block are the same, or a dual tree indicating that the partition structures of the luma component and chroma component of the current block are different.

[0287] For example, the (first) bin of the empty string of the above-mentioned transformation kernel index flags can be coded based on bypass coding. Here, bypass coding may indicate performing context coding based on a uniform probability distribution, and coding efficiency can be improved by omitting the context coding update procedure, etc.

[0288] Alternatively, although not illustrated in FIG. 12, for example, the encoding device may generate restored samples based on the residual samples and the predicted samples. Furthermore, restored blocks and restored pictures may be derived based on the restored samples.

[0289] For example, an encoding device can encode image information including all or part of the above-described information (or syntax elements) to generate a bitstream or encoded information. Or, the bitstream or encoded information can be output in the form of a bitstream. In addition, the bitstream or encoded information can be transmitted to a decoding device via a network or a storage medium. Alternatively, the bitstream or encoded information can be stored in a computer-readable storage medium, and the bitstream or the encoded information can be generated by the above-described image encoding method.

[0290] FIG. 14 and FIG. 15 schematically illustrate an example of a video / image decoding method and related components according to an embodiment(s) of the present document.

[0291] The method disclosed in FIG. 14 can be performed by the decoding device disclosed in FIG. 3 or FIG. 15. Specifically, for example, S1400 of FIG. 14 can be performed by the entropy decoding unit (310) of the decoding device in FIG. 15, and S1410 and S1420 of FIG. 14 can be performed by the residual processing unit (320) of the decoding device in FIG. 15. In addition, although not shown in FIG. 14, prediction-related information or residual information can be derived from a bitstream by the entropy decoding unit (310) of the decoding device in FIG. 15, residual samples can be derived from the residual information by the residual processing unit (320) of the decoding device, prediction samples can be derived from the prediction-related information by the prediction unit (330) of the decoding device, and a reconstructed block or reconstructed picture can be derived from the residual samples or prediction samples by the adding unit (340) of the decoding device. The method disclosed in FIG. 13 may include the embodiments described above in this document.

[0292] Referring to FIG. 14, a decoding device can obtain prediction-related information and residual-related information for a current block (S1400). For example, the prediction-related information may include intra-prediction mode information and / or intra-prediction type information for the current block. For example, the decoding device can obtain prediction-related information or residual-related information by parsing or decoding a bitstream. Here, the bitstream may also be referred to as encoded (video) information. For example, the decoding device can generate prediction samples for the current block based on the prediction-related information.

[0293] The intra prediction mode information may indicate which intra prediction mode among the intra prediction modes is to be applied to the current block. For example, the intra prediction modes may include intra prediction modes 0 to 66. For example, intra prediction mode 0 may indicate a planar mode, and intra prediction mode 1 may indicate a DC mode. In addition, intra prediction modes 2 to 66 may be indicated as directional or angular intra prediction modes, and may indicate a direction to be referenced. Alternatively, intra prediction modes 0 and 1 may be indicated as non-directional or non-angular intra prediction modes. A detailed description thereof has been described above with reference to FIG. 5.

[0294] Additionally, the intra prediction type information may indicate whether to apply the normal intra prediction type that uses a reference line adjacent to the current block, the MRL (Multi-Reference Line) that uses a reference line that is not adjacent to the current block, the ISP (Intra Sub-Partitions) that performs sub-partitioning for the current block, or the MIP (Matrix based Intra Prediction) that uses a matrix.

[0295] For example, a decoding device may obtain residual-related information from a bitstream. Here, the residual-related information may indicate information used to derive residual samples, and may include information about residual samples, (inverse) transform-related information, and / or (inverse) quantization-related information. For example, the residual-related information may include information about quantized transform coefficients.

[0296] For example, the intra prediction type information (or prediction-related information) may include a MIP flag indicating whether MIP is applied to the current block. Or, for example, the intra prediction type information (or prediction-related information) may include ISP (Intra Sub-Partitions)-related information regarding sub-partitioning of ISP to the current block. For example, the ISP-related information may include an ISP flag indicating whether ISP is applied to the current block or an ISP split flag indicating a splitting direction. Or, for example, the intra prediction type information may include the MIP flag and the ISP-related information. For example, the MIP flag may indicate an intra_mip_flag syntax element. Or, for example, the ISP flag may indicate an intra_subpartitions_mode_flag syntax element, and the ISP split flag may indicate an intra_subpartitions_split_flag syntax element.

[0297] For example, the residual-related information may include LFNST (Low Frequency Non Separable Transform) index information indicating information about a non-separable transform for low-frequency transform coefficients of the current block based on the MIP flag. Or, for example, the residual-related information may include LFNST index information based on the MIP flag or the size of the current block. Or, for example, the residual-related information may include LFNST index information based on the MIP flag or the information about the current block. Here, the information about the current block may include at least one of the size of the current block, tree structure information indicating a single tree or a dual tree, an LFNST availability flag, or ISP-related information. For example, the MIP flag may be one of a plurality of conditions for determining whether the residual-related information includes LFNST index information, and in addition to the MIP flag, the residual-related information may also include LFNST index information based on other conditions such as the size of the current block. However, the following description will focus on the MIP flag. Here, the LFNST index information may be represented as transformation index information. Alternatively, the LFNST index information may be represented as the st_idx syntax element or the lfnst_idx syntax element.

[0298] For example, the residual-related information may include the LFNST index information based on the MIP flag indicating that the MIP is not applied. Or, for example, the residual-related information may not include the LFNST index information based on the MIP flag indicating that the MIP is applied. That is, when the MIP flag indicates that the MIP is applied to the current block (e.g., when the value of the intra_mip_flag syntax element is 1), the residual-related information may not include the LFNST index information, and when the MIP flag indicates that the MIP is not applied to the current block (e.g., when the value of the intra_mip_flag syntax element is 0), the residual-related information may include the LFNST index information.

[0299] Alternatively, for example, the residual-related information may include the LFNST index information based on the MIP flag and the ISP-related information. For example, if the MIP flag indicates that MIP is not applied to the current block (for example, if the value of the intra_mip_flag syntax element is 0), the residual-related information may include the LFNST index information by referring to the ISP-related information (IntraSubPartitionsSplitType). Here, IntraSubPartitionsSplitType may indicate that ISP is not applied (ISP_NO_SPLIT), applied in the horizontal direction (ISP_HOR_SPLIT), or applied in the vertical direction (ISP_VER_SPLIT), which may be derived based on the ISP flag or the ISP split flag.

[0300] For example, when the residual-related information does not include the LFNST index information, i.e., when the LFNST index information is not signaled, as the MIP flag indicates that the MIP is applied to the current block, the LFNST index information may be derived or derived. For example, the LFNST index information may be derived based on at least one of reference line index information for the current block, intra prediction mode information of the current block, size information of the current block, and the MIP flag.

[0301] Alternatively, for example, the LFNST index information may include an LFNST flag indicating whether a non-separable transform is applied to the low-frequency transform coefficients of the current block and / or a transform kernel index flag indicating a transform kernel applied to the current block among transform kernel candidates. That is, the LFNST index information may indicate information about a non-separable transform for the low-frequency transform coefficients of the current block based on one syntax element or one piece of information, but may also be indicated based on two syntax elements or two pieces of information. For example, the LFNST flag may be indicated by an st_flag syntax element or an lfnst_flag syntax element, and the transform kernel index flag may be indicated by an st_idx_flag syntax element, an st_kernel_flag syntax element, an lfnst_idx_flag syntax element, or an lfnst_kernel_flag syntax element. Here, the transformation kernel index flag may be included in the LFNST index information based on the LFNST flag indicating that the non-separable transformation is applied and the MIP flag indicating that the MIP is not applied. That is, when the LFNST flag indicates that the non-separable transformation is applied and the MIP flag indicates that the MIP is applied, the LFNST index information may include the transformation kernel index flag.

[0302] For example, when the residual-related information does not include the LFNST flag and the transform kernel index flag, i.e., when the LFNST flag and the transform kernel index flag are not signaled, since the MIP flag indicates that the MIP is applied to the current block, the LFNST flag and the transform kernel index flag may be derived or derived. For example, the LFNST flag and the transform kernel index flag may be derived based on at least one of reference line index information for the current block, intra prediction mode information of the current block, size information of the current block, and the MIP flag.

[0303] For example, when the residual-related information includes the LFNST index information, the LFNST index information can be derived through binarization. For example, based on the MIP flag indicating that the MIP is not applied, the LFNST index information (e.g., the st_idx syntax element or the lfnst_idx syntax element) can be derived through TR (Truncated Rice)-based binarization, and based on the MIP flag indicating that the MIP is applied, the LFNST index information (e.g., the st_idx syntax element or the lfnst_idx syntax element) can be derived through FL (Fixed Length)-based binarization. That is, when the MIP flag indicates that MIP is not applied to the current block (e.g., when the intra_mip_flag syntax element is 0 or false), the LFNST index information (e.g., the st_idx syntax element or the lfnst_idx syntax element) can be derived through TR-based binarization, and when the MIP flag indicates that MIP is applied to the current block (e.g., when the intra_mip_flag syntax element is 1 or true), the LFNST index information (e.g., the st_idx syntax element or the lfnst_idx syntax element) can be derived through FL-based binarization.

[0304] Or, for example, if the residual related information includes the LFNST index information, and the LFNST index information includes the LFNST flag and the transformation kernel index flag, the LFNST flag and the transformation kernel index flag can be derived through FL (Fixed Length)-based binarization.

[0305] For example, the LFNST index information can be obtained by deriving candidates through binarization as described above, and comparing bins represented by parsing or decoding a bitstream with the candidates.

[0306] For example, the (first) bin of the empty string of the LFNST flag can be derived based on context coding, and the context coding can be performed based on the value of the context index increment / decrease with respect to the LFNST flag. Here, the context coding is a coding performed based on a context model and may be called regular coding. In addition, the context model can be represented by a context index (ctxIdx), and the context index can be derived based on a context index increment / decrease (ctxInc) and a context index offset (ctxIdxOffset). For example, the value of the context index increment / decrease can be derived as one of candidates including 0 and 1. For example, the value of the context index increment / decrease can be derived based on an MTS index (e.g., an mts_idx syntax element or a tu_mts_idx syntax element) indicating a transform kernel set to be used for the current block among transform kernel sets and tree type information indicating a partition structure of the current block. Here, the tree type information can indicate a single tree indicating that the partition structures of the luma component and chroma component of the current block are the same, or a dual tree indicating that the partition structures of the luma component and chroma component of the current block are different.

[0307] For example, the (first) bin of the empty string of the above-mentioned transformation kernel index flags can be derived based on bypass coding. Here, bypass coding may indicate performing context coding based on a uniform probability distribution, and coding efficiency can be improved by omitting the context coding update procedure, etc.

[0308] The decoding device can derive transform coefficients for the current block based on residual-related information (S1410). For example, the residual-related information can include information on quantized transform coefficients, and the decoding device can derive quantized transform coefficients for the current block based on the information on the quantized transform coefficients. For example, the decoding device can perform inverse quantization on the quantized transform coefficients to derive transform coefficients for the current block.

[0309] The decoding device may generate residual samples of the current block based on transform coefficients (S1420). For example, the decoding device may generate the residual samples from the transform coefficients based on the LFNST index information. Alternatively, for example, the decoding device may derive modified transform coefficients from the transform coefficients based on the LFNST index information, and generate the residual samples based on the modified transform coefficients. For example, when an inverse second transform is not performed, the transform coefficients may be identical to the modified transform coefficients, and the transform coefficients may be used as is to generate the residual samples.

[0310] For example, when the LFNST index information is included in the residual-related information or when the LFNST index information is derived or derived, LFNST can be performed on the transform coefficients according to the LFNST index information, and modified transform coefficients can be derived. Thereafter, the decoding device can generate the residual samples based on the modified transform coefficients. Or, for example, when the LFNST index information is not included in the residual-related information or indicates not to perform LFNST, the decoding device can generate residual samples based on the transform coefficients without performing LFNST on the transform coefficients.

[0311] Although not illustrated in FIG. 14, for example, a decoding device may generate reconstructed samples based on the predicted samples and the residual samples. Furthermore, for example, reconstructed blocks and reconstructed pictures may be derived based on the reconstructed samples.

[0312] For example, a decoding device can obtain image information including all or part of the above-described information (or syntax elements) by decoding a bitstream or encoded information. In addition, the bitstream or encoded information can be stored in a computer-readable storage medium and can cause the above-described decoding method to be performed.

[0313] In the embodiments described above, the methods are described based on a flowchart as a series of steps or blocks. However, the embodiments are not limited to the order of the steps, and some steps may occur in a different order or simultaneously with other steps described above. Furthermore, those skilled in the art will understand that the steps depicted in the flowchart are not exclusive, and other steps may be included, or one or more steps in the flowchart may be deleted without affecting the scope of the embodiments of this document.

[0314] The method according to the embodiments of the present document described above can be implemented in the form of software, and the encoding device and / or decoding device according to the present document can be included in a device that performs image processing, such as a TV, a computer, a smartphone, a set-top box, a display device, etc.

[0315] When the embodiments in this document are implemented as software, the above-described method can be implemented as a module (process, function, etc.) that performs the above-described function. The module can be stored in memory and executed by a processor. The memory can be internal or external to the processor and can be connected to the processor by various well-known means. The processor can include an application-specific integrated circuit (ASIC), another chipset, logic circuit, and / or data processing device. The memory can include a read-only memory (ROM), a random access memory (RAM), flash memory, a memory card, a storage medium, and / or other storage devices. That is, the embodiments described in this document can be implemented and performed on a processor, a microprocessor, a controller, or a chip. For example, the functional units illustrated in each drawing can be implemented and performed on a computer, a processor, a microprocessor, a controller, or a chip. In this case, information for implementation (e.g., information on instructions) or an algorithm can be stored on a digital storage medium.

[0316] In addition, the decoding device and encoding device to which the embodiment(s) of the present document are applied may be included in a multimedia broadcasting transmitting and receiving device, a mobile communication terminal, a home cinema video device, a digital cinema video device, a surveillance camera, a video conversation device, a real-time communication device such as a video communication, a mobile streaming device, a storage medium, a camcorder, a video-on-demand (VoD) service providing device, an OTT (Over the top video) device, an Internet streaming service providing device, a three-dimensional (3D) video device, a VR (virtual reality) device, an AR (argumente reality) device, a video phone video device, a transportation terminal (e.g., a vehicle (including an autonomous vehicle) terminal, an airplane terminal, a ship terminal, etc.), and a medical video device, and may be used to process a video signal or a data signal. For example, the OTT (Over the top video) device may include a game console, a Blu-ray player, an Internet-connected TV, a home theater system, a smartphone, a tablet PC, a DVR (Digital Video Recorder), etc.

[0317] In addition, the processing method to which the embodiment(s) of the present document are applied can be produced in the form of a computer-executable program and can be stored in a computer-readable recording medium. Multimedia data having a data structure according to the embodiment(s) of the present document can also be stored in a computer-readable recording medium. The computer-readable recording medium includes all types of storage devices and distributed storage devices in which computer-readable data is stored. The computer-readable recording medium can 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 includes a medium implemented in the form of a carrier wave (e.g., transmission via the Internet). In addition, a bitstream generated by an encoding method can be stored in a computer-readable recording medium or transmitted via a wired or wireless communication network.

[0318] Additionally, the embodiments of the present document may be implemented as a computer program product by program code, and the program code may be executed on a computer by the embodiments of the present document. The program code may be stored on a computer-readable carrier.

[0319] Figure 16 illustrates an example of a content streaming system to which the embodiments disclosed in this document can be applied.

[0320] Referring to FIG. 16, a content streaming system to which embodiments of the present document are applied may largely include an encoding server, a streaming server, a web server, a media storage, a user device, and a multimedia input device.

[0321] The encoding server compresses content input from multimedia input devices such as smartphones, cameras, and camcorders into digital data, generates a bitstream, and transmits it to the streaming server. Alternatively, if multimedia input devices such as smartphones, cameras, and camcorders directly generate bitstreams, the encoding server may be omitted.

[0322] The above bitstream can be generated by an encoding method or a bitstream generation method to which the embodiments of the present document are applied, and the streaming server can temporarily store the bitstream during the process of transmitting or receiving the bitstream.

[0323] 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 an intermediary 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 the multimedia data to the user. At this time, the content streaming system may include a separate control server, in which case the control server controls commands / responses between each device within the content streaming system.

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

[0325] Examples of the user devices may include mobile phones, smart phones, laptop computers, digital broadcasting terminals, personal digital assistants (PDAs), portable multimedia players (PMPs), navigation devices, slate PCs, tablet PCs, ultrabooks, wearable devices (e.g., smartwatches, smart glasses, HMDs), digital TVs, desktop computers, digital signage, etc.

[0326] Each server within the above content streaming system can be operated as a distributed server, in which case data received from each server can be processed in a distributed manner.

[0327] The claims set forth in this specification may be combined in various ways. For example, the technical features of the method claims of this specification may be combined and implemented as a device, and the technical features of the device claims of this specification may be combined and implemented as a method. Furthermore, the technical features of the method claims and the technical features of the device claims of this specification may be combined and implemented as a device, and the technical features of the method claims and the technical features of the device claims of this specification may be combined and implemented as a method.

Claims

1. In a video decoding method performed by a decoding device, A step of obtaining prediction-related information and residual-related information for the current block; A step of deriving transformation coefficients for the current block based on the residual-related information; and A step of generating residual samples of the current block based on the above transformation coefficients is included, The above residual-related information includes LFNST (Low Frequency Non Separable Transform) index information indicating information about a non-separable transform for low-frequency transform coefficients of the current block based on a MIP (Matrix based Intra Prediction) flag, The step of generating the above residual samples is: A step of deriving modified transform coefficients from the transform coefficients based on the LFNST index information; and A step of generating the residual samples based on the modified transformation coefficients is included, The above MIP flag indicates whether MIP is applied to the current block, A video decoding method, characterized in that the above MIP flag is included in the above prediction-related information.

2. In paragraph 1, A video decoding method, characterized in that the residual related information includes the LFNST index information based on the MIP flag indicating that the MIP is not applied.

3. In paragraph 1, Based on the MIP flag indicating that the MIP is applied, the residual related information does not include the LFNST index information, A video decoding method, characterized in that the LFNST index information is derived based on at least one of reference line index information for the current block, intra prediction mode information of the current block, size information of the current block, and the MIP flag.

4. In paragraph 1, Based on the MIP flag indicating that the MIP is not applied, the LFNST index information is derived through TR (Truncated Rice) based binarization, An image decoding method, characterized in that the LFNST index information is derived through FL (Fixed Length)-based binarization based on the MIP flag indicating that the MIP is applied.

5. In paragraph 1, An image decoding method, characterized in that the LFNST index information includes an LFNST flag indicating whether a non-separable transform is applied to low-frequency transform coefficients of the current block and a transform kernel index flag indicating a transform kernel applied to the current block among transform kernel candidates.

6. In paragraph 5, A video decoding method, characterized in that the transform kernel index flag is included in the LFNST index information based on the LFNST flag indicating that the non-separable transform is applied and the MIP flag indicating that the MIP is not applied.

7. In paragraph 5, An image decoding method, characterized in that the LFNST flag and the transformation kernel index flag are derived through FL (Fixed Length)-based binarization.

8. In paragraph 5, The first bin of the empty string of the LFNST flag is derived based on context coding, and the context coding is performed based on the value of the context index increment for the LFNST flag, and the value of the context index increment is derived as one of the candidates including 0 and 1, A video decoding method, characterized in that the first bin of the empty string of the above transformation kernel index flag is derived based on bypass coding.

9. In paragraph 8, A video decoding method, characterized in that the value of the context index increase or decrease is derived based on an MTS index indicating a transformation kernel set to be used for the current block among transformation kernel sets and tree type information indicating a division structure of the current block.

10. In paragraph 5, Based on the MIP flag indicating that the MIP is applied, the residual related information does not include the LFNST flag and the transformation kernel index flag, A video decoding method, characterized in that the LFNST flag and the transformation kernel index flag are derived based on at least one of reference line index information for the current block, intra prediction mode information of the current block, size information of the current block, and the MIP flag.

11. In paragraph 1, The above prediction related information further includes ISP (Intra Sub-Partitions) related information regarding sub-partitioning of the current block, A video decoding method, characterized in that the residual related information includes the LFNST index information based on the MIP flag and the ISP related information.

12. In a video encoding method performed by an encoding device, A step of determining an intra prediction mode and an intra prediction type for the current block; A step of generating prediction-related information for the current block based on the intra prediction mode and the intra prediction type; A step of deriving prediction samples of the current block based on the intra prediction mode and the intra prediction type; A step of generating residual samples of the current block based on the above prediction samples; A step of generating residual-related information for the current block based on the residual samples; and A step of encoding the above prediction-related information and the above residual-related information is included, The above residual-related information includes LFNST (Low Frequency Non Separable Transform) index information indicating information about a non-separable transform for low-frequency transform coefficients of the current block based on a MIP (Matrix based Intra Prediction) flag, The step of generating the above residual related information is: A step of deriving temporary transformation coefficients for the current block based on the residual samples; A step of deriving transform coefficients for the current block from the temporary transform coefficients; and A step of generating residual-related information based on the above conversion coefficients is included, The above LFNST index information is generated based on the transformation kernel used to derive the transformation coefficients for the current block, The above MIP flag indicates whether MIP is applied to the current block, A video encoding method, characterized in that the above MIP flag is included in the above prediction-related information.

13. In paragraph 12, A video encoding method, characterized in that the residual related information includes the LFNST index information based on the MIP flag indicating that the MIP is not applied.

14. A computer-readable digital storage medium storing encoded information that causes a decoding device to perform an image decoding method, wherein the image decoding method comprises: A step of obtaining prediction-related information and residual-related information for the current block; A step of deriving transformation coefficients for the current block based on the residual-related information; and A step of generating residual samples of the current block based on the above transformation coefficients is included, The above residual-related information includes LFNST (Low Frequency Non Separable Transform) index information indicating information about a non-separable transform for low-frequency transform coefficients of the current block based on a MIP (Matrix based Intra Prediction) flag, The step of generating the above residual samples is: A step of deriving modified transform coefficients from the transform coefficients based on the LFNST index information; and A step of generating the residual samples based on the modified transformation coefficients is included, The above MIP flag indicates whether MIP is applied to the current block, A computer-readable digital storage medium, characterized in that the above MIP flag is included in the above prediction-related information.