Transform-based image coding method and apparatus

By applying LFNST to sub-partition blocks in image coding, the method improves compression efficiency for high-resolution and immersive media, addressing the need for cost-effective transmission and storage of high-quality images/videos.

JP2026043002APending Publication Date: 2026-03-11LG ELECTRONICS INC
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2026-01-13
Publication Date
2026-03-11

AI Technical Summary

Technical Problem

The increasing demand for high-resolution and high-quality images/videos, particularly in immersive media like VR and AR, necessitates a highly efficient image/video compression technique to reduce transmission and storage costs.

Method used

An image coding method utilizing Linear Frequency Division Transform (LFNST) is applied to sub-partition blocks, with modified transform coefficients derived based on an LFNST index, allowing for improved coding efficiency by parsing the LFNST index without requiring a first variable for certain block configurations.

Benefits of technology

This approach enhances overall image/video compression efficiency and transform index coding, particularly in high-resolution and immersive media applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2026043002000001_ABST
    Figure 2026043002000001_ABST
Patent Text Reader

Abstract

This document relates to image coding techniques. [Solution] The image decoding method according to the present document may include a step of deriving modified transform coefficients, the step of deriving the modified transform coefficients including a step of determining whether the transform coefficients exist in a second region excluding a first region at the top left corner of the current block, a step of parsing an LFNST index based on the determination result, and a step of deriving the modified transform coefficients based on the LFNST index and an LFNST matrix, wherein the current block is divided into a plurality of sub-partition blocks, and the LFNST index may be parsed based on the fact that the transform coefficients do not exist in any of the second regions individually for the plurality of sub-partition blocks.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

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

[0002] In recent years, the demand for high-resolution, high-quality images / videos, such as 4K or 8K or higher UHD (Ultra High Definition) images / videos, has been increasing in various fields. As the resolution and quality of image / video data increases, the amount of information or bits to be transmitted increases relatively compared to existing image / video data. Therefore, when transmitting image data using existing media such as wired or wireless broadband lines or storing image / video data using existing storage media, transmission costs 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 in recent years, and the broadcast of images / videos with different image characteristics from real images, such as game images, has been increasing.

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

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

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

[0007] Yet another technical problem of this document is to provide an image coding method and apparatus that utilizes LFNST.

[0008] Another technical problem of this document is to provide a video coding method and apparatus for applying LFNST to sub-partition blocks. [Means for solving the problem]

[0009] According to an embodiment of the present document, there is provided an image decoding method performed by a decoding device, the method may include deriving modified transform coefficients, the deriving the modified transform coefficients may include determining whether the transform coefficients exist in a second region excluding a first region at an upper left corner of the current block, parsing an LFNST index based on the determination result, and deriving the modified transform coefficients based on the LFNST index and an LFNST matrix, wherein the current block may be divided into a plurality of sub-partition blocks, and the LFNST index may be parsed based on the fact that the transform coefficients do not exist in any of the second regions individually for the plurality of sub-partition blocks.

[0010] If the current block is not divided into the plurality of sub-partition blocks and the transform coefficients do not exist in the second region, the LFNST index can be parsed.

[0011] The current block is a coding block, and if the width and height of each sub-partition block are four or more, the LFNST index for the current block can be applied to the sub-partition blocks.

[0012] If the divided sub-partition block is a 4x4 block or an 8x8 block, the LFNST may be applied to the first eight transform coefficients from the upper left corner of the current block in the scanning direction.

[0013] The step of deriving the modified transform coefficients may further include the step of deriving a first variable indicating whether the transform coefficients exist in an area excluding a DC position of the current block, and the LFNST index may be parsed if the first variable indicates that the transform coefficients exist in an area excluding the DC position.

[0014] Based on the division of the current block into a plurality of sub-partition blocks, the LFNST index can be parsed without deriving the first variable.

[0015] If the sub-partition block is not a 4x4 block or an 8x8 block, the LFNST may be applied to the transform coefficients of the 4x4 region at the top left corner of the sub-partition block.

[0016] According to one embodiment of the present document, there is provided an image encoding method to be performed by an encoding device, the method comprising the steps of: deriving transform coefficients for the current block based on a linear transform on residual samples;

[0017] The present invention can include the steps of: deriving modified transform coefficients for the current block based on the transform coefficients of a first region in the upper left corner of the current block and a predetermined LFNST matrix; zeroing out a second region of the current block where the modified transform coefficients do not exist; dividing the current block into a plurality of sub-partition blocks and configuring image information such that the LFNST index is signaled based on the zeroing out of all of the plurality of sub-partition blocks; and outputting the image information including residual information derived through quantization of the modified transform coefficients and the LFNST index.

[0018] According to yet another embodiment of the present document, a digital storage medium may be provided that stores encoded image information generated according to an image encoding method performed by an encoding device, and image data including a bitstream.

[0019] According to yet another embodiment of the present document, a digital storage medium may be provided that stores encoded image information and image data including a bitstream that causes a decoding device to perform the image decoding method. [Effects of the Invention]

[0020] This document can improve the overall image / video compression efficiency.

[0021] This document can improve the efficiency of transform index coding.

[0022] Yet another technical object of this document is to provide an image coding method and apparatus utilizing LFNST.

[0023] Another technical object of this document is to provide a video coding method and apparatus for applying LFNST to sub-partition blocks.

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

[0025] [Figure 1] 1 is a diagram illustrating the configuration of a video / image encoding device to which this document can be applied; [Figure 2] 1 is a diagram illustrating the configuration of a video / image decoding device to which this document can be applied. [Figure 3] 1 illustrates a schematic diagram of a multiple conversion technique according to an embodiment of the present document; [Figure 4] An intra-directional mode with 65 prediction directions is shown as an example. [Figure 5] FIG. 1 is a diagram for explaining an RST according to one embodiment of this document. [Figure 6] 10 is a diagram illustrating an example of an order in which output data of a forward linear transform is arranged in a one-dimensional vector. FIG. [Figure 7] 10 is a diagram illustrating an example of an order in which output data of a forward quadratic transform is arranged in two-dimensional blocks. [Figure 8] FIG. 10 is a diagram showing a block shape to which LFNST is applied. [Figure 9] FIG. 10 is a diagram showing an example of the arrangement of output data from a forward LFNST. [Figure 10] FIG. 10 is a diagram showing an example in which the number of output data items for a forward LFNST is limited to a maximum of 16. [Figure 11] FIG. 10 is a diagram illustrating zeroing out in a block to which 4×4 LFNST is applied, according to an example. [Figure 12] FIG. 10 is a diagram illustrating zeroing out in a block to which 8×8 LFNST is applied, according to an example. [Figure 13] FIG. 10 is a diagram illustrating zeroing out in a block to which 8×8 LFNST is applied according to another example. [Figure 14] FIG. 10 is a diagram illustrating an example of sub-blocks into which one coding block is divided. [Figure 15] FIG. 10 is a diagram illustrating another example of sub-blocks into which one coding block is divided. [Figure 16] FIG. 10 illustrates symmetry between an M×2 (M×1) block and a 2×M (1×M) block according to an example. [Figure 17] FIG. 10 is a diagram illustrating an example in which a 2×M block is transposed. [Figure 18] 1 shows an example scanning order for an 8x2 or 2x8 region. [Figure 19] FIG. 10 is a diagram illustrating a sampled LFNST kernel in an ISP mode according to an example. [Figure 20] FIG. 10 is a diagram illustrating an example of an image decoding method. [Figure 21] FIG. 1 is a diagram illustrating an example of an image encoding method. [Figure 22] 1 illustrates schematically an example of a video / image coding system to which this document may be applied; [Figure 23] 1 illustrates an exemplary structural diagram of a content streaming system to which this document applies. DETAILED DESCRIPTION OF THE INVENTION

[0026] Although this document may be modified in various ways and may have various embodiments, specific embodiments will be illustrated in the drawings and described in detail. However, this is not intended to limit this document to the specific embodiment. Common terms used in this specification are used merely to describe specific embodiments and are not intended to limit the technical ideas of this document. A singular expression includes a plural expression unless the context clearly indicates otherwise. In this specification, terms such as "comprise" or "have" are intended to specify the presence of features, numbers, steps, operations, components, parts, or combinations thereof described in the specification, and should be understood not to preclude the possibility of the presence or addition of one or more different features, numbers, steps, operations, components, parts, or combinations thereof.

[0027] Meanwhile, each component in the drawings described in this document is shown independently for the convenience of explaining the different characteristic functions, and does not mean that each component is realized by separate hardware or software. For example, two or more components 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.

[0028] Hereinafter, preferred embodiments of the present invention will be described in more detail with reference to the accompanying drawings. Hereinafter, the same reference numerals will be used to refer to the same components in the drawings, and redundant description of the same components will be omitted.

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

[0030] This document presents various embodiments relating to video / image coding, which may be implemented in combination with one another unless otherwise stated.

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

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

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

[0034] In this document, the terms " / " and "," should be interpreted to mean "and / or." For example, "A / B" means "A and / or B," and "A, B" means "A and / or B." Furthermore, "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.")

[0035] Furthermore, in this document, "or" should be interpreted as "and / or." For example, "A or B" may mean 1) only "A," 2) only "B," or 3) "A and B." In other words, "or" in this document may mean "additionally or alternatively." (Further, 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.")

[0036] As used herein, "at least one of A and B" can mean "only A," "only B," or "both A and B." Furthermore, as used herein, the expressions "at least one of A or B" and "at least one of A and / or B" can be interpreted in the same way as "at least one of A and B."

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

[0038] Furthermore, parentheses used herein may mean "for example." Specifically, when "prediction (intra prediction)" is displayed, "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, when "prediction (i.e., intra prediction)" is displayed, "intra prediction" may be suggested as an example of "prediction."

[0039] Technical features individually described in one drawing in this specification may be implemented individually or simultaneously.

[0040] 1 is a diagram illustrating the configuration of a video / image encoding device to which this document can be applied. Hereinafter, the term "video encoding device" may include an image encoding device.

[0041] Referring to FIG. 1, the encoding device 100 may include an image partitioner 110, a predictor 120, a residual processor 130, an entropy encoder 140, an adder 150, a filter 160, and a memory 170. The predictor 120 may include an inter predictor 121 and an intra predictor 122. The residual processor 130 may include a transformer 132, a quantizer 133, a dequantizer 134, and an inverse transformer 135. The residual processor 130 may further include a subtractor 131. The adder 150 may be referred to as a reconstructor or a reconstructed block generator. The image dividing unit 110, the predicting unit 120, the residual processing unit 130, the entropy encoding unit 140, the adding unit 150, and the filtering unit 160 may be configured by one or more hardware components (e.g., an encoder chipset or a processor) depending on the embodiment. Also, the memory 170 may include a decoded picture buffer (DPB) and may be configured by a digital storage medium. The hardware components may further include the memory 170 as an internal / external component.

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

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

[0044] The encoding apparatus 100 may subtract a prediction signal (predicted block, prediction sample array) output from the inter prediction unit 121 or the intra prediction unit 122 from an input image signal (original block, original sample array) to generate a residual signal (residual block, residual sample array), and the generated residual signal is transmitted to the conversion unit 132. In this case, as shown in the figure, a unit in the encoding apparatus 100 that subtracts a prediction signal (predicted block, prediction sample array) from an input image signal (original block, original sample array) may be referred to as a subtraction unit 131. The prediction unit may perform prediction on a current 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 may determine whether intra prediction or inter prediction is applied on a current block or CU basis. The prediction unit may generate various information related to prediction, such as prediction mode information, and transmit the information to the entropy encoding unit 140, as will be described later in the description of each prediction mode. The prediction information can be encoded by the entropy encoding unit 140 and output in the form of a bitstream.

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

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

[0047] The predictor 120 may generate a prediction signal based on various prediction methods, which will be described later. For example, the predictor may apply intra prediction or inter prediction for predicting a block, or may simultaneously apply intra prediction and inter prediction. This may be referred to as combined inter and intra prediction (CIIP). The predictor may also use intra block copy (IBC) prediction mode or palette mode for predicting a block. The IBC prediction mode or palette mode may be used for content image / video coding, such as games, such as screen content coding (SCC). IBC basically performs prediction within a current picture, but may be similar to inter prediction in that it derives a reference block within the current picture. That is, IBC may utilize at least one of the inter prediction techniques described herein. The palette mode may be considered an example of intra coding or intra prediction. When the palette mode is applied, sample values ​​within a picture may be signaled based on information related to a palette table and a palette index.

[0048] The prediction signal generated by the prediction unit (including the inter prediction unit 121 and / or the intra prediction unit 122) may be used to generate a reconstructed signal or a residual signal. The transform unit 132 may generate transform coefficients by applying a transform technique to the residual signal. For example, the transform technique may include at least one of a discrete cosine transform (DCT), a discrete sine transform (DST), a Karhunen-Loeve transform (KLT), a graph-based transform (GBT), or a conditionally non-linear transform (CNT). Here, GBT refers to a transform obtained from a graph representing inter-pixel relationship information. CNT refers to a transform obtained based on a prediction signal generated using all previously reconstructed pixels. In addition, the transform process may be applied to pixel blocks having the same square size, or to non-square blocks of variable size.

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

[0050] The quantized transform coefficients output from the quantization unit 133 may be used to generate a prediction signal. For example, a residual signal (residual block or residual sample) may be reconstructed by applying inverse quantization and inverse transform to the quantized transform coefficients via the inverse quantization unit 134 and the inverse transform unit 135. The adder 155 may generate a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample array) by adding the reconstructed residual signal to the prediction signal output from the inter prediction unit 121 or the intra prediction unit 122. When there is no residual for the current block, such as when skip mode is applied, a predicted block may be used as the reconstructed block. The adder 150 may be referred to as a reconstruction unit or a reconstructed block generator. The generated reconstructed signal may be used for intra prediction of the next block to be processed in the current picture, or may be used for inter prediction of the next picture after filtering, as described below.

[0051] Meanwhile, luma mapping with chroma scaling (LMCS) can be applied during picture encoding and / or reconstruction.

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

[0053] The modified reconstructed picture transmitted to the memory 170 can be used as a reference picture in the inter prediction unit 121. When inter prediction is applied through this, the encoding device can avoid a mismatch in prediction between the encoding device 100 and the decoding device, and can also improve coding efficiency.

[0054] The DPB of the memory 170 may store a modified reconstructed picture for use as a reference picture in the inter predictor 121. The memory 170 may store motion information of a block from which motion information in the current picture is derived (or encoded) and / or motion information of a block in an already reconstructed picture. The stored motion information may be transmitted to the inter predictor 121 to be used as motion information of a spatially neighboring block or a temporally neighboring block. The memory 170 may store reconstructed samples of reconstructed blocks in the current picture and transmit them to the intra predictor 122.

