Transform-based video encoding method and apparatus

By deriving modified transform coefficients through parsing LFNST indexes and applying LFNST in video encoding, the method addresses the need for efficient image/video compression, enhancing coding efficiency and reducing costs for high-resolution and immersive media.

JP2026026349APending Publication Date: 2026-02-16LG ELECTRONICS INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2025231486
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2019-11-13
Filing Date
2025-12-04
Publication Date
2026-02-16

AI Technical Summary

Technical Problem

The increasing demand for high-resolution and immersive media has led to a need for highly efficient image/video compression technologies to reduce transmission and storage costs, with a specific focus on improving video coding efficiency, LFNST index coding efficiency, and coding efficiency of LFNST indexes based on transform skip flags.

Method used

A video decoding method that derives modified transform coefficients by parsing an LFNST index based on variables indicating whether an ISP is applied to the current block and significant coefficients exist, and a video encoding method that applies LFNST to derive modified transform coefficients from transform coefficients using individual transform skip flag values for color components.

Benefits of technology

Improves overall image/video compression efficiency, enhances LFNST index coding, and increases the coding efficiency of LFNST indexes based on transform skip flags.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2026026349000001_ABST
    Figure 2026026349000001_ABST
Patent Text Reader

Abstract

To provide a video decoding method.SOLUTION: An image decoding method according to the present document may include deriving a modified transform coefficient, wherein the deriving of the modified transform coefficient includes parsing an LFNST index based on a variable indicating whether ISP is applied to the current block or whether a significant coefficient is present in a DC component of the current block according to a tree type of the current block, and wherein the variable may be derived based on individual transform skip flag values for color components of the current block.SELECTED DRAWING: Figure 15
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

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

[0002] In recent years, 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 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 (preservation, 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 has been increasing in recent years, and the broadcast of images / videos with visual characteristics different from real images, such as game images, is on the rise.

[0004] Accordingly, there is a demand for highly efficient image / video compression technology to effectively compress, 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 video coding efficiency.

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

[0007] Yet another technical problem of this document is to provide a method and apparatus for improving the coding efficiency of LFNST indexes based on transform skip flags. [Means for solving the problem]

[0008] According to one embodiment of the present document, there is provided a video decoding method executed by a decoding device, the method comprising: deriving modified transform coefficients, the deriving the modified transform coefficients comprising parsing an LFNST index based on a variable indicating whether an ISP is applied to the current block according to a tree type of the current block or whether significant coefficients exist in DC components of the current block, the variable may be derived based on individual transform skip flag values ​​for color components of the current block.

[0009] The LFNST index can be parsed regardless of the value of the variable based on whether the current block is a single-type or dual-tree luma and the ISP is applied.

[0010] If the current block is a dual-tree chroma, the LFNST index may be parsed based on the variables indicating that there are significant coefficients in positions that are not DC components.

[0011] Based on the transform skip flag value being 0 for a color component, the variable can indicate that a significant coefficient exists at a position other than the DC component.

[0012] The variable is initially set to 1 at the coding unit level of the current block, and if the transform skip flag value is 0, the variable is changed to 0 from the residual coding level, and the LFNST index can be parsed based on the variable being 0.

[0013] If the tree type of the current block is dual tree chroma, the variables may be derived based on the value of the transform skip flag for the chroma Cb component and the value of the transform skip flag for the chroma Cr component.

[0014] The transform skip flag for the current block can be signaled for each color component.

[0015] Deriving the modified transform coefficients may further include setting a plurality of variables for the LFNST based on whether the LFNST index is not 0 and the individual transform skip flag values ​​of the color components are 0.

[0016] According to one embodiment of the present document, there is provided a video encoding method executed by an encoding device, the method including applying LFNST to derive modified transform coefficients from transform coefficients, where the modified transform coefficients are derived based on a variable indicating whether an ISP is applied to the current block according to a tree type of the current block or whether there are significant coefficients in the DC components of the current block, and the variable may be derived based on individual transform skip flag values ​​for the color components of the current block.

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

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

[0019] This document will improve the overall image / video compression efficiency.

[0020] This document improves the efficiency of LFNST index coding.

[0021] This document allows for the coding efficiency of LFNST indexes to be improved based on the transform skip flag.

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

[0023] [Figure 1] 1 illustrates a schematic diagram of an example of a video / image encoding system to which the present document can be applied; [Figure 2] 1 is a diagram illustrating the configuration of a video / image encoding device to which this document can be applied. [Figure 3] 1 is a diagram illustrating the configuration of a video / image decoding device to which this document can be applied. [Figure 4] FIG. 1 illustrates a schematic diagram of a multiple conversion technique according to an embodiment of the present document; [Figure 5] FIG. 10 is a diagram illustrating an example of intra-directional modes of 65 prediction directions. [Figure 6] FIG. 1 is a diagram illustrating a RST according to one embodiment of this document. [Figure 7] FIG. 10 is a diagram illustrating an example of an order in which output data of a forward linear transform is arranged into a one-dimensional vector. [Figure 8] 10 is a diagram illustrating an example of a sequence in which output data of a forward quadratic transform is arranged in a two-dimensional block. [Figure 9] FIG. 1 illustrates a wide-angle intra-prediction mode according to one embodiment of the present document. [Figure 10] FIG. 10 is a diagram showing the shape of a block to which LFNST is applied. [Figure 11] FIG. 10 is a diagram illustrating an example of an arrangement of output data from a forward LFNST. [Figure 12] FIG. 10 illustrates an example in which the number of output data for a forward LFNST is limited to a maximum of 16. [Figure 13] FIG. 10 is a diagram illustrating zeroing out in a block to which a 4×4 LFNST is applied, according to an example. [Figure 14] FIG. 10 is a diagram illustrating zeroing out in a block to which an 8×8 LFNST is applied, according to an example. [Figure 15] FIG. 10 is a diagram illustrating a video decoding method according to an example. [Figure 16] 1 is a diagram illustrating an example of a video coding method. [Figure 17] FIG. 1 is an exemplary structural diagram of a content streaming system to which this document applies. DETAILED DESCRIPTION OF THE INVENTION

[0024] 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.

[0025] 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.

[0026] 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 descriptions of the same components will be omitted.

[0027] This document relates to video / image encoding. For example, methods / embodiments disclosed herein 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.).

[0028] This document presents various embodiments related to video / image encoding, and unless otherwise stated, the embodiments may be performed in combination with each other.

[0029] 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 include 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 include one or more tiles.

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

[0031] A unit may refer to a basic unit of video 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 mixed 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.

[0032] In this document, " / " and "," are interpreted as "and / or." For example, "A / B" is interpreted as "A and / or B," and "A, B" is interpreted as "A and / or B." 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."

[0033] Furthermore, in this document, "or" is interpreted as "and / or." For example, "A or B" can mean 1) only "A," 2) only "B," or 3) "A and B." In other words, "or" in this document can mean "additionally or alternatively."

[0034] 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 similarly to "at least one of A and B."

[0035] Also, 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." Also, "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."

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

[0037] Technical features described separately in one drawing in this specification may be embodied separately or simultaneously.

[0038] FIG. 1 shows a schematic diagram of an example of a video / image encoding system to which this document can be applied.

[0039] 1, a video / image encoding 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 in the form of a file or streaming data via a digital storage medium or a network.

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

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

[0042] 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.

[0043] 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.

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

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

[0046] 2 is a diagram illustrating a schematic 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.

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

[0048] The image division unit 210 may divide an input image (or picture, frame) input to the encoding device 200 into one or more processing units. For example, the processing units may be called coding units (CUs). In this case, the coding units may be recursively divided into coding tree units (CTUs) or largest coding units (LCUs) using a quad-tree, binary-tree, and ternary-tree (QTBTTT) 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 tree structure. In this case, for example, the quad-tree structure may be applied first, and then the binary tree structure and / or the ternary tree structure may be applied. Alternatively, the binary tree structure may be applied first. The coding procedure described herein may be performed based on a 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 video characteristics, or the coding unit may be recursively divided into coding units of lower depth as needed, and a coding unit of an optimal size may be used as the final coding unit. Here, the coding procedure may include procedures such as prediction, transformation, and restoration, which will be described later. As another example, the processing unit may further include a prediction unit (PU) or a transform unit (TU). In this case, the prediction unit and the transform unit may each be divided or partitioned from the final coding unit.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.

[0049] The term "unit" can be mixed 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 a pixel value, or can refer to only a pixel / pixel value of the luminance (luma) component, or only a pixel / pixel value of the chroma (chroma) component. A sample can be used as a term corresponding to a pixel or pel of a picture (or image).

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

[0051] The intra prediction unit 222 can 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 can include a plurality of non-directional modes and a plurality of directional modes. The non-directional modes can include, for example, DC mode and planar mode. The directional modes can 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 222 can also determine the prediction mode to be applied to the current block using the prediction modes applied to neighboring blocks.

[0052] The inter prediction unit 221 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 the 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 221 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 skip mode and merge mode, the inter predictor 221 may use motion information of neighboring blocks as motion information for the current block. In the case of skip mode, unlike in merge mode, a residual signal may not be transmitted.In the case of the Motion Vector Prediction (MVP) mode, the motion vector of the current block can be indicated by using the motion vector of the surrounding block as the motion vector predictor and signaling the motion vector difference.

[0053] The predictor 220 may generate a prediction signal based on various prediction methods, which will be described later. For example, the predictor may not only apply intra prediction or inter prediction for prediction of a block, but also apply intra prediction and inter prediction simultaneously. This may be referred to as combined inter and intra prediction (CIIP). The predictor may also perform intra block copy (IBC) for prediction of a block. The intra block copy may be used for coding content images / videos, such as games, such as screen content coding (SCC). IBC basically performs prediction within a current picture, but may be performed similarly to inter prediction in deriving a reference block within the current picture. That is, IBC may use at least one of the inter prediction techniques described herein.

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

[0055] The quantizer 233 quantizes the transform coefficients and transmits the quantized signal to the entropy encoder 240. The entropy encoder 240 encodes the quantized signal (information about the quantized transform coefficients) and outputs the encoded signal as a bitstream. The information about the quantized transform coefficients may be referred to as residual information. The quantizer 233 may rearrange the quantized transform coefficients in a block form into a one-dimensional vector form based on a coefficient scan order, and may generate information about the quantized transform coefficients based on the quantized transform coefficients in the one-dimensional vector form. The entropy encoder 240 may perform various encoding methods, such as exponential Golomb, context-adaptive variable length coding (CAVLC), and context-adaptive binary arithmetic coding (CABAC). The entropy encoder 240 may encode information required for video / image restoration (e.g., values ​​of syntax elements) together with or separately from the quantized transform coefficients. The encoded information (e.g., encoded video / picture information) may be transmitted or stored in the form of a bitstream in Network Abstraction Layer (NAL) units. The video / picture 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 / picture information may also include general constraint information. Signaling / transmitted information and / or syntax elements described later in this document may be encoded through the encoding procedure described above and included in the bitstream. The bitstream may be transmitted over a network or stored in a digital storage medium.Here, the network may include a broadcast network and / or a communication network, and the digital storage medium may include various storage media such as a USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. A transmitting unit (not shown) for transmitting the signal output from the entropy encoding unit 240 and / or a storage unit (not shown) for storing the signal may be configured as an internal / external element of the encoding device 200, or the transmitting unit may be included in the entropy encoding unit 240.

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

[0057] Meanwhile, Luma Mapping with Chroma Scaling (LMCS) may be applied during picture encoding and / or restoration.

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

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

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

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

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

