Transform-based image coding method and apparatus therefor

By optimizing the quantization process based on the block tree type and tag information during image encoding and decoding, the problem of low compression efficiency of high-resolution images/videos is solved, enabling more efficient image/video transmission and storage.

CN114930849BActive Publication Date: 2025-12-26LG ELECTRONICS INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202180008455.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2020-01-10
Filing Date
2021-01-11
Publication Date
2025-12-26
Estimated Expiration
2041-01-11

AI Technical Summary

Technical Problem

Existing technologies increase costs and have low compression efficiency when transmitting and storing high-resolution, high-quality images/videos, especially when dealing with immersive media and high-resolution images, where effective compression techniques are lacking.

Method used

By determining whether to apply scaling lists and LFNST transform based on the tree type and tag information of the blocks during image encoding and decoding, the quantization process of luminance and chrominance components is optimized, thereby improving quantization efficiency.

Benefits of technology

It improves image/video compression efficiency, especially the quantization efficiency of single-tree type chroma components, and reduces transmission and storage costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114930849B_ABST
    Figure CN114930849B_ABST
Patent Text Reader

Abstract

The image decoding method according to the present document can include the steps of receiving flag information indicating whether a scaling list is available when performing LFNST, and LFNST index and residual information for a current block; determining whether the scaling list is applicable to the current block based on the flag information, the LFNST index, and a tree type of the current block; deriving transform coefficients for the current block from the residual information based on a result of the determining; and applying the LFNST to the transform coefficients to derive corrected transform coefficients.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The disclosure relates to an image coding technology, and more particularly, to a method and apparatus for coding an image based on a transform in an image coding system. BACKGROUND

[0002] Nowadays, there is a growing demand for high-resolution and high-quality images / videos such as ultra-high-definition (UHD) images / videos of 4K, 8K or more in various fields. As image / video data becomes higher in resolution and quality, the amount of information or bits transmitted increases compared to conventional image data. Therefore, when transmitting image data using a medium such as a conventional wired / wireless broadband line or storing image / video data using an existing storage medium, the transmission cost and storage cost increase.

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

[0004] Therefore, there is a need for an efficient image / video compression technique 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

[0005] TECHNICAL PROBLEM

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

[0007] Another technical aspect of the disclosure is to provide a method and apparatus for improving quantization efficiency.

[0008] Still another technical aspect of the disclosure is to provide a method and apparatus for improving quantization efficiency of a single tree type of chroma component.

[0009] TECHNICAL SOLUTION

[0010] According to an embodiment of the disclosure, an image decoding method performed by a decoding device is provided. The method can include receiving flag information indicating whether a scaling list is available when performing LFNST, an LFNST index and residual information for a current block; determining whether to apply the scaling list to the current block based on the flag information, the LFNST index and a tree type of the current block; based on the determination result, deriving transform coefficients for the current block from the residual information; and deriving modified transform coefficients by applying the LFNST to the transform coefficients, wherein the scaling list can not be applied when the tree type of the current block is single tree and the current block is a luma component, and the scaling list can be applied when the tree type of the current block is single tree and the current block is a chroma component.

[0011] The LFNST can not be applied to a chroma component of the current block.

[0012] The scaling list can not be applied to the luma component when the flag information indicates that the scaling list is not available and the LFNST index is greater than 0.

[0013] The scaling list can not be applied to the chroma component if the tree type of the current block is dual tree chroma when the flag information indicates that the scaling list is not available and the LFNST index is greater than 0.

[0014] The scaling list can not be applied to the luma component if the tree type of the current block is dual tree luma when the flag information indicates that the scaling list is not available and the LFNST index is greater than 0.

[0015] The current block can include a transform block.

[0016] According to an embodiment of the disclosure, an image encoding method performed by an encoding device is provided. The method can include deriving transform coefficients for a current block from residual samples based on a transform process; and quantizing the transform coefficients based on a scaling list, wherein whether to apply the scaling list to the current block is determined based on performing LFNST in the transform process and a tree type of the current block, wherein the scaling list can not be applied when the tree type of the current block is single tree and the current block is a luma component, and the scaling list can be applied when the tree type of the current block is single tree and the current block is a chroma component.

[0017] According to embodiments of the disclosure, an image encoding method performed by an encoding apparatus can be provided. The method can include deriving modified transform coefficients from transform coefficients by applying LFNST, and encoding quantized residual information and an LFNST index indicating an LFNST matrix applied to the LFNST, wherein the LFNST index is encoded based on a tree type of the current block not being dual tree chroma and MIP mode not being applied to the current block.

[0018] According to still another embodiment of the disclosure, a digital storage medium storing image data including encoded image information and a bitstream generated according to an image encoding method performed by an encoding apparatus can be provided.

[0019] Advantageous Effects

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

[0021] According to the disclosure, quantization efficiency can be improved.

[0022] According to the disclosure, quantization efficiency of a single tree type of a chroma component can be improved.

[0023] Effects that can be obtained through specific examples of the disclosure are not limited to the effects enumerated above. For example, there can be various technical effects that can be understood or derived by those of ordinary skill in the related art from the disclosure. Accordingly, specific effects of the disclosure are not limited to effects explicitly described in the disclosure, and can include various effects that can be understood or derived from technical features of the disclosure. BRIEF DESCRIPTION OF DRAWINGS

[0024] Figure 1 FIG. 1 is a diagram schematically describing a configuration of a video / image encoding apparatus to which the disclosure can be applied.

[0025] Figure 2 FIG. 2 is a diagram schematically describing a configuration of a video / image decoding apparatus to which the disclosure can be applied.

[0026] Figure 3 A multi-transform technique according to embodiments of the present document is schematically illustrated.

[0027] Figure 4 An intra directional mode with 65 prediction directions is exemplarily illustrated.

[0028] Figure 5 FIG. 3 is a diagram illustrating RST according to embodiments of the disclosure.

[0029] Figure 6 FIG. 4 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.

[0030] Figure 7 is a diagram illustrating the order in which output data of a forward secondary transform is arranged into two-dimensional blocks according to an example.

[0031] Figure 8 is a diagram illustrating the block shape to which a LFNST is applied.

[0032] Figure 9 is a diagram illustrating the arrangement of output data of a forward LFNST according to an embodiment.

[0033] Figure 10 illustrates zeroing in a block to which a 4x4 LFNST is applied according to an example.

[0034] Figure 11 illustrates zeroing in a block to which an 8x8 LFNST is applied according to an example.

[0035] Figure 12 illustrates an image decoding method according to an example.

[0036] Figure 13 illustrates an image encoding method according to an example.

[0037] Figure 14 schematically illustrates an example of a video / image encoding system to which the present disclosure is applicable.

[0038] Figure 15 illustrates the structure of a content streaming system to which the present disclosure is applied. DETAILED DESCRIPTION

[0039] While the present disclosure can be susceptible to various modifications and alternative forms, specific embodiments thereof have been shown by way of example in the drawings and will herein be described in detail. The disclosure is not intended to be limited to the particular embodiments disclosed herein, but it is to be understood that the disclosure will include all modifications and equivalents falling within the scope of the technical idea of the present disclosure. The terms used herein are merely used to describe particular embodiments and are not intended to limit the technical idea of the present disclosure. The singular forms are intended to include the plural forms unless the context clearly indicates otherwise. Terms such as "include" and "have" are intended to indicate the presence of the described features, numbers, steps, operations, elements, components, or combinations thereof, and should not be understood as precluding the presence or addition of one or more different features, numbers, steps, operations, elements, components, or combinations thereof.

[0040] Meanwhile, the components on the drawings described herein are independently illustrated for the convenience of describing different characteristic functions from each other, however, it is not intended that the components are implemented by separate hardware or software. For example, any two or more of the 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 belong to the scope of the patent right of the present disclosure as long as they do not depart from the essence of the present disclosure.

[0041] Hereinafter, preferred embodiments of the present disclosure will be described in greater detail with reference to the accompanying drawings. Also, in the drawings, the same drawing reference numerals are used for the same components, and redundant descriptions for the same components will be omitted.

[0042] The present document relates to video / image coding. For example, the methods / examples disclosed in the present document can 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., the HEVC (High Efficiency Video Coding) standard (ITU-T Rec. H.265), the EVC (Elementary Video Coding) standard, the AVS2 standard, etc.).

[0043] In the present document, various embodiments related to video / image coding can be provided, and these embodiments can be combined and performed with each other unless specified otherwise.

[0044] In the present document, a video can refer to a set of a series of images for a period of time. In general, a picture refers to a unit of an image representing a specific time region, and a slice / tile refers to a unit of a part constituting a picture. A slice / tile can include one or more coding tree units (CTUs). One picture can be composed of one or more slices / tiles. One picture can be composed of one or more tile groups. One tile group can include one or more tiles.

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

[0046] A unit can represent a basic unit of image processing. A unit can include at least one of a certain region and information related to the region. One unit can include one luma block and two chroma (e.g., cb, cr) blocks. Depending on the situation, a unit and terms such as a block, a region, and the like can be used interchangeably. In general, an MxN block can include a set (or an array) of samples (or sample array) or transform coefficients consisting of M columns and N rows.

[0047] In this document, the terms “ / ” and “,” should be interpreted as indicating “and / or.” For example, the expression “A / B” can mean “A and / or B.” Additionally, “A, B” can mean “A and / or B.” Additionally, “A / B / C” can mean “at least one of A, B, and / or C.” Additionally, “A / B / C” can mean “at least one of A, B, and / or C.”

[0048] Additionally, in this document, the term “or” should be interpreted as indicating “and / or.” For example, the expression “A or B” can include 1) only A, 2) only B, and / or 3) both A and B. In other words, a term “or” in this document should be interpreted as indicating “additionally or alternatively.”

[0049] In this disclosure, “at least one of A and B” can mean “only A”, “only B”, or “both A and B”. Also, in this disclosure, the expression “at least one of A or B” or “at least one of A and / or B” can be interpreted as “at least one of A and B”.

[0050] Also, in this disclosure, “at least one of A, B, and C” can mean “only A”, “only B”, “only C”, or “any combination of A, B, and C”. Also, “at least one of A, B, or C” or “at least one of A, B, and / or C” can mean “at least one of A, B, and C”.

[0051] Additionally, parentheses used in this disclosure can mean “for example”. Specifically, when indicated as “prediction (intra prediction)”, it can mean that “intra prediction” is proposed as an example of “prediction”. In other words, “prediction” of this disclosure is not limited to “intra prediction”, and “intra prediction” is proposed as an example of “prediction”. Additionally, when indicated as “prediction (i.e., intra prediction)”, this can also mean that “intra prediction” is proposed as an example of “prediction”.

[0052] The technical features described in one drawing in this disclosure can be implemented individually or can be implemented simultaneously.

[0053] Figure 1is a diagram schematically illustrating a configuration of a video / image encoding apparatus to which the present disclosure can be applied. Hereinafter, the term called a video encoding apparatus can include an image encoding apparatus.

[0054] Referring to Figure 1 , the encoding apparatus 100 can include an image partitioner 110, a predictor 120, a residual processor 130, an entropy encoder 140, an adder 150, a filter 160, and a memory 170. The predictor 120 can include an inter-predictor 121 and an intra-predictor 122. The residual processor 130 can include a transformer 132, a quantizer 133, a dequantizer 134, and an inverse transformer 135. The residual processor 130 can further include a subtractor 131. The adder 150 can be referred to as a reconstructor or a reconstructed block generator. The image partitioner 110, the predictor 120, the residual processor 130, the entropy encoder 140, the adder 150, and the filter 160 described above can be configured by one or more hardware components (e.g., an encoder chipset or a processor) according to an embodiment. In addition, the memory 170 can include a decoded picture buffer (DPB) and can be configured by a digital storage medium. The hardware components can further include the memory 170 as an internal / external component.

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

[0056] Depending on the situation, units and terms such as block, region, and the like can be used in place of each other. In general, an MxN block can represent a set of samples or transform coefficients consisting of M columns and N rows. A sample can generally represent a pixel or a pixel value, and can represent only a pixel / pixel value of a luma component, or only a pixel / pixel value of a chroma component. A sample can be used as a term corresponding to a pixel or a pel of one picture (or image).

[0057] The encoding apparatus 100 subtracts a prediction signal (a prediction block, a prediction sample array) output from the inter-predictor 121 or the intra-predictor 122 from an input image signal (an original block, an original sample array) to generate a residual signal (a residual block, a residual sample array), and the generated residual signal is transmitted to the transformer 132. In this case, as illustrated in the drawing, a unit that subtracts the prediction signal (the prediction block, the prediction sample array) from the input image signal (the original block, the original sample array) within the encoding apparatus 100 can be referred to as a subtractor 131. The predictor can perform prediction on a processing target block (hereinafter, referred to as a "current block") and can generate a prediction block including prediction samples for the current block. The predictor can 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 can generate various information related to prediction, such as prediction mode information, and can transmit the generated information to the entropy encoder 140. The information about prediction can be encoded in the entropy encoder 140 and output in the form of a bitstream.

[0058] The intra-predictor 122 can predict the current block by referring to samples in the current picture. Depending on the prediction mode, the reference samples can be located in a neighboring region of the current block or in a distant region away from the current block. In intra-prediction, the prediction mode can include a plurality of non-directional modes and a plurality of directional modes. The non-directional modes can include, for example, a DC mode and a planar mode. The directional modes can include, for example, 33 directional prediction modes or 65 directional prediction modes depending on the degree of detail of the prediction direction. However, this is merely an example, and more or less directional prediction modes can be used depending on the configuration. The intra-predictor 122 can determine a prediction mode applied to the current block by using a prediction mode applied to a neighboring block.

[0059] The inter predictor 121 can derive a prediction block for a current block based on a reference block (a reference sample array) specified by a motion vector on a reference picture. At this time, in order to reduce the amount of motion information transmitted in the inter prediction mode, motion information can be predicted in a block, sub-block, or sample unit based on the correlation of motion information between neighboring blocks and the current block. The motion information can include a motion vector and a reference picture index. The motion information can further include information on an inter prediction direction (L0 prediction, L1 prediction, Bi prediction, etc.). In the case of inter prediction, the neighboring blocks can include spatial neighboring blocks existing in the current picture and temporal neighboring blocks existing in the reference picture. The reference picture including the reference block and the reference picture including the temporal neighboring block can be the same as or different from each other. The temporal neighboring block can be referred to as a collocated reference block, a collocated CU (colCU), or the like, and the reference picture including the temporal neighboring block can be referred to as a collocated picture (colPic). For example, the inter predictor 121 can 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 the reference picture index of the current block. Inter prediction can be performed based on various prediction modes. For example, in the case of a skip mode and a merge mode, the inter predictor 121 can use motion information of the neighboring blocks as motion information of the current block. In the skip mode, unlike the merge mode, a residual signal can not be transmitted. In the case of a motion information prediction (motion vector prediction, MVP) mode, a motion vector of the neighboring block can be used as a motion vector predictor, and a motion vector of the current block can be indicated by signaling a motion vector difference.

