Transform-based video coding method and apparatus

The video coding method improves compression efficiency by updating intra prediction modes for chroma blocks based on luma blocks in CCLM mode, enhancing LFNST index coding and secondary transformations for high-resolution, high-quality images/videos.

JP7747864B2Active Publication Date: 2025-10-01LG ELECTRONICS INC

Patent Information

Application Number
JP2024229789
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2019-10-29
Filing Date
2024-12-26
Publication Date
2025-10-01
Estimated Expiration
2040-10-29

AI Technical Summary

Technical Problem

Existing image/video coding technologies face inefficiencies in compressing high-resolution, high-quality images/videos, especially those with diverse characteristics like VR and AR content, leading to increased transmission and storage costs.

Method used

A video coding method that updates intra prediction modes for chroma blocks based on luma blocks in Cross-Component Linear Model (CCLM) mode, using an LFNST transform set, and derives residual samples for improved coding efficiency.

Benefits of technology

Enhances overall image/video compression efficiency by improving LFNST index coding and secondary transformations, particularly in deriving LFNST transform sets using intra modes of luma blocks in CCLM mode.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007747864000039
    Figure 0007747864000039
  • Figure 0007747864000040
    Figure 0007747864000040
  • Figure 0007747864000041
    Figure 0007747864000041
Patent Text Reader

Abstract

To provide an image decoding method.SOLUTION: An image decoding method according to the present document includes the steps of: updating an intra-prediction mode of a chroma block based on an intra-prediction mode of a luma block corresponding to the chroma block, based on the intra-prediction mode of the chroma block being a CCLM (Cross-Component Linear Model) mode; and determining a LFNST set including LFNST matrixes based on the updated intra-prediction mode. The updated intra-prediction mode is derived as an intra-prediction mode corresponding to a specific position in the luma block, and the updated intra-prediction mode is updated as an intra-DC mode based on the intra-prediction mode, that corresponds to the specific position, being an intra-block copy (IBC) mode.SELECTED DRAWING: Figure 16
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

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

[0002] In recent years, demand for high-resolution, high-quality images / videos, such as 4K or 8K or higher UHD (Ultra High Definition) images / videos, has been increasing in various fields. As the resolution and quality of image / video data increases, the amount of information or bits to be transmitted increases relative to existing image / video data. Therefore, when image data is transmitted using existing media such as wired or wireless broadband lines, or when image / video data is stored using existing storage media, transmission costs and storage costs increase.

[0003] In addition, in recent years, interest in and demand for immersive media such as VR (Virtual Reality), AR (Artificial Reality) content and holograms has increased, and broadcasts of images / videos with different image characteristics from real images, such as game images, are on the rise.

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

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

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

[0007] Another technical problem of this document is to provide a method and apparatus for increasing the efficiency of secondary transforms through coding of LFNST indices.

[0008] Another technical problem of this document is to provide a video coding method and apparatus for deriving an LFNST transform set using an intra mode of a luma block when in CCLM mode. [Means for solving the problem]

[0009] According to one embodiment of this document, there is provided a video decoding method executed by a decoding device. The method includes the steps of: updating an intra prediction mode of a chroma block based on an intra prediction mode of a luma block corresponding to the chroma block, when the intra prediction mode of the chroma block is a Cross-Component Linear Model (CCLM) mode; determining an LFNST set having an LFNST matrix based on the updated intra prediction mode; performing LFNST for the chroma block based on the LFNST matrix derived from the LFNST set; and deriving residual samples for the chroma block based on transform coefficients, wherein the updated intra prediction mode is derived as an intra prediction mode corresponding to a specific position within the luma block, and updating the updated intra prediction mode to intra DC mode when the intra prediction mode corresponding to the specific position is an Intra Block Copy (IBC) mode.

[0010] The specific position is set based on the color format of the chroma block.

[0011] The specific position is the center position of the luma block.

[0012] The specific position is set to ((xTbY+(nTbW*SubWidthC) / 2), (yTbY+(nTbH*SubHeightC) / 2)), where xTbY and yTbY indicate the top left coordinate of the luma block, nTbW and nTbH indicate the width and height of the chroma block, and SubWidthC and SubHeightC are variables corresponding to the color format.

[0013] If the color format is 4:2:0, SubWidthC and SubHeightC are 2; if the color format is 4:2:2, SubWidthC is 2 and SubHeightC is 1.

[0014] If the intra prediction mode corresponding to a particular position is the MIP mode, the updated intra prediction mode is the intra planar mode.

[0015] If the intra prediction mode corresponding to a particular position is the palette mode, the updated intra prediction mode is the intra DC mode.

[0016] According to one embodiment of the present document, there is provided a video encoding method executed by an encoding device, the method including: deriving prediction samples for a chroma block based on the fact that an intra prediction mode for the chroma block is a cross-component linear model (CCLM); and deriving residual samples for the chroma block based on the prediction samples, wherein the updated intra prediction mode is derived as an intra prediction mode corresponding to a specific position within the luma block; and updating the updated intra prediction mode to an intra DC mode based on the fact that the intra prediction mode corresponding to the specific position is an intra block copy (IBC) mode.

[0017] According to another embodiment of the present document, there is provided a digital storage medium having stored thereon video data including encoded video information and a bitstream generated by a video encoding method performed by an encoding device.

[0018] According to another embodiment of the present document, there is provided a digital storage medium having stored thereon video data comprising encoded video information and a bitstream that enables a decoding device to perform a video decoding method. [Effects of the Invention]

[0019] According to the document, it can improve overall image / video compression efficiency.

[0020] According to this document, the efficiency of LFNST index coding can be improved.

[0021] According to this document, the efficiency of secondary transformations can be improved through coding of LFNST indexes.

[0022] According to this document, a video coding method and apparatus can be provided for deriving an LFNST transform set using an intra mode of a luma block in CCLM mode.

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

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

[0025] This document may be modified in various ways and may have various embodiments. A specific embodiment will be illustrated in the drawings and described in detail. However, this is not intended to limit this document to the specific embodiment. The terms used in this document are used merely to describe specific embodiments and are not intended to limit the technical ideas of this document. A singular expression includes a plural expression unless the context clearly dictates otherwise. In this specification, terms such as "comprise" or "have" specify the presence of a feature, number, step, operation, component, part, or combination thereof described in the specification, and should be understood not to preclude the presence or addition of one or more other features, numbers, steps, operations, components, parts, or combinations thereof.

[0026] Meanwhile, each component in the drawings described herein is illustrated independently for the convenience of explaining the different characteristic functions, and does not mean that each component is realized by separate hardware or software. For example, two or more components may be combined to form a single component, or a single component may be divided into multiple components. Implementations in which each component is integrated and / or separated are also within the scope of this document as long as they do not deviate from the essence of this document.

[0027] DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Preferred embodiments of the present invention will now be described in more detail with reference to the accompanying drawings. In the following, the same reference numerals will be used to refer to the same components in the drawings, and redundant descriptions of the same components will be omitted.

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

[0029] This document presents various embodiments relating to video / image coding, and unless otherwise stated, the embodiments may also be implemented in combination with each other.

[0030] In this document, video can refer to a collection of a series of images over time. A picture generally refers to a unit that shows an image at a specific time, and a slice / tile is a unit that constitutes part of a picture in coding. A slice / tile can include one or more Coding Tree Units (CTUs). A picture can consist of one or more slices / tiles. A picture can consist of one or more tile groups. A tile group can include one or more tiles.

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

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

[0033] In this document, the terms " / " and "," are interpreted as "and / or." For example, "A / B" is interpreted as "A and / or B," and "A, B" is interpreted as "A and / or B." Additionally, "A / B / C" means "at least one of A, B, and / or C." Also, "A, B, C" means "at least one of A, B, and / or C." (In this document, the terms " / " and "," should be interpreted to indicate "and / or." For instance, the expression "A / B" may mean "A and / or B." Further, "A, B" may mean "A and / or B." Further, "A / B / C" may mean "at least one of A, B, and / or C." Also, "A / B / C" may mean "at least one of A, B, and / or C.")

[0034] Additionally, in this document, "or" should be interpreted as "and / or." For example, "A or B" can mean 1) only "A," or 2) only "B," or 3) "A and B." In other words, the term "or" in this document should be interpreted to indicate "and / or." For instance, the expression "A or B" may comprise 1) only A, 2) only B, and / or 3) both A and B. In other words, the term "or" in this document should be interpreted to indicate "additionally or alternatively."

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

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

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

[0038] In this specification, technical features described separately in one drawing may be embodied separately or simultaneously.

[0039] FIG. 1 illustrates schematically an example of a video / image coding system to which this document can be applied.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[0056] The quantization unit 233 quantizes the transform coefficients and transmits them to the entropy coding unit 240. The entropy coding unit 240 encodes the quantized signal (information about the quantized transform coefficients) and outputs it as a bitstream. The information about the quantized transform coefficients may be referred to as residual information. The quantization unit 233 may rearrange the quantized transform coefficients in a block form into a one-dimensional vector form based on a coefficient scan order and generate information about the quantized transform coefficients based on the quantized transform coefficients in the one-dimensional vector form. The entropy coding unit 240 may perform various encoding methods, such as exponential Golomb, context-adaptive variable length coding (CAVLC), and context-adaptive binary arithmetic coding (CABAC). The entropy coding unit 240 may also encode information required for video / image restoration (e.g., values ​​of syntax elements) together with or separately from the quantized transform coefficients. The encoded information (e.g., encoded video / picture information) may be transmitted or stored in the form of a bitstream in Network Abstraction Layer (NAL) units. The video / picture information may further include information on various parameter sets, such as an Adaptation Parameter Set (APS), a Picture Parameter Set (PPS), a Sequence Parameter Set (SPS), or a Video Parameter Set (VPS). The video / picture information may also include general constraint information. Signaling / transmitted information and / or syntax elements described later in this document may be encoded through the encoding procedure described above and included in the bitstream. The bitstream may be transmitted via a network or stored in a digital storage medium.Here, the network may include a broadcasting network and / or a communication network, and the digital storage medium may include various storage media such as a USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. A transmitter (not shown) that transmits and / or a storage unit (not shown) that stores the signal output from the entropy encoder 240 may be configured as an internal / external element of the encoding device 200, or the transmitter may be included in the entropy encoder 240.

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

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

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

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

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

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

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