[0063] When a bitstream including video / image information is input, the decoding device 300 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 300 can derive units / blocks based on information about block division obtained from the bitstream. The decoding device 300 can perform decoding using the processing units applied by the encoding device. Therefore, the processing units for decoding may be, for example, coding units, and the coding units may be divided from coding tree units or maximal coding units according to a quadtree 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 video signal decoded and output by the decoding device 300 can then be played back via a playback device.

[0064] The decoding device 300 may receive a signal output from the encoding device of FIG. 2 in the form of a bitstream, and the received signal may be decoded via the entropy decoding unit 310. For example, the entropy decoding unit 310 may parse the bitstream to derive information (e.g., video / video information) necessary for video reconstruction (or picture reconstruction). The video / video 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 / video 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 decoder 310 may decode information in a bitstream based on a coding method such as Exponential-Golomb Coding, CAVLC, or CABAC, and output values ​​of syntax elements required for image restoration and quantized values ​​of transform coefficients related to the residual. 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, decoded information on neighboring and current blocks, or information on symbols / bins decoded in previous stages, predicts the occurrence probability of the bins based on the determined context model, performs arithmetic decoding of the bins, and generates 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 310, information related to prediction is provided to the prediction unit 330, and information related to the residual on which entropy decoding is performed by the entropy decoding unit 310, i.e., quantized transform coefficients and related parameter information, may be input to the inverse quantization unit 321. Also, among the information decoded by the entropy decoding unit 310, information related to filtering may be provided to the filtering unit 350. 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 300, or the receiving unit may be a component of the entropy decoding unit 310. 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 310, and the sample decoder may include at least one of the inverse quantization unit 321, the inverse transform unit 322, the prediction unit 330, the addition unit 340, the filtering unit 350, and the memory 360.

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

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

[0067] The prediction unit may perform prediction on the 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 310, and may determine a specific intra / inter prediction mode.

[0068] The predictor may generate a prediction signal based on various prediction methods, which will be described later. For example, the predictor may not only apply intra prediction or inter prediction for prediction of a block, but also apply intra prediction and inter prediction simultaneously. This may be referred to as combined inter and intra prediction (CIIP). The predictor may also perform intra block copy (IBC) for prediction of a block. The intra block copy may be used for content image / video coding such as games, for example, as in SCC (Screen Content Coding). IBC basically performs prediction within a current picture, but may be performed similarly to inter prediction in deriving a reference block within the current picture. That is, IBC may utilize at least one of the inter prediction techniques described in this document.

[0069] The intra prediction unit 332 can 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 from the current block depending on the prediction mode. Prediction modes in intra prediction can include a plurality of non-directional modes and a plurality of directional modes. The intra prediction unit 332 can also determine the prediction mode to be applied to the current block using the prediction modes applied to neighboring blocks.

[0070] The inter predictor 331 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 predictor 331 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.

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

[0072] The adder 340 may be referred to as a reconstruction unit or a reconstruction block generator. The generated reconstruction signal may be used for intra prediction of the 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 the next picture.

[0073] Meanwhile, Luma Mapping with Chroma Scaling (LMCS) can be applied in the picture decoding process.

[0074] The filtering unit 350 may apply filtering to the reconstructed signal to improve subjective / objective image quality. For example, the filtering unit 350 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 360, specifically, to the DPB of the memory 360. The various filtering methods may include, for example, deblock filtering, sample adaptive offset, an adaptive loop filter, a bilateral filter, etc.

[0075] The (modified) reconstructed picture stored in the DPB of the memory 360 can be used as a reference picture in the inter predictor 331. The memory 360 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 331 to be used as motion information of a spatially surrounding block or a temporally surrounding block. The memory 360 can store reconstructed samples of reconstructed blocks in the current picture and transmit them to the intra predictor 332.

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

[0077] As described above, prediction is performed to improve compression efficiency when video coding is performed. 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 video encoding efficiency by signaling information (residual information) regarding the residual between the original block and the predicted block to the decoding device, rather than the original sample values ​​of the original block. 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.

[0078] The residual information may be generated through a transform and quantization procedure. For example, an encoding device may derive a residual block between the original block and the 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 to a decoding device (via a bitstream). 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 perform an inverse quantization / inverse transform procedure based on the residual information to derive residual samples (or a residual block). The decoding device may generate a reconstructed picture based on the predicted block and the residual block. The encoding device may also derive a residual block by inverse quantizing / inverse transforming quantized transform coefficients for reference for inter-prediction of a subsequent picture, and generate a reconstructed picture based on the residual block.

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

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

[0081] The transform unit may perform a primary transform based on residual samples (residual sample array) in the residual block to derive primary transform coefficients (S410). 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.

[0082] The multi-core 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-core transform may refer to a transform method for transforming a spatial domain residual signal (or a residual block) into a frequency domain transform coefficient (or a primary transform coefficient) 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 primary transform coefficient may be referred to as a tentative transform coefficient from the perspective of a transform unit.

[0083] 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-core 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.

[0084] When the multi-core 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.

[0085] Also, according to one example, when applying MTS to perform a linear transform, 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.

[0086] In this case, MTS index information can be encoded and signaled to a decoding device to indicate one of a number (plurality) 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.

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

[0088] [Table 1]

[0089] The transform unit performs a secondary transform based on the (primary) transform coefficients to derive modified (secondary) transform coefficients (S420). The primary transform is a transform from the spatial domain to the frequency domain, and the secondary transform is a transform to a more compressed representation by utilizing 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, the non-separable transform matrix can be used to simultaneously apply a vertical transform and a horizontal transform to the (first-order) transform coefficients without separately applying the vertical transform and the horizontal transform (or independently applying the horizontal-vertical transform). In other words, the non-separable second-order transform refers to a transform method in which, instead of applying the vertical and horizontal transforms to the (first-order) transform coefficients separately, a two-dimensional signal (transform coefficients) is rearranged into a one-dimensional signal in a specific direction (e.g., row-first or column-first), and then a modified transform coefficient (or second-order transform coefficient) is generated based on the non-separable transform matrix. For example, the row-major order is to arrange the first row, the second row, ..., the Nth row in a row for an MxN block, and the column-major order is to arrange the first column, the second column, ..., the Mth column in a row for an MxN block. The non-separable second-order 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 may be applied to the upper left 8x8 region of the transform coefficient block.Furthermore, if the width (W) and height (H) of the transform coefficient block are both equal to or greater than 4, but the width (W) or height (H) of the transform coefficient block is less than 8, a 4x4 non-separable quadratic transform may be applied to the upper left min(8,W)xmin(8,H) region of the transform coefficient block. However, the embodiment is not limited thereto, and for example, even if only the condition that the width (W) or height (H) of the transform coefficient block is both equal to or greater than 4 is satisfied, a 4x4 non-separable quadratic transform may be applied to the upper left min(8,W)xmin(8,H) region of the transform coefficient block.

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

[0091] The above 4×4 input block X can be expressed as follows:

[0092] <Formula 1>

number

[0093] When the above X is expressed as a vector, the vector JPEG2026026349000004.jpg84 can be represented as follows:

[0094] <Formula 2>

number

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

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

[0097] <Formula 3>

number

[0098] where: JPEG2026026349000008.jpg75 denotes a transform coefficient vector, and T denotes a 16x16 (non-separable) transform matrix.

[0099] Through the above formula 3, the 16 × 1 transform coefficient vector JPEG2026026349000009.jpg75 can be derived from the above JPEG2026026349000010.jpg75 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.

[0100] Meanwhile, the non-separable quadratic transform may have a transform kernel (or transform core, transform type) selected mode-dependently, where the mode may include an intra-prediction mode and / or an inter-prediction mode.

[0101] As described above, the non-separable quadratic transform can 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 all equal to or greater than 8, and the 8x8 region can 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 all equal to or greater than 4, and the 4x4 region can be the upper-left 4x4 region within the transform coefficient block. For example, the 8x8 transform kernel matrix can be a 64x64 / 16x64 matrix, and the 4x4 transform kernel matrix can be a 16x16 / 8x16 matrix.

[0102] 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.

[0103] 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.

[0104] 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.

[0105] 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 through 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, depending on the case, an intra prediction mode numbered 67 may also be used, and the intra prediction mode numbered 67 may indicate a Linear Model (LM) mode.

[0106] FIG. 5 exemplarily shows the intra-directional modes of 65 prediction directions.

[0107] Referring to FIG. 5, intra prediction modes can be divided into those with horizontal directionality and those with vertical directionality, centered on intra prediction mode No. 34, which has a prediction direction on the lower right diagonal. H and V in FIG. 5 represent horizontal and vertical directions, 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. Intra prediction modes No. 2 to No. 33 have horizontal directionality, while intra prediction modes No. 34 to No. 66 have vertical directionality. Strictly speaking, intra prediction mode No. 34 can be considered neither horizontally nor vertically oriented, but can be classified as horizontally oriented from the perspective of determining a transform set for secondary transforms. This is because input data is transposed for vertical modes symmetrical with respect to the 34th intra prediction mode, and an input data alignment method for horizontal modes is used for the 34th intra prediction mode. Transposing the input data means that for MxN 2D block data, rows become columns and columns become rows, forming NxM data. The 18th and 50th intra prediction modes indicate horizontal and vertical intra prediction modes, respectively. The 2nd intra prediction mode predicts in the upper right direction using a reference pixel on the left, so it may be called an upper right diagonal intra prediction mode. In the same context, the 34th intra prediction mode may be called a lower right diagonal intra prediction mode, and the 66th intra prediction mode may be called a lower left diagonal intra prediction mode.

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

[0109] [Table 2]

[0110] 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.

[0111] 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 secondary transform index. The encoding device can derive a non-separable secondary transform index that points to a specific transform kernel based on a rate-distortion (RD) check and signal the non-separable secondary transform index to a decoding device. The decoding device can select one of the k transform kernels in the specific set based on the non-separable secondary transform index. For example, an index value of 0 for lfnst can point to the first non-separable secondary transform kernel, an index value of 1 for lfnst can point to the second non-separable secondary transform kernel, and an index value of 2 for lfnst can point to the third non-separable secondary transform kernel. Alternatively, an index value of 0 for lfnst can indicate that the first non-separable secondary transform is not applied to the current block, and index values ​​1 to 3 for lfnst can point to the three transform kernels.

[0112] 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 transmitted to a decoding device and an inverse quantization / inverse transform unit in an encoding device.

[0113] 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, and signaled to the decoding device and transmitted to the inverse quantization / inverse transform unit in the encoding device.

[0114] 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 (S450), and perform a primary (inverse) transform on the (primary) transform coefficients to obtain residual blocks (residual samples) (S460). 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 device and the decoding device may generate a reconstructed block based on the residual block and a predicted block, and generate a reconstructed picture based on the reconstructed block.

[0115] Meanwhile, the decoding apparatus may further include a secondary inverse transform application determining unit (or an element determining whether the secondary inverse transform can be applied) 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 the secondary inverse transform can be applied. For example, the secondary inverse transform may be NSST, RST, or LFNST, and the secondary inverse transform application determining unit may determine whether the secondary inverse transform can be applied based on a secondary transform flag parsed from the bitstream. As another example, the secondary inverse transform application determining unit may determine whether the secondary inverse transform can be applied based on transform coefficients of a residual block.

[0116] 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 the current block based on an LFNST (NSST or RST) transform set specified by an intra prediction mode. In addition, as an embodiment, the secondary transform decision method may be determined depending on the primary transform decision method. Various combinations of the primary transform and the secondary transform may be determined depending on the intra prediction mode. In addition, as an 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.

