Image coding method and device based on transformation

By introducing a transform-based image compilation method in the image compilation system, using LFNST index and BDPCM flag information related to the transformation coefficient, the problem of efficient compression and transmission of image/video data in the prior art is solved, and more efficient images are achieved /Video compression and transmission effects.

CN115152232BActive Publication Date: 2025-02-11BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202180015735.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2020-03-29
Filing Date
2021-02-22
Publication Date
2025-02-11
Estimated Expiration
2041-02-22

AI Technical Summary

Technical Problem

The prior art is difficult to efficiently compress and transmit high-resolution and high-quality image/video data, especially in the case of increasing demand for supporting immersive media such as virtual reality, artificial reality and holograms.

Method used

By introducing transform-based image compilation methods in the image compilation system, the image decoding and encoding process are optimized and image/video compression efficiency is improved.

Benefits of technology

It realizes more efficient compression and transmission of image/video data, reduces transmission and storage costs, and improves the compilation efficiency of LFNST indexes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115152232B_ABST
    Figure CN115152232B_ABST
Patent Text Reader

Abstract

The image decoding method according to the present document includes a step of deriving a modified transform coefficient, wherein the step of deriving the modified transform coefficient includes a step of setting an LFNST application variable regarding whether to apply LFNST based on a tree type of a current block, a transform coefficient coding flag for each component of the current block, or a transform skip flag for each component of the current block, and can include a step of parsing an LFNST index based on a value of the LFNST application variable.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure generally relates to image coding technology, and more particularly, to a transformation-based image coding method and a device thereof in an image coding system. Background Art

[0002] Nowadays, the demand for high-resolution and high-quality images / videos such as 4K, 8K or higher ultra-high-definition (UHD) images / videos has been growing in various fields. As image / video data becomes higher resolution and higher quality, the amount of information or bit volume sent increases compared to traditional image data. Therefore, when using a medium such as a traditional wired / wireless broadband line to send image data or using an existing storage medium to store image / video data, its transmission cost and storage cost increase.

[0003] In addition, nowadays, interest and demand for immersive media such as virtual reality (VR) and artificial reality (AR) content or holograms are increasing, and broadcasting of images / videos having image characteristics different from real images such as game images is increasing.

[0004] Therefore, there is a need for an efficient image / video compression technology that effectively compresses and transmits or stores and reproduces information of high-resolution and high-quality images / videos having various characteristics as described above. Summary of the invention

[0005] Technical issues

[0006] A technical aspect of the present disclosure is to provide a method and a device for improving image coding efficiency.

[0007] Another technical aspect of the present disclosure is to provide a method and apparatus for increasing efficiency of coding a LFNST index.

[0008] Still another technical aspect of the present disclosure is to provide a method and apparatus for increasing efficiency of coding an LFNST index based on flag information about the presence of a BDPCM and a transform coefficient.

[0009] Technical Solution

[0010] According to an embodiment of the present disclosure, an image decoding method performed by a decoding device is provided. The method may include deriving a modified transform coefficient, wherein deriving the modified transform coefficient may include setting an LFNST application variable regarding whether to apply LFNST based on a tree type of a current block and a transform coefficient coding flag for each component of the current block or a transform skip flag for each component of the current block, and parsing an LFNST index based on a value of the LFNST application variable.

[0011] Based on the transform coefficient coding flag for each component of the current block being 0, the value of the LFNST apply variable may be set to 1, which indicates that the LFNST index is parsed.

[0012] Based on the transform skip flag for each component of the current block being 0, the value of the LFNST apply variable may be set to 1, which indicates that the LFNST index is resolved.

[0013] When the tree type is single tree, the transform skip flag for the luma component of the current block is 0, and the chroma components of the current block are in BDPCM mode, the value of the LFNST apply variable may be set to 1, indicating that the LFNST index is parsed.

[0014] The transform coefficient coding flag for chroma components may be 0.

[0015] The transform skip flag for chroma components may be inferred to be 1.

[0016] According to an embodiment of the present disclosure, an image encoding method performed by an encoding device is provided. The method may include deriving a modified transform coefficient from a transform coefficient by applying LFNST, wherein deriving the modified transform coefficient may include setting an LFNST application variable regarding whether to apply LFNST based on a tree type of a current block and a transform coefficient coding flag for each component of the current block or a transform skip flag for each component of the current block, and applying an LFNST index based on a value of the LFNST application variable.

[0017] According to another embodiment of the present disclosure, a digital storage medium storing image data including encoded image information and a bit stream generated according to an image encoding method performed by an encoding device may be provided.

[0018] According to yet another embodiment of the present disclosure, a digital storage medium may be provided, which stores image data including encoded image information and a bit stream, so that a decoding device performs an image decoding method.

[0019] Beneficial Effects

[0020] According to the present disclosure, the overall image / video compression efficiency can be increased.

[0021] According to the present disclosure, the efficiency of compiling LFNST indexes can be increased.

[0022] According to the present disclosure, it is possible to increase the efficiency of coding an LFNST index based on flag information about the presence of BDPCM and a transform coefficient.

[0023] The effects that can be obtained by the specific examples of the present disclosure are not limited to the effects listed above. For example, there may be various technical effects that can be understood or derived from the present disclosure by a person of ordinary skill in the relevant field. Therefore, the specific effects of the present disclosure are not limited to the effects explicitly described in the present disclosure, and can include various effects that can be understood or derived from the technical features of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 An example of a video / image coding system to which the present disclosure is applicable is schematically illustrated.

[0025] Figure 2 is a diagram schematically illustrating a configuration of a video / image encoding device to which the present disclosure can be applied.

[0026] Figure 3 is a diagram schematically illustrating a configuration of a video / image decoding device to which the present disclosure can be applied.

[0027] Figure 4 The structure of a content streaming system to which the present disclosure is applied is illustrated.

[0028] Figure 5 The multi-transformation technique according to an embodiment of this document is schematically illustrated.

[0029] Figure 6 The intra directional mode of 65 prediction directions is exemplarily illustrated.

[0030] Figure 7 is a diagram for explaining RST according to an embodiment of the present disclosure.

[0031] Figure 8 is a diagram illustrating an order in which output data of a forward primary transform is arranged into a one-dimensional vector according to an example.

[0032] Fig. 9 is a diagram illustrating an order in which output data of a forward sub-transform is arranged into two-dimensional blocks according to an example.

[0033] Fig.10 is a diagram illustrating a wide-angle intra prediction mode according to an embodiment of this document.

[0034] Fig.11 is a diagram illustrating a block shape to which LFNST is applied.

[0035] Fig.12 is a diagram illustrating an arrangement of output data of a forward LFNST according to an example.

[0036] Fig.13 Illustrated is zeroing in a block to which 4×4 LFNST is applied according to an example.

[0037] Fig.14 Illustrated is the clearing of zeros in a block to which 8×8 LFNST is applied according to an example.

[0038] Fig.15 is a flowchart illustrating the operation of a video decoding device according to an embodiment of the present disclosure.

[0039] Fig.16 is a flowchart illustrating the operation of a video encoding apparatus according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0040] Although the present disclosure may be susceptible to various modifications and includes various embodiments, its specific embodiments have been shown by way of example in the accompanying drawings, and will now be described in detail. However, this is not intended to limit the present disclosure to the specific embodiments disclosed herein. The terms used herein are only for the purpose of describing specific embodiments and are not intended to limit the technical ideas of the present disclosure. Unless the context clearly indicates otherwise, the singular form may include the plural form. Terms such as "including" and "having" are intended to indicate the presence of features, numbers, steps, operations, elements, components, or combinations thereof used in the following description, and therefore should not be understood as precluding the possibility of the presence or addition of one or more different features, numbers, steps, operations, elements, components, or combinations thereof.

[0041] At the same time, in order to facilitate the description of different characteristic functions, each component on the drawings described herein is independently illustrated, however, it is not intended that each component is implemented by separate hardware or software. For example, any two or more of these components can be combined to form a single component, and any single component can be divided into multiple components. Embodiments in which components are combined and / or divided will fall within the scope of the patent rights of the present disclosure as long as they do not depart from the essence of the present disclosure.

[0042] Hereinafter, preferred embodiments of the present disclosure will be described in more detail with reference to the accompanying drawings. In addition, in the accompanying drawings, the same reference numerals are used for the same components, and repeated description of the same components will be omitted.

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

[0044] In this document, various embodiments related to video / image coding may be provided, and unless specified otherwise, these embodiments may be combined with each other and performed.

[0045] In this document, a video may refer to a collection of a series of images over a period of time. Typically, a picture refers to a unit of an image representing a specific time region, and a slice / tile is a unit that constitutes a part of a picture. A slice / tile may include one or more coding tree units (CTUs). A picture may consist of one or more slices / tiles. A picture may consist of one or more tile groups. A tile group may include one or more tiles.

[0046] A pixel or a picture element (pel) may refer to the smallest unit constituting a picture (or image). In addition, "sample" may be used as a term corresponding to a pixel. A sample may generally represent a pixel or a pixel value, and may represent only a pixel / pixel value of a luminance component or only a pixel / pixel value of a chrominance component. Alternatively, a sample may mean a pixel value in a spatial domain, or when the pixel value is transformed into a frequency domain, it may mean a transform coefficient in a frequency domain.

[0047] A unit may represent a basic unit of image processing. A unit may include at least one of a specific region and information related to the region. A unit may include a luminance block and two chrominance (e.g., cb, cr) blocks. Depending on the situation, terms such as unit, block, region, etc. may be used interchangeably. In general, an M×N block may include a set (or array) of samples (or sample arrays) or transform coefficients consisting of M columns and N rows.

[0048] In this document, the terms " / " and "," should be interpreted as indicating "and / or". For example, the expression "A / B" may mean "A and / or B". In addition, "A, B" may mean "A and / or B". In addition, "A / B / C" may mean "at least one of A, B, and / or C". In addition, "A / B / C" may mean "at least one of A, B, and / or C".

[0049] In addition, in this document, the term "or" should be interpreted as indicating "and / or". For example, the expression "A or B" may include 1) only A, 2) only B, and / or 3) both A and B. In other words, the term "or" in this document should be interpreted as indicating "additionally or alternatively".

[0050] In the present disclosure, “at least one of A and B” may mean “only A”, “only B”, or “both A and B”. In addition, in the present disclosure, the expression “at least one of A or B” or “at least one of A and / or B” may be interpreted as “at least one of A and B”.

[0051] Furthermore, in the present disclosure, “at least one of A, B, and C” may mean “only A”, “only B”, “only C”, or “any combination of A, B, and C”. Furthermore, “at least one of A, B, or C” or “at least one of A, B and / or C” may mean “at least one of A, B, and C”.

[0052] In addition, the brackets used in the present disclosure may mean "for example". Specifically, when the indication is "prediction (intra-frame prediction)", it may mean that "intra-frame prediction" is proposed as an example of "prediction". In other words, the "prediction" of the present disclosure is not limited to "intra-frame prediction", and "intra-frame prediction" is proposed as an example of "prediction". In addition, when the indication is "prediction (ie, intra-frame prediction)", this may also mean that "intra-frame prediction" is proposed as an example of "prediction".

[0053] Technical features described separately in one drawing in the present disclosure may be implemented separately or may be implemented simultaneously.

[0054] Figure 1 An example of a video / image coding system to which the present disclosure is applicable is schematically illustrated.

[0055] refer to Figure 1 The video / image coding system may include a first device (source device) and a second device (receiving device). The source device may deliver coded video / image information or data to the receiving device in the form of a file or stream via a digital storage medium or a network.

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

[0057] The video source can obtain the video / image by capturing, synthesizing or generating the process of the video / image. The video source may include a video / image capturing device and / or a video / image generating device. The video / image capturing device may include, for example, one or more cameras, a video / image archive including previously captured videos / images, etc. The video / image generating device may include, for example, a computer, a tablet computer, and a smart phone, and may (electronically) generate the video / image. For example, a virtual video / image may be generated by a computer, etc. In this case, the video / image capturing process may be replaced by the process of generating the relevant data.

[0058] The encoding device can encode the input video / image. The encoding device can perform a series of processes 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.

[0059] The transmitter may transmit the encoded video / image information or data output in the form of a bit stream to a receiver of a receiving device in the form of a file or stream through a digital storage medium or a network. The digital storage medium may include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. The transmitter may include an element for generating a media file in a predetermined file format, and may include an element for transmitting through a broadcast / communication network. The receiver may receive / extract a bit stream and transmit the received / extracted bit stream to a decoding device.

[0060] The decoding device may decode a video / image by performing a series of processes such as dequantization, inverse transformation, prediction, etc. corresponding to the operation of the encoding device.

[0061] The renderer can render the decoded video / image, and the rendered video / image can be displayed through a display.

[0062] Figure 2 is a diagram schematically illustrating a configuration of a video / image encoding device to which the present disclosure can be applied. Hereinafter, a term referred to as a video encoding device may include an image encoding device.

[0063] refer to Figure 2 , the encoding device 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-frame predictor 221 and an intra-frame 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 also include a subtractor 231. The adder 250 may be referred to as a reconstructor or a reconstructed block generator. The image partitioner 210, the predictor 220, the residual processor 230, the entropy encoder 240, the adder 250, and the filter 260 described above may be configured by one or more hardware components (e.g., an encoder chipset or processor) according to an embodiment. In addition, the memory 270 may include a decoded picture buffer (DPB) and may be configured by a digital storage medium. The hardware component may also include a memory 270 as an internal / external component.

[0064] The image partitioner 210 may partition an input image (or picture or frame) input to the encoding device 200 into one or more processing units. As an example, a processing unit may be referred to as a coding unit (CU). In this case, starting from a coding tree unit (CTU) or a maximum coding unit (LCU), the coding unit may be recursively divided according to a quadtree binary tree ternary tree (QTBTTT) structure. For example, a coding unit may be divided into a plurality of coding units of a deeper depth based on a quadtree structure, a binary tree structure, and / or a ternary tree structure. In this case, for example, a quadtree structure may be applied first and a binary tree structure and / or a ternary tree structure may be applied later. Alternatively, a binary tree structure may be applied first. The coding process according to the present disclosure may be performed based on a final coding unit that is not further divided. In this case, the maximum coding unit may be directly used as a final coding unit based on coding efficiency according to image characteristics. Alternatively, the coding unit may be recursively divided into coding units of a further deeper depth as needed so that a coding unit of an optimal size may be used as a final coding unit. Here, the coding process may include processes such as prediction, transformation, and reconstruction, which will be described later. As another example, the processing unit may also include a prediction unit (PU) or a transform unit (TU). In this case, the prediction unit and the transform unit may be split or partitioned from the above-mentioned final coding unit. The prediction unit may be a unit of sample prediction, and the transform unit may be a unit for deriving a transform coefficient and / or a unit for deriving a residual signal from a transform coefficient.

[0065] Unit and terms such as block, region, etc. may be used to replace each other depending on the situation. In general, an M×N block may represent a set of samples or transform coefficients consisting of M columns and N rows. A sample may generally represent a pixel or a pixel value, and may represent only a pixel / pixel value of a luminance component, or only a pixel / pixel value of a chrominance component. A sample may be used as a term corresponding to a pixel or a pel of a picture (or image).

[0066] The subtractor 231 subtracts the prediction signal (prediction block, prediction sample array) output from the inter predictor 221 or the intra predictor 222 from the input image signal (original block, original sample array) to generate a residual signal (residual block, residual sample array), and the generated residual signal is sent to the transformer 232. In this case, as shown, the unit that subtracts the prediction signal (prediction block, prediction sample array) from the input image signal (original block, original sample array) in the encoder 200 may be referred to as a subtractor 231. The predictor may perform prediction on a processing target block (hereinafter, referred to as a "current block") and may generate a prediction block including prediction samples for the current block. The predictor may determine whether to apply intra prediction or inter prediction on a current block or CU basis. As discussed later, in the description of each prediction mode, the predictor may generate various information related to prediction, such as prediction mode information, and send the generated information to the entropy encoder 240. Information about the prediction may be encoded in the entropy encoder 240 and output in the form of a bitstream.

[0067] The intra-frame predictor 222 can predict the current block by referring to the samples in the current picture. Depending on the prediction mode, the reference sample can be located in the neighboring area of ​​the current block or in a distant area away from the current block. In intra-frame prediction, the prediction mode may include multiple non-directional modes and multiple directional modes. The non-directional mode may include, for example, a DC mode and a plane mode. Depending on the degree of detail of the prediction direction, the directional mode may include, for example, 33 directional prediction modes or 65 directional prediction modes. However, this is only an example, and more or fewer directional prediction modes may be used depending on the configuration. The intra-frame predictor 222 may determine the prediction mode applied to the current block by using the prediction mode applied to the neighboring blocks.

[0068] The inter-frame predictor 221 can derive a prediction block for the current block based on a reference block (reference sample array) specified by a motion vector on a reference picture. At this time, in order to reduce the amount of motion information sent in the inter-frame prediction mode, the motion information can be predicted in blocks, sub-blocks or sample units based on the correlation of the motion information between the neighboring blocks and the current block. The motion information may include a motion vector and a reference picture index. The motion information may also include information about the inter-frame prediction direction (L0 prediction, L1 prediction, Bi prediction, etc.). In the case of inter-frame 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 from each other. The temporal neighboring block may be referred to as a collocated reference block, a collocated CU (colCU), etc., and the reference picture including the temporal neighboring block may be referred to as a collocated picture (colPic). For example, the inter-frame predictor 221 may configure a motion information candidate list based on the neighboring blocks and generate information indicating which candidate is used to derive the motion vector and / or reference picture index of the current block. Inter-frame prediction may be performed based on various prediction modes. For example, in the case of skip mode and merge mode, the inter-frame predictor 221 may use the motion information of the neighboring block as the motion information of the current block. In the skip mode, unlike the merge mode, the residual signal may not be sent. In the case of the motion information prediction (motion vector prediction, MVP) mode, the motion vector of the neighboring block may be used as a motion vector predictor, and the motion vector of the current block may be indicated by signaling the motion vector difference.

[0069] The predictor 220 may generate a prediction signal based on various prediction methods. For example, the predictor may apply intra prediction or inter prediction for predicting a block and may also apply intra prediction and inter prediction at the same time. This may be referred to as combined inter and intra prediction (CIIP). In addition, the predictor may be based on an intra block copy (IBC) prediction mode or a palette mode to perform prediction on a block. The IBC prediction mode or the palette mode may be used for content image / video coding in games, etc., such as screen content coding (SCC). Although IBC basically performs prediction in the current block, it may be performed similarly to inter prediction in terms of deriving a reference block within the current block. That is, IBC is capable of using at least one of the inter prediction techniques described in the present disclosure.

[0070] The prediction signal generated by the inter-frame predictor 221 and / or the intra-frame predictor 222 can be used to generate a reconstruction signal or to generate a residual signal. The transformer 232 can generate a transform coefficient by applying a transform technique to the residual signal. For example, the transform technique may include at least one of a discrete cosine transform (DCT), a discrete sine transform (DST), a Karhunen-Loève transform (KLT), a graph-based transform (GBT), or a conditional nonlinear transform (CNT). Here, GBT means a transform obtained from a graph when the relationship information between pixels is represented by a graph. CNT refers to a transform obtained based on a prediction signal generated using all previously reconstructed pixels. In addition, the transform process can be applied to square pixel blocks of the same size or can be applied to blocks of variable size other than square blocks.

[0071] The quantizer 233 may quantize the transform coefficients and send the quantized transform coefficients to the entropy encoder 240, and the entropy encoder 240 may encode the quantized signal (information about the quantized transform coefficients) and may output the encoded signal in a bitstream. The information about the quantized transform coefficients may be referred to as residual information. The quantizer 233 may rearrange the block type quantized transform coefficients into a one-dimensional vector form based on the coefficient scanning order, and 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, for example, exponential Golomb, context adaptive variable length coding (CAVLC), context adaptive binary arithmetic coding (CABAC), etc. The entropy encoder 240 may encode information necessary for video / image reconstruction (e.g., values ​​of syntax elements, etc.) other than the quantized transform coefficients together or separately. The encoding information (e.g., encoded video / image information) may be transmitted or stored on a unit basis of a network abstraction layer (NAL) in the form of a bitstream. The video / image information may also include information about various parameter sets such as an adaptive parameter set (APS), a picture parameter set (PPS), a sequence parameter set (SPS), a video parameter set (VPS), etc. In addition, the video / image information may also include general constraint information. In the present disclosure, information and / or syntax elements sent / signaled from an encoding device to a decoding device may be included in the video / image information. The video / image information may be encoded by the above-mentioned encoding process and included in a bitstream. The bitstream may be sent through a network or stored in a digital storage medium. Here, the network may include a broadcast network, a communication network, and / or the like, and the digital storage medium may include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. A transmitter (not shown) that sends a signal output from the entropy encoder 240 and / or a storage device (not shown) that stores the signal may be configured as an internal / external element of the encoding device 200, or the transmitter may be included in the entropy encoder 240.