[0055] FIG. 2 is a diagram for explaining the outline of the configuration of a video / image decoding device to which this document can be applied.

[0056] Referring to FIG. 2, the decoding device 200 may be configured to include an entropy decoder 210, a residual processor 220, a predictor 230, an adder 240, a filter 250, and a memory 260. The predictor 230 may include an inter predictor 231 and an intra predictor 232. The residual processor 220 may include a dequantizer 221 and an inverse transformer 222. The entropy decoder 210, the residual processor 220, the predictor 230, the adder 240, and the filter 250 may be configured as a single hardware component (e.g., a decoder chipset or processor) according to an embodiment. The memory 260 may include a decoded picture buffer (DPB) and may be configured as a digital storage medium. The hardware components may further include a memory 260 as an internal / external component.

[0057] When a bitstream including video / image information is input, the decoding device 200 can reconstruct an image corresponding to the process by which the video / image information was processed by the encoding device of FIG. 2. For example, the decoding device 200 can derive units / blocks based on information about block division obtained from the bitstream. The decoding device 200 can perform decoding using the processing units applied by the encoding device. Therefore, the processing unit for decoding may be, for example, a coding unit, and the coding unit may be divided from a coding tree unit or a maximal coding unit according to a quad tree structure, a binary tree structure, and / or a ternary tree structure. One or more transform units may be derived from the coding unit. The reconstructed image signal decoded and output by the decoding device 200 can be reproduced by a playback device.

[0058] The decoding device 200 may receive a signal output from the encoding device of FIG. 1 in the form of a bitstream, and the received signal may be decoded via the entropy decoding unit 210. For example, the entropy decoding unit 210 may 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). The video / image information may also include general constraint information. The decoding device may further decode pictures based on the information on the parameter sets and / or the general constraint information. Signaling / received information and / or syntax elements, which will be described later in this document, may be decoded via the decoding procedure and obtained from the bitstream. For example, the entropy decoding unit 210 may decode information in a bitstream based on a coding method such as Exponential-Golomb coding, CAVLC, or CABAC, and output values ​​of syntax elements required for image restoration, quantized values ​​of transform coefficients related to residuals, etc. More specifically, the CABAC entropy decoding method receives bins corresponding to each syntax element in the bitstream, determines a context model using information on the syntax element to be decoded and decoded information on neighboring and current blocks, or information on symbols / bins decoded in previous steps, predicts the occurrence probability of the bins based on the determined context model, and performs arithmetic decoding of the bins to generate symbols corresponding to the values ​​of each syntax element. After determining the context model, the CABAC entropy decoding method may update the context model using information on the decoded symbols / bins for the context model of the next symbol / bin.Among the information decoded by the entropy decoding unit 210, information related to prediction is provided to a prediction unit (inter prediction unit 232 and intra prediction unit 231), and residual values ​​entropy decoded by the entropy decoding unit 210, i.e., quantized transform coefficients and related parameter information, may be input to the residual processing unit 220. The residual processing unit 220 may derive a residual signal (residual block, residual sample, residual sample array). In addition, among the information decoded by the entropy decoding unit 210, information related to filtering may be provided to the filtering unit 250. Meanwhile, a receiving unit (not shown) that receives a signal output from the encoding device may be further configured as an internal / external element of the decoding device 200, or the receiving unit may be a component of the entropy decoding unit 210. Meanwhile, the decoding device according to this document may be referred to as a video / image / picture decoding device, and the decoding device may be divided into an information decoder (video / image / picture information decoder) and a sample decoder (video / image / picture sample decoder). The information decoder may include the entropy decoding unit 210, and the sample decoder may include at least one of the inverse quantization unit 221, the inverse transform unit 222, the addition unit 240, the filtering unit 250, the memory 260, the inter prediction unit 232, and the intra prediction unit 231.

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

[0060] The inverse transform unit 222 performs inverse transform on the transform coefficients to obtain a residual signal (residual block, residual sample array).

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

[0062] The predictor 220 may generate a prediction signal based on various prediction methods, which will be described later. For example, the predictor may apply intra prediction or inter prediction for predicting a block, or may simultaneously apply intra prediction and inter prediction. This may be referred to as combined inter and intra prediction (CIIP). The predictor may also use an intra block copy (IBC) prediction mode or a palette mode for predicting a block. The IBC prediction mode or palette mode may be used for content image / video coding, such as games, such as screen content coding (SCC). IBC basically performs prediction within a current picture, but may be similar to inter prediction in that a reference block is derived within the current picture. That is, IBC may utilize at least one of the inter prediction techniques described herein. The palette mode may be considered an example of intra coding or intra prediction. When the palette mode is applied, information regarding a palette table and a palette index may be included in the video / image information and signaled.

[0063] The intra prediction unit 231 may predict a current block by referring to samples in a current picture. The referenced samples may be located in the neighborhood of the current block or may be located far away from the current block depending on the prediction mode. Prediction modes in intra prediction may include a plurality of non-directional modes and a plurality of directional modes. The intra prediction unit 231 may also determine a prediction mode to be applied to the current block using prediction modes applied to neighboring blocks.

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

[0065] The adder 240 can generate a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample array) by adding the acquired residual signal to a prediction signal (predicted block, predicted sample array) output from a prediction unit (including the inter prediction unit 232 and / or the intra prediction unit 231). When there is no residual for the current block, such as when a skip mode is applied, the predicted block can be used as a reconstructed block.

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

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

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

[0069] The (modified) reconstructed picture stored in the DPB of the memory 260 can be used as a reference picture in the inter predictor 232. The memory 260 can store motion information of a block from which motion information in the current picture is derived (or decoded) and / or motion information of a block in an already reconstructed picture. The stored motion information can be transmitted to the inter predictor 232 to be used as motion information of a spatially neighboring block or a temporally neighboring block. The memory 260 can store reconstructed samples of reconstructed blocks in the current picture and transmit them to the intra predictor 231.

[0070] In this document, the embodiments described for the filtering unit 160, inter prediction unit 121, and intra prediction unit 122 of the encoding device 100 can also be applied identically or correspondingly to the filtering unit 250, inter prediction unit 232, and intra prediction unit 231 of the decoding device 200, respectively.

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

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

[0073] FIG. 3 shows a schematic diagram of the multiple transformation technique according to this document.

[0074] Referring to Figure 3, the transform unit may correspond to the transform unit in the encoding device of Figure 1 described above, and the inverse transform unit may correspond to the inverse transform unit in the encoding device of Figure 1 described above or the inverse transform unit in the decoding device of Figure 3.

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

[0076] The multi-kernel transform may refer to a transform method further using a Discrete Cosine Transform (DCT) type 2, a Discrete Sine Transform (DST) type 7, a DCT type 8, and / or a DST type 1. That is, the multi-kernel transform may refer to a transform method for transforming a spatial domain residual signal (or a residual block) into frequency domain transform coefficients (or first-order transform coefficients) based on a plurality of transform kernels selected from the DCT type 2, the DST type 7, the DCT type 8, and the DST type 1. Here, the first-order transform coefficients may be referred to as tentative transform coefficients from the perspective of a transform unit.

[0077] In other words, when an existing transform method is applied, a spatial-domain to frequency-domain transform is applied to a residual signal (or residual block) based on DCT type 2 to generate transform coefficients. In contrast, when the multi-kernel transform is applied, a spatial-domain to frequency-domain transform is applied to a residual signal (or residual block) based on DCT type 2, DST type 7, DCT type 8, and / or DST type 1, etc. to generate transform coefficients (or primary transform coefficients). Here, DCT type 2, DST type 7, DCT type 8, DST type 1, etc. may be referred to as transform types, transform kernels, or transform cores. Such DCT / DST transform types may be defined based on basis functions.

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

[0079] Also, according to one example, when a linear transform is performed by applying MTS, a specific basis function is set to a predetermined value, and when it is a vertical transform or a horizontal transform, a mapping relationship for the transform kernel can be set by combining which basis function is applied or not. For example, if the horizontal transform kernel is represented by trTypeHor and the vertical transform kernel is represented by trTypeVer, a value of 0 for trTypeHor or trTypeVer can be set to DCT2, a value of 1 for trTypeHor or trTypeVer can be set to DCT7, and a value of 2 for trTypeHor or trTypeVer can be set to DCT8.

[0080] In this case, MTS index information can be encoded and signaled to a decoding device to indicate one of a number of transform kernel sets. For example, an MTS index of 0 can indicate that the values ​​of trTypeHor and trTypeVer are all 0, an MTS index of 1 can indicate that the values ​​of trTypeHor and trTypeVer are all 1, an MTS index of 2 can indicate that the value of trTypeHor is 2 and the value of trTypeVer is 1, an MTS index of 3 can indicate that the value of trTypeHor is 1 and the value of trTypeVer is 2, and an MTS index of 4 can indicate that the values ​​of trTypeHor and trTypeVer are all 2.

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

[0082] [Table 1]

[0083] The transform unit performs a secondary transform on the (primary) transform coefficients to derive modified (secondary) transform coefficients (S320). The primary transform is a transform from the spatial domain to the frequency domain, and the secondary transform refers to a conversion to a more compressed representation using correlations existing between the (primary) transform coefficients. The secondary transform includes a non-separable transform. In this case, the secondary transform may be referred to as a non-separable secondary transform (NSST) or a mode-dependent non-separable secondary transform (MDNSST). The non-separable secondary transform refers to a transform that generates modified transform coefficients (or secondary transform coefficients) for a residual signal by performing a secondary transform on the (primary) transform coefficients derived by the primary transform based on a non-separable transform matrix. Here, a transform can be applied to the (primary) transform coefficients simultaneously without separately applying a vertical transform and a horizontal transform (or independently applying a horizontal-vertical transform) based on the non-separable transform matrix. In other words, the non-separable quadratic transform is not applied separately to the vertical and horizontal directions of the (first-order) transform coefficients, but rather, for example, rearranges a two-dimensional signal (transform coefficient) into a one-dimensional signal in a specific direction (e.g., row-first or column-first), and then generates modified transform coefficients (or second-order transform coefficients) based on the non-separable transform matrix. For example, row-major order means arranging the first row, second row, ..., Nth row in a row for an MxN block, and column-major order means arranging the first column, second column, ..., Mth column in a row for an MxN block. The non-separable quadratic transform can be applied to the top-left region of a block composed of (first-order) transform coefficients (hereinafter referred to as a transform coefficient block). For example, if the width (W) and height (H) of the transform coefficient block are both equal to or greater than 8, an 8x8 non-separable quadratic transform can be applied to the upper left 8x8 region of the transform coefficient block.Also, if the width (W) and height (H) of the transform coefficient block are both 4 or greater, but the width (W) or height (H) of the transform coefficient block is less than 8, a 4x4 non-separable quadratic transform can be applied to the upper left min(8,W) x min(8,H) region of the transform coefficient block. However, the embodiment is not limited thereto. For example, even if the only condition that the width (W) or height (H) of the transform coefficient block is 4 or greater, a 4x4 non-separable quadratic transform can be applied to the upper left min(8,W) x min(8,H) region of the transform coefficient block.

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

[0085] The 4x4 input block X can be expressed as follows:

[0086]

number

[0087] When X is expressed in the form of a vector, the vector JPEG2026043002000004.jpg1289 can be represented as follows:

[0088]

number

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

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

[0091]

number

[0092] where: JPEG2026043002000008.jpg11100 denotes the transform coefficient vector, and T denotes the 16x16 (non-separable) transform matrix.

[0093] Through Equation 3, a 16×1 transform coefficient vector JPEG2026043002000009.jpg1096 can be derived, and JPEG2026043002000010.jpg1191 can be re-organized into 4x4 blocks via a scan order (horizontal, vertical, diagonal, etc.). However, the above calculation is an example, and in order to reduce the computational complexity of the non-separable quadratic transform, a Hypercube-Givens Transform (HyGT) or the like can also be used to calculate the non-separable quadratic transform.

[0094] Meanwhile, the non-separable quadratic transform may be mode-dependent, with the transform kernel (or transform core, transform type) being selectable, where the mode may include an intra-prediction mode and / or an inter-prediction mode.

[0095] As described above, the non-separable quadratic 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. The 8x8 transform refers to a transform that can be applied to an 8x8 region contained within the transform coefficient block when W and H are both equal to or greater than 8, and the 8x8 region may be the upper-left 8x8 region within the transform coefficient block. Similarly, the 4x4 transform refers to a transform that can be applied to a 4x4 region contained within the transform coefficient block when W and H are both equal to or greater than 4, and the 4x4 region may be the upper-left 4x4 region within the transform coefficient block. For example, an 8x8 transform kernel matrix may be a 64x64 / 16x64 matrix, and a 4x4 transform kernel matrix may be a 16x16 / 8x16 matrix.

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

[0097] However, the size of the transform, i.e., the size of the region to which the transform is applied, may be other than, for example, 8x8 or 4x4, the number of sets may be n, and the number of transform kernels in each set may be k.

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