[0060] The predictor 120 can generate a prediction signal based on various prediction methods. For example, the predictor can apply intra prediction or inter prediction for predicting one block and can also simultaneously apply intra prediction and inter prediction. This can be referred to as combined inter and intra prediction (CIIP). Further, the predictor can perform prediction on a block based on an intra block copy (IBC) prediction mode or a palette mode. The IBC prediction mode or the palette mode can be used for content image / video coding in games or the like, such as screen content coding (SCC). Although the IBC basically performs prediction in the current picture, aspects of deriving a reference block in the current block can perform prediction similarly to inter prediction. That is, the IBC can use at least one of the inter prediction techniques described in the present disclosure. The palette mode can be regarded as an example of intra coding or intra prediction. In the case of applying the palette mode, a sample value within a picture can be signaled based on information related to a palette table and a palette index.

[0061] The prediction signal generated by the predictor (including the inter-predictor 121 and / or the intra-predictor 122) can be used to generate a reconstructed signal or to generate a residual signal. The transformer 132 can generate transform coefficients by applying a transform technique to the residual signal. For example, the transform technique can 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 non-linear transform (CNT). Here, the GBT means a transform obtained from a graph when relationship information between pixels is represented by a graph. The CNT refers to a transform obtained based on a prediction signal generated using all previously reconstructed pixels. In addition, the transform process can be applied to a square pixel block having the same size or can be applied to a non-square block having a varying size.

[0062] The quantizer 133 can quantize the transform coefficients and transmit the quantized transform coefficients to the entropy encoder 140, and the entropy encoder 140 can encode a quantized signal (information about the quantized transform coefficients) and can output the encoded signal in a bitstream. The information about the quantized transform coefficients can be referred to as residual information. The quantizer 133 can rearrange the block-type quantized transform coefficients into a one-dimensional vector form based on a coefficient scanning order, and generate the information about the quantized transform coefficients based on the one-dimensional vector-form quantized transform coefficients. The entropy encoder 140 can perform various encoding methods such as, for example, exponential Golomb, context adaptive variable length coding (CAVLC), context adaptive binary arithmetic coding (CABAC), and the like. The entropy encoder 140 can encode information (e.g., values of syntax elements, etc.) necessary for video / image reconstruction, other than the quantized transform coefficients, together or individually. The encoded information (e.g., encoded video / image information) can be transmitted or stored in the form of a bitstream on a unit basis of a network abstraction layer (NAL). The video / image information can further 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), and the like. Furthermore, the video / image information can further include general constraint information. In the disclosure, information and / or syntax elements transmitted / signaled from the encoding apparatus to the decoding apparatus can be included in the video / image information. The video / image information can be encoded through the above-described encoding process and included in the bitstream. The bitstream can be transmitted through a network, or stored in a digital storage medium. Here, the network can include a broadcasting network, a communication network, and / or the like, and the digital storage medium can include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, and the like. A transmitter (not shown) that transmits the signal output from the entropy encoder 140 and / or a storage device (not shown) that stores the signal can be configured as an internal / external element of the encoding apparatus 100, or can be included in the entropy encoder 140.

[0063] The quantized transform coefficients output from the quantizer 133 can be used to generate a prediction signal. For example, by applying dequantization and inverse transform to the quantized transform coefficients via the dequantizer 134 and the inverse transformer 135, a reconstructed residual signal (a residual block or a residual sample) can be reconstructed. The adder 155 adds the reconstructed residual signal to the prediction signal output from the inter-predictor 121 or the intra-predictor 122, enabling generation of a reconstructed signal (a reconstructed picture, a reconstructed block, a reconstructed sample array). When there is no residual for a target block, as in the case where a skip mode is applied, a prediction block can be used as a reconstructed block. The adder 150 can be referred to as a reconstructor or a reconstructed block generator. The generated reconstructed signal can be used for intra-prediction of a next processing target block in the current block, and as described later, the generated reconstructed signal can be used for inter-prediction of a next picture by filtering.

[0064] Meanwhile, in the picture encoding and / or reconstruction process, luminance mapping with chroma scaling (LMCS) can be applied.

[0065] The filter 160 can improve subjective / objective video quality by applying filtering to the reconstructed signal. For example, the filter 160 can generate a modified reconstructed picture by applying various filtering methods to the reconstructed picture, and the filter 160 can store the modified reconstructed picture in the memory 170, more specifically, in the DPB of the memory 170. The various filtering methods can 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 160 can generate various information related to filtering and transmit the generated information to the entropy encoder 140. The information about filtering can be encoded in the entropy encoder 140 and output in the form of a bitstream.

[0066] The modified reconstructed picture transmitted to the memory 170 can be used as a reference picture in the inter-predictor 121. In doing so, the encoding device can avoid prediction mismatch in the encoding device 100 and the decoding device when inter-prediction is applied, and can also improve coding efficiency.

[0067] The memory 170 DPB can store the modified reconstructed picture in order to use it as a reference picture in the inter-predictor 121. The memory 170 can store motion information of a block in a current picture from which motion information is derived (or encoded) and / or motion information of a block in a picture that has been (or was previously) reconstructed. The stored motion information can be transmitted to the inter-predictor 121 in order to be used as motion information of a neighboring block or motion information of a temporally neighboring block. The memory 170 can store reconstructed samples of a reconstructed block in a current picture and can transmit the reconstructed samples to the intra-predictor 122.

[0068] Figure 2FIG. 1 is a diagram schematically illustrating a configuration of a video / image decoding apparatus to which the present disclosure is applicable.

[0069] Referring to Figure 2 , the video decoding apparatus 200 can include an entropy decoder 210, a residue processor 220, a predictor 230, an adder 240, a filter 250, and a memory 260. The predictor 230 can include an inter-predictor 231 and an intra-predictor 232. The residue processor 220 can include a dequantizer 221 and an inverse transformer 222. The entropy decoder 210, the residue processor 220, the predictor 230, the adder 240, and the filter 250 described above can be configured by one or more hardware components (e.g., a decoder chipset or a processor) according to an embodiment. Also, the memory 260 can include a decoded picture buffer (DPB) and can be configured by a digital storage medium. The hardware components can further include the memory 260 as an internal / external component.

[0070] When a bitstream including video / image information is input, the decoding apparatus 200 can reconstruct an image in correspondence with a process in which the video / image information has been processed in the encoding apparatus 100. Figure 1 For example, the decoding apparatus 200 can derive a unit / block based on information related to a block partition obtained from the bitstream. The decoding apparatus 200 can perform decoding by using a processing unit applied in the encoding apparatus. Accordingly, the decoded processing unit can be, for example, a coding unit that can be partitioned from a coding tree unit or a largest coding unit along a quad-tree structure, a binary-tree structure, and / or a ternary-tree structure. One or more transform units can be derived from the coding unit. Also, a reconstructed image signal decoded and output by the decoding apparatus 200 can be reproduced by a reproducer.

[0071] The decoding apparatus 200 can receive a bitstream from the encoding apparatus 100 in the form of a bitstream. Figure 1The signal output from the encoding apparatus, and can decode the received signal through the entropy decoder 210. For example, the entropy decoder 210 can parse a bitstream to derive information (e.g., video / image information) required for image reconstruction (or picture reconstruction). The video / image information can further include information on 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 can further include general constraint information. The decoding apparatus can further decode a picture based on the information on the parameter sets and / or the general constraint information. In the present disclosure, the information and / or syntax elements to be signaled / received, which will be described later, can be decoded through a decoding process and obtained from a bitstream. For example, the entropy decoder 210 can decode information in a bitstream based on an encoding method such as exponential Golomb coding, CAVLC, CABAC, etc., and can output values of syntax elements necessary for image reconstruction and quantized values of transform coefficients on a residual. More specifically, the CABAC entropy decoding method can receive bins corresponding to each syntax element in a bitstream, determine a context model using decoded information of a neighboring and decoding target block or information of a symbol / bin decoded in a previous step, predict a 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 information of a symbol / bin decoded for a next symbol / bin after determining the context model. Information on prediction among the information decoded in the entropy decoder 210 can be provided to the predictor (inter-predictor 232 and intra-predictor 231), and a residual value, i.e., a quantized transform coefficient, on which entropy decoding has been performed in the entropy decoder 210 and related parameter information can be input to the residual processor 220. The residual processor 220 can derive a residual signal (a residual block, a residual sample, a residual sample array). In addition, information on filtering among the information decoded in the entropy decoder 210 can be provided to the filter 250. Meanwhile, a receiver (not shown) receiving a signal output from the encoding apparatus can further configure the decoding apparatus 200 as an internal / external element, and the receiver can be a component of the entropy decoder 210. Meanwhile, the decoding apparatus according to the present disclosure can be referred to as a video / image / picture decoding apparatus, and can be classified into an information decoder (video / image / picture information decoder) and a sample decoder (video / image / picture sample decoder). The information decoder can include the entropy decoder 210, and the sample decoder can include at least one of the dequantizer 221, the inverse transformer 222, the adder 240, the filter 250, the memory 260, the inter-predictor 232, and the intra-predictor 231.

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

[0073] The inverse transformer 222 obtains a residual signal (a residual block, a residual sample array) by performing inverse transform on the transform coefficients.

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

[0075] The predictor 220 can generate a prediction signal based on various prediction methods. For example, the predictor can apply intra prediction or inter prediction for predicting one block, and can also simultaneously apply intra prediction and inter prediction. This can be referred to as combined inter and intra prediction (CIIP). In addition, the predictor can perform intra block copy (IBC) for predicting a block. Intra block copy can be used for content image / video coding in games, etc., such as screen content coding (SCC). Although IBC basically performs prediction in the current picture, prediction can be performed similarly to inter prediction in terms of deriving a reference block in the current picture. That is, IBC can use at least one of the inter prediction techniques described in the present disclosure. A palette mode can be considered as an example of intra coding or intra prediction. In the case where the palette mode is applied, sample values within a picture can be signaled based on information related to a palette table and a palette index.

[0076] The intra predictor 231 can predict the current block by referring to samples in the current picture. Depending on the prediction mode, the reference samples can be located in a neighboring region of the current block or in a distant region away from the current block. In intra prediction, the prediction mode can include a plurality of non-directional modes and a plurality of directional modes. The intra predictor 231 can determine the prediction mode applied to the current block by using a prediction mode applied to a neighboring block.

[0077] The inter predictor 232 can derive a prediction block for a current block based on a reference block (a reference sample array) specified by a motion vector on a reference picture. At this time, in order to reduce the amount of motion information transmitted in the inter prediction mode, motion information can be predicted in a block, sub-block, or sample unit basis based on the correlation of motion information between neighboring blocks and the current block. The motion information can include a motion vector and a reference picture index. The motion information can further include information on an inter prediction direction (L0 prediction, L1 prediction, Bi prediction, etc.). In the case of inter prediction, the neighboring blocks can include spatial neighboring blocks existing in the current picture and temporal neighboring blocks existing in the reference picture. For example, the inter predictor 232 can 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 received candidate selection information. The inter prediction can be performed based on various prediction modes, and information on the prediction can include information indicating an inter prediction mode for the current block.

[0078] The adder 240 can generate a reconstructed signal (a reconstructed picture, a reconstructed block, a reconstructed sample array) by adding the obtained residual signal to a prediction signal (a prediction block, a prediction sample array) output from the predictor (including the inter predictor 232 and / or the intra predictor 231). When there is no residual for a target block, as in the case where a skip mode is applied, the prediction block can be used as the reconstructed block.

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

[0080] Meanwhile, in the picture decoding process, luminance mapping and chrominance scaling (LMCS) can be applied.

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

[0082] The (modified) reconstructed picture stored in the DPB of the memory 260 can be used as a reference picture in the inter prediction 232. The memory 260 can store motion information of a block in a current picture from which motion information has been derived (or decoded) and / or motion information of a block in a picture that has been (or was previously) reconstructed. The stored motion information can be sent to the inter prediction 232 to be used as motion information of a neighboring block or motion information of a temporally neighboring block. The memory 260 can store reconstructed samples of a reconstructed block in a current picture and can send the reconstructed samples to the intra prediction 231.

[0083] In this specification, the embodiments described in each of the filter 250, the inter prediction 232, and the intra prediction 231 of the decoding device 200 can be identically or correspondingly applied to the filter 160, the inter prediction 121, and the intra prediction 122 of the encoding device 100, respectively.

[0084] As described above, prediction is performed in order to improve compression efficiency when performing video encoding. In doing so, a prediction block including prediction samples for a current block as an encoding 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 the encoding device and the decoding device, and the encoding device can improve image encoding efficiency by signaling information (residual information) about a residual between an original block itself and the prediction block to the decoding device, rather than original sample values of the original block. 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.

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

[0086] Figure 3 A multiple transform technique according to an embodiment of the disclosure is schematically illustrated.

[0087] Reference Figure 3 The transformer can correspond to the transformer in the encoding apparatus of the foregoing Figure 1 The inverse transformer can correspond to the inverse transformer in the encoding apparatus of the foregoing Figure 1 The inverse transformer can correspond to the inverse transformer in the decoding apparatus of the foregoing Figure 2 The inverse transformer can correspond to the inverse transformer in the decoding apparatus of the foregoing

[0088] The transformer can derive (primary) transform coefficients by performing a primary transform based on residual samples (residual sample array) in a residual block (S310). This primary transform can be referred to as a core transform. In this context, the primary transform can be based on multiple transform selection (MTS), and when a multiple core transform is applied as the primary transform, it can be referred to as a multi-core transform.

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

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

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

[0092] Further, according to an example, if the primary transform is performed by applying the MTS, the mapping relationship of the transform kernel can be set by setting a certain basis function to a predetermined value and combining basis functions to be applied in the vertical transform or the horizontal transform. For example, when a horizontal transform kernel is denoted as trTypeHor and a vertical direction transform kernel is denoted as trTypeVer, trTypeHor or trTypeVer having a value of 0 can be set to DCT2, trTypeHor or trTypeVer having a value of 1 can be set to DST7, and trTypeHor or trTypeVer having a value of 2 can be set to DCT8.

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

[0094] In one example, transform kernel sets according to MTS index information are shown in the following table.

[0095] [Table 1]

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