[0072] The quantized transform coefficients output from the quantizer 233 can be used to generate a prediction signal. For example, by applying dequantization and inverse transformation to the quantized transform coefficients via the dequantizer 234 and the inverse transformer 235, a residual signal (residual block or residual sample) can be reconstructed. The adder 255 adds the reconstructed residual signal to the prediction signal output from the inter-frame predictor 221 or the intra-frame predictor 222, so that a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample array) can be generated. When the processing target block has no residual, as in the case of applying the skip mode, the prediction block can be used as a reconstructed block. The adder 250 can be referred to as a reconstructor or a reconstructed block generator. The generated reconstructed signal can be used for intra-frame prediction of the next processing target block in the current block, and as described later, the generated reconstructed signal can be used for inter-frame prediction of the next picture by filtering.

[0073] Meanwhile, during picture encoding and / or reconstruction, luminance mapping and chrominance scaling (LMCS) may be applied.

[0074] The filter 260 can improve the subjective / objective video quality by applying filtering to the reconstructed signal. For example, the filter 260 can generate a modified reconstructed picture by applying various filtering methods to the reconstructed picture, and the filter 260 can store the modified reconstructed picture in the memory 270, more specifically, in the DPB of the memory 270. Various filtering methods may include, for example, deblocking filtering, sample adaptive offset, adaptive loop filter, bilateral filter, etc. As discussed later in the description of each filtering method, the filter 260 can generate various information related to filtering and send the generated information to the entropy encoder 240. Information about filtering can be encoded in the entropy encoder 240 and output in the form of a bitstream.

[0075] The modified reconstructed picture transmitted to the memory 270 may be used as a reference picture in the inter predictor 221. In doing so, the encoding device may avoid prediction mismatch in the encoding device 200 and the decoding device when inter prediction is applied, and may also improve coding efficiency.

[0076] The memory 270DPB may store the modified reconstructed picture so as to use it as a reference picture in the inter-frame predictor 221. The memory 270 may store the motion information of the block in the current picture from which the motion information is derived (or encoded) and / or the motion information of the block in the picture that has been (or previously) reconstructed. The stored motion information may be sent to the inter-frame predictor 221 to be used as the motion information of the neighboring block or the motion information of the temporal neighboring block. The memory 270 may store the reconstructed samples of the reconstructed block in the current picture and may send the reconstructed samples to the intra-frame predictor 222.

[0077] Figure 3is a diagram schematically illustrating a configuration of a video / image decoding device to which the present disclosure can be applied.

[0078] refer to Figure 3 , the video 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-frame predictor 331 and an intra-frame predictor 332. The residual processor 320 may include a dequantizer 321 and an inverse transformer 322. The entropy decoder 310, the residual processor 320, the predictor 330, the adder 340, and the filter 350 described above may be configured by one or more hardware components (e.g., a decoder chipset or a processor) according to an embodiment. In addition, the memory 360 may include a decoded picture buffer (DPB) and may be configured by a digital storage medium. The hardware component may also include a memory 360 as an internal / external component.

[0079] When a bit stream including video / image information is input, the decoding device 300 can be used with Figure 2 The process of processing video / image information in the encoding device of the reconstructs the image accordingly. For example, the decoding device 300 can derive the unit / block based on information related to the block partition obtained from the bitstream. The decoding device 300 can perform decoding by using a processing unit applied in the encoding device. Therefore, the processing unit of decoding can be, for example, a coding unit, which can be partitioned from a coding tree unit or a maximum coding unit along a quadtree structure, a binary tree structure and / or a ternary tree structure. One or more transform units can be derived from the coding unit. And, the reconstructed image signal decoded and output by the decoding device 300 can be reproduced by a reproducer.

[0080] The decoding device 300 can receive the Figure 2The signal output by the encoding device of the encoding device, and the received signal can be decoded by the entropy decoder 310. For example, the entropy decoder 310 can parse the bitstream to derive the information (e.g., video / image information) required for image reconstruction (or picture reconstruction). The video / image information may also include information about various parameter sets such as adaptive parameter set (APS), picture parameter set (PPS), sequence parameter set (SPS), video parameter set (VPS), etc. In addition, the video / image information may also include general constraint information. The decoding device may further decode the picture based on the information about the parameter set and / or the general constraint information. In the present disclosure, the information and / or syntax elements sent / received with the signal described later can be decoded by a decoding process and obtained from the bitstream. For example, the entropy decoder 310 can decode the information in the bitstream based on a coding method such as exponential Golomb coding, CAVLC, CABAC, etc., and can output the values ​​of the syntax elements necessary for image reconstruction and the quantized values ​​of the transform coefficients of the residual. More specifically, the CABAC entropy decoding method can receive a bin corresponding to each syntax element in the bitstream, use the decoded information of the decoding target syntax element information and the decoded information of the neighboring and decoding target blocks or the information of the symbol / bin decoded in the previous step to determine the context model, predict the bin generation probability according to the determined context model, and perform arithmetic decoding of the bin to generate a symbol corresponding to each syntax element value. Here, the CABAC entropy decoding method can update the context model using the information of the symbol / bin decoded by the context model for the next symbol / bin after determining the context model. The information about prediction among the information decoded in the entropy decoder 310 can be provided to the predictor (inter-frame predictor 332 and intra-frame predictor 331), and the residual value, i.e., the quantized transform coefficient and the related parameter information, which have been entropy decoded in the entropy decoder 310, can be input to the residual processor 320. The residual processor 320 can derive a residual signal (residual block, residual sample, residual sample array). In addition, the information about filtering among the information decoded in the entropy decoder 310 can be provided to the filter 350. Meanwhile, a receiver (not shown) receiving a signal output from the encoding device may further configure the decoding device 300 as an internal / external element, and the receiver may be a component of the entropy decoder 310. Meanwhile, the decoding device according to the present disclosure may be referred to as a video / image / picture coding device, and the decoding device may be classified 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 decoder 310, and the sample decoder may include at least one of the dequantizer 321, the inverse transformer 322, the adder 340, the filter 350, the memory 360, the inter-frame predictor 332, and the intra-frame predictor 331.

[0081] The dequantizer 321 may output the transform coefficient by dequantizing the quantized transform coefficient. The dequantizer 321 may rearrange the quantized transform coefficient in the form of a two-dimensional block. In this case, the rearrangement process may perform rearrangement based on the order of coefficient scanning performed in the encoding device. The dequantizer 321 may use a quantization parameter (e.g., quantization step size information) to perform dequantization on the quantized transform coefficient and obtain the transform coefficient.

[0082] The inverse transformer 322 obtains a residual signal (residual block, residual sample array) by performing inverse transformation on the transformation coefficients.

[0083] The predictor may perform prediction on the current block and generate a prediction block including prediction samples of the current block. The predictor may determine whether to apply intra prediction or inter prediction to the current block based on the information about prediction output from the entropy decoder 310, and more specifically, the predictor may determine an intra / inter prediction mode.

[0084] The predictor can generate a prediction signal based on various prediction methods. For example, the predictor can apply intra prediction or inter prediction for predicting a block, and can also apply intra prediction and inter prediction at the same time. This can be called combined inter and intra prediction (CIIP). In addition, the predictor can perform intra block copying (IBC) for predicting the block. Intra block copying can be used for content image / video coding in games, such as screen content coding (SCC). Although IBC basically performs prediction in the current block, it can be performed similarly to inter prediction in terms of deriving a reference block within the current block. That is, IBC can use at least one of the inter prediction techniques described in the present disclosure.

[0085] The intra-frame predictor 331 can predict the current block by referring to samples in the current picture. Depending on the prediction mode, the reference sample can be located in a neighboring area of ​​the current block or in a distant area away from the current block. In intra-frame prediction, the prediction mode can include multiple non-directional modes and multiple directional modes. The intra-frame predictor 331 can determine the prediction mode applied to the current block by using the prediction mode applied to the neighboring block.

[0086] The inter-frame predictor 332 may derive a prediction block for the current block based on a reference block (reference sample array) specified by a motion vector on a reference picture. At this time, in order to reduce the amount of motion information sent in the inter-frame prediction mode, the motion information may be predicted in block, sub-block or sample units based on the correlation of the motion information between the neighboring blocks and the current block. The motion information may include a motion vector and a reference picture index. The motion information may also include information about the inter-frame prediction direction (L0 prediction, L1 prediction, Bi prediction, etc.). In the case of inter-frame 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-frame predictor 332 may configure a motion information candidate list based on the neighboring blocks and derive a motion vector and / or a reference picture index of the current block based on the received candidate selection information. Inter-frame prediction may be performed based on various prediction modes, and information about the prediction may include information indicating an inter-frame prediction mode for the current block.

[0087] The adder 340 can generate a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample array) by adding the obtained residual signal to the prediction signal (prediction block, prediction sample array) output from the predictor 330. When the processing target block has no residual, as in the case of applying the skip mode, the prediction block can be used as the reconstructed block.

[0088] The adder 340 may be referred to as a reconstructor or a reconstructed block generator. The generated reconstructed signal may be used for intra prediction of the next processing target block in the current block, and as described later, the generated reconstructed signal may be output through filtering or used for inter prediction of the next picture.

[0089] At the same time, during the picture decoding process, luminance mapping and chrominance scaling (LMCS) can be applied.

[0090] The filter 350 can improve the subjective / objective video quality by applying filtering to the reconstructed signal. For example, the filter 350 can generate a modified reconstructed picture by applying various filtering methods to the reconstructed picture, and the modified reconstructed picture can be sent to the memory 360, more specifically, to the DPB of the memory 360. The various filtering methods may include, for example, deblocking filtering, sample adaptive offset, adaptive loop filter, bilateral filter, etc.

[0091] The (modified) reconstructed picture stored in the DPB of the memory 360 may be used as a reference picture in the inter-frame predictor 332. The memory 360 may store the motion information of the block in the current picture from which the motion information has been derived (or decoded) and / or the motion information of the block in the picture that has been (or previously) reconstructed. The stored motion information may be sent to the inter-frame predictor 260 to be used as the motion information of the neighboring block or the motion information of the temporal neighboring block. The memory 360 may store the reconstructed samples of the reconstructed block in the current picture and may send the reconstructed samples to the intra-frame predictor 331.

[0092] In the present specification, the examples described in the predictor 330, the dequantizer 321, the inverse transformer 322, and the filter 350 of the decoding device 300 may be similarly or correspondingly applied to the predictor 220, the dequantizer 234, the inverter 235, and the filter 260 of the encoding device 200, respectively.

[0093] As described above, prediction is performed in order to improve compression efficiency when performing video coding. In doing so, a prediction block including prediction samples for a current block as a coding target block can be generated. Here, the prediction block includes prediction samples in a spatial domain (or pixel domain). The prediction block can be derived identically in an encoding device and a decoding device, and the encoding device can improve image coding efficiency by signaling to the decoding device information (residual information) about the residual between the original block and the prediction block instead of the original sample value of the original block itself. The decoding device can derive a residual block including residual samples based on the residual information, generate a reconstructed block including reconstructed samples by adding the residual block to the prediction block, and generate a reconstructed picture including the reconstructed block.

[0094] The residual information may be generated by a transformation and quantization process. For example, the encoding device may derive a residual block between the original block and the prediction block, derive a transform coefficient by performing a transformation process on the residual samples (residual sample array) included in the residual block, and derive a quantized transform coefficient by performing a quantization process on the transform coefficient, so that it can (through a bitstream) send the relevant residual information to the decoding device with a signal. Here, the residual information may include value information, position information, transformation technology, transformation kernel, quantization parameter, etc. of the quantized transform coefficient. The decoding device may perform a quantization / dequantization process and derive a residual sample (or residual sample block) based on the residual information. The decoding device may generate a reconstructed block based on the prediction block and the residual block. The encoding device may derive a residual block for reference for inter-frame prediction of the next picture by dequantizing / inverse transforming the quantized transform coefficient, and may generate a reconstructed picture based on the derived residual block.

[0095] Figure 4 The structure of a content streaming system to which the present disclosure is applied is illustrated.

[0096] In addition, the content streaming system to which the present disclosure is applied may generally include an encoding server, a streaming server, a web server, a media storage, a user device, and a multimedia input device.

[0097] The encoding server is used to compress the content input from a multimedia input device such as a smart phone, a camera, a camcorder, etc. into digital data to generate a bitstream, and send it to a streaming server. As another example, in the case where a multimedia input device such as a smart phone, a camera, a camcorder, etc. directly generates a bitstream, the encoding server can be omitted. The bitstream can be generated by applying the encoding method or the bitstream generation method disclosed in the present invention. And the streaming server can temporarily store the bitstream during the process of sending or receiving the bitstream.

[0098] The streaming server sends multimedia data to the user device through the web server based on the user's request, and the web server serves as a tool to inform the user of what services exist. When the user requests the service the user wants, the web server transmits the request to the streaming server, and the streaming server sends the multimedia data to the user. In this regard, the content streaming system may include a separate control server, and in this case, the control server is used to control the command / response between the corresponding devices in the content streaming system.

[0099] The streaming server can receive content from a media storage device and / or an encoding server. For example, in the case of receiving content from an encoding server, the content can be received in real time. In this case, in order to smoothly provide a streaming service, the streaming server can store the bit stream for a predetermined time.

[0100] For example, the user equipment may include a mobile phone, a smart phone, a laptop computer, a digital broadcast terminal, a personal digital assistant (PDA), a portable multimedia player (PMP), a navigator, a tablet PC, a tablet PC, an ultrabook, a wearable device (e.g., a watch-type terminal (smart watch), a glasses-type terminal (smart glasses), a head-mounted display (HMD)), a digital TV, a desktop computer, a digital signage, etc. Each server in the content streaming system may operate as a distributed server, and in this case, the data received by each server may be processed in a distributed manner.

[0101] Figure 5 The multiple transformation technology according to an embodiment of the present disclosure is schematically illustrated.

[0102] refer to Figure 5 , the converter can correspond to the aforementioned Figure 2 The converter in the encoding device, and the inverse converter may correspond to the aforementioned Figure 2 The inverse transformer in the encoding device of Figure 3An inverse transformer in a decoding device.

[0103] The transformer may derive (primary) transform coefficients by performing a primary transform based on the residual samples (residual sample array) in the residual block (S510). This primary transform may be referred to as a core transform. In this document, the primary transform may be based on a multiple transform selection (MTS), and when multiple transforms are applied as the primary transform, it may be referred to as a multi-core transform.

[0104] The multi-core transform may refer to a method of performing transform using discrete cosine transform (DCT) type 2 and discrete sine transform (DST) type 7, DCT type 8, and / or DST type 1 additionally. That is, the multi-core transform may refer to a transform method of transforming a residual signal (or residual block) in the spatial domain into a transform coefficient (or primary transform coefficient) in the frequency domain based on a plurality of transform kernels selected from DCT type 2, DST type 7, DCT type 8, and DST type 1. In this article, the primary transform coefficient may be referred to as a temporary transform coefficient from the perspective of the transformer.

[0105] In other words, when a conventional transform method is applied, a transform coefficient can be generated by applying a transform from the spatial domain to the frequency domain to a residual signal (or residual block) based on DCT type 2. In contrast, when a multi-core transform is applied, a transform coefficient (or primary transform coefficient) can be generated by applying a transform from the spatial domain to the frequency domain to a residual signal (or residual block) based on DCT type 2, DST type 7, DCT type 8, and / or DST type 1. In this document, DCT type 2, DST type 7, DCT type 8, and DST type 1 may be referred to as a transform type, a transform kernel, or a transform core. These DCT / DST transform types may be defined based on basis functions.

[0106] When performing a multi-core transform, a vertical transform core and a horizontal transform core for a target block may be selected from the transform cores, a vertical transform may be performed on the target block based on the vertical transform core, and a horizontal transform may be performed on the target block based on the horizontal transform core. Here, the horizontal transform may indicate a transform of a horizontal component of the target block, and the vertical transform may indicate a transform of a vertical component of the target block. The vertical transform core / horizontal transform core may be adaptively determined based on a prediction mode and / or a transform index of a target (CU or subblock) including a residual block.

[0107] In addition, according to the example, if the primary transform is performed by applying MTS, the mapping relationship of the transform kernel can be set by setting a specific basis function to a predetermined value and combining the basis functions to be applied in the vertical transform or the horizontal transform. For example, when the horizontal transform kernel is represented as trTypeHor and the vertical transform kernel is represented as trTypeVer, trTypeHor or trTypeVer with a value of 0 can be set to DCT2, trTypeHor or trTypeVer with a value of 1 can be set to DST-7, and trTypeHor or trTypeVer with a value of 2 can be set to DCT-8.

[0108] In this case, the MTS index information may be encoded and signaled to a decoding device to indicate any one of a plurality of transform kernel sets. For example, an MTS index of 0 may indicate that both trTypeHor and trTypeVer values ​​are 0, an MTS index of 1 may indicate that both trTypeHor and trTypeVer values ​​are 1, an MTS index of 2 may indicate that both trTypeHor and trTypeVer values ​​are 2, an MTS index of 3 may indicate that both trTypeHor and trTypeVer values ​​are 1, and an MTS index of 4 may indicate that both trTypeHor and trTypeVer values ​​are 2.

[0109] In one example, the transformation core set according to the MTS index information is shown in the following table.

[0110] [Table 1]

[0111] tu_mts_idx[x0][y0] 0 1 2 3 4 trTypeHor 0 1 2 1 2 trTypeVer 0 1 1 2 2

[0112] The transformer may perform a secondary transform based on the (primary) transform coefficients to derive modified (secondary) transform coefficients (S520). The primary transform is a transform from the spatial domain to the frequency domain, and the secondary transform refers to the use of the correlation between the (primary) transform coefficients to transform into a more compact expression. The secondary transform may include an inseparable 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). NSST may represent a transform that performs a secondary transform on the (primary) transform coefficients derived by the primary transform based on an inseparable transform matrix to generate modified transform coefficients (or secondary transform coefficients) for the residual signal. Here, the vertical transform and the horizontal transform may not be applied separately (or the vertical transform and the horizontal transform may not be applied independently) to the (primary) transform coefficients, but the transform may be applied once based on the inseparable transform matrix. In other words, NSST is not applied separately to (primary) transform coefficients in the vertical and horizontal directions, and may represent, for example, a transform method that rearranges a two-dimensional signal (transform coefficient) into a one-dimensional signal by a specific predetermined direction (e.g., a row-first direction or a column-first direction) and then generates modified transform coefficients (or secondary transform coefficients) based on an inseparable transform matrix. For example, the row-first order is to arrange rows in the order of row 1, row 2, ..., row N for an MxN block, and the column-first order is to arrange rows in the order of column 1, column 2, ..., column M for an MxN block. NSST may be applied to the upper left region of a block (hereinafter referred to as a transform coefficient block) configured with (primary) transform coefficients. For example, when the width W and height H of the transform coefficient block are both 8 or greater, 8×8 NSST may be applied to the upper left 8×8 region of the transform coefficient block. In addition, when the width (W) and the height (H) of the transform coefficient block are both 4 or more, when the width (W) or the height (H) of the transform coefficient block is less than 8, the 4×4 NSST may be applied to the upper left min(8,W)×min(8,H) region of the transform coefficient block. However, the embodiment is not limited thereto, and for example, even if the condition that only the width W or the height H of the transform coefficient block is 4 or more is satisfied, the 4×4 NSST may be applied to the upper left min(8,W)×min(8,H) region of the transform coefficient block.