[0064] When a bitstream including video / image information is input, the decoding apparatus 300 can reconstruct an image corresponding to the process by which the video / image information was processed by the encoding apparatus of FIG. 2. For example, the decoding apparatus 300 can derive units / blocks based on block division-related information obtained from the bitstream. The decoding apparatus 300 can perform decoding using processing units applied by the encoding apparatus. Accordingly, the processing unit for decoding is, for example, a coding unit, and the coding unit can be divided from a coding tree unit or a maximal coding unit using a quadtree structure, a binary tree structure, and / or a ternary tree structure. One or more transform units can be derived from the coding unit. The reconstructed image signal decoded and output by the decoding apparatus 300 can be played back via a playback device.

[0065] The decoding device 300 may receive a signal output from the encoding device of FIG. 2 in the form of a bitstream and may decode the received signal via the entropy decoding unit 310. For example, the entropy decoding unit 310 may parse the bitstream to derive information (e.g., video / video information) necessary for video restoration (or picture restoration). The video / video information may further include information on various parameter sets, such as an adaptation parameter set (APS), a picture parameter set (PPS), a sequence parameter set (SPS), or a video parameter set (VPS). The video / video information may also include general constraint information. The decoding device may decode pictures based on the information on the parameter sets and / or the general constraint information. Signaling / received information and / or syntax elements, which will be described later in this document, may be decoded through the decoding procedure and obtained from the bitstream. For example, the entropy decoder 310 may decode information in a bitstream based on a coding method such as Exponential-Golomb coding, CAVLC, or CABAC, and output values ​​of syntax elements required for image restoration and quantized values ​​of transform coefficients related to residuals. More specifically, the CABAC entropy decoding method receives bins corresponding to each syntax element in the bitstream, determines a context model using information on the syntax element to be decoded and decoding information on neighboring and current blocks, or information on symbols / bins decoded in previous steps, predicts the occurrence probability of bins based on the determined context model, and performs arithmetic decoding of the bins to generate symbols corresponding to the values ​​of each syntax element.In this case, after determining a context model, the CABAC entropy decoding method can update the context model using information on the decoded symbol / bin for the context model of the next symbol / bin. Prediction-related information from the information decoded by the entropy decoding unit 310 is provided to the prediction unit 330, and information on the residual on which entropy decoding is performed by the entropy decoding unit 310, i.e., quantized transform coefficients and related parameter information, can be input to the inverse quantization unit 321. Filtering-related information from the information decoded by the entropy decoding unit 310 can be provided to the filtering unit 350. A receiving unit (not shown) for receiving a signal output from the encoding device may be further configured as an internal / external element of the decoding device 300, or the receiving unit may be a component of the entropy decoding unit 310. The decoding device according to this document may be referred to as a video / image / picture decoding device, and the decoding device may be divided into an information decoder (video / image / picture information decoder) and a sample decoder (video / image / picture sample decoder). The information decoder may include the entropy decoding unit 310, and the sample decoder may include at least one of the inverse quantization unit 321, the inverse transform unit 322, the prediction unit 330, the addition unit 340, the filtering unit 350, and the memory 360.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[0083] The multi-core transform may refer to a transform method additionally using a Discrete Cosine Transform (DCT) type 2 and a Discrete Sine Transform (DST) type 7, DCT type 8, and / or DST type 1. That is, the multi-core transform may refer to a transform method of transforming a spatial domain residual signal (or a residual block) into a frequency domain transform coefficient (or a primary transform coefficient) based on a plurality of transform kernels selected from the DCT type 2, the DST type 7, the DCT type 8, and the DST type 1. Here, the primary transform coefficient may be referred to as a temporary transform coefficient from the perspective of a transform unit.

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

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

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

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

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

[0089] [Table 1]

[0090] The transform unit may perform a secondary transform based on the (primary) transform coefficients to derive modified (secondary) transform coefficients (S420). The primary transform is a transform from the spatial domain to the frequency domain, and the secondary transform refers to a transform using a correlation between the (primary) transform coefficients to obtain a more compressed representation. The secondary transform may include a non-separable transform. In this case, the secondary transform may be referred to as a non-separable secondary transform (NSST) or a mode-dependent non-separable secondary transform (MDNSST). The non-separable secondary transform may refer to a transform that generates modified transform coefficients (or secondary transform coefficients) for a residual signal by performing a secondary transform on the (primary) transform coefficients derived through the primary transform based on a non-separable transform matrix. Here, based on the non-separable transform matrix, the vertical transform and the horizontal transform may be applied to the (first-order) transform coefficients at once, rather than separately (or independently). That is, the non-separable second-order transform may refer to a transform method in which, instead of being applied separately to the vertical and horizontal directions of the (first-order) transform coefficients, a two-dimensional signal (transform coefficient) is rearranged into a one-dimensional signal in a specific direction (e.g., row-first direction or column-first direction), and then modified transform coefficients (or second-order transform coefficients) are generated based on the non-separable transform matrix. For example, the row-major order is to arrange the first row, second row, ..., Nth row of an MxN block in a row, and the column-major order is to arrange the first column, second column, ..., Mth column of an MxN block in a row. The non-separable quadratic transform can be applied to the top-left region of a block (hereinafter referred to as a transform coefficient block) made up of (first-order) transform coefficients.For example, if the width (W) and height (H) of the transform coefficient block are both equal to or greater than 8, an 8x8 non-separable quadratic transform may be applied to the upper left 8x8 region of the transform coefficient block. Also, if the width (W) and height (H) of the transform coefficient block are both equal to or greater than 4 and the width (W) or height (H) of the transform coefficient block is less than 8, a 4x4 non-separable quadratic transform may be applied to the upper left min(8,W) x min(8,H) region of the transform coefficient block. However, the embodiment is not limited thereto. For example, even if the condition that the width (W) and height (H) of the transform coefficient block are both equal to or greater than 4 is satisfied, a 4x4 non-separable quadratic transform may also be applied to the upper left min(8,W) x min(8,H) region of the transform coefficient block.

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

[0092] The above 4×4 input block X is expressed as follows:

[0093] <Formula 1>

number

[0094] If we express the above X in vector form, the vector JPEG0007747864000003.jpg84 is shown as follows:

[0095] <Formula 2>

number

[0096] As shown in Equation 2, the vector JPEG0007747864000005.jpg84 rearranges the two-dimensional blocks of X in Equation 1 into one-dimensional vectors in row-first order.

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

[0098] <Formula 3>

number

[0099] where: JPEG0007747864000007.jpg75 denotes the transform coefficient vector, and T denotes the 16x16 (non-separable) transform matrix.

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

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

[0102] As described above, the non-separable quadratic transform can be performed based on an 8x8 transform or a 4x4 transform determined based on the width (W) and height (H) of the transform coefficient block. The 8x8 transform refers to a transform that can be applied to an 8x8 region contained within a corresponding transform coefficient block when W and H are both greater than or equal to 8, and the corresponding 8x8 region is the upper-left 8x8 region within the corresponding transform coefficient block. Similarly, the 4x4 transform refers to a transform that can be applied to a 4x4 region contained within a corresponding transform coefficient block when W and H are both greater than or equal to 4, and the corresponding 4x4 region is the upper-left 4x4 region within the corresponding transform coefficient block. For example, the 8x8 transform kernel matrix can be a 64x64 / 16x64 matrix, and the 4x4 transform kernel matrix can be a 16x16 / 8x16 matrix.

[0103] In this case, for mode-based transform kernel selection, two non-separable quadratic transform kernels may be configured per transform set for the non-separable quadratic transform for both the 8×8 transform and the 4×4 transform, resulting in 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 kernels, and each of the four transform sets for the 4×4 transform may include two 4×4 transform kernels.

[0104] However, the size of the above transform, i.e., the size of the region to which the transform is applied, is merely an example, and sizes other than 8x8 or 4x4 can be used, the number of sets is n, and the number of transform kernels in each set is k.

[0105] The transform set may be referred to as an NSST set or an LFNST set. Selection of a particular set from the transform set may be performed based on, for example, the intra prediction mode of the current block (CU or sub-block). A low-frequency non-separable transform (LFNST) is an example of a reduced non-separable transform (described later) and refers to a non-separable transform for low-frequency components.

[0106] For reference, for example, the intra prediction modes may include two non-directional (or non-angular) intra prediction modes and 65 directional (or angular) intra prediction modes. The non-directional intra prediction modes may include a planar intra prediction mode numbered 0 and a DC intra prediction mode numbered 1, and the directional intra prediction modes may include 65 intra prediction modes numbered 2 through 66. However, this is merely an example, and this document may also be applied to cases where the number of intra prediction modes is different. Meanwhile, in some cases, an intra prediction mode numbered 67 may also be used, and the intra prediction mode numbered 67 may indicate a Linear Model (LM) mode.

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

[0108] Referring to FIG. 5, intra prediction modes can be divided into those with horizontal directionality and those with vertical directionality, with the 34th intra prediction mode having a right-down diagonal prediction direction as the center. H and V in FIG. 5 represent horizontal and vertical directionality, respectively, and the numbers -32 to 32 indicate displacements of 1 / 32 units on the sample grid position. This may indicate an offset to the mode index value. The 2nd to 33rd intra prediction modes have horizontal directionality, while the 34th to 66th intra prediction modes have vertical directionality. Meanwhile, the 34th intra prediction mode can be considered neither horizontally nor vertically oriented in the strict sense, but can be classified as belonging to the horizontal direction in terms of determining the transform set for the secondary transform. This is because input data is transposed for vertical modes symmetrical with respect to the 34th intra prediction mode, and an input data alignment method for horizontal modes is used for the 34th intra prediction mode. Transposing the input data means that rows become columns and columns become rows for 2D block data M×N, forming N×M data. The 18th and 50th intra prediction modes indicate horizontal and vertical intra prediction modes, respectively. The 2nd intra prediction mode predicts in an upper-right direction using a left reference pixel, and therefore may be referred to as an upper-right diagonal intra prediction mode. In the same vein, the 34th intra prediction mode may be referred to as a lower-right diagonal intra prediction mode, and the 66th intra prediction mode may be referred to as a lower-left diagonal intra prediction mode.