[0097] The transformer can perform a secondary transform based on the (primary) transform coefficients to derive modified (secondary) transform coefficients (S320). The primary transform is a transform from a spatial domain to a frequency domain, and the secondary transform refers to a transform into a more compact expression using a correlation existing between the (primary) transform coefficients. The secondary transform can include a non-separable transform. In this case, the secondary transform can be referred to as a non-separable secondary transform (NSST) or a mode-dependent non-separable secondary transform (MDNSST). The NSST can denote a transform that performs a secondary transform on the (primary) transform coefficients derived through the primary transform based on a non-separable transform matrix to generate modified transform coefficients (or secondary transform coefficients) for a residual signal. Here, the vertical transform and the horizontal transform can not be applied separately (or can not be applied independently) to the (primary) transform coefficients, but the transform can be applied at once based on the non-separable transform matrix. In other words, the NSST is not applied separately to the (primary) transform coefficients in the vertical direction and the horizontal direction, and can denote a transform method that, for example, rearranges a two-dimensional signal (transform coefficients) into a one-dimensional signal through a particular predetermined direction (e.g., a row-major direction or a column-major direction) and then generates modified transform coefficients (or secondary transform coefficients) based on a non-separable transform matrix. For example, the row-major order is to arrange by row in the order of 1st row, 2nd row,..., Nth row for an MxN block, and the column-major order is to arrange by row in the order of 1st column, 2nd column,..., Mth column for an MxN block. The NSST can be applied to a left-top region of a block (hereinafter, referred to as a transform coefficient block) configured with the (primary) transform coefficients. For example, when the width W and the height H of the transform coefficient block are both 8 or more, an 8x8 NSST can be applied to a left-top 8x8 region of the transform coefficient block. Also, while 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, a 4x4 NSST can be applied to a left-top min(8,W)xmin(8,H) region of the transform coefficient block. However, embodiments are 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 4x4 NSST can be applied to the left-top min(8,W)xmin(8,H) region of the transform coefficient block.

[0098] In detail, for example, if a 4x4 input block is used, the non-separable secondary transform can be performed as follows.

[0099] The 4x4 input block X can be expressed as follows.

[0100] [Equation 1]

[0101]

[0102] If X is expressed in the form of a vector, the vector may be expressed as follows.

[0103] [Equation 2]

[0104]

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

[0106] In this case, the non-separable secondary transform can be calculated as follows.

[0107] [Equation 3]

[0108]

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

[0110] Through Equation 3 described above, a 16x1 transform coefficient vector may be derived, and the vector may be reorganized into 4x4 blocks through a scan order (horizontal, vertical, and diagonal, etc.). However, the above calculation is an example, and a hypercube-Givens transform (HyGT) or the like can also be used for the calculation of the non-separable secondary transform in order to reduce the calculation complexity of the non-separable secondary transform.

[0111] Further, in the non-separable secondary transform, a transform kernel (or transform core, transform type) can be selected to be mode-dependent. In this case, the mode can include an intra-prediction mode and / or an inter-prediction mode.

[0112] As described above, the non-separable secondary transform can be performed based on an 8x8 transform or a 4x4 transform determined based on a width (W) and a height (H) of a transform coefficient block. The 8x8 transform refers to a transform applicable to an 8x8 region included in the transform coefficient block when both W and H are equal to or greater than 8, and the 8x8 region can be a top-left 8x8 region in the transform coefficient block. Similarly, the 4x4 transform refers to a transform applicable to a 4x4 region included in the transform coefficient block when both W and H are equal to or greater than 4, and the 4x4 region can be a top-left 4x4 region in the transform coefficient block. For example, an 8x8 transform kernel matrix can be a 64x64 / 16x64 matrix, and a 4x4 transform kernel matrix can be a 16x16 / 8x16 matrix.

[0113] Here, to select a mode-dependent transform kernel, two non-separable secondary transform kernels for non-separable secondary transform can be configured for each of the transform sets for both 8x8 transform and 4x4 transform, and there can be four transform sets. That is, four transform sets can be configured for 8x8 transform, and four transform sets can be configured for 4x4 transform. In this case, each of the four transform sets for 8x8 transform can include two 8x8 transform kernels, and each of the four transform sets for 4x4 transform can include two 4x4 transform kernels.

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

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

[0116] For reference, for example, the intra prediction mode can include two non-directional (or non-angular) intra prediction modes and 65 directional (or angular) intra prediction modes. The non-directional intra prediction mode can include a planar intra prediction mode of 0 number and a DC intra prediction mode of 1 number, and the directional intra prediction mode can include 65 intra prediction modes of 2 number to 66 number. However, this is an example, and the present document can be applied even if the number of intra prediction modes is different. Also, in some cases, a 67th intra prediction mode can also be used, and the 67th intra prediction mode can denote a linear model (LM) mode.

[0117] Figure 4 An intra directional mode of 65 prediction directions is exemplarily shown.

[0118] Reference Figure 4 On the basis of the intra prediction mode 34 having a left-up diagonal prediction direction, the intra prediction mode can be divided into an intra prediction mode having horizontal directionality and an intra prediction mode having vertical directionality. In the case of the intra prediction mode having horizontal directionality, the intra prediction mode can be divided into an intra prediction mode having a horizontal directionality of 0 degree and an intra prediction mode having a horizontal directionality of 180 degree. In the case of the intra prediction mode having vertical directionality, the intra prediction mode can be divided into an intra prediction mode having a vertical directionality of 90 degree and an intra prediction mode having a vertical directionality of 270 degree. Figure 5In this context, H and V denote horizontal and vertical directionality, respectively, and the numbers -32 to 32 indicate a displacement in 1 / 32 units on the sample grid position. These numbers can represent an offset for the mode index value. Intra prediction modes 2 to 33 have horizontal directionality and intra prediction modes 34 to 66 have vertical directionality. Strictly speaking, intra prediction mode 34 can be considered neither horizontal nor vertical, but can be classified as belonging to horizontal directionality when determining the transform set of the secondary transform. This is because the input data is transposed for the vertically oriented modes that are symmetric around intra prediction mode 34, and the input data alignment method for horizontal modes is used for intra prediction mode 34. Transposing the input data means that the rows and columns of a two-dimensional MxN block of data are switched to NxM data. Intra prediction mode 18 and intra prediction mode 50 can represent a horizontal and a vertical intra prediction mode, respectively, and intra prediction mode 2 can be referred to as a right-up diagonal intra prediction mode because it has a left reference pixel and performs prediction in a right-up direction. Likewise, intra prediction mode 34 can be referred to as a right-down diagonal intra prediction mode, and intra prediction mode 66 can be referred to as a left-down diagonal intra prediction mode.

[0119] According to examples, four transform sets according to intra prediction modes can be mapped, for example, as shown in the following table.

[0120] [Table 2]

[0121] 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

[0122] As shown in Table 2, according to intra prediction modes, any one of the four transform sets, i.e., 1fnstTrSetldx, can be mapped to any one of the four indices, i.e., 0 to 3.

[0123] When a particular set is determined to be used for a non-separable transform, one of the k transform kernels in the particular set can be selected by a non-separable secondary transform index. The encoding device can derive the non-separable secondary transform index indicating the particular transform kernel based on rate-distortion (RD) checks, and can signal the non-separable secondary transform index to the decoding device. The decoding device can select one of the k transform kernels in the particular set based on the non-separable secondary transform index. For example, lfnst index value 0 can refer to a first non-separable secondary transform kernel, lfnst index value 1 can refer to a second non-separable secondary transform kernel, and lfnst index value 2 can refer to a third non-separable secondary transform kernel. Alternatively, lfnst index value 0 can indicate that a first non-separable secondary transform is not applied to the target block, and lfnst index values 1 to 3 can indicate three transform kernels.

[0124] The transformer can perform a non-separable 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 the quantizer, and can be encoded and signaled to the decoding device, and transferred to the dequantizer / inverse transformer in the encoding device.

[0125] Further, as described above, if the secondary transform is omitted, the (primary) transform coefficients that are output as the primary (separable) transform can be derived as transform coefficients quantized by the quantizer as described above, and can be encoded and signaled to the decoding device, and transferred to the dequantizer / inverse transformer in the encoding device.

[0126] The inverse transformer can perform a series of processes in an order opposite to the order in which the series of processes are performed in the above-described transformer. The inverse transformer can receive (dequantized) transformer coefficients, and derive (primary) transform coefficients by performing a secondary (inverse) transform (S350), and can obtain a residual block (residual samples) by performing a primary (inverse) transform with respect to the (primary) transform coefficients (S360). In this regard, the primary transform coefficients can be referred to as modified transform coefficients from the perspective of the inverse transformer. 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.

[0127] The decoding device can 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 can determine whether to apply a secondary inverse transform. For example, the secondary inverse transform can be an NSST, an RST, or an LFNST, and the secondary inverse transform application determiner can determine whether to apply the secondary inverse transform based on a secondary transform flag obtained by parsing a bitstream. In another example, the secondary inverse transform application determiner can determine whether to apply the secondary inverse transform based on transform coefficients of a residual block.

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

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

[0130] Meanwhile, in the present disclosure, a reduced secondary transform (RST) in which the size of a transform matrix (kernel) is reduced can be applied in the concept of the NSST in order to reduce the amount of calculation and the amount of storage required for the non-separable secondary transform.

[0131] Meanwhile, the transform kernel, the transform matrix, and the coefficients constituting the transform kernel matrix, i.e., the kernel coefficients or the matrix coefficients, described in the present disclosure can be represented in 8 bits. This can be a condition that is implemented in the decoding apparatus and the encoding apparatus, and compared to the existing 9 bits or 10 bits, the amount of storage required to store the transform kernel can be reduced, and performance degradation can be reasonably accommodated. In addition, representing the kernel matrix in 8 bits can allow the use of a small multiplier, and can be more suitable for single instruction multiple data (SIMD) instructions used for optimal software implementation.

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

[0133] The RST can be referred to as various terms such as reduced transform, reduced secondary transform, downsize transform, simplified transform, and simple transform, and the name by which the RST can be referred to is not limited to the listed examples. Alternatively, since the RST is mainly performed in a low frequency region including non-zero coefficients in the transformed block, it can be referred to as a low frequency non-separable transform (LFNST). The transform index can be referred to as an LFNST index.

[0134] Meanwhile, when the secondary inverse transform is performed based on the RST, the inverse transformer 135 of the encoding apparatus 100 and the inverse transformer 222 of the decoding apparatus 200 can include an inverse reduced secondary transformer that derives modified transform coefficients based on the inverse RST of the transform coefficients, and an inverse primary transformer that derives residual samples for a target block based on the inverse primary transform of 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 can refer to deriving transform coefficients by applying a transform.

[0135] Figure 5is a diagram illustrating an RST according to an embodiment of the disclosure.

[0136] In the disclosure, a "target block" can refer to a current block to be encoded, a residual block, or a transform block.

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

[0138] In the example, the reduction factor or the reduction coefficient can be signaled through a bitstream, but the example is not limited thereto. For example, a pre-defined value for the reduction factor or the reduction coefficient can be stored in each of the encoding apparatus 100 and the decoding apparatus 200, and in this case, the reduction factor or the reduction coefficient can not be separately signaled.

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

[0140] [Equation 4]

[0141]

[0142] Figure 5 The matrix T in the reduced transform block illustrated in (a) of FIG. 1 can mean the matrix T of Equation 4 RxN . As Figure 5 indicated in (a) of FIG. 1, when the reduced transform matrix T RxN is multiplied by the residual samples of the target block, the transform coefficients for the target block can be derived.

[0143] In the example, if the size of the block to which a transform is applied is 8x8 and R=16 (i.e., R / N=16 / 64=1 / 4), the RST according to (a) of FIG. 1 can be expressed as a matrix operation as shown in Equation 5 below. In this case, it is possible to reduce the memory and multiplication calculation by about 1 / 4 through the reduction factor. Figure 5

[0144] In the disclosure, a matrix operation can be understood as an operation of obtaining a column vector by multiplying the column vector by a matrix disposed on the left side of the column vector.

[0145] [Equation 5]​

[0146]

[0147] In Equation 6, r1to r 64 may represent residual samples of the target block, and specifically can be transform coefficients generated by applying the primary transform. As a result of the calculation of Equation 5, transform coefficients c i for the target block can be derived, and the process of deriving c i may be as shown in Equation 6.

[0148] [Equation 6]

[0149]

[0150] As a result of the calculation of Equation 6, transform coefficients c1to c R for the target block can be derived. That is, when R = 16, transform coefficients c1to c 16 for the target block can be derived. Although 64(N) transform coefficients are derived for the target block, if a regular transform is applied instead of RST and a 64x64(NxN) size transform matrix is multiplied by a 64x1(Nx1) size residual sample, 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 100 to the decoding device 200 is reduced, and thus the efficiency of transmission between the encoding device 100 and the decoding device 200 can be improved.

[0151] When considered from the perspective of the size of the transform matrix, the size of the regular transform matrix is 64x64(NxN), but the size of the reduced transform matrix is reduced to 16x64(RxN), and thus the storage usage rate in the case of performing RST can be reduced by a ratio of R / N compared to the case of performing a regular transform. In addition, when compared to the number of multiplication calculations NxN in the case of using a regular transform matrix, the number of multiplication calculations (RxN) can be reduced by a ratio of R / N using a reduced transform matrix.

[0152] In an example, the transformer 132 of the encoding device 100 can derive transform coefficients for a target block by performing a primary transform and a secondary transform based on RST with respect to residual samples for the target block. These transform coefficients can be passed to the inverse transformer of the decoding device 200, and the inverse transformer 222 of the decoding device 200 can derive modified transform coefficients based on an inverse reduced secondary transform (RST) with respect to the transform coefficients, and can derive residual samples for the target block based on an inverse primary transform with respect to the modified transform coefficients.

[0153] Based on the example inverse RST matrix T NxR The size is smaller than the size of the conventional inverse transformation matrix NxN by NxR, and is similar to the reduced transformation matrix T shown in Equation 4. RxN It is in a transpose relationship.

[0154] Figure 5 The matrix T in the reduced inverse transform block shown in (b) t It can refer to the inverse RST matrix T RxN T (The superscript T indicates transpose). When... Figure 5 (b) shows the inverse RST matrix T RxN T When multiplied by the transform coefficients used for the target block, modified transform coefficients for the target block or residual samples for the current block can be derived. The inverse RST matrix T can be... RxN T Expressed as (T) RxN ) T NxR .

[0155] More specifically, when the inverse RST is used as a secondary inverse transformation, 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. Furthermore, the inverse RST can be used as the inverse primary transform, and in this case, when the inverse RST matrix T... N×R T When multiplied by the transformation coefficients of the target block, the residual samples of the target block can be derived.

[0156] In the example, if the size of the block to which the inverse transform is applied is 8x8 and R = 16 (i.e., R / N = 16 / 64 = 1 / 4), then according to Figure 5 The RST expression of (b) is a matrix operation as shown in Equation 7 below.

[0157] [Formula 7]

[0158]

[0159] In Equation 7, c1 to c 16 The transformation coefficients of the target block can be represented. As a result of Equation 7, the transformation coefficients representing the modifications to the target block or the r values ​​of the residual samples of the target block can be derived. i And export r i The process can be shown in Equation 8.