[0113] Specifically, for example, if a 4×4 input block is used, the non-separable secondary transform may be performed as follows.

[0114] A 4×4 input block X can be represented as follows.

[0115] [Formula 1]

[0116]

[0117] If X is expressed in vector form, then the vector It can be expressed as follows.

[0118] [Formula 2]

[0119]

[0120] In Equation 2, the vector is a one-dimensional vector obtained by rearranging the two-dimensional block X of Equation 1 according to the row-major order.

[0121] In this case, the inseparable secondary transform can be calculated as follows.

[0122] [Formula 3]

[0123]

[0124] In this formula, denotes a transform coefficient vector and T denotes a 16x16 (non-separable) transform matrix.

[0125] By using the above formula 3, the 16×1 transform coefficient vector can be derived And the vector can be divided into two parts by scanning order (horizontally, vertically, diagonally, etc.) Reorganized into 4×4 blocks. However, the above calculation is an example, and Hypercube-Givens Transform (HyGT) or the like may also be used for the calculation of the inseparable secondary transform in order to reduce the calculation complexity of the inseparable secondary transform.

[0126] Meanwhile, in the inseparable secondary transform, the transform kernel (or transform core, transform type) may be selected to be mode-dependent. In this case, the mode may include an intra prediction mode and / or an inter prediction mode.

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

[0128] Here, in order to select the mode-dependent transform cores, two inseparable secondary transform cores may be configured for each transform set of inseparable secondary transforms for both the 8×8 transform and the 4×4 transform, and there may be four transform sets. 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 cores, and each of the four transform sets for the 4×4 transform may include two 4×4 transform cores.

[0129] However, as the size of the transform (ie, the size of the region to which the transform is applied) may be, for example, a size other than 8×8 or 4×4, the number of sets may be n, and the number of transform kernels in each set may be k.

[0130] The transform set may be referred to as an NSST set or a LFNST set. A specific set among the transform sets may be selected, for example, based on the intra prediction mode of the current block (CU or subblock). A low frequency non-separable transform (LFNST) may be an example of a reduced non-separable transform, which will be described later, and represents a non-separable transform for a low frequency component.

[0131] For reference, for example, the intra prediction mode may include two non-directional (or non-angle) intra prediction modes and 65 directional (or angle) intra prediction modes. The non-directional intra prediction mode may include a plane intra prediction mode No. 0 and a DC intra prediction mode No. 1, and the directional intra prediction mode may include 65 intra prediction modes No. 2 to No. 66. However, this is an example, and this document may be applied even if the number of intra prediction modes is different. In addition, in some cases, intra prediction mode No. 67 may also be used, and intra prediction mode No. 67 may represent a linear model (LM) mode.

[0132] Figure 6 The intra directional mode for 65 prediction directions is shown as an example.

[0133] refer to Figure 6 , based on the intra prediction mode 34 having the left-upward diagonal prediction direction, the intra prediction mode can be divided into an intra prediction mode having a horizontal directionality and an intra prediction mode having a vertical directionality. Figure 6In , H and V represent horizontal and vertical directivities, respectively, and numbers -32 to 32 indicate displacements of 1 / 32 units on sample grid positions. These numbers may represent offsets for mode index values. Intra-prediction modes 2 to 33 have horizontal directivities, and intra-prediction modes 34 to 66 have vertical directivities. Strictly speaking, intra-prediction mode 34 may be considered neither horizontal nor vertical, but may be classified as belonging to horizontal directivity when determining a transform set for a secondary transform. This is because the input data is transposed for a vertically oriented mode that is symmetrical on the basis of intra-prediction mode 34, and the input data alignment method for the horizontal mode is used for intra-prediction mode 34. Transposing the input data means that the rows and columns of two-dimensional MxN block data are switched to NxM data. Intra-prediction mode 18 and intra-prediction mode 50 may represent horizontal intra-prediction mode and vertical intra-prediction mode, respectively, and intra-prediction mode 2 may be referred to as a right-up diagonal intra-prediction mode because intra-prediction mode 2 has a left reference pixel and performs prediction in the right-up direction. Likewise, intra-prediction mode 34 may be referred to as a right-down diagonal intra-prediction mode, and intra-prediction mode 66 may be referred to as a left-down diagonal intra-prediction mode.

[0134] According to an example, four transform sets according to intra prediction modes may be mapped, for example, as shown in the following table.

[0135] [Table 2]

[0136] predModeIntra lfnstTrSetIdx predModeIntra<0 1 0<=predModeIntra<=1 0 2<=predModeIntra<=12 1 13<=predModeIntra<=23 2 24<=predModeIntra<=44 3 45<=predModeIntra<=55 2 56<=predModeIntra<=80 1

[0137] As shown in Table 2, any one of four transform sets, ie, lfnstTrSetIdx, may be mapped to any one of four indexes (ie, 0 to 3) according to the intra prediction mode.

[0138] When it is determined that a specific set is used for an inseparable transform, one of the k transform cores in the specific set can be selected by an inseparable secondary transform index. The encoding device can derive an inseparable secondary transform index indicating a specific transform core based on a rate-distortion (RD) check, and can send the inseparable secondary transform index to a decoding device with a signal. The decoding device can select one of the k transform cores in a specific set based on the inseparable secondary transform index. For example, lfnst index value 0 can refer to a first inseparable secondary transform core, lfnst index value 1 can refer to a second inseparable secondary transform core, and lfnst index value 2 can refer to a third inseparable secondary transform core. Alternatively, lfnst index value 0 can indicate that the first inseparable secondary transform is not applied to the target block, and lfnst index values ​​1 to 3 can indicate three transform cores.

[0139] The transformer can perform an inseparable secondary transform based on the selected transform kernel, and can obtain modified (secondary) transform coefficients. As described above, the modified transform coefficients can be derived as transform coefficients quantized by a quantizer, and can be encoded and sent to a decoding device with a signal, and transmitted to a dequantizer / inverse transformer in an encoding device.

[0140] At the same time, as described above, if the secondary transform is omitted, the (primary) transform coefficients that are the output of the primary (separable) transform can be derived as transform coefficients quantized by the quantizer as described above, and can be encoded and sent to the decoding device with a signal, and transmitted to the dequantizer / inverse transformer in the encoding device.

[0141] The inverse transformer is capable of performing a series of processes in an order opposite to the order in which the series of processes are performed in the above-mentioned transformer. The inverse transformer can receive (dequantized) transformer coefficients and derive (primary) transform coefficients by performing a secondary (inverse) transform (S550), and can obtain a residual block (residual sample) by performing a primary (inverse) transform on the (primary) transform coefficients (S560). In this regard, from the perspective of the inverse transformer, the primary transform coefficients can be referred to as modified transform coefficients. As described above, the encoding device and the decoding device can generate a reconstructed block based on the residual block and the prediction block, and can generate a reconstructed picture based on the reconstructed block.

[0142] The decoding device may further include a secondary inverse transform application determiner (or an element for determining whether to apply a secondary inverse transform) and a secondary inverse transform determiner (or an element for determining a secondary inverse transform). The secondary inverse transform application determiner may determine whether to apply a secondary inverse transform. For example, the secondary inverse transform may be NSST, RST, or LFNST, and the secondary inverse transform application determiner may determine whether to apply a secondary inverse transform based on a secondary transform flag obtained by parsing a bitstream. In another example, the secondary inverse transform application determiner may determine whether to apply a secondary inverse transform based on a transform coefficient of a residual block.

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

[0144] Meanwhile, as described above, if the secondary (inverse) transform is omitted, the (dequantized) transform coefficients may be received, the primary (separable) inverse transform may be performed, and the residual block (residual sample) may be obtained. As described above, the encoding device and the decoding device may generate a reconstructed block based on the residual block and the prediction block, and may generate a reconstructed picture based on the reconstructed block.

[0145] Meanwhile, in the present disclosure, a reduced secondary transform (RST) in which the size of a transformation matrix (kernel) is reduced may be applied in the concept of NSST in order to reduce the amount of calculation and storage required for an inseparable secondary transform.

[0146] At the same time, the transformation kernel, transformation matrix, and coefficients constituting the transformation kernel matrix described in the present disclosure, that is, the kernel coefficients or matrix coefficients, can be represented by 8 bits. This can be a condition for implementation in a decoding device and an encoding device, and compared with the existing 9 bits or 10 bits, the amount of storage required to store the transformation kernel can be reduced, and performance degradation can be reasonably adapted. In addition, representing the kernel matrix with 8 bits can allow the use of small multipliers and can be more suitable for single instruction multiple data (SIMD) instructions for optimal software implementation.

[0147] In the present specification, the term "RST" may refer to a transformation performed on residual samples of a target block based on a transformation matrix whose size is reduced according to a reduction factor. In the case of performing a reduced transformation, the amount of calculation required for the transformation can be reduced due to the reduction in the size of the transformation matrix. That is, RST can be used to solve the computational complexity problem that occurs when transforming a block of large size or an inseparable transform.

[0148] RST may be referred to as various terms such as reduced transform, reduced secondary transform, downscaled transform, simplified transform, and simple transform, and the names that RST may be referred to as are not limited to the listed examples. Alternatively, since RST is mainly performed in a low-frequency region including non-zero coefficients in a transform block, it may be referred to as a low-frequency non-separable transform (LFNST). A transform index may be referred to as a LFNST index.

[0149] Meanwhile, when the secondary inverse transform is performed based on the RST, the inverse transformer 235 of the encoding device 200 and the inverse transformer 322 of the decoding device 300 may include an inverse reduction secondary transformer that derives the modified transform coefficient based on the inverse RST of the transform coefficient, and an inverse primary transformer that derives the residual sample for the target block based on the inverse primary transform of the modified transform coefficient. The inverse primary transform refers to an inverse transform of the primary transform applied to the residual. In the present disclosure, deriving the transform coefficient based on the transform may refer to deriving the transform coefficient by applying the transform.

[0150] Figure 7is a diagram illustrating an RST according to an embodiment of the present disclosure.

[0151] In the present disclosure, a “target block” may refer to a current block to be encoded, a residual block, or a transform block.

[0152] In the RST according to the example, an N-dimensional vector can be mapped to an R-dimensional vector located in another space, so that a reduced transformation matrix can be determined, where R is less than N. N may refer to the square of the length of the side of the block to which the transformation is applied, or the total number of transformation coefficients corresponding to the block to which the transformation is applied, and the reduction factor may refer to an R / N value. The reduction factor may be referred to as a reduction factor, a reduction factor, a simplification factor, a simple factor, or other various terms. In addition, R may be referred to as a reduction coefficient, but depending on the situation, the reduction factor may refer to R. In addition, depending on the situation, the reduction factor may refer to an N / R value.

[0153] In the example, the reduction factor or the reduction coefficient may be signaled through the bitstream, but the example is not limited thereto. For example, a predefined value for the reduction factor or the reduction coefficient may be stored in each of the encoding device 200 and the decoding device 300, and in this case, the reduction factor or the reduction coefficient may not be signaled separately.

[0154] The size of the reduced transform matrix according to an example may be R×N which is smaller than N×N (the size of a conventional transform matrix), and may be defined as in Equation 4 below.

[0155] [Formula 4]

[0156]

[0157] Figure 7 The matrix T in the reduced transform block shown in (a) may refer to the matrix T of Formula 4. RxN .like Figure 7 As shown in (a), when the reduction transformation matrix T RxN When multiplied with the residual samples of the target block, transform coefficients for the target block may be derived.

[0158] In an example, if the size of the block to which the transform is applied is 8x8 and R=16 (ie, R / N=16 / 64=1 / 4), then Figure 7 The RST of (a) is expressed as a matrix operation as shown in the following Equation 5. In this case, it is possible to reduce the memory and multiplication calculation to about 1 / 4 by the reduction factor.

[0159] In the present disclosure, a matrix operation may be understood as an operation of obtaining a column vector by multiplying a column vector by a matrix provided on the left side of the column vector.

[0160] [Formula 5]

[0161]

[0162] In formula 5, r1 to r 64 y may represent the residual sample of the target block, and specifically may be a transform coefficient generated by applying the primary transform. As a result of the calculation of Equation 5, the transform coefficient c of the target block may be derived. i , and export c i The process can be shown as formula 6.

[0163] [Formula 6]

[0164]

[0165] As a result of the calculation of Equation 6, the transform coefficients c1 to c2 for the target block can be derived. R That is, when R=16, the transform coefficients c1 to c2 for the target block can be derived. 16 . Although 64 (N) transform coefficients are derived for the target block, if a regular transform is applied instead of RST and a transform matrix of 64x64 (NxN) size is multiplied by a residual sample of 64x1 (Nx1) size, only 16 (R) transform coefficients are derived for the target block because RST is applied. Since the total number of transform coefficients for the target block is reduced from N to R, the amount of data transmitted by the encoding device 200 to the decoding device 300 is reduced, which can improve the efficiency of transmission between the encoding device 200 and the decoding device 300.

[0166] When considered from the perspective of the size of the transformation matrix, the size of the conventional transformation matrix is ​​64×64 (N×N), but the size of the reduced transformation matrix is ​​reduced to 16×64 (R×N), so the storage usage in the case of performing RST can be reduced by the R / N ratio compared to the case of performing the conventional transformation. In addition, when compared with the number of multiplication calculations N×N in the case of using the conventional transformation matrix, the use of the reduced transformation matrix can reduce the number of multiplication calculations (R×N) by the R / N ratio.

[0167] In an example, the transformer 232 of the encoding device 200 may derive transform coefficients for the target block by performing a primary transform and a secondary transform based on RST for the residual samples for the target block. These transform coefficients may be passed to the inverse transformer of the decoding device 300, and the inverse transformer 322 of the decoding device 300 may derive modified transform coefficients based on an inverse reduced secondary transform (RST) for the transform coefficients, and may derive residual samples for the target block based on an inverse primary transform for the modified transform coefficients.

[0168] According to the example, the inverse RST matrix T NxR The size of is NxR which is smaller than the size of the conventional inverse transform matrix NxN, and is similar to the reduced transform matrix T shown in Equation 4 RxN In a transposed relationship.

[0169] Figure 7 The matrix T in the reduced inverse transform block shown in (b) t It can be referred to as the inverse RST matrix T RxN T (The superscript T means transposition). Figure 7 As shown in (b), the inverse RST matrix T RxN T When multiplied with the transform coefficients for the target block, modified transform coefficients for the target block or residual samples for the current block can be derived. RxN T Expressed as (T RxN ) T NxR .

[0170] More specifically, when the inverse RST is used as the secondary inverse transform, when the inverse RST matrix T N×R T When multiplied by the transform coefficients of the target block, the modified transform coefficients of the target block can be derived. In addition, the inverse RST can be used as an inverse primary transform, and in this case, when the inverse RST matrix T N×R T When multiplied by the transform coefficients of the target block, residual samples of the target block can be derived.

[0171] In an example, if the size of the block to which the inverse transform is applied is 8x8 and R=16 (ie, R / N=16 / 64=1 / 4), then Figure 7 The RST of (b) is expressed as a matrix operation as shown in the following Equation 7.

[0172] [Formula 7]

[0173]

[0174] In formula 7, c1 to c 16 As a result of the calculation of Equation 7, r representing the modified transform coefficient of the target block or the residual sample of the target block can be derived. i , and derive r i The process can be shown as formula 8.

[0175] [Formula 8]

[0176]

[0177] As a result of the calculation of Equation 8, r1 to r2 representing the modified transform coefficients of the target block or the residual samples of the target block can be derived. N . From the perspective of the size of the inverse transformation matrix, the size of the conventional inverse transformation matrix is ​​64×64 (N×N), but the size of the inverse reduction transformation matrix is ​​reduced to 64×16 (R×N), so the storage usage rate in the case of performing the inverse RST can be reduced by the R / N ratio compared to the case of performing the conventional inverse transformation. In addition, when compared with the number of multiplication calculations N×N in the case of using the conventional inverse transformation matrix, the use of the inverse reduction transformation matrix can reduce the number of multiplication calculations (N×R) by the R / N ratio.

[0178] The transform set configuration shown in Table 2 can also be applied to 8×8 RST. That is, 8×8 RST can be applied according to the transform set in Table 2. Since a transform set includes two or three transforms (kernels) according to the intra prediction mode, it can be configured to select one of up to four transforms, including the case where the secondary transform is not applied. In the transform where the secondary transform is not applied, the application of the identity matrix can be considered. Assuming that indexes 0, 1, 2, and 3 are assigned to the four transforms respectively (for example, index 0 can be assigned to the case where the identity matrix is ​​applied, that is, the case where the secondary transform is not applied), the transform index or lfnst index as a syntax element can be signaled for each transform coefficient block, thereby specifying the transform to be applied. That is, for the upper left 8×8 block, the 8×8 NSST in the RST configuration can be specified by the transform index, or the 8×8 lfnst can be specified when LFNST is applied. 8×8lfnst and 8×8RST refer to the transform applicable to an 8×8 region included in a transform coefficient block when W and H of a target block to be transformed are both equal to or greater than 8, and the 8×8 region may be the upper left 8×8 region in the transform coefficient block. Similarly, 4×4lfnst and 4×4RST refer to the transform applicable to a 4×4 region included in a transform coefficient block when W and H of a target block are both equal to or greater than 4, and the 4×4 region may be the upper left 4×4 region in the transform coefficient block.

[0179] According to an embodiment of the present disclosure, for the transformation in the encoding process, only 48 pieces of data can be selected, and a maximum 16×48 transform kernel matrix can be applied thereto, instead of applying a 16×64 transform kernel matrix to 64 pieces of data forming an 8×8 region. Here, "maximum" means that m has a maximum value of 16 in the m×48 transform kernel matrix for generating m coefficients. That is, when RST is performed by applying an m×48 transform kernel matrix (m≤16) to an 8×8 region, 48 pieces of data are input, and m coefficients are generated. When m is 16, 48 pieces of data are input and 16 coefficients are generated. That is, assuming that 48 pieces of data form a 48×1 vector, the 16×48 matrix and the 48×1 vector are multiplied in sequence, thereby generating a 16×1 vector. Here, the 48 pieces of data forming an 8×8 region can be appropriately arranged, thereby forming a 48×1 vector. For example, a 48×1 vector can be constructed based on 48 pieces of data constituting an area other than the lower right 4×4 area in an 8×8 region. Here, when the matrix operation is performed by applying the maximum 16×48 transform kernel matrix, 16 modified transform coefficients are generated and the 16 modified transform coefficients can be arranged in the upper left 4×4 region according to the scanning order, and the upper right 4×4 region and the lower left 4×4 region can be filled with zeros.

[0180] For the inverse transform in the decoding process, the transposed matrix of the aforementioned transform kernel matrix can be used. That is, when the inverse RST or LFNST is performed in the inverse transform process performed by the decoding device, the input coefficient data to which the inverse RST is applied is configured in a one-dimensional vector according to a predetermined arrangement order, and the modified coefficient vector obtained by multiplying the one-dimensional vector with the corresponding inverse RST matrix on the left side of the one-dimensional vector can be arranged into a two-dimensional block according to a predetermined arrangement order.

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

[0182] On the contrary, in the inverse transform process, when the inverse RST or LFNST is applied to the 8×8 area, 16 transform coefficients corresponding to the upper left area of ​​the 8×8 area among the transform coefficients in the 8×8 area can be input in a one-dimensional array according to the scanning order, and can undergo a matrix operation with a 48×16 transform kernel matrix. That is, the matrix operation can be expressed as (48×16 matrix)*(16×1 transform coefficient vector)=(48×1 modified transform coefficient vector). Here, the n×1 vector can be interpreted as having the same meaning as the n×1 matrix, and can therefore be expressed as an n×1 column vector. In addition, * represents matrix multiplication. When the matrix operation is performed, 48 modified transform coefficients can be derived, and the 48 modified transform coefficients can be arranged in the upper left area, the upper right area, and the lower left area of ​​the 8×8 area except the lower right area.