[0099] For reference, for example, the intra prediction modes may include two non-directional (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 merely an example, and this document may also be applied to cases where the number of intra prediction modes is different. Meanwhile, an intra prediction mode numbered 67 may also be used depending on the case, and the 67th intra prediction mode may indicate a linear model (LM) mode.

[0100] FIG. 4 exemplarily shows the intra-directional modes of 65 prediction directions.

[0101] Referring to FIG. 4, intra prediction modes can be classified into those with horizontal directionality and those with vertical directionality, centered on the 34th intra prediction mode, which has a prediction direction on the lower right diagonal. In FIG. 4, H and V represent horizontal and vertical directionality, respectively, and the numbers -32 to 32 indicate displacements in 1 / 32 units on the sample grid position. This may indicate an offset to the mode index value. The 2nd to 33rd intra prediction modes have horizontal directionality, while the 34th to 66th intra prediction modes have vertical directionality. Meanwhile, the 34th intra prediction mode can be considered neither horizontal nor vertical, strictly speaking, but can be classified as belonging to the horizontal direction from the perspective of determining a transform set for a secondary transform. This is because input data is transposed for vertical modes symmetrical with respect to the 34th intra prediction mode, and the 34th intra prediction mode uses the same input data alignment method as the horizontal mode. Transposing the input data means that for an MxN two-dimensional block of data, rows become columns and columns become rows, creating NxM data. The 18th and 50th intra prediction modes indicate a horizontal intra prediction mode and a vertical intra prediction mode, respectively. The 2nd intra prediction mode predicts in the upper right direction using a reference pixel on the left, so it can be called an upper right diagonal intra prediction mode. In the same context, the 34th intra prediction mode can be called a lower right diagonal intra prediction mode, and the 66th intra prediction mode can be called a lower left diagonal intra prediction mode.

[0102] For example, depending on the intra prediction mode, the mapping of the four transform sets may be shown as in the following table.

[0103] [Table 2]

[0104] As shown in Table 2, one of four transform sets, ie, lfnstTrSetIdx, can be mapped to any of 0 to 3, ie, 4, depending on the intra prediction mode.

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

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

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

[0108] The inverse transform unit may perform a series of steps in the reverse order of the steps performed by the transform unit described above. The inverse transform unit may receive (dequantized) transform coefficients, perform a secondary (inverse) transform to derive (primary) transform coefficients (S350), and perform a primary (inverse) transform on the (primary) transform coefficients to obtain residual blocks (residual samples) (S360). Here, the primary transform coefficients may be referred to as modified transform coefficients from the perspective of the inverse transform unit. As described above, the encoding and decoding devices may generate reconstructed blocks based on the residual blocks and predicted blocks, and generate reconstructed pictures based on the reconstructed blocks.

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

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

[0111] On the other hand, as described above, if the second-order (inverse) transform is omitted, the (dequantized) transform coefficients can be received and the first-order (separate) inverse transform can be performed to obtain a residual block (residual sample). As described above, the encoding device and the decoding device can generate a reconstructed block based on the residual block and the predicted block, and generate a reconstructed picture based on the reconstructed block.

[0112] On the other hand, in this paper, in order to reduce the computational complexity and memory requirements associated with non-separable secondary transforms, the RST (reduced secondary transform) can be applied, in which the size of the transformation matrix (kernel) is reduced using the concept of NSST.

[0113] Meanwhile, the coefficients constituting the transform kernels, transform matrices, and transform kernel matrices described herein, i.e., kernel coefficients or matrix coefficients, may be expressed in 8 bits. This may be one condition for implementation in decoding and encoding devices, and may reduce the memory requirements for storing the transform kernels with a reasonably acceptable performance degradation compared to existing 9-bit or 10-bit implementations. Furthermore, expressing the kernel matrix in 8 bits allows the use of smaller multipliers, making it more suitable for SIMD (Single Instruction Multiple Data) instructions used for optimal software implementation.

[0114] In this specification, RST may refer to a transformation performed on residual samples of a target block based on a transform matrix whose size is reduced by a simplification factor. When a simplified transformation is performed, the amount of calculation required during the transformation may be reduced due to the reduction in the size of the transform matrix. In other words, RST can be used to resolve issues of computational complexity that arise during the transformation of large blocks or non-separable transformations.

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

[0116] On the other hand, when the secondary inverse transform is performed based on the RST, the inverse transform unit 135 of the encoding device 100 and the inverse transform unit 222 of the decoding device 200 may include an inverse RST unit that derives modified transform coefficients based on the inverse RST for the transform coefficients, and an inverse linear transform unit that derives residual samples for the current block based on an inverse linear transform for the modified transform coefficients. The inverse linear transform refers to the inverse transform of the linear transform applied to the residual. In this document, deriving transform coefficients based on a transform may refer to deriving transform coefficients by applying the transform.

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

[0118] In this specification, the term "target block" may refer to a current block, a residual block, or a transform block on which coding is performed.

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

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

[0121] The size of the simplified transformation matrix according to one embodiment is RxN, which is smaller than the size NxN of the normal transformation matrix, and can be defined as Equation 4 below.

[0122]

number

[0123] The matrix T in the Reduced Transform block shown in (a) of FIG. 5 is the matrix T in Equation 4. RxN As shown in FIG. 5(a), the simplified transformation matrix T RxN When multiplied by , the transform coefficients for the current block can be derived.

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

[0125] In this document, a matrix operation can be understood as an operation in which a matrix is ​​placed to the left of a column vector and multiplied by the column vector to obtain the column vector.

[0126]

number

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

[0128]

number

[0129] The calculation result of Equation 6 is the transform coefficients c1 to c2 for the target block. R That is, when R=16, the transform coefficients c1 to c2 for the target block can be derived. 16can be derived. If a regular transform, rather than RST, were applied and a transform matrix of size 64x64 (NxN) were multiplied by residual samples of size 64x1 (Nx1), 64 (N) transform coefficients for the current block would be derived. However, because RST is applied, only 16 (R) transform coefficients for the current block are derived. Since the total number of transform coefficients for the current block is reduced from N to R and the amount of data transmitted from encoding device 100 to decoding device 200 is reduced, the transmission efficiency between encoding device 100 and decoding device 200 can be increased.

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

[0131] In one embodiment, the transform unit 132 of the encoding device 100 may derive transform coefficients for the current block by performing a primary transform and an RST-based secondary transform on residual samples for the current block. These transform coefficients may be transmitted to an inverse transform unit 222 of the decoding device 200, and the inverse transform unit 222 of the decoding device 200 may derive modified transform coefficients based on an inverse reduced secondary transform (RST) on the transform coefficients and derive residual samples for the current block based on an inverse primary transform on the modified transform coefficients.

[0132] Inverse RST matrix T according to one embodiment NxR The size of the simplified transformation matrix T shown in Equation 4 is NxR, which is smaller than the size of the normal inverse transformation matrix NxN. RxNand are in a transpose relationship.

[0133] The matrix T in the Reduced Inverse Transform block shown in Figure 5(b) t is the inverse RST matrix T RxN T (The superscript T means transpose.) As shown in FIG. 5(b), the inverse RST matrix T RxN T When the inverse RST matrix T is multiplied by , the modified transform coefficients for the current block or the residual samples for the current block can be derived. RxN T is (T RxN ) T NxR It is also sometimes expressed as:

[0134] More specifically, when the inverse RST is applied to the secondary inverse transform, the inverse RST matrix T RxN T On the other hand, an inverse RST can be applied to the inverse linear transform, in which case the inverse RST matrix T RxN T When multiplied by , the residual sample for the target block can be derived.

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

[0136]

number

[0137] In Equation 7, c1 to c 16The result of the calculation of Equation 7 is r, which indicates the modified transform coefficients for the current block or the residual samples for the current block. j can be derived, and r j The derivation process is as shown in Equation 8.

[0138]

number

[0139] The calculation result of Equation 8 is r1 to r2, which indicate the modified transform coefficients for the target block or the residual samples for the target block. N can be derived. Considering the size of the inverse transformation matrix, the size of a normal inverse transformation matrix is ​​64x64 (NxN), but the size of the simplified inverse transformation matrix is ​​reduced to 64x16 (NxR). Therefore, compared to performing a normal inverse transformation, memory usage when performing inverse RST can be reduced by a ratio of R / N. Also, compared to the number of multiplication operations when using a normal inverse transformation matrix (NxN), using a simplified inverse transformation matrix can reduce the number of multiplication operations by a ratio of R / N (NxR).

[0140] Meanwhile, the transform set configuration shown in Table 2 can also be applied to an 8x8 RST. That is, the 8x8 RST can be applied according to the transform set in Table 2. Since one transform set is composed of two or three transforms (kernels) depending on the intra-frame prediction mode, it can be configured to select one of up to four transforms, including cases where a secondary transform is not applied. When a secondary transform is not applied, the transform can be considered to have been applied with an identity matrix. If the four transforms are assigned indices 0, 1, 2, and 3 (for example, index 0 can be assigned to the identity matrix, i.e., when a secondary transform is not applied), a syntax element called a transform index or an lfnst index can be signaled for each block of transform coefficients to specify the transform to be applied. That is, for an 8x8 upper left block, an 8x8 RST can be specified in the RST configuration via the transform index, or an 8x8 lfnst can be specified when an LFNST is applied. The 8x8 lfnst and 8x8 RST refer to a transform that can be applied to an 8x8 region contained within a block of transform coefficients when W and H of the target block are all equal to or greater than 8, and the 8x8 region may be the upper left 8x8 region within the block of transform coefficients. Similarly, the 4x4 lfnst and 4x4 RST refer to a transform that can be applied to a 4x4 region contained within a block of transform coefficients when W and H of the target block are all equal to or greater than 4, and the 4x4 region may be the upper left 4x4 region within the block of transform coefficients.

[0141] Meanwhile, according to one embodiment of this document, during the encoding process, instead of a 16x64 transformation kernel matrix, only 48 pieces of data are selected for the 64 pieces of data constituting an 8x8 region, and a maximum 16x48 transformation kernel matrix can be applied. Here, "maximum" means that for an mx48 transformation kernel matrix that can generate m coefficients, the maximum value of m is 16. That is, when RST is performed by applying an mx48 transformation kernel matrix (m≦16) to an 8x8 region, 48 pieces of data can be input and m coefficients can be generated. When m is 16, 48 pieces of data can be input and 16 coefficients can be generated. That is, when 48 pieces of data form a 48x1 vector, the 16x1 vector can be generated by multiplying the 16x48 matrix and the 48x1 vector in order. Then, the 48 pieces of data constituting the 8x8 region can be properly arranged to form a 48x1 vector. In this case, when a matrix operation is performed by applying a maximum 16x48 transform kernel matrix, 16 modified transform coefficients are generated, and the 16 modified transform coefficients can be arranged in the upper left 4x4 area according to the scanning order, and the upper right 4x4 area and the lower left 4x4 area can be filled with 0s.

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

[0143] To summarize, when RST or LFNST is applied to an 8x8 region during the transform process, a matrix operation is performed on 48 transform coefficients in the upper left, upper right, and lower left regions of the 8x8 region, excluding the lower right region, of the transform coefficients of the 8x8 region, and a 16x48 transform kernel matrix. For the matrix operation, the 48 transform coefficients are input into a one-dimensional array. After this matrix operation, 16 modified transform coefficients are derived, and the modified transform coefficients may be arranged in the upper left region of the 8x8 region.

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

[0145] On the other hand, when the secondary inverse transform is performed based on the RST, the inverse transform unit 135 of the encoding device 100 and the inverse transform unit 222 of the decoding device 200 may include an inverse RST unit that derives modified transform coefficients based on the inverse RST for the transform coefficients, and an inverse linear transform unit that derives residual samples for the current block based on an inverse linear transform for the modified transform coefficients. The inverse linear transform refers to the inverse transform of the linear transform applied to the residual. In this document, deriving transform coefficients based on a transform may refer to deriving transform coefficients by applying the transform.

[0146] The non-separable transform (LFNST) described above will be described in detail as follows: LFNST may include a forward transform performed by an encoding device and an inverse transform performed by a decoding device.

[0147] The encoding device applies a forward primary (core) transform, and then applies a forward secondary transform using the derived result (or part of the result) as input.

[0148]

number

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

[0150] For the backward LFNST, the dimensions of the matrix G are [48x16], [48x8], [16x16], and [16x8], where the [48x8] and [16x8] matrices are submatrices obtained by sampling eight transformation basis vectors from the left side of the [48x16] and [16x16] matrices, respectively.

[0151] On the other hand, in the case of forward LFNST, the matrix G T The dimensions of are [16x48], [8x48], [16x16], and [8x16], where the [8x48] and [8x16] matrices are submatrices obtained by sampling eight transformation basis vectors from the top of the [16x48] and [16x16] matrices, respectively.

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

[0153] 6 shows an example of a sequence for arranging output data of a forward linear transform into a one-dimensional vector. The left diagrams of (a) and (b) of FIG. 6 show a sequence for creating a [48x1] vector, and the right diagrams of (a) and (b) of FIG. 6 show a sequence for creating a [16x1] vector. In the case of LFNST, the 2D data is sequentially arranged in the sequence shown in (a) and (b) of FIG. 6 to obtain a one-dimensional vector x.

[0154] The arrangement direction of the output data of the forward linear transform may be determined according to the intra prediction mode of the current block. For example, if the intra prediction mode of the current block is horizontally aligned with respect to the diagonal direction, the output data of the forward linear transform may be arranged in the order of (a) of Figure 6, and if the intra prediction mode of the current block is vertically aligned with respect to the diagonal direction, the output data of the forward linear transform may be arranged in the order of (b) of Figure 6.

[0155] As an example, an ordering different from that shown in (a) and (b) of Figures 6 can be applied, and in order to derive the same result (y vector) as when the ordering shown in (a) and (b) of Figures 6 is applied, the column vectors of matrix G can be rearranged to match that ordering. In other words, the column vectors of G can be rearranged so that each element constituting the x vector is always multiplied by the same transformation basis vector.

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

[0157] FIG. 7 is a diagram illustrating an example of an order in which output data of a forward quadratic transform is arranged in a two-dimensional block.

[0158] In the case of LFNST, the output values ​​can be arranged in a 2D block according to a predetermined scan order. Figure 7(a) shows that when the output y is a [16x1] vector, the output values ​​are arranged in 16 positions of the 2D block according to a diagonal scan order. Figure 7(b) shows that when the output y is an [8x1] vector, the output values ​​are arranged in 8 positions of the 2D block according to a diagonal scan order, and the remaining 8 positions are filled with 0. X in Figure 7(b) indicates that it is filled with 0.

[0159] As another example, depending on the configuration for performing quantization or residual coding, the order in which the output vector y is processed may be performed according to a preset order, so the output vector y may not be arranged in a 2D block as shown in Figure 7. However, in the case of residual coding, data coding may be performed in units of 2D blocks (e.g., 4x4) such as a coefficient group (CG), and in this case, data may be arranged in a specific order such as the diagonal scan order of Figure 7.

[0160] Meanwhile, the decoding device can arrange 2D data output through an inverse quantization process, etc., for inverse transformation according to a preset scanning order to form a 1D input vector y. The input vector y can be output to the input vector x according to the following equation:

[0161]

number

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

[0163] The output vector x is arranged in two-dimensional blocks in the order shown in FIG. 6 and arranged into two-dimensional data, and such two-dimensional data becomes the input data (or part of the input data) for the inverse linear transformation.

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

[0165] Inverse LFNST allows you to select one of eight [48x16] matrices or eight [16x16] matrices as the transformation matrix G. Whether to apply a [48x16] or [16x16] matrix depends on the size and shape of the block.

[0166] Also, the eight matrices may be derived from four transform sets as shown in Table 2 above, and each transform set may consist of two matrices. Which transform set to use among the four transform sets is determined depending on the intra prediction mode. More specifically, the transform set is determined based on an extended intra prediction mode value, taking into account a wide angle intra prediction mode (WAIP). Which of the two matrices constituting the selected transform set is selected is determined through index signaling. More specifically, the transmitted index value may be 0, 1, or 2, where 0 indicates that LFNST is not applied and 1 and 2 indicate one of the two transform matrices constituting the transform set selected based on the intra prediction mode value.

[0167] On the other hand, as described above, whether to apply a [48x16] matrix or a [16x16] matrix to LFNST is determined by the size and shape of the block to be transformed.

[0168] Figure 8 shows the shapes of blocks to which LFNST is applied, where (a) shows a 4x4 block, (b) shows 4x8 and 8x4 blocks, (c) shows a 4xN or Nx4 block where N is 16 or greater, (d) shows an 8x8 block, and (e) shows an MxN block where M≧8, N≧8, and N>8 or M>8.

[0169] In Fig. 8, blocks with thick frames indicate the regions to which LFNST is applied. For the blocks in Fig. 8(a) and (b), LFNST is applied to the top-left 4x4 region, and for the block in Fig. 8(c), LFNST is applied to each of the two consecutive 4x4 regions in the top-left corner. In Fig. 8(a), (b), and (c), LFNST is applied in units of 4x4 regions, so this type of LFNST will be referred to as "4x4 LFNST" below, and the transformation matrix that can be applied is a [16x16] or [16x8] matrix based on the matrix dimensions for G in Equation 9 and Equation 10.

[0170] More specifically, a [16x8] matrix is ​​applied to the 4x4 block (4x4TU or 4x4CU) in (a) of Figure 8, and a [16x16] matrix is ​​applied to the blocks in (b) and (c) of Figure 8. This is to match the worst-case computational complexity with 8 multiplications per sample.

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

[0172] A [48x8] matrix can be applied to the 8x8 block (8x8TU or 8x8CU) in Figure 8(d), and a [48x16] matrix can be applied to the 8x8 block in Figure 8(e), again to match the worst-case computational complexity to 8 multiplications per sample.

[0173] Depending on the block shape, the corresponding forward LFNST (4x4LFNST or 8x8LFNST) is applied to generate 8 or 16 output data (the y vector in Equation 9, an [8x1] or [16x1] vector). In the forward LFNST, the matrix G T Due to the characteristics of the algorithm, the number of output data is equal to or less than the number of input data.

[0174] FIG. 9 is a diagram showing an example of the arrangement of output data from a forward LFNST, showing blocks in which output data from a forward LFNST is arranged according to a block shape.

[0175] The shaded area in the upper left corner of the block shown in Figure 9 corresponds to the area where the output data of the forward LFNST is located, with locations marked with 0 indicating samples filled with 0 values, and the remaining area indicating areas that are not changed by the forward LFNST. In areas that are not changed by the LFNST, the output data of the forward linear transform remains unchanged.

[0176] As mentioned above, the dimensions of the transformation matrix applied vary depending on the block shape, and therefore the number of output data also varies. As shown in Figure 9, the output data of the forward LFNST may not fill the entire upper-left 4x4 block. In the cases of Figures 11(a) and 11(d), a [16x8] matrix and a [48x8] matrix are applied to the block indicated by the thick line or a partial area within the block, respectively, and an [8x1] vector is generated as the output of the forward LFNST. That is, according to the scan order shown in Figure 7(b), only eight output data positions are filled as shown in Figures 9(a) and 9(d), and the remaining eight positions are filled with zeros. In the case of the block to which the LFNST is applied in Figure 8(d), the two 4x4 blocks on the upper right and lower left adjacent to the upper-left 4x4 block are also filled with zeros, as shown in Figure 9(d).

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

[0178] 1) As shown in Figure 9(a), in the 4x4 block on the upper left, the 8th position in the scan order and after, that is, the 9th to 16th samples