[0109] For example, the mapping of four transform sets according to intra prediction modes is shown in the following table.

[0110] [Table 2]

[0111] As shown in Table 2, depending on the intra prediction mode, one of four transform sets, i.e., lfnstTrSetIdx, can be mapped to one of 0 to 3, i.e., one of four.

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

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

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

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

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

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

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

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

[0120] Meanwhile, the coefficients constituting the transform kernel, transform matrix, and transform kernel matrix described herein, i.e., kernel coefficients or matrix coefficients, can be expressed in 8 bits. This is one condition for implementation in a decoding device and an encoding device, and it can reduce the memory requirements for storing the transform kernel with a reasonably acceptable performance degradation compared to the existing 9-bit or 10-bit representation. In addition, expressing the kernel matrix in 8 bits allows the use of a small multiplier, making it more compatible with SIMD (Single Instruction Multiple Data) instructions used for optimal software implementation.

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

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

[0123] On the other hand, when the second-order inverse transform is performed based on the RST, the inverse transform unit 235 of the encoding device 200 and the inverse transform unit 322 of the decoding device 300 may include an inverse RST unit that derives modified transform coefficients based on the inverse RST for the transform coefficients, and an inverse linear transform unit that derives residual samples for the current block based on an inverse linear transform for the modified transform coefficients. The inverse linear transform refers to the inverse transform of the linear transform applied to the residual. In this document, deriving transform coefficients based on a transform may refer to deriving transform coefficients by applying the corresponding transform.

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

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

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

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

[0128] The size of the simplified transformation matrix according to an embodiment is R×N, which is smaller than the size N×N of the normal transformation matrix, and can be defined as Equation 4 below.

[0129] <Formula 4>

number

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

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

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

[0133] <Formula 5>

number

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

[0135] <Formula 6>

number

[0136] As a result of the calculation of Equation 6, the transform coefficients c1 to c2 for the target block are R That is, when R=16, the transform coefficients c1 to c2 for the current block can be derived. 16 can be derived. If a regular transform, rather than an RST, is applied and a transform matrix of size 64×64 (N×N) is multiplied by a residual sample of size 64×1 (N×1), 64 (N) transform coefficients for the current block are derived. However, because an RST is applied, only 16 (R) transform coefficients for the current block are derived. Since the total number of transform coefficients for the current block is reduced from N to R, the amount of data transmitted from the encoding device 200 to the decoding device 300 is reduced, and therefore, transmission efficiency between the encoding device 200 and the decoding device 300 can be improved.

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

[0138] In one embodiment, the transform unit 232 of the encoding device 200 may derive transform coefficients for the current block by performing a linear transform and an RST-based secondary transform on residual samples for the current block. These transform coefficients may be transmitted to an inverse transform unit 322 of the decoding device 300, and the inverse transform unit 322 of the decoding device 300 may derive modified transform coefficients based on an inverse Reduced Secondary Transform (RST) on the transform coefficients and derive residual samples for the current block based on an inverse linear transform on the modified transform coefficients.

[0139] Inverse RST matrix T according to one embodiment N×R The size of the simplified transformation matrix T R×N It is in a transpose relationship with

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

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

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

[0143] <Formula 7>

number

[0144] In Formula 7, c1 to c 16 may represent the transform coefficients for the current block. As a result of the operation of Equation 7, r represents the modified transform coefficients for the current block or the residual samples for the current block. i can be derived, and r i The derivation process is as shown in Equation 8.

[0145] <Formula 8>

number

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

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

[0148] Meanwhile, according to one embodiment of the present document, in the transformation of the encoding process, a maximum 16×48 transformation kernel matrix can be applied by selecting only 48 pieces of data, rather than a 16×64 transformation kernel matrix, for 64 pieces of data constituting an 8×8 region. Here, "maximum" means that the maximum value of m is 16 for an m×48 transformation kernel matrix that can generate m coefficients. That is, when RST is performed by applying an m×48 transformation kernel matrix (m≦16) to an 8×8 region, m coefficients can be generated from 48 input pieces of data. When m is 16, 16 coefficients can be generated from 48 input pieces of data. That is, when 48 pieces of data form a 48×1 vector, a 16×48 matrix and a 48×1 vector can be sequentially multiplied to generate a 16×1 vector. In this case, a 48×1 vector can be constructed by appropriately arranging the 48 pieces of data constituting the 8×8 region. For example, a 48×1 vector can be constructed based on 48 pieces of data constituting a region excluding the bottom right 4×4 region of the 8×8 region. In this case, when a matrix operation is performed by applying a maximum 16x48 transform kernel matrix, 16 modified transform coefficients are generated, and the 16 modified transform coefficients can be arranged in the upper left 4x4 area according to the scan order, and the upper right 4x4 area and the lower left 4x4 area can be filled with 0s.

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

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

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

[0152] On the other hand, when the second-order inverse transform is performed based on the RST, the inverse transform unit 235 of the encoding device 200 and the inverse transform unit 322 of the decoding device 300 may include an inverse RST unit that derives modified transform coefficients based on the inverse RST for the transform coefficients, and an inverse linear transform unit that derives residual samples for the current block based on an inverse linear transform for the modified transform coefficients. The inverse linear transform refers to the inverse transform of the linear transform applied to the residual. In this document, deriving transform coefficients based on a transform may refer to deriving transform coefficients by applying the corresponding transform.

[0153] The detailed non-separable transform, LFNST, is as follows: LFNST can include a forward transform by the encoding device and an inverse transform by the decoding device.

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

[0155] [Number 9] y=G T x

[0156] In the above formula 9, x and y are the input and output of the quadratic transformation, respectively, and G is a matrix representing the quadratic transformation, with the transform basis vector being composed of column vectors. In the case of the backward LFNST, when the dimension of the transformation matrix G is expressed as [number of rows × number of columns], in the case of the forward LFNST, the transposed matrix G is G. T It becomes a dimension of.

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

[0158] On the other hand, in the case of forward LFNST, the matrix G T The dimensions of are [16×48], [8×48], [16×16], and [8×16], where the [8×48] and [8×16] matrices are submatrices obtained by sampling eight transformation basis vectors from the upper side of the [16×48] and [16×16] matrices, respectively.

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

[0160] 7 shows an example of the order in which output data from a forward linear transform is arranged into a one-dimensional vector. The left diagrams in (a) and (b) of FIG. 7 show the order in which a [48×1] vector is created, and the right diagrams in (a) and (b) of FIG. 7 show the order in which a [16×1] vector is created. In the case of LFNST, the one-dimensional vector x can be obtained by sequentially arranging 2D data in the order shown in (a) and (b) of FIG.

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

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

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

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

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

[0166] As another example, since the order in which the output vector y is processed in a configuration that performs quantization or residual coding may be performed in a preset order, the output vector y may not be arranged in a 2D block as shown in Figure 8. However, in the case of residual coding, data coding may be performed in units of 2D blocks (e.g., 4x4) such as coefficient groups (CGs), and in this case, data may be arranged in a specific order such as the diagonal scan order of Figure 8.

[0167] Meanwhile, the decoding device can arrange (arrange) two-dimensional data output through an inverse quantization process for inverse transformation according to a preset scanning order to form a one-dimensional input vector y. The input vector y can be output as an input vector x according to the following equation:

[0168] [Number 10] x=Gy

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

[0170] The output vector x is arranged in a two-dimensional block in the order shown in FIG. 7 and arranged as two-dimensional data, and such two-dimensional data becomes input data (or part of the input data) for the inverse linear transformation.

[0171] Therefore, the inverse quadratic transformation is generally the opposite of the forward quadratic transformation process, and in the case of the inverse transformation, unlike the forward transformation, the inverse quadratic transformation is applied first, followed by the inverse linear transformation.

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

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

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

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

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

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

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

[0179] [Table 3]

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

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

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

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

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

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

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

[0187] On the other hand, as mentioned above, which of the [48×16] and [16×16] transformation matrices to apply to LFNST is determined by the size and shape of the block to be transformed.

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

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

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

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

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

[0193] Depending on the block shape, applying the corresponding forward LFNST (4x4 LFNST or 8x8 LFNST) generates 8 or 16 output data (the y vector in Equation 9, an [8x1] or [16x1] vector). In the forward LFNST, the number of output data is equal to or less than the number of input data due to the characteristics of the matrix GT.

[0194] FIG. 11 shows an example of the arrangement of output data from the forward LFNST, and is a diagram showing blocks in which output data from the forward LFNST is arranged depending on the block shape.

[0195] The shaded area at the top left of the block in Figure 11 corresponds to the area where the output data of the forward LFNST is located, and the positions marked with 0 indicate samples filled with the value 0, while the remaining areas indicate areas that are not changed by the forward LFNST. In areas that are not changed by the LFNST, the output data of the forward linear transform remains unchanged.

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

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

[0198] 1) As shown in Figure 11(a), in the upper left corner of the 4x4 block, the 8th position in the scan order or later, i.e., the 9th to 16th samples

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

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

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

[0202] Since a truncated unary code is applied to the binarization method for the LFNST index, the LFNST index consists of a maximum of two bins, and the binary codes for the possible LFNST index values ​​of 0, 1, and 2 are assigned as 0, 10, and 11, respectively. For example, context-based CABAC coding (regular coding) can be applied to the first bin, and context-based CABAC coding can also be applied to the second bin. The coding of the LFNST index can be represented in the following table.

[0203] [Table 4]

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

[0205] Here, the single tree means that the luma component and the chroma component are coded in the same coding structure. After a coding unit is divided in the same coding structure, if the size of the coding unit is below a certain threshold and the luma component and the chroma component are coded in separate tree structures, the coding unit can be regarded as a dual tree and the context of the first bin can be determined. That is, the first context can be assigned as shown in Table 4.

