Transformation-based image compiling method and device
By adopting LFNST technology in image compilation, the modified transformation coefficients are derived, and the problem of low compression and transmission efficiency of high resolution and high-quality image/video data is solved, and more efficient image/video compression and compilation is achieved.
Patent Information
- Application Number
- CN202411359410.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2019-09-21
- Filing Date
- 2020-09-18
- Publication Date
- 2025-02-11
AI Technical Summary
The prior art is difficult to efficiently compress and transmit or store high-resolution and high-quality image/video data, especially when meeting the needs of applications such as ultra-high definition, virtual reality and holograms.
The image compilation method based on LFNST is adopted to improve image compilation efficiency by deriving the modified transformation coefficients, especially the application of LFNST in sub-partition transformation blocks to improve the efficiency of transform index compilation.
Improves overall image/video compression efficiency, enhances the efficiency of transform index compilation, and supports the use of LFNST in image compilation, suitable for storage and transmission of high resolution and high quality images/videos.
Smart Images

Figure CN119420947A_ABST
Abstract
Description
[0001] This application is a divisional application of a patent application with application number 202080077531.4 (PCT / KR2020 / 012665), which was submitted to the China Patent Office on May 7, 2022, with an international application date of September 18, 2020, and the invention name is “Transformation-based image coding method and device thereof”. Technical Field
[0002] The present disclosure relates to an image coding technology, and more particularly, to a method and a device for coding an image based on transformation in an image coding system. Background Art
[0003] Nowadays, the demand for high-resolution and high-quality images / videos such as 4K, 8K or higher ultra-high-definition (UHD) images / videos has been growing in various fields. As image / video data becomes higher resolution and higher quality, the amount of information or the amount of bits transmitted increases compared to conventional image data. Therefore, when image data is transmitted using a medium such as a conventional wired / wireless broadband line or when image / video data is stored using an existing storage medium, its transmission cost and storage cost increase.
[0004] In addition, nowadays, interest and demand for immersive media such as virtual reality (VR) and artificial reality (AR) content or holograms are increasing, and broadcasting of images / videos having image characteristics different from real images such as game images is increasing.
[0005] Therefore, there is a need for an efficient image / video compression technology that effectively compresses and transmits or stores and reproduces information of high-resolution and high-quality images / videos having various characteristics as described above. Summary of the invention
[0006] Technical Purpose
[0007] A technical aspect of the present disclosure is to provide a method and an apparatus for increasing image coding efficiency.
[0008] Another technical aspect of the present disclosure is to provide a method and apparatus for increasing the efficiency of transform index coding.
[0009] Yet another technical aspect of the present disclosure is to provide an image coding method and apparatus using LFNST.
[0010] Still another technical aspect of the present disclosure is to provide a method and apparatus for coding an image for applying LFNST to a sub-partitioned transform block.
[0011] Technical Solution
[0012] According to an embodiment of the present specification, provided herein is an image decoding method performed by a decoding device. The method may include deriving a modified transform coefficient, wherein the step of deriving the modified transform coefficient may include: determining whether LFNST is applicable to the height and width of a partitioned subpartition block when ISP is applied to a current block, parsing an LFNST index when LFNST is applicable, and deriving the modified transform coefficient based on the LFNST index and the LFNST matrix.
[0013] When the height and width of the sub-partition block are equal to 4 or greater, the LFNST index can be parsed.
[0014] If the tree type of the current block is dual-tree luma or single-tree, the LFNST index may be parsed when the height and width of the sub-partition block for the luma component block of the current block are equal to 4 or more.
[0015] Whether LFNST is applicable to the height and width of the current block may be determined based on the tree type and color format of the current block.
[0016] If ISP is not applied to the current block and the tree type of the current block is dual-tree chroma, the LFNST index may be parsed when the height and width corresponding to the chroma component blocks of the current block are equal to 4 or more.
[0017] If ISP is not applied to the current block and the tree type of the current block is single-tree or dual-tree luma, the LFNST index may be parsed when the height and width corresponding to the luma component block of the current block are equal to 4 or more.
[0018] The current block is a coding unit, and when the width and height of the coding unit are equal to or less than the maximum luma transform size available for transform, the LFNST index may be resolved.
[0019] According to an embodiment of the present specification, provided herein is an image encoding method performed by an encoding device. The method may include deriving a modified transform coefficient, wherein the step of deriving the modified transform coefficient may include: determining whether LFNST is applicable to the height and width of the sub-partition block of the partition when ISP is applied to the current block, and in this article, when LFNST is applicable, the LFNST index may be encoded.
[0020] According to still another embodiment of the present disclosure, a digital storage medium storing image data including a bit stream generated according to an image encoding method performed by an encoding device and encoded image information may be provided.
[0021] According to yet another embodiment of the present disclosure, a digital storage medium storing image data including encoded image information and a bit stream to enable a decoding device to perform an image decoding method may be provided.
[0022] Beneficial Effects
[0023] According to the present disclosure, the overall image / video compression efficiency can be increased.
[0024] According to the present disclosure, the efficiency of transform index compilation can be increased.
[0025] Technical aspects of the present disclosure may provide an image coding method and apparatus using LFNST.
[0026] Technical aspects of the present disclosure may provide a method and apparatus for coding an image for applying LFNST to a sub-partitioned transform block.
[0027] The effects that can be obtained by the specific examples of the present disclosure are not limited to the effects listed above. For example, there may be various technical effects that can be understood by a person of ordinary skill in the relevant field or derived from the present disclosure. Therefore, the specific effects of the present disclosure are not limited to those explicitly described in the present disclosure, and may include various effects that can be understood or derived from the technical features of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 is a diagram schematically illustrating a configuration of a video / image encoding device to which the present disclosure can be applied.
[0029] Figure 2 is a diagram schematically illustrating a configuration of a video / image decoding device to which the present disclosure can be applied.
[0030] Figure 3 Schematically illustrates multiple transformation schemes according to embodiments of this document.
[0031] Figure 4 The intra directional mode of 65 prediction directions is exemplarily illustrated.
[0032] Figure 5 is a diagram for explaining RST according to an embodiment of this document.
[0033] Figure 6 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.
[0034] Figure 7 is a diagram illustrating an order in which output data of a forward sub-transform is arranged into a two-dimensional vector according to an example.
[0035] Figure 8is a diagram illustrating a block shape to which LFNST is applied.
[0036] Fig. 9 is a diagram illustrating an arrangement of output data of a forward LFNST according to an embodiment.
[0037] Fig.10 is a diagram illustrating limiting the number of output data for the forward LFNST to a maximum value of 16 according to an example.
[0038] Fig.11 is a diagram illustrating zeroing in a block to which 4×4 LFNST is applied according to an example.
[0039] Fig.12 is a diagram illustrating clearing in a block to which 8×8 LFNST is applied according to an example.
[0040] Fig.13 is a diagram illustrating clearing in a block to which 8×8 LFNST is applied according to another example.
[0041] Fig.14 is a diagram illustrating an example of sub-blocks into which one coding block is divided.
[0042] Fig.15 is a diagram illustrating another example of sub-blocks into which one coding block is divided.
[0043] Fig.16 is a diagram illustrating symmetry between an Mx2 (Mx1) block and a 2xM (1xM) block according to an embodiment.
[0044] Fig.17 is a diagram illustrating an example of transposing a 2xM block according to an embodiment.
[0045] Fig.18 The scanning order of 8x2 or 2x8 areas according to an embodiment is illustrated.
[0046] Fig.19 is a flowchart illustrating a method of decoding an image according to an embodiment.
[0047] Fig. 20 is a flowchart illustrating a method of encoding an image according to an embodiment.
[0048] Fig.21 An example of a video / image coding system to which the present disclosure is applicable is schematically illustrated.
[0049] Fig. 22 is a diagram illustrating the structure of a content streaming system to which the present document is applied. DETAILED DESCRIPTION
[0050] Although the present disclosure may be susceptible to various modifications and includes various embodiments, its specific embodiments have been shown by way of example in the accompanying drawings, and will now be described in detail. However, this is not intended to limit the present disclosure to the specific embodiments disclosed herein. The terms used herein are only for the purpose of describing specific embodiments and are not intended to limit the technical ideas of the present disclosure. Unless the context clearly indicates otherwise, the singular form may include the plural form. Terms such as "including" and "having" are intended to indicate the presence of features, numbers, steps, operations, elements, components, or combinations thereof used in the following description, and therefore should not be understood as precluding the possibility of the presence or addition of one or more different features, numbers, steps, operations, elements, components, or combinations thereof.
[0051] At the same time, in order to facilitate the description of different characteristic functions, each component on the drawings described herein is independently illustrated, however, it is not intended that each component is implemented by separate hardware or software. For example, any two or more of these components can be combined to form a single component, and any single component can be divided into multiple components. Embodiments in which components are combined and / or divided will fall within the scope of the patent rights of the present disclosure as long as they do not depart from the essence of the present disclosure.
[0052] Hereinafter, preferred embodiments of the present disclosure will be described in more detail with reference to the accompanying drawings. In addition, in the accompanying drawings, the same reference numerals are used for the same components, and repeated description of the same components will be omitted.
[0053] This document relates to video / image coding. For example, the methods / examples disclosed in this document may relate to the VVC (Versatile Video Coding) standard (ITU-T Rec. H.266), the next generation video / image coding standard after VVC, or other video coding related standards (e.g., HEVC (High Efficiency Video Coding) standard (ITU-T Rec. H.265), EVC (Basic Video Coding) standard, AVS2 standard, etc.).
[0054] In this document, various embodiments related to video / image coding may be provided, and unless specified otherwise, these embodiments may be combined with each other and performed.
[0055] In this document, video can refer to a collection of a series of images over a period of time. Generally, a picture refers to a unit of an image representing a specific time region, and a slice / tile is a unit that constitutes a part of a picture. A slice / tile may include one or more coding tree units (CTUs). A picture may consist of one or more slices / tiles. A picture may consist of one or more tile groups. A tile group may include one or more tiles.
[0056] A pixel or picture element (pel) may refer to the smallest unit constituting a picture (or image). In addition, "sample" may be used as a term corresponding to a pixel. A sample may generally represent a pixel or a pixel value, and may represent only a pixel / pixel value of a luminance component or only a pixel / pixel value of a chrominance component. Alternatively, a sample may mean a pixel value in a spatial domain, or when the pixel value is transformed into a frequency domain, it may mean a transform coefficient in a frequency domain.
[0057] A unit may represent a basic unit of image processing. A unit may include at least one of a specific region and information related to the region. A unit may include a luminance block and two chrominance (e.g., cb, cr) blocks. Depending on the situation, terms such as unit, block, region, etc. may be used interchangeably. In general, an M×N block may include a set (or array) of samples (or sample arrays) or transform coefficients consisting of M columns and N rows.
[0058] In this document, the terms " / " and "," should be interpreted as indicating "and / or". For example, the expression "A / B" may mean "A and / or B". In addition, "A, B" may mean "A and / or B". In addition, "A / B / C" may mean "at least one of A, B, and / or C". In addition, "A / B / C" may mean "at least one of A, B, and / or C".
[0059] In addition, in this document, the term "or" should be interpreted as indicating "and / or". For example, the expression "A or B" may include 1) only A, 2) only B, and / or 3) both A and B. In other words, the term "or" in this document should be interpreted as indicating "additionally or alternatively".
[0060] In the present disclosure, "at least one of A and B" may mean "only A", "only B", or "both A and B". In addition, in the present disclosure, the expression "at least one of A or B" or "at least one of A and / or B" may be interpreted as "at least one of A and B".
[0061] Furthermore, in the present disclosure, “at least one of A, B, and C” may mean “only A”, “only B”, “only C”, or “any combination of A, B, and C”. Furthermore, “at least one of A, B, or C” or “at least one of A, B and / or C” may mean “at least one of A, B, and C”.
[0062] In addition, the brackets used in the present disclosure may mean "for example". Specifically, when the indication is "prediction (intra-frame prediction)", it may mean that "intra-frame prediction" is proposed as an example of "prediction". In other words, the "prediction" of the present disclosure is not limited to "intra-frame prediction", and "intra-frame prediction" is proposed as an example of "prediction". In addition, when the indication is "prediction (ie, intra-frame prediction)", this may also mean that "intra-frame prediction" is proposed as an example of "prediction".
[0063] Technical features described separately in one drawing in the present disclosure may be implemented separately or may be implemented simultaneously.
[0064] Figure 1 is a diagram schematically illustrating a configuration of a video / image encoding device to which the present disclosure can be applied. Hereinafter, a term referred to as a video encoding device may include an image encoding device.
[0065] refer to Figure 1 , the encoding device 100 may include an image partitioner 110, a predictor 120, a residual processor 130, an entropy encoder 140, an adder 150, a filter 160, and a memory 170. The predictor 120 may include an inter-frame predictor 121 and an intra-frame predictor 122. The residual processor 130 may include a transformer 132, a quantizer 133, a dequantizer 134, and an inverse transformer 135. The residual processor 130 may also include a subtractor 131. The adder 150 may 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 may be configured by one or more hardware components (e.g., an encoder chipset or processor) according to an embodiment. In addition, the memory 170 may include a decoded picture buffer (DPB) and may be configured by a digital storage medium. The hardware component may also include the memory 170 as an internal / external component.
[0066] The image partitioner 110 may partition an input image (or picture or frame) input to the encoding device 100 into one or more processing units. As an example, a processing unit may be referred to as a coding unit (CU). In this case, starting from a coding tree unit (CTU) or a maximum coding unit (LCU), the coding unit may be recursively divided according to a quadtree binary tree ternary tree (QTBTTT) structure. For example, a coding unit may be divided into a plurality of coding units of a deeper depth based on a quadtree structure, a binary tree structure, and / or a ternary tree structure. In this case, for example, a quadtree structure may be applied first and a binary tree structure and / or a ternary tree structure may be applied later. Alternatively, a binary tree structure may be applied first. The coding process according to the present disclosure may be performed based on a final coding unit that is not further divided. In this case, the maximum coding unit may be directly used as a final coding unit based on coding efficiency according to image characteristics. Alternatively, the coding unit may be recursively divided into coding units of a further deeper depth as needed so that a coding unit of an optimal size may be used as a final coding unit. Here, the coding process may include processes such as prediction, transformation, and reconstruction, which will be described later. As another example, the processing unit may also include a prediction unit (PU) or a transformation unit (TU). In this case, the prediction unit and the transformation unit may be split or partitioned from the above-mentioned final coding unit. The prediction unit may be a unit for sample prediction, and the transformation unit may be a unit for deriving a transformation coefficient and / or a unit for deriving a residual signal from the transformation coefficient.
[0067] Unit and terms such as block, region, etc. may be used to replace each other depending on the situation. In general, an M×N block may represent a set of samples or transform coefficients consisting of M columns and N rows. A sample may generally represent a pixel or a pixel value, and may represent only a pixel / pixel value of a luminance component, or only a pixel / pixel value of a chrominance component. A sample may be used as a term corresponding to a pixel or a pel of one picture (or image).
[0068] The encoding device 100 subtracts the prediction signal (prediction block, prediction sample array) output from the inter predictor 121 or the intra predictor 122 from the input image signal (original block, original sample array) to generate a residual signal (residual block, residual sample array), and the generated residual signal is sent to the transformer 132. In this case, as shown in the figure, the unit that subtracts the prediction signal (prediction block, prediction sample array) from the input image signal (original block, original sample array) in the encoding device 100 may be referred to as a subtractor 131. The predictor may perform prediction on a processing target block (hereinafter, referred to as a "current block") and may generate a prediction block including prediction samples for the current block. The predictor may determine whether to apply intra prediction or inter prediction on a current block or CU basis. As discussed later, in the description of each prediction mode, the predictor may generate various information related to prediction, such as prediction mode information, and may send the generated information to the entropy encoder 140. Information about prediction may be encoded in the entropy encoder 140 and output in the form of a bitstream.
[0069] The intra-frame predictor 122 can predict the current block by referring to the samples in the current picture. Depending on the prediction mode, the reference sample can be located in the neighboring area of the current block or in a distant area away from the current block. In intra-frame prediction, the prediction mode may include multiple non-directional modes and multiple directional modes. The non-directional mode may include, for example, a DC mode and a plane mode. Depending on the degree of detail of the prediction direction, the directional mode may include, for example, 33 directional prediction modes or 65 directional prediction modes. However, this is only an example, and more or fewer directional prediction modes may be used depending on the configuration. The intra-frame predictor 122 may determine the prediction mode applied to the current block by using the prediction mode applied to the neighboring blocks.
[0070] The inter-frame predictor 121 may derive a prediction block for the current block based on a reference block (reference sample array) specified by a motion vector on a reference picture. At this time, in order to reduce the amount of motion information sent in the inter-frame prediction mode, the motion information may be predicted in blocks, sub-blocks, or sample units based on the correlation of the motion information between the neighboring blocks and the current block. The motion information may include a motion vector and a reference picture index. The motion information may also include information about the inter-frame prediction direction (L0 prediction, L1 prediction, Bi prediction, etc.). In the case of inter-frame prediction, the neighboring blocks may include spatial neighboring blocks present in the current picture and temporal neighboring blocks present in the reference picture. The reference picture including the reference block and the reference picture including the temporal neighboring block may be the same or different from each other. The temporal neighboring block may be referred to as a collocated reference block, a collocated CU (colCU), etc., and the reference picture including the temporal neighboring block may be referred to as a collocated picture (colPic). For example, the inter-frame predictor 121 may configure a motion information candidate list based on the neighboring blocks and generate information indicating which candidate is used to derive the motion vector and / or reference picture index of the current block. Inter-frame prediction may be performed based on various prediction modes. For example, in the case of skip mode and merge mode, the inter-frame predictor 121 may use the motion information of the neighboring block as the motion information of the current block. In the skip mode, unlike the merge mode, the residual signal may not be transmitted. In the case of the motion information prediction (motion vector prediction, MVP) mode, the motion vector of the neighboring block may be used as a motion vector predictor, and the motion vector of the current block may be indicated by signaling the motion vector difference.
[0071] The predictor 120 may generate a prediction signal based on various prediction methods. For example, the predictor may apply intra prediction or inter prediction for predicting a block and may also apply intra prediction and inter prediction at the same time. This may be referred to as combined inter and intra prediction (CIIP). In addition, the predictor may be based on an intra block copy (IBC) prediction mode or a palette mode to perform prediction on a block. The IBC prediction mode or the palette mode may be used for content image / video coding in games, etc., such as screen content coding (SCC). Although IBC basically performs prediction in the current picture, the aspect of deriving a reference block in the current block may be similar to inter prediction in performing prediction. That is, IBC may use at least one of the inter prediction techniques described in the present disclosure. The palette mode may be considered as an example of intra coding or intra prediction. In the case of applying the palette mode, the sample values within the picture may be signaled based on information related to the palette table and the palette index.
[0072] The prediction signal generated by the predictor (including the inter-frame predictor 121 and / or the intra-frame predictor 122) can be used to generate a reconstruction signal or to generate a residual signal. The transformer 132 can generate a transform coefficient by applying a transform technique to the residual signal. For example, the transform technique may include at least one of a discrete cosine transform (DCT), a discrete sine transform (DST), a Karhunen-Loève transform (KLT), a graph-based transform (GBT), or a conditional nonlinear transform (CNT). Here, GBT means a transform obtained from a graph when the relationship information between pixels is represented by a graph. CNT refers to a transform obtained based on a prediction signal generated using all previously reconstructed pixels. In addition, the transform process can be applied to square pixel blocks of the same size or can be applied to non-square blocks of varying sizes.
[0073] The quantizer 133 may quantize the transform coefficients and send the quantized transform coefficients to the entropy encoder 140, and the entropy encoder 140 may encode the quantized signal (information about the quantized transform coefficients) and may output the encoded signal in the bitstream. The information about the quantized transform coefficients may be referred to as residual information. The quantizer 133 may rearrange the block type quantized transform coefficients into a one-dimensional vector form based on the coefficient scanning order, and generate information about the quantized transform coefficients based on the quantized transform coefficients in the one-dimensional vector form. The entropy encoder 140 may perform various encoding methods such as, for example, exponential Golomb, context adaptive variable length coding (CAVLC), context adaptive binary arithmetic coding (CABAC), etc. The entropy encoder 140 may encode information necessary for video / image reconstruction (e.g., values of syntax elements, etc.) other than the quantized transform coefficients together or separately. The encoding information (e.g., encoded video / image information) may be transmitted or stored on a unit basis of a network abstraction layer (NAL) in the form of a bitstream. The video / image information may also include information about various parameter sets such as an adaptive parameter set (APS), a picture parameter set (PPS), a sequence parameter set (SPS), a video parameter set (VPS), etc. In addition, the video / image information may also include general constraint information. In the present disclosure, information and / or syntax elements sent / signaled from an encoding device to a decoding device may be included in the video / image information. The video / image information may be encoded by the above-mentioned encoding process and included in a bitstream. The bitstream may be sent through a network or stored in a digital storage medium. Here, the network may include a broadcast network, a communication network, and / or the like, and the digital storage medium may include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. A transmitter (not shown) that transmits a signal output from the entropy encoder 140 and / or a storage device (not shown) that stores the signal may be configured as an internal / external element of the encoding device 100, or the transmitter may be included in the entropy encoder 140.
[0074] The quantized transform coefficients output from the quantizer 133 can be used to generate a prediction signal. For example, by applying dequantization and inverse transformation to the quantized transform coefficients via the dequantizer 134 and the inverse transformer 135, a residual signal (residual block or residual sample) can be reconstructed. The adder 155 adds the reconstructed residual signal to the prediction signal output from the inter-frame predictor 121 or the intra-frame predictor 122, so that a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample array) can be generated. When the processing target block has no residual, as in the case of applying the skip mode, the prediction block can be used as a reconstructed block. The adder 150 can be referred to as a reconstructor or a reconstructed block generator. The generated reconstructed signal can be used for intra-frame prediction of the next processing target block in the current block, and as described later, the generated reconstructed signal can be used for inter-frame prediction of the next picture by filtering.
[0075] At the same time, during the picture encoding and / or reconstruction process, luminance mapping and chrominance scaling (LMCS) can be applied.
[0076] The filter 160 can improve the 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. Various filtering methods may include, for example, deblocking filtering, sample adaptive offset, adaptive loop filter, bilateral filter, etc. As discussed later in the description of each filtering method, the filter 160 can generate various information related to filtering and send the generated information to the entropy encoder 140. Information about filtering can be encoded in the entropy encoder 140 and output in the form of a bitstream.
[0077] The modified reconstructed picture transmitted to the memory 170 may be used as a reference picture in the inter predictor 121. In doing so, the encoding apparatus may avoid prediction mismatch in the encoding apparatus 100 and the decoding apparatus when inter prediction is applied, and may also improve coding efficiency.
[0078] The memory 170 DPB may store the modified reconstructed picture so as to use it as a reference picture in the inter-frame predictor 121. The memory 170 may store the motion information of the block in the current picture from which the motion information is derived (or encoded) and / or the motion information of the block in the picture that has been (or previously) reconstructed. The stored motion information may be sent to the inter-frame predictor 121 to be used as the motion information of the neighboring block or the motion information of the temporal neighboring block. The memory 170 may store the reconstructed samples of the reconstructed block in the current picture and may send the reconstructed samples to the intra-frame predictor 122.
[0079] Figure 2is a diagram schematically illustrating a configuration of a video / image decoding device to which the present disclosure can be applied.
[0080] refer to Figure 2 , the video decoding device 200 may include an entropy decoder 210, a residual processor 220, a predictor 230, an adder 240, a filter 250, and a memory 260. The predictor 230 may include an inter-frame predictor 231 and an intra-frame predictor 232. The residual processor 220 may include a dequantizer 221 and an inverse transformer 222. The entropy decoder 210, the residual processor 220, the predictor 230, the adder 240, and the filter 250 described above may be configured by one or more hardware components (e.g., a decoder chipset or a processor) according to an embodiment. In addition, the memory 260 may include a decoded picture buffer (DPB) and may be configured by a digital storage medium. The hardware component may also include the memory 260 as an internal / external component.
[0081] When a bit stream including video / image information is input, the decoding device 200 can be used with Figure 1 The process of processing video / image information in the encoding device of the encoding device reconstructs the image accordingly. For example, the decoding device 200 can derive the unit / block based on information related to the block partition obtained from the bitstream. The decoding device 200 can perform decoding by using a processing unit applied in the encoding device. Therefore, the processing unit of decoding can be, for example, a coding unit, which can be partitioned along a quadtree structure, a binary tree structure and / or a ternary tree structure from a coding tree unit or a maximum coding unit. One or more transform units can be derived from the coding unit. And, the reconstructed image signal decoded and output by the decoding device 200 can be reproduced by a reproducer.
[0082] The decoding device 200 can receive the Figure 1The received signal can be decoded by the entropy decoder 210. For example, the entropy decoder 210 can parse the bitstream to derive information (e.g., video / image information) required for image reconstruction (or picture reconstruction). The video / image information may also include information about various parameter sets such as adaptive parameter set (APS), picture parameter set (PPS), sequence parameter set (SPS), video parameter set (VPS), etc. In addition, the video / image information may also include general constraint information. The decoding device may further decode the picture based on the information about the parameter set and / or the general constraint information. In the present disclosure, the information and / or syntax elements that will be described later and signaled / received can be decoded by a decoding process and obtained from the bitstream. For example, the entropy decoder 210 can decode the information in the bitstream based on a coding method such as exponential Golomb coding, CAVLC, CABAC, etc., and can output the values of syntax elements necessary for image reconstruction and the quantized values of the transform coefficients of the residual. More specifically, the CABAC entropy decoding method may receive a bin corresponding to each syntax element in the bitstream, use the decoded information of the decoding target syntax element information and the decoded information of the neighboring and decoding target blocks or the information of the symbol / bin decoded in the previous step to determine the context model, predict the bin generation probability according to the determined context model, and perform arithmetic decoding of the bin to generate a symbol corresponding to each syntax element value. Here, the CABAC entropy decoding method may update the context model using the information of the symbol / bin decoded by the context model for the next symbol / bin after determining the context model. Information about prediction among the information decoded in the entropy decoder 210 may be provided to the predictor (inter-frame predictor 232 and intra-frame predictor 231), and the residual value, i.e., the quantized transform coefficient and the related parameter information, which have been entropy decoded in the entropy decoder 210, may be input to the residual processor 220. The residual processor 220 may derive a residual signal (residual block, residual sample, residual sample array). In addition, information about filtering among the information decoded in the entropy decoder 210 may be provided to the filter 250. Meanwhile, a receiver (not shown) receiving a signal output from the encoding device may further configure the decoding device 200 as an internal / external element, and the receiver may be a component of the entropy decoder 210. Meanwhile, the decoding device according to the present disclosure may be referred to as a video / image / picture coding device, and the decoding device may be classified into an information decoder (video / image / picture information decoder) and a sample decoder (video / image / picture sample decoder). The information decoder may include the entropy decoder 210, and the sample decoder may include at least one of the dequantizer 221, the inverse transformer 222, the adder 240, the filter 250, the memory 260, the inter-frame predictor 232, and the intra-frame predictor 231.
[0083] The dequantizer 221 may output the transform coefficient by dequantizing the quantized transform coefficient. The dequantizer 221 may rearrange the quantized transform coefficient in the form of a two-dimensional block. In this case, the rearrangement process may perform rearrangement based on the order of coefficient scanning performed in the encoding device. The dequantizer 221 may perform dequantization on the quantized transform coefficient using a quantization parameter (e.g., quantization step size information) and obtain the transform coefficient.
[0084] The inverse transformer 222 obtains a residual signal (residual block, residual sample array) by performing inverse transformation on the transformation coefficients.
[0085] The predictor may perform prediction on the current block and generate a prediction block including prediction samples of the current block. The predictor may determine whether to apply intra prediction or inter prediction to the current block based on the information about prediction output from the entropy decoder 210, and more specifically, the predictor may determine an intra / inter prediction mode.
[0086] The predictor 220 may generate a prediction signal based on various prediction methods. For example, the predictor may apply intra prediction or inter prediction for predicting a block, and may also apply intra prediction and inter prediction at the same time. This may be referred to as combined inter and intra prediction (CIIP). In addition, the predictor may perform intra block copying (IBC) for predicting a block. Intra block copying may be used for content image / video coding in games, such as screen content coding (SCC). Although IBC basically performs prediction in the current block, prediction may be performed similarly to inter prediction in terms of deriving a reference block in the current block. That is, IBC may use at least one of the inter prediction techniques described in the present disclosure. The palette mode may be considered as an example of intra coding or intra prediction. In the case of applying the palette mode, the sample values within the picture may be signaled based on information related to the palette table and the palette index.
[0087] The intra-frame predictor 231 can predict the current block by referring to samples in the current picture. Depending on the prediction mode, the reference sample can be located in a neighboring area of the current block or in a distant area away from the current block. In intra-frame prediction, the prediction mode can include multiple non-directional modes and multiple directional modes. The intra-frame predictor 231 can determine the prediction mode applied to the current block by using the prediction mode applied to the neighboring block.
[0088] The inter-frame predictor 232 may derive a prediction block for the current block based on a reference block (reference sample array) specified by a motion vector on a reference picture. At this time, in order to reduce the amount of motion information sent in the inter-frame prediction mode, the motion information may be predicted in blocks, sub-blocks, or sample units based on the correlation of the motion information between the neighboring blocks and the current block. The motion information may include a motion vector and a reference picture index. The motion information may also include information about the inter-frame prediction direction (L0 prediction, L1 prediction, Bi prediction, etc.). In the case of inter-frame prediction, the neighboring blocks may include spatial neighboring blocks present in the current picture and temporal neighboring blocks present in the reference picture. For example, the inter-frame predictor 232 may configure a motion information candidate list based on the neighboring blocks and derive a motion vector and / or a reference picture index of the current block based on the received candidate selection information. Inter-frame prediction may be performed based on various prediction modes, and information about the prediction may include information indicating an inter-frame prediction mode for the current block.
[0089] The adder 240 can generate a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample array) by adding the obtained residual signal to the prediction signal (prediction block, prediction sample array) output from the predictor (including the inter-frame predictor 232 and / or the intra-frame predictor 231). When the processing target block has no residual, as in the case of applying the skip mode, the prediction block can be used as the reconstructed block.
[0090] The adder 240 may be referred to as a reconstructor or a reconstructed block generator. The generated reconstructed signal may be used for intra prediction of the next processing target block in the current block, and as described later, the generated reconstructed signal may be output through filtering or used for inter prediction of the next picture.
[0091] At the same time, during the picture decoding process, luminance mapping and chroma scaling (LMCS) can be applied.
[0092] The filter 250 can improve the 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 the modified reconstructed picture can be sent to the memory 260, more specifically, to the DPB of the memory 260. The various filtering methods may include, for example, deblocking filtering, sample adaptive offset, adaptive loop filter, bilateral filter, etc.
[0093] The (modified) reconstructed picture stored in the DPB of the memory 260 may be used as a reference picture in the inter-frame predictor 232. The memory 260 may store the motion information of the block in the current picture from which the motion information has been derived (or decoded) and / or the motion information of the block in the picture that has been (or previously) reconstructed. The stored motion information may be sent to the inter-frame predictor 232 to be used as the motion information of the neighboring block or the motion information of the temporal neighboring block. The memory 260 may store the reconstructed samples of the reconstructed block in the current picture and may send the reconstructed samples to the intra-frame predictor 231.
[0094] In the present specification, the embodiments described in each of the filter 250, the inter-frame predictor 232 and the intra-frame predictor 231 of the decoding device 200 may be applied identically or correspondingly to the filter 160, the inter-frame predictor 121 and the intra-frame predictor 122 of the encoding device 100, respectively.
[0095] As described above, prediction is performed in order to improve compression efficiency when performing video coding. In doing so, a prediction block including prediction samples for a current block as a coding target block can be generated. Here, the prediction block includes prediction samples in the 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 the image coding efficiency by signaling to the decoding device not the original sample value of the original block itself but information about the residual between the original block and the prediction block (residual information). 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.
[0096] The residual information may be generated by a transform and quantization process. For example, the encoding device may derive a residual block between the original block and the prediction block, derive a transform coefficient by performing a transform process on the residual samples (residual sample array) included in the residual block, and derive a quantized transform coefficient by performing a quantization process on the transform coefficient, so that it can (through a bitstream) signal the relevant residual information to the decoding device. Here, the residual information may include value information, position information, transform technology, transform kernel, quantization parameter, etc. of the quantized transform coefficient. The decoding device may perform a quantization / dequantization process and derive a residual sample (or residual sample block) based on the residual information. The decoding device may generate a reconstructed block based on the prediction block and the residual block. The encoding device may derive a residual block for reference for inter-frame prediction of the next picture by dequantizing / inverse transforming the quantized transform coefficient, and may generate a reconstructed picture based on the derived residual block.
[0097] Figure 3 The multiple transformation technology according to an embodiment of the present disclosure is schematically illustrated.
[0098] refer to Figure 3 , the converter can correspond to the aforementioned Figure 1 The converter in the encoding device, and the inverse converter may correspond to the aforementioned Figure 1 The inverse transformer in the encoding device of Figure 2 An inverse transformer in a decoding device.
[0099] The transformer may derive (primary) transform coefficients by performing a primary transform based on residual samples (residual sample arrays) in the residual block (S310). This primary transform may be referred to as a core transform. In this document, the primary transform may be based on a multiple transform selection (MTS), and when multiple transforms are applied as the primary transform, it may be referred to as a multi-core transform.
[0100] The multi-core transform may refer to a method of performing transform using discrete cosine transform (DCT) type 2 and discrete sine transform (DST) type 7, DCT type 8, and / or DST type 1 additionally. That is, the multi-core transform may refer to a transform method of transforming a residual signal (or residual block) in the spatial domain into a transform coefficient (or primary transform coefficient) in the frequency domain based on a plurality of transform kernels selected from DCT type 2, DST type 7, DCT type 8, and DST type 1. In this article, the primary transform coefficient may be referred to as a temporary transform coefficient from the perspective of the transformer.
[0101] In other words, when a conventional transform method is applied, a transform coefficient can be generated by applying a transform from the spatial domain to the frequency domain to a residual signal (or residual block) based on DCT type 2. In contrast, when a multi-core transform is applied, a transform coefficient (or primary transform coefficient) can be generated by applying a transform from the spatial domain to the frequency domain to a residual signal (or residual block) based on DCT type 2, DST type 7, DCT type 8, and / or DST type 1. In this document, DCT type 2, DST type 7, DCT type 8, and DST type 1 may be referred to as a transform type, a transform kernel, or a transform core. These DCT / DST transform types may be defined based on basis functions.
[0102] When performing multi-core transformation, a vertical transformation core and a horizontal transformation core for a target block may be selected from the transformation cores, a vertical transformation may be performed on the target block based on the vertical transformation core, and a horizontal transformation may be performed on the target block based on the horizontal transformation core. Here, the horizontal transformation may indicate a transformation of a horizontal component of the target block, and the vertical transformation may indicate a transformation of a vertical component of the target block. The vertical transformation core / horizontal transformation core may be adaptively determined based on a prediction mode and / or a transformation index of a target (CU or subblock) including a residual block.
[0103] In addition, according to the example, if the primary transform is performed by applying MTS, the mapping relationship of the transform kernel can be set by setting a specific basis function to a predetermined value and combining the basis functions to be applied in the vertical transform or the horizontal transform. For example, when the horizontal transform kernel is represented as trTypeHor and the vertical transform kernel is represented as trTypeVer, trTypeHor or trTypeVer with a value of 0 can be set to DCT2, trTypeHor or trTypeVer with a value of 1 can be set to DST7, and trTypeHor or trTypeVer with a value of 2 can be set to DCT8.
[0104] In this case, the MTS index information may be encoded and signaled to the decoding device to indicate any one of the plurality of transform kernel sets. For example, an MTS index of 0 may indicate that both trTypeHor and trTypeVer values are 0, an MTS index of 1 may indicate that both trTypeHor and trTypeVer values are 1, an MTS index of 2 may indicate that both trTypeHor and trTypeVer values are 2, an MTS index of 3 may indicate that both trTypeHor and trTypeVer values are 1, and an MTS index of 4 may indicate that both trTypeHor and trTypeVer values are 2.
[0105] In one example, the transformation core set according to the MTS index information is shown in the following table.
[0106] [Table 1]
[0107]
[0108] The transformer may perform a secondary transform based on the (primary) transform coefficients to derive modified (secondary) transform coefficients (S320). The primary transform is a transform from the spatial domain to the frequency domain, and the secondary transform refers to the use of the correlation between the (primary) transform coefficients to transform into a more compact expression. The secondary transform may include an inseparable transform. In this case, the secondary transform may be referred to as a non-separable secondary transform (NSST) or a mode-dependent non-separable secondary transform (MDNSST). NSST may represent a transform that performs a secondary transform on the (primary) transform coefficients derived by the primary transform based on a non-separable transform matrix to generate modified transform coefficients (or secondary transform coefficients) for a residual signal. Here, the transform may be applied at one time without separating the vertical transform and the horizontal transform based on the non-separable transform matrix (or applying horizontal / vertical transforms independently to the (primary) transform coefficients). In other words, NSST is not applied separately to the (primary) transform coefficients in the vertical direction and the horizontal direction, and may represent, for example, a transform method that rearranges a two-dimensional signal (transform coefficient) into a one-dimensional signal by a specific predetermined direction (e.g., a row-first direction or a column-first direction) and then generates a modified transform coefficient (or secondary transform coefficient) based on an inseparable transform matrix. For example, the row-first order is to arrange rows in the order of row 1, row 2, ..., row N for an MxN block, and the column-first order is to arrange rows in the order of column 1, column 2, ..., column M for an MxN block. NSST may be applied to the upper left region of a block (hereinafter, referred to as a transform coefficient block) configured with (primary) transform coefficients. For example, when the width W and height H of the transform coefficient block are both 8 or greater, 8×8 NSST may be applied to the upper left 8×8 region of the transform coefficient block. In addition, when the width (W) and the height (H) of the transform coefficient block are both 4 or more, when the width (W) or the height (H) of the transform coefficient block is less than 8, the 4×4 NSST may be applied to the upper left min(8,W)×min(8,H) region of the transform coefficient block. However, the embodiment is not limited thereto, and for example, even if the condition that only the width W or the height H of the transform coefficient block is 4 or more is satisfied, the 4×4 NSST may be applied to the upper left min(8,W)×min(8,H) region of the transform coefficient block.
[0109] Specifically, for example, if a 4×4 input block is used, the non-separable secondary transform may be performed as follows.
[0110] A 4×4 input block X can be represented as follows.
[0111] [Formula 1]
[0112]
[0113] If X is expressed in vector form, then the vector It can be expressed as follows.
[0114] [Formula 2]
[0115]
[0116] In Equation 2, the vector is a one-dimensional vector obtained by rearranging the two-dimensional block X of Equation 1 according to the row priority order.
[0117] In this case, the inseparable secondary transform can be calculated as follows.
[0118] [Formula 3]
[0119]
[0120] In this formula, denotes the transform coefficient vector, and T denotes the 16×16 (non-separable) transform matrix.
[0121] By using the above formula 3, the 16×1 transform coefficient vector can be derived , and the vector can be transformed into Reorganized into 4×4 blocks. However, the above calculation is an example, and Hypercube-Givens Transform (HyGT) or the like may also be used for the calculation of the inseparable secondary transform in order to reduce the calculation complexity of the inseparable secondary transform.
[0122] Furthermore, in a non-separable secondary transform, the transform kernel (or transform core, transform type) may be selected to be mode-dependent. In this case, the mode may include an intra prediction mode and / or an inter prediction mode.
[0123] As described above, an inseparable secondary transform may be performed based on an 8×8 transform or a 4×4 transform determined based on the width (W) and height (H) of the transform coefficient block. The 8×8 transform refers to a transform that is applicable to an 8×8 region included in a transform coefficient block when both W and H are equal to or greater than 8, and the 8×8 region may be the upper left 8×8 region in the transform coefficient block. Similarly, the 4×4 transform refers to a transform that is applicable to a 4×4 region included in a transform coefficient block when both W and H are equal to or greater than 4, and the 4×4 region may be the upper left 4×4 region in the transform coefficient block. For example, an 8×8 transform kernel matrix may be a 64×64 / 16×64 matrix, and a 4×4 transform kernel matrix may be a 16×16 / 8×16 matrix.
[0124] Here, in order to select the mode-dependent transform cores, two inseparable secondary transform cores may be configured for each transform set of inseparable secondary transforms for both the 8×8 transform and the 4×4 transform, and there may be four transform sets. That is, four transform sets may be configured for the 8×8 transform, and four transform sets may be configured for the 4×4 transform. In this case, each of the four transform sets for the 8×8 transform may include two 8×8 transform cores, and each of the four transform sets for the 4×4 transform may include two 4×4 transform cores.
[0125] However, as the size of the transform (ie, the size of the region to which the transform is applied) may be a size other than 8×8 or 4×4, for example, the number of sets may be n, and the number of transform kernels in each set may be k.
[0126] The transform set may be referred to as an NSST set or a LFNST set. A specific set among the transform sets may be selected, for example, based on the intra prediction mode of the current block (CU or subblock). A low frequency non-separable transform (LFNST) may be an example of a reduced non-separable transform, which will be described later, and represents a non-separable transform for a low frequency component.
[0127] For reference, for example, the intra prediction mode may include two non-directional (or non-angle) intra prediction modes and 65 directional (or angle) intra prediction modes. The non-directional intra prediction mode may include a plane intra prediction mode No. 0 and a DC intra prediction mode No. 1, and the directional intra prediction mode may include 65 intra prediction modes No. 2 to No. 66. However, this is an example, and this document may be applied even if the number of intra prediction modes is different. In addition, in some cases, intra prediction mode No. 67 may also be used, and intra prediction mode No. 67 may represent a linear model (LM) mode.
[0128] Figure 4 The intra directional mode for 65 prediction directions is shown as an example.
[0129] refer to Figure 4 , based on the intra prediction mode 34 having the left-upward diagonal prediction direction, the intra prediction mode can be divided into an intra prediction mode having a horizontal directionality and an intra prediction mode having a vertical directionality. Figure 5In , H and V represent horizontal and vertical directivities, respectively, and numbers -32 to 32 indicate displacements of 1 / 32 units on sample grid positions. These numbers may represent offsets for mode index values. Intra-prediction modes 2 to 33 have horizontal directivities, and intra-prediction modes 34 to 66 have vertical directivities. Strictly speaking, intra-prediction mode 34 may be considered neither horizontal nor vertical, but may be classified as belonging to horizontal directivity when determining a transform set for a secondary transform. This is because the input data is transposed for a vertically oriented mode that is symmetrical on the basis of intra-prediction mode 34, and the input data alignment method for the horizontal mode is used for intra-prediction mode 34. Transposing the input data means that the rows and columns of two-dimensional MxN block data are switched to NxM data. Intra-prediction mode 18 and intra-prediction mode 50 may represent horizontal intra-prediction mode and vertical intra-prediction mode, respectively, and intra-prediction mode 2 may be referred to as a right-up diagonal intra-prediction mode because intra-prediction mode 2 has a left reference pixel and performs prediction in the right-up direction. Likewise, intra-prediction mode 34 may be referred to as a right-down diagonal intra-prediction mode, and intra-prediction mode 66 may be referred to as a left-down diagonal intra-prediction mode.
[0130] According to an example, four transform sets according to intra prediction modes may be mapped, for example, as shown in the following table.
[0131] [Table 2]
[0132]
[0133] As shown in Table 2, any one of four transform sets, ie, lfnstTrSetIdx, may be mapped to any one of four indexes (ie, 0 to 3) according to the intra prediction mode.
[0134] When it is determined that a specific set is used for an inseparable transform, one of the k transform cores in the specific set can be selected by an inseparable secondary transform index. The encoding device can derive an inseparable secondary transform index indicating a specific transform core based on a rate-distortion (RD) check, and can signal the inseparable secondary transform index to the decoding device. The decoding device can select one of the k transform cores in a specific set based on the inseparable secondary transform index. For example, a lfnst index value 0 can refer to a first inseparable secondary transform core, a lfnst index value 1 can refer to a second inseparable secondary transform core, and a lfnst index value 2 can refer to a third inseparable secondary transform core. Alternatively, a lfnst index value 0 can indicate that the first inseparable secondary transform is not applied to the target block, and lfnst index values 1 to 3 can indicate three transform cores.
[0135] The transformer can perform an inseparable secondary transform based on the selected transform kernel, and can obtain modified (secondary) transform coefficients. As described above, the modified transform coefficients can be derived as transform coefficients quantized by a quantizer, and can be encoded and notified to a decoding device with a signal, and transmitted to a dequantizer / inverse transformer in an encoding device.
[0136] In addition, as described above, if the secondary transform is omitted, the (primary) transform coefficients that are the output of the primary (separable) transform can be derived as transform coefficients quantized by the quantizer as described above, and can be encoded and notified to the decoding device with a signal, and transmitted to the dequantizer / inverse transformer in the encoding device.
[0137] The inverse transformer is capable of performing a series of processes in an order opposite to the order in which the series of processes are performed in the above-mentioned transformer. The inverse transformer may receive (dequantized) transformer coefficients, and derive (primary) transform coefficients by performing a secondary (inverse) transform (S350), and may obtain a residual block (residual sample) by performing a primary (inverse) transform on the (primary) transform coefficients (S360). In this regard, from the perspective of the inverse transformer, the primary transform coefficients may be referred to as modified transform coefficients. As described above, the encoding device and the decoding device may generate a reconstructed block based on the residual block and the prediction block, and may generate a reconstructed picture based on the reconstructed block.
[0138] The decoding device may further include a secondary inverse transform application determiner (or an element for determining whether to apply a secondary inverse transform) and a secondary inverse transform determiner (or an element for determining a secondary inverse transform). The secondary inverse transform application determiner may determine whether to apply a secondary inverse transform. For example, the secondary inverse transform may be NSST, RST, or LFNST, and the secondary inverse transform application determiner may determine whether to apply a secondary inverse transform based on a secondary transform flag obtained by parsing a bitstream. In another example, the secondary inverse transform application determiner may determine whether to apply a secondary inverse transform based on a transform coefficient of a residual block.
[0139] The secondary inverse transform determiner may determine the secondary inverse transform. In this case, the secondary inverse transform determiner may determine the secondary inverse transform applied to the current block based on the LFNST (NSST or RST) transform set specified according to the intra prediction mode. In an embodiment, the secondary transform determination method may be determined depending on the primary transform determination method. Various combinations of the primary transform and the secondary transform may be determined according to the intra prediction mode. In addition, in an example, the secondary inverse transform determiner may determine the area to which the secondary inverse transform is applied based on the size of the current block.
[0140] Meanwhile, as described above, if the secondary (inverse) transform is omitted, the (dequantized) transform coefficients may be received, the primary (separable) inverse transform may be performed, and the residual block (residual sample) may be obtained. As described above, the encoding device and the decoding device may generate a reconstructed block based on the residual block and the prediction block, and may generate a reconstructed picture based on the reconstructed block.
[0141] Meanwhile, in the present disclosure, a reduced secondary transform (RST) in which the size of a transformation matrix (kernel) is reduced may be applied in the concept of NSST in order to reduce the amount of calculation and storage required for an inseparable secondary transform.
[0142] At the same time, the transformation kernel, transformation matrix, and coefficients constituting the transformation kernel matrix described in the present disclosure, that is, kernel coefficients or matrix coefficients, can be represented by 8 bits. This can be a condition for implementation in a decoding device and an encoding device, and compared with the existing 9 bits or 10 bits, the amount of storage required to store the transformation kernel can be reduced, and performance degradation can be reasonably adapted. In addition, representing the kernel matrix with 8 bits can allow the use of small multipliers and can be more suitable for single instruction multiple data (SIMD) instructions for optimal software implementation.
[0143] In the present specification, the term "RST" may refer to a transformation performed on residual samples of a target block based on a transformation matrix whose size is reduced according to a reduction factor. In the case of performing a reduced transformation, the amount of calculation required for the transformation can be reduced due to the reduction in the size of the transformation matrix. That is, RST can be used to solve the computational complexity problem that occurs when transforming a block of large size or an inseparable transform.
[0144] RST may be referred to as various terms such as reduced transform, reduced secondary transform, downscaled transform, simplified transform, and simple transform, and the names that RST may be referred to as are not limited to the listed examples. Alternatively, since RST is mainly performed in a low frequency region including non-zero coefficients in a transform block, it may be referred to as a low frequency non-separable transform (LFNST). The transform index may be referred to as an LFNST index.
[0145] Meanwhile, when the secondary inverse transform is performed based on the RST, the inverse transformer 135 of the encoding device 100 and the inverse transformer 222 of the decoding device 200 may include an inverse reduction secondary transformer that derives the modified transform coefficient based on the inverse RST of the transform coefficient, and an inverse primary transformer that derives the residual sample for the target block based on the inverse primary transform of the modified transform coefficient. The inverse primary transform refers to an inverse transform of the primary transform applied to the residual. In the present disclosure, deriving the transform coefficient based on the transform may refer to deriving the transform coefficient by applying the transform.
[0146] Figure 5is a diagram illustrating an RST according to an embodiment of the present disclosure.
[0147] In the present disclosure, a “target block” may refer to a current block to be encoded, a residual block, or a transform block.
[0148] In the RST according to the example, an N-dimensional vector can be mapped to an R-dimensional vector located in another space, so that a reduction transformation matrix can be determined, where R is less than N. N may refer to the square of the length of the side of the block to which the transformation is applied, or the total number of transformation coefficients corresponding to the block to which the transformation is applied, and the reduction factor may refer to an R / N value. The reduction factor may be referred to as a reduction factor, a reduction factor, a simplification factor, a simple factor, or other various terms. In addition, R may be referred to as a reduction coefficient, but depending on the situation, the reduction factor may refer to R. In addition, depending on the situation, the reduction factor may refer to an N / R value.
[0149] In the example, the reduction factor or the reduction coefficient may be signaled through the bitstream, but the example is not limited thereto. For example, a predefined value for the reduction factor or the reduction coefficient may be stored in each of the encoding device 100 and the decoding device 200, and in this case, the reduction factor or the reduction coefficient may not be signaled separately.
[0150] The size of the reduced transform matrix according to an example may be R×N which is smaller than N×N (the size of a conventional transform matrix), and may be defined as in Equation 4 below.
[0151] [Formula 4]
[0152]
[0153] Figure 5 The matrix T in the reduced transform block shown in (a) may mean the matrix T of Formula 4 RxN .like Figure 5 As shown in (a), when the reduction transformation matrix T RxN When multiplied by the residual samples of the target block, the transform coefficients for the target block can be derived.
[0154] In an example, if the size of the block to which the transform is applied is 8x8 and R=16 (ie, R / N = 16 / 64 = 1 / 4), then the Figure 5 The RST of (a) is expressed as a matrix operation as shown in the following Equation 5. In this case, it is possible to reduce the memory and multiplication calculation to about 1 / 4 by the reduction factor.
[0155] In the present disclosure, a matrix operation may be understood as an operation of obtaining a column vector by multiplying a column vector by a matrix provided on the left side of the column vector.
[0156] [Formula 5]
[0157]
[0158] In formula 6, r1 to r 64 y may represent the residual sample of the target block, and specifically may be a transform coefficient generated by applying the primary transform. As a result of the calculation of Equation 5, the transform coefficient c of the target block may be derived. i , and derive c i The process can be shown as formula 6.
[0159] [Formula 6]
[0160]
[0161] As a result of the calculation of Equation 6, transform coefficients c1 to c2 for the target block can be derived. R That is, when R=16, the transform coefficients c1 to c2 for the target block can be derived. 16 . Although 64 (N) transform coefficients are derived for the target block, if a regular transform is applied instead of RST and a transform matrix of 64x64 (NxN) size is multiplied by a residual sample of 64x1 (Nx1) size, only 16 (R) transform coefficients are derived for the target block because RST is applied. Since the total number of transform coefficients for the target block is reduced from N to R, the amount of data transmitted from the encoding device 100 to the decoding device 200 is reduced, which can improve the efficiency of transmission between the encoding device 100 and the decoding device 200.
[0162] When considered from the perspective of the size of the transformation matrix, the size of the conventional transformation matrix is 64×64 (N×N), but the size of the reduced transformation matrix is reduced to 16×64 (R×N), so the storage usage in the case of performing RST can be reduced by the R / N ratio compared to the case of performing the conventional transformation. In addition, when compared with the number of multiplication calculations N×N in the case of using the conventional transformation matrix, the use of the reduced transformation matrix can reduce the number of multiplication calculations (R×N) by the R / N ratio.
[0163] In an example, the transformer 132 of the encoding device 100 may derive transform coefficients for the target block by performing a primary transform and a secondary transform based on RST for the residual samples for the target block. These transform coefficients may be transferred to the inverse transformer of the decoding device 200, and the inverse transformer 222 of the decoding device 200 may derive modified transform coefficients based on an inverse reduced secondary transform (RST) for the transform coefficients, and may derive residual samples for the target block based on an inverse primary transform for the modified transform coefficients.
[0164] According to the example, the inverse RST matrix T NxR The size of is NxR which is smaller than the size of the conventional inverse transform matrix NxN, and is similar to the reduced transform matrix T shown in Equation 4 RxN In a transposed relationship.
[0165] Figure 5 The matrix T of the reduced inverse transform block shown in (b) t It can be referred to as the inverse RST matrix T RxN T (The superscript T means transpose). Figure 5 (b) shows the inverse RST matrix T RxN T When multiplied by the transform coefficients for the target block, modified transform coefficients for the target block or residual samples for the current block can be derived. RxN T Expressed as (T RxN ) T NxR .
[0166] More specifically, when the inverse RST is used as the secondary inverse transform, when the inverse RST matrix T N×R T When multiplied by the transform coefficients of the target block, the modified transform coefficients of the target block can be derived. In addition, the inverse RST can be used as an inverse primary transform, and in this case, when the inverse RST matrix T N×R T When multiplied by the transform coefficients of the target block, the residual samples of the target block can be derived.
[0167] In an example, if the size of the block to which the inverse transform is applied is 8x8 and R=16 (ie, R / N=16 / 64=1 / 4), then the Figure 5 The RST of (b) is expressed as a matrix operation as shown in the following Equation 7.
[0168] [Formula 7]
[0169]
[0170] In formula 7, c1 to c 16 As a result of the calculation of Equation 7, r representing the modified transform coefficient of the target block or the residual sample of the target block can be derived. j , and derive r j The process can be shown as formula 8.
[0171] [Formula 8]
[0172]
[0173] As a result of the calculation of Equation 8, r1 to r2 representing the modified transform coefficients of the target block or the residual samples of the target block can be derived. N . From the perspective of the size of the inverse transform matrix, the size of the conventional inverse transform matrix is 64×64 (N×N), but the size of the inverse reduction transform matrix is reduced to 64×16 (R×N), so the storage usage in the case of performing the inverse RST can be reduced by the R / N ratio compared to the case of performing the conventional inverse transform. In addition, when compared with the number of multiplication calculations N×N in the case of using the conventional inverse transform matrix, the use of the inverse reduction transform matrix can reduce the number of multiplication calculations (N×R) by the R / N ratio.
[0174] The transform set configuration shown in Table 2 can also be applied to 8×8 RST. That is, 8×8 RST can be applied according to the transform set in Table 2. Since one transform set includes two or three transforms (kernels) according to the intra prediction mode, it can be configured to select one of up to four transforms including the case where the secondary transform is not applied. In the transform where the secondary transform is not applied, the application of the identity matrix can be considered. Assuming that indexes 0, 1, 2, and 3 are assigned to the four transforms respectively (for example, index 0 can be assigned to the case where the identity matrix is applied, that is, the case where the secondary transform is not applied), the transform index or lfnst index as a syntax element can be signaled for each transform coefficient block, thereby specifying the transform to be applied. That is, for the upper left 8×8 block, by the transform index, the 8×8 NSST in the RST configuration can be specified, or the 8×8 lfnst can be specified when the LFNST is applied. 8×8 lfnst and 8×8 rst refer to transforms that can be applied to an 8×8 region included in a transform coefficient block when both W and H of a target block to be transformed are equal to or greater than 8, and the 8×8 region may be the upper left 8×8 region in the transform coefficient block. Similarly, 4×4 lfnst and 4×4 rst refer to transforms that can be applied to a 4×4 region included in a transform coefficient block when both W and H of a target block are equal to or greater than 4, and the 4×4 region may be the upper left 4×4 region in the transform coefficient block.
[0175] According to an embodiment of the present disclosure, for the transformation in the encoding process, only 48 pieces of data may be selected, and a maximum 16×48 transform kernel matrix may be applied thereto, instead of applying a 16×64 transform kernel matrix to 64 pieces of data forming an 8×8 region. Here, "maximum" means that m has a maximum value of 16 in the m×48 transform kernel matrix for generating m coefficients. That is, when RST is performed by applying an m×48 transform kernel matrix (m≤16) to an 8×8 region, 48 pieces of data are input, and m coefficients are generated. When m is 16, 48 pieces of data are input and 16 coefficients are generated. That is, assuming that 48 pieces of data form a 48×1 vector, the 16×48 matrix and the 48×1 vector are multiplied in sequence, thereby generating a 16×1 vector. Here, the 48 pieces of data forming an 8×8 region may be appropriately arranged, thereby forming a 48×1 vector. For example, a 48×1 vector may be constructed based on 48 pieces of data constituting an area other than the lower right 4×4 area among the 8×8 regions. Here, when the matrix operation is performed by applying the maximum 16×48 transform kernel matrix, 16 modified transform coefficients are generated and the 16 modified transform coefficients can be arranged in the upper left 4×4 region according to the scanning order, and the upper right 4×4 region and the lower left 4×4 region can be filled with zeros.
[0176] For the inverse transform in the decoding process, the transposed matrix of the aforementioned transform kernel matrix can be used. That is, when the inverse RST or LFNST is performed in the inverse transform process performed by the decoding device, the input coefficient data to which the inverse RST is applied is configured in a one-dimensional vector according to a predetermined arrangement order, and the modified coefficient vector obtained by multiplying the one-dimensional vector with the corresponding inverse RST matrix on the left side of the one-dimensional vector can be arranged in a two-dimensional block according to a predetermined arrangement order.
[0177] In summary, in the transformation process, when RST or LFNST is applied to an 8×8 region, 48 transform coefficients in the upper left region, the upper right region, and the lower left region except the lower right region of the 8×8 region are matrix-operated with a 16×48 transform kernel matrix. For the matrix operation, the 48 transform coefficients are input in a one-dimensional array. When the matrix operation is performed, 16 modified transform coefficients are derived, and the modified transform coefficients can be arranged in the upper left region of the 8×8 region.
[0178] On the contrary, in the inverse transform process, when the inverse RST or LFNST is applied to the 8×8 area, 16 transform coefficients corresponding to the upper left area of the 8×8 area among the transform coefficients in the 8×8 area can be input in a one-dimensional array according to the scanning order, and can undergo a matrix operation with a 48×16 transform kernel matrix. That is, the matrix operation can be expressed as (48×16 matrix) * (16×1 transform coefficient vector) = (48×1 modified transform coefficient vector). Here, the n×1 vector can be interpreted as having the same meaning as the n×1 matrix, and can therefore be expressed as an n×1 column vector. In addition, * represents matrix multiplication. When the matrix operation is performed, 48 modified transform coefficients can be derived, and the 48 modified transform coefficients can be arranged in the upper left area, the upper right area, and the lower left area of the 8×8 area except the lower right area.
[0179] When the secondary inverse transform is based on the RST, the inverse transformer 135 of the encoding device 100 and the inverse transformer 222 of the decoding device 200 may include an inverse reduction secondary transformer for deriving modified transform coefficients based on the inverse RST of the transform coefficients and an inverse primary transformer for deriving residual samples for the target block based on the inverse primary transform for the modified transform coefficients. The inverse primary transform refers to an inverse transform of the primary transform applied to the residual. In the present disclosure, deriving transform coefficients based on a transform may refer to deriving transform coefficients by applying a transform.
[0180] The non-separable transform (LFNST) described above will be described in detail as follows: The LFNST may include a forward transform performed by an encoding device and an inverse transform performed by a decoding device.
[0181] The encoding device receives as input a result (or a portion of the result) derived after applying a primary (core) transform, and applies a forward secondary transform (Secondary Transform).
[0182] [Formula 9]
[0183]
[0184] In Equation 9, x and y are the input and output of the secondary transform, respectively, G is a matrix representing the secondary transform, and the transform basis vectors consist of column vectors. In the case of inverse LFNST, when the dimension of the transform matrix G is expressed as [number of rows × number of columns], in the case of forward LFNST, the transpose of the matrix G becomes G T Dimension.
[0185] For inverse LFNST, the dimensions of the matrix G are [48×16], [48×8], [16×16], [16×8], and the [48×8] matrix and the [16×8] matrix are partial matrices of 8 transformation basis vectors sampled from the left side of the [48×16] matrix and the [16×16] matrix, respectively.
[0186] On the other hand, for forward LFNST, the matrix G T The dimensions of are [16×48], [8×48], [16×16], [8×16], and the [8×48] matrix and the [8×16] matrix are partial matrices obtained by sampling 8 transformation basis vectors from the upper parts of the [16×48] matrix and the [16×16] matrix, respectively.
[0187] Therefore, in the case of forward LFNST, a [48×1] vector or a [16×1] vector can be used as input x, and a [16×1] vector or a [8×1] vector can be used as output y. In video encoding and decoding, the output of the forward primary transform is two-dimensional (2D) data, so in order to construct a [48×1] vector or a [16×1] vector as input x, it is necessary to construct a one-dimensional vector by appropriately arranging the 2D data as the output of the forward transform.
[0188] Figure 6 is a diagram illustrating an order in which output data of a forward primary transform is arranged into a one-dimensional vector according to an example. Figure 6 The left diagrams of (a) and (b) show the order for constructing the [48 x 1] vector, and Figure 6 The right figures of (a) and (b) show the order for constructing the [16 x 1] vector. In the case of LFNST, it is possible to Figure 6 The 2D data are sequentially arranged in the same order as in (a) and (b) to obtain a one-dimensional vector x.
[0189] The arrangement direction of the output data of the forward primary transform may be determined according to the intra-frame prediction mode of the current block. For example, when the intra-frame prediction mode of the current block is in the horizontal direction relative to the diagonal direction, the output data of the forward primary transform may be arranged in the horizontal direction relative to the diagonal direction. Figure 6 The output data of the forward primary transform are arranged in the order of (a) and when the intra prediction mode of the current block is in the vertical direction with respect to the diagonal direction, it is possible to Figure 6 The output data of the forward primary transform are arranged in the order of (b).
[0190] According to the example, you can apply Figure 6 The arrangement order of (a) and (b) is different, and in order to derive the same as when applying Figure 6If the arrangement order of (a) and (b) is the same result (y vector), 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 so that each element constituting the x vector is always multiplied by the same transform basis vector.
[0191] Since the output y derived by Formula 9 is a one-dimensional vector, when two-dimensional data is required as input data in a process using the result of the forward secondary transform as input (for example, in the process of performing quantization or residual encoding), the output y vector of Formula 9 needs to be properly arranged as 2D data again.
[0192] Figure 7 is a diagram illustrating an order in which output data of a forward secondary transform is arranged into two-dimensional blocks according to an example.
[0193] In the case of LFNST, output values may be arranged in 2D blocks according to a predetermined scanning order. Figure 7 (a) shows that when the output y is a [16 x 1] vector, the output values are arranged at 16 positions of the 2D block according to the diagonal scanning order. Figure 7 (b) shows that when the output y is a [8 x 1] 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 filled with zeros. Figure 7 The X in (b) indicates that it is filled with zeros.
[0194] According to another example, since the order of processing the output vector y when performing quantization or residual coding can be preset, as Figure 8 The output vector y may not be arranged in a 2D block as shown in . However, in the case of residual coding, data coding may be performed in 2D block (eg, 4x4) units such as CG (coefficient group), and in this case, as in Figure 7 The data is arranged in a specific order as in the diagonal scan order of .
[0195] Meanwhile, the decoding apparatus may configure a one-dimensional input vector y by arranging two-dimensional data output through a dequantization process according to a preset scanning order for inverse transformation. The input vector y may be output as an output vector x through the following equation.
[0196] [Formula 10]
[0197]
[0198] In the case of inverse LFNST, the output vector x can be derived by multiplying the input vector y, which is a [16×1] vector or a [8×1] vector, by the G matrix. For inverse LFNST, the output vector x can be a [48×1] vector or a [16×1] vector.
[0199] The output vector x is based on Figure 6 The order shown is arranged in a two-dimensional block and arranged as two-dimensional data, and this two-dimensional data becomes input data (or a part of the input data) of the inverse primary transform.
[0200] Thus, the inverse secondary transform is overall the reverse of the forward secondary transform process and in the case of an inverse transform, unlike in the forward direction, the inverse secondary transform is applied first and then the inverse primary transform.
[0201] In the inverse LFNST, one of 8 [48×16] matrices and 8 [16×16] matrices can be selected as the transformation matrix G. Whether to apply the [48×16] matrix or the [16×16] matrix depends on the size and shape of the block.
[0202] In addition, 8 matrices can be derived from the four transform sets shown in Table 2 above, and each transform set can be composed of two matrices. Which transform set to use among the 4 transform sets is determined according to the intra prediction mode, and more specifically, the transform set is determined based on the value of the intra prediction mode extended by considering wide-angle intra prediction (WAIP). Which matrix is selected from the two matrices constituting the selected transform set is derived by index signaling. More specifically, 0, 1, and 2 can be used as the index values sent, 0 can indicate that LFNST is not applied, and 1 and 2 can indicate any one of the two transform matrices constituting the transform set selected based on the intra prediction mode value.
[0203] Meanwhile, as described above, which transform matrix of the [48×16] matrix and the [16×16] matrix is applied to the LFNST is determined by the size and shape of the transform target block.
[0204] Figure 8 is a diagram illustrating a block shape to which LFNST is applied. Figure 8 (a) shows 4 x 4 blocks, (b) shows 4 x 8 blocks and 8 x 4 blocks, (c) shows 4 x N blocks or N x 4 blocks, where N is 16 or greater, (d) shows 8 x 8 blocks, and (e) shows M x N blocks, where M ≥ 8, N ≥ 8, and N > 8 or M > 8.
[0205] exist Figure 8 In , the blocks with thick borders indicate the areas where LFNST is applied. Figure 8For blocks (a) and (b), LFNST is applied to the top left 4x4 region, and for Figure 8 In block (c), LFNST is applied separately to the two upper left 4x4 regions arranged consecutively. Figure 8 In (a), (b), and (c), since LFNST is applied in units of 4x4 regions, this LFNST will be referred to as “4x4 LFNST” hereinafter. Depending on the matrix dimension used for G, a [16x16] or [16x8] matrix may be applied.
[0206] More specifically, the [16 x 8] matrix is applied to Figure 8 (a) 4x4 block (4x4 TU or 4x4 CU) and the [16x16] matrix is applied to Figure 8 This is to adjust the computational complexity to 8 multiplications per sample for the worst case.
[0207] about Figure 8 In (d) and (e), LFNST is applied to the upper left 8x8 region, and this LFNST is hereinafter referred to as "8x8 LFNST". As the corresponding transformation matrix, a [48 x 16] matrix or a [48 x 8] matrix may be applied. In the case of the forward LFNST, since the [48 x 1] vector (x vector in Equation 9) is input as input data, all sample values of the upper left 8x8 region are not used as input values of the forward LFNST. That is, as can be done with Figure 6 The left order of (a) or Figure 6 As seen in the left order of (b), a [48 x 1] vector can be constructed based on the samples belonging to the remaining 3 4x4 blocks, while leaving the bottom right 4x4 block as is.
[0208] The [48 x 8] matrix can be applied to Figure 8 (d) 8×8 block (8×8 TU or 8×8 CU), and the [48×16] matrix can be applied to Figure 8 The 8×8 block in (e) is also used to adjust the computational complexity to 8 multiplications per sample for the worst case.
[0209] Depending on the block shape, when the corresponding forward LFNST (4×4 or 8×8 LFNST) is applied, 8 or 16 output data are generated (the Y vector in Eq. 9, [8×1] or [16×1] vector). In the forward LFNST, since the matrix G T The characteristic is that the number of output data is equal to or less than the number of input data.
[0210] Fig. 9is a diagram illustrating arrangement of output data of a forward LFNST according to an example, and shows blocks in which the output data of the forward LFNST is arranged according to a block shape.
[0211] Fig. 9 The shaded area at the upper left of the block shown in corresponds to the area where the output data of the forward LFNST is located, the position marked with 0 indicates the sample filled with the value 0, and the remaining area represents the area not changed by the forward LFNST. In the area not changed by the LFNST, the output data of the forward primary transform remains unchanged.
[0212] As described above, since the dimension of the applied transformation matrix varies according to the shape of the block, the number of output data also varies. Fig. 9 , the output data of the forward LFNST may not completely fill the upper left 4x4 block. Fig. 9 In the cases of (a) and (d), the [16 x 8] matrix and the [48 x 8] matrix are applied to the block indicated by the bold line or a partial region within the block, respectively, and an [8 x 1] vector is generated as the output of the forward LFNST. That is, according to Figure 7 The scanning order shown in (b) can be Fig. 9 As shown in (a) and (d), only 8 output data are filled, and 0 can be filled in the remaining 8 positions. Figure 8 (d) The case of applying LFNST to a block, such as Fig. 9 As shown in (d), the two 4x4 blocks in the upper right and upper left adjacent to the upper left 4x4 block are also filled with value 0.
[0213] As described above, basically, by signaling the LFNST index, whether to apply LFNST and the transformation matrix to be applied are specified. Fig. 9 As shown, when LFNST is applied, since the number of output data of the forward LFNST may be equal to or less than the number of input data, an area filled with zero values occurs as follows.
[0214] 1) If Fig. 9 As shown in (a), samples from the 8th and subsequent positions in the upper left 4x4 block in the scanning order, that is, samples from the 9th to the 16th.
[0215] 2) If Fig. 9 As shown in (d) and (e), when the [48 x 16] matrix or the [48 x 8] matrix is applied, the two 4x4 blocks adjacent to the upper left 4x4 block or the second and third 4x4 blocks in the scanning order.
[0216] Therefore, if non-zero data exists by checking areas 1) and 2), it is determined that LFNST is not applied, so that signaling of the corresponding LFNST index can be omitted.
[0217] According to an example, for example, in the case of LFNST adopted in the VVC standard, since the signaling of the LFNST index is performed after residual coding, the encoding device can know whether there is non-zero data (significant coefficient) at all positions within the TU or CU block through residual coding. Therefore, the encoding device can determine whether to perform signaling about the LFNST index based on the presence of non-zero data, and the decoding device can determine whether to parse the LFNST index. When non-zero data does not exist in the area specified in 1) and 2) above, the signaling of the LFNST index is performed.
[0218] Since truncated unary code is applied as a binarization method for the LFNST index, the LFNST index consists of up to two bins, and 0, 10, and 11 are assigned as binary codes for possible LFNST index values 0, 1, and 2, respectively. In the case of LFNST currently used for VVC, context-based CABAC coding is applied to the first bin (conventional coding), and bypass coding is applied to the second bin. The total number of contexts for the first bin is 2, and when (DCT-2, DCT-2) is applied as a primary transform pair for horizontal and vertical directions and the luminance component and the chrominance component are coded in a dual-tree type, one context is allocated and the other context is applied to the remaining cases. The coding of the LFNST index is shown in the following table.
[0219] [Table 3]
[0220]
[0221] Meanwhile, for the adopted LFNST, the following simplified method can be applied.
[0222] (i) According to an example, the number of output data of the forward LFNST may be limited to a maximum of 16.
[0223] exist Figure 8 In the case of (c), 4x4 LFNST can be applied to two 4x4 regions adjacent to the upper left, respectively, and in this case, a maximum of 32 LFNST output data can be generated. When the number of output data for 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 to only one 4x4 region in the upper left, and LFNST can be applied Figure 8 All blocks of are only once. By doing this, the implementation of image compilation can be simplified.
[0224] Fig.10 It is shown that the number of output data for the forward LFNST is limited to a maximum of 16 according to an example. Fig.10 ,When LFNST is applied to the upper leftmost 4x4 region in a 4xN or Nx4 block where N is 16 or greater, the output data of the forward LFNST becomes 16 pieces.
[0225] (ii) According to an example, zeroing may be additionally applied to an area to which LFNST is not applied. In this document, zeroing may mean filling all positions belonging to a specific area with a value of 0. That is, zeroing may be applied to an area that is unchanged due to LFNST, and the result of the forward primary transformation is maintained. As described above, since LFNST is divided into 4×4 LFNST and 8×8 LFNST, zeroing may be divided into two types ((ii)-(A) and (ii)-(B)) as follows.
[0226] (ii)-(A) When 4x4 LFNST is applied, the area to which 4x4 LFNST is not applied may be zeroed. Fig.11 is a diagram illustrating clearing in a block to which 4×4 LFNST is applied according to an example.
[0227] like Fig.11 As shown in , relative to the block where 4x4 LFNST is applied, that is, for Fig. 9 All blocks in (a), (b), and (c) can be filled with zeros in the entire area where LFNST is not applied.
[0228] on the other hand, Fig.11 (d) shows that when the number of output data of the forward LFNST is the maximum value as Fig.10 When is limited to 16 as shown in , zeroing is performed on the remaining blocks to which 4x4 LFNST is not applied.
[0229] (ii)-(B) When 8x8 LFNST is applied, the area to which 8x8 LFNST is not applied may be zeroed. Fig.12 is a diagram illustrating clearing in a block to which 8x8 LFNST is applied according to an example.
[0230] like Fig.12 As shown, relative to the block applying 8x8 LFNST, that is, for Fig. 9 All blocks in (d) and (e) can be filled with zeros in the entire area where LFNST is not applied.
[0231] (iii) Due to the zeroing presented in (ii) above, the area filled with zeros when LFNST is applied may not be the same. Fig. 9Compared with the case of LFNST, we can check whether there are non-zero data over a wider area according to the zeroing proposed in (ii).
[0232] For example, when (ii)-(B) is applied, in addition to the Fig.12 Outside the area additionally filled with 0 Fig. 9 After determining whether there is non-zero data in the area filled with zero values in (d) and (e), signaling for the LFNST index can be performed only when there is no non-zero data.
[0233] Of course, even if the zeroing proposed in (ii) is applied, it is possible to check whether there is non-zero data in the same way as the existing LFNST index signaling. That is, when checking Fig. 9 After checking whether there is non-zero data in the block filled with zeros in , LFNST index signaling can be applied. In this case, the encoding device only performs zero clearing, and the decoding device does not assume zero clearing, that is, only checks whether there is non-zero data in the block filled with zeros in . Fig. 9 LFNST index parsing can be performed to determine whether there is non-zero data in the region explicitly marked as 0 in .
[0234] Alternatively, according to another example, Fig.13 Perform clearing as shown in . Fig.13 is a diagram illustrating clearing in a block to which 8×8 LFNST is applied according to another example.
[0235] like Fig.11 and Fig.12 As shown in , clearing can be applied to all regions except the region where LFNST is applied, or it can be applied as shown in Fig.13 As shown in the figure, the zeroing is applied only to some areas. Fig.13 For areas other than the upper left 8x8 region of the , clearing may not be applied to the lower right 4x4 block within the upper left 8x8 region.
[0236] Various embodiments of the combination of the simplified methods ((i), (ii)-(A), (ii)-(B), (iii)) applying LFNST can be derived. Of course, the combination of the simplified methods described above is not limited to the following embodiments, and any combination can be applied to LFNST.
[0237] Example
[0238] - Limit the number of output data of the forward LFNST to a maximum of 16 → (i)
[0239] - When 4×4 LFNST is applied, all regions where 4×4 LFNST is not applied are cleared → (II)-(A)
[0240] - When 8×8 LFNST is applied, all regions where 8×8 LFNST is not applied are cleared → (II)-(B)
[0241] - After checking whether non-zero data also exists in the existing region filled with zero values and in the region filled with zeros due to the additional clearing ((ii)-(A), (ii)-(B)), signal the LFNST index only if non-zero data does not exist → (iii)
[0242] In the case of this embodiment, when LFNST is applied, the area in which non-zero output data can exist is limited to the inside of the upper left 4x4 area. Fig.11 (a) and Fig.12 In the case of (a), the 8th position in the scan order is the last position where non-zero data can exist. Fig.11 (b) and (c) and Fig.12 In case of (b), the 16th position in the scanning order (ie, the position of the lower right edge of the upper left 4x4 block) is the last position where data other than 0 may exist.
[0243] Therefore, when LFNST is applied, after checking whether non-zero data exists at a position not allowed by the residual coding process (at a position beyond the last position), it may be determined whether to signal the LFNST index.
[0244] In the case of the zeroing method proposed in (ii), the amount of calculation required to perform the entire transformation process can be reduced due to the amount of data ultimately generated when both the primary transformation and LFNST are applied. That is, when LFNST is applied, since zeroing is applied to the forward primary transformation output data exists in the area where LFNST is not applied, it is not necessary to generate data for the area that becomes zeroed during the execution of the forward primary transformation. Therefore, the amount of calculation required to generate the corresponding data can be reduced. The additional effects of the zeroing method proposed in (ii) are summarized as follows.
[0245] First, as mentioned above, the amount of computation required to perform the entire transformation process is reduced.
[0246] In particular, when (ii)-(B) is applied, the amount of calculation in the worst case is reduced, so that the transform process can be made lighter. In other words, in general, a large amount of calculation is required to perform a large-size primary transform. By applying (ii)-(B), the amount of data derived as a result of performing forward LFNST can be reduced to 16 or less. In addition, as the size of the entire block (TU or CU) increases, the effect of reducing the amount of transform operations further increases.
[0247] Second, the amount of computation required for the entire transformation process can be reduced, thereby reducing the power consumption required to perform the transformation.
[0248] Third, the delay involved in the transformation process is reduced.
[0249] Secondary transforms such as LFNST add computational effort to the existing primary transform, thus increasing the overall latency involved in performing the transform. In particular, in the case of intra prediction, since reconstructed data of neighboring blocks is used in the prediction process, during encoding, the increase in latency due to the secondary transform results in an increase in latency until reconstruction. This can result in an increase in the overall latency of intra prediction encoding.
[0250] However, if the clearing proposed in (ii) is applied, the delay time for performing the primary transform can be greatly reduced when LFNST is applied, maintaining or reducing the delay time of the entire transform, so that the encoding device can be implemented more simply.
[0251] In conventional intra prediction, the current block to be encoded is regarded as one coding unit, and encoding is performed without segmentation. However, intra sub-partitioning (ISP) coding means performing intra prediction coding by dividing the current block to be encoded in the horizontal direction or the vertical direction. In this case, a reconstructed block can be generated by performing encoding / decoding in units of divided blocks, and the reconstructed block can be used as a reference block for the next divided block. According to an embodiment, in ISP coding, one coding block can be divided into two or four sub-blocks and coded, and in ISP, in one sub-block, intra prediction is performed with reference to the reconstructed pixel value of the sub-block located on the adjacent left side or the adjacent upper side. Hereinafter, "coding" may be used as a concept including both coding performed by an encoding device and decoding performed by a decoding device.
[0252] Table 4 represents the number of sub-blocks divided according to a block size when ISP is applied, and the sub-partitions divided according to ISP may be referred to as transform blocks (TUs).
[0253] [Table 4]
[0254]
[0255] ISP is to divide the block predicted as a luma frame into two or four sub-partitions in the vertical or horizontal direction according to the size of the block. For example, the minimum block size to which ISP can be applied is 4×8 or 8×4. When the block size is larger than 4×8 or 8×4, the block is divided into 4 sub-partitions.
[0256] Fig.14 and Fig.15 An example of sub-blocks into which a coding block is divided is illustrated, and more specifically, Fig.14An example of partitioning in the case where a coding block (width (W) x height (H)) is a 4x8 block or an 8x4 block is illustrated, and Fig.15 An example of partitioning for a case in which a coding block is not a 4x8 block, an 8x4 block, or a 4x4 block is illustrated.
[0257] When ISP is applied, subblocks are sequentially coded from left to right or from top to bottom (e.g., horizontally or vertically) according to the partition type, and after performing reconstruction processing via inverse transform and intra prediction for one subblock, coding of the next subblock can be performed. For the leftmost or topmost subblock, the reconstructed pixels of the coded coding block are referenced, as in the conventional intra prediction method. In addition, when each side of the subsequent internal subblock is not adjacent to the previous subblock, in order to derive the reference pixels adjacent to the corresponding side, the reconstructed pixels of the coded adjacent coding blocks are referenced, as in the conventional intra prediction method.
[0258] In ISP coding mode, all sub-blocks can be coded with the same intra prediction mode, and a flag indicating whether ISP coding is used and a flag indicating in which direction (horizontally or vertically) the split can be signaled. Fig.14 and Fig.15 As illustrated in , the number of sub-blocks can be adjusted to 2 or 4 according to the block shape, and when the size (width x height) of one sub-block is less than 16, the size can be limited so that division into corresponding sub-blocks is not allowed or ISP coding itself is not applied.
[0259] In case of the ISP prediction mode, one coding unit is divided into two or four partition blocks (ie, sub-blocks) and predicted, and the same intra prediction mode is applied to the divided two or four partition blocks.
[0260] As described above, in the division direction, both the horizontal direction (when an M×N coding unit having a horizontal length and a vertical length of M and N, respectively, is divided in the horizontal direction, if the M×N coding unit is divided into two, the M×N coding unit is divided into M×(N / 2) blocks, and if the M×N coding unit is divided into four blocks, the M×N coding unit is divided into M×(N / 4) blocks) and the vertical direction (when the M×N coding unit is divided in the vertical direction, if the M×N coding unit is divided into two, the M×N coding unit is divided into (M / 2)×N blocks, and if the M×N coding unit is divided into four, the M×N coding unit is divided into (M / 4)×N blocks) are possible. When the M×N coding unit is divided in the horizontal direction, the partition blocks are coded in a top-to-bottom order, and when the M×N coding unit is divided in the vertical direction, the partition blocks are coded in a left-to-right order. In the case of horizontal (vertical) partitioning, the reconstructed pixel values of the upper (left) partition block can be referenced to predict the currently coded partition block.
[0261] Transformation can be applied to the residual signal generated in units of partition blocks by the ISP prediction method. A multi-transform selection (MTS) technique based on a DST-7 / DCT-8 combination and the existing DCT-2 can be applied to a forward-based primary transform (core transform), and a forward low-frequency non-separable transform (LFNST) can be applied to the transform coefficients generated from the primary transform to generate the final modified transform coefficients.
[0262] That is, LFNST can be applied to the partition blocks divided by applying the ISP prediction mode, and the same intra prediction mode is applied to the divided partition blocks, as described above. Therefore, when the LFNST set derived based on the intra prediction mode is selected, the derived LFNST set can be applied to all partition blocks. That is, because the same intra prediction mode is applied to all partition blocks, the same LFNST set can be applied to all partition blocks.
[0263] According to an embodiment, LFNST may be applied only to a transform block having both a horizontal length and a vertical length of 4 or more. Therefore, when the horizontal length or the vertical length of a partition block divided according to the ISP prediction method is less than 4, LFNST is not applied and the LFNST index is not signaled. In addition, when LFNST is applied to each partition block, the corresponding partition block may be regarded as one transform block. When the ISP prediction method is not applied, LFNST may be applied to the coding block.
[0264] A method of applying LFNST to each partition block will be described in detail.
[0265] According to an embodiment, after applying forward LFNST to each partition block, only a maximum of 16 (8 or 16) coefficients are left in the upper left 4×4 region in the transform coefficient scanning order, and then zeroing can be applied, where the remaining positions and regions are all filled with 0.
[0266] Alternatively, according to an embodiment, when the length of one side of the partition block is 4, LFNST is applied only to the upper left 4×4 region, and when the lengths of all sides of the partition block (i.e., width and height) are 8 or greater, LFNST can be applied to the remaining 48 coefficients within the upper left 8×8 region except for the lower right 4×4 region.
[0267] Alternatively, according to an embodiment, in order to adjust the worst-case computational complexity to 8 multiplications per sample, when each partition block is 4×4 or 8×8, only 8 transform coefficients may be output after applying the forward LFNST. That is, when the partition block is 4×4, an 8×16 matrix may be applied as the transform matrix, and when the partition block is 8×8, an 8×48 matrix may be applied as the transform matrix.
[0268] In the current VVC standard, LFNST index signaling is performed in units of coding units. Therefore, in ISP prediction mode and when LFNST is applied to all partition blocks, the same LFNST index value can be applied to the corresponding partition blocks. That is, when the LFNST index value is sent once at the coding unit level, the corresponding LFNST index can be applied to all partition blocks in the coding unit. As described above, the LFNST index value can have values of 0, 1, and 2, where 0 represents the case where LFNST is not applied, and 1 and 2 represent two transform matrices present in one LFNST set when LFNST is applied.
[0269] As described above, the LFNST set is determined by the intra prediction mode, and in the case of the ISP prediction mode, since all partition blocks in a coding unit are predicted in the same intra prediction mode, the partition blocks can refer to the same LFNST set.
[0270] As another example, LFNST index signaling is still performed in units of coding units, but in the case of the ISP prediction mode, it is not determined whether LFNST is uniformly applied to all partition blocks, and for each partition block, whether to apply the LFNST index value signaled at the coding unit level and whether to apply LFNST can be determined by a separate condition. Here, a separate condition can be signaled in the form of a flag for each partition block through the bitstream, and when the flag value is 1, the LFNST index value signaled at the coding unit level is applied, and when the flag value is 0, LFNST may not be applied.
[0271] In a coding unit to which the ISP mode is applied, an example of applying LFNST when the length of one side of a partition block is less than 4 is described as follows.
[0272] First, when the size of the partition block is N×2 (2×N), LFNST can be applied to the upper left M×2 (2×M) region (where M≤N). For example, when M=8, the upper left region becomes 8×2 (2×8), so the region with 16 residual signals can be the input of the forward LFNST, and a forward transformation matrix of R×16 (R≤16) can be applied.
[0273] Here, the forward LFNST matrix can be a separate additional matrix in addition to the matrix included in the current VVC standard. In addition, for the worst case complexity control, an 8×16 matrix in which only the upper 8 rows of the 16×16 matrix are sampled can be used for the transformation. The complexity control method will be described in detail later.
[0274] Secondly, when the size of the partition block is N×1 (1×N), LFNST can be applied to the upper left M×1 (1×M) region (where M≤N). For example, when M=16, the upper left region becomes 16×1 (1×16), so the region with 16 residual signals can be the input of the forward LFNST, and a forward transformation matrix of R×16 (R≤16) can be applied.
[0275] Here, the corresponding forward LFNST matrix can be a separate additional matrix in addition to the matrix included in the current VVC standard. In addition, in order to control the complexity of the worst case, an 8×16 matrix in which only the upper 8 rows of the 16×16 matrix are sampled can be used for the transformation. The complexity control method will be described in detail later.
[0276] The first embodiment and the second embodiment may be applied at the same time, or either of the two embodiments may be applied. In particular, in the case of the second embodiment, because the primary transformation is considered in LFNST, it is observed through experiments that the compression performance improvement that can be obtained in the existing LFNST is relatively small compared to the LFNST index signaling cost. However, in the case of the first embodiment, a compression performance improvement similar to that that can be obtained from the conventional LFNST is observed. That is, in the case of ISP, the contribution of the application of 2×N and N×2 LFNST to the actual compression performance can be checked through experiments.
[0277] In the LFNST of the current VVC, symmetry between intra prediction modes is applied. The same set of LFNST is applied to the two directional modes set around mode 34 (prediction in the 45-degree diagonal direction at the lower right corner), for example, the same set of LFNST is applied to mode 18 (horizontal direction prediction mode) and mode 50 (vertical direction prediction mode). However, in modes 35 to 66, when forward LFNST is applied, the input data is transposed and then LFNST is applied.
[0278] VVC supports wide-angle intra prediction (WAIP) mode, and the LFNST set is derived based on the modified intra prediction mode taking into account the WAIP mode. For the mode extended by WAIP, the LFNST set is determined by using symmetry, just like in the general intra prediction direction mode. For example, because mode-1 is symmetric with mode 67, the same LFNST set is applied, and because mode-14 is symmetric with mode 80, the same LFNST set is applied. Modes 67 to 80 apply the LFNST transform after transposing the input data before applying the forward LFNST.
[0279] In the case of applying LFNST to the top left M×2 (M×1) block, since the block to which LFNST is applied is non-square, the symmetry to LFNST cannot be applied. Therefore, instead of applying the symmetry based on the intra prediction mode, as in the LFNST of Table 2, the symmetry between the M×2 (M×1) block and the 2×M (1×M) block can be applied.
[0280] Fig.16 is a diagram illustrating symmetry between an Mx2 (Mx1) block and a 2xM (1xM) block according to an embodiment.
[0281] like Fig.16 As illustrated in , since mode 2 in an Mx2(Mx1) block can be considered symmetric to mode 66 in a 2xM(1xM) block, the same set of LFNSTs can be applied to both 2xM(1xM) blocks and Mx2(Mx1) blocks.
[0282] In this case, in order to apply the LFNST set applied to the M×2 (M×1) block to the 2×M (1×M) block, the LFNST set is selected based on mode 2 instead of mode 66. That is, before applying the forward LFNST, the LFNST may be applied after transposing the input data of the 2×M (1×M) block.
[0283] Fig.17 is a diagram illustrating an example of transposing a 2xM block according to an embodiment.
[0284] Fig.17(a) is a diagram illustrating that LFNST can be applied by reading input data in column-major order for 2xM blocks, and Fig.17 (b) is a diagram illustrating that LFNST can be applied by reading input data in row-major order with respect to an Mx2 (Mx1) block. A method of applying LFNST to an upper left Mx2 (Mx1) or 2xM (Mx1) block is described as follows.
[0285] 1. First, if Fig.17 As shown in (a) and (b), the input data is arranged to configure the input vector of the forward LFNST. Fig.16 , for a Mx2 block predicted in mode 2, follow Fig.17 The order of (b) and for a 2xM block predicted in mode 66, Fig.17 The input data is arranged in the order of (a), and then the LFNST set for mode 2 can be applied.
[0286] 2. For M×2 (M×1) blocks, considering WAIP, determine the LFNST set based on the modified intra prediction mode. As described above, a preset mapping relationship is established between the intra prediction mode and the LFNST set, which can be represented by a mapping table as shown in Table 2.
[0287] For a 2×M (1×M) block, a symmetric mode around the prediction mode (mode 34 in the case of the VVC standard) in a 45-degree diagonal direction downward from the modified intra prediction mode in consideration of WAIP can be obtained, and then the LFNST set is determined based on the corresponding symmetric mode and the mapping table. The symmetric mode (y) around mode 34 can be derived by the following formula. The mapping table will be described in more detail below.
[0288] [Formula 11]
[0289]
[0290] 3. When the forward LFNST is applied, the transform coefficient may be derived by multiplying the input data prepared in process 1 by the LFNST kernel. The LFNST kernel may be selected according to the LFNST set determined in process 2 and a predetermined LFNST index.
[0291] For example, when M=8 and a 16×16 matrix is applied as the LFNST kernel, 16 transform coefficients can be generated by multiplying the matrix by 16 input data. The generated transform coefficients can be arranged in the upper left 8×2 or 2×8 area according to the scanning order used in the VVC standard.
[0292] Fig.18 The scanning order of 8x2 or 2x8 areas according to an embodiment is illustrated.
[0293] All regions except the upper left 8×2 or 2×8 region may be filled with zero values (cleared), or the existing transform coefficients to which the primary transform is applied may be left as is. The predetermined LFNST index may be one of the LFNST index values (0, 1, 2) attempted when calculating the RD cost while changing the LFNST index value in the encoding process.
[0294] In the case of a configuration where the computational complexity for the worst case is adjusted to a certain level or lower (e.g., 8 multiplications / sample), for example, after generating only 8 transform coefficients by multiplying an 8x16 matrix taking only the upper 8 rows of the 16x16 matrix, it is possible to Fig.18 The eight transform coefficients are arranged in a scanning order of , and zeroing can be applied to the remaining coefficient regions. Complexity control for the worst case will be described later.
[0295] 4. When the inverse LFNST is applied, a preset number (e.g., 16) of transform coefficients are set as an input vector, and the LFNST set obtained from process 2 and the LFNST kernel (e.g., a 16×16 matrix) derived from the selected parsed LFNST index are selected, and then by multiplying the LFNST kernel with the corresponding input vector, an output vector can be derived.
[0296] In the case of Mx2 (Mx1) blocks, it is possible to Fig.17 (b) arranges the output vectors in row-major order, and in the case of 2xM (1xM) blocks, it is possible to Fig.17 (a) Arrange the output vector in column-major order.
[0297] The remaining areas except the area in which the corresponding output vector is set within the upper left M×2 (M×1) or 2×M (M×2) area and the area except the upper left M×2 (M×1) or 2×M (M×2) area in the partition block (M×2 area in the partition block) can all be cleared to have a zero value, or can be configured to keep the reconstructed transform coefficient as is through residual coding and inverse quantization processing.
[0298] When configuring the input vector, as in point 3, the input data can be Fig. 20 The scan order arrangement is carried out, and in order to control the computational complexity of the worst case to a certain level or lower, the input vector can be configured by reducing the number of input data (for example, 8 instead of 16).
[0299] For example, when M=8, if 8 input data are used, only the left 16×8 matrix can be taken from the corresponding 16×16 matrix and multiplied to obtain 16 output data. The worst case complexity control will be described later.
[0300] In the above embodiment, when LFNST is applied, the case where symmetry is applied between M×2 (M×1) blocks and 2×M (1×M) blocks is shown, but according to another example, a different LFNST set may be applied to each of the two block shapes.
[0301] Hereinafter, various examples of a mapping method using an intra prediction mode and a LFNST set configuration of an ISP mode will be described.
[0302] In the case of ISP mode, the LFNST set configuration may be different from the existing LFNST set. In other words, a core different from the existing LFNST core may be applied, and a mapping table different from the mapping table between the intra prediction mode index and the LFNST set applied to the current VVC standard may be applied. The mapping table applied to the current VVC standard may be the same as the mapping table of Table 2.
[0303] In Table 2, the preModeIntra value indicates an intra prediction mode value changed in consideration of WAIP, and the lfnstTrSetIdx value is an index value indicating a specific LFNST set. Each LFNST set is configured with two LFNST cores.
[0304] When the ISP prediction mode is applied, if both the horizontal length and the vertical length of each partition block are equal to or greater than 4, the same kernel as the LFNST kernel applied in the current VVC standard can be applied, and the mapping table can be applied as is. A mapping table and LFNST kernel different from the current VVC standard can be applied.
[0305] When the ISP prediction mode is applied, when the horizontal length or vertical length of each partition block is less than 4, a mapping table and an LFNST kernel different from those in the current VVC standard may be applied. Hereinafter, Tables 5 to 7 represent mapping tables between intra prediction mode values (intra prediction mode values changed in consideration of WAIP) and LFNST sets that may be applied to Mx2 (Mx1) blocks or 2xM (1xM) blocks.
[0306] [Table 5]
[0307]
[0308] [Table 6]
[0309]
[0310] [Table 7]
[0311]
[0312] The first mapping table of Table 5 is configured with seven LFNST sets, the mapping table of Table 6 is configured with four LFNST sets, and the mapping table of Table 7 is configured with two LFNST sets. As another example, when it is configured with one LFNST set, the lfnstTrSetIdx value may be fixed to 0 with respect to the preModeIntra value.
[0313] Hereinafter, a method of maintaining the worst-case computational complexity when applying LFNST to the ISP mode will be described.
[0314] In the case of ISP mode, when LFNST is applied, in order to keep the number of multiplications per sample (or per coefficient, per position) to a certain value or less, the application of LFNST may be limited. Depending on the size of the partition block, the number of multiplications per sample (or per coefficient, per position) can be kept to 8 or less by applying LFNST as follows.
[0315] 1. When both the horizontal length and the vertical length of the partition block are 4 or more, the same method as the worst-case computational complexity control method for LFNST in the current VVC standard may be applied.
[0316] That is, when the partition block is a 4×4 block, an 8×16 matrix obtained by sampling the upper 8 rows from the 16×16 matrix may be applied in the forward direction instead of the 16×16 matrix, and a 16×8 matrix obtained by sampling the left 8 columns from the 16×16 matrix may be applied in the reverse direction. In addition, when the partition block is an 8×8 block, in the forward direction, instead of the 16×48 matrix, an 8×48 matrix obtained by sampling the upper 8 rows from the 16×48 matrix is applied, and in the reverse direction, instead of the 48×16 matrix, a 48×8 matrix obtained by sampling the left 8 columns from the 48×16 matrix may be applied.
[0317] In the case of a 4×N or N×4 (N>4) block, when forward transform is performed, 16 coefficients generated after applying the 16×16 matrix to only the upper left 4×4 block may be set in the upper left 4×4 region, and the other regions may be filled with a value of 0. In addition, when inverse transform is performed, the 16 coefficients located in the upper left 4×4 block are set in a scanning order to form an input vector, and then 16 output data may be generated by multiplying the 16×16 matrix. The generated output data may be set in the upper left 4×4 region, and the remaining regions except the upper left 4×4 region may be filled with a value of 0.
[0318] In the case of an 8×N or N×8 (N>8) block, when performing forward transform, the generated 16 coefficients after applying the 16×48 matrix to the ROI region within only the upper left 8×8 block (except for the remaining regions except the lower right 4×4 block from the upper left 8×8 block) can be set in the upper left 4×4 region, and all other regions can be filled with a value of 0. In addition, when performing inverse transform, the 16 coefficients located in the upper left 4×4 region are set in a scan order to form an input vector, and then 48 output data can be generated by multiplying the 48×16 matrix. The generated output data can be filled in the ROI region, and all other regions can be filled with a value of 0.
[0319] 2. When the size of the partition block is N×2 or 2×N and LFNST is applied to the upper left M×2 or 2×M region (M≤N), a matrix sampled according to the N value can be applied.
[0320] In the case of M=8, for a partition block of N=8, i.e., an 8×2 or 2×8 block, in the case of forward transform, an 8×16 matrix obtained by sampling the upper 8 rows from a 16×16 matrix may be applied instead of a 16×16 matrix, and in the case of inverse transform, a 16×8 matrix obtained by sampling the left 8 columns from a 16×16 matrix may be applied instead of a 16×16 matrix.
[0321] When N is greater than 8, in the case of forward transform, 16 output data generated after applying the 16×16 matrix to the upper left 8×2 or 2×8 block are set in the upper left 8×2 or 2×8 block, and the remaining area can be filled with the value 0. In the case of inverse transform, the 16 coefficients located in the upper left 8×2 or 2×8 block are arranged in a scanning order to form an input vector, and then 16 output data can be generated by multiplying the 16×16 matrix. The generated output data can be placed in the upper left 8×2 or 2×8 block, and all the remaining areas can be filled with the value 0.
[0322] 3. When the size of the partition block is N×1 or 1×N and LFNST is applied to the upper left M×1 or 1×M region (M≤N), a matrix sampled according to the N value can be applied.
[0323] When M=16, for a partition block of N=16, i.e., a 16×1 or 1×16 block, in the case of forward transform, an 8×16 matrix obtained by sampling the upper 8 rows from a 16×16 matrix may be applied instead of a 16×16 matrix, and in the case of inverse transform, a 16×8 matrix obtained by sampling the left 8 columns from a 16×16 matrix may be applied instead of a 16×16 matrix.
[0324] When N is greater than 16, in the case of forward transform, 16 output data generated after applying the 16×16 matrix to the upper left 16×1 or 1×16 block can be set in the upper left 16×1 or 1×16 block, and the remaining area can be filled with a value of 0. In the case of inverse transform, the 16 coefficients located in the upper left 16×1 or 1×16 block can be set in a scanning order to form an input vector, and then 16 output data can be generated by multiplying the 16×16 matrix. The generated output data can be set in the upper left 16×1 or 1×16 block, and all remaining areas can be filled with a value of 0.
[0325] As another example, in order to keep the number of multiplications per sample (or per coefficient, per position) to a certain value or less, the number of multiplications per sample (or per coefficient, per position) based on the ISP coding unit size rather than the size of the ISP partition block can be kept to 8 or less. When only one block among the ISP partition blocks meets the conditions for applying LFNST, the worst-case complexity calculation for LFNST can be applied based on the corresponding coding unit size rather than the size of the partition block. For example, the luminance coding block of a coding unit (CU) is divided (or partitioned) into four partition blocks, each of which has a size of 4×4. And, in this article, among the four partition blocks, if there are no non-zero transform coefficients for two partition blocks, each of the remaining two partition blocks can be configured to have 16 transform coefficients generated therein (based on the encoder) instead of 8 transform coefficients.
[0326] Hereinafter, a method for signaling a LFNST index in case of the ISP mode will be described.
[0327] As described above, the LFNST index may have values 0, 1, 2, where 0 indicates that LFNST is not applied, and where 1 and 2 respectively indicate each of two LFNST kernel matrices included in the selected LFNST set. LFNST is applied based on the LFNST kernel matrix selected by the LFNST index. In the current VVC standard, a method according to which LFNST is transmitted will be described as follows.
[0328] 1. LFNST index may be sent once for each coding unit (CU), and in case of dual tree, LFNST index may be signaled separately for each of luma and chroma blocks.
[0329] 2. When the LFNST index is not signaled, the LFNST index is inferred to be 0, which is a default value. The case where the LFNST index value is inferred to be 0 will be described below.
[0330] A. When the mode corresponds to a mode in which transform is not applied (eg, transform skip, BDPCM, lossless coding, etc.).
[0331] B. When the primary transform is not DCT-2 (DST7 or DCT8), that is, when the horizontal transform or the vertical transform is not DCT-2.
[0332] C. When the horizontal length or 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 128×16, LFNST cannot be applied.
[0333] In the case of a 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 transform, and it is checked whether the chroma block exceeds the horizontal / vertical length of the transform of the corresponding luma block available 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 lengths of the corresponding luma block becomes twice the length of the corresponding chroma block, and the transform size of the corresponding luma block becomes twice the size of the corresponding chroma block. As another example, when the color format is 4:4:4, the horizontal / vertical length and transform size of the corresponding luma block are the same as those of the corresponding chroma block.
[0334] A 64-length transform or a 32-length transform means a transform applied to a horizontal or vertical length of 64 or 32, respectively. And, a "transform size" may mean a corresponding length of 64 or 32.
[0335] In the case of a single tree, after checking whether the horizontal length or vertical length of the luma block exceeds the maximum luma transform block size available for transform, LFNST index signaling can be skipped (or omitted) when the length exceeds the transform block size.
[0336] D. The LFNST index may be sent only when both the horizontal length and the vertical length of the coding unit are equal to 4 or greater.
[0337] In the case of a dual tree, the LFNST index may be signaled only when both the horizontal length and the vertical length of the corresponding component (ie, luma component or chroma component) are equal to 4 or more.
[0338] In case of a single tree, when both the horizontal length and the vertical length of the luma component are equal to 4 or more, the LFNST index may be signaled.
[0339] E. When the last non-zero coefficient position is not the DC position (upper left position in the block), if the block is a dual-tree type luma block and if the last non-zero coefficient position is not the DC position, the LFNST index is sent. If the block is a dual-tree type chroma block and if at least one of the last non-zero coefficient position of Cb and the last non-zero coefficient position of Cr is not the DC position, the corresponding LFNST index is sent.
[0340] In case of a single tree type, for any of the luma component, Cb component, and Cr component, if the corresponding last non-zero coefficient position is not the DC position, the LFNST index is transmitted.
[0341] Herein, when a coding block flag (CBF) value indicating the presence or absence of a transform coefficient for one transform block is equal to 0, in order to determine whether to perform LFNST index signaling, the last non-zero coefficient position for the corresponding transform block is not checked. That is, when the corresponding CBF value is equal to 0, since the transform is not applied to the corresponding block, when checking the condition for LFNST index signaling, the last non-zero coefficient position may not be considered.
[0342] For example, 1) in the case of a dual tree type and a luma component, if the corresponding CBF value is equal to 0, the LFNST index is not signaled; 2) in the case of a dual tree type and a chroma component, if the CBF value of Cb is equal to 0 and the CBF value of Cr is equal to 1, only the position of the last non-zero coefficient position of Cr is checked in order to send the corresponding LFNST index; and 3) in the case of a single tree type, only the last non-zero coefficient position of the luma component, the Cb component, or the Cr component, each having a CBF value of 1, is checked.
[0343] F. When the verification transform coefficient exists in a position other than the position where the LFNST transform coefficient can exist, the LFNST index signaling can be skipped (or omitted). In the case of a 4×4 transform block and an 8×8 transform block, according to the transform coefficient scanning order of the VVC standard, the LFNST transform coefficient can exist in 8 positions starting from the DC position, and all the remaining positions can be filled with 0. In addition, in the case where the transform block is not a 4×4 transform block and an 8×8 transform block, according to the transform coefficient scanning order of the VVC standard, the LFNST transform coefficient can exist in 16 positions starting from the DC position, and all the remaining positions can be filled with 0.
[0344] Therefore, after performing residual coding, when non-zero transform coefficients exist in a region that should be filled with only 0 values, LFNST index signaling may be skipped (or omitted).
[0345] In addition, the ISP mode can be applied only to luma blocks or can be applied to both luma blocks and chroma blocks. As described above, when ISP prediction is applied, prediction is performed after the corresponding coding unit is divided (or partitioned) into 2 or 4 partition blocks, and the transform can also be applied to each of the corresponding partition blocks. Therefore, even when determining the conditions for signaling the LFNST index by the coding unit, it should be considered that the LFNST can be applied to each of the corresponding partition blocks. In addition, when the ISP prediction mode is applied only to a specific component (e.g., a luma block), the LFNST index should be signaled based on the fact that the coding unit is divided into partition blocks only for the corresponding component. The LFNST index signaling method that can be used for the ISP mode will be described below.
[0346] 1. LFNST index may be sent once for each coding unit (CU), and in case of dual tree, LFNST index may be signaled separately for each of luma and chroma blocks.
[0347] 2. When the LFNST index is not signaled, the LFNST index is inferred to be 0, which is a default value. The case where the LFNST index value is inferred to be 0 will be described below.
[0348] A. When the mode corresponds to a mode in which transform is not applied (eg, transform skip, BDPCM, lossless coding, etc.).
[0349] B. When the horizontal length or 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 128×16, LFNST cannot be applied.
[0350] Whether to perform LFNST index signaling can be determined based on the size of the partition block rather than the size of the coding unit. That is, when the horizontal length or vertical length of the partition block corresponding to the luma block exceeds the maximum luma transform size available for transform, LFNST index signaling can be skipped (or omitted) and the LFNST index value can be inferred to be 0.
[0351] In the case of a 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, 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 that can be used for the maximum transform. For example, when the color format is 4:2:0, each of the horizontal / vertical lengths of the corresponding luma block becomes twice the length of the corresponding chroma block, and the transform size of the corresponding luma block becomes twice the size of the corresponding chroma block. As another example, when the color format is 4:4:4, the horizontal / vertical length and transform size of the corresponding luma block are the same as those of the corresponding chroma block.
[0352] In the case of a single tree, after checking whether the horizontal length or vertical length of the luma block (coding unit or partition block) exceeds the maximum luma transform block size available for transform, LFNST index signaling can be skipped (or omitted) when the length exceeds the transform block size.
[0353] C. If LFNST included in the current VVC standard is applied, the LFNST index may be transmitted only when both the horizontal length and the vertical length of the partition block are equal to 4 or more.
[0354] In addition to LFNST included in the current VVC standard, if LFNST for 2×M (1×M) or M×2 (M×1) blocks is applied, the LFNST index may be transmitted only when the partition block size is equal to or greater than 2×M (1×M) or M×2 (M×1) blocks. Herein, when a P×Q block is equal to or greater than an R×S block, this means P≥R and Q≥S.
[0355] In summary, the LFNST index may be sent only for the case where the partition block size is equal to or greater than the minimum size to which LFNST may be applied. In the case of a dual tree, the LFNST index may be signaled only when the size of the partition block of the luma component or the chroma component is equal to or greater than the minimum size to which LFNST may be applied. In the case of a single tree, the LFNST index may be signaled only when the size of the partition block of the luma component is equal to or greater than the minimum size to which LFNST may be applied.
[0356] In this specification, when an M×N block is equal to or greater than a K×L block, this means that M is equal to or greater than K and N is equal to or greater than L. When an M×N block is greater than a K×L block, this means that M is equal to or greater than K and N is equal to or greater than L, while M is greater than K or N is greater than L. When an M×N block is less than or equal to a K×L block, this means that M is less than or equal to K and N is less than or equal to L. And, when an M×N block is less than a K×L block, this means that M is less than or equal to K and N is less than or equal to L, while M is less than K or N is less than L.
[0357] D. When the last non-zero coefficient position is not the DC position (upper left position in the block), if the block is a dual-tree type luminance block and even the corresponding last non-zero coefficient position for one of all partition blocks is not the DC position, the LFNST index may be transmitted. If the block is a dual-tree type chrominance block and even one of the last non-zero coefficient positions of all partition blocks for Cb (when the ISP mode is not applied to the chrominance component, it is assumed that the number of partition blocks is equal to 1) and the last non-zero coefficient position of all partition blocks for Cr (when the ISP mode is not applied to the chrominance component, it is assumed that the number of partition blocks is equal to 1) is not the DC position, the corresponding LFNST index may be transmitted.
[0358] In case of a single tree type, for any one of the luma component, the Cb component, and the Cr component, if the corresponding last non-zero coefficient position of even one of all partition blocks is not a DC position, an LFNST index may be transmitted.
[0359] Herein, when a coding block flag (CBF) value indicating the presence or absence of a transform coefficient of each partition block is equal to 0, in order to determine whether to perform LFNST index signaling, the last non-zero coefficient position of the corresponding partition block is not checked. That is, when the corresponding CBF value is equal to 0, since the transform is not applied to the corresponding block, when checking the condition for LFNST index signaling, the last non-zero coefficient position of the corresponding partition block is not considered.
[0360] For example, 1) in the case of a dual tree type and a luma 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 a dual tree type and a 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 to determine whether to perform the corresponding LFNST index signaling; and 3) in the case of a single tree type, only the last non-zero coefficient position of the luma component, Cb component, or Cr component of all partition blocks, each of which has a CBF value of 1, is checked to determine whether to perform LFNST index signaling.
[0361] In the case of the ISP mode, the image information may be configured such that the last non-zero coefficient position is not checked, and a corresponding embodiment will be described below.
[0362] i. In the case of ISP mode, the check of the last non-zero coefficient position of both the luminance block and the chrominance block is skipped, and LFNST index signaling can be authorized. That is, even if the last non-zero coefficient position of all partition blocks is the DC position or has a corresponding CBF value of 0, the corresponding LFNST index signaling can be authorized.
[0363] ii. In the case of ISP mode, only the check of the last non-zero coefficient position of the luma block is skipped, and for the chroma block, the check of the last non-zero coefficient position according to the above method may be performed. For example, in the case of a dual tree type and a luma block, the check of the last non-zero coefficient position is not performed, and LFNST index signaling may be authorized. And, in the case of a dual tree type and a chroma block, the presence or absence of a DC position corresponding to the last non-zero coefficient position is checked according to the above method to determine whether to perform signaling of the corresponding LFNST index.
[0364] iii. In the case of ISP mode and single tree type, method number i and method number ii may be applied. That is, in the case of applying method number i to ISP mode and single tree type, checking of the last non-zero coefficient position of both the luminance block and the chrominance block may be skipped, and LFNST index signaling may be authorized. Alternatively, by applying method number ii, checking of the last non-zero coefficient position of the partition block of the luminance component may be skipped, and checking of the last non-zero coefficient position of the partition block of the chrominance component may be performed according to the above method (when the ISP mode is not applied to the chrominance component, the number of partition blocks may be given to be equal to 1), so as to determine whether to perform the corresponding LFNST index signaling.
[0365] E. For example, when it is verified that a transform coefficient exists in a position other than a position where a LFNST transform coefficient may exist even for one partition block among all partition blocks, LFNST index signaling may be skipped (or omitted).
[0366] For example, in the case of a 4×4 partition block and an 8×8 partition block, according to the transform coefficient scanning order of the VVC standard, the LFNST transform coefficient may be present in 8 positions starting from the DC position, and all remaining positions may be filled with 0. In addition, in the case where the partition block is equal to or greater than 4×4, and in the case where the partition block is not a 4×4 partition block and an 8×8 partition block, according to the transform coefficient scanning order of the VVC standard, the LFNST transform coefficient may be present in 16 positions starting from the DC position, and all remaining positions may be filled with 0.
[0367] Therefore, after performing residual coding, when non-zero transform coefficients exist in a region that should be filled with only 0 values, LFNST index signaling may be skipped (or omitted).
[0368] If LFNST can be applied even for the case where the partition block size is equal to 2×M (1×M) or M×2 (M×1), the area where the LFNST transform coefficient can be located can be specified as described below. The area outside the area where the LFNST transform coefficient can be located can be filled with 0. And, when it is assumed that LFNST has been applied, if there is a non-zero transform coefficient in the area that should be filled with 0, LFNST index signaling can be skipped.
[0369] i. When LFNST can be applied to 2×M or M×2 blocks, and when M=8, only 8 LFNST transform coefficients can be generated for the 2×8 or 8×2 partition blocks. Fig. 20 When the transform coefficients are arranged in the scanning order shown in , 8 transform coefficients are arranged in scanning order starting from the DC position, and the remaining 8 positions can be filled with 0s.
[0370] 16 LFNST transform coefficients can be generated for 2×N or N×2 (N>8) partition blocks. Fig. 20 When the transform coefficients are arranged in the scanning order shown in , 16 transform coefficients are arranged in the scanning order starting from the DC position, and the remaining area can be filled with 0. That is, in a 2×N or N×2 (N>8) partition block, the area excluding the upper left 2×8 or 8×2 block can be filled with 0. Instead of 8 LFNST transform coefficients, 16 coefficient blocks can also be generated for a 2×8 or 8×2 partition block, and in this case, there is no area that needs to be filled with 0. As described above, when LFNST is applied, when a non-zero transform coefficient is detected to exist in an area that is specified to be filled with 0 even in one partition block, LFNST index signaling can be skipped and the LFNST index can be inferred to be 0.
[0371] ii. When LFNST can be applied to a 1×M or M×1 block, and when M=16, only 8 LFNST transform coefficients can be generated for a 1×16 or 16×1 partition block. When the transform coefficients are arranged in a left-to-right or top-to-bottom scan order, 8 transform coefficients are arranged in the corresponding scan order starting from the DC position, and the remaining 8 positions can be filled with 0.
[0372] 16 LFNST transform coefficients may be generated for a 1×N or N×1 partition block (N>16). When the transform coefficients are arranged in a scan order from left to right or from top to bottom, 16 transform coefficients are arranged in a corresponding scan order starting from the DC position, and the remaining area may be filled with 0. That is, in a 1×N or N×1 (N>16) partition block, an area excluding the upper left 1×16 or 16×1 block may be filled with 0.
[0373] Instead of 8 LFNST transform coefficients, 16 coefficient blocks may also be generated for a 1×16 or 16×1 partition block, and in this case, there is no area that needs to be filled with 0. As described above, when LFNST is applied, when a non-zero transform coefficient is detected to exist in an area that is specified to be filled with 0 even in one partition block, LFNST index signaling may be skipped and the LFNST index may be inferred to be 0.
[0374] In addition, in the case of ISP mode, in the current VVC standard, by independently (or separately) referring to the length conditions in the horizontal and vertical directions, DST-7 is applied instead of DCT-2 without performing signaling for the MTS index. Depending on whether the horizontal or vertical length is equal to or greater than 4 and less than or equal to 16, the primary transform kernel is determined. Therefore, in the case of ISP mode, and when LFNST can be applied, the following transform combination can be configured as described below.
[0375] 1. For the case where the LFNST index is 0 (including the case where the LFNST index is inferred to be 0), the conditions for determining the primary transform corresponding to the ISP mode included in the current VVC standard may be followed. That is, by independently (or separately) checking whether the length conditions in the horizontal direction and the vertical direction (ie, the condition that the length is equal to or greater than 4 and less than or equal to 16) are satisfied, if the length condition is satisfied, DST-7 is applied to the primary transform instead of DCT-2. And, if the length condition is not satisfied, DCT-2 may be applied.
[0376] 2. For the case where the LFNST index is greater than 0, the following two configurations may be possible for the primary transform.
[0377] A. DCT-2 can be applied in both horizontal and vertical directions.
[0378] B. The conditions for determining the primary transform corresponding to the ISP mode included in the current VVC standard may be followed. That is, by independently (or separately) checking whether the length conditions in the horizontal direction and the vertical direction (i.e., the condition that the length is equal to or greater than 4 and less than or equal to 16) are met, if the length condition is met, DST-7 is applied instead of DCT-2. And, if the length condition is not met, DCT-2 may be applied.
[0379] In the case of ISP mode, the image information may be configured so that the LFNST index may be transmitted for each partition block instead of for each coding unit. In this case, the above-mentioned LFNST index signaling method assumes that there is only one partition block within the unit through which the LFNST index is transmitted, and it may be determined whether to perform LFNST index signaling.
[0380] Meanwhile, an embodiment of an LFNST core that can be applied to a 2xN or Nx2 (N ≥ 8) partition block when in ISP mode will be shown below. The following LFNST core can be applied to the upper left 2x8 or 8x2 area in a 2xN or Nx2 (N ≥ 8) partition block. And, the corresponding LFNST core can be used in the LFNST described in the above embodiment.
[0381] Each of Tables 8 to 10 shows an example in which the LFNST core is configured by a total of 4 LFNST sets, wherein each LFNST set is configured by two LFNST core candidates (ie, LFNST core matrices). This is a method of selecting a set among the 4 LFNST sets, as shown in Table 2. The LFNST cores proposed in Tables 8 to 10 are defined according to the syntax of the C / C++ programming language. And, in g_lfnst_2x8_8x2[4][2]
[16]
[16] , which is an array storing LFNST core data, [4] indicates that the core is configured by a total of 4 LFNST sets, [2] indicates that each LFNST set is configured by 2 LFNST candidate cores, and
[16]
[16] indicates that each LFNST core is configured by a 16x16 matrix. Each 16x16 matrix shown in Tables 8 to 10 represents a matrix used in the forward LFNST transform. That is, one row becomes a transform base vector (1x16 vector), which is then multiplied by the input data configured by the primary transform coefficients.
[0382] [Table 8]
[0383]
[0384]
[0385]
[0386] [Table 9]
[0387]
[0388]
[0389]
[0390]
[0391] [Table 10]
[0392]
[0393]
[0394]
[0395]
[0396] The following figures are provided to describe specific examples of the present disclosure. Since the specific names of the devices or the names of the specific signals / messages / fields shown in the figures are provided for illustration, the technical features of the present disclosure are not limited to the specific names used in the following figures.
[0397] Fig.19 is a flowchart illustrating the operation of a video decoding device according to an embodiment of this document.
[0398] Fig.19 Each step disclosed in Figures 3 to 18 Therefore, some of the contents described in the above will be omitted or simplified Figures 3 to 18 A detailed description of the overlap described in .
[0399] The decoding apparatus 200 according to the present embodiment may receive residual information from a bitstream.
[0400] More specifically, the decoding device 200 can decode the information about the quantized transform coefficient for the target block from the bitstream and can derive the quantized transform coefficient for the current block based on the information about the quantized transform coefficient for the current block. The information about the quantized transform coefficient for the target block may be included in a sequence parameter set (SPS) or a slice header and may include information about whether a reduced transform (RST) is applied, information about a simplification factor, information about a minimum transform size in which the reduced transform is applied, information about a maximum transform size in which the reduced transform is applied, a reduced inverse transform size, and at least one of information about a transform index indicating any one of transform kernel matrices included in one transform set.
[0401] In addition, the decoding device may also receive information about the intra prediction mode of the current block and information about whether the ISP is applied to the current block. By receiving and parsing flag information indicating whether the ISP code or ISP mode is to be applied, the decoding device may deduce whether the current block is divided (or separated or partitioned) into a predetermined number of sub-partition transform blocks. In this article, the current block may be a coding block. In addition, the decoding device may deduce the size and number of the divided sub-partition blocks by indicating the flag information along which direction the current block is to be divided (or partitioned).
[0402] The decoding apparatus 200 may induce residual information for the current block, that is, induce a transform coefficient by performing dequantization on a quantized transform coefficient ( S1910 ).
[0403] The derived transform coefficients may be arranged (or aligned) in a 4×4 block unit according to a reverse diagonal scanning order, and the transform coefficients within the 4×4 block may also be arranged according to a reverse diagonal scanning order. That is, the transform coefficients processed by dequantization may be arranged according to a reverse scanning order applied to a video codec (e.g., VVC or HEVC).
[0404] The decoding apparatus may derive modified transform coefficients by applying LFNST to the transform coefficients.
[0405] Unlike the primary transform that transforms the coefficients of the transform target separately in the vertical direction or the horizontal direction, LFNST is an inseparable transform that applies the transform without separating the coefficients in a specific direction. This inseparable transmission can be a low-frequency inseparable transform that applies the forward transform only in the low-frequency region rather than the entire block region.
[0406] The LFNST index information is received as syntax information, and the syntax information may be received as a binarized bin string including 0 and 1.
[0407] The syntax element of the LFNST index according to this embodiment may indicate whether inverse LFNST or inverse inseparable transform is being applied, and whether any one of the transform kernel matrices is included in the transform set. Also, when the transform set includes two transform kernel matrices, there may be 3 different syntax element values in the transform index.
[0408] That is, according to an embodiment, the syntax element value for the LFNST index may include: 0, which indicates that the inverse LFNST is not applied to the target block; 1, which indicates the first transform core matrix of the two transform core matrices; and 2, which indicates the second transform core matrix of the two transform core matrices.
[0409] Intra prediction mode information and LFNST index information may be signaled at a coding unit level.
[0410] Meanwhile, the decoding device may determine whether LFNST is applicable to the height and width of the sub-partition block of the partition if ISP is applied to the current block ( S1920 ), and may parse the LFNST index only when LFNST is applicable ( S1930 ).
[0411] The decoding device may determine whether LFNST is applicable to the height and width of the sub-partition block of the partition. In this case, when the height and width of the sub-partition block are equal to 4 or more, the decoding device may parse the LFNST index.
[0412] Additionally, the decoding device may determine whether LFNST is applicable based on the tree type and color format of the current block.
[0413] According to an embodiment, in a case where the tree type of the current block is single-tree or dual-tree luma, when the height and width corresponding to the luma component block of the current block are equal to 4 or more, the decoding apparatus may parse the LFNST index.
[0414] In addition, when ISP is applied to the current block, that is, when the current block is partitioned into sub-partition transform blocks, the decoding device may determine whether LFNST is applicable to the height and width of the partitioned sub-partition blocks. And, in this case, when the height and width of the sub-partition blocks are equal to 4 or more, the decoding device may parse the LFNST index.
[0415] In addition, in case that the tree type of the current block is dual-tree luma or single-tree, when the height and width of the sub-partition block of the luma component block of the current block are equal to 4 or more, the decoding apparatus may parse the LFNST index.
[0416] For example, if the tree type of the current block is dual-tree chroma, ISP may not be applied, and in this case, when the height and width corresponding to the chroma component block of the current block are equal to 4 or more, the decoding device may parse the LFNST index.
[0417] Conversely, if the tree type of the current block is dual-tree luma or single tree instead of dual-tree chroma, depending on whether the ISP is applied to the current block, the decoding device can parse the LFNST index when the height and width of the sub-partition block of the luma component block of the current block or the height and width of the current block are equal to 4 or more.
[0418] According to an embodiment, the current block is a coding unit, and when the width and height of the coding unit are equal to or smaller than the maximum luma transform size available for transform, the decoding apparatus may parse the LFNST index.
[0419] Thereafter, the decoding apparatus may induce a modified transform coefficient from the transform coefficient based on the LFNST index and the LFNST matrix used for LFNST ( S1940 ).
[0420] The decoding apparatus may determine an LFNST set including an LFNST matrix based on the intra prediction mode derived from the intra prediction mode information, and select any one of a plurality of LFNST matrices based on the LFNST set and the LFNST index.
[0421] In this case, the same LFNST set and the same LFNST index can be applied to the sub-partition transform blocks split from the current block. That is, since the same intra prediction mode is applied to the sub-partition transform blocks, the LFNST set determined based on the intra prediction mode can be equally applied to all 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 split from the current block.
[0422] As described above, a transform set may be determined according to an intra prediction mode of a transform block to be transformed, and inverse LFNST may be performed based on any one of the transform kernel matrices (ie, LFNST matrices) included in the transform set indicated by the LFNST index. A matrix applied to inverse LFNST may be referred to as an inverse LFNST matrix or a LFNST matrix, and such a matrix may have any name as long as it has a transposed relationship with a matrix used for forward LFNST.
[0423] In one example, the inverse LFNST matrix may be a non-square matrix in which the number of columns is less than the number of rows.
[0424] A predetermined number of transform coefficients as output data of the LFNST may be derived based on the size of the current block or the sub-partitioned transform block. For example, when the height and width of the current block or the sub-partitioned transform block are 8 or more, 48 transform coefficients may be derived, such as Figure 6 As illustrated on the left side of , and when the width and height of the sub-partition transform block are not 8 or more, that is, when the width or height of the sub-partition transform block is 4 or more and less than 8, 16 transform coefficients may be derived, as Figure 6 As shown in the figure on the right side of .
[0425] like Figure 6 As illustrated, 48 transform coefficients may be arranged in the upper left, upper right, and lower left 4x4 regions of the upper left 8x8 region of the subpartition transform block, and 16 transform coefficients may be arranged in the upper left 4x4 region of the subpartition transform block.
[0426] 48 transform coefficients and 16 transform coefficients may be arranged in the vertical direction or the horizontal direction according to the intra prediction mode of the sub-partition transform block. For example, when the intra prediction mode is based on the diagonal direction ( Figure 4 Mode 34 in the horizontal direction ( Figure 4 2 to 34 in ), the transform coefficients may be arranged in the horizontal direction (ie, in row-first directional order), such as Figure 6 As shown in (a), when the intra prediction mode is based on the diagonal direction is the vertical direction ( Figure 4 , the transform coefficients may be arranged in the horizontal direction (ie, in column-first order) as Figure 6 As shown in (b).
[0427] The decoding apparatus may induce residual samples for the current block based on the inverse primary transform with respect to the modified transform coefficient ( S1950 ).
[0428] At this time, a generally separable transform can be used as the inverse primary transform, and the above-mentioned MTS can also be used.
[0429] Subsequently, the decoding apparatus 200 may generate a reconstructed sample based on the residual sample for the current block and the prediction sample for the current block ( S1960 ).
[0430] The following figures are provided to describe specific examples of the present disclosure. Since the specific names of the devices or the names of specific signals / messages / fields illustrated in the figures are provided for illustration, the technical features of the present disclosure are not limited to the specific names used in the following figures.
[0431] Fig. 20 is a flowchart illustrating the operation of a video encoding device according to an embodiment of this document.
[0432] Fig. 20 Each step disclosed in Figures 3 to 18 Therefore, some of the contents described in the above will be omitted or simplified Figure 1 and Figures 3 to 18 A detailed description of those overlaps described in .
[0433] The encoding apparatus 100 according to an embodiment may induce a prediction sample for a current block based on an intra prediction mode applied to the current block ( S2010 ).
[0434] When ISP is applied to the current block, the encoding apparatus may perform prediction per sub-partitioned transform block.
[0435] The encoding device can determine whether ISP coding or ISP mode is applied to the current block (ie, coding block), determine the direction in which the current block is to be divided according to the determination result, and derive the size and number of divided sub-blocks.
[0436] For example, when the size (width x height) of the current block is 8x4, Fig.14 As illustrated in , the current block may be divided vertically into two sub-blocks, and when the size (width x height) of the current block is 4x8, the current block may be divided horizontally into two sub-blocks. Alternatively, as Fig.15 As illustrated in , when the size (width x height) of the current block is greater than 4x8 or 8x4, that is, when the size of the current block is 1) 4xN or Nx4 (N ≥ 16) or 2) MxN (M ≥ 8, N ≥ 8), the current block can be divided into 4 sub-blocks in the horizontal direction or the vertical direction.
[0437] The same intra prediction mode can be applied to the sub-partition transform blocks divided from the current block, and the encoding device can derive the prediction samples of each sub-partition transform block. That is, the encoding device performs intra prediction in sequence from left to right or from top to bottom, for example, horizontally or vertically, according to the division form of the sub-partition transform blocks. For the leftmost or topmost sub-block, the reconstructed pixels of the already coded coding block are referenced, as in the traditional intra prediction method. In addition, for each side of the subsequent internal sub-partition transform block, when it is not adjacent to the previous sub-partition transform block, in order to derive the reference pixels adjacent to the corresponding side, the reconstructed pixels of the already coded adjacent coding block are referenced, as in the traditional intra prediction method.
[0438] The encoding apparatus 100 may induce a residual sample of the current block based on the prediction sample ( S2020 ).
[0439] In addition, the encoding apparatus 100 may induce a transform coefficient for the current block based on the primary transform of the residual sample ( S2030 ).
[0440] The primary transform may be performed by a plurality of transform cores, and in this case, the transform core may be selected based on the intra prediction mode.
[0441] The encoding apparatus 100 may determine whether to perform a secondary transform or a non-separable transform, more specifically, LFNST, on a transform coefficient of a current block, and may derive a modified transform coefficient by applying LFNST to the transform coefficient.
[0442] Unlike the primary transform that transforms the coefficients of the transform target separately in the vertical direction or the horizontal direction, LFNST is an inseparable transform that applies the transform without separating the coefficients in a specific direction. This inseparable transmission may be a low-frequency inseparable transform that applies the transform only in the low-frequency region rather than the entire target block (which is the transform target).
[0443] The encoding apparatus may determine whether LFNST is applicable to the height and width of the sub-partition block of the partition if the ISP is applied to the current block ( S2040 ).
[0444] The encoding device may determine whether LFNST is applicable to the height and width of the sub-partition block of the partition. In this case, when the height and width of the sub-partition block are equal to 4 or more, the encoding device may encode the LFNST index.
[0445] Additionally, the encoding device may determine whether LFNST is applicable based on the tree type and color format of the current block.
[0446] According to an embodiment, in case that the tree type of the current block is dual-tree chroma, when the height and width corresponding to the chroma component block of the current block are equal to 4 or more, the encoding apparatus may determine that LFNST may be applied.
[0447] In addition, according to an embodiment, in a case where the tree type of the current block is single-tree or dual-tree luma, when the height and width corresponding to the luma component block of the current block are equal to 4 or more, the encoding apparatus may determine that LFNST may be applied.
[0448] For example, if the tree type of the current block is dual-tree chroma, ISP may not be applied, and, in this case, when the height and width corresponding to the chroma component block of the current block are equal to 4 or more, the encoding device may determine that LFNST may be applied.
[0449] On the contrary, if the tree type of the current block is dual-tree luminance or single tree instead of dual-tree chrominance, depending on whether ISP is applied to the current block, the encoding device can determine that LFNST can be applied when the height and width of the sub-partition block of the luminance component block of the current block or the height and width of the current block are equal to 4 or more.
[0450] In addition, according to an embodiment, the current block is a coding unit, and when the width and height of the coding unit are equal to or smaller than the maximum luma transform size available for transform, the encoding apparatus may determine that LFNST may be applied.
[0451] When it is determined that LFNST is to be performed, the encoding apparatus 100 may induce a modified transform coefficient for the current block or the sub-partitioned transform block based on the LFNST set mapped to the intra prediction mode and the LFNST matrix included in the LFNST set ( S2050 ).
[0452] The encoding apparatus 100 may determine an LFNST set based on a mapping relationship according to an intra prediction mode applied to a current block, and perform LFNST (ie, non-separable transform) based on one of two LFNST matrices included in the LFNST set.
[0453] In this case, the same LFNST set and the same LFNST index can be applied to the sub-partition transform blocks split from the current block. That is, since the same intra prediction mode is applied to the sub-partition transform blocks, the LFNST set determined based on the intra prediction mode can also be equally applied to all sub-partition transform blocks. In addition, since the LFNST index is encoded in units of coding units, the same LFNST matrix can be applied to the sub-partition transform blocks split from the current block.
[0454] As described above, the transform set may be determined according to the intra prediction mode of the transform block to be transformed. The matrix applied to LFNST has a transposed relationship with the matrix used for inverse LFNST.
[0455] In one example, the LFNST matrix may be a non-square matrix in which the number of rows is less than the number of columns.
[0456] The region where the transform coefficients used as input data for LFNST are located can be derived based on the size of the sub-partition transform block. For example, when the height and width of the sub-partition transform block are 8 or more, the region is the upper left, upper right, and lower left 4x4 regions of the upper left 8x8 region of the sub-partition transform block, as shown in Figure 6 As shown in the left side of , and when the height and width of the sub-partition transform block are not equal to or greater than 8, the area may be the upper left 4x4 area of the current block, such as Figure 6 As shown in the figure on the right side of .
[0457] In order to perform a multiplication operation using the LFNST matrix, the transform coefficient of the above region may be read in a vertical direction or a horizontal direction according to the intra prediction mode of the sub-partitioned transform block, thereby configuring a one-dimensional vector.
[0458] 48 modified transform coefficients or 16 modified transform coefficients may be read in the vertical direction or the horizontal direction and arranged in one dimension according to the intra prediction mode of the sub-partition transform block. For example, when the intra prediction mode is based on the diagonal direction ( Fig. 9 Mode 34 in the horizontal direction ( Fig. 92 to 34 in ), the transform coefficients may be arranged in the horizontal direction (ie, in row-first directional order), such as Figure 6 As shown in (a), when the intra prediction mode is based on the diagonal direction is the vertical direction ( Fig. 9 , the transform coefficients may be arranged in the horizontal direction (ie, in column-major order) as Figure 6 As shown in (b).
[0459] In one embodiment, the encoding device may include the following steps: determining whether the encoding device is in a condition to apply LFNST, generating and encoding an LFNST index based on the determination, selecting a transform kernel matrix, and applying LFNST to the residual sample based on the selected transform kernel matrix and / or a simplification factor when the encoding device is in a condition to apply LFNST. In this case, the size of the simplified transform kernel matrix may be determined based on the simplification factor.
[0460] The encoding device may derive a quantized transform coefficient by performing quantization based on the modified transform coefficient of the current block, and the encoding device may then encode information about the quantized transform coefficient and, if LFNST is applicable (i.e., if LFNST can be applied), encode an LFNST index indicating an LFNST matrix (S2060).
[0461] The encoding device may generate residual information including information about the quantized transform coefficients. The residual information may include the above-mentioned transform-related information / syntax elements. The encoding device may encode the image / video information including the residual information and output the encoded image / video information in the form of a bitstream.
[0462] More specifically, the encoding apparatus 100 may generate information about a quantized transform coefficient and encode the information about the generated quantized transform coefficient.
[0463] The syntax element of the LFNST index according to the present embodiment may indicate whether to apply (inverse) LFNST and any one LFNST matrix included in the LFNST set, and when the LFNST set includes two transform kernel matrices, the syntax element of the LFNST index may have three values.
[0464] According to an embodiment, when the partition tree structure of the current block is a dual tree type, an LFNST index may be encoded for each of the luma block and the chroma block.
[0465] According to an embodiment, the syntax element value of the transform index may be derived as 0, 1, and 2, 0 indicating a case where (inverse) LFNST is not applied to the current block, 1 indicating a first LFNST matrix in the LFNST matrix, and 2 indicating a second LFNST matrix in the LFNST matrix.
[0466] In the present disclosure, at least one of quantization / dequantization and / or transform / inverse transform may be omitted. When quantization / dequantization is omitted, the quantized transform coefficient may be referred to as a transform coefficient. When transform / inverse transform is omitted, the transform coefficient may be referred to as a coefficient or a residual coefficient, or may still be referred to as a transform coefficient for consistency of expression.
[0467] In addition, in the present disclosure, the quantized transform coefficient and the transform coefficient may be referred to as a transform coefficient and a scaled transform coefficient, respectively. In this case, the residual information may include information about the transform coefficient, and the information about the transform coefficient may be signaled by the residual coding syntax. The transform coefficient may be derived based on the residual information (or information about the transform coefficient), and the scaled transform coefficient may be derived by an inverse transform (scaling) of the transform coefficient. The residual sample may be derived based on an inverse transform (transform) of the scaled transform coefficient. These details may also be applied / expressed in other parts of the present disclosure.
[0468] In the above embodiments, the method is explained based on the flowchart with the aid of a series of steps or boxes, but the present disclosure is not limited to the order of the steps, and a certain step may be performed in an order or step different from the above order or step, or a certain step may be performed concurrently with other steps. In addition, it can be understood by those of ordinary skill in the art that the steps shown in the flowchart are not exclusive, and another step may be incorporated or one or more steps in the flowchart may be deleted without affecting the scope of the present disclosure.
[0469] The above method according to the present disclosure may be implemented in a software form, and the encoding device and / or decoding device according to the present disclosure may be included in a device for image processing such as a television, a computer, a smart phone, a set-top box, a display device, and the like.
[0470] When the embodiments in the present disclosure are implemented by software, the above methods can be implemented as modules (steps, functions, etc.) for performing the above functions. These modules can be stored in a memory and can be executed by a processor. The memory can be inside or outside the processor and can be connected to the processor in various well-known ways. The processor may include an application-specific integrated circuit (ASIC), other chipsets, logic circuits, and / or data processing devices. The memory may include a read-only memory (ROM), a random access memory (RAM), a flash memory, a memory card, a storage medium, and / or other storage devices. That is, the embodiments described in the present disclosure can be implemented and executed on a processor, a microprocessor, a controller, or a chip. For example, the functional units shown in each of the accompanying drawings can be implemented and executed on a computer, a processor, a microprocessor, a controller, or a chip.
[0471] In addition, the decoding device and the encoding device to which the present disclosure is applied may be included in a multimedia broadcast transceiver, a mobile communication terminal, a home theater video device, a digital theater video device, a surveillance camera, a video chat device, a real-time communication device (such as video communication), a mobile streaming device, a storage medium, a camera, a video on demand (VoD) service provider, an over-the-top (OTT) video device, an Internet streaming service provider, a three-dimensional (3D) video device, a video phone video device, and a medical video device, and may be used to process a video signal or a data signal. For example, an over-the-top (OTT) video device may include a game console, a Blu-ray player, an Internet access TV, a home theater system, a smart phone, a tablet PC, a digital video recorder (DVR), etc.
[0472] In addition, the processing method of the present 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 present disclosure can also be stored in a computer-readable storage medium. Computer-readable storage media include various storage devices and distributed storage devices that store computer-readable data. Computer-readable storage media may include, for example, a Blu-ray disc (BD), a universal serial bus (USB), a ROM, a PROM, an EPROM, an EEPROM, a RAM, a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device. In addition, the computer-readable storage medium includes a medium implemented in the form of a carrier (e.g., transmission on the Internet). In addition, the bit stream 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 present disclosure can be implemented as a computer program product through a program code, and the program code can be executed on a computer according to the embodiments of the present disclosure. The program code can be stored on a computer-readable carrier.
[0473] Fig.21An example of a video / image encoding system to which the present disclosure is applicable is schematically illustrated.
[0474] refer to Fig.21 , the video / image coding system may include a first device (source device) and a second device (receiving device). The source device may deliver coded video / image information or data to the receiving device in the form of a file or stream via a digital storage medium or a network.
[0475] The source device may include a video source, an encoding device, and a transmitter. The receiving device may include a receiver, a decoding device, and a renderer. The encoding device may be referred to as a video / image encoding device, and the decoding device may be referred to as a video / image decoding device. The transmitter may be included in the encoding device. The receiver may be included in the decoding device. The renderer may include a display, and the display may be configured as a separate device or an external component.
[0476] The video source can obtain the video / image by capturing, synthesizing or generating the video / image process. The video source may include a video / image capture device and / or a video / image generation device. The video / image capture device may include, for example, one or more cameras, a video / image archive including previously captured videos / images, etc. The video / image generation device may include, for example, a computer, a tablet computer, and a smart phone, and may (electronically) generate the video / image. For example, a virtual video / image may be generated by a computer, etc. In this case, the video / image capture process may be replaced by a process that generates relevant data.
[0477] The encoding device may encode the input video / image. The encoding device may perform a series of processes such as prediction, transformation, and quantization for compression and coding efficiency. The encoded data (encoded video / image information) may be output in the form of a bitstream.
[0478] The transmitter may transmit the encoded video / image information or data output in the form of a bit stream to a receiver of a receiving device in the form of a file or stream through a digital storage medium or a network. The digital storage medium may include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. The transmitter may include an element for generating a media file in a predetermined file format, and may include an element for transmitting through a broadcast / communication network. The receiver may receive / extract a bit stream and transmit the received / extracted bit stream to a decoding device.
[0479] The decoding device may decode a video / image by performing a series of processes such as dequantization, inverse transformation, prediction, etc. corresponding to the operation of the encoding device.
[0480] The renderer can render the decoded video / image, and the rendered video / image can be displayed through a display.
[0481] Fig. 22 The structure of a content streaming system to which the present disclosure is applied is illustrated.
[0482] Furthermore, a content streaming system to which the present disclosure is applied may generally include an encoding server, a streaming server, a web server, a media storage device, a user device, and a multimedia input device.
[0483] The encoding server is used to compress the content input from a multimedia input device such as a smart phone, a camera, a camcorder, etc. into digital data to generate a bitstream, and send it to a streaming server. As another example, in the case where a multimedia input device such as a smart phone, a camera, a camcorder, etc. directly generates a bitstream, the encoding server can be omitted. The bitstream can be generated by applying the encoding method or the bitstream generation method disclosed in the present invention. And the streaming server can temporarily store the bitstream during the process of sending or receiving the bitstream.
[0484] The streaming server sends multimedia data to the user device through the web server based on the user's request, and the web server serves as a tool to inform the user of what services exist. When the user requests the service the user wants, the web server transmits the request to the streaming server, and the streaming server sends the multimedia data to the user. In this regard, the content streaming system may include a separate control server, and in this case, the control server is used to control the command / response between the corresponding devices in the content streaming system.
[0485] The streaming server can receive content from a media storage device and / or an encoding server. For example, in the case of receiving content from an encoding server, the content can be received in real time. In this case, in order to smoothly provide a streaming service, the streaming server can store the bit stream for a predetermined time.
[0486] For example, user devices may include mobile phones, smart phones, laptop computers, digital broadcast terminals, personal digital assistants (PDAs), portable multimedia players (PMPs), navigators, tablet PCs, tablet PCs, ultrabooks, wearable devices (e.g., watch-type terminals (smart watches), glasses-type terminals (smart glasses), head-mounted displays (HMDs)), digital TVs, desktop computers, digital signage, etc. Each server in the content streaming system may operate as a distributed server, and in this case, data received by each server may be processed in a distributed manner.
[0487] The claims disclosed herein may be combined in various ways. For example, the technical features of the method claims of the present disclosure may be combined to be implemented or performed in a device, and the technical features of the device claims may be combined to be implemented or performed in a method. In addition, the technical features of the method claims and the device claims may be combined to be implemented or performed in a device, and the technical features of the method claims and the device claims may be combined to be implemented or performed in a method.
Claims
1. An image decoding method performed by a decoding device, the method comprising: Obtaining residual information from a bitstream; Based on the residual information, deriving a quantized transform coefficient for the current block; deriving transform coefficients for the current block by performing inverse quantization on the quantized transform coefficients; deriving modified transform coefficients by applying a low frequency non-separable transform (LFNST) to the transform coefficients; deriving residual samples for the current block by applying an inverse primary transform to the modified transform coefficients; as well as Based on the residual samples, a reconstructed picture is generated, The derived modified transform coefficients include: Based on intra sub-partitioning (ISP) being applied to the current block, determining a height and a width of a sub-partition block, Resolving LFNST indexes based on the height and width of the sub-partition block, and deriving the modified transform coefficients by applying the LFNST based on a LFNST matrix associated with the LFNST index to the transform coefficients, wherein the LFNST matrix is derived based on a LFNST index in a LFNST set, and the LFNST set is derived based on an intra prediction mode of the current block, and Wherein, in a case where the tree type of the current block is dual-tree luma or single-tree, the LFNST index is parsed based on a height and a width of the sub-partition block corresponding to the luma component block for the current block being equal to 4 or greater.
2. An image encoding method performed by an encoding device, the method comprising: deriving prediction samples for the current block; Based on the prediction samples, deriving residual samples for the current block; deriving transform coefficients for the current block by applying a primary transform to the residual samples; deriving modified transform coefficients by applying a low frequency non-separable transform (LFNST) matrix based LFNST to the transform coefficients; deriving quantized transform coefficients by performing quantization on the modified transform coefficients; as well as encoding residual information about the quantized transform coefficient and an LFNST index associated with the LFNST matrix to output a bitstream, Wherein, deriving the modified transform coefficients comprises: Based on intra sub-partitioning (ISP) being applied to the current block, determining a height and a width of a sub-partition block, wherein the LFNST index is encoded based on the height and width of the sub-partition block, wherein the LFNST matrix is included in a LFNST set, and the LFNST set is derived based on an intra prediction mode of the current block, and Wherein, in a case where the tree type of the current block is dual-tree luma or single-tree, the LFNST index is encoded based on a height and a width of the sub-partition block corresponding to the luma component block for the current block being equal to 4 or more.
3. A method for transmitting image data, the method comprising: obtaining a bitstream for the image, wherein the bitstream is generated based on: deriving prediction samples for a current block, deriving residual samples for the current block based on the prediction samples, deriving transform coefficients for the current block by applying a primary transform to the residual samples, deriving modified transform coefficients by applying a low frequency non-separable transform (LFNST) matrix based on LFNST to the transform coefficients, deriving quantized transform coefficients by performing quantization on the modified transform coefficients, and encoding residual information about the quantized transform coefficients and LFNST indices associated with the LFNST matrix to output a bitstream; as well as sending said data comprising said bit stream, Wherein, deriving the modified transform coefficients comprises: Based on intra sub-partitioning (ISP) being applied to the current block, determining a height and a width of a sub-partition block, wherein the LFNST index is encoded based on the height and width of the sub-partition block, wherein the LFNST matrix is included in a LFNST set, and the LFNST set is derived based on an intra prediction mode of the current block, and Wherein, in a case where the tree type of the current block is dual-tree luma or single-tree, the LFNST index is encoded based on a height and a width of the sub-partition block corresponding to the luma component block for the current block being equal to 4 or more.