[0179] 2) As shown in (d) and (e) of Figure 9, a [16x48] matrix or an [8x48] matrix is ​​applied to the two 4x4 blocks adjacent to the upper left 4x4 block or the second and third 4x4 blocks in the scan order.

[0180] Therefore, if non-zero data is found by checking the above 1) and 2), it is certain that the LFNST has not been applied, and signaling of the LFNST index can be omitted.

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

[0182] Since a truncated unary code is applied as the binarization method for the LFNST index, the LFNST index consists of a maximum of two bins, and the binary codes for the possible LFNST index values ​​of 0, 1, and 2 are assigned as 0, 10, and 11, respectively. In the LFNST currently adopted by VVC, context-based CABAC coding (regular coding) is applied to the first bin, and bypass coding is applied to the second bin. The total number of contexts for the first bin is two, with (DCT-2, DCT-2) applied as the primary transform pair in the horizontal and vertical directions. One context is assigned when the luma and chroma components are coded using a dual-tree type, and the other context is applied for the remaining cases. The coding of such LFNST indexes is shown in the table below.

[0183] [Table 3]

[0184] On the other hand, the following simplification method can be applied to the adopted LFNST.

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

[0186] In the case of (c) of Figure 8, 4x4 LFNST can be applied to each of the two adjacent 4x4 regions on the upper left side, generating a maximum of 32 LFNST output data. If the number of output data for forward LFNST is limited to a maximum of 16, 4x4 LFNST can be applied only to the single 4x4 region on the upper left side of a 4xN / Nx4 (N≧16) block (TU or CU), and LFNST can be applied only once to all blocks in Figure 8. This simplifies the implementation of image coding.

[0187] As an example, Figure 10 shows that the number of output data items for the forward LFNST is limited to a maximum of 16. As shown in Figure 10, when LFNST is applied to the top-left 4x4 region of a 4xN or Nx4 block where N is 16 or greater, the number of output data items for the forward LFNST is 16.

[0188] (ii) As an example, zero-out can be applied to areas where LFNST is not applied. In this document, zero-out can mean filling the values ​​of all positions belonging to a specific area with 0. In other words, zero-out can be applied to areas that remain unchanged by LFNST and retain the results of the forward linear transform. As mentioned above, LFNST is divided into 4x4 LFNST and 8x8 LFNST, so zero-out can be divided into two types ((ii)-(A) and (ii)-(B)) as follows.

[0189] (ii)-(A) When 4x4 LFNST is applied, regions to which 4x4 LFNST is not applied can be zeroed out. Figure 11 illustrates zeroing out in a block to which 4x4 LFNST is applied, according to an example.

[0190] As shown in FIG. 11, for blocks to which 4x4 LFNST is applied, i.e., for blocks (a), (b), and (c) in FIG. 9, even areas to which LFNST is not applied can be filled with 0.

[0191] On the other hand, (d) of FIG. 11 shows that when the maximum number of output data pieces of the forward LFNST is limited to 16 as in FIG. 12, zeroing out is performed on the remaining blocks to which the 4×4 LFNST is not applied.

[0192] (ii)-(B) When an 8x8 LFNST is applied, regions to which the 8x8 LFNST is not applied can be zeroed out. Figure 12 illustrates zeroing out in a block to which the 8x8 LFNST is applied, according to an example.

[0193] As shown in FIG. 12, for 8x8 blocks to which LFNST is applied, i.e., for the blocks (d) and (e) in FIG. 9, the entire area up to the area to which LFNST is not applied can be filled with 0.

[0194] (iii) The zero-out method proposed in (ii) above may change the area filled with zeros when LFNST is applied. Therefore, the zero-out method proposed in (ii) above can check whether non-zero data exists in a wider area than the LFNST method in FIG. 9.

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

[0196] Of course, even if the zero-out proposed in (ii) above is applied, it is possible to check whether non-zero data exists, just like the existing LFNST index signaling. That is, it is possible to check whether non-zero data exists for blocks filled with zeros in Figure 9 and apply LFNST index signaling. In this case, zero-out is performed only in the encoding device, and the decoding device does not assume this zero-out. In other words, it is possible to perform LFNST index parsing by checking whether non-zero data exists only in areas explicitly marked with zeros in Figure 9.

[0197] Alternatively, according to another example, zeroing out can be performed as shown in Fig. 13. Fig. 13 is a diagram showing zeroing out in an 8x8 block to which LFNST is applied, according to another example.

[0198] As shown in Figures 11 and 12, zeroing out can be applied to all areas other than the area to which LFNST is applied, or it can be applied to only a partial area as shown in Figure 13. It is also possible to apply zeroing out only to areas other than the 8x8 area in the upper left of Figure 13, and not to apply zeroing out to the 4x4 block in the lower right inside the 8x8 area in the upper left.

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

[0200] Embodiment

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

[0202] -When 4x4 LFNST is applied, zero out all areas where 4x4 LFNST is not applied → (ii)-(A)

[0203] -When 8x8 LFNST is applied, zero out all areas where 8x8 LFNST is not applied → (ii)-(B)

[0204] -After checking whether non-zero data exists in the areas filled with existing zero values ​​and in the areas filled with zeros due to additional zero-out ((ii)-(A), (ii)-(B)), signal LFNST indexing only if non-zero data does not exist → (iii)

[0205] In the above embodiment, when LFNST is applied, the area in which non-zero output data can exist is limited to the interior of the upper left 4x4 area. More specifically, in the cases of Figures 11(a) and 12(a), the 8th position in the scan order is the last position in which non-zero data can exist, and in the cases of Figures 11(b) and 11(d) and 12(b), the 16th position in the scan order (i.e., the position on the lower right side of the upper left 4x4 block) is the last position in which non-zero data can exist.

[0206] Therefore, when LFNST is applied, whether or not to signal the LFNST index can be determined after checking whether non-zero data exists at a position where the residual coding process is not allowed (a position beyond the last position).

[0207] In the case of the zero-out method proposed in (ii), the amount of data ultimately generated when both the linear transform and the LFNST are applied is reduced, thereby reducing the amount of calculation required when performing the entire transform process. In other words, when the LFNST is applied, zero-out is also applied to the forward linear transform output data present in areas where the LFNST is not applied, so there is no need to generate data for areas that will be zeroed out when performing the forward linear transform. Therefore, the amount of calculation required to generate this data can be reduced. Additional benefits of the zero-out method proposed in (ii) can be summarized as follows:

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

[0209] In particular, when (ii)-(B) is applied, the worst-case calculation amount is reduced, making the transformation process lighter. In general, a large amount of calculations is required to execute a large-size primary transformation, but when (ii)-(B) is applied, the number of data derived as the forward LFNST execution result can be reduced to 16 or less, and the effect of reducing the amount of transformation calculations increases as the overall block (TU or CU) size increases.

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

[0211] Third, it reduces the latency involved in the conversion process.

[0212] Quadratic transforms such as LFNST add computational complexity to existing linear transforms, increasing the overall latency associated with the transform execution. In particular, in the case of intra prediction, reconstruction data from neighboring blocks is used in the prediction process, so the increased latency due to quadratic transforms during encoding can lead to an increased latency until reconstruction, potentially increasing the overall latency of intra prediction encoding.

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

[0214] Meanwhile, conventional intra prediction treats a block to be coded as a single coding unit and performs coding without division. However, ISP (Intra Sub-Partitions) coding refers to dividing a block to be coded horizontally or vertically and performing intra prediction coding. In this case, coding / decoding is performed on each divided block to generate a reconstructed block, and the reconstructed block is used as a reference block for the next divided block. For example, in ISP coding, one coding block may be divided into two or four sub-blocks for coding, and in ISP, one sub-block performs intra prediction by referring to the reconstructed pixel value of the sub-block located to the left or above it. Hereinafter, the term "coding" is used as a concept that includes both encoding performed in an encoding device and decoding performed in a decoding device.

[0215] Table 4 shows the number of sub-blocks into which a block is divided according to its size when ISP is applied, and the sub-partitions divided by ISP may be called transform blocks (TUs).

[0216] [Table 4]

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

[0218] Figures 14 and 15 show examples of sub-blocks into which one coding block is divided. More specifically, Figure 14 shows an example of division when the coding block (width (W) x height (H)) is a 4x8 block or an 8x4 block, and Figure 15 shows an example of division when the coding block is not a 4x8 block, an 8x4 block, or a 4x4 block.

[0219] When ISP is applied, sub-blocks are coded sequentially, for example, horizontally or vertically, from left to right, or from top to bottom, depending on the division type. After a sub-block undergoes inverse transform and intra-prediction and is restored, the next sub-block is coded. For the leftmost or topmost sub-block, restored pixels of a previously coded coding block are referenced, as in a conventional intra-prediction method. Furthermore, if each side of a subsequent inner sub-block is not adjacent to the previous sub-block, restored pixels of a previously coded adjacent coding block are referenced, as in a conventional intra-prediction method, to derive reference pixels adjacent to that side.

[0220] In the ISP coding mode, all sub-blocks may be coded in the same intra-prediction mode, and a flag indicating whether to use ISP coding and a flag indicating which direction (horizontal or vertical) to divide are signaled. As shown in Figures 14 and 15, the number of sub-blocks can be adjusted to two or four depending on the block shape, and if the size (width x height) of one sub-block is less than 16, division into the corresponding sub-blocks can be prohibited or ISP coding itself can be restricted from being applied.

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

[0222] As mentioned above, the division direction can be either horizontal (when an M×N coding unit with horizontal and vertical lengths of M and N is divided horizontally, it is divided into two M×(N / 2) blocks, or into four M×(N / 4) blocks) or vertical (when an M×N coding unit is divided vertically, it is divided into two (M / 2)×N blocks, or into four (M / 4)×N blocks). If the division is horizontal, the partition blocks are coded from top to bottom, and if the division is vertical, the partition blocks are coded from left to right. If the partition block to be coded is divided horizontally (vertically), it can be predicted with reference to the restored pixel values ​​of the upper (left) partition block.

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

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

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

[0226] The application of LFNST to each partition block is specifically described as follows.

[0227] In one example, after applying forward LFNST to an individual partition block, only up to 16 (8 or 16) coefficients are left in the upper left 4x4 region according to the transform coefficient scan order, and then zero-out is applied to fill all remaining positions and regions with zero values.

[0228] Alternatively, as an example, if the length of one side of a partition block is 4, LFNST is applied only to the upper left 4x4 region, and if the lengths of all sides of the partition block, i.e., the width and height, are 8 or more, LFNST can be applied to the remaining 48 coefficients within the upper left 8x8 region, excluding the lower right 4x4 region.

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

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

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

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

[0233] Meanwhile, in a coding unit to which the ISP mode is applied, when the length of one side of a partition block is less than 4, an example of applying LFNST will be described below.

[0234] First, if the size of a partition block is N×2 (2×N), then LFNST can be applied to the upper left M×2 (2×M) region (where M≦N). For example, if M=8, then the upper left region is 8×2 (2×8), so the region containing 16 residual signals becomes the input for the forward LFNST, and an R×16 (R≦16) forward transform matrix can be applied.

[0235] Here, the forward LFNST matrix may be a separate additional matrix, not a matrix currently included in the VVC standard. Also, to adjust the worst-case complexity, an 8x16 matrix obtained by sampling only the top eight row vectors of a 16x16 matrix is ​​used for the conversion. The complexity adjustment method will be described in detail later.