[0206] Alternatively, if the value of the variable treeType is assigned as SINGLE_TREE for the first bin, you can code it using context 0, otherwise you can code it using context 1.

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

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

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

[0210] 12 shows an example in which the number of output data items for the forward LFNST is limited to a maximum of 16. As shown in FIG. 12, when LFNST is applied to the upper left 4×4 region of a 4×N or N×4 block where N is 16 or greater, the number of output data items from the forward LFNST is 16.

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

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

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

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

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

[0216] As shown in FIG. 14, for blocks to which 8×8 LFNST is applied, that is, for blocks (d) and (e) in FIG. 11, the area to which LFNST is not applied can be filled with 0.

[0217] (iii) When LFNST is applied due to the zero-out proposed in (ii) above, the area filled with zeros can change. Therefore, the zero-out proposed in (ii) above allows checking whether non-zero data exists over a wider area than in the case of LFNST in Figure 11.

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

[0219] Of course, even when the zero-out proposed in (ii) above is applied, it is possible to check whether non-zero data exists, as with the existing LFNST index signaling. That is, LFNST index signaling can be applied by checking whether non-zero data exists for blocks filled with zeros in Figure 11. In this case, zero-out is performed only in the encoding device, and the decoding device can perform LFNST index parsing without assuming the corresponding zero-out, that is, by checking whether non-zero data exists only in areas explicitly marked with zeros in Figure 11.

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

[0221] Example

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

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

[0224] When -8×8LFNST is applied, all areas to which 8×8LFNST does not apply are zeroed out → (ii)-(B)

[0225] -For the area filled with the existing value 0 and the area filled with 0 by additional zero-out ((ii)-(A), (ii)-(B)), after checking whether non-zero data exists, LFNST indexing signaling is performed only if non-zero data does not exist → (iii)

[0226] In the above embodiment, when LFNST is applied, the area in which non-zero output data can exist is limited to the interior of the upper left 4x4 area. More specifically, in the cases of (a) in Figure 13 and (a) in Figure 14, the eighth position in the scan order is the last position in which non-zero data can exist, and in the cases of (b) and (d) in Figure 13 and (b) in Figure 14, the sixteenth position in the scan order (i.e., the position at the bottom right of the upper left 4x4 block) is the last position in which non-zero data can exist.

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

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

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

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

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

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

[0233] Secondary transforms such as LFNST increase the overall latency associated with transform execution by adding computational complexity to existing primary transforms. In particular, in the case of intra prediction, reconstruction data from neighboring blocks is used in the prediction process, so the increased latency due to secondary transforms during encoding leads to an increased latency until reconstruction, which can result in an overall increase in latency for intra prediction encoding.

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

[0235] On the other hand, conventional intra prediction performs coding without dividing a block to be currently coded, treating the block as a single coding unit. However, ISP (Intra Sub-Partition) coding means dividing the block to be currently coded horizontally or vertically and performing intra prediction coding. In this case, coding / decoding is performed on the divided block unit to generate a reconstructed block, and the reconstructed block can be used as a reference block for the next divided block. For example, in ISP coding, one coding block can be divided into two or four sub-blocks and coded, and in ISP, one sub-block performs intra prediction by referring to the reconstructed pixel value of the sub-block located to the left or above it. Hereinafter, the term "coding" may be used to refer to both coding performed by an encoding device and decoding performed by a decoding device.

[0236] Meanwhile, the signaling order of the LFNST index and the MTS index will be considered below.

[0237] For example, the LFNST index signaled in residual coding may be coded next to the coding position for the last non-zero coefficient position, and the MTS index may be coded immediately after the LFNST index. In such a configuration, the LFNST index may be signaled for each transform unit. Alternatively, even if not signaled in residual coding, the LFNST index may be coded next to the coding position for the last significant coefficient position, and the MTS index may be coded next to the LFNST index.

[0238] An example of the syntax for residual coding is as follows:

[0239] [Table 5-1]

[0240] [Table 5-2]

[0241] The meanings of the main variables shown in Table 5 are as follows:

[0242] 1. cbWidth, cbHeight: Width and height of the current coding block

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

[0244] 3. sps_lfnst_enabled_flag: A flag indicating whether LFNST can be applied (enabled). If the flag value is 0, LFNST cannot be applied, and if the flag value is 1, LFNST can be applied. This flag is defined in the Sequence Parameter Set (SPS).

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

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

[0247] 6. intra_mip_flag[x0][y0]: The content for the position (x0, y0) is the same as 4 above. intra_mip_flag is a flag indicating whether the MIP (Matrix-based Intra Prediction) prediction mode is applied. If the flag value is 0, it indicates that MIP is not applicable, and if the flag value is 1, it indicates that MIP is applied.

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

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

[0250] 9. tu_cbf_cb[x0][y0]: The contents for position (x0, y0) are the same as those in 4 above. Indicates the CBF (Coded Block Flag) for the Cb component. If the value is 0, it means that no non-zero coefficients exist in the transform unit for the Cb component. If the value is 1, it means that no non-zero coefficients exist in the transform unit for the Cb component.

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

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

[0253] 12. lfnst_idx[x0][y0]: The LFNST index syntax element to be parsed. If not parsed, the value is inferred to be 0. In other words, the default value is set to 0, which indicates that LFNST is not applied.

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

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

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

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

[0258] As shown in Table 5, in the case of a single tree, whether or not an LFNST index can be signaled can be determined based only on the last significant coefficient position condition for luma. That is, if the last significant coefficient position is not DC and the last significant coefficient is located within the upper left sub-block (CG), for example, a 4x4 block, the LFNST index is signaled. In this case, in the case of a 4x4 transform block and an 8x8 transform block, the LFNST index is signaled only if the last significant coefficient is located at a position from 0 to 7 within the upper left sub-block.

[0259] In the case of a dual tree, the LFNST index is signaled independently for luma and chroma, and for chroma, the LFNST index can be signaled by applying the last significant coefficient position condition only to the Cb component.The corresponding condition is not checked for the Cr component, and if the CBF value for Cb is 0, the LFNST index can be signaled by applying the last significant coefficient position condition to the Cr component.

[0260] In Table 5, "Min(log2TbWidth, log2TbHeight) >= 2" can be expressed as "Min(tbWidth, tbHeight) >= 4", and "Min(log2TbWidth, log2TbHeight) >= 4" can be expressed as "Min(tbWidth, tbHeight) >= 16".

[0261] In Table 5, log2ZoTbWidth and log2ZoTbHeight refer to the base-2 log values ​​of the width and height, respectively, for the top-left region where the last significant coefficient can reside due to zeroing out.

[0262] As shown in Table 5, the log2ZoTbWidth and log2ZoTbHeight values ​​can be updated in two places: first, before the MTS index or LFNST index value is parsed, and second, after parsing the MTS index.

[0263] The first update occurs before the MTS index (tu_mts_idx[x0][y0]) value is parsed, so log2ZoTbWidth and log2ZoTbHeight can be set regardless of the MTS index value.

[0264] After the MTS index is parsed, if the MTS index value is greater than 0 (in the case of a DST-7 / DCT-8 combination), log2ZoTbWidth and log2ZoTbHeight are set. When DST-7 / DCT-8 is applied independently to the horizontal and vertical directions in a primary transform, up to 16 significant coefficients can exist per row or column in each direction. That is, after applying a DST-7 / DCT-8 of length 32 or greater, up to 16 transform coefficients can be derived per row or column from the left or top. Therefore, when DST-7 / DCT-8 is applied to both the horizontal and vertical directions for a 2D block, significant coefficients can only exist up to the top-left 16x16 region.

[0265] Additionally, when DCT-2 is applied independently to the horizontal and vertical directions in a primary transform, up to 32 significant coefficients can exist per row or column in each direction. That is, when a DCT-2 with a length of 64 or more is applied, up to 32 transform coefficients can be derived per row or column from the left or top. Therefore, when DCT-2 is applied to both the horizontal and vertical directions for a two-dimensional block, significant coefficients can exist only up to the upper left 32x32 region.

[0266] Also, when DST-7 / DCT-8 is applied to one direction and DCT-2 is applied to the other, there can be 16 significant coefficients in the horizontal direction and 32 significant coefficients in the latter direction. For example, in a 64x8 transform block, when DCT-2 is applied to the horizontal direction and DST-7 is applied to the vertical direction (which can occur when implicit MTS is applied), significant coefficients can exist in the upper left 32x8 region at most.

[0267] When log2ZoTbWidth and log2ZoTbHeight are updated in two places as in Table 5, i.e., before MTS index parsing, the range of last_sig_coeff_x_prefix and last_sig_coeff_y_prefix can be determined by log2ZoTbWidth and log2ZoTbHeight as shown in the table below.

[0268] [Table 6]

[0269] In such a case, the maximum values ​​of last_sig_coeff_x_prefix and last_sig_coeff_y_prefix can be set in a binarization process for last_sig_coeff_x_prefix and last_sig_coeff_y_prefix, reflecting the log2ZoTbWidth and log2TbHeight values.

[0270] [Table 7]

[0271] Meanwhile, as an example, in the case of ISP mode and LFNST application, when the signaling of Table 5 is applied, the spec text can be configured as shown in Table 8. Compared to Table 5, the condition that the LFNST index is signaled only when not in ISP mode (IntraSubPartitionsSplit[x0][y0] == ISP_NO_SPLIT in Table 5) has been deleted.

[0272] In the case of a single tree, if the LFNST index transmitted for luma (cIdx=0) is reused for chroma, the LFNST index transmitted for the first ISP partition block containing significant coefficients can be applied to the chroma transform block. Alternatively, even in the case of a single tree, the LFNST index for the chroma component can be signaled separately from the luma component. The variables listed in Table 8 are described in Table 5.

[0273] [Table 8]

[0274] Meanwhile, according to one example, the LFNST index and / or the MTS index may be signaled at the coding unit level. As described above, the LFNST index may have three values: 0, 1, and 2, where 0 indicates that LFNST is not applied, and 1 and 2 indicate the first and second LFNST kernel candidates, respectively, among the two LFNST kernel candidates included in the selected LFNST set. The LFNST index is coded via truncated unary binarization, and the values ​​0, 1, and 2 may be coded as bin strings 0, 10, and 11, respectively.