[0160] [Formula 8]

[0161]

[0162] As a result of the calculation of Equation 8, r1 to r N From the perspective of the size of the inverse transform matrix, the size of the regular inverse transform matrix is 64x64 (NxN), but the size of the inverse reduced transform matrix is reduced to 64x16 (RxN), and thus the storage usage rate can be reduced by a ratio of R / N in the case of performing the inverse RST compared to the case of performing the regular inverse transform. In addition, the number of multiplication calculations can be reduced by a ratio of R / N (NxR) using the inverse reduced transform matrix when compared to the number of multiplication calculations NxN in the case of using the regular inverse transform matrix.

[0163] The transform set configuration shown in Table 2 can also be applied to 8x8 RST. That is, 8x8 RST can be applied according to the transform set in Table 2. Since one transform set includes two or three transforms (kernels) according to the intra prediction mode, it can be configured to select one of at most four transforms included in the case where the secondary transform is not applied. In the transform in which the secondary transform is not applied, it can be considered that an identity matrix is applied. Assuming that indices 0, 1, 2, and 3 are respectively assigned to the four transforms (for example, the index 0 can be assigned to the case where the identity matrix is applied, i.e., the case where the secondary transform is not applied), the transform index or lfnst index can be signaled as a syntax element for each transform coefficient block, thereby designating the transform to be applied. That is, for the top-left 8x8 block, through the transform index, it can be designated that 8x8 NSST in the RST configuration or 8x8 lfnst when the LFNST is applied. The 8x8 lfnst and 8x8 RST refer to a transform that can be applied to an 8x8 region included in a transform coefficient block when W and H of a target block to be transformed are equal to or greater than 8, and the 8x8 region can be a top-left 8x8 region in the transform coefficient block. Similarly, the 4x4 lfnst and 4x4 RST refer to a transform that can be applied to a 4x4 region included in a transform coefficient block when W and H of a target block are equal to or greater than 4, and the 4x4 region can be a top-left 4x4 region in the transform coefficient block.

[0164] According to embodiments of the disclosure, for a transform in an encoding process, only 48 pieces of data can be selected, and a maximum 16x48 transform kernel matrix can be applied thereto, instead of applying a 16x64 transform kernel matrix to 64 pieces of data forming an 8x8 region. Here, "maximum" means that m has a maximum value of 16 in an m x 48 transform kernel matrix for generating m coefficients. That is, when RST is performed by applying an m x 48 transform kernel matrix (m ≤ 16) to an 8x8 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 the 48 pieces of data form a 48x1 vector, the 16x48 matrix and the 48x1 vector are sequentially multiplied, thereby generating a 16x1 vector. Here, the 48 pieces of data forming the 8x8 region can be appropriately arranged, thereby forming a 48x1 vector. For example, the 48x1 vector can be constructed based on the 48 pieces of data constituting a region other than the right-bottom 4x4 region among the 8x8 region. Here, when matrix operation is performed by applying the maximum 16x48 transform kernel matrix, 16 modified transform coefficients are generated, and the 16 modified transform coefficients can be arranged in the upper-left 4x4 region according to a scan order, and the upper-right 4x4 region and the lower-left 4x4 region can be padded with zeros.

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

[0166] In summary, in a transform process, when RST or LFNST is applied to an 8x8 region, 48 transform coefficients in the upper-left region, the upper-right region, and the lower-left region of the 8x8 region other than the right-bottom region are subjected to matrix operation with a 16x48 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 8x8 region.

[0167] In contrast, in the inverse transform process, when the inverse RST or LFNST is applied to the 8x8 region, 16 transform coefficients corresponding to the upper left region of the 8x8 region among the transform coefficients in the 8x8 region can be input in a one-dimensional array according to the scan order, and can undergo a matrix operation with the 48x16 transform kernel matrix. That is, the matrix operation can be expressed as (48x16 matrix)*(16x1 transform coefficient vector)=(48x1 modified transform coefficient vector). Here, the nx1 vector can be interpreted to have the same meaning as the nx1 matrix, and thus can be expressed as an nx1 column vector. Also, * denotes 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 region, the upper right region, and the lower left region in the 8x8 region except for the lower right region.

[0168] When the secondary inverse transform is based on the RST, the inverse transformer 135 of the encoding apparatus 100 and the inverse transformer 222 of the decoding apparatus 200 can include an inverse reduced secondary transformer for deriving modified transform coefficients based on the inverse RST on the transform coefficients and an inverse primary transformer for deriving residual samples for a target block based on the inverse primary transform on 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 can refer to deriving the transform coefficients by applying the transform.

[0169] The non-separable transform (LFNST) described above will be described in detail as follows. The LFNST can include a forward transform by the encoding apparatus and an inverse transform by the decoding apparatus.

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

[0171] [Equation 9]

[0172] y = G T x

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

[0174] For inverse LFNST, the dimensions of the matrix G are [48x16], [48x8], [16x16], [16x8], and the [48x8] matrix and the [16x8] matrix are partial matrices of 8 transform basis vectors sampled from the left side of the [48x16] matrix and the [16x16] matrix, respectively.

[0175] On the other hand, for forward LFNST, the dimensions of the matrix G T are [16x48], [8x48], [16x16], [8x16], and the [8x48] matrix and the [8x16] matrix are partial matrices obtained by sampling 8 transform basis vectors from the upper part of the [16x48] matrix and the [16x16] matrix, respectively.

[0176] Accordingly, in the case of forward LFNST, a [48x1] vector or a [16x1] vector can be inputted as x, and a [16x1] vector or an [8x1] vector can be outputted as y. In video encoding and decoding, the output of the forward primary transform is two-dimensional (2D) data, and thus in order to construct a [48x1] vector or a [16x1] vector as input x, it is necessary to construct a one-dimensional vector by appropriately arranging the 2D data which is the output of the forward transform.

[0177] Figure 6 is a diagram illustrating an order of arranging output data of the forward primary transform into a one-dimensional vector according to an example. Figure 6 The left diagram of (a) and (b) of FIG. 1 illustrates an order for constructing a [48x1] vector, and Figure 6 The right diagram of (a) and (b) of FIG. 1 illustrates an order for constructing a [16x1] vector. In the case of LFNST, a one-dimensional vector x can be obtained by sequentially arranging 2D data in the same order as in Figure 6 (a) and (b) of FIG. 1.

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

[0179] According to an example, a different arrangement order than the arrangement order of (a) and (b) of FIG. 1 can be applied, and in order to derive the same as when (a) and (b) of FIG. 1 are applied, it is necessary to appropriately arrange the 2D data which is the output of the forward transform. Figure 6 Figure 6 ​​​The arrangement order of (a) and (b) of FIG. 9 is the same result (y vector), and the column vectors of the matrix G can be rearranged according to the arrangement order. That is, the column vectors of G can be rearranged such that each element constituting the x vector is always multiplied by the same transform basis vector.

[0180] Since the output y derived through Equation 9 is a one-dimensional vector, when two-dimensional data is required as input data in a process of using the result of the forward secondary transform as input (for example, in a process of performing quantization or residual coding), the output y vector of Equation 9 needs to be rearranged as 2D data again as appropriate.

[0181] Figure 7 is a diagram illustrating an order of arranging output data of the forward secondary transform into a two-dimensional block according to an example.

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

[0183] According to another example, since the order of processing the output vector y when performing quantization or residual coding can be preset, the output vector y can not be arranged in a 2D block as shown in Figure 8 However, in the case of residual coding, data coding can be performed in units of a 2D block (for example, 4x4) such as CG (coefficient group), and in this case, the data is arranged according to a certain order as in the diagonal scan order of Figure 7

[0184] Meanwhile, the decoding device can configure a one-dimensional input vector y by arranging two-dimensional data output through a dequantization process according to a preset scan order for inverse transform. The input vector y can be output as an output vector x through the following equation.

[0185] [Equation 10]

[0186] x = Gy

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

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

[0189] Accordingly, the inverse secondary transform is the reverse of the forward secondary transform process as a whole, and in the case of the inverse transform, unlike in the forward direction, the inverse secondary transform is applied first, and then the inverse primary transform is applied.

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

[0191] In addition, the 8 matrices can be derived from four transform sets as shown in Table 2 above, and each transform set can consist of two matrices. Which transform set is used 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 among the two matrices constituting the selected transform set is derived through index signaling. More specifically, 0, 1, and 2 can be transmitted as index values, 0 can indicate that the 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.

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

[0193] Figure 8 is a diagram illustrating a block shape to which the LFNST is applied. Figure 8 (a) of shows a 4x4 block, (b) shows a 4x8 block and an 8x4 block, (c) shows a 4xN block or an Nx4 block where N is 16 or more, (d) shows an 8x8 block, and (e) shows an MxN block where M≥8, N≥8, and N>8 or M>8.

[0194] In Figure 8 , the block with a thick border indicates a region to which the LFNST is applied. For Figure 8 the blocks of (a) and (b) of, the LFNST is applied to the upper left 4x4 region, and for Figure 8 the block of (c) of, the LFNST is applied to the two upper left 4x4 regions arranged continuously, respectively. In Figure 8 ​In (a), (b), and (c) of FIG. 1, since the LFNST is applied in units of 4x4 regions, this LFNST will be hereinafter referred to as "4x4 LFNST". Based on the matrix dimension for G, either a [16x16] or a [16x8] matrix can be applied.

[0195] More specifically, a [16x8] matrix is applied to Figure 8 4x4 blocks (4x4 TUs or 4x4 CUs) of (a) of FIG. 1 and a [16x16] matrix is applied to Figure 8 blocks in (b) and (c) of FIG. 1. This is to adjust the computational complexity for the worst case to 8 multiplications per sample.

[0196] As for Figure 6 (d) and (e) of FIG. 1, the LFNST is applied to the upper left 8x8 region, and this LFNST will be hereinafter referred to as "8x8 LFNST". As a corresponding transform matrix, either a [48x16] matrix or a [48x8] matrix can be applied. In the case of the forward LFNST, since a [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 for the forward LFNST. That is, as can be seen in the left order of (a) of FIG. 1 or the left order of (b) of FIG. 1, the [48x1] vector can be constructed based on samples belonging to the remaining 3 4x4 blocks, while leaving the right lower 4x4 block as it is. Figure 6 Figure 8

[0197] A [48x8] matrix can be applied to Figure 8 8x8 blocks (8x8 TUs or 8x8 CUs) in (d) of FIG. 1, and a [48x16] matrix can be applied to Figure 9 8x8 blocks in (e) of FIG. 1. This is also to adjust the computational complexity for the worst case to 8 multiplications per sample.

[0198] Depending on the block shape, 8 or 16 output data (Y vector in Equation 9, [8x1] or [16x1] vector) are generated when the corresponding forward LFNST (4x4 or 8x8 LFNST) is applied. In the forward LFNST, due to the characteristic of the matrix G T of FIG. 1, the number of output data is equal to or less than the number of input data.

[0199] Figure 9 is a diagram illustrating the arrangement of output data of the forward LFNST according to an example, and shows a block in which the output data of the forward LFNST is arranged according to the block shape.

[0200] Figure 9 ​​The shaded area at the upper left of the block shown in FIG. 10 corresponds to the area where the output data of the forward LFNST is located, the positions marked with 0 indicate samples filled with the value 0, and the remaining area represents an area that is not changed by the forward LFNST. In the area that is not changed by the LFNST, the output data of the forward primary transform remains unchanged.

[0201] As described above, since the dimension of the applied transform matrix varies according to the shape of the block, the number of output data also varies. As Figure 9 , the output data of the forward LFNST can not completely fill the upper left 4x4 block. In the case of (a) and (d) of Figure 7 , the [16x8] matrix and the [48x8] matrix are applied to the block or the partial area within the block indicated by the thick line, respectively, and an [8x1] vector is generated as the output of the forward LFNST. That is, according to the scan order shown in (b) of Figure 9 , only 8 output data can be filled as shown in (a) and (d) of Figure 8 , and 0 can be filled in the remaining 8 positions. In the case of the block to which the LFNST is applied in (d) of Figure 9 , as shown in (d) of Figure 9 , two 4x4 blocks in the upper right and the upper left adjacent to the upper left 4x4 block are also filled with the value 0.

[0202] As described above, basically, by signaling the LFNST index, whether the LFNST is applied and the transform matrix to be applied are designated. As Figure 9 indicated, when the LFNST is applied, since the number of output data of the forward LFNST can be equal to or less than the number of input data, an area filled with zero values occurs as follows.

[0203] 1) As shown in (a) of Figure 9 , the samples from the 8th and subsequent positions in the scan order in the upper left 4x4 block, i.e., from the 9th to the 16th.

[0204] 2) As shown in (d) and (e) of Figure 8 , when the [48x16] matrix or the [48x8] matrix is applied, two 4x4 blocks adjacent to the upper left 4x4 block or the second and third 4x4 blocks in the scan order.

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

[0206] According to an example, in the case of LFNST adopted in the VVC standard, for example, since signaling of the LFNST index is performed after residual coding, the encoding device can know whether non-zero data (significant coefficients) exist at all positions within a TU or CU block through residual coding. Therefore, the encoding device can determine whether to perform signaling regarding 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 regions specified in the above 1) and 2), signaling of the LFNST index is performed.

[0207] Meanwhile, for the adopted LFNST, the following simplified method can be applied.

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

[0209] In the case of (c) of Figure 8 , 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 on the upper left, and LFNST can be applied only to Figure 10 all blocks at a time. By this, the implementation of the image coding can be simplified.

[0210] (ii) According to an example, zeroing can be additionally applied to a region to which LFNST is not applied. In this, zeroing can mean filling the values of all positions belonging to a certain region with a value of 0. That is, zeroing can be applied to a region whose value does not change due to LFNST and which maintains the result of the forward primary transform. As described above, because LFNST is divided into 4x4 LFNST and 8x8 LFNST, zeroing can be divided into the following two types ((ii)-(A) and (ii)-(B)).

[0211] (ii)-(A) When 4x4 LFNST is applied, a region to which 4x4 LFNST is not applied can be zeroed. Figure 10 FIG. 13 illustrates zeroing in a block to which 4x4 LFNST is applied according to an example.

[0212] As Figure 9 indicated in Figure 10 , with respect to a block to which 4x4 LFNST is applied, that is, with respect to a block in (a), (b), and (c) of

[0213] Figure 11 (d) shows, according to an example, when the maximum number of output data of a forward LFNST is limited to 16, performing zeroing on the remaining blocks to which 4x4 LFNST is not applied.

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

[0215] As shown in Figure 9 , with respect to a block to which 8x8 LFNST is applied, that is, with respect to a block in which Figure 9 (d) and (e) of the above, even the area to which LFNST is not applied can be padded with 0.