[0236] Second, if the size of a partition block is N×1 (1×N), the LFNST can be applied to the upper left M×1 (1×M) region (where M≦N). For example, if M=16, the upper left region is 16×1 (1×16), so the region containing 16 residual signals becomes the input for the forward LFNST, and an R×16 (R≦16) forward transform matrix can be applied.

[0237] Here, the forward LFNST matrix may be a separate additional matrix that is not included in the current VVC standard. Also, for worst-case complexity control, an 8x16 matrix obtained by sampling only the top eight row vectors of a 16x16 matrix can be used for the conversion. The complexity control method will be described in detail later.

[0238] The first and second embodiments may be applied simultaneously, or only one of the two embodiments may be applied. In particular, in the case of the second embodiment, it was experimentally observed that the improvement in compression performance obtained over the existing LFNST was relatively small compared to the LFNST index signaling cost, since a one-dimensional transformation is considered in the LFNST. However, in the case of the first embodiment, a compression performance improvement similar to that obtained over the existing LFNST was observed. That is, in the case of ISP, it was experimentally confirmed that applying the LFNST for 2×N and N×2 contributes to actual compression performance.

[0239] Currently, LFNST in VVC applies symmetry between intra prediction modes. The same LFNST set is applied to bidirectional modes centered around mode 34 (prediction in the 45-degree diagonal direction from the bottom right). For example, the same LFNST set is applied to mode 18 (horizontal prediction mode) and mode 50 (vertical prediction mode). However, when applying forward LFNST to modes 35 to 66, the input data is transposed before LFNST is applied.

[0240] Meanwhile, VVC supports Wide Angle Intra Prediction (WAIP) mode, and LFNST sets are derived based on intra prediction modes modified to take WAIP mode into account. For modes extended by WAIP, the LFNST set is determined using symmetry, just as with general intra prediction direction modes. For example, mode -1 is symmetrical to mode 67, so the same LFNST set is applied, and mode -14 is symmetrical to mode 80, so the same LFNST set is applied. For modes 67 to 80, the input data is transposed before applying forward LFNST, and then the LFNST transform is applied.

[0241] In the case of LFNST applied to the upper left Mx2 (Mx1) block, the symmetry for LFNST described above cannot be applied because the block to which LFNST is applied is non-square. Therefore, instead of applying symmetry based on the intra prediction mode as in LFNST in Table 2, symmetry between the Mx2 (Mx1) block and the 2xM (1xM) block can be applied.

[0242] FIG. 16 is a diagram illustrating the symmetry between an M×2 (M×1) block and a 2×M (1×M) block according to an example.

[0243] As shown in Figure 16, mode 2 in an Mx2 (Mx1) block is symmetrical to mode 66 in a 2xM (1xM) block, so the same LFNST set can be applied to both 2xM (1xM) and Mx2 (Mx1) blocks.

[0244] In this case, to apply the LFNST set that was applied to the M×2 (M×1) block to the 2×M (1×M) block, the LFNST set is selected based on mode 2 instead of mode 66. In other words, before applying forward LFNST, the input data for the 2×M (1×M) block is transposed and then LFNST is applied.

[0245] FIG. 17 is a diagram illustrating an example in which a 2×M block is transposed.

[0246] Figure 17(a) illustrates that LFNST can be applied to a 2xM block by reading input data in column-first order, while Figure 17(b) illustrates that LFNST can be applied to an Mx2 (Mx1) block by reading input data in row-first order. The method of applying LFNST to the upper left Mx2 (Mx1) or 2xM (Mx1) block can be summarized as follows:

[0247] 1. First, construct an input vector for the forward LFNST by arranging input data as shown in (a) and (b) of Figure 17. For example, referring to Figure 16, for an Mx2 block predicted in mode 2, the input data is arranged in the order shown in (b) of Figure 17, and for a 2xM block predicted in mode 66, the input data is arranged in the order shown in (a) of Figure 17, and then the LFNST set for mode 2 can be applied.

[0248] 2. For an Mx2 (Mx1) block, the LFNST set is determined based on the modified intra prediction mode that takes WAIP into consideration. As described above, there is a predefined mapping relationship between the intra prediction mode and the LFNST set, which can be represented as a mapping table, as shown in Table 2.

[0249] For a 2×M (1×M) block, a mode symmetrical about a 45-degree diagonal prediction mode (mode 34 in the VVC standard) is found from the intra prediction modes modified in consideration of WAIP, and then the LFNST set is determined based on the symmetric mode and a mapping table. The mode (y) symmetrical about mode 34 is derived as follows: The mapping table will be described in more detail below.

[0250]

number

[0251] 3. When applying forward LFNST, the input data prepared in step 1 is multiplied by the LFNST kernel to derive the transform coefficients. The LFNST kernel is selected from the LFNST set determined in step 2 and the pre-specified LFNST index.

[0252] For example, when M=8 and a 16×16 matrix is ​​applied as the LFNST kernel, the matrix is ​​multiplied by 16 input data to generate 16 transform coefficients, which are arranged in the upper left 8×2 or 2×8 region according to the scan order used in the VVC standard.

[0253] FIG. 18 is a diagram illustrating the scan order for an 8×2 or 2×8 region according to an example.

[0254] Areas other than the upper left 8x2 or 2x8 area may be filled with zeros (zero-out) or the existing transform coefficients to which the first-order transform has been applied may be maintained as they are. The pre-specified LFNST index may be one of the LFNST index values ​​(0, 1, 2) that is tried when calculating the RD cost while changing the LFNST index value during the encoding process.

[0255] In the case of a configuration in which the worst-case computational complexity is adjusted to a certain level or less (e.g., 8 multiplications / sample), for example, only the top eight rows of the 16x16 matrix are multiplied by an 8x16 matrix to generate only eight transform coefficients, and then the eight transform coefficients may be arranged in the scan order shown in Figure 18, and zero-out may be applied to the remaining coefficient area. Adjustment of the worst-case complexity will be described later.

[0256] 4. When applying the reverse LFNST, a preset number of transform coefficients (e.g., 16) are used as an input vector, and an LFNST kernel (e.g., a 16x16 matrix) derived from the LFNST set obtained in step 2 and the parsed LFNST index is selected. The LFNST kernel is then multiplied by the input vector to derive the output vector.

[0257] In the case of an M×2 (M×1) block, the output vectors are arranged in row-major order as shown in (b) of Figure 17, and in the case of a 2×M (1×M) block, the output vectors are arranged in column-major order as shown in (a) of Figure 17.

[0258] The remaining areas, excluding the area in which the output vector is placed within the upper left M×2 (M×1) or 2×M (M×2) area, and areas other than the upper left M×2 (M×1) or 2×M (M×2) area within the partition block, are either filled with zero values ​​(zero-out) or configured to maintain the transform coefficients restored during the residual coding and inverse quantization process as they are.

[0259] As in No. 3, when constructing an input vector, the input data is arranged according to the scan order of FIG. 18, and the number of input data can be reduced (e.g., 8 instead of 16) to keep the worst-case computational complexity below a certain level.

[0260] For example, when M=8, if eight input data are used, 16 output data can be obtained by multiplying only the left 16x8 matrix from the 16x16 matrix. The adjustment of complexity for the worst case will be described later.

[0261] In the above embodiment, symmetry is applied between an M×2 (M×1) block and a 2×M (1×M) block when applying LFNST. However, in other examples, different LFNST sets may be applied to the shapes of the two blocks.

[0262] Various examples of LFNST set configurations for ISP modes and mapping schemes using intra prediction modes are described below.

[0263] In the ISP mode, the LFNST set configuration may differ from the existing LFNST set. In other words, a kernel different from the existing LFNST kernel may be applied, and a mapping table different from the mapping table between intra-prediction mode indexes and LFNST sets currently applied in the VVC standard may be applied. The mapping table currently applied in the VVC standard is shown in Table 2.

[0264] In Table 2, the preModeIntra value indicates the intra prediction mode value modified taking WAIP into consideration, and the lfnstTrSetIdx value is an index value indicating a specific LFNST set. Each LFNST set consists of two LFNST kernels.

[0265] When the ISP prediction mode is applied, if both the horizontal and vertical lengths of each partition block are greater than or equal to 4, the same kernel as the LFNST kernel applied in the current VVC standard may be applied, and the mapping table may also be applied as is. Of course, an LFNST kernel and a mapping table different from those in the current VVC standard may also be applied.

[0266] When the ISP prediction mode is applied, if the horizontal or vertical length of each partition block is less than 4, a different LFNST kernel and a different mapping table than those currently used in the VVC standard may be applied. Tables 5 to 7 below show mapping tables between intra prediction mode values ​​(intra prediction mode values ​​modified taking WAIP into account) and LFNST sets that can be applied to M×2 (M×1) blocks or 2×M (1×M) blocks.

[0267] [Table 5]

[0268] [Table 6]

[0269] [Table 7]

[0270] The first mapping table in Table 5 consists of seven LFNST sets, the mapping table in Table 6 consists of four LFNST sets, and the mapping table in Table 7 consists of two LFNST sets. As another example, when consisting of one LFNST set, the lfnstTrSetIdx value is fixed to 0 for the preModeIntra value.

[0271] Below, we explain how to maintain the worst-case computational complexity when applying LFNST to the ISP mode.

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

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

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

[0275] For 4xN or Nx4 (N>4) blocks, when performing a forward transform, a 16x16 matrix is ​​applied only to the upper-left 4x4 block, and the resulting 16 coefficients are placed in the upper-left 4x4 region, with the remaining region filled with zeros. When performing an inverse transform, the 16 coefficients located in the upper-left 4x4 block are arranged in scan order to form an input vector, and then multiplied by a 16x16 matrix to generate 16 output data. The generated output data is placed in the upper-left 4x4 region, with the remaining region excluding the upper-left 4x4 region filled with zeros.

[0276] For 8xN or Nx8 (N>8) blocks, when performing a forward transform, a 16x48 matrix is ​​applied only to the ROI region within the upper-left 8x8 block (the remaining region from the upper-left 8x8 block excluding the lower-right 4x4 block), and the resulting 16 coefficients are placed in the upper-left 4x4 region, with the remaining regions filled with zeros. When performing an inverse transform, the 16 coefficients located in the upper-left 4x4 block are arranged in scan order to form an input vector, which is then multiplied by a 48x16 matrix to generate 48 output data. The resulting output data is filled in the ROI region, with the remaining regions filled with zeros.

[0277] 2. When the size of a partition block is N×2 or 2×N and LFNST is applied to the upper left M×2 or 2×M region (M≦N), a matrix sampled according to the N value can be applied.

[0278] When M=8, for partition blocks where N=8, i.e., 8x2 or 2x8 blocks, an 8x16 matrix obtained by sampling the top 8 rows from a 16x16 matrix is ​​applied instead of a 16x16 matrix in the forward transform, and a 16x8 matrix obtained by sampling the left 8 columns from a 16x16 matrix is ​​applied instead of a 16x16 matrix in the inverse transform.

[0279] If N is greater than 8, in the case of a forward transform, a 16x16 matrix is ​​applied to the upper left 8x2 or 2x8 block, and the generated 16 output data are placed in the upper left 8x2 or 2x8 block, with the remaining area filled with zeros. In the case of an inverse transform, the 16 coefficients located in the upper left 8x2 or 2x8 block are arranged in scan order to form an input vector, and the corresponding 16x16 matrix is ​​multiplied to generate 16 output data. The generated output data are placed in the upper left 8x2 or 2x8 block, with the remaining area filled with zeros.

[0280] 3. When the size of a partition block is N×1 or 1×N and LFNST is applied to the upper left M×1 or 1×M area (M≦N), a matrix sampled according to the N value is applied.

[0281] When M=16, for partition blocks where N=16, i.e., 16x1 or 1x16 blocks, an 8x16 matrix obtained by sampling the top eight rows from a 16x16 matrix is ​​applied instead of a 16x16 matrix in the forward transform, and a 16x8 matrix obtained by sampling the left eight columns from a 16x16 matrix is ​​applied instead of a 16x16 matrix in the inverse transform.

[0282] If N is greater than 16, in the case of a forward transform, a 16x16 matrix is ​​applied to the upper-left 16x1 or 1x16 block, and the generated 16 output data are placed in the upper-left 16x1 or 1x16 block, with the remaining area filled with zeros. In the case of an inverse transform, the 16 coefficients located in the upper-left 16x1 or 1x16 block are arranged in scan order to form an input vector, and then the corresponding 16x16 matrix is ​​multiplied to generate 16 output data. The generated output data are placed in the upper-left 16x1 or 1x16 block, with the remaining area filled with zeros.

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

[0284] The following describes how to signal the LFNST index in the ISP mode.

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

[0286] 1. The LFNST index can be sent once per coding unit (CU), and in the case of a dual-tree, separate LFNST indices are signaled for luma blocks and chroma blocks.

[0287] 2. If the LFNST index is not signaled, the LFNST index value is inferred to be the default value of 0. The following are cases where the LFNST index value is inferred to be 0.

[0288] A. In modes where no transform is applied (e.g., transform skip, BDPCM, lossless coding, etc.)

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

[0290] C. If the width or height of the luma block of the coding unit exceeds the maximum luma transform size that can be converted, for example, if the maximum luma transform size that can be converted is 64, and the size of the luma block of the coding block is similar to 128x16, LFNST cannot be applied.

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

[0292] A 64 length transform or a 32 length transform refers to a transform applied horizontally or vertically having a length of 64 or 32, respectively, and "transform size" refers to the length, 64 or 32.

[0293] In the case of a single tree, it is checked whether the horizontal or vertical length of the luma block exceeds the maximum luma transform block size that can be transformed, and if so, the LFNST index signaling may be omitted.

[0294] D. An LFNST index can be sent only if both the width and height of the coding unit are 4 or greater.

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

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

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

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

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

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

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

[0302] Therefore, after residual coding, if there are non-zero transform coefficients in the area that should be filled with zero values, LFNST index signaling can be omitted.

[0303] Meanwhile, the ISP mode may be applied only to luma blocks, or may be applied to both luma blocks and chroma blocks. As described above, when ISP prediction is applied, a corresponding coding unit is divided into two or four partition blocks for prediction, and transform is also applied to each of the corresponding partition blocks. Therefore, when determining the conditions for signaling an LFNST index in units of coding units, the fact that LFNST can be applied to each of the corresponding partition blocks must be taken into consideration. Also, when the ISP prediction mode is applied only to a specific component (e.g., a luma block), the LFNST index must be signaled taking into consideration the fact that only the component is divided into partition blocks. In the case of the ISP mode, possible LFNST index signaling methods can be summarized as follows:

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

[0305] 2. If the LFNST index is not signaled, the LFNST index value is inferred to the default value of 0. The following are cases where the LFNST index value is inferred to 0.