[0275] According to one example, the LFNST can be applied only when the DCT-2 is applied to both the horizontal and vertical directions in the primary transform. Therefore, when the MTS index is signaled after the LFNST index signaling, the MTS index can be signaled only if the LFNST index value is 0. If the LFNST index is not 0, the primary transform can be performed by applying the DCT-2 to both the horizontal and vertical directions without signaling the MTS index.

[0276] The MTS index value can have values ​​of 0, 1, 2, 3, and 4, which indicate that DCT-2 / DCT-2, DST-7 / DST-7, DCT-8 / DST-7, DST-7 / DCT-8, and DCT-8 / DCT-8 are applied to the horizontal and vertical directions, respectively. The MTS index can also be coded via truncated unary binarization, where the values ​​0, 1, 2, 3, and 4 can be coded with the bin strings 0, 10, 110, 1110, and 1111, respectively.

[0277] The LFNST index and the MTS index can be signaled at the coding unit level, and the MTS index can be coded after the LFNST index at the coding unit level. The coding unit syntax table for this is as follows:

[0278] [Table 9]

[0279] According to Table 9, in the condition for signaling lfnst_idx[x0][y0], the existing condition for checking whether the value of tu_mts_idx[x0][y0] is 0 (i.e., checking whether both the horizontal and vertical directions are DCT-2) has been changed to a condition for checking whether the value of transform_skip_flag[x0][y0] is 0 (!transform_skip_flag[x0][y0]). transform_skip_flag[x0][y0] indicates whether the coding unit is coded in transform skip mode, in which the transform is omitted, and this flag is signaled before the MTS index and the LFNST index. In other words, because lfnst_idx[x0][y0] is signaled before the value of tu_mtx_idx[x0][y0] is signaled, only the condition for the value of transform_skip_flag[x0][y0] can be checked.

[0280] As shown in Table 9, when coding tu_mts_idx[x0][y0], various conditions are checked and, as mentioned above, tu_mts_idx[x0][y0] is signaled only if the value of lfnst_idx[x0][y0] is 0.

[0281] Also, tu_cbf_luma[x0][y0] is a flag indicating whether or not a significant coefficient exists for the luma component, and cbWidth and cbHeight indicate the width and height of the coding unit for the luma component, respectively.

[0282] Also, in Table 9, (IntraSubPartitionsSplit[x0][y0]==ISP_NO_SPLIT) indicates that the ISP mode is not used, and (!cu_sbt_flag) indicates that SBT is not applied.

[0283] According to Table 9, when the width and height of the coding unit for the luma component are both less than or equal to 32, tu_mts_idx[x0][y0] is signaled, i.e., whether MTS is applicable or not is determined by the width and height of the coding unit for the luma component.

[0284] As another example, when transform block tiling (TU tiling) occurs (e.g., when the maximum transform size is set to 32, a 64x64 coding unit is divided into four 32x32 transform blocks for coding), the MTS index may be signaled based on the size of each transform block. For example, when both the width and height of a transform block are 32 or less, the same MTS index value may be applied to all transform blocks in a coding unit, and the same first-order transform may be applied. Also, when transform block tiling occurs, the value of tu_cbf_luma[x0][y0] in Table 9 is the CBF value for the top-left transform block, or may be set to 1 for all transform blocks if the corresponding CBF value of at least one transform block is 1.

[0285] For example, if the ISP mode is applied to the current block, LFNST can be applied, and in this case, Table 9 can be modified as shown in Table 10.

[0286] [Table 10]

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

[0288] Also, as shown in Table 10, tu_mts_idx[x0][y0] can be signaled only when not in ISP mode, so the MTS index coding part is the same as Table 9.

[0289] If the MTS index is signaled immediately after the LFNST index as in Tables 9 and 10, information about the primary transform cannot be known when performing residual coding. That is, the MTS index is signaled after residual coding. Therefore, the part of the residual coding part where only 16 coefficients are left for a DST-7 or DCT-8 of length 32 and zeroing out is performed can be changed as shown in Table 11 below.

[0290] [Table 11-1]

[0291] [Table 11-2]

[0292] In the process of determining log2ZoTbWidth and log2ZoTbHeight as shown in Table 11 (where log2ZoTbWidth and log2ZoTbHeight respectively represent the base-2 logarithmic values ​​of the width and height for the top-left corner area remaining after zeroing out is performed), the part that checks the value of tu_mts_idx[x0][y0] can be omitted.

[0293] The binarization for last_sig_coeff_x_prefix and last_sig_coeff_y_prefix in Table 11 can be determined based on log2ZoTbWidth and log2ZoTbHeight as in Table 7.

[0294] Also, as shown in Table 11, when determining log2ZoTbWidth and log2ZoTbHeight in residual coding, a condition for checking sps_mts_enable_flag can be added.

[0295] TR in Table 7 indicates a truncated Rice binarization method, and the last significant coefficient information can be binarized based on cMax and cRiceParam defined in Table 7.

[0296] For example, if information about the last significant coefficient position for the luma transform block is recorded during the residual coding process, the MTS index can be signaled as shown in Table 12.

[0297] [Table 12]

[0298] In Table 12, LumaLastSignificantCoeffX and LumaLastSignificantCoeffY respectively indicate the X and Y coordinates of the position of the last significant coefficient for the luma transform block. A condition that LumaLastSignificantCoeffX and LumaLastSignificantCoeffY must all be less than 16 is added to Table 12. If any one of the two is 16 or greater, DCT-2 is applied to both the horizontal and vertical directions. Therefore, it can be inferred that signaling for tu_mts_idx[x0][y0] is omitted and DCT-2 is applied to all of the horizontal and vertical directions.

[0299] If LumaLastSignificantCoeffX and LumaLastSignificantCoeffY are all less than 16, it means that the last significant coefficient is within the upper left 16x16 region, and if a DST-7 or DCT-8 of length 32 is applied in the current VVC standard, there is a possibility that zeroing out has been applied, leaving only 16 transform coefficients from the leftmost or topmost. Therefore, the transform kernel used for the primary transform can be indicated by signaling tu_mts_idx[x0][y0].

[0300] Meanwhile, in another example, the coding unit syntax table, transform unit syntax table, and residual coding syntax table are as shown in the following tables. According to Table 13, the MTS index is moved from the transform unit level to the coding unit level syntax and is signaled after the LFNST index signaling. Furthermore, when ISP is applied to a coding unit, the restriction that does not allow LFNST is removed. When ISP is applied to a coding unit, the restriction that does not allow LFNST is removed, so that LFNST can be applied to all intra-predicted blocks. Furthermore, both the MTS index and the LFNST index are conditionally signaled at the end of the coding unit level.

[0301] [Table 13]

[0302] [Table 14]

[0303] [Table 15]

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

[0305] On the other hand, as shown in Table 13, mts_idx[x0][y0] coding can be omitted if tu_cbf_luma[x0][y0] is 0. That is, if the CBF value of the luma component is 0, no transform is applied, so there is no need to signal the MTS index, and MTS index coding can be omitted.

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

[0307] The variable MtsDcOnly may be initially set to 1 at the coding unit level, and then its value may be changed to 0 if it indicates that a valid coefficient exists in a region excluding the DC region of the current block at the residual coding level. When the variable MtsDcOnly is 0, the video information may be configured so that an MTS index is signaled.

[0308] If tu_cbf_luma[x0][y0] is 0, the variable MtsDcOnly maintains its initial value of 1 because no residual coding syntax is invoked at the transform unit level in Table 14. In this case, the video information can be configured so that the MTS index is not signaled because the variable MtsDcOnly was not changed to 0. That is, the MTS index is not parsed or signaled.

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

[0310] In one example, since MTS can be applied only to the luma component of the current block, the decoding device can determine whether the color index is luma when deriving the variable MtsZeroOutSigCoeffFlag, which determines whether parsing of the MTS index is possible.

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

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

[0313] In this way, when deriving a variable that determines whether parsing of an MTS index is possible, it is determined whether the color component is luma or chroma, but because LFNST can be applied to both the luma and chroma components of the current block, the color component is not determined when deriving a variable that determines whether parsing of an LFNST index is possible.

[0314] For example, Table 13 shows a variable LfnstZeroOutSigCoeffFlag that can indicate that zeroing out has been performed when applying LFNST. The variable LfnstZeroOutSigCoeffFlag indicates whether a valid coefficient exists in a second region excluding the first region at the top left corner of the current block. This value is initially set to 1, and if a valid coefficient exists in the second region, this value can be changed to 0. The LFNST index can be parsed only if the initially set value of the variable LfnstZeroOutSigCoeffFlag is maintained at 1. When determining and deriving whether the value of the variable LfnstZeroOutSigCoeffFlag is 1, the color index of the current block is not determined because LFNST can be applied to both the luma component and the chroma component of the current block.

[0315] FIG. 15 is a diagram illustrating a CCLM that can be applied when deriving an intra prediction mode for a chroma block according to an embodiment.

[0316] In this specification, the term "reference sample template" may refer to a set of reference samples surrounding a current chroma block for predicting the current chroma block. The reference sample template may be predefined, or information about the reference sample template may be signaled from the encoding device 200 to the decoding device 300.

[0317] 15, a set of samples shaded in one line around the 4x4 block that is the current chroma block represents a reference sample template. As can be seen from FIG. 15, the reference sample template is composed of one line of reference samples, whereas the reference sample area in the luma region corresponding to the reference sample template is composed of two lines.

[0318] In one embodiment, when intra-frame coding of a chroma image is performed in the Joint Exploration Test Model (JEM) used by the Joint Video Exploration Team (JVET), a Cross Component Linear Model (CCLM) can be used. CCLM is a method of predicting pixel values ​​of a chroma image using pixel values ​​of a restored luminance image, and is based on the characteristic that there is a high correlation between the luminance image and the chroma image.

[0319] CCLM prediction of Cb and Cr chroma images is performed based on the following formula:

[0320] <Formula 11>

number