[0216] (iii) Due to the zeroing proposed in (ii), the area padded with 0 can change when LFNST is applied. Accordingly, according to the zeroing proposed in (ii), it is possible to check whether non-zero data exists on a wider area than the LFNST of Figure 9 .

[0217] For example, when (ii) - (B) is applied, it is possible to check whether non-zero data exists in the area padded with 0 in (d) and (e) of the above, up to the area additionally padded with 0 in Figure 11 . Figure 9 , and then the LFNST index can be signaled only when non-zero data does not exist.

[0218] Of course, even if the zeroing proposed in (ii) is applied, it is possible to check whether non-zero data exists in the same manner as the existing LFNST index signaling. That is, after checking whether non-zero data exists in the block padded with zero in Figure 9 , the LFNST index signaling can be applied. In this case, the encoding device only performs zeroing, and the decoding device does not assume zeroing, that is, only checks whether non-zero data exists only in the area explicitly marked as 0 in Embodiment , LFNST index resolution can be performed.

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

[0220] Figure 10

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

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

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

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

[0225] In an embodiment, when LFNST is applied, the region in which non-zero output data can exist is limited to the inside of the left upper 4x4 region. Specifically, in (a) of Figure 11 and (a) of Figure 10 , the eighth position in the scan order is the last position in which non-zero data can exist, and in (b) and (d) of Figure 11 and (b) of treeType!= DUAL_TREE_CHROMA? transform_ , the 16th position in the scan order (i.e., the right lower corner position of the left upper 4x4 block) is the last position in which non-zero data can exist.

[0226] Therefore, when LFNST is applied, after checking whether non-zero data exists in a position that the residual coding process does not allow (at a position beyond the last position), it can be determined whether to signal the LFNST index.

[0227] In the case of the zeroing-out method proposed in (ii), the amount of calculation required to perform the entire transform process can be reduced due to the number of data finally generated when both the primary transform and LFNST are applied. That is, when LFNST is applied, since zeroing-out is applied to the forward primary transform output data existing in a region to which LFNST is not applied, there is no need to generate data for a region that becomes zeroed-out during the performance of the forward primary transform. Therefore, the amount of calculation required to generate corresponding data can be reduced. The additional effects of the zeroing-out method proposed in (ii) are summarized as follows.

[0228] First, as described above, the amount of calculation required to perform the entire transform process is reduced.

[0229] In particular, when applying (ii)-(B), the worst case calculation amount is reduced, so that the transform process can be made lighter. In other words, generally, a large amount of calculation is required to perform a large primary transform. By applying (ii)-(B), the amount of data derived as a result of performing the 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 operation further increases.

[0230] Second, the amount of calculation required for the entire transform process can be reduced, thereby reducing the power consumption required to perform the transform.

[0231] Third, the delay involved in the transform process is reduced.

[0232] A secondary transform such as LFNST adds the amount of calculation to the existing primary transform, thus increasing the overall delay time involved in performing the transform. In particular, in the case of intra prediction, since the reconstructed data of the neighboring block is used in the prediction process, the increase in delay due to the secondary transform during encoding results in an increase in the delay until the reconstruction. This can result in an increase in the overall delay of the intra prediction encoding.

[0233] However, if the zeroing out proposed in (ii) is applied, the delay time of performing the primary transform can be greatly reduced when applying the LFNST, the delay time of the entire transform is maintained or reduced, so that the encoding apparatus can be more simply implemented.

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

[0235] The ISP partitions the block predicted as the intra luma 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 the ISP can be applied is 4x8 or 8x4. If the block size is greater than 4x8 or 8x4, the block is partitioned into four sub-partitions.

[0236] When the ISP is applied, the sub-blocks are coded in order according to the partition type, such as horizontal or vertical, from left to right, or from top to bottom, and the coding of the next sub-block can be performed after the restoration process is performed on one sub-block through inverse transform and intra prediction. For the leftmost or topmost sub-block, the reconstructed pixels of the coded block that has already been coded are referred to as in the conventional intra prediction method. In addition, if the previous sub-block is not adjacent to each side edge of the following intra sub-block, in order to derive the reference pixels adjacent to the corresponding side edge, the reconstructed pixels of the adjacent coded block that has already been coded are referred to as in the conventional intra prediction method.

[0237] In the ISP coding mode, all of the sub-blocks can be coded with the same intra prediction mode, and a flag indicating whether to use the ISP coding and a flag indicating the direction (horizontal or vertical) of performing the partitioning can be signaled. Here, the number of sub-blocks can be adjusted to 2 or 4 according to the shape of the block. When the size (width x height) of one sub-block is less than 16, the partitioning into sub-blocks can not be allowed, or a restriction can be imposed not to use the ISP coding itself.

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

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

[0240] A transform can be applied to a residual signal generated in a unit of a partition block through an ISP prediction method. A multi-transform selection (MTS) technique based on a DST-7 / DCT-8 combination and an existing DCT-2 can be applied to a forward-based primary transform (core transform), and a forward low-frequency non-separable transform (LFNST) can be applied to transform coefficients generated according to the primary transform to generate finally modified transform coefficients.

[0241] That is, the 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. Accordingly, when a LFNST set derived based on the intra prediction mode is selected, the derived LFNST set can be applied to all of the partition blocks. That is, because the same intra prediction mode is applied to all of the partition blocks, the same LFNST set can be applied to all of the partition blocks.

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

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

[0244] According to an embodiment, after the forward LFNST is applied to each partition block, only up to 16 (8 or 16) coefficients are left in the top-left 4x4 region in the scan order of the transform coefficients, and then a zero-out can be applied in which the remaining positions and regions are all filled with 0.

[0245] Alternatively, according to an embodiment, when the length of one side of the partition block is 4, the LFNST is applied only to the top-left 4x4 region, and when the length (i.e., the width and the height) of all sides of the partition block is 8 or more, the LFNST can be applied to the remaining 48 coefficients within the top-left 8x8 region except for the bottom-right 4x4 region.

[0246] Alternatively, according to an embodiment, in order to adjust the worst-case computational complexity to 8 multiplications per sample, only 8 transform coefficients can be output after the forward LFNST is applied when each partition block is 4x4 or 8x8. That is, when the partition block is 4x4, an 8x16 matrix can be applied as a transform matrix, and when the partition block is 8x8, an 8x48 matrix can be applied as a transform matrix.

[0247] In the current VVC standard, LFNST index signaling is performed in units of a coding unit. Therefore, in the 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 an LFNST index value is transmitted 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, in which 0 indicates a case where LFNST is not applied, and 1 and 2 indicate two transform matrices existing in one LFNST set when LFNST is applied.

[0248] 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 the coding unit are predicted in the same intra prediction mode, the partition blocks can refer to the same LFNST set.

[0249] As another example, LFNST index signaling is still performed in units of a coding unit, but in the case of the ISP prediction mode, it is not determined whether to uniformly apply LFNST to all partition blocks, and for each partition block, it can be determined whether to apply the LFNST index value signaled at the coding unit level and whether to apply LFNST through a separate condition. Here, the separate condition can be signaled in the form of a flag for each partition block through a 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 can not be applied.

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

[0251] In the case of the ISP mode, in order to maintain the number of multiplications per sample (or per coefficient, or per position) at a certain value or less when LFNST is applied, the application of LFNST can be limited. According to the size of the partition block, the number of multiplications per sample (or per coefficient, or per position) can be maintained at 8 or less by applying LFNST as follows.

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

[0253] 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 can be applied, and in the backward direction, a 16x8 matrix obtained by sampling the left 8 columns from the 16x16 matrix can be applied. Also, 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 can 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 can be applied.

[0254] In the case of a 4xN or Nx4 (N>4) block, when the forward transform is performed, 16 coefficients generated after the 16x16 matrix is applied only to the upper left 4x4 block are arranged in the upper left 4x4 region, and other regions can be filled with 0 values. Also, when the inverse transform is performed, the 16 coefficients located in the upper left 4x4 block can be arranged in a scan order to configure an input vector, and then 16 output data can be generated by multiplication by the 16x16 matrix. The generated output data can be arranged in the upper left 4x4 region, and the remaining regions except for the upper left 4x4 region can be padded with zeros.

[0255] In the case of an 8xN or Nx8 (N>8) block, when the forward transform is performed, 16 coefficients generated after the 16x48 matrix is applied only to an ROI region in the upper left 8x8 block (the remaining region excluding the right lower 4x4 block from the upper left 8x8 block) can be arranged in the upper left 4x4 region, and other regions can be filled with 0 values. Also, when the inverse transform is performed, the 16 coefficients located in the upper left 4x4 block can be arranged in a scan order to configure an input vector, and then 48 output data can be generated by multiplication by the 48x16 matrix. The generated output data can be filled in the ROI region, and other regions can be filled with 0 values.

[0256] As another example, 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 size of the ISP compilation unit instead of the size of the ISP partition block can be kept to 8 or less. When only one block among the ISP partition blocks satisfies the condition to apply LFNST, the worst case complexity calculation for LFNST can be applied based on the size of the corresponding compilation unit instead of the size of the partition block. For example, one compilation unit (CU) of luma compilation block is divided (or partitioned) into four partition blocks each having a size of 4x4. And, in this context, among the four partition blocks, if there is no non-zero transform coefficient for two partition blocks, each of the remaining two partition blocks can be configured to have (based on the encoder) 16 transform coefficients generated therein, instead of 8 transform coefficients.

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

[0258] As described above, the LFNST index can have values 0, 1, 2, wherein 0 indicates that LFNST is not applied, and wherein 1 and 2 respectively indicate each of the 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, the method according to which LFNST is transmitted will be described as follows.

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

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

[0261] A. When the mode corresponds to a mode in which no transform is applied (e.g., transform skip, BDPCM, lossless coding, etc.).

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

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

[0264] In the case of dual tree, it is determined whether each of the coding unit of the luma component and the coding unit of the chroma component exceeds the maximum luma transform size. That is, it is checked whether the luma block exceeds the maximum luma transform size available for the transform, and it is checked whether the chroma block exceeds the horizontal / vertical length of the transform of the corresponding luma block for the color format and the maximum luma transform size. For example, when the color format is 4:2:0, each of the horizontal / vertical length of the corresponding luma block becomes 2 times the length of the corresponding chroma block, and the transform size of the corresponding luma block becomes 2 times the size of the corresponding chroma block. As another example, when the color format is 4:4:4, the horizontal / vertical length and the transform size of the corresponding luma block are the same as the corresponding chroma block.

[0265] 64-length transform or 32-length transform means a transform applied to a horizontal or vertical length of 64 or 32, respectively. Also, "transform size" can mean a corresponding length of 64 or 32.

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

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

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

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

[0270] E. When the last non-zero coefficient position is not the DC position (the top-left position in the block), the LFNST index is signaled if the block is a dual tree type luma block and if the last non-zero coefficient position is not the DC position. The corresponding LFNST index is signaled 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.

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

[0272] In this document, when a coded block flag (CBF) value indicating the presence or absence of transform coefficients for a 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, the last non-zero coefficient position can not be considered when checking the condition for LFNST index signaling.

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

[0274] F. When it is verified that transform coefficients exist in positions other than positions in which LFNST transform coefficients can exist, LFNST index signaling can be skipped (or omitted). In the case of 4x4 transform blocks and 8x8 transform blocks, according to the transform coefficient scan order of the VVC standard, LFNST transform coefficients can exist in 8 positions from the DC position, and all remaining positions can be padded with 0. In addition, in the case of transform blocks that are not 4x4 transform blocks and 8x8 transform blocks, according to the transform coefficient scan order of the VVC standard, LFNST transform coefficients can exist in 16 positions from the DC position, and all remaining positions can be padded with 0.

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

[0276] In addition, the ISP mode can be applied only to a luma block or can be applied to both luma and chroma blocks. As described above, when ISP prediction is applied, prediction is performed after a corresponding coding unit is divided (or partitioned) into 2 or 4 partition blocks, and a transform can also be applied to each of the corresponding partition blocks. Therefore, even when determining the condition for signaling the LFNST index by the coding unit, it should be considered that 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 for only the corresponding component. The LFNST index signaling method that can be used for the ISP mode will be described below.

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

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

[0279] A. When the mode corresponds to a mode in which no transform is applied (e.g., transform skip, BDPCM, lossless coding, etc.).

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

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

[0282] In the case of dual tree, it is determined whether each coding unit or partition block of the luma component and each coding unit or partition block of the chroma component exceeds the maximum block transform size. That is, by comparing each of the horizontal length and the vertical length of the coding unit or partition block of the luma component with the maximum luma transform size, and when it is determined that at least one length is greater than the maximum luma transform size, the LFNST is not applied. And, in the case of the coding unit or partition block of the chroma component, the horizontal / vertical length of the corresponding luma block of the color format is compared with the maximum luma transform size available for the maximum transform. For example, when the color format is 4:2:0, each of the horizontal / vertical length of the corresponding luma block becomes twice the length of the corresponding chroma block, and the transform size of the corresponding luma block becomes 2 times the size of the corresponding chroma block. As another example, when the color format is 4:4:4, the horizontal / vertical length and the transform size of the corresponding luma block are the same as the corresponding chroma block.

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

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

[0285] In addition to LFNST included in the current VVC standard, if LFNST for 2xM (1xM) or Mx2 (Mx1) block is applied, LFNST index can be signaled only in the case that the size of the partition block is equal to or larger than 2xM (1xM) or Mx2 (Mx1) block. In this document, when P x Q block is equal to or larger than R x S block, it means P ≥ R and Q ≥ S.

[0286] In summary, LFNST index can be signaled only for the case that the size of the partition block is equal to or larger than the minimum size in which LFNST can be applied. In the case of dual tree, LFNST index can be signaled only in the case that the size of the partition block of luma component or chroma component is equal to or larger than the minimum size in which LFNST can be applied. In the case of single tree, LFNST index can be signaled only in the case that the size of the partition block of luma component is equal to or larger than the minimum size in which LFNST can be applied.

[0287] In this document, when M x N block is equal to or larger than K x L block, it means M is equal to or larger than K and N is equal to or larger than L. When M x N block is larger than K x L block, it means M is equal to or larger than K and N is equal to or larger than L, while M is larger than K or N is larger than L. When M x N block is smaller than or equal to K x L block, it means M is smaller than or equal to K and N is smaller than or equal to L. And, when M x N block is smaller than K x L block, it means M is smaller than or equal to K and N is smaller than or equal to L, while M is smaller than K or N is smaller than L.

[0288] D. When the last non-zero coefficient position is not the DC position (the top-left position in the block), LFNST index can be signaled if the block is a dual tree type luma block and even for the corresponding last non-zero coefficient position of one of all partition blocks is not the DC position. LFNST index can be signaled if the block is a dual tree type chroma block and even one of the last non-zero coefficient position for all partition blocks of Cb (assuming the number of partition blocks is equal to 1 when ISP mode is not applied for chroma component) and the last non-zero coefficient position for all partition blocks of Cr (assuming the number of partition blocks is equal to 1 when ISP mode is not applied for chroma component) is not the DC position.

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