[0306] A. In modes where no transform is applied (e.g., transform skip, BDPCM, lossless coding, etc.)

[0307] B. If the width or height of the luma block of the coding unit exceeds the maximum luma transform size that can be converted, for example, if the maximum luma transform size that can be converted is 64, and the size of the luma block of the coding block is the same as 128x16, LFNST cannot be applied.

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

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

[0310] In the case of a single tree, it is possible to check whether the width or height of the luma block (coding unit or partition block) exceeds the maximum luma transform block size that can be transformed, and if so, LFNST index signaling may be omitted.

[0311] C. If LFNST included in the current VVC standard is applied, the LFNST index can be transmitted only if both the width and height of the partition block are 4 or more.

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

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

[0314] In this document, an MxN block greater than or equal to a KxL block means that M is greater than or equal to K and N is greater than or equal to L. An MxN block greater than a KxL block means that M is greater than or equal to K and N is greater than or equal to L, but M is greater than K or N is greater than L. An MxN block less than or equal to a KxL block means that M is less than or equal to K and N is less than or equal to L, and an MxN block less than a KxL block means that M is less than or equal to K and N is less than or equal to L, but M is less than K or N is less than L.

[0315] D. If the position of the last non-zero coefficient is not the DC position (the upper left corner of the block), for a dual-tree type luma block, if the position of the last non-zero coefficient in at least one of all partition blocks is not the DC position, then an LFNST index can be transmitted. For a dual-tree type chroma block, if the position of the last non-zero coefficient in all partition blocks for Cb (if ISP mode is not applied to the chroma component, the number of partition blocks is considered to be one) and the position of the last non-zero coefficient in all partition blocks for Cr (if ISP mode is not applied to the chroma component, the number of partition blocks is considered to be one), then the LNFST index can be transmitted.

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

[0317] Here, if a coded block flag (CBF) value indicating whether a transform coefficient exists for each partition block is 0, the position of the last non-zero coefficient for the partition block is not checked to determine whether to perform LFNST index signaling. That is, if the CBF value is 0, no transform is applied to the block, so the position of the last non-zero coefficient for the partition block is not taken into account when checking the conditions for LFNST index signaling.

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

[0319] In the ISP mode, the image information may be configured so as not to check the position of the last non-zero coefficient, and an embodiment of this is as follows.

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

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

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

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

[0324] For example, in the case of a 4x4 partition block and an 8x8 partition block, the LFNST transform coefficient is located at 8 positions from the DC position according to the transform coefficient scan order in the VVC standard, and the remaining positions are all filled with 0. Also, in the case of a partition block that is larger than or equal to 4x4 but is not a 4x4 or 8x8 partition block, the LFNST transform coefficient is located at 16 positions from the DC position according to the transform coefficient scan order in the VVC standard, and the remaining positions are all filled with 0.

[0325] Therefore, after residual coding, if there are non-zero transform coefficients in the area that should be filled with zero values, LFNST index signaling can be omitted.

[0326] If LFNST can be applied to partition blocks of 2×M (1×M) or M×2 (M×1), the area where LFNST transform coefficients can be located can be specified as follows: Areas outside the area where transform coefficients can be located are filled with zeros, and if there is a non-zero transform coefficient in an area that should be filled with zeros assuming that LFNST is applied, LFNST index signaling can be omitted.

[0327] i. LFNST can be applied to a 2×M or M×2 block, and if M=8, only eight LFNST transform coefficients are generated for a 2×8 or 8×2 partition block. When the transform coefficients are arranged in the scan order shown in FIG. 18, eight transform coefficients are arranged in scan order starting from the DC position, and the remaining eight positions are filled with zeros.

[0328] For a 2×N or N×2 (N>8) partition block, 16 LFNST transform coefficients are generated. When the transform coefficients are arranged in the scan order as shown in FIG. 18, the 16 transform coefficients are arranged in the scan order from the DC position, and the remaining area is filled with zeros. That is, in a 2×N or N×2 (N>8) partition block, areas other than the upper left 2×8 or 8×2 block are filled with zeros. For a 2×8 or 8×2 partition block, 16 transform coefficients are generated instead of 8 LFNST transform coefficients, and in this case, no areas that must be filled with zeros occur. As described above, when LFNST is applied, if it is detected that a non-zero transform coefficient exists in an area that is determined to be filled with zeros in even one partition block, LFNST index signaling can be omitted and the LFNST index can be inferred as 0.

[0329] ii. LFNST can be applied to 1xM or Mx1 blocks, and when M=16, only eight LFNST transform coefficients are generated for a 1x16 or 16x1 partition block. When transform coefficients are arranged in left-to-right or top-to-bottom scan order, eight transform coefficients are arranged in the corresponding scan order starting from the DC position, and the remaining eight positions are filled with zeros.

[0330] For a 1xN or Nx1 (N>16) partition block, 16 LFNST transform coefficients are generated, and when the transform coefficients are arranged in a left-to-right or top-to-bottom scan order, the 16 transform coefficients are arranged in the corresponding scan order from the DC position, and the remaining area is filled with 0. That is, in a 1xN or Nx1 (N>16) partition block, the area other than the upper left 1x16 or 16x1 block is filled with 0.

[0331] Even for a 1x16 or 16x1 partition block, 16 LFNST transform coefficients are generated instead of 8, and in this case, no areas that must be filled with 0s occur. As described above, when LFNST is applied, if it is detected that a non-zero transform coefficient exists in an area that is defined to be filled with 0s even in one partition block, the LFNST index signaling can be omitted and the LFNST index can be inferred as 0.

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

[0333] 1. If the LFNST index is 0 (including cases where the LFNST index is inferred to be 0), the primary transformation decision conditions for the ISP currently included in the VVC standard are followed. That is, the horizontal and vertical lengths are checked independently to see if they satisfy the length conditions (greater than or equal to 4 and less than or equal to 16). If they satisfy the conditions, DST-7 is applied instead of DCT-2 for the primary transformation; if they do not satisfy the conditions, DCT-2 is applied.

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

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

[0336] B. It can follow the primary transform decision conditions for ISPs currently included in the VVC standard. That is, it checks whether the horizontal and vertical length conditions (greater than or equal to 4 and less than or equal to 16) are satisfied independently, and if they are satisfied, it applies DCT-7 instead of DCT-2, and if they are not satisfied, it applies DCT-2.

[0337] In the ISP mode, the video information can be configured so that the LFNST index is transmitted for each partition block, rather than for each coding unit. In this case, it can be determined whether to signal the LFNST index by regarding the unit in which the LFNST index is transmitted as being only one partition block.

[0338] The embodiment in which LFNST is applied in the above-described ISP mode can be summarized as follows.

[0339] (1) When LFNST is applied in ISP mode, the divided transform unit must have a size of at least 4x4.

[0340] (2) The same LFNST kernel as the existing LFNST kernel applied to a coding unit to which the ISP mode is not applied can be used.

[0341] (3) All transform units must satisfy the maximum last position value condition (the position condition of the last non-zero valid coefficient). If one or more transform units do not satisfy the maximum last position value condition, LFNST will not be used and the LFNST index will not be parsed.

[0342] (4) When the ISP mode is applied, the setting that LFNST cannot be applied unless the effective coefficient exists at a position other than the DC position can be ignored.

[0343] (5) When LFNST is applied, the primary transform of the transform unit to which ISP is applied is DCT-2.

[0344] Table 8 below shows the syntax elements that include the above.

[0345] [Table 8]

[0346] Table 8 specifies the width and height of the area to which LFNST is applied depending on the tree type, and shows the conditions for transmitting the LFNST index. The syntax elements in Table 8 are signaled at the coding unit (CU) level. In the case of a dual-tree, separate LFNST indexes are signaled for the luma block and the chroma block.

[0347] First, if the tree type of the coding unit is dual tree chroma, the width of the area to which LFNST is applied (lfnstWidth) can be set to a width that reflects the color format from the width of the coding unit ((treeType==DUAL_TREE_CHROMA)?cbWidth / SubWidthC).

[0348] On the other hand, if the tree type of the coding unit is not dual tree chroma, i.e., dual tree luma or single tree, the width of the area to which LFNST is applied (lfnstWidth) is set to either the value obtained by dividing the coding unit by the number of subpartitions or the width of the coding unit, depending on whether the coding unit is split by an ISP ((IntraSubPartitionsSplitType==ISP_VER_SPLIT)?cbWidth / NumIntraSubPartitions:cbWidth). That is, if the coding unit is split vertically by an ISP (IntraSubPartitionsSplitType==ISP_VER_SPLIT), the width of the area to which LFNST is applied is set to the value obtained by dividing the coding unit by the number of subpartitions (cbWidth / NumIntraSubPartitions), and if not split, it is set to the width of the coding unit (cbWidth).

[0349] Similarly, if the tree type of the coding unit is dual tree chroma, the height of the area to which LFNST is applied (lfnstHeight) is set to the height reflecting the color format from the height of the coding unit ((treeType==DUAL_TREE_CHROMA)?cbHeight / SubHeightC).

[0350] On the other hand, if the tree type of the coding unit is not dual tree chroma, i.e., dual tree luma or single tree, the height of the area to which LFNST is applied (lfnstHeight) is set to either the value obtained by dividing the coding unit by the number of subpartitions or the height of the coding unit, depending on whether the coding unit is divided by an ISP ((IntraSubPartitionsSplitType==ISP_HOR_SPLIT)?cbHeight / NumIntraSubPartitions:cbHeight). That is, if the coding unit is divided horizontally by an ISP (IntraSubPartitionsSplitType==ISP_HOR_SPLIT), the height of the area to which LFNST is applied is set to the value obtained by dividing the coding unit by the number of subpartitions (cbHeight / NumIntraSubPartitions), and if not divided, it is set to the height of the coding unit (cbHeight).

[0351] In order for LFNST to be applied in this manner, the width and height of the area to which LFNST is applied must be 4 or greater (Min(lfnstWidth, lfnstHeight)≧4). That is, in the case of a dual coding tree, an LFNST index is signaled only when both the width and height of the corresponding component (i.e., luma or chroma component) are 4 or greater, and in the case of a single tree, an LFNST index is signaled only when both the width and height of the luma component are 4 or greater.

[0352] When ISP is applied to a coding unit, the LFNST index is transmitted only when both the width and height of the partition block are 4 or more.

[0353] Also, if the width or height of the luma block of the coding unit exceeds the size of the largest luma transform block that can be transformed (if the condition Max(cbWidth, cbHeight)≦MaxTbSizeY is not satisfied), LFNST cannot be applied and the LFNST index is not transmitted.

[0354] Also, the LFNST index is signaled only when the position of the last non-zero coefficient is not the DC position (the upper left position of the block).

[0355] For dual-tree luma blocks, if the position of the last non-zero coefficient is not the DC position, an LFNST index is transmitted. For dual-tree chroma blocks, if the position of the last non-zero coefficient for Cb or the last non-zero coefficient for Cr is not the DC position, an LFNST index is transmitted. For single-tree chroma blocks, if the position of the last non-zero coefficient for any one of the luma, Cb, or Cr components is not the DC position, an LFNST index is transmitted.

[0356] On the other hand, when ISP is applied to a coding unit, the LFNST index can be signaled without checking the position of the last non-zero coefficient (IntraSubPartitionsSplitType!=ISP_NO_SPLIT||LfnstDcOnly==0). That is, even if the position of the last non-zero coefficient for all partition blocks is located at the DC position, LFNST index signaling can be allowed. The DC position indicates the position of the upper left corner of the block.

[0357] Finally, if it is determined that a transform coefficient exists in a position where an LFNST transform coefficient cannot exist, the LFNST index signaling can be omitted (LfnstZeroOutSigCoeffFlag==1).

[0358] When ISP is applied to a coding unit, if it is confirmed that a transform coefficient exists in a position where an LFNST transform coefficient cannot exist for even one partition block among all partition blocks, LFNST index signaling can be omitted.

[0359] In the following, an embodiment will be described in which an LFNST kernel sampled from an 8x8 LFNST is applied in the ISP mode.

[0360] As an example, kernel data can be sampled from an 8x8 LFNST (a 16x48 matrix for forward LFNST, e.g., the 8x8 LFNST currently included in the VVC standard) to derive an LFNST kernel (A) that can be applied to the upper left 4x4 block, an LFNST kernel (B) that can be applied to the upper left 4x8 block, and an LFNST kernel (C) that can be applied to the upper left 8x4 block.

[0361] The derived kernel can be used as the LFNST kernel when the ISP mode is in effect and LFNST is applied. For example, (A) can be applied to a 4x4 ISP partition block, (B) can be applied to an Nx4 ISP partition block (N≧8), and (C) can be applied to a 4xN ISP partition block (N≧8). For ISP partitions whose horizontal and vertical lengths are both equal to or greater than 8, the existing 8x8 LFNST (e.g., the 8x8 LFNST currently included in the VVC standard) can be applied.

[0362] To unify the LFNST computational complexity and reduce memory usage, a 16x48 LFNST kernel has been proposed for LFNST. For example, smaller blocks such as 4xN or Nx4 can be considered as part of an 8xN or Nx8 block. For this reason, the overlapping portion with the 16x48 LFNST kernel, i.e., a portion of the 16x48 LFNST kernel, can be used as the LFNST kernel.

[0363] FIG. 19 is a diagram illustrating a sampled LFNST kernel in the ISP mode according to an example.

[0364] For forward LFNST, when a 16x48 LFNST kernel is applied to a 4xN or Nx4 block, a matrix that overlaps the 16x48 LFNST kernel may be used for the quadratic transform.

[0365] FIG. 19 shows a 16×48 LFNST kernel that can be applied to 4×4, 8×4, 4×8, and 16×4 regions. (a) of FIG. 19 shows that when applying the 16×48 LFNST kernel to a 4×4 region, only the portion of the kernel that overlaps with the 4×4 region is used. (b) of FIG. 19 shows that when applying the 16×48 LFNST kernel to an 8×4 region, only the portion of the kernel that overlaps with the 8×4 region is used. (c) of FIG. 19 shows that when applying the 16×48 LFNST kernel to a 4×8 region, only the portion of the kernel that overlaps with the 4×8 region is used. (d) of FIG. 19 shows that when applying the 16×48 LFNST kernel to a 16×4 region, a 16×32 matrix that overlaps with the 16×48 LFNST kernel in the 16×4 region can be used.

[0366] In the case of backward LFNST, 8 or 16 coefficients are input and 16 or 48 coefficients can be output. Meanwhile, calculations for transform are performed only on samples, i.e., coefficients, within the block-sized region, and the remaining samples are not calculated. For example, in the case of a 4x4 transform unit, if 8 coefficients and a 16x48 LFNST kernel are given, only the upper left 4x4 region is calculated as the output, and coefficients outside the 4x4 region are not calculated.