[0183] When the secondary inverse transform is based on RST, the inverse transformer 235 of the encoding device 200 and the inverse transformer 322 of the decoding device 300 may include an inverse reduction secondary transformer for deriving modified transform coefficients based on an inverse RST of the transform coefficients and an inverse primary transformer for deriving residual samples for the target block based on an inverse primary transform for the modified transform coefficients. The inverse primary transform refers to an inverse transform of the primary transform applied to the residual. In the present disclosure, deriving transform coefficients based on a transform may refer to deriving transform coefficients by applying a transform.

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

[0185] The encoding device receives as input a result (or a portion of a result) derived after applying a primary (core) transform, and applies a forward secondary transform (Secondary Transform).

[0186] [Formula 9]

[0187] y=G T x

[0188] In Equation 9, x and y are the input and output of the secondary transform, respectively, G is a matrix representing the secondary transform, and the transform basis vectors consist of column vectors. In the case of inverse LFNST, when the dimension of the transform matrix G is expressed as [number of rows × number of columns], in the case of forward LFNST, the transpose of the matrix G becomes G T Dimension.

[0189] For inverse LFNST, the dimensions of the matrix G are [48×16], [48×8], [16×16], [16×8], and the [48×8] matrix and the [16×8] matrix are partial matrices of 8 transformation basis vectors sampled from the left side of the [48×16] matrix and the [16×16] matrix, respectively.

[0190] On the other hand, for forward LFNST, the matrix G T The dimensions of are [16×48], [8×48], [16×16], [8×16], and the [8×48] matrix and the [8×16] matrix are partial matrices obtained by sampling 8 transformation basis vectors from the upper parts of the [16×48] matrix and the [16×16] matrix, respectively.

[0191] Therefore, in the case of forward LFNST, a [48×1] vector or a [16×1] vector can be used as input x, and a [16×1] vector or a [8×1] vector can be used as output y. In video encoding and decoding, the output of the forward primary transform is two-dimensional (2D) data, so in order to construct a [48×1] vector or a [16×1] vector as input x, it is necessary to construct a one-dimensional vector by appropriately arranging the 2D data as the output of the forward transform.

[0192] Figure 8 is a diagram illustrating an order in which output data of a forward primary transform is arranged into a one-dimensional vector according to an example. Figure 8 The left diagrams of (a) and (b) show the order for constructing a [48x1] vector, and Figure 8 The right figures of (a) and (b) show the order for constructing a [16x1] vector. In the case of LFNST, it is possible to Figure 8 Arrange the 2D data in the same order as in (a) and (b) to obtain a one-dimensional vector x.

[0193] The arrangement direction of the output data of the forward primary transform may be determined according to the intra-frame prediction mode of the current block. For example, when the intra-frame prediction mode of the current block is in the horizontal direction relative to the diagonal direction, the output data of the forward primary transform may be arranged in the following manner: Figure 8 The output data of the forward primary transform are arranged in the order of (a), and when the intra prediction mode of the current block is in the vertical direction with respect to the diagonal direction, it is possible to Figure 8 The output data of the forward primary transform are arranged in the order of (b).

[0194] According to the example, it can be applied with Figure 8 The order of (a) and (b) is different, and in order to derive the same as when applying Figure 8If the order of arrangement of (a) and (b) is the same result (y vector), the column vectors of matrix G can be rearranged according to the order of arrangement. 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 transform basis vector.

[0195] Since the output y derived by Formula 9 is a one-dimensional vector, when two-dimensional data is required as input data in a process using the result of the forward secondary transform as input (for example, in the process of performing quantization or residual encoding), the output y vector of Formula 9 needs to be properly arranged into 2D data again.

[0196] Fig. 9 is a diagram illustrating an order in which output data of a forward sub-transform is arranged into two-dimensional blocks according to an example.

[0197] In the case of LFNST, the output values ​​can be arranged in 2D blocks according to a predetermined scanning order. Fig. 9 (a) shows that when the output y is a [16x1] vector, the output values ​​are arranged at 16 positions of the 2D block according to the diagonal scanning order. Fig. 9 (b) shows that when the output y is a [8x1] vector, the output values ​​are arranged at 8 positions of the 2D block according to the diagonal scanning order, and the remaining 8 positions are filled with zeros. Fig. 9 The X in (b) indicates that it is filled with zeros.

[0198] According to another example, since the order of processing the output vector y when performing quantization or residual coding can be preset, as Fig. 9 The output vector y may not be arranged in a 2D block as shown in . However, in the case of residual coding, data coding may be performed in 2D block (e.g., 4x4) units such as CG (coefficient group), and in this case, as in Fig. 9 The data is arranged in a specific order in the diagonal scan order of .

[0199] Meanwhile, the decoding apparatus may configure a one-dimensional input vector y by arranging two-dimensional data output through a dequantization process according to a preset scanning order for inverse transformation. The input vector y may be output as an output vector x through the following equation.

[0200] [Formula 10]

[0201] x=Gy

[0202] In the case of inverse LFNST, the output vector x can be derived by multiplying the input vector y, which is a [16×1] vector or a [8×1] vector, by the G matrix. For inverse LFNST, the output vector x can be a [48×1] vector or a [16×1] vector.

[0203] The output vector x is based on Figure 8 The order shown is arranged in a two-dimensional block and arranged as two-dimensional data, and this two-dimensional data becomes input data (or a part of the input data) of the inverse primary transform.

[0204] Thus, the inverse secondary transform is overall the reverse of the forward secondary transform process and in the case of an inverse transform, unlike in the forward direction, the inverse secondary transform is applied first and then the inverse primary transform.

[0205] In the inverse LFNST, one of 8 [48×16] matrices and 8 [16×16] matrices can be selected as the transformation matrix G. Whether to apply the [48×16] matrix or the [16×16] matrix depends on the size and shape of the block.

[0206] In addition, 8 matrices can be derived from the four transform sets shown in Table 2 above, and each transform set can be composed of two matrices. Which transform set to use among the 4 transform sets is determined according to the intra prediction mode, and more specifically, the transform set is determined based on the value of the intra prediction mode extended by considering wide-angle intra prediction (WAIP). Which matrix is ​​selected from the two matrices constituting the selected transform set is derived by index signaling. More specifically, 0, 1, and 2 can be used as the index values ​​sent, 0 can indicate that LFNST is not applied, and 1 and 2 can indicate any one of the two transform matrices constituting the transform set selected based on the intra prediction mode value.

[0207] Fig.10 is a diagram illustrating a wide-angle intra prediction mode according to an embodiment of the present invention.

[0208] The general intra prediction mode value may have a value from 0 to 66 and 81 to 83, and the intra prediction mode value extended due to WAIP may have a value from -14 to 83, as shown. A value from 81 to 83 indicates a CCLM (cross component linear model) mode, and a value from -14 to -1 and a value from 67 to 80 indicate an intra prediction mode extended due to WAIP application.

[0209] When the width of the predicted current block is greater than the height, the upper reference pixel is generally closer to the position inside the block to be predicted. Therefore, prediction in the lower left direction may be more accurate than prediction in the upper right direction. Conversely, when the height of the block is greater than the width, the left reference pixel is generally closer to the position inside the block to be predicted. Therefore, prediction in the upper right direction may be more accurate than prediction in the lower left direction. Therefore, it may be beneficial to apply remapping (i.e., mode index modification) to the index of the wide-angle intra prediction mode.

[0210] When wide-angle intra prediction is applied, information about the existing intra prediction may be signaled, and after parsing the information, the information may be remapped to 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) is not changed, and that is, the total number of intra prediction modes is 67, and the intra prediction mode coding for the specific block may not be changed.

[0211] Meanwhile, as described above, which transform matrix of the [48×16] matrix and the [16×16] matrix is ​​applied to the LFNST is determined by the size and shape of the transform target block.

[0212] Fig.11 is a diagram illustrating a block shape to which LFNST is applied. Fig.11 (a) shows a 4x4 block, (b) shows a 4x8 block and an 8x4 block, (c) shows a 4x N block or an N x4 block, where N is 16 or greater, (d) shows an 8x8 block, and (e) shows an M x N block, where M≥8, N≥8, and N>8 or M>8.

[0213] exist Fig.11 In , the blocks with thick borders indicate the areas where LFNST is applied. Fig.11 For the blocks (a) and (b), LFNST is applied to the top left 4x4 region, and for Fig.11 In block (c), LFNST is applied separately to the two upper left 4x4 regions arranged consecutively. Figure 8 In (a), (b), and (c), since LFNST is applied in units of 4x4 regions, this LFNST will be referred to as “4x4 LFNST” hereinafter. Depending on the matrix dimension used for G, a [16x16] or [16x8] matrix may be applied.

[0214] More specifically, the [16x8] matrix is ​​applied to Fig.11 (a) 4x4 block (4x4 TU or 4x4 CU) and the [16x16] matrix is ​​applied to Fig.11 This is to adjust the computational complexity to 8 multiplications per sample for the worst case.

[0215] about Fig.11In (d) and (e), LFNST is applied to the upper left 8x8 region, and this LFNST is hereinafter referred to as "8x8 LFNST". As the corresponding transformation matrix, a [48x16] matrix or a [48x8] matrix may be applied. In the case of the forward LFNST, since the [48x1] vector (x vector in Equation 9) is input as input data, all sample values ​​of the upper left 8x8 region are not used as input values ​​of the forward LFNST. That is, if it is possible to Figure 8 The left order of (a) or Figure 8 As seen from the left order of (b), a [48x1] vector can be constructed based on the samples belonging to the remaining 3 4x4 blocks, while leaving the lower right 4x4 block as is.

[0216] The [48x8] matrix can be applied to Fig.11 The 8×8 block (8×8TU or 8×8CU) in (d) and the [48×16] matrix can be applied to Fig.11 This is also to adjust the computational complexity for the worst case to 8 multiplications per sample.

[0217] Depending on the block shape, when the corresponding forward LFNST (4×4 or 8×8 LFNST) is applied, 8 or 16 output data (Y vector in Eq. 9, [8×1] or [16×1] vector) are generated. In the forward LFNST, since the matrix G T The characteristic is that the number of output data is equal to or less than the number of input data.

[0218] Fig.12 is a diagram illustrating an arrangement of output data of a forward LFNST according to an example, and shows blocks in which the output data of the forward LFNST is arranged according to a block shape.

[0219] Fig.12 The shaded area at the upper left of the block shown in corresponds to the area where the output data of the forward LFNST is located, the position marked with 0 indicates the sample filled with the value 0, and the remaining area represents the area not changed by the forward LFNST. In the area not changed by the LFNST, the output data of the forward primary transform remains unchanged.

[0220] As described above, since the dimension of the applied transformation matrix varies according to the shape of the block, the number of output data also varies. Fig.12 , the output data of the forward LFNST may not completely fill the upper left 4x4 block. Fig.12In the cases of (a) and (d), the [16x8] matrix and the [48x8] matrix are applied to the block indicated by the bold line or the partial area within the block, respectively, and the [8x1] vector is generated as the output of the forward LFNST. That is, according to Fig. 9 The scanning order shown in (b) can be Fig.12 Only 8 output data are filled as shown in (a) and (d), and 0 can be filled in the remaining 8 positions. Fig.11 (d) In the case of applying LFNST blocks, such as Fig.12 As shown in (d), the two 4x4 blocks in the upper right and upper left adjacent to the upper left 4x4 block are also filled with value 0.

[0221] As described above, basically, by signaling the LFNST index, whether to apply LFNST and the transform matrix to be applied are specified. Fig.12 As shown, when LFNST is applied, since the number of output data of the forward LFNST may be equal to or less than the number of input data, an area filled with zero values ​​occurs as follows.

[0222] 1) If Fig.12 As shown in (a), samples from the 8th and subsequent positions in the upper left 4x4 block in the scanning order, that is, samples from the 9th to the 16th.

[0223] 2) If Fig.12 As shown in (d) and (e), when the [48x16] matrix or the [48x8] matrix is ​​applied, the two 4x4 blocks adjacent to the upper left 4x4 block or the second and third 4x4 blocks in the scanning order.

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

[0225] According to an example, for example, in the case of LFNST adopted in the VVC standard, since the signaling of the LFNST index is performed after residual coding, the encoding device can know whether there is non-zero data (significant coefficient) at all positions within the TU or CU block through residual coding. Therefore, the encoding device can determine whether to perform signaling about the LFNST index based on the presence of non-zero data, and the decoding device can determine whether to parse the LFNST index. When non-zero data does not exist in the area specified in 1) and 2) above, the signaling of the LFNST index is performed.

[0226] Meanwhile, for the adopted LFNST, the following simplification method can be applied.

[0227] (i) According to an example, the number of output data of the forward LFNST may be limited to 16 at most.

[0228] exist Fig.11 In the case of (c), 4x4 LFNST can be applied to two 4x4 regions adjacent to the upper left, respectively, and in this case, a maximum of 32 LFNST output data can be generated. When the number of output data of the forward LFNST is limited to a maximum of 16, in the case of a 4xN / Nx4 (N≥16) block (TU or CU), 4x4 LFNST is applied only to one 4x4 region in the upper left, and LFNST can be applied only to Fig.11 All blocks of are processed at once. By doing this, the implementation of image compilation can be simplified.

[0229] (ii) According to an example, zeroing may be additionally applied to an area to which LFNST is not applied. In this article, zeroing may mean filling the values ​​of all positions belonging to a specific area with a value of 0. That is, zeroing may be applied to an area that has not been changed due to LFNST and maintains the result of the forward primary transformation. As described above, since LFNST is divided into 4x4 LFNST and 8x8 LFNST, zeroing may be divided into the following two types ((ii)-(A) and (ii)-(B)).

[0230] (ii)-(A) When 4x4 LFNST is applied, a region to which 4x4 LFNST is not applied may be zeroed. Fig.13 Illustrated is zeroing in a block to which 4×4 LFNST is applied according to an example.

[0231] like Fig.13 As shown in , for the block to which 4x4 LFNST is applied, i.e., for Fig.12 For all blocks in (a), (b), and (c), the entire area where LFNST is not applied can be filled with zeros.

[0232] on the other hand, Fig.13 (d) shows that when the maximum value of the number of output data of the forward LFNST is limited to 16 according to an example, clearing is performed on the remaining blocks to which the 4x4 LFNST is not applied.

[0233] (ii)-(B) When 8×8 LFNST is applied, a region to which 8×8 LFNST is not applied may be cleared to zero. Fig.14 Illustrated is the clearing of zeros in a block to which 8×8 LFNST is applied according to an example.

[0234] like Fig.14 As shown, for the block to which 8×8 LFNST is applied, that is, for Fig.12For all blocks in (d) and (e), the entire area where LFNST is not applied can be filled with zeros.

[0235] (iii) Due to the zeroing proposed in (ii) above, the area filled with zeros can be different when LFNST is applied. Fig.12 Compared with the case of LFNST, it is possible to check whether non-zero data exists over a wider area according to the zeroing proposed in (ii).

[0236] For example, when applying (ii)-(B), when checking Fig.12 The areas filled with zero values ​​in (d) and (e) and the Fig.14 After determining whether non-zero data exists in the area additionally filled with 0 in FIG. 1 , signaling for the LFNST index can be performed only when non-zero data does not exist.

[0237] Of course, even if the clearing proposed in (ii) is applied, the presence of non-zero data can be checked in the same way as the existing LFNST index signaling. Fig.12 LFNST index signaling can be applied after checking whether there is non-zero data in the block filled with zeros in . In this case, the encoding device only performs zero clearing, and the decoding device does not assume zero clearing, that is, it only checks whether non-zero data exists only in Fig.12 LFNST index parsing can be performed in regions explicitly marked as 0 in .

[0238] Various embodiments can be derived in which a combination of the simplified methods ((i), (ii)-(A), (ii)-(B), (iii)) for LFNST is applied. Of course, the combination of the simplified methods described above is not limited to the following embodiments, and any combination can be applied to LFNST.

[0239] Example

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

[0241] - When 4x4 LFNST is applied, all regions to which 4x4 LFNST is not applied are cleared to zero → (ii)-(A)

[0242] - When 8x8 LFNST is applied, all regions to which 8x8 LFNST is not applied are cleared → (ii)-(B)

[0243] - After checking whether non-zero data also exists in the existing region filled with zero values ​​and the region filled with zeros due to additional clearing ((ii)-(A), (ii)-(B)), the LFNST index is signaled only if non-zero data does not exist → (iii)

[0244] In the case of the embodiment, when LFNST is applied, the area where non-zero output data can exist is limited to the inside of the upper left 4×4 area. In more detail, in Fig.13 (a) and Fig.14 In case (a), the 8th position in the scan order is the last position where non-zero data can exist. Fig.13 (b) and (c) and Fig.14 In the case of (b), the 16th position in the scanning order (ie, the position of the lower right edge of the upper left 4×4 block) is the last position where data other than 0 may exist.

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

[0246] In the case of the zeroing method proposed in (ii), the amount of calculation required to perform the entire transformation process can be reduced due to the amount of data ultimately generated when both the primary transformation and the LFNST are applied. That is, when LFNST is applied, since zeroing is applied to the forward primary transformation output data exists in the area where the LFNST is not applied, it is not necessary to generate data for the area that becomes zeroed during the execution of the forward primary transformation. Therefore, the amount of calculation required to generate the corresponding data can be reduced. The additional effects of the zeroing method proposed in (ii) are summarized as follows.

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

[0248] In particular, when (ii)-(B) is applied, the amount of calculation in the worst case is reduced, so that the transform process can be made lighter. In other words, in general, a large amount of calculation is required to perform a primary transform of a large size. By applying (ii)-(B), the amount of data derived as a result of performing forward LFNST can be reduced to 16 or less. In addition, as the size of the entire block (TU or CU) increases, the effect of reducing the amount of transform operations further increases.

[0249] Second, the amount of computation required for the entire transformation process can be reduced, thereby reducing the power consumption required to perform the transformation.

[0250] Third, the delay involved in the transformation process is reduced.

[0251] Secondary transforms such as LFNST add computational effort to the existing primary transform, thus increasing the overall latency involved in performing the transform. In particular, in the case of intra prediction, since reconstructed data of neighboring blocks is used in the prediction process, during encoding, the increase in latency due to the secondary transform results in an increase in latency until reconstruction. This can result in an increase in the overall latency of intra prediction encoding.

[0252] However, if the clearing proposed in (ii) is applied, the delay time for performing the primary transform can be greatly reduced when LFNST is applied, maintaining or reducing the delay time of the entire transform, so that the encoding device can be implemented more simply.

[0253] Meanwhile, in conventional intra prediction, the block currently to be coded is regarded as one coding unit, and coding is performed without partitioning. However, intra sub-partitioning (ISP) coding means performing intra prediction coding by dividing the block currently to be coded in the horizontal direction or the vertical direction. In this case, a reconstructed block can be generated by performing encoding / decoding in units of partitioned blocks, and the reconstructed block can be used as a reference block for the next partitioned block. According to an embodiment, in ISP coding, one coding block can be divided into two or four sub-blocks and coded, and in ISP, in one sub-block, intra prediction is performed with reference to the reconstructed pixel value of the sub-block located on the adjacent left side or the adjacent upper side. Hereinafter, "coding" may be used as a concept including both coding performed by an encoding device and decoding performed by a decoding device.

[0254] ISP partitions the block predicted as intra-frame brightness into two or four sub-partitions in the vertical direction or the horizontal direction according to the size of the block. For example, the minimum block size to which ISP can be applied is 4x8 or 8x4. If the block size is larger than 4x8 or 8x4, the block is partitioned into four sub-partitions.

[0255] When ISP is applied, subblocks are sequentially coded according to partition types, such as horizontally or vertically, from left to right, or from top to bottom, and coding of the next subblock can be performed after a recovery process is performed on a subblock through inverse transform and intra prediction. For the leftmost or topmost subblock, as in the conventional intra prediction method, the reconstructed pixels of the coded coding block are referenced. In addition, if the previous subblock is not adjacent to each side of the internal subblock behind it, in order to derive the reference pixels adjacent to the corresponding side, as in the conventional intra prediction method, the reconstructed pixels of the adjacent coding block that has been coded are referenced.

[0256] In ISP coding mode, all sub-blocks can be coded with the same intra prediction mode, and a flag indicating whether ISP coding is used and a flag indicating in which direction (horizontal or vertical) partitioning is to be performed can be signaled. At this time, the number of sub-blocks may be adjusted to 2 or 4 depending on the shape of the block, and when the size (width x height) of a sub-block is less than 16, it may be restricted to not allow partitioning of the corresponding sub-block or not apply ISP coding itself.