[0290] In this context, when a coded block flag (CBF) value indicating the presence or absence of transform coefficients 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, the last non-zero coefficient position of the corresponding partition block is not considered when checking the condition for LFNST index signaling.

[0291] For example, 1) in the case of the dual tree type and the luminance component, if the corresponding CBF value of each partition block is equal to 0, the corresponding partition block is excluded when determining whether to perform LFNST index signaling; 2) in the case of the dual tree type and the chroma component, if the CBF value of Cb of each partition block 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 determine whether to perform the corresponding LFNST index signaling; and 3) in the case of the single tree type, only the last non-zero coefficient position of the luminance component, the Cb component, or the Cr component, each of which has a CBF value of 1, of all partition blocks is checked in order to determine whether to perform LFNST index signaling.

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

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

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

[0295] iii.In the case of the ISP mode and the single tree type, the method number i and the method number ii can be applied. That is, in the case of applying the method number i to the ISP mode and the single tree type, the check for the last non-zero coefficient position of both the luma block and the chroma block can be skipped, and the LFNST index signaling can be authorized. Alternatively, by applying the method number ii, the check for the last non-zero coefficient position of the partitioned block of the luma component can be skipped, and the check for the last non-zero coefficient position of the partitioned block of the chroma component can be performed according to the above-described method (when the ISP mode is not applied to the chroma component, the number of the partitioned block can be given as equal to 1) in order to determine whether to perform the corresponding LFNST index signaling.

[0296] E.For example, when it is verified that the transform coefficients exist in positions other than positions in which the LFNST transform coefficients can exist even for one of all the partitioned blocks, the LFNST index signaling can be skipped (or omitted).

[0297] For example, in the case of the 4x4 partitioned block and the 8x8 partitioned block, according to the transform coefficient scan order of the VVC standard, the LFNST transform coefficients can exist in 8 positions from the DC position, and all the remaining positions can be padded with 0. In addition, in the case of the partitioned block being equal to or greater than 4x4, and in the case of the partitioned block not being the 4x4 partitioned block and the 8x8 partitioned block, according to the transform coefficient scan order of the VVC standard, the LFNST transform coefficients can exist in 16 positions from the DC position, and all the remaining positions can be padded with 0.

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

[0299] Meanwhile, in the case of the ISP mode, in the current VVC standard, by independently (or separately) referring to the length conditions of the horizontal direction and the vertical direction, the DST-7 is applied instead of the DCT-2 without performing the 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 the ISP mode, and when the LFNST can be applied, the following transform combination can be configured as described below.

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

[0301] 2. For the case of LFNST index greater than 0, the following two configurations can be possible for the primary transform.

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

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

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

[0305] Hereinafter, an embodiment in which LFNST is applied only to the luminance component in a single tree is described.

[0306] Hereinafter, a coding unit syntax table related to signaling of LFNST index and MTS index according to an example is shown.

[0307] [Table 3]

[0308]

[0309] The meanings of the main variables in the above table are as follows.

[0310] 1. cbWidth, cbHeight: width and height of the current coding block

[0311] 2. log2TbWidth, log2TbHeight: Log base 2 of the width and height of the current transform block. By applying a zero-out, the size of the current transform block can be reduced to the top-left region where non-zero coefficients can exist.

[0312] 3. sps_lfnst_enabled_flag: Flag indicating whether LFNST is enabled. A value of the flag equal to 0 indicates that LFNST is not enabled, while a value of the flag equal to 1 indicates that LFNST is enabled. The flag is defined in the sequence parameter set (SPS).

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

[0314] 5. IntraSubPartitionsSplitType: Indicates which ISP is applied to the current coding unit, and ISP_NO_SPLIT indicates that the coding unit is not split into sub-blocks.

[0315] 6. intra_mip_flag[x0][y0]: Position (x0, y0) is as described in 4 above. intra_mip_flag is a flag indicating whether a matrix-based intra prediction (MIP) mode is applied. A value of the flag equal to 0 indicates that MIP is not applicable, while a value of the flag equal to 1 indicates that MIP is applied.

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

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

[0318] 9. lfnst_idx[x0][y0]: LFNST index syntax element to be parsed. If not parsed, the element is inferred to have a value of 0. That is, the default value is set to 0, which indicates that LFNST is not applied.

[0319] The descriptions of the foregoing syntax elements can be applied to the syntax elements shown in the following table.

[0320] In Table 3, transform_skip_flag[x0][y0][0] == 0 is one condition for determining whether to signal the lfnst index with respect to the luma component depending on whether the transform is skipped.

[0321] According to examples, therefore, the following coding unit syntax table is proposed in order to remove the dependency between the signaling of the transform skip flag for the luma component and the signaling of the LFNST index for the chroma components.

[0322] [Table 4]

[0323]

[0324] In the embodiment shown in Table 4, the signaling of the LFNST index for the luma component depends only on the transform skip flag for the luma component for both the dual tree type and the single tree partition mode. In the dual tree mode, the LFNST index for the chroma components can be signaled depending only on the transform skip flag for the chroma components. In the single tree partition mode, the LFNST is not applied to the chroma components in order to reduce the worst case latency.

[0325] The variable LfnstTransformNotSkipFlag shown in Table 4 is set depending on the tree type of the current block and the transform skip flag value for the color component, and the LFNST index can be signaled only when the value of the variable is 1.

[0326] When the tree type is not dual tree chroma (treeType!= DUAL_TREE_CHROMA), i.e. when the tree type is single tree or dual tree luma, the variable LfnstTransformNotSkipFlag can be set to 1 if the transform skip flag value for the luma component is 0. skip_flag[x0][y0][0] == = treeType!= DUAL_TREE_CHROMA? 0: (transform_skip_flag[x0][y0][1] == 0 || transform_skip_flag[x0][y0][2] == 0)), and when the tree type is dual tree chroma, the variable LfnstTransformNotSkipFlag can be set to 1 if the transform skip flag value for the chroma component Cb (transform_skip_flag[x0][y0][1]) is 0 or the transform skip flag value for the chroma component Cr (transform_skip_flag[x0][y0][1]) is 0. (transform_skip_flag[x0][y0][1] == 0 || transform_skip_flag[x0][y0][2] == 0 transform_skip_flag[x0][y0][0] == 0: Figure 12 )).

[0327] In the present disclosure, the operator "x?y:z" indicates that x is y if x is true, otherwise x is z (the value of y is evaluated if x is true, otherwise the value of z is evaluated).

[0328] The specification text of the transform process of Table 4 is as follows.

[0329] [Table 5]

[0330]

[0331]

[0332] The variable LfnstZeroOutSigCoeffFlag in Table 3 is 0 if there is a significant coefficient at the zero-out position when LFNST is applied, otherwise 1. The variable LfnstZeroOutSigCoeffFlag can be set according to a plurality of conditions shown in Table 10 below.

[0333] The variable LfnstZeroOutSigCoeffFlag indicates whether there is a significant coefficient in the second region other than the top-left first region of the current block. The value of the variable is initially set to 1 and can change to 0 when there is a significant coefficient in the second region. The LFNST index can be parsed only when the initial setting value of the variable LfnstZeroOutSigCoeffFlag is maintained. When it is determined and derived whether the value of the variable LfnstZeroOutSigCoeffFlag is 1, LFNST can be applied to the luminance component or all chroma components of the current block, and thus the color index of the current block is not determined.

[0334] According to an example, the variable LfnstDcOnly in Table 3 is 1 when all the last significant coefficients of the transform block for which the corresponding coded block flag (CBF, 1 when there is at least one significant coefficient in the corresponding block, otherwise 0) is 1 are in the DC position (top-left position), otherwise 0. Specifically, the position of the last significant coefficient is checked with respect to one luminance transform block in dual tree luminance, and the position of the last significant coefficient is checked with respect to both the transform block of Cb and the transform block of Cr in dual tree chroma. In single tree, the position of the last significant coefficient can be checked with respect to the transform blocks of luminance, Cb, and Cr.

[0335] The syntax table of the coding unit for signaling the LFNST index according to another example is as follows.

[0336] [Table 6]

[0337]

[0338] In Table 6, the variable transform_skip_flag[ x0 ][ y0 ][ cldx ] indicates whether transform skip is applied to the coding block for a component indicated by cldx. cldx can have values 0, 1, and 2, where 0 indicates the luma component, and 1 and 2 indicate the Cb and Cr components, respectively. A value of 1 for transform_skip_flag[ x0 ][ y0 ][ cldx ] indicates that transform skip is applied, and 0 indicates that transform skip is not applied.

[0339] In Table 6, the variable LfnstNotSkipFlag can be set to 1 only when transform skip is not applied to all components (all coding blocks) forming the current coding unit, and can be set to 0 in other cases, and the LFNST index (lfnst_idx in Table 6) is signaled only when LfnstNotSkipFlag is 1.

[0340] When the current coding unit is coded in a single tree structure (when treeType is SINGLE_TREE in Table 6), all components include Y, Cb, and Cr, when the current coding unit is coded in a separate tree structure for luma (when treeType is DUAL_TREE_LUMA in Table 6), all components include only Y, and when the current coding unit is coded in a separate tree structure for chroma (when treeType is DUAL_TREE_CHROMA in Table 6), all components include Cb and Cr.

[0341] In other words, when even one of the components consisting of the current coding unit is coded by transform skip, the LFNST index is not signaled, and the value of the LFNST index is inferred to be 0. That is, LFNST is not applied.

[0342] In the structure where LFNST is not applied when even one of the components (Y, Cb, and Cr) is coded by transform skip as in Table 6, when multiple components (Y, Cb, and Cr) are sequentially coded as in a single tree and it is determined during parsing that the components are subject to transform skip (for example, when transform skip is determined for Cb and Cr), the corresponding transform coefficients can be configured not to be additionally buffered with respect to the corresponding components coded by transform skip until the value of the LFNST index is parsed.

[0343] For example, when it is found that any one component is coded by transform skip, it is determined that LFNST is not applied, and thus inverse quantization, inverse transform, etc. can be immediately performed thereafter.

[0344] Instead of Table 6, the syntax table can be described concisely as in Table 7.

[0345] [Table 7]

[0346]

[0347] When determining whether to signal the LFNST index by checking only whether transform skip is applied to the luma component in the single tree, the syntax table for the coding unit can be configured as follows.

[0348] [Table 8]

[0349]

[0350] In Table 8, LfnstNotSkipFlag is determined to be the same as in Table 6 or Table 7 in the separate tree (i.e., in the luma separate tree, LfnstNotSkipFlag is set to 1 when transform skip is not applied to the luma component, and otherwise is set to 0, while in the chroma separate tree, LfnstNotSkipFlag is set to 1 when transform skip is not applied to both the Cb component and the Cr component, and otherwise is set to 0). In the single tree, LfnstNotSkipFlag is set to 1 when no transform skip is applied to the luma component only, and otherwise is set to 0. Instead of Table 8, the syntax table shown in Table 9 can be applied.

[0351] [Table 9]

[0352]

[0353] Embodiments of determining LFNST index signaling conditions when LFNST is applied to the luma component only in the single tree are described below.

[0354] In the coding unit syntax tables of Table 3 and Table 4, Table 6, Table 7, Table 8, and Table 9, the variable LfnstDcOnly and the variable LfnstZeroOutSigCoeffFlag are used as conditions for signaling the LFNST index. Basically, both the variable LfnstDcOnly and the variable LfnstZeroOutSigCoeffFlag are initialized to 1 as shown in Table 6, and the values of these two variables can be updated to 0 in the syntax table for residual coding as shown in Table 10. For reference, when a component (which can be Y, Cb, or Cr) is coded with transform skip, a different syntax table (transform_ts_coding) is imported instead of the residual coding in Table 10, so the variable LfnstDcOnly and the variable LfnstZeroOutSigCoeffFlag are not updated when parsing the LFNST index for the component.

[0355] [Table 10]

[0356]

[0357]

[0358] In Table 10, lastSubBlock indicates the position of a subblock (coefficient group (CG)) in which the last significant (non-zero) coefficient is located in the scan order. 0 indicates a subblock including the DC component, and a value larger than 0 indicates a subblock not including the DC component.

[0359] lastScanPos indicates the position of the last significant coefficient within one subblock in the scan order. When one subblock includes 16 positions, values from 0 to 15 are possible.

[0360] LastSignificantCoeffX and LastSignificantCoeffY indicate the x-coordinate and y-coordinate of the last significant coefficient located in the transform block. The x-coordinate starts from 0 and increases from left to right, and the y-coordinate starts from 0 and increases from top to bottom. A value of 0 for both variables means that the last significant coefficient is located at the DC.

[0361] Basically, Table 10 is applied to the embodiment of Table 4 to determine the value of the variable LfnstDcOnly and the variable LfnstZeroOutSigCoeffFlag. When Table 10 is applied and the current coding block is coded by single tree, the residual coding presented in Table 10 can be imported for all components. For example, when all Y, Cb and Cr components are coded without using transform skip, the residual coding can be performed for each component.

[0362] Therefore, when Table 10 is applied and the current coding block is coded by single tree, if the last non-zero coefficient of even one component is located at a position other than the DC position (the top-left position of the transform block), the value of the variable LfnstDcOnly can be updated to 0, and if the position of the last non-zero coefficient of even one component is located in a region in which a transform coefficient cannot be located in the case of applying LFNST (i.e., located in a region other than the first to eighth positions in a 4x4 transform block or an 8x8 transform block according to the forward transform coefficient scan order, or located in a region other than the top-left 4x4 region in a transform block to which LFNST is applied in the current VVC standard), the value of the variable LfnstZeroOutSigCoeffFlag can be updated to 0. As shown in the coding unit syntax tables of Table 4, Table 6, Table 7, Table 8 and Table 9, the LFNST index can be signaled only when the value of the variable LfnstZeroOutSigCoeffFlag is 1, and in the modes other than the ISP mode, the LFNST index can be signaled only when the value of the variable LfnstDcOnly is 0.

[0363] However, when LFNST is applied only to the luma component in a single tree, the update of the variable LfnstDcOnly and the variable LfnstZeroOutSigCoeffFlag can not be allowed when performing residual coding on a component to which LFNST is not applied (chroma component Cb or Cr). This is because the arrangement or distribution of transform coefficients of a component to which LFNST is not applied is logically inappropriate to determine whether to signal the LFNST index (i.e., whether to apply LFNST).

[0364] Table 11 restricts the update of the variable LfnstDcOnly and the variable LfnstZeroOutSigCoeffFlag only for the luma component in a single tree. In the case other than a single tree, the variable LfnstDcOnly and the variable LfnstZeroOutSigCoeffFlag can be updated for all components (as shown in Table 10).

