Transform-based video coding method and apparatus
The video coding method enhances compression efficiency by using MTS indexes to parse and encode blocks based on type and zero-out status, addressing the need for efficient compression of high-resolution and immersive media.
Patent Information
- Application Number
- JP2025064169
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2019-10-07
- Filing Date
- 2025-04-09
- Publication Date
- 2026-03-04
- Estimated Expiration
- 2040-10-05
AI Technical Summary
The increasing demand for high-resolution and high-quality images/videos, as well as immersive media, necessitates a highly efficient image/video compression technology to reduce transmission and storage costs while improving coding efficiency.
A video coding method and apparatus that utilizes Modified Transform Skip (MTS) indexes, determining whether to parse MTS based on block type, partition type, and zero-out status, and signals LFNST and MTS indexes at the coding unit level.
Improves overall image/video compression efficiency and transform index coding efficiency by optimizing the parsing and encoding of MTS indexes.
Smart Images

Figure 0007824461000036 
Figure 0007824461000037 
Figure 0007824461000038
Abstract
Description
[Technical Field]
[0001] This document relates to video coding technology, and more particularly to a transform-based video coding method and apparatus in a video coding system. [Background technology]
[0002] Recently, demand for high-resolution, high-quality images / videos such as 4K or 8K or higher UHD (Ultra High Definition) images / videos is increasing in various fields. As the resolution and quality of image / video data increases, the amount of information or bits transmitted increases relatively compared to existing image / video data, which increases transmission and storage costs when transmitting image data using existing media such as wired or wireless broadband lines or storing image / video data using existing storage media.
[0003] In addition, interest and demand for immersive media such as VR (Virtual Reality), AR (Artificial Reality) content and holograms has been increasing recently, and the broadcast of images / videos with different image characteristics from real images, such as game images, is increasing.
[0004] Therefore, a highly efficient image / video compression technology is required 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 transform index coding.
[0007] Another technical problem of this document is to provide a video coding method and apparatus using MTS.
[0008] Another technical problem of this document is to provide a video coding method and apparatus that utilizes MTS indexes. [Means for solving the problem]
[0009] According to an embodiment of the present document, there is provided a video decoding method performed by a decoding device, the method including the steps of: determining whether to parse an MTS index for applying an MTS to a current block; applying the MTS to the current block based on the MTS index to derive a residual sample for the current block; and generating a reconstructed picture based on the residual sample, wherein the determining whether to parse the MTS index is characterized by determining a tree type of the current block, a partition type of the current block, and whether zero-out has been performed on the MTS for the current block.
[0010] If the tree type of the current block is not dual tree chroma and the LFNST index indicating the LFNST kernel to be applied to the current block is 0, the MTS index is parsed.
[0011] If the larger of the width and height of the current block is equal to or smaller than 32, the MTS index is parsed.
[0012] If the current block is not divided into a plurality of sub-partition blocks and sub-block transformation, which divides the current block into coding units and performs transformation, is not applied to the current block, the MTS index is parsed.
[0013] Whether or not zeroing out has been performed on the MTS is determined by determining whether a valid coefficient exists in a second area excluding the first area at the top left corner where a valid transform coefficient can exist in the current block, and if the valid coefficient does not exist in the second area, the MTS index is parsed.
[0014] The LFNST index and the MTS index are signaled at a coding unit level, with the MTS index being signaled immediately after the LFNST index.
[0015] According to an embodiment of the present document, there is provided a video encoding method executed by an encoding device, the method including the steps of: deriving transform coefficients for the current block based on MTS for residual samples; and encoding residual information derived through quantization of the transform coefficients and an MTS index indicating an MTS kernel, wherein the MTS index is encoded based on a tree type of the current block, a partition type of the current block, and whether zero-out has been performed on the MTS for the current block.
[0016] According to another embodiment of the present document, a digital storage medium is provided that stores video data including encoded video information and a bitstream generated by a video encoding method performed by an encoding device.
[0017] According to another embodiment of the present document, there is provided a digital storage medium storing video data including encoded video information and a bitstream that enables a decoding device to perform the video decoding method. [Effects of the Invention]
[0018] According to the document, it can improve overall image / video compression efficiency.
[0019] According to this document, the efficiency of transform index coding can be improved.
[0020] According to this document, a video coding method and device using MTS can be provided.
[0021] According to this document, a video coding method and apparatus using an MTS index can be provided.
[0022] The effects that can be obtained through a specific example of the present specification are not limited to the effects listed above. For example, there may be various technical effects that a person having ordinary skill in the related art can understand or derive from the present specification. Therefore, the specific effects of the present specification are not limited to those explicitly described in the present specification, but may include various effects that can be understood or derive from the technical features of the present specification. [Brief explanation of the drawings]
[0023] [Figure 1] 1 illustrates schematically an example of a video / image coding system to which this document can be applied. [Figure 2] 1 is a diagram illustrating the configuration of a video / image encoding device to which the present 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] 1 illustrates an exemplary structural diagram of a content streaming system to which this document applies. [Figure 5] 1 illustrates a schematic diagram of a multiple conversion technique according to one embodiment of the present document; [Figure 6] An intra-directional mode with 65 prediction directions is shown as an example. [Figure 7] FIG. 1 is a diagram for explaining an RST according to one embodiment of this document. [Figure 8] 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 9] 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 10] FIG. 1 illustrates a wide-angle intra-prediction mode according to one embodiment of the present document. [Figure 11] FIG. 10 is a diagram showing block patterns to which LFNST is applied. [Figure 12] FIG. 10 is a diagram showing an example of an arrangement of output data from a forward LFNST. [Figure 13] 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 14] FIG. 10 is a diagram illustrating zeroing out in a block to which 4×4 LFNST is applied, according to an example. [Figure 15] FIG. 10 is a diagram illustrating zeroing out in a block to which 8×8 LFNST is applied, according to an example. [Figure 16] FIG. 10 is a diagram illustrating zeroing out in a block to which 8×8 LFNST is applied according to another example. [Figure 17] FIG. 10 is a diagram illustrating an example of sub-blocks into which one coding block is divided. [Figure 18] FIG. 10 is a diagram illustrating another example of sub-blocks into which one coding block is divided. [Figure 19] FIG. 10 illustrates the symmetry of an M×2 (M×1) block and a 2×M (1×M) block according to an example. [Figure 20] FIG. 10 is a diagram illustrating an example in which a 2×M block is transposed. [Figure 21] 1 shows an example scanning order for an 8x2 or 2x8 region. [Figure 22] 1 is a flow chart illustrating the operation of a video decoding device according to one embodiment of the present document. [Figure 23]1 is a flow chart illustrating the operation of a video encoding device according to one embodiment of the present document. DETAILED DESCRIPTION OF THE INVENTION
[0024] 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 a specific embodiment and are not intended to limit the technical ideas of this document. The singular expressions include the plural expressions unless the context clearly dictates otherwise. In this specification, the terms "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.
[0025] 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. Embodiments 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.
[0026] 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 designate the same components in the drawings, and redundant descriptions of the same components will be omitted.
[0027] 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.).
[0028] This document presents various embodiments relating to video / image coding, and unless otherwise stated, the embodiments may be implemented in combination with each other.
[0029] In this document, video can refer to a collection of a series of images over time. A picture generally refers to a unit that shows one image at a specific time, and a slice / tile is a unit that constitutes part of a picture in coding. A slice / tile can contain one or more coding tree units (CTUs). One picture can be composed of one or more slices / tiles. One picture can be composed of one or more tile groups. One tile group can contain one or more tiles.
[0030] 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.
[0031] 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.
[0032] 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.")
[0033] 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." Furthermore, in this document, "or" can mean "additionally or alternatively." (Further, in the document, the term "or" 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.")
[0034] As used herein, "at least one of A and B" can mean "only A," "only B," or "both A and B." Additionally, 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."
[0035] 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."
[0036] 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."
[0037] In this specification, technical features individually described in one drawing may be embodied individually or simultaneously.
[0038] FIG. 1 illustrates schematically an example of a video / image coding system to which this document can be applied.
[0039] 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 via a digital storage medium or a network in the form of a file or streaming.
[0040] The source device may include a video source, an encoding device, and a transmitting 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 include a display unit, which may be a separate device or an external component.
[0041] 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.
[0042] An encoding device can encode input video / images. The encoding device can perform a series of procedures such as prediction, transformation, and quantization for compression and coding efficiency. The encoded data (encoded video / image information) can be output in the form of a bitstream.
[0043] The transmitter 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 a 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, SSD, etc. 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.
[0044] The decoding device can decode the video / image by performing a series of steps such as inverse quantization, inverse transform, and prediction, which correspond to the operations of the encoding device.
[0045] The renderer can render the decoded video / image, and the rendered video / image can be displayed via a display unit.
[0046] 2 is a diagram illustrating the configuration of a video / image encoding device to which this document can be applied. Hereinafter, the term "video encoding device" may include a video encoding device.
[0047] Referring to FIG. 2, the encoding apparatus 200 may include an image partitioner 210, a predictor 220, a residual processor 230, an entropy encoder 240, an adder 250, a filter 260, and a memory 270. The predictor 220 may include an inter predictor 221 and an intra predictor 222. The residual processor 230 may include a transformer 232, a quantizer 233, a dequantizer 234, and an inverse transformer 235. The residual processor 230 may further include a subtractor 231. The adder 250 may be referred to as a reconstructor or a reconstructed block generator. The image dividing unit 210, the predicting unit 220, the residual processing unit 230, the entropy encoding unit 240, the adding unit 250, and the filtering unit 260 may be configured by one or more hardware components (e.g., an encoder chipset or a processor) depending on the embodiment. Also, the memory 270 may include a decoded picture buffer (DPB) and may be configured by a digital storage medium. The hardware components may further include the memory 270 as an internal / external component.
[0048] The image division unit 210 may divide an input image (or picture, frame) input to the encoding device 200 into one or more processing units. For example, the processing units may be called coding units (CUs). In this case, the coding units may be recursively divided from a coding tree unit (CTU) or a largest coding unit (LCU) according to a quad-tree, binary-tree, 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 structure. In this case, for example, the quad-tree structure may be applied first, and then the binary tree structure and / or ternary 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 transform coefficients and / or a unit for deriving a residual signal from the transform coefficients.
[0049] The term "unit" can 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 the luma component or only a pixel / pixel value of the chroma component. A sample can also be used as a term corresponding to a pixel or pel in one picture (or image).
[0050] The subtraction unit 231 may subtract a prediction signal (predicted block, prediction sample, or prediction sample array) output from the prediction unit 220 from an input video signal (original block, original sample, or original sample array) to generate a residual signal (residual block, residual sample, or residual sample array), and the generated residual signal is transmitted to the conversion unit 232. The prediction unit 220 may perform prediction on a 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 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 the description of each prediction mode. The prediction information may be encoded by the entropy encoding unit 240 and output in the form of a bitstream.
[0051] The intra prediction unit 222 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 setting. 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.
[0052] 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. 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 in the current picture and temporal neighboring blocks in the reference picture. The reference picture including the reference block and the reference picture including the temporal neighboring blocks may be the same or different. The temporal neighboring blocks may be referred to as collocated reference blocks, collocated CUs (colCUs), etc., and the reference picture including the temporal neighboring blocks may be referred to as collocated pictures (colPics). For example, the inter predictor 221 may construct a motion information candidate list based on neighboring blocks and generate information indicating which candidate is used to derive a motion vector and / or a reference picture index for the current block. Inter prediction may be performed based on various prediction modes. For example, in the case of skip mode and merge mode, the inter predictor 221 may use motion information of neighboring blocks as motion information of the current block. In the case of skip mode, unlike in merge mode, a residual signal is not transmitted.In the case of motion vector prediction (MVP) mode, the motion vector of the neighboring block is used as a motion vector predictor, and the motion vector difference can be signaled to indicate the motion vector of the current block.
[0053] 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, for example, as in 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.
[0054] The prediction signal generated by the inter prediction unit 221 and / or the intra prediction unit 222 may be used to generate a reconstructed signal or a residual signal. The transform unit 232 may generate transform coefficients by applying a transform technique to the residual signal. For example, the transform technique may include a discrete cosine transform (DCT), a discrete sine transform (DST), a graph-based transform (GBT), or a conditionally non-linear transform (CNT). Here, GBT refers to a transform obtained from a graph representing inter-pixel relationship information. CNT refers to a transform obtained based on a prediction signal generated using all previously reconstructed pixels. In addition, the transform process may be applied to pixel blocks having the same square size or non-square blocks of variable sizes.
[0055] The quantization unit 233 quantizes the transform coefficients and transmits them to the entropy encoding unit 240. The entropy encoding 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 one-dimensional vector form of the quantized transform coefficients. The entropy encoding unit 240 may perform various encoding methods, such as exponential Golomb, context-adaptive variable length coding (CAVLC), context-adaptive binary arithmetic coding (CABAC), etc. The entropy encoding unit 240 may also encode information required for video / image restoration (e.g., values of syntax elements) in addition to the quantized transform coefficients, either 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) unit 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 can be transmitted via a network or stored in a digital storage medium. Here, the network can include a broadcasting network and / or a communication network, and the digital storage medium can include various storage media such as a USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. A transmitter (not shown) for transmitting the signal output from the entropy encoding unit 240 and / or a storage unit (not shown) for storing the signal can be configured as an internal / external element of the encoding apparatus 200, or the transmitter can be included in the entropy encoding unit 240.
[0056] The quantized transform coefficients output from the quantizer 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 quantizer 234 and the inverse transformer 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 predictor 220. 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. The generated reconstructed signal may be used for intra prediction of the next current block in the current picture, or may be used for inter prediction of the next picture after filtering, as described below.
[0057] Meanwhile, LMCS (luma mapping with chroma scaling) can be applied during picture encoding and / or reconstruction.
[0058] The filtering unit 260 may apply filtering to the reconstructed signal to improve subjective / objective image quality. For example, the filtering unit 260 may apply various filtering methods to the reconstructed picture to generate a modified reconstructed picture and 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 encoding unit 240, as will be described later in the description of each filtering method. The filtering information may be encoded by the entropy encoding unit 240 and output in the form of a bitstream.
[0059] The modified reconstructed picture transmitted to the memory 270 can be used as a reference picture in the inter prediction unit 221. When inter prediction is applied through this, the encoding apparatus can avoid prediction mismatch between the encoding apparatus 200 and the decoding apparatus, and can also improve coding efficiency.
[0060] The DPB of the memory 270 may store a 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.
[0061] FIG. 3 is a diagram illustrating the configuration of a video / image decoding device to which this document can be applied.
[0062] Referring to FIG. 3, the decoding device 300 may include an entropy decoder 310, a residual processor 320, a predictor 330, an adder 340, a filter 350, and a memory 360. The predictor 330 may include an inter predictor 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 decoding unit 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). In addition, the memory 360 may include a decoded picture buffer (DPB) and may be implemented as a digital storage medium. The hardware components may further include a memory 360 as an internal / external component.
[0063] When a bitstream including video / image information is input, the decoding apparatus 300 can reconstruct an image corresponding to the process in 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 a processing unit applied by the encoding apparatus. Accordingly, the processing unit for decoding is, for example, a coding unit, and the coding unit can be divided into a coding tree unit or a maximal coding unit according to a quad tree structure, a binary tree structure, and / or a ternary tree structure. One or more transform units can be derived from the coding unit. The reconstructed image signal decoded and output by the decoding apparatus 300 can be played back via a playback device.
[0064] The decoding apparatus 300 may receive a signal output from the encoding apparatus of FIG. 2 in the form of a bitstream, and the received signal may be decoded via the entropy decoding unit 310. For example, the entropy decoding unit 310 may parse the bitstream to derive information (e.g., video / video information) necessary for video 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 apparatus may decode pictures based on the information on the parameter set and / or the general constraint information. Signaled / 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 decoding unit 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, 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. In addition, filtering-related information from the information decoded by the entropy decoding unit 310 can be provided to the filtering unit 350. Meanwhile, a receiving unit (not shown) that receives a signal output from the encoding apparatus may be further configured as an internal / external element of the decoding apparatus 300, or the receiving unit may be a component of the entropy decoding unit 310. Meanwhile, the decoding apparatus according to this document may be called a video / image / picture decoding apparatus, and the decoding apparatus may be divided into an information decoder (video / image / picture information decoder) and a sample decoder (video / image / picture sample decoder). The information decoder may include the entropy decoding unit 310, and the sample decoder may include at least one of the inverse quantization unit 321, the inverse transform unit 322, the prediction unit 330, the addition unit 340, the filtering unit 350, and the memory 360.
[0065] The inverse quantization unit 321 may inverse quantize the quantized transform coefficients and output the transform coefficients. The inverse quantization unit 321 may rearrange the quantized transform coefficients in a two-dimensional block format. In this case, the rearrangement may be performed based on the coefficient scanning order performed in the encoding apparatus. The inverse quantization unit 321 may perform inverse quantization on the quantized transform coefficients using a quantization parameter (e.g., quantization step size information) to obtain transform coefficients.
[0066] The inverse transform unit 322 inversely transforms the transform coefficients to obtain a residual signal (residual block, residual sample array).
[0067] The prediction unit may perform prediction on a 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 information about the prediction output from the entropy decoding unit 310, and may determine a specific intra / inter prediction mode.
[0068] The predictor may generate a prediction signal based on various prediction methods, which will be described later. For example, the predictor may 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, for example, as in 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.
[0069] The intra prediction unit 331 may predict a current block by referring to samples in a 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 intra prediction unit 331 may also determine a prediction mode to be applied to the current block by using prediction modes applied to neighboring blocks.
[0070] The inter prediction unit 332 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. 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 (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.
[0071] The adder 340 may generate a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample array) by adding the acquired residual signal to the predicted signal (predicted block, predicted sample array) output from the predictor 330. 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.
[0072] The adder 340 may be referred to as a reconstruction unit or a reconstruction block generator. The generated reconstruction signal may be used for intra prediction of 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.
[0073] Meanwhile, LMCS (luma mapping with chroma scaling) can be applied during picture decoding.
[0074] The filtering unit 350 may apply filtering to the reconstructed signal to improve subjective / objective image quality. For example, the filtering unit 350 may apply various filtering methods to the reconstructed picture to generate a modified reconstructed picture, and may transmit the modified reconstructed picture to the memory 360, specifically, to the DPB of the memory 360. The various filtering methods may include, for example, deblocking filtering, sample adaptive offset, an adaptive loop filter, a bilateral filter, etc.
[0075] The (modified) reconstructed picture stored in the DPB of the memory 360 can be used as a reference picture in the inter predictor 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.
[0076] In this specification, the embodiments described for the prediction unit 330, inverse quantization unit 321, inverse transform unit 322, and filtering unit 350 of the decoding device 300 can 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.
[0077] 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 an encoding device and a decoding device. The encoding device signals information (residual information) regarding the residual between the original block and the predicted block, rather than the original sample values of the original block, to the decoding device, thereby improving video coding efficiency. The decoding device derives a residual block including residual samples based on the residual information, combines the residual block with the predicted block to generate a reconstructed block including reconstructed samples, and generates a reconstructed picture including the reconstructed block.
[0078] The residual information may be generated through a transform and quantization procedure. For example, an encoding apparatus 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 (via a bitstream) to a decoding apparatus. 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 apparatus may derive residual samples (or residual blocks) by performing an inverse quantization / inverse transform procedure based on the residual information. The decoding apparatus may generate a reconstructed picture based on the predicted block and the residual block. The encoding apparatus may also derive a residual block by inverse quantizing / inverse transforming the quantized transform coefficients for reference for inter-prediction of a future picture, and generate a reconstructed picture based on the residual block.
[0079] FIG. 4 exemplarily shows a structural diagram of a content streaming system to which this document applies.
[0080] Additionally, the content streaming system to which this document applies may include to a large extent encoding servers, streaming servers, web servers, media stores, user devices, and multimedia input devices.
[0081] The encoding server compresses content input from a multimedia input device such as a smartphone, camera, camcorder, etc. 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, camcorder, etc. 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 applies, and the streaming server can temporarily store the bitstream during the process of transmitting or receiving the bitstream.
[0082] 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 to inform 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.
[0083] The streaming server can receive content from a media repository and / or an encoding server. For example, if content is received from the encoding server, the content can be received in real time. In this case, the streaming server can store the bitstream for a certain period of time to provide a smooth streaming service.
[0084] Examples of the user devices include mobile phones, smartphones, laptop computers, digital broadcasting terminals, personal digital assistants (PDAs), portable multimedia players (PMPs), navigation systems, slate PCs, tablet PCs, ultrabooks, wearable devices (e.g., smartwatches, smart glasses, head mounted displays (HMDs), digital TVs, desktop computers, digital signage, etc. Each server in the content streaming system may be operated as a distributed server, and in this case, data received by each server may be processed in a distributed manner.
[0085] FIG. 5 shows a schematic diagram of the multiple conversion technique according to this document.
[0086] Referring to Figure 5, 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.
[0087] The transform unit may perform a primary transform based on the residual samples (residual sample array) in the residual block to derive (primary) transform coefficients (S510). Such a primary transform may be called 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 called a multiple core transform.
[0088] The multi-kernel transform may refer to a transform method that additionally uses a DCT (Discrete Cosine Transform) Type 2 and a DST (Discrete Sine Transform) Type 7, DCT Type 8, and / or DST Type 1. That is, the multi-kernel transform may refer to a transform method that transforms a spatial domain residual signal (or a residual block) into frequency domain transform coefficients (or primary transform coefficients) 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 coefficients may be called temporary transform coefficients from the perspective of a transform unit.
[0089] 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-kernel 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.
[0090] When the multi-kernel 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.
[0091] 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 it is a vertical transform or a horizontal transform, a mapping relationship for the transform kernel can be set by combining which basis function is applied. 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.
[0092] In this case, MTS index information may be encoded and signaled to a decoding device to indicate one of a plurality of transform kernel sets. For example, if the MTS index is 0, it may indicate that the trTypeHor and trTypeVer values are both 0; if the MTS index is 1, it may indicate that the trTypeHor and trTypeVer values are both 1; if the MTS index is 2, it may indicate that the trTypeHor value is 2 and the trTypeVer value is 1; if the MTS index is 3, it may indicate that the trTypeHor value is 1 and the trTypeVer value is 2; and if the MTS index is 4, it may indicate that the trTypeHor and trTypeVer values are both 2.
[0093] As an example, the conversion kernel set according to the MTS index information is shown in the table below.
[0094] [Table 1]
[0095] The transform unit may perform a secondary transform based on the (primary) transform coefficients to derive modified (secondary) transform coefficients (S520). The primary transform is a transform from the spatial domain to the frequency domain, and the secondary transform refers to a transform using a correlation between the (primary) transform coefficients to 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 (primary) transform coefficients may be simultaneously subjected to a vertical transform and a horizontal transform (or a horizontal-vertical transform independently). That is, the non-separable secondary transform may refer to a transform method in which, instead of being applied separately to the vertical and horizontal directions of the (primary) transform coefficients, a two-dimensional signal (transform coefficients) is rearranged into a one-dimensional signal in a specific direction (e.g., row-first or column-first), and then modified transform coefficients (or secondary transform coefficients) are generated based on the non-separable transform matrix. For example, row-major order refers to arranging the first row, second row, ..., Nth row of an MxN block, and column-major order refers to arranging the first column, second column, ..., Mth column of an MxN block. The non-separable quadratic transform may be applied to the top-left region of a block (hereinafter referred to as a transform coefficient block) composed 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, embodiments are not limited thereto. For example, even if the condition that the width (W) or height (H) of the transform coefficient block is both equal to or greater than 4 is satisfied, a 4x4 non-separable quadratic transform may also be applied to the upper left min(8,W) x min(8,H) region of the transform coefficient block.
[0096] Specifically, for example, if a 4x4 input block is used, a non-separable quadratic transform can be performed as follows:
[0097] The 4x4 input block X is given as follows:
[0098]
number
[0099] When X is expressed in vector form, the vector JPEG0007824461000003.jpg84 is shown as follows:
[0100]
number
[0101] As shown in Equation 2, the vector JPEG0007824461000005.jpg84 rearranges the two-dimensional blocks of X in Equation 1 into one-dimensional vectors in row-first order.
[0102] In this case, the second-order non-separable transform can be calculated as follows:
[0103]
number
[0104] where: JPEG0007824461000007.jpg75 denotes the transform coefficient vector, and T denotes the 16x16 (non-separable) transform matrix.
[0105] 16×1 transform coefficient vector through Equation 3 JPEG0007824461000008.jpg75 can be derived, JPEG0007824461000009.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.
[0106] 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.
[0107] 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, an 8x8 transform kernel matrix can be a 64x64 / 16x64 matrix, and a 4x4 transform kernel matrix can be a 16x16 / 8x16 matrix.
[0108] 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.
[0109] However, the size of the transform, i.e., the size of the area 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.
[0110] 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). LFNST (Low-Frequency Non-Separable Transform) is an example of a reduced non-separable transform, which will be described later, and refers to a non-separable transform for low-frequency components.
[0111] 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 to 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, a 67th intra prediction mode may also be used, and the 67th intra prediction mode may indicate a linear model (LM) mode.
[0112] FIG. 6 exemplarily shows the intra-directional modes of 65 prediction directions.
[0113] Referring to FIG. 6, intra prediction modes can be classified into those with horizontal directionality and those with vertical directionality, with respect to the 34th intra prediction mode having a right-down diagonal prediction direction. H and V in FIG. 6 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, and 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 the 34th intra prediction mode uses the input data alignment method for horizontal modes. Transposing the input data means that rows of MxN 2D block data become columns and columns become rows to form NxM 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 can be called a right-upward diagonal intra prediction mode. In the same vein, the 34th intra prediction mode can be called a right-downward diagonal intra prediction mode, and the 66th intra prediction mode can be called a left-downward diagonal intra prediction mode.
[0114] For example, the mapping of four transform sets according to intra prediction modes is shown in the following table.
[0115] [Table 2]
[0116] 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.
[0117] 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.
[0118] 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, encoded, and signaled to a decoding device and transmitted to an inverse quantization / inverse transform unit in the encoding device, as described above.
[0119] 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 within the encoding device.
[0120] 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 (S550), and perform a primary (inverse) transform on the (primary) transform coefficients to obtain residual blocks (residual samples) (S560). Here, the primary transform coefficients may be referred to as modified transform coefficients from the inverse transform unit's perspective. As described above, the encoding and decoding devices may generate reconstructed blocks based on the residual blocks and predicted blocks, and generate reconstructed pictures based on the reconstructed blocks.
[0121] Meanwhile, the decoding apparatus may further include a secondary inverse transform application determining unit (or an element determining whether to apply the secondary inverse transform) 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 to apply the secondary inverse transform. For example, the secondary inverse transform may be NSST, RST, or LFNST, and the secondary inverse transform application determining unit may determine whether to apply the secondary inverse transform based on a secondary transform flag parsed from the bitstream. As another example, the secondary inverse transform application determining unit may determine whether to apply the secondary inverse transform based on transform coefficients of a residual block.
[0122] 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 a current block based on an LFNST (NSST or RST) transform set designated 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.
[0123] 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 a predicted block, and generate a reconstructed picture based on the reconstructed block.
[0124] On the other hand, in this paper, in order to reduce the computational complexity and memory requirements due to non-separable secondary transforms, the RST (reduced secondary transform) can be applied, in which the size of the transformation matrix (kernel) is reduced using the concept of NSST.
[0125] 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 implementation. In addition, by expressing the kernel matrix in 8 bits, a smaller multiplier can be used, making it more compatible with SIMD (Single Instruction Multiple Data) instructions used for optimal software implementation.
[0126] In this specification, RST may refer to a transformation performed on residual samples of a target block based on a transform matrix whose size is reduced by a simplification factor. When a simplified transformation is performed, the amount of calculation required during the transformation can be reduced due to the reduction in the size of the transform matrix. That is, RST can be used to solve the computational complexity problem that occurs during the transformation of a large block or a non-separable transformation.
[0127] 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, a simple transform, etc., and the names of the RST are not limited to the listed examples. Alternatively, the RST may be called a Low-Frequency Non-Separable Transform (LFNST) 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.
[0128] On the other hand, when the second-order inverse transform is performed based on an RST, the inverse transform unit 235 of the encoding apparatus 200 and the inverse transform unit 322 of the decoding apparatus 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.
[0129] FIG. 7 is a diagram illustrating an RST according to an embodiment of the present document.
[0130] In this specification, the term "target block" may refer to a current block, a residual block, or a transform block on which coding is performed.
[0131] In an RST according to one embodiment, an N-dimensional vector is 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.
[0132] In one embodiment, the simplification factors or simplification coefficients may be signaled via a bitstream, but the embodiment is not limited thereto. For example, predefined values for the simplification factors or simplification coefficients may be stored in each of the encoding apparatus 200 and the decoding apparatus 300, in which case the simplification factors or simplification coefficients are not separately signaled.
[0133] 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.
[0134]
number
[0135] The matrix T in the Reduced Transform block shown in (a) of Figure 7 may refer to the matrix TR × N in Equation 4. When the residual samples for the current block are multiplied by the simplified transform matrix TR × N as shown in (a) of Figure 7, the transform coefficients for the current block can be derived.
[0136] 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 7 can be expressed by the matrix operation shown in Equation 5 below. In this case, the memory and multiplication operations can be reduced to approximately 1 / 4 due to the simplification factor.
[0137] In this document, a matrix operation can be understood as an operation in which a matrix is placed to the left of a column vector and multiplied by the column vector to obtain the column vector.
[0138]
number
[0139] In Equation 5, r1 to r 64 can represent a residual sample for the target block, and more specifically, is a transform coefficient generated by applying a linear transform. As a result of the calculation of Equation 5, the transform coefficient c for the target block is i can be derived, and c i The derivation process is as shown in Equation 6.
[0140]
number
[0141] The calculation result of Equation 6 is the transform coefficients c1 to c2 for the target block. R That is, when R=16, the transform coefficients c1 to c2 for the current block can be derived. 16 If a regular transform, rather than an RST, is applied and a transform matrix of size 64×64 (N×N) is multiplied by residual samples 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 apparatus 200 to the decoding apparatus 300 is reduced, thereby improving the transmission efficiency between the encoding apparatus 200 and the decoding apparatus 300.
[0142] 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).
[0143] In one embodiment, the transform unit 232 of the encoding apparatus 200 may derive transform coefficients for the current block by performing a primary transform and an RST-based secondary transform on residual samples for the current block. These transform coefficients may be transmitted to an inverse transform unit 322 of the decoding apparatus 300, and the inverse transform unit 322 of the decoding apparatus 300 may derive modified transform coefficients based on an inverse reduced secondary transform (RST) on the transform coefficients and derive residual samples for the current block based on an inverse primary transform on the modified transform coefficients.
[0144] 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
[0145] The matrix T in the Reduced Inv. Transform block shown in Figure 7(b) t is the inverse RST matrix T R×N T (The superscript T means transpose.) As shown in FIG. 7(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
[0146] More specifically, when the inverse RST is applied as the secondary inverse transform, the inverse RST matrix T R×N TAlternatively, 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 sample for the current block can be derived.
[0147] 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 Figure 7 can be expressed by a matrix operation as shown in Equation 7 below.
[0148]
number
[0149] In Equation 7, c1 to c 16 The result of the calculation of Equation 7 is r, which indicates 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.
[0150]
number
[0151] The calculation result of Equation 8 is r1 to r2, which indicate the modified transform coefficients for the target block or the residual samples for the target block. Ncan 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, the number of multiplication operations can be reduced by a ratio of R / N (N x R) when using a simplified inverse transformation matrix.
[0152] Meanwhile, the transform set configuration shown in Table 2 can also be applied to an 8x8 RST. That is, the 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 the case where a secondary transform is not applied. When a secondary transform is not applied, the transform can be considered to have been applied as 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.
[0153] Meanwhile, according to one embodiment of this document, during the encoding process, a maximum 16x48 transformation kernel matrix can be applied by selecting only 48 pieces of data, rather than a 16x64 transformation kernel matrix, for 64 pieces of data constituting an 8x8 region. Here, "maximum" means that the maximum value of m is 16 for an mx48 transformation kernel matrix that can generate m coefficients. That is, when RST is performed by applying an mx48 transformation kernel matrix (m≦16) to an 8x8 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 48x1 vector, a 16x1 vector can be generated by sequentially multiplying a 16x48 matrix and a 48x1 vector. In this case, a 48x1 vector can be constructed by appropriately arranging the 48 pieces of data constituting the 8x8 region. For example, a 48x1 vector can be constructed based on 48 pieces of data constituting an area excluding the bottom right 4x4 area of the 8x8 region. In this case, when a matrix operation is performed by applying a maximum 16x48 transformation kernel matrix, 16 modified transformation coefficients are generated, and the 16 modified transformation coefficients can be arranged in the upper left 4x4 area according to the scanning order, and the upper right 4x4 area and the lower left 4x4 area can be filled with 0s.
[0154] A transposed matrix of the above-described transformation kernel matrix can be used for the inverse transformation of the decoding process. That is, when an inverse RST or LFNST is performed as an inverse transformation process 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 the modified coefficient vector obtained by multiplying the one-dimensional vector by the corresponding inverse RST matrix on the left side can be arranged in a two-dimensional block in a predetermined arrangement order.
[0155] 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 may be arranged in the upper left region of the 8x8 region.
[0156] 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 scanning 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, * denotes 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.
[0157] On the other hand, when the second-order inverse transform is performed based on an RST, the inverse transform unit 235 of the encoding apparatus 200 and the inverse transform unit 322 of the decoding apparatus 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.
[0158] The detailed non-separable transform, LFNST, is as follows: LFNST can include a forward transform by an encoding device and an inverse transform by a decoding device.
[0159] 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.
[0160] [Number 9] y=G T x
[0161] In Equation 9, x and y are the input and output of the quadratic transformation, respectively, and G is a matrix representing the quadratic transformation, where the transform basis vector is composed of a column vector. 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.
[0162] 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.
[0163] 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], and 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.
[0164] 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.
[0165] 8 shows an example of a sequence for arranging output data of a forward linear transform into a one-dimensional vector. The left diagrams of (a) and (b) of FIG. 8 show a sequence for creating a [48×1] vector, and the right diagrams of (a) and (b) of FIG. 8 show a sequence for creating a [16×1] vector. In the case of LFNST, the one-dimensional vector x can be obtained by sequentially arranging 2D data in the sequence shown in (a) and (b) of FIG.
[0166] The arrangement direction of the output data of the forward linear transform may be determined according to the intra prediction mode of the current block. For example, if the intra prediction mode of the current block is horizontal with respect to the diagonal direction, the output data of the forward linear transform may be arranged in the order of (a) of Figure 8, and if the intra prediction mode of the current block is vertical with respect to the diagonal direction, the output data of the forward linear transform may be arranged in the order of (b) of Figure 8.
[0167] For example, an ordering different from that of (a) and (b) of Figure 8 can be applied, and if one wants to derive the same result (y vector) as when applying the ordering of (a) and (b) of Figure 8, the column vectors of matrix G can be rearranged to match the ordering. That is, 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.
[0168] 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.
[0169] FIG. 9 is a diagram illustrating an example of the order in which output data of the forward quadratic transform is arranged in a two-dimensional block.
[0170] In the case of LFNST, the output values can be arranged in a 2D block in a predetermined scan order. Figure 9(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 9(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 9(b) indicates that the value is filled with 0.
[0171] 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 9. However, in the case of residual coding, data coding may be performed in units of 2D blocks (e.g., 4x4) such as a coefficient group (CG), and in this case, data may be arranged in a specific order such as the diagonal scan order of Figure 9.
[0172] Meanwhile, the decoding device can generate a one-dimensional input vector y by arranging two-dimensional data output through an inverse quantization process for inverse transform according to a preset scanning order. The input vector y can be output as an input vector x according to the following equation:
[0173] [Number 10] x=Gy
[0174] 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.
[0175] The output vector x is arranged in a two-dimensional block in the order shown in FIG. 8 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.
[0176] Therefore, the inverse quadratic transform is generally the opposite of the forward quadratic transform process, and in the case of the inverse transform, unlike the forward transform, the inverse quadratic transform is applied first, and then the inverse linear transform is applied.
[0177] In the inverse LFNST, one of eight [48x16] matrices or eight [16x16] matrices can be selected as the transformation matrix G. Which of the [48x16] and [16x16] matrices to apply depends on the size and pattern of the block.
[0178] In addition, the eight matrices may be derived from four transform sets as shown in Table 2 above, and each transform set may consist of two matrices. Which transform set to use among the four transform sets is determined according to the intra prediction mode. More specifically, the transform set is determined based on an intra prediction mode value extended to take into account a wide angle intra prediction mode (WAIP). Which matrix to select 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.
[0179] FIG. 10 is a diagram illustrating wide-angle intra prediction modes according to one embodiment of this document.
[0180] 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.
[0181] When the width of the current block to be predicted is greater than its height, the upper reference pixel is generally closer to its 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 its 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.
[0182] 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.
[0183] 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.
[0184] [Table 3]
[0185] 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 according to the Intra Sub Partitions (ISP) technique currently adopted in the VVC standard, and the cIdx variable values 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.
[0186] 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)).
[0187] For non-square blocks, the intra prediction mode can be modified in two distinct cases.
[0188] 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)].
[0189] 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)].
[0190] 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. 10, 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.
[0191] 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 8(a) and 8(b), respectively, and it can be seen that the ordering patterns shown in Figures 8(a) and 8(b) are symmetrical about the direction (diagonal direction) indicated by mode 34.
[0192] On the other hand, as mentioned above, which of the [48×16] and [16×16] transformation matrices to apply to LFNST is determined based on the size of the block to be transformed.
[0193] Figure 11 shows block patterns to which LFNST is applied, where (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.
[0194] In Figure 11, blocks with thick frames indicate areas to which LFNST is applied. For blocks (a) and (b) in Figure 11, LFNST is applied to the top-left 4x4 area, and for block (c) in Figure 11, LFNST is applied to each of the two adjacent top-left 4x4 areas. Because LFNST is applied to 4x4 areas in (a), (b), and (c) in Figure 11, this type of LFNST is hereinafter referred to as "4x4 LFNST," and a [16x16] or [16x8] matrix can be applied to the corresponding transformation matrix based on the matrix dimension for G in Equation 9 and Equation 10.
[0195] More specifically, a [16x8] matrix is applied to the 4x4 block (4x4TU or 4x4CU) in (a) of Figure 11, and a [16x16] matrix is applied to the blocks in (b) and (c) of Figure 11. This is to match the worst-case computational complexity with 8 multiplications per sample.
[0196] For (d) and (e) of Figure 11, 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 applied 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-hand order of Figure 8(a) or the left-hand order of Figure 8(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.
[0197] A [48x8] matrix can be applied to the 8x8 block (8x8TU or 8x8CU) in (d) of Figure 11, and a [48x16] matrix can be applied to the 8x8 block in (e) of Figure 11. This is also to match the worst case computational complexity to 8 multiplications per sample.
[0198] Depending on the block design, 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). Due to the nature of matrix GT, the number of output data in the forward LFNST may be equal to or less than the number of input data.
[0199] FIG. 12 shows an example of the arrangement of output data from the forward LFNST, and illustrates blocks in which output data from the forward LFNST is arranged depending on the block pattern.
[0200] The shaded area at the top left of the block in Figure 12 corresponds to the area where the output data of the forward LFNST is located, the positions marked with 0 indicate samples filled with 0 values, and the remaining area indicates areas that are not changed by the forward LFNST. The output data of the forward linear transform remains unchanged in the areas that are not changed by the LFNST.
[0201] As mentioned above, the dimensions of the transformation matrix applied vary depending on the block, and therefore the number of output data also varies. As shown in Figure 12, the output data of the forward LFNST may not fill the entire upper-left 4x4 block. In Figures 12(a) and 12(d), a [16x8] matrix and a [48x8] matrix are applied to the block indicated by the thick line or a partial area within the block, respectively, to generate an [8x1] vector as the output of the forward LFNST. That is, according to the scan order shown in Figure 9(b), only eight output data positions are filled as shown in Figures 12(a) and 12(d), and the remaining eight positions are filled with zeros. In the case of the LFNST-applied block of Figure 11(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 12(d).
[0202] As described above, the LFNST index is basically signaled to specify whether to apply LFNST and the transformation matrix to be applied. As shown in Figure 12, 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 values as follows:
[0203] 1) As shown in Figure 12(a), within the upper left corner 4x4 block, the 8th position in the scan order and thereafter, i.e., the 9th to 16th samples
[0204] 2) As shown in (d) and (e) of FIG. 12, a [16x48] matrix or an [8x48] matrix is applied to the two 4x4 blocks adjacent to the upper left 4x4 block or the second and third 4x4 blocks in the scan order.
[0205] Therefore, if non-zero data is found by checking the above 1) and 2), it is certain that LFNST will not be applied, and therefore signaling of the corresponding LFNST index can be omitted.
[0206] For example, in the case of LFNST adopted in the VVC standard, signaling of the LFNST index is performed after residual coding, so that the encoding device can know whether non-zero data (significant coefficients) exist at all positions within a TU or CU block through residual coding. Therefore, the encoding device can determine whether to perform signaling for the LFNST index based on whether non-zero data exists, and the decoding device can determine whether to parse the LFNST index. If non-zero data does not exist in the areas specified in 1) and 2), signaling of the LFNST index is performed.
[0207] Because a truncated unary code is applied as the binarization method for an LFNST index, an LFNST index consists of a maximum of two bins, and the binary codes for the possible LFNST index values of 0, 1, and 2 are assigned 0, 10, and 11, respectively. In the LFNST currently adopted by VVC, context-based CABAC coding (regular coding) is applied to the first bin, and bypass coding is applied to the second bin. The total number of contexts for the first bin is two, and (DCT-2, DCT-2) is applied as the primary transform pair in the horizontal and vertical directions. One context is assigned when the luma and chroma components are coded using a dual-tree type, and the other context is assigned in other cases. The coding of such LFNST indexes can be represented in the following table.
[0208] [Table 4]
[0209] Meanwhile, the following simplification method can be applied to the adopted LFNST.
[0210] (i) As an example, the number of output data for the forward LFNST can be limited to a maximum of 16.
[0211] In the case of (c) of Figure 11, 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 11. This simplifies the implementation of video coding.
[0212] Fig. 13 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. 13, when LFNST is applied to the upper left 4x4 region of a 4xN or Nx4 block where N is 16 or greater, the number of output data items from the forward LFNST is 16.
[0213] (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 zero values. That is, zero-out can also be applied to areas that are not changed by LFNST and retain the result of the forward linear transform. As described 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.
[0214] (ii)-(A) When 4x4 LFNST is applied, regions to which 4x4 LFNST is not applied can be zeroed out. Figure 14 illustrates zeroing out in a block to which 4x4 LFNST is applied, according to an example.
[0215] As shown in FIG. 14, for blocks to which 4×4 LFNST is applied, i.e., for blocks (a), (b), and (c) in FIG. 12, even areas to which LFNST is not applied can be filled with 0.
[0216] On the other hand, (d) of FIG. 14 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.
[0217] (ii)-(B) When 8x8 LFNST is applied, it is possible to zero out areas to which 8x8 LFNST is not applied. Figure 15 is a diagram illustrating zeroing out in a block to which 8x8 LFNST is applied, according to an example.
[0218] As shown in FIG. 15, for blocks to which 8×8 LFNST is applied, that is, for blocks (d) and (e) in FIG. 12, even areas to which LFNST is not applied can be filled with 0.
[0219] (iii) When LFNST is applied, the area filled with zeros can change due to the zero-out method proposed in (ii) above. Therefore, the zero-out method proposed in (ii) above allows checking whether non-zero data exists in a wider area than in the case of LFNST in FIG. 12.
[0220] For example, when (ii)-(B) is applied, it is possible to check whether non-zero data exists in the areas filled with zero values in (d) and (e) of FIG. 12 as well as in the areas additionally filled with zeros in FIG. 15, and then perform signaling for the LFNST index only if non-zero data does not exist.
[0221] 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 12. 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 for areas explicitly marked with zeros in Figure 12.
[0222] Alternatively, according to another example, zeroing out can be performed as shown in Fig. 16. Fig. 16 is a diagram illustrating zeroing out in a block to which 8x8 LFNST is applied according to another example.
[0223] As shown in Figures 14 and 15, zeroing out can be applied to all areas other than the area to which LFNST is applied, or it can be applied to only a partial area as shown in Figure 16. In Figure 16, zeroing out is applied only to areas other than the upper left 8x8 area, and zeroing out is not applied to the lower right 4x4 block within the upper left 8x8 area.
[0224] Various embodiments can be derived by applying combinations of the simplification methods ((i), (ii)-(A), (ii)-(B), and (iii)) to the LFNST. Of course, the combinations of the simplification methods are not limited to the following examples, and any combination can be applied to the LFNST.
[0225] Example
[0226] -Limit the number of output data for forward LFNST to a maximum of 16 → (i)
[0227] -When 4×4LFNST is applied, all areas to which 4×4LFNST is not applied are zeroed out → (ii)-(A)
[0228] When -8×8LFNST is applied, all areas where 8×8LFNST is not applied are zeroed out → (ii)-(B)
[0229] - For areas filled with existing 0 values and areas filled with 0 due to additional zero-out ((ii)-(A), (ii)-(B)), check whether non-zero data exists, and only if non-zero data does not exist, perform LFNST indexing signaling → (iii)
[0230] In the above embodiment, when LFNST is applied, the area in which non-zero output data can exist is limited to the upper left 4x4 area. More specifically, in the cases of Figures 14(a) and 15(a), the 8th position in the scan order is the last position in which non-zero data can exist, and in the cases of Figures 14(b) and 14(d) and 15(b), the 16th position in the scan order (i.e., the bottom rightmost position of the upper left 4x4 block) is the last position in which non-zero data can exist.
[0231] Therefore, when LFNST is applied, whether or not LFNST index signaling is enabled can be determined after checking whether non-zero data exists at a position where the residual coding process is not allowed (a position beyond the last position).
[0232] In the case of the zero-out method proposed in (ii), the amount of data that is ultimately generated when applying both the primary transform and LFNST is reduced, 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 that exists 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 corresponding data can be reduced. Additional effects of the zero-out method proposed in (ii) can be summarized as follows.
[0233] First, as mentioned above, the amount of computation required to perform the entire transformation process is reduced.
[0234] In particular, when (ii)-(B) is applied, the amount of calculation 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, and 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 is further enhanced as the size of the entire block (TU or CU) increases.
[0235] Second, the amount of computation required for the entire conversion process is reduced, thereby reducing the power consumption required to perform the conversion.
[0236] Third, it reduces the latency involved in the conversion process.
[0237] Secondary transforms such as LFNST increase the overall latency associated with the transform execution by adding computational complexity to the existing primary transform. 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 increase in the overall latency of intra prediction encoding.
[0238] 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.
[0239] On the other hand, conventional intra prediction performs coding without dividing a block to be coded, treating the block to be coded as a single coding unit. However, ISP (Intra Sub-Partitions) coding means dividing the block to be 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" can be used to refer to both coding performed by an encoding device and decoding performed by a decoding device.
[0240] Table 5 shows the number of sub-blocks divided according to the block size when ISP is applied, and the sub-partitions divided by ISP can be called transform blocks (TUs).
[0241] [Table 5]
[0242] ISP divides a luma intra predicted block into two or four subpartitions vertically or horizontally depending on the block size. For example, the minimum block size for which ISP can be applied is 4x8 or 8x4. If the block size is larger than 4x8 or 8x4, the block is divided into four subpartitions.
[0243] Figures 17 and 18 show examples of sub-blocks into which one coding block is divided. More specifically, Figure 17 shows an example of division when the coding block (width (W) x height (H)) is a 4x8 block or an 8x4 block, and Figure 18 shows an example of division when the coding block is not a 4x8 block, an 8x4 block, or a 4x4 block.
[0244] When ISP is applied, sub-blocks are coded sequentially, for example, horizontally or vertically, from left to right or from top to bottom, depending on the division type. After a sub-block undergoes inverse transform and intra prediction and is restored, coding of the next sub-block can proceed. The leftmost or topmost sub-block references restored pixels of a previously coded coding block, as in a conventional intra-prediction method. Also, if each side of a subsequent inner sub-block is not adjacent to the previous sub-block, the subsequent inner sub-block references restored pixels of a previously coded adjacent coding block, as in a conventional intra-prediction method, to derive reference pixels adjacent to the corresponding side.
[0245] In the ISP coding mode, all sub-blocks can be coded in the same intra-prediction mode, and a flag indicating whether to use ISP coding and a flag indicating which direction (horizontal or vertical) to divide can be signaled. As shown in Figures 17 and 18, the number of sub-blocks can be adjusted to 2 or 4 depending on the block, and if the size (width x height) of one sub-block is less than 16, division into the corresponding sub-blocks can be prohibited or ISP coding itself can be restricted from being applied.
[0246] On the other hand, in the case of the ISP prediction mode, one coding unit is divided into two or four partition blocks, i.e., sub-blocks, and predicted, and the same intra-frame prediction mode is applied to the two or four partition blocks.
[0247] As mentioned above, the division direction can be either horizontal (when an M×N coding unit with horizontal and vertical lengths of M and N is divided horizontally, it is divided into two M×(N / 2) blocks, or into four M×(N / 4) blocks) or vertical (when an M×N coding unit is divided vertically, it is divided into two (M / 2)×N blocks, or into four (M / 4)×N blocks). In the case of horizontal division, the partition blocks are coded in order from top to bottom, and in the case of vertical division, the partition blocks are coded in order from left to right. In the case of horizontal (vertical) division, the partition block to be coded can be predicted by referring to the restored pixel values of the upper (left) partition block.
[0248] A transform can be applied to the residual signal generated by the ISP prediction method in partition block units. Based on the forward direction, not only the existing DCT-2 but also the DST-7 / DCT-8 combination-based Multiple Transform Selection (MTS) technology can be applied to the primary transform (core transform or primary transform). A forward Low Frequency Non-Separable Transform (LFNST) can be applied to the transform coefficients generated by the primary transform to generate final modified transform coefficients.
[0249] That is, LFNST can also be applied to partition blocks divided by applying the ISP prediction mode, and as described above, the same intra prediction mode is applied to the divided partition blocks. Therefore, when an LFNST set derived based on the intra prediction mode is selected, the derived LFNST set can be applied to all partition blocks. That is, since the same intra prediction mode is applied to all partition blocks, the same LFNST set can be applied to all partition blocks.
[0250] Meanwhile, for example, LFNST can be applied only to transform blocks whose horizontal and vertical lengths are both equal to or greater than 4. Therefore, if the horizontal or vertical length of a partition block divided by ISP prediction is less than 4, LFNST is not applied and an LFNST index is not signaled. Also, when LFNST is applied to each partition block, the corresponding partition block can be regarded as one transform block. Of course, when ISP prediction is not applied, LFNST can be applied to a coding block.
[0251] The specific process of applying LFNST to each partition block is as follows.
[0252] As an example, after applying forward LFNST to an individual partition block, only up to 16 (8 or 16) coefficients are left in the upper left 4x4 region according to the transform coefficient scanning order, and then zeroing can be applied to the remaining positions and regions, filling them all with zero values.
[0253] Alternatively, as an example, if the length of one side of a partition block is 4, LFNST is applied only to the top-left 4x4 region; if the lengths of all sides of the partition block, i.e., the width and height, are 8 or more, LFNST can be applied to the remaining 48 coefficients excluding the bottom-right 4x4 region within the top-left 8x8 region.
[0254] Alternatively, as an example, to achieve worst-case computational complexity of 8 multiplications per sample, if each partition block is 4x4 or 8x8, only 8 transform coefficients may be output after applying the forward LFNST. That is, if the partition block is 4x4, an 8x16 matrix may be applied as the transform matrix, and if the partition block is 8x8, an 8x48 matrix may be applied as the transform matrix.
[0255] Meanwhile, in the current VVC standard, LFNST index signaling is performed on a coding unit basis. Therefore, when LFNST is applied to all partition blocks in ISP prediction mode, the same LFNST index value can be applied to the corresponding partition blocks. That is, when an LFNST index value is transmitted once at the coding unit level, the corresponding LFNST index can be applied to all partition blocks within the coding unit. As described above, the LFNST index value can have values of 0, 1, and 2, where 0 indicates that LFNST is not applied and 1 and 2 indicate two transformation matrices present in one LFNST set when LFNST is applied.
[0256] As described above, the LFNST set is determined by the intra prediction mode. In the case of the ISP prediction mode, all partition blocks in a coding unit are predicted in the same intra prediction mode, so the partition blocks can refer to the same LFNST set.
[0257] As another example, although LFNST index signaling is still performed on a coding unit basis, instead of uniformly determining whether to apply LFNST to all partition blocks in the case of ISP prediction mode, it may be possible to determine whether to apply the LFNST index value signaled at the coding unit level to each partition block using a separate condition. Here, the separate condition may be signaled in the form of a flag for each partition block via the bitstream, where if the flag value is 1, the LFNST index value signaled at the coding unit level is applied, and if the flag value is 0, LFNST is not applied.
[0258] Meanwhile, in a coding unit to which the ISP mode is applied, when the length of one side of a partition block is less than 4, an example of applying LFNST is as follows.
[0259] First, if the size of a partition block is N×2 (2×N), LFNST can be applied to the upper left M×2 (2×M) region (where M≦N). For example, if M=8, the corresponding upper left region is 8×2 (2×8), so the region containing 16 residual signals can be input to the forward LFNST, and an R×16 (R≦16) forward transform matrix can be applied.
[0260] Here, the forward LFNST matrix is a separate additional matrix that is not included in the current VVC standard. Also, for worst-case complexity control, an 8x16 matrix obtained by sampling only the top 8 row vectors of a 16x16 matrix can be used for conversion. The complexity control method will be described in detail later.
[0261] Second, if the size of a partition block is N×1 (1×N), LFNST can be applied to the upper left M×1 (1×M) region (where M≦N). For example, if M=16, the corresponding upper left region is 16×1 (1×16), so the region containing 16 residual signals can be input to the forward LFNST, and an R×16 (R≦16) forward transform matrix can be applied.
[0262] Here, the corresponding forward LFNST matrix is a separate additional matrix that is not included in the current VVC standard. Also, for worst-case complexity control, an 8x16 matrix obtained by sampling only the top 8 row vectors of a 16x16 matrix can be used for conversion. The complexity control method will be described in detail later.
[0263] The first and second embodiments may be applied simultaneously, or only one of the two may be applied. In particular, in the case of the second embodiment, it was experimentally observed that the compression performance improvement obtained with the existing LFNST is not significant compared to the LFNST index signaling cost because a one-dimensional transformation is considered in the LFNST. However, in the case of the first embodiment, a compression performance improvement similar to that obtained with the existing LFNST was observed. That is, in the case of ISP, it was experimentally confirmed that applying the LFNST for 2xN and Nx2 actually contributes to compression performance.
[0264] Currently, LFNST in VVC applies symmetry between intra prediction modes. The same LFNST set is applied to the two directional modes centered around mode 34 (prediction in the 45-degree diagonal direction from the bottom right corner). For example, the same LFNST set is applied to mode 18 (horizontal prediction mode) and mode 50 (vertical prediction mode). However, for modes 35 to 66, when applying forward LFNST, the input data is transposed before LFNST is applied.
[0265] Meanwhile, VVC supports Wide Angle Intra Prediction (WAIP) mode, and LFNST sets are derived based on intra prediction modes modified to take WAIP mode into account. For modes extended by WAIP, the LFNST set is determined using symmetry, just like for general intra prediction direction modes. For example, mode -1 is symmetrical with mode 67, so the same LFNST set is applied, and mode -14 is symmetrical with mode 80, so the same LFNST set is applied. For modes 67 to 80, the input data is transposed before applying forward LFNST, and then the LFNST transformation is applied.
[0266] In the case of LFNST applied to the top left Mx2 (Mx1) block, the symmetry for LFNST described above cannot be applied because the block to which LFNST is applied is non-square. Therefore, instead of applying symmetry based on the intra prediction mode as in the LFNST of Table 2, symmetry between the Mx2 (Mx1) block and the 2xM (1xM) block can be applied.
[0267] FIG. 19 is a diagram illustrating the symmetry between an M×2 (M×1) block and a 2×M (1×M) block according to an example.
[0268] As shown in Figure 19, the 2nd mode in the M×2 (M×1) block can be seen as symmetric to the 66th mode in the 2×M (1×M) block, so the same LFNST set can be applied to the 2×M (1×M) block and the M×2 (M×1) block.
[0269] In this case, to apply the LFNST set applied to the M×2 (M×1) block to the 2×M (1×M) block, the LFNST set is selected based on mode 2 instead of mode 66. In other words, before applying forward LFNST, the input data of the 2×M (1×M) block is transposed and then LFNST is applied.
[0270] FIG. 20 is a diagram showing an example in which a 2×M block is transposed.
[0271] 20(a) illustrates the application of LFNST to input data read in column-first order for a 2×M block, and FIG. 20(b) illustrates the application of LFNST to input data read in row-first order for an M×2 (M×1) block. The method of applying LFNST to the upper left M×2 (M×1) or 2×M (M×1) block can be summarized as follows:
[0272] 1. First, construct an input vector for the forward LFNST by arranging input data as shown in (a) and (b) of Figure 20. For example, referring to Figure 19, for an Mx2 block predicted for mode 2, the order is as shown in (b) of Figure 20, and for a 2xM block predicted for mode 66, the input data is arranged in the order shown in (a) of Figure 20, and then the LFNST set for mode 2 can be applied.
[0273] 2. For an Mx2 (Mx1) block, the LFNST set is determined based on the modified intra prediction mode that takes WAIP into consideration. As described above, there is a predefined mapping relationship between the intra prediction mode and the LFNST set, which can be represented by a mapping table as shown in Table 2.
[0274] For a 2×M (1×M) block, a mode symmetrical about a 45-degree diagonal prediction mode (mode 34 in the VVC standard) is obtained from the intra prediction modes modified in consideration of WAIP, and then an LFNST set is determined based on the corresponding symmetric mode and a mapping table. The mode (y) symmetrical about mode 34 can be derived using the following equation. The mapping table will be described in more detail below.
[0275] [Number 11] if2≦x≦66, y=68-x, otherwise(x≦-1orx≧67), y=66-x
[0276] 3. When applying forward LFNST, the input data prepared in step 1 can be multiplied by the LFNST kernel to derive the transform coefficients. The LFNST kernel can be selected from the LFNST set determined in step 2 and a pre-specified LFNST index.
[0277] For example, if M=8 and a 16x16 matrix is applied to the LFNST kernel, the matrix can be multiplied by 16 input data to generate 16 transform coefficients. The generated transform coefficients can be arranged in the upper left 8x2 or 2x8 area according to the scanning order used in the VVC standard.
[0278] FIG. 21 shows the scanning order for an 8×2 or 2×8 region according to an example.
[0279] Areas other than the upper left 8x2 or 2x8 area can be filled with zeros (zero-out) or the existing transform coefficients to which the first transform was applied can be maintained as they are. The pre-specified LFNST index is one of the LFNST index values (0, 1, 2) that are tried when calculating the RD cost while changing the LFNST index value during the encoding process.
[0280] In the case of a configuration in which the worst-case calculation complexity is adjusted to a certain level or less (e.g., 8 multiplications / sample), for example, only the top 8 rows of the 16x16 matrix are multiplied by an 8x16 matrix to generate only 8 transform coefficients, and then the 8 transform coefficients are arranged in the scanning order shown in Figure 21, and zero-out can be applied to the remaining coefficient area. The worst-case complexity adjustment will be described later.
[0281] 4. When applying reverse LFNST, a preset number of transform coefficients (e.g., 16) are placed in the input vector, and an LFNST kernel (e.g., a 16x16 matrix) derived from the LFNST set obtained in step 2 and the parsed LFNST index is selected. The LFNST kernel is then multiplied by the corresponding input vector to derive the output vector.
[0282] In the case of M×2 (M×1) blocks, the output vectors can be arranged in row-major order as shown in (b) of Figure 20, and in the case of 2×M (1×M) blocks, the output vectors can be arranged in column-major order as shown in (a) of Figure 20.
[0283] The remaining areas excluding the area where the corresponding output vector is placed within the upper left M×2 (M×1) or 2×M (M×2) area, and areas within the partition block other than the upper left M×2 (M×1) or 2×M (M×2) area, can be configured to be filled with zero values (zero-out) or to maintain the transform coefficients restored through the residual coding and inverse quantization processes as they are.
[0284] When constructing an input vector as in No. 3, the input data can be arranged according to the scanning order of FIG. 21, and the input vector can be constructed by reducing the number of input data (e.g., 8 instead of 16) in order to keep the worst-case computational complexity below a certain level.
[0285] For example, when M=8, if 8 input data are used, 16 output data can be obtained by multiplying only the left 16x8 matrix from the corresponding 16x16 matrix. Complexity adjustment for the worst case will be described later.
[0286] In the above example, symmetry is applied between an Mx2 (Mx1) block and a 2xM (1xM) block when applying LFNST. However, in other examples, different LFNST sets may be applied to the two block patterns.
[0287] Hereinafter, various examples of LFNST set configuration for ISP mode and mapping methods using intra prediction modes will be described.
[0288] In the ISP mode, the LFNST set configuration may be different from the existing LFNST set. That is, a kernel different from the existing LFNST kernel may be applied, and a mapping table different from the mapping table between intra-prediction mode indexes and LFNST sets currently applied in the VVC standard may be applied. The mapping table currently applied in the VVC standard is shown in Table 2.
[0289] In Table 2, the preModeIntra value indicates the intra prediction mode value modified taking WAIP into consideration, and the lfnstTrSetIdx value is an index value that indicates a specific LFNST set. Each LFNST set consists of two LFNST kernels.
[0290] When the ISP prediction mode is applied, if the horizontal and vertical lengths of each partition block are all equal or greater than 4, the same kernel as the LFNST kernel currently applied in the VVC standard can be applied, and the mapping table can also be applied as is. Of course, other LFNST kernels and other mapping tables than those currently applied in the VVC standard can also be applied.
[0291] When the ISP prediction mode is applied, the current VVC standard and other LFNST kernels and other mapping tables can be applied if the horizontal or vertical length of each partition block is less than 4. Tables 6 to 8 below show mapping tables between intra prediction mode values (intra prediction mode values modified taking WAIP into account) and LFNST sets that can be applied to M×2 (M×1) blocks or 2×M (1×M) blocks.
[0292] [Table 6]
[0293] [Table 7]
[0294] [Table 8]
[0295] The mapping table in Table 6 consists of seven LFNST sets, the mapping table in Table 7 consists of four LFNST sets, and the mapping table in Table 8 consists of two LFNST sets. As another example, when consisting of one LFNST set, the lfnstTrSetIdx value for the preModeIntra value may be fixed to 0.
[0296] Below, we will describe how to maintain the worst-case computational complexity when applying LFNST to the ISP mode.
[0297] In ISP mode, when applying LFNST, the application of LFNST can be limited to keep the number of multiplications per sample (or per coefficient, or per position) below a certain value. Depending on the size of the partition block, LFNST can be applied as follows to keep the number of multiplications per sample (or per coefficient, or per position) below 8.
[0298] 1. If the horizontal and vertical lengths of the partition block are both 4 or more, the same method as the worst-case calculation complexity adjustment method for LFNST in the current VVC standard can be applied.
[0299] That is, when the partition block is a 4x4 block, instead of a 16x16 matrix, an 8x16 matrix obtained by sampling the top eight rows from the 16x16 matrix can be applied in the forward direction, and a 16x8 matrix obtained by sampling the left eight columns from the 16x16 matrix can be applied in the reverse direction. Also, when the partition block is an 8x8 block, instead of a 16x48 matrix, an 8x48 matrix obtained by sampling the top eight rows from the 16x48 matrix can be applied in the forward direction, and a 48x8 matrix obtained by sampling the left eight columns from the 48x16 matrix can be applied in the reverse direction.
[0300] For 4xN or Nx4 (N>4) blocks, when performing a forward transform, 16 coefficients generated after applying a 16x16 matrix only to the top-left 4x4 block are placed in the top-left 4x4 region, and the rest of the region can be filled with 0s. When performing an inverse transform, 16 coefficients located in the top-left 4x4 block are arranged in scanning order to form an input vector, and then multiplied by a 16x16 matrix to generate 16 output data. The generated output data is placed in the top-left 4x4 region, and the rest of the region excluding the top-left 4x4 region can be filled with 0s.
[0301] In the case of an 8xN or Nx8 (N>8) block, when a forward transform is performed, 16 coefficients generated after applying a 16x48 matrix only to the ROI region within the upper left 8x8 block (the remaining region of the upper left 8x8 block excluding the lower right 4x4 block) are placed in the upper left 4x4 region, and the remaining region is filled with zeros. Also, when an inverse transform is performed, 16 coefficients located in the upper left 4x4 block are arranged in scanning order to form an input vector, and then multiplied by a 48x16 matrix to generate 48 output data. The generated output data is filled in the ROI region, and the remaining region is filled with zeros.
[0302] 2. When the size of a partition block is Nx2 or 2xN and LFNST is applied to the upper left Mx2 or 2xM area (M≦N), a matrix sampled according to the N value can be applied.
[0303] When M=8, for a partition block where N=8, i.e., an 8x2 or 2x8 block, in the case of a forward transform, an 8x16 matrix obtained by sampling the top 8 rows from a 16x16 matrix can be applied instead of a 16x16 matrix, and in the case of an inverse transform, a 16x8 matrix obtained by sampling the left 8 columns from a 16x16 matrix can be applied instead of a 16x16 matrix.
[0304] If N is greater than 8, in the case of a forward transform, 16 output data generated after applying a 16x16 matrix to the upper left 8x2 or 2x8 block can be arranged in the upper left 8x2 or 2x8 block, and the remaining area can be filled with zeros. In the case of an inverse transform, 16 coefficients located in the upper left 8x2 or 2x8 block can be arranged in scanning order to form an input vector, and then multiplied by the corresponding 16x16 matrix to generate 16 output data. The generated output data can be arranged in the upper left 8x2 or 2x8 block, and the remaining area can be filled with zeros.
[0305] 3. When the size of a partition block is Nx1 or 1xN and LFNST is applied to the upper left Mx1 or 1xM area (M≦N), a matrix sampled according to the N value can be applied.
[0306] When M=16, for a partition block where N=16, i.e., a 16x1 or 1x16 block, in the case of a forward transform, an 8x16 matrix obtained by sampling the top 8 rows from a 16x16 matrix can be applied instead of a 16x16 matrix, and in the case of an inverse transform, a 16x8 matrix obtained by sampling the left 8 columns from a 16x16 matrix can be applied instead of a 16x16 matrix.
[0307] If N is greater than 16, in the case of a forward transform, 16 output data generated after applying a 16x16 matrix to the upper left 16x1 or 1x16 block are arranged in the upper left 16x1 or 1x16 block, and the remaining area can be filled with zeros. In the case of an inverse transform, 16 coefficients located in the upper left 16x1 or 1x16 block are arranged in scanning order to form an input vector, and then the corresponding 16x16 matrix is multiplied to generate 16 output data. The generated output data can be arranged in the upper left 16x1 or 1x16 block, and the remaining area can be filled with zeros.
[0308] As another example, in order to maintain the number of multiplications per sample (or per coefficient, or per position) below a certain value, the number of multiplications per sample (or per coefficient, or per position) may be maintained at 8 or less based on the size of the ISP coding unit, not the size of the ISP partition block. If there is only one block among the ISP partition blocks that satisfies the conditions for applying LFNST, a worst-case complexity calculation for LFNST may be applied based on the size of the coding unit, not the size of the partition block. For example, if a luma coding block for a certain coding unit is divided into four 4x4 partition blocks and coded using ISP, and two of the partition blocks do not have any non-zero transform coefficients, the other two partition blocks may be configured to generate 16 transform coefficients (based on the encoder) each, rather than 8.
[0309] In the following, a method for signaling the LFNST index in the ISP mode will be considered.
[0310] As mentioned above, the LFNST index can have the values 0, 1, and 2, where 0 indicates that LFNST is not applied, and 1 and 2 indicate one of two LFNST kernel matrices included in the selected LFNST set. LFNST is applied based on the LFNST kernel matrix selected by the LFNST index. The method for transmitting the LFNST index in the current VVC standard is as follows:
[0311] 1. An LFNST index can be transmitted once per coding unit (CU), and in the case of a dual-tree, separate LFNST indexes can be signaled for luma blocks and chroma blocks.
[0312] 2. If the LFNST index is not signaled, the LFNST index value is inferred to the default value of 0. The cases where the LFNST index value is inferred to 0 are as follows.
[0313] A. When the mode does not apply transform (e.g., transform skip, BDPCM, lossless coding, etc.)
[0314] B. When the primary transform is not DCT-2 (DST7 or DCT8), i.e., when the horizontal or vertical transform is not DCT-2
[0315] C. If the horizontal or vertical length of the luma block of the coding unit exceeds the maximum luma transform size that can be converted, for example, if the maximum luma transform size that can be converted is 64 and the size of the luma block of the coding block is 128x16, LFNST cannot be applied.
[0316] In the case of a dual tree, it is determined whether the maximum luma transform size is exceeded for each of the coding unit for the luma component and the coding unit for the chroma component. That is, it is checked whether the maximum luma transform size that can be transformed for the luma block is exceeded, and it is checked whether the horizontal / vertical lengths of the corresponding luma block for the color format and the maximum luma transform size that can be transformed for the chroma block are exceeded. For example, if the color format is 4:2:0, the horizontal / vertical lengths of the corresponding luma block are twice those of the corresponding chroma block, and the transform size of the corresponding luma block is twice those of the corresponding chroma block. As another example, if the color format is 4:4:4, the horizontal / vertical lengths and transform size of the corresponding luma block are the same as those of the corresponding chroma block.
[0317] A 64-length transform or a 32-length transform refers to a transform applied horizontally or vertically having a length of 64 or 32, respectively, and the "transform size" may refer to the corresponding length of 64 or 32.
[0318] In the case of a single tree, it is checked whether the horizontal or vertical length of the luma block exceeds the maximum luma transform block size that can be transformed, and if so, LFNST index signaling can be omitted.
[0319] D. The LFNST index can be transmitted only if the width and height of the coding unit are both 4 or greater.
[0320] In the case of a dual tree, the LFNST index can be signaled only when the horizontal and vertical dimensions of the corresponding component (i.e., luma or chroma component) are both 4 or greater.
[0321] In the case of a single tree, the LFNST index can be signaled when the horizontal and vertical lengths of the luma component are both 4 or more.
[0322] E. If the position of the last non-zero coefficient is not the DC position (top left corner of the block), and if it is a dual tree type luma block, an LNFST index is sent if the position of the last non-zero coefficient is not the DC position. If it is a dual tree type chroma block, an LNFST index is sent if either the position of the last non-zero coefficient for Cb or the position of the last non-zero coefficient for Cr is not the DC position.
[0323] In the case of the single tree type, the LFNST index is transmitted when the position of the last non-zero coefficient of any one of the luma, Cb, and Cr components is not the DC position.
[0324] Here, if a coded block flag (CBF) value indicating whether a transform coefficient exists for a transform block is 0, the position of the last non-zero coefficient for the corresponding transform block is not checked to determine whether LFNST index signaling is required. That is, if the CBF value is 0, no transform is applied to the corresponding block, so the position of the last non-zero coefficient is not considered when checking the condition for LFNST index signaling.
[0325] For example, 1) in the case of a dual tree type and a luma component, if the corresponding CBF value is 0, the LFNST index is not signaled; 2) in the case of a dual tree type and a chroma component, if the CBF value for Cb is 0 and the CBF value for Cr is 1, only the position of the last non-zero coefficient for Cr is checked and the corresponding LFNST index is transmitted; and 3) in the case of a single tree type, the position of the last non-zero coefficient is checked only for components whose CBF values are 1 for all of luma, Cb, and Cr.
[0326] If it is confirmed that a transform coefficient exists at a position where an F.LFNST transform coefficient is not allowed, LFNST index signaling can be omitted. In the case of 4x4 transform blocks and 8x8 transform blocks, the LFNST transform coefficient can exist at 8 positions from the DC position according to the transform coefficient scanning order of the VVC standard, and the remaining positions are all filled with 0. In addition, in the case of blocks other than 4x4 transform blocks and 8x8 transform blocks, the LFNST transform coefficient can exist at 16 positions from the DC position according to the transform coefficient scanning order of the VVC standard, and the remaining positions are all filled with 0.
[0327] Therefore, after residual coding, if there are non-zero transform coefficients in the area that should be filled with zero values, LFNST index signaling can be omitted.
[0328] Meanwhile, the ISP mode may be applied only to luma blocks, or may be applied to both luma blocks and chroma blocks. As described above, when ISP prediction is applied, a corresponding coding unit is divided into two or four partition blocks for prediction, and transform may be applied to each of the corresponding partition blocks. Therefore, when determining the conditions for signaling an LFNST index in units of coding units, the fact that LFNST may be applied to each of the corresponding partition blocks must be taken into consideration. Also, when the ISP prediction mode is applied only to a specific component (e.g., a luma block), the LFNST index must be signaled taking into consideration the fact that only the corresponding component is divided into partition blocks. Possible LFNST index signaling methods in the ISP mode are summarized as follows:
[0329] 1. An LFNST index can be transmitted once per coding unit (CU), and in the case of a dual-tree, separate LFNST indexes can be signaled for luma blocks and chroma blocks.
[0330] 2. If the LFNST index is not signaled, the LFNST index value is inferred to the default value of 0. The cases where the LFNST index value is inferred to 0 are as follows.
[0331] A. When the mode does not apply transform (e.g., transform skip, BDPCM, lossless coding, etc.)
[0332] B. If the horizontal or vertical length of the luma block of the coding unit exceeds the maximum luma transform size that can be converted, for example, if the maximum luma transform size that can be converted is 64 and the size of the luma block of the coding block is 128x16, LFNST cannot be applied.
[0333] Whether to signal the LFNST index may also be determined based on the size of the partition block instead of the coding unit. That is, if the horizontal or vertical length of the partition block for the corresponding luma block exceeds the maximum luma transform size that can be transformed, the LFNST index signaling may be omitted and the LFNST index value may be inferred to be 0.
[0334] In the case of a dual tree, it is determined whether the maximum transform block size is exceeded for each of the coding unit or partition block for the luma component and the coding unit or partition block for the chroma component. That is, the horizontal and vertical lengths of the coding unit or partition block for luma are compared with the maximum luma transform size. If any one of them is larger than the maximum luma transform size, LFNST is not applied. In the case of the coding unit or partition block for chroma, the horizontal and vertical lengths of the corresponding luma block for the color format are compared with the maximum luma transform size that can be transformed. For example, if the color format is 4:2:0, the horizontal and vertical lengths of the corresponding luma block are each twice that of the corresponding chroma block, and the transform size of the corresponding luma block is twice that of the corresponding chroma block. As another example, if the color format is 4:4:4, the horizontal and vertical lengths and transform size of the corresponding luma block are the same as those of the corresponding chroma block.
[0335] In the case of a single tree, it is checked whether the horizontal or vertical length of the luma block (coding unit or partition block) exceeds the maximum luma transform block size that can be transformed, and if it does, the LFNST index signaling can be omitted.
[0336] C. If LFNST included in the current VVC standard is applied, the LFNST index can be transmitted only when both the horizontal and vertical lengths of the partition block are 4 or more.
[0337] If LFNST for 2xM (1xM) or Mx2 (Mx1) blocks is applied in addition to the LFNST currently included in the VVC standard, an LFNST index can be transmitted only if the partition block size is larger than or equal to 2xM (1xM) or Mx2 (Mx1) blocks. Here, PxQ blocks being larger than or equal to RxS blocks means that P≧R and Q≧S.
[0338] To summarize, an LFNST index can be sent only when a partition block is larger than or equal to the minimum size for which LFNST is applicable. In the case of a dual tree, an LFNST index can be signaled only when a partition block for a luma or chroma component is larger than or equal to the minimum size for which LFNST is applicable. In the case of a single tree, an LFNST index can be signaled only when a partition block for a luma component is larger than or equal to the minimum size for which LFNST is applicable.
[0339] In this document, an MxN block larger than or equal to a KxL block means that M is larger than or equal to K and N is larger than or equal to L. An MxN block larger than a KxL block means that M is larger than or equal to K, N is larger than or equal to L, and M is larger than K or N is larger than L. An MxN block smaller than or equal to a KxL block means that M is smaller than or equal to K and N is smaller than or equal to L, and an MxN block smaller than a KxL block means that M is smaller than or equal to K, N is smaller than or equal to L, and M is smaller than K or N is smaller than L.
[0340] D. If the position of the last non-zero coefficient is not the DC position (the upper left corner of the block), and if it is a dual tree type luma block, the LFNST index can be transmitted if the position of the last non-zero coefficient in any one of all partition blocks is not the DC position. If it is a dual tree type chroma block, the LNFST index can be transmitted if the position of the last non-zero coefficient in any one of all partition blocks for Cb (if ISP mode is not applied to the chroma component, the number of partition blocks is considered to be one) and all partition blocks for Cr (if ISP mode is not applied to the chroma component, the number of partition blocks is considered to be one) is not the DC position.
[0341] In the case of a single tree type, if the position of the last non-zero coefficient in any one of all partition blocks for the luma component, Cb component, or Cr component is not the DC position, the corresponding LFNST index can be transmitted.
[0342] Here, if the coded block flag (CBF) value indicating whether a transform coefficient exists for each partition block is 0, the position of the last non-zero coefficient for the partition block is not checked to determine whether LFNST index signaling is required. That is, if the CBF value is 0, no transform is applied to the block, so the position of the last non-zero coefficient for the partition block is not considered when checking the condition for LFNST index signaling.
[0343] For example, 1) in the case of a dual tree type and a luma component, if the corresponding CBF value for each partition block is 0, the corresponding partition block is excluded when determining whether to signal an LFNST index; 2) in the case of a dual tree type and a chroma component, if the CBF value for Cb is 0 and the CBF value for Cr is 1 for each partition block, only the position of the last non-zero coefficient for Cr is checked to determine whether to signal an LFNST index; and 3) in the case of a single tree type, for all partition blocks of the luma component, Cb component, and Cr component, the position of the last non-zero coefficient is checked only for blocks with a CBF value of 1 to determine whether to signal an LFNST index.
[0344] In the ISP mode, the image information may be configured so as not to check the position of the last non-zero coefficient, and an embodiment thereof will be described below.
[0345] In the ISP mode, LFNST index signaling can be accepted by omitting the check on the position of the last non-zero coefficient for both luma blocks and chroma blocks. That is, even if the position of the last non-zero coefficient for all partition blocks is the DC position or the corresponding CBF value is 0, the corresponding LFNST index signaling can be accepted.
[0346] ii. In the ISP mode, a check on the position of the last non-zero coefficient may be omitted for luma blocks, and a check on the position of the last non-zero coefficient may be performed in the case of chroma blocks in the same manner as described above. For example, in the case of a dual tree type luma block, LFNST index signaling may be permitted without checking the position of the last non-zero coefficient, and in the case of a dual tree type chroma block, whether a DC position exists for the position of the last non-zero coefficient may be checked in the same manner as described above to determine whether to signal the corresponding LFNST index.
[0347] iii. In the case of ISP mode and single-tree type, the above method i or method ii can be applied. That is, when method i is applied to the ISP mode and single-tree type, it is possible to omit checking the position of the last non-zero coefficient for both the luma block and the chroma block and allow LFNST index signaling. Alternatively, method ii can be applied to omit checking the position of the last non-zero coefficient for the partition block for the luma component, and for the partition block for the chroma component (when ISP is not applied to the chroma component, the number of partition blocks can be considered to be one), it is possible to determine whether to signal the corresponding LFNST index by performing a check on the position of the last non-zero coefficient in the above-mentioned method.
[0348] E. If it is confirmed that a transform coefficient exists in a position where an LFNST transform coefficient is not allowed for even one partition block among all partition blocks, LFNST index signaling can be omitted.
[0349] For example, in the case of a 4x4 partition block and an 8x8 partition block, the VVC standard's transform coefficient scanning order allows LFNST transform coefficients to exist at 8 positions from the DC position, and the remaining positions are all filled with 0. Also, in the case of a block that is larger than or equal to 4x4 and is not a 4x4 partition block or an 8x8 partition block, the VVC standard's transform coefficient scanning order allows LFNST transform coefficients to exist at 16 positions from the DC position, and the remaining positions are all filled with 0.
[0350] Therefore, after residual coding, if there are non-zero transform coefficients in the area that should be filled with zero values, LFNST index signaling can be omitted.
[0351] If LFNST can be applied to partition blocks of 2×M (1×M) or M×2 (M×1), the area where LFNST transform coefficients can be located can be specified as follows: Areas outside the area where transform coefficients can be located can be filled with zeros, and assuming that LFNST is applied, if there is a non-zero transform coefficient in the area that should be filled with zeros, LFNST index signaling can be omitted.
[0352] i. LFNST can be applied to 2×M or M×2 blocks, and when M=8, only eight LFNST transform coefficients can be generated for a 2×8 or 8×2 partition block. When transform coefficients are arranged in the scanning order shown in FIG. 20, eight transform coefficients are arranged in the scanning order from the DC position, and the remaining eight positions can be filled with zeros.
[0353] For a 2xN or Nx2 (N>8) partition block, 16 LFNST transform coefficients can be generated. When the transform coefficients are arranged in the scanning order as shown in FIG. 20, 16 transform coefficients are arranged in the scanning order from the DC position, and the remaining area can be filled with zeros. That is, in a 2xN or Nx2 (N>8) partition block, areas other than the upper left 2x8 or 8x2 block can be filled with zeros. For a 2x8 or 8x2 partition block, 16 transform coefficients can be generated instead of 8 LFNST transform coefficients, and in this case, no areas to be filled with zeros occur. As described above, when LFNST is applied, if a non-zero transform coefficient is detected in an area that is determined to be filled with zeros even in one partition block, LFNST index signaling can be omitted and the LFNST index can be inferred to be 0.
[0354] ii. LFNST can be applied to 1×M or M×1 blocks, and when M=16, only 8 LFNST transform coefficients can be generated for a 1×16 or 16×1 partition block. When transform coefficients are arranged in a left-to-right or top-to-bottom scanning order, 8 transform coefficients are arranged in the corresponding scanning order from the DC position, and the remaining 8 positions can be filled with 0.
[0355] For a 1xN or Nx1 (N>16) partition block, 16 LFNST transform coefficients can be generated, and when the transform coefficients are arranged in a scanning order from left to right or top to bottom, 16 transform coefficients are arranged in the corresponding scanning order from the DC position, and the remaining area can be filled with 0. That is, in a 1xN or Nx1 (N>16) partition block, the area other than the top left 1x16 or 16x1 block can be filled with 0.
[0356] For a 1x16 or 16x1 partition block, 16 transform coefficients can be generated instead of 8 LFNST transform coefficients, in which case no areas to be filled with 0 occur. As described above, when LFNST is applied, if a non-zero transform coefficient is detected in an area that is determined to be filled with 0 even in one partition block, LFNST index signaling can be omitted and the LFNST index can be inferred to 0.
[0357] Meanwhile, in ISP mode, the current VVC standard checks the length conditions for the horizontal and vertical directions independently and applies DST-7 instead of DCT-2 without signaling the MTS index. It determines whether the horizontal or vertical length is greater than or equal to 4 and less than or equal to 16, and the primary transform kernel is determined based on the determination result. Therefore, in ISP mode and when LFNST can be applied, the following transform combination configurations are possible.
[0358] 1. If the LFNST index is 0 (including the case where the LFNST index is inferred to be 0), the primary transformation decision conditions for the ISP currently included in the VVC standard can be followed. That is, it checks whether the length conditions (greater than or equal to 4, and less than or equal to 16) are met independently for the horizontal and vertical directions, and if they are met, DST-7 is applied instead of DCT-2 for the primary transformation; if not, DCT-2 can be applied.
[0359] 2. When the LFNST index is greater than 0, the following two configurations are possible for the linear transformation:
[0360] A. DCT-2 can be applied to both the horizontal and vertical directions.
[0361] B. It can comply with the primary transformation decision conditions for ISPs currently included in the VVC standard. That is, it checks whether the horizontal and vertical length conditions (greater than or equal to 4, and less than or equal to 16) are met independently, and if they are met, it applies DST-7 instead of DCT-2, and if they are not met, it applies DCT-2.
[0362] In the ISP mode, the video information can be configured so that the LFNST index is transmitted for each partition block, not for each coding unit. In this case, whether to signal the LFNST index can be determined by regarding only one partition block as being present within the unit in which the LFNST index is transmitted in the above-described LFNST index signaling method.
[0363] Meanwhile, the signaling order of the LFNST index and the MTS index will be considered below.
[0364] 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 this 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.
[0365] An example of the syntax of residual coding is as follows:
[0366] [Table 9-1]
[0367] [Table 9-2]
[0368] The meanings of the main variables shown in Table 9 are as follows:
[0369] 1. cbWidth, cbHeight: Width and height of the current coding block
[0370] 2. log2TbWidth, log2TbHeight: Base-2 logarithm of the width and height of the current transform block. Zero-out is reflected and it can be reduced to the upper left corner where non-zero coefficients can exist.
[0371] 3. sps_lfnst_enabled_flag: A flag indicating whether LFNST is applicable (enabled). If the flag value is 0, LFNST is not applicable, and if the flag value is 1, LFNST is applicable. This flag is defined in the Sequence Parameter Set (SPS).
[0372] 4. CuPredMode[chType][x0][y0]: Prediction mode corresponding to the variable chType and the (x0, y0) position. chType can have values of 0 and 1, where 0 indicates the luma component and 1 indicates the chroma component. The (x0, y0) position indicates the position on the picture, and the CuPredMode[chType][x0][y0] value can be MODE_INTRA (intra prediction) or MODE_INTER (inter prediction).
[0373] 5. IntraSubPartitionsSplit[x0][y0]: The content for the (x0, y0) position is the same as 4. It indicates what type of ISP split is applied at the (x0, y0) position, and ISP_NO_SPLIT indicates that the coding unit corresponding to the (x0, y0) position is not split into partition blocks.
[0374] 6. intra_mip_flag[x0][y0]: The content for the (x0, y0) position is the same as in 4. intra_mip_flag is a flag indicating whether 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.
[0375] 7. cIdx: A value of 0 indicates luma, and values of 1 and 2 indicate the chroma components Cb and Cr, respectively.
[0376] 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)
[0377] 9. tu_cbf_cb[x0][y0]: The content for the (x0, y0) position is the same as in 4. It indicates the CBF (Coded Block Flag) for the Cb component. If its value is 0, it means that no non-zero coefficients exist in the transform unit for the Cb component, and if its value is 1, it means that a non-zero coefficient exists in the transform unit for the Cb component.
[0378] 10. lastSubBlock: Indicates the position in the scan order of the sub-block (Coefficient Group (CG)) where the last significant coefficient (last non-zero coefficient) is located. 0 indicates a sub-block containing a DC component, and if it is greater than 0, it is not a sub-block containing a DC component.
[0379] 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.
[0380] 12. lfnst_idx[x0][y0]: The LFNST index syntax element to be parsed. If not parsed, it is inferred to have a value of 0. In other words, the default value is set to 0, which indicates that LFNST is not applied.
[0381] 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.
[0382] 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.
[0383] 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.
[0384] 16. tu_mts_idx[x0][y0]: MTS index syntax element to be parsed. If not parsed, it is inferred to 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.
[0385] As shown in Table 9, in the case of a single tree, whether to signal an LFNST index 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 present 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 present at a position from 0 to 7 within the upper left sub-block.
[0386] 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.
[0387] In Table 9, "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".
[0388] In Table 9, log2ZoTbWidth and log2ZoTbHeight refer to the base-2 logarithmic values of the width and height, respectively, for the top-left region where the last significant coefficient can reside due to zeroing out.
[0389] As shown in Table 9, 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.
[0390] 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.
[0391] 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. In other words, after applying a DST-7 / DCT-8 of length 32 or more, 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.
[0392] 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.
[0393] 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, if a 64x8 transform block is used and DCT-2 is applied to the horizontal direction and DST-7 to the vertical direction (which can occur when implicit MTS is applied), there can be significant coefficients in the upper left 32x8 region at most.
[0394] If log2ZoTbWidth and log2ZoTbHeight are updated in two places as in Table 9, 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.
[0395] [Table 10]
[0396] In such a case, the maximum values of last_sig_coeff_x_prefix and last_sig_coeff_y_prefix can be set by reflecting the log2ZoTbWidth and log2ZoTbHeight values in the binarization process for last_sig_coeff_x_prefix and last_sig_coeff_y_prefix.
[0397] [Table 11]
[0398] Meanwhile, as an example, if the mode is ISP and LFNST is applied, when the signaling of Table 9 is applied, the spec text can be configured as shown in Table 12. Compared to Table 9, the condition that signals the LFNST index only when the mode is not ISP (IntraSubPartitionsSplit[x0][y0] == ISP_NO_SPLIT in Table 9) has been deleted.
[0399] 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 having a significant coefficient 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 12 are explained in Table 9.
[0400] [Table 12]
[0401] As another example, if the last significant coefficient is allowed to be located at the DC position in ISP in Table 12, the parsing condition of the LFNST index can be changed as follows:
[0402] [Table 13]
[0403] Meanwhile, according to one example, the LFNST index and / or MTS index can be signaled at the coding unit level. As described above, the LFNST index can 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 can be coded as bin strings 0, 10, and 11, respectively.
[0404] For 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, if 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.
[0405] The MTS index value can have values of 0, 1, 2, 3, and 4, where 0, 1, 2, 3, and 4 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 0, 1, 2, 3, and 4 values can be coded with bin strings of 0, 10, 110, 1110, and 1111, respectively.
[0406] 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:
[0407] [Table 14]
[0408] The variables LfnstDcOnly and LfnstZeroOutSigCoeffFlag in Table 14 can be set as shown in Table 15 below.
[0409] The variable LfnstDcOnly is set to 1 if the last significant coefficients of a transform block whose CBF (Coded Block Flag, which is 1 if there is at least one significant coefficient in the block and 0 otherwise) value is 1 are all located at the DC position (top left corner position), and is set to 0 otherwise. More specifically, in the case of dual tree luma, the position of the last significant coefficient is checked for one luma transform block, and in the case of dual tree chroma, the position of the last significant coefficient is checked for both the transform block for Cb and the transform block for Cr. In the case of a single tree, the position of the last significant coefficient can be checked for the transform blocks for luma, Cb, and Cr.
[0410] The variable LfnstZeroOutSigCoeffFlag is 0 if there is a valid coefficient at a position that will be zeroed out when LFNST is applied, and is 1 otherwise.
[0411] In Table 14 and the following tables, lfnst_idx[x0][y0] indicates the LFNST index for the corresponding coding unit, and tu_mts_idx[x0][y0] indicates the MTS index for the corresponding coding unit.
[0412] As shown in Table 14, the condition for signaling lfnst_idx[x0][y0] may include a condition (!transform_skip_flag[x0][y0]) that checks whether the transform_skip_flag[x0][y0] value is 0, in which case the existing condition for checking whether the tu_mts_idx[x0][y0] value is 0 (i.e., checking whether both the horizontal and vertical directions are DCT-2) may be omitted.
[0413] transform_skip_flag[x0][y0] indicates whether the coding unit is coded in transform skip mode, in which transform is omitted, and this flag is signaled before the MTS index and the LFNST index. That is, since lfnst_idx[x0][y0] is signaled before the tu_mtx_idx[x0][y0] value is signaled, only the condition for the transform_skip_flag[x0][y0] value can be checked.
[0414] As shown in Table 14, 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 lfnst_idx[x0][y0] value is 0.
[0415] 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.
[0416] According to Table 14, 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, that is, whether MTS is applicable is determined by the width and height of the coding unit for the luma component.
[0417] 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 tu_cbf_luma[x0][y0] value in Table 14 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.
[0418] Also, according to Table 14, 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.
[0419] On the other hand, tu_mts_idx[x0][y0] can only be signaled in non-ISP mode (IntraSubPartitionsSplit[x0][y0]==ISP_NO_SPLIT).
[0420] If the MTS index is signaled immediately after the LFNST index as in Table 14, 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 in the residual coding part where only 16 coefficients are left for a 32-length DST-7 or DCT-8 and zero-out is performed can be changed as shown in Table 15 below.
[0421] [Table 15-1]
[0422] [Table 15-2]
[0423] In the process of determining log2ZoTbWidth and log2ZoTbHeight as shown in Table 15 (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 tu_mts_idx[x0][y0] value can be omitted.
[0424] The binarization for last_sig_coeff_x_prefix and last_sig_coeff_y_prefix in Table 15 can be determined based on log2ZoTbWidth and log2ZoTbHeight as in Table 11.
[0425] Also, as shown in Table 15, when determining log2ZoTbWidth and log2ZoTbHeight in residual coding, a condition for checking sps_mts_enable_flag can be added.
[0426] TR in Table 11 indicates a truncated Rice binarization method, and the last significant coefficient information can be binarized according to the method described in the following table based on cMax and cRiceParam defined in Table 11.
[0427] [Table 16]
[0428] For example, if information on 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 17.
[0429] [Table 17]
[0430] In Table 17, 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 has been added to Table 17. If either 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 both the horizontal and vertical directions.
[0431] If LumaLastSignificantCoeffX and LumaLastSignificantCoeffY are both less than 16, it means that the last significant coefficient is located within the upper left 16x16 region, and if a 32-length DST-7 or DCT-8 is applied in the current VVC standard, it indicates that zeroing may have been applied, leaving only the leftmost or topmost 16 transform coefficients. Therefore, the transform kernel used for the primary transform can be indicated by signaling tu_mts_idx[x0][y0].
[0432] Meanwhile, in another example, the coding unit syntax table and the residual coding syntax table are as shown in the following table.
[0433] [Table 18]
[0434] [Table 19]
[0435] In Table 18, MtsZeroOutSigCoeffFlag is initially set to 1, and this value can be changed by residual coding in Table 19. The variable MtsZeroOutSigCoeffFlag changes its value from 1 to 0 if 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 19.
[0436] Meanwhile, as an example, when determining log2ZoTbWidth and log2ZoTbHeight in residual coding, a condition for checking sps_mts_enable_flag can be added as shown in the table below.
[0437] [Table 20]
[0438] As shown in Table 20, when tu_cbf_luma[x0][y0] is 1, MtsZeroOutSigCoeffFlag can be set to 1, and when tu_cbf_luma[x0][y0] is 0, the existing MtsZeroOutSigCoeffFlag value can be maintained. Therefore, when tu_cbf_luma[x0][y0] is 0 and the MtsZeroOutSigCoeffFlag value is maintained at 0, mts_idx[x0][y0] coding can be omitted. That is, when the CBF value of the luma component is 0, no transformation is applied and therefore the MTS index is meaningless, so coding of the MTS index can be omitted.
[0439] 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.
[0440] FIG. 22 is a flow chart illustrating the operation of a video decoding device according to one embodiment of this document.
[0441] The steps disclosed in Fig. 22 are based on some of the details detailed in Fig. 5 to Fig. 21. Therefore, the description of specific details that overlap with the details detailed in Fig. 3, and Fig. 5 to Fig. 21 will be omitted or simplified.
[0442] The decoding apparatus 300 according to an embodiment may receive residual information from a bitstream (S2210).
[0443] More specifically, the decoding apparatus 300 may decode information on quantized transform coefficients for a current block from a bitstream and derive quantized transform coefficients for a target block based on the information on the quantized transform coefficients for the current block. The information on 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 on whether a simplified transform (RST) is applied, information on a simplification factor, information on a minimum transform size for applying the simplified transform, information on a maximum transform size for applying the simplified transform, a simplified inverse transform size, and information on a transform index indicating any one of transform kernel matrices included in the transform set.
[0444] In addition, the decoding apparatus may further receive information regarding an intra-prediction mode for the current block and information regarding whether ISP is applied to the current block. The decoding apparatus may derive whether the current block is to be divided into a predetermined number of sub-partition transformation blocks by receiving and parsing flag information indicating whether ISP coding or an ISP mode is to be applied. Here, the current block is a coding block. In addition, the decoding apparatus may derive the size and number of the sub-partition blocks to be divided based on the flag information indicating the direction in which the current block is to be divided.
[0445] The decoding apparatus 300 may derive transform coefficients by performing inverse quantization on residual information for the current block, i.e., quantized transform coefficients (S2220).
[0446] 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, i.e., the transform coefficients on which inverse quantization has been performed may be arranged in a reverse scan order applied in VVC or HEVC video codecs.
[0447] The transform coefficients derived based on the residual information may be dequantized or quantized as described above. That is, the transform coefficients may be data that can be checked for non-zero data in the current block, regardless of whether they are quantized or not.
[0448] A decoding device can derive residual samples by applying an inverse transform to the quantized transform coefficients.
[0449] 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 these 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.
[0450] The decoding device can determine whether to parse the MTS index to apply the MTS to the current block, and for example, can determine the tree type of the current block, the division type of the current block, and whether zero-out has been performed on the MTS for the current block (S2230).
[0451] If the tree type of the current block is not dual tree chroma and the LFNST index indicating the LFNST kernel to be applied to the current block is 0, the decoding device can determine that the MTS index is to be parsed and parse the MTS index.
[0452] That is, when the tree type of the current block is single trig or dual tree luma, the decoding device can parse the MTS index when the LFNST index is 0, i.e., when LFNST is not applied to the current block.
[0453] However, even if the MTS index is not parsed, if certain conditions are met, the MTS can be implicitly applied. For example, if the current block is divided into sub-partition blocks, or if a sub-block transform (SBT) is applied, or if matrix-based intra prediction (MIP) mode is not applied to intra prediction of the current block, the implicit MTS can be applied.
[0454] Also, according to one example, the decoding device may parse the MTS index if the larger of the width and height of the current block is equal to or smaller than 32. That is, if the width or height of the current block is larger than 32, the MTS cannot be applied.
[0455] Also, according to one example, if the current block is not divided into a plurality of sub-partition blocks and sub-block transformation that divides coding units and performs transformation on the current block is not applied, the MTS index may be parsed. As described above, if ISP or SBT is applied to the current block, MTS may be implicitly performed and the MTS index is not signaled.
[0456] In addition, the decoding device can parse the MTS index depending on whether zero-out has been performed on the MTS, and can determine that zero-out has not been performed if a significant coefficient exists in a second region excluding a first region at the top left corner where a significant transform coefficient can exist in the current block. That is, if no significant coefficient exists in the second region, it can determine that zero-out has been performed and parse the MTS index.
[0457] The first region is the 16x16 region at the top left corner of the current block.
[0458] The decoding apparatus may derive a variable MtsZeroOutSigCoeffFlag that can indicate that zeroing out has been performed when MTS is applied. The variable MtsZeroOutSigCoeffFlag indicates whether a transform coefficient exists in an area other than the top left area, i.e., the top left 16x16 area, where the last significant coefficient can be located due to zeroing out after MTS is performed. The variable MtsZeroOutSigCoeffFlag is initially set to 1, and if a transform coefficient exists in an area other than the 16x16 area, the value may be changed from 1 to 0. If the value of the variable MtsZeroOutSigCoeffFlag is 0, the MTS index is not signaled.
[0459] In one example, the decoding device may check the transform skip flag value and parse the MTS index if the value is 0.
[0460] At least two or more conditions for parsing the MTS index can be combined with an AND condition. For example, the decoding device can parse the MTS index if the tree type of the current block is not dual tree chroma, the LFNST index indicating the LFNST kernel is 0, the greater of the width and height of the current block is less than or equal to 32, the current block is not divided into sub-partition blocks, sub-block transformation is not applied to the current block, and zero-out due to MTS execution is performed.
[0461] The decoding device can receive and parse at least one of an LFNST index or an MTS index at the coding unit level, and can parse an LFNST index that points to an LFNST kernel before, i.e., immediately after, an MTS index that points to an MTS kernel.
[0462] After parsing the MTS index, the decoding apparatus can apply the MTS to the current block based on the MTS index to derive a residual sample for the current block (S2240).
[0463] Next, the decoding apparatus 300 may generate reconstructed samples based on the residual samples for the current block and the predicted samples for the current block (S2250).
[0464] 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.
[0465] FIG. 23 is a flow diagram illustrating the operation of a video encoding device according to one embodiment of this document.
[0466] Each step disclosed in Fig. 23 is based on part of the content detailed in Fig. 5 to Fig. 21. Therefore, the description of specific content that overlaps with the content detailed in Fig. 2, and Fig. 5 to Fig. 21 will be omitted or simplified.
[0467] The encoding apparatus 200 according to an embodiment may derive prediction samples for a current block based on an intra prediction mode applied to the current block (S2310).
[0468] When ISP is applied to the current block, the encoding apparatus can perform prediction for each sub-partition transform block.
[0469] The encoding device can determine whether to apply ISP coding or ISP mode to the current block, i.e., the coding block, and based on the determination result, can determine in which direction the current block will be divided and derive the size and number of sub-blocks to be divided.
[0470] The encoding apparatus 200 may derive residual samples for the current block based on the predicted samples (S2320).
[0471] The encoding apparatus 200 can derive transform coefficients for the current block by applying at least one of LFNST or MTS to the residual samples and arrange the transform coefficients according to a predetermined scanning order. For example, the encoding apparatus 200 can derive transform coefficients for the current block based on the MTS for the residual samples (S2330).
[0472] The primary transform can be performed via multiple transform kernels, such as MTS, in which case the transform kernel can be selected based on the intra prediction mode.
[0473] After deriving transform coefficients by applying MTS, the encoding apparatus may zero out the remaining area of the current block excluding a specific area at the top left corner of the current block, for example, a 16x16 area.
[0474] The encoding device may encode the MTS index based on the tree type of the current block, the partition type of the current block, and whether zeroing out has been performed on the MTS for the current block, and may encode residual information derived through quantization of the transform coefficients (S2340).
[0475] The encoding device may configure video information so that an MTS index is signaled if the tree type of the current block is not dual tree chroma and the LFNST index indicating the LFNST kernel to be applied to the current block is 0, and may signal the MTS index.
[0476] That is, when the tree type of the current block is single trig or dual tree luma, the encoding device can signal the MTS index when the LFNST index is 0, i.e., when LFNST is not applied to the current block.
[0477] However, even if the MTS index is not signaled, if certain conditions are met, the MTS may be implicitly applied. For example, if the current block is divided into sub-partition blocks, or if a sub-block transform (SBT) is applied, or if the matrix-based intra prediction (MIP) mode is not applied to the intra prediction of the current block, the implicit MTS may be applied.
[0478] Also, according to one example, the encoding apparatus may configure video information so that an MTS index is signaled when the larger of the width and height of the current block is equal to or smaller than 32, and may signal the MTS index. That is, if the width or height of the current block is larger than 32, the MTS cannot be applied.
[0479] Also, according to one example, if the current block is not divided into a plurality of sub-partition blocks and sub-block transformation that divides coding units and performs transformation on the current block is not applied, the MTS index may be signaled. As described above, if ISP or SBT is applied to the current block, MTS may be implicitly performed and the MTS index is not signaled.
[0480] In addition, the encoding apparatus may signal an MTS index depending on whether zero-out has been performed on the MTS, and may determine that zero-out has not been performed if a significant coefficient exists in a second region excluding a first region at the top left corner where a significant transform coefficient can exist in the current block. That is, if no significant coefficient exists in the second region, it may determine that zero-out has been performed and signal an MTS index.
[0481] The first region is the 16x16 region at the top left corner of the current block.
[0482] The encoding apparatus derives a variable MtsZeroOutSigCoeffFlag, which can indicate that zero-out has been performed when MTS is applied, and can configure this variable in video information for MTS index signaling. The variable MtsZeroOutSigCoeffFlag indicates whether a transform coefficient exists in an area other than the top-left area, i.e., the top-left 16x16 area, where the last significant coefficient can be located due to zero-out after MTS is performed. The variable MtsZeroOutSigCoeffFlag is initially set to 1, and if a transform coefficient exists in an area other than the 16x16 area, its value can be changed from 1 to 0. If the value of the variable MtsZeroOutSigCoeffFlag is 0, the MTS index is not signaled.
[0483] According to one example, the encoding device may check the transform skip flag value and, if the value is 0, signal the MTS index.
[0484] At least two of the conditions for encoding the MTS index may be combined with an AND condition. For example, the encoding device may signal the MTS index if the tree type of the current block is not dual tree chroma, the LFNST index indicating the LFNST kernel is 0, the greater of the width and height of the current block is less than or equal to 32, the current block is not divided into sub-partition blocks, sub-block transform is not applied to the current block, and zero-out due to MTS execution is performed.
[0485] The encoding device can signal at least one of an LFNST index or an MTS index at the coding unit level, and can configure video information so that an LFNST index indicating an LFNST kernel is signaled before, i.e., immediately after, an MTS index indicating an MTS kernel.
[0486] The encoding apparatus can generate residual information including information on quantized transform coefficients. The residual information can include the above-described transform-related information / syntax elements. The encoding apparatus can encode image / video information including the residual information and output it in the form of a bitstream.
[0487] More specifically, the encoding apparatus 200 may generate information about the quantized transform coefficients and encode the generated information about the quantized transform coefficients.
[0488] If LFNST can be applied, the video information may include an LFNST index that indicates an LFNST matrix.
[0489] The LFNST index syntax element according to this embodiment indicates whether an (inverse) LFNST is applied and which of the LFNST matrices is included in the LFNST set. If the LFNST set includes two transformation kernel matrices, the value of the LFNST index syntax element is three.
[0490] For example, if the partitioning tree structure for the current block is a dual tree type, an LFNST index may be encoded for each of the luma block and the chroma block.
[0491] In one embodiment, the syntax element value for the transform index can be derived as 0, which indicates that (inverse) LFNST is not applied to the current block, 1, which indicates the first LFNST matrix among the LFNST matrices, or 2, which indicates the second LFNST matrix among the LFNST matrices.
[0492] In this document, at least one of quantization / dequantization and / or transform / inverse transform may be omitted. When the quantization / dequantization is omitted, the quantized transform coefficients may be referred to as transform coefficients. When the transform / inverse transform is omitted, the transform coefficients may be referred to as coefficients or residual coefficients, or may still be referred to as transform coefficients for the sake of uniformity of expression.
[0493] 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 the transform coefficient(s), and the information about the transform coefficient(s) may be signaled via residual coding syntax. Transform coefficients may be derived based on the residual information (or information about the transform coefficient(s), 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 be similarly applied / expressed in other parts of this document.
[0494] In the above-described embodiments, the method is described based on a flow chart with a series of steps or blocks, but this document is not limited to the order of steps, and some steps may occur in a different order or simultaneously with other steps than those described. Furthermore, those skilled in the art will understand that the steps shown in the flow chart are not exclusive, and other steps may be included, or one or more steps in the flow chart may be deleted without affecting the scope of this document.
[0495] The method according to the present document described above can be implemented in software form, and the encoding device and / or decoding device according to the present document can be included in a device that performs video processing, such as a TV, a computer, a smartphone, a set-top box, or a display device.
[0496] In this document, when an embodiment is implemented in software, the method described above may be implemented with modules (processes, functions, etc.) that perform the functions described above. The modules 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 in various well-known ways. The processor may include an application-specific integrated circuit (ASIC), other chipsets, logic circuits, and / or data processing devices. The memory may include 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 the figures may be implemented and executed on a computer, processor, microprocessor, controller, or chip.
[0497] In addition, the decoding device and encoding device to which this document is applied may be included in 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, a medical video device, etc., and may be used to process a video signal or a data signal. For example, over-the-top (OTT) video devices may include a game console, a Blu-ray player, an internet-connected TV, a home theater system, a smartphone, a tablet PC, a digital video recorder (DVR), etc.
[0498] In addition, a processing method to which this document is applied may be produced in the form of a computer-executable program and stored on a computer-readable recording medium. Multimedia data having a data structure according to this document may also be stored on 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. Examples of the computer-readable recording medium include Blu-ray Discs (BDs), Universal Serial Buses (USBs), ROMs, PROMs, EPROMs, EEPROMs, RAMs, CD-ROMs, magnetic tapes, floppy disks, and optical data storage devices. The computer-readable recording medium also includes media embodied in the form of carrier waves (e.g., transmission via the Internet). A bitstream generated by an encoding method may be stored on a computer-readable recording medium or transmitted via a wired or wireless communication network. Furthermore, embodiments of this document may be embodied as a computer program product in the form of program code, which can be executed by a computer according to embodiments of this document. The program code may be stored on a computer-readable carrier.
[0499] 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 performed by a decoding device, comprising: receiving residual information from a bitstream; deriving transform coefficients for a current block based on the residual information; deriving residual samples for the current block by applying an inverse transform to the transform coefficients based on a multiple transform selection (MTS) index of the current block; generating a reconstructed picture based on the residual samples; The MTS index is The tree type of the current block; A division type of the current block; and a low frequency non-separable transform (LFNST) index associated with an LFNST kernel for the current block; a variable related to whether at least one significant coefficient is present in a second region other than a first region within the current block, the first region being a 16x16 region including a top-left sample position of the current block; the variable is set to an initial value equal to 1 in the coding unit syntax; the variable is changed to 0 in a residual coding syntax based on the at least one significant coefficient being in the second region other than the first region; the LFNST index and the MTS index are obtained from a coding unit syntax; The video decoding method, wherein the MTS index is obtained after the LFNST index is obtained from the coding unit syntax.
2. The video decoding method of claim 1 , wherein the MTS index is obtained from the bitstream based on the tree type of the current block not being dual-tree chroma and the LFNST index being 0.
3. The video decoding method of claim 2 , wherein the MTS index is obtained from the bitstream based on the maximum width and height of the current block being 32 or less.
4. 4. The video decoding method of claim 3, wherein the MTS index is obtained from the bitstream based on the fact that the current block is not divided into a plurality of sub-partition blocks and that a sub-block transform for performing the inverse transform by dividing a coding unit is not applied to the current block.
5. A video decoding method as described in Claim 4, wherein the MTS index is obtained from the bitstream based on the at least one valid coefficient not being present in the second region.
6. A video encoding method performed by a video encoding device, comprising: deriving a predicted sample for the current block; deriving a residual sample for the current block based on the predicted sample; deriving transform coefficients for the current block based on a transform for the residual samples; encoding residual information derived via quantization of the transform coefficients and a multiple transform selection (MTS) index associated with a transform kernel for the transform; The MTS index is The tree type of the current block; A division type of the current block; and a low frequency non-separable transform (LFNST) index associated with an LFNST kernel for the current block; a variable related to whether at least one significant coefficient is present in a second region other than a first region within the current block, the first region being a 16x16 region including a top left sample position of the current block; the variable is set to an initial value equal to 1 in the coding unit syntax; the variable is changed to 0 in a residual coding syntax based on the at least one significant coefficient being in the second region other than the first region; the LFNST index and the MTS index are encoded in the coding unit syntax; The video encoding method, wherein the MTS index is encoded after the LFNST index is encoded in the coding unit syntax.
7. The video encoding method of claim 6 , wherein the MTS index is encoded into the bitstream based on the tree type of the current block not being dual tree chroma and the LFNST index being 0.
8. The video encoding method of claim 7 , wherein the MTS index is encoded into the bitstream based on the maximum width and height of the current block being equal to or less than 32.
9. 9. The video encoding method of claim 8, wherein the MTS index is encoded in the bitstream based on the fact that the current block is not divided into a plurality of sub-partition blocks and that a sub-block transform for performing a transform by dividing a coding unit is not applied to the current block.
10. A video encoding method as described in Claim 9, wherein the MTS index is encoded into the bitstream based on the at least one significant coefficient not being present in the second region.
11. 1. A method for transmitting data for video information, comprising: generating a bitstream of the video information including residual information, the bitstream comprising: deriving a predicted sample for the current block; deriving a residual sample for the current block based on the predicted sample; deriving transform coefficients for the current block based on a transform for the residual samples; encoding residual information derived via quantization of the transform coefficients and multiple transform selection (MTS) indices associated with a transform kernel for the transform; transmitting the data including a bitstream of the video information; The MTS index is The tree type of the current block; A division type of the current block; and a low frequency non-separable transform (LFNST) index associated with an LFNST kernel for the current block; a variable related to whether at least one significant coefficient is present in a second region other than a first region within the current block, the first region being a 16x16 region including a top left sample position of the current block; the variable is set to an initial value equal to 1 in the coding unit syntax; the variable is changed to 0 in a residual coding syntax based on the at least one significant coefficient being in the second region other than the first region; the LFNST index and the MTS index are encoded in the coding unit syntax; The method, wherein the MTS index is encoded after the LFNST index is encoded into the coding unit syntax.