[0367] To maintain the worst-case number of multiplication operations per coefficient, only eight coefficients are calculated for 8x4 and 4x8 blocks, which matches the number of operations of the LFNST applied to the existing 4x4 and 8x8 transform units.

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

[0369] FIG. 20 is a flowchart showing the operation of a video decoding device according to one embodiment of the present document.

[0370] The steps disclosed in Fig. 20 are based on some of the content described above in Fig. 2 to Fig. 19. Therefore, the description of specific content that overlaps with the content described above in Fig. 2 to Fig. 19 will be omitted or simplified.

[0371] A decoding device 200 according to an embodiment may receive residual information from a bitstream (S2010).

[0372] More specifically, the decoding apparatus 200 may decode information on quantized transform coefficients for a current block from a bitstream and derive quantized transform coefficients for a target block based on the information on the quantized transform coefficients for the current block. The information on the quantized transform coefficients for the target block may be included in a Sequence Parameter Set (SPS) or a slice header, and may include at least one of information on whether a simplified transform (RST) is applied, information on a simplification factor, information on a minimum transform size to apply the simplified transform, information on a maximum transform size to apply the simplified transform, a simplified inverse transform size, and information on a transform index indicating one of the transform kernel matrices included in the transform set.

[0373] In addition, the decoding device may further receive information regarding an intra-prediction mode for the current block and information regarding whether ISP is applied to the current block. The decoding device may derive whether the current block is divided into a predetermined number of sub-partition transformation blocks by receiving and parsing flag information indicating whether ISP coding or an ISP mode is applied. Here, the current block may be a coding block. In addition, the decoding device may derive the size and number of sub-partition blocks to be divided based on flag information indicating the direction in which the current block is divided.

[0374] For example, as shown in Figure 14, if the size (width x height) of the current block is 8x4, the current block is divided vertically into two sub-blocks, and if the size (width x height) of the current block is 4x8, the current block is divided horizontally into two sub-blocks. Alternatively, as shown in Figure 15, if the size (width x height) of the current block is larger than 4x8 or 8x4, that is, if the size of the current block is 1) 4xN or Nx4 (N≧16) or 2) MxN (M≧8, N≧8), the current block is divided horizontally or vertically into four sub-blocks.

[0375] The same intra prediction mode is applied to the divided sub-partition blocks of the current block, and the decoding device derives prediction samples for each sub-partition block. That is, the decoding device performs intra prediction sequentially, for example, horizontally or vertically, from left to right, or from top to bottom, depending on the division form of the sub-partition blocks. For the leftmost or topmost sub-block, reconstructed pixels of a previously coded coding block are referenced as in a conventional intra prediction method. Also, if each side of a subsequent internal sub-partition block is not adjacent to the previous sub-partition block, reconstructed pixels of a previously coded adjacent coding block are referenced as in a conventional intra prediction method to derive reference pixels adjacent to the side.

[0376] The decoding apparatus 200 performs inverse quantization on residual information for the current block, i.e., quantized transform coefficients, to derive transform coefficients (S2020).

[0377] The derived transform coefficients are arranged in a reverse diagonal scan order in units of 4x4 blocks, and the transform coefficients within the 4x4 blocks are also arranged in a reverse diagonal scan order, i.e., the inversely quantized transform coefficients are arranged in a reverse scan order applied in video codecs such as VVC and HEVC.

[0378] The transform coefficients derived based on the residual information may be either dequantized or quantized as described above. That is, the transform coefficients may be any data that can be checked for non-zero values ​​in the current block, regardless of whether they are quantized or not.

[0379] The decoding device may determine whether the transform coefficient exists in a second region excluding a first region at the top left corner of the current block, and if the transform coefficient does not exist in the second region, may parse the LFNST index. In addition, the decoding device may determine whether the current block is divided into a plurality of sub-partition blocks and whether the transform coefficient exists in all of the individual second regions for the plurality of sub-partition blocks (S2030).

[0380] The decoding device can check whether zeroing out has been performed for the second region by deriving a first variable indicating whether there are significant coefficients in the second region excluding the first region at the top left corner of the current block.

[0381] The first variable may be a variable LfnstZeroOutSigCoeffFlag that indicates that zeroing out has been performed when applying LFNST. The first variable may be initially set to 1, and if there is a valid coefficient in the second region, the second variable may be changed to 0.

[0382] The variable LfnstZeroOutSigCoeffFlag may be derived to 0 if the index of the sub-block where the last non-zero coefficient exists is greater than 0, the width and height of the transform block are both equal to or greater than 4, or the position of the last non-zero coefficient within the sub-block where the last non-zero coefficient exists is greater than 7, and the size of the transform block is 4x4 or 8x8. A sub-block refers to a 4x4 block used as a coding unit in residual coding and may also be named a coefficient group (CG). A sub-block index of 0 refers to the upper left 4x4 sub-block.

[0383] That is, when a non-zero coefficient is derived in an area other than the upper left area where LFNST transform coefficients can exist in a transform block, or when a non-zero coefficient exists outside the eighth position in the scanning sequence for a 4x4 block or an 8x8 block, the variable LfnstZeroOutSigCoffFlag is set to 0.

[0384] For example, when ISP is applied to a coding unit, if it is determined that a transform coefficient exists in a position other than a position where an LFNST transform coefficient is allowed for even one of all sub-partition blocks, LFNST index signaling can be omitted. That is, if zero-out is not performed in one sub-partition block and a valid coefficient exists in the second region, LFNST index signaling is not performed.

[0385] On the other hand, the first region is derived based on the size of the current block.

[0386] For example, if the size of the current block is 4x4 or 8x8, the first region is from the upper left side of the current block to the 8th sample position in the scanning direction. If the size of the sub-partition block is 4x4 or 8x8 after the current block is divided, the first region is from the upper left side of the sub-partition block to the 8th sample position in the scanning direction.

[0387] If the size of the current block is 4x4 or 8x8, eight pieces of data are output through the forward LFNST, and the eight transform coefficients received by the decoding device can be arranged from the upper left side of the current block to the eighth sample position in the scanning direction, as shown in (a) of Figure 11 and (a) of Figure 12.

[0388] Also, if the size of the current block is not 4x4 or 8x8, the first region may be the 4x4 region at the upper left of the current block. If the size of the current block is not 4x4 or 8x8, 16 data are output through the forward LFNST, and therefore the 16 transform coefficients received by the decoding device may be arranged in the 4x4 region at the upper left of the current block, as shown in (b) to (d) of Figure 11 and (b) of Figure 12.

[0389] Meanwhile, the transform coefficients that can be arranged in the first region can be arranged along the diagonal scan direction as shown in FIG.

[0390] As described above, when a current block is divided into sub-partition blocks, the decoding device parses the LFNST index if transform coefficients are not present in all of the second fields for the sub-partition blocks, but does not parse the LFNST index if a transform coefficient is present in the second field for any one of the sub-partition blocks.

[0391] As described above, the LFNST is applied to sub-partition blocks whose width and height are 4 or more, and the LFNST index for the current block, which is a coding block, can be applied to multiple sub-partition blocks.

[0392] Meanwhile, since the zero-outs reflected by LFNST (including all zero-outs associated with the application of LFNST) are also applied to sub-partition blocks, they are applied equally to both the first region and the sub-partition blocks. That is, if the divided sub-partition block is a 4x4 block or an 8x8 block, LFNST is applied to the transform coefficients from the upper left corner of the sub-partition block to the eighth in the scanning direction. If the sub-partition block is not a 4x4 block or an 8x8 block, LFNST is applied to the transform coefficients in the upper left 4x4 region of the sub-partition block.

[0393] Meanwhile, according to an example, the decoding device may derive a second variable indicating whether the transform coefficients, i.e., valid coefficients, exist in an area excluding the DC position of the current block in order to determine whether the LFNST index can be parsed.

[0394] The second variable may be a variable LfnstDcOnly that can be derived during the residual coding process. The second variable may be derived to 0 if the index of a sub-block including the last significant coefficient in a current block is 0 and the position of the last significant coefficient in the sub-block is greater than 0, and if the second variable is 0, an LFNST index may be parsed. A sub-block refers to a 4x4 block used as a coding unit in residual coding and may also be named a Coefficient Group (CG). A sub-block index of 0 refers to the upper left 4x4 sub-block.

[0395] The second variable may be initially set to 1, and may remain at 1 or may be changed to 0 depending on whether or not there is a valid coefficient in the area excluding the DC position.

[0396] The variable LfnstDcOnly represents whether or not a non-zero coefficient exists in a non-DC component position for at least one transform block in a coding unit, and can be 0 if a non-zero coefficient exists in a non-DC component position for at least one transform block in a coding unit, or 1 if no non-zero coefficient exists in a non-DC component position for all transform blocks in a coding unit.

[0397] The decoding device can parse the LFNST index based on the derived result (S2040).

[0398] That is, when the current block is divided into a plurality of sub-partition blocks, if transform coefficients do not exist in all of the individual second areas for the plurality of sub-partition blocks, the decoding device can parse the LFNST index and perform LFNST.

[0399] The LFNST index information is received as syntax information, which may be received as a binarized bin string containing 0s and 1s.

[0400] The LFNST index syntax element according to this embodiment can indicate whether an inverse LFNST or an inverse non-separable transform is applied and which one of the transform kernel matrices is included in the transform set. If the transform set includes two transform kernel matrices, the value of the transform index syntax element can be three.

[0401] That is, according to one embodiment, the syntax element value for the LFNST index may include 0 indicating that the inverse LFNST is not applied to the current block, 1 indicating the first transformation kernel matrix among the transformation kernel matrices, or 2 indicating the second transformation kernel matrix among the transformation kernel matrices.

[0402] The intra-prediction mode information and LFNST index information can be signaled at the coding unit level.

[0403] On the other hand, the decoding device can parse the LFNST index without deriving the second variable based on the division of the current block into multiple sub-partition blocks.

[0404] For example, if the current block is not divided into multiple sub-partition blocks and the second variable indicates that a transform coefficient exists in an area excluding a DC position, the decoding device may parse the LFNST index; if the current block is divided into multiple sub-partition blocks, the decoding device may parse the LFNST index without checking the second variable or ignoring the value of the first variable.

[0405] That is, when ISP is applied to the current block, LFNST index signaling can be allowed even if the positions of the last non-zero coefficients for all sub-partition blocks are located at the DC position.

[0406] The decoding device can derive modified transform coefficients from the transform coefficients based on the LFNST index and the LFNST matrix for the LFNST (S2050).

[0407] Unlike a linear transform that separates and transforms coefficients in the vertical or horizontal direction, the LFNST is a non-separable transform that applies a transform without separating the coefficients in a specific direction. Such a non-separable transform may be a low-frequency non-separable transform that applies a forward transform only to the low-frequency region, not to the entire block region.

[0408] The decoding device can determine an LFNST set including an LFNST matrix based on the intra-prediction mode derived from the intra-prediction mode information, and select one of a plurality of LFNST matrices based on the LFNST set and the LFNST index.

[0409] In this case, the same LFNST set and the same LFNST index are applied to the sub-partition transform blocks divided in the current block. That is, since the same intra prediction mode is applied to the sub-partition transform blocks, the LFNST set determined based on the intra prediction mode is also applied to all the sub-partition transform blocks. Furthermore, since the LFNST index is signaled at the coding unit level, the same LFNST matrix is ​​applied to the sub-partition transform blocks divided in the current block.

[0410] Meanwhile, as described above, a transform set is determined according to the intra prediction mode of the transform block to be transformed, and inverse LFNST is performed based on one of the transform kernel matrices, i.e., LFNST matrices, included in the transform set indicated by the LFNST index. A matrix applied to inverse LFNST is called an inverse LFNST matrix or an LFNST matrix, and the name of such a matrix does not matter as long as it is in a transpose relationship with the matrix used in forward LFNST.

[0411] In one example, the matrix of the inverse LFNST may be a non-square matrix with fewer columns than rows.

[0412] Meanwhile, a predetermined number of transform coefficients, which are output data of the LFNST, are derived based on the size of the current block or sub-partition transform block. For example, if the height and width of the current block or sub-partition transform block are 8 or more, 48 transform coefficients are derived as shown on the left side of Figure 6. If the width and height of the sub-partition transform block are less than 8, i.e., if the width and height of the sub-partition transform block are 4 or more but the width or height of the sub-partition transform block is less than 8, 16 transform coefficients are derived as shown on the right side of Figure 6.

[0413] As shown in Figure 6, the 48 transform coefficients are arranged in the 4x4 areas on the upper left, upper right, and lower left sides of the 8x8 area on the upper left side of the sub-partition transform block, and the 16 transform coefficients are arranged in the 4x4 area on the upper left side of the sub-partition transform block.

[0414] The 48 transform coefficients or the 16 transform coefficients are arranged vertically or horizontally depending on the intra prediction mode of the sub-partition transform block. For example, if the intra prediction mode is a horizontal direction (modes 2 to 34 in FIG. 4) based on a diagonal direction (mode 34 in FIG. 4), the transform coefficients are arranged horizontally, i.e., in a row-major order, as shown in (a) of FIG. 6. If the intra prediction mode is a vertical direction (modes 35 to 66 in FIG. 4) based on a diagonal direction, the transform coefficients are arranged horizontally, i.e., in a column-major order, as shown in (b) of FIG. 6.

[0415] The decoding apparatus derives residual samples for the current block based on the linear inverse transform of the modified transform coefficients (S2060).

[0416] In this case, the inverse linear transform can be a general separation transform, or the above-mentioned MTS can be used.

[0417] Subsequently, the decoding apparatus 200 may generate reconstructed samples based on the residual samples for the current block and the predicted samples for the current block (S2070).

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

[0419] FIG. 21 is a flowchart illustrating the operation of a video encoding device according to an embodiment of the present document.

[0420] Each step disclosed in Fig. 21 is based on part of the content described above in Fig. 3 to Fig. 19. Therefore, the description of specific content that overlaps with the content described above in Fig. 1 and Fig. 3 to Fig. 19 will be omitted or simplified.

[0421] The encoding apparatus 100 according to an embodiment derives prediction samples for the current block based on an intra prediction mode applied to the current block (S2110).

[0422] When ISP is applied to the current block, the encoding device performs prediction for each sub-partition transform block.

[0423] The encoding device determines whether to apply ISP coding or ISP mode to a current block, i.e., a coding block, and determines in which direction the current block is to be divided based on the determination result, and derives the size and number of sub-blocks to be divided.