[0321] Here, Pred C (i, j) means the predicted Cb or Cr chroma image, and Rec L '(i, j)' means the restored luminance image adjusted to the chroma block size, and (i, j) means the coordinates of a pixel. In the color format 4:2:0, the size of the luminance image is twice that of the chroma image, so the chroma block size is adjusted to the Rec L ' should be generated, and therefore the chroma image Pred c The luminance image pixels used for (i, j) are L In addition to (2i, 2j), all surrounding pixels can be taken into consideration. L '(i,j) may denote the downsampled luma sample.

[0322] For example, the above Rec L '(i, j) can be derived using six surrounding pixels as follows:

[0323] <Formula 12>

number

[0324] Also, α and β represent the cross-correlation and the average value difference between the Cb or Cr chroma block surrounding template and the luminance block surrounding template, as shown in the shaded area in Figure 12. α and β are, for example, as shown in Equation 13 below.

[0325] <Formula 13>

number

[0326] Here, L(n) denotes the peripheral reference samples and / or left peripheral samples of the luma block corresponding to the current chroma image, C(n) denotes the peripheral reference samples and / or left peripheral samples of the current chroma block to which current encoding is applied, and (i, j) denotes a pixel position. L(n) may also denote down-sampled top and / or left peripheral samples of the current luma block. N may also denote the total number of pixel pairs (luminance and chrominance) used in CCLM parameter calculation, and may denote a value that is twice the smaller of the width and height of the current chroma block.

[0327] Meanwhile, a picture may be divided into a sequence of coding tree units (CTUs). A CTU may correspond to a coding tree block (CTB). Alternatively, a CTU may include a coding tree block for a luma sample and a coding tree block for a corresponding chroma sample. The tree type may be classified as a single tree (SINGLE_TREE) or a dual tree (DUAL_TREE) depending on whether a luma block and a corresponding chroma block have separate partition structures. If a chroma block has the same partition structure as the luma block, it is represented as a single tree. If a chroma component block has a different partition structure from the luma component block, it is represented as a dual tree.

[0328] On the other hand, as an example, when applying LFNST to a chroma transform block, it is necessary to refer to information about a collocated luma transform block.

[0329] The existing specification text for the relevant part is shown in the table below.

[0330] [Table 16]

[0331] As shown in Table 16, when the current intra prediction mode is CCLM mode, the variable value predModeIntra for the corresponding chroma transform block is determined using the intra prediction mode value for the co-located luma transform block (the part shown in italics). In this way, the intra prediction mode value of the luma transform block (value of predModeIntra) can be used when determining the LFNST set thereafter.

[0332] However, the variables nTbW and nTbH input as input values ​​of this transform process indicate the width and height of the current transform block. If the current block is a luma transform block, the variables nTbW and nTbH indicate the width and height of the luma transform block, and if the current block is a chroma transform block, the variables nTbW and nTbH indicate the width and height of the chroma transform block.

[0333] In this case, the variables nTbW and nTbH in the italicized portion of Table 16 indicate the width and height of the chroma transform block that do not reflect the color format, and therefore do not accurately indicate the reference position of the luma transform block corresponding to the chroma transform block. Therefore, the italicized portion of Table 16 can be modified as shown in the following table.

[0334] [Table 17]

[0335] As shown in Table 17, nTbW( / 2) and nTbH( / 2) are changed to (nTbW*SubWidthC) / 2 and (nTbH*SubHeightC) / 2, respectively. xTbY and yTbY indicate the position within the current picture relative to the luma (the top-left sample of the current luma transform block relative to the top-left luma sample of the current picture), and nTbW and nTbH can indicate the width and height of the transform block currently being coded (a variable nTbW specifying the width of the current transform block, a variable nTbH specifying the height of the current transform block).

[0336] If the transform block currently being coded is a transform block for chroma (for Cb or Cr), nTbW and nTbH are the width and height of the chroma transform block, respectively. Therefore, if the transform block currently being coded is a chroma transform block (cIdx>0), when determining a reference position for a collocated luma transform block, the reference position must be determined using the width and height of the corresponding luma transform block. SubWidthC and SubHeightC in Table 17 are values ​​set according to the color format (e.g., 4:2:0, 4:2:2, 4:4:4). More specifically, they indicate the width ratio and height ratio of the luma component and the chroma component, respectively (see Table 18 below). Therefore, in the case of a chroma transform block, (nTbW*SubWidthC) and (nTbH*SubHeightC) can be the width and height values ​​of the colocated luma transform block, respectively.

[0337] As a result, the values ​​xTbY+(nTbW*SubWidthC) / 2 and yTbY+(nTbH*SubHeightC) / 2 indicate the center position values ​​within the collocator transform block relative to the top left corner position of the current picture, and therefore can more specifically refer to the collocator transform block.

[0338] [Table 18]

[0339] In Table 17, the predModeIntra variable indicates an intra prediction mode value, and when the variable value predModeIntra is INTRA_LT_CCLM, INTRA_L_CCLM, or INTRA_T_CCLM, it indicates that the current transform block is a transform block for chroma. For example, in the current VVC standard, INTRA_LT_CCLM, INTRA_L_CCLM, and INTRA_T_CCLM correspond to mode values ​​81, 82, and 83, respectively, among the intra prediction mode values. Therefore, as shown in Table 17, the reference position must be found in the co-located transform block using the value xTbY+(nTbW*SubWidthC) / 2 and the value yTbY+(nTbH*SubHeightC) / 2.

[0340] As shown in Table 17, the predModeIntra variable value is updated taking into account both the intra_mip_flag[xTbY+(nTbW*SubWidthC) / 2][yTbY+(nTbH*SubHeightC) / 2] variable and the CuPredMode[0][xTbY+(nTbW*SubWidthC) / 2][yTbY+(nTbH*SubHeightC) / 2] variable.

[0341] The variable intra_mip_flag indicates whether the current transform block (or coding unit) is coded using the MIP (Matrix-based Intra Prediction) method, and intra_mip_flag[x][y] indicates a flag value indicating whether MIP is applicable to a position corresponding to the (x, y) coordinates based on the luma component when the top left corner of the current picture is (0, 0). The x and y coordinates increase from left to right and from top to bottom, respectively. When the flag value indicating whether MIP is applicable is 1, it indicates that MIP is applied. When the flag value indicating whether MIP is applicable is 0, it indicates that MIP is not applied. MIP can only be applied to luma blocks.

[0342] According to the modified content part of Table 17, when the value of intra_mip_flag[xTbY+(nTbW*SubWidthC) / 2][yTbY+(nTbH*SubHeightC) / 2] inside the collocator transformation block is 1, the predModeIntra value is set to planar mode (INTRA_PLANAR).

[0343] The variable CuPredMode[0][xTbY+(nTbW*SubWidthC) / 2][yTbY+(nTbH*SubHeightC) / 2] indicates a prediction mode value corresponding to the coordinates (xTbY+(nTbW*SubWidthC) / 2, yTbY+(nTbH*SubHeightC) / 2) for the luma component, where (0, 0) is the top left corner of the current picture. The prediction mode value may have values ​​MODE_INTRA, MODE_IBC, MODE_PLT, and MODE_INTER, which indicate intra prediction mode, IBC (Intra Block Copy) prediction mode, PLT (Palette) coding mode, and inter prediction mode, respectively. According to Table 17, if the variable value CuPredMode[0][xTbY+(nTbW*SubWidthC) / 2][yTbY+(nTbH*SubHeightC) / 2] is MODE_IBC or MODE_PLT, the value of the variable predModeIntra is set to DC mode. Otherwise, the value of the variable predModeIntra is set to IntraPredModeY[xTbY+(nTbW*SubWidthC) / 2][yTbY+(nTbH*SubHeightC) / 2] (the intra prediction mode value corresponding to the center position inside the collocator transform block).

[0344] For example, based on the value predModeIntra updated in Table 17, the value of the variable predModeIntra can be updated again considering whether wide angle intra prediction is possible as shown in the following table.

[0345] [Table 19]

[0346] The input values ​​of the mapping process presented in Table 19, predModeIntra, nTbW, and nTbH, are the same as the value of the variable predModeIntra updated in Table 17 and nTbW and nTbH referenced in Table 17, respectively.

[0347] In Table 19, nCbW and nCbH respectively refer to the width and height of a coding block corresponding to a corresponding transform block, and the IntraSubPartitionsSplitType variable indicates whether the ISP mode is applied. If IntraSubPartitionsSplitType is ISP_NO_SPLIT, it indicates that the coding unit is not split by ISP (i.e., the ISP mode is not applied). If the value of the variable IntraSubPartitionsSplitType is not ISP_NO_SPLIT, it indicates that the ISP mode is applied and the coding unit is split into two or four partition blocks. In Table 19, cIdx is an index indicating a color component, and if the value of cIdx is 0, it indicates a luma block, and if the value of cIdx is not 0, it indicates a chroma block. The value of predModeIntra output through the mapping process of Table 19 is updated taking into account whether the wide-angle intra prediction (WAIP) mode is applicable.

[0348] For the value of predModeIntra updated through Table 19, the LFNST set can be determined through the mapping relationship as shown in the table below.

[0349] [Table 20]

[0350] In the above table, lfnstTrSetIdx indicates an index for an LFNST set and has values ​​ranging from 0 to 3, so that a total of four LFNST sets are configured. Each LFNST set can be composed of two transformation kernels, i.e., LFNST kernels (depending on the region to which LFNST is applied, the transformation kernel can be a 16x16 matrix or a 16x48 matrix in the forward direction). Which of the two transformation kernels is applied can be specified through signaling of the LFNST index. In addition, whether or not LFNST is applicable can also be specified through the LFNST index. In the current VVC standard, the LFNST index can have values ​​0, 1, or 2, where 0 indicates that LFNST is not applied and 1 and 2 indicate the two transformation kernels, respectively.

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

[0352] FIG. 16 is a flow diagram illustrating the operation of a video decoding device according to one embodiment of this document.

[0353] The steps disclosed in Fig. 16 are based on some of the details detailed in Fig. 4 to Fig. 15. Therefore, the description of specific details that overlap with the details detailed in Fig. 3 to Fig. 15 will be omitted or simplified.