[0257] In case of the ISP prediction mode, one coding unit is divided into two or four partition blocks (ie, sub-blocks) and predicted, and the same intra prediction mode is applied to the divided two or four partition blocks.

[0258] As described above, in the division direction, both the horizontal direction (when an M×N coding unit having a horizontal length and a vertical length of M and N, respectively, is divided in the horizontal direction, if the M×N coding unit is divided into two, the M×N coding unit is divided into M×(N / 2) blocks, and if the M×N coding unit is divided into four blocks, the M×N coding unit is divided into M×(N / 4) blocks) and the vertical direction (when the M×N coding unit is divided in the vertical direction, if the M×N coding unit is divided into two, the M×N coding unit is divided into (M / 2)×N blocks, and if the M×N coding unit is divided into four, the M×N coding unit is divided into (M / 4)×N blocks) are possible. When the M×N coding unit is divided in the horizontal direction, the partition blocks are coded in a top-to-bottom order, and when the M×N coding unit is divided in the vertical direction, the partition blocks are coded in a left-to-right order. In the case of horizontal (vertical) partitioning, the currently coded partition block can be predicted by referring to the reconstructed pixel values ​​of the upper (left) partition block.

[0259] A transform may be applied to the residual signal generated in units of partition blocks by the ISP prediction method. A multi-transform selection (MTS) technique based on a DST-7 / DCT-8 combination and the existing DCT-2 may be applied to a forward-based primary transform (core transform), and a forward low-frequency non-separable transform (LFNST) may be applied to the transform coefficients generated from the primary transform to generate the final modified transform coefficients.

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

[0261] Meanwhile, according to an embodiment, LFNST may be applied only to a transform block having both a horizontal length and a vertical length of 4 or more. Therefore, when the horizontal length or the vertical length of a partition block divided according to the ISP prediction method is less than 4, LFNST is not applied and an LFNST index is not signaled. In addition, when LFNST is applied to each partition block, the corresponding partition block may be regarded as one transform block. When the ISP prediction method is not applied, LFNST may be applied to a coding block.

[0262] A method of applying LFNST to each partition block will be described in detail.

[0263] According to an embodiment, after applying forward LFNST to each partition block, only a maximum of 16 (8 or 16) coefficients are left in the upper left 4×4 area in the transform coefficient scanning order, and then zeroing can be applied, where the remaining positions and areas are all filled with 0.

[0264] Alternatively, according to an embodiment, when the length of one side of the partition block is 4, LFNST is applied only to the upper left 4×4 region, and when the lengths of all sides of the partition block (i.e., width and height) are 8 or greater, LFNST can be applied to the remaining 48 coefficients within the upper left 8×8 region except for the lower right 4×4 region.

[0265] Alternatively, according to an embodiment, in order to adjust the worst-case computational complexity to 8 multiplications per sample, when each partition block is 4×4 or 8×8, only 8 transform coefficients may be output after applying the forward LFNST. That is, when the partition block is 4×4, an 8×16 matrix may be applied as the transform matrix, and when the partition block is 8×8, an 8×48 matrix may be applied as the transform matrix.

[0266] In the current VVC standard, LFNST index signaling is performed in units of coding units. Therefore, in ISP prediction mode and when LFNST is applied to all partition blocks, the same LFNST index value can be applied to the corresponding partition blocks. That is, when the LFNST index value is sent once at the coding unit level, the corresponding LFNST index can be applied to all partition blocks in the coding unit. As described above, the LFNST index value can have values ​​of 0, 1, and 2, where 0 represents the case where LFNST is not applied, and 1 and 2 represent two transform matrices present in one LFNST set when LFNST is applied.

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

[0268] As another example, LFNST index signaling is still performed in units of coding units, but in the case of the ISP prediction mode, it is not determined whether LFNST is uniformly applied to all partition blocks, and for each partition block, whether to apply the LFNST index value signaled at the coding unit level and whether to apply LFNST can be determined by a separate condition. Here, a separate condition can be signaled in the form of a flag for each partition block through the bitstream, and when the flag value is 1, the LFNST index value signaled at the coding unit level is applied, and when the flag value is 0, LFNST may not be applied.

[0269] Hereinafter, a method of maintaining the worst-case computational complexity when applying LFNST to the ISP mode will be described.

[0270] In the case of ISP mode, in order to keep the number of multiplications per sample (or per coefficient, or per position) to a certain value or less when applying LFNST, the application of LFNST can be limited. Depending on the size of the partition block, the number of multiplications per sample (or per coefficient, or per position) can be kept at 8 or less by applying LFNST as follows.

[0271] 1. When both the horizontal length and the vertical length of the partition block are equal to or greater than 4, the same method as the computational complexity adjustment method for the worst case of LFNST in the current VVC standard can be applied.

[0272] That is, when the partition block is a 4x4 block, instead of a 16x16 matrix, in the forward direction, an 8x16 matrix obtained by sampling the upper 8 rows from the 16x16 matrix may be applied, and in the backward direction, a 16x8 matrix obtained by sampling the left 8 columns from the 16x16 matrix may be applied. In addition, when the partition block is an 8x8 block, in the forward direction, instead of a 16x48 matrix, an 8x48 matrix obtained by sampling the upper 8 rows from the 16x48 matrix may be applied, and in the backward direction, instead of a 48x16 matrix, a 48x8 matrix obtained by sampling the left 8 columns from the 48x16 matrix may be applied.

[0273] In the case of a 4xN or Nx4 (N>4) block, when performing forward transform, the 16 coefficients generated after applying the 16x16 matrix to only the upper left 4x4 block are arranged in the upper left 4x4 area, and the other areas may be filled with 0 values. In addition, when performing inverse transform, the 16 coefficients located in the upper left 4x4 block may be arranged in a scanning order to configure an input vector, and then 16 output data may be generated by multiplying the 16x16 matrix. The generated output data may be arranged in the upper left 4x4 area, and the remaining areas except the upper left 4x4 area may be filled with zeros.

[0274] In the case of an 8xN or Nx8 (N>8) block, when performing forward transform, the 16 coefficients generated after applying the 16x48 matrix only to the ROI area in the upper left 8x8 block (excluding the remaining area of ​​the lower right 4x4 block from the upper left 8x8 block) can be arranged in the upper left 4x4 area, and the other areas can be filled with 0 values. In addition, when performing inverse transform, the 16 coefficients located in the upper left 4x4 block can be arranged in a scanning order to configure an input vector, and then 48 output data can be generated by multiplying the 48x16 matrix. The generated output data can be filled in the ROI area, and the other areas can be filled with 0 values.

[0275] As another example, in order to keep the number of multiplications per sample (or per coefficient, per position) to a certain value or less, the number of multiplications per sample (or per coefficient, per position) based on the ISP coding unit size rather than the size of the ISP partition block can be kept to 8 or less. When only one block among the ISP partition blocks meets the conditions for applying LFNST, the worst-case complexity calculation for LFNST can be applied based on the corresponding coding unit size rather than the size of the partition block. For example, the luminance coding block of a coding unit (CU) is divided (or partitioned) into four partition blocks, each of which has a size of 4×4. And, in this article, among the four partition blocks, if there are no non-zero transform coefficients for two partition blocks, each of the remaining two partition blocks can be configured to have 16 transform coefficients generated therein (based on the encoder) instead of 8 transform coefficients.

[0276] Hereinafter, a method for signaling a LFNST index in case of the ISP mode will be described.

[0277] As described above, the LFNST index may have values ​​0, 1, 2, where 0 indicates that LFNST is not applied, and where 1 and 2 respectively indicate each of two LFNST kernel matrices included in the selected LFNST set. LFNST is applied based on the LFNST kernel matrix selected by the LFNST index. In the current VVC standard, a method according to which LFNST is transmitted will be described as follows.

[0278] 1. The LFNST index may be transmitted once for each coding unit (CU), and in case of a dual tree, the LFNST index may be signaled separately for each of the luma block and the chroma block.

[0279] 2. When the LFNST index is not signaled, the LFNST index is inferred to be 0, which is a default value. The case where the LFNST index value is inferred to be 0 will be described below.

[0280] A. When the mode corresponds to a mode in which transform is not applied (eg, transform skip, BDPCM, lossless coding, etc.).

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

[0282] C. When the horizontal length or vertical length of the luma block of the coding unit exceeds the maximum luma transform size available for transformation, for example, when the maximum luma transform size available for transformation is equal to 64 and when the size of the luma block of the coding block is equal to 128×16, LFNST cannot be applied.

[0283] In the dual tree, it is determined whether each of the coding units for the luma component and the coding units for the chroma components exceeds the maximum luma transform size. That is, it is checked whether the luma block exceeds the maximum luma transform size for the transform, and it is checked whether the width or length of the corresponding luma block according to the color format with respect to the chroma block exceeds the maximum luma transform size for the maximum transform. For example, when the color format is 4:2:0, the width / length of the corresponding luma block is twice that of the chroma block, and the transform size of the corresponding luma block is twice that of the chroma block. In another example, when the color format is 4:4:4, the width / length and transform size of the corresponding luma block are the same as those of the chroma block.

[0284] A 64-length transform or a 32-length transform means a transform applied to a horizontal or vertical length of 64 or 32, respectively. And, a "transform size" may mean a corresponding length of 64 or 32.

[0285] In the case of a single tree, after checking whether the horizontal length or vertical length of the luma block exceeds the maximum luma transform block size available for transform, LFNST index signaling may be skipped (or omitted) when the length exceeds the transform block size.

[0286] D. The LFNST index may be sent only when both the horizontal length and the vertical length of the coding unit are equal to 4 or more.

[0287] In the case of a dual tree, the LFNST index may be signaled only when both the horizontal length and the vertical length of the corresponding component (ie, the luma component or the chroma component) are equal to 4 or more.

[0288] In case of a single tree, when both the horizontal length and the vertical length of the luma component are equal to 4 or more, the LFNST index may be signaled.

[0289] E. When the last non-zero coefficient position is not the DC position (upper left position in the block), if the block is a dual-tree type luma block and if the last non-zero coefficient position is not the DC position, the LFNST index is sent. If the block is a dual-tree type chroma block and if at least one of the last non-zero coefficient position of Cb and the last non-zero coefficient position of Cr is not the DC position, the corresponding LFNST index is sent.

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

[0291] Herein, when a coding block flag (CBF) value indicating the presence or absence of a transform coefficient for one transform block is equal to 0, in order to determine whether to perform LFNST index signaling, the last non-zero coefficient position for the corresponding transform block is not checked. That is, when the corresponding CBF value is equal to 0, since the transform is not applied to the corresponding block, when checking the condition for LFNST index signaling, the last non-zero coefficient position may not be considered.

[0292] For example, 1) in the case of a dual tree type and a luma component, if the corresponding CBF value is equal to 0, the LFNST index is not signaled; 2) in the case of a dual tree type and a chroma component, if the CBF value of Cb is equal to 0 and the CBF value of Cr is equal to 1, only the position of the last non-zero coefficient position of Cr is checked in order to send the corresponding LFNST index; and 3) in the case of a single tree type, only the last non-zero coefficient position of the luma component, the Cb component, or the Cr component, each having a CBF value of 1, is checked.

[0293] F. When verifying that a transform coefficient exists in a position other than the position where the LFNST transform coefficient can exist, LFNST index signaling can be skipped (or omitted). In the case of a 4×4 transform block and an 8×8 transform block, according to the transform coefficient scanning order of the VVC standard, the LFNST transform coefficient can exist in 8 positions starting from the DC position, and all remaining positions can be filled with 0. In addition, in the case where the transform block is not a 4×4 transform block and an 8×8 transform block, according to the transform coefficient scanning order of the VVC standard, the LFNST transform coefficient can exist in 16 positions starting from the DC position, and all remaining positions can be filled with 0.

[0294] Therefore, after performing residual coding, when non-zero transform coefficients exist in a region that should be filled with only 0 values, LFNST index signaling may be skipped (or omitted).

[0295] In addition, the ISP mode can be applied only to luma blocks or can be applied to both luma blocks and chroma blocks. As described above, when ISP prediction is applied, prediction is performed after the corresponding coding unit is divided (or partitioned) into 2 or 4 partition blocks, and the transform can also be applied to each of the corresponding partition blocks. Therefore, even when determining the conditions for signaling the LFNST index by the coding unit, it should be considered that the LFNST can be applied to each of the corresponding partition blocks. In addition, when the ISP prediction mode is applied only to a specific component (e.g., a luma block), the LFNST index should be signaled based on the fact that the coding unit is divided into partition blocks only for the corresponding component. The LFNST index signaling method that can be used for the ISP mode will be described below.

[0296] 1. The LFNST index may be transmitted once for each coding unit (CU), and in case of a dual tree, the LFNST index may be signaled separately for each of the luma block and the chroma block.

[0297] 2. When the LFNST index is not signaled, the LFNST index is inferred to be 0, which is a default value. The case where the LFNST index value is inferred to be 0 will be described below.

[0298] A. When the mode corresponds to a mode in which transform is not applied (eg, transform skip, BDPCM, lossless coding, etc.).

[0299] B. When the horizontal length or vertical length of the luma block of the coding unit exceeds the maximum luma transform size available for transformation, for example, when the maximum luma transform size available for transformation is equal to 64 and when the size of the luma block of the coding block is equal to 128×16, LFNST cannot be applied.

[0300] Whether to perform signaling of the LFNST index may be determined based on the size of the partition block rather than the size of the coding unit. That is, when the horizontal length or vertical length of the partition block corresponding to the luma block exceeds the maximum luma transform size available for transform, the LFNST index signaling may be skipped (or omitted) and the LFNST index value may be inferred to be 0.

[0301] In the dual tree, it is determined whether each of the coding unit or partition block for the luma component and the coding unit or partition block for the chroma component exceeds the maximum transform block size. That is, when each of the width and length of the coding unit or partition block for luma is compared with the maximum luma transform size and even one of them is greater than the maximum luma transform size, LFNST is not applied. In the coding unit or partition block for chroma, the width / length of the corresponding luma block according to the color format is compared with the maximum luma transform size for the maximum transform. For example, when the color format is 4:2:0, the width / length of the corresponding luma block is twice that of the chroma block, and the maximum transform size of the corresponding luma block is twice the maximum transform size of the chroma block. In another example, when the color format is 4:4:4, the width / length and transform size of the corresponding luma block are the same as the width / length and transform size of the chroma block.

[0302] In the case of a single tree, after checking whether the horizontal length or vertical length of the luma block (coding unit or partition block) exceeds the maximum luma transform block size available for transform, LFNST index signaling can be skipped (or omitted) when the length exceeds the transform block size.

[0303] C. If LFNST included in the current VVC standard is applied, the LFNST index may be transmitted only when both the horizontal length and the vertical length of the partition block are equal to 4 or more.

[0304] In addition to the LFNST included in the current VVC standard, if LFNST for 2×M (1×M) or M×2 (M×1) blocks is applied, the LFNST index may be sent only when the partition block size is equal to or greater than 2×M (1×M) or M×2 (M×1) blocks. Herein, when a P×Q block is equal to or greater than an R×S block, this means P≥R and Q≥S.

[0305] In summary, the LFNST index may be signaled only for the case where the partition block size is equal to or greater than the minimum size to which LFNST may be applied. In the case of a dual tree, the LFNST index may be signaled only if the size of the partition block of the luma component or the chroma component is equal to or greater than the minimum size to which LFNST may be applied. In the case of a single tree, the LFNST index may be signaled only if the size of the partition block of the luma component is equal to or greater than the minimum size to which LFNST may be applied.

[0306] In this specification, when an M×N block is equal to or greater than a K×L block, this means that M is equal to or greater than K and N is equal to or greater than L. When an M×N block is greater than a K×L block, this means that M is equal to or greater than K and N is equal to or greater than L, while M is greater than K or N is greater than L. When an M×N block is less than or equal to a K×L block, this means that M is less than or equal to K and N is less than or equal to L. And, when an M×N block is less than a K×L block, this means that M is less than or equal to K and N is less than or equal to L, while M is less than K or N is less than L.

[0307] D. When the last non-zero coefficient position is not the DC position (upper left position in the block), if the block is a dual-tree type luminance block and even the corresponding last non-zero coefficient position for one of all partition blocks is not the DC position, the LFNST index may be transmitted. If the block is a dual-tree type chrominance block and even one of the last non-zero coefficient positions of all partition blocks for Cb (when the ISP mode is not applied to the chrominance component, it is assumed that the number of partition blocks is equal to 1) and the last non-zero coefficient position of all partition blocks for Cr (when the ISP mode is not applied to the chrominance component, it is assumed that the number of partition blocks is equal to 1) is not the DC position, the corresponding LFNST index may be transmitted.

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

[0309] Here, when a coding block flag (CBF) value indicating the presence or absence of a transform coefficient of each partition block is equal to 0, in order to determine whether to perform LFNST index signaling, the last non-zero coefficient position of the corresponding partition block is not checked. That is, when the corresponding CBF value is equal to 0, since the transform is not applied to the corresponding block, when checking the condition for LFNST index signaling, the last non-zero coefficient position of the corresponding partition block is not considered.

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

[0311] In the case of the ISP mode, the image information may be configured such that the last non-zero coefficient position is not checked, and a corresponding embodiment will be described below.

[0312] i. In the case of ISP mode, the check of the last non-zero coefficient position of both the luminance block and the chrominance block is skipped, and LFNST index signaling can be authorized. That is, even if the last non-zero coefficient position for all partition blocks is the DC position or the corresponding CBF value is 0, LFNST index signaling can be allowed.

[0313] ii. In the case of ISP mode, only the check of the last non-zero coefficient position of the luma block is skipped, and for the chroma block, the check of the last non-zero coefficient position according to the above method may be performed. For example, in the case of a dual tree type and a luma block, the check of the last non-zero coefficient position is not performed, and LFNST index signaling may be authorized. And, in the case of a dual tree type and a chroma block, the presence or absence of a DC position corresponding to the last non-zero coefficient position is checked according to the above method to determine whether to perform signaling of the corresponding LFNST index.

[0314] iii. In the case of ISP mode and single tree type, method number i and method number ii may be applied. That is, in the case of applying method number i to ISP mode and single tree type, checking of the last non-zero coefficient position of both the luminance block and the chrominance block may be skipped, and LFNST index signaling may be authorized. Alternatively, by applying method number ii, checking of the last non-zero coefficient position of the partition block of the luminance component may be skipped, and checking of the last non-zero coefficient position of the partition block of the chrominance component may be performed according to the above method (when the ISP mode is not applied to the chrominance component, the number of partition blocks may be given to be equal to 1), so as to determine whether to perform signaling of the corresponding LFNST index.

[0315] E. For example, when it is verified that a transform coefficient exists in a position other than a position where a LFNST transform coefficient may exist even for one partition block among all partition blocks, LFNST index signaling may be skipped (or omitted).

[0316] For example, in the case of a 4×4 partition block and an 8×8 partition block, according to the transform coefficient scanning order of the VVC standard, the LFNST transform coefficient may be present in 8 positions starting from the DC position, and all remaining positions may be filled with 0. In addition, in the case where the partition block is equal to or greater than 4×4, and in the case where the partition block is not a 4×4 partition block and an 8×8 partition block, according to the transform coefficient scanning order of the VVC standard, the LFNST transform coefficient may be present in 16 positions starting from the DC position, and all remaining positions may be filled with 0.

[0317] Therefore, after performing residual coding, when non-zero transform coefficients exist in a region that should be filled with only 0 values, LFNST index signaling may be skipped (or omitted).

[0318] Meanwhile, in the case of ISP mode, in the current VVC standard, DST-7 is applied instead of DCT-2 by independently (or individually) referring to the length conditions in the horizontal and vertical directions, without performing signaling for the MTS index. Depending on whether the horizontal or vertical length is equal to or greater than 4 and less than or equal to 16, the primary transform kernel is determined. Therefore, in the case of ISP mode, and when LFNST can be applied, the following transform combination can be configured as described below.