[0365] [Table 11]

[0366]

[0367]

[0368] In the residual coding presented in Table 11, since treeType is added as a parameter compared to Table 10, the syntax table for a transform unit can be modified as shown in Table 12.

[0369] [Table 12]

[0370]

[0371] Based on the details of Table 4, some details can be replaced with the embodiments of Tables 6 to 9, or the details of Table 10 or Table 11 can be applied. The following possible combinations can be configured based on Tables 6 to 9, Table 10, or Table 11.

[0372] 1. Table 6 (or Table 7) + Table 10

[0373] 2. Table 6 (or Table 7) + Table 11

[0374] 3. Table 8 (or Table 9) + Table 10

[0375] 4. Table 8 (or Table 9) + Table 11

[0376] Hereinafter, a method for applying a scaling list to a chroma component when LFNST is applied only to a luma component in a single tree is described.

[0377] Currently, in the VVC WD, a syntax element called scaling_matrix_for_lfnst_disabled_flag is defined. When scaling_matrix_for_lfnst_disabled_flag is 1, a scaling list is not applied when LFNST is applied, and when scaling_matrix_for_lfnst_disabled_flag is 0, a scaling list can be applied when LFNST is applied.

[0378] Here, the scaling list is a matrix for specifying a specific weight (weighting value) for each transform coefficient position in the transform block, and dequantization or quantization is implemented by multiplying the weight for each transform coefficient, thereby enabling differential dequantization or quantization to be applied according to the importance of the transform coefficient.

[0379] In the single tree, as in the embodiment of Table 4, LFNST can be applied only to the luminance component, and when the value of scaling_matrix_for_lfnst_disabled_flag is 1 and LFNST is applied while the current block is coded in the single tree, a scaling list is not applied to the luminance component. Here, the scaling list can be applied to the chrominance components to which LFNST is not applied.

[0380] Table 13 shows an example of a dequantization process (scaling process) that implements the above-described case.

[0381] [Table 13]

[0382]

[0383]

[0384]

[0385]

[0386] In Table 13, treeType indicates the tree type of the coding unit to which the transform block currently being processed belongs, and SINGLE_TREE, DUAL_TREE_LUMA, and DUAL_TREE_CHROMA indicate a single tree, a separate tree for luminance, and a separate tree for chrominance (dual tree chroma), respectively.

[0387] In this embodiment, since LFNST can be applied only to the luminance component in the single tree, when the value of scaling_matrix_for_lfnst_disabled_flag is 1 and LFNST is applied (lfnst_idx[xTby][yTby] value is greater than 0), the scaling list is not applied to the luminance component (when the value of cIdx is 0).

[0388] However, for the chrominance components (when the value of cIdx is greater than 0), it can be determined whether to apply the scaling list by further checking different conditions (e.g., checking transform_skip_flag[xTby][yTby][cIdx]).

[0389] In the separate tree, as in the case of the luminance component in the single tree, when the value of scaling_matrix_for_lfnst_disabled_flag is 1 and LFNST is applied (lfnst_idx[xTby][yTby] value is greater than 0), the scaling list is not applied to the luminance and chrominance components.

[0390] Further, in the separate tree, as in the case of the chrominance component in the single tree, it can be determined whether to apply the scaling list by further checking different conditions (e.g., checking transform_skip_flag[xTby][yTby][cIdx]).

[0391] Therefore, when the value of scaling_matrix_for_lfnst_disabled_flag is 1 and LFNST can be applied only to the luminance component in the single tree, the scaling list can not be applied to the luminance component and can be applied to the chrominance component.

[0392] According to an example, a combination of Table 13 and the above-described embodiments can be applied (some details are replaced with the embodiments of Tables 6 to 9 or a combination of the details of Table 10 or Table 11 based on the details of Table 4).

[0393] In this case, as in the specification text of "Transform process for scaling transform coefficients" in Table 5, LFNST can be configured to be applied only to the luminance component in the single tree.

[0394] The following drawings are provided to describe specific examples of the present disclosure. Since specific terms for apparatuses 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.

[0395] Figure 12 is a flowchart illustrating the operation of a video decoding apparatus according to an embodiment of the present disclosure.

[0396] Figures 1 to 11 Each of the processes disclosed in the Figures 1 to 11 description will be based on some details of the reference Figure 13 description. Therefore, the description overlapping with the specific details of the reference

[0397] The decoding device 300 according to an embodiment can receive flag information indicating whether a scaling list is available when LFNST is performed, an LFNST index for a current block, and residual information from a bitstream (S1210).

[0398] Specifically, the decoding device 300 can decode information about quantized transform coefficients for a current block from a bitstream, and can derive quantized transform coefficients for a 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 can be included in a sequence parameter set (SPS) or a slice header, and can include at least one of 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 information about a transform index indicating any one of transform kernel matrices included in a transform set.

[0399] The decoding device can further receive information about an intra prediction mode for a current block and information about whether ISP is applied to the current block. The decoding device can receive and parse flag information indicating whether ISP coding or an 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 can be a coding block. In addition, the decoding device can derive the size and the number of the sub-partition blocks by flag information indicating a direction in which the current block is divided.

[0400] The LFNST index is a value for specifying an LFNST matrix when LFNST is applied as an inverse secondary non-separable transform and can have a value ranging from 0 to 2. For example, an LFNST index value of 0 can indicate that LFNST is not applied to a current block, an LFNST index value of 1 can indicate a first LFNST matrix, and an LFNST index value of 2 can indicate a second LFNST matrix.

[0401] Information about ISP and an LFNST index can be received at a coding unit level.

[0402] The flag information indicating whether a scaling list is available when LFNST is performed, received by the decoding device, can be represented by scaling_matrix_for_lfnst_disabled_flag or sps_scaling_matrix_for_lfnst_disabled_flag, and can be signaled in a sequence parameter set. The flag value equal to 1 indicates that a scaling list is not applied when LFNST is applied, and the flag value equal to 0 indicates that a scaling list is applied when LFNST is applied. The scaling list is a matrix for specifying a specific weight (weighting value) of each transform coefficient position in a transform block, and enables differential dequantization or quantization to be applied according to the importance of the transform coefficient by multiplying the weight of each transform coefficient, thereby enabling differential dequantization or quantization to be applied according to the importance of the transform coefficient.

[0403] The decoding device 200 can determine whether to apply a scaling list to the current block in order to dequantize transform coefficients of the current block based on the flag information, the LFNST index, and the tree type of the current block (S1220).

[0404] When the tree type of the current block is single tree, the color components of the current block can include a luma component, a first chroma component indicating chroma Cb, and a second chroma component indicating chroma Cr, and when the tree type of the current block is dual tree luma, the current block can include a luma component. When the tree type of the current block is dual tree chroma, the color components of the current block can include the first chroma component and the second chroma component.

[0405] Here, the current block can be a transform block, which is a transform unit, and when the tree type of the current block is single tree, the current block can 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 can include a transform block for a luma component, and when the tree type of the current block is dual tree chroma, the current block can include a transform block for a first chroma component and a transform block for a second chroma component.

[0406] According to an example, when the type of the current block is single tree, LFNST can be applied only to a luma component, and when the current block is coded in single tree, the value of scaling_matrix_for_lfnst_disabled_flag is 1, and LFNST is applied, a scaling list is not applied to the luma component. However, the scaling list can be applied to chroma components to which LFNST is not applied.

[0407] In summary, in a case where the flag information on the scaling list indicates that the scaling list is not available and the LFNST index is greater than 0 (i.e., the LFNST is applied), the scaling list can not be applied when the tree type of the current block is single tree and the current block is a luma component, and the scaling list can be applied when the tree type of the current block is single tree and the current block is a chroma component.

[0408] According to an example, in a case where the flag information on the scaling list indicates that the scaling list is not available and the LFNST index is greater than 0, the LFNST is applied to the current block when the tree type of the current block is dual tree chroma, whereby the scaling list is not applied to the chroma component.

[0409] According to an example, in a case where the flag information on the scaling list indicates that the scaling list is not available and the LFNST index is greater than 0, the LFNST is applied to the current block when the tree type of the current block is dual tree luma, whereby the scaling list is not applied to the luma component.

[0410] Subsequently, the decoding device derives transform coefficients for the current block from the residual information based on the determination result (S1230).

[0411] The derived transform coefficients can be arranged in 4x4 block units according to a reflection diagonal scan order, and the transform coefficients in the 4x4 block can also be arranged according to a reverse diagonal scan order. That is, the dequantized transform coefficients can be arranged according to a reverse scan order applied in a video codec, such as in VVC or HEVC.

[0412] The decoding device can derive modified transform coefficients from the transform coefficients based on the LFNST index and an LFNST matrix for the LFNST (i.e., by applying the LFNST) (S1240).

[0413] The LFNST is a non-separable transform in which a transform is applied to coefficients without separating the coefficients in a particular direction, which is different from a primary transform that separates coefficients to be transformed in a vertical or horizontal direction and transforms them. The non-separable transform can be a low-frequency non-separable transform that applies a forward transform only to a low-frequency region, rather than the entire region of a block.

[0414] The decoding device can derive various variables to apply the LFNST, and can determine whether to apply the LFNST based on the tree type and the size of the current block.

[0415] The decoding device can derive a first variable (variable LfnstDcOnly) indicating whether there is a valid coefficient at a position other than a DC component in the current block, and a second variable (variable LfnstZeroOutSigCoeffFlag) indicating whether there is a transform coefficient in a second region other than a top-left first region of the current block.

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

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

[0418] For luma components to which an intra sub-partition (ISP) mode is applicable, the LFNST index can be parsed without deriving the variable LfnstDcOnly.

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

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

[0421] The second variable can be a variable LfnstZeroOutSigCoeffFlag, which can indicate that zero-out is performed when LFNST is applied. The second variable can be initially set to 1 and can be changed to 0 when a significant coefficient exists in the second region.

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

[0423] That is, the variable LfnstZeroOutSigCoeffFlag is set to 0 when a non-zero coefficient is derived in a region other than the top-left region in which the LFNST transform coefficient can exist in the transform block, or a non-zero coefficient exists at a position other than the eighth position of the scan order for a 4x4 block or an 8x8 block.

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

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

[0426] As described above, the transform set can be determined according to the intra prediction mode for the transform block to be transformed, and the inverse LFNST can be performed based on the transform kernel matrix included in the transform set indicated by the LFNST index, that is, any one of the LFNST matrices. The matrix applied to the inverse LFNST can be referred to as an inverse LFNST matrix or an LFNST matrix, and referred to as any term as long as the matrix is the transpose of the matrix for the forward LFNST.

[0427] In an example, the inverse LFNST matrix can be a non-square matrix in which the number of columns is less than the number of rows.

[0428] The decoding device can derive the residual samples for the current block based on the primary inverse transform for the modified transform coefficient (S1250).

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

[0430] Subsequently, the decoding apparatus 200 can generate reconstructed samples based on the residual samples for the current block and the prediction samples for the current block.

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

[0432] Figure 13 is a flowchart illustrating an operation of a video encoding apparatus according to an embodiment of the present disclosure.

[0433] Figures 4 to 11 Each process disclosed in the Figure 2 description is based on the Figures 4 to 11 and Figure 14 description described above. Therefore, the description overlapping with the specific details of the

[0434] The encoding apparatus 100 according to an embodiment can derive prediction samples for the current block based on an intra prediction mode applied to the current block.

[0435] When the ISP is applied to the current block, the encoding apparatus can perform prediction per sub-partitioned transform block.

[0436] The encoding apparatus can determine whether to apply the ISP compilation or the ISP mode to the current block (i.e., the compilation block), and can determine a direction in which the current block is partitioned, and can derive the size and the number of partitioned sub-blocks according to the determination result.

[0437] The same intra prediction mode can be applied to the sub-partitioned transform blocks into which the current block is partitioned, and the encoding apparatus can derive prediction samples for each of the sub-partitioned transform blocks. That is, the encoding apparatus sequentially performs intra prediction according to the partitioning form of the sub-partitioned transform blocks, e.g., horizontal or vertical, or from left to right or from top to bottom. For the leftmost or the topmost sub-block, the reconstructed pixels of the compilation block that has been compiled are referred to as in the conventional intra prediction method. In addition, for each side of a subsequent internal sub-partitioned transform block that is not adjacent to the previous sub-partitioned transform block, in order to derive the reference pixels adjacent to the side, the reconstructed pixels of the adjacent compilation block that has been compiled are referred to as in the conventional intra prediction method.

[0438] The encoding apparatus 100 can derive residual samples for the current block based on the prediction samples (S1310).

[0439] The encoding apparatus 100 can derive transform coefficients for the current block by applying at least one of LFNST or MTS to the residual samples, and can arrange the transform coefficients according to a predetermined scan order.

[0440] The encoding apparatus can derive transform coefficients for the current block based on a transform process (such as a primary transform and / or a secondary transform) on the residual samples (S1320).

[0441] The primary transform can be performed by a plurality of transform kernels as in MTS, in which case the transform kernel can be selected based on an intra prediction mode.

[0442] The encoding apparatus 100 can determine whether to perform a secondary transform or a non-separable transform (specifically, LFNST) on the transform coefficients for the current block, and can derive modified transform coefficients by applying LFNST to the transform coefficients.

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

[0444] The encoding apparatus can derive various variables to apply LFNST, and can determine whether to apply LFNST based on a tree type and a size of the current block.

[0445] The encoding apparatus can derive a first variable (variable LfnstDcOnly) indicating whether there is a significant coefficient at a position other than a position of a DC component in the current block and a second variable (variable LfnstZeroOutSigCoeffFlag) indicating whether there is a transform coefficient in a second region outside a top-left first region of the current block.

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

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

[0448] For a luma component to which an intra sub-partition (ISP) mode is applicable, LFNST can be applied without deriving the variable LfnstDcOnly.

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

[0450] However, for the chroma components to which the ISP mode is not applied, the value of the variable LfnstDcOnly can be set to 0 according to the value of the transform skip flag for the chroma component Cb (transform_skip_flag[x0][y0][1]) and the value of the transform skip flag for the chroma component Cr (transform_skip_flag[x0][y0][2]). That is, when the value of cIdx in transform_skip_flag[x0][y0][cIdx] is 1, the value of the variable LfnstDcOnly can be set to 0 only when the value of transform_skip_flag[x0][y0][1] is 0, and when the value of cIdx is 2, the value of the variable LfnstDcOnly can 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 can apply LFNST, and otherwise, the encoding device can not apply LFNST.

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

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

[0453] That is, the variable LfnstZeroOutSigCoeffFlag is set to 0 when a non-zero coefficient is derived in a region other than the top-left region in which an LFNST transform coefficient can exist in the transform block, or a non-zero coefficient exists at a position other than the eighth position of the scan order for a 4x4 block or an 8x8 block.

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