[0354] The decoding device 300 according to an embodiment may obtain intra-prediction mode information and an LFNST index from a bitstream (S1610).

[0355] The intra prediction mode information may include an mpm index indicating one of the mpm candidates in an MPM (Most Probable Mode) list derived based on the intra prediction modes of surrounding blocks (e.g., left and / or upper surrounding blocks) of the current block and additional candidate modes, or remaining (remaining) intra prediction mode information indicating one of the remaining intra prediction modes not included in the mpm candidates.

[0356] The intra mode information may also include flag information sps_cclm_enabled_flag indicating whether CCLM is applied to the current block and information intra_chroma_pred_mode regarding the intra prediction mode for the chroma component.

[0357] The LFNST index information is received in the syntax information, which is received in a binarized bin string containing 0's and 1's.

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

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

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

[0361] The decoding device 300 may derive transform coefficients by performing inverse quantization on residual information for the current block, i.e., quantized transform coefficients, and may arrange the derived transform coefficients in a predetermined scanning order.

[0362] Specifically, the derived transform coefficients may be arranged in a reverse diagonal scan order in units of 4x4 blocks, and the transform coefficients within the 4x4 blocks may also be arranged in a reverse diagonal scan order. That is, the transform coefficients on which inverse quantization has been performed may be arranged in a reverse scan order applied in video codecs such as VVC and HEVC.

[0363] The transform coefficients derived based on such residual information may be dequantized transform coefficients as described above, or may be quantized transform coefficients, i.e., the transform coefficients may be data that can be checked for non-zero data in the current block, regardless of whether they can be quantized or not.

[0364] The decoding device can update the intra prediction mode of the chroma block based on the intra prediction mode of the luma block corresponding to the chroma block, based on the intra prediction mode of the chroma block being CCLM mode, and in particular, can update it to intra DC mode based on the intra prediction mode of the luma block being intra block copy (IBC) mode (S1620).

[0365] The decoding device may derive the intra prediction mode of the chroma block as the CCLM mode based on the intra prediction mode information. For example, the decoding device may receive information about the intra prediction mode of the current chroma block via a bitstream and derive the CCLM mode as the intra prediction mode of the current chroma block based on the information about the intra prediction mode.

[0366] The CCLM mode can include upper left-based CCLM mode, upper side-based CCLM mode or left side CCLM mode.

[0367] As described above, the decoding device can derive residual samples by applying the LFNST, which is a non-separable transform, or the MTS, which is a separable transform, and such transforms can be performed based on an LFNST kernel, i.e., an LFNST index indicating an LFNST matrix, and an MTS index indicating an MTS kernel, respectively.

[0368] Meanwhile, an LFNST set should be determined for LFNST, and the LFNST set has a mapping relationship with the intra prediction mode of the current block.

[0369] For inverse LFNST of a chroma block, the decoding device can update the intra prediction mode of the chroma block based on the intra prediction mode of the luma block corresponding to the chroma block.

[0370] In one example, the updated intra prediction mode may be derived as an intra prediction mode corresponding to a specific position within the luma block, where the specific position may be set based on the color format of the chroma block.

[0371] The specific position is the center position of the luma block and can be expressed as ((xTbY+(nTbW*SubWidthC) / 2), (yTbY+(nTbH*SubHeightC) / 2)).

[0372] At the center position, xTbY and yTbY indicate the top left coordinates of the luma block, i.e., the top left position based on the luma sample for the current transform block, nTbW and nTbH indicate the width and height of the chroma block, and SubWidthC and SubHeightC correspond to variables corresponding to the color format. ((xTbY+(nTbW*SubWidthC) / 2), (yTbY+(nTbH*SubHeightC) / 2)) indicates the middle position of the luma transform block, and IntraPredModeY[xTbY+(nTbW*SubWidthC) / 2][yTbY+(nTbH*SubHeightC) / 2] indicates the intra prediction mode of the luma block for the corresponding position.

[0373] SubWidthC and SubHeightC can be derived as shown in Table 18. That is, if the color format is 4:2:0, SubWidthC and SubHeightC are 2, and if the color format is 4:2:2, SubWidthC is 2 and SubHeightC is 1.

[0374] As shown in Table 17, in order to specify a specific position of a luma block corresponding to a chroma block regardless of the color format, the color format is reflected in the variable indicating the specific position.

[0375] As described above, if the intra prediction mode of the luma block corresponding to a particular position is the IBC mode, the decoding apparatus can update the updated intra prediction mode to the intra DC mode.

[0376] IBC can be implemented similarly to inter-prediction in that it essentially performs prediction within the current picture but derives reference blocks within the current picture, i.e., IBC can utilize at least one of the inter-prediction techniques described in this document.

[0377] Alternatively, according to one example, if the intra prediction mode corresponding to a particular position is the palette mode, the decoding device may set the updated intra prediction mode to the intra DC mode.

[0378] IBC mode or palette mode can be used for content image / moving picture coding such as games, for example, as in Screen Content Coding (SCC). IBC basically performs prediction within the current picture, but can be performed similarly to inter prediction in that it derives reference blocks within the current picture. That is, IBC can use at least one of the inter prediction techniques described in this document. Palette mode can be seen as an example of intra coding or intra prediction. When palette mode is applied, sample values ​​within a picture can be signaled based on information about a palette table and a palette index.

[0379] Alternatively, as another example, if the intra prediction mode of the luma block corresponding to a particular position is a matrix-based intra prediction (hereinafter referred to as MIP) mode, the decoding device can set the updated intra prediction mode to an intra plane mode.

[0380] The MIP mode is also called Affine Linear Weighted Intra Prediction (ALWIP) or Matrix Weighted Intra Prediction (MWIP). When MIP is applied to a current block, a predicted sample for the current block can be derived by: (i) using neighboring reference samples on which an averaging procedure has been performed; (ii) performing a matrix-vector-multiplication procedure; and (iii) further performing horizontal / vertical interpolation procedures as necessary.

[0381] To summarize, if the intra prediction mode for the central position is MIP mode, IBC mode, or palette mode, the intra prediction mode of the chroma block can be updated to a specific mode such as intra planar mode or intra DC mode.

[0382] Of course, if the intra prediction mode of the central position is not MIP mode, IBC mode, or palette mode, the intra prediction mode of the chroma block can be updated to the intra prediction mode of the luma block for the central position to reflect the association between the chroma block and the luma block.

[0383] The decoding device may determine an LFNST set including LFNST matrices based on the updated intra-prediction mode (S1630), and perform LFNST on the chroma blocks based on the LFNST matrices derived from the LFNST set to derive transform coefficients (S1640).

[0384] Any one of the multiple LFNST matrices can be selected from among multiple ones based on the LFNST set and LFNST index.

[0385] As shown in Table 20, the LFNST transform set is derived depending on the intra prediction mode. 81 to 83, which indicate the CCLM mode in the intra prediction mode, are omitted because in the case of the CCLM mode, the LFNST transform set is derived using the intra mode value for the corresponding luma block.

[0386] For example, as shown in Table 20, one of four LFNST sets may be determined depending on the intra prediction mode of the current block, and at this time, the LFNST set to be applied to the current chroma block may also be determined.

[0387] The decoding device can then derive modified transform coefficients for the current chroma block by applying an LFNST matrix to the dequantized transform coefficients to perform an inverse RST, e.g., an inverse LFNST.

[0388] The decoding device may derive residual samples from the transform coefficients through a first inverse transform (S1650), and if the current block is a chroma block, may derive residual samples for the chroma block based on the transform coefficients. MTS may be used as the first inverse transform.

[0389] The decoding device may also generate reconstructed samples based on the residual samples for the current block and the predicted samples for the current block.

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

[0391] FIG. 17 is a flow diagram illustrating the operation of a video encoding device according to one embodiment of this document.

[0392] The steps disclosed in Fig. 17 are based on some of the details detailed in Fig. 4 to Fig. 15. Therefore, the explanation of specific details that overlap with the details detailed in Fig. 2 and Fig. 4 to Fig. 15 will be omitted or simplified.

[0393] The encoding apparatus 200 according to an embodiment may derive prediction samples for the chroma block based on the fact that the intra prediction mode for the chroma block is the CCLM mode (S1710).

[0394] First, the encoding device can derive the intra prediction mode for the chroma block as the CCLM mode.

[0395] For example, the encoding device may determine the intra prediction mode of the current chroma block based on a rate-distortion (RD) cost (or RDO), where the RD cost may be derived based on a sum of absolute differences (SAD). The encoding device may determine the CCLM mode as the intra prediction mode of the current chroma block based on the RD cost.

[0396] The CCLM mode can include an upper left-side based CCLM mode, an upper side based CCLM mode, or a left side based CCLM mode.

[0397] In addition, the encoding apparatus may encode information regarding the intra prediction mode of the current chroma block, and the information regarding the intra prediction mode may be signaled via a bitstream. The prediction-related information of the current chroma block may include information regarding the intra prediction mode.

[0398] An encoding apparatus according to an embodiment may derive residual samples for the chroma blocks based on the predicted samples (S1720).

[0399] An encoding apparatus according to one embodiment can derive transform coefficients for chroma blocks based on a linear transform on residual samples.

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

[0401] For LFNST of a chroma block, the encoding device can update the intra prediction mode of the chroma block based on the intra prediction mode of the luma block corresponding to the chroma block, and can update to intra DC mode based on the intra prediction mode of the luma block being intra block copy (IBC) mode (S1730).

[0402] The encoding device can update the CCLM mode for a chroma block based on the intra prediction mode of the luma block corresponding to the chroma block, as shown in Table 17 (When predModeIntra is equal to either INTRA_LT_CCLM, INTRA_L_CCLM, or INTRA_T_CCLM, predModeIntra is derived as follows:).

[0403] According to one example, the updated intra prediction mode may be derived as an intra prediction mode corresponding to a specific position within the luma block, where the specific position may be set based on the color format of the chroma block.

[0404] The specific position is the center position of the luma block and can be expressed as ((xTbY+(nTbW*SubWidthC) / 2), (yTbY+(nTbH*SubHeightC) / 2)).