[0319] 1. For the case where the LFNST index is 0 (including the case where the LFNST index is inferred to be 0), the conditions for determining the primary transform corresponding to the ISP mode included in the current VVC standard may be followed. That is, by independently (or separately) checking whether the length conditions in the horizontal direction and the vertical direction (i.e., the condition that the length is equal to or greater than 4 and less than or equal to 16) are met, if the length condition is met, DST-7 is applied to the primary transform instead of DCT-2. And, if the length condition is not met, DCT-2 may be applied.

[0320] 2. For the case where the LFNST index is greater than 0, the following two configurations may be possible for the primary transform.

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

[0322] B. The conditions for determining the primary transform corresponding to the ISP mode included in the current VVC standard may be followed. That is, by independently (or separately) checking whether the length conditions in the horizontal direction and the vertical direction (i.e., the condition that the length is equal to or greater than 4 and less than or equal to 16) are met, if the length condition is met, DST-7 is applied instead of DCT-2. And, if the length condition is not met, DCT-2 may be applied.

[0323] In the case of the ISP mode, the image information may be configured so that the LFNST index may be transmitted for each partition block instead of for each coding unit. In this case, the above-mentioned LFNST index signaling method assumes that there is only one partition block within the unit through which the LFNST index is transmitted, and it may be determined whether to perform signaling of the LFNST index.

[0324] According to one embodiment, a block differential pulse code modulation or block-based delta pulse code modulation (BDPCM) scheme may be used. BDPCM may also be referred to as quantized residual block-based delta pulse code modulation (RDPCM).

[0325] When a block is predicted by applying BDPCM, the reconstructed samples are used to predict the rows or columns of the block line by line. Here, the reference pixels used can be unfiltered samples. The BDPCM direction can indicate whether vertical or horizontal prediction is used. The prediction error is quantized in the spatial domain, and the pixel is reconstructed by adding the dequantized prediction error to the prediction. As an alternative to this BDPCM, a quantized residual domain BDPCM can be proposed, in which the prediction direction or signaling can be the same as that applied to the BDPCM in the spatial domain. That is, as in incremental pulse code modulation (DPCM), the quantized coefficients themselves can be accumulated by quantized residual domain BDPCM, after which the residual can be reconstructed by dequantization. Therefore, the quantized residual domain BDPCM can be used in the sense of applying DPCM in the residual coding stage. The quantized residual domain used in the present disclosure indicates that the residual derived based on the prediction is quantized without transformation, and refers to the domain of the residual samples used for quantization.

[0326] According to an example, whether a block-based delta pulse code modulation (BDPCM) mode is applied may be signaled in a syntax table of a coding unit as shown in Table 3.

[0327] [Table 3]

[0328]

[0329]

[0330] In Table 3, intra_bdpcm_luma_flag is a flag indicating whether BDPCM is applied to the luma component of the coding unit, and intra_bdpcm_chroma_flag is a flag indicating whether BDPCM is applied to the chroma component of the coding unit. A flag value of 1 indicates that BDPCM is applied, and a flag value of 0 indicates that BDPCM is not applied. The value of the variable BdpcmFlag[x][y][cIdx] is determined according to the values ​​of intra_bdpcm_luma_flag and intra_bdpcm_chroma_flag, as shown in Table 4.

[0331] [Table 4]

[0332]

[0333] In BdpcmFlag[x][y][cIdx] of Table 4, the value of x is the x coordinate (horizontal pixel position) value based on the upper left horizontal coordinate (x coordinate) position of the luma picture as a reference (set to 0), and the x coordinate increases from left to right. In BdpcmFlag[x][y][cIdx] of Table 4, the value of y is the y coordinate (vertical pixel position) value based on the upper left vertical coordinate (y coordinate) position of the luma picture as a reference (set to 0), and the y coordinate increases from top to bottom.

[0334] In BdpcmFlag[x][y][cIdx] of Table 4, the value of cIdx indicates a color component (Y, Cb, or Cr), 0 indicates a luma component, and 1 and 2 indicate chroma components (1 for Cb and 2 for Cr). In Table 4, even if the value of cIdx is a chroma component other than 0, the x coordinate and the y coordinate are expressed based on the luma picture. For example, when the horizontal resolution of the chroma component is two times lower than the horizontal resolution of the luma component (for example, when the color format used for the picture is 4:2:0 or 4:2:2), the actual x coordinate value for the chroma picture is half of the corresponding coordinate based on the luma picture.

[0335] In Table 4, cbWidth and cbHeight indicate the width and length of the coding block based on the luma component, respectively. Similarly, when the horizontal (vertical) resolution of the chroma component is two times lower than that of the luma component, the actual width (length) of the corresponding chroma coding block is half of that of the luma coding block.

[0336] In Table 4, x0 and y0 respectively indicate an x ​​coordinate value and a y coordinate value of an upper left position in a luma coding block when an upper left position of a luma picture is set to 0. Here, when converted into a luma component, a chroma coding block corresponds to a collocated luma position.

[0337] As shown in Table 4, since all BdpcmFlag[x][y][cIdx] values ​​for two chroma components (Cb and Cr) are set to intra_bdpcm_chroma_flag, when the value of intra_bdpcm_chroma_flag is 1, BDPCM can be applied to both of the two chroma components (Cb and Cr) of the currently coded coding unit.

[0338] As shown in Table 5, when BDPCM is applied to each component, the value of the transform skip flag (transform_skip_flag) for the component is inferred to be 1.

[0339] [Table 5]

[0340]

[0341]

[0342] In Table 5, transform_skip_flag[x0][y0][cIdx] is a flag indicating whether the coding block is coded with transform skip. A flag value of 1 indicates that transform skip is applied, and a flag value of 0 indicates that transform skip is not applied. Here, the meanings of x0, y0, cIdx are also specified in Table 5 and described with reference to Table 4.

[0343] In Table 5, when the value of BdpcmFlag[x0][y0][cIdx] is 1, transform_skip_flag[x0][y0][cIdx] is inferred to be 1 (i.e., when BPPCM is applied to the component specified by cIdx, the transform skip flag for the component is set to 1), and as shown in Table 4, since all BdpcmFlag[x0][y0][cIdx] values ​​for two chroma components (Cb and Cr) are set to intra_bdpcm_chroma_flag, for the case where BDPCM is applied to the chroma components, the transform_skip_flag[x0][y0][cIdx] values ​​for the two chroma components are equally set to 1.

[0344] Table 6 is a syntax table for a transform unit, which shows the signaling or parsing of transform_skip_flag[x0][y0][cIdx] and the coding block flag (CBF) value of the transform block for each color component.

[0345] [Table 6]

[0346]

[0347]

[0348] In Table 6, when tu_y_coded_flag[x0][y0] (or can be expressed as tu_cbf_luma[x0][y0]) as CBF for luma component and tu_cb_coded_flag[xC][yC] (CBF for Cb component or tu_cbf_cb[xC][yC]) and tu_cr_coded_flag[xC][yC] (CBF for Cr component or tu_cbf_cr[xC][yC]) as CBF for chroma component are signaled, it is not checked whether BDPCM is applied to each component. That is, the value of BdpcmFlag[x][y][cIdx] is not checked.

[0349] Here, the coding block flag (CBF) indicates whether there is a transform coefficient in the transform block, wherein a value of 1 indicates that there is a transform coefficient, and a value of 0 indicates that there is no transform coefficient. Therefore, even if BDPCM is applied to each component, the corresponding CBF value may be 0.

[0350] According to the BDPCM operation method, the residual signal is reconstructed by accumulating the values ​​transmitted in the form of transform coefficients for each position according to the selected direction (horizontal or vertical direction in VVC, specified by intra_bdpcm_luma_dir_flag for the luma component in Table 4, and specified by intra_bdpm_chroma_dir_flag for the chroma component). Here, the CBF value of 0 can be considered to be the same in operation as in a general intra prediction method without a residual signal.

[0351] However, when the CBF value is 0, the BDPCM mode in which intra_bdpcm_luma_flag, intra_bdpcm_luma_dir_flag, intra_bdpcm_chroma_flag, and intra_bdpcm_chroma_dir_flag are signaled may be more advantageous than intra prediction coding in terms of RD cost. Therefore, when the CBF value is 0, coding may be performed in the BDPCM mode, and thus the CBF value may be 0 even in the BDPCM mode.

[0352] The LFNST index (lfnst_idx) may be signaled in the coding unit of Table 3, and as shown in Table 3, the LFNST index may be signaled only when the value of the variable lfnstNotTsFlag is 1. In Table 3, when any one of the transform skip flags for a plurality of components is 1, the value of lfnstNotTsFlag is set to 1. That is, the variable lfnstNotTsFlag may be set to 1 only when all transform skip flag values ​​of all components belonging to the current coding unit are 0.

[0353] As shown in Table 3, in a single tree, the value of lfnstNotTsFlag can be 1 only when the transform skip flags for both the luma component and the chroma component are 0, in the luma separation tree (DUAL_TREE_LUMA), when only the transform skip flag for the luma component is 0, the value of the variable lfnstNotTsFlag can be 1, and in the chroma separation tree (DUAL_TREE_CHROMA), the value of the variable lfnstNotTsFlag can be 1 only when all transform skip flags for the Cb component and the Cr component are 0.

[0354] As described above, when the BDPCM mode is applied to a component and the CBF value is 0, the transform skip flag for the component may be inferred to be 1. However, since there is no transform coefficient for the component, the component is irrelevant to the transform process. The component is irrelevant to the transform process and therefore needs to be irrelevant to the signaling of the LFNST index. However, in this case, in Table 3, since the transform skip flag for the component is inferred to be 1 and therefore the value of lfnstNotTsFlag is set to 0, the LFNST index is not signaled. For specific explanation, the following case may be exemplified.

[0355] 1. In the chroma separation tree, if, unlike Table 3, for each of the Cb component and the Cr component, there is a separate flag indicating whether BDPCM is applied (for example, if there are intra_bdpcm_cb_flag and intra_bdpcm_cr_flag instead of intra_bdpcm_chroma_flag in Table 3), when BDPCM is applied to the Cb component or the Cr component and the CBF value for the corresponding transform block is 0, the transform skip flag for the Cb component or the Cr component is also 1, and thus the value of lfnstNotTsFlag in Table 3 is 0. Therefore, the LFNST index is not signaled.

[0356] However, when BDPCM is applied to the Cr component or the Cb component, the CBF value for the remaining component is not 0, and the value of the transform skip flag for the remaining component is 0, LFNST may be applied to the remaining component, and thus it is desirable to allow the LFNST index to be signaled.

[0357] However, as shown in Table 3, if the flag indicating whether BDPCM is applied to the Cb component and the Cr component is the same as intra_bdpcm_chroma_flag, BDPCM is applied to both the Cb component and the Cr component when intra_bdpcm_chroma_flag is 1. Therefore, a situation in which BDPCM is applied to the Cr component or the Cb component, the CBF value for the remaining component is not 0, and the transform skip flag value for the remaining component is 0 does not occur, and the LFNST index is not signaled.

[0358] 2. In a single tree, when BDPCM is applied to any one component of Y, Cb, and Cr and the CBF value for the corresponding transform block is 0, the transform skip flag value for the component is also 1, and thus the value of lfnstNotTsFlag is 0.

[0359] However, when the CBF value for any one of the remaining two components is not 0 and the transform skip flag value for the component is 0, LFNST may be applied to the component, and thus it is desirable to allow the LFNST index to be signaled.

[0360] As shown in Table 3, it is assumed that whether BDPCM is applied to the luminance component (Y) is determined by intra_luma_bdpcm_flag (when the value of intra_luma_bdpcm_flag is 1, BDPCM is applied, and when the value of intra_luma_bdpcm_flag is 0, BDPCM is not applied) and whether BDPCM is applied to the two chrominance components (Cb and Cr) is determined by intra_chroma_bdpcm_flag (when the value of intra_chroma_bdpcm_flag is 1, BDPCM is applied, and when the value of intra_chroma_bdpcm_flag is 0, BDPCM is not applied).

[0361] In this case, when coding is performed in a single tree, (1) when BDPCM is applied to the luma component, the corresponding CBF value is 0, and the corresponding CBF value of any of the remaining two chroma components is not 0, and the transform skip flag value for the component is 0, LFNST can be applied to the chroma component. However, when BDPCM is applied to the luma component and the corresponding CBF value is 0, the LFNST index can be signaled only when all transform skip flag values ​​for the two chroma components are 0 in the current VVC standard, and for this reason, BDPCM cannot be applied to the two chroma components. In addition, in the current VVC standard, since LFNST is applied only to the luma component in a single tree, LFNST is not applied to the chroma components when coding is performed in a single tree.

[0362] (2) In a different case of coding in a single tree, where BDPCM is applied to two chroma components and the CBF value for the two chroma components is 0, LFNST may be applied to the luma component when the CBF value for the luma component is not 0 and its transform skip flag value is 0. That is, even if transform skip is not applied to the luma component, BDPCM is applied to two chroma components, and all CBF values ​​of the chroma components are 0, the LFNST index for the luma component may be signaled.

[0363] Therefore, when the variable lfnstNotTsFlag in Table 3 is set as shown in Table 7 and Table 8, the LFNST index may be signaled in two cases ((1) and (2)).

[0364] [Table 7]

[0365]

[0366] [Table 8]

[0367]

[0368] As shown in Tables 7 and 8, when the CBF value for a component is 0, the transform skip flag value for the component does not matter even if it is any value, and thus does not contribute to changing the value of lfnstNotTsFlag to 0.

[0369] In other words, when the CBF values ​​for all components belonging to the coding unit are 0 or the transform skip flag values ​​thereof are 0, the value of lfnstNotTsFlag may be set to 1.

[0370] In Table 7, different components of the check condition are configured depending on the single tree, the luma separation tree, and the chroma separation tree. That is, the CBF value or the transform skip flag value is checked for Y / Cb / Cr in the single tree, for only Y in the luma separation tree, and for Cb and Cr in the chroma separation tree, and all components in Table 8 are checked.

[0371] In Table 8, it is assumed that for components not associated with the current coding unit, the CBF or transform skip flag is inferred to be 0. That is, in the luma separation tree, tu_cb_coded_flag[x0][y0] or transform_skip_flag[x0][y0][1] needs to be inferred to be 0, and tu_cr_coded_flag[x0][y0] or transform_skip_flag[x0][y0][2] needs to be inferred to be 0. In the chroma separation tree, tu_y_coded_flag[x0][y0] or transform_skip_flag[x0][y0][0] needs to be inferred to be 0.

[0372] In the current VVC standard, LFNST can be applied to the coding block to which the ISP mode is applied. When the ISP mode is applied and the coding block of the Y component is thus divided into N (N=2 or 4) partition blocks, each partition block has a CBF value. That is, tu_y_coded_flag is signaled for each partition block.

[0373] When the ISP mode is applied in the current VVC standard, it is guaranteed that at least one of the partition blocks has a CBF of 1, and one of the partition blocks having a CBF of 1 does not necessarily need to be the first partition block in the coding order.

[0374] When ISP is applied, since x0 and y0 in Tables 7 and 8 are the x coordinate and y coordinate of the coding unit, tu_y_coded_flag[x0][y0] in Tables 7 and 8 is the CBF for the first partition block.

[0375] Therefore, when the ISP mode is applied, it is impossible to check whether the transform coefficient exists in the luma coding block only by the condition “!tu_y_coded_flag[x0][y0]” in Tables 7 and 8.

[0376] According to an example, when the ISP mode is applied, Tables 7 and 8 can be described as Tables 9 and 10, respectively, to reflect the case where it is not possible to clearly check whether the transform coefficient exists in the luma coding block. In Tables 9 and 10, the condition "IntraSubPartitionsSplitType==ISP_NO_SPLIT" indicates the case where the ISP mode is not applied.

[0377] [Table 9]

[0378]

[0379] [Table 10]

[0380]

[0381] However, since transform skip cannot be applied when the ISP mode is applied in the current VVC standard, the ISP mode is not applied unless the condition of “transform_skip_flag[x0][y0][0]==0” is satisfied.

[0382] The condition is true when only one of "!tu_y_coded_flag[x0][y0]" and "transform_skip_flag[x0][y0]][0]==0" in the condition of Table 7 "!tu_y_coded_flag[x0][y0]||transform_skip_flag[x0]][y0][0]==0" is logically satisfied, and therefore it makes sense to check "!tu_y_coded_flag[x0][y0]" only when "transform_skip_flag[x0][y0][0]==0" is not satisfied.

[0383] However, as described above, when "transform_skip_flag[x0][y0][0]==0" is not satisfied, it is certain that the ISP mode is not applied, and therefore, when checking "!tu_y_coded_flag[x0][y0]", it is not necessary to consider whether the ISP mode is applied. Therefore, Tables 7 and 8 are considered to be still valid.

[0384] According to an example, in the current VVC, LFNST 1) can be applied in the luma separation tree, 2) can be applied in the chroma separation tree, and 3) can be applied only to the luma component in a single tree. As described above, since the transform is not applied to the component to which BDPCM is applied and CBF is 0, the component can be considered irrelevant to LFNST.

[0385] In the luma separation tree or the single tree, when BDPCM is applied to the luma component and the CBF is 0, LFNST is not applied at all, and therefore there is no need to check the CBF value for the luma component. Therefore, in the luma separation tree and the single tree, lfnstNotTsFlag may be derived as shown in Table 11 or Table 12 without checking the CBF value for the luma component.

[0386] [Table 11]

[0387]

[0388] [Table 12]

[0389]

[0390] When Table 11 or Table 12 is applied, the operations in all cases where BDPCM and LFNST are applied are described as follows.

[0391] 1. BDPCM is not applied to luma and BDPCM is not applied to chroma: The same operation as in the current VVC standard, ie, Table 3, is performed.

[0392] 2. BDPCM is applied to luminance and BDPCM is not applied to chrominance

[0393] 2-1) Luma separation tree: Performs the same operation as the current VVC standard, ie, Table 3. That is, in both cases where the CBF for the luma component is 0 and the CBF for the luma component is 1, the LFNST index is inferred to be 0 without being signaled.

[0394] 2-2) Chroma separation tree: performs the same operation as the current VVC standard, i.e., in Table 3.

[0395] 2-3) Single Tree: The same operation as in the current VVC standard, ie, Table 3, is performed because the CBF for the luma component is not checked in Table 12.

[0396] 3. BDPCM should not be used for luminance and BDPCM should be used for chrominance

[0397] 3-1) Luminance separation tree: performs the same operation as the current VVC standard, i.e., in Table 3.

[0398] 3-2) Chroma separation tree: When the CBF value for both the Cb component and the Cr component is 0, the LFNST index is inferred to be 0 without being signaled, and thus the same operation as the current VVC standard, ie, Table 3, is performed.

[0399] 3-3) Single tree: Even if the CBF value for the Cb component and the Cr component is 0, BDPCM is not applied to the luma component, and thus LFNST can be applied. Therefore, the LFNST index can be signaled. However, in the current VVC standard, LFNST is not applied in this case.

[0400] 4. BDPCM is applied to luma and BDPCM is applied to chroma: Because BDPCM is applied to the luma component, the corresponding transform skip flag is 1, and the value of lfnstNotTsFlag is 0, and thus the LFNST index is not signaled. Finally, the same operation as in the current VVC standard, ie, Table 3, is performed.

[0401] As mentioned above, according to the current VVC standard, in the luma separation tree and the single tree, LFNST can be applied only to the luma component. In the luma separation tree, when the CBF value for the luma component is 0, the value of the variable LfnstDcOnly remains 1 in Table 3, and thus the LFNST index is inferred to be 0 without being sent with a signal.

[0402] However, in a single tree, even if the CBF value for the luma component is 0, when the value of LfnstDcOnly is updated to 0 by the chroma component (when the corresponding residual coding is performed and thus the last non-zero transform coefficient exists outside the DC position, the value of LfnstDcOnly is updated to 0), and when the clearing condition for LFNST is satisfied with respect to the chroma component and thus the value of LfnstZeroOutSigCoeffFlag remains 0 (as a case where the transform coefficient exists only in an area in which the transform coefficient can exist when the forward LFNST is applied, in the case where the size of the transform block is 4×4 and 8×8, the transform coefficient can exist at positions from the DC position to the eighth position according to the forward scanning order, and in other cases, the transform coefficient can exist in the upper left 4×4 area of ​​the TB. Here, the DC position refers to the upper left position of the transform block), the LFNST index can be signaled.