[0117] 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 samples). 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.

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

[0119] 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 while accompanied by a reasonably acceptable performance degradation compared to existing 9-bit or 10-bit implementations. Furthermore, expressing the kernel matrix in 8 bits may enable the use of smaller multipliers, making it more suitable for SIMD (Single Instruction Multiple Data) instructions used for optimal software implementation.

[0120] In this specification, RST may refer to a transform performed on residual samples for a current block based on a transform matrix whose size is reduced by a simplification factor. When a simplified transform is performed, the amount of calculation required during the transform may be reduced due to the reduced size of the transform matrix. That is, RST may be used to resolve the problem of computational complexity that occurs during the transform of a large block or a non-separable transform.

[0121] 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, or a simple transform, and the names that 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.

[0122] On the other hand, when the second-order inverse transform is performed based on the RST, the inverse transform unit 235 of the encoding device 200 and the inverse transform unit 322 of the decoding device 300 may include an inverse RST unit that derives modified transform coefficients based on the inverse RST for 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.

[0123] FIG. 6 is a diagram illustrating an RST according to one embodiment of this document.

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

[0125] 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, a reduction factor, a simplified factor, or a simple factor. Meanwhile, R may be referred to as a reduced 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.

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

[0127] 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.

[0128] <Formula 4>

number

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

[0130] 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 6 can be expressed by a matrix operation as shown in Equation 5 below. In this case, the memory and multiplication operations can be reduced to about 1 / 4 due to the simplification factor.

[0131] 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 the matrix is ​​multiplied by the column vector to obtain the column vector.

[0132] <Formula 5>

number

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

[0134] <Formula 6>

number

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

[0136] Considering the size of the transformation matrix, the size of a normal transformation matrix is ​​64x64 (NxN), but the size of a simplified transformation matrix is ​​reduced to 16x64 (RxN), so compared to performing a normal transformation, 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.

[0137] In one embodiment, the transform unit 232 of the encoding device 200 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 322 of the decoding device 300, and the inverse transform unit 322 of the decoding device 300 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.

[0138] Inverse RST matrix T according to one embodiment NxRThe 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. RxN and are in a transpose relationship.

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

[0140] More specifically, when the inverse RST is applied to the secondary inverse transform, the inverse RST matrix T RxN T Alternatively, an inverse RST may be applied to the inverse linear transform, in which case the inverse RST matrix T RxN T When multiplied by , the residual samples for the current block can be derived.

[0141] 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. 6 can be expressed by a matrix operation as shown in Equation 7 below.

[0142] <Formula 7>

number

[0143] In Formula 7, c1 to c 16 may represent the transform coefficients for the current block. As a result of the operation of Equation 7, r represents 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.

[0144] <Formula 8>

number

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

[0146] 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. An 8x8 lfnst and an 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 current block to be transformed are all equal to or greater than 8, and the 8x8 region can be the upper left 8x8 region within the block of transform coefficients. Similarly, a 4x4 lfnst and a 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 current block are all equal to or greater than 4, and the 4x4 region can be the upper left 4x4 region within the block of transform coefficients.

[0147] 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, a 16x1 vector can be generated by sequentially multiplying the 16x48 matrix and the 48x1 vector. 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 transform kernel matrix of up to 16x48, 16 modified transform coefficients are generated, and the 16 modified transform coefficients can be arranged in the upper left 4x4 area according to the scan order, and the upper right 4x4 area and the lower left 4x4 area can be filled with 0s.

[0148] A transposed matrix of the above-described transform kernel matrix may 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 may be configured as a one-dimensional vector in a predetermined arrangement order, and a modified coefficient vector obtained by multiplying the one-dimensional vector by the matrix of the inverse RST on the left side may be arranged in a two-dimensional block in a predetermined arrangement order.

[0149] 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.

[0150] Conversely, when the inverse RST or LFNST is applied to an 8x8 region during the inverse transform process, 16 transform coefficients corresponding to the upper left side of the 8x8 region are input in a one-dimensional array format according to the scan order and may be subjected to a matrix operation with a 48x16 transform kernel matrix. That is, the matrix operation in this case may be expressed as (48x16 matrix) * (16x1 transform coefficient vector) = (48x1 modified transform coefficient vector). Here, an nx1 vector may 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 may be derived, and the 48 modified transform coefficients may be arranged in the upper left, upper right, and lower left regions of the 8x8 region, excluding the lower right region.

[0151] On the other hand, when the second-order inverse transform is performed based on the RST, the inverse transform unit 235 of the encoding device 200 and the inverse transform unit 322 of the decoding device 300 may include an inverse RST unit that derives modified transform coefficients based on the inverse RST for 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.

[0152] 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.

[0153] 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.

[0154] <Formula 9>

number

[0155] In the above formula 9, x and y are the input and output of the quadratic transformation, respectively, and G is a matrix representing the quadratic transformation, with the transform basis vector being composed of column vectors. 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, the transpose of matrix G is G T It becomes a dimension of.

[0156] In the case of the backward LFNST, the dimensions of the matrix G are [48×16], [48×8], [16×16], and [16×8]. The [48×8] and [16×8] matrices are submatrices obtained by sampling the eight transformation basis vectors from the left side of the [48×16] and [16×16] matrices, respectively.

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

[0158] 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] vector or a [16x1] vector as the input x, the 2D data output from the forward transform must be appropriately arranged to construct a one-dimensional vector.

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

[0160] The arrangement direction of the output data of the forward linear transform may be determined depending on the intra prediction mode of the current block. For example, if the intra prediction mode of the current block is horizontal with respect to the diagonal direction, the output data of the forward linear transform may be arranged in the order of (a) of Figure 7, and if the intra prediction mode of the current block is vertical with respect to the diagonal direction, the output data of the forward linear transform may be arranged in the order of (b) of Figure 7.

[0161] As an example, an ordering different from that shown in (a) and (b) of Figures 7 can be applied, and in order to derive the same result (y vector) as when the ordering shown in (a) and (b) of Figures 7 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.

[0162] 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 again be appropriately arranged into 2D data.

[0163] FIG. 8 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.

[0164] In the case of LFNST, the output values ​​can be arranged in a 2D block according to a predetermined scan order. Figure 8(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 8(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 8(b) indicates that the values ​​are filled with 0.

[0165] 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 8. However, in the case of residual coding, data coding may be performed in units of 2D blocks (e.g., 4x4) such as coefficient groups (CGs), and in this case, data may be arranged in a specific order such as the diagonal scan order of Figure 8.

[0166] Meanwhile, the decoding device can arrange (arrange) 2D data output through an inverse quantization process 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:

[0167] <Formula 10>

number

[0168] 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.

[0169] The output vector x is arranged in a two-dimensional block according to the order shown in FIG. 7 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.

[0170] 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.

[0171] In the inverse LFNST, one of eight [48x16] matrices and eight [16x16] matrices can be selected as the transformation matrix G. Which of the [48x16] and [16x16] matrices to apply is determined by the size and shape of the block.

[0172] 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 according to the intra prediction mode. More specifically, the transform set is determined based on an extended intra prediction mode value, taking into account even a wide angle intra prediction mode (WAIP). Which of the two matrices constituting the selected transform set to select is determined through index signaling. More specifically, the index value to be transmitted 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.

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

[0174] Typical intra prediction mode values ​​can range from 0 to 66 and from 81 to 83, and as shown, intra prediction mode values ​​extended by WAIP can range from -14 to 83. Values ​​from 81 to 83 refer to CCLM (Cross Component Linear Model) modes, and values ​​from -14 to -1 and values ​​from 67 to 80 refer to intra prediction mode values ​​extended by applying WAIP.

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

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

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

[0178] [Table 3]

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

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

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

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

[0183] If the above is not the case, and all of the following conditions are met: (1) the height of the current block is greater than the width, (2) the intra prediction mode before modification is equal to or less than 66, and (3) the intra prediction mode is greater than the value derived from (60-2*whRatio) if the variable whRatio is greater than 1, or greater than 60 if the variable whRatio is equal to or less than 1 [predModeIntra is greater than (whRatio>1)?(60-2*whRatio):60], then the intra prediction mode is set to a value 67 less than the intra prediction mode [predModeIntra is set equal to (predModeIntra-67)].

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

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

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

[0187] Figure 10 shows the shapes of blocks to which LFNST is applied. In Figure 10, (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.

[0188] In Figure 10, blocks with thick borders indicate regions to which LFNST is applied. For blocks (a) and (b) in Figure 10, LFNST is applied to the top-left 4x4 region, and for block (c) in Figure 10, LFNST is applied to each of the two consecutively arranged top-left 4x4 regions. Because LFNST is applied in units of 4x4 regions in Figures 10(a), (b), and (c), this type of LFNST is hereinafter referred to as "4x4 LFNST," and a [16x16] or [16x8] matrix can be applied as the transformation matrix based on the matrix dimension for G in Equation 9 and Equation 10.

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

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

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

[0192] Depending on the block shape, the corresponding forward LFNST (4x4 LFNST or 8x8 LFNST) 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.

[0193] FIG. 11 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.

[0194] The shaded area in the upper left of the block shown in Figure 11 corresponds to the area where the output data of the forward LFNST is located, and the positions marked with 0 indicate samples filled with 0 values, while the remaining areas indicate 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.

[0195] As mentioned above, the dimensions of the transformation matrix applied vary depending on the block shape, and so does the number of output data. As shown in Figure 11, the output data of the forward LFNST may not fill the entire upper-left 4x4 block. In 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, generating an [8x1] vector at the output of the forward LFNST. That is, according to the scan order shown in Figure 8(b), only eight output data points are filled as shown in Figures 11(a) and 11(d), and the remaining eight positions are filled with zeros. In the case of the block to which the LFNST is applied in Figure 10(d), the two 4x4 blocks on the upper-right and lower-left sides adjacent to the upper-left 4x4 block are also filled with zeros, as shown in Figure 11(d).

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

[0197] 1) As shown in Figure 11(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

[0198] 2) As shown in Figure 11(d) and (e), 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.

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

[0200] For example, in the case of the LFNST adopted in the VVC standard, signaling of the LFNST index is performed after residual coding, so that the encoding device can determine whether non-zero data (significant coefficients) are present 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 are present, and the decoding device can determine whether parsing of the LFNST index is possible. If non-zero data is not present in the areas specified in 1) and 2) above, the LFNST index is signaled.

[0201] Because a truncated unary code is applied as the binarization method for an LFNST index, an LFNST index consists of a maximum of two bins, and the possible LFNST index values ​​of 0, 1, and 2 are assigned binary codes of 0, 10, and 11, respectively. In one example, context-based CABAC coding (regular coding) may be applied to the first bin, and context-based CABAC coding may also be applied to the second bin. The coding of an LFNST index is shown in the table below.

[0202] [Table 4]

[0203] As shown in Table 4, for the first bean (binIdx = 0), context 0 can be applied in the case of a single tree, and context 1 can be applied in the case of a non-single tree. Also, as shown in Table 4, context 2 can be applied to the second bean (binIdx = 1). In other words, two contexts can be assigned to the first bin, and one context can be assigned to the second bin, and each context can be distinguished by the ctxInc value (0, 1, 2).

[0204] Here, the term "single tree" means that the luma component and the chroma component are coded using the same coding structure. If the size of a coding unit falls below a certain threshold while the coding unit is being divided while having the same coding structure, and the luma component and the chroma component are coded using separate tree structures, the coding unit is considered to be a dual tree, and the context of the first bin can be determined. That is, the first context can be assigned as shown in Table 4.

[0205] Alternatively, you can code using context 0 if the value of the variable treeType of the first bean is assigned to SINGLE_TREE, otherwise use context 1.

[0206] Meanwhile, the following simplification method can be applied to the adopted LFNST.

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

[0208] In the case of (c) of Figure 10, 4x4 LFNST can be applied to each of the two 4x4 regions adjacent to the upper left, generating up to 32 pieces of 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 in the upper left even for a 4xN / Nx4 (N≧16) block (TU or CU), and LFNST can be applied only once to all blocks in Figure 10. This simplifies the implementation of video encoding.

[0209] As an example, Figure 12 shows that the number of output data items for the forward LFNST is limited to a maximum of 16. As shown in Figure 12, 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.

[0210] (ii) As an example, zero-out can be applied to areas where LFNST is not applied. In this document, zero-out can mean that the values ​​of all positions belonging to a specific area are filled with 0. In other words, zero-out can also 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.

[0211] (ii)-(A) When a 4x4 LFNST is applied, it is possible to zero out areas to which the 4x4 LFNST is not applied. Figure 13 illustrates zeroing out in a block to which the 4x4 LFNST is applied, according to an example.

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

[0213] On the other hand, (d) of FIG. 13 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.

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

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

[0216] (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 allows checking whether non-zero data exists over a wider area than the LFNST method in Figure 11.

[0217] 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. 11 as well as in the areas further filled with zeros in FIG. 14, and then perform signaling for the LFNST index only if non-zero data does not exist.

[0218] 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 11 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. 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 11.

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

[0220] Embodiment

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

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

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

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

[0225] In the above embodiment, when LFNST is applied, the region in which non-zero output data can exist is restricted to the interior of the upper left 4x4 region. More specifically, in the cases of (a) in Figure 13 and (a) in Figure 14, the eighth position in scan order is the last position in which non-zero data can exist, and in the cases of (b) and (d) in Figure 13 and (b) in Figure 14, the sixteenth position in 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.

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

[0227] 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, the zero-out method 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:

[0228] First, it reduces the amount of computation required to perform the entire transformation process as described above.

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

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

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

[0232] 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.

[0233] 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 for the entire transform execution remains the same or is reduced, making it easier to implement the encoding device.

[0234] Meanwhile, conventional intra prediction performs coding without division, regarding a block to be currently coded as one coding unit. However, ISP (Intra Sub-Partitions) coding means dividing a block to be currently coded horizontally or vertically and performing intra prediction coding. In this case, coding / decoding is performed on a divided block basis 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 is intra predicted 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.

[0235] Meanwhile, in the following we look carefully at the signaling of the LFNST index and the MTS index.

[0236] The following tables show an example of a coding unit syntax table, a transform unit syntax table, and a residual coding syntax table related to the signaling of LFNST and MTS indices. According to Table 5, the MTS index is moved from the transform unit level to the coding unit level syntax and is signaled after the LFNST index signaling. Furthermore, when ISP is applied to a coding unit, the restriction that does not allow LFNST is removed, so LFNST can be applied to all intra-predicted blocks. Furthermore, all of the MTS and LFNST indices are conditionally signaled at the end of the coding unit level.

[0237] [Table 5]

[0238] [Table 6]

[0239] [Table 7]

[0240] The main variables in the above table have the following meanings:

[0241] CbWidth, CbHeight: Width and height of the current coding block

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

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

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

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

[0246] 6. intra_mip_flag[x0][y0]: The content related to the (x0, y0) position is the same as that of No. 4 above. intra_mip_flag is a flag indicating whether or not the MIP (Matrix-based Intra Prediction) prediction mode is applied. If the flag value is 0, it indicates that MIP cannot be applied, and if the flag value is 1, it indicates that MIP is applied.

[0247] 7. cIdx: A value of 0 represents luma, and values ​​of 1 and 2 represent the chroma components Cb and Cr, respectively.

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

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

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

[0251] 11. lfnst_idx[ x0 ][ y0 ]: The LFNST index syntax element to be parsed. If not parsed, it is inferred to a zero value. In other words, the default value is set to zero, which indicates that LFNST is not applied.

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

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

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

[0255] 15. tu_mts_idx[ x0 ][ y0 ]: The MTS index syntax element to be parsed. If not parsed, it is inferred to a zero value. That is, the default value is set to zero, which indicates that DCT-2 is applied to both the horizontal and vertical directions.

[0256] As shown in Table 5, several conditions are checked when coding mts_idx[x0][y0], and tu_mts_idx[x0][y0] is signaled only if the lfnst_idx[x0][y0] value is 0.

[0257] Also, tu_Cbf_luma[x0][y0] is a flag indicating whether or not there is a valid coefficient for the luma component.

[0258] According to Table 5, when the width and height of the coding unit of the luma component are all less than or equal to 32, mts_idx[ x0 ][ y0 ] is signaled (Max( CbWidth, CbHeight ) <= 32), that is, whether MTS is applied or not depends on the width and height of the coding unit for the luma component.

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

[0260] On the other hand, mts_idx[x0][y0] can only be signaled when not in ISP mode (IntraSubPartitionsSplit[x0][y0] == ISP_NO_SPLIT).

[0261] As shown in Table 7, in the process of determining log2ZoTbWidth and log2ZoTbHeight (where log2ZoTbWidth and log2ZoTbHeight respectively indicate the base-2 log values ​​of the width and height of the remaining upper-left corner region after zeroing out), the part checking the mts_idx[x0][y0] (x0][y0]) value can be omitted.

[0262] Also, according to one example, a condition can be added to check sps_mts_enable_flag when determining log2ZoTbWidth and log2ZoTbHeight in residual coding.

[0263] The variable LfnstZeroOutSigCoeffFlag in Table 5 is 0 if there is a valid coefficient at a position that will be zeroed out when LFNST is applied, and is 1 otherwise. The variable LfnstZeroOutSigCoeffFlag can be set according to various conditions shown in Table 7.

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

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

[0266] Meanwhile, as shown in Table 5, if tu_Cbf_luma[x0][y0] is 0, mts_idx[x0][y0] coding can be omitted. That is, if the CBF value of the luma component is 0, no transformation is applied, so there is no need to signal the MTS index, and therefore MTS index coding can be omitted.

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

[0268] The variable MtsDcOnly may be initially set to 1 at the coding unit level, and then its value may be changed to 0 if it indicates that significant coefficients exist in the area excluding the DC area of ​​the current block at the residual coding level. When the variable MtsDcOnly is 0, the video information may be configured so that an MTS index is signaled.

[0269] If tu_Cbf_luma[x0][y0] is 0, the residual coding syntax is not called at the transform unit level in Table 6, so the variable MtsDcOnly maintains its initial value of 1. In this case, since the variable MtsDcOnly has not been changed to 0, the video information may be configured so that the MTS index is not signaled. In other words, the MTS index is not parsed or signaled.

[0270] Meanwhile, the decoding device can determine the color index cIdx of the transform coefficient to derive the variable MtsZeroOutSigCoeffFlag in Table 7. A color index (cIdx) of 0 indicates a luma component.

[0271] According to one example, MTS can be applied only to the luma component of the current block, so that the decoding device can determine whether a color index is luma when deriving the variable MtsZeroOutSigCoefFlag, which determines whether parsing of the MTS index is possible.

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

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

[0274] In this way, when deriving a variable that determines whether parsing of an MTS index is possible, it is determined whether the color component is luma or chroma. However, since LFNST can be applied to all of the luma or chroma components of the current block, the color component is not determined when deriving a variable that determines whether parsing of an LFNST index k is possible.

[0275] For example, Table 5 shows a variable LfnstZeroOutSigCoeffFlag that can indicate that zeroing out has been performed when applying LFNST. The variable LfnstZeroOutSigCoeffFlag indicates whether there are valid coefficients in the second region excluding the first region at the top left of the current block. This value is initially set to 1, and if there are valid coefficients in the second region, this value can be changed to 0. The initially set value of the variable LfnstZeroOutSigCoeffFlag should be maintained at 1 so that the LFNST index can be parsed. When determining and deriving whether the variable LfnstZeroOutSigCoeffFlag value is 1, the color index of the current block is not determined because LFNST can be applied to all of the luma components or chroma components of the current block.

[0276] Meanwhile, a syntax table of a coding unit signaling an LFNST index according to an example is as follows:

[0277] [Table 8]

[0278] In Table 8, lfnst_idx means an LFNST index and can have values ​​of 0, 1, or 2 as described above. As shown in Table 8, lfnst_idx is signaled only if the condition (!intra_mip_flag[x0][y0] || Min(lfnstWidth, lfnstHeight) >= 16) is met. Here, intra_mip_flag[x0][y0] is a flag indicating whether MIP (Matrix-based Intra Prediction) mode is applied to the luma block to which the (x0, y0) coordinate belongs. If the MIP mode is applied to the luma block, its value is 1, and if not, its value is zero.

[0279] lfnstWidth and lfnstHeight indicate the width and height to which LFNST is applied to the currently coded coding block (including all of the luma coding block and chroma coding block). When ISP is applied to the coding block, they can indicate the width and height of each partition block divided into two or four.

[0280] In addition, in the above condition, Min(lfnstWidth, lfnstHeight) >= 16 indicates that when MIP is applied, LFNST can be applied only when the block is 16x16 or larger (for example, when the width and height of the luma coding block to which MIP is applied are both 16 or larger). The meanings of the main variables included in Table 8 that do not overlap with the explanation in Table 4 are briefly introduced as follows.

[0281] 1. IntraSubPartitionSplitType: Indicates how ISP partitioning was performed for the current coding unit. ISP_NO_SPLIT means that the coding unit is not divided into partition blocks. ISP_VER_SPLIT indicates vertical division, and ISP_HOR_SPLIT indicates horizontal division. For example, if a W x H (width W, height H) block is divided horizontally into n partition blocks, it is divided into W x (H / n) blocks. If a W x H (width W, height H) block is divided vertically into n partition blocks, it is divided into (W / n) x H blocks.

[0282] 2. SubWidthC, SubHeightC: SubWidthC and SubHeightC are values ​​set according to the color format (or chroma format, e.g., 4:2:0, 4:2:2, 4:4:4), and more specifically, they indicate the ratio of the width and height of the luma and chroma components, respectively (see the table below).

[0283] [Table 9]

[0284] 3. NumIntraSubPartitions: Indicates the number of partition blocks into which the data is divided when ISP is applied. In other words, it indicates that the data is divided into NumIntraSubPartitions partition blocks.

[0285] 4. LfnstDcOnly: For all transform blocks belonging to the current coding unit, if the last non-zero coefficient position is a DC position (i.e., the top-left position within the transform block) or there is no significant coefficient (i.e., the corresponding CBF value is 0), the value of the LnfstDCOnly variable is 1.

[0286] In the case of a luma separate-tree or luma dual-tree, the above condition is checked only for transform blocks corresponding to the luma component in the coding unit to determine the value of the LfnstDcOnly variable, and in the case of a chroma separate-tree or chroma dual-tree, the above condition is checked only for transform blocks corresponding to the chroma components (Cb, Cr) in the corresponding coding unit to determine the value of the LfnstDcOnly variable. In the case of a single tree, the above condition is checked for all transform blocks corresponding to the luma component and chroma components (Cb, Cr) in the coding unit to determine the value of the LfnstDcOnly variable.

