Transform-based image coding method, and apparatus therefor
Through the transform-based image encoding method, LFNST and MTS index signaling are used to optimize image/video compression, solving the problem of high-resolution image/video data transmission cost, and achieving more efficient video compression and transmission.
Patent Information
- Application Number
- JP2024207045
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2019-10-07
- Filing Date
- 2024-11-28
- Publication Date
- 2025-02-06
- Estimated Expiration
- 2040-10-05
AI Technical Summary
The prior art is difficult to efficiently compress and transmit high-resolution, high-quality image/video data, especially Immersive Media such as VR and AR content, and the transmission and storage costs are high.
The transformation-based image encoding method is adopted, and video encoding is used to use LFNST and MTS. The image/video compression efficiency is optimized through LFNST index and MTS index signaling, including processing of residual double samples and arrangement of scanning order.
Improve image/video encoding efficiency, enhance the efficiency of transform index encoding, and achieve more efficient video compression and transmission.
Smart Images

Figure 2025019306000001_ABST
Abstract
Description
[Technical field]
[0001] This document relates to image coding technology, and more particularly to a transform-based image coding method and apparatus in an image coding system. [Background technology]
[0002] In recent years, the 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 image / video data has higher resolution and quality, the amount of information or bits to be transmitted increases relatively compared to existing image / video data, so that when image data is transmitted using a medium such as an existing wired or wireless broadband line or image / video data is stored using an existing storage medium, the transmission cost and storage cost increase.
[0003] In addition, in recent years, interest in and demand for immersive media such as virtual reality (VR), artificial reality (AR) content, and holograms has been increasing, and the broadcast of images / videos having different image characteristics from real images, such as game images, has been increasing.
[0004] Therefore, there is a demand for a highly efficient image / video compression technique to effectively compress and 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 improving the coding efficiency of images.
[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 object of this document is to provide a video coding method and apparatus using LFNST and MTS.
[0008] Another technical problem of this document is to provide a video coding method and apparatus for LFNST index and MTS index signaling. [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: a residual coding step of parsing residual information received at a residual coding level and arranging transform coefficients for the current block according to a predetermined scanning order; a step of applying at least one of LFNST and MTS to the transform coefficients to derive residual samples; and a step of generating a reconstructed picture based on the residual samples; wherein the LFNST is performed based on an LFNST index indicating an LFNST kernel, and the MTS is performed based on an MTS index indicating an MTS kernel, the LFNST index and the MTS index are signaled at a coding unit level, and the MTS index is signaled immediately after the signaling of the LFNST index.
[0010] If the tree type of the current block is a single tree type, the LFNST index is parsed after the residual coding for the luma block and the chroma block of the current block is performed.
[0011] If the tree type of the current block is a dual tree type and a chroma component is coded, the LFNST index is parsed after the residual coding for the Cb and Cr components of the chroma block is performed.
[0012] If the current block is divided into a plurality of sub-partition blocks, the residual coding for the plurality of sub-partition blocks is performed, and then the LFNST index is parsed.
[0013] When the current block is divided into the plurality of sub-partition blocks, the LFNST index is parsed regardless of whether the transform coefficients are present in an area excluding a DC position of each of the plurality of sub-partition blocks.
[0014] The residual coding step includes the steps of: deriving a first variable indicating whether the transform coefficient exists in an area excluding a DC position of the current block; and deriving a second variable indicating whether the transform coefficient exists in a second area excluding a first area at the upper left corner of the current block or the sub-partition block divided from the current block; and if the transform coefficient exists in the area excluding the DC position and the transform coefficient does not exist in the second area, the LFNST index is parsed.
[0015] The residual coding step includes a step of deriving a third variable indicating whether the transform coefficient exists in an area excluding the top left 16x16 area of the current block, and if the transform coefficient does not exist in the area excluding the 16x16 area, the MTS index is parsed.
[0016] According to an embodiment of the present document, there is provided a video encoding method performed by an encoding apparatus, the method including: deriving transform coefficients for the current block by applying at least one of LFNST or MTS to residual samples and arranging the transform coefficients according to a predetermined scanning order; encoding at least one of an LFNST index indicating an LFNST kernel or an MTS index indicating an MTS kernel; and configuring and outputting video information such that the LFNST index and the MTS index are signaled at a coding unit level and the MTS index is signaled immediately after the signaling of the LFNST index.
[0017] According to another embodiment of the present document, a digital storage medium is provided having stored thereon video data including encoded video information and a bitstream generated by a video encoding method performed by an encoding apparatus.
[0018] According to another embodiment of the present document, a digital storage medium is provided having stored thereon video data including encoded video information and a bitstream that enables a decoding device to perform the video decoding method. Effect of the Invention
[0019] According to the document, it can improve the overall image / video compression efficiency.
[0020] According to this document, the efficiency of transform index coding can be improved.
[0021] According to this document, a video coding method and device using LFNST and MTS can be provided.
[0022] According to this document, a video coding method and apparatus for LFNST index and MTS index signaling can be provided.
[0023] The effects 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. Thus, the specific effects of the present specification are not limited to those explicitly described in the present specification, and may include various effects that can be understood or derive from the technical features of the present specification. [Brief description of the drawings]
[0024] [Figure 1] FIG. 1 is a diagram illustrating the configuration of a video / image encoding device to which this document can be applied.
[0025] [Diagram 2] FIG. 1 is a diagram illustrating the configuration of a video / image decoding device to which this document can be applied.
[0026] [Diagram 3] 1 illustrates a schematic diagram of a multiple conversion technique according to an embodiment of the present document;
[0027] [Figure 4] An intra-directional mode with 65 prediction directions is shown as an example.
[0028] [Diagram 5] FIG. 1 is a diagram for explaining a RST according to one embodiment of this document.
[0029] [Figure 6] 13 is a diagram illustrating an example of a sequence in which output data of a forward linear transform is arranged in a one-dimensional vector. FIG.
[0030] [Figure 7] 13 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.
[0031] [Figure 8] FIG. 13 shows block shapes to which LFNST is applied.
[0032] [Figure 9] FIG. 13 is a diagram showing an example of an arrangement of output data from a forward LFNST;
[0033] [Figure 10] FIG. 13 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.
[0034] [Figure 11] FIG. 13 is a diagram illustrating zeroing out in a block to which 4×4 LFNST is applied, according to an example.
[0035] [Figure 12] FIG. 13 is a diagram illustrating zeroing out in a block to which 8×8 LFNST is applied, according to an example.
[0036] [Figure 13] FIG. 13 is a diagram showing zeroing out in a block to which 8×8 LFNST is applied according to another example.
[0037] [Figure 14] FIG. 2 is a diagram showing an example of sub-blocks into which one coding block is divided.
[0038] [Figure 15] FIG. 13 is a diagram showing another example of sub-blocks into which one coding block is divided.
[0039] [Figure 16] FIG. 2 illustrates symmetry between an M×2 (M×1) block and a 2×M (1×M) block according to an example.
[0040] [Figure 17] FIG. 13 illustrates an example of transposing a 2×M block.
[0041] [Figure 18] 1 shows a scanning order for an 8×2 or 2×8 region according to an example.
[0042] [Figure 19] 1 is a diagram illustrating an image decoding method according to an example.
[0043] [Figure 20] 1 is a diagram illustrating an example of a method for encoding a video.
[0044] [Figure 21] 1 illustrates generally an example of a video / image coding system to which this document can be applied;
[0045] [Figure 22] 1 illustrates an exemplary structural diagram of a content streaming system to which this document applies. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0046] Although this document can be modified in various ways and can 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 a specific embodiment. Terms commonly used in this specification are used only to describe a specific embodiment and are not intended to limit the technical ideas in this document. A singular expression includes a plural expression unless the context clearly indicates otherwise. In this specification, terms such as "include" or "have" are intended to specify the presence of features, numbers, steps, operations, components, parts, or combinations thereof described in the specification, and should be understood not to preclude the possibility of the presence or addition of one or more different features, numbers, steps, operations, components, parts, or combinations thereof.
[0047] Meanwhile, each configuration in the drawings described in this document is shown independently for the convenience of explaining the different characteristic functions, and does not mean that each configuration is realized by separate hardware or software. For example, two or more of each configuration may be combined to form one configuration, and one configuration may be divided into multiple configurations. An embodiment in which each configuration is integrated and / or separated is also included in the scope of this document as long as it does not deviate from the essence of this document.
[0048] DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings. In the following, the same reference numerals are used for the same components in the drawings, and duplicated descriptions of the same components will be omitted.
[0049] This document relates to video / image coding. For example, the methods / embodiments disclosed in this document may be related to the Versatile Video Coding (VVC) standard (ITU-T Rec. H.266), next-generation video / image coding standards 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.).
[0050] Various embodiments relating to video / image coding are presented in this document, and unless otherwise stated, the embodiments may be implemented in combination with each other.
[0051] In this document, video may 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 a part of a picture in coding. A slice / tile may contain one or more coding tree units (CTUs). One picture may be composed of one or more slices / tiles. One picture may be composed of one or more tile groups. One tile group may contain one or more tiles.
[0052] A pixel or a pel can mean the smallest unit that constitutes one picture (or image). A term corresponding to a pixel can also be "sample." A sample can generally refer to a pixel or a pixel value, can refer to only a pixel / pixel value of a luma component, or can refer to only a pixel / pixel value of a chroma component. Alternatively, a sample can mean a pixel value in the spatial domain, or can mean a transform coefficient in the frequency domain when such a pixel value is transformed into the frequency domain.
[0053] A unit may indicate a basic unit of image processing. A unit may include at least one of a specific region of a picture and information about the region. A unit may include one luma block and two chroma (e.g., cb, cr) blocks. A unit may be used in combination with terms such as block or area, depending on the case. In a general case, an M×N block may include a set (or array) of samples or transform coefficients consisting of M columns and N rows.
[0054] In this document, the term “ / ” 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.”
[0055] Further, in this 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.”
[0056] In this specification, "at least one of A and B" may mean "only A," "only B," or "both A and B." In addition, in this specification, the expressions "at least one of A or B" and "at least one of A and / or B" may be interpreted similarly to "at least one of A and B."
[0057] In addition, in this specification, "at least one of A, B and C" may mean "only A," "only B," "only C," or "any combination of A, B and C." Furthermore, "at least one of A, B or C" and "at least one of A, B and / or C" may mean "at least one of A, B and C."
[0058] In addition, parentheses used in this specification may mean "for example." Specifically, when "prediction (intra prediction)" is displayed, "intra prediction" may be proposed as an example of "prediction." In other words, "prediction" in this specification is not limited to "intra prediction," and "intra prediction" may be proposed as an example of "prediction." In addition, even when "prediction (i.e., intra prediction)" is displayed, "intra prediction" may be proposed as an example of "prediction."
[0059] Technical features described individually in one drawing in this specification may be realized individually or simultaneously.
[0060] 1 is a diagram for explaining the schematic configuration of a video / image encoding device to which this document can be applied. Hereinafter, the video encoding device may include an image encoding device.
[0061] Referring to FIG. 1, the encoding device 100 may be configured to include an image partitioner 110, a predictor 120, a residual processor 130, an entropy encoder 140, an adder 150, a filter 160, and a memory 170. The predictor 120 may include an inter predictor 121 and an intra predictor 122. The residual processor 130 may include a transformer 132, a quantizer 133, a dequantizer 134, and an inverse transformer 135. The residual processor 130 may further include a subtractor 131. The adder 150 may be referred to as a reconstructor or a reconstructed block generator. The image division unit 110, the prediction unit 120, the residual processing unit 130, the entropy encoding unit 140, the addition unit 150, and the filtering unit 160 may be configured by one or more hardware components (e.g., an encoder chip set or a processor) according to an embodiment. In addition, the memory 170 may include a decoded picture buffer (DPB) and may be configured by a digital storage medium. The hardware components may further include the memory 170 as an internal / external component.
[0062] The image division unit 110 may divide an input image (or picture, frame) input to the encoding device 100 into one or more processing units. As an 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 a plurality of coding units of a deeper depth 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 the 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 immediately based on coding efficiency according to image characteristics, or the coding unit may be recursively divided into coding units of lower depths as necessary, and the coding unit of the 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 described above.The prediction unit may be a unit of sample prediction, and the transform unit may be a unit for deriving transform coefficients and / or a unit for deriving a residual signal from the transform coefficients.
[0063] The unit can be used interchangeably with terms such as block or area, depending on the case. In the general case, an M×N block can refer to a set of samples or transform coefficients consisting of M columns and N rows. A sample can generally refer to a pixel or pixel value, or can refer to only a pixel / pixel value of a luma component, or can refer to only a pixel / pixel value of a chroma component. A sample can be used as a term corresponding to a pixel or pel of one picture (or image).
[0064] The encoding device 100 may generate a residual signal (residual block, residual sample array) by subtracting a prediction signal (predicted block, prediction sample array) output from the inter prediction unit 121 or the intra prediction unit 122 from an input image signal (original block, original sample array), and the generated residual signal is transmitted to the conversion unit 132. In this case, as illustrated, a unit that subtracts a prediction signal (prediction block, prediction sample array) from an input image signal (original block, original sample array) in the encoding device 100 may be called a subtraction unit 131. The prediction unit may perform prediction on a block to be processed (hereinafter, referred to as a current block) and generate a predicted block including a prediction sample for the current block. The prediction unit 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 140, as will be described later in the description of each prediction mode. The prediction information can be encoded by the entropy encoding unit 140 and output in the form of a bitstream.
[0065] The intra prediction unit 122 may predict the current block by referring to samples in the current picture. The referenced samples may be located in the neighborhood of the current block or may be located away from the current block depending on the prediction mode. Prediction modes in intra prediction may include a plurality of non-directional modes and a plurality of directional modes. The non-directional modes may include, for example, a DC mode and a planar mode. The directional modes may include, for example, 33 directional prediction modes or 65 directional prediction modes depending on the fineness of the prediction direction. However, this is merely an example, and more or less directional prediction modes may be used depending on the settings. The intra prediction unit 122 may also determine a prediction mode to be applied to the current block using prediction modes applied to neighboring blocks.
[0066] The inter prediction unit 121 may derive a predicted block for a current block based on a reference block (reference sample array) identified by a motion vector on a reference picture. In this case, in order to reduce the amount of motion information transmitted in the 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 a neighboring block and a current block. The motion information may include a motion vector and a reference picture index. The motion information may further include inter prediction direction (L0 prediction, L1 prediction, Bi prediction, etc.) information. In the case of inter prediction, the neighboring block may include a spatial neighboring block present in the current picture and a temporal neighboring block present in the reference picture. The reference picture including the reference block and the reference picture including the temporal neighboring block may be the same or different. The temporal neighboring block may be called a collocated reference block, a collocated CU (col CU), etc., and the reference picture including the temporal neighboring block may be called a collocated picture (colPic). For example, the inter prediction unit 121 may generate information indicating which candidate is used to construct a motion information candidate list based on neighboring blocks and derive a motion vector and / or a reference picture index of the current block. Inter prediction may be performed based on various prediction modes, and for example, in the case of a skip mode and a merge mode, the inter prediction unit 121 may use motion information of neighboring blocks as motion information of the current block. In the case of the skip mode, unlike the merge mode, a residual signal may not be transmitted.In the case of motion vector prediction (MVP) mode, the motion vector of the current block can be indicated by using the motion vector of a neighboring block as a motion vector predictor and signaling the motion vector difference.
[0067] The prediction unit 120 may generate a prediction signal based on various prediction methods, which will be described later. For example, the prediction unit may apply intra prediction or inter prediction for prediction of one block, and may simultaneously apply intra prediction and inter prediction. This may be called combined inter and intra prediction (CIIP). In addition, the prediction unit may be based on an intra block copy (IBC) prediction mode or a palette mode for prediction of a block. The IBC prediction mode or palette mode may be used for content image / video coding such as games, for example, screen content coding (SCC). IBC basically performs prediction within a current picture, but may be performed similarly to inter prediction in that a reference block is derived within the current picture. That is, IBC may utilize at least one of the inter prediction techniques described in this document. The palette mode may be considered as an example of intra coding or intra prediction. When the palette mode is applied, a sample value within a picture may be signaled based on information regarding a palette table and a palette index.
[0068] The prediction signal generated through the prediction unit (including the inter prediction unit 121 and / or the intra prediction unit 122) may be used to generate a restored signal or may be used to generate a residual signal. The transform unit 132 may generate transform coefficients by applying a transform technique to the residual signal. For example, the transform technique may include at least one of a discrete cosine transform (DCT), a discrete sine transform (DST), a Karhunen-Loeve transform (KLT), a graph-based transform (GBT), or a conditionally non-linear transform (CNT). Here, the GBT refers to a transform obtained from a graph when the relationship information between pixels is expressed as a graph. The CNT refers to a transform obtained based on a prediction signal generated using all previously reconstructed pixels. In addition, the transform process may be applied to pixel blocks having the same square size, and may also be applied to non-square variable-size blocks.
[0069] The quantizer 133 quantizes the transform coefficients and transmits the quantized transform coefficients to the entropy encoder 140, which may encode the quantized signal (information on the quantized transform coefficients) and output the quantized signal to a bitstream. The information on the quantized transform coefficients may be referred to as residual information. The quantizer 133 may rearrange the quantized transform coefficients in a block form into a one-dimensional vector form based on a coefficient scan order, and may generate information on the quantized transform coefficients based on the quantized transform coefficients in the one-dimensional vector form. The entropy encoder 140 may perform various encoding methods, such as exponential Golomb, context-adaptive variable length coding (CAVLC), and context-adaptive binary arithmetic coding (CABAC). The entropy encoder 140 may encode information required for video / image restoration (e.g., values of syntax elements, etc.) together with or separately from the quantized transform coefficients. The encoded information (e.g., encoded video / image information) may be transmitted or stored in a network abstraction layer (NAL) unit unit in the form of a bitstream. The video / image 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 / image information may further include general constraint information. Information and / or syntax elements transmitted / signaled from an encoding device to a decoding device in this document may be included in the video / image information. The video / image information may be encoded through the above-mentioned encoding procedure and included in the bitstream.The bitstream may be transmitted via a network or may be stored in a digital storage medium, where the network may include a broadcasting network and / or a communication network, and the digital storage medium may include various storage media such as a USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. A transmitter (not shown) for transmitting the signal output from the entropy encoding unit 140 and / or a storage unit (not shown) for storing the signal may be configured as an internal / external element of the encoding device 100, or the transmitter may be included in the entropy encoding unit 140.
[0070] The quantized transform coefficients output from the quantizer 133 may be used to generate a prediction signal. For example, a residual signal (residual block or residual sample) may be restored by applying inverse quantization and inverse transform to the quantized transform coefficients via the inverse quantizer 134 and the inverse transformer 135. The adder 155 may generate a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample array) by adding the reconstructed residual signal to the prediction signal output from the inter prediction unit 121 or the intra prediction unit 122. When there is no residual for the current block, such as when a skip mode is applied, a predicted block may be used as a reconstructed block. The adder 150 may be referred to as a reconstruction unit or a reconstructed block generator. The generated reconstructed signal may be used for intra prediction of the next current block in the current picture, and may also be used for inter prediction of the next picture after filtering, as described below.
[0071] Meanwhile, luma mapping with chroma scaling (LMCS) may be applied during picture encoding and / or reconstruction.
[0072] The filtering unit 160 may apply filtering to the reconstructed signal to improve subjective / objective image quality. For example, the filtering unit 160 may apply various filtering methods to the reconstructed picture to generate a modified reconstructed picture, and may store the modified reconstructed picture in the memory 170, specifically, in the DPB of the memory 170. The various filtering methods may include, for example, deblocking filtering, sample adaptive offset, an adaptive loop filter, a bilateral filter, etc. The filtering unit 160 may generate various information related to filtering and transmit the information to the entropy encoding unit 140, as will be described later in relation to each filtering method. The information related to filtering may be encoded by the entropy encoding unit 140 and output in the form of a bitstream.
[0073] The modified reconstructed picture transmitted to the memory 170 can be used as a reference picture in the inter prediction unit 121. When inter prediction is applied through this, the encoding apparatus can avoid a mismatch in prediction between the encoding apparatus 100 and the decoding apparatus, and can also improve encoding efficiency.
[0074] The DPB of the memory 170 may store the modified reconstructed picture to be used as a reference picture in the inter prediction unit 121. The memory 170 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 prediction unit 121 to be used as motion information of a spatial neighboring block or motion information of a temporal neighboring block. The memory 170 may store reconstructed samples of reconstructed blocks in the current picture and transmit them to the intra prediction unit 122.
[0075] FIG. 2 is a diagram for explaining the schematic configuration of a video / image decoding device to which this document can be applied.
[0076] Referring to FIG. 2, the decoding device 200 may be configured to include an entropy decoder 210, a residual processor 220, a predictor 230, an adder 240, a filter 250, and a memory 260. The predictor 230 may include an inter predictor 231 and an intra predictor 232. The residual processor 220 may include a dequantizer 221 and an inverse transformer 222. The entropy decoder 210, the residual processor 220, the predictor 230, the adder 240, and the filter 250 may be configured as one hardware component (e.g., a decoder chipset or processor) according to an embodiment. In addition, the memory 260 may include a decoded picture buffer (DPB) and may be configured as a digital storage medium. The hardware components may further include a memory 260 as an internal / external component.
[0077] When a bitstream including video / image information is input, the decoding device 200 can restore an image corresponding to the process in which the video / image information is processed by the encoding device of FIG. 2. For example, the decoding device 200 can derive units / blocks based on information on block division obtained from the bitstream. The decoding device 200 can perform decoding using a processing unit applied in the encoding device. Thus, the processing unit for decoding may be, for example, a coding unit, and the coding unit may be divided from a coding tree unit or a maximum coding unit according to a quad tree structure, a binary tree structure, and / or a ternary tree structure. One or more transform units may be derived from the coding unit. Then, the restored image signal decoded and output by the decoding device 200 can be reproduced by a reproduction device.
[0078] The decoding device 200 may receive a signal output from the encoding device of FIG. 1 in the form of a bitstream, and the received signal may be decoded via the entropy decoding unit 210. For example, the entropy decoding unit 210 may derive information (e.g., video / image information) required for image restoration (or picture restoration) by parsing the bitstream. The video / image 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). In addition, the video / image information may further include general constraint information. The decoding device may further decode a picture based on information on the parameter set and / or the general constraint information. Signaling / received information and / or syntax elements described later in this document may be decoded via the decoding procedure and obtained from the bitstream. For example, the entropy decoding unit 210 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, quantized values of transform coefficients related to residuals, etc. More specifically, the CABAC entropy decoding method may receive bins corresponding to each syntax element in the bitstream, determine a context model using information on the syntax element to be decoded and decode information on the neighboring and blocks to be decoded, or information on symbols / bins decoded in a previous step, predict the occurrence probability of bins according to the determined context model, and perform arithmetic decoding of the bins to generate symbols corresponding to the values of each syntax element. In this case, the CABAC entropy decoding method may update the context model using information on the decoded symbol / bin for the context model of the next symbol / bin after determining the context model.Among the information decoded by the entropy decoding unit 210, information related to prediction is provided to a prediction unit (inter prediction unit 232 and intra prediction unit 231), and residual values entropy decoded by the entropy decoding unit 210, i.e., quantized transform coefficients and related parameter information, may be input to the residual processing unit 220. The residual processing unit 220 may derive a residual signal (residual block, residual sample, residual sample array). Also, among the information decoded by the entropy decoding unit 210, information related to filtering may be provided to the filtering unit 250. Meanwhile, a receiving unit (not shown) for receiving a signal output from the encoding device may be further configured as an internal / external element of the decoding device 200, or the receiving unit may be a component of the entropy decoding unit 210. Meanwhile, the decoding device according to this document may be called a video / image / picture decoding device, and the decoding device may be divided into an information decoder (video / image / picture information decoder) and a sample decoder (video / image / picture sample decoder). The information decoder may include the entropy decoding unit 210, and the sample decoder may include at least one of the inverse quantization unit 221, the inverse transform unit 222, the addition unit 240, the filtering unit 250, the memory 260, the inter prediction unit 232, and the intra prediction unit 231.
[0079] The inverse quantization unit 221 may inverse quantize the quantized transform coefficients and output the transform coefficients. The inverse quantization unit 221 may rearrange the quantized transform coefficients in a two-dimensional block form. In this case, the rearrangement may be performed based on a coefficient scanning order performed in the encoding device. The inverse quantization unit 221 may perform inverse quantization on the quantized transform coefficients using a quantization parameter (e.g., quantization step size information) and obtain transform coefficients.
[0080] The inverse transform unit 222 inversely transforms the transform coefficients to obtain a residual signal (residual block, residual sample array).
[0081] 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 the prediction information output from the entropy decoding unit 210, and may determine a specific intra / inter prediction mode.
[0082] The prediction unit 220 may generate a prediction signal based on various prediction methods, which will be described later. For example, the prediction unit may apply intra prediction or inter prediction for prediction of one block, and may simultaneously apply intra prediction and inter prediction. This may be called combined inter and intra prediction (CIIP). In addition, the prediction unit may be based on an intra block copy (IBC) prediction mode or a palette mode for prediction of a block. The IBC prediction mode or palette mode may be used for content image / video coding such as games, for example, screen content coding (SCC). IBC basically performs prediction within a current picture, but may be performed similarly to inter prediction in that a reference block is derived within the current picture. That is, IBC may utilize at least one of the inter prediction techniques described in this document. The palette mode may be regarded as an example of intra coding or intra prediction. When the palette mode is applied, information regarding a palette table and a palette index may be included in the video / image information and signaled.
[0083] The intra prediction unit 231 may predict the current block by referring to samples in the current picture. The referenced samples may be located in the neighborhood of the current block or may be located away from the current block depending on the prediction mode. Prediction modes in intra prediction may include a plurality of non-directional modes and a plurality of directional modes. The intra prediction unit 231 may also determine a prediction mode to be applied to the current block using prediction modes applied to neighboring blocks.
[0084] The inter prediction unit 232 may derive a predicted block for the current block based on a reference block (reference sample array) identified by a motion vector on a reference picture. At that time, in order to reduce the amount of motion information transmitted in the 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 inter prediction direction (L0 prediction, L1 prediction, Bi prediction, etc.) information. In the case of inter prediction, the neighboring blocks may include spatial neighboring blocks present in the current picture and temporal neighboring blocks present in the reference picture. For example, the inter prediction unit 232 may configure 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 the received candidate selection information. Inter prediction may be performed based on various prediction modes, and the information regarding the prediction may include information indicating a mode of inter prediction for the current block.
[0085] The adder 240 may generate a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample array) by adding the acquired residual signal to a prediction signal (predicted block, predicted sample array) output from a prediction unit (including the inter prediction unit 232 and / or the intra prediction unit 231). When there is no residual for the current block, such as when the skip mode is applied, the predicted block may be used as the reconstructed block.
[0086] The adder 240 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 a current picture, and may be output after filtering as described below, or may be used for inter prediction of a next picture.
[0087] Meanwhile, LMCS (luma mapping with chroma scaling) can be applied during the picture decoding process.
[0088] The filtering unit 250 may apply filtering to the reconstructed signal to improve subjective / objective image quality. For example, the filtering unit 250 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 260, specifically, to the DPB of the memory 260. The various filtering methods may include, for example, deblocking filtering, sample adaptive offset, an adaptive loop filter, a bilateral filter, etc.
[0089] The (modified) reconstructed picture stored in the DPB of the memory 260 may be used as a reference picture in the inter prediction unit 232. The memory 260 may 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 may be transmitted to the inter prediction unit 232 to be used as motion information of a spatially neighboring block or motion information of a temporally neighboring block. The memory 260 may store reconstructed samples of reconstructed blocks in the current picture and transmit them to the intra prediction unit 231.
[0090] In this document, the embodiments described for the filtering unit 160, inter prediction unit 121, and intra prediction unit 122 of the encoding device 100 can also be applied identically or correspondingly to the filtering unit 250, inter prediction unit 232, and intra prediction unit 231 of the decoding device 200, respectively.
[0091] 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 a spatial domain (or a pixel domain). The predicted block is derived in the same way by an encoding device and a decoding device, and the encoding device can improve image coding efficiency by signaling information (residual information) regarding the residual between an original block and a predicted block, not the original sample value of the original block itself, to the decoding device. The decoding device can derive a residual block including residual samples based on the residual information, combine the residual block with the predicted block to generate a reconstructed block including reconstructed samples, and generate a reconstructed picture including the reconstructed block.
[0092] The residual information may be generated through a transform and quantization procedure. For example, the encoding apparatus may derive a residual block between an original block and a predicted block, perform a transform procedure on the 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 (through a bitstream) to the 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 perform an inverse quantization / inverse transform procedure based on the residual information to derive residual samples (or residual blocks). The decoding apparatus may generate a reconstructed picture based on the predicted block and the residual block. The encoding apparatus may further 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.
[0093] FIG. 3 illustrates a schematic of the multiple transformation technique according to this document.
[0094] Referring to Figure 3, the conversion unit may correspond to the conversion unit in the encoding device of Figure 1 described above, and the inverse conversion unit may correspond to the inverse conversion unit in the encoding device of Figure 1 described above or the inverse conversion unit in the decoding device of Figure 3.
[0095] 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 (S310). Such a primary transform may be referred to as a core transform. Here, the primary transform may be based on Multiple Transform Selection (MTS), and when multiple transforms are applied as the primary transform, it may be referred to as a multiple core transform.
[0096] The multi-kernel transform may refer to a method of further using a Discrete Cosine Transform (DCT) type 2, a Discrete Sine Transform (DST) type 7, a DCT type 8, and / or a DST type 1. That is, the multi-kernel transform may refer to a transform method of transforming a residual signal (or a residual block) in a spatial domain into transform coefficients (or first transform coefficients) in a frequency domain 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 first transform coefficients may be called tentative transform coefficients from the perspective of a transform unit.
[0097] In other words, when the existing transform method is applied, a spatial domain to frequency domain transform 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 spatial domain to frequency domain transform 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 first-order 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.
[0098] 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.
[0099] Also, according to one example, when applying MTS to perform a linear transformation, a specific basis function may be set to a predetermined value, and when it is a vertical transformation or a horizontal transformation, a mapping relationship for the transformation kernel may be set by combining which basis function is applied or not. For example, when the horizontal transformation kernel is represented by trTypeHor and the vertical transformation kernel is represented by trTypeVer, a value of 0 for trTypeHor or trTypeVer may be set to DCT2, a value of 1 for trTypeHor or trTypeVer may be set to DST7, and a value of 2 for trTypeHor or trTypeVer may be set to DCT8.
[0100] In this case, MTS index information may be encoded and signaled to a decoding device to indicate one of a number of transformation kernel sets. For example, an MTS index of 0 may indicate that the values of trTypeHor and trTypeVer are all 0, an MTS index of 1 may indicate that the values of trTypeHor and trTypeVer are all 1, an MTS index of 2 may indicate that the value of trTypeHor is 2 and the value of trTypeVer is 1, an MTS index of 3 may indicate that the value of trTypeHor is 1 and the value of trTypeVer is 2, and an MTS index of 4 may indicate that the values of trTypeHor and trTypeVer are all 2.
[0101] As an example, a conversion kernel set according to index information of MTS is shown in the table below.
[0102] [Table 1]
[0103] The transform unit performs a secondary transform based on the (primary) transform coefficients to derive modified (secondary) transform coefficients (S320). The primary transform is a transform from a spatial domain to a frequency domain, and the secondary transform refers to a transform to a more compressed representation using a correlation existing between the (primary) transform coefficients. The secondary transform includes a non-separable transform. In this case, the secondary transform may be called a non-separable secondary transform (NSST) or a mode-dependent non-separable secondary transform (MDNSST). The non-separable secondary transform refers to a transform that performs a secondary transform on the (primary) transform coefficients derived by the primary transform based on a non-separable transform matrix to generate modified transform coefficients (or secondary transform coefficients) for a residual signal. Here, a transform may be applied to the (primary) transform coefficients at once based on the non-separable transform matrix without applying a vertical transform and a horizontal transform separately (or a horizontal-vertical transform independently). In other words, the non-separable secondary transform refers to a transform method in which, for example, a two-dimensional signal (transform coefficient) is rearranged into a one-dimensional signal in a specific direction (for example, row-first direction or column-first direction) without being applied separately to the (first-order) transform coefficients in the vertical and horizontal directions, and then a modified transform coefficient (or a second-order transform coefficient) is generated based on the non-separable transform matrix. For example, the row-major order is to arrange the first row, the second row, ..., the Nth row in a row for an MxN block, and the column-major order is to arrange the first column, the second column, ..., the Mth column in a row for an MxN block. The non-separable secondary transform can 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 8×8 non-separable quadratic transform may be applied to the top left 8×8 region of the transform coefficient block.Also, if the width (W) and height (H) of the transform coefficient block are both 4 or more, but the width (W) or height (H) of the transform coefficient block is less than 8, a 4×4 non-separable secondary transform can be applied to the upper left min(8,W)×min(8,H) area of the transform coefficient block. However, the embodiment is not limited thereto, and for example, even if only the condition that the width (W) or height (H) of the transform coefficient block is both 4 or more is satisfied, a 4×4 non-separable secondary transform can also be applied to the upper left min(8,W)×min(8,H) area of the transform coefficient block.
[0104] Specifically, for example, if a 4×4 input block is used, the non-separable quadratic transform can be performed as follows:
[0105] The 4×4 input block X can be expressed as follows:
[0106]
number
[0107] When X is expressed in the form of a vector, the vector JPEG2025019306000004.jpg12150 can be represented as:
[0108]
number
[0109] As shown in Equation 2, the vector JPEG2025019306000006.jpg15147 rearranges the two-dimensional block of X in Equation 1 into a one-dimensional vector in row-first order.
[0110] In this case, the second-order non-separable transform can be computed as follows:
[0111]
number
[0112] Where: JPEG2025019306000008.jpg13139 denotes the transform coefficient vector, and T denotes the 16×16 (non-separable) transform matrix.
[0113] Through Equation 3, a 16×1 transform coefficient vector JPEG2025019306000009.jpg12155 can be derived, and JPEG2025019306000010.jpg12156 can be re-organized into 4x4 blocks via the scan order (horizontal, vertical, diagonal, etc.). However, the above calculations are merely examples, and in order to reduce the computational complexity of the non-separable quadratic transform, a Hypercube-Givens Transform (HyGT) or the like can be used to calculate the non-separable quadratic transform.
[0114] Meanwhile, the non-separable secondary transform may select a transform kernel (or transform core, transform type) on a mode-dependent basis, where the mode may include an intra-prediction mode and / or an inter-prediction mode.
[0115] As described above, the non-separable secondary transform may 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 may be applied to an 8x8 region contained within the transform coefficient block when W and H are all equal to or greater than 8, and the 8x8 region may be an upper left 8x8 region within the transform coefficient block. Similarly, the 4x4 transform refers to a transform that may be applied to a 4x4 region contained within the transform coefficient block when W and H are all equal to or greater than 4, and the 4x4 region may be an upper left 4x4 region within the transform coefficient block. For example, the 8x8 transform kernel matrix may be a 64x64 / 16x64 matrix, and the 4x4 transform kernel matrix may be a 16x16 / 8x16 matrix.
[0116] Then, 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, and the transform sets may be four. 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, the four transform sets for the 8×8 transform may include two 8×8 transform kernels each, and in this case, the four transform sets for the 4×4 transform may include two 4×4 transform kernels each.
[0117] However, the size of the transform, i.e., the size of the region to which the transform is applied, may be other than, for example, 8x8 or 4x4, the number of sets may be n, and the number of transform kernels in each set may be k.
[0118] The transform set may be referred to as an NSST set or an LFNST set. The selection of a particular one of the transform sets may be performed based on, for example, an intra-prediction mode of a current block (CU or sub-block). LFNST (Low-Frequency Non-Separable Transform) may be an example of a reduced non-separable transform, which will be described later, and refers to a non-separable transform for low-frequency components.
[0119] For reference, for example, the intra prediction modes may include two non-directional (non-angular) intra prediction modes and 65 directional (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 the present document may also be applied to cases where the number of intra prediction modes is different. Meanwhile, depending on the case, an intra prediction mode numbered 67 may further be used, and the intra prediction mode numbered 67 may indicate a linear model (LM) mode.
[0120] FIG. 4 exemplarily shows intra-directional modes of 65 prediction directions.
[0121] Referring to FIG. 4, intra prediction modes having horizontal directionality and intra prediction modes having vertical directionality may be distinguished from each other with respect to the 34th intra prediction mode having a prediction direction of the diagonal at the lower right. H and V in FIG. 4 respectively mean horizontal directionality and vertical directionality, and the numbers from -32 to 32 indicate a displacement of 1 / 32 units on a sample grid position. This may indicate an offset for a 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 may be regarded as neither horizontal nor vertical directionality in the strict sense, but may be classified as belonging to horizontal directionality from the viewpoint of determining a transform set for secondary transform. This is because the input data is transposed and used for vertical modes that are symmetrical with respect to the 34th intra prediction mode, and the input data alignment method for the horizontal mode is used for the 34th intra prediction mode. Transposing the input data means that for the data MxN of a two-dimensional block, rows become columns and columns become rows, forming NxM data. The 18th intra prediction mode and the 50th intra prediction mode indicate a horizontal intra prediction mode and a vertical intra prediction mode, respectively, and the 2nd intra prediction mode predicts in the upper right direction with the reference pixel on the left, so it can be called an upper right diagonal intra prediction mode, and in the same context, the 34th intra prediction mode can be called a lower right diagonal intra prediction mode, and the 66th intra prediction mode can be called a lower left diagonal intra prediction mode.
[0122] As an example, depending on the intra prediction mode, the mapping of the four transform sets may be shown, for example, as in the following table.
[0123] [Table 2]
[0124] As shown in Table 2, depending on the intra prediction mode, one of four transform sets, i.e., lfnstTrSetIdx can be mapped to 0 to 3, i.e., one of four.
[0125] Meanwhile, when it is determined that a specific set is used for 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 indicates a specific transform kernel based on a rate-distortion (RD) check, and may 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 index value 0 of lfnst may indicate a first non-separable secondary transform kernel, an index value 1 of lfnst may indicate a second non-separable secondary transform kernel, and an index value 2 of lfnst may indicate a third non-separable secondary transform kernel. Alternatively, an index value 0 of lfnst may indicate that a first non-separable secondary transform is not applied to a current block, and index values 1 to 3 of lfnst may indicate the three transform kernels.
[0126] The transform unit may perform the non-separable quadratic transform based on a selected transform kernel to obtain modified (quadratic) transform coefficients. The modified transform coefficients may be derived as transform coefficients quantized via a quantizer as described above, encoded, and signaled to a decoding device and transmitted to an inverse quantization / inverse transform unit in an encoding device.
[0127] On the other hand, when the secondary transform is omitted as described above, the (primary) transform coefficients, which are the output of the primary (separate) transform, can be derived as quantized transform coefficients through a quantization unit as described above, encoded, and signaled to a decoding device and transmitted to an inverse quantization / inverse transform unit in an encoding device.
[0128] 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 (S350), and perform a primary (inverse) transform on the (primary) transform coefficients to obtain residual blocks (residual samples) (S360). Here, the primary transform coefficients may be called modified transform coefficients from the perspective of the inverse transform unit. As described above, the encoding device and the decoding device may generate a reconstructed block based on the residual block and a predicted block, and generate a reconstructed picture based on the reconstructed block.
[0129] Meanwhile, the decoding apparatus may further include a secondary inverse transform application determining unit (or an element for determining whether to apply the secondary inverse transform) and a secondary inverse transform determining unit (or an element for 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 a transform coefficient of a residual block.
[0130] The secondary inverse transform decision unit may determine a secondary inverse transform. At this time, 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 according to an intra prediction mode. In addition, as an embodiment, a secondary transform decision method may be determined depending on a primary transform decision method. Various combinations of primary transform and secondary transform may be determined according to an intra prediction mode. In addition, as an example, the secondary inverse transform decision unit may determine an area to which a secondary inverse transform is applied based on a size of a current block.
[0131] Meanwhile, as described above, if the second (inverse) transform is omitted, the (dequantized) transform coefficients are received and the first (separate) inverse transform is performed to obtain a residual block (residual sample). 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.
[0132] On the other hand, in this paper, in order to reduce the computational complexity and memory requirements associated with non-separable secondary transforms, we can apply RST (reduced secondary transform), in which the size of the transformation matrix (kernel) is reduced using the concept of NSST.
[0133] Meanwhile, coefficients constituting the transform kernel, transform matrix, and transform kernel matrix described in this document, i.e., kernel coefficients or matrix coefficients, may be expressed in 8 bits. This may be one condition for implementation in a decoding device and an encoding device, and may reduce the memory requirement for storing the transform kernel with a reasonably acceptable performance degradation compared to the existing 9 bits or 10 bits. In addition, by expressing the kernel matrix in 8 bits, a small multiplier may be used, and it may be more suitable for SIMD (Single Instruction Multiple Data) instructions used for optimal software implementation.
[0134] 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 performing a simplified transformation, the amount of calculation required during transformation may be reduced due to the reduction in the size of the transform matrix. That is, RST can be used to solve the issue of complexity of calculations that occurs during transformation of a large block or non-separable transformation.
[0135] The RST may be referred to by various terms such as reduced transform, reduced secondary transform, reduction transform, simplified transform, simple transform, etc., and the names by which the RST may be referred to are not limited to the examples given. Alternatively, the RST may be referred to as a Low-Frequency Non-Separable Transform (LFNST) since it is mainly performed in a low-frequency domain including coefficients that are not zero in a transform block. The transform index may be called an LFNST index.
[0136] Meanwhile, when the secondary inverse transform is performed based on a RST, the inverse transform unit 135 of the encoding device 100 and the inverse transform unit 222 of the decoding device 200 may include an inverse RST unit that derives modified transform coefficients based on an inverse RST for the transform coefficients, and an inverse linear transform unit that derives residual samples for the target block based on an inverse linear transform for the modified transform coefficients. The inverse linear transform means an inverse transform of the linear transform applied to the residual. In this document, deriving transform coefficients based on a transform may mean deriving transform coefficients by applying the transform.
[0137] FIG. 5 is a diagram for explaining a RST according to an embodiment of this document.
[0138] In this specification, a "target block" may refer to a current block, a residual block, or a transformed block on which coding is performed.
[0139] In an RST according to an embodiment, an N dimensional vector is mapped to an R dimensional vector located in a different space, and a reduced transformation matrix can be determined, 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, a reduction factor, a simplified factor, a simple factor, etc. Meanwhile, R may be referred to as a simplification coefficient, but the simplification factor may represent R depending on the case. The simplification factor may also represent an N / R value depending on the case.
[0140] In one embodiment, the simplification factors or simplification coefficients may be signaled via the bitstream, but the embodiment is not limited thereto. For example, predefined values for the simplification factors or simplification coefficients may be stored in each encoding device 100 and decoding device 200, in which case the simplification factors or simplification coefficients may not be separately signaled.
[0141] The size of the simplified transformation matrix according to an embodiment is RxN, which is smaller than the size NxN of the normal transformation matrix, and can be defined as Equation 4 below.
[0142]
number
[0143] The matrix T in the Reduced Transform block shown in (a) of Figure 5 may represent the matrix TRxN of Equation 4. When the residual samples for the target block are multiplied by the simplified transform matrix TRxN as shown in (a) of Figure 5, the transform coefficients for the target block can be derived.
[0144] In one embodiment, when 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 Fig. 5(a) can be expressed by the matrix operation as shown in Equation 5 below. In this case, the memory and multiplication operations can be reduced by approximately 1 / 4 due to the simplification factor.
[0145] 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 the matrix is multiplied by the column vector to obtain the column vector.
[0146]
number
[0147] In Equation 5, r1 to r64 may represent residual samples for the target block, and more specifically, may be transform coefficients generated by applying a linear transform. As a result of the operation of Equation 5, transform coefficients ci for the target block can be derived, and the process of deriving ci is as shown in Equation 6.
[0148]
number
[0149] As a result of the calculation of Equation 6, transform coefficients c1 to cR for the target block can be derived. That is, when R=16, transform coefficients c1 to c16 for the target block can be derived. If a regular transform, instead of the RST, is applied and a transform matrix having a size of 64x64 (NxN) is multiplied by a residual sample having a size of 64x1 (Nx1), 64 (N) transform coefficients for the target block may be derived, but since the RST is applied, only 16 (R) transform coefficients for the target block are derived. Since the total number of transform coefficients for the target block is reduced from N to R and the amount of data transmitted from the encoding device 100 to the decoding device 200 is reduced, the transmission efficiency between the encoding device 100 and the decoding device 200 may be increased.
[0150] Considering the size of the transformation matrix, the size of the normal transformation matrix is 64x64 (NxN), but the size of the simplified transformation matrix is reduced to 16x64 (RxN), so compared to performing normal transformation, memory usage can be reduced by a ratio of R / N when performing RST. Also, compared to the number of multiplication operations NxN when using the normal transformation matrix, the number of multiplication operations can be reduced by a ratio of R / N when using the simplified transformation matrix (RxN).
[0151] In one embodiment, the transform unit 132 of the encoding device 100 may derive transform coefficients for the current block by performing a primary transform and an RST-based secondary transform on the residual samples for the current block. Such transform coefficients may be transmitted to an inverse transform unit of the decoding device 200, and the inverse transform unit 222 of the decoding device 200 may derive modified transform coefficients based on an inverse reduced secondary transform (RST) for the transform coefficients, and derive residual samples for the current block based on an inverse primary transform for the modified transform coefficients.
[0152] The size of the inverse RST matrix TNxR according to one embodiment is NxR, which is smaller than the size NxN of a normal inverse transformation matrix, and has a transpose relationship with the simplified transformation matrix TRxN shown in Equation 4.
[0153] The matrix Tt in the Reduced Inv. Transform block shown in (b) of FIG. 5 may represent an inverse RST matrix TRxNT (the superscript T represents transpose). When the inverse RST matrix TRxNT is multiplied by the transform coefficients of the current block as shown in (b) of FIG. 5, modified transform coefficients of the current block or residual samples of the current block can be derived. The inverse RST matrix TRxNT may also be expressed as (TRxN)TNxR.
[0154] More specifically, when an inverse RST is applied to a second-order inverse transform, modified transform coefficients for the current block can be derived by multiplying the transform coefficients for the current block by the inverse RST matrix TRxNT. On the other hand, an inverse RST can be applied to an inverse linear transform, in which case residual samples for the current block can be derived by multiplying the transform coefficients for the current block by the inverse RST matrix TRxNT.
[0155] In one embodiment, when the size of the block to which the inverse transform is applied is 8x8 and R=16 (i.e., R / N=16 / 64=1 / 4), the RST according to (b) of FIG. 5 can be expressed by a matrix operation as shown in Equation 7 below.
[0156]
number
[0157] In Equation 7, c1 to c16 may represent transform coefficients for the target block. As a result of the operation of Equation 7, rj representing modified transform coefficients for the target block or residual samples for the target block may be derived, and the derivation process of rj is as shown in Equation 8.
[0158]
number
[0159] As a result of the calculation of Equation 8, r1 to rN indicating modified transform coefficients for the target block or residual samples for the target block can be derived. Considering the size of the inverse transform matrix, the size of a normal inverse transform matrix is 64x64 (NxN), but the size of the simplified inverse transform matrix is reduced to 64x16 (NxR), so compared to performing normal inverse transform, memory usage can be reduced by a ratio of R / N when performing inverse RST. In addition, compared to the number of multiplication operations NxN when using a normal inverse transform matrix, the number of multiplication operations can be reduced by a ratio of R / N when using a simplified inverse transform matrix (NxR).
[0160] Meanwhile, the configuration of the transform set as shown in Table 2 can be applied to the 8x8 RST. That is, the 8x8 RST can be applied by the transform set in Table 2. Since one transform set is composed of two or three transforms (kernels) according to the prediction mode in the screen, it can be configured to select one of up to four transforms including the case where the secondary transform is not applied. When the secondary transform is not applied, the transform can be considered as the one applied with the identity matrix. If the four transforms are assigned indices 0, 1, 2, and 3 (for example, the 0th index can be assigned to the identity matrix, i.e., when the secondary transform is not applied), a syntax element called a transform index or an lfnst index can be signaled for each block of transform coefficients to specify the transform to be applied. That is, for the 8x8 upper left block, the RST configuration can specify the 8x8 RST through the transform index, or the 8x8 lfnst can be specified when the LFNST is applied. The 8x8 lfnst and 8x8 RST refer to a transform that may be applied to an 8x8 region contained within the block of transform coefficients when W and H of the target block are all equal to or greater than 8, and the 8x8 region may be the upper left 8x8 region within the block of transform coefficients. Similarly, the 4x4 lfnst and 4x4 RST refer to a transform that may be applied to a 4x4 region contained within the block of transform coefficients when W and H of the target block are all equal to or greater than 4, and the 4x4 region may be the upper left 4x4 region within the block of transform coefficients.
[0161] Meanwhile, according to an embodiment of this document, in the transformation of the encoding process, only 48 data pieces are selected from 64 data pieces constituting an 8x8 region, instead of a 16x64 transformation kernel matrix, and a maximum 16x48 transformation kernel matrix can be applied. Here, "maximum" means that for an mx48 transformation kernel matrix capable of generating m coefficients, the maximum value of m is 16. That is, when an mx48 transformation kernel matrix (m≦16) is applied to an 8x8 region to execute RST, 48 data pieces can be input and m coefficients can be generated. When m is 16, 48 data pieces can be input and 16 coefficients can be generated. That is, when 48 data pieces form a 48x1 vector, a 16x1 vector can be generated by multiplying the 16x48 matrix and the 48x1 vector in order. At that time, the 48 data pieces constituting the 8x8 region can be appropriately arranged to form a 48x1 vector. In this case, when a matrix operation is performed by applying a transformation kernel matrix of up to 16x48, 16 modified transformation coefficients are generated, and the 16 modified transformation coefficients may 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 may be filled with 0s.
[0162] For the inverse transformation in the decoding process, a transposed matrix of the transformation kernel matrix described above can be used. That is, when an inverse RST or an LFNST is performed in the inverse transformation process performed in the decoding device, input coefficient data to which the inverse RST is applied is composed of one-dimensional vectors according to a predetermined arrangement order, and the modified coefficient vectors obtained by multiplying the one-dimensional vectors by the matrix of the inverse RST on the left side can be arranged in two-dimensional blocks according to a predetermined arrangement order.
[0163] In summary, when RST or LFNST is applied to an 8x8 region in the transformation 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 of the 8x8 region, and a 16x48 transform kernel matrix. For the matrix operation, the 48 transform coefficients are input into a one-dimensional array. When such a 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.
[0164] Conversely, when the inverse RST or LFNST is applied to an 8x8 region in the inverse transform process, 16 transform coefficients corresponding to the upper left side of the 8x8 region among the transform coefficients of the 8x8 region are input in a one-dimensional array form according to the scanning order and may be subjected to a matrix operation with a 48x16 transform kernel matrix. That is, the matrix operation in this case may be expressed as (48x16 matrix) * (16x1 transform coefficient vector) = (48x1 modified transform coefficient vector). Here, since the nx1 vector may be interpreted as an nx1 matrix, it may be expressed as an nx1 column vector. Also, * means a matrix multiplication operation. When such a matrix operation is performed, 48 modified transform coefficients may be derived, and the 48 modified transform coefficients may be arranged in the upper left, upper right, and lower left regions of the 8x8 region, excluding the lower right region.
[0165] Meanwhile, when the secondary inverse transform is performed based on a RST, the inverse transform unit 135 of the encoding device 100 and the inverse transform unit 222 of the decoding device 200 may include an inverse RST unit that derives modified transform coefficients based on an inverse RST for the transform coefficients, and an inverse linear transform unit that derives residual samples for the target block based on an inverse linear transform for the modified transform coefficients. The inverse linear transform means an inverse transform of the linear transform applied to the residual. In this document, deriving transform coefficients based on a transform may mean deriving transform coefficients by applying the transform.
[0166] The non-separable transform, LFNST, described above will be described in detail as follows: LFNST may include a forward transform performed by an encoding device and an inverse transform performed by a decoding device.
[0167] The encoding device applies a forward primary (core) transform, and then applies a forward secondary transform using the derived result (or a portion of the result) as input.
[0168]
number
[0169] In Equation 9, x and y are the input and output of the quadratic transformation, respectively, and G is a matrix indicating the quadratic transformation, where the transform basis vector is composed of column vectors. In the case of backward LFNST, when the dimension of the transform matrix G is expressed as [number of rows × number of columns], in the case of forward LFNST, the transposition of matrix G becomes the dimension of GT.
[0170] For the reverse LFNST, the dimensions of the matrix G are [48x16], [48x8], [16x16], and [16x8], where the [48x8] and [16x8] matrices are submatrices obtained by sampling 8 transformation basis vectors from the left side of the [48x16] and [16x16] matrices, respectively.
[0171] On the other hand, in the case of forward LFNST, the dimensions of the matrix GT are [16x48], [8x48], [16x16], and [8x16], where the [8x48] and [8x16] matrices are submatrices obtained by sampling the eight transformation basis vectors from the top of the [16x48] and [16x16] matrices, respectively.
[0172] 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 a [8x1] vector. Since the output of the forward linear transform in video coding and decoding is two-dimensional (2D) data, in order to configure a [48x1] vector or a [16x1] vector as the input x, the 2D data that is the output of the forward transform must be appropriately arranged to configure a one-dimensional vector.
[0173] FIG. 6 is a diagram showing an example of a sequence for arranging output data of a forward linear transform into a one-dimensional vector. The left diagrams of FIG. 6(a) and (b) show a sequence for creating a [48x1] vector, and the right diagrams of FIG. 6(a) and (b) show a sequence for creating a [16x1] vector. In the case of LFNST, 2D data is sequentially arranged in the sequence shown in FIG. 6(a) and (b) to obtain a one-dimensional vector x.
[0174] The arrangement direction of the output data of the forward primary 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 primary transform may be arranged in the order of (a) of FIG. 6, and if the intra prediction mode of the current block is vertical with respect to the diagonal direction, the output data of the forward primary transform may be arranged in the order of (b) of FIG.
[0175] As an example, an ordering different from that of (a) and (b) of Figure 6 can be applied, and in order to derive the same result (y vector) as when the ordering of (a) and (b) of Figure 6 is applied, the column vectors of matrix G can be rearranged according to 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 base vector.
[0176] Since the output y derived via Equation 9 is a one-dimensional vector, if a configuration that processes the result of a forward quadratic transform as input, such as a configuration that performs quantization or residual coding, requires two-dimensional data as input data, the output y vector of Equation 9 must be appropriately arranged into 2D data again.
[0177] FIG. 7 is a diagram illustrating an example of a sequence in which output data of a forward secondary transform is arranged in a two-dimensional block.
[0178] In the case of LFNST, the output values can be arranged in a 2D block according to a determined scan order. FIG. 7(a) shows that when the output y is a [16x1] vector, the output values are arranged in 16 positions of the 2D block according to a diagonal scan order. FIG. 7(b) shows that when the output y is an [8x1] vector, the output values are arranged in 8 positions of the 2D block according to a diagonal scan order, and the remaining 8 positions are filled with 0. X in FIG. 7(b) indicates that it is filled with 0.
[0179] As another example, depending on the configuration for performing quantization or residual coding, the order in which the output vector y is processed may be performed according to a preset order, so the output vector y may not be arranged in a 2D block as shown in Fig. 7. However, in the case of residual coding, data coding may be performed in units of 2D blocks (e.g., 4x4) such as CG (Coefficient Group), and in this case, data may be arranged in a specific order such as the diagonal scan order of Fig. 7.
[0180] Meanwhile, the decoding device may arrange two-dimensional data output through an inverse quantization process for inverse transformation according to a preset scanning order to form a one-dimensional input vector y. The input vector y may be output to the input vector x according to the following equation:
[0181]
number
[0182] For 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 reverse LFNST, the output vector x can be a [48x1] or [16x1] vector.
[0183] The output vector x is arranged in a two-dimensional block according to the order shown in FIG. 6 and arranged into two-dimensional data, and such two-dimensional data becomes the input data (or a part of the input data) for the inverse linear transformation.
[0184] Therefore, the inverse quadratic transform is generally the opposite process to the forward quadratic transform, 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.
[0185] Inverse LFNST can select one of eight [48x16] matrices or eight [16x16] matrices as the transformation matrix G. Which of the [48x16] and [16x16] matrices to apply is determined by the size and shape of the block.
[0186] Also, the eight matrices may be derived from four transform sets as shown in Table 2 above, and each transform set may be composed of two matrices. Which transform set is used among the four transform sets is determined according to an intra prediction mode, and more specifically, the transform set is determined based on an extended intra prediction mode value, taking into account a wide angle intra prediction mode (Wide Angle Intra Prediction, WAIP). Which of the two matrices constituting the selected transform set is selected is derived through index signaling. More specifically, the index value to be transmitted may be 0, 1, or 2, where 0 indicates that LFNST is not applied, and 1 and 2 may indicate one of the two transform matrices constituting the transform set selected based on the intra prediction mode value.
[0187] Meanwhile, as described above, whether to apply a [48x16] matrix or a [16x16] matrix to LFNST is determined based on the size and shape of the block to be transformed.
[0188] Fig. 8 shows the shapes of blocks 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 more, (d) shows an 8x8 block, and (e) shows an MxN block where M≧8, N≧8, and N>8 or M>8.
[0189] In Fig. 8, blocks with thick frames indicate areas to which LFNST is applied. For the blocks in Fig. 8(a) and (b), LFNST is applied to the top-left 4x4 area, and for the block in Fig. 8(c), LFNST is applied to each of the two consecutive 4x4 areas in the top-left. In Fig. 8(a), (b), and (c), LFNST is applied in 4x4 area units, so this type of LFNST is hereinafter referred to as "4x4 LFNST", and the transformation matrix that can be applied is a [16x16] or [16x8] matrix based on the matrix dimensions for G in Equations 9 and 10.
[0190] More specifically, a [16x8] matrix is applied to the 4x4 block (4x4TU or 4x4CU) in (a) of Figure 8, and a [16x16] matrix is applied to the blocks in (b) and (c) of Figure 8. This is to match the worst case computational complexity to 8 multiplications per sample.
[0191] 8(d) and (e), LFNST is applied to the 8x8 region in the upper left, and such LFNST is hereinafter referred to as "8x8 LFNST". A [48x16] or [48x8] matrix can be applied as the transformation matrix. In the case of forward LFNST, a [48x1] vector (x vector in Equation 9) is input as input data, so all sample values in the 8x8 region in the upper left are not used as input values for forward LFNST. That is, as seen in the left-hand order of FIG. 6(a) or the left-hand order of FIG. 6(b), the bottom-right 4x4 block is left as it is, and a [48x1] vector can be constructed based on samples belonging to the remaining three 4x4 blocks.
[0192] A [48x8] matrix can be applied to the 8x8 block (8x8TU or 8x8CU) in Fig. 8(d), and a [48x16] matrix can be applied to the 8x8 block in Fig. 8(e), again to match the worst case computational complexity to 8 multiplications per sample.
[0193] Depending on the block shape, when the corresponding forward LFNST (4x4LFNST or 8x8LFNST) is applied, 8 or 16 output data (the y vector in Equation 9, an [8x1] or [16x1] vector) are generated; in forward LFNST, the number of output data is equal to or less than the number of input data due to the properties of the matrix GT.
[0194] FIG. 9 is a diagram showing an example of the arrangement of output data from a forward LFNST, showing blocks in which output data from a forward LFNST is arranged according to a block shape.
[0195] The shaded area in the upper left corner of the block shown in Figure 9 corresponds to the area where the output data of the forward LFNST is located, the positions marked with 0 indicate samples that are filled with 0 values, and the remaining areas indicate areas that are left unchanged by the forward LFNST, where the output data of the forward linear transform remains unchanged.
[0196] As described above, the dimension of the transformation matrix applied changes according to the shape of the block, so the number of output data also changes. As shown in FIG. 9, the output data of the forward LFNST may not fill the entire upper left 4x4 block. In the cases of (a) and (d) of FIG. 11, a [16x8] matrix and a [48x8] matrix are applied to the block shown by the thick line or a part of the block, respectively, and an [8x1] vector is generated at the output of the forward LFNST. That is, according to the scan order shown in FIG. 7(b), only eight output data are filled as shown in (a) and (d) of FIG. 9, and the remaining eight positions are filled with zeros. In the case of the block to which LFNST is applied in FIG. 8(d), the two 4x4 blocks on the upper right and lower left adjacent to the upper left 4x4 block are also filled with zero values as shown in FIG. 9(d).
[0197] As described above, the LFNST index is basically signaled to specify whether LFNST is applied and the transformation matrix to be applied. As shown in Figure 9, when LFNST is applied, the number of output data of the forward LFNST may be equal to or less than the number of input data, so areas filled with 0 values occur as follows:
[0198] 1) As shown in Fig. 9(a), in the 4x4 block on the upper left, the 8th position in the scan order and after, that is, the 9th to 16th samples
[0199] 2) As shown in (d) and (e) of FIG. 9, a [16×48] matrix or an [8×48] matrix is applied to the two 4×4 blocks adjacent to the upper left 4×4 block or the second and third 4×4 blocks in the scan order.
[0200] Therefore, by checking the above 1) and 2), if non-zero data is found, it is certain that LFNST is not applied, and therefore it is possible to omit signaling of the LFNST index.
[0201] For example, in the case of LFNST adopted in the VVC standard, signaling of the LFNST index is performed after residual coding, so that an encoding device can know whether or not non-zero data (significant coefficients) exist at all positions inside a TU or CU block through residual coding. Therefore, an encoding device can determine whether or not to perform signaling for the LFNST index based on whether or not non-zero data exists, and a decoding device can determine whether or not 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.
[0202] As a binarization method for the LFNST index, a truncated unary code is applied, so the LFNST index consists of a maximum of two bins, and the binary codes for the possible LFNST index values 0, 1, and 2 are assigned as 0, 10, and 11, respectively. In the case of LFNST currently adopted in VVC, the first bin is applied with context-based CABAC coding (regular coding), and the second bin is applied with bypass coding. The total number of contexts for the first bin is two, and (DCT-2, DCT-2) is applied as the primary transform pair for the horizontal and vertical directions. When the luma and chroma components are coded in a dual tree type, one context is assigned, and the other context is applied for the remaining cases. The coding of such LFNST indexes is shown in the following table.
[0203] [Table 3]
[0204] On the other hand, the following simplification method can be applied to the adopted LFNST.
[0205] (i) In one example, the number of output data for the forward LFNST can be limited to a maximum of 16.
[0206] In the case of (c) of Figure 8, 4x4 LFNST can be applied to each of the two adjacent 4x4 regions on the upper left side, and in this case, a maximum of 32 pieces of LFNST output data can be generated. If the number of output data for forward LFNST is limited to a maximum of 16, 4x4 LFNST is applied only to one 4x4 region on the upper left side even for a 4xN / Nx4 (N≧16) block (TU or CU), and LFNST can be applied only once to all blocks in Figure 8. This simplifies the implementation of image coding.
[0207] Figure 10 shows an example in which the number of output data items for forward LFNST is limited to a maximum of 16. As shown in Figure 10, when LFNST is applied to the top-left 4x4 region of a 4xN or Nx4 block where N is 16 or greater, the number of output data items for forward LFNST is 16.
[0208] (ii) As an example, zero-out can be further applied to areas to which LFNST is not applied. In this document, zero-out can mean that the values of all positions belonging to a specific area are filled with 0. In other words, zero-out can also be applied to areas that remain unchanged by LFNST and retain the result of the forward linear transform. As described above, LFNST is divided into 4x4LFNST and 8x8LFNST, so zero-out can be divided into two types ((ii)-(A) and (ii)-(B)) as follows.
[0209] (ii)-(A) When 4x4 LFNST is applied, it is possible to zero out areas where 4x4 LFNST is not applied. Figure 11 is a diagram showing zeroing out in a block to which 4x4 LFNST is applied, according to an example.
[0210] As shown in FIG. 11, for 4x4 blocks to which LFNST is applied, that is, for the blocks (a), (b), and (c) in FIG. 9, the areas to which LFNST is not applied can all be filled with 0.
[0211] On the other hand, FIG. 11(d) shows that when the maximum number of output data pieces of the forward LFNST is limited to 16 as in FIG. 12, zero-out is performed on the remaining blocks to which the 4×4 LFNST is not applied.
[0212] (ii)-(B) When 8x8 LFNST is applied, it is possible to zero out areas to which 8x8 LFNST is not applied. Figure 12 is a diagram showing zeroing out in a block to which 8x8 LFNST is applied, according to an example.
[0213] As shown in FIG. 12, for an 8x8 block to which LFNST is applied, i.e., for the blocks in (d) and (e) of FIG. 9, even the area to which LFNST is not applied can be filled with 0s.
[0214] (iii) When LFNST is applied, the area filled with zeros may change due to the zero-out proposed in (ii) above. Therefore, the zero-out proposed in (ii) above makes it possible to check whether non-zero data exists in a wider area than in the case of LFNST in FIG. 9.
[0215] 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. 9 as well as in the areas further filled with zeros in FIG. 12, and then perform signaling for the LFNST index only if non-zero data does not exist.
[0216] Of course, even if the zero-out proposed in (ii) above is applied, it is possible to check whether non-zero data exists, just like the existing LFNST index signaling. That is, it is possible to check whether non-zero data exists for blocks filled with zeros in Figure 9 and apply LFNST index signaling. In this case, zero-out is performed only in the encoding device, and the decoding device does not assume the zero-out, i.e., it is possible to perform parsing of the LFNST index by checking whether non-zero data exists only in areas explicitly marked with zeros in Figure 9.
[0217] Alternatively, according to another example, zero-out can be performed as shown in Fig. 13. Fig. 13 is a diagram showing zero-out in an 8x8 block to which LFNST is applied, according to another example.
[0218] It is possible to apply zero-out to all areas other than the area to which LFNST is applied, as in Figures 11 and 12, or it is also possible to apply zero-out to only a partial area, as in Figure 13. It is also possible to apply zero-out only to areas other than the 8x8 area in the upper left of Figure 13, and not to apply zero-out to the 4x4 block in the lower right inside the upper left 8x8 area.
[0219] Various embodiments are 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 embodiments, and any combination can be applied to the LFNST.
[0220] Embodiment
[0221] -Limit the number of output data for forward LFNST to a maximum of 16 → (i)
[0222] -When 4x4 LFNST is applied, all areas where 4x4 LFNST is not applied are zeroed out → (ii)-(A)
[0223] -When 8x8 LFNST is applied, all areas to which 8x8 LFNST is not applied are zeroed out → (ii)-(B)
[0224] -After checking whether non-zero data exists for the existing zero-filled areas and the areas filled with zeros due to additional zero-out ((ii)-(A), (ii)-(B)), signal LFNST indexing only if non-zero data does not exist → (iii)
[0225] In the above embodiment, when LFNST is applied, the area in which non-zero output data can exist is restricted to the interior of the upper left 4x4 area. More specifically, in the cases of Figures 11(a) and 12(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 11(b) and 11(d) and Figure 12(b), the 16th position in the scan order (i.e., the position on the lower right side of the upper left 4x4 block) is the last position in which non-zero data can exist.
[0226] Therefore, when LFNST is applied, it is possible to determine whether or not to signal an LFNST index after checking whether non-zero data exists at a position where the residual coding process is not allowed (a position beyond the last position).
[0227] In the case of the zero-out method proposed in (ii), the amount of data finally generated when both the linear transformation and LFNST are applied is reduced, thereby reducing the amount of calculations required when performing the entire transformation process. In other words, when LFNST is applied, zero-out is also applied to the forward linear transformation output data present in areas where LFNST is not applied, so there is no need to generate data for areas that will be zero-out when performing the forward linear transformation. Therefore, the amount of calculations required to generate this data can be reduced. Additional effects of the zero-out method proposed in (ii) can be summarized as follows:
[0228] First, it reduces the amount of computation required to perform the entire transformation process as described above.
[0229] In particular, when (ii)-(B) is applied, the amount of calculations in the worst case is reduced, making the transformation process lighter. In more detail, a large amount of calculations is generally required to execute a large-size primary transformation, but when (ii)-(B) is applied, the number of data derived as the forward LFNST execution result can be reduced to 16 or less, and the effect of reducing the amount of transformation calculations increases further as the total block (TU or CU) size becomes larger.
[0230] Secondly, the amount of computation required for the entire conversion process is reduced, reducing the power consumption required to perform the conversion.
[0231] Third, it reduces the latency involved in the conversion process.
[0232] Secondary transforms such as LFNST add computational complexity to the existing primary transform, increasing the overall latency associated with transform execution. In particular, in the case of intra prediction, reconstruction data of adjacent blocks is used in the prediction process, so the increase in latency due to secondary transform during encoding leads to an increase in latency until reconstruction, which may lead to an increase in the overall latency of intra prediction encoding.
[0233] However, by applying the zero-out technique proposed in (ii), the latency of the first transform can be significantly reduced when LFNST is applied, so that the latency of the entire transform execution remains the same or is reduced, making it easier to implement the encoding device.
[0234] Meanwhile, in the conventional intra prediction, a block to be coded is regarded as one coding unit and coded without division. However, ISP (Intra Sub-Paritions) coding means that a block to be coded is divided horizontally or vertically and intra prediction coding is performed. At this time, coding / decoding is performed in divided block units to generate a restored block, and the restored block is used as a reference block for the next divided block. As an example, in ISP coding, one coding block may be divided into two or four sub-blocks and coded, and in ISP, one sub-block is intra prediction by referring to the restored pixel value of the sub-block located to the left or upper adjacent side. Hereinafter, "coding" used is used as a concept including both encoding performed in an encoding device and decoding performed in a decoding device.
[0235] Table 4 shows the number of sub-blocks into which a block is divided according to its size when ISP is applied, and the sub-partitions divided by ISP may be called transform blocks (TUs).
[0236] [Table 4]
[0237] ISP is to divide the luma intra predicted block into two or four subpartitions vertically or horizontally depending on the size of the block. For example, the minimum block size that ISP can apply is 4x8 or 8x4. If the block size is larger than 4x8 or 8x4, the block is divided into four subpartitions.
[0238] Figures 14 and 15 show examples of sub-blocks into which one coding block is divided. More specifically, Figure 14 shows an example of division when the coding block (width (W) x height (H)) is a 4x8 block or an 8x4 block, and Figure 15 shows an example of division when the coding block is not a 4x8 block, an 8x4 block, or a 4x4 block.
[0239] 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 type of division, and after a restoration process is performed through inverse transform and intra prediction for one sub-block, coding for the next sub-block is performed. For the leftmost or topmost sub-block, restored pixels of a coding block that has already been coded are referenced 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, restored pixels of adjacent coding blocks that have already been coded are referenced as in a conventional intra prediction method to derive reference pixels adjacent to the side.
[0240] In the ISP coding mode, all sub-blocks may 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 are signaled. As shown in Figures 14 and 15, the number of sub-blocks can be adjusted to two or four depending on the block shape, and if the size (width x height) of one sub-block is less than 16, division into the corresponding sub-block is not allowed or ISP coding itself can be restricted from being applied.
[0241] 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-screen prediction mode is applied to the two or four partition blocks.
[0242] As described above, the division direction can be either horizontal (when an M×N coding unit with a horizontal length and a vertical length of M and N is divided horizontally, it is divided into M×(N / 2) blocks when divided into two, or into M×(N / 4) blocks when divided into four) or vertical (when an M×N coding unit is divided vertically, it is divided into (M / 2)×N blocks when divided into two, or into (M / 4)×N blocks when divided into four). When divided horizontally, the partition blocks are coded in the order from top to bottom, and when divided vertically, the partition blocks are coded in the order from left to right. When the partition block to be coded is divided in the horizontal (vertical) direction, it can be predicted by referring to the restored pixel value of the upper (left) partition block.
[0243] A transform can be applied to the residual signal generated by the ISP prediction method in partition block units. In the forward direction, not only the existing DCT-2 but also the DST-7 / DCT-8 combination-based Multiple Transform Selection (MTS) technology is applied to the primary transform (core transform or primary transform) and a forward Low Frequency Non-Separable Transform (LFNST) is applied to the transform coefficients generated by the primary transform to generate final modified transform coefficients.
[0244] That is, LFNST can also be applied to partition blocks divided by applying the ISP prediction mode, and the same intra prediction mode is applied to the divided partition blocks as described above. Therefore, when 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.
[0245] Meanwhile, as an example, LFNST can only be applied to transform blocks whose width and height are both equal to or greater than 4. Therefore, if the width or height of a partition block divided according to the ISP prediction method is less than 4, LFNST is not applied and an LFNST index is not signaled. Also, when LFNST is applied to each partition block, the partition block can be regarded as one transform block. Of course, when the ISP prediction method is not applied, LFNST is applied to the coding block.
[0246] The specific application of LFNST to each partition block is as follows:
[0247] 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 scan order, and then zero-out is applied to fill all remaining positions and regions with zero values.
[0248] Alternatively, as an example, if the length of one side of a partition block is 4, LFNST can be applied only to the upper left 4×4 region, and 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 within the upper left 8×8 region excluding the lower right 4×4 region.
[0249] Alternatively, for example, in order to achieve a worst-case computational complexity of 8 multiplications per sample, if each partition block is 4×4 or 8×8, only 8 transform coefficients may be output after applying forward LFNST, i.e., if the partition block is 4×4, an 8×16 matrix is applied as the transform matrix, and if the partition block is 8×8, an 8×48 matrix is applied as the transform matrix.
[0250] Meanwhile, in the current VVC standard, LFNST index signaling is performed on a coding unit basis. Therefore, in the ISP prediction mode, when LFNST is applied to all partition blocks, the same LFNST index value can be applied to the partition blocks. That is, once an LFNST index value is transmitted at the coding unit level, the corresponding LFNST index can be applied to all partition blocks within the coding unit. As mentioned above, the LFNST index value has values 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.
[0251] 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 that the partition blocks can refer to the same LFNST set.
[0252] As another example, LFNST index signaling is still performed on a coding unit basis, but in the case of ISP prediction mode, instead of uniformly determining whether to apply LFNST to all partition blocks, it is determined whether to apply the LFNST index value signaled at the coding unit level or not to apply LFNST to each partition block according to a separate condition. Here, the separate condition is 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.
[0253] 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 will be described below.
[0254] First, when 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, when M=8, the upper left region is 8×2 (2×8), so the region containing 16 residual signals becomes the input for the forward LFNST, and an R×16 (R≦16) forward transform matrix can be applied.
[0255] Here, the forward LFNST matrix may be a separate additional matrix, not a matrix currently included in the VVC standard. Also, for worst-case complexity control, an 8×16 matrix obtained by sampling only the top 8 row vectors of a 16×16 matrix is used for conversion. The complexity control method will be described in detail later.
[0256] Second, when 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, when M=16, the upper left region is 16×1 (1×16), so the region containing 16 residual signals becomes the input for the forward LFNST, and an R×16 (R≦16) forward transform matrix can be applied.
[0257] Here, the forward LFNST matrix may be a separate additional matrix that is not included in the current VVC standard. Also, for worst-case complexity control, an 8×16 matrix obtained by sampling only the top 8 row vectors of a 16×16 matrix may be used for conversion. The complexity control method will be described in detail later.
[0258] The first and second embodiments may be applied simultaneously, or only one of the two embodiments may be applied. In particular, in the case of the second embodiment, it has been observed through experiments that the improvement in compression performance obtained in the existing LFNST is not relatively large compared to the LFNST index signaling cost, since a one-dimensional transformation is considered in the LFNST. However, in the case of the first embodiment, an improvement in compression performance similar to that obtained in the existing LFNST has been observed, i.e., in the case of ISP, it has been confirmed through experiments that the application of LFNST for 2×N and N×2 contributes to the actual compression performance.
[0259] Currently, LFNST in VVC applies symmetry between intra prediction modes. The same LFNST set is applied to bidirectional modes centered around mode 34 (prediction in the 45-degree diagonal direction from the bottom right), and for example, the same LFNST set is applied to mode 18 (horizontal prediction mode) and mode 50 (vertical prediction mode). However, when applying forward LFNST to modes 35 to 66, the input data is transposed before LFNST is applied.
[0260] Meanwhile, VVC supports Wide Angle Intra Prediction (WAIP) mode, and the LFNST set is derived based on the intra prediction mode modified taking into account the WAIP mode. For modes extended by WAIP, the LFNST set is determined by utilizing symmetry, just like 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 LFNST transformation is applied.
[0261] In the case of LFNST applied to the upper left M×2 (M×1) 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 LFNST in Table 2, symmetry between the M×2 (M×1) block and the 2×M (1×M) block can be applied.
[0262] FIG. 16 is a diagram illustrating the symmetry of an M×2 (M×1) block and a 2×M (1×M) block according to an example.
[0263] As shown in FIG. 16, since mode 2 in M×2 (M×1) blocks is symmetric with mode 66 in 2×M (1×M) blocks, the same LFNST set can be applied to 2×M (1×M) blocks and M×2 (M×1) blocks.
[0264] In this case, to apply the LFNST set that was applied to M×2 (M×1) blocks to 2×M (1×M) blocks, the LFNST set is selected based on mode 2 instead of mode 66. In other words, before applying forward LFNST, the input data for 2×M (1×M) blocks is transposed, and then LFNST is applied.
[0265] FIG. 17 is a diagram showing an example in which a 2×M block is transposed.
[0266] Figure 17(a) illustrates that LFNST can be applied to a 2xM block by reading input data in column-first order, while Figure 17(b) illustrates that LFNST can be applied to an Mx2 (Mx1) block by reading input data in row-first order. The method of applying LFNST to the upper left Mx2 (Mx1) or 2xM (Mx1) block can be summarized as follows:
[0267] 1. First, construct an input vector for a forward LFNST by arranging input data as shown in (a) and (b) of Figure 17. For example, referring to Figure 16, for an Mx2 block predicted in mode 2, the input data is arranged according to the order in (b) of Figure 17, and for a 2xM block predicted in mode 66, the input data is arranged according to the order in (a) of Figure 17, and then the LFNST set for mode 2 can be applied.
[0268] 2. For an M×2 (M×1) block, the LFNST set is determined based on the modified intra prediction mode taking WAIP into consideration. As described above, there is a predefined mapping relationship between the intra prediction mode and the LFNST set, which can be shown as a mapping table as shown in Table 2.
[0269] For a 2×M (1×M) block, a mode symmetrical with respect to a diagonal prediction mode at 45 degrees downward to the right (mode 34 in the case of the VVC standard) is obtained from intra prediction modes modified in consideration of WAIP, and an LFNST set is determined based on the symmetric mode and a mapping table. The mode (y) symmetrical with respect to mode 34 is derived by the following number. The mapping table will be described in more detail below.
[0270]
number
[0271] 3. When applying forward LFNST, the input data prepared in step 1 is multiplied by the LFNST kernel to derive transform coefficients. The LFNST kernel is selected from the LFNST set determined in step 2 and the pre-specified LFNST index.
[0272] For example, when M=8 and a 16×16 matrix is applied as the LFNST kernel, the matrix is multiplied by 16 input data to generate 16 transform coefficients, which are arranged in the upper left 8×2 or 2×8 region according to the scan order used in the VVC standard.
[0273] FIG. 18 illustrates a scan order for an 8×2 or 2×8 region according to an example.
[0274] Areas other than the upper left 8x2 or 2x8 area may be filled with zeros (zero-out) or the existing transform coefficients to which the first-order transform is applied may be maintained as they are. The pre-specified LFNST index may be one of the LFNST index values (0, 1, 2) that is tried when calculating the RD cost while changing the LFNST index value during encoding.
[0275] 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 16×16 matrix are multiplied by an 8×16 matrix to generate only 8 transform coefficients, and then the 8 transform coefficients are arranged according to the scan order as shown in FIG 18, and zero-out may be applied to the remaining coefficient area. The adjustment of the worst-case complexity will be described later.
[0276] 4. When applying reverse LFNST, a preset number of transform coefficients (e.g., 16) are placed as an input vector, an LFNST kernel (e.g., a 16x16 matrix) is selected from the LFNST set obtained in step 2 and the parsed LFNST index, and the LFNST kernel is multiplied by the input vector to derive an output vector.
[0277] In the case of M×2 (M×1) blocks, the output vectors are arranged in row-major order as shown in FIG. 17(b), and in the case of 2×M (1×M) blocks, the output vectors are arranged in column-major order as shown in FIG. 17(a).
[0278] The remaining areas, excluding the area in which the output vector is placed within the upper left M×2 (M×1) or 2×M (M×2) area, and areas other than the upper left M×2 (M×1) or 2×M (M×2) area within the partition block, are either filled with zero values (zero-out) or configured to maintain the transform coefficients restored during the residual coding and inverse quantization process as they are.
[0279] As in number 3, when constructing an input vector, the input data is arranged according to the scan order of FIG. 18, 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.
[0280] For example, when M=8, and 8 input data are used, 16 output data can be obtained by multiplying only the left 16×8 matrix from the 16×16 matrix. The adjustment of the complexity for the worst case will be described later.
[0281] In the above embodiment, a case has been presented in which symmetry is applied when applying LFNST between an M×2 (M×1) block and a 2×M (1×M) block. However, in other examples, different LFNST sets may be applied to the shapes of the two blocks.
[0282] In the following, various examples of LFNST set configurations for ISP modes and mapping schemes using intra prediction modes are described.
[0283] In the ISP mode, the LFNST set configuration is different from the existing LFNST set. In other words, 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 as shown in Table 2.
[0284] In Table 2, the preModeIntra value means an intra prediction mode value modified taking WAIP into consideration, and the lfnstTrSetIdx value is an index value indicating a specific LFNST set. Each LFNST set consists of two LFNST kernels.
[0285] When the ISP prediction mode is applied, if the width and height of each partition block are both greater than or equal to 4, the same kernel as the LFNST kernel currently applied in the VVC standard may be applied, and the mapping table may also be applied as is. Of course, an LFNST kernel and a mapping table different from those in the current VVC standard may also be applied.
[0286] When the ISP prediction mode is applied, a different LFNST kernel and a different mapping table than those currently used in the VVC standard may be applied if the width or height of each partition block is less than 4. Tables 5 to 7 below show mapping tables between intra prediction mode values (intra prediction mode values modified in consideration of WAIP) and LFNST sets that can be applied to M×2 (M×1) blocks or 2×M (1×M) blocks.
[0287] [Table 5]
[0288] [Table 6]
[0289] [Table 7]
[0290] The first mapping table in Table 5 consists of seven LFNST sets, the mapping table in Table 6 consists of four LFNST sets, and the mapping table in Table 7 consists of two LFNST sets. As another example, when consisting of one LFNST set, the lfnstTrSetIdx value is fixed to 0 for the preModeIntra value.
[0291] In the following, we explain how to maintain the worst-case computational complexity when applying LFNST to the ISP mode.
[0292] In ISP mode, 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 when applying LFNST. 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.
[0293] 1. When both the width and height of a partition block are 4 or more, the same method as the worst-case calculation complexity adjustment method for LFNST in the current VVC standard can be applied.
[0294] That is, when the partition block is a 4×4 block, an 8×16 matrix obtained by sampling the top 8 rows from a 16×16 matrix can be applied in the forward direction instead of a 16×16 matrix, and a 16×8 matrix obtained by sampling the left 8 columns from a 16×16 matrix can be applied in the reverse direction instead of a 16×16 matrix. Also, when the partition block is an 8×8 block, an 8×48 matrix obtained by sampling the top 8 rows from a 16×48 matrix can be applied in the forward direction instead of a 16×48 matrix, and a 48×8 matrix obtained by sampling the left 8 columns from a 48×16 matrix can be applied in the reverse direction instead of a 48×16 matrix.
[0295] In the case of a 4xN or Nx4 (N>4) block, when performing a forward transform, a 16x16 matrix is applied only to the upper left 4x4 block, and the generated 16 coefficients are placed in the upper left 4x4 area, and the remaining area is filled with 0 values. Also, when performing an inverse transform, 16 coefficients located in the upper left 4x4 block are arranged in the scan order to form an input vector, and then a 16x16 matrix is multiplied to generate 16 output data. The generated output data is placed in the upper left 4x4 area, and the remaining area except for the upper left 4x4 area is filled with 0 values.
[0296] In the case of an 8×N or N×8 (N>8) block, when performing a forward transform, a 16×48 matrix is applied only to the ROI region (the remaining region from the upper left 8×8 block to the lower right 4×4 block) inside the upper left 8×8 block, and the generated 16 coefficients are placed in the upper left 4×4 region, and the remaining regions are all filled with 0 values. When performing an inverse transform, the 16 coefficients located in the upper left 4×4 block are placed according to the scan order to form an input vector, and then a 48×16 matrix is multiplied to generate 48 output data. The generated output data is filled in the ROI region, and the remaining regions are all filled with 0 values.
[0297] 2. When the size of a partition block is N×2 or 2×N and LFNST is applied to the upper left M×2 or 2×M area (M≦N), a matrix sampled according to the N value can be applied.
[0298] When M=8, for a partition block where N=8, i.e., an 8×2 or 2×8 block, in the case of forward transform, an 8×16 matrix obtained by sampling the top 8 rows from a 16×16 matrix is applied instead of a 16×16 matrix, and in the case of inverse transform, a 16×8 matrix obtained by sampling the left 8 columns from a 16×16 matrix is applied instead of a 16×16 matrix.
[0299] If N is greater than 8, in the case of forward transform, a 16x16 matrix is applied to the upper left 8x2 or 2x8 block, and the 16 generated output data are placed in the upper left 8x2 or 2x8 block, and the remaining area is filled with 0 values. In the case of inverse transform, 16 coefficients located in the upper left 8x2 or 2x8 block are arranged in the scan order to form an input vector, and then the corresponding 16x16 matrix is multiplied to generate 16 output data. The generated output data are placed in the upper left 8x2 or 2x8 block, and the remaining area is filled with 0 values.
[0300] 3. When the size of a partition block is N×1 or 1×N and LFNST (M≦N) is applied to the upper left M×1 or 1×M area, a matrix sampled according to the N value is applied.
[0301] When M=16, for partition blocks where N=16, i.e., 16×1 or 1×16 blocks, in the case of forward transform, an 8×16 matrix obtained by sampling the top 8 rows from a 16×16 matrix is applied instead of the 16×16 matrix, and in the case of inverse transform, a 16×8 matrix obtained by sampling the left 8 columns from a 16×16 matrix is applied instead of the 16×16 matrix.
[0302] If N is greater than 16, in the case of forward transform, a 16x16 matrix is applied to the upper left 16x1 or 1x16 block, and the 16 generated output data are placed in the upper left 16x1 or 1x16 block, and the remaining area is filled with 0 values. In the case of inverse transform, 16 coefficients located in the upper left 16x1 or 1x16 block are arranged in the scan order to form an input vector, and then the corresponding 16x16 matrix is multiplied to generate 16 output data. The generated output data are placed in the upper left 16x1 or 1x16 block, and the remaining area is filled with 0 values.
[0303] As another example, in order to maintain the number of multiplications per sample (or per coefficient, position) below a certain value, the number of multiplications per sample (or per coefficient, position) is maintained to 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 that satisfies the condition for applying LFNST among the ISP partition blocks, a complexity calculation for the worst case of LFNST is 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 partition blocks of 4×4 size and coded by ISP, and no non-zero transform coefficient exists for two of the partition blocks, the other two partition blocks may be set to generate 16 transform coefficients (based on the encoder), not 8, respectively.
[0304] The following describes a method for signaling the LFNST index in the ISP mode.
[0305] As mentioned above, the LFNST index has values of 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 current VVC standard describes the method of transmitting the LFNST index as follows:
[0306] 1. The LFNST index can be sent once per coding unit (CU), and in the dual-tree case, separate LFNST indexes are signaled for luma and chroma blocks.
[0307] 2. If the LFNST index is not signaled, the LFNST index value is inferred to be the default value of 0. The cases in which the LFNST index value is inferred to be 0 are as follows.
[0308] A. If the mode does not apply transform (e.g. transform skip, BDPCM, lossless coding, etc.)
[0309] B. When the primary transform is not DCT-2 (DST7 or DCT8), i.e., when the horizontal transform or vertical transform is not DCT-2
[0310] C. If the width or height 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, LFNST cannot be applied if the size of the luma block of the coding block is similar to 128x16.
[0311] 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 is exceeded for the luma block, and it is checked whether the vertical / horizontal length of the corresponding luma block for the color format and the maximum luma transform size that can be transformed are exceeded for the chroma block. For example, when the color format is 4:2:0, the horizontal / vertical length of the corresponding luma block is twice that of the chroma block, and the size of the corresponding luma block transform is twice that of the chroma block. As another example, when the color format is 4:4:4, the horizontal / vertical length and transform size of the corresponding luma block are the same as those of the corresponding chroma block.
[0312] 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" refers to the length, 64 or 32.
[0313] In the case of a single tree, after checking whether the width or height of the luma block exceeds the maximum luma transform block size that can be transformed, if it exceeds the size, the LFNST index signaling may be omitted.
[0314] D. An LFNST index can be sent only if both the width and height of a coding unit are 4 or greater.
[0315] In the case of a dual tree, the LFNST index can be signaled only if both the width and height for the corresponding component (i.e., the luma or chroma component) are 4 or greater.
[0316] In the case of a single tree, the LFNST index can be signaled for cases where both the width and height for the luma component are 4 or greater.
[0317] E. If the position of the last non-zero coefficient is not the DC position (upper left position of the block), and it is a dual tree type luma block, if the position of the last non-zero coefficient is not the DC position, send an LFNST index. If it is a dual tree type chroma block, 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, send the corresponding LNFST index.
[0318] In the case of the single tree type, if the position of the last non-zero coefficient of any one of the luma component, Cb component, and Cr component is not the DC position, the LFNST index is transmitted.
[0319] Here, if a coded block flag (CBF) value, which indicates whether a transform coefficient exists for a transform block, is 0, the position of the last non-zero coefficient for the transform block is not checked to determine whether to perform LFNST index signaling. That is, if the CBF value is 0, no transform is applied to the block, so the position of the last non-zero coefficient does not need to be considered when checking the condition for LFNST index signaling.
[0320] For example, 1) in the case of a dual tree type, if the CBF value is 0 for a luma component, no LFNST index is signaled; 2) in the case of a dual tree type, if the CBF value for Cb is 0 and the CBF value for Cr is 1 for a chroma component, 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.
[0321] F. If it is confirmed that a transform coefficient exists at a position where an LFNST transform coefficient cannot exist, the LFNST index signaling can be omitted. In the case of a 4×4 transform block and an 8×8 transform block, the LFNST transform coefficient exists at 8 positions from the DC position according to the transform coefficient scan order in the VVC standard, and the remaining positions are all filled with 0. In addition, in the case of a block other than a 4×4 transform block and an 8×8 transform block, the LFNST transform coefficient exists at 16 positions from the DC position according to the transform coefficient scan order in the VVC standard, and the remaining positions are all filled with 0.
[0322] Therefore, if there are non-zero transform coefficients in the area that should be filled with zero values after residual coding, the LFNST index signaling can be omitted.
[0323] Meanwhile, the ISP mode may be applied only to the luma block, or may be applied to both the luma block and the chroma block. As described above, when ISP prediction is applied, the corresponding coding unit is divided into two or four partition blocks and predicted, and transformation is also applied to each of the corresponding partition blocks. Therefore, when determining a condition for signaling an LFNST index in units of coding units, the fact that LFNST can be applied to each of the corresponding partition blocks should 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 should be signaled taking into consideration the fact that only the component is divided into partition blocks. In the case of the ISP mode, possible LFNST index signaling methods can be summarized as follows.
[0324] 1. An LFNST index can be transmitted once for each coding unit (CU), and in the case of a dual-tree, separate LFNST indexes can be signaled for luma blocks and chroma blocks.
[0325] 2. If the LFNST index is not signaled, the LFNST index value is inferred to the default value of 0. The cases in which the LFNST index value is inferred to 0 are as follows.
[0326] A. If the mode does not apply transform (e.g. transform skip, BDPCM, lossless coding, etc.)
[0327] B. If the width or height 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 the same as 128x16, LFNST cannot be applied.
[0328] It may also be possible to determine whether to signal the LFNST index based on the size of the partition block instead of the coding unit. That is, if the width or height of the partition block for the corresponding luma block exceeds the maximum luma transform size that can be converted, the LFNST index signaling may be omitted and the LFNST index value may be inferred to be 0.
[0329] 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 vertical length and horizontal length of the coding unit or partition block for luma are compared with the maximum luma transform size, respectively, and 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 / vertical length of the corresponding luma block for the color format is compared with the maximum luma transform size that can be converted. For example, if the color format is 4:2:0, the horizontal / vertical length of the corresponding luma block is twice that of the chroma block, respectively, and the transform size of the corresponding luma block is twice that of the chroma block. As another example, if the color format is 4:4:4, the horizontal / vertical length and transform size of the corresponding luma block are the same as the corresponding chroma block.
[0330] In the case of a single tree, after checking whether the width or height of the luma block (coding unit or partition block) exceeds the maximum luma transform block size that can be transformed, if it does, the LFNST index signaling may be omitted.
[0331] C. If LFNST, which is included in the current VVC standard, is applied, the LFNST index can be sent only if both the width and height of the partition block are 4 or more.
[0332] If LFNST for 2xM (1xM) or Mx2 (Mx1) blocks is applied in addition to the LFNST currently included in the VVC standard, the LFNST index can be transmitted only if the partition block size is greater than or equal to 2xM (1xM) or Mx2 (Mx1) blocks. Here, PxQ blocks greater than or equal to RxS blocks means P≧R and Q≧S.
[0333] To summarize, an LFNST index can be sent only if a partition block is greater 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 if a partition block for a luma or chroma component is greater 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 if a partition block for a luma component is greater than or equal to the minimum size for which LFNST is applicable.
[0334] In this document, an MxN block greater than or equal to a KxL block means that M is greater than or equal to K and N is greater than or equal to L. An MxN block greater than a KxL block means that M is greater than or equal to K and N is greater than or equal to L, while M is greater than or equal to K and N is greater than or equal to L. An MxN block less than or equal to a KxL block means that M is less than or equal to K and N is less than or equal to L, while M is less than or equal to K and N is less than or equal to L, and an MxN block less than a KxL block means that M is less than or equal to K and N is less than or equal to L, while M is less than K and N is less than L.
[0335] D. If the position of the last non-zero coefficient is not the DC position (the upper left corner position of the block), if the luma block is of dual tree type, the LFNST can be transmitted if the position of the last non-zero coefficient in any one of the partition blocks is not the DC position. If the luma block is of dual tree type, the LNFST index can be transmitted if the position of the last non-zero coefficient in any one of the partition blocks for Cb (if the ISP mode is not applied to the chroma component, the number of partition blocks is considered to be one) and the position of the last non-zero coefficient in any one of the partition blocks for Cr (if the ISP mode is not applied to the chroma component, the number of partition blocks is considered to be one) are not the DC position.
[0336] In the case of the 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.
[0337] Here, if a coded block flag (CBF) value, which indicates 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 to perform LFNST index signaling. 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 conditions for LFNST index signaling.
[0338] 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 perform LFNST index signaling; 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 perform LFNST index signaling; 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 perform LFNST index signaling.
[0339] In the ISP mode, the image information may be configured not to check the position of the last non-zero coefficient, and an embodiment of this is as follows.
[0340] i. In ISP mode, omit the check on the position of the last non-zero coefficient for both luma and chroma blocks and allow LFNST index signaling, i.e., allow LFNST index signaling 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.
[0341] ii. In the ISP mode, the check on the position of the last non-zero coefficient is omitted only for the luma block, and the check on the position of the last non-zero coefficient is performed in the above-mentioned manner in the case of a chroma block. For example, in the case of a dual tree type and a luma block, the LFNST index signaling is permitted without checking the position of the last non-zero coefficient, and in the case of a dual tree type and a chroma block, the presence or absence of a DC position for the position of the last non-zero coefficient in the above-mentioned manner is checked to determine whether or not to signal the corresponding LFNST index.
[0342] iii. In the case of ISP mode and single tree type, the method i or ii is applied. That is, in the case of ISP mode and single tree type, when method i is applied, a check on the position of the last non-zero coefficient for both luma blocks and chroma blocks is omitted, and LFNST index signaling is allowed. Alternatively, method ii is applied to omit a check on the position of the last non-zero coefficient for partition blocks for the luma component, and a check on the position of the last non-zero coefficient for partition blocks for the chroma components (when ISP is not applied to the chroma component, the number of partition blocks is considered to be 1) in the above-mentioned method is performed to determine whether to perform the corresponding LFNST index signaling.
[0343] 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, the LFNST index signaling can be omitted.
[0344] For example, in the case of a 4×4 partition block and an 8×8 partition block, the LFNST transform coefficient is located at 8 positions from the DC position according to the transform coefficient scan order in the VVC standard, and the remaining positions are all filled with 0. In addition, in the case of a partition block that is greater than or equal to 4×4 but is not a 4×4 partition block or an 8×8 partition block, the LFNST transform coefficient is located at 16 positions from the DC position according to the transform coefficient scan order in the VVC standard, and the remaining positions are all filled with 0.
[0345] Therefore, if there are non-zero transform coefficients in the area that should be filled with zero values after residual coding, the LFNST index signaling can be omitted.
[0346] If LFNST can be applied to partition blocks that are 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 are filled with zeros, and if there is a non-zero transform coefficient in an area that should be filled with zeros if LFNST is applied, LFNST index signaling can be omitted.
[0347] i. LFNST can be applied to a 2×M or M×2 block, and if M=8, then only eight LFNST transform coefficients are generated for a 2×8 or 8×2 partition block. When transform coefficients are arranged in a scan order as in FIG. 18, eight transform coefficients are arranged in scan order starting from the DC position, and the remaining eight positions are filled with zeros.
[0348] For a 2×N or N×2 (N>8) partition block, 16 LFNST transform coefficients are generated, and when the transform coefficients are arranged in the scan order as shown in FIG. 18, 16 transform coefficients are arranged in the scan order from the DC position, and the remaining area is filled with 0. That is, in a 2×N or N×2 (N>8) partition block, areas other than the upper left 2×8 or 8×2 block are filled with 0. For a 2×8 or 8×2 partition block, 16 transform coefficients are generated instead of 8 LFNST transform coefficients, and in this case, no area needs to be filled with 0. As described above, when LFNST is applied, if it is detected that a transform coefficient other than 0 exists in an area that is determined to be filled with 0 in even one partition block, the LFNST index signaling can be omitted and the LFNST index can be inferred as 0.
[0349] ii. LFNST can be applied to a 1×M or M×1 block, and for a 1×16 or 16×1 partition block, if M=16, then only 8 LFNST transform coefficients are generated. When transform coefficients are arranged in left-to-right or top-to-bottom scan order, 8 transform coefficients are arranged in the corresponding scan order starting from the DC position, and the remaining 8 positions are filled with zeros.
[0350] For a 1×N or N×1 (N>16) partition block, 16 LFNST transform coefficients are generated, and when the transform coefficients are arranged in a left-to-right or top-to-bottom scan order, the 16 transform coefficients are arranged in the corresponding scan order from the DC position, and the remaining area is filled with 0. That is, in a 1×N or N×1 (N>16) partition block, the area other than the upper left 1×16 or 16×1 block is filled with 0.
[0351] For a 1×16 or 16×1 partition block, 16 LFNST transform coefficients are generated instead of 8, and in this case, there are no areas that must be filled with 0. As described above, when LFNST is applied, if it is detected that a non-zero transform coefficient exists in an area that is defined to be filled with zeros even in one partition block, the LFNST index signaling can be omitted and the LFNST index can be inferred as 0.
[0352] Meanwhile, in the ISP mode, the current VVC standard looks at the length conditions for the horizontal and vertical directions independently and applies DST-7 instead of DCT-2 without signaling for the MTS index. It is determined whether the vertical or horizontal length is greater than or equal to 4 and less than or equal to 16, and the primary transform kernel is determined according to the determination result. Therefore, in the case where LFNST can be applied in the ISP mode, the following transform combination configurations are possible.
[0353] 1. If the LFNST index is 0 (including the case where the LFNST index is inferred to be 0), the decision condition for the primary transformation when it is an ISP currently included in the VVC standard is followed. That is, it is checked whether the length condition (greater than or equal to 4 and less than or equal to 16) is satisfied independently for the horizontal and vertical directions, and if it is satisfied, DST-7 is applied instead of DCT-2 for the primary transformation, and if it is not satisfied, DCT-2 is applied.
[0354] 2. For LFNST indexes greater than 0, there are two possible configurations for the linear transformation:
[0355] A. DCT-2 can be applied to both the horizontal and vertical directions.
[0356] B. It can follow the decision conditions for the primary transform when it is an ISP currently included in the VVC standard. That is, it checks whether the length condition (greater than or equal to 4 and less than or equal to 16) is satisfied independently for the horizontal and vertical directions, and if it is satisfied, it applies DCT-7 instead of DCT-2, and if it is not satisfied, it applies DCT-2.
[0357] 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, it can be determined whether to perform LFNST index signaling by regarding that there is only one partition block within the unit in which the LFNST index is transmitted in the above-mentioned LFNST index signaling method.
[0358] Meanwhile, the signaling order of the LFNST index and the MTS index will be considered below.
[0359] As an example, the LFNST index signaled in residual coding may be coded next to the coding position for the last non-zero coefficient position, and the MTS index may be coded immediately after the LFNST index. In such a configuration, the LFNST index may be signaled for each transform unit. Alternatively, even if not signaled in residual coding, the LFNST index may be coded next to the coding position for the last significant coefficient position, and the MTS index may be coded next to the LFNST index.
[0360] The syntax of the residual coding according to an example is as follows:
[0361] [Table 8-1]
[0362] [Table 8-2]
[0363] The meanings of the main variables shown in Table 8 are as follows:
[0364] 1. cbWidth, cbHeight: Width and height of the current coding block
[0365] 2. log2TbWidth, log2TbHeight: Base-2 log value for the width and height of the current transform block. Zero-out is reflected and it can be reduced to the upper left corner area where non-zero coefficients can exist.
[0366] 3. sps_lfnst_enabled_flag: A flag indicating whether LFNST is applicable (enabled). If the flag value is 0, it indicates that LFNST is not applicable, and if the flag value is 1, it indicates that LFNST is applicable. This is defined in the Sequence Parameter Set (SPS).
[0367] 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 a position on the picture, and the CuPredMode[chType][x0][y0] value can be MODE_INTRA (intra prediction) or MODE_INTER (inter prediction).
[0368] 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.
[0369] 6. intra_mip_flag[x0][y0]: The contents for the (x0, y0) position are the same as in 4 above. 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.
[0370] 7. cIdx: A value of 0 indicates luma, and values of 1 and 2 indicate the chroma components Cb and Cr, respectively.
[0371] 8. treeType: Refers to 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)
[0372] 9. tu_cbf_cb[x0][y0]: The contents for the (x0, y0) position are the same as in 4. Indicates the CBF (Coded Block Flag) for the Cb component. When the value is 0, it means that a non-zero coefficient does not exist in the transform unit corresponding to the Cb component, and when the value is 1, it indicates that a non-zero coefficient exists in the transform unit corresponding to the Cb component.
[0373] 10. lastSubBlock: Indicates the position in the scan order of the sub-block (Coefficient Group (CG)) in which the last non-zero coefficient is located. 0 indicates a sub-block containing DC components, and if it is greater than 0, it is not a sub-block containing DC components.
[0374] 11. lastScanPos: Indicates the position of the last valid coefficient in the scan order within a subblock. If a subblock consists of 16 positions, the possible values are 0 to 15.
[0375] 12. lfnst_idx[x0][y0]: LFNST index syntax element to be parsed. If not parsed, it is inferred to 0. That is, the default value is set to 0, which indicates that LFNST is not applied.
[0376] 13. LastSignificantCoeffX, LastSignificantCoeffY: Indicates the x and y coordinates where the last significant coefficient is located in the transform block. The x coordinate starts from 0 and increases from left to right, and the y coordinate starts from 0 and increases from top to bottom. If the values of the two variables are all 0, it means that the last significant coefficient is located at DC.
[0377] 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 applied.
[0378] 15. sps_explicit_mts_inter_enabled_flag, sps_explicit_mts_intra_enabled_flag: Flags indicating whether explicit MTS has been 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 flag value is 1, it indicates that MTS is applicable.
[0379] 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 all horizontal and vertical directions.
[0380] As shown in Table 8, 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 exists in the top 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 exists in positions 0 to 7 in the top left sub-block.
[0381] 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.
[0382] In Table 8, "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".
[0383] In Table 8, log2ZoTbWidth and log2ZoTbHeight refer to the base-2 log values of the width and height, respectively, for the top-left region within which the last significant coefficient can reside due to zeroing out.
[0384] As shown in Table 8, 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.
[0385] 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.
[0386] After the MTS index is parsed, log2ZoTbWidth and log2ZoTbHeight are set if the MTS index value is greater than 0 (in the case of DST-7 / DCT-8 combination). When DST-7 / DCT-8 is applied independently to the horizontal and vertical directions in the first transformation, up to 16 effective coefficients can exist per row or column in each direction. That is, after applying a DST-7 / DCT-8 with a length of 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, effective coefficients can only exist up to the top left 16x16 region.
[0387] Also, currently, when DCT-2 is applied independently to the horizontal and vertical directions in a primary transform, up to 32 effective coefficients can exist for each 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 for each row or column from the left or top. Therefore, when DCT-2 is applied to both the horizontal and vertical directions for a 2D block, effective coefficients can only exist up to the top left 32x32 region.
[0388] Also, when DST-7 / DCT-8 is applied to one side of the horizontal direction and DCT-2 is applied to the other side of the vertical direction, there can be 16 significant coefficients in the former direction and 32 significant coefficients in the latter direction. For example, in a 64x8 transform block, when DCT-2 is applied to the horizontal direction and DST-7 is applied to the vertical direction (which can occur when implicit MTS is applied), there can be significant coefficients in the upper left 32x8 region at most.
[0389] If log2ZoTbWidth and log2ZoTbHeight are updated in two places as in Table 8, 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.
[0390] [Table 9]
[0391] In this case, the maximum values of last_sig_coeff_x_prefix and last_sig_coeff_y_prefix can be set by reflecting the log2ZoTbWidth and log2TbHeight values in the binarization process for last_sig_coeff_x_prefix and last_sig_coeff_y_prefix.
[0392] [Table 10]
[0393] Meanwhile, as an example, in the case where the ISP mode is selected and LFNST is applied, the spec text can be configured as shown in Table 11 when the signaling in Table 8 is applied. Compared to Table 8, the condition in which the LFNST index is signaled only when the ISP mode is not selected (IntraSubPartitionsSplit[x0][y0]==ISP_NO_SPLIT in Table 8) has been deleted.
[0394] In the case of a single tree, if the LFNST index sent in the case of luma (cIdx=0) is reused in the case of chroma, the LFNST index sent for the first ISP partition block in which a significant coefficient exists can be applied to the chroma transform block. Or, even in the case of a single tree, the LFNST index can be signaled separately from the luma component for the case of a chroma component. The variables listed in Table 11 are explained in Table 8.
[0395] [Table 11]
[0396] As another example, if the last significant coefficient is allowed to be located only at the DC position for all partition blocks when in ISP in Table 11, the parsing condition of the LFNST index can be changed as follows:
[0397] [Table 12]
[0398] Meanwhile, according to one example, the LFNST index and / or the MTS index may be signaled at a coding unit level. As described above, the LFNST index may have three values, 0, 1, and 2, where 0 indicates that LFNST is not applied, and 1 and 2 indicate the first and second candidates, respectively, of the two LFNST kernel candidates included in the selected LFNST set. The LFNST index is coded via truncated unary binarization, and the values 0, 1, and 2 may be coded with bin strings 0, 10, and 11, respectively.
[0399] According to one example, LFNST can be applied only when 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, and if the LFNST index is not 0, the primary transform can be performed by applying DCT-2 to both the horizontal and vertical directions without signaling the MTS index.
[0400] The MTS index value may have values of 0, 1, 2, 3, and 4, where 0, 1, 2, 3, and 4 may 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. Also, the MTS index may be coded via truncated unary binarization, where the 0, 1, 2, 3, and 4 values may be coded with bin strings 0, 10, 110, 1110, and 1111, respectively.
[0401] The fact that the LFNST index is signaled at the coding unit level can be shown as in the following table: The LFNST index can be signaled in the latter half of the coding unit syntax table.
[0402] [Table 13]
[0403] Meanwhile, as an example, the variables LfnstDcOnly and LfnstZeroOutSigCoeffFlag in Table 13 may be set as shown in Table 16 below.
[0404] The variable LfnstDcOnly is set to 1 if all the last significant coefficients for 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 located at the DC position (top left 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.
[0405] The variable LfnstZeroOutSigCoeffFlag is 0 if there is a valid coefficient in a position that will be zeroed out when LFNST is applied, and is 1 otherwise.
[0406] In Table 13 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.
[0407] For example, when the MTS index is to be coded following the LFNST index at the coding unit level, a coding unit syntax table as shown in Table 14 can be constructed.
[0408] [Table 14]
[0409] When comparing Table 14 with Table 13, the condition for signaling lfnst_idx[x0][y0], which checks whether the tu_mts_idx[x0][y0] value is 0 (i.e., checking whether both the horizontal and vertical directions are DCT-2), has been changed to a condition for checking whether the transform_skip_flag[x0][y0] value is 0 (!transform_skip_flag[x0][y0]). transform_skip_flag[x0][y0] indicates whether the coding unit is coded in a transform skip mode in which the transform is omitted, and the 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.
[0410] As shown in Table 14, when coding tu_mts_idx[x0][y0], various conditions are checked and, as previously described, tu_mts_idx[x0][y0] is signaled only if the value of lfnst_idx[x0][y0] is 0.
[0411] In addition, 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 a coding unit for the luma component, respectively.
[0412] Also, in Table 14, (IntraSubPartitionsSplit[x0][y0]==ISP_NO_SPLIT) indicates that the ISP mode is not used, and (!cu_sbt_flag) indicates that SBT is not applied.
[0413] 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.
[0414] 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 the width and height of a transform block are both less than or equal to 32, 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. In addition, 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 even one transform block is 1.
[0415] For example, when the ISP mode is applied to the current block, LFNST can be applied, in which case Table 14 can be modified as shown in Table 15.
[0416] [Table 15]
[0417] As shown in Table 15, 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.
[0418] Also, as shown in Table 15, tu_mts_idx[x0][y0] can be signaled only when not in ISP mode, so the MTS index coding part is as shown in Table 14.
[0419] As shown in Tables 14 and 15, if the MTS index is signaled immediately after the LFNST index, information on the first transform cannot be known when performing residual coding. That is, the MTS index is signaled after the residual coding. Therefore, the part in which zero-out is performed leaving only 16 coefficients for the 32-length DST-7 or DCT-8 in the residual coding part can be changed as shown in Table 16 below.
[0420] [Table 16-1]
[0421] [Table 16-2]
[0422] In the process of determining log2ZoTbWidth and log2ZoTbHeight as shown in Table 16 (where log2ZoTbWidth and log2ZoTbHeight respectively indicate the base-2 log values of the width and height for the upper left region remaining after zero-out is performed), the part checking the tu_mts_idx[x0][y0] value can be omitted.
[0423] The binarization for last_sig_coeff_x_prefix and last_sig_coeff_y_prefix in Table 16 can be determined based on log2ZoTbWidth and log2ZoTbHeight as in Table 10.
[0424] In addition, as shown in Table 16, when determining log2ZoTbWidth and log2ZoTbHeight in residual coding, a condition for checking sps_mts_enable_flag can be added.
[0425] TR in Table 10 indicates a truncated Rice binarization method, and the last valid coefficient information can be binarized according to the method described in the following table based on cMax and cRiceParam defined in Table 10.
[0426] [Table 17]
[0427] Meanwhile, in another example, the coding unit syntax table and the residual coding syntax table are as shown in the following table.
[0428] [Table 18]
[0429] [Table 19]
[0430] 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, as in Table 19, the MTS index is not signaled.
[0431] Meanwhile, according to one example, the MTS index coding portion of Table 18 can be changed as shown in the following table.
[0432] [Table 20]
[0433] Unlike Table 18, the variable MtsZeroOutSigCoeffFlag in Table 20 is initialized to 0 instead of 1 (MtsZeroOutSigCoeffFlag=0). The variable MtsZeroOutSigCoeffFlag maintains its value as 0 if there is a valid coefficient in the region that should be filled with 0 by zeroing out (LastSignificantCoeffX>15||LastSignificantCoeffY>15), in which case no MTS index is signaled.
[0434] 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 described in the drawings are presented for illustrative purposes only, and the technical features of the present specification are not limited to the specific names used in the following drawings.
[0435] FIG. 19 is a flow chart illustrating the operation of a video decoding device according to one embodiment of this document.
[0436] Each step disclosed in Fig. 19 is based on part of the contents detailed in Fig. 2 to Fig. 18. Therefore, the description of the specific contents overlapping with the contents detailed in Fig. 2 to Fig. 18 will be omitted or simplified.
[0437] The decoding device 200 according to one embodiment may perform residual coding based on residual information received from a bitstream, and more specifically, may parse the residual information received at a residual coding level and arrange transform coefficients for a current block according to a predetermined scanning order (S1910).
[0438] The decoding apparatus 200 may decode information on quantized transform coefficients for a current block from a bitstream, and may 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 a transform set.
[0439] 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 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 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 through flag information indicating in which direction the current block is divided.
[0440] The decoding apparatus 200 may derive transform coefficients by performing inverse quantization on residual information for a current block, i.e., quantized transform coefficients, and may arrange the derived transform coefficients in a predetermined scanning order.
[0441] Specifically, the derived transform coefficients may be arranged in a reverse diagonal scan order in units of 4x4 blocks, and the transform coefficients in 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 a video codec such as VVC or HEVC.
[0442] The transform coefficients derived based on the residual information may be the inversely quantized transform coefficients as described above, or may be the quantized transform coefficients, that is, the transform coefficients may be data that can be checked to see if they are non-zero in the current block, regardless of whether they are quantized or not.
[0443] A decoding device can apply an inverse transform to the quantized transform coefficients to derive residual samples.
[0444] As described above, the decoding device can derive residual samples by applying the non-separable transform LFNST or the separable transform MTS, and such transforms can be performed based on an LFNST kernel, i.e., an LFNST index indicating an LFNST matrix and an MTS index indicating an MTS kernel, respectively.
[0445] According to one example, the decoding device may receive and parse at least one of an LFNST index or an MTS index at a coding unit level, and may parse an LFNST index pointing to an LFNST kernel prior to, i.e., immediately after, an MTS index pointing to an MTS kernel (S1920).
[0446] Depending on the specific condition for the LFNST index, for example, when the LFNST index value is 0, the MTS index can be parsed.
[0447] Meanwhile, the residual coding level may include a syntax for the last significant coefficient position information, and the LFNST index may be parsed after the last significant coefficient position information is parsed.
[0448] According to one example, if the current block is a luma block and the LFNST index is 0, the MTS index may be parsed. That is, if the current block is a luma block and the LFNST index is greater than 0, the MTS index is not parsed.
[0449] For example, if the tree type of the current block is a dual tree, the LFNST index for each of the luma block and the chroma block may be parsed.
[0450] Meanwhile, in the step of deriving the transform coefficients, the width and height for the top left region where the last significant coefficient can be present due to zero-out in the current block can be derived, and the width and height for the top left region can be derived before parsing the MTS index.
[0451] Meanwhile, the last significant coefficient position may be derived from the width and height for the upper left region, and the last significant coefficient position information may be binarized based on the width and height for the upper left region.
[0452] Alternatively, according to an example, if the tree type of the current block is a single tree type, the decoding apparatus may parse the LFNST index after performing residual coding on the luma block and the chroma block of the current block.
[0453] When the LFNST index is parsed at the coding unit level after residual coding that is not a transform block level or residual coding level is performed, an LFNST index can be received that reflects the positions of complete transform coefficients for the luma block and chroma block, rather than transform coefficient information for either the luma block or the chroma block, and zero-out information involved in the transform process.
[0454] In addition, when the tree type of the current block is a dual tree type and the decoding apparatus codes a chroma component, the decoding apparatus may parse the LFNST index after performing residual coding on the Cb component and the Cr component of the chroma block.
[0455] When the LFNST index is parsed at the coding unit level after residual coding that is not a transform block level or residual coding level is performed, an LFNST index reflecting the complete transform coefficient positions for the Cb and Cr components and zero-out information involved in the transform process, which is not transform coefficient information for any one of the Cb and Cr components of a chroma block, can be received.
[0456] Also, if the current block is divided into a plurality of sub-partition blocks, the decoding apparatus may parse the LFNST index after performing residual coding on the plurality of sub-partition blocks.
[0457] As described above, when the LFNST index is parsed at the coding unit level after residual coding that is not at the transform block level or residual coding level is performed, an LFNST index reflecting the complete transform coefficient positions for all sub-partition blocks and zero-out information involved in the transform process, rather than transform coefficient information for some or individual sub-partition blocks, can be received.
[0458] Meanwhile, according to an example, when the current block is divided into the sub-partition blocks, the LFNST index may be parsed regardless of whether a transform coefficient exists in an area excluding a DC position of each of the sub-partition blocks. That is, when ISP is applied to the current block, if it is permitted that the last significant coefficient is located only at a DC position for all the sub-partition blocks, signaling of the LFNST index may be permitted.
[0459] Meanwhile, in the residual coding step, the decoding device may derive a first variable indicating whether a transform coefficient exists in an area excluding a DC position of the current block, and derive a second variable indicating whether a transform coefficient exists in a second area excluding a first area at the upper left corner of the current block or a sub-partition block divided from the current block.
[0460] The decoding device can parse the LFNST index if there are transform coefficients in the region excluding the DC position and no transform coefficients in the second region.
[0461] Specifically, in order to determine whether or not the LFNST index can be parsed, the decoding device can derive a first variable indicating whether the transform coefficient, i.e., a valid coefficient, exists in an area excluding the DC position of the current block.
[0462] The first variable is a variable LfnstDcOnly that can be derived in the residual coding process. The first variable can be derived to 0 if the index of a sub-block including the last significant coefficient in a current block is 0 and the position of the last significant coefficient in the sub-block is greater than 0, and if the first variable is 0, an LFNST index can be parsed. The sub-block means a 4×4 block used as a coding unit in residual coding, and may also be named a coefficient group (CG). The sub-block index of 0 refers to the upper left 4×4 sub-block.
[0463] The first variable may be initially set to 1 and may remain at 1 or may be changed to 0 depending on whether there are valid coefficients in the region excluding the DC position.
[0464] The variable LfnstDcOnly indicates whether a non-zero coefficient exists in a non-DC component position for at least one transform block in a coding unit, and can be 0 if a non-zero coefficient exists in a non-DC component position for at least one transform block in a coding unit, and can be 1 if no non-zero coefficient exists in a non-DC component position for all transform blocks in a coding unit.
[0465] The decoding device can also check whether zeroing out has been performed for a second region by deriving a second variable indicating whether a valid coefficient exists in the second region excluding the first region at the upper left corner of the current block.
[0466] The second variable is a variable LfnstZeroOutSigCoeffFlag that can indicate that zero-out has been performed when LFNST is applied. The second variable is initially set to 1, and if a valid coefficient exists in the second region, the second variable can be changed to 0.
[0467] The variable LfnstZeroOutSigCoeffFlag may be derived to 0 if the index of the sub-block in which the last non-zero coefficient exists is greater than 0, the width and height of the transform block are both equal to or greater than 4, or the position of the last non-zero coefficient in the sub-block in which the last non-zero coefficient exists is greater than 7, and the size of the transform block is 4×4 or 8×8. A sub-block refers to a 4×4 block used as a coding unit in residual coding, and may also be named a coefficient group (CG). A sub-block index of 0 refers to the upper left 4×4 sub-block.
[0468] That is, when a non-zero coefficient is derived in an area other than the upper left corner area where LFNST transform coefficients can exist in a transform block, or when a non-zero coefficient exists outside the eighth position in the scan order for a 4x4 block or an 8x8 block, the variable LfnstZeroOutSigCoeffFlag is set to 0.
[0469] For example, when ISP is applied to a coding unit, if it is determined that a transform coefficient exists in a position where an LFNST transform coefficient does not exist for even one of all sub-partition blocks, LFNST index signaling may be omitted. That is, if zero-out is not performed in one sub-partition block and a valid coefficient exists in the second region, LFNST index signaling is not performed.
[0470] Meanwhile, the first region can be derived based on the size of the current block.
[0471] For example, if the size of the current block is 4x4 or 8x8, the first region is from the upper left corner of the current block to the 8th sample position in the scanning direction. When the current block is divided, if the size of the subpartition block is 4x4 or 8x8, the first region is from the upper left corner of the subpartition block to the 8th sample position in the scanning direction.
[0472] When the size of the current block is 4x4 or 8x8, eight pieces of data are output through the forward LFNST, and the eight transform coefficients received by the decoding device can be arranged from the upper left end of the current block to the eighth sample position in the scanning direction, as shown in (a) of Figure 11 and (a) of Figure 12.
[0473] Also, if the size of the current block is not 4x4 or 8x8, the first region is the 4x4 region at the top left corner of the current block. If the size of the current block is not 4x4 or 8x8, 16 data are output through the forward LFNST, so that the 16 transform coefficients received by the decoding device can be arranged in the 4x4 region at the top left corner of the current block as shown in (b) to (d) of Figure 11 and (b) of Figure 12.
[0474] Meanwhile, the transform coefficients that can be arranged in the first region can be arranged in a diagonal scan direction as shown in FIG.
[0475] As described above, when a current block is divided into sub-partition blocks, the decoding apparatus can parse the LFNST index if no transform coefficient exists in each of the second regions for a plurality of sub-partition blocks, and does not parse the LFNST index if a transform coefficient exists in the second region for any one of the sub-partition blocks.
[0476] As described above, LFNST can be applied to sub-partition blocks whose width and height are 4 or more, and the LFNST index for a current block, which is a coding block, can be applied to multiple sub-partition blocks.
[0477] Meanwhile, since the zero-out reflected by LFNST (including all zero-out that may accompany the application of LFNST) is also applied to the sub-partition block as it is, the first region is also applied to the sub-partition block in the same manner. That is, if the divided sub-partition block is a 4×4 block or an 8×8 block, LFNST is applied to the transform coefficients from the upper left corner of the sub-partition block to the eighth in the scanning direction, and if the sub-partition block is not a 4×4 block or an 8×8 block, LFNST may be applied to the transform coefficients of the upper left 4×4 region of the sub-partition block.
[0478] In addition, the decoding device can derive a third variable indicating whether a transform coefficient exists in an area excluding the top left 16x16 area of the current block in the residual coding step, and parse the MTS index if a transform coefficient does not exist in an area excluding the 16x16 area.
[0479] The third variable is a variable MtsZeroOutSigCoeffFlag that can indicate that zero-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 corner area where the last valid coefficient can exist due to zero-out after MTS is performed, i.e., the top left corner 16×16 area, and is initially set to 1. If a transform coefficient exists in an area other than the 16×16 area, the value can be changed from 1 to 0. If the value of the third variable is 0, the MTS index is not signaled.
[0480] The decoding apparatus may derive residual samples by applying at least one of LFNST performed based on the LFNST index or MTS performed based on the MTS index (S1930).
[0481] Next, the decoding apparatus 200 may generate a reconstructed sample based on the residual sample for the current block and the predicted sample for the current block (S1940).
[0482] 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 described in the drawings are presented for illustrative purposes only, and the technical features of the present specification are not limited to the specific names used in the following drawings.
[0483] FIG. 20 is a flow diagram illustrating the operation of a video encoding device according to one embodiment of this document.
[0484] Each step disclosed in Fig. 20 is based on a part of the contents detailed in Fig. 3 to Fig. 18. Therefore, the description of the specific contents overlapping with the contents detailed in Fig. 1 and Fig. 3 to Fig. 18 will be omitted or simplified.
[0485] The encoding apparatus 100 according to an embodiment may derive a prediction sample for a current block based on an intra prediction mode applied to the current block (S2010).
[0486] When the ISP is applied to the current block, the encoding apparatus may perform prediction for each sub-partition transform block.
[0487] The encoding device can determine whether to apply ISP coding or ISP mode to a current block, i.e., a coding block, and can determine in which direction the current block will be divided based on the determination result and derive the size and number of sub-blocks to be divided.
[0488] The encoding apparatus 100 may derive a residual sample for the current block based on the predicted sample (S2020).
[0489] The encoding apparatus 100 may derive transform coefficients for a current block by applying at least one of LFNST and MTS to the residual samples, and may arrange the transform coefficients according to a predetermined scanning order (S2030).
[0490] The primary transform may be performed via multiple transform kernels, such as MTS, where the transform kernel may be selected based on the intra prediction mode.
[0491] In addition, the encoding apparatus 100 may determine whether to perform a quadratic transform or a non-separable transform, specifically LFNST, on the transform coefficients for the current block, and may apply LFNST to the transform coefficients to derive modified transform coefficients.
[0492] Unlike a linear transform that separates the coefficients to be transformed in the vertical or horizontal direction, LFNST is a non-separable transform that applies transform without separating the coefficients in a specific direction. This type of non-separable transform is a low-frequency non-separable transform that applies transform only to the low-frequency region, not to the entire target block to be transformed.
[0493] The encoding apparatus may determine whether LFNST can be applied to the height and width of the divided sub-partition blocks when ISP is applied to the current block.
[0494] The encoding device may determine whether LFNST can be applied to the height and width of the divided sub-partition block, in which case the decoding device may parse the LFNST index when the height and width of the sub-partition block are 4 or greater.
[0495] The encoding device may encode at least one of an LFNST index indicating an LFNST kernel or an MTS index indicating an MTS kernel (S2040).
[0496] Depending on a specific condition for the LFNST index, for example, when the LFNST index value is 0, the MTS index can be encoded.
[0497] According to one example, if the current block is a luma block and the LFNST index indicates 0, the encoding apparatus may encode the MTS index.
[0498] For example, if the tree type of the current block is a dual tree, the encoding apparatus may encode the LFNST index for each of the luma block and the chroma block.
[0499] In one example, when the transform coefficients are derived, the encoding device can derive the width and height for the upper left region where the last significant coefficient can be located due to zero-out in the current block, derive the position of the last significant coefficient based on the width and height for the upper left region, and binarize the last significant coefficient position information.
[0500] According to one example, the width and height for the top left region can be derived prior to signaling of the MTS index.
[0501] Alternatively, according to an example, if the tree type of the current block is a single tree type, the encoding apparatus may derive all transform coefficients for the luma block and the chroma block of the current block and then encode the LFNST index at the coding unit level.
[0502] When the LFNST index is encoded at the coding unit level after all transform coefficients that are not at the transform block level or residual coding level are derived, an LFNST index that reflects the positions of all transform coefficients for the luma block and chroma block, which is not transform coefficient information for either the luma block or the chroma block, and zero-out information involved in the transform process, can be encoded.
[0503] In addition, when the tree type of the current block is a dual tree type and the encoding apparatus is coding a chroma component, the encoding apparatus may derive all transform coefficients for the Cb component and the Cr component of the chroma block and then encode the LFNST index at the coding unit level.
[0504] When the LFNST index is encoded at the coding unit level after all transform coefficients that are not at the transform block level or the residual coding level are derived, an LFNST index that reflects the complete transform coefficient positions for the Cb and Cr components and zero-out information involved in the transform process that is not transform coefficient information for any one of the Cb and Cr components of the chroma block can be encoded.
[0505] Also, when the current block is divided into a plurality of sub-partition blocks, the encoding apparatus may derive all transform coefficients for the plurality of sub-partition blocks and then encode the LFNST index at a coding unit level.
[0506] As described above, when the LFNST index is parsed at the coding unit level after all transform coefficients that are not at the transform block level or residual coding level are derived, an LFNST index reflecting the positions of complete transform coefficients for all sub-partition blocks and zero-out information involved in the transform process, rather than transform coefficient information for some or individual sub-partition blocks, can be encoded.
[0507] Meanwhile, when the current block is divided into the plurality of sub-partition blocks, the encoding apparatus may encode the LFNST index regardless of whether a transform coefficient exists in an area excluding a DC position of each of the plurality of sub-partition blocks. That is, when ISP is applied to the current block, if it is permitted that the last significant coefficient is located only at a DC position for all the sub-partition blocks, signaling of the LFNST index may be permitted.
[0508] In the process of deriving a transform coefficient, the encoding device may derive a first variable indicating whether a transform coefficient exists in an area excluding a DC position of the current block and a second variable indicating whether a transform coefficient exists in a second area excluding a first area at the upper left corner of the current block or a sub-partition block divided from the current block.
[0509] The encoding apparatus may encode the LFNST index when the transform coefficients are present in the region excluding the DC position and the transform coefficients are not present in the second region.
[0510] Specifically, the first variable is a variable LfnstDcOnly, which may be derived to 0 if the index of the sub-block containing the last significant coefficient in the current block is 0 and the position of the last significant coefficient in the sub-block is greater than 0; if the first variable is 0, an LFNST index may be encoded.
[0511] The first variable may be initially set to 1 and may remain at 1 or may be changed to 0 depending on whether there are valid coefficients in the region excluding the DC position.
[0512] The variable LfnstDcOnly indicates whether a non-zero coefficient exists in a non-DC component position for at least one transform block in a coding unit, and can be 0 if a non-zero coefficient exists in a non-DC component position for at least one transform block in a coding unit, and can be 1 if no non-zero coefficient exists in a non-DC component position for all transform blocks in a coding unit.
[0513] The encoding apparatus may also zero out a second region of the current block in which no modified transform coefficients exist after LFNST is performed, and derive a second variable indicating whether the transform coefficients exist in the second region.
[0514] As shown in Figures 11 and 12, the remaining area of the current block where no modified transform coefficients exist can be processed to be all 0. This zeroing out reduces the amount of calculation required to perform the entire transform process, and the amount of calculation required for the entire transform process can be reduced, thereby reducing power consumption required to perform the transform. In addition, the latency involved in the transform process can be reduced, thereby increasing video coding efficiency.
[0515] The second variable is a variable LfnstZeroOutSigCoeffFlag that can indicate that zero-out has been performed when LFNST is applied. The second variable is initially set to 1, and if a valid coefficient exists in the second region, the second variable can be changed to 0.
[0516] The variable LfnstZeroOutSigCoeffFlag may be derived to 0 if the index of the sub-block in which the last non-zero coefficient resides is greater than 0, the width and height of the transform block are both greater than or equal to 4, or the position of the last non-zero coefficient within the sub-block in which the last non-zero coefficient resides is greater than 7, or the size of the transform block is 4x4 or 8x8.
[0517] That is, when a non-zero coefficient is derived in an area other than the upper left corner area where LFNST transform coefficients can exist in a transform block, or when a non-zero coefficient exists outside the eighth position in the scan order for a 4x4 block or an 8x8 block, the variable LfnstZeroOutSigCoeffFlag is set to 0.
[0518] The description of the first region and zero-out when the ISP is applied is the same as the description of the decoding method, so that the duplicated description will be omitted.
[0519] As an example, when applying MTS to a primary transform of a current block, the encoding apparatus may perform zero-out by filling an area excluding a 16×16 area at the top left corner of the current block or a sub-partition block with zeros, and may encode an MTS index by a third variable indicating whether a transform coefficient exists in the zero-out area.
[0520] The third variable is a variable MtsZeroOutSigCoeffFlag that can indicate that zero-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 corner area where the last valid coefficient can exist due to zero-out after MTS is performed, i.e., the top left corner 16×16 area, and is initially set to 1. If a transform coefficient exists in an area other than the 16×16 area, the value can be changed from 1 to 0. If the value of the third variable is 0, the MTS index is not encoded and signaled.
[0521] The encoding apparatus may configure and output video information such that at least one of an LFNST index and an MTS index is signaled at a coding unit level, and the MTS index is signaled immediately after the signaling of the LFNST index (S2050).
[0522] In addition, the encoding device may perform quantization based on the transform coefficients for the current block or the modified transform coefficients to derive quantized transform coefficients, and encode and output image information including information about the quantized transform coefficients.
[0523] The encoding apparatus may generate residual information including information on the quantized transform coefficients. The residual information may include the above-mentioned transform-related information / syntax elements. The encoding apparatus may encode image / video information including the residual information and output the encoded image / video information in the form of a bitstream.
[0524] More specifically, the encoding apparatus may generate information about the quantized transform coefficients and encode the generated information about the quantized transform coefficients.
[0525] In this document, at least one of quantization / dequantization and / or transform / inverse transform may be omitted. If the quantization / dequantization is omitted, the quantized transform coefficients may be referred to as transform coefficients. If the transform / inverse transform is omitted, the transform coefficients may also be referred to as coefficients or residual coefficients, or may still be referred to as transform coefficients for uniformity of representation.
[0526] Also, in this document, the quantized transform coefficients and the transform coefficients may be referred to as transform coefficients and scaled transform coefficients, respectively. In this case, the residual information may include information on the transform coefficients, and the information on the transform coefficients may be signaled via a residual coding syntax. Transform coefficients may be derived based on the residual information (or the information on the transform coefficients), and scaled transform coefficients may be derived through an inverse transform (scaling) on the transform coefficients. Residual samples may be derived based on an inverse transform (transform) on the scaled transform coefficients. This may be similarly applied / expressed in other parts of this document.
[0527] In the above embodiments, the method is described based on the flowchart as 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 above. Also, those skilled in the art can understand that the steps shown in the flowchart are not exclusive, and other steps may be included, or one or more steps of the flowchart may be deleted without affecting the scope of this document.
[0528] The method according to the present document described above may be embodied in the form of software, and the encoding device and / or decoding device according to the present document may be included in an image processing device such as a TV, a computer, a smartphone, a set-top box, a display device, etc.
[0529] In this document, when the embodiments are implemented in software, the methods described above may be implemented with modules (processes, functions, etc.) performing the functions described above. The modules may be stored in a 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, memory cards, storage media, and / or other storage devices. That is, the embodiments described in this document may be implemented and executed on a processor, microprocessor, controller, or chip. For example, the functional units illustrated in each drawing may be implemented and executed on a computer, processor, microprocessor, controller, or chip.
[0530] 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 interactive device, a real-time communication device such as video communication, a mobile streaming device, a storage medium, a camcorder, a customized video (VoD) service providing device, an over-the-top video (OTT) device, an internet streaming service providing device, a three-dimensional (3D) video device, an image telephone video device, and a medical video device, and may be used to process a video signal or a data signal. For example, an over-the-top video (OTT) device may include a game console, a Blu-ray player, an internet access TV, a home theater system, a smartphone, a tablet PC, a digital video recorder (DVR), and the like.
[0531] In addition, the processing method to which this document is applied may be produced in the form of a program executed by a computer and may be stored in a computer-readable recording medium. Multimedia data having a data structure according to this document may also be stored in a computer-readable recording medium. The computer-readable recording medium includes all kinds of storage devices and distributed storage devices in which computer-readable data is stored. The computer-readable recording medium may include, for example, a Blu-ray Disc (BD), a Universal Serial Bus (USB), a ROM, a PROM, an EPROM, an EEPROM, a RAM, a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device. In addition, the computer-readable recording medium may include a medium embodied in the form of a carrier wave (e.g., transmission via the Internet). In addition, a bit stream generated by the encoding method may be stored in a computer-readable recording medium or transmitted via a wired or wireless communication network. In addition, an embodiment of this document may be embodied in a computer program product by a program code, and the program code may be executed by a computer according to an embodiment of this document. The program code may be stored on a computer-readable carrier.
[0532] FIG. 21 illustrates a schematic diagram of an example video / image coding system to which this document may be applied.
[0533] 21, the 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.
[0534] The source device may include a video source, an encoding device, and a sending unit. The receiving device may include a receiving unit, a decoding device, and a renderer. The encoding device may be called a video / image encoding device, and the decoding device may be called a video / image decoding device. The transmitter may be included in the encoding device. The receiver may be included in the decoding device. The renderer may also include a display unit, which may be a separate device or an external component.
[0535] A video source may acquire video / images through a video / image capture, synthesis, or generation process, etc. A video source may include a video / image capture device and / or a video / image generation device. A video / image capture device may include, for example, one or more cameras, a video / image archive containing previously captured videos / images, etc. A video / image generation device may include, for example, a computer, a tablet, a smartphone, etc., and may (electronically) generate video / images. For example, a virtual video / image may be generated via a computer, etc., in which case the video / image capture process may be replaced by a process in which related data is generated.
[0536] An encoding device can encode an input video / image. The encoding device can perform a series of steps such as prediction, transformation, quantization, etc. for compression and coding efficiency. The encoded data (encoded video / image information) can be output in the form of a bitstream.
[0537] The transmitting unit may transmit the encoded video / image information or data output in the form of a bitstream to a receiving unit of a receiving device via a digital storage medium or a network in the form of a file or streaming. The digital storage medium may include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. The transmitting unit may include elements for generating a media file through a predetermined file format and may include elements for transmission via a broadcasting / communication network. The receiving unit may receive / extract the bitstream and transmit it to a decoding device.
[0538] The decoding device can decode the video / image by performing a series of steps such as inverse quantization, inverse transformation, prediction, etc., which correspond to the operations of the encoding device.
[0539] The renderer can render the decoded video / images, and the rendered video / images can be displayed via a display unit.
[0540] FIG. 22 exemplarily shows a structural diagram of a content streaming system to which this document applies.
[0541] Furthermore, the content streaming system to which this document is applied can broadly include an encoding server, a streaming server, a web server, a media storage, a user device, and a multimedia input device.
[0542] 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 may be omitted. The bitstream may be generated by an encoding method or a bitstream generation method to which this document is applied, and the streaming server may temporarily store the bitstream during the process of transmitting or receiving the bitstream.
[0543] The streaming server transmits multimedia data to a user device based on a user's request via a web server, and the web server acts as a medium 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, and the streaming server transmits the multimedia data to the user. In this case, the content streaming system may include a separate control server, and in this case, the control server controls commands / responses between devices in the content streaming system.
[0544] The streaming server may receive the content from a media storage and / or an encoding server. For example, when the content is received from the encoding server, the content may be received in real time. In this case, the streaming server may store the bitstream for a certain period of time in order to provide a smooth streaming service.
[0545] Examples of the user devices include mobile phones, smart phones, 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 glass, head mounted displays (HMDs)), digital TVs, desktop computers, digital signage, etc. Each server in the content streaming system can be operated as a distributed server, and in this case, data received by each server can be processed in a distributed manner.
[0546] 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 as an apparatus, and the technical features of the apparatus claims herein may be combined and embodied as a method. In addition, the technical features of the method claims herein and the technical features of the apparatus claims herein may be combined and embodied as 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 as a method.
Claims
1. 1. A video decoding method performed by a decoding device, comprising: obtaining residual information at the residual coding level; deriving transform coefficients for a current block based on the residual information; applying at least one of a low frequency non-separable transform (LFNST) kernel derived from an LFNST index or a primary transform kernel derived from a multiple transform selection (MTS) index to the transform coefficients to derive residual samples; generating a reconstructed picture based on the residual samples; The LFNST index and the MTS index are signaled at a coding unit level, An MTS index is signaled immediately after the LFNST index is signaled; performing residual coding on a luma block and a chroma block of the current block based on the tree type of the current block being a single tree type, and then parsing the LFNST index; The image decoding method according to claim 1, wherein the LFNST index is parsed after performing residual coding on a Cb component and a Cr component of the chroma block based on the tree type of the current block being a dual tree chroma type.
2. The video decoding method of claim 1 , wherein the LFNST index is parsed after residual coding is performed on the sub-partition blocks based on division of the current block into a plurality of sub-partition blocks.
3. 3. The video decoding method of claim 2, wherein the LFNST index is parsed based on the division of the current block into the plurality of sub-partition blocks, regardless of whether the transform coefficients are present in an area excluding a DC position of each of the plurality of sub-partition blocks.
4. The step of performing residual coding comprises: deriving a first variable related to whether the transform coefficient is present in a region of the current block excluding a DC position; deriving a second variable related to whether the transform coefficient is present in a second region excluding a first region at a top left corner of the current block or a sub-partition block divided from the current block; The video decoding method of claim 1 , wherein the LFNST index is parsed based on the presence of the transform coefficients in a region excluding the DC position and the absence of the transform coefficients in the second region.
5. The step of performing the residual coding includes a step of deriving a third variable related to whether the transform coefficient is present in an area excluding a top left 16×16 area of the current block; The video decoding method of claim 1 , wherein the MTS index is parsed based on the absence of the transform coefficients in an area other than the 16×16 area.
6. 1. A video encoding method performed by an encoding device, comprising: deriving a predicted sample for the current block; deriving a residual sample for the current block based on the predicted sample; performing a transform coefficient derivation operation to derive transform coefficients for the current block by applying at least one of a low frequency non-separable transform (LFNST) kernel or a linear transform kernel to the residual samples; encoding at least one of an LFNST index associated with the LFNST kernel or a multiple transform selection (MTS) index associated with the primary transform kernel; and configuring and outputting video information such that the LFNST index and the MTS index are signaled at a coding unit level, and the MTS index is signaled immediately after the LFNST index is signaled; based on the tree type of the current block being a single tree type, the transform coefficient derivation operation for the luma block and the chroma block of the current block is performed, and then the LFNST index is encoded; The image encoding method according to claim 1, wherein the LFNST index is encoded after the transform coefficient derivation operation is performed on a Cb component and a Cr component of the chroma block based on the tree type of the current block being a dual tree chroma type.
7. The video encoding method of claim 6 , wherein the LFNST index is encoded after the transform coefficient derivation operation is performed on the sub-partition blocks based on dividing the current block into a plurality of sub-partition blocks.
8. The video encoding method of claim 7, wherein the LFNST index is encoded based on the division of the current block into the plurality of sub-partition blocks, regardless of whether the transform coefficients are present in an area excluding a DC position of each of the plurality of sub-partition blocks.
9. The step of performing a transform coefficient derivation operation comprises: deriving a first variable related to whether the transform coefficient is present in a region of the current block excluding a DC position; deriving a second variable related to whether the transform coefficient is present in a second region excluding a first region at a top left corner of the current block or a sub-partition block divided from the current block; The video encoding method of claim 6 , wherein the LFNST index is encoded based on the presence of the transform coefficients in a region excluding the DC position and the absence of the transform coefficients in the second region.
10. The step of performing the transform coefficient derivation operation includes a step of deriving a third variable related to whether the transform coefficient is present in an area excluding a top left 16×16 area of the current block; The video encoding method of claim 6 , wherein the MTS index is encoded based on the absence of the transform coefficients in an area other than the 16×16 area.
11. 1. A method for transmitting data for video information, comprising: obtaining a bitstream of the video information, the bitstream being generated based on: deriving predicted samples for a current block; deriving residual samples for the current block based on the predicted samples; performing a transform coefficient derivation operation of deriving transform coefficients for the current block by applying at least one of a Low Frequency Non-Separable Transform (LFNST) kernel or a linear transform kernel to the residual samples; encoding at least one of an LFNST index associated with the LFNST kernel or a Multiple Transform Selection (MTS) index associated with the linear transform kernel; and configuring and outputting the video information such that the LFNST index and the MTS index are signaled at a coding unit level, and the MTS index is signaled immediately after the LFNST index is signaled; transmitting the data including the bitstream; based on the tree type of the current block being a single tree type, the transform coefficient derivation operation for the luma block and the chroma block of the current block is performed, and then the LFNST index is encoded; The LFNST index is encoded after the transform coefficient derivation operation is performed on a Cb component and a Cr component of the chroma block based on a tree type of the current block being a dual tree chroma type.