[0403] Therefore, in the current VVC standard, in a single tree, even if the LFNST index is signaled, the CBF value for the luma component is 0 and the resulting LFNST is not applied to any component, and thus the LFNST index may be redundantly signaled.

[0404] By modifying the value of the variable lfnstNotTsFlag set in Table 3 as shown in Table 13, the LFNST index may be configured to be inferred to be 0 without being signaled when the CBF value for the luma component in a single tree is 0.

[0405] Here, the condition "IntraSubPartitionsSplitType!=ISP_NO_SPLIT" in Table 13 indicates that the ISP mode is applied. As described above, when the ISP mode is applied, the CBF for at least one partition block is not 0, and in the coding order, tu_y_coded_flag[x0][y0] is only the CBF for the first partition block, and therefore tu_y_coded_flag[x0][y0] is checked only when the condition "IntraSubPartitionsSplitType!=ISP_NO_SPLIT" is independently separated and the ISP mode is not applied.

[0406] [Table 13]

[0407]

[0408] As shown in Tables 7 to 10, when the LFNST index is allowed to be signaled even when BDPCM is applied and the CBF value is 0 (ie, regarded as a transform block to which transform is not applied in this case), the variable lfnstNotTsFlag may be set as shown in Table 14.

[0409] [Table 14]

[0410]

[0411] When Table 14 is applied, 1) in the luma separation tree, the LFNST index is signaled only when the CBF value for the luma component is 1, as in Table 3, and 2) in the chroma separation tree, as shown in Tables 7 to 12, when all CBF values ​​for chroma components (Cb and Cr) are 0, the LFNST index is not signaled, for example, when BDPCM is applied and all CBF values ​​for Cb components and Cr components are 0. In addition, 3) in a single tree, the LFNST index is signaled when the CBF value for the luma component is 1 and 3-1) transform skipping is not applied to both Cb components and Cr components or 3-2) when BDPCM is applied to chroma components, all CBF values ​​for Cb components and Cr components are 0.

[0412] Hereinafter, an embodiment in which a CBF value for a transform block is inferred to be 1 when the BDPCM mode is applied and the existing LFNST index signaling method is used as it is will be described.

[0413] When each color component is coded in BDPCM mode, the LFNST index signaling method proposed in Table 3, that is, the existing setting for the variable lfnstNotTsFlag, can be used as is by inferring that the CBF value for the component is 1. According to this embodiment, the syntax table for the transform unit of Table 6 can be changed as shown in Table 15.

[0414] [Table 15]

[0415]

[0416]

[0417] As shown in Table 3, since ISP and BDPCM are mutually exclusive, that is, intra_subpartitions_mode_flag[x0][y0] can be parsed only when intra_bdpcm_luma_flag is 0, ISP is not enabled when BDPCM is enabled, and BDPCM is not enabled when ISP is enabled. In Table 15, the condition "IntraSubPartitionsSplitType!=ISP_NO_SPLIT" indicates that the ISP mode is applied, and the condition !BdpcmFlag[x0][y0][0] can be expressed as shown in Table 16.

[0418] [Table 16]

[0419]

[0420] In addition to Table 15, the content that the corresponding CBF value is inferred to be 1 when BDPCM is applied can be reflected in the specification text of CBF (Table 17).

[0421] [Table 17]

[0422]

[0423] When BDPCM is applied to chroma of the currently coded coding unit, joint Cb-Cr may be enabled as is or may be disabled. In Table 15, tu_joint_cbcr_residual_flag[xC][yC], which is a syntax element indicating whether joint Cb-Cr is enabled, is signaled.

[0424] As shown in Table 17, when BDPCM is applied to chroma components (i.e., when BdpcmFlag[x0][y0][1] and BdpcmFlag[x0][y0][2] are both 1), if the CBF values ​​for the Cb component and the Cr component are inferred to be 1, joint Cb-Cr can be applied only when tu_cb_coded_flag[xC][yC] and tu_cr_coded_flag[xC][yC] are both 1. Table 18 shows normative text related to the joint Cb-Cr operation.

[0425] [Table 18]

[0426]

[0427]

[0428]

[0429]

[0430] As shown in Table 18, when the joint Cb-Cr mode is applied, the transform coefficient for one of the chrominance components is signaled and coded, that is, the component specified by codedCIdx in Table 18 is coded. codedCIdx may have a value of 1 or 2, where 1 indicates a Cb component and 2 indicates a Cr component. Here, the residual data for the other components is determined as the value of the residual data of the coded component multiplied by the value of cSign, and then right-shifted by 1 or not shifted.

[0431] When BDPCM is applied to the chroma component, because the value of TuCResMode[x0][y0] is determined to be 2, as shown in Table 18, the residual data of other components are determined to be values ​​that are not shifted right by 1 (resSamples[x][y] = cSign*res[x][y]) and the value of cSign is determined to be (1-2*ph_joint_cbcr_sign_flag) based on the syntax element ph_joint_cbcr_sign_flag.

[0432] In addition, as shown in Table 19, when BDPCM is not applied to the chrominance component, the joint Cb-Cr mode may not be applied. In Table 19, only a part of the signaling tu_joint_cbcr_residual_flag[xC][yC] in Table 15 is changed. That is, when BDPCM is not applied to the chrominance component, the joint Cb-Cr mode is restricted to not be applied.

[0433] [Table 19]

[0434]

[0435] Using the variables BdpcmFlag[x0][y0][1] and BdpcmFlag[x0][y0][2], syntax information operating in the same manner as in Table 19 may be configured as shown in Table 20.

[0436] [Table 20]

[0437]

[0438] According to an example, when BDPCM mode is applied, a bitstream consistency constraint may be assigned to signal the CBF value for the corresponding transform block as 1.

[0439] When the BDPCM mode is applied and the CBF value is 0, the transform skip flag of the corresponding component is inferred to be 1. In this case, even if the component is not related to the transform process due to the absence of transform coefficients, the transform skip flag is inferred to be 1, and thus the LFNST index is not signaled. To prevent this problem, when the BDPCM mode is applied, a bitstream consistency constraint may be assigned to signal the CBF value of the corresponding transform block as 1.

[0440] Table 21 shows that the bitstream consistency constraints are added to the semantics for each CBF.

[0441] [Table 21]

[0442]

[0443] The following drawings are provided to describe specific examples of the present disclosure. Since specific terms for devices or specific terms for signals / messages / fields shown in the drawings are provided for illustration, the technical features of the present disclosure are not limited to the specific terms used in the following drawings.

[0444] Fig.15 is a flowchart illustrating the operation of a video decoding device according to an embodiment of the present disclosure.

[0445] Fig.15 Each process disclosed in the reference is based on Figures 5 to 14 Therefore, with reference Figure 3 and Figures 5 to 14 Descriptions of those overlapping specific details will be omitted or will be made schematically.

[0446] The decoding apparatus 300 according to an embodiment may receive residual information from a bitstream ( S1510 ).

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

[0448] The decoding device may further receive information about the intra prediction mode for the current block and information about whether the ISP is applied to the current block. The decoding device may receive and parse flag information indicating whether ISP coding is applied or ISP mode is applied, thereby deriving whether the current block is divided into a predetermined number of sub-partition transform blocks. Here, the current block may be a coding block. In addition, the decoding device may derive the size and number of the divided sub-partition blocks by the flag information indicating the direction in which the current block is divided.

[0449] According to an example, an LFNST index may be received through a bitstream. The LFNST index is a value for specifying an LFNST matrix when LFNST is applied as an inverse secondary inseparable transform, and may have a value ranging from 0 to 2. For example, an LFNST index value of 0 may indicate that LFNST is not applied to the current block, an LFNST index value of 1 may indicate a first LFNST matrix, and an LFNST index value of 2 may indicate a second LFNST matrix.

[0450] Information about ISP and LFNST indexes may be received in a compilation unit level.

[0451] The decoding apparatus 300 may derive a transform coefficient for the current block by performing dequantization based on the residual information ( S1520 ).

[0452] Here, the current block may be a transform block, which is a transform unit, and when the tree type of the current block is a single tree, the current block may include a transform block for a luma component, a transform block for a first chroma component, and a transform block for a second chroma component. When the tree type of the current block is dual-tree luma, the current block may include a transform block for a luma component, and when the tree type of the current block is dual-tree chroma, the current block may include a transform block for a first chroma component and a transform block for a second chroma component.

[0453] The derived transform coefficients may be arranged in a 4×4 block unit according to a reverse diagonal scanning order, and the transform coefficients in a 4×4 block may also be arranged according to a reverse diagonal scanning order. That is, the dequantized transform coefficients may be arranged according to a reverse scanning order applied in a video codec, such as in VVC or HEVC.

[0454] The decoding apparatus may set a LFNST application variable regarding whether to apply LFNST based on the tree type of the current block and a transform coefficient coding flag for each component of the current block or a transform skip flag for each component of the current block ( S1530 ).

[0455] The LFNST application variable may be a flag variable, for example, lfnstNotTsFlag, and lfnstNotTsFlag may be derived based on the tree type of the current block and the transform coefficient coding flag for each component of the current block or the transform skip flag for each component of the current block. The LFNST application variable equal to 1 indicates that LFNST is applicable, and the LFNST application variable equal to 0 indicates that no LFNST is applicable. That is, when the LFNST application variable is 1, the LFNST index may be parsed, and when the LFNST application variable is 0, the LFNST index may not be parsed.

[0456] The transform coefficient coding flag refers to a CBF indicating whether there is a transform coefficient for a transform block, where when the CBF is equal to 1, it indicates that there is a transform coefficient for the transform block and the transform process can be performed, and when the CBF is equal to 0, no transform process is performed.

[0457] According to an example, the value of the LFNST application variable may be derived as 1 based on the transform coefficient coding flag for all components of the current block being 0. In this case, the value of the LFNST application variable is set to 1, but when the CBF is 0, the actual transform process is not performed and the residual coding is not introduced, and therefore the variable LfnstDcOnly described later is not updated to 0. That is, when the transform coefficient coding flag for all components of the current block is 0, LFNST is not applied.

[0458] According to an example, the value of the LFNST application variable may be set to 1 based on the transform skip flag for all components of the current block being 0. That is, when transform skip is not applied to all components of the current block, LFNST may be applied.

[0459] According to an example, when the tree type of the current block is a single tree, the BDPCM mode may be applied to each of the luminance component and the chrominance component. That is, the BDPCM mode may be applied to the luminance component and may not be applied to the chrominance component. Conversely, the BDPCM mode may be applied to the chrominance component and may not be applied to the luminance component.

[0460] According to the current standard, in a single tree, LFNST can be applied only to luma components and not to chroma components. Here, for the luma component, the BDPCM mode is not applied and there are transform coefficients, and thus the transform can be performed (i.e., in the case where the BDPCM mode is not applied to the luma component, the CBF is not 0, and the transform skip flag is not 0), and there is a case where the BDPCM mode is applicable to the chroma components. When the BDPCM mode is applied, the transform skip flag is inferred to be 1.

[0461] Conventionally, when deriving the LFNST application variable, if the transform skip flag of any one component included in the block is 1, the LFNST application variable is set to 0 and thus the LFNST index is not parsed. That is, in the case of a single tree type, even if LFNST is applied to the luma component, since the chroma component of the BDPCM mode is applied, the LFNST application variable is set to 0 (because the transform skip flag is inferred to be 1 when the BDPCM mode is applied).

[0462] According to the example, when the BDPCM mode is applied to a specific block, there may be a case where the CBF is 0, and thus the above-mentioned problem can be solved by utilizing this case. By adding the condition that the CBF is 0 to the condition for deriving the LFNST application variable, the decoding device can apply the LFNST to the luma component even if the BDPCM mode is applied to the chroma component.

[0463] The decoding device may set the condition for deriving the LFNST application variable to “(treeType==DUAL_TREE_CHROMA||(!tu_y_coded_flag[x0][y0]||transform_skip_flag[x0][y0][0]==0))&&(treeType==DUAL_TREE_LUMA||((!tu_cb_coded_flag[x0][y0]||transform_skip_flag[x0][y0][1]==0)&&(!tu_cr_coded_flag[x0][y0]||transform_skip_flag[x0][y0][2]==0)))”.

[0464] According to the condition, since the tree type of the current block is a single tree ("treeType==DUAL_TREE_CHROMA" is not satisfied, and therefore the condition "(!tu_y_coded_flag[x0][y0]||transform_skip_flag[x0][y0][0]==0)" is checked) and the transform skip flag for the luminance component is 0, the condition "transform_skip_flag[x0][y0][0]==0" is satisfied.

[0465] In addition, when the BDPCM mode is applied to the chroma component of the current block and the transform coefficient coding flag is 0, the condition ((!tu_cb_coded_flag[x0][y0]||transform_skip_flag[x0][y0][1]==0)&&(!tu_cr_coded_flag[x0][y0]||transform_skip_flag[x0][y0][2]==0))) is satisfied. That is, even if the BDPCM mode is applied to the chroma component and thus the transform skip flag is inferred to be 1, according to the transform coefficient coding flag condition, the value of the LFNST application variable can also be set to 1, indicating that the LFNST index can be parsed.

[0466] As described above, by changing the condition for setting the LFNST application variable, it is possible to solve the problem that LFNST is not applied to all transform blocks regardless of the CBF value when the BDPCM mode is applied to any one transform block. In addition, when checking the condition for determining whether to parse the LFNST index, the transform skip flag and the CBF value are checked together for each color component. Therefore, when the CBF value is 0, even if any one of the color components is in the BDPCM mode, the parsing of the LFNST index for the different components is not affected.

[0467] The decoding apparatus may parse the LFNST index based on the value of the LFNST application variable ( S1540 ).

[0468] The decoding device may parse the LFNST index based on a value of the LFNST application variable being 1, and may derive various variables other than the LFNST application variable to parse the LFNST index.

[0469] For example, the decoding device may derive a first variable (variable LfnstDcOnly) indicating whether a significant coefficient exists at a position other than the position of the DC component in the current block and a second variable (variable LfnstZeroOutSigCoeffFlag) indicating whether a transform coefficient exists in a second region other than the upper left first region of the current block. Further, the decoding device may determine whether to apply LFNST based on the tree type and size of the current block, that is, whether to parse the LFNST index.

[0470] The first variable and the second variable are initially set to 1, wherein the first variable may be updated to 0 when the significant coefficient exists at a position other than the position of the DC component in the current block, and the second variable may be updated to 0 when the transform coefficient exists in the second region.

[0471] When the first variable is updated to 0 and the second variable remains to be 1, LFNST may be applied to the current block.

[0472] For luma components to which intra sub-partitioning (ISP) mode is applicable, the LFNST index may be parsed without deriving the variable LfnstDcOnly.

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

[0474] However, for the chroma component to which the ISP mode is not applied, the value of the variable LfnstDcOnly may be set to 0 according to the value of the transform skip flag transform_skip_flag[x0][y0][1] for the chroma component Cb and the value of the transform skip flag transform_skip_flag[x0][y0][2] for the chroma component Cr. That is, when the value of cIdx in transform_skip_flag[x0][y0][cIdx] is 1, the value of the variable LfnstDcOnly may be set to 0 only when the value of transform_skip_flag[x0][y0][1] is 0, and when the value of cIdx is 2, the value of the variable LfnstDcOnly may be set to 0 only when the value of transform_skip_flag[x0][y0][2] is 0. When the value of the variable LfnstDcOnly is 0, the decoding device may parse the LFNST index, and otherwise, the LFNST index may be inferred to be 0 without being signaled.

[0475] The second variable may be a variable LfnstZeroOutSigCoeffFlag, which may indicate that zeroing is performed when LFNST is applied. The second variable may be initially set to 1, and may be changed to 0 when a significant coefficient exists in the second region.

[0476] When the index of the sub-block where the last non-zero coefficient exists is greater than 0 and the width and height of the transform block are both equal to or greater than 4, or when the position of the last non-zero coefficient in the sub-block where the last non-zero coefficient exists is greater than 7 and the size of the transform block is 4×4 or 8×8, the variable LfnstZeroOutSigCoeffFlag can be derived as 0. A sub-block refers to a 4×4 block used as a coding unit in residual coding and can be referred to as a coefficient group (CG). A sub-block index 0 refers to the top left 4×4 sub-block.

[0477] That is, when a non-zero coefficient is derived in an area other than the upper left area where the LFNST transform coefficient may exist in the transform block, or when a non-zero coefficient exists at a position other than the eighth position in the scanning order for a 4×4 block or an 8×8 block, the variable LfnstZeroOutSigCoeffFlag is set to 0.

[0478] The decoding apparatus may determine an LFNST set including an LFNST matrix based on the intra prediction mode derived from the information about the intra prediction mode, and may select any one of a plurality of LFNST matrices based on the LFNST set and the LFNST index.

[0479] Here, the same LFNST set and the same LFNST index may be applied to the sub-partition transform blocks into which the current block is divided. 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 may also be equally applied to all sub-partition transform blocks. In addition, since the LFNST index is signaled in the coding unit level, the same LFNST matrix may be applied to the sub-partition transform blocks into which the current block is divided.

[0480] As described above, a transform set may be determined according to an intra prediction mode for a transform block to be transformed, and inverse LFNST may be performed based on a transform kernel matrix (i.e., any one of the LFNST matrices) included in the transform set indicated by the LFNST index. A matrix applied to inverse LFNST may be referred to as an inverse LFNST matrix or a LFNST matrix, and is referred to by any term as long as the matrix is ​​the transpose of the matrix used for forward LFNST.

[0481] In an example, the inverse LFNST matrix may be a non-square matrix, where the number of columns is less than the number of rows.

[0482] The decoding apparatus may derive a modified transform coefficient from the transform coefficient based on the LFNST index and the LFNST matrix used for LFNST, that is, by applying LFNST ( S1550 ).

[0483] LFNST is a non-separable transform in which a transform is applied to coefficients without separating the coefficients in a specific direction, unlike a primary transform that separates the coefficients to be transformed vertically or horizontally and transforms them. This non-separable transform may be a low-frequency non-separable transform that applies a forward transform only to a low-frequency region rather than to the entire region of a block.

[0484] The decoding apparatus may derive residual samples for the current block based on the primary inverse transform of the modified transform coefficient ( S1560 ).

[0485] Here, as the primary inverse transform, a general separable transform may be used, or the aforementioned MTS may be used.

[0486] Subsequently, the decoding apparatus 300 may generate a reconstructed sample based on the residual sample for the current block and the prediction sample for the current block ( S1570 ).

[0487] The following drawings are provided to describe specific examples of the present disclosure. Because specific terms of the devices illustrated in the drawings or specific terms of signals / messages / fields are provided for explanation, the technical features of the present disclosure are not limited to the specific terms used in the following drawings.

[0488] Fig.16 is a flowchart illustrating the operation of a video encoding apparatus according to an embodiment of the present disclosure.

[0489] exist Fig.16 Each process disclosed in the reference is based on Figures 4 to 14 Therefore, with reference Figure 2 and Figures 4 to 14 Descriptions of those overlapping specific details will be omitted or will be made schematically.

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

[0491] When the ISP is applied to the current block, the encoding apparatus may perform prediction through each sub-partitioned transform block.

[0492] The encoding device can determine whether to apply ISP coding or ISP mode to the current block, that is, the coding block, and can determine the direction in which the current block is partitioned, and can derive the size and number of partitioned sub-blocks according to the determination result.

[0493] The same intra prediction mode can be applied to the sub-partition transform blocks into which the current block is partitioned, and the encoding device can derive prediction samples for each sub-partition transform block. That is, the encoding device performs intra prediction in sequence according to the partition form of the sub-partition transform blocks, for example, horizontally or vertically, or from left to right or from top to bottom. For the leftmost or topmost sub-block, as in the conventional intra prediction method, the reconstructed pixels of the already coded coding block are referenced. Further, for each edge of a subsequent internal sub-partition transform block that is not adjacent to the previous sub-partition transform block, in order to derive reference pixels adjacent to the side, the reconstructed pixels of the already coded adjacent coding block are referenced as in the conventional intra prediction method.