[0455] Here, the same LFNST set and the same LFNST index can be applied to the sub-partitioned transform blocks into which the current block is divided. That is, since the same intra prediction mode is applied to the sub-partitioned transform blocks, the LFNST set determined based on the intra prediction mode can also be equally applied to all the sub-partitioned transform blocks. In addition, since the LFNST index is signaled at the coding unit level, the same LFNST matrix can be applied to the sub-partitioned transform blocks into which the current block is divided.

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

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

[0458] The encoding apparatus can determine whether to apply the scaling list to the current block based on whether the LFNST is performed in the transform process and the tree type of the current block, to quantize the transform coefficients based on the scaling list (S1330).

[0459] The scaling list is a matrix for specifying a specific weight (weighting value) for each transform coefficient position in the transform block, and dequantization or quantization is achieved by multiplying the weight for each transform coefficient, thereby enabling to apply differential dequantization or quantization according to the importance of the transform coefficient.

[0460] According to an example, the encoding apparatus can not apply the scaling list when the tree type of the current block is single tree and the current block is a luma component, and can apply the scaling list when the tree type of the current block is single tree and the current block is a chroma component.

[0461] When the tree type of the current block is single tree, the color components of the current block can include a luma component, a first chroma component indicating a chroma Cb, and a second chroma component indicating a chroma Cr, and when the tree type of the current block is dual tree luma, the current block can include a luma component. When the tree type of the current block is dual tree chroma, the color components of the current block can include the first chroma component and the second chroma component.

[0462] Here, the current block can be a transform block, which is a transform unit, and when the tree type of the current block is single tree, the current block can 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 can include a transform block for a luma component, and when the tree type of the current block is dual tree chroma, the current block can include a transform block for a first chroma component and a transform block for a second chroma component.

[0463] According to an example, when the current block is single tree, the encoding apparatus can apply the LFNST only to the luma component, and when the LFNST is applied, the encoding apparatus does not apply the scaling list to the luma component. However, the encoding apparatus can apply the scaling list to the chroma component to which the LFNST is not applied.

[0464] In summary, in the case where the LFNST index is greater than 0 (i.e., the LFNST is applied), when the tree type of the current block is single tree and the current block is a luma component, the encoding apparatus can not apply the scaling list, and when the tree type of the current block is single tree and the current block is a chroma component, the encoding apparatus can apply the scaling list.

[0465] According to an example, when the LFNST index is greater than 0, when the tree type of the current block is dual tree chroma, the LFNST is applied to the current block, whereby the encoding apparatus does not apply the scaling list.

[0466] According to an example, when the LFNST index is greater than 0, when the tree type of the current block is dual tree luma, the LFNST is applied to the current block, whereby the encoding apparatus does not apply the scaling list.

[0467] The encoding apparatus can quantize the transform coefficients based on the determination (i.e., whether to apply the scaling list to the current block) (S1340).

[0468] That is, the encoding apparatus can quantize the transform coefficients for the transform block to which the LFNST is not applied using the scaling list, and can quantize the transform coefficients for the transform block to which the LFNST is applied without using the scaling list.

[0469] The encoding apparatus can encode and output the residual information and flag information indicating whether the scaling list is available when the LFNST is performed (S1350).

[0470] The flag information indicating whether the scaling list is available when LFNST is performed can be represented by scaling_matrix_for_lfnst_disabled_flag or sps_scaling_matrix_for_lfnst_disabled_flag, and can be signaled in a sequence parameter set. The flag value equal to 1 indicates that the scaling list is not applied when LFNST is applied, and the flag value equal to 0 indicates that the scaling list is applied when LFNST is applied.

[0471] When the LFNST index is greater than 0 and the current block is single tree, LFNST is applied to the luma component, whereby the encoding device can encode the value of the flag as 1.

[0472] However, when the LFNST index is greater than 0 and the current block is single tree, LFNST is not applied to the chroma component, whereby the encoding device can construct the picture information so that the scaling list can be applied.

[0473] When the LFNST index is greater than 0 and the tree type of the current block is dual tree chroma, LFNST is applied to the current block, whereby the encoding device can encode the value of the flag as 1 so that the scaling list is not applied to the chroma component.

[0474] 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 applied to the current block, whereby the encoding device can encode the value of the flag as 1 so that the scaling list is not applied to the luma component.

[0475] The encoding device can derive quantized transform coefficients by quantizing the modified transform coefficients for the current block, and can encode the LFNST index.

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

[0477] More specifically, the encoding device 100 can generate information about the quantized transform coefficients and encode the information about the generated quantized transform coefficients.

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

[0479] According to an embodiment, when the partition tree structure of the current block is a dual tree type, the LFNST index can be encoded for each of the luma block and the chroma block.

[0480] According to an embodiment, the syntax element value of the transform index can be derived as 0, 1, and 2, 0 indicating a case where no (inverse) LFNST is applied to the current block, 1 indicating a first LFNST matrix among the LFNST matrices, and 2 indicating a second LFNST matrix among the LFNST matrices.

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

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

[0483] In the above-described embodiments, the method is explained based on the flowchart by means of a series of steps or blocks, but the disclosure is not limited to the order of the steps, and a certain step can be performed in a different order or step from the above-described order or step, or concurrently with other steps. In addition, it can be understood by one of ordinary skill in the art that the steps shown in the flowchart are not exclusive, and one or more steps in the flowchart can be incorporated or deleted without affecting the scope of the disclosure.

[0484] The above-described method according to the disclosure can be implemented in the form of software, and an encoding apparatus and / or a decoding apparatus according to the disclosure can be included in an apparatus for image processing such as a television, a computer, a smart phone, a set-top box, and a display device.

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

[0486] In addition, the decoding apparatus and the encoding apparatus according to the disclosure can 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 camcorder, a video-on-demand (VoD) service providing device, an over-the-top (OTT) video device, an Internet streaming service providing device, a three-dimensional (3D) video device, a video phone video device, and a medical video device, and can be used to process a video signal or a data signal. For example, the over-the-top (OTT) video device can 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.

[0487] In addition, the processing method according to the disclosure can be produced in the form of a program executed by a computer, and can be stored in a computer-readable storage medium. Multimedia data having a data structure according to the disclosure can also be stored in a computer-readable storage medium. The computer-readable storage medium includes various storage devices and distributed storage devices that store computer-readable data. The computer-readable storage medium can include, for example, a Blu-ray disc (BD), a universal serial bus (USB), a ROM, a PROM, an EPROM, an EEPROM, a RAM, a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device. In addition, the computer-readable storage medium includes a medium implemented in the form of a carrier wave (for example, transmission over the Internet). In addition, the bitstream generated by the encoding method can be stored in a computer-readable storage medium or transmitted through a wired or wireless communication network. In addition, the embodiments of the disclosure can be implemented as a computer program product by program codes, and the program codes can be executed on a computer according to the embodiments of the disclosure. The program codes can be stored on a computer-readable carrier.

[0488] Figure 14An example of a video / image encoding system to which the present disclosure is applicable is schematically illustrated.

[0489] Referring to Figure 15 The video / image encoding system can include a first apparatus (a source apparatus) and a second apparatus (a sink apparatus). The source apparatus can deliver encoded video / image information or data in the form of a file or a stream to the sink apparatus via a digital storage medium or a network.

[0490] The source apparatus can include a video source, an encoding device, and a transmitter. The sink apparatus can include a receiver, a decoding device, and a Tenderer. The encoding device can be referred to as a video / image encoding device, and the decoding device can be referred to as a video / image decoding device. The transmitter can be included in the encoding device. The receiver can be included in the decoding device. The Tenderer can include a display, and the display can be configured as a separate apparatus or an external component.

[0491] The video source can obtain a video / image through a process of capturing, synthesizing, or generating a video / image. The video source can include a video / image capturing apparatus and / or a video / image generating apparatus. The video / image capturing apparatus can include, for example, one or more cameras, a video / image archive including previously captured video / images, or the like. The video / image generating apparatus can include, for example, a computer, a tablet, and a smartphone, and can (electronically) generate a video / image. For example, a virtual video / image can be generated through a computer or the like. In this case, the video / image capturing process can be replaced by a process of generating related data.

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

[0493] The transmitter can transmit the encoded video / image information or data output in the form of a bitstream to the receiver of the sink apparatus in the form of a file or a stream through a digital storage medium or a network. The digital storage medium can include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, or the like. The transmitter can include an element for generating a media file through a predetermined file format, and can include an element for transmission through a broadcasting / communication network. The receiver can receive / extract a bitstream, and transmit the received / extracted bitstream to the decoding device.

[0494] The decoding device can decode a video / image by performing a series of processes such as dequantization, inverse transform, prediction, or the like, which correspond to the operations of the encoding device.

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

[0496] ​ The structure of a content streaming system to which the disclosure is applied is illustrated.

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

[0498] The encoding server serves to compress 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 transmit it to the 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 an encoding method or a bitstream generation method of the disclosure. And the streaming server can temporarily store the bitstream during a process of transmitting or receiving the bitstream.

[0499] The streaming server transmits multimedia data to a user device through a web server based on a request of a user, and the web server serves as a tool to inform the user of what services exist. When the user requests a service that the user wants, the web server transmits the request to the streaming server, and the streaming server transmits multimedia data to the user. In this regard, the content streaming system can include a separate control server, and in this case, the control server serves to control commands / responses between respective devices in the content streaming system.

[0500] The streaming server can receive content from the media storage and / or the encoding server. For example, in the case of receiving content from the 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 a bitstream for a predetermined time.

[0501] For example, the user device can include a mobile phone, a smart phone, a laptop computer, a digital broadcasting terminal, a personal digital assistant (PDA), a portable multimedia player (PMP), a navigation, a board PC, a tablet PC, an ultrabook, a wearable device (for example, 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. The respective servers in the content streaming system can operate as a distributed server, and in this case, data received by the respective servers can be processed in a distributed manner.

[0502] The claims disclosed herein can be combined in various ways. For example, the technical features of the method claims of the disclosure can be combined to be implemented or performed in an apparatus, and the technical features of the apparatus claims can be combined to be implemented or performed in a method. Also, the technical features of the method claims and the technical features of the apparatus claims can be combined to be implemented or performed in an apparatus, and the technical features of the method claims and the technical features of the apparatus claims can be combined to be implemented or performed in a method.

Claims

1. An image decoding method performed by a decoding device, comprising: receiving flag information on whether a scaling list is available for a block to which a low-frequency non-separable transform (LFNST) is applied, an LFNST index for a current block, and residual information; based on the flag information, the LFNST index, and a tree type of the current block, determining whether the scaling list is applied to the current block; based on the determination, deriving transform coefficients for the current block from the residual information; and deriving residual samples based on inverse transform for the transform coefficients, wherein a width and a height of the current block are greater than 4, wherein based on the tree type of the current block being single tree and a color component of the current block being a luma component, the scaling list is not applied to the luma component of the current block, wherein based on the flag information indicating that the scaling list is not available, the LFNST index being greater than 0, the tree type of the current block being single tree, and the color component of the current block being a chroma component, the scaling list is applied to the chroma component of the current block, and wherein based on the tree type of the current block being dual tree chroma and the LFNST index being greater than 0, the scaling list is not applied to the chroma component of the current block.

2. The image decoding method of claim 1, wherein, based on the tree type of the current block being single tree and the color component of the current block being a chroma component, the LFNST is not applied to the chroma component of the current block.

3. The image decoding method of claim 1, wherein, based on the flag information indicating that the scaling list is not available, the LFNST index being greater than 0, and the tree type of the current block being single tree, the scaling list is not applied to the luma component of the current block.

4. The image decoding method of claim 1, wherein, based on the flag information indicating that the scaling list is not available, the LFNST index being greater than 0, and the tree type of the current block being dual tree chroma, the scaling list is not applied to the chroma component of the current block.

5. The image decoding method of claim 1, wherein, based on the flag information indicating that the scaling list is not available, the LFNST index being greater than 0, and the tree type of the current block being dual tree luma, the scaling list is not applied to the luma component of the current block.

6. The image decoding method of claim 1, wherein, the current block comprises a transform block.

7. An image encoding method performed by an image encoding device, comprising: deriving prediction samples for a current block; based on the prediction samples, deriving residual samples for the current block; based on a transform process, deriving transform coefficients for the current block from the residual samples; and quantizing the transform coefficients based on whether a scaling list is applied to the current block, wherein a width and a height of the current block are greater than 4, wherein based on flag information on whether a scaling list is available for a block to which a low-frequency non-separable transform (LFNST) is applied, whether the LFNST is performed in the transform process, and a tree type of the current block, determining whether the scaling list is applied to the current block, wherein based on the tree type of the current block being single tree and a color component of the current block being a luma component, the scaling list is not applied to the luma component of the current block, wherein, based on the flag information indicating that the scaling list is not available, the LFNST is performed on the current block, a tree type of the current block being single tree and a color component of the current block being a luma component, the scaling list is not applied to the luma component of the current block, and wherein, based on the flag information indicating that the scaling list is not available, the LFNST is performed on the current block, a tree type of the current block being single tree and a color component of the current block being a luma component, the scaling list is not applied to the luma component of the current block, and 8. The image coding method according to claim 7, wherein based on a tree type of the current block being single tree and a color component of the current block being the luma component, the LFNST is not performed on the luma component of the current block.

9. The image coding method of claim 7, wherein, based on a tree type of the current block being dual tree luma and the LFNST being performed on the current block, the scaling list is not applied to the luma component of the current block.

10. The image coding method of claim 7, wherein, the current block comprises a transform block.

11. A method for transmitting data for image information, comprising: obtaining a bitstream for the image information, wherein the bitstream is generated based on: deriving prediction samples for a current block, based on the prediction samples, deriving residual samples for the current block, based on a transform process, deriving transform coefficients for the current block from the residual samples, based on whether a scaling list is applied to the current block, quantizing the transform coefficients, and encoding residual information related to the quantized transform coefficients; and transmitting data comprising the bitstream, wherein a width and a height of the current block are greater than 4, wherein, based on flag information related to whether a block to which a low-frequency non-separable transform (LFNST) is applied is available, whether the LFNST is performed in the transform process and a tree type of the current block, it is determined whether the scaling list is applied to the current block, wherein, based on the tree type of the current block being single tree and the color component of the current block being a luma component, the scaling list is not applied to the luma component of the current block, wherein, based on the flag information indicating that the scaling list is not available, the LFNST is performed on the current block, a tree type of the current block being single tree and a color component of the current block being a luma component, the scaling list is not applied to the luma component of the current block, and wherein, based on the tree type of the current block being dual tree luma and the LFNST being performed on the current block, the scaling list is not applied to the luma component of the current block.