[0405] At the center position, xTbY and yTbY indicate the top left coordinates of the luma block, i.e., the top left position based on the luma sample for the current transform block, nTbW and nTbH indicate the width and height of the chroma block, and SubWidthC and SubHeightC correspond to variables corresponding to the color format. ((xTbY+(nTbW*SubWidthC) / 2), (yTbY+(nTbH*SubHeightC) / 2)) indicates the middle position of the luma transform block, and IntraPredModeY[xTbY+(nTbW*SubWidthC) / 2][yTbY+(nTbH*SubHeightC) / 2] indicates the intra prediction mode of the luma block for the corresponding position.

[0406] SubWidthC and SubHeighC can be derived as shown in Table 18. That is, if the color format is 4:2:0, SubWidthC and SubHeightC are 2, and if the color format is 4:2:2, SubWidthC is 2 and SubHeightC is 1.

[0407] As shown in Table 17, in order to specify a specific position of a luma block corresponding to a chroma block regardless of the color format, the color format is reflected in the variable indicating the specific position.

[0408] As described above, if the intra prediction mode of the luma block corresponding to a particular position is the IBC mode, the encoding device can update the updated intra prediction mode to the intra DC mode.

[0409] IBC can be implemented similarly to inter-prediction in that it essentially performs prediction within the current picture but derives reference blocks within the current picture, i.e., IBC can utilize at least one of the inter-prediction techniques described in this document.

[0410] Alternatively, according to one example, if the intra prediction mode corresponding to a particular position is palette mode, the encoding device may set the updated intra prediction mode to intra DC mode.

[0411] IBC mode or palette mode can be used for content picture / moving picture coding such as games, for example, as in Screen Content Coding (SCC). IBC basically performs prediction within the current picture, but can be performed similarly to inter prediction in that it derives reference blocks within the current picture. That is, IBC can utilize at least one of the inter prediction techniques described in this document. Palette mode can be seen as an example of intra coding or intra prediction. When palette mode is applied, sample values ​​within a picture can be signaled based on information about a palette table and a palette index.

[0412] Alternatively, as another example, if the intra prediction mode of the luma block corresponding to a particular position is a matrix-based intra prediction (hereinafter referred to as MIP) mode, the encoding device can set the updated intra prediction mode to an intra plane mode.

[0413] The MIP mode is also called Affine Linear Weighted Intra Prediction (ALWIP) or Matrix Weighted Intra Prediction (MWIP). When MIP is applied to a current block, a predicted sample for the current block can be derived by: (i) using neighboring reference samples on which an averaging procedure has been performed; (ii) performing a matrix-vector-multiplication procedure; and (iii) further performing horizontal / vertical interpolation procedures as necessary.

[0414] To summarize, if the intra prediction mode for the central position is MIP mode, IBC mode, or palette mode, the intra prediction mode of the chroma block can be updated to a specific mode such as intra planar mode or intra DC mode.

[0415] Of course, if the intra prediction mode of the central position is not MIP mode, IBC mode, or palette mode, the intra prediction mode of the chroma block can be updated to the intra prediction mode of the luma block for the central position to reflect the association between the chroma block and the luma block.

[0416] The encoding device may determine an LFNST set including an LFNST matrix based on the updated intra prediction mode (S1740), and perform LFNST on the chroma block based on the residual sample and the LFNST matrix to derive modified transform coefficients (S1750).

[0417] The encoding device can determine a transform set based on a mapping relationship according to the intra prediction mode applied to the current block, and perform LFNST, i.e., non-separable transform, based on one of two LFNST matrices included in the transform set.

[0418] As described above, multiple transform sets can be determined depending on the intra prediction mode of the transform block to be transformed. The matrix applied to LFNST has a transpose relationship with the matrix used in backward LFNST.

[0419] In one example, an LFNST matrix is ​​a non-square matrix with fewer rows than columns.

[0420] The encoding device may perform quantization based on the modified transform coefficients for the current chroma block to derive quantized transform coefficients, and may encode and output video information including information about the quantized transform coefficients, intra-prediction mode information, and an LFNST index indicating an LFNST matrix (S1760).

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

[0422] In one example, the information about the quantized transform coefficients may include at least one of information about whether LFNST is applied, information about a simplification factor, information about a minimum transform size to apply LFNST, and information about a maximum transform size to apply LFNST.

[0423] The encoding device can encode, as intra mode information, flag information sps_cclm_enabled_flag indicating whether CCLM is applied to the current block and information intra_chroma_pred_mode regarding the intra prediction mode for the chroma components.

[0424] The information about the CCLM mode, intra_chroma_pred_mode, can indicate an upper left-side based CCLM mode, an upper side based CCLM mode, or a left side based CCLM mode.

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

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

[0427] In the above-described embodiments, the method is described based on a flowchart as a series of steps or blocks, but this document is not limited to the order of steps, and certain steps may occur in a different order or simultaneously than those described above. Furthermore, those skilled in the art will understand that the steps shown in the flowchart are not exclusive, and other steps may be included, or one or more steps in the flowchart may be deleted without affecting the scope of this document.

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

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

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

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

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

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

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

[0435] The streaming server transmits multimedia data to a user device based on a user request via a web server, and the web server acts as an intermediary that informs the user of available services. When a user requests a desired service from the web server, the web server transmits the request to the streaming server, which then transmits the multimedia data to the user. In this case, the content streaming system may include a separate control server, which controls commands and responses between devices in the content streaming system.

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

[0437] Examples of the user devices include mobile phones, smartphones, laptop computers, digital broadcasting terminals, PDAs (Personal Digital Assistants), PMPs (Portable Multimedia Players), navigation systems, slate PCs, tablet PCs, ULTRABOOK (registered trademark), wearable devices such as smart watches, smart glasses, HMDs (Head Mounted Displays), digital TVs, desktop computers, and digital signatures. Each server in the content streaming system can be operated as a distributed server, and in this case, data received by each server can be processed in a distributed manner.

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

Claims

1. A video decoding method executed by a decoding device, comprising: obtaining intra-prediction mode information and an LFNST index from a bitstream; deriving prediction samples for the chroma block based on the intra prediction mode of the chroma block being a cross-component linear model (CCLM) mode; deriving residual samples by performing a transformation process; The execution of the conversion process comprises: updating the intra prediction mode of the chroma block based on an intra prediction mode of a luma block corresponding to the chroma block; determining an LFNST set including an LFNST matrix based on the updated intra-prediction mode; performing LFNST on the chroma blocks based on the LFNST matrix selected by the LFNST index; The video decoding method, wherein the intra prediction mode of the chroma block is updated to an intra DC mode based on the prediction mode corresponding to a specific position within the luma block being an intra block copy (IBC) mode.

2. A video decoding method as described in Claim 1, wherein the specific position is set based on the color format of the chroma block.

3. The video decoding method according to claim 2 , wherein the specific position is a center position of the luma block.

4. The specific position is set to ((xTbY+(nTbW*SubWidthC) / 2), (yTbY+(nTbH*SubHeightC) / 2)), xTbY and yTbY indicate the coordinates of the top left corner of the luma block, nTbW and nTbH denote the width and height of the chroma block, The video decoding method of claim 3 , wherein SubWidthC and SubHeightC indicate variables corresponding to the color format.

5. If the color format is 4:2:0, SubWidthC and SubHeightC are 2; The video decoding method of claim 4 , wherein SubWidthC is 2 and SubHeightC is 1 if the color format is 4:2:

2.

6. A video encoding method executed by a video encoding device, comprising: deriving prediction samples for the chroma block based on the intra prediction mode for the chroma block being a cross-component linear model (CCLM); deriving residual samples for the chroma block based on the prediction samples; deriving transform coefficients based on the residual samples by performing a transform process; The execution of the conversion process comprises: updating the intra prediction mode of the chroma block based on an intra prediction mode of a luma block corresponding to the chroma block; determining an LFNST set including an LFNST matrix based on the updated intra-prediction mode; performing LFNST on the chroma blocks based on the residual samples and an LFNST matrix selected from the LFNST set; 11. A video encoding method, comprising: updating the intra prediction mode of the chroma block to an intra DC mode based on the prediction mode corresponding to a specific position within the luma block being an intra block copy (IBC) mode.

7. A video encoding method as described in Claim 6, wherein the specific position is set based on the color format of the chroma block.

8. The video encoding method according to claim 7 , wherein the specific position is a center position of the luma block.

9. The specific position is set to ((xTbY+(nTbW*SubWidthC) / 2), (yTbY+(nTbH*SubHeightC) / 2)), xTbY and yTbY indicate the coordinates of the top left corner of the luma block, nTbW and nTbH denote the width and height of the chroma block, The video encoding method of claim 8 , wherein SubWidthC and SubHeightC indicate variables corresponding to the color format.

10. If the color format is 4:2:0, SubWidthC and SubHeightC are 2; The video encoding method of claim 9 , wherein SubWidthC is 2 and SubHeightC is 1 if the color format is 4:2:

2.

11. A method for transmitting data relating to video, comprising: generating a bitstream relating to the video, the bitstream comprising: deriving prediction samples for the chroma block based on the intra prediction mode for the chroma block being a cross-component linear model (CCLM); deriving residual samples for the chroma blocks based on the prediction samples; deriving transform coefficients based on the residual samples by performing a transform process; encoding residual information to generate the bitstream; transmitting the data including the bitstream; The execution of the conversion process comprises: updating the intra prediction mode of the chroma block based on an intra prediction mode of a luma block corresponding to the chroma block; determining an LFNST set including an LFNST matrix based on the updated intra-prediction mode; performing LFNST on the chroma blocks based on the residual samples and an LFNST matrix selected from the LFNST set; The method, wherein the intra prediction mode of the chroma block is updated to an intra DC mode based on the prediction mode corresponding to a particular position within the luma block being an intra block copy (IBC) mode.

Citation Information

Patent Citations

  • Improved intra predictive mode coding method and apparatus

    JP2013541303A

  • Entropy decoding method, and decoding apparatus using the same

    JP2016123119A

Cited By

  • Transform-based image coding method and device therefor

    JP2025172200A