[0424] For example, as shown in Figure 14, if the size (width x height) of the current block is 8x4, the current block is divided vertically into two sub-blocks, and if the size (width x height) of the current block is 4x8, the current block is divided horizontally into two sub-blocks. Alternatively, as shown in Figure 15, if the size (width x height) of the current block is larger than 4x8 or 8x4, that is, if the size of the current block is 1) 4xN or Nx4 (N≧16) or 2) MxN (M≧8, N≧8), the current block is divided horizontally or vertically into four sub-blocks.

[0425] The same intra prediction mode is applied to the divided sub-partition transform blocks of the current block, and the encoding device derives prediction samples for each sub-partition transform block. That is, the encoding device performs intra prediction sequentially, for example, horizontally or vertically, from left to right, or from top to bottom, depending on the division form of the sub-partition transform blocks. For the leftmost or topmost sub-block, reconstructed pixels of a previously coded coding block are referenced as in a conventional intra prediction method. Also, if each side of a subsequent internal sub-partition transform block is not adjacent to the previous sub-partition transform block, reconstructed pixels of a previously coded adjacent coding block are referenced as in a conventional intra prediction method to derive reference pixels adjacent to the side.

[0426] The encoding apparatus 100 derives residual samples for the current block based on the predicted samples (S2120).

[0427] In addition, the encoding apparatus 100 derives transform coefficients for the current block based on the linear transform of the residual samples (S2130).

[0428] The primary transform is performed by multiple transform kernels, where the transform kernel is selected based on the intra prediction mode.

[0429] The encoding apparatus 100 may determine whether to perform a quadratic transform or a non-separable transform, specifically, an LFNST, on the transform coefficients of the current block, and may apply the LFNST to the transform coefficients to derive modified transform coefficients.

[0430] Unlike a linear transform that separates and transforms coefficients in the vertical or horizontal direction, the LFNST is a non-separable transform that applies a transform without separating the coefficients in a specific direction. Such a non-separable transform may be a low-frequency non-separable transform that applies a transform only to the low-frequency region, rather than to the entire target block.

[0431] When ISP is applied to the current block, the encoding device can determine whether LFNST can be applied to the height and width of the divided sub-partition blocks.

[0432] The encoding device can determine whether LFNST can be applied to the height and width of the divided sub-partition blocks. In this case, the decoding device can parse the LFNST index when the height and width of the sub-partition blocks are 4 or more.

[0433] In addition, the encoding device can determine whether LFNST is applicable based on the tree type and color format of the current block.

[0434] For example, if the tree type of the current block is dual tree chroma, the encoding apparatus determines that LFNST is applicable when the height and width corresponding to the chroma component blocks of the current block are 4 or more.

[0435] Also, according to an example, the encoding apparatus determines that LFNST can be applied when the tree type of the current block is single-tree or dual-tree luma and the height and width corresponding to the luma component block of the current block are 4 or more.

[0436] For example, if the tree type of the current block is dual tree chroma, ISP is not applied. In this case, the encoding device determines that LFNST can be applied if the height and width corresponding to the chroma component blocks of the current block are 4 or more.

[0437] On the other hand, if the tree type of the current block is dual tree chroma or single tree, the encoding device determines that LFNST can be applied when the height and width of the sub-partition block for the luma component block of the current block or the height and width of the current block are 4 or more, depending on whether ISP is applied to the current block.

[0438] In another example, when the current block is a coding unit and the width and height of the coding unit are smaller than or equal to the size of the maximum luma transform that can be transformed, the encoding device determines that LFNST can be applied.

[0439] If it is determined that LFNST is to be performed, the encoding device 100 derives modified transform coefficients for the current block or sub-partition transform block based on the LFNST set mapped to the intra prediction mode and the LFNST matrix included in the LFNST set (S2140).

[0440] The encoding apparatus 100 determines an LFNST set based on a mapping relationship according to the intra prediction mode applied to the current block, and performs LFNST, i.e., non-separable transform, based on one of two LFNST matrices included in the LFNST set.

[0441] In this case, the same LFNST set and the same LFNST index are applied to the sub-partition transform blocks divided in the current block. That is, since the same intra prediction mode is applied to the sub-partition transform blocks, the LFNST set determined based on the intra prediction mode is also applied to all the sub-partition transform blocks. Furthermore, since the LFNST index is encoded in units of coding units, the same LFNST matrix is ​​applied to the sub-partition transform blocks divided in the current block.

[0442] As described above, the transform set is determined by the intra prediction mode of the transform block to be transformed. The matrix applied to LFNST has a transpose relationship with the matrix used for the inverse LFNST.

[0443] In one example, the LFNST matrix may be a non-square matrix with fewer rows than columns.

[0444] The region where the transform coefficients used as input data for the LFNST are located is determined based on the size of the sub-partition transform block. For example, if the height and width of the sub-partition transform block are 8 or more, the region may be the upper left, upper right, and lower left 4x4 regions of the upper left 8x8 region of the sub-partition transform block as shown on the left side of Figure 6. If the height and width of the sub-partition transform block are not 8 or more, the region may be the upper left 4x4 region of the current block as shown on the right side of Figure 6.

[0445] The transform coefficients of the region are read vertically or horizontally according to the intra prediction mode of the sub-partition transform block to form a one-dimensional vector for multiplication with the LFNST matrix.

[0446] The 48 modified transform coefficients or the 16 modified transform coefficients are read vertically or horizontally according to the intra prediction mode of the sub-partition transform block and arranged one-dimensionally. For example, if the intra prediction mode is a horizontal direction (modes 2 to 34 in FIG. 3) based on a diagonal direction (mode 34 in FIG. 3), the transform coefficients are arranged horizontally, i.e., in a row-major order, as shown in (a) of FIG. 6. If the intra prediction mode is a vertical direction (modes 35 to 66 in FIG. 3) based on a diagonal direction, the transform coefficients are arranged horizontally, i.e., in a column-major order, as shown in (b) of FIG. 6.

[0447] In one embodiment, the encoding apparatus includes the steps of determining whether a condition for applying LFNST is met, generating and encoding an LFNST index based on the determination, selecting a transformation kernel matrix, and, if the condition for applying LFNST is met, applying LFNST to the residual samples based on the selected transformation kernel matrix and / or a simplification factor, where the size of the simplified transformation kernel matrix is ​​determined based on the simplification factor.

[0448] Meanwhile, according to an example, the encoding apparatus may zero out a second region of the current block in which no modified transform coefficients exist (S2150).

[0449] 11 and 12, the remaining areas of the current block where no modified transform coefficients exist can be processed as 0. This zeroing reduces the amount of calculation required to perform the entire transform process, reduces the amount of calculation required for the entire transform process, and can reduce power consumption required to perform the transform. In addition, it can reduce latency associated with the transform process and increase the efficiency of image coding.

[0450] The encoding device may also configure image information such that the current block is divided into a plurality of sub-partition blocks and the LFNST index is signaled based on zeroing out all of the sub-partition blocks (S2160).

[0451] In addition, according to one example, the encoding device may configure image information such that an LFNST index indicating an LFNST matrix is ​​signaled based on whether a transform coefficient exists in an area excluding a DC position of the current block, and may configure image information such that an LFNST index is signaled regardless of whether a transform coefficient exists in an area excluding a DC position based on whether the current block is divided into a plurality of sub-partition blocks.

[0452] The encoding device configures the video information shown in Table 8 so that it can be parsed by the decoding device.

[0453] That is, the encoding device configures the video information so that the LFNST index is parsed if the current block is not divided into a plurality of sub-partition blocks and indicates that a transform coefficient exists in an area excluding the DC position of the current block; and if the current block is divided into a plurality of sub-partition blocks, the encoding device configures the video information so that the LFNST index is parsed without checking whether a transform coefficient exists in an area excluding the DC position.

[0454] That is, when ISP is applied to the current block, the encoding apparatus configures the video information so that the LFNST index is signaled even if the position of the last non-zero coefficient for all sub-partition blocks is located at the DC position.

[0455] For example, if the index of a sub-block including the last significant coefficient in a current block (or a sub-partition block) is 0 and the position of the last significant coefficient in the sub-block is greater than 0, the encoding apparatus determines that the significant coefficient exists in an area excluding a DC position and configures video information such that an LFNST index is signaled. In this document, the first position in the scanning order may be 0.

[0456] Also, according to one example, if the index of the sub-block including the last significant coefficient in the current block (or sub-partition block) is greater than 0 and the width and height of the current block are 4 or greater, the encoding device determines that LFNST is not applied and configures the video information so that the LFNST index is not signaled.

[0457] Also, according to one example, when the size of the current block (or sub-partition block) is 4x4 or 8x8 and the position in the scanning order starts from 0, if the position of the last significant coefficient is greater than 7, the encoding device determines that LFNST is definitely not applied, and configures the video information so that the LFNST index is not signaled.

[0458] That is, the encoding apparatus configures video information such that the variables LfnstDcOnly and LfnstZeroOutSigCoeffFlag are derived in the decoding apparatus, and the LFNST index is parsed according to the values ​​of the derived variables.

[0459] The encoding device may perform quantization based on the modified transform coefficients for the current block to derive quantized transform coefficients, and may encode and output image information including information on the quantized transform coefficients and, if LFNST is applicable, LFNST index information indicating an LFNST matrix (S2170).

[0460] The encoding device can generate residual information including information on quantized transform coefficients. The residual information can include the above-described transform-related information / syntax elements. The encoding device can encode image / video information including the residual information and output it in the form of a bitstream.

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

[0462] The LFNST index syntax element according to this embodiment indicates whether or not an (inverse) LFNST is applied and which one of the LFNST matrices is included in the LFNST set. If the LFNST set includes two transformation kernel matrices, the LFNST index syntax element can have three values.

[0463] For example, if the partitioning tree structure for the current block is a dual tree type, an LFNST index is encoded for each of the luma block and the chroma block.

[0464] In one embodiment, the syntax element value for the transform index is derived as 0, which indicates that no (inverse) LFNST is applied to the current block, 1, which indicates the first LFNST matrix among the LFNST matrices, or 2, which indicates the second LFNST matrix among the LFNST matrices.

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

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

[0467] In the above-described embodiments, the method is described based on a flowchart as a series of steps or blocks, but this document is not limited to the order of steps, and some steps may occur in a different order or simultaneously with other steps than those described above. Furthermore, those skilled in the art will understand that the steps shown 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 this document.

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

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

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

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

[0472] FIG. 22 shows a schematic diagram of an example video / image coding system to which this document can be applied.

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

[0474] The source device may include a video source, an encoding device, and a transmitting unit. The receiving device may include a receiving unit, a decoding device, and a renderer. The encoding device may be called a video / image encoding device, and the decoding device may be called a video / image decoding device. The transmitter may be included in the encoding device. The receiver may be included in the decoding device. The renderer may also include a display unit, which may be a separate device or an external component.

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

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

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

[0478] The decoding device can decode the video / image by performing a series of steps such as inverse quantization, inverse transform, prediction, etc., which correspond to the operations of the encoding device.

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

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

[0481] Furthermore, the content streaming system to which this document applies can broadly include an encoding server, a streaming server, a web server, a media storage, a user device, and a multimedia input device.

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

[0483] 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 that informs 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, which then transmits the multimedia data to the user. The content streaming system may include a separate control server, which controls commands and responses between devices in the content streaming system.

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

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

[0486] The claims described herein may be combined in various ways. For example, technical features of method claims herein may be combined to be embodied as an apparatus, and technical features of apparatus claims herein may be combined to be embodied as a method. Furthermore, technical features of method claims herein and technical features of apparatus claims herein may be combined to be embodied as an apparatus, and technical features of method claims herein and technical features of apparatus claims herein may be combined to be embodied as a method.

Claims

1. 1. A decoding device for decoding an image, comprising: Memory and at least one processor coupled to the memory; The at least one processor: Get the residual information from the bitstream, deriving transform coefficients for a current block based on the residual information; deriving modified transform coefficients by applying a low-frequency non-separable transform (LFNST) to the transform coefficients; deriving residual samples for the current block based on an inverse linear transform of the modified transform coefficients; generating a reconstructed picture based on the residual samples; The at least one processor: determining whether a non-zero transform coefficient exists in a second region other than the first region, the second region being a region covering the samples arranged in scan order from the upper left position; Parsing the LFNST index based on the result of said determination; deriving the modified transform coefficients based on the LFNST matrix indicated by the LFNST index; When Intra Sub-Partitions (ISP) is applied, the LFNST index is parsed based on the fact that the non-zero transform coefficient does not exist in any of second regions for a plurality of sub-partition blocks divided from the current block; A decoding device, wherein the LFNST index is parsed based on the absence of the non-zero transform coefficients in the second region of the current block even when the ISP is not applied.

2. 1. An encoding device for encoding an image, comprising: Memory and at least one processor coupled to the memory; The at least one processor: Derive a predicted sample for the current block; deriving a residual sample for the current block based on the predicted sample; deriving transform coefficients for the current block based on a linear transform of the residual samples; deriving modified transform coefficients for transform coefficients of a first region, the first region covering the samples arranged in scan order from the upper left position, based on a low-frequency non-separable transform (LFNST) matrix; zeroing out a second region where the modified transform coefficients are not present; Based on the fact that the zeroing out is performed on all of the second regions of a plurality of sub-partition blocks divided from the current block to which Intra Sub-Partitions (ISP) is applied, image information is configured so that an LFNST index associated with the LFNST matrix is ​​signaled; outputting the image information including the LFNST index and residual information related to quantized transform coefficients derived by quantizing the modified transform coefficients; An image encoding device, wherein the image information is configured such that the LFNST index is signaled based on the zeroing out being performed on the second region of the current block even when the ISP is not applied.

3. 1. An apparatus for transmitting data for an image, comprising: at least one processor configured to obtain a bitstream for the image, the bitstream comprising: deriving a predicted sample for the current block; deriving residual samples for the current block based on the predicted samples; deriving transform coefficients for the current block based on a linear transform for the residual samples; deriving modified transform coefficients for transform coefficients of a first region, the first region covering samples arranged in scan order from the upper left position, based on a low-frequency non-separable transform (LFNST) matrix; zeroing out a second region where the modified transform coefficients are not present; Configuring image information so that an LFNST index associated with the LFNST matrix is ​​signaled based on the fact that the zeroing out is performed on all second regions of a plurality of sub-partition blocks divided from the current block to which ISP (Intra Sub-Partitions) is applied; and outputting the image information including the LFNST index and residual information related to quantized transform coefficients derived by quantizing the modified transform coefficients. a transmitter configured to transmit the data including the bitstream; An apparatus, wherein the image information is configured such that the LFNST index is signaled based on the zeroing out being performed on the second region of the current block even when the ISP is not applied.