[0287] 5. LfnstZeroOutSigCoeffFlag: Set to 1 if valid coefficients exist only in the region where valid coefficients can exist when applying LFNST, otherwise set to 0.

[0288] In the case of a 4x4 transform block or an 8x8 transform block, up to eight significant coefficients can be located from the (0,0) position (top-left) in the transform block in the scan order, and the remaining positions in the transform block are zeroed out. In the case of a transform block that is not 4x4 or 8x8 but has a width and height of 4 or more (i.e., a transform block to which LFNST can be applied), up to 16 significant coefficients can be located from the (0,0) position (top-left) in the transform block in the scan order (i.e., significant coefficients can only be located in the top-left 4x4 block), and the remaining positions in the transform block are zeroed out.

[0289] Also, as shown in Table 8, when coding is performed using a separate tree or dual tree, the application of MIP to chroma components is not checked when signaling the LFNST index, so that LFNST can be properly applied to chroma components.

[0290] As shown in Table 8, if (treeType == DUAL_TREE_CHROMA) and the condition (!intra_mip_flag[x0][y0] || Min(lfnstWidth, lfnstHeight) >= 16) is met, the LFNST index is signaled. This means that the LFNST index is signaled if the tree type is the dual tree chroma type (treeType == DUAL_TREE_CHROMA), MIP mode is not applied (!intra_mip_flag [x0] [y0]), or the smaller of the width and height of the block to which LFNST is applied is 16 or greater (Min(lfnstWidth, lfnstHeight) >= 16)). In other words, if the coding block is dual tree chroma, the LFNST index is signaled without determining whether MIP mode is applied or the width and height of the block to which LFNST is applied.

[0291] In addition, the above condition can be interpreted as meaning that if the coding block is not dual-tree chroma and MIP is not applied, the LFNST index is signaled without determining the width and height of the block to which LFNST is applied.

[0292] In addition, the above condition can be interpreted as meaning that if the coding block is not dual-tree chroma but MIP is applied, the LFNST index is signaled when the smaller of the width and height of the block to which LFNST is applied is 16 or greater.

[0293] On the other hand, as shown in Table 8, the LFNST index is signaled only when no transform skip is applied to the luma component (that is, when the condition transform_skip_flag[x0][y0]

[0000] ==0 is satisfied).

[0294] Here, x0 and y0 refer to the (x0, y0) coordinates when the position of the top left corner of the luma component picture is (0, 0). The horizontal X coordinate increases from left to right, and the vertical Y coordinate increases from top to bottom.

[0295] Although (x0, y0) is a coordinate based on the luma component, it can also be used for the chroma component, in which case the actual position pointed to by (x0, y0) can be scaled based on the picture for the chroma component. For example, if the chroma format is 4:2:0, the actual position on the picture pointed to by (x0, y0) for the chroma component can be (x0 / 2, y0 / 2). Then, x0 and y0 can refer to the coordinates for the luma component regardless of whether the currently coded component is luma or chroma.

[0296] In transform_skip_flag[x0][y0]

[0000] , the last index 0 means the luma component. More specifically, in transform_skip_flag[x0][y0][cIdx], cIdx indicates which component it is for, and if the cIdx value is 0, it represents luma, and if cIdx is greater than 0 (1 or 2), it represents chroma.

[0297] Also, the variable LfnstDcOnly is initialized to a value of 1 as shown in Table 8, and can be set to a value of 0 depending on the conditions in the parsing function of the residual coding as shown in the table below.

[0298] [Table 10-1]

[0299] [Table 10-2]

[0300] As shown in Table 10, the LfnstDcOnly value can be set to 0 only when the value of transform_skip_flag[x0][y0][cIdx] is 0 (i.e., only when transform skip is not applied to the component pointed to by cIdx). When not in ISP mode, as shown in Table 8, the LFNST index is signaled only when the LfnstDcOnly value is 0, and when the LFNST index is not signaled, the LFNST index value can be inferred to be zero.

[0301] For reference, the residual coding functions listed in Table 10 are called while executing the transform tree (transform_tree) called in Table 8. In the case of a single tree, the residual coding function for luma (cIdx = 0) and the function for chroma (cIdx = 1 or 2, corresponding to the Cb and Cr components) are all called. In the case of a dual tree, in the case of a luma dual tree (DU residual coding AL_TREE_LUMA), only the residual coding function for luma (cIdx = 0) is called, and in the case of a chroma dual tree (DUAL_TREE_CHROMA), only the residual coding function for chroma (cIdx = 1 or 2, corresponding to the Cb and Cr components) is called.

[0302] The conditions for signaling the LFNST index when not in ISP mode are summarized as follows (here, it can be assumed that other conditions for signaling the LFNST index are met, for example, it is assumed that the condition Max(CbWidth, CbHeight) <= MaxTbSizeY is satisfied):

[0303] 1. transform_skip_flag[ x0 ][ y0 ]

[0000] is 1

[0304] - LFNST index is not signaled and is inferred as a zero value

[0305] 2. transform_skip_flag[ x0 ][ y0 ]

[0000] is 0

[0306] 2-A. When transform_skip_flag[ x0 ][ y0 ]

[0001] is 0 and transform_skip_flag[ x0 ][ y0 ]

[0002] is 0

[0307] - For all cIdx in Table 10 (when cIdx is 0, 1, or 2), the LfnstDcOnly value can be set to 0

[0308] - If LfnstDcOnly value is 0, signal the L,FNST index, otherwise do not signal the LFNST index and infer a 0 value.

[0309] 2-B. When transform_skip_flag[ x0 ][ y0 ]

[0001] is 0 and transform_skip_flag[ x0 ][ y0 ]

[0002] is 1

[0310] - In Table 10, the LfnstDcOnly value can be set to 0 only when cIdx is 0 or 1.

[0311] - If LfnstDcOnly value is 0, signal the LFNST index; otherwise, do not signal the LFNST index and infer a value of 0.

[0312] 2-C. When transform_skip_flag[ x0 ][ y0 ]

[0001] is 1 and transform_skip_flag[ x0 ][ y0 ]

[0002] is 0

[0313] - The LfnstDcOnly value can be set to 0 only when cIdx is 0 or 2 in Table 10

[0314] - If LfnstDcOnly value is 0, signal the LFNST index; otherwise, do not signal the LFNST index and infer a value of 0.

[0315] When 2-D.transform_skip_flag[ x0 ][ y0 ]

[0001] is 1 and transform_skip_flag[ x0 ][ y0 ]

[0002] is 1

[0316] - Only when cIdx is 0 in Table 10, the LfnstDcOnly value can be set to 0

[0317] - If LfnstDcOnly value is 0, signal the LFNST index; otherwise, do not signal the LFNST index and infer a value of 0.

[0318] For a single tree, mode-check the values ​​of transform_skip_flag[ x0 ][ y0 ]

[0000] , transform_skip_flag[ x0 ][ y0 ]

[0001] , and transform_skip_flag[ x0 ][ y0 ]

[0002] for the above cases; for a luma dual tree, only check transform_skip_flag[ x0 ][ y0 ]

[0000] ; and for a chroma dual tree, check the values ​​of transform_skip_flag[ x0 ][ y0 ]

[0001] and transform_skip_flag[ x0 ][ y0 ]

[0002] .

[0319] In the ISP mode (IntraSubPartitionsSplitType!=ISP_NO_SPLIT condition in Table 8, meaning horizontal or vertical split), the LFNST index is signaled as shown in Table 8 without checking the LfnstDcOnly variable.

[0320] Therefore, in single tree and luma dual tree, in ISP mode, the LFNST index is signaled if the transform_skip_flag[x0][y0]

[0000] value is 0 (transform skip is not applied to the luma component), regardless of the LfnstDcOnly variable value (if the LFNST index is not signaled, the LFNST index value can be inferred to be 0 (zero)).

[0321] In the case of a chroma dual tree, noting that ISP prediction is only applied to luma in the current VVC standard, ISP is considered not to be applied to chroma, and the LFNST index can be signaled by checking the LfnstDcOnly variable as described above. As shown in Table 10, the LfnstDcOnly variable can be set to 0 only if the transform_skip_flag[x0][y0][cIdx] value is (0).

[0322] Of course, the application of ISP mode for luma also affects the case of chroma dual tree, and even in the case of chroma dual tree, it is also possible to signal the LFNST index for the case where transform_skip_flag[x0][y0]

[0000] value is 0, regardless of the LfnstDcOnly variable.

[0323] When the ISP mode is applied and the value of transform_skip_flag[x0][y0]

[0000] is 0, the conditions under which the LFNST index is signaled can be summarized as follows: When the value of transform_skip_flag[x0][y0][0] is 1, the LFNST index is not signaled and is inferred as 0. Of course, it can be assumed that other conditions required for signaling the LFNST index in Table 8 are met, for example, that Max(CbWidth, CbHeight)<=MaxTbSizeY is met.

[0324] 1. Single tree

[0325] - LFNST index signaling regardless of the value of the LfnstDcOnly variable

[0326] 2. Dual tree

[0327] 2-A. Luma's Dual Tree

[0328] - LFNST index signaling regardless of the value of the LfnstDcOnly variable

[0329] 2-B. Chroma Dual Tree

[0330] - Depending on the values ​​of transform_skip_flag[x0][y0][1] and transform_skip_flag[x0][y0][2], the LfnstDcOnly variable value may be set to 0. That is, when transform_skip_flag[x0][y0][cIdx] to cIdx, the LfnstDcOnly variable value may be set to 0 only when the transform_skip_flag[x0][y0] value is 0. When the cIdx value is 2, the LfnstDcOnly variable value may be set to 0 only when the transform_skip_flag[x0][y0][cIdx] value is 1. transform_skip_flag[x0][y0][1] value is 0 and when the cIdx value is 2, the LfnstDcOnly variable value can be set to 0 only when the transform_skip_flag[x0][y0][2] value is 0).

[0331] - If the LfnstDcOnly value is 0, the LFNST index is signaled; otherwise, the LFNST index is not signaled and is inferred as a 0 value.

[0332] In the above case, the chroma dual tree case is the same as when ISP is not applied.

[0333] Meanwhile, according to one example, in the current VVC standard, transform skip for chroma components is permitted, and a transform skip flag (transform_skip_flag) corresponding to each chroma component is added as shown in the table below.

[0334] [Table 11]

[0335] It can be seen that, except for the case of the luma dual tree in Table 11, transform_skip_flag[xC][yC]

[0001] , which corresponds to whether or not a transform skip can be applied to Cb, and transform_skip_flag[xC][yC] [2], which corresponds to whether or not a transform skip can be applied to Cr, can be signaled. If the value of transform_skip_flag[xC][yC]

[0001] is 1, a transform skip to Cb is applied, and if it is 0, a transform skip to Cb is not applied (not applied). If the value of transform_skip_flag[xC][yC] [2] is 1, a transform skip to Cr is applied, and if it is 0, a transform skip to Cr is not applied (not applied).

[0336] Therefore, even if the LFNST index value is greater than 0 (i.e., LFNST is applied), the values ​​of transform_skip_flag[x0][y0][cIdx] for the luma component (Y component) and chroma components (Cb component and Cr component) may be different. According to Table 8 above, the LFNST index value may be greater than 0 only when the transform_skip_flag[x0][y0]

[0000] value is 0, so for LFNST index values ​​greater than 0, the transform_skip_flag[x0][y0]

[0000] value is always 0.

[0337] Therefore, the cases in which LFNST can be applied depending on the value of transform_skip_flag[x0][y0][cIdx] can be summarized as follows: Here, the LFNST index is greater than 0 and the value of transform_skip_flag[x0][y0][0] is 0. It can be assumed that other conditions for applying LFNST are met; for example, the width and height of the corresponding block may all be 4 or greater.

[0338] 1. Single Tree

[0339] - For the luma component, apply LFNST

[0340] transform_skip_flag[ x0 ][ y0 ]

[0001] If the value is 0, LFNST is applied to the Cb component. If the value is 1, LFNST is not applied to the Cb component.

[0341] -transform_skip_flag[ x0 ][ y0 ]

[0002] If the value is 0, apply LFNST to the Cr component. If the value is 1, do not apply LFNST to the Cr component.

[0342] 2. Luma's Dual Tree

[0343] - Apply LFNST to luma component

[0344] 3. Chroma Dual Tree

[0345] -transform_skip_flag[ x0 ][ y0 ]

[0001] If the value is 0, apply LFNST to the Cb component. If the value is 1, do not apply LFNST to the Cb component.

[0346] -transform_skip_flag[ x0 ][ y0 ]

[0002] If the value is 0, apply LFNST to the Cr component. If the value is 1, do not apply LFNST to the Cr component.

[0347] As mentioned above, if you want to selectively apply LFNST based on the value of transform_skip_flag[x0][y0][cIdx], you should add the following condition to the LFNST specification text:

[0348] [Table 12-1]

[0349] [Table 12-2]

[0350] As shown in Table 12, when the LFNST index (lfnst_idx) value is not 0 (i.e., when LFNST is applied), the transform_skip_flag[xTbY][yTbY][cIdx] value of the component specified by cIdx is checked (When lfnst_idx is not equal to 0 and transform_skip_flag[xTbY][yTbY][cIdx] is equal to 0 and both nTbW and nTbH are greater than or equal to 4, the following applies:) Only if transform_skip_x[[ is true, the subsequent coding process is executed, i.e., LFNST is applied). (As shown in Table 12, when the LFNST index (lfnst_idx) value is not 0 (that is, when LFNST is applied), by checking the transform_skip_flag[xTbY][yTbY][cIdx] value for the component specified by cIdx (When lfnst_idx is not equal to 0 and transform_skip_flag[xTbY][yTbY][cIdx] is equal to 0 and both nTbW and nTbH are greater than or equal to 4, the following applies), it may be configured such that the subsequent coding process is performed only when the transform_skip_flag[xTbY][yTbY][cIdx] value is 0, that is, LFNST is applied.)

[0351] Meanwhile, the LFNST index can be signaled depending on whether or not a transform skip is performed for each color component.

[0352] As an example, in comparison with Table 8, in Table 13, the condition of transmitting an LFNST index only when the transform_skip_flag[x0][y0][0] value is 0 can be removed.

[0353] [Table 13]

[0354] However, since the method for setting the LfnstDcOnly variable value described in Table 13 is the same as that described in Table 10, the setting of the LfnstDcOnly variable value changes depending on the value of transform_skip_flag[x0][y0][cIdx], and ultimately whether or not signaling of the LFNST index is possible also changes.

[0355] To summarize how the LFNST index is signaled by the value of transform_skip_flag[x0][y0][cIdx] when ISP mode is not applied, it can be assumed that other conditions for signaling the LFNST index are already met, for example, Max(CbWidth, CbHeight) <= MaxTbSizeY.

[0356] 1. Single tree

[0357] - If the value of transform_skip_flag[x0][y0][0] is 0, the value of the LfnstDcOnly variable can be set to 0 according to the method shown in Table 10.

[0358] - If the value of transform_skip_flag[x0][y0][1] is 0, the value of the LfnstDcOnly variable can be set to 0 according to the method shown in Table 10.

[0359] - If the value of transform_skip_flag[x0][y0][2] is 0, the value of the LfnstDcOnly variable may be set to 0 according to the method shown in Table 10.

[0360] - If the LfnstDcOnly value is 0, the LFNST index can be signaled. If the LFNST index is not signaled, it can be inferred as 0 (zero).

[0361] 2. Dual-tree case for luma component

[0362] - If the value of transform_skip_flag[x0][y0][0] is 0, the value of the LfnstDcOnly variable may be set to 0 according to the method shown in Table 10.

[0363] - If the LfnstDcOnly value is 0, the LFNST index can be signaled. If the LFNST index is not signaled, it can be inferred as 0.

[0364] 3. Dual tree for chroma components

[0365] - If the value of transform_skip_flag[x0][y0][1] is 0, you can set the value of the LfnstDcOnly variable to 0 by following the method shown in Table 10.

[0366] - If the value of transform_skip_flag[x0][y0][2] is 0, you can set the value of the LfnstDcOnly variable to 0 according to the method shown in Table 10.

[0367] - If the LfnstDcOnly value is 0, the LFNST index can be signaled. If the LFNST index is not signaled, it can be inferred as 0.

[0368] As shown in Table 13, the LfnstDcOnly value is initialized to 1, and in the case of a dual tree, the LFNST index corresponding to the luma dual tree and the LFNST index corresponding to the chroma dual tree can be signaled separately. This means that different LFNST kernels can be applied to luma and chroma.

[0369] In addition, the dual trees shown in Tables 8 to 13 may include DUAL_TREE_LUMA (corresponding to the luma component) and DUAL_TREE_CHROMA (corresponding to the chroma component) that appear in the current VVC specification document, and this includes cases where the luma syntax parsing tree and the chroma syntax parsing tree are differentiated depending on the size conditions of the coding unit, etc. For example, this includes cases of separated trees.

[0370] When the ISP mode is applied, transform_skip_flag[x0][y0][0] is not signaled and is inferred to 0 as shown in Table 11. That is, as shown in Table 11, transform_skip_flag[x0][y0][0] is signaled only when the condition IntraSubPartitionsSplit[x0][y0]==ISP_NO_SPLIT is met, which is the case when the ISP mode is not applied.

[0371] Furthermore, as shown in Table 11, transform_skip_flag[x0][y0][1] and transform_skip_flag[x0][y0][2] can be signaled regardless of whether ISP mode is applied.

[0372] Therefore, LFNST signaling when the ISP mode is applied can be summarized as follows: It can be assumed that other conditions for signaling the LFNST index are already met, for example, conditions such as Max(CbWidth, CbHeight) <= MaxTbSizeY can be met.

[0373] 1. Single tree

[0374] - The LFNST index can be signaled. If the LFNST index is not signaled, it can be inferred as 0.

[0375] 2. Dual-tree case for luma component

[0376] - The LFNST index can be signaled. If the LFNST index is not signaled, it can be inferred as 0.

[0377] Dual tree for chroma components

[0378] - If the value of transform_skip_flag[x0][y0][1] is 0, you can set the value of the LfnstDcOnly variable to 0 by following the method shown in Table 10.

[0379] - If the value of transform_skip_flag[x0][y0][2] is 0, you can set the value of the LfnstDcOnly variable to 0 according to the method shown in Table 10.

[0380] - If the LfnstDcOnly value is 0, the LFNST index can be signaled. If the LFNST index is not signaled, it can be inferred as 0.

[0381] When the ISP mode is applied, the LfnstDcOnly condition is not checked, as shown in Table 13. Therefore, in the first single-tree case above and the second dual-tree case for the luma component, the LFNST index can be signaled without checking the LfnstDcOnly condition. In the case of a dual-tree for chroma, as in case 3 above, the LFNST index can be signaled according to the same conditions as when the ISP mode is not applied. That is, the LFNST index is signaled according to the LfnstDcOnly condition.

[0382] According to one example, a transform_skip_flag[x0][y0][cIdx] value can be given to each of the luma component and two chroma components, so that even if the LFNST index value is greater than 0, i.e., even if LFNST is applied, LFNST can be applied to the component pointed to by cIdx only when the transform_skip_flag[x0][y0][cIdx] value is 0. The corresponding changes to the specification text are the same as those in Table 12.

[0383] According to one example, if the condition for checking whether the transform_skip_flag[x0][y0]

[0000] value is 0 is removed only in the case of a dual tree, as compared to Table 8, the LFNST index signaling can be configured as shown in Table 14. The LfnstDcOnly variable shown in Table 14 can be set to 0 depending on the conditions as shown in Table 10.

[0384] [Table 14]

[0385] With the configuration shown in Table 14, the LFNST index signaling methods shown in Tables 8 to 10 can be applied in the case of a single tree, and the method shown in Table 13 can be applied in the case of a dual tree. Also, since the transform_skip_flag[x0][y0][cIdx] values ​​are respectively assigned to the luma component and the two chroma components, even if the LFNST index value is greater than 0 (i.e., when LFNST is applied), as shown in Tables 8 to 10, it is possible to configure so that LFNST is applied to the component pointed to by cIdx only when the transform_skip_flag[x0][y0][cIdx] value is 0. The content of the specification text to be changed is the same as that in Table 12.

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

[0387] FIG. 15 is a flowchart illustrating the operation of a video decoding device according to one embodiment of the present document.

[0388] The steps disclosed in Fig. 15 are based on some of the content described above in Fig. 4 to Fig. 14. Therefore, the description of specific content that overlaps with the content described above in Fig. 3 to Fig. 14 will be omitted or simplified.

[0389] A decoding device 300 according to an embodiment may receive information about an intra prediction mode, residual information, and an LFNST index from a bitstream (S1510).

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

[0391] The decoding device may also receive information about an intra-prediction mode for the current block and information about 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. The decoding device may also derive the size and number of sub-partition blocks to be divided from the flag information indicating the direction in which the current block is divided.

[0392] The decoding device 300 performs inverse quantization on the residual information for the current block, that is, the quantized transform coefficients, to derive the transform coefficients (S1520).

[0393] 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.

[0394] A decoding device can apply LFNST to the transform coefficients to derive modified transform coefficients.

[0395] Unlike linear transforms, which separate and transform coefficients in the vertical or horizontal direction, LFNST is a non-separable transform that applies a transform without separating the coefficients in a specific direction. This 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.

[0396] The LFNST index information is received in the syntax information, which may be received as a binarized string containing 0's and 1's.

[0397] The LFNST index syntax element in 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.

[0398] That is, according to one embodiment, the syntax element value of the LFNST index may include 0 to indicate that no inverse LFNST is applied to the current block, 1 to indicate a first one of the transform kernel matrices, or 2 to indicate a second one of the transform kernel matrices.

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

[0400] To determine whether parsing of the LFNST index for the current block is possible, the decoding device may derive a variable indicating whether an ISP is applied to the current block according to the tree type of the current block or whether a significant coefficient exists in the DC component of the current block, and the variable may be derived based on individual transform skip flag values ​​for the color components of the current block (S1530).

[0401] The LFNST index can be parsed regardless of the value of the variable if the current block is single-type or dual-tree luma and ISP is applied, and if the current block is dual-tree chroma or ISP is not applied to the current block, the LFNST index can be parsed based on the variable indicating that there is a significant coefficient in a position that is not a DC component.

[0402] The variable indicating whether the DC component of the current block has a valid coefficient can be represented by a variable LfnstDcOnly, which is 0 if there is a non-zero coefficient in a position other than the DC component for at least one transform block in a coding unit, and is 1 if there is no non-zero coefficient in a position other than the DC component for all transform blocks in a coding unit. In this document, the DC component refers to (0, 0) or the top-left position as the position reference for 2D components.

[0403] A single coding unit may include multiple transform blocks. For example, for a chroma component, there may be Cb and Cr transform blocks, and for a single-tree type, there may be luma, Cb, and Cr transform blocks. According to one example, if a non-zero coefficient is found in any transform block other than the DC component position in one of the transform blocks constituting the current coding block, the value of the variable LfnstDcOnly may be set to 0.

[0404] On the other hand, if a transform block does not contain any non-zero coefficients, residual coding is not performed on the corresponding transform block, and the value of the variable LfnstDcOnly is not changed by the corresponding transform block. Therefore, if a transform block does not contain any non-zero coefficients in a position other than the direct current (DC) component, the value of the variable LfnstDcOnly remains unchanged and maintains its previous value. For example, if a coding unit is coded using a single tree type and the value of the variable LfnstDcOnly is changed to 0 for a luma transform block, the value of the variable LfnstDcOnly remains zero if the Cb transform block contains a non-zero coefficient only in the DC component or if the Cb transform block does not contain any non-zero coefficients. The variable LfnstDcOnly value is initially initialized to 1, and if none of the components in the current coding unit can update the value of the variable LfnstDcOnly to 0, it remains at 1. If at least one of the transform blocks constituting the coding unit updates the value of the variable LfnstDcOnly to 0, it is finally maintained at zero.

[0405] On the other hand, such a variable LfnstDcOnly may be derived based on individual transform skip flag values ​​for the color components of the current block. The transform skip flag of the current block may be signaled for each color component, and when the tree type of the current block is single tree, the variable LfnstDcOnly may be derived based on the value of the transform skip flag for the luma component, the value of the transform skip flag for the chroma Cb component, and the value of the transform skip flag for the chroma Cr component. Alternatively, when the tree type of the current block is dual tree luma, the variable LfnstDcOnly may be derived based on the value of the transform skip flag for the luma component, and when the tree type of the current block is dual tree chroma, the variable LfnstDcOnly may be derived based on the value of the transform skip flag for the chroma Cb component and the value of the transform skip flag for the chroma Cr component.

[0406] According to one example, the variable LfnstDcOnly may indicate that a significant coefficient is present in a position other than the DC component based on the transform skip flag values ​​of the color components being zero. That is, if the tree type of the current block is single tree, the variable LfnstDcOnly may be derived as zero based on the transform skip flag values ​​for the luma component, the chroma Cb component, and the chroma Cr component being zero. Alternatively, if the tree type of the current block is dual tree luma, the variable LfnstDcOnly may be derived as zero based on the transform skip flag values ​​for the luma component being zero. If the tree type of the current block is dual tree chroma, the variable LfnstDcOnly may be derived as zero based on the transform skip flag values ​​for the chroma Cb component and the chroma Cr component being zero.

[0407] As mentioned above, the variable LfnstDcOnly may be initially set to 1 at the coding unit level of the current block, and if the transform skip flag value is 0, the variable LfnstDcOnly may be changed to 0 at the residual coding level.

[0408] On the other hand, as described above, in the case of a luma block to which the intra sub-partition (ISP) mode can be applied, the decoding device can parse the LFNST index without deriving the variable LfnstDcOnly.

[0409] Specifically, when the ISP mode is applied and the value of the transform skip flag for the luma component, i.e., transform_skip_flag[x0][y0][0], is 0, if the tree type of the current block is a single tree or a luma dual tree, the LFNST index can be signaled regardless of the value of the variable LfnstDcOnly.

[0410] On the other hand, for chroma components to which the ISP mode is not applied, the value of the variable LfnstDcOnly can be set to 0 depending on the values ​​of transform_skip_flag[x0][y0][1], which is the transform skip flag for the chroma Cb component, and transform_skip_flag[x0][y0][2], which is the transform skip flag for the chroma Cr component. In other words, when the cIdx value in transform_skip_flag[x0][y0][cIdx] is 1, the value of the variable LfnstDcOnly can be set to 0 only when the value of transform_skip_flag[x0][y0][1] is 0, and when the cIdx value is 2, the value of the variable LfnstDcOnly can be set to 0 only when the value of x0][y0]

[0002] (transform_skip_flag[x0][y0][2]) is 0. If the variable LfnstDcOnly value is 0, the decoding device can parse the LFNST index; otherwise, the LFNST index is not signaled and can be inferred as a zero value.

[0411] Thereafter, the decoding apparatus can derive modified transform coefficients from the transform coefficients based on the LFNST index and the LFNST matrix for the LFNST (S1540).

[0412] The decoding device can set multiple variables for the LFNST based on whether the LFNST index is not zero, i.e., whether the LFNST index is greater than zero and whether the individual transform skip flag values ​​for the color components are zero.

[0413] For example, in the step of applying LFNST after parsing the LFNST index, the decoding device may again determine whether the individual transform skip flag values ​​for the color components are zero, and may set various variables for applying LFNST, such as an intra prediction mode for selecting an LFNST set, the number of transform coefficients output after applying LFNST, and the size of the block to which LFNST is applied.

[0414] For blocks coded using BDPCM, the transform skip flag may be automatically set to 1. In this case, the transform skip flag may be 1 even if the LFNST index is not 0. Therefore, the transform skip flag value for each color component can be rechecked when actually applying LFNST.

[0415] Alternatively, according to one example, there may be a situation where the transform skip flag value is not checked if the flag value indicating whether there is a significant coefficient coded in the transform block is zero. In this case, too, since the transform skip flag value is not guaranteed to be 0 simply because the LFNST index is not zero, it is possible to recheck the transform skip flag value for each color component when actually applying the LFNST.

[0416] That is, the decoding device can check the transform skip flag value for each color component during the LFNST index parsing step, and can recheck the transform skip flag value for each color component when actually applying the LFNST.

[0417] 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 any one of a plurality of LFNST matrices based on the LFNST set and the LFNST index.

[0418] 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.

[0419] 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 included in the transform set indicated by the LFNST index, i.e., one of the LFNST matrices. 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 transposed relative to the matrix used in forward LFNST.

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

[0421] The decoding device derives residual samples for the current block based on a linear inverse transform on the modified transform coefficients (S1550).

[0422] In this case, the inverse linear transformation can use a general separation transformation, or the above-mentioned MTS can also be used.

[0423] Subsequently, decoding device 300 may generate reconstructed samples based on the residual samples for the current block and the predicted samples for the current block.

[0424] 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.

[0425] FIG. 16 is a flowchart showing the operation of a video encoding device according to an embodiment of the present document.

[0426] The steps disclosed in Fig. 16 are based on some of the content described above with reference to Figs. 4 to 14. Therefore, the description of specific content that overlaps with the content described above with reference to Figs. 2 and 4 to 14 will be omitted or simplified.

[0427] The coding apparatus 200 according to an embodiment may derive predicted samples of the current block based on the intra prediction mode applied to the current block.

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

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

[0430] 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.

[0431] The encoding apparatus 200 may derive residual samples of the current block based on the predicted samples (S1610).

[0432] Encoding apparatus 200 may apply at least one of LFNST or MTS to the residual samples to derive transform coefficients of the current block, and arrange the transform coefficients according to a predetermined scanning order.

[0433] The encoding device may derive transform coefficients for the current block based on a linear transform on the residual samples (S1620).

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

[0435] The encoding device 200 can determine whether to perform a quadratic or non-separable transform, specifically LFNST, on the transform coefficients for the current block, and can apply LFNST to the transform coefficients to derive modified transform coefficients.

[0436] Unlike linear transforms, which separate and transform coefficients in the vertical or horizontal direction, 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.

[0437] The encoding device may apply multiple LFNST matrices to the transform coefficients to derive a variable indicating whether significant coefficients exist in the DC component of the current block, and according to one example, may derive modified transform coefficients based on a variable indicating whether an ISP is applied to the current block according to the tree type of the current block or whether significant coefficients exist in the DC component of the current block, where the variable may be derived based on individual transform skip flag values ​​for the color components of the current block (S1630).

[0438] The encoding device can apply LFNST to the current block based on whether the current block is single-type or dual-tree luma and whether ISP is applied, and can select an LFNST matrix based on a variable indicating whether the DC component has a significant coefficient if the tree type of the current block is dual-tree chroma or if ISP is not applied.

[0439] The encoding device can derive variables for each LFNST matrix candidate after applying LFNST, or for those for which LFNST is not applied, without applying LFNST.

[0440] Specifically, the encoding device applies multiple LFNST candidates, i.e., LFNST matrices, and eliminates corresponding LFNST matrices in which significant coefficients of all transform blocks exist only at DC positions (of course, if CBF is 0, it is excluded from the variable determination process). RD values ​​can be compared only between LFNST matrices for which the variable LfnstDcOnly value is zero. For example, when LFNST is not applied, the RD values ​​are included in the comparison process because they are unrelated to the variable LfnstDcOnly value (in this case, since LFNST is not applied, the LfnstDcOnly variable value can be determined based on the transform coefficients obtained as a result of the primary transform), and LFNST matrices for which the LfnstDcOnly value is zero are also included in the RD value comparison process.

[0441] The variable indicating whether there is a valid coefficient in the DC component of the current block can be represented by the variable LfnstDcOnly, which is 0 if there is a non-zero coefficient in a non-DC component position for at least one transform block in a coding unit, and is 1 if there is no non-zero coefficient in a non-DC component position for all transform blocks in a coding unit.

[0442] There may be multiple transform blocks in one coding unit. For example, in the case of a chroma component, there may be Cb and Cr transform blocks, and in the case of a single-tree type, there may be luma, Cb, and Cr transform blocks. According to an example, if a non-zero coefficient is found in any transform block other than the DC component position in one of the transform blocks constituting the current coding block, the value of the variable LfnstDcOnly may be set to 0.

[0443] On the other hand, if a transform block does not contain any non-zero coefficients, residual coding is not performed on the corresponding transform block, and therefore the value of the variable LfnstDcOnly is not changed by the transform block. Therefore, if there are no non-zero coefficients in a position other than the DC component of the transform block, the value of the variable LfnstDcOnly is not changed and maintains its previous value. For example, if a coding unit is coded using a single tree type and the value of the variable LfnstDcOnly is changed to 0 by the luma transform block, the value of the variable LfnstDcOnly remains zero if there are non-zero coefficients only in the DC component of the Cb transform block or if there are no non-zero coefficients in the Cb transform block. The value of the variable LfnstDcOnly is initially initialized to 1, and remains 1 if none of the components in the current coding unit can update the value of the variable LfnstDcOnly to 0. If at least one of the transform blocks constituting the coding unit updates the value of the variable LfnstDcOnly to 0, the value of the variable LfnstDcOnly is finally maintained at 0.

[0444] Meanwhile, such a variable LfnstDcOnly may be derived based on individual transform skip flag values ​​for the color components of the current block. The transform skip flag of the current block may be signaled for each color component, and when the tree type of the current block is single tree, the variable LfnstDcOnly may be derived based on the value of the transform skip flag for the luma component, the value of the transform skip flag for the chroma Cb component, and the value of the transform skip flag for the chroma Cr component. Alternatively, when the tree type of the current block is dual tree luma, the variable LfnstDcOnly may be derived based on the value of the transform skip flag for the luma component, and when the tree type of the current block is dual tree chroma, the variable LfnstDcOnlyg may be derived based on the value of the transform skip flag for the chroma Cb component and the value of the transform skip flag for the chroma Cr component.

[0445] According to one example, the variable LfnstDcOnly may indicate that a significant coefficient is present at a position other than the DC component when the transform skip flag value of a color component is zero. That is, when the tree type of the current block is single tree, the variable LfnstDcOnly may be derived to zero when at least one of the transform skip flag values ​​for the luma component, the chroma Cb component, and the chroma Cr component is zero. Alternatively, when the tree type of the current block is dual tree luma, the variable LfnstDcOnly may be derived to zero when at least one of the transform skip flag values ​​for the luma component is zero. When the tree type of the current block is dual tree chroma, the variable LfnstDcOnly may be derived to zero when at least one of the transform skip flag values ​​for the chroma Cb component and the chroma Cr component is zero.

[0446] As mentioned above, the variable LfnstDcOnly may be initially set to 1 at the coding unit level of the current block, and if the transform skip flag value is 0, the variable LfnstDcOnly may be changed to 0 from the residual coding level.

[0447] The encoding device can select an optimal LFNST matrix based on the variable indicating that a significant coefficient exists at a position other than the DC component, and derive modified transform coefficients based on the selected LFNST matrix.

[0448] In deriving the modified transform coefficients, the encoding apparatus may set multiple variables for the LFNST based on whether the respective transform skip flag values ​​for the color components are zero.

[0449] For example, after determining whether to apply LFNST, the encoding device may again determine whether the transform skip flag value for each color component is 0 in the step of applying LFNST, and set various variables for applying LFNST. For example, the encoding device may set an intra prediction mode for selecting an LFNST set, the number of transform coefficients output after applying LFNST, the size of the block to which LFNST is applied, etc.

[0450] For blocks coded using BDPCM, the transform skip flag may be automatically set to 1, so that the transform skip flag value for each color component can be rechecked when applying LFNST.

[0451] Alternatively, according to one example, there may be a situation where the transform skip flag value is not checked when the flag value indicating whether there is a significant coefficient coded in the transform block is zero. In this case, too, since the transform skip flag value is not guaranteed to be 0 simply because the LFNST index is not zero, it is possible to recheck the transform skip flag value for each color component when actually applying the LFNST.

[0452] That is, the encoding device may check the value of the transform skip flag for each color component when determining whether LFNST is applicable, and may recheck the value of the transform skip flag for each color component when actually applying LFNST.

[0453] On the other hand, as described above, in the case of a luma block to which the intra sub-partition (ISP) mode can be applied, LFNST can be applied without deriving the variable LfnstDcOnly.

[0454] Specifically, when the ISP mode is applied and the transform skip flag for the luma component, i.e., the value of transform_skip_flag[x0][y0][0], is 0, the tree type of the current block is a single tree or a luma dual tree, and Lfnst can be applied regardless of the value of the variable LfnstDcOnly.

[0455] On the other hand, for chroma components to which the ISP mode is not applied, the value of the variable LfnstDcOnly can be set to 0 depending on the values ​​of transform_skip_flag[x0][y0][1], which is the transform skip flag for the chroma Cb component, and transform_skip_flag[x0][y0][2], which is the transform skip flag for the chroma Cr component. In other words, when the cIdx value in transform_skip_flag[x0][y0][cIdx] is 1, the value of the variable LfnstDcOnly can be set to 0 only when the value of transform_skip_flag[x0][y0][1] is 0, and when the cIdx value is 2, the value of the variable LfnstDcOnly can be set to 0 only when the value of x0][y0]

[0002] (transform_skip_flag[x0][y0][2]) is 0. If the variable LfnstDcOnly value is 0, the encoding device can apply LFNST; otherwise, LFNST is not applied.

[0456] The encoding device 200 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.

[0457] 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.

[0458] 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.

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

[0460] The encoding device may configure the video information such that the variable LfnstDcOnly is initially set to 1 at the coding unit level of the current block, and if the transform skip flag value is 0, the variable LfnstDcOnly is changed to 0 from the residual coding level, and an LFNST index indicating the LFNST matrix to be applied to the LFNST based on the variable LfnstDcOnly being 0 is parsed.

[0461] The encoding device may perform quantization based on the modified transform coefficients for the current block to derive quantized transform coefficients and encode the LFNST index.

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

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

[0464] The LFNST index syntax element according to this embodiment can indicate whether (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.

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

[0466] 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.

[0467] In this document, at least one of quantization / dequantization and / or transform / inverse transform may be omitted. When the quantization / inverse quantization 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 expression.

[0468] 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 the 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.

[0469] 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 the steps, and some steps may occur in a different order or simultaneously than those described above. Also, 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 of the flowchart may be deleted without affecting the scope of this document.

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

[0471] In this document, when an embodiment is implemented in software, the method described above may be implemented as a module (process, function, etc.) that performs the function described above. The module may be stored in memory and executed by a processor. The memory may be internal or external to the processor and may be connected (coupled) to the processor by various well-known means. 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 drawing may be implemented and executed on a computer, processor, microprocessor, controller, or chip.

[0472] 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 video-on-demand (VoD) service providing device, an over-the-top (OTT) video device, an internet streaming service providing device, a three-dimensional (3D) video device, a video telephone video device, and 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.

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

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

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

[0476] The encoding server compresses content input from a multimedia input device such as a smartphone, camera, or camcorder 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, or camcorder 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.

[0477] 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 informing 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.

[0478] 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.

[0479] Examples of the user device include a mobile phone, a smartphone, a laptop computer, a digital broadcasting terminal, a PDA (Personal Digital Assistant), a PMP (Portable Multimedia Player), a navigation system, a slate PC, a tablet PC, an ULTRABOOK (registered trademark), a wearable device (e.g., a smartwatch, smart glass, a head mounted display (HMD)), a digital TV, a desktop computer, a 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.

[0480] 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. obtaining residual information from the bitstream; deriving transform coefficients for a current block based on the residual information; deriving residual samples for the current block based on a non-separable transform on the transform coefficients; generating a reconstructed picture based on the residual samples; The step of deriving the residual samples comprises: parsing a first transform skip flag for the chroma Cb component of the current block; parsing a second transform skip flag for the chroma Cr component of the current block; parsing a transform index based on a value of the first transform skip flag for the chroma Cb component and a value of the second transform skip flag for the chroma Cr component; determining whether to apply the non-separable transform to the chroma Cb component based on the transform index and the first transform skip flag for the chroma Cb component; applying the non-separable transform to first transform coefficients associated with the chroma Cb component based on the determination that the non-separable transform is to be applied to the chroma Cb component; determining whether to apply the non-separable transform to the chroma-Cr component based on the transform index and the second transform skip flag for the chroma-Cr component; applying the non-separable transform to second transform coefficients associated with the chroma-Cr component based on the determination that the non-separable transform is applied to the chroma-Cr component.

2. based on the value of the transform index being greater than 0 and the value of the first transform skip flag for the chroma Cb component being equal to 0, the non-separable transform is applied to the chroma Cb component of the current block; 2. The method of claim 1 , wherein the non-separable transform is not applied to the chroma Cb component of the current block based on the value of the transform index being greater than 0 and the value of the first transform skip flag for the chroma Cb component being equal to 1.

3. based on the value of the transform index being greater than 0 and the value of the second transform skip flag for the chroma-Cr component being equal to 0, the non-separable transform is applied to the chroma-Cr component of the current block; 2. The method of claim 1 , wherein the non-separable transform is not applied to the chroma Cr component of the current block based on the value of the transform index being greater than 0 and the value of the second transform skip flag for the chroma Cr component being equal to 1.

4. The transform index is parsed based on a variable indicating whether significant coefficients exist only in a DC component of the current block; The method of claim 1 , wherein the variable is derived based on the value of the first transform skip flag for the chroma Cb component and the value of the second transform skip flag for the chroma Cr component.

5. the value of said variable is initially set to 1 in the coding unit syntax; the value of the variable is derived as 0 based on at least one of the value of the first transform skip flag for the chroma Cb component or the value of the second transform skip flag for the chroma Cr component not being equal to 1; The method of claim 4 , wherein the transformation index is parsed based on the value of the variable being equal to zero.

6. 5. The method of claim 4, wherein the value of the variable is derived as 0 based on the value of the first transform skip flag for the chroma Cb component being equal to 1 and the value of the second transform skip flag for the chroma Cr component being equal to 0.

7. 5. The method of claim 4, wherein the value of the variable is derived as 0 based on the value of the first transform skip flag for the chroma Cb component being equal to 0 and the value of the second transform skip flag for the chroma Cr component being equal to 1.

8. 5. The method of claim 4, wherein the transform index is parsed based on the tree type of the current block being dual tree chroma and the variable indicating that the significant coefficient is present at a position other than the DC component.

9. 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 from the residual samples based on a non-separable transform; generating residual information based on the transform coefficients; encoding the video information including the residual information; the video information includes a first transform skip flag for a chroma Cb component of the current block and a second transform skip flag for a chroma Cr component of the current block; a transform index is included in the video information based on a value of the first transform skip flag for the chroma Cb component and a value of the second transform skip flag for the chroma Cr component; The step of deriving the transform coefficients comprises: determining whether to apply the non-separable transform to the chroma Cb component based on the transform index and the first transform skip flag for the chroma Cb component; applying the non-separable transform to the chroma Cb component based on the determination that the non-separable transform is to be applied to the chroma Cb component; determining whether to apply the non-separable transform to the chroma-Cr component based on the transform index and the second transform skip flag for the chroma-Cr component; applying the non-separable transform to the chroma-Cr component based on the determination that the non-separable transform is to be applied to the chroma-Cr component.

10. based on the value of the transform index being greater than 0 and the value of the first transform skip flag for the chroma Cb component being equal to 0, the non-separable transform is applied to the chroma Cb component of the current block; 10. The method of claim 9, wherein the non-separable transform is not applied to the chroma Cb component of the current block based on the value of the transform index being greater than 0 and the value of the first transform skip flag for the chroma Cb component being equal to 1.

11. based on the value of the transform index being greater than 0 and the value of the second transform skip flag for the chroma-Cr component being equal to 0, the non-separable transform is applied to the chroma-Cr component of the current block; 10. The method of claim 9, wherein the non-separable transform is not applied to the chroma Cr component of the current block based on the value of the transform index being greater than 0 and the value of the second transform skip flag for the chroma Cr component being equal to 1.

12. the transformation index is included in the image information based on a variable indicating whether significant coefficients exist only in a DC component of the current block; The method of claim 9 , wherein the variable is derived based on the value of the first transform skip flag for the chroma Cb component and the value of the second transform skip flag for the chroma Cr component.

13. the value of said variable is initially set to 1 in the coding unit syntax; the value of the variable is derived as 0 based on at least one of the value of the first transform skip flag for the chroma Cb component or the value of the second transform skip flag for the chroma Cr component not being equal to 1; The method of claim 12 , wherein the transformation index is included in the video information based on the value of the variable being equal to zero.

14. generating a bitstream, 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 from the residual samples based on a non-separable transform; generating residual information based on the transform coefficients; encoding video information including the residual information; transmitting data including the bitstream; the video information includes a first transform skip flag for a chroma Cb component of the current block and a second transform skip flag for a chroma Cr component of the current block; a transform index is included in the video information based on a value of the first transform skip flag for the chroma Cb component and a value of the second transform skip flag for the chroma Cr component; The step of deriving the transform coefficients comprises: determining whether to apply the non-separable transform to the chroma Cb component based on the transform index and the first transform skip flag for the chroma Cb component; applying the non-separable transform to the chroma Cb component based on the determination that the non-separable transform is to be applied to the chroma Cb component; determining whether to apply the non-separable transform to the chroma-Cr component based on the transform index and the second transform skip flag for the chroma-Cr component; applying the non-separable transform to the chroma-Cr component based on the determination that the non-separable transform is to be applied to the chroma-Cr component.