[0494] The encoding apparatus 200 may derive residual samples for the current block based on the prediction samples ( S1620 ).

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

[0496] The encoding device may derive a transform coefficient for the current block based on a transform process such as a primary transform and / or a secondary transform on the residual sample, and may apply LFNST when the tree type of the current block is a single tree and the current block is a luma component, and may not apply LFNST when the tree type of the current block is a single tree and the current block is a chroma component.

[0497] The encoding apparatus may derive a transform coefficient for the current block based on the primary transform of the residual sample ( S1630 ).

[0498] The primary transform may be performed by multiple transform cores, as in MTS, in which case the transform core may be selected based on the intra prediction mode.

[0499] The encoding apparatus 200 may set a LFNST application variable regarding whether to apply LFNST based on a tree type of the current block and a transform coefficient coding flag for each component of the current block or a transform skip flag for each component of the current block ( S1640 ).

[0500] The LFNST application variable may be a flag variable, for example, lfnstNotTsFlag, and lfnstNotTsFlag may be derived based on the tree type of the current block and the transform coefficient coding flag for each component of the current block or the transform skip flag for each component of the current block. The LFNST application variable equal to 1 indicates that LFNST is applicable, and the LFNST application variable equal to 0 indicates that no LFNST is applicable. That is, when the LFNST application variable is 1, LFNST may be applied, and when the LFNST application variable is 0, LFNST may not be applied.

[0501] The transform coefficient coding flag refers to a CBF indicating whether there is a transform coefficient for a transform block, where when the CBF is equal to 1, it indicates that there is a transform coefficient for the transform block and the transform process can be performed, and when the CBF is equal to 0, no transform process is performed.

[0502] According to an example, the value of the LFNST application variable may be derived as 1 based on the transform coefficient coding flag for all components of the current block being 0. In this case, the value of the LFNST application variable is set to 1, but when the CBF is 0, the actual transform process is not performed, and the variable LfnstDcOnly described later is not updated to 0. That is, when the transform coefficient coding flag for all components of the current block is 0, LFNST is not applied.

[0503] According to an example, the value of the LFNST application variable may be set to 1 based on the transform skip flag for all components of the current block being 0. That is, when transform skip is not applied to all components of the current block, LFNST may be applied.

[0504] According to an example, when the tree type of the current block is a single tree, the BDPCM mode may be applied to each of the luminance component and the chrominance component. That is, the BDPCM mode may be applied to the luminance component and may not be applied to the chrominance component. Conversely, the BDPCM mode may be applied to the chrominance component and may not be applied to the luminance component.

[0505] According to the current standard, in a single tree, LFNST can be applied only to luma components and not to chroma components. Here, for the luma component, the BDPCM mode is not applied and there are transform coefficients, and thus the transform can be performed (i.e., in the case where the BDPCM mode is not applied to the luma component, the CBF is not 0, and the transform skip flag is not 0), and there is a case where the BDPCM mode is applicable to the chroma components. When the BDPCM mode is applied, the transform skip flag is inferred to be 1.

[0506] Conventionally, when deriving the LFNST application variable, if the transform skip flag of any one component included in the block is 1, the LFNST application variable is set to 0, and thus the LFNST index is not parsed. That is, even if LFNST is applied to the luma component, since the chroma component of the BDPCM mode is applied, the LFNST application variable is set to 0 (because the transform skip flag is inferred to be 1 when the BDPCM mode is applied).

[0507] According to the example, when the BDPCM mode is applied to a specific block, there may be a case where the CBF is 0, and thus the above-mentioned problem can be solved by using this case. By adding the condition that the CBF is 0 to the condition for deriving the LFNST application variable, the encoding device can apply LFNST to the luma component even if the BDPCM mode is applied to the chroma component.

[0508] The encoding device may set the condition for deriving LFNST application variables to “(treeType==DUAL_TREE_CHROMA||(!tu_y_coded_flag[x0][y0]||transform_skip_flag[x0][y0][0]==0))&&(treeType==DUAL_TREE_LUMA||((!tu_cb_coded_flag[x0][y0]||transform_skip_flag[x0][y0][1]==0)&&(!tu_cr_coded_flag[x0][y0]||transform_skip_flag[x0][y0][2]==0)))”.

[0509] According to the condition, since the tree type of the current block is a single tree ("treeType==DUAL_TREE_CHROMA" is not satisfied, and therefore the condition "(!tu_y_coded_flag[x0][y0]||transform_skip_flag[x0][y0][0]==0)" is checked) and the transform skip flag for the luminance component is 0, the condition "transform_skip_flag[x0][y0][0]==0" is satisfied.

[0510] In addition, when the BDPCM mode is applied to the chroma component of the current block and the transform coefficient coding flag is 0, the condition ((!tu_cb_coded_flag[x0][y0]||transform_skip_flag[x0][y0][1]==0)&&(!tu_cr_coded_flag[x0][y0]||transform_skip_flag[x0][y0][2]==0))) is satisfied. That is, even if the BDPCM mode is applied to the chroma component and thus the transform skip flag for the chroma component is inferred to be 1, according to the transform coefficient coding flag condition, the value of the LFNST application variable may be set to 1, indicating that LFNST is applicable.

[0511] As described above, by changing the condition for setting the LFNST application variable, it is possible to solve the problem that LFNST is not applied to all transform blocks regardless of the CBF value when the BDPCM mode is applied to any one transform block. In addition, when checking the condition for determining whether to parse the LFNST index, the transform skip flag and the CBF value are checked together for each color component. Therefore, when the CBF value is 0, even if any one of the color components is in the BDPCM mode, the parsing of the LFNST index for the different components is not affected.

[0512] The encoding apparatus 200 may derive a modified transform coefficient by applying LFNST based on a value of the LFNST application variable ( S1650 ).

[0513] LFNST is a non-separable transform in which a transform is applied to coefficients without separating the coefficients in a specific direction, unlike a primary transform that separates the coefficients to be transformed vertically or horizontally and transforms them. The non-separable transform may be a low-frequency non-separable transform that applies the transform only to a low-frequency region rather than the entire target block to be transformed.

[0514] The encoding apparatus may apply LFNST to the current block based on a value of the LFNST application variable being 1, and may derive various variables other than the LFNST application variable to apply LFNST.

[0515] For example, the encoding device may derive a first variable (variable LfnstDcOnly) indicating whether a significant coefficient exists at a position other than the position of the DC component in the current block and a second variable (variable LfnstZeroOutSigCoeffFlag) indicating whether a transform coefficient exists in a second region other than the upper left first region of the current block. In addition, the encoding device may determine whether to apply LFNST based on the tree type and size of the current block. The upper left first region indicates an area including 8 positions starting from the DC position in a 4×4 transform block and an 8×8 transform block according to a transform coefficient scanning order in the VVC standard, and indicates an area including 16 positions starting from the DC position in a transform block other than a 4×4 transform block and an 8×8 transform block according to a transform coefficient scanning order in the VVC standard.

[0516] The first variable and the second variable are initially set to 1, wherein the first variable may be updated to 0 when the significant coefficient exists at a position other than the position of the DC component in the current block, and the second variable may be updated to 0 when the transform coefficient exists in the second region.

[0517] When the first variable is updated to 0 and the second variable remains to be 1, LFNST may be applied to the current block.

[0518] For the luma component to which the intra sub-partitioning (ISP) mode is applicable, LFNST may be applied without deriving the variable LfnstDcOnly.

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

[0520] However, for the chroma component to which the ISP mode is not applied, the value of the variable LfnstDcOnly may be set to 0 according to the value of the transform skip flag transform_skip_flag[x0][y0][1] for the chroma component Cb and the value of the transform skip flag transform_skip_flag[x0][y0][2] for the chroma component Cr. That is, when the value of cIdx in transform_skip_flag[x0][y0][cIdx] is 1, the value of the variable LfnstDcOnly may be set to 0 only when the value of transform_skip_flag[x0][y0][1] is 0, and when the value of cIdx is 2, the value of the variable LfnstDcOnly may be set to 0 only when the value of transform_skip_flag[x0][y0][2] is 0. When the value of the variable LfnstDcOnly is 0, the encoding device may apply LFNST, and otherwise, the encoding device may not apply LFNST.

[0521] The second variable may be a variable LfnstZeroOutSigCoeffFlag, which may indicate that zeroing is performed when LFNST is applied. The second variable may be initially set to 1, and may be changed to 0 when there are significant coefficients in the second region.

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

[0523] That is, when a non-zero coefficient is derived in an area other than the upper left area in which the LFNST transform coefficient may exist in the transform block, or when a non-zero coefficient exists at a position other than the eighth position in the scanning order for a 4×4 block or an 8×8 block, the variable LfnstZeroOutSigCoeffFlag is set to 0.

[0524] The encoding apparatus may determine an LFNST set including an LFNST matrix based on the intra prediction mode derived from the information about the intra prediction mode, and may select any one of a plurality of LFNST matrices.

[0525] Here, the same LFNST set and the same LFNST index may be applied to the sub-partition transform blocks into which the current block is divided. 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 may also be equally applied to all sub-partition transform blocks. In addition, since the LFNST index is signaled in the coding unit level, the same LFNST matrix may be applied to the sub-partition transform blocks into which the current block is divided.

[0526] As described above, a transform set may be determined according to an intra prediction mode for a transform block to be transformed, and LFNST may be performed based on a transform kernel matrix (i.e., any one of the LFNST matrices) included in the LFNST transform set. A matrix applied to LFNST may be referred to as an LFNST matrix and may be referred to as any term as long as the matrix is ​​the transpose of a matrix used for inverse LFNST.

[0527] In an example, the LFNST matrix may be a non-square matrix having a smaller number of rows than the number of columns.

[0528] When the LFNST index is greater than 0 and the tree type of the current block is dual-tree chroma, LFNST is applicable to the current block, and thus the encoding device may encode the value of the flag as 1 so that the scaling list is not applied to the chroma component. The flag may be a flag belonging to a high-level syntax element set such as a sequence parameter set (SPS).

[0529] According to an example, when the LFNST index is greater than 0 and the tree type of the current block is dual-tree luma, LFNST is applicable to the current block, and thus the encoding device may encode the value of the flag as 1 so that the scaling list is not applied to the luma component.

[0530] The encoding apparatus may derive residual information by performing quantization based on the modified transform coefficient for the current block, and may encode and output the residual information and the LFNST index ( S1660 ).

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

[0532] Specifically, the encoding apparatus 200 may generate information about a quantized transform coefficient and may encode the quantized information about the generated transform coefficient.

[0533] The syntax element of the LFNST index according to the present embodiment may indicate whether any one of the (inverse) LFNST and LFNST matrices included in the LFNST set is applied, and when the LFNST set includes two transform kernel matrices, the syntax element of the LFNST index may have three values.

[0534] According to an example, when the partitioned tree structure of the current block is a dual tree type, an LFNST index may be encoded for each of a luma block and a chroma block.

[0535] According to an embodiment, the value of the syntax element of the transform index may include: 0, which indicates that no (inverse) LFNST is applied to the current block; 1, which indicates the first LFNST matrix among the LFNST matrices; and 2, which indicates the second LFNST matrix among the LFNST matrices.

[0536] In the present disclosure, at least one of quantization / dequantization and / or transform / inverse transform may be omitted. When quantization / dequantization is omitted, the quantized transform coefficient may be referred to as a transform coefficient. When transform / inverse transform is omitted, the transform coefficient may be referred to as a coefficient or a residual coefficient, or may still be referred to as a transform coefficient for consistency of expression.

[0537] In addition, in the present disclosure, the quantized transform coefficient and the transform coefficient may be referred to as a transform coefficient and a scaled transform coefficient, respectively. In this case, the residual information may include information about the transform coefficient, and the information about the transform coefficient may be signaled through the residual coding syntax. The transform coefficient may be derived based on the residual information (or information about the transform coefficient), and the scaled transform coefficient may be derived by inverse transform (scaling) of the transform coefficient. The residual sample may be derived based on the inverse transform (transform) of the scaled transform coefficient. These details may also be applied / expressed in other parts of the present disclosure.

[0538] In the above embodiments, the method is described based on the flowchart with the aid of a series of steps or boxes, but the present disclosure is not limited to the order of the steps, and a certain step may be performed in an order or step different from the above order or step or simultaneously with another step. In addition, it can be understood by a person of ordinary skill in the art that the steps shown in the flowchart are not exclusive, and another step may be incorporated or one or more steps of the flowchart may be removed without affecting the scope of the present disclosure.

[0539] The above-mentioned method according to the present disclosure may be implemented in software form, and the encoding device and / or decoding device according to the present disclosure may be included in a device for image processing such as a TV, a computer, a smart phone, a set-top box, a display device, etc.

[0540] When the embodiments in the present disclosure are specifically implemented by software, the above methods can be embodied as modules (processes, functions, etc.) for performing the above functions. The modules can be stored in a memory and can be executed by a processor. The memory can be inside or outside the processor and can be connected to the processor in various known ways. The processor may include an application specific integrated circuit (ASIC), other chipsets, logic circuits, and / or data processing devices. The memory may include a read-only memory (ROM), a random access memory (RAM), a flash memory, a memory card, a storage medium, and / or other storage devices. In other words, the embodiments described in the present disclosure can be specifically implemented and executed on a processor, a microprocessor, a controller, or a chip. For example, the functional units shown in each figure can be specifically implemented and executed on a computer, a processor, a microprocessor, a controller, or a chip.

[0541] In addition, the decoding device and the encoding device to which the present disclosure is applied may be included in a multimedia broadcast transceiver, a mobile communication terminal, a home theater video device, a digital theater video device, a surveillance camera, a video chat device, a real-time communication device such as video communication, a mobile streaming device, a storage medium, a camera, a video on demand (VoD) service provider, an over-the-top (OTT) video device, an Internet streaming service provider, a three-dimensional (3D) video device, a video phone video device, and a medical video device, and may be used to process a video signal or a data signal. For example, an over-the-top (OTT) video device may include a game console, a Blu-ray player, an Internet access TV, a home theater system, a smart phone, a tablet PC, a digital video recorder (DVR), etc.

[0542] In addition, the processing method of the present disclosure can be generated in the form of a program executed by a computer and stored in a computer-readable recording medium. Multimedia data with a data structure according to the present disclosure can also be stored in a computer-readable recording medium. Computer-readable recording media include all kinds of storage devices and distributed storage devices in which computer-readable data is stored. Computer-readable recording media may include, for example, a Blu-ray disc (BD), a universal serial bus (USB), a ROM, a PROM, an EPROM, an EEPROM, a RAM, a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device. In addition, the computer-readable recording medium includes a medium embodied in the form of a carrier (e.g., transmission via the Internet). In addition, the bit stream generated by the encoding method can be stored in a computer-readable recording medium or sent via a wired or wireless communication network. Additionally, the embodiments of the present disclosure can be embodied as a computer program product through a program code, and the program code can be executed on a computer through an embodiment of the present disclosure. The program code can be stored on a computer-readable carrier.

Claims

1. An image decoding method performed by a decoding device, the method comprising: receiving residual information from a bitstream; deriving a transform coefficient for a first component of a current block by performing dequantization based on the residual information, the first component representing one of a luma component or a chroma component of the current block; as well as deriving modified transform coefficients by applying a low frequency non-separable transform (LFNST) to the transform coefficients, Wherein, deriving the modified transform coefficients comprises: setting a LFNST apply variable based on a tree type of the current block, a transform coefficient coding flag for a second component of the current block, and a transform skip flag for a first component of the current block, the second component representing the other of the luma component or the chroma component of the current block; and parsing a LFNST index from the bitstream based on a value of the LFNST application variable; In which, in response to the case where the tree type is a single tree, the transform coefficient coding flag for the second component of the current block is 0, and the transform skip flag for the first component of the current block is 0, the value of the LFNST application variable is set to be equal to 1.

2. The image decoding method according to claim 1, wherein: In response to the transform coefficient coding flag for the second component of the current block being equal to 0, the value of the LFNST apply variable is set equal to 1, and In response to the value of the LFNST application variable being equal to 1, parsing the LFNST index from the bitstream.

3. The image decoding method according to claim 2, wherein: In response to the transform skip flag for the first component of the current block being equal to 0, the value of the LFNST apply variable is set equal to 1.

4. The image decoding method according to claim 1, wherein: In response to the tree type being a single tree, a second component of the current block is coded in a BDPCM mode, and a first component of the current block is not coded in the BDPCM mode.

5. The image decoding method according to claim 4, wherein: In response to wherein the tree type is single tree, a transform skip flag is inferred to be 1 for a second component of the current block.

6. An image encoding method performed by an image encoding device, the method comprising: deriving prediction samples for a first component of a current block, the first component representing one of a luma component or a chroma component of the current block; deriving residual samples for a first component of the current block based on the prediction samples; deriving transform coefficients for a first component of the current block based on a primary transform of the residual samples; as well as deriving modified transform coefficients from said transform coefficients by applying a low frequency non-separable transform (LFNST), Wherein, deriving the modified transform coefficients comprises: setting a LFNST apply variable based on a tree type of the current block, a transform coefficient coding flag for a second component of the current block, and a transform skip flag for a first component of the current block, the second component representing the other of the luma component or the chroma component of the current block; and Applying the LFNST based on the value of the LFNST application variable; In which, in response to the case where the tree type is a single tree, the transform coefficient coding flag for the second component of the current block is 0, and the transform skip flag for the first component of the current block is 0, the value of the LFNST application variable is set to be equal to 1.

7. The image encoding method according to claim 6, wherein: In response to the transform coefficient coding flag for the first component of the current block being equal to 0, the value of the LFNST apply variable is set equal to 1, and In response to the value of the LFNST application variable being equal to 1, the LFNST index is encoded into the bitstream.

8. The image encoding method according to claim 7, wherein: In response to the transform skip flag for the first component of the current block being equal to 0, the value of the LFNST apply variable is set equal to 1.

9. The image encoding method according to claim 6, wherein: In response to the tree type being a single tree, a second component of the current block is coded in a BDPCM mode, and a first component of the current block is not coded in the BDPCM mode.

10. The image encoding method according to claim 9, wherein: In response to wherein the tree type is single tree, a transform skip flag is inferred to be 1 for a second component of the current block.

11. A computer-readable digital storage medium for storing a bit stream generated by an image encoding method, The image encoding method comprises: deriving prediction samples for a first component of a current block, the first component representing one of a luma component or a chroma component of the current block; deriving residual samples for a first component of the current block based on the prediction samples; deriving transform coefficients for a first component of the current block based on a primary transform of the residual samples; as well as deriving modified transform coefficients from said transform coefficients by applying a low frequency non-separable transform (LFNST), Wherein, deriving the modified transform coefficients comprises: setting a LFNST apply variable based on a tree type of the current block, a transform coefficient coding flag for a second component of the current block, and a transform skip flag for a first component of the current block, the second component representing the other of the luma component or the chroma component of the current block; and Applying the LFNST based on the value of the LFNST application variable; In which, in response to the case where the tree type is a single tree, the transform coefficient coding flag for the second component of the current block is 0, and the transform skip flag for the first component of the current block is 0, the value of the LFNST application variable is set to be equal to 1.

12. A method for transmitting data for image information, comprising: deriving prediction samples for a first component of a current block, the first component representing one of a luma component or a chroma component of the current block; deriving residual samples for a first component of the current block based on the prediction samples; deriving transform coefficients for a first component of the current block based on a primary transform of the residual samples; deriving modified transform coefficients from said transform coefficients by applying a low frequency non-separable transform (LFNST), deriving quantized transform coefficients by performing quantization on the modified transform coefficients; encoding residual information for the quantized transform coefficients to generate a bitstream; as well as sending said data comprising said bit stream, Wherein, deriving the modified transform coefficients comprises: setting a LFNST apply variable based on a tree type of the current block, a transform coefficient coding flag for a second component of the current block, and a transform skip flag for a first component of the current block, the second component representing the other of the luma component or the chroma component of the current block; and Applying the LFNST based on the value of the LFNST application variable; In which, in response to the case where the tree type is a single tree, the transform coefficient coding flag for the second component of the current block is 0, and the transform skip flag for the first component of the current block is 0, the value of the LFNST application variable is set to